From f2ae34d60b11e5b94c5116c249271cdc82ce3a38 Mon Sep 17 00:00:00 2001 From: jimmythomson Date: Mon, 9 Dec 2024 20:12:39 +0000 Subject: [PATCH] deploy: b8bf847ab4ee12d97b7c6fdbc9bb058edd09f5f1 --- assets/navigation.js | 2 +- classes/CommercetoolsApi.html | 326 +++++++++--------- classes/CommercetoolsAuth.html | 24 +- classes/CommercetoolsError.html | 16 +- classes/CommercetoolsGrant.html | 22 +- enums/GrantType.html | 8 +- enums/Region.html | 4 +- functions/buildUserAgent.html | 2 +- functions/calculateDelay.html | 2 +- functions/convertAxiosError.html | 2 +- functions/convertAxiosResponse.html | 2 +- functions/createAxiosInstance.html | 2 +- functions/ensureNonEmptyString.html | 2 +- functions/extractAxiosHeaders.html | 2 +- functions/formatAsKey.html | 2 +- functions/getAttributeValue.html | 2 +- functions/maskSensitiveData.html | 2 +- functions/maskSensitiveHeaders.html | 2 +- functions/maskSensitiveInput.html | 2 +- functions/retryOnConflict.html | 2 +- interfaces/AnonymousGrantOptions.html | 6 +- .../CartSetCustomShippingMethodAction.html | 4 +- interfaces/CommercetoolsApiConfig.html | 10 +- interfaces/CommercetoolsAuthConfig.html | 10 +- interfaces/CommercetoolsBaseConfig.html | 10 +- interfaces/CommercetoolsHooks.html | 6 +- interfaces/CommercetoolsRequest.html | 4 +- interfaces/CommercetoolsRequestResponse.html | 4 +- .../CommercetoolsRequestResponseStats.html | 4 +- interfaces/CommercetoolsRetryConfig.html | 8 +- interfaces/CommonRequestOptions.html | 8 +- .../CommonStoreEnabledRequestOptions.html | 10 +- interfaces/EnsureNonEmptyStringParams.html | 6 +- interfaces/FetchOptions.html | 18 +- interfaces/GetAttributeValueParams.html | 6 +- interfaces/LoginOptions.html | 10 +- interfaces/ProductDraft.html | 4 +- interfaces/RegionEndpoints.html | 6 +- interfaces/RequestExecutor.html | 2 +- interfaces/RetryOnConflictParams.html | 10 +- interfaces/TaxCategoryResourceIdentifier.html | 7 + modules.html | 1 + variables/DEFAULT_MASKING_STRING.html | 2 +- variables/MAX_ITEMS_PER_QUERY.html | 2 +- variables/SENSITIVE_HEADER_NAMES.html | 2 +- variables/SENSITIVE_PROPERTY_NAMES.html | 2 +- 46 files changed, 299 insertions(+), 291 deletions(-) create mode 100644 interfaces/TaxCategoryResourceIdentifier.html diff --git a/assets/navigation.js b/assets/navigation.js index 250d1e9b7..19e4fe998 100644 --- a/assets/navigation.js +++ b/assets/navigation.js @@ -1 +1 @@ -window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA62ca3PjNBSG/0s+F8oWdoF+C6nbzey2Te10h4VhOqp9kojakpHkUsPw35nYufgiHSuSv/a8ep8jWZZ1S3//d6LgTU0uJzeCMLUsc5icTXKiNpPLCbAik+eHwLcblaWTs8kLZcnk8qf/zg5lQ1hTzroF67+aS814loGIQXGeymlOj+XjlEgJ8ryraHu9uzC7FWozZFeojbVfIAQXA4aVxtqxatUBx0qDOU6TRICURxvKFIgViUGe72Lt4hfvP5zVrMnlRMnkGyq/gTcFgpF00je+EmSlMPdK4IhgnJUZL+pa3ueKcmaoiU7ZgzatpQQV8ULEoDc8xh1zV0rQ50IZ7PdRT/NFSigLWJF9IWkxgGpr3cC/EAkhSHO7NQVuiBkR+v60DbhbTpPkM2UwV5BNY9UaijqMntIdOtsQtoa920NBmKKqHOBjhdxTuaIy5gUzN+1e4I9YkDUkDwWIMgSZcyb1XQUv4pGGcUQ6RN3NT6jbmHWKQM0KqXgWbWieU7a+BbXhyUBPQkuNkAyIICM0tc2iJXfFK1hzURpgddDPGus+DYUfxLobmeR++Mc8IYYvU1viiAGmFgJiKilnt5yB4Xn1ZI64DWEMUj2jjnkZ2z4sk9oLHsIKBDDD57Yr8kTV3+15AkzRFQWBM7tqR3hnAj/jbEXXerJWik3zetN5a/eD1tp+O/WxtT9qre0/cv6in/z2ZdamIfxVgDQMdxrhqcb4C4MUcAVFiiiLVtKVOgGpRGn7pBviIQBnu7SwlY5OOGwcKS4gYOQ5hcQaYi6EAqtv/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Wdb4orhwuTOhY8p1un3YQ9762cy4sSoMkM78yHuBliSN/QqfCPuDbBsQLSEcxILLozrwGPY2T40PaFdzNkYku2Zkvnr0ZY4YgRhkpjXyY24I8C0LnRfEJ6wEhxzCbj1wsfIlsIN8htnYOxQ+6D7z27q8aJ71KfKfPc7m2a8Q/nu5x/fvb9wuD1koGk07sT2eT/GNSvd6fX5KEbtK9xpjdMGPawncGe1NoP1NI3Eg9fZpELBiNY7AwvwOLzqk5fGRUpU9Qum5m21GtdXeNEMCE/fMoekcztjZ32IuLtfBdfTx8/Lp9tp9Gl+d/MULcP53c2R9LrdDXtOt5f6tMo2+fuL5qs7/fVpvgxuo6dFED49PAbhV52vRoaYRsFdNF/OvwRPH4PpVRA+3U1vg0jnq1daWS/C+0UQLr/amLe1iP1zQdPkUYKYrlsneauCVf1cnrcVbasPPzSs4l2f3W4LkVJn1VZgVpy9glDTN8q7/yKh4dYVWRr25w96T/3koW1b7cNV6jmTirTmCQ3XvgwxBc21UZ2rTofZvilB4rpqH4EkIKTWtS9DTFdcZERN5SfQPvBGGDFZd69o6qx6IsQwI/IlAiapoq/QPt87GvZEtoZI4+l0trZzlhfaF7CvQixFe1dS59eR9Mz++B8QLBFNvEUAAA==" \ No newline at end of file +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA62ca3PjNBSG/0s+F8oWdoF+C6nbzey2Te10h4VhOqp9kojakpHkUsPw35nYufgiHSuSv/a8ep8jWZZ1S3//d6LgTU0uJzeCMLUsc5icTXKiNpPLCbAik+eHwLcblaWTs8kLZcnk8qf/zg5lQ1hTzroF67+aS814loGIQXGeymlOj+XjlEgJ8ryraHu9uzC7FWozZFeojbVfIAQXA4aVxtqxatUBx0qDOU6TRICURxvKFIgViUGe72Lt4hfvP5zVrMnlRMnkGyq/gTcFgpF00je+EmSlMPdK4IhgnJUZL+pa3ueKcmaoiU7ZgzatpQQV8ULEoDc8xh1zV0rQ50IZ7PdRT/NFSigLWJF9IWkxgGpr3cC/EAk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E/1d75TEFGAAA=" \ No newline at end of file diff --git a/classes/CommercetoolsApi.html b/classes/CommercetoolsApi.html index 30c319050..b8aacf205 100644 --- a/classes/CommercetoolsApi.html +++ b/classes/CommercetoolsApi.html @@ -1,6 +1,6 @@ CommercetoolsApi | @gradientedge/commercetools-utils

A collection of convenience methods for interacting with the commercetools API.

-

Constructors

Constructors

Properties

Constructors

