commerce-sdk-isomorphic 3.4.0 → 4.0.1-preview-shopper-test.0

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.
Files changed (86) hide show
  1. package/README.md +88 -10
  2. package/lib/clientConfig.cjs.d.ts +52 -0
  3. package/lib/clientConfig.cjs.js +1 -0
  4. package/lib/clientConfig.d.ts +52 -0
  5. package/lib/clientConfig.js +1 -0
  6. package/lib/config.cjs.d.ts +2 -0
  7. package/lib/config.cjs.js +1 -0
  8. package/lib/config.d.ts +2 -0
  9. package/lib/config.js +1 -0
  10. package/lib/helpers.cjs.d.ts +2225 -0
  11. package/lib/helpers.cjs.js +1 -0
  12. package/lib/helpers.d.ts +2225 -0
  13. package/lib/helpers.js +1 -0
  14. package/lib/index.cjs.d.ts +51500 -28554
  15. package/lib/index.cjs.js +1 -1
  16. package/lib/index.esm.d.ts +51500 -28554
  17. package/lib/index.esm.js +1 -1
  18. package/lib/responseError.cjs.d.ts +12 -0
  19. package/lib/responseError.cjs.js +1 -0
  20. package/lib/responseError.d.ts +12 -0
  21. package/lib/responseError.js +1 -0
  22. package/lib/shopperBaskets.cjs.d.ts +10259 -0
  23. package/lib/shopperBaskets.cjs.js +1 -0
  24. package/lib/shopperBaskets.d.ts +10259 -0
  25. package/lib/shopperBaskets.js +1 -0
  26. package/lib/shopperBasketsv2.cjs.d.ts +10453 -0
  27. package/lib/shopperBasketsv2.cjs.js +1 -0
  28. package/lib/shopperBasketsv2.d.ts +10453 -0
  29. package/lib/shopperBasketsv2.js +1 -0
  30. package/lib/shopperConsents.cjs.d.ts +1142 -0
  31. package/lib/shopperConsents.cjs.js +1 -0
  32. package/lib/shopperConsents.d.ts +1142 -0
  33. package/lib/shopperConsents.js +1 -0
  34. package/lib/shopperContext.cjs.d.ts +1401 -0
  35. package/lib/shopperContext.cjs.js +1 -0
  36. package/lib/shopperContext.d.ts +1401 -0
  37. package/lib/shopperContext.js +1 -0
  38. package/lib/shopperCustomers.cjs.d.ts +12185 -0
  39. package/lib/shopperCustomers.cjs.js +1 -0
  40. package/lib/shopperCustomers.d.ts +12185 -0
  41. package/lib/shopperCustomers.js +1 -0
  42. package/lib/shopperExperience.cjs.d.ts +1169 -0
  43. package/lib/shopperExperience.cjs.js +1 -0
  44. package/lib/shopperExperience.d.ts +1169 -0
  45. package/lib/shopperExperience.js +1 -0
  46. package/lib/shopperGiftCertificates.cjs.d.ts +729 -0
  47. package/lib/shopperGiftCertificates.cjs.js +1 -0
  48. package/lib/shopperGiftCertificates.d.ts +729 -0
  49. package/lib/shopperGiftCertificates.js +1 -0
  50. package/lib/shopperLogin.cjs.d.ts +3842 -0
  51. package/lib/shopperLogin.cjs.js +1 -0
  52. package/lib/shopperLogin.d.ts +3842 -0
  53. package/lib/shopperLogin.js +1 -0
  54. package/lib/shopperOrders.cjs.d.ts +5393 -0
  55. package/lib/shopperOrders.cjs.js +1 -0
  56. package/lib/shopperOrders.d.ts +5393 -0
  57. package/lib/shopperOrders.js +1 -0
  58. package/lib/shopperProducts.cjs.d.ts +3479 -0
  59. package/lib/shopperProducts.cjs.js +1 -0
  60. package/lib/shopperProducts.d.ts +3479 -0
  61. package/lib/shopperProducts.js +1 -0
  62. package/lib/shopperPromotions.cjs.d.ts +1001 -0
  63. package/lib/shopperPromotions.cjs.js +1 -0
  64. package/lib/shopperPromotions.d.ts +1001 -0
  65. package/lib/shopperPromotions.js +1 -0
  66. package/lib/shopperSearch.cjs.d.ts +3352 -0
  67. package/lib/shopperSearch.cjs.js +1 -0
  68. package/lib/shopperSearch.d.ts +3352 -0
  69. package/lib/shopperSearch.js +1 -0
  70. package/lib/shopperSeo.cjs.d.ts +769 -0
  71. package/lib/shopperSeo.cjs.js +1 -0
  72. package/lib/shopperSeo.d.ts +769 -0
  73. package/lib/shopperSeo.js +1 -0
  74. package/lib/shopperStores.cjs.d.ts +1289 -0
  75. package/lib/shopperStores.cjs.js +1 -0
  76. package/lib/shopperStores.d.ts +1289 -0
  77. package/lib/shopperStores.js +1 -0
  78. package/lib/templateUrl.cjs.d.ts +76 -0
  79. package/lib/templateUrl.cjs.js +1 -0
  80. package/lib/templateUrl.d.ts +76 -0
  81. package/lib/templateUrl.js +1 -0
  82. package/lib/version.cjs.d.ts +3 -0
  83. package/lib/version.cjs.js +1 -0
  84. package/lib/version.d.ts +3 -0
  85. package/lib/version.js +1 -0
  86. package/package.json +101 -32
