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
|
@@ -1,601 +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/configuration/shopper-configurations/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
|
-
* @type ErrorResponse:
|
|
98
|
-
*
|
|
99
|
-
* @property title: A short, human-readable summary of the problem type.
|
|
100
|
-
* - **Max Length:** 256
|
|
101
|
-
*
|
|
102
|
-
* @property type: A URI reference that identifies the problem type.
|
|
103
|
-
* - **Max Length:** 2048
|
|
104
|
-
*
|
|
105
|
-
* @property detail: A human-readable explanation specific to this occurrence of the problem.
|
|
106
|
-
*
|
|
107
|
-
* @property instance: A URI reference that identifies the specific occurrence of the problem.
|
|
108
|
-
* - **Max Length:** 2048
|
|
109
|
-
*
|
|
110
|
-
*/
|
|
111
|
-
type ErrorResponse = {
|
|
112
|
-
title: string;
|
|
113
|
-
type: string;
|
|
114
|
-
detail: string;
|
|
115
|
-
instance?: string;
|
|
116
|
-
} & {
|
|
117
|
-
[key: string]: any;
|
|
118
|
-
};
|
|
119
|
-
/**
|
|
120
|
-
* @type ModelConfiguration: Configuration object
|
|
121
|
-
*
|
|
122
|
-
* @property id: identifier
|
|
123
|
-
* - **Max Length:** 255
|
|
124
|
-
*
|
|
125
|
-
* @property value: value for identifier
|
|
126
|
-
* - **Max Length:** 255
|
|
127
|
-
*
|
|
128
|
-
* @property configurationType: type of configuration value
|
|
129
|
-
* - **Max Length:** 255
|
|
130
|
-
*
|
|
131
|
-
*/
|
|
132
|
-
type ModelConfiguration = {
|
|
133
|
-
id: string;
|
|
134
|
-
value: any | null;
|
|
135
|
-
configurationType?: string;
|
|
136
|
-
} & {
|
|
137
|
-
[key: string]: any;
|
|
138
|
-
};
|
|
139
|
-
/**
|
|
140
|
-
* @type SiteConfiguration: Site Configuration object
|
|
141
|
-
*
|
|
142
|
-
* @property configurations: List configurations for the instance and site
|
|
143
|
-
*
|
|
144
|
-
*/
|
|
145
|
-
type SiteConfiguration = {
|
|
146
|
-
configurations: Array<ModelConfiguration>;
|
|
147
|
-
} & {
|
|
148
|
-
[key: string]: any;
|
|
149
|
-
};
|
|
150
|
-
type getConfigurationsQueryParameters = {
|
|
151
|
-
siteId: string;
|
|
152
|
-
};
|
|
153
|
-
type getConfigurationsPathParameters = {
|
|
154
|
-
organizationId: string;
|
|
155
|
-
};
|
|
156
|
-
/**
|
|
157
|
-
* All path parameters that are used by at least one ShopperConfigurations method.
|
|
158
|
-
*/
|
|
159
|
-
type ShopperConfigurationsPathParameters = Partial<getConfigurationsPathParameters & {}>;
|
|
160
|
-
/**
|
|
161
|
-
* All query parameters that are used by at least one ShopperConfigurations method.
|
|
162
|
-
*/
|
|
163
|
-
type ShopperConfigurationsQueryParameters = Partial<getConfigurationsQueryParameters & {}>;
|
|
164
|
-
/**
|
|
165
|
-
* All parameters that are used by ShopperConfigurations.
|
|
166
|
-
*/
|
|
167
|
-
type ShopperConfigurationsParameters = ShopperConfigurationsPathParameters & BaseUriParameters & ShopperConfigurationsQueryParameters;
|
|
168
|
-
/**
|
|
169
|
-
* [Shopper Configurations](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-configurations:Summary)
|
|
170
|
-
* ==================================
|
|
171
|
-
*
|
|
172
|
-
* *<shopper-configurations-description.md>*<br />
|
|
173
|
-
*
|
|
174
|
-
* Simple example:
|
|
175
|
-
*
|
|
176
|
-
* ```typescript
|
|
177
|
-
* import { ShopperConfigurations } from "commerce-sdk-isomorphic";
|
|
178
|
-
*
|
|
179
|
-
* const clientConfig = {
|
|
180
|
-
* parameters: {
|
|
181
|
-
* clientId: "XXXXXX",
|
|
182
|
-
* organizationId: "XXXX",
|
|
183
|
-
* shortCode: "XXX",
|
|
184
|
-
* siteId: "XX"
|
|
185
|
-
* }
|
|
186
|
-
* };
|
|
187
|
-
* const shopperConfigurationsClient = new ShopperConfigurations(clientConfig);
|
|
188
|
-
* ```
|
|
189
|
-
*
|
|
190
|
-
* <span style="font-size:.7em; display:block; text-align: right">
|
|
191
|
-
* API Version: 0.0.33<br />
|
|
192
|
-
* Last Updated: <br />
|
|
193
|
-
* </span>
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*/
|
|
197
|
-
declare class ShopperConfigurations<ConfigParameters extends ShopperConfigurationsParameters & Record<string, unknown>> {
|
|
198
|
-
// baseUri is not required on ClientConfig, but we know that we provide one in the class constructor
|
|
199
|
-
clientConfig: ClientConfig<ConfigParameters> & {
|
|
200
|
-
baseUri: string;
|
|
201
|
-
};
|
|
202
|
-
static readonly defaultBaseUri = "https://{shortCode}.api.commercecloud.salesforce.com/configuration/shopper-configurations/v1";
|
|
203
|
-
static readonly apiPaths: {
|
|
204
|
-
getConfigurations: string;
|
|
205
|
-
};
|
|
206
|
-
constructor(config: ClientConfigInit<ConfigParameters>);
|
|
207
|
-
static readonly paramKeys: {
|
|
208
|
-
readonly getConfigurations: readonly [
|
|
209
|
-
"organizationId",
|
|
210
|
-
"siteId"
|
|
211
|
-
];
|
|
212
|
-
readonly getConfigurationsRequired: readonly [
|
|
213
|
-
"organizationId",
|
|
214
|
-
"siteId"
|
|
215
|
-
];
|
|
216
|
-
};
|
|
217
|
-
/**
|
|
218
|
-
* Retrieves configurations for the specified organization and site.
|
|
219
|
-
*
|
|
220
|
-
* If you would like to get a raw Response object use the other getConfigurations function.
|
|
221
|
-
*
|
|
222
|
-
* @param options - An object containing the options for this method.
|
|
223
|
-
* @param options.parameters - An object containing the parameters for this method.
|
|
224
|
-
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
|
|
225
|
-
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of.
|
|
226
|
-
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
|
|
227
|
-
*
|
|
228
|
-
* @returns A promise of type SiteConfiguration.
|
|
229
|
-
*/
|
|
230
|
-
getConfigurations(options?: RequireParametersUnlessAllAreOptional<{
|
|
231
|
-
parameters?: CompositeParameters<{
|
|
232
|
-
organizationId: string;
|
|
233
|
-
siteId: string;
|
|
234
|
-
} & QueryParameters, ConfigParameters>;
|
|
235
|
-
headers?: {
|
|
236
|
-
[key: string]: string;
|
|
237
|
-
};
|
|
238
|
-
}>): Promise<SiteConfiguration>;
|
|
239
|
-
/**
|
|
240
|
-
* Retrieves configurations for the specified organization and site.
|
|
241
|
-
*
|
|
242
|
-
* @param options - An object containing the options for this method.
|
|
243
|
-
* @param options.parameters - An object containing the parameters for this method.
|
|
244
|
-
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
|
|
245
|
-
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of.
|
|
246
|
-
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
|
|
247
|
-
* @param rawResponse - Set to true to return entire Response object instead of DTO.
|
|
248
|
-
*
|
|
249
|
-
* @returns A promise of type Response if rawResponse is true, a promise of type SiteConfiguration otherwise.
|
|
250
|
-
*/
|
|
251
|
-
getConfigurations<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
|
|
252
|
-
parameters?: CompositeParameters<{
|
|
253
|
-
organizationId: string;
|
|
254
|
-
siteId: string;
|
|
255
|
-
} & QueryParameters, ConfigParameters>;
|
|
256
|
-
headers?: {
|
|
257
|
-
[key: string]: string;
|
|
258
|
-
};
|
|
259
|
-
}>, rawResponse?: T): Promise<T extends true ? Response : SiteConfiguration>;
|
|
260
|
-
}
|
|
261
|
-
declare namespace ShopperConfigurationsApiTypes {
|
|
262
|
-
/*
|
|
263
|
-
* Copyright (c) 2023, Salesforce, Inc.
|
|
264
|
-
* All rights reserved.
|
|
265
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
266
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
267
|
-
*/
|
|
268
|
-
/**
|
|
269
|
-
* Makes a type easier to read.
|
|
270
|
-
*/
|
|
271
|
-
type Prettify<T> = NonNullable<{
|
|
272
|
-
[K in keyof T]: T[K];
|
|
273
|
-
}>;
|
|
274
|
-
/**
|
|
275
|
-
* Generates the types required on a method, based on those provided in the config.
|
|
276
|
-
*/
|
|
277
|
-
type CompositeParameters<MethodParameters extends Record<string, unknown>, ConfigParameters extends Record<string, unknown>> = Prettify<Omit<MethodParameters, keyof ConfigParameters> & Partial<MethodParameters>>;
|
|
278
|
-
/**
|
|
279
|
-
* If an object has a `parameters` property, and the `parameters` object has required properties,
|
|
280
|
-
* then the `parameters` property on the root object is marked as required.
|
|
281
|
-
*/
|
|
282
|
-
type RequireParametersUnlessAllAreOptional<T extends {
|
|
283
|
-
parameters?: Record<string, unknown>;
|
|
284
|
-
}> = Record<string, never> extends NonNullable<T["parameters"]> ? T : Prettify<T & Required<Pick<T, "parameters">>>;
|
|
285
|
-
/**
|
|
286
|
-
* Template parameters used in the base URI of all API endpoints. `version` will default to `"v1"`
|
|
287
|
-
* if not specified.
|
|
288
|
-
*/
|
|
289
|
-
interface BaseUriParameters {
|
|
290
|
-
shortCode: string;
|
|
291
|
-
}
|
|
292
|
-
type LocaleCode = {
|
|
293
|
-
[key: string]: any;
|
|
294
|
-
};
|
|
295
|
-
/**
|
|
296
|
-
* Generic interface for path parameters.
|
|
297
|
-
*/
|
|
298
|
-
interface PathParameters {
|
|
299
|
-
[key: string]: string | number | boolean;
|
|
300
|
-
}
|
|
301
|
-
/**
|
|
302
|
-
* Generic interface for query parameters.
|
|
303
|
-
*/
|
|
304
|
-
interface QueryParameters {
|
|
305
|
-
[key: string]: string | number | boolean | string[] | number[] | LocaleCode;
|
|
306
|
-
}
|
|
307
|
-
/**
|
|
308
|
-
* Generic interface for all parameter types.
|
|
309
|
-
*/
|
|
310
|
-
type UrlParameters = PathParameters | QueryParameters;
|
|
311
|
-
/**
|
|
312
|
-
* Custom query parameter type with any string prefixed with `c_` as the key and the allowed
|
|
313
|
-
* types for query parameters for the value.
|
|
314
|
-
*/
|
|
315
|
-
type CustomQueryParameters = {
|
|
316
|
-
[key in `c_${string}`]: string | number | boolean | string[] | number[];
|
|
317
|
-
};
|
|
318
|
-
/**
|
|
319
|
-
* Custom body request type with any string prefixed with `c_` as the key and the allowed
|
|
320
|
-
* types for the value.
|
|
321
|
-
*/
|
|
322
|
-
type CustomRequestBody = {
|
|
323
|
-
[key in `c_${string}`]: string | number | boolean | string[] | number[] | {
|
|
324
|
-
[key: string]: unknown;
|
|
325
|
-
};
|
|
326
|
-
};
|
|
327
|
-
/**
|
|
328
|
-
* Alias for `RequestInit` from TypeScript's DOM lib, to more clearly differentiate
|
|
329
|
-
* it from the `RequestInit` provided by node-fetch.
|
|
330
|
-
*/
|
|
331
|
-
type BrowserRequestInit = RequestInit;
|
|
332
|
-
/**
|
|
333
|
-
* Any properties supported in either the browser or node are accepted.
|
|
334
|
-
* Using the right properties in the right context is left to the user.
|
|
335
|
-
*/
|
|
336
|
-
type FetchOptions = NodeRequestInit & BrowserRequestInit;
|
|
337
|
-
/**
|
|
338
|
-
* Base options that can be passed to the `ClientConfig` class.
|
|
339
|
-
*/
|
|
340
|
-
interface ClientConfigInit<Params extends BaseUriParameters> {
|
|
341
|
-
baseUri?: string;
|
|
342
|
-
proxy?: string;
|
|
343
|
-
headers?: {
|
|
344
|
-
[key: string]: string;
|
|
345
|
-
};
|
|
346
|
-
parameters: Params;
|
|
347
|
-
fetchOptions?: FetchOptions;
|
|
348
|
-
transformRequest?: (data: unknown, headers: {
|
|
349
|
-
[key: string]: string;
|
|
350
|
-
}) => Required<FetchOptions>["body"];
|
|
351
|
-
throwOnBadResponse?: boolean;
|
|
352
|
-
}
|
|
353
|
-
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
354
|
-
/**
|
|
355
|
-
* Configuration parameters common to Commerce SDK clients
|
|
356
|
-
*/
|
|
357
|
-
class ClientConfig<Params extends BaseUriParameters> implements ClientConfigInit<Params> {
|
|
358
|
-
baseUri?: string;
|
|
359
|
-
proxy?: string;
|
|
360
|
-
headers: {
|
|
361
|
-
[key: string]: string;
|
|
362
|
-
};
|
|
363
|
-
parameters: Params;
|
|
364
|
-
fetchOptions: FetchOptions;
|
|
365
|
-
transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
|
|
366
|
-
throwOnBadResponse: boolean;
|
|
367
|
-
constructor(config: ClientConfigInit<Params>);
|
|
368
|
-
static readonly defaults: Pick<Required<ClientConfigInit<never>>, "transformRequest">;
|
|
369
|
-
}
|
|
370
|
-
/**
|
|
371
|
-
* @type ErrorResponse:
|
|
372
|
-
*
|
|
373
|
-
* @property title: A short, human-readable summary of the problem type.
|
|
374
|
-
* - **Max Length:** 256
|
|
375
|
-
*
|
|
376
|
-
* @property type: A URI reference that identifies the problem type.
|
|
377
|
-
* - **Max Length:** 2048
|
|
378
|
-
*
|
|
379
|
-
* @property detail: A human-readable explanation specific to this occurrence of the problem.
|
|
380
|
-
*
|
|
381
|
-
* @property instance: A URI reference that identifies the specific occurrence of the problem.
|
|
382
|
-
* - **Max Length:** 2048
|
|
383
|
-
*
|
|
384
|
-
*/
|
|
385
|
-
type ErrorResponse = {
|
|
386
|
-
title: string;
|
|
387
|
-
type: string;
|
|
388
|
-
detail: string;
|
|
389
|
-
instance?: string;
|
|
390
|
-
} & {
|
|
391
|
-
[key: string]: any;
|
|
392
|
-
};
|
|
393
|
-
/**
|
|
394
|
-
* @type ModelConfiguration: Configuration object
|
|
395
|
-
*
|
|
396
|
-
* @property id: identifier
|
|
397
|
-
* - **Max Length:** 255
|
|
398
|
-
*
|
|
399
|
-
* @property value: value for identifier
|
|
400
|
-
* - **Max Length:** 255
|
|
401
|
-
*
|
|
402
|
-
* @property configurationType: type of configuration value
|
|
403
|
-
* - **Max Length:** 255
|
|
404
|
-
*
|
|
405
|
-
*/
|
|
406
|
-
type ModelConfiguration = {
|
|
407
|
-
id: string;
|
|
408
|
-
value: any | null;
|
|
409
|
-
configurationType?: string;
|
|
410
|
-
} & {
|
|
411
|
-
[key: string]: any;
|
|
412
|
-
};
|
|
413
|
-
/**
|
|
414
|
-
* @type SiteConfiguration: Site Configuration object
|
|
415
|
-
*
|
|
416
|
-
* @property configurations: List configurations for the instance and site
|
|
417
|
-
*
|
|
418
|
-
*/
|
|
419
|
-
type SiteConfiguration = {
|
|
420
|
-
configurations: Array<ModelConfiguration>;
|
|
421
|
-
} & {
|
|
422
|
-
[key: string]: any;
|
|
423
|
-
};
|
|
424
|
-
type getConfigurationsQueryParameters = {
|
|
425
|
-
siteId: string;
|
|
426
|
-
};
|
|
427
|
-
type getConfigurationsPathParameters = {
|
|
428
|
-
organizationId: string;
|
|
429
|
-
};
|
|
430
|
-
/**
|
|
431
|
-
* All path parameters that are used by at least one ShopperConfigurations method.
|
|
432
|
-
*/
|
|
433
|
-
type ShopperConfigurationsPathParameters = Partial<getConfigurationsPathParameters & {}>;
|
|
434
|
-
/**
|
|
435
|
-
* All query parameters that are used by at least one ShopperConfigurations method.
|
|
436
|
-
*/
|
|
437
|
-
type ShopperConfigurationsQueryParameters = Partial<getConfigurationsQueryParameters & {}>;
|
|
438
|
-
/**
|
|
439
|
-
* All parameters that are used by ShopperConfigurations.
|
|
440
|
-
*/
|
|
441
|
-
type ShopperConfigurationsParameters = ShopperConfigurationsPathParameters & BaseUriParameters & ShopperConfigurationsQueryParameters;
|
|
442
|
-
/**
|
|
443
|
-
* [Shopper Configurations](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-configurations:Summary)
|
|
444
|
-
* ==================================
|
|
445
|
-
*
|
|
446
|
-
* *<shopper-configurations-description.md>*<br />
|
|
447
|
-
*
|
|
448
|
-
* Simple example:
|
|
449
|
-
*
|
|
450
|
-
* ```typescript
|
|
451
|
-
* import { ShopperConfigurations } from "commerce-sdk-isomorphic";
|
|
452
|
-
*
|
|
453
|
-
* const clientConfig = {
|
|
454
|
-
* parameters: {
|
|
455
|
-
* clientId: "XXXXXX",
|
|
456
|
-
* organizationId: "XXXX",
|
|
457
|
-
* shortCode: "XXX",
|
|
458
|
-
* siteId: "XX"
|
|
459
|
-
* }
|
|
460
|
-
* };
|
|
461
|
-
* const shopperConfigurationsClient = new ShopperConfigurations(clientConfig);
|
|
462
|
-
* ```
|
|
463
|
-
*
|
|
464
|
-
* <span style="font-size:.7em; display:block; text-align: right">
|
|
465
|
-
* API Version: 0.0.33<br />
|
|
466
|
-
* Last Updated: <br />
|
|
467
|
-
* </span>
|
|
468
|
-
*
|
|
469
|
-
*
|
|
470
|
-
*/
|
|
471
|
-
class ShopperConfigurations<ConfigParameters extends ShopperConfigurationsParameters & Record<string, unknown>> {
|
|
472
|
-
// baseUri is not required on ClientConfig, but we know that we provide one in the class constructor
|
|
473
|
-
clientConfig: ClientConfig<ConfigParameters> & {
|
|
474
|
-
baseUri: string;
|
|
475
|
-
};
|
|
476
|
-
static readonly defaultBaseUri = "https://{shortCode}.api.commercecloud.salesforce.com/configuration/shopper-configurations/v1";
|
|
477
|
-
static readonly apiPaths: {
|
|
478
|
-
getConfigurations: string;
|
|
479
|
-
};
|
|
480
|
-
constructor(config: ClientConfigInit<ConfigParameters>);
|
|
481
|
-
static readonly paramKeys: {
|
|
482
|
-
readonly getConfigurations: readonly [
|
|
483
|
-
"organizationId",
|
|
484
|
-
"siteId"
|
|
485
|
-
];
|
|
486
|
-
readonly getConfigurationsRequired: readonly [
|
|
487
|
-
"organizationId",
|
|
488
|
-
"siteId"
|
|
489
|
-
];
|
|
490
|
-
};
|
|
491
|
-
/**
|
|
492
|
-
* Retrieves configurations for the specified organization and site.
|
|
493
|
-
*
|
|
494
|
-
* If you would like to get a raw Response object use the other getConfigurations function.
|
|
495
|
-
*
|
|
496
|
-
* @param options - An object containing the options for this method.
|
|
497
|
-
* @param options.parameters - An object containing the parameters for this method.
|
|
498
|
-
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
|
|
499
|
-
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of.
|
|
500
|
-
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
|
|
501
|
-
*
|
|
502
|
-
* @returns A promise of type SiteConfiguration.
|
|
503
|
-
*/
|
|
504
|
-
getConfigurations(options?: RequireParametersUnlessAllAreOptional<{
|
|
505
|
-
parameters?: CompositeParameters<{
|
|
506
|
-
organizationId: string;
|
|
507
|
-
siteId: string;
|
|
508
|
-
} & QueryParameters, ConfigParameters>;
|
|
509
|
-
headers?: {
|
|
510
|
-
[key: string]: string;
|
|
511
|
-
};
|
|
512
|
-
}>): Promise<SiteConfiguration>;
|
|
513
|
-
/**
|
|
514
|
-
* Retrieves configurations for the specified organization and site.
|
|
515
|
-
*
|
|
516
|
-
* @param options - An object containing the options for this method.
|
|
517
|
-
* @param options.parameters - An object containing the parameters for this method.
|
|
518
|
-
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
|
|
519
|
-
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of.
|
|
520
|
-
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
|
|
521
|
-
* @param rawResponse - Set to true to return entire Response object instead of DTO.
|
|
522
|
-
*
|
|
523
|
-
* @returns A promise of type Response if rawResponse is true, a promise of type SiteConfiguration otherwise.
|
|
524
|
-
*/
|
|
525
|
-
getConfigurations<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
|
|
526
|
-
parameters?: CompositeParameters<{
|
|
527
|
-
organizationId: string;
|
|
528
|
-
siteId: string;
|
|
529
|
-
} & QueryParameters, ConfigParameters>;
|
|
530
|
-
headers?: {
|
|
531
|
-
[key: string]: string;
|
|
532
|
-
};
|
|
533
|
-
}>, rawResponse?: T): Promise<T extends true ? Response : SiteConfiguration>;
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
declare namespace ShopperConfigurationsModelTypes {
|
|
537
|
-
/**
|
|
538
|
-
* @type ErrorResponse:
|
|
539
|
-
*
|
|
540
|
-
* @property title: A short, human-readable summary of the problem type.
|
|
541
|
-
* - **Max Length:** 256
|
|
542
|
-
*
|
|
543
|
-
* @property type: A URI reference that identifies the problem type.
|
|
544
|
-
* - **Max Length:** 2048
|
|
545
|
-
*
|
|
546
|
-
* @property detail: A human-readable explanation specific to this occurrence of the problem.
|
|
547
|
-
*
|
|
548
|
-
* @property instance: A URI reference that identifies the specific occurrence of the problem.
|
|
549
|
-
* - **Max Length:** 2048
|
|
550
|
-
*
|
|
551
|
-
*/
|
|
552
|
-
type ErrorResponse = {
|
|
553
|
-
title: string;
|
|
554
|
-
type: string;
|
|
555
|
-
detail: string;
|
|
556
|
-
instance?: string;
|
|
557
|
-
} & {
|
|
558
|
-
[key: string]: any;
|
|
559
|
-
};
|
|
560
|
-
/**
|
|
561
|
-
* @type ModelConfiguration: Configuration object
|
|
562
|
-
*
|
|
563
|
-
* @property id: identifier
|
|
564
|
-
* - **Max Length:** 255
|
|
565
|
-
*
|
|
566
|
-
* @property value: value for identifier
|
|
567
|
-
* - **Max Length:** 255
|
|
568
|
-
*
|
|
569
|
-
* @property configurationType: type of configuration value
|
|
570
|
-
* - **Max Length:** 255
|
|
571
|
-
*
|
|
572
|
-
*/
|
|
573
|
-
type ModelConfiguration = {
|
|
574
|
-
id: string;
|
|
575
|
-
value: any | null;
|
|
576
|
-
configurationType?: string;
|
|
577
|
-
} & {
|
|
578
|
-
[key: string]: any;
|
|
579
|
-
};
|
|
580
|
-
/**
|
|
581
|
-
* @type SiteConfiguration: Site Configuration object
|
|
582
|
-
*
|
|
583
|
-
* @property configurations: List configurations for the instance and site
|
|
584
|
-
*
|
|
585
|
-
*/
|
|
586
|
-
type SiteConfiguration = {
|
|
587
|
-
configurations: Array<ModelConfiguration>;
|
|
588
|
-
} & {
|
|
589
|
-
[key: string]: any;
|
|
590
|
-
};
|
|
591
|
-
}
|
|
592
|
-
declare namespace ShopperConfigurationsTypes {
|
|
593
|
-
type ShopperConfigurationsPathParameters = ShopperConfigurationsApiTypes.ShopperConfigurationsPathParameters;
|
|
594
|
-
type ShopperConfigurationsQueryParameters = ShopperConfigurationsApiTypes.ShopperConfigurationsQueryParameters;
|
|
595
|
-
type getConfigurationsQueryParameters = ShopperConfigurationsApiTypes.getConfigurationsQueryParameters;
|
|
596
|
-
type getConfigurationsPathParameters = ShopperConfigurationsApiTypes.getConfigurationsPathParameters;
|
|
597
|
-
type ErrorResponse = ShopperConfigurationsModelTypes.ErrorResponse;
|
|
598
|
-
type ModelConfiguration = ShopperConfigurationsModelTypes.ModelConfiguration;
|
|
599
|
-
type SiteConfiguration = ShopperConfigurationsModelTypes.SiteConfiguration;
|
|
600
|
-
}
|
|
601
|
-
export { defaultBaseUri, getConfigurationsQueryParameters, getConfigurationsPathParameters, ShopperConfigurationsPathParameters, ShopperConfigurationsQueryParameters, ShopperConfigurationsParameters, ShopperConfigurations, ErrorResponse, ModelConfiguration, SiteConfiguration, ShopperConfigurationsTypes };
|