Properties

This is the instance of the {@see CommercetoolsAuth} class that +

Constructors

Properties

This is the instance of the {@see CommercetoolsAuth} class that this class uses internally. It's exposed publicly so that it can be used by consumer's of this class in order to access authorization API related functionality.

-

The configuration passed in to the constructor.

-
endpoints: RegionEndpoints

The Auth and API endpoints driven by the user's setting of CommercetoolsApiConfig.region +

The configuration passed in to the constructor.

+
endpoints: RegionEndpoints

The Auth and API endpoints driven by the user's setting of CommercetoolsApiConfig.region https://docs.commercetools.com/api/general-concepts#regions

-
requestExecutor: RequestExecutor<any>

The request executor that's responsible for making the request to commercetools

-

Methods

  • Applies the store key to a given path

    -

    Parameters

    • path: string
    • storeKey: undefined | null | string

    Returns string

requestExecutor: RequestExecutor<any>

The request executor that's responsible for making the request to commercetools

+

Methods

  • Applies the store key to a given path

    +

    Parameters

    • path: string
    • storeKey: undefined | null | string

    Returns string

  • Delete a product by key: +

Returns Promise<Product>

  • Delete a product selection by key +

Returns Promise<Product>

\ No newline at end of file +

Parameters

Returns void

\ No newline at end of file diff --git a/classes/CommercetoolsAuth.html b/classes/CommercetoolsAuth.html index 33f8993e9..7409d4412 100644 --- a/classes/CommercetoolsAuth.html +++ b/classes/CommercetoolsAuth.html @@ -8,7 +8,7 @@ Azure Function App, you can safely instantiate this class outside of your function handler and have it exist for as long the serverless environment allows.

-

Constructors

Constructors

Properties

api config grant? @@ -23,18 +23,18 @@ that we have some clientScopes defined. We also set a member called {@see api} to an instance of {@see CommercetoolsAuthApi}, which handles the lower level commercetools request.

-

Parameters

Returns CommercetoolsAuth

Properties

api: CommercetoolsAuthApi

The {@see CommercetoolsAuthApi} handles the actual sending of the request +

Parameters

Returns CommercetoolsAuth

Properties

api: CommercetoolsAuthApi

The {@see CommercetoolsAuthApi} handles the actual sending of the request and any lower level outgoing or incoming transformation of data.

-
config: Config

The internal configuration. This is a combination of the CommercetoolsAuthConfig +

config: Config

The internal configuration. This is a combination of the CommercetoolsAuthConfig type passed in to the constructor and the default values specified in the configDefaults object.

-

This holds the client grant, once one has been generated.

-
grantPromise: null | Promise<any> = null

Whenever we either refresh the client grant, or request a new one, +

This holds the client grant, once one has been generated.

+
grantPromise: null | Promise<any> = null

Whenever we either refresh the client grant, or request a new one, we don't want to allow any other requests to be initiated until that request has completed. This promise is used to determine whether incoming requests need to wait on an existing client grant request to complete before they can start to be processed.

-

Methods

Methods

  • Get a grant for an anonymous customer.

    If you pass a value to the AnonymousGrantOptions.anonymousId options parameter property then this must not exist within the commercetools system for your project key, otherwise an error will be thrown. Typically @@ -43,11 +43,11 @@

    Example code to generate an anonymous customer grant:

    import { Region, CommercetoolsAuth } from '@gradientedge/commercetools-utils'

    async function example() {
    const auth = new CommercetoolsAuth({
    projectKey: 'your-project-key',
    clientId: 'your-client-id',
    clientSecret: 'your-client-secret',
    region: Region.EUROPE_GCP,
    clientScopes: [
    'view_published_products',
    'view_categories',
    'manage_customers',
    'create_anonymous_token'
    ]
    })

    const grant = await auth.getAnonymousGrant()

    console.log('Anonymous customer grant:', grant)
    }

    example()
    -

    Parameters

    Returns Promise<CommercetoolsGrant>

  • Get a client grant

    If we don't already have a client grant stored locally, then we make a call to commercetools to generate one. Once we have a grant, we store it locally and then return that cached version up until it needs to be renewed.

    -

    Returns Promise<CommercetoolsGrant>

  • Revoke the given access/refresh token

    Remember that you can only revoke tokens that were generated using this client access token.

    -

    Parameters

    • options: RevokeTokenOptions

    Returns Promise<void>

\ No newline at end of file +

Parameters

  • options: RevokeTokenOptions

Returns Promise<void>

\ No newline at end of file diff --git a/classes/CommercetoolsError.html b/classes/CommercetoolsError.html index c46685cd8..f8fb66c2e 100644 --- a/classes/CommercetoolsError.html +++ b/classes/CommercetoolsError.html @@ -1,5 +1,5 @@ CommercetoolsError | @gradientedge/commercetools-utils

The error class thrown by any of the utility classes.

-

Hierarchy

  • Error
    • CommercetoolsError

Constructors

Hierarchy

  • Error
    • CommercetoolsError

Constructors

Properties

cause?: unknown
data?: any

The data passed in to the error class. This could be anything, +

Constructors

Properties

cause?: unknown
data?: any

The data passed in to the error class. This could be anything, but is most likely to be the response from a commercetools request.

-
isCommercetoolsError: true = true

Convenience mechanism for identifying that the error that's +

isCommercetoolsError: true = true

Convenience mechanism for identifying that the error that's just been caught is a CommercetoolsError.

-
message: string
name: string
stack?: string
status: undefined | number

If available, this is the status code of the request received +

message: string
name: string
stack?: string
status: undefined | number

If available, this is the status code of the request received back from commercetools: https://docs.commercetools.com/api/errors

-
prepareStackTrace?: ((err, stackTraces) => any)

Optional override for formatting stack traces

+
prepareStackTrace?: ((err, stackTraces) => any)

Optional override for formatting stack traces

Type declaration

    • (err, stackTraces): any
    • Parameters

      • err: Error
      • stackTraces: CallSite[]

      Returns any

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    +
stackTraceLimit: number

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

  • Parse the JSON string back in to an object for easier viewing

    -

    Parameters

    • config: undefined | InternalAxiosRequestConfig<any>

    Returns any

\ No newline at end of file +

Parameters

Returns CommercetoolsError

\ No newline at end of file diff --git a/classes/CommercetoolsGrant.html b/classes/CommercetoolsGrant.html index 36fa5bb15..e4616885e 100644 --- a/classes/CommercetoolsGrant.html +++ b/classes/CommercetoolsGrant.html @@ -1,7 +1,7 @@ CommercetoolsGrant | @gradientedge/commercetools-utils

Holds the details of the grant returned from commercetools in response to an authorisation API related request: https://docs.commercetools.com/api/authorization

-

Constructors

Constructors

Properties

accessToken anonymousId? customerId? @@ -12,30 +12,30 @@

Methods

Constructors

Properties

accessToken: string = ''

The access token string needed when making requests to commercetools. If this +

Parameters

  • data: CommercetoolsGrantResponse

Returns CommercetoolsGrant

Properties

accessToken: string = ''

The access token string needed when making requests to commercetools. If this was generated by a customer logging in, then this is used by commercetools to identify the customer.

-
anonymousId?: string

When this grant came from a call to {@see CommercetoolsAuth.getAnonymousGrant} +

anonymousId?: string

When this grant came from a call to {@see CommercetoolsAuth.getAnonymousGrant} or {@see CommercetoolsApi.getAnonymousGrant} then the value will be populated with the id of the anonymous customer to which this grant relates.

-
customerId?: string

When this grant is generated from a call to {@see CommercetoolsAuth.login} +

customerId?: string

When this grant is generated from a call to {@see CommercetoolsAuth.login} or {@see CommercetoolsApi.login} then this value will be populated with the id of the customer to which this grant relates.

-
expiresAt: Date = ...

This is the expiry date/time of the access token. This is calculated based +

expiresAt: Date = ...

