commerce-sdk-isomorphic 4.0.1-preview-shopper-configurations.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -61
- package/lib/index.cjs.d.ts +6 -748
- package/lib/index.cjs.js +1 -1
- package/lib/index.esm.d.ts +6 -748
- package/lib/index.esm.js +1 -1
- package/package.json +27 -94
- package/lib/clientConfig.cjs.d.ts +0 -52
- package/lib/clientConfig.cjs.js +0 -1
- package/lib/clientConfig.d.ts +0 -52
- package/lib/clientConfig.js +0 -1
- package/lib/config.cjs.d.ts +0 -2
- package/lib/config.cjs.js +0 -1
- package/lib/config.d.ts +0 -2
- package/lib/config.js +0 -1
- package/lib/helpers.cjs.d.ts +0 -2225
- package/lib/helpers.cjs.js +0 -1
- package/lib/helpers.d.ts +0 -2225
- package/lib/helpers.js +0 -1
- package/lib/responseError.cjs.d.ts +0 -12
- package/lib/responseError.cjs.js +0 -1
- package/lib/responseError.d.ts +0 -12
- package/lib/responseError.js +0 -1
- package/lib/shopperBaskets.cjs.d.ts +0 -10259
- package/lib/shopperBaskets.cjs.js +0 -1
- package/lib/shopperBaskets.d.ts +0 -10259
- package/lib/shopperBaskets.js +0 -1
- package/lib/shopperBasketsv2.cjs.d.ts +0 -10453
- package/lib/shopperBasketsv2.cjs.js +0 -1
- package/lib/shopperBasketsv2.d.ts +0 -10453
- package/lib/shopperBasketsv2.js +0 -1
- package/lib/shopperConfigurations.cjs.d.ts +0 -601
- package/lib/shopperConfigurations.cjs.js +0 -1
- package/lib/shopperConfigurations.d.ts +0 -601
- package/lib/shopperConfigurations.js +0 -1
- package/lib/shopperConsents.cjs.d.ts +0 -1142
- package/lib/shopperConsents.cjs.js +0 -1
- package/lib/shopperConsents.d.ts +0 -1142
- package/lib/shopperConsents.js +0 -1
- package/lib/shopperContext.cjs.d.ts +0 -1401
- package/lib/shopperContext.cjs.js +0 -1
- package/lib/shopperContext.d.ts +0 -1401
- package/lib/shopperContext.js +0 -1
- package/lib/shopperCustomers.cjs.d.ts +0 -12425
- package/lib/shopperCustomers.cjs.js +0 -1
- package/lib/shopperCustomers.d.ts +0 -12425
- package/lib/shopperCustomers.js +0 -1
- package/lib/shopperExperience.cjs.d.ts +0 -1169
- package/lib/shopperExperience.cjs.js +0 -1
- package/lib/shopperExperience.d.ts +0 -1169
- package/lib/shopperExperience.js +0 -1
- package/lib/shopperGiftCertificates.cjs.d.ts +0 -729
- package/lib/shopperGiftCertificates.cjs.js +0 -1
- package/lib/shopperGiftCertificates.d.ts +0 -729
- package/lib/shopperGiftCertificates.js +0 -1
- package/lib/shopperLogin.cjs.d.ts +0 -3842
- package/lib/shopperLogin.cjs.js +0 -1
- package/lib/shopperLogin.d.ts +0 -3842
- package/lib/shopperLogin.js +0 -1
- package/lib/shopperOrders.cjs.d.ts +0 -5393
- package/lib/shopperOrders.cjs.js +0 -1
- package/lib/shopperOrders.d.ts +0 -5393
- package/lib/shopperOrders.js +0 -1
- package/lib/shopperProducts.cjs.d.ts +0 -3479
- package/lib/shopperProducts.cjs.js +0 -1
- package/lib/shopperProducts.d.ts +0 -3479
- package/lib/shopperProducts.js +0 -1
- package/lib/shopperPromotions.cjs.d.ts +0 -1001
- package/lib/shopperPromotions.cjs.js +0 -1
- package/lib/shopperPromotions.d.ts +0 -1001
- package/lib/shopperPromotions.js +0 -1
- package/lib/shopperSearch.cjs.d.ts +0 -3352
- package/lib/shopperSearch.cjs.js +0 -1
- package/lib/shopperSearch.d.ts +0 -3352
- package/lib/shopperSearch.js +0 -1
- package/lib/shopperSeo.cjs.d.ts +0 -769
- package/lib/shopperSeo.cjs.js +0 -1
- package/lib/shopperSeo.d.ts +0 -769
- package/lib/shopperSeo.js +0 -1
- package/lib/shopperStores.cjs.d.ts +0 -1289
- package/lib/shopperStores.cjs.js +0 -1
- package/lib/shopperStores.d.ts +0 -1289
- package/lib/shopperStores.js +0 -1
- package/lib/templateUrl.cjs.d.ts +0 -76
- package/lib/templateUrl.cjs.js +0 -1
- package/lib/templateUrl.d.ts +0 -76
- package/lib/templateUrl.js +0 -1
- package/lib/version.cjs.d.ts +0 -3
- package/lib/version.cjs.js +0 -1
- package/lib/version.d.ts +0 -3
- package/lib/version.js +0 -1
package/lib/shopperSeo.cjs.d.ts
DELETED
|
@@ -1,769 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2021, salesforce.com, inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
-
*/
|
|
7
|
-
import { RequestInit as NodeRequestInit } from "node-fetch";
|
|
8
|
-
/*
|
|
9
|
-
* Copyright (c) 2025, Salesforce, Inc.
|
|
10
|
-
* All rights reserved.
|
|
11
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
13
|
-
*/
|
|
14
|
-
declare const defaultBaseUri = "https://{shortCode}.api.commercecloud.salesforce.com/site/shopper-seo/v1";
|
|
15
|
-
/**
|
|
16
|
-
* Makes a type easier to read.
|
|
17
|
-
*/
|
|
18
|
-
type Prettify<T> = NonNullable<{
|
|
19
|
-
[K in keyof T]: T[K];
|
|
20
|
-
}>;
|
|
21
|
-
/**
|
|
22
|
-
* Generates the types required on a method, based on those provided in the config.
|
|
23
|
-
*/
|
|
24
|
-
type CompositeParameters<MethodParameters extends Record<string, unknown>, ConfigParameters extends Record<string, unknown>> = Prettify<Omit<MethodParameters, keyof ConfigParameters> & Partial<MethodParameters>>;
|
|
25
|
-
/**
|
|
26
|
-
* If an object has a `parameters` property, and the `parameters` object has required properties,
|
|
27
|
-
* then the `parameters` property on the root object is marked as required.
|
|
28
|
-
*/
|
|
29
|
-
type RequireParametersUnlessAllAreOptional<T extends {
|
|
30
|
-
parameters?: Record<string, unknown>;
|
|
31
|
-
}> = Record<string, never> extends NonNullable<T["parameters"]> ? T : Prettify<T & Required<Pick<T, "parameters">>>;
|
|
32
|
-
/**
|
|
33
|
-
* Template parameters used in the base URI of all API endpoints. `version` will default to `"v1"`
|
|
34
|
-
* if not specified.
|
|
35
|
-
*/
|
|
36
|
-
interface BaseUriParameters {
|
|
37
|
-
shortCode: string;
|
|
38
|
-
}
|
|
39
|
-
type LocaleCode = {
|
|
40
|
-
[key: string]: any;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Generic interface for path parameters.
|
|
44
|
-
*/
|
|
45
|
-
interface PathParameters {
|
|
46
|
-
[key: string]: string | number | boolean;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Generic interface for query parameters.
|
|
50
|
-
*/
|
|
51
|
-
interface QueryParameters {
|
|
52
|
-
[key: string]: string | number | boolean | string[] | number[] | LocaleCode;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Alias for `RequestInit` from TypeScript's DOM lib, to more clearly differentiate
|
|
56
|
-
* it from the `RequestInit` provided by node-fetch.
|
|
57
|
-
*/
|
|
58
|
-
type BrowserRequestInit = RequestInit;
|
|
59
|
-
/**
|
|
60
|
-
* Any properties supported in either the browser or node are accepted.
|
|
61
|
-
* Using the right properties in the right context is left to the user.
|
|
62
|
-
*/
|
|
63
|
-
type FetchOptions = NodeRequestInit & BrowserRequestInit;
|
|
64
|
-
/**
|
|
65
|
-
* Base options that can be passed to the `ClientConfig` class.
|
|
66
|
-
*/
|
|
67
|
-
interface ClientConfigInit<Params extends BaseUriParameters> {
|
|
68
|
-
baseUri?: string;
|
|
69
|
-
proxy?: string;
|
|
70
|
-
headers?: {
|
|
71
|
-
[key: string]: string;
|
|
72
|
-
};
|
|
73
|
-
parameters: Params;
|
|
74
|
-
fetchOptions?: FetchOptions;
|
|
75
|
-
transformRequest?: (data: unknown, headers: {
|
|
76
|
-
[key: string]: string;
|
|
77
|
-
}) => Required<FetchOptions>["body"];
|
|
78
|
-
throwOnBadResponse?: boolean;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Configuration parameters common to Commerce SDK clients
|
|
82
|
-
*/
|
|
83
|
-
declare class ClientConfig<Params extends BaseUriParameters> implements ClientConfigInit<Params> {
|
|
84
|
-
baseUri?: string;
|
|
85
|
-
proxy?: string;
|
|
86
|
-
headers: {
|
|
87
|
-
[key: string]: string;
|
|
88
|
-
};
|
|
89
|
-
parameters: Params;
|
|
90
|
-
fetchOptions: FetchOptions;
|
|
91
|
-
transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
|
|
92
|
-
throwOnBadResponse: boolean;
|
|
93
|
-
constructor(config: ClientConfigInit<Params>);
|
|
94
|
-
static readonly defaults: Pick<Required<ClientConfigInit<never>>, "transformRequest">;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* A specialized value indicating the system default values for locales.
|
|
98
|
-
*/
|
|
99
|
-
type DefaultFallback = "default";
|
|
100
|
-
/**
|
|
101
|
-
* @type ErrorResponse:
|
|
102
|
-
*
|
|
103
|
-
* @property title: A short, human-readable summary of the problem type. It will not change from occurrence to occurrence of the problem, except for purposes of localization
|
|
104
|
-
* - **Max Length:** 256
|
|
105
|
-
*
|
|
106
|
-
* @property type: A URI reference [RFC3986] that identifies the problem type. This specification encourages that, when dereferenced, it provide human-readable documentation for the problem type (e.g., using HTML [W3C.REC-html5-20141028]). When this member is not present, its value is assumed to be \"about:blank\". It accepts relative URIs; this means that they must be resolved relative to the document\'s base URI, as per [RFC3986], Section 5.
|
|
107
|
-
* - **Max Length:** 2048
|
|
108
|
-
*
|
|
109
|
-
* @property detail: A human-readable explanation specific to this occurrence of the problem.
|
|
110
|
-
*
|
|
111
|
-
* @property instance: A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. It accepts relative URIs; this means that they must be resolved relative to the document\'s base URI, as per [RFC3986], Section 5.
|
|
112
|
-
* - **Max Length:** 2048
|
|
113
|
-
*
|
|
114
|
-
*/
|
|
115
|
-
type ErrorResponse = {
|
|
116
|
-
title: string;
|
|
117
|
-
type: string;
|
|
118
|
-
detail: string;
|
|
119
|
-
instance?: string;
|
|
120
|
-
} & {
|
|
121
|
-
[key: string]: any;
|
|
122
|
-
};
|
|
123
|
-
/**
|
|
124
|
-
* @type LocaleCode
|
|
125
|
-
* A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
|
|
126
|
-
*/
|
|
127
|
-
type LocaleCode$0 = DefaultFallback | string;
|
|
128
|
-
/**
|
|
129
|
-
* @type UrlMapping: The URL mapping information for a URL that a shopper clicked or typed in.
|
|
130
|
-
*
|
|
131
|
-
* @property resourceType: The type of resource that corresponds to the requested URL. If you set up a URL redirect in Business Manager, resourceType returns the corresponding destination type value from the redirect. If there\'s a URI redirect, resourceType isn\'t returned. The URL redirect feature is available from B2C Commerce version 24.3.
|
|
132
|
-
* - **Min Length:** 1
|
|
133
|
-
* - **Max Length:** 256
|
|
134
|
-
*
|
|
135
|
-
* @property resourceSubType: If the resourceType is CONTENT_ASSET, this field tells you whether the resource is a standard content asset or a Page Designer content asset. This output is available from B2C Commerce version 24.2.
|
|
136
|
-
* - **Min Length:** 1
|
|
137
|
-
* - **Max Length:** 256
|
|
138
|
-
*
|
|
139
|
-
* @property resourceId: The identifier for the resource that corresponds to the requested URL. If you set up a URL redirect in Business Manager, resourceId returns the corresponding destination ID value from the redirect. If there\'s a URI redirect, resourceId isn\'t returned. The URL redirect feature is available from B2C Commerce version 24.3.
|
|
140
|
-
* - **Min Length:** 1
|
|
141
|
-
* - **Max Length:** 256
|
|
142
|
-
*
|
|
143
|
-
* @property refinements: The refinement filters that correspond to the URL and resourceType. Refinements are returned only if all of these conditions are met - a) the resourceType is CATEGORY, b) refinements are included in the urlSegment, and c) the refinements are configured in Business Manager. This field returns a key-value pair of refinement name and refinement value. If there’s a matching URL redirect for the requested URL. the refinements output isn’t returned. The URL redirect feature is available from B2C Commerce version 24.3.
|
|
144
|
-
*
|
|
145
|
-
* @property statusCode: This field is populated only if you set up a URL redirect in Business Manager. It specifies whether the redirect is temporary (302 or 307) or permanent (301). See [Create a Redirect from a B2C Commerce URL.](https://help.salesforce.com/s/articleView?id=cc.b2c_creating_a_redirect_from_a_digital_url.htm&type=5) This parameter is available from B2C Commerce version 24.3.
|
|
146
|
-
*
|
|
147
|
-
* @property destinationUrl: This field is populated if the urlSegment resolves to a redirect. Specifies the URL you want to redirect to as an absolute or relative URL. The destinationUrl is based on your configuration in Business Manager. It\'s either a calculated value indicating the Commerce Cloud object (product, category, or content asset) URL or your specified URL. Note that an object\'s path may not necessarily match your headless storefront URLs but can be used as a reference for calculating the destinationUrl. See [Create a Redirect from a B2C Commerce URL.](https://help.salesforce.com/s/articleView?id=cc.b2c_creating_a_redirect_from_a_digital_url.htm&type=5). Available from B2C Commerce 24.3.
|
|
148
|
-
* - **Min Length:** 1
|
|
149
|
-
* - **Max Length:** 2048
|
|
150
|
-
*
|
|
151
|
-
* @property copySourceParams: This field is populated only if you set up a URL redirect in Business Manager. It’s a flag that shows whether the parameters of the source URL have been copied to the destination URL. This parameter is available from B2C Commerce version 24.3.
|
|
152
|
-
*
|
|
153
|
-
* @property additionalUrlParams: This field is populated only if you set up a URL redirect in Business Manager. It returns the parameters you want to add to the end of the URL. This parameter is available from B2C Commerce version 24.3.
|
|
154
|
-
* - **Min Length:** 1
|
|
155
|
-
* - **Max Length:** 2048
|
|
156
|
-
*
|
|
157
|
-
* @property productCategoryId: This field is populated only if you set up a URL redirect in Business Manager. It identifies the destination product\'s category ID. This field is returned only when the destination type is product. This parameter is available from B2C Commerce version 24.3.
|
|
158
|
-
* - **Min Length:** 1
|
|
159
|
-
* - **Max Length:** 256
|
|
160
|
-
*
|
|
161
|
-
*/
|
|
162
|
-
type UrlMapping = {
|
|
163
|
-
resourceType?: string;
|
|
164
|
-
resourceSubType?: string;
|
|
165
|
-
resourceId?: string;
|
|
166
|
-
refinements?: {
|
|
167
|
-
[key: string]: any;
|
|
168
|
-
};
|
|
169
|
-
statusCode?: number;
|
|
170
|
-
destinationUrl?: string;
|
|
171
|
-
copySourceParams?: boolean;
|
|
172
|
-
additionalUrlParams?: string;
|
|
173
|
-
productCategoryId?: string;
|
|
174
|
-
} & {
|
|
175
|
-
[key: string]: any;
|
|
176
|
-
};
|
|
177
|
-
type getUrlMappingQueryParameters = {
|
|
178
|
-
urlSegment: string;
|
|
179
|
-
siteId: string;
|
|
180
|
-
locale?: LocaleCode$0;
|
|
181
|
-
};
|
|
182
|
-
type getUrlMappingPathParameters = {
|
|
183
|
-
organizationId: string;
|
|
184
|
-
};
|
|
185
|
-
/**
|
|
186
|
-
* All path parameters that are used by at least one ShopperSEO method.
|
|
187
|
-
*/
|
|
188
|
-
type ShopperSEOPathParameters = Partial<getUrlMappingPathParameters & {}>;
|
|
189
|
-
/**
|
|
190
|
-
* All query parameters that are used by at least one ShopperSEO method.
|
|
191
|
-
*/
|
|
192
|
-
type ShopperSEOQueryParameters = Partial<getUrlMappingQueryParameters & {}>;
|
|
193
|
-
/**
|
|
194
|
-
* All parameters that are used by ShopperSEO.
|
|
195
|
-
*/
|
|
196
|
-
type ShopperSEOParameters = ShopperSEOPathParameters & BaseUriParameters & ShopperSEOQueryParameters;
|
|
197
|
-
/**
|
|
198
|
-
* [Shopper SEO](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-seo:Summary)
|
|
199
|
-
* ==================================
|
|
200
|
-
*
|
|
201
|
-
* *# API Overview
|
|
202
|
-
|
|
203
|
-
The Shopper SEO API Provides access to SEO-related information, such as URL mapping information.
|
|
204
|
-
|
|
205
|
-
## Authentication & Authorization
|
|
206
|
-
|
|
207
|
-
The Shopper SEO API requires a shopper access token from the [Shopper Login and API Access Service (SLAS).](https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-shopper-apis.html)
|
|
208
|
-
|
|
209
|
-
You must include the relevant scope(s) in the client ID used to generate the SLAS token. For details, see [Authorization Scopes Catalog.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/auth-z-scope-catalog.html)
|
|
210
|
-
|
|
211
|
-
## Use Cases
|
|
212
|
-
|
|
213
|
-
### URL Resolution
|
|
214
|
-
|
|
215
|
-
For information on setting up URL rules and URL redirects in Business Manager, see [URL Resolution.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/url-resolution.html)
|
|
216
|
-
|
|
217
|
-
### Caching
|
|
218
|
-
|
|
219
|
-
Caching capabilities are available for the Shopper SEO API. For details, see [Server-Side Web-Tier Caching.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html)
|
|
220
|
-
|
|
221
|
-
### Using Hooks
|
|
222
|
-
|
|
223
|
-
For details working with hooks, see [Extensibility with Hooks.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/extensibility_via_hooks.html)*<br />
|
|
224
|
-
*
|
|
225
|
-
* Simple example:
|
|
226
|
-
*
|
|
227
|
-
* ```typescript
|
|
228
|
-
* import { ShopperSEO } from "commerce-sdk-isomorphic";
|
|
229
|
-
*
|
|
230
|
-
* const clientConfig = {
|
|
231
|
-
* parameters: {
|
|
232
|
-
* clientId: "XXXXXX",
|
|
233
|
-
* organizationId: "XXXX",
|
|
234
|
-
* shortCode: "XXX",
|
|
235
|
-
* siteId: "XX"
|
|
236
|
-
* }
|
|
237
|
-
* };
|
|
238
|
-
* const shopperSEOClient = new ShopperSEO(clientConfig);
|
|
239
|
-
* ```
|
|
240
|
-
*
|
|
241
|
-
* <span style="font-size:.7em; display:block; text-align: right">
|
|
242
|
-
* API Version: 0.0.33<br />
|
|
243
|
-
* Last Updated: <br />
|
|
244
|
-
* </span>
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
*/
|
|
248
|
-
declare class ShopperSEO<ConfigParameters extends ShopperSEOParameters & Record<string, unknown>> {
|
|
249
|
-
// baseUri is not required on ClientConfig, but we know that we provide one in the class constructor
|
|
250
|
-
clientConfig: ClientConfig<ConfigParameters> & {
|
|
251
|
-
baseUri: string;
|
|
252
|
-
};
|
|
253
|
-
static readonly defaultBaseUri = "https://{shortCode}.api.commercecloud.salesforce.com/site/shopper-seo/v1";
|
|
254
|
-
static readonly apiPaths: {
|
|
255
|
-
getUrlMapping: string;
|
|
256
|
-
};
|
|
257
|
-
constructor(config: ClientConfigInit<ConfigParameters>);
|
|
258
|
-
static readonly paramKeys: {
|
|
259
|
-
readonly getUrlMapping: readonly [
|
|
260
|
-
"organizationId",
|
|
261
|
-
"urlSegment",
|
|
262
|
-
"siteId",
|
|
263
|
-
"locale"
|
|
264
|
-
];
|
|
265
|
-
readonly getUrlMappingRequired: readonly [
|
|
266
|
-
"organizationId",
|
|
267
|
-
"urlSegment",
|
|
268
|
-
"siteId"
|
|
269
|
-
];
|
|
270
|
-
};
|
|
271
|
-
/**
|
|
272
|
-
* The mapping information is based on URL rules and redirects that are set up in Business Manager.
|
|
273
|
-
For more information about prerequisites and sample usage, see [URL Resolution](/docs/commerce/commerce-api/guide/url-resolution.html).
|
|
274
|
-
You can customize the behavior of this endpoint by using hooks. For details, refer to the [Hook List](https://developer.salesforce.com/docs/commerce/commerce-api/guide/hook_list.html).
|
|
275
|
-
*
|
|
276
|
-
* If you would like to get a raw Response object use the other getUrlMapping function.
|
|
277
|
-
*
|
|
278
|
-
* @param options - An object containing the options for this method.
|
|
279
|
-
* @param options.parameters - An object containing the parameters for this method.
|
|
280
|
-
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
|
|
281
|
-
* @param options.parameters.urlSegment - The part of the requested URL that comes after the domain name. For example, the urlSegment for \"www.abc.com/blue/new-arrivals/tops\" is \"blue/new-arrivals/tops\".
|
|
282
|
-
There's no limit on the length of the urlSegment. However, for this endpoint, the maximum allowed length of the URL (after URL encoding) is 2047 characters.
|
|
283
|
-
Make this field URL-encoded so that it properly handles special values such as whitespace. If a urlSegment includes a query string, a 404 error code is returned.
|
|
284
|
-
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
|
|
285
|
-
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
|
|
286
|
-
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
|
|
287
|
-
*
|
|
288
|
-
* @returns A promise of type UrlMapping.
|
|
289
|
-
*/
|
|
290
|
-
getUrlMapping(options?: RequireParametersUnlessAllAreOptional<{
|
|
291
|
-
parameters?: CompositeParameters<{
|
|
292
|
-
organizationId: string;
|
|
293
|
-
urlSegment: string;
|
|
294
|
-
siteId: string;
|
|
295
|
-
locale?: LocaleCode$0;
|
|
296
|
-
} & QueryParameters, ConfigParameters>;
|
|
297
|
-
headers?: {
|
|
298
|
-
[key: string]: string;
|
|
299
|
-
};
|
|
300
|
-
}>): Promise<UrlMapping>;
|
|
301
|
-
/**
|
|
302
|
-
* The mapping information is based on URL rules and redirects that are set up in Business Manager.
|
|
303
|
-
For more information about prerequisites and sample usage, see [URL Resolution](/docs/commerce/commerce-api/guide/url-resolution.html).
|
|
304
|
-
You can customize the behavior of this endpoint by using hooks. For details, refer to the [Hook List](https://developer.salesforce.com/docs/commerce/commerce-api/guide/hook_list.html).
|
|
305
|
-
*
|
|
306
|
-
* @param options - An object containing the options for this method.
|
|
307
|
-
* @param options.parameters - An object containing the parameters for this method.
|
|
308
|
-
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
|
|
309
|
-
* @param options.parameters.urlSegment - The part of the requested URL that comes after the domain name. For example, the urlSegment for \"www.abc.com/blue/new-arrivals/tops\" is \"blue/new-arrivals/tops\".
|
|
310
|
-
There's no limit on the length of the urlSegment. However, for this endpoint, the maximum allowed length of the URL (after URL encoding) is 2047 characters.
|
|
311
|
-
Make this field URL-encoded so that it properly handles special values such as whitespace. If a urlSegment includes a query string, a 404 error code is returned.
|
|
312
|
-
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
|
|
313
|
-
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
|
|
314
|
-
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
|
|
315
|
-
* @param rawResponse - Set to true to return entire Response object instead of DTO.
|
|
316
|
-
*
|
|
317
|
-
* @returns A promise of type Response if rawResponse is true, a promise of type UrlMapping otherwise.
|
|
318
|
-
*/
|
|
319
|
-
getUrlMapping<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
|
|
320
|
-
parameters?: CompositeParameters<{
|
|
321
|
-
organizationId: string;
|
|
322
|
-
urlSegment: string;
|
|
323
|
-
siteId: string;
|
|
324
|
-
locale?: LocaleCode$0;
|
|
325
|
-
} & QueryParameters, ConfigParameters>;
|
|
326
|
-
headers?: {
|
|
327
|
-
[key: string]: string;
|
|
328
|
-
};
|
|
329
|
-
}>, rawResponse?: T): Promise<T extends true ? Response : UrlMapping>;
|
|
330
|
-
}
|
|
331
|
-
declare namespace ShopperSEOApiTypes {
|
|
332
|
-
/*
|
|
333
|
-
* Copyright (c) 2023, Salesforce, Inc.
|
|
334
|
-
* All rights reserved.
|
|
335
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
336
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
337
|
-
*/
|
|
338
|
-
/**
|
|
339
|
-
* Makes a type easier to read.
|
|
340
|
-
*/
|
|
341
|
-
type Prettify<T> = NonNullable<{
|
|
342
|
-
[K in keyof T]: T[K];
|
|
343
|
-
}>;
|
|
344
|
-
/**
|
|
345
|
-
* Generates the types required on a method, based on those provided in the config.
|
|
346
|
-
*/
|
|
347
|
-
type CompositeParameters<MethodParameters extends Record<string, unknown>, ConfigParameters extends Record<string, unknown>> = Prettify<Omit<MethodParameters, keyof ConfigParameters> & Partial<MethodParameters>>;
|
|
348
|
-
/**
|
|
349
|
-
* If an object has a `parameters` property, and the `parameters` object has required properties,
|
|
350
|
-
* then the `parameters` property on the root object is marked as required.
|
|
351
|
-
*/
|
|
352
|
-
type RequireParametersUnlessAllAreOptional<T extends {
|
|
353
|
-
parameters?: Record<string, unknown>;
|
|
354
|
-
}> = Record<string, never> extends NonNullable<T["parameters"]> ? T : Prettify<T & Required<Pick<T, "parameters">>>;
|
|
355
|
-
/**
|
|
356
|
-
* Template parameters used in the base URI of all API endpoints. `version` will default to `"v1"`
|
|
357
|
-
* if not specified.
|
|
358
|
-
*/
|
|
359
|
-
interface BaseUriParameters {
|
|
360
|
-
shortCode: string;
|
|
361
|
-
}
|
|
362
|
-
type LocaleCode = {
|
|
363
|
-
[key: string]: any;
|
|
364
|
-
};
|
|
365
|
-
/**
|
|
366
|
-
* Generic interface for path parameters.
|
|
367
|
-
*/
|
|
368
|
-
interface PathParameters {
|
|
369
|
-
[key: string]: string | number | boolean;
|
|
370
|
-
}
|
|
371
|
-
/**
|
|
372
|
-
* Generic interface for query parameters.
|
|
373
|
-
*/
|
|
374
|
-
interface QueryParameters {
|
|
375
|
-
[key: string]: string | number | boolean | string[] | number[] | LocaleCode;
|
|
376
|
-
}
|
|
377
|
-
/**
|
|
378
|
-
* Generic interface for all parameter types.
|
|
379
|
-
*/
|
|
380
|
-
type UrlParameters = PathParameters | QueryParameters;
|
|
381
|
-
/**
|
|
382
|
-
* Custom query parameter type with any string prefixed with `c_` as the key and the allowed
|
|
383
|
-
* types for query parameters for the value.
|
|
384
|
-
*/
|
|
385
|
-
type CustomQueryParameters = {
|
|
386
|
-
[key in `c_${string}`]: string | number | boolean | string[] | number[];
|
|
387
|
-
};
|
|
388
|
-
/**
|
|
389
|
-
* Custom body request type with any string prefixed with `c_` as the key and the allowed
|
|
390
|
-
* types for the value.
|
|
391
|
-
*/
|
|
392
|
-
type CustomRequestBody = {
|
|
393
|
-
[key in `c_${string}`]: string | number | boolean | string[] | number[] | {
|
|
394
|
-
[key: string]: unknown;
|
|
395
|
-
};
|
|
396
|
-
};
|
|
397
|
-
/**
|
|
398
|
-
* Alias for `RequestInit` from TypeScript's DOM lib, to more clearly differentiate
|
|
399
|
-
* it from the `RequestInit` provided by node-fetch.
|
|
400
|
-
*/
|
|
401
|
-
type BrowserRequestInit = RequestInit;
|
|
402
|
-
/**
|
|
403
|
-
* Any properties supported in either the browser or node are accepted.
|
|
404
|
-
* Using the right properties in the right context is left to the user.
|
|
405
|
-
*/
|
|
406
|
-
type FetchOptions = NodeRequestInit & BrowserRequestInit;
|
|
407
|
-
/**
|
|
408
|
-
* Base options that can be passed to the `ClientConfig` class.
|
|
409
|
-
*/
|
|
410
|
-
interface ClientConfigInit<Params extends BaseUriParameters> {
|
|
411
|
-
baseUri?: string;
|
|
412
|
-
proxy?: string;
|
|
413
|
-
headers?: {
|
|
414
|
-
[key: string]: string;
|
|
415
|
-
};
|
|
416
|
-
parameters: Params;
|
|
417
|
-
fetchOptions?: FetchOptions;
|
|
418
|
-
transformRequest?: (data: unknown, headers: {
|
|
419
|
-
[key: string]: string;
|
|
420
|
-
}) => Required<FetchOptions>["body"];
|
|
421
|
-
throwOnBadResponse?: boolean;
|
|
422
|
-
}
|
|
423
|
-
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
424
|
-
/**
|
|
425
|
-
* Configuration parameters common to Commerce SDK clients
|
|
426
|
-
*/
|
|
427
|
-
class ClientConfig<Params extends BaseUriParameters> implements ClientConfigInit<Params> {
|
|
428
|
-
baseUri?: string;
|
|
429
|
-
proxy?: string;
|
|
430
|
-
headers: {
|
|
431
|
-
[key: string]: string;
|
|
432
|
-
};
|
|
433
|
-
parameters: Params;
|
|
434
|
-
fetchOptions: FetchOptions;
|
|
435
|
-
transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
|
|
436
|
-
throwOnBadResponse: boolean;
|
|
437
|
-
constructor(config: ClientConfigInit<Params>);
|
|
438
|
-
static readonly defaults: Pick<Required<ClientConfigInit<never>>, "transformRequest">;
|
|
439
|
-
}
|
|
440
|
-
/**
|
|
441
|
-
* A specialized value indicating the system default values for locales.
|
|
442
|
-
*/
|
|
443
|
-
type DefaultFallback = "default";
|
|
444
|
-
/**
|
|
445
|
-
* @type ErrorResponse:
|
|
446
|
-
*
|
|
447
|
-
* @property title: A short, human-readable summary of the problem type. It will not change from occurrence to occurrence of the problem, except for purposes of localization
|
|
448
|
-
* - **Max Length:** 256
|
|
449
|
-
*
|
|
450
|
-
* @property type: A URI reference [RFC3986] that identifies the problem type. This specification encourages that, when dereferenced, it provide human-readable documentation for the problem type (e.g., using HTML [W3C.REC-html5-20141028]). When this member is not present, its value is assumed to be \"about:blank\". It accepts relative URIs; this means that they must be resolved relative to the document\'s base URI, as per [RFC3986], Section 5.
|
|
451
|
-
* - **Max Length:** 2048
|
|
452
|
-
*
|
|
453
|
-
* @property detail: A human-readable explanation specific to this occurrence of the problem.
|
|
454
|
-
*
|
|
455
|
-
* @property instance: A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. It accepts relative URIs; this means that they must be resolved relative to the document\'s base URI, as per [RFC3986], Section 5.
|
|
456
|
-
* - **Max Length:** 2048
|
|
457
|
-
*
|
|
458
|
-
*/
|
|
459
|
-
type ErrorResponse = {
|
|
460
|
-
title: string;
|
|
461
|
-
type: string;
|
|
462
|
-
detail: string;
|
|
463
|
-
instance?: string;
|
|
464
|
-
} & {
|
|
465
|
-
[key: string]: any;
|
|
466
|
-
};
|
|
467
|
-
/**
|
|
468
|
-
* @type LocaleCode
|
|
469
|
-
* A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
|
|
470
|
-
*/
|
|
471
|
-
type LocaleCode$0 = DefaultFallback | string;
|
|
472
|
-
/**
|
|
473
|
-
* @type UrlMapping: The URL mapping information for a URL that a shopper clicked or typed in.
|
|
474
|
-
*
|
|
475
|
-
* @property resourceType: The type of resource that corresponds to the requested URL. If you set up a URL redirect in Business Manager, resourceType returns the corresponding destination type value from the redirect. If there\'s a URI redirect, resourceType isn\'t returned. The URL redirect feature is available from B2C Commerce version 24.3.
|
|
476
|
-
* - **Min Length:** 1
|
|
477
|
-
* - **Max Length:** 256
|
|
478
|
-
*
|
|
479
|
-
* @property resourceSubType: If the resourceType is CONTENT_ASSET, this field tells you whether the resource is a standard content asset or a Page Designer content asset. This output is available from B2C Commerce version 24.2.
|
|
480
|
-
* - **Min Length:** 1
|
|
481
|
-
* - **Max Length:** 256
|
|
482
|
-
*
|
|
483
|
-
* @property resourceId: The identifier for the resource that corresponds to the requested URL. If you set up a URL redirect in Business Manager, resourceId returns the corresponding destination ID value from the redirect. If there\'s a URI redirect, resourceId isn\'t returned. The URL redirect feature is available from B2C Commerce version 24.3.
|
|
484
|
-
* - **Min Length:** 1
|
|
485
|
-
* - **Max Length:** 256
|
|
486
|
-
*
|
|
487
|
-
* @property refinements: The refinement filters that correspond to the URL and resourceType. Refinements are returned only if all of these conditions are met - a) the resourceType is CATEGORY, b) refinements are included in the urlSegment, and c) the refinements are configured in Business Manager. This field returns a key-value pair of refinement name and refinement value. If there’s a matching URL redirect for the requested URL. the refinements output isn’t returned. The URL redirect feature is available from B2C Commerce version 24.3.
|
|
488
|
-
*
|
|
489
|
-
* @property statusCode: This field is populated only if you set up a URL redirect in Business Manager. It specifies whether the redirect is temporary (302 or 307) or permanent (301). See [Create a Redirect from a B2C Commerce URL.](https://help.salesforce.com/s/articleView?id=cc.b2c_creating_a_redirect_from_a_digital_url.htm&type=5) This parameter is available from B2C Commerce version 24.3.
|
|
490
|
-
*
|
|
491
|
-
* @property destinationUrl: This field is populated if the urlSegment resolves to a redirect. Specifies the URL you want to redirect to as an absolute or relative URL. The destinationUrl is based on your configuration in Business Manager. It\'s either a calculated value indicating the Commerce Cloud object (product, category, or content asset) URL or your specified URL. Note that an object\'s path may not necessarily match your headless storefront URLs but can be used as a reference for calculating the destinationUrl. See [Create a Redirect from a B2C Commerce URL.](https://help.salesforce.com/s/articleView?id=cc.b2c_creating_a_redirect_from_a_digital_url.htm&type=5). Available from B2C Commerce 24.3.
|
|
492
|
-
* - **Min Length:** 1
|
|
493
|
-
* - **Max Length:** 2048
|
|
494
|
-
*
|
|
495
|
-
* @property copySourceParams: This field is populated only if you set up a URL redirect in Business Manager. It’s a flag that shows whether the parameters of the source URL have been copied to the destination URL. This parameter is available from B2C Commerce version 24.3.
|
|
496
|
-
*
|
|
497
|
-
* @property additionalUrlParams: This field is populated only if you set up a URL redirect in Business Manager. It returns the parameters you want to add to the end of the URL. This parameter is available from B2C Commerce version 24.3.
|
|
498
|
-
* - **Min Length:** 1
|
|
499
|
-
* - **Max Length:** 2048
|
|
500
|
-
*
|
|
501
|
-
* @property productCategoryId: This field is populated only if you set up a URL redirect in Business Manager. It identifies the destination product\'s category ID. This field is returned only when the destination type is product. This parameter is available from B2C Commerce version 24.3.
|
|
502
|
-
* - **Min Length:** 1
|
|
503
|
-
* - **Max Length:** 256
|
|
504
|
-
*
|
|
505
|
-
*/
|
|
506
|
-
type UrlMapping = {
|
|
507
|
-
resourceType?: string;
|
|
508
|
-
resourceSubType?: string;
|
|
509
|
-
resourceId?: string;
|
|
510
|
-
refinements?: {
|
|
511
|
-
[key: string]: any;
|
|
512
|
-
};
|
|
513
|
-
statusCode?: number;
|
|
514
|
-
destinationUrl?: string;
|
|
515
|
-
copySourceParams?: boolean;
|
|
516
|
-
additionalUrlParams?: string;
|
|
517
|
-
productCategoryId?: string;
|
|
518
|
-
} & {
|
|
519
|
-
[key: string]: any;
|
|
520
|
-
};
|
|
521
|
-
type getUrlMappingQueryParameters = {
|
|
522
|
-
urlSegment: string;
|
|
523
|
-
siteId: string;
|
|
524
|
-
locale?: LocaleCode$0;
|
|
525
|
-
};
|
|
526
|
-
type getUrlMappingPathParameters = {
|
|
527
|
-
organizationId: string;
|
|
528
|
-
};
|
|
529
|
-
/**
|
|
530
|
-
* All path parameters that are used by at least one ShopperSEO method.
|
|
531
|
-
*/
|
|
532
|
-
type ShopperSEOPathParameters = Partial<getUrlMappingPathParameters & {}>;
|
|
533
|
-
/**
|
|
534
|
-
* All query parameters that are used by at least one ShopperSEO method.
|
|
535
|
-
*/
|
|
536
|
-
type ShopperSEOQueryParameters = Partial<getUrlMappingQueryParameters & {}>;
|
|
537
|
-
/**
|
|
538
|
-
* All parameters that are used by ShopperSEO.
|
|
539
|
-
*/
|
|
540
|
-
type ShopperSEOParameters = ShopperSEOPathParameters & BaseUriParameters & ShopperSEOQueryParameters;
|
|
541
|
-
/**
|
|
542
|
-
* [Shopper SEO](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-seo:Summary)
|
|
543
|
-
* ==================================
|
|
544
|
-
*
|
|
545
|
-
* *# API Overview
|
|
546
|
-
|
|
547
|
-
The Shopper SEO API Provides access to SEO-related information, such as URL mapping information.
|
|
548
|
-
|
|
549
|
-
## Authentication & Authorization
|
|
550
|
-
|
|
551
|
-
The Shopper SEO API requires a shopper access token from the [Shopper Login and API Access Service (SLAS).](https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-shopper-apis.html)
|
|
552
|
-
|
|
553
|
-
You must include the relevant scope(s) in the client ID used to generate the SLAS token. For details, see [Authorization Scopes Catalog.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/auth-z-scope-catalog.html)
|
|
554
|
-
|
|
555
|
-
## Use Cases
|
|
556
|
-
|
|
557
|
-
### URL Resolution
|
|
558
|
-
|
|
559
|
-
For information on setting up URL rules and URL redirects in Business Manager, see [URL Resolution.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/url-resolution.html)
|
|
560
|
-
|
|
561
|
-
### Caching
|
|
562
|
-
|
|
563
|
-
Caching capabilities are available for the Shopper SEO API. For details, see [Server-Side Web-Tier Caching.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html)
|
|
564
|
-
|
|
565
|
-
### Using Hooks
|
|
566
|
-
|
|
567
|
-
For details working with hooks, see [Extensibility with Hooks.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/extensibility_via_hooks.html)*<br />
|
|
568
|
-
*
|
|
569
|
-
* Simple example:
|
|
570
|
-
*
|
|
571
|
-
* ```typescript
|
|
572
|
-
* import { ShopperSEO } from "commerce-sdk-isomorphic";
|
|
573
|
-
*
|
|
574
|
-
* const clientConfig = {
|
|
575
|
-
* parameters: {
|
|
576
|
-
* clientId: "XXXXXX",
|
|
577
|
-
* organizationId: "XXXX",
|
|
578
|
-
* shortCode: "XXX",
|
|
579
|
-
* siteId: "XX"
|
|
580
|
-
* }
|
|
581
|
-
* };
|
|
582
|
-
* const shopperSEOClient = new ShopperSEO(clientConfig);
|
|
583
|
-
* ```
|
|
584
|
-
*
|
|
585
|
-
* <span style="font-size:.7em; display:block; text-align: right">
|
|
586
|
-
* API Version: 0.0.33<br />
|
|
587
|
-
* Last Updated: <br />
|
|
588
|
-
* </span>
|
|
589
|
-
*
|
|
590
|
-
*
|
|
591
|
-
*/
|
|
592
|
-
class ShopperSEO<ConfigParameters extends ShopperSEOParameters & Record<string, unknown>> {
|
|
593
|
-
// baseUri is not required on ClientConfig, but we know that we provide one in the class constructor
|
|
594
|
-
clientConfig: ClientConfig<ConfigParameters> & {
|
|
595
|
-
baseUri: string;
|
|
596
|
-
};
|
|
597
|
-
static readonly defaultBaseUri = "https://{shortCode}.api.commercecloud.salesforce.com/site/shopper-seo/v1";
|
|
598
|
-
static readonly apiPaths: {
|
|
599
|
-
getUrlMapping: string;
|
|
600
|
-
};
|
|
601
|
-
constructor(config: ClientConfigInit<ConfigParameters>);
|
|
602
|
-
static readonly paramKeys: {
|
|
603
|
-
readonly getUrlMapping: readonly [
|
|
604
|
-
"organizationId",
|
|
605
|
-
"urlSegment",
|
|
606
|
-
"siteId",
|
|
607
|
-
"locale"
|
|
608
|
-
];
|
|
609
|
-
readonly getUrlMappingRequired: readonly [
|
|
610
|
-
"organizationId",
|
|
611
|
-
"urlSegment",
|
|
612
|
-
"siteId"
|
|
613
|
-
];
|
|
614
|
-
};
|
|
615
|
-
/**
|
|
616
|
-
* The mapping information is based on URL rules and redirects that are set up in Business Manager.
|
|
617
|
-
For more information about prerequisites and sample usage, see [URL Resolution](/docs/commerce/commerce-api/guide/url-resolution.html).
|
|
618
|
-
You can customize the behavior of this endpoint by using hooks. For details, refer to the [Hook List](https://developer.salesforce.com/docs/commerce/commerce-api/guide/hook_list.html).
|
|
619
|
-
*
|
|
620
|
-
* If you would like to get a raw Response object use the other getUrlMapping function.
|
|
621
|
-
*
|
|
622
|
-
* @param options - An object containing the options for this method.
|
|
623
|
-
* @param options.parameters - An object containing the parameters for this method.
|
|
624
|
-
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
|
|
625
|
-
* @param options.parameters.urlSegment - The part of the requested URL that comes after the domain name. For example, the urlSegment for \"www.abc.com/blue/new-arrivals/tops\" is \"blue/new-arrivals/tops\".
|
|
626
|
-
There's no limit on the length of the urlSegment. However, for this endpoint, the maximum allowed length of the URL (after URL encoding) is 2047 characters.
|
|
627
|
-
Make this field URL-encoded so that it properly handles special values such as whitespace. If a urlSegment includes a query string, a 404 error code is returned.
|
|
628
|
-
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
|
|
629
|
-
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
|
|
630
|
-
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
|
|
631
|
-
*
|
|
632
|
-
* @returns A promise of type UrlMapping.
|
|
633
|
-
*/
|
|
634
|
-
getUrlMapping(options?: RequireParametersUnlessAllAreOptional<{
|
|
635
|
-
parameters?: CompositeParameters<{
|
|
636
|
-
organizationId: string;
|
|
637
|
-
urlSegment: string;
|
|
638
|
-
siteId: string;
|
|
639
|
-
locale?: LocaleCode$0;
|
|
640
|
-
} & QueryParameters, ConfigParameters>;
|
|
641
|
-
headers?: {
|
|
642
|
-
[key: string]: string;
|
|
643
|
-
};
|
|
644
|
-
}>): Promise<UrlMapping>;
|
|
645
|
-
/**
|
|
646
|
-
* The mapping information is based on URL rules and redirects that are set up in Business Manager.
|
|
647
|
-
For more information about prerequisites and sample usage, see [URL Resolution](/docs/commerce/commerce-api/guide/url-resolution.html).
|
|
648
|
-
You can customize the behavior of this endpoint by using hooks. For details, refer to the [Hook List](https://developer.salesforce.com/docs/commerce/commerce-api/guide/hook_list.html).
|
|
649
|
-
*
|
|
650
|
-
* @param options - An object containing the options for this method.
|
|
651
|
-
* @param options.parameters - An object containing the parameters for this method.
|
|
652
|
-
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
|
|
653
|
-
* @param options.parameters.urlSegment - The part of the requested URL that comes after the domain name. For example, the urlSegment for \"www.abc.com/blue/new-arrivals/tops\" is \"blue/new-arrivals/tops\".
|
|
654
|
-
There's no limit on the length of the urlSegment. However, for this endpoint, the maximum allowed length of the URL (after URL encoding) is 2047 characters.
|
|
655
|
-
Make this field URL-encoded so that it properly handles special values such as whitespace. If a urlSegment includes a query string, a 404 error code is returned.
|
|
656
|
-
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.
|
|
657
|
-
* @param options.parameters.locale - A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
|
|
658
|
-
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
|
|
659
|
-
* @param rawResponse - Set to true to return entire Response object instead of DTO.
|
|
660
|
-
*
|
|
661
|
-
* @returns A promise of type Response if rawResponse is true, a promise of type UrlMapping otherwise.
|
|
662
|
-
*/
|
|
663
|
-
getUrlMapping<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
|
|
664
|
-
parameters?: CompositeParameters<{
|
|
665
|
-
organizationId: string;
|
|
666
|
-
urlSegment: string;
|
|
667
|
-
siteId: string;
|
|
668
|
-
locale?: LocaleCode$0;
|
|
669
|
-
} & QueryParameters, ConfigParameters>;
|
|
670
|
-
headers?: {
|
|
671
|
-
[key: string]: string;
|
|
672
|
-
};
|
|
673
|
-
}>, rawResponse?: T): Promise<T extends true ? Response : UrlMapping>;
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
declare namespace ShopperSEOModelTypes {
|
|
677
|
-
/**
|
|
678
|
-
* A specialized value indicating the system default values for locales.
|
|
679
|
-
*/
|
|
680
|
-
type DefaultFallback = "default";
|
|
681
|
-
/**
|
|
682
|
-
* @type ErrorResponse:
|
|
683
|
-
*
|
|
684
|
-
* @property title: A short, human-readable summary of the problem type. It will not change from occurrence to occurrence of the problem, except for purposes of localization
|
|
685
|
-
* - **Max Length:** 256
|
|
686
|
-
*
|
|
687
|
-
* @property type: A URI reference [RFC3986] that identifies the problem type. This specification encourages that, when dereferenced, it provide human-readable documentation for the problem type (e.g., using HTML [W3C.REC-html5-20141028]). When this member is not present, its value is assumed to be \"about:blank\". It accepts relative URIs; this means that they must be resolved relative to the document\'s base URI, as per [RFC3986], Section 5.
|
|
688
|
-
* - **Max Length:** 2048
|
|
689
|
-
*
|
|
690
|
-
* @property detail: A human-readable explanation specific to this occurrence of the problem.
|
|
691
|
-
*
|
|
692
|
-
* @property instance: A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. It accepts relative URIs; this means that they must be resolved relative to the document\'s base URI, as per [RFC3986], Section 5.
|
|
693
|
-
* - **Max Length:** 2048
|
|
694
|
-
*
|
|
695
|
-
*/
|
|
696
|
-
type ErrorResponse = {
|
|
697
|
-
title: string;
|
|
698
|
-
type: string;
|
|
699
|
-
detail: string;
|
|
700
|
-
instance?: string;
|
|
701
|
-
} & {
|
|
702
|
-
[key: string]: any;
|
|
703
|
-
};
|
|
704
|
-
/**
|
|
705
|
-
* @type LocaleCode
|
|
706
|
-
* A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.
|
|
707
|
-
*/
|
|
708
|
-
type LocaleCode = DefaultFallback | string;
|
|
709
|
-
/**
|
|
710
|
-
* @type UrlMapping: The URL mapping information for a URL that a shopper clicked or typed in.
|
|
711
|
-
*
|
|
712
|
-
* @property resourceType: The type of resource that corresponds to the requested URL. If you set up a URL redirect in Business Manager, resourceType returns the corresponding destination type value from the redirect. If there\'s a URI redirect, resourceType isn\'t returned. The URL redirect feature is available from B2C Commerce version 24.3.
|
|
713
|
-
* - **Min Length:** 1
|
|
714
|
-
* - **Max Length:** 256
|
|
715
|
-
*
|
|
716
|
-
* @property resourceSubType: If the resourceType is CONTENT_ASSET, this field tells you whether the resource is a standard content asset or a Page Designer content asset. This output is available from B2C Commerce version 24.2.
|
|
717
|
-
* - **Min Length:** 1
|
|
718
|
-
* - **Max Length:** 256
|
|
719
|
-
*
|
|
720
|
-
* @property resourceId: The identifier for the resource that corresponds to the requested URL. If you set up a URL redirect in Business Manager, resourceId returns the corresponding destination ID value from the redirect. If there\'s a URI redirect, resourceId isn\'t returned. The URL redirect feature is available from B2C Commerce version 24.3.
|
|
721
|
-
* - **Min Length:** 1
|
|
722
|
-
* - **Max Length:** 256
|
|
723
|
-
*
|
|
724
|
-
* @property refinements: The refinement filters that correspond to the URL and resourceType. Refinements are returned only if all of these conditions are met - a) the resourceType is CATEGORY, b) refinements are included in the urlSegment, and c) the refinements are configured in Business Manager. This field returns a key-value pair of refinement name and refinement value. If there’s a matching URL redirect for the requested URL. the refinements output isn’t returned. The URL redirect feature is available from B2C Commerce version 24.3.
|
|
725
|
-
*
|
|
726
|
-
* @property statusCode: This field is populated only if you set up a URL redirect in Business Manager. It specifies whether the redirect is temporary (302 or 307) or permanent (301). See [Create a Redirect from a B2C Commerce URL.](https://help.salesforce.com/s/articleView?id=cc.b2c_creating_a_redirect_from_a_digital_url.htm&type=5) This parameter is available from B2C Commerce version 24.3.
|
|
727
|
-
*
|
|
728
|
-
* @property destinationUrl: This field is populated if the urlSegment resolves to a redirect. Specifies the URL you want to redirect to as an absolute or relative URL. The destinationUrl is based on your configuration in Business Manager. It\'s either a calculated value indicating the Commerce Cloud object (product, category, or content asset) URL or your specified URL. Note that an object\'s path may not necessarily match your headless storefront URLs but can be used as a reference for calculating the destinationUrl. See [Create a Redirect from a B2C Commerce URL.](https://help.salesforce.com/s/articleView?id=cc.b2c_creating_a_redirect_from_a_digital_url.htm&type=5). Available from B2C Commerce 24.3.
|
|
729
|
-
* - **Min Length:** 1
|
|
730
|
-
* - **Max Length:** 2048
|
|
731
|
-
*
|
|
732
|
-
* @property copySourceParams: This field is populated only if you set up a URL redirect in Business Manager. It’s a flag that shows whether the parameters of the source URL have been copied to the destination URL. This parameter is available from B2C Commerce version 24.3.
|
|
733
|
-
*
|
|
734
|
-
* @property additionalUrlParams: This field is populated only if you set up a URL redirect in Business Manager. It returns the parameters you want to add to the end of the URL. This parameter is available from B2C Commerce version 24.3.
|
|
735
|
-
* - **Min Length:** 1
|
|
736
|
-
* - **Max Length:** 2048
|
|
737
|
-
*
|
|
738
|
-
* @property productCategoryId: This field is populated only if you set up a URL redirect in Business Manager. It identifies the destination product\'s category ID. This field is returned only when the destination type is product. This parameter is available from B2C Commerce version 24.3.
|
|
739
|
-
* - **Min Length:** 1
|
|
740
|
-
* - **Max Length:** 256
|
|
741
|
-
*
|
|
742
|
-
*/
|
|
743
|
-
type UrlMapping = {
|
|
744
|
-
resourceType?: string;
|
|
745
|
-
resourceSubType?: string;
|
|
746
|
-
resourceId?: string;
|
|
747
|
-
refinements?: {
|
|
748
|
-
[key: string]: any;
|
|
749
|
-
};
|
|
750
|
-
statusCode?: number;
|
|
751
|
-
destinationUrl?: string;
|
|
752
|
-
copySourceParams?: boolean;
|
|
753
|
-
additionalUrlParams?: string;
|
|
754
|
-
productCategoryId?: string;
|
|
755
|
-
} & {
|
|
756
|
-
[key: string]: any;
|
|
757
|
-
};
|
|
758
|
-
}
|
|
759
|
-
declare namespace ShopperSEOTypes {
|
|
760
|
-
type ShopperSEOPathParameters = ShopperSEOApiTypes.ShopperSEOPathParameters;
|
|
761
|
-
type ShopperSEOQueryParameters = ShopperSEOApiTypes.ShopperSEOQueryParameters;
|
|
762
|
-
type getUrlMappingQueryParameters = ShopperSEOApiTypes.getUrlMappingQueryParameters;
|
|
763
|
-
type getUrlMappingPathParameters = ShopperSEOApiTypes.getUrlMappingPathParameters;
|
|
764
|
-
type DefaultFallback = ShopperSEOModelTypes.DefaultFallback;
|
|
765
|
-
type ErrorResponse = ShopperSEOModelTypes.ErrorResponse;
|
|
766
|
-
type LocaleCode = ShopperSEOModelTypes.LocaleCode;
|
|
767
|
-
type UrlMapping = ShopperSEOModelTypes.UrlMapping;
|
|
768
|
-
}
|
|
769
|
-
export { defaultBaseUri, getUrlMappingQueryParameters, getUrlMappingPathParameters, ShopperSEOPathParameters, ShopperSEOQueryParameters, ShopperSEOParameters, ShopperSEO, DefaultFallback, ErrorResponse, LocaleCode$0 as LocaleCode, UrlMapping, ShopperSEOTypes };
|