@@ -0,0 +1,1001 @@
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/pricing/shopper-promotions/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 Promotion: Document representing a promotion.
130
+ *
131
+ * @property calloutMsg: The localized call-out message of the promotion.
132
+ *
133
+ * @property currency: The currency that a promotion can be applied to. A null value means that the promotion applies to all allowed currencies.
134
+ *
135
+ * @property details: The localized detailed description of the promotion.
136
+ *
137
+ * @property endDate: The end date of the promotion. This property follows the ISO8601 date time format: yyyy-MM-dd\'T\'HH:mmZ . The time zone of the date time is always UTC.
138
+ *
139
+ * @property id: The unique ID of the promotion.
140
+ *
141
+ * @property image: The URL to the promotion image.
142
+ *
143
+ * @property name: The localized name of the promotion.
144
+ *
145
+ * @property startDate: The start date of the promotion. This property follows the ISO8601 date time format: yyyy-MM-dd\'T\'HH:mmZ. The time zone of the date time is always UTC.
146
+ *
147
+ */
148
+ type Promotion = {
149
+ calloutMsg?: string;
150
+ currency?: string;
151
+ details?: string;
152
+ endDate?: string;
153
+ id: string;
154
+ image?: string;
155
+ name?: string;
156
+ startDate?: string;
157
+ } & {
158
+ [key: string]: any;
159
+ };
160
+ /**
161
+ * @type PromotionResult: Result document containing an array of promotions.
162
+ *
163
+ * @property data: The array of promotion documents.
164
+ *
165
+ * @property limit: Maximum records to retrieve per request, not to exceed the maximum defined. A limit must be at least 1 so at least one record is returned (if any match the criteria).
166
+ *
167
+ * @property total: The total number of hits that match the search\'s criteria. This can be greater than the number of results returned as search results are pagenated.
168
+ *
169
+ */
170
+ type PromotionResult = {
171
+ data: Array<Promotion>;
172
+ limit: number;
173
+ total: number;
174
+ } & {
175
+ [key: string]: any;
176
+ };
177
+ /**
178
+ * @type ResultBase: Schema defining generic list result. Each response schema of a resource requiring a list response should extend this schema. Additionally it needs to be defined what data is returned.
179
+ *
180
+ * @property limit: Maximum records to retrieve per request, not to exceed the maximum defined. A limit must be at least 1 so at least one record is returned (if any match the criteria).
181
+ *
182
+ * @property total: The total number of hits that match the search\'s criteria. This can be greater than the number of results returned as search results are pagenated.
183
+ *
184
+ */
185
+ type ResultBase = {
186
+ limit: number;
187
+ total: number;
188
+ } & {
189
+ [key: string]: any;
190
+ };
191
+ type getPromotionsQueryParameters = {
192
+ siteId: string;
193
+ ids: Array<string>;
194
+ locale?: LocaleCode$0;
195
+ };
196
+ type getPromotionsPathParameters = {
197
+ organizationId: string;
198
+ };
199
+ type getPromotionsForCampaignQueryParameters = {
200
+ siteId: string;
201
+ startDate?: string;
202
+ endDate?: string;
203
+ currency?: string;
204
+ };
205
+ type getPromotionsForCampaignPathParameters = {
206
+ campaignId: string;
207
+ organizationId: string;
208
+ };
209
+ /**
210
+ * All path parameters that are used by at least one ShopperPromotions method.
211
+ */
212
+ type ShopperPromotionsPathParameters = Partial<getPromotionsPathParameters & getPromotionsForCampaignPathParameters & {}>;
213
+ /**
214
+ * All query parameters that are used by at least one ShopperPromotions method.
215
+ */
216
+ type ShopperPromotionsQueryParameters = Partial<getPromotionsQueryParameters & getPromotionsForCampaignQueryParameters & {}>;
217
+ /**
218
+ * All parameters that are used by ShopperPromotions.
219
+ */
220
+ type ShopperPromotionsParameters = ShopperPromotionsPathParameters & BaseUriParameters & ShopperPromotionsQueryParameters;
221
+ /**
222
+ * [Shopper Promotions](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-promotions:Summary)
223
+ * ==================================
224
+ *
225
+ * *# API Overview
226
+
227
+ Retrieve information about active promotions within the context of a shopper and a site. You can use this API to retrieve promotions that you configured in the commerce platform by searching for specific promotion IDs or by searching for promotions associated with a campaign.
228
+
229
+ Caching is provided for the Shopper Promotions API. For details, see [Server-Side Web-Tier Caching.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html)
230
+
231
+ ## Authentication & Authorization
232
+
233
+ The Shopper Promotions API requires a JSON Web Token acquired via the Shopper Customers endpoint:
234
+
235
+ ```
236
+ https://{{shortcode}}.api.commercecloud.salesforce.com/customer/shopper-customers/v1/organizations/{{organizationId}}/customers/actions/login
237
+ ```
238
+
239
+ 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)
240
+
241
+ ## Use Cases
242
+
243
+ ### Get Promotion by Promotion ID
244
+
245
+ Use the Shopper Promotions API to find promotion information by the promotion ID.
246
+
247
+ For example, a customer who is browsing on a commerce shopping app built using Commerce Cloud APIs can see the details about the applied promotions in the cart.
248
+
249
+ ### Get Promotion by Campaign ID
250
+
251
+ Use the Shopper Promotions API to find promotion information by the campaign ID.
252
+
253
+ For example, a customer who is browsing on a commerce shopping app built using Commerce Cloud APIs can see the possible promotions that can be applied in the cart.
254
+
255
+ ### Use Hooks
256
+
257
+ For details working with hooks, see [Extensibility with Hooks.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/extensibility_via_hooks.html)*<br />
258
+ *
259
+ * Simple example:
260
+ *
261
+ * ```typescript
262
+ * import { ShopperPromotions } from "commerce-sdk-isomorphic";
263
+ *
264
+ * const clientConfig = {
265
+ * parameters: {
266
+ * clientId: "XXXXXX",
267
+ * organizationId: "XXXX",
268
+ * shortCode: "XXX",
269
+ * siteId: "XX"
270
+ * }
271
+ * };
272
+ * const shopperPromotionsClient = new ShopperPromotions(clientConfig);
273
+ * ```
274
+ *
275
+ * <span style="font-size:.7em; display:block; text-align: right">
276
+ * API Version: 0.0.33<br />
277
+ * Last Updated: <br />
278
+ * </span>
279
+ *
280
+ *
281
+ */
282
+ declare class ShopperPromotions<ConfigParameters extends ShopperPromotionsParameters & Record<string, unknown>> {
283
+ // baseUri is not required on ClientConfig, but we know that we provide one in the class constructor
284
+ clientConfig: ClientConfig<ConfigParameters> & {
285
+ baseUri: string;
286
+ };
287
+ static readonly defaultBaseUri = "https://{shortCode}.api.commercecloud.salesforce.com/pricing/shopper-promotions/v1";
288
+ static readonly apiPaths: {
289
+ getPromotions: string;
290
+ getPromotionsForCampaign: string;
291
+ };
292
+ constructor(config: ClientConfigInit<ConfigParameters>);
293
+ static readonly paramKeys: {
294
+ readonly getPromotions: readonly [
295
+ "organizationId",
296
+ "siteId",
297
+ "ids",
298
+ "locale"
299
+ ];
300
+ readonly getPromotionsRequired: readonly [
301
+ "organizationId",
302
+ "siteId",
303
+ "ids"
304
+ ];
305
+ readonly getPromotionsForCampaign: readonly [
306
+ "campaignId",
307
+ "organizationId",
308
+ "siteId",
309
+ "startDate",
310
+ "endDate",
311
+ "currency"
312
+ ];
313
+ readonly getPromotionsForCampaignRequired: readonly [
314
+ "campaignId",
315
+ "organizationId",
316
+ "siteId"
317
+ ];
318
+ };
319
+ /**
320
+ * In the request URL, you can specify up to 50 IDs. If you specify an ID that contains either parentheses or the separator characters, you must URL encode these characters.
321
+ Each request returns only enabled promotions as the server does not consider promotion qualifiers or schedules.
322
+ *
323
+ * If you would like to get a raw Response object use the other getPromotions function.
324
+ *
325
+ * @param options - An object containing the options for this method.
326
+ * @param options.parameters - An object containing the parameters for this method.
327
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
328
+ * @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.
329
+ * @param options.parameters.ids -
330
+ * @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.
331
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
332
+ *
333
+ * @returns A promise of type PromotionResult.
334
+ */
335
+ getPromotions(options?: RequireParametersUnlessAllAreOptional<{
336
+ parameters?: CompositeParameters<{
337
+ organizationId: string;
338
+ siteId: string;
339
+ ids: Array<string>;
340
+ locale?: LocaleCode$0;
341
+ } & QueryParameters, ConfigParameters>;
342
+ headers?: {
343
+ [key: string]: string;
344
+ };
345
+ }>): Promise<PromotionResult>;
346
+ /**
347
+ * In the request URL, you can specify up to 50 IDs. If you specify an ID that contains either parentheses or the separator characters, you must URL encode these characters.
348
+ Each request returns only enabled promotions as the server does not consider promotion qualifiers or schedules.
349
+ *
350
+ * @param options - An object containing the options for this method.
351
+ * @param options.parameters - An object containing the parameters for this method.
352
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
353
+ * @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.
354
+ * @param options.parameters.ids -
355
+ * @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.
356
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
357
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
358
+ *
359
+ * @returns A promise of type Response if rawResponse is true, a promise of type PromotionResult otherwise.
360
+ */
361
+ getPromotions<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
362
+ parameters?: CompositeParameters<{
363
+ organizationId: string;
364
+ siteId: string;
365
+ ids: Array<string>;
366
+ locale?: LocaleCode$0;
367
+ } & QueryParameters, ConfigParameters>;
368
+ headers?: {
369
+ [key: string]: string;
370
+ };
371
+ }>, rawResponse?: T): Promise<T extends true ? Response : PromotionResult>;
372
+ /**
373
+ * Retrieves promotion information using filter criteria. In the request URL, you must provide a campaign_id parameter, and you can optionally specify a date
374
+ range by providing start_date and end_date parameters. Both parameters are required to specify a date range, and
375
+ omitting one causes the server to return a MissingParameterException fault. Each request returns only enabled
376
+ promotions, since the server does not consider promotion qualifiers or schedules.
377
+ *
378
+ * If you would like to get a raw Response object use the other getPromotionsForCampaign function.
379
+ *
380
+ * @param options - An object containing the options for this method.
381
+ * @param options.parameters - An object containing the parameters for this method.
382
+ * @param options.parameters.campaignId - Find the promotions assigned to this campaign (mandatory).
383
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
384
+ * @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.
385
+ * @param options.parameters.startDate - The start date of the promotion in ISO8601 date time format: yyyy-MM-dd'T'HH:mmZ
386
+ * @param options.parameters.endDate - The end date of the promotion in ISO8601 date time format: yyyy-MM-dd'T'HH:mmZ
387
+ * @param options.parameters.currency - The currency mnemonic specified for price. This parameter is effective only for product suggestions.
388
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
389
+ *
390
+ * @returns A promise of type PromotionResult.
391
+ */
392
+ getPromotionsForCampaign(options?: RequireParametersUnlessAllAreOptional<{
393
+ parameters?: CompositeParameters<{
394
+ campaignId: string;
395
+ organizationId: string;
396
+ siteId: string;
397
+ startDate?: string;
398
+ endDate?: string;
399
+ currency?: string;
400
+ } & QueryParameters, ConfigParameters>;
401
+ headers?: {
402
+ [key: string]: string;
403
+ };
404
+ }>): Promise<PromotionResult>;
405
+ /**
406
+ * Retrieves promotion information using filter criteria. In the request URL, you must provide a campaign_id parameter, and you can optionally specify a date
407
+ range by providing start_date and end_date parameters. Both parameters are required to specify a date range, and
408
+ omitting one causes the server to return a MissingParameterException fault. Each request returns only enabled
409
+ promotions, since the server does not consider promotion qualifiers or schedules.
410
+ *
411
+ * @param options - An object containing the options for this method.
412
+ * @param options.parameters - An object containing the parameters for this method.
413
+ * @param options.parameters.campaignId - Find the promotions assigned to this campaign (mandatory).
414
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
415
+ * @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.
416
+ * @param options.parameters.startDate - The start date of the promotion in ISO8601 date time format: yyyy-MM-dd'T'HH:mmZ
417
+ * @param options.parameters.endDate - The end date of the promotion in ISO8601 date time format: yyyy-MM-dd'T'HH:mmZ
418
+ * @param options.parameters.currency - The currency mnemonic specified for price. This parameter is effective only for product suggestions.
419
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
420
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
421
+ *
422
+ * @returns A promise of type Response if rawResponse is true, a promise of type PromotionResult otherwise.
423
+ */
424
+ getPromotionsForCampaign<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
425
+ parameters?: CompositeParameters<{
426
+ campaignId: string;
427
+ organizationId: string;
428
+ siteId: string;
429
+ startDate?: string;
430
+ endDate?: string;
431
+ currency?: string;
432
+ } & QueryParameters, ConfigParameters>;
433
+ headers?: {
434
+ [key: string]: string;
435
+ };
436
+ }>, rawResponse?: T): Promise<T extends true ? Response : PromotionResult>;
437
+ }
438
+ declare namespace ShopperPromotionsApiTypes {
439
+ /*
440
+ * Copyright (c) 2023, Salesforce, Inc.
441
+ * All rights reserved.
442
+ * SPDX-License-Identifier: BSD-3-Clause
443
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
444
+ */
445
+ /**
446
+ * Makes a type easier to read.
447
+ */
448
+ type Prettify<T> = NonNullable<{
449
+ [K in keyof T]: T[K];
450
+ }>;
451
+ /**
452
+ * Generates the types required on a method, based on those provided in the config.
453
+ */
454
+ type CompositeParameters<MethodParameters extends Record<string, unknown>, ConfigParameters extends Record<string, unknown>> = Prettify<Omit<MethodParameters, keyof ConfigParameters> & Partial<MethodParameters>>;
455
+ /**
456
+ * If an object has a `parameters` property, and the `parameters` object has required properties,
457
+ * then the `parameters` property on the root object is marked as required.
458
+ */
459
+ type RequireParametersUnlessAllAreOptional<T extends {
460
+ parameters?: Record<string, unknown>;
461
+ }> = Record<string, never> extends NonNullable<T["parameters"]> ? T : Prettify<T & Required<Pick<T, "parameters">>>;
462
+ /**
463
+ * Template parameters used in the base URI of all API endpoints. `version` will default to `"v1"`
464
+ * if not specified.
465
+ */
466
+ interface BaseUriParameters {
467
+ shortCode: string;
468
+ }
469
+ type LocaleCode = {
470
+ [key: string]: any;
471
+ };
472
+ /**
473
+ * Generic interface for path parameters.
474
+ */
475
+ interface PathParameters {
476
+ [key: string]: string | number | boolean;
477
+ }
478
+ /**
479
+ * Generic interface for query parameters.
480
+ */
481
+ interface QueryParameters {
482
+ [key: string]: string | number | boolean | string[] | number[] | LocaleCode;
483
+ }
484
+ /**
485
+ * Generic interface for all parameter types.
486
+ */
487
+ type UrlParameters = PathParameters | QueryParameters;
488
+ /**
489
+ * Custom query parameter type with any string prefixed with `c_` as the key and the allowed
490
+ * types for query parameters for the value.
491
+ */
492
+ type CustomQueryParameters = {
493
+ [key in `c_${string}`]: string | number | boolean | string[] | number[];
494
+ };
495
+ /**
496
+ * Custom body request type with any string prefixed with `c_` as the key and the allowed
497
+ * types for the value.
498
+ */
499
+ type CustomRequestBody = {
500
+ [key in `c_${string}`]: string | number | boolean | string[] | number[] | {
501
+ [key: string]: unknown;
502
+ };
503
+ };
504
+ /**
505
+ * Alias for `RequestInit` from TypeScript's DOM lib, to more clearly differentiate
506
+ * it from the `RequestInit` provided by node-fetch.
507
+ */
508
+ type BrowserRequestInit = RequestInit;
509
+ /**
510
+ * Any properties supported in either the browser or node are accepted.
511
+ * Using the right properties in the right context is left to the user.
512
+ */
513
+ type FetchOptions = NodeRequestInit & BrowserRequestInit;
514
+ /**
515
+ * Base options that can be passed to the `ClientConfig` class.
516
+ */
517
+ interface ClientConfigInit<Params extends BaseUriParameters> {
518
+ baseUri?: string;
519
+ proxy?: string;
520
+ headers?: {
521
+ [key: string]: string;
522
+ };
523
+ parameters: Params;
524
+ fetchOptions?: FetchOptions;
525
+ transformRequest?: (data: unknown, headers: {
526
+ [key: string]: string;
527
+ }) => Required<FetchOptions>["body"];
528
+ throwOnBadResponse?: boolean;
529
+ }
530
+ type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
531
+ /**
532
+ * Configuration parameters common to Commerce SDK clients
533
+ */
534
+ class ClientConfig<Params extends BaseUriParameters> implements ClientConfigInit<Params> {
535
+ baseUri?: string;
536
+ proxy?: string;
537
+ headers: {
538
+ [key: string]: string;
539
+ };
540
+ parameters: Params;
541
+ fetchOptions: FetchOptions;
542
+ transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
543
+ throwOnBadResponse: boolean;
544
+ constructor(config: ClientConfigInit<Params>);
545
+ static readonly defaults: Pick<Required<ClientConfigInit<never>>, "transformRequest">;
546
+ }
547
+ /**
548
+ * A specialized value indicating the system default values for locales.
549
+ */
550
+ type DefaultFallback = "default";
551
+ /**
552
+ * @type ErrorResponse:
553
+ *
554
+ * @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
555
+ * - **Max Length:** 256
556
+ *
557
+ * @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.
558
+ * - **Max Length:** 2048
559
+ *
560
+ * @property detail: A human-readable explanation specific to this occurrence of the problem.
561
+ *
562
+ * @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.
563
+ * - **Max Length:** 2048
564
+ *
565
+ */
566
+ type ErrorResponse = {
567
+ title: string;
568
+ type: string;
569
+ detail: string;
570
+ instance?: string;
571
+ } & {
572
+ [key: string]: any;
573
+ };
574
+ /**
575
+ * @type LocaleCode
576
+ * 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.
577
+ */
578
+ type LocaleCode$0 = DefaultFallback | string;
579
+ /**
580
+ * @type Promotion: Document representing a promotion.
581
+ *
582
+ * @property calloutMsg: The localized call-out message of the promotion.
583
+ *
584
+ * @property currency: The currency that a promotion can be applied to. A null value means that the promotion applies to all allowed currencies.
585
+ *
586
+ * @property details: The localized detailed description of the promotion.
587
+ *
588
+ * @property endDate: The end date of the promotion. This property follows the ISO8601 date time format: yyyy-MM-dd\'T\'HH:mmZ . The time zone of the date time is always UTC.
589
+ *
590
+ * @property id: The unique ID of the promotion.
591
+ *
592
+ * @property image: The URL to the promotion image.
593
+ *
594
+ * @property name: The localized name of the promotion.
595
+ *
596
+ * @property startDate: The start date of the promotion. This property follows the ISO8601 date time format: yyyy-MM-dd\'T\'HH:mmZ. The time zone of the date time is always UTC.
597
+ *
598
+ */
599
+ type Promotion = {
600
+ calloutMsg?: string;
601
+ currency?: string;
602
+ details?: string;
603
+ endDate?: string;
604
+ id: string;
605
+ image?: string;
606
+ name?: string;
607
+ startDate?: string;
608
+ } & {
609
+ [key: string]: any;
610
+ };
611
+ /**
612
+ * @type PromotionResult: Result document containing an array of promotions.
613
+ *
614
+ * @property data: The array of promotion documents.
615
+ *
616
+ * @property limit: Maximum records to retrieve per request, not to exceed the maximum defined. A limit must be at least 1 so at least one record is returned (if any match the criteria).
617
+ *
618
+ * @property total: The total number of hits that match the search\'s criteria. This can be greater than the number of results returned as search results are pagenated.
619
+ *
620
+ */
621
+ type PromotionResult = {
622
+ data: Array<Promotion>;
623
+ limit: number;
624
+ total: number;
625
+ } & {
626
+ [key: string]: any;
627
+ };
628
+ /**
629
+ * @type ResultBase: Schema defining generic list result. Each response schema of a resource requiring a list response should extend this schema. Additionally it needs to be defined what data is returned.
630
+ *
631
+ * @property limit: Maximum records to retrieve per request, not to exceed the maximum defined. A limit must be at least 1 so at least one record is returned (if any match the criteria).
632
+ *
633
+ * @property total: The total number of hits that match the search\'s criteria. This can be greater than the number of results returned as search results are pagenated.
634
+ *
635
+ */
636
+ type ResultBase = {
637
+ limit: number;
638
+ total: number;
639
+ } & {
640
+ [key: string]: any;
641
+ };
642
+ type getPromotionsQueryParameters = {
643
+ siteId: string;
644
+ ids: Array<string>;
645
+ locale?: LocaleCode$0;
646
+ };
647
+ type getPromotionsPathParameters = {
648
+ organizationId: string;
649
+ };
650
+ type getPromotionsForCampaignQueryParameters = {
651
+ siteId: string;
652
+ startDate?: string;
653
+ endDate?: string;
654
+ currency?: string;
655
+ };
656
+ type getPromotionsForCampaignPathParameters = {
657
+ campaignId: string;
658
+ organizationId: string;
659
+ };
660
+ /**
661
+ * All path parameters that are used by at least one ShopperPromotions method.
662
+ */
663
+ type ShopperPromotionsPathParameters = Partial<getPromotionsPathParameters & getPromotionsForCampaignPathParameters & {}>;
664
+ /**
665
+ * All query parameters that are used by at least one ShopperPromotions method.
666
+ */
667
+ type ShopperPromotionsQueryParameters = Partial<getPromotionsQueryParameters & getPromotionsForCampaignQueryParameters & {}>;
668
+ /**
669
+ * All parameters that are used by ShopperPromotions.
670
+ */
671
+ type ShopperPromotionsParameters = ShopperPromotionsPathParameters & BaseUriParameters & ShopperPromotionsQueryParameters;
672
+ /**
673
+ * [Shopper Promotions](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-promotions:Summary)
674
+ * ==================================
675
+ *
676
+ * *# API Overview
677
+
678
+ Retrieve information about active promotions within the context of a shopper and a site. You can use this API to retrieve promotions that you configured in the commerce platform by searching for specific promotion IDs or by searching for promotions associated with a campaign.
679
+
680
+ Caching is provided for the Shopper Promotions API. For details, see [Server-Side Web-Tier Caching.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/server-side-web-tier-caching.html)
681
+
682
+ ## Authentication & Authorization
683
+
684
+ The Shopper Promotions API requires a JSON Web Token acquired via the Shopper Customers endpoint:
685
+
686
+ ```
687
+ https://{{shortcode}}.api.commercecloud.salesforce.com/customer/shopper-customers/v1/organizations/{{organizationId}}/customers/actions/login
688
+ ```
689
+
690
+ 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)
691
+
692
+ ## Use Cases
693
+
694
+ ### Get Promotion by Promotion ID
695
+
696
+ Use the Shopper Promotions API to find promotion information by the promotion ID.
697
+
698
+ For example, a customer who is browsing on a commerce shopping app built using Commerce Cloud APIs can see the details about the applied promotions in the cart.
699
+
700
+ ### Get Promotion by Campaign ID
701
+
702
+ Use the Shopper Promotions API to find promotion information by the campaign ID.
703
+
704
+ For example, a customer who is browsing on a commerce shopping app built using Commerce Cloud APIs can see the possible promotions that can be applied in the cart.
705
+
706
+ ### Use Hooks
707
+
708
+ For details working with hooks, see [Extensibility with Hooks.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/extensibility_via_hooks.html)*<br />
709
+ *
710
+ * Simple example:
711
+ *
712
+ * ```typescript
713
+ * import { ShopperPromotions } from "commerce-sdk-isomorphic";
714
+ *
715
+ * const clientConfig = {
716
+ * parameters: {
717
+ * clientId: "XXXXXX",
718
+ * organizationId: "XXXX",
719
+ * shortCode: "XXX",
720
+ * siteId: "XX"
721
+ * }
722
+ * };
723
+ * const shopperPromotionsClient = new ShopperPromotions(clientConfig);
724
+ * ```
725
+ *
726
+ * <span style="font-size:.7em; display:block; text-align: right">
727
+ * API Version: 0.0.33<br />
728
+ * Last Updated: <br />
729
+ * </span>
730
+ *
731
+ *
732
+ */
733
+ class ShopperPromotions<ConfigParameters extends ShopperPromotionsParameters & Record<string, unknown>> {
734
+ // baseUri is not required on ClientConfig, but we know that we provide one in the class constructor
735
+ clientConfig: ClientConfig<ConfigParameters> & {
736
+ baseUri: string;
737
+ };
738
+ static readonly defaultBaseUri = "https://{shortCode}.api.commercecloud.salesforce.com/pricing/shopper-promotions/v1";
739
+ static readonly apiPaths: {
740
+ getPromotions: string;
741
+ getPromotionsForCampaign: string;
742
+ };
743
+ constructor(config: ClientConfigInit<ConfigParameters>);
744
+ static readonly paramKeys: {
745
+ readonly getPromotions: readonly [
746
+ "organizationId",
747
+ "siteId",
748
+ "ids",
749
+ "locale"
750
+ ];
751
+ readonly getPromotionsRequired: readonly [
752
+ "organizationId",
753
+ "siteId",
754
+ "ids"
755
+ ];
756
+ readonly getPromotionsForCampaign: readonly [
757
+ "campaignId",
758
+ "organizationId",
759
+ "siteId",
760
+ "startDate",
761
+ "endDate",
762
+ "currency"
763
+ ];
764
+ readonly getPromotionsForCampaignRequired: readonly [
765
+ "campaignId",
766
+ "organizationId",
767
+ "siteId"
768
+ ];
769
+ };
770
+ /**
771
+ * In the request URL, you can specify up to 50 IDs. If you specify an ID that contains either parentheses or the separator characters, you must URL encode these characters.
772
+ Each request returns only enabled promotions as the server does not consider promotion qualifiers or schedules.
773
+ *
774
+ * If you would like to get a raw Response object use the other getPromotions function.
775
+ *
776
+ * @param options - An object containing the options for this method.
777
+ * @param options.parameters - An object containing the parameters for this method.
778
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
779
+ * @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.
780
+ * @param options.parameters.ids -
781
+ * @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.
782
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
783
+ *
784
+ * @returns A promise of type PromotionResult.
785
+ */
786
+ getPromotions(options?: RequireParametersUnlessAllAreOptional<{
787
+ parameters?: CompositeParameters<{
788
+ organizationId: string;
789
+ siteId: string;
790
+ ids: Array<string>;
791
+ locale?: LocaleCode$0;
792
+ } & QueryParameters, ConfigParameters>;
793
+ headers?: {
794
+ [key: string]: string;
795
+ };
796
+ }>): Promise<PromotionResult>;
797
+ /**
798
+ * In the request URL, you can specify up to 50 IDs. If you specify an ID that contains either parentheses or the separator characters, you must URL encode these characters.
799
+ Each request returns only enabled promotions as the server does not consider promotion qualifiers or schedules.
800
+ *
801
+ * @param options - An object containing the options for this method.
802
+ * @param options.parameters - An object containing the parameters for this method.
803
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
804
+ * @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.
805
+ * @param options.parameters.ids -
806
+ * @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.
807
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
808
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
809
+ *
810
+ * @returns A promise of type Response if rawResponse is true, a promise of type PromotionResult otherwise.
811
+ */
812
+ getPromotions<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
813
+ parameters?: CompositeParameters<{
814
+ organizationId: string;
815
+ siteId: string;
816
+ ids: Array<string>;
817
+ locale?: LocaleCode$0;
818
+ } & QueryParameters, ConfigParameters>;
819
+ headers?: {
820
+ [key: string]: string;
821
+ };
822
+ }>, rawResponse?: T): Promise<T extends true ? Response : PromotionResult>;
823
+ /**
824
+ * Retrieves promotion information using filter criteria. In the request URL, you must provide a campaign_id parameter, and you can optionally specify a date
825
+ range by providing start_date and end_date parameters. Both parameters are required to specify a date range, and
826
+ omitting one causes the server to return a MissingParameterException fault. Each request returns only enabled
827
+ promotions, since the server does not consider promotion qualifiers or schedules.
828
+ *
829
+ * If you would like to get a raw Response object use the other getPromotionsForCampaign function.
830
+ *
831
+ * @param options - An object containing the options for this method.
832
+ * @param options.parameters - An object containing the parameters for this method.
833
+ * @param options.parameters.campaignId - Find the promotions assigned to this campaign (mandatory).
834
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
835
+ * @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.
836
+ * @param options.parameters.startDate - The start date of the promotion in ISO8601 date time format: yyyy-MM-dd'T'HH:mmZ
837
+ * @param options.parameters.endDate - The end date of the promotion in ISO8601 date time format: yyyy-MM-dd'T'HH:mmZ
838
+ * @param options.parameters.currency - The currency mnemonic specified for price. This parameter is effective only for product suggestions.
839
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
840
+ *
841
+ * @returns A promise of type PromotionResult.
842
+ */
843
+ getPromotionsForCampaign(options?: RequireParametersUnlessAllAreOptional<{
844
+ parameters?: CompositeParameters<{
845
+ campaignId: string;
846
+ organizationId: string;
847
+ siteId: string;
848
+ startDate?: string;
849
+ endDate?: string;
850
+ currency?: string;
851
+ } & QueryParameters, ConfigParameters>;
852
+ headers?: {
853
+ [key: string]: string;
854
+ };
855
+ }>): Promise<PromotionResult>;
856
+ /**
857
+ * Retrieves promotion information using filter criteria. In the request URL, you must provide a campaign_id parameter, and you can optionally specify a date
858
+ range by providing start_date and end_date parameters. Both parameters are required to specify a date range, and
859
+ omitting one causes the server to return a MissingParameterException fault. Each request returns only enabled
860
+ promotions, since the server does not consider promotion qualifiers or schedules.
861
+ *
862
+ * @param options - An object containing the options for this method.
863
+ * @param options.parameters - An object containing the parameters for this method.
864
+ * @param options.parameters.campaignId - Find the promotions assigned to this campaign (mandatory).
865
+ * @param options.parameters.organizationId - An identifier for the organization the request is being made by
866
+ * @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.
867
+ * @param options.parameters.startDate - The start date of the promotion in ISO8601 date time format: yyyy-MM-dd'T'HH:mmZ
868
+ * @param options.parameters.endDate - The end date of the promotion in ISO8601 date time format: yyyy-MM-dd'T'HH:mmZ
869
+ * @param options.parameters.currency - The currency mnemonic specified for price. This parameter is effective only for product suggestions.
870
+ * @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
871
+ * @param rawResponse - Set to true to return entire Response object instead of DTO.
872
+ *
873
+ * @returns A promise of type Response if rawResponse is true, a promise of type PromotionResult otherwise.
874
+ */
875
+ getPromotionsForCampaign<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
876
+ parameters?: CompositeParameters<{
877
+ campaignId: string;
878
+ organizationId: string;
879
+ siteId: string;
880
+ startDate?: string;
881
+ endDate?: string;
882
+ currency?: string;
883
+ } & QueryParameters, ConfigParameters>;
884
+ headers?: {
885
+ [key: string]: string;
886
+ };
887
+ }>, rawResponse?: T): Promise<T extends true ? Response : PromotionResult>;
888
+ }
889
+ }
890
+ declare namespace ShopperPromotionsModelTypes {
891
+ /**
892
+ * A specialized value indicating the system default values for locales.
893
+ */
894
+ type DefaultFallback = "default";
895
+ /**
896
+ * @type ErrorResponse:
897
+ *
898
+ * @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
899
+ * - **Max Length:** 256
900
+ *
901
+ * @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.
902
+ * - **Max Length:** 2048
903
+ *
904
+ * @property detail: A human-readable explanation specific to this occurrence of the problem.
905
+ *
906
+ * @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.
907
+ * - **Max Length:** 2048
908
+ *
909
+ */
910
+ type ErrorResponse = {
911
+ title: string;
912
+ type: string;
913
+ detail: string;
914
+ instance?: string;
915
+ } & {
916
+ [key: string]: any;
917
+ };
918
+ /**
919
+ * @type LocaleCode
920
+ * 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.
921
+ */
922
+ type LocaleCode = DefaultFallback | string;
923
+ /**
924
+ * @type Promotion: Document representing a promotion.
925
+ *
926
+ * @property calloutMsg: The localized call-out message of the promotion.
927
+ *
928
+ * @property currency: The currency that a promotion can be applied to. A null value means that the promotion applies to all allowed currencies.
929
+ *
930
+ * @property details: The localized detailed description of the promotion.
931
+ *
932
+ * @property endDate: The end date of the promotion. This property follows the ISO8601 date time format: yyyy-MM-dd\'T\'HH:mmZ . The time zone of the date time is always UTC.
933
+ *
934
+ * @property id: The unique ID of the promotion.
935
+ *
936
+ * @property image: The URL to the promotion image.
937
+ *
938
+ * @property name: The localized name of the promotion.
939
+ *
940
+ * @property startDate: The start date of the promotion. This property follows the ISO8601 date time format: yyyy-MM-dd\'T\'HH:mmZ. The time zone of the date time is always UTC.
941
+ *
942
+ */
943
+ type Promotion = {
944
+ calloutMsg?: string;
945
+ currency?: string;
946
+ details?: string;
947
+ endDate?: string;
948
+ id: string;
949
+ image?: string;
950
+ name?: string;
951
+ startDate?: string;
952
+ } & {
953
+ [key: string]: any;
954
+ };
955
+ /**
956
+ * @type PromotionResult: Result document containing an array of promotions.
957
+ *
958
+ * @property data: The array of promotion documents.
959
+ *
960
+ * @property limit: Maximum records to retrieve per request, not to exceed the maximum defined. A limit must be at least 1 so at least one record is returned (if any match the criteria).
961
+ *
962
+ * @property total: The total number of hits that match the search\'s criteria. This can be greater than the number of results returned as search results are pagenated.
963
+ *
964
+ */
965
+ type PromotionResult = {
966
+ data: Array<Promotion>;
967
+ limit: number;
968
+ total: number;
969
+ } & {
970
+ [key: string]: any;
971
+ };
972
+ /**
973
+ * @type ResultBase: Schema defining generic list result. Each response schema of a resource requiring a list response should extend this schema. Additionally it needs to be defined what data is returned.
974
+ *
975
+ * @property limit: Maximum records to retrieve per request, not to exceed the maximum defined. A limit must be at least 1 so at least one record is returned (if any match the criteria).
976
+ *
977
+ * @property total: The total number of hits that match the search\'s criteria. This can be greater than the number of results returned as search results are pagenated.
978
+ *
979
+ */
980
+ type ResultBase = {
981
+ limit: number;
982
+ total: number;
983
+ } & {
984
+ [key: string]: any;
985
+ };
986
+ }
987
+ declare namespace ShopperPromotionsTypes {
988
+ type ShopperPromotionsPathParameters = ShopperPromotionsApiTypes.ShopperPromotionsPathParameters;
989
+ type ShopperPromotionsQueryParameters = ShopperPromotionsApiTypes.ShopperPromotionsQueryParameters;
990
+ type getPromotionsQueryParameters = ShopperPromotionsApiTypes.getPromotionsQueryParameters;
991
+ type getPromotionsPathParameters = ShopperPromotionsApiTypes.getPromotionsPathParameters;
992
+ type getPromotionsForCampaignQueryParameters = ShopperPromotionsApiTypes.getPromotionsForCampaignQueryParameters;
993
+ type getPromotionsForCampaignPathParameters = ShopperPromotionsApiTypes.getPromotionsForCampaignPathParameters;
994
+ type DefaultFallback = ShopperPromotionsModelTypes.DefaultFallback;
995
+ type ErrorResponse = ShopperPromotionsModelTypes.ErrorResponse;
996
+ type LocaleCode = ShopperPromotionsModelTypes.LocaleCode;
997
+ type Promotion = ShopperPromotionsModelTypes.Promotion;
998
+ type PromotionResult = ShopperPromotionsModelTypes.PromotionResult;
999
+ type ResultBase = ShopperPromotionsModelTypes.ResultBase;
1000
+ }
1001
+ export { defaultBaseUri, getPromotionsQueryParameters, getPromotionsPathParameters, getPromotionsForCampaignQueryParameters, getPromotionsForCampaignPathParameters, ShopperPromotionsPathParameters, ShopperPromotionsQueryParameters, ShopperPromotionsParameters, ShopperPromotions, DefaultFallback, ErrorResponse, LocaleCode$0 as LocaleCode, Promotion, PromotionResult, ResultBase, ShopperPromotionsTypes };