This is the expiry date/time of the access token. This is calculated based on the expiredIn property, and as such may be very slightly after the internal commercetools expiry date (due to the time involved to receive and process the response.

-
expiresIn: number = 0

The duration of the access token in seconds (typically 48 hours)

-
refreshToken?: string

The refresh token is required for refreshing an existing grant. A refresh token +

expiresIn: number = 0

The duration of the access token in seconds (typically 48 hours)

+
refreshToken?: string

The refresh token is required for refreshing an existing grant. A refresh token is only issued for customer grants (either logged in or anonymous), an not for client grants.

-
scopes: string[] = []

List of permission scopes. This will also include the anonymous_id when +

scopes: string[] = []

List of permission scopes. This will also include the anonymous_id when generating an anonymous customer token, or the customer_id when logging in as an existing customer.

-

Methods

Methods

  • Calculates whether the grant is due to expire within a given number of seconds. This is useful when deciding if the expiry date/time is close enough to warrant pro-active renewal, rather than waiting for expiry.

    -

    Parameters

    • refreshIfWithinSecs: number

    Returns boolean

  • Given a scope string (as returned from commercetools), this method +

    Parameters

    • refreshIfWithinSecs: number

    Returns boolean

  • Given a scope string (as returned from commercetools), this method extracts the value of the associated with the given key. Used for retrieving the anonymous id and customer id from the scope string.

    -

    Parameters

    • key: string
    • scope: string

    Returns undefined | string

\ No newline at end of file +

Parameters

Returns undefined | string

\ No newline at end of file diff --git a/enums/GrantType.html b/enums/GrantType.html index c73d10dd0..30dea3aa7 100644 --- a/enums/GrantType.html +++ b/enums/GrantType.html @@ -1,14 +1,14 @@ GrantType | @gradientedge/commercetools-utils

Authentication grant types. These are used when populating the 'grant_type' parameter.

-

Enumeration Members

Enumeration Members

CLIENT_CREDENTIALS: "client_credentials"
PASSWORD: "password"

Used when attempting to login a customer: +

PASSWORD: "password"

Used when attempting to login a customer: https://docs.commercetools.com/api/authorization#password-flow

-
REFRESH_TOKEN: "refresh_token"

Used when refreshing any existing access token (whether client or customer): +

REFRESH_TOKEN: "refresh_token"

Used when refreshing any existing access token (whether client or customer): https://docs.commercetools.com/api/authorization#refresh-token-flow

-
\ No newline at end of file +
\ No newline at end of file diff --git a/enums/Region.html b/enums/Region.html index d52747d70..7dbb71b93 100644 --- a/enums/Region.html +++ b/enums/Region.html @@ -1,8 +1,8 @@ Region | @gradientedge/commercetools-utils

The commercetools region that your API client id/secret relate to. This is used to determine the authentication endpoint.

-

Enumeration Members

Enumeration Members

AUSTRALIA_GCP: "australia_gcp"
EUROPE_AWS: "europe_aws"
EUROPE_GCP: "europe_gcp"
NORTH_AMERICA_AWS: "north_america_aws"
NORTH_AMERICA_GCP: "north_america_gcp"
\ No newline at end of file +

Enumeration Members

AUSTRALIA_GCP: "australia_gcp"
EUROPE_AWS: "europe_aws"
EUROPE_GCP: "europe_gcp"
NORTH_AMERICA_AWS: "north_america_aws"
NORTH_AMERICA_GCP: "north_america_gcp"
\ No newline at end of file diff --git a/functions/buildUserAgent.html b/functions/buildUserAgent.html index 09723abbf..91789c228 100644 --- a/functions/buildUserAgent.html +++ b/functions/buildUserAgent.html @@ -4,4 +4,4 @@ {@see CommercetoolsApiConfig.systemIdentifier} and should be a string that uniquely identifies the application where this package is being used.

-

Parameters

Returns string

\ No newline at end of file +

Parameters

Returns string

\ No newline at end of file diff --git a/functions/calculateDelay.html b/functions/calculateDelay.html index 747086873..20231de7d 100644 --- a/functions/calculateDelay.html +++ b/functions/calculateDelay.html @@ -1,3 +1,3 @@ calculateDelay | @gradientedge/commercetools-utils
  • Calculate how long to delay before running the request. For each retry attempt, we increase the time that we delay for.

    -

    Parameters

    Returns number

\ No newline at end of file +

Parameters

Returns number

\ No newline at end of file diff --git a/functions/convertAxiosError.html b/functions/convertAxiosError.html index df225f320..8d77f290c 100644 --- a/functions/convertAxiosError.html +++ b/functions/convertAxiosError.html @@ -1 +1 @@ -convertAxiosError | @gradientedge/commercetools-utils
\ No newline at end of file +convertAxiosError | @gradientedge/commercetools-utils
\ No newline at end of file diff --git a/functions/convertAxiosResponse.html b/functions/convertAxiosResponse.html index 237fd165c..1014c06d2 100644 --- a/functions/convertAxiosResponse.html +++ b/functions/convertAxiosResponse.html @@ -1 +1 @@ -convertAxiosResponse | @gradientedge/commercetools-utils
\ No newline at end of file +convertAxiosResponse | @gradientedge/commercetools-utils
\ No newline at end of file diff --git a/functions/createAxiosInstance.html b/functions/createAxiosInstance.html index 55efb2a7b..743a5ec7c 100644 --- a/functions/createAxiosInstance.html +++ b/functions/createAxiosInstance.html @@ -1,3 +1,3 @@ createAxiosInstance | @gradientedge/commercetools-utils
  • Define the base axios instance that forms the foundation of all axios calls made by the {@see request} method.

    -

    Parameters

    • options: {
          httpsAgent?: Agent;
      }
      • Optional httpsAgent?: Agent

    Returns AxiosInstance

\ No newline at end of file +

Parameters

Returns AxiosInstance

\ No newline at end of file diff --git a/functions/ensureNonEmptyString.html b/functions/ensureNonEmptyString.html index e21ff6166..a5c54d9b8 100644 --- a/functions/ensureNonEmptyString.html +++ b/functions/ensureNonEmptyString.html @@ -1,3 +1,3 @@ ensureNonEmptyString | @gradientedge/commercetools-utils
\ No newline at end of file +
\ No newline at end of file diff --git a/functions/extractAxiosHeaders.html b/functions/extractAxiosHeaders.html index 8ff493e55..83189ee06 100644 --- a/functions/extractAxiosHeaders.html +++ b/functions/extractAxiosHeaders.html @@ -1 +1 @@ -extractAxiosHeaders | @gradientedge/commercetools-utils
\ No newline at end of file +extractAxiosHeaders | @gradientedge/commercetools-utils
\ No newline at end of file diff --git a/functions/formatAsKey.html b/functions/formatAsKey.html index f53c6c03c..7f57ef0d2 100644 --- a/functions/formatAsKey.html +++ b/functions/formatAsKey.html @@ -3,4 +3,4 @@ and must have a minimum length of 2 characters and maximum length of 256 characters.

Parameters

Returns string

\ No newline at end of file +

Returns string

\ No newline at end of file diff --git a/functions/getAttributeValue.html b/functions/getAttributeValue.html index 1c8479868..29ac6a1f0 100644 --- a/functions/getAttributeValue.html +++ b/functions/getAttributeValue.html @@ -1,3 +1,3 @@ getAttributeValue | @gradientedge/commercetools-utils
\ No newline at end of file +

Type Parameters

Parameters

Returns T | null

\ No newline at end of file diff --git a/functions/maskSensitiveData.html b/functions/maskSensitiveData.html index 2a85e3a6d..904d5762c 100644 --- a/functions/maskSensitiveData.html +++ b/functions/maskSensitiveData.html @@ -1,3 +1,3 @@ maskSensitiveData | @gradientedge/commercetools-utils
  • Mask all properties defined by {@see propertyNames} in the given {@see data} object with the mask string defined by the {@see mask} parameter.

    -

    Parameters

    • data: any
    • propertyNames: string[]
    • mask: string = DEFAULT_MASKING_STRING

    Returns any

\ No newline at end of file +

Parameters

Returns any

\ No newline at end of file diff --git a/functions/maskSensitiveHeaders.html b/functions/maskSensitiveHeaders.html index 8b6b17558..704893b63 100644 --- a/functions/maskSensitiveHeaders.html +++ b/functions/maskSensitiveHeaders.html @@ -1,2 +1,2 @@ maskSensitiveHeaders | @gradientedge/commercetools-utils
  • Mask all properties matching those in {@see SENSITIVE_HEADER_NAMES}

    -

    Parameters

    • data: unknown

    Returns any

\ No newline at end of file +

Parameters

Returns any

\ No newline at end of file diff --git a/functions/maskSensitiveInput.html b/functions/maskSensitiveInput.html index fe92ce4eb..f69333f0e 100644 --- a/functions/maskSensitiveInput.html +++ b/functions/maskSensitiveInput.html @@ -1,2 +1,2 @@ maskSensitiveInput | @gradientedge/commercetools-utils
  • Mask all properties matching those in {@see SENSITIVE_PROPERTY_NAMES}

    -

    Parameters

    • data: unknown

    Returns any

\ No newline at end of file +

Parameters

Returns any

\ No newline at end of file diff --git a/functions/retryOnConflict.html b/functions/retryOnConflict.html index 86fca3547..68e84305b 100644 --- a/functions/retryOnConflict.html +++ b/functions/retryOnConflict.html @@ -17,4 +17,4 @@ in a different value for the RetryOnConflictParams.delayMs parameter.

If the RetryOnConflictParams.jitter parameter is set to true, then a random element is added to the exponential increase in retry time.

-

Type Parameters

Parameters

Returns Promise<T>

\ No newline at end of file +

Type Parameters

Parameters

Returns Promise<T>

\ No newline at end of file diff --git a/interfaces/AnonymousGrantOptions.html b/interfaces/AnonymousGrantOptions.html index 06e48bd06..46e7cd865 100644 --- a/interfaces/AnonymousGrantOptions.html +++ b/interfaces/AnonymousGrantOptions.html @@ -1,13 +1,13 @@ -AnonymousGrantOptions | @gradientedge/commercetools-utils
interface AnonymousGrantOptions {
    anonymousId?: string;
    scopes?: string[];
}

Properties

anonymousId? +AnonymousGrantOptions | @gradientedge/commercetools-utils
interface AnonymousGrantOptions {
    anonymousId?: string;
    scopes?: string[];
}

Properties

anonymousId?: string

If you specify this, you need to be sure that the value does not already exist as an anonymous customer id in the commercetools system under your project key. If it does, an error will be thrown when trying to create the access token.

-
scopes?: string[]

The scopes of the anonymous customer must be less than or equal to +

scopes?: string[]

The scopes of the anonymous customer must be less than or equal to the scopes of the client API key (ideally, less). If you don't specify the scopes using this property, then the code will check for the scopes defined on CommercetoolsAuthConfig.customerScopes. If scopes aren't defined there either, than an error will be thrown when a call is made to CommercetoolsAuth.getAnonymousGrant

-
\ No newline at end of file +
\ No newline at end of file diff --git a/interfaces/CartSetCustomShippingMethodAction.html b/interfaces/CartSetCustomShippingMethodAction.html index 797f35770..ea3bd18b4 100644 --- a/interfaces/CartSetCustomShippingMethodAction.html +++ b/interfaces/CartSetCustomShippingMethodAction.html @@ -3,7 +3,7 @@ the Single ShippingMode and a shippingAddress.

To unset a custom Shipping Method on a Cart, use the [Set ShippingMethod](ctp:api:type:CartSetShippingMethodAction) update action
without the `shippingMethod` field instead.
-
interface CartSetCustomShippingMethodAction {
    action: "setCustomShippingMethod";
    externalTaxRate?: ExternalTaxRateDraft;
    shippingMethodName: string;
    shippingRate: ShippingRateDraft;
    taxCategory?: TaxCategoryResourceIdentifier;
}

Properties

interface CartSetCustomShippingMethodAction {
    action: "setCustomShippingMethod";
    externalTaxRate?: ExternalTaxRateDraft;
    shippingMethodName: string;
    shippingRate: ShippingRateDraft;
    taxCategory?: TaxCategoryResourceIdentifier;
}

Properties

action: "setCustomShippingMethod"
externalTaxRate?: ExternalTaxRateDraft

External Tax Rate for the shippingRate to be set if the Cart has the External TaxMode.

shippingMethodName: string

Name of the custom Shipping Method.

shippingRate: ShippingRateDraft

Determines the shipping price.

-
taxCategory?: TaxCategoryResourceIdentifier

Tax Category used to determine the Tax Rate when the Cart has the Platform TaxMode.

+

Tax Category used to determine the Tax Rate when the Cart has the Platform TaxMode.

\ No newline at end of file diff --git a/interfaces/CommercetoolsApiConfig.html b/interfaces/CommercetoolsApiConfig.html index 9de5b1cc6..abddea6a6 100644 --- a/interfaces/CommercetoolsApiConfig.html +++ b/interfaces/CommercetoolsApiConfig.html @@ -1,5 +1,5 @@ CommercetoolsApiConfig | @gradientedge/commercetools-utils

Configuration for constructing the {@see CommercetoolsApi} class.

-
interface CommercetoolsApiConfig {
    clientId: string;
    clientScopes: string[];
    clientSecret: string;
    customerScopes?: string[];
    httpsAgent?: Agent;
    onAfterResponse?: ((response) => void);
    onBeforeRequest?: ((requestConfig) => CommercetoolsRequest | Promise<CommercetoolsRequest>);
    projectKey: string;
    refreshIfWithinSecs?: number;
    region: Region;
    retry?: Partial<CommercetoolsRetryConfig>;
    storeKey?: string;
    systemIdentifier?: string;
    timeoutMs?: number;
}

Hierarchy (view full)

Properties

interface CommercetoolsApiConfig {
    clientId: string;
    clientScopes: string[];
    clientSecret: string;
    customerScopes?: string[];
    httpsAgent?: Agent;
    onAfterResponse?: ((response) => void);
    onBeforeRequest?: ((requestConfig) => CommercetoolsRequest | Promise<CommercetoolsRequest>);
    projectKey: string;
    refreshIfWithinSecs?: number;
    region: Region;
    retry?: Partial<CommercetoolsRetryConfig>;
    storeKey?: string;
    systemIdentifier?: string;
    timeoutMs?: number;
}

Hierarchy (view full)

Properties

clientId: string
clientScopes: string[]
clientSecret: string
customerScopes?: string[]
httpsAgent?: Agent
onAfterResponse?: ((response) => void)

If passed in, will be called once a request has been made and the +

Properties

clientId: string
clientScopes: string[]
clientSecret: string
customerScopes?: string[]
httpsAgent?: Agent
onAfterResponse?: ((response) => void)

If passed in, will be called once a request has been made and the response received (or error thrown).

-

Type declaration

onBeforeRequest?: ((requestConfig) => CommercetoolsRequest | Promise<CommercetoolsRequest>)

If passed in, will be called before sending a request to commercetools. +

Type declaration

onBeforeRequest?: ((requestConfig) => CommercetoolsRequest | Promise<CommercetoolsRequest>)

If passed in, will be called before sending a request to commercetools. The {@see requestConfig} parameter can be manipulated if you wish to modify/add headers or any other request data.

-

Type declaration

projectKey: string
refreshIfWithinSecs?: number
region: Region
retry?: Partial<CommercetoolsRetryConfig>
storeKey?: string
systemIdentifier?: string

If provided, will be passed across to commercetools in the +

Type declaration

projectKey: string
refreshIfWithinSecs?: number
region: Region
retry?: Partial<CommercetoolsRetryConfig>
storeKey?: string
systemIdentifier?: string

If provided, will be passed across to commercetools in the 'User-Agent' HTTP header, in order to help commercetools identify the source of incoming requests.

-
timeoutMs?: number
\ No newline at end of file +
timeoutMs?: number
\ No newline at end of file diff --git a/interfaces/CommercetoolsAuthConfig.html b/interfaces/CommercetoolsAuthConfig.html index 5f3a6226a..fa583418c 100644 --- a/interfaces/CommercetoolsAuthConfig.html +++ b/interfaces/CommercetoolsAuthConfig.html @@ -1,5 +1,5 @@ CommercetoolsAuthConfig | @gradientedge/commercetools-utils

Configuration for {@see CommercetoolsAuth}

-
interface CommercetoolsAuthConfig {
    clientId: string;
    clientScopes: string[];
    clientSecret: string;
    customerScopes?: string[];
    onAfterResponse?: ((response) => void);
    onBeforeRequest?: ((requestConfig) => CommercetoolsRequest | Promise<CommercetoolsRequest>);
    projectKey: string;
    refreshIfWithinSecs?: number;
    region: Region;
    retry?: Partial<CommercetoolsRetryConfig>;
    storeKey?: string;
    systemIdentifier?: string;
    timeoutMs?: number;
}

Hierarchy (view full)

Properties

interface CommercetoolsAuthConfig {
    clientId: string;
    clientScopes: string[];
    clientSecret: string;
    customerScopes?: string[];
    onAfterResponse?: ((response) => void);
    onBeforeRequest?: ((requestConfig) => CommercetoolsRequest | Promise<CommercetoolsRequest>);
    projectKey: string;
    refreshIfWithinSecs?: number;
    region: Region;
    retry?: Partial<CommercetoolsRetryConfig>;
    storeKey?: string;
    systemIdentifier?: string;
    timeoutMs?: number;
}

Hierarchy (view full)

Properties

clientId: string
clientScopes: string[]
clientSecret: string
customerScopes?: string[]
onAfterResponse?: ((response) => void)

If passed in, will be called once a request has been made and the +

Properties

clientId: string
clientScopes: string[]
clientSecret: string
customerScopes?: string[]
onAfterResponse?: ((response) => void)

If passed in, will be called once a request has been made and the response received (or error thrown).

-

Type declaration

onBeforeRequest?: ((requestConfig) => CommercetoolsRequest | Promise<CommercetoolsRequest>)

If passed in, will be called before sending a request to commercetools. +

Type declaration

onBeforeRequest?: ((requestConfig) => CommercetoolsRequest | Promise<CommercetoolsRequest>)

If passed in, will be called before sending a request to commercetools. The {@see requestConfig} parameter can be manipulated if you wish to modify/add headers or any other request data.

-

Type declaration

projectKey: string
refreshIfWithinSecs?: number
region: Region
retry?: Partial<CommercetoolsRetryConfig>
storeKey?: string
systemIdentifier?: string

If provided, will be passed across to commercetools in the +

Type declaration

projectKey: string
refreshIfWithinSecs?: number
region: Region
retry?: Partial<CommercetoolsRetryConfig>
storeKey?: string
systemIdentifier?: string

If provided, will be passed across to commercetools in the 'User-Agent' HTTP header, in order to help commercetools identify the source of incoming requests.

-
timeoutMs?: number
\ No newline at end of file +
timeoutMs?: number
\ No newline at end of file diff --git a/interfaces/CommercetoolsBaseConfig.html b/interfaces/CommercetoolsBaseConfig.html index 47e2ea2f2..6e3b3296e 100644 --- a/interfaces/CommercetoolsBaseConfig.html +++ b/interfaces/CommercetoolsBaseConfig.html @@ -1,6 +1,6 @@ CommercetoolsBaseConfig | @gradientedge/commercetools-utils

Provides a base configuration definition from which other class specific configurations can be extended.

-
interface CommercetoolsBaseConfig {
    clientId: string;
    clientSecret: string;
    onAfterResponse?: ((response) => void);
    onBeforeRequest?: ((requestConfig) => CommercetoolsRequest | Promise<CommercetoolsRequest>);
    projectKey: string;
    region: Region;
    retry?: Partial<CommercetoolsRetryConfig>;
    storeKey?: string;
    systemIdentifier?: string;
    timeoutMs?: number;
}

Hierarchy (view full)

Properties

interface CommercetoolsBaseConfig {
    clientId: string;
    clientSecret: string;
    onAfterResponse?: ((response) => void);
    onBeforeRequest?: ((requestConfig) => CommercetoolsRequest | Promise<CommercetoolsRequest>);
    projectKey: string;
    region: Region;
    retry?: Partial<CommercetoolsRetryConfig>;
    storeKey?: string;
    systemIdentifier?: string;
    timeoutMs?: number;
}

Hierarchy (view full)

Properties

clientId: string
clientSecret: string
onAfterResponse?: ((response) => void)

If passed in, will be called once a request has been made and the +

Properties

clientId: string
clientSecret: string
onAfterResponse?: ((response) => void)

If passed in, will be called once a request has been made and the response received (or error thrown).

-

Type declaration

onBeforeRequest?: ((requestConfig) => CommercetoolsRequest | Promise<CommercetoolsRequest>)

If passed in, will be called before sending a request to commercetools. +

Type declaration

onBeforeRequest?: ((requestConfig) => CommercetoolsRequest | Promise<CommercetoolsRequest>)

If passed in, will be called before sending a request to commercetools. The {@see requestConfig} parameter can be manipulated if you wish to modify/add headers or any other request data.

-

Type declaration

projectKey: string
region: Region
retry?: Partial<CommercetoolsRetryConfig>
storeKey?: string
systemIdentifier?: string

If provided, will be passed across to commercetools in the +

Type declaration

projectKey: string
region: Region
retry?: Partial<CommercetoolsRetryConfig>
storeKey?: string
systemIdentifier?: string

If provided, will be passed across to commercetools in the 'User-Agent' HTTP header, in order to help commercetools identify the source of incoming requests.

-
timeoutMs?: number
\ No newline at end of file +
timeoutMs?: number
\ No newline at end of file diff --git a/interfaces/CommercetoolsHooks.html b/interfaces/CommercetoolsHooks.html index c8c23784b..b20779a46 100644 --- a/interfaces/CommercetoolsHooks.html +++ b/interfaces/CommercetoolsHooks.html @@ -1,8 +1,8 @@ -CommercetoolsHooks | @gradientedge/commercetools-utils
interface CommercetoolsHooks {
    onAfterResponse?: ((response) => void);
    onBeforeRequest?: ((requestConfig) => CommercetoolsRequest | Promise<CommercetoolsRequest>);
}

Hierarchy (view full)

Properties

onAfterResponse? +CommercetoolsHooks | @gradientedge/commercetools-utils
interface CommercetoolsHooks {
    onAfterResponse?: ((response) => void);
    onBeforeRequest?: ((requestConfig) => CommercetoolsRequest | Promise<CommercetoolsRequest>);
}

Hierarchy (view full)

Properties

onAfterResponse?: ((response) => void)

If passed in, will be called once a request has been made and the response received (or error thrown).

-

Type declaration

onBeforeRequest?: ((requestConfig) => CommercetoolsRequest | Promise<CommercetoolsRequest>)

If passed in, will be called before sending a request to commercetools. +

Type declaration

onBeforeRequest?: ((requestConfig) => CommercetoolsRequest | Promise<CommercetoolsRequest>)

If passed in, will be called before sending a request to commercetools. The {@see requestConfig} parameter can be manipulated if you wish to modify/add headers or any other request data.

-

Type declaration

\ No newline at end of file +

Type declaration

\ No newline at end of file diff --git a/interfaces/CommercetoolsRequest.html b/interfaces/CommercetoolsRequest.html index f2a93ea2b..b82d03a45 100644 --- a/interfaces/CommercetoolsRequest.html +++ b/interfaces/CommercetoolsRequest.html @@ -1,7 +1,7 @@ CommercetoolsRequest | @gradientedge/commercetools-utils

Represents a request about to be made to commercetools

-
interface CommercetoolsRequest {
    data?: any;
    headers: Record<string, string>;
    method: string;
    params?: Record<string, string | number | boolean>;
    url: string;
}

Properties

interface CommercetoolsRequest {
    data?: any;
    headers: Record<string, string>;
    method: string;
    params?: Record<string, string | number | boolean>;
    url: string;
}

Properties

data?: any
headers: Record<string, string>
method: string
params?: Record<string, string | number | boolean>
url: string
\ No newline at end of file +

Properties

data?: any
headers: Record<string, string>
method: string
params?: Record<string, string | number | boolean>
url: string
\ No newline at end of file diff --git a/interfaces/CommercetoolsRequestResponse.html b/interfaces/CommercetoolsRequestResponse.html index 483dbdaf8..1688ffc54 100644 --- a/interfaces/CommercetoolsRequestResponse.html +++ b/interfaces/CommercetoolsRequestResponse.html @@ -1,5 +1,5 @@ CommercetoolsRequestResponse | @gradientedge/commercetools-utils

Represents the request and response for a request made to commercetools

-
interface CommercetoolsRequestResponse {
    request: {
        data?: any;
        headers?: Record<string, string>;
        method: string;
        params?: Record<string, string | number | boolean>;
        url: string;
    };
    response: {
        code?: string;
        data?: any;
        headers?: Record<string, string>;
        message?: string;
        status?: number;
    };
    stats: CommercetoolsRequestResponseStats;
}

Properties

interface CommercetoolsRequestResponse {
    request: {
        data?: any;
        headers?: Record<string, string>;
        method: string;
        params?: Record<string, string | number | boolean>;
        url: string;
    };
    response: {
        code?: string;
        data?: any;
        headers?: Record<string, string>;
        message?: string;
        status?: number;
    };
    stats: CommercetoolsRequestResponseStats;
}

Properties

Properties

request: {
    data?: any;
    headers?: Record<string, string>;
    method: string;
    params?: Record<string, string | number | boolean>;
    url: string;
}

Type declaration

  • Optional data?: any
  • Optional headers?: Record<string, string>
  • method: string
  • Optional params?: Record<string, string | number | boolean>
  • url: string
response: {
    code?: string;
    data?: any;
    headers?: Record<string, string>;
    message?: string;
    status?: number;
}

Type declaration

  • Optional code?: string
  • Optional data?: any
  • Optional headers?: Record<string, string>
  • Optional message?: string
  • Optional status?: number
\ No newline at end of file +

Properties

request: {
    data?: any;
    headers?: Record<string, string>;
    method: string;
    params?: Record<string, string | number | boolean>;
    url: string;
}

Type declaration

  • Optional data?: any
  • Optional headers?: Record<string, string>
  • method: string
  • Optional params?: Record<string, string | number | boolean>
  • url: string
response: {
    code?: string;
    data?: any;
    headers?: Record<string, string>;
    message?: string;
    status?: number;
}

Type declaration

  • Optional code?: string
  • Optional data?: any
  • Optional headers?: Record<string, string>
  • Optional message?: string
  • Optional status?: number
\ No newline at end of file diff --git a/interfaces/CommercetoolsRequestResponseStats.html b/interfaces/CommercetoolsRequestResponseStats.html index f9a77852b..c9ab7ea62 100644 --- a/interfaces/CommercetoolsRequestResponseStats.html +++ b/interfaces/CommercetoolsRequestResponseStats.html @@ -1,4 +1,4 @@ -CommercetoolsRequestResponseStats | @gradientedge/commercetools-utils
interface CommercetoolsRequestResponseStats {
    accumulativeDurationMs: number;
    durationMs: number;
    retries: number;
}

Properties

accumulativeDurationMs +CommercetoolsRequestResponseStats | @gradientedge/commercetools-utils
interface CommercetoolsRequestResponseStats {
    accumulativeDurationMs: number;
    durationMs: number;
    retries: number;
}

Properties

accumulativeDurationMs: number
durationMs: number
retries: number
\ No newline at end of file +

Properties

accumulativeDurationMs: number
durationMs: number
retries: number
\ No newline at end of file diff --git a/interfaces/CommercetoolsRetryConfig.html b/interfaces/CommercetoolsRetryConfig.html index 011581f07..c655e9ea7 100644 --- a/interfaces/CommercetoolsRetryConfig.html +++ b/interfaces/CommercetoolsRetryConfig.html @@ -1,13 +1,13 @@ CommercetoolsRetryConfig | @gradientedge/commercetools-utils

Configuration for retrying a request when it fails

-
interface CommercetoolsRetryConfig {
    delayMs: number;
    jitter?: boolean;
    maxRetries: number;
}

Properties

interface CommercetoolsRetryConfig {
    delayMs: number;
    jitter?: boolean;
    maxRetries: number;
}

Properties

delayMs: number

The number of milliseconds to wait before retrying a failed request. This will be increased exponentially {@see CommercetoolsApi.calculateDelay}.

-
jitter?: boolean

If enabled, adds a random element to the exponential increase +

jitter?: boolean

If enabled, adds a random element to the exponential increase in retry time. See the following url for more details: https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/ We utilise the 'full' jitter + plus an additional decaying variance.

-
maxRetries: number

The maximum number of times that a request will be retried before +

maxRetries: number

The maximum number of times that a request will be retried before returning the error caught from the last failure.

-
\ No newline at end of file +
\ No newline at end of file diff --git a/interfaces/CommonRequestOptions.html b/interfaces/CommonRequestOptions.html index 9cc445923..9f000e0be 100644 --- a/interfaces/CommonRequestOptions.html +++ b/interfaces/CommonRequestOptions.html @@ -1,8 +1,8 @@ CommonRequestOptions | @gradientedge/commercetools-utils

Options that are available to all requests.

-
interface CommonRequestOptions {
    correlationId?: string;
    params?: Record<string, undefined | string | number | boolean | (string | number | boolean)[]>;
    retry?: CommercetoolsRetryConfig;
}

Hierarchy (view full)

Properties

interface CommonRequestOptions {
    correlationId?: string;
    params?: Record<string, undefined | string | number | boolean | (string | number | boolean)[]>;
    retry?: CommercetoolsRetryConfig;
}

Hierarchy (view full)

Properties

correlationId?: string

A unique id used to track the source of a request.

-
params?: Record<string, undefined | string | number | boolean | (string | number | boolean)[]>

Query string parameters. For repeated param=value in the query string, define an array with values

-

Retry configuration

-
\ No newline at end of file +
params?: Record<string, undefined | string | number | boolean | (string | number | boolean)[]>

Query string parameters. For repeated param=value in the query string, define an array with values

+

Retry configuration

+
\ No newline at end of file diff --git a/interfaces/CommonStoreEnabledRequestOptions.html b/interfaces/CommonStoreEnabledRequestOptions.html index d165e6b57..66a62c7e7 100644 --- a/interfaces/CommonStoreEnabledRequestOptions.html +++ b/interfaces/CommonStoreEnabledRequestOptions.html @@ -1,10 +1,10 @@ CommonStoreEnabledRequestOptions | @gradientedge/commercetools-utils

Options that are available to all requests that support specifying a store

-
interface CommonStoreEnabledRequestOptions {
    correlationId?: string;
    params?: Record<string, undefined | string | number | boolean | (string | number | boolean)[]>;
    retry?: CommercetoolsRetryConfig;
    storeKey?: string;
}

Hierarchy (view full)

Properties

interface CommonStoreEnabledRequestOptions {
    correlationId?: string;
    params?: Record<string, undefined | string | number | boolean | (string | number | boolean)[]>;
    retry?: CommercetoolsRetryConfig;
    storeKey?: string;
}

Hierarchy (view full)

Properties

correlationId?: string

A unique id used to track the source of a request.

-
params?: Record<string, undefined | string | number | boolean | (string | number | boolean)[]>

Query string parameters. For repeated param=value in the query string, define an array with values

-

Retry configuration

-
storeKey?: string

The key of the store that you want this call to apply to

-
\ No newline at end of file +
params?: Record<string, undefined | string | number | boolean | (string | number | boolean)[]>

Query string parameters. For repeated param=value in the query string, define an array with values

+

Retry configuration

+
storeKey?: string

The key of the store that you want this call to apply to

+
\ No newline at end of file diff --git a/interfaces/EnsureNonEmptyStringParams.html b/interfaces/EnsureNonEmptyStringParams.html index c2cda3579..cc35e7a3d 100644 --- a/interfaces/EnsureNonEmptyStringParams.html +++ b/interfaces/EnsureNonEmptyStringParams.html @@ -1,6 +1,6 @@ EnsureNonEmptyStringParams | @gradientedge/commercetools-utils

Options interface for {@see ensureNonEmptyString}

-
interface EnsureNonEmptyStringParams {
    name: string;
    value: string;
}

Properties

interface EnsureNonEmptyStringParams {
    name: string;
    value: string;
}

Properties

Properties

name: string

name of property to be checked

-
value: string

string value to be checked

-
\ No newline at end of file +
value: string

string value to be checked

+
\ No newline at end of file diff --git a/interfaces/FetchOptions.html b/interfaces/FetchOptions.html index 8b62a44d6..04153275c 100644 --- a/interfaces/FetchOptions.html +++ b/interfaces/FetchOptions.html @@ -1,4 +1,4 @@ -FetchOptions | @gradientedge/commercetools-utils
interface FetchOptions<T> {
    accessToken?: string;
    correlationId?: string;
    data?: T;
    headers?: Record<string, string>;
    method: "GET" | "DELETE" | "HEAD" | "POST";
    params?: Record<string, any>;
    path: string;
    retry?: CommercetoolsRetryConfig;
}

Type Parameters

  • T = any

Properties

accessToken? +FetchOptions | @gradientedge/commercetools-utils
interface FetchOptions<T> {
    accessToken?: string;
    correlationId?: string;
    data?: T;
    headers?: Record<string, string>;
    method: "GET" | "DELETE" | "HEAD" | "POST";
    params?: Record<string, any>;
    path: string;
    retry?: CommercetoolsRetryConfig;
}

Type Parameters

  • T = any

Properties

accessToken? correlationId? data? headers? @@ -11,11 +11,11 @@ This must be passed in when using one of the me endpoints.

If this property is not passed in, we fall back to using the client access token.

-
correlationId?: string

Value to be passed in the X-Correlation-ID HTTP header

-
data?: T

Plain JavaScript object containing the payload to send as JSON

+
correlationId?: string

Value to be passed in the X-Correlation-ID HTTP header

+
data?: T

Plain JavaScript object containing the payload to send as JSON

This object will be converted to a JSON string and sent as the body of a POST or DELETE request.

-
headers?: Record<string, string>

Key/value pairs representing the HTTP headers to send

+
headers?: Record<string, string>

Key/value pairs representing the HTTP headers to send

You can pass in any headers you like using this property, however this is generally not necessary, as the {@see CommercetoolsApi.request} method applies all necessary headers.

@@ -30,13 +30,13 @@

Example value:

{
...
headers: {
'X-My-Special-Header': 'MyCustomValue'
}
...
}
-
method: "GET" | "DELETE" | "HEAD" | "POST"

HTTP method to use when sending the request

-
params?: Record<string, any>

Querystring parameters to send with the request

+
method: "GET" | "DELETE" | "HEAD" | "POST"

HTTP method to use when sending the request

+
params?: Record<string, any>

Querystring parameters to send with the request

Key/value pairs that are then converted in to a querystring using the qs npm package. See the paramSerializer option in {@see CommercetoolsApi.createAxiosInstance} for implementation details.

-
path: string

Path of the REST endpoint

+
path: string

Path of the REST endpoint

This is the absolute path, without the host/schema/port etc. You should not include your project key, as this will be automatically prepended.

@@ -44,10 +44,10 @@

Note that if you want to create a path that takes into account the store key that you defined in {@see CommercetoolsApiConfig} then you should use the {@see CommercetoolsApi.applyStore} method.

-

Request retry configuration

+

Request retry configuration

The request retry configuration can be set on the CommercetoolsApi instance or on a request by request basis. If no value is passed in here, we fall back to using the configuration provided when constructing the CommercetoolsApi instance. If no value was passed in to the constructor configuration, then no retries will take place.

-
\ No newline at end of file +
\ No newline at end of file diff --git a/interfaces/GetAttributeValueParams.html b/interfaces/GetAttributeValueParams.html index 4c9d77538..0b18aa0bc 100644 --- a/interfaces/GetAttributeValueParams.html +++ b/interfaces/GetAttributeValueParams.html @@ -1,6 +1,6 @@ GetAttributeValueParams | @gradientedge/commercetools-utils

Options interface for {@see getAttributeValue}

-
interface GetAttributeValueParams {
    attributes: undefined | null | Attribute[];
    name: string;
}

Properties

interface GetAttributeValueParams {
    attributes: undefined | null | Attribute[];
    name: string;
}

Properties

Properties

attributes: undefined | null | Attribute[]

Attribute list

-
name: string

Name of the attribute that you want to retrieve the value of

-
\ No newline at end of file +
name: string

Name of the attribute that you want to retrieve the value of

+
\ No newline at end of file diff --git a/interfaces/LoginOptions.html b/interfaces/LoginOptions.html index 5259729ad..c104e1349 100644 --- a/interfaces/LoginOptions.html +++ b/interfaces/LoginOptions.html @@ -1,11 +1,11 @@ LoginOptions | @gradientedge/commercetools-utils

This is the LoginOptions description

-
interface LoginOptions {
    password: string;
    scopes?: string[];
    storeKey?: string;
    username: string;
}

Properties

interface LoginOptions {
    password: string;
    scopes?: string[];
    storeKey?: string;
    username: string;
}

Properties

password: string

The customer's password

-
scopes?: string[]

The scopes to which you want to restrict the customer grant. Note that +

scopes?: string[]

The scopes to which you want to restrict the customer grant. Note that these must be a subset of the scopes associated with the client grant.

-
storeKey?: string

The key of the store to login to

-
username: string

The customer's username (email address)

-
\ No newline at end of file +
storeKey?: string

The key of the store to login to

+
username: string

The customer's username (email address)

+
\ No newline at end of file diff --git a/interfaces/ProductDraft.html b/interfaces/ProductDraft.html index 3e6548611..8f20677d8 100644 --- a/interfaces/ProductDraft.html +++ b/interfaces/ProductDraft.html @@ -1,4 +1,4 @@ -ProductDraft | @gradientedge/commercetools-utils
interface ProductDraft {
    categories?: CategoryResourceIdentifier[];
    categoryOrderHints?: CategoryOrderHints;
    description?: LocalizedString;
    key?: string;
    masterVariant?: ProductVariantDraft;
    metaDescription?: LocalizedString;
    metaKeywords?: LocalizedString;
    metaTitle?: LocalizedString;
    name: LocalizedString;
    priceMode?: string;
    productType: ProductTypeResourceIdentifier;
    publish?: boolean;
    searchKeywords?: SearchKeywords;
    slug: LocalizedString;
    state?: StateResourceIdentifier;
    taxCategory?: TaxCategoryResourceIdentifier;
    variants?: ProductVariantDraft[];
}

Properties

categories? +ProductDraft | @gradientedge/commercetools-utils
interface ProductDraft {
    categories?: CategoryResourceIdentifier[];
    categoryOrderHints?: CategoryOrderHints;
    description?: LocalizedString;
    key?: string;
    masterVariant?: ProductVariantDraft;
    metaDescription?: LocalizedString;
    metaKeywords?: LocalizedString;
    metaTitle?: LocalizedString;
    name: LocalizedString;
    priceMode?: string;
    productType: ProductTypeResourceIdentifier;
    publish?: boolean;
    searchKeywords?: SearchKeywords;
    slug: LocalizedString;
    state?: StateResourceIdentifier;
    taxCategory?: TaxCategoryResourceIdentifier;
    variants?: ProductVariantDraft[];
}

Properties

categories? categoryOrderHints? description? key? @@ -34,6 +34,6 @@ It must be unique across a Project, but a Product can have the same slug in different Locales. It must match the pattern [a-zA-Z0-9_\\-]{2,256}.

state?: StateResourceIdentifier

State to be assigned to the Product.

-
taxCategory?: TaxCategoryResourceIdentifier

The Tax Category to be assigned to the Product.

+

The Tax Category to be assigned to the Product.

variants?: ProductVariantDraft[]

The additional Product Variants for the Product.

\ No newline at end of file diff --git a/interfaces/RegionEndpoints.html b/interfaces/RegionEndpoints.html index 5a1593e36..ccd914ec7 100644 --- a/interfaces/RegionEndpoints.html +++ b/interfaces/RegionEndpoints.html @@ -1,6 +1,6 @@ RegionEndpoints | @gradientedge/commercetools-utils

The Authentication and API endpoints for a particular region

-
interface RegionEndpoints {
    api: string;
    auth: string;
}

Properties

api +
interface RegionEndpoints {
    api: string;
    auth: string;
}

Properties

Properties

api: string

The url to the commercetools API endpoint for the region

-
auth: string

The url to the commercetools auth endpoint for the region

-
\ No newline at end of file +
auth: string

The url to the commercetools auth endpoint for the region

+
\ No newline at end of file diff --git a/interfaces/RequestExecutor.html b/interfaces/RequestExecutor.html index 63cab86cb..b465fc380 100644 --- a/interfaces/RequestExecutor.html +++ b/interfaces/RequestExecutor.html @@ -1 +1 @@ -RequestExecutor | @gradientedge/commercetools-utils
interface RequestExecutor<T> ((options) => Promise<T>)

Type Parameters

  • T = any
\ No newline at end of file +RequestExecutor | @gradientedge/commercetools-utils
interface RequestExecutor<T> ((options) => Promise<T>)

Type Parameters

  • T = any
\ No newline at end of file diff --git a/interfaces/RetryOnConflictParams.html b/interfaces/RetryOnConflictParams.html index e12a2c46c..a297382fe 100644 --- a/interfaces/RetryOnConflictParams.html +++ b/interfaces/RetryOnConflictParams.html @@ -1,19 +1,19 @@ -RetryOnConflictParams | @gradientedge/commercetools-utils
interface RetryOnConflictParams<T> {
    delayMs?: number;
    executeFn: ((attemptNo) => Promise<T>);
    jitter?: boolean;
    maxRetries?: number;
}

Type Parameters

  • T = any

Properties

delayMs? +RetryOnConflictParams | @gradientedge/commercetools-utils
interface RetryOnConflictParams<T> {
    delayMs?: number;
    executeFn: ((attemptNo) => Promise<T>);
    jitter?: boolean;
    maxRetries?: number;
}

Type Parameters

  • T = any

Properties

delayMs?: number

The number of milliseconds to wait before retrying a failed request. This will be increased exponentially CommercetoolsApi.calculateDelay. Defaults to 100.

-
executeFn: ((attemptNo) => Promise<T>)

Any function that returns a promise

+
executeFn: ((attemptNo) => Promise<T>)

Any function that returns a promise

This function is expected to be able to throw a CommercetoolsError with a status code of 409. These errors should not be swallowed by the code in this function.

-

Type declaration

    • (attemptNo): Promise<T>
    • Parameters

      • attemptNo: number

      Returns Promise<T>

jitter?: boolean

If enabled, adds a random element to the exponential increase +

Type declaration

    • (attemptNo): Promise<T>
    • Parameters

      • attemptNo: number

      Returns Promise<T>

jitter?: boolean

If enabled, adds a random element to the exponential increase in retry time. See the following url for more details: https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/ We utilise the 'full' jitter + plus an additional decaying variance.

-
maxRetries?: number

The maximum number of times that we'll call the executeFn function +

maxRetries?: number

The maximum number of times that we'll call the executeFn function before returning the error caught from the last failure. Defaults to 3.

-
\ No newline at end of file +
\ No newline at end of file diff --git a/interfaces/TaxCategoryResourceIdentifier.html b/interfaces/TaxCategoryResourceIdentifier.html new file mode 100644 index 000000000..c6ee7f4d9 --- /dev/null +++ b/interfaces/TaxCategoryResourceIdentifier.html @@ -0,0 +1,7 @@ +TaxCategoryResourceIdentifier | @gradientedge/commercetools-utils

ResourceIdentifier to a TaxCategory. Either id or key is required. If both are set, an InvalidJsonInput error is returned.

+
interface TaxCategoryResourceIdentifier {
    id?: string;
    key?: string;
    typeId: "tax-category";
}

Properties

Properties

id?: string

Unique identifier of the referenced TaxCategory. Required if key is absent.

+
key?: string

User-defined unique identifier of the referenced TaxCategory. Required if id is absent.

+
typeId: "tax-category"
\ No newline at end of file diff --git a/modules.html b/modules.html index b79477d0f..39186d2a2 100644 --- a/modules.html +++ b/modules.html @@ -134,6 +134,7 @@ StoreUpdate TaxCategory TaxCategoryPagedQueryResponse +TaxCategoryResourceIdentifier TaxPortion TaxRate TaxedItemPrice diff --git a/variables/DEFAULT_MASKING_STRING.html b/variables/DEFAULT_MASKING_STRING.html index 741f716c7..029af4e61 100644 --- a/variables/DEFAULT_MASKING_STRING.html +++ b/variables/DEFAULT_MASKING_STRING.html @@ -1,2 +1,2 @@ DEFAULT_MASKING_STRING | @gradientedge/commercetools-utils

Variable DEFAULT_MASKING_STRINGConst

DEFAULT_MASKING_STRING: "********" = '********'

The string mask to use if none explicitly provided.

-
\ No newline at end of file +
\ No newline at end of file diff --git a/variables/MAX_ITEMS_PER_QUERY.html b/variables/MAX_ITEMS_PER_QUERY.html index 8cde18e1d..54be01dc3 100644 --- a/variables/MAX_ITEMS_PER_QUERY.html +++ b/variables/MAX_ITEMS_PER_QUERY.html @@ -1,2 +1,2 @@ MAX_ITEMS_PER_QUERY | @gradientedge/commercetools-utils
MAX_ITEMS_PER_QUERY: 500 = 500

The maximum number of items that can be returned in a query

-
\ No newline at end of file +
\ No newline at end of file diff --git a/variables/SENSITIVE_HEADER_NAMES.html b/variables/SENSITIVE_HEADER_NAMES.html index d498b3ee6..b5bb68cbb 100644 --- a/variables/SENSITIVE_HEADER_NAMES.html +++ b/variables/SENSITIVE_HEADER_NAMES.html @@ -1,3 +1,3 @@ SENSITIVE_HEADER_NAMES | @gradientedge/commercetools-utils

Variable SENSITIVE_HEADER_NAMESConst

SENSITIVE_HEADER_NAMES: string[] = ...

List of HTTP header names that we want to mask. Names are not case sensitive.

-
\ No newline at end of file +
\ No newline at end of file diff --git a/variables/SENSITIVE_PROPERTY_NAMES.html b/variables/SENSITIVE_PROPERTY_NAMES.html index c6239f920..6489b0b31 100644 --- a/variables/SENSITIVE_PROPERTY_NAMES.html +++ b/variables/SENSITIVE_PROPERTY_NAMES.html @@ -1,3 +1,3 @@ SENSITIVE_PROPERTY_NAMES | @gradientedge/commercetools-utils

Variable SENSITIVE_PROPERTY_NAMESConst

SENSITIVE_PROPERTY_NAMES: string[] = ...

List of property names that we want to mask. Names are not case sensitive.

-
\ No newline at end of file +
\ No newline at end of file