commerce-sdk-isomorphic 4.0.1-preview-shopper-configurations.0 → 4.1.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.
- package/README.md +57 -0
- package/lib/clientConfig.cjs.d.ts +4 -2
- package/lib/clientConfig.cjs.js +1 -1
- package/lib/clientConfig.d.ts +4 -2
- package/lib/clientConfig.js +1 -1
- package/lib/helpers.cjs.d.ts +9 -9
- package/lib/helpers.cjs.js +1 -1
- package/lib/helpers.d.ts +9 -9
- package/lib/helpers.js +1 -1
- package/lib/index.cjs.d.ts +333 -1025
- package/lib/index.cjs.js +1 -1
- package/lib/index.esm.d.ts +333 -1025
- package/lib/index.esm.js +1 -1
- package/lib/shopperBaskets.cjs.d.ts +6 -1
- package/lib/shopperBaskets.cjs.js +1 -1
- package/lib/shopperBaskets.d.ts +6 -1
- package/lib/shopperBaskets.js +1 -1
- package/lib/shopperBasketsv2.cjs.d.ts +6 -1
- package/lib/shopperBasketsv2.cjs.js +1 -1
- package/lib/shopperBasketsv2.d.ts +6 -1
- package/lib/shopperBasketsv2.js +1 -1
- package/lib/shopperConsents.cjs.d.ts +6 -1
- package/lib/shopperConsents.cjs.js +1 -1
- package/lib/shopperConsents.d.ts +6 -1
- package/lib/shopperConsents.js +1 -1
- package/lib/shopperContext.cjs.d.ts +6 -1
- package/lib/shopperContext.cjs.js +1 -1
- package/lib/shopperContext.d.ts +6 -1
- package/lib/shopperContext.js +1 -1
- package/lib/shopperCustomers.cjs.d.ts +11 -246
- package/lib/shopperCustomers.cjs.js +1 -1
- package/lib/shopperCustomers.d.ts +11 -246
- package/lib/shopperCustomers.js +1 -1
- package/lib/shopperExperience.cjs.d.ts +6 -1
- package/lib/shopperExperience.cjs.js +1 -1
- package/lib/shopperExperience.d.ts +6 -1
- package/lib/shopperExperience.js +1 -1
- package/lib/shopperGiftCertificates.cjs.d.ts +6 -1
- package/lib/shopperGiftCertificates.cjs.js +1 -1
- package/lib/shopperGiftCertificates.d.ts +6 -1
- package/lib/shopperGiftCertificates.js +1 -1
- package/lib/shopperLogin.cjs.d.ts +6 -1
- package/lib/shopperLogin.cjs.js +1 -1
- package/lib/shopperLogin.d.ts +6 -1
- package/lib/shopperLogin.js +1 -1
- package/lib/shopperOrders.cjs.d.ts +6 -1
- package/lib/shopperOrders.cjs.js +1 -1
- package/lib/shopperOrders.d.ts +6 -1
- package/lib/shopperOrders.js +1 -1
- package/lib/shopperProducts.cjs.d.ts +6 -1
- package/lib/shopperProducts.cjs.js +1 -1
- package/lib/shopperProducts.d.ts +6 -1
- package/lib/shopperProducts.js +1 -1
- package/lib/shopperPromotions.cjs.d.ts +6 -1
- package/lib/shopperPromotions.cjs.js +1 -1
- package/lib/shopperPromotions.d.ts +6 -1
- package/lib/shopperPromotions.js +1 -1
- package/lib/shopperSearch.cjs.d.ts +6 -1
- package/lib/shopperSearch.cjs.js +1 -1
- package/lib/shopperSearch.d.ts +6 -1
- package/lib/shopperSearch.js +1 -1
- package/lib/shopperSeo.cjs.d.ts +6 -1
- package/lib/shopperSeo.cjs.js +1 -1
- package/lib/shopperSeo.d.ts +6 -1
- package/lib/shopperSeo.js +1 -1
- package/lib/shopperStores.cjs.d.ts +6 -1
- package/lib/shopperStores.cjs.js +1 -1
- package/lib/shopperStores.d.ts +6 -1
- package/lib/shopperStores.js +1 -1
- package/lib/version.cjs.d.ts +1 -1
- package/lib/version.cjs.js +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +4 -4
- 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/index.cjs.d.ts
CHANGED
|
@@ -77,6 +77,7 @@ type BrowserRequestInit = RequestInit;
|
|
|
77
77
|
* Using the right properties in the right context is left to the user.
|
|
78
78
|
*/
|
|
79
79
|
type FetchOptions = NodeRequestInit & BrowserRequestInit;
|
|
80
|
+
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
80
81
|
/**
|
|
81
82
|
* Base options that can be passed to the `ClientConfig` class.
|
|
82
83
|
*/
|
|
@@ -88,12 +89,12 @@ interface ClientConfigInit<Params extends BaseUriParameters> {
|
|
|
88
89
|
};
|
|
89
90
|
parameters: Params;
|
|
90
91
|
fetchOptions?: FetchOptions;
|
|
92
|
+
fetch?: FetchFunction;
|
|
91
93
|
transformRequest?: (data: unknown, headers: {
|
|
92
94
|
[key: string]: string;
|
|
93
95
|
}) => Required<FetchOptions>["body"];
|
|
94
96
|
throwOnBadResponse?: boolean;
|
|
95
97
|
}
|
|
96
|
-
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
97
98
|
/**
|
|
98
99
|
* Configuration parameters common to Commerce SDK clients
|
|
99
100
|
*/
|
|
@@ -105,6 +106,7 @@ declare class ClientConfig<Params extends BaseUriParameters> implements ClientCo
|
|
|
105
106
|
};
|
|
106
107
|
parameters: Params;
|
|
107
108
|
fetchOptions: FetchOptions;
|
|
109
|
+
fetch?: FetchFunction;
|
|
108
110
|
transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
|
|
109
111
|
throwOnBadResponse: boolean;
|
|
110
112
|
constructor(config: ClientConfigInit<Params>);
|
|
@@ -4569,6 +4571,7 @@ declare namespace ShopperBasketsApiTypes {
|
|
|
4569
4571
|
* Using the right properties in the right context is left to the user.
|
|
4570
4572
|
*/
|
|
4571
4573
|
type FetchOptions = NodeRequestInit & BrowserRequestInit;
|
|
4574
|
+
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
4572
4575
|
/**
|
|
4573
4576
|
* Base options that can be passed to the `ClientConfig` class.
|
|
4574
4577
|
*/
|
|
@@ -4580,12 +4583,12 @@ declare namespace ShopperBasketsApiTypes {
|
|
|
4580
4583
|
};
|
|
4581
4584
|
parameters: Params;
|
|
4582
4585
|
fetchOptions?: FetchOptions;
|
|
4586
|
+
fetch?: FetchFunction;
|
|
4583
4587
|
transformRequest?: (data: unknown, headers: {
|
|
4584
4588
|
[key: string]: string;
|
|
4585
4589
|
}) => Required<FetchOptions>["body"];
|
|
4586
4590
|
throwOnBadResponse?: boolean;
|
|
4587
4591
|
}
|
|
4588
|
-
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
4589
4592
|
/**
|
|
4590
4593
|
* Configuration parameters common to Commerce SDK clients
|
|
4591
4594
|
*/
|
|
@@ -4597,6 +4600,7 @@ declare namespace ShopperBasketsApiTypes {
|
|
|
4597
4600
|
};
|
|
4598
4601
|
parameters: Params;
|
|
4599
4602
|
fetchOptions: FetchOptions;
|
|
4603
|
+
fetch?: FetchFunction;
|
|
4600
4604
|
transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
|
|
4601
4605
|
throwOnBadResponse: boolean;
|
|
4602
4606
|
constructor(config: ClientConfigInit<Params>);
|
|
@@ -14787,6 +14791,7 @@ declare namespace ShopperBasketsV2ApiTypes {
|
|
|
14787
14791
|
* Using the right properties in the right context is left to the user.
|
|
14788
14792
|
*/
|
|
14789
14793
|
type FetchOptions = NodeRequestInit & BrowserRequestInit;
|
|
14794
|
+
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
14790
14795
|
/**
|
|
14791
14796
|
* Base options that can be passed to the `ClientConfig` class.
|
|
14792
14797
|
*/
|
|
@@ -14798,12 +14803,12 @@ declare namespace ShopperBasketsV2ApiTypes {
|
|
|
14798
14803
|
};
|
|
14799
14804
|
parameters: Params;
|
|
14800
14805
|
fetchOptions?: FetchOptions;
|
|
14806
|
+
fetch?: FetchFunction;
|
|
14801
14807
|
transformRequest?: (data: unknown, headers: {
|
|
14802
14808
|
[key: string]: string;
|
|
14803
14809
|
}) => Required<FetchOptions>["body"];
|
|
14804
14810
|
throwOnBadResponse?: boolean;
|
|
14805
14811
|
}
|
|
14806
|
-
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
14807
14812
|
/**
|
|
14808
14813
|
* Configuration parameters common to Commerce SDK clients
|
|
14809
14814
|
*/
|
|
@@ -14815,6 +14820,7 @@ declare namespace ShopperBasketsV2ApiTypes {
|
|
|
14815
14820
|
};
|
|
14816
14821
|
parameters: Params;
|
|
14817
14822
|
fetchOptions: FetchOptions;
|
|
14823
|
+
fetch?: FetchFunction;
|
|
14818
14824
|
transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
|
|
14819
14825
|
throwOnBadResponse: boolean;
|
|
14820
14826
|
constructor(config: ClientConfigInit<Params>);
|
|
@@ -20571,64 +20577,223 @@ declare namespace ShopperBasketsV2Types {
|
|
|
20571
20577
|
type Taxes = ShopperBasketsV2ModelTypes.Taxes;
|
|
20572
20578
|
}
|
|
20573
20579
|
/**
|
|
20574
|
-
*
|
|
20580
|
+
* The consent status of the subscription as supplied or recorded by this system
|
|
20581
|
+
*/
|
|
20582
|
+
type ConsentStatus = "opt_in" | "opt_out";
|
|
20583
|
+
/**
|
|
20575
20584
|
*
|
|
20576
|
-
|
|
20585
|
+
*/
|
|
20586
|
+
type SubscriptionChannel = "email" | "sms" | "push_notification" | "in_app" | "postal_mail" | "whatsapp";
|
|
20587
|
+
/**
|
|
20588
|
+
* @type ConsentSubscription:
|
|
20589
|
+
*
|
|
20590
|
+
* @property subscriptionId: Identifier for the communication subscription
|
|
20591
|
+
* - **Pattern:** /^[a-z0-9]+(?:-[a-z0-9]+)*$/
|
|
20592
|
+
* - **Min Length:** 1
|
|
20577
20593
|
* - **Max Length:** 255
|
|
20578
20594
|
*
|
|
20579
|
-
* @property
|
|
20595
|
+
* @property consentId: Identifier for the shopper communication subscription consent -- formatted as `<contactPointValue>#<communicationSubscriptionChannelId>`
|
|
20596
|
+
* - **Min Length:** 19
|
|
20597
|
+
* - **Max Length:** 339
|
|
20598
|
+
*
|
|
20599
|
+
* @property contactPointValue: The customer\'s contact point value, polymorphic based on the channel type as below: - `sms` - Subject\'s phone number in E.164 format, ex: `+1 424 535 3546` - `email` - Subject\'s email address in RFC 5321 & RFC 5322 format, ex: `jack.sparrow@salesforce.com`
|
|
20600
|
+
* - **Min Length:** 3
|
|
20601
|
+
* - **Max Length:** 320
|
|
20602
|
+
*
|
|
20603
|
+
* @property channel:
|
|
20604
|
+
*
|
|
20605
|
+
* @property status:
|
|
20606
|
+
*
|
|
20607
|
+
* @property title:
|
|
20608
|
+
* - **Min Length:** 1
|
|
20580
20609
|
* - **Max Length:** 255
|
|
20581
20610
|
*
|
|
20582
|
-
* @property
|
|
20611
|
+
* @property subtitle:
|
|
20612
|
+
* - **Min Length:** 1
|
|
20583
20613
|
* - **Max Length:** 255
|
|
20584
20614
|
*
|
|
20615
|
+
* @property tags:
|
|
20616
|
+
*
|
|
20585
20617
|
*/
|
|
20586
|
-
type
|
|
20587
|
-
|
|
20588
|
-
|
|
20589
|
-
|
|
20618
|
+
type ConsentSubscription = {
|
|
20619
|
+
subscriptionId: string;
|
|
20620
|
+
consentId?: string;
|
|
20621
|
+
contactPointValue?: string;
|
|
20622
|
+
channel: SubscriptionChannel;
|
|
20623
|
+
status?: ConsentStatus;
|
|
20624
|
+
title?: string;
|
|
20625
|
+
subtitle?: string;
|
|
20626
|
+
tags?: Array<string>;
|
|
20590
20627
|
} & {
|
|
20591
20628
|
[key: string]: any;
|
|
20592
20629
|
};
|
|
20593
20630
|
/**
|
|
20594
|
-
* @type
|
|
20631
|
+
* @type ConsentSubscriptionRequest: Consent subscription update request
|
|
20595
20632
|
*
|
|
20596
|
-
* @property
|
|
20633
|
+
* @property subscriptionId: Identifier for the communication subscription
|
|
20634
|
+
* - **Pattern:** /^[a-z0-9]+(?:-[a-z0-9]+)*$/
|
|
20635
|
+
* - **Min Length:** 1
|
|
20636
|
+
* - **Max Length:** 255
|
|
20637
|
+
*
|
|
20638
|
+
* @property contactPointValue: The customer\'s contact point value, polymorphic based on the channel type as below: - `sms` - Subject\'s phone number in E.164 format, ex: `+1 424 535 3546` - `email` - Subject\'s email address in RFC 5321 & RFC 5322 format, ex: `jack.sparrow@salesforce.com`
|
|
20639
|
+
* - **Min Length:** 3
|
|
20640
|
+
* - **Max Length:** 320
|
|
20641
|
+
*
|
|
20642
|
+
* @property channel:
|
|
20643
|
+
*
|
|
20644
|
+
* @property status:
|
|
20597
20645
|
*
|
|
20598
20646
|
*/
|
|
20599
|
-
type
|
|
20600
|
-
|
|
20647
|
+
type ConsentSubscriptionRequest = {
|
|
20648
|
+
subscriptionId: string;
|
|
20649
|
+
contactPointValue: string;
|
|
20650
|
+
channel: SubscriptionChannel;
|
|
20651
|
+
status: ConsentStatus;
|
|
20601
20652
|
} & {
|
|
20602
20653
|
[key: string]: any;
|
|
20603
20654
|
};
|
|
20604
|
-
|
|
20655
|
+
/**
|
|
20656
|
+
* @type ConsentSubscriptionResponse: Collection wrapper of consent subscriptions
|
|
20657
|
+
*
|
|
20658
|
+
* @property data:
|
|
20659
|
+
*
|
|
20660
|
+
*/
|
|
20661
|
+
type ConsentSubscriptionResponse = {
|
|
20662
|
+
data: Array<ConsentSubscription>;
|
|
20663
|
+
} & {
|
|
20664
|
+
[key: string]: any;
|
|
20665
|
+
};
|
|
20666
|
+
/**
|
|
20667
|
+
* A specialized value indicating the system default values for locales.
|
|
20668
|
+
*/
|
|
20669
|
+
type DefaultFallback$1 = "default";
|
|
20670
|
+
/**
|
|
20671
|
+
* @type LocaleCode
|
|
20672
|
+
* 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.
|
|
20673
|
+
*/
|
|
20674
|
+
type LocaleCode$2 = DefaultFallback$1 | string;
|
|
20675
|
+
type getSubscriptionsQueryParameters = {
|
|
20605
20676
|
siteId: string;
|
|
20677
|
+
locale?: LocaleCode$2;
|
|
20678
|
+
tags?: Array<string>;
|
|
20606
20679
|
};
|
|
20607
|
-
type
|
|
20680
|
+
type getSubscriptionsPathParameters = {
|
|
20681
|
+
organizationId: string;
|
|
20682
|
+
};
|
|
20683
|
+
type updateSubscriptionQueryParameters = {
|
|
20684
|
+
siteId: string;
|
|
20685
|
+
locale?: LocaleCode$2;
|
|
20686
|
+
};
|
|
20687
|
+
type updateSubscriptionPathParameters = {
|
|
20608
20688
|
organizationId: string;
|
|
20609
20689
|
};
|
|
20610
20690
|
/**
|
|
20611
|
-
* All path parameters that are used by at least one
|
|
20691
|
+
* All path parameters that are used by at least one ShopperConsents method.
|
|
20612
20692
|
*/
|
|
20613
|
-
type
|
|
20693
|
+
type ShopperConsentsPathParameters = Partial<getSubscriptionsPathParameters & updateSubscriptionPathParameters & {}>;
|
|
20614
20694
|
/**
|
|
20615
|
-
* All query parameters that are used by at least one
|
|
20695
|
+
* All query parameters that are used by at least one ShopperConsents method.
|
|
20616
20696
|
*/
|
|
20617
|
-
type
|
|
20697
|
+
type ShopperConsentsQueryParameters = Partial<getSubscriptionsQueryParameters & updateSubscriptionQueryParameters & {}>;
|
|
20618
20698
|
/**
|
|
20619
|
-
* All parameters that are used by
|
|
20699
|
+
* All parameters that are used by ShopperConsents.
|
|
20620
20700
|
*/
|
|
20621
|
-
type
|
|
20701
|
+
type ShopperConsentsParameters = ShopperConsentsPathParameters & BaseUriParameters & ShopperConsentsQueryParameters;
|
|
20622
20702
|
/**
|
|
20623
|
-
* [Shopper
|
|
20703
|
+
* [Shopper Consents](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-consents:Summary)
|
|
20624
20704
|
* ==================================
|
|
20625
20705
|
*
|
|
20626
|
-
*
|
|
20706
|
+
* *# Shopper Consent
|
|
20707
|
+
|
|
20708
|
+
## API Overview
|
|
20709
|
+
|
|
20710
|
+
The Shopper Consent API offers a centralized method for managing shopper consent. With this API, shoppers can view and update subscription preferences for marketing communications across various channels. This API controls how and where shoppers receive marketing messages while ensuring compliance with privacy regulations.
|
|
20711
|
+
|
|
20712
|
+
## Key Features
|
|
20713
|
+
|
|
20714
|
+
- Multi-Channel Support: Manage communication subscriptions across email, SMS, push notifications, in-app messages, and postal mail.
|
|
20715
|
+
- Organization-Based Management: Isolate consent preferences by organization for multi-tenant environments.
|
|
20716
|
+
- Real-Time Updates: Instantly create and retrieve subscription preferences.
|
|
20717
|
+
- Compliance Ready: Built with privacy regulations and consent-management best practices in mind.
|
|
20718
|
+
|
|
20719
|
+
## Authentication & Authorization
|
|
20720
|
+
|
|
20721
|
+
The Shopper Consent API requires a JSON Web Token acquired using the Shopper Consent endpoint:
|
|
20722
|
+
```
|
|
20723
|
+
https://{{shortcode}}.api.commercecloud.salesforce.com/customer/shopper-customers/v1/organizations/{{organizationId}}/customers/actions/login
|
|
20724
|
+
```
|
|
20725
|
+
You must include the relevant scope(s) in the client ID used to generate the SLAS token.
|
|
20726
|
+
|
|
20727
|
+
### Required Scopes
|
|
20728
|
+
|
|
20729
|
+
- `sfcc.shopper-consents`: Required for reading communication subscription data (GET operations).
|
|
20730
|
+
- `sfcc.shopper-consents.rw`: Required for creating and modifying communication subscription data (POST operations).
|
|
20731
|
+
|
|
20732
|
+
## Use Cases
|
|
20733
|
+
|
|
20734
|
+
### Shopper Subscription Management
|
|
20735
|
+
- Retrieve communication subscriptions: Retrieve relevant communication subscription options with display information.
|
|
20736
|
+
- Guest shoppers can retrieve communication subscriptions options without pre-defined shopper credentials, for example: email address, phone number.
|
|
20737
|
+
- Authenticated shoppers can retrieve communication subscription options available to their shopper credentials.
|
|
20738
|
+
- Communication subscription options can be filtered by one or more qualifying tags.
|
|
20739
|
+
- Update communication subscription consent preferences.
|
|
20740
|
+
|
|
20741
|
+
## Data Model
|
|
20742
|
+
|
|
20743
|
+
### Subscriptions
|
|
20744
|
+
Subscriptions represent a shopper's consent to receive specific types of marketing communications. Each subscription includes:
|
|
20745
|
+
|
|
20746
|
+
- Identifier: Descriptive identifier
|
|
20747
|
+
- Consent Status: Opt-in or opt-out
|
|
20748
|
+
- Display Information: Title, subtitle, and description for customer-facing interfaces
|
|
20749
|
+
- Tags: Categorical tags indicating where the subscription option can appear
|
|
20750
|
+
- Channels: Supported communication methods, such as email, SMS, push notification
|
|
20751
|
+
|
|
20752
|
+
### Channels
|
|
20753
|
+
Channels define the communication methods available for a subscription:
|
|
20754
|
+
- `email`: Email communications
|
|
20755
|
+
- `sms`: SMS/text messages
|
|
20756
|
+
- `whatsapp`: WhatsApp
|
|
20757
|
+
|
|
20758
|
+
### Tags
|
|
20759
|
+
Tags indicate where subscription options are displayed in your shopper experience. Tags are also accepted as optional filtering parameters in the retrieval of shopper consent subscriptions. For example:
|
|
20760
|
+
- `homepage_banner`: Main website homepage
|
|
20761
|
+
- `registration`: Shopper registration process
|
|
20762
|
+
- `checkout`: Checkout process
|
|
20763
|
+
- `user_profile`: User profile management area
|
|
20764
|
+
|
|
20765
|
+
## Best Practices
|
|
20766
|
+
|
|
20767
|
+
### User Experience
|
|
20768
|
+
- Make it easy for shoppers to update their preferences.
|
|
20769
|
+
- Respect shopper choices immediately.
|
|
20770
|
+
|
|
20771
|
+
### Implementation Guidelines
|
|
20772
|
+
- Implement clear and prominent unsubscribe mechanisms.
|
|
20773
|
+
|
|
20774
|
+
### Compliance Considerations
|
|
20775
|
+
- Ensure consent is freely given, specific, informed, and unambiguous.
|
|
20776
|
+
- Implement proper data retention and deletion policies.
|
|
20777
|
+
- Provide easy access to consent history and preferences.
|
|
20778
|
+
|
|
20779
|
+
## Error Handling
|
|
20780
|
+
|
|
20781
|
+
The API uses standard HTTP status codes and returns detailed error information to help with troubleshooting:
|
|
20782
|
+
|
|
20783
|
+
- `400 Bad Request`: Invalid request format or missing required fields
|
|
20784
|
+
- `401 Unauthorized`: Invalid or missing authentication token
|
|
20785
|
+
- `403 Forbidden`: Insufficient permissions for the requested operation
|
|
20786
|
+
- `404 Not Found`: Requested organization or resource not found
|
|
20787
|
+
- `500 Internal Server Error`: Unexpected server error
|
|
20788
|
+
|
|
20789
|
+
## Rate Limits
|
|
20790
|
+
|
|
20791
|
+
To ensure fair usage and system stability, the Shopper Consent API implements rate limiting. Refer to the response headers for current rate limit status and adjust your integration accordingly.*<br />
|
|
20627
20792
|
*
|
|
20628
20793
|
* Simple example:
|
|
20629
20794
|
*
|
|
20630
20795
|
* ```typescript
|
|
20631
|
-
* import {
|
|
20796
|
+
* import { ShopperConsents } from "commerce-sdk-isomorphic";
|
|
20632
20797
|
*
|
|
20633
20798
|
* const clientConfig = {
|
|
20634
20799
|
* parameters: {
|
|
@@ -20638,7 +20803,7 @@ type ShopperConfigurationsParameters = ShopperConfigurationsPathParameters & Bas
|
|
|
20638
20803
|
* siteId: "XX"
|
|
20639
20804
|
* }
|
|
20640
20805
|
* };
|
|
20641
|
-
* const
|
|
20806
|
+
* const shopperConsentsClient = new ShopperConsents(clientConfig);
|
|
20642
20807
|
* ```
|
|
20643
20808
|
*
|
|
20644
20809
|
* <span style="font-size:.7em; display:block; text-align: right">
|
|
@@ -20648,71 +20813,142 @@ type ShopperConfigurationsParameters = ShopperConfigurationsPathParameters & Bas
|
|
|
20648
20813
|
*
|
|
20649
20814
|
*
|
|
20650
20815
|
*/
|
|
20651
|
-
declare class
|
|
20816
|
+
declare class ShopperConsents<ConfigParameters extends ShopperConsentsParameters & Record<string, unknown>> {
|
|
20652
20817
|
// baseUri is not required on ClientConfig, but we know that we provide one in the class constructor
|
|
20653
20818
|
clientConfig: ClientConfig<ConfigParameters> & {
|
|
20654
20819
|
baseUri: string;
|
|
20655
20820
|
};
|
|
20656
|
-
static readonly defaultBaseUri = "https://{shortCode}.api.commercecloud.salesforce.com/
|
|
20821
|
+
static readonly defaultBaseUri = "https://{shortCode}.api.commercecloud.salesforce.com/shopper/shopper-consents/v1";
|
|
20657
20822
|
static readonly apiPaths: {
|
|
20658
|
-
|
|
20823
|
+
getSubscriptions: string;
|
|
20824
|
+
updateSubscription: string;
|
|
20659
20825
|
};
|
|
20660
20826
|
constructor(config: ClientConfigInit<ConfigParameters>);
|
|
20661
20827
|
static readonly paramKeys: {
|
|
20662
|
-
readonly
|
|
20828
|
+
readonly getSubscriptions: readonly [
|
|
20829
|
+
"organizationId",
|
|
20830
|
+
"siteId",
|
|
20831
|
+
"locale",
|
|
20832
|
+
"tags"
|
|
20833
|
+
];
|
|
20834
|
+
readonly getSubscriptionsRequired: readonly [
|
|
20663
20835
|
"organizationId",
|
|
20664
20836
|
"siteId"
|
|
20665
20837
|
];
|
|
20666
|
-
readonly
|
|
20838
|
+
readonly updateSubscription: readonly [
|
|
20839
|
+
"organizationId",
|
|
20840
|
+
"siteId",
|
|
20841
|
+
"locale"
|
|
20842
|
+
];
|
|
20843
|
+
readonly updateSubscriptionRequired: readonly [
|
|
20667
20844
|
"organizationId",
|
|
20668
20845
|
"siteId"
|
|
20669
20846
|
];
|
|
20670
20847
|
};
|
|
20671
20848
|
/**
|
|
20672
|
-
*
|
|
20849
|
+
* Retrieve all subcription preferences for the shopper (authenticated or guest)
|
|
20673
20850
|
*
|
|
20674
|
-
* If you would like to get a raw Response object use the other
|
|
20851
|
+
* If you would like to get a raw Response object use the other getSubscriptions function.
|
|
20675
20852
|
*
|
|
20676
20853
|
* @param options - An object containing the options for this method.
|
|
20677
20854
|
* @param options.parameters - An object containing the parameters for this method.
|
|
20678
20855
|
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
|
|
20679
|
-
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of.
|
|
20856
|
+
* @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.
|
|
20857
|
+
* @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.
|
|
20858
|
+
* @param options.parameters.tags - Optional parameter of 0 or more query string values which act as a filtering criteria. Multiple values are treated with `OR` logic, and absence of a value indicates no filtering by tag is desired.
|
|
20680
20859
|
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
|
|
20681
20860
|
*
|
|
20682
|
-
* @returns A promise of type
|
|
20861
|
+
* @returns A promise of type ConsentSubscriptionResponse.
|
|
20683
20862
|
*/
|
|
20684
|
-
|
|
20863
|
+
getSubscriptions(options?: RequireParametersUnlessAllAreOptional<{
|
|
20685
20864
|
parameters?: CompositeParameters<{
|
|
20686
20865
|
organizationId: string;
|
|
20687
20866
|
siteId: string;
|
|
20867
|
+
locale?: LocaleCode$2;
|
|
20868
|
+
tags?: Array<string>;
|
|
20688
20869
|
} & QueryParameters, ConfigParameters>;
|
|
20689
20870
|
headers?: {
|
|
20690
20871
|
[key: string]: string;
|
|
20691
20872
|
};
|
|
20692
|
-
}>): Promise<
|
|
20873
|
+
}>): Promise<ConsentSubscriptionResponse>;
|
|
20693
20874
|
/**
|
|
20694
|
-
*
|
|
20875
|
+
* Retrieve all subcription preferences for the shopper (authenticated or guest)
|
|
20695
20876
|
*
|
|
20696
20877
|
* @param options - An object containing the options for this method.
|
|
20697
20878
|
* @param options.parameters - An object containing the parameters for this method.
|
|
20698
20879
|
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
|
|
20699
|
-
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of.
|
|
20880
|
+
* @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.
|
|
20881
|
+
* @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.
|
|
20882
|
+
* @param options.parameters.tags - Optional parameter of 0 or more query string values which act as a filtering criteria. Multiple values are treated with `OR` logic, and absence of a value indicates no filtering by tag is desired.
|
|
20700
20883
|
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
|
|
20701
20884
|
* @param rawResponse - Set to true to return entire Response object instead of DTO.
|
|
20702
20885
|
*
|
|
20703
|
-
* @returns A promise of type Response if rawResponse is true, a promise of type
|
|
20886
|
+
* @returns A promise of type Response if rawResponse is true, a promise of type ConsentSubscriptionResponse otherwise.
|
|
20704
20887
|
*/
|
|
20705
|
-
|
|
20888
|
+
getSubscriptions<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
|
|
20706
20889
|
parameters?: CompositeParameters<{
|
|
20707
20890
|
organizationId: string;
|
|
20708
20891
|
siteId: string;
|
|
20892
|
+
locale?: LocaleCode$2;
|
|
20893
|
+
tags?: Array<string>;
|
|
20709
20894
|
} & QueryParameters, ConfigParameters>;
|
|
20710
20895
|
headers?: {
|
|
20711
20896
|
[key: string]: string;
|
|
20712
20897
|
};
|
|
20713
|
-
}>, rawResponse?: T): Promise<T extends true ? Response :
|
|
20898
|
+
}>, rawResponse?: T): Promise<T extends true ? Response : ConsentSubscriptionResponse>;
|
|
20899
|
+
/**
|
|
20900
|
+
* Update the consent status for a given subscription.
|
|
20901
|
+
*
|
|
20902
|
+
* If you would like to get a raw Response object use the other updateSubscription function.
|
|
20903
|
+
*
|
|
20904
|
+
* @param options - An object containing the options for this method.
|
|
20905
|
+
* @param options.parameters - An object containing the parameters for this method.
|
|
20906
|
+
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
|
|
20907
|
+
* @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.
|
|
20908
|
+
* @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.
|
|
20909
|
+
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
|
|
20910
|
+
* @param options.body - The data to send as the request body.
|
|
20911
|
+
*
|
|
20912
|
+
* @returns A promise of type ConsentSubscription.
|
|
20913
|
+
*/
|
|
20914
|
+
updateSubscription(options: RequireParametersUnlessAllAreOptional<{
|
|
20915
|
+
parameters?: CompositeParameters<{
|
|
20916
|
+
organizationId: string;
|
|
20917
|
+
siteId: string;
|
|
20918
|
+
locale?: LocaleCode$2;
|
|
20919
|
+
} & QueryParameters, ConfigParameters>;
|
|
20920
|
+
headers?: {
|
|
20921
|
+
[key: string]: string;
|
|
20922
|
+
};
|
|
20923
|
+
body: ConsentSubscriptionRequest & CustomRequestBody;
|
|
20924
|
+
}>): Promise<ConsentSubscription>;
|
|
20925
|
+
/**
|
|
20926
|
+
* Update the consent status for a given subscription.
|
|
20927
|
+
*
|
|
20928
|
+
* @param options - An object containing the options for this method.
|
|
20929
|
+
* @param options.parameters - An object containing the parameters for this method.
|
|
20930
|
+
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
|
|
20931
|
+
* @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.
|
|
20932
|
+
* @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.
|
|
20933
|
+
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
|
|
20934
|
+
* @param options.body - The data to send as the request body.
|
|
20935
|
+
* @param rawResponse - Set to true to return entire Response object instead of DTO.
|
|
20936
|
+
*
|
|
20937
|
+
* @returns A promise of type Response if rawResponse is true, a promise of type ConsentSubscription otherwise.
|
|
20938
|
+
*/
|
|
20939
|
+
updateSubscription<T extends boolean>(options: RequireParametersUnlessAllAreOptional<{
|
|
20940
|
+
parameters?: CompositeParameters<{
|
|
20941
|
+
organizationId: string;
|
|
20942
|
+
siteId: string;
|
|
20943
|
+
locale?: LocaleCode$2;
|
|
20944
|
+
} & QueryParameters, ConfigParameters>;
|
|
20945
|
+
headers?: {
|
|
20946
|
+
[key: string]: string;
|
|
20947
|
+
};
|
|
20948
|
+
body: ConsentSubscriptionRequest & CustomRequestBody;
|
|
20949
|
+
}>, rawResponse?: T): Promise<T extends true ? Response : ConsentSubscription>;
|
|
20714
20950
|
}
|
|
20715
|
-
declare namespace
|
|
20951
|
+
declare namespace ShopperConsentsApiTypes {
|
|
20716
20952
|
/*
|
|
20717
20953
|
* Copyright (c) 2023, Salesforce, Inc.
|
|
20718
20954
|
* All rights reserved.
|
|
@@ -20788,720 +21024,7 @@ declare namespace ShopperConfigurationsApiTypes {
|
|
|
20788
21024
|
* Using the right properties in the right context is left to the user.
|
|
20789
21025
|
*/
|
|
20790
21026
|
type FetchOptions = NodeRequestInit & BrowserRequestInit;
|
|
20791
|
-
/**
|
|
20792
|
-
* Base options that can be passed to the `ClientConfig` class.
|
|
20793
|
-
*/
|
|
20794
|
-
interface ClientConfigInit<Params extends BaseUriParameters> {
|
|
20795
|
-
baseUri?: string;
|
|
20796
|
-
proxy?: string;
|
|
20797
|
-
headers?: {
|
|
20798
|
-
[key: string]: string;
|
|
20799
|
-
};
|
|
20800
|
-
parameters: Params;
|
|
20801
|
-
fetchOptions?: FetchOptions;
|
|
20802
|
-
transformRequest?: (data: unknown, headers: {
|
|
20803
|
-
[key: string]: string;
|
|
20804
|
-
}) => Required<FetchOptions>["body"];
|
|
20805
|
-
throwOnBadResponse?: boolean;
|
|
20806
|
-
}
|
|
20807
21027
|
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
20808
|
-
/**
|
|
20809
|
-
* Configuration parameters common to Commerce SDK clients
|
|
20810
|
-
*/
|
|
20811
|
-
class ClientConfig<Params extends BaseUriParameters> implements ClientConfigInit<Params> {
|
|
20812
|
-
baseUri?: string;
|
|
20813
|
-
proxy?: string;
|
|
20814
|
-
headers: {
|
|
20815
|
-
[key: string]: string;
|
|
20816
|
-
};
|
|
20817
|
-
parameters: Params;
|
|
20818
|
-
fetchOptions: FetchOptions;
|
|
20819
|
-
transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
|
|
20820
|
-
throwOnBadResponse: boolean;
|
|
20821
|
-
constructor(config: ClientConfigInit<Params>);
|
|
20822
|
-
static readonly defaults: Pick<Required<ClientConfigInit<never>>, "transformRequest">;
|
|
20823
|
-
}
|
|
20824
|
-
/**
|
|
20825
|
-
* @type ErrorResponse:
|
|
20826
|
-
*
|
|
20827
|
-
* @property title: A short, human-readable summary of the problem type.
|
|
20828
|
-
* - **Max Length:** 256
|
|
20829
|
-
*
|
|
20830
|
-
* @property type: A URI reference that identifies the problem type.
|
|
20831
|
-
* - **Max Length:** 2048
|
|
20832
|
-
*
|
|
20833
|
-
* @property detail: A human-readable explanation specific to this occurrence of the problem.
|
|
20834
|
-
*
|
|
20835
|
-
* @property instance: A URI reference that identifies the specific occurrence of the problem.
|
|
20836
|
-
* - **Max Length:** 2048
|
|
20837
|
-
*
|
|
20838
|
-
*/
|
|
20839
|
-
type ErrorResponse = {
|
|
20840
|
-
title: string;
|
|
20841
|
-
type: string;
|
|
20842
|
-
detail: string;
|
|
20843
|
-
instance?: string;
|
|
20844
|
-
} & {
|
|
20845
|
-
[key: string]: any;
|
|
20846
|
-
};
|
|
20847
|
-
/**
|
|
20848
|
-
* @type ModelConfiguration: Configuration object
|
|
20849
|
-
*
|
|
20850
|
-
* @property id: identifier
|
|
20851
|
-
* - **Max Length:** 255
|
|
20852
|
-
*
|
|
20853
|
-
* @property value: value for identifier
|
|
20854
|
-
* - **Max Length:** 255
|
|
20855
|
-
*
|
|
20856
|
-
* @property configurationType: type of configuration value
|
|
20857
|
-
* - **Max Length:** 255
|
|
20858
|
-
*
|
|
20859
|
-
*/
|
|
20860
|
-
type ModelConfiguration = {
|
|
20861
|
-
id: string;
|
|
20862
|
-
value: any | null;
|
|
20863
|
-
configurationType?: string;
|
|
20864
|
-
} & {
|
|
20865
|
-
[key: string]: any;
|
|
20866
|
-
};
|
|
20867
|
-
/**
|
|
20868
|
-
* @type SiteConfiguration: Site Configuration object
|
|
20869
|
-
*
|
|
20870
|
-
* @property configurations: List configurations for the instance and site
|
|
20871
|
-
*
|
|
20872
|
-
*/
|
|
20873
|
-
type SiteConfiguration = {
|
|
20874
|
-
configurations: Array<ModelConfiguration>;
|
|
20875
|
-
} & {
|
|
20876
|
-
[key: string]: any;
|
|
20877
|
-
};
|
|
20878
|
-
type getConfigurationsQueryParameters = {
|
|
20879
|
-
siteId: string;
|
|
20880
|
-
};
|
|
20881
|
-
type getConfigurationsPathParameters = {
|
|
20882
|
-
organizationId: string;
|
|
20883
|
-
};
|
|
20884
|
-
/**
|
|
20885
|
-
* All path parameters that are used by at least one ShopperConfigurations method.
|
|
20886
|
-
*/
|
|
20887
|
-
type ShopperConfigurationsPathParameters = Partial<getConfigurationsPathParameters & {}>;
|
|
20888
|
-
/**
|
|
20889
|
-
* All query parameters that are used by at least one ShopperConfigurations method.
|
|
20890
|
-
*/
|
|
20891
|
-
type ShopperConfigurationsQueryParameters = Partial<getConfigurationsQueryParameters & {}>;
|
|
20892
|
-
/**
|
|
20893
|
-
* All parameters that are used by ShopperConfigurations.
|
|
20894
|
-
*/
|
|
20895
|
-
type ShopperConfigurationsParameters = ShopperConfigurationsPathParameters & BaseUriParameters & ShopperConfigurationsQueryParameters;
|
|
20896
|
-
/**
|
|
20897
|
-
* [Shopper Configurations](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-configurations:Summary)
|
|
20898
|
-
* ==================================
|
|
20899
|
-
*
|
|
20900
|
-
* *<shopper-configurations-description.md>*<br />
|
|
20901
|
-
*
|
|
20902
|
-
* Simple example:
|
|
20903
|
-
*
|
|
20904
|
-
* ```typescript
|
|
20905
|
-
* import { ShopperConfigurations } from "commerce-sdk-isomorphic";
|
|
20906
|
-
*
|
|
20907
|
-
* const clientConfig = {
|
|
20908
|
-
* parameters: {
|
|
20909
|
-
* clientId: "XXXXXX",
|
|
20910
|
-
* organizationId: "XXXX",
|
|
20911
|
-
* shortCode: "XXX",
|
|
20912
|
-
* siteId: "XX"
|
|
20913
|
-
* }
|
|
20914
|
-
* };
|
|
20915
|
-
* const shopperConfigurationsClient = new ShopperConfigurations(clientConfig);
|
|
20916
|
-
* ```
|
|
20917
|
-
*
|
|
20918
|
-
* <span style="font-size:.7em; display:block; text-align: right">
|
|
20919
|
-
* API Version: 0.0.33<br />
|
|
20920
|
-
* Last Updated: <br />
|
|
20921
|
-
* </span>
|
|
20922
|
-
*
|
|
20923
|
-
*
|
|
20924
|
-
*/
|
|
20925
|
-
class ShopperConfigurations<ConfigParameters extends ShopperConfigurationsParameters & Record<string, unknown>> {
|
|
20926
|
-
// baseUri is not required on ClientConfig, but we know that we provide one in the class constructor
|
|
20927
|
-
clientConfig: ClientConfig<ConfigParameters> & {
|
|
20928
|
-
baseUri: string;
|
|
20929
|
-
};
|
|
20930
|
-
static readonly defaultBaseUri = "https://{shortCode}.api.commercecloud.salesforce.com/configuration/shopper-configurations/v1";
|
|
20931
|
-
static readonly apiPaths: {
|
|
20932
|
-
getConfigurations: string;
|
|
20933
|
-
};
|
|
20934
|
-
constructor(config: ClientConfigInit<ConfigParameters>);
|
|
20935
|
-
static readonly paramKeys: {
|
|
20936
|
-
readonly getConfigurations: readonly [
|
|
20937
|
-
"organizationId",
|
|
20938
|
-
"siteId"
|
|
20939
|
-
];
|
|
20940
|
-
readonly getConfigurationsRequired: readonly [
|
|
20941
|
-
"organizationId",
|
|
20942
|
-
"siteId"
|
|
20943
|
-
];
|
|
20944
|
-
};
|
|
20945
|
-
/**
|
|
20946
|
-
* Retrieves configurations for the specified organization and site.
|
|
20947
|
-
*
|
|
20948
|
-
* If you would like to get a raw Response object use the other getConfigurations function.
|
|
20949
|
-
*
|
|
20950
|
-
* @param options - An object containing the options for this method.
|
|
20951
|
-
* @param options.parameters - An object containing the parameters for this method.
|
|
20952
|
-
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
|
|
20953
|
-
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of.
|
|
20954
|
-
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
|
|
20955
|
-
*
|
|
20956
|
-
* @returns A promise of type SiteConfiguration.
|
|
20957
|
-
*/
|
|
20958
|
-
getConfigurations(options?: RequireParametersUnlessAllAreOptional<{
|
|
20959
|
-
parameters?: CompositeParameters<{
|
|
20960
|
-
organizationId: string;
|
|
20961
|
-
siteId: string;
|
|
20962
|
-
} & QueryParameters, ConfigParameters>;
|
|
20963
|
-
headers?: {
|
|
20964
|
-
[key: string]: string;
|
|
20965
|
-
};
|
|
20966
|
-
}>): Promise<SiteConfiguration>;
|
|
20967
|
-
/**
|
|
20968
|
-
* Retrieves configurations for the specified organization and site.
|
|
20969
|
-
*
|
|
20970
|
-
* @param options - An object containing the options for this method.
|
|
20971
|
-
* @param options.parameters - An object containing the parameters for this method.
|
|
20972
|
-
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
|
|
20973
|
-
* @param options.parameters.siteId - The identifier of the site that a request is being made in the context of.
|
|
20974
|
-
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
|
|
20975
|
-
* @param rawResponse - Set to true to return entire Response object instead of DTO.
|
|
20976
|
-
*
|
|
20977
|
-
* @returns A promise of type Response if rawResponse is true, a promise of type SiteConfiguration otherwise.
|
|
20978
|
-
*/
|
|
20979
|
-
getConfigurations<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
|
|
20980
|
-
parameters?: CompositeParameters<{
|
|
20981
|
-
organizationId: string;
|
|
20982
|
-
siteId: string;
|
|
20983
|
-
} & QueryParameters, ConfigParameters>;
|
|
20984
|
-
headers?: {
|
|
20985
|
-
[key: string]: string;
|
|
20986
|
-
};
|
|
20987
|
-
}>, rawResponse?: T): Promise<T extends true ? Response : SiteConfiguration>;
|
|
20988
|
-
}
|
|
20989
|
-
}
|
|
20990
|
-
declare namespace ShopperConfigurationsModelTypes {
|
|
20991
|
-
/**
|
|
20992
|
-
* @type ErrorResponse:
|
|
20993
|
-
*
|
|
20994
|
-
* @property title: A short, human-readable summary of the problem type.
|
|
20995
|
-
* - **Max Length:** 256
|
|
20996
|
-
*
|
|
20997
|
-
* @property type: A URI reference that identifies the problem type.
|
|
20998
|
-
* - **Max Length:** 2048
|
|
20999
|
-
*
|
|
21000
|
-
* @property detail: A human-readable explanation specific to this occurrence of the problem.
|
|
21001
|
-
*
|
|
21002
|
-
* @property instance: A URI reference that identifies the specific occurrence of the problem.
|
|
21003
|
-
* - **Max Length:** 2048
|
|
21004
|
-
*
|
|
21005
|
-
*/
|
|
21006
|
-
type ErrorResponse = {
|
|
21007
|
-
title: string;
|
|
21008
|
-
type: string;
|
|
21009
|
-
detail: string;
|
|
21010
|
-
instance?: string;
|
|
21011
|
-
} & {
|
|
21012
|
-
[key: string]: any;
|
|
21013
|
-
};
|
|
21014
|
-
/**
|
|
21015
|
-
* @type ModelConfiguration: Configuration object
|
|
21016
|
-
*
|
|
21017
|
-
* @property id: identifier
|
|
21018
|
-
* - **Max Length:** 255
|
|
21019
|
-
*
|
|
21020
|
-
* @property value: value for identifier
|
|
21021
|
-
* - **Max Length:** 255
|
|
21022
|
-
*
|
|
21023
|
-
* @property configurationType: type of configuration value
|
|
21024
|
-
* - **Max Length:** 255
|
|
21025
|
-
*
|
|
21026
|
-
*/
|
|
21027
|
-
type ModelConfiguration = {
|
|
21028
|
-
id: string;
|
|
21029
|
-
value: any | null;
|
|
21030
|
-
configurationType?: string;
|
|
21031
|
-
} & {
|
|
21032
|
-
[key: string]: any;
|
|
21033
|
-
};
|
|
21034
|
-
/**
|
|
21035
|
-
* @type SiteConfiguration: Site Configuration object
|
|
21036
|
-
*
|
|
21037
|
-
* @property configurations: List configurations for the instance and site
|
|
21038
|
-
*
|
|
21039
|
-
*/
|
|
21040
|
-
type SiteConfiguration = {
|
|
21041
|
-
configurations: Array<ModelConfiguration>;
|
|
21042
|
-
} & {
|
|
21043
|
-
[key: string]: any;
|
|
21044
|
-
};
|
|
21045
|
-
}
|
|
21046
|
-
declare namespace ShopperConfigurationsTypes {
|
|
21047
|
-
// API types
|
|
21048
|
-
type ShopperConfigurationsPathParameters = ShopperConfigurationsApiTypes.ShopperConfigurationsPathParameters;
|
|
21049
|
-
type ShopperConfigurationsQueryParameters = ShopperConfigurationsApiTypes.ShopperConfigurationsQueryParameters;
|
|
21050
|
-
type getConfigurationsQueryParameters = ShopperConfigurationsApiTypes.getConfigurationsQueryParameters;
|
|
21051
|
-
type getConfigurationsPathParameters = ShopperConfigurationsApiTypes.getConfigurationsPathParameters;
|
|
21052
|
-
// Model types
|
|
21053
|
-
type ErrorResponse = ShopperConfigurationsModelTypes.ErrorResponse;
|
|
21054
|
-
type ModelConfiguration = ShopperConfigurationsModelTypes.ModelConfiguration;
|
|
21055
|
-
type SiteConfiguration = ShopperConfigurationsModelTypes.SiteConfiguration;
|
|
21056
|
-
}
|
|
21057
|
-
/**
|
|
21058
|
-
* The consent status of the subscription as supplied or recorded by this system
|
|
21059
|
-
*/
|
|
21060
|
-
type ConsentStatus = "opt_in" | "opt_out";
|
|
21061
|
-
/**
|
|
21062
|
-
*
|
|
21063
|
-
*/
|
|
21064
|
-
type SubscriptionChannel = "email" | "sms" | "push_notification" | "in_app" | "postal_mail" | "whatsapp";
|
|
21065
|
-
/**
|
|
21066
|
-
* @type ConsentSubscription:
|
|
21067
|
-
*
|
|
21068
|
-
* @property subscriptionId: Identifier for the communication subscription
|
|
21069
|
-
* - **Pattern:** /^[a-z0-9]+(?:-[a-z0-9]+)*$/
|
|
21070
|
-
* - **Min Length:** 1
|
|
21071
|
-
* - **Max Length:** 255
|
|
21072
|
-
*
|
|
21073
|
-
* @property consentId: Identifier for the shopper communication subscription consent -- formatted as `<contactPointValue>#<communicationSubscriptionChannelId>`
|
|
21074
|
-
* - **Min Length:** 19
|
|
21075
|
-
* - **Max Length:** 339
|
|
21076
|
-
*
|
|
21077
|
-
* @property contactPointValue: The customer\'s contact point value, polymorphic based on the channel type as below: - `sms` - Subject\'s phone number in E.164 format, ex: `+1 424 535 3546` - `email` - Subject\'s email address in RFC 5321 & RFC 5322 format, ex: `jack.sparrow@salesforce.com`
|
|
21078
|
-
* - **Min Length:** 3
|
|
21079
|
-
* - **Max Length:** 320
|
|
21080
|
-
*
|
|
21081
|
-
* @property channel:
|
|
21082
|
-
*
|
|
21083
|
-
* @property status:
|
|
21084
|
-
*
|
|
21085
|
-
* @property title:
|
|
21086
|
-
* - **Min Length:** 1
|
|
21087
|
-
* - **Max Length:** 255
|
|
21088
|
-
*
|
|
21089
|
-
* @property subtitle:
|
|
21090
|
-
* - **Min Length:** 1
|
|
21091
|
-
* - **Max Length:** 255
|
|
21092
|
-
*
|
|
21093
|
-
* @property tags:
|
|
21094
|
-
*
|
|
21095
|
-
*/
|
|
21096
|
-
type ConsentSubscription = {
|
|
21097
|
-
subscriptionId: string;
|
|
21098
|
-
consentId?: string;
|
|
21099
|
-
contactPointValue?: string;
|
|
21100
|
-
channel: SubscriptionChannel;
|
|
21101
|
-
status?: ConsentStatus;
|
|
21102
|
-
title?: string;
|
|
21103
|
-
subtitle?: string;
|
|
21104
|
-
tags?: Array<string>;
|
|
21105
|
-
} & {
|
|
21106
|
-
[key: string]: any;
|
|
21107
|
-
};
|
|
21108
|
-
/**
|
|
21109
|
-
* @type ConsentSubscriptionRequest: Consent subscription update request
|
|
21110
|
-
*
|
|
21111
|
-
* @property subscriptionId: Identifier for the communication subscription
|
|
21112
|
-
* - **Pattern:** /^[a-z0-9]+(?:-[a-z0-9]+)*$/
|
|
21113
|
-
* - **Min Length:** 1
|
|
21114
|
-
* - **Max Length:** 255
|
|
21115
|
-
*
|
|
21116
|
-
* @property contactPointValue: The customer\'s contact point value, polymorphic based on the channel type as below: - `sms` - Subject\'s phone number in E.164 format, ex: `+1 424 535 3546` - `email` - Subject\'s email address in RFC 5321 & RFC 5322 format, ex: `jack.sparrow@salesforce.com`
|
|
21117
|
-
* - **Min Length:** 3
|
|
21118
|
-
* - **Max Length:** 320
|
|
21119
|
-
*
|
|
21120
|
-
* @property channel:
|
|
21121
|
-
*
|
|
21122
|
-
* @property status:
|
|
21123
|
-
*
|
|
21124
|
-
*/
|
|
21125
|
-
type ConsentSubscriptionRequest = {
|
|
21126
|
-
subscriptionId: string;
|
|
21127
|
-
contactPointValue: string;
|
|
21128
|
-
channel: SubscriptionChannel;
|
|
21129
|
-
status: ConsentStatus;
|
|
21130
|
-
} & {
|
|
21131
|
-
[key: string]: any;
|
|
21132
|
-
};
|
|
21133
|
-
/**
|
|
21134
|
-
* @type ConsentSubscriptionResponse: Collection wrapper of consent subscriptions
|
|
21135
|
-
*
|
|
21136
|
-
* @property data:
|
|
21137
|
-
*
|
|
21138
|
-
*/
|
|
21139
|
-
type ConsentSubscriptionResponse = {
|
|
21140
|
-
data: Array<ConsentSubscription>;
|
|
21141
|
-
} & {
|
|
21142
|
-
[key: string]: any;
|
|
21143
|
-
};
|
|
21144
|
-
/**
|
|
21145
|
-
* A specialized value indicating the system default values for locales.
|
|
21146
|
-
*/
|
|
21147
|
-
type DefaultFallback$1 = "default";
|
|
21148
|
-
/**
|
|
21149
|
-
* @type LocaleCode
|
|
21150
|
-
* 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.
|
|
21151
|
-
*/
|
|
21152
|
-
type LocaleCode$2 = DefaultFallback$1 | string;
|
|
21153
|
-
type getSubscriptionsQueryParameters = {
|
|
21154
|
-
siteId: string;
|
|
21155
|
-
locale?: LocaleCode$2;
|
|
21156
|
-
tags?: Array<string>;
|
|
21157
|
-
};
|
|
21158
|
-
type getSubscriptionsPathParameters = {
|
|
21159
|
-
organizationId: string;
|
|
21160
|
-
};
|
|
21161
|
-
type updateSubscriptionQueryParameters = {
|
|
21162
|
-
siteId: string;
|
|
21163
|
-
locale?: LocaleCode$2;
|
|
21164
|
-
};
|
|
21165
|
-
type updateSubscriptionPathParameters = {
|
|
21166
|
-
organizationId: string;
|
|
21167
|
-
};
|
|
21168
|
-
/**
|
|
21169
|
-
* All path parameters that are used by at least one ShopperConsents method.
|
|
21170
|
-
*/
|
|
21171
|
-
type ShopperConsentsPathParameters = Partial<getSubscriptionsPathParameters & updateSubscriptionPathParameters & {}>;
|
|
21172
|
-
/**
|
|
21173
|
-
* All query parameters that are used by at least one ShopperConsents method.
|
|
21174
|
-
*/
|
|
21175
|
-
type ShopperConsentsQueryParameters = Partial<getSubscriptionsQueryParameters & updateSubscriptionQueryParameters & {}>;
|
|
21176
|
-
/**
|
|
21177
|
-
* All parameters that are used by ShopperConsents.
|
|
21178
|
-
*/
|
|
21179
|
-
type ShopperConsentsParameters = ShopperConsentsPathParameters & BaseUriParameters & ShopperConsentsQueryParameters;
|
|
21180
|
-
/**
|
|
21181
|
-
* [Shopper Consents](https://developer.salesforce.com/docs/commerce/commerce-api/references?meta=shopper-consents:Summary)
|
|
21182
|
-
* ==================================
|
|
21183
|
-
*
|
|
21184
|
-
* *# Shopper Consent
|
|
21185
|
-
|
|
21186
|
-
## API Overview
|
|
21187
|
-
|
|
21188
|
-
The Shopper Consent API offers a centralized method for managing shopper consent. With this API, shoppers can view and update subscription preferences for marketing communications across various channels. This API controls how and where shoppers receive marketing messages while ensuring compliance with privacy regulations.
|
|
21189
|
-
|
|
21190
|
-
## Key Features
|
|
21191
|
-
|
|
21192
|
-
- Multi-Channel Support: Manage communication subscriptions across email, SMS, push notifications, in-app messages, and postal mail.
|
|
21193
|
-
- Organization-Based Management: Isolate consent preferences by organization for multi-tenant environments.
|
|
21194
|
-
- Real-Time Updates: Instantly create and retrieve subscription preferences.
|
|
21195
|
-
- Compliance Ready: Built with privacy regulations and consent-management best practices in mind.
|
|
21196
|
-
|
|
21197
|
-
## Authentication & Authorization
|
|
21198
|
-
|
|
21199
|
-
The Shopper Consent API requires a JSON Web Token acquired using the Shopper Consent endpoint:
|
|
21200
|
-
```
|
|
21201
|
-
https://{{shortcode}}.api.commercecloud.salesforce.com/customer/shopper-customers/v1/organizations/{{organizationId}}/customers/actions/login
|
|
21202
|
-
```
|
|
21203
|
-
You must include the relevant scope(s) in the client ID used to generate the SLAS token.
|
|
21204
|
-
|
|
21205
|
-
### Required Scopes
|
|
21206
|
-
|
|
21207
|
-
- `sfcc.shopper-consents`: Required for reading communication subscription data (GET operations).
|
|
21208
|
-
- `sfcc.shopper-consents.rw`: Required for creating and modifying communication subscription data (POST operations).
|
|
21209
|
-
|
|
21210
|
-
## Use Cases
|
|
21211
|
-
|
|
21212
|
-
### Shopper Subscription Management
|
|
21213
|
-
- Retrieve communication subscriptions: Retrieve relevant communication subscription options with display information.
|
|
21214
|
-
- Guest shoppers can retrieve communication subscriptions options without pre-defined shopper credentials, for example: email address, phone number.
|
|
21215
|
-
- Authenticated shoppers can retrieve communication subscription options available to their shopper credentials.
|
|
21216
|
-
- Communication subscription options can be filtered by one or more qualifying tags.
|
|
21217
|
-
- Update communication subscription consent preferences.
|
|
21218
|
-
|
|
21219
|
-
## Data Model
|
|
21220
|
-
|
|
21221
|
-
### Subscriptions
|
|
21222
|
-
Subscriptions represent a shopper's consent to receive specific types of marketing communications. Each subscription includes:
|
|
21223
|
-
|
|
21224
|
-
- Identifier: Descriptive identifier
|
|
21225
|
-
- Consent Status: Opt-in or opt-out
|
|
21226
|
-
- Display Information: Title, subtitle, and description for customer-facing interfaces
|
|
21227
|
-
- Tags: Categorical tags indicating where the subscription option can appear
|
|
21228
|
-
- Channels: Supported communication methods, such as email, SMS, push notification
|
|
21229
|
-
|
|
21230
|
-
### Channels
|
|
21231
|
-
Channels define the communication methods available for a subscription:
|
|
21232
|
-
- `email`: Email communications
|
|
21233
|
-
- `sms`: SMS/text messages
|
|
21234
|
-
- `whatsapp`: WhatsApp
|
|
21235
|
-
|
|
21236
|
-
### Tags
|
|
21237
|
-
Tags indicate where subscription options are displayed in your shopper experience. Tags are also accepted as optional filtering parameters in the retrieval of shopper consent subscriptions. For example:
|
|
21238
|
-
- `homepage_banner`: Main website homepage
|
|
21239
|
-
- `registration`: Shopper registration process
|
|
21240
|
-
- `checkout`: Checkout process
|
|
21241
|
-
- `user_profile`: User profile management area
|
|
21242
|
-
|
|
21243
|
-
## Best Practices
|
|
21244
|
-
|
|
21245
|
-
### User Experience
|
|
21246
|
-
- Make it easy for shoppers to update their preferences.
|
|
21247
|
-
- Respect shopper choices immediately.
|
|
21248
|
-
|
|
21249
|
-
### Implementation Guidelines
|
|
21250
|
-
- Implement clear and prominent unsubscribe mechanisms.
|
|
21251
|
-
|
|
21252
|
-
### Compliance Considerations
|
|
21253
|
-
- Ensure consent is freely given, specific, informed, and unambiguous.
|
|
21254
|
-
- Implement proper data retention and deletion policies.
|
|
21255
|
-
- Provide easy access to consent history and preferences.
|
|
21256
|
-
|
|
21257
|
-
## Error Handling
|
|
21258
|
-
|
|
21259
|
-
The API uses standard HTTP status codes and returns detailed error information to help with troubleshooting:
|
|
21260
|
-
|
|
21261
|
-
- `400 Bad Request`: Invalid request format or missing required fields
|
|
21262
|
-
- `401 Unauthorized`: Invalid or missing authentication token
|
|
21263
|
-
- `403 Forbidden`: Insufficient permissions for the requested operation
|
|
21264
|
-
- `404 Not Found`: Requested organization or resource not found
|
|
21265
|
-
- `500 Internal Server Error`: Unexpected server error
|
|
21266
|
-
|
|
21267
|
-
## Rate Limits
|
|
21268
|
-
|
|
21269
|
-
To ensure fair usage and system stability, the Shopper Consent API implements rate limiting. Refer to the response headers for current rate limit status and adjust your integration accordingly.*<br />
|
|
21270
|
-
*
|
|
21271
|
-
* Simple example:
|
|
21272
|
-
*
|
|
21273
|
-
* ```typescript
|
|
21274
|
-
* import { ShopperConsents } from "commerce-sdk-isomorphic";
|
|
21275
|
-
*
|
|
21276
|
-
* const clientConfig = {
|
|
21277
|
-
* parameters: {
|
|
21278
|
-
* clientId: "XXXXXX",
|
|
21279
|
-
* organizationId: "XXXX",
|
|
21280
|
-
* shortCode: "XXX",
|
|
21281
|
-
* siteId: "XX"
|
|
21282
|
-
* }
|
|
21283
|
-
* };
|
|
21284
|
-
* const shopperConsentsClient = new ShopperConsents(clientConfig);
|
|
21285
|
-
* ```
|
|
21286
|
-
*
|
|
21287
|
-
* <span style="font-size:.7em; display:block; text-align: right">
|
|
21288
|
-
* API Version: 0.0.33<br />
|
|
21289
|
-
* Last Updated: <br />
|
|
21290
|
-
* </span>
|
|
21291
|
-
*
|
|
21292
|
-
*
|
|
21293
|
-
*/
|
|
21294
|
-
declare class ShopperConsents<ConfigParameters extends ShopperConsentsParameters & Record<string, unknown>> {
|
|
21295
|
-
// baseUri is not required on ClientConfig, but we know that we provide one in the class constructor
|
|
21296
|
-
clientConfig: ClientConfig<ConfigParameters> & {
|
|
21297
|
-
baseUri: string;
|
|
21298
|
-
};
|
|
21299
|
-
static readonly defaultBaseUri = "https://{shortCode}.api.commercecloud.salesforce.com/shopper/shopper-consents/v1";
|
|
21300
|
-
static readonly apiPaths: {
|
|
21301
|
-
getSubscriptions: string;
|
|
21302
|
-
updateSubscription: string;
|
|
21303
|
-
};
|
|
21304
|
-
constructor(config: ClientConfigInit<ConfigParameters>);
|
|
21305
|
-
static readonly paramKeys: {
|
|
21306
|
-
readonly getSubscriptions: readonly [
|
|
21307
|
-
"organizationId",
|
|
21308
|
-
"siteId",
|
|
21309
|
-
"locale",
|
|
21310
|
-
"tags"
|
|
21311
|
-
];
|
|
21312
|
-
readonly getSubscriptionsRequired: readonly [
|
|
21313
|
-
"organizationId",
|
|
21314
|
-
"siteId"
|
|
21315
|
-
];
|
|
21316
|
-
readonly updateSubscription: readonly [
|
|
21317
|
-
"organizationId",
|
|
21318
|
-
"siteId",
|
|
21319
|
-
"locale"
|
|
21320
|
-
];
|
|
21321
|
-
readonly updateSubscriptionRequired: readonly [
|
|
21322
|
-
"organizationId",
|
|
21323
|
-
"siteId"
|
|
21324
|
-
];
|
|
21325
|
-
};
|
|
21326
|
-
/**
|
|
21327
|
-
* Retrieve all subcription preferences for the shopper (authenticated or guest)
|
|
21328
|
-
*
|
|
21329
|
-
* If you would like to get a raw Response object use the other getSubscriptions function.
|
|
21330
|
-
*
|
|
21331
|
-
* @param options - An object containing the options for this method.
|
|
21332
|
-
* @param options.parameters - An object containing the parameters for this method.
|
|
21333
|
-
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
|
|
21334
|
-
* @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.
|
|
21335
|
-
* @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.
|
|
21336
|
-
* @param options.parameters.tags - Optional parameter of 0 or more query string values which act as a filtering criteria. Multiple values are treated with `OR` logic, and absence of a value indicates no filtering by tag is desired.
|
|
21337
|
-
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
|
|
21338
|
-
*
|
|
21339
|
-
* @returns A promise of type ConsentSubscriptionResponse.
|
|
21340
|
-
*/
|
|
21341
|
-
getSubscriptions(options?: RequireParametersUnlessAllAreOptional<{
|
|
21342
|
-
parameters?: CompositeParameters<{
|
|
21343
|
-
organizationId: string;
|
|
21344
|
-
siteId: string;
|
|
21345
|
-
locale?: LocaleCode$2;
|
|
21346
|
-
tags?: Array<string>;
|
|
21347
|
-
} & QueryParameters, ConfigParameters>;
|
|
21348
|
-
headers?: {
|
|
21349
|
-
[key: string]: string;
|
|
21350
|
-
};
|
|
21351
|
-
}>): Promise<ConsentSubscriptionResponse>;
|
|
21352
|
-
/**
|
|
21353
|
-
* Retrieve all subcription preferences for the shopper (authenticated or guest)
|
|
21354
|
-
*
|
|
21355
|
-
* @param options - An object containing the options for this method.
|
|
21356
|
-
* @param options.parameters - An object containing the parameters for this method.
|
|
21357
|
-
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
|
|
21358
|
-
* @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.
|
|
21359
|
-
* @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.
|
|
21360
|
-
* @param options.parameters.tags - Optional parameter of 0 or more query string values which act as a filtering criteria. Multiple values are treated with `OR` logic, and absence of a value indicates no filtering by tag is desired.
|
|
21361
|
-
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
|
|
21362
|
-
* @param rawResponse - Set to true to return entire Response object instead of DTO.
|
|
21363
|
-
*
|
|
21364
|
-
* @returns A promise of type Response if rawResponse is true, a promise of type ConsentSubscriptionResponse otherwise.
|
|
21365
|
-
*/
|
|
21366
|
-
getSubscriptions<T extends boolean>(options?: RequireParametersUnlessAllAreOptional<{
|
|
21367
|
-
parameters?: CompositeParameters<{
|
|
21368
|
-
organizationId: string;
|
|
21369
|
-
siteId: string;
|
|
21370
|
-
locale?: LocaleCode$2;
|
|
21371
|
-
tags?: Array<string>;
|
|
21372
|
-
} & QueryParameters, ConfigParameters>;
|
|
21373
|
-
headers?: {
|
|
21374
|
-
[key: string]: string;
|
|
21375
|
-
};
|
|
21376
|
-
}>, rawResponse?: T): Promise<T extends true ? Response : ConsentSubscriptionResponse>;
|
|
21377
|
-
/**
|
|
21378
|
-
* Update the consent status for a given subscription.
|
|
21379
|
-
*
|
|
21380
|
-
* If you would like to get a raw Response object use the other updateSubscription function.
|
|
21381
|
-
*
|
|
21382
|
-
* @param options - An object containing the options for this method.
|
|
21383
|
-
* @param options.parameters - An object containing the parameters for this method.
|
|
21384
|
-
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
|
|
21385
|
-
* @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.
|
|
21386
|
-
* @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.
|
|
21387
|
-
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
|
|
21388
|
-
* @param options.body - The data to send as the request body.
|
|
21389
|
-
*
|
|
21390
|
-
* @returns A promise of type ConsentSubscription.
|
|
21391
|
-
*/
|
|
21392
|
-
updateSubscription(options: RequireParametersUnlessAllAreOptional<{
|
|
21393
|
-
parameters?: CompositeParameters<{
|
|
21394
|
-
organizationId: string;
|
|
21395
|
-
siteId: string;
|
|
21396
|
-
locale?: LocaleCode$2;
|
|
21397
|
-
} & QueryParameters, ConfigParameters>;
|
|
21398
|
-
headers?: {
|
|
21399
|
-
[key: string]: string;
|
|
21400
|
-
};
|
|
21401
|
-
body: ConsentSubscriptionRequest & CustomRequestBody;
|
|
21402
|
-
}>): Promise<ConsentSubscription>;
|
|
21403
|
-
/**
|
|
21404
|
-
* Update the consent status for a given subscription.
|
|
21405
|
-
*
|
|
21406
|
-
* @param options - An object containing the options for this method.
|
|
21407
|
-
* @param options.parameters - An object containing the parameters for this method.
|
|
21408
|
-
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
|
|
21409
|
-
* @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.
|
|
21410
|
-
* @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.
|
|
21411
|
-
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
|
|
21412
|
-
* @param options.body - The data to send as the request body.
|
|
21413
|
-
* @param rawResponse - Set to true to return entire Response object instead of DTO.
|
|
21414
|
-
*
|
|
21415
|
-
* @returns A promise of type Response if rawResponse is true, a promise of type ConsentSubscription otherwise.
|
|
21416
|
-
*/
|
|
21417
|
-
updateSubscription<T extends boolean>(options: RequireParametersUnlessAllAreOptional<{
|
|
21418
|
-
parameters?: CompositeParameters<{
|
|
21419
|
-
organizationId: string;
|
|
21420
|
-
siteId: string;
|
|
21421
|
-
locale?: LocaleCode$2;
|
|
21422
|
-
} & QueryParameters, ConfigParameters>;
|
|
21423
|
-
headers?: {
|
|
21424
|
-
[key: string]: string;
|
|
21425
|
-
};
|
|
21426
|
-
body: ConsentSubscriptionRequest & CustomRequestBody;
|
|
21427
|
-
}>, rawResponse?: T): Promise<T extends true ? Response : ConsentSubscription>;
|
|
21428
|
-
}
|
|
21429
|
-
declare namespace ShopperConsentsApiTypes {
|
|
21430
|
-
/*
|
|
21431
|
-
* Copyright (c) 2023, Salesforce, Inc.
|
|
21432
|
-
* All rights reserved.
|
|
21433
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
21434
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
21435
|
-
*/
|
|
21436
|
-
/**
|
|
21437
|
-
* Makes a type easier to read.
|
|
21438
|
-
*/
|
|
21439
|
-
type Prettify<T> = NonNullable<{
|
|
21440
|
-
[K in keyof T]: T[K];
|
|
21441
|
-
}>;
|
|
21442
|
-
/**
|
|
21443
|
-
* Generates the types required on a method, based on those provided in the config.
|
|
21444
|
-
*/
|
|
21445
|
-
type CompositeParameters<MethodParameters extends Record<string, unknown>, ConfigParameters extends Record<string, unknown>> = Prettify<Omit<MethodParameters, keyof ConfigParameters> & Partial<MethodParameters>>;
|
|
21446
|
-
/**
|
|
21447
|
-
* If an object has a `parameters` property, and the `parameters` object has required properties,
|
|
21448
|
-
* then the `parameters` property on the root object is marked as required.
|
|
21449
|
-
*/
|
|
21450
|
-
type RequireParametersUnlessAllAreOptional<T extends {
|
|
21451
|
-
parameters?: Record<string, unknown>;
|
|
21452
|
-
}> = Record<string, never> extends NonNullable<T["parameters"]> ? T : Prettify<T & Required<Pick<T, "parameters">>>;
|
|
21453
|
-
/**
|
|
21454
|
-
* Template parameters used in the base URI of all API endpoints. `version` will default to `"v1"`
|
|
21455
|
-
* if not specified.
|
|
21456
|
-
*/
|
|
21457
|
-
interface BaseUriParameters {
|
|
21458
|
-
shortCode: string;
|
|
21459
|
-
}
|
|
21460
|
-
type LocaleCode = {
|
|
21461
|
-
[key: string]: any;
|
|
21462
|
-
};
|
|
21463
|
-
/**
|
|
21464
|
-
* Generic interface for path parameters.
|
|
21465
|
-
*/
|
|
21466
|
-
interface PathParameters {
|
|
21467
|
-
[key: string]: string | number | boolean;
|
|
21468
|
-
}
|
|
21469
|
-
/**
|
|
21470
|
-
* Generic interface for query parameters.
|
|
21471
|
-
*/
|
|
21472
|
-
interface QueryParameters {
|
|
21473
|
-
[key: string]: string | number | boolean | string[] | number[] | LocaleCode;
|
|
21474
|
-
}
|
|
21475
|
-
/**
|
|
21476
|
-
* Generic interface for all parameter types.
|
|
21477
|
-
*/
|
|
21478
|
-
type UrlParameters = PathParameters | QueryParameters;
|
|
21479
|
-
/**
|
|
21480
|
-
* Custom query parameter type with any string prefixed with `c_` as the key and the allowed
|
|
21481
|
-
* types for query parameters for the value.
|
|
21482
|
-
*/
|
|
21483
|
-
type CustomQueryParameters = {
|
|
21484
|
-
[key in `c_${string}`]: string | number | boolean | string[] | number[];
|
|
21485
|
-
};
|
|
21486
|
-
/**
|
|
21487
|
-
* Custom body request type with any string prefixed with `c_` as the key and the allowed
|
|
21488
|
-
* types for the value.
|
|
21489
|
-
*/
|
|
21490
|
-
type CustomRequestBody = {
|
|
21491
|
-
[key in `c_${string}`]: string | number | boolean | string[] | number[] | {
|
|
21492
|
-
[key: string]: unknown;
|
|
21493
|
-
};
|
|
21494
|
-
};
|
|
21495
|
-
/**
|
|
21496
|
-
* Alias for `RequestInit` from TypeScript's DOM lib, to more clearly differentiate
|
|
21497
|
-
* it from the `RequestInit` provided by node-fetch.
|
|
21498
|
-
*/
|
|
21499
|
-
type BrowserRequestInit = RequestInit;
|
|
21500
|
-
/**
|
|
21501
|
-
* Any properties supported in either the browser or node are accepted.
|
|
21502
|
-
* Using the right properties in the right context is left to the user.
|
|
21503
|
-
*/
|
|
21504
|
-
type FetchOptions = NodeRequestInit & BrowserRequestInit;
|
|
21505
21028
|
/**
|
|
21506
21029
|
* Base options that can be passed to the `ClientConfig` class.
|
|
21507
21030
|
*/
|
|
@@ -21513,12 +21036,12 @@ declare namespace ShopperConsentsApiTypes {
|
|
|
21513
21036
|
};
|
|
21514
21037
|
parameters: Params;
|
|
21515
21038
|
fetchOptions?: FetchOptions;
|
|
21039
|
+
fetch?: FetchFunction;
|
|
21516
21040
|
transformRequest?: (data: unknown, headers: {
|
|
21517
21041
|
[key: string]: string;
|
|
21518
21042
|
}) => Required<FetchOptions>["body"];
|
|
21519
21043
|
throwOnBadResponse?: boolean;
|
|
21520
21044
|
}
|
|
21521
|
-
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
21522
21045
|
/**
|
|
21523
21046
|
* Configuration parameters common to Commerce SDK clients
|
|
21524
21047
|
*/
|
|
@@ -21530,6 +21053,7 @@ declare namespace ShopperConsentsApiTypes {
|
|
|
21530
21053
|
};
|
|
21531
21054
|
parameters: Params;
|
|
21532
21055
|
fetchOptions: FetchOptions;
|
|
21056
|
+
fetch?: FetchFunction;
|
|
21533
21057
|
transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
|
|
21534
21058
|
throwOnBadResponse: boolean;
|
|
21535
21059
|
constructor(config: ClientConfigInit<Params>);
|
|
@@ -22662,6 +22186,7 @@ declare namespace ShopperContextsApiTypes {
|
|
|
22662
22186
|
* Using the right properties in the right context is left to the user.
|
|
22663
22187
|
*/
|
|
22664
22188
|
type FetchOptions = NodeRequestInit & BrowserRequestInit;
|
|
22189
|
+
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
22665
22190
|
/**
|
|
22666
22191
|
* Base options that can be passed to the `ClientConfig` class.
|
|
22667
22192
|
*/
|
|
@@ -22673,12 +22198,12 @@ declare namespace ShopperContextsApiTypes {
|
|
|
22673
22198
|
};
|
|
22674
22199
|
parameters: Params;
|
|
22675
22200
|
fetchOptions?: FetchOptions;
|
|
22201
|
+
fetch?: FetchFunction;
|
|
22676
22202
|
transformRequest?: (data: unknown, headers: {
|
|
22677
22203
|
[key: string]: string;
|
|
22678
22204
|
}) => Required<FetchOptions>["body"];
|
|
22679
22205
|
throwOnBadResponse?: boolean;
|
|
22680
22206
|
}
|
|
22681
|
-
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
22682
22207
|
/**
|
|
22683
22208
|
* Configuration parameters common to Commerce SDK clients
|
|
22684
22209
|
*/
|
|
@@ -22690,6 +22215,7 @@ declare namespace ShopperContextsApiTypes {
|
|
|
22690
22215
|
};
|
|
22691
22216
|
parameters: Params;
|
|
22692
22217
|
fetchOptions: FetchOptions;
|
|
22218
|
+
fetch?: FetchFunction;
|
|
22693
22219
|
transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
|
|
22694
22220
|
throwOnBadResponse: boolean;
|
|
22695
22221
|
constructor(config: ClientConfigInit<Params>);
|
|
@@ -25367,34 +24893,6 @@ type CustomerPaymentInstrumentRequest = {
|
|
|
25367
24893
|
} & {
|
|
25368
24894
|
[key: string]: any;
|
|
25369
24895
|
};
|
|
25370
|
-
/**
|
|
25371
|
-
* @type CustomerPaymentInstrumentUpdateRequestPaymentCard: The payment card expiration information.
|
|
25372
|
-
*
|
|
25373
|
-
* @property expirationMonth: The month when the payment card expires.
|
|
25374
|
-
*
|
|
25375
|
-
* @property expirationYear: The year when the payment card expires.
|
|
25376
|
-
*
|
|
25377
|
-
*/
|
|
25378
|
-
type CustomerPaymentInstrumentUpdateRequestPaymentCard = {
|
|
25379
|
-
expirationMonth?: number;
|
|
25380
|
-
expirationYear?: number;
|
|
25381
|
-
} & {
|
|
25382
|
-
[key: string]: any;
|
|
25383
|
-
};
|
|
25384
|
-
/**
|
|
25385
|
-
* @type CustomerPaymentInstrumentUpdateRequest: Document representing a customer payment instrument update request. Only allows updating the default flag and card expiration date.
|
|
25386
|
-
*
|
|
25387
|
-
* @property default: The default payment instrument.
|
|
25388
|
-
*
|
|
25389
|
-
* @property paymentCard:
|
|
25390
|
-
*
|
|
25391
|
-
*/
|
|
25392
|
-
type CustomerPaymentInstrumentUpdateRequest = {
|
|
25393
|
-
default?: boolean;
|
|
25394
|
-
paymentCard?: CustomerPaymentInstrumentUpdateRequestPaymentCard;
|
|
25395
|
-
} & {
|
|
25396
|
-
[key: string]: any;
|
|
25397
|
-
};
|
|
25398
24896
|
/**
|
|
25399
24897
|
* @type ProductListEvent: Document representing a product list event.
|
|
25400
24898
|
*
|
|
@@ -25983,14 +25481,6 @@ type updateCustomerPasswordPathParameters = {
|
|
|
25983
25481
|
customerId: string;
|
|
25984
25482
|
organizationId: string;
|
|
25985
25483
|
};
|
|
25986
|
-
type updateCustomerPaymentInstrumentQueryParameters = {
|
|
25987
|
-
siteId: string;
|
|
25988
|
-
};
|
|
25989
|
-
type updateCustomerPaymentInstrumentPathParameters = {
|
|
25990
|
-
paymentInstrumentId: string;
|
|
25991
|
-
customerId: string;
|
|
25992
|
-
organizationId: string;
|
|
25993
|
-
};
|
|
25994
25484
|
type updateCustomerProductListQueryParameters = {
|
|
25995
25485
|
siteId: string;
|
|
25996
25486
|
};
|
|
@@ -26011,11 +25501,11 @@ type updateCustomerProductListItemPathParameters = {
|
|
|
26011
25501
|
/**
|
|
26012
25502
|
* All path parameters that are used by at least one ShopperCustomers method.
|
|
26013
25503
|
*/
|
|
26014
|
-
type ShopperCustomersPathParameters = Partial<createCustomerAddressPathParameters & createCustomerPaymentInstrumentPathParameters & createCustomerProductListPathParameters & createCustomerProductListItemPathParameters & deleteCustomerPaymentInstrumentPathParameters & deleteCustomerProductListPathParameters & deleteCustomerProductListItemPathParameters & getCustomerPathParameters & getCustomerAddressPathParameters & getCustomerBasketsPathParameters & getCustomerOrdersPathParameters & getCustomerPaymentInstrumentPathParameters & getCustomerProductListPathParameters & getCustomerProductListItemPathParameters & getCustomerProductListsPathParameters & getExternalProfilePathParameters & getProductListItemPathParameters & getPublicProductListPathParameters & getPublicProductListsBySearchTermPathParameters & getResetPasswordTokenPathParameters & registerCustomerPathParameters & registerExternalProfilePathParameters & removeCustomerAddressPathParameters & resetPasswordPathParameters & updateCustomerPathParameters & updateCustomerAddressPathParameters & updateCustomerPasswordPathParameters &
|
|
25504
|
+
type ShopperCustomersPathParameters = Partial<createCustomerAddressPathParameters & createCustomerPaymentInstrumentPathParameters & createCustomerProductListPathParameters & createCustomerProductListItemPathParameters & deleteCustomerPaymentInstrumentPathParameters & deleteCustomerProductListPathParameters & deleteCustomerProductListItemPathParameters & getCustomerPathParameters & getCustomerAddressPathParameters & getCustomerBasketsPathParameters & getCustomerOrdersPathParameters & getCustomerPaymentInstrumentPathParameters & getCustomerProductListPathParameters & getCustomerProductListItemPathParameters & getCustomerProductListsPathParameters & getExternalProfilePathParameters & getProductListItemPathParameters & getPublicProductListPathParameters & getPublicProductListsBySearchTermPathParameters & getResetPasswordTokenPathParameters & registerCustomerPathParameters & registerExternalProfilePathParameters & removeCustomerAddressPathParameters & resetPasswordPathParameters & updateCustomerPathParameters & updateCustomerAddressPathParameters & updateCustomerPasswordPathParameters & updateCustomerProductListPathParameters & updateCustomerProductListItemPathParameters & {}>;
|
|
26015
25505
|
/**
|
|
26016
25506
|
* All query parameters that are used by at least one ShopperCustomers method.
|
|
26017
25507
|
*/
|
|
26018
|
-
type ShopperCustomersQueryParameters = Partial<createCustomerAddressQueryParameters & createCustomerPaymentInstrumentQueryParameters & createCustomerProductListQueryParameters & createCustomerProductListItemQueryParameters & deleteCustomerPaymentInstrumentQueryParameters & deleteCustomerProductListQueryParameters & deleteCustomerProductListItemQueryParameters & getCustomerQueryParameters & getCustomerAddressQueryParameters & getCustomerBasketsQueryParameters & getCustomerOrdersQueryParameters & getCustomerPaymentInstrumentQueryParameters & getCustomerProductListQueryParameters & getCustomerProductListItemQueryParameters & getCustomerProductListsQueryParameters & getExternalProfileQueryParameters & getProductListItemQueryParameters & getPublicProductListQueryParameters & getPublicProductListsBySearchTermQueryParameters & getResetPasswordTokenQueryParameters & registerCustomerQueryParameters & registerExternalProfileQueryParameters & removeCustomerAddressQueryParameters & resetPasswordQueryParameters & updateCustomerQueryParameters & updateCustomerAddressQueryParameters & updateCustomerPasswordQueryParameters &
|
|
25508
|
+
type ShopperCustomersQueryParameters = Partial<createCustomerAddressQueryParameters & createCustomerPaymentInstrumentQueryParameters & createCustomerProductListQueryParameters & createCustomerProductListItemQueryParameters & deleteCustomerPaymentInstrumentQueryParameters & deleteCustomerProductListQueryParameters & deleteCustomerProductListItemQueryParameters & getCustomerQueryParameters & getCustomerAddressQueryParameters & getCustomerBasketsQueryParameters & getCustomerOrdersQueryParameters & getCustomerPaymentInstrumentQueryParameters & getCustomerProductListQueryParameters & getCustomerProductListItemQueryParameters & getCustomerProductListsQueryParameters & getExternalProfileQueryParameters & getProductListItemQueryParameters & getPublicProductListQueryParameters & getPublicProductListsBySearchTermQueryParameters & getResetPasswordTokenQueryParameters & registerCustomerQueryParameters & registerExternalProfileQueryParameters & removeCustomerAddressQueryParameters & resetPasswordQueryParameters & updateCustomerQueryParameters & updateCustomerAddressQueryParameters & updateCustomerPasswordQueryParameters & updateCustomerProductListQueryParameters & updateCustomerProductListItemQueryParameters & {}>;
|
|
26019
25509
|
/**
|
|
26020
25510
|
* All parameters that are used by ShopperCustomers.
|
|
26021
25511
|
*/
|
|
@@ -26135,7 +25625,6 @@ declare class ShopperCustomers<ConfigParameters extends ShopperCustomersParamete
|
|
|
26135
25625
|
updateCustomer: string;
|
|
26136
25626
|
updateCustomerAddress: string;
|
|
26137
25627
|
updateCustomerPassword: string;
|
|
26138
|
-
updateCustomerPaymentInstrument: string;
|
|
26139
25628
|
updateCustomerProductList: string;
|
|
26140
25629
|
updateCustomerProductListItem: string;
|
|
26141
25630
|
};
|
|
@@ -26438,18 +25927,6 @@ declare class ShopperCustomers<ConfigParameters extends ShopperCustomersParamete
|
|
|
26438
25927
|
"organizationId",
|
|
26439
25928
|
"siteId"
|
|
26440
25929
|
];
|
|
26441
|
-
readonly updateCustomerPaymentInstrument: readonly [
|
|
26442
|
-
"paymentInstrumentId",
|
|
26443
|
-
"customerId",
|
|
26444
|
-
"organizationId",
|
|
26445
|
-
"siteId"
|
|
26446
|
-
];
|
|
26447
|
-
readonly updateCustomerPaymentInstrumentRequired: readonly [
|
|
26448
|
-
"paymentInstrumentId",
|
|
26449
|
-
"customerId",
|
|
26450
|
-
"organizationId",
|
|
26451
|
-
"siteId"
|
|
26452
|
-
];
|
|
26453
25930
|
readonly updateCustomerProductList: readonly [
|
|
26454
25931
|
"listId",
|
|
26455
25932
|
"customerId",
|
|
@@ -27884,61 +27361,6 @@ declare class ShopperCustomers<ConfigParameters extends ShopperCustomersParamete
|
|
|
27884
27361
|
};
|
|
27885
27362
|
body: PasswordChangeRequest & CustomRequestBody;
|
|
27886
27363
|
}>, rawResponse?: T): Promise<T extends true ? Response : void>;
|
|
27887
|
-
/**
|
|
27888
|
-
*
|
|
27889
|
-
*
|
|
27890
|
-
* If you would like to get a raw Response object use the other updateCustomerPaymentInstrument function.
|
|
27891
|
-
*
|
|
27892
|
-
* @param options - An object containing the options for this method.
|
|
27893
|
-
* @param options.parameters - An object containing the parameters for this method.
|
|
27894
|
-
* @param options.parameters.paymentInstrumentId - The ID of the payment instrument to be retrievedCustomer.
|
|
27895
|
-
* @param options.parameters.customerId - The customer ID.
|
|
27896
|
-
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
|
|
27897
|
-
* @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.
|
|
27898
|
-
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
|
|
27899
|
-
* @param options.body - The data to send as the request body.
|
|
27900
|
-
*
|
|
27901
|
-
* @returns A promise of type CustomerPaymentInstrument.
|
|
27902
|
-
*/
|
|
27903
|
-
updateCustomerPaymentInstrument(options: RequireParametersUnlessAllAreOptional<{
|
|
27904
|
-
parameters?: CompositeParameters<{
|
|
27905
|
-
paymentInstrumentId: string;
|
|
27906
|
-
customerId: string;
|
|
27907
|
-
organizationId: string;
|
|
27908
|
-
siteId: string;
|
|
27909
|
-
} & QueryParameters, ConfigParameters>;
|
|
27910
|
-
headers?: {
|
|
27911
|
-
[key: string]: string;
|
|
27912
|
-
};
|
|
27913
|
-
body: CustomerPaymentInstrumentUpdateRequest & CustomRequestBody;
|
|
27914
|
-
}>): Promise<CustomerPaymentInstrument>;
|
|
27915
|
-
/**
|
|
27916
|
-
*
|
|
27917
|
-
*
|
|
27918
|
-
* @param options - An object containing the options for this method.
|
|
27919
|
-
* @param options.parameters - An object containing the parameters for this method.
|
|
27920
|
-
* @param options.parameters.paymentInstrumentId - The ID of the payment instrument to be retrievedCustomer.
|
|
27921
|
-
* @param options.parameters.customerId - The customer ID.
|
|
27922
|
-
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
|
|
27923
|
-
* @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.
|
|
27924
|
-
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
|
|
27925
|
-
* @param options.body - The data to send as the request body.
|
|
27926
|
-
* @param rawResponse - Set to true to return entire Response object instead of DTO.
|
|
27927
|
-
*
|
|
27928
|
-
* @returns A promise of type Response if rawResponse is true, a promise of type CustomerPaymentInstrument otherwise.
|
|
27929
|
-
*/
|
|
27930
|
-
updateCustomerPaymentInstrument<T extends boolean>(options: RequireParametersUnlessAllAreOptional<{
|
|
27931
|
-
parameters?: CompositeParameters<{
|
|
27932
|
-
paymentInstrumentId: string;
|
|
27933
|
-
customerId: string;
|
|
27934
|
-
organizationId: string;
|
|
27935
|
-
siteId: string;
|
|
27936
|
-
} & QueryParameters, ConfigParameters>;
|
|
27937
|
-
headers?: {
|
|
27938
|
-
[key: string]: string;
|
|
27939
|
-
};
|
|
27940
|
-
body: CustomerPaymentInstrumentUpdateRequest & CustomRequestBody;
|
|
27941
|
-
}>, rawResponse?: T): Promise<T extends true ? Response : CustomerPaymentInstrument>;
|
|
27942
27364
|
/**
|
|
27943
27365
|
*
|
|
27944
27366
|
*
|
|
@@ -28148,6 +27570,7 @@ declare namespace ShopperCustomersApiTypes {
|
|
|
28148
27570
|
* Using the right properties in the right context is left to the user.
|
|
28149
27571
|
*/
|
|
28150
27572
|
type FetchOptions = NodeRequestInit & BrowserRequestInit;
|
|
27573
|
+
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
28151
27574
|
/**
|
|
28152
27575
|
* Base options that can be passed to the `ClientConfig` class.
|
|
28153
27576
|
*/
|
|
@@ -28159,12 +27582,12 @@ declare namespace ShopperCustomersApiTypes {
|
|
|
28159
27582
|
};
|
|
28160
27583
|
parameters: Params;
|
|
28161
27584
|
fetchOptions?: FetchOptions;
|
|
27585
|
+
fetch?: FetchFunction;
|
|
28162
27586
|
transformRequest?: (data: unknown, headers: {
|
|
28163
27587
|
[key: string]: string;
|
|
28164
27588
|
}) => Required<FetchOptions>["body"];
|
|
28165
27589
|
throwOnBadResponse?: boolean;
|
|
28166
27590
|
}
|
|
28167
|
-
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
28168
27591
|
/**
|
|
28169
27592
|
* Configuration parameters common to Commerce SDK clients
|
|
28170
27593
|
*/
|
|
@@ -28176,6 +27599,7 @@ declare namespace ShopperCustomersApiTypes {
|
|
|
28176
27599
|
};
|
|
28177
27600
|
parameters: Params;
|
|
28178
27601
|
fetchOptions: FetchOptions;
|
|
27602
|
+
fetch?: FetchFunction;
|
|
28179
27603
|
transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
|
|
28180
27604
|
throwOnBadResponse: boolean;
|
|
28181
27605
|
constructor(config: ClientConfigInit<Params>);
|
|
@@ -30203,34 +29627,6 @@ declare namespace ShopperCustomersApiTypes {
|
|
|
30203
29627
|
} & {
|
|
30204
29628
|
[key: string]: any;
|
|
30205
29629
|
};
|
|
30206
|
-
/**
|
|
30207
|
-
* @type CustomerPaymentInstrumentUpdateRequestPaymentCard: The payment card expiration information.
|
|
30208
|
-
*
|
|
30209
|
-
* @property expirationMonth: The month when the payment card expires.
|
|
30210
|
-
*
|
|
30211
|
-
* @property expirationYear: The year when the payment card expires.
|
|
30212
|
-
*
|
|
30213
|
-
*/
|
|
30214
|
-
type CustomerPaymentInstrumentUpdateRequestPaymentCard = {
|
|
30215
|
-
expirationMonth?: number;
|
|
30216
|
-
expirationYear?: number;
|
|
30217
|
-
} & {
|
|
30218
|
-
[key: string]: any;
|
|
30219
|
-
};
|
|
30220
|
-
/**
|
|
30221
|
-
* @type CustomerPaymentInstrumentUpdateRequest: Document representing a customer payment instrument update request. Only allows updating the default flag and card expiration date.
|
|
30222
|
-
*
|
|
30223
|
-
* @property default: The default payment instrument.
|
|
30224
|
-
*
|
|
30225
|
-
* @property paymentCard:
|
|
30226
|
-
*
|
|
30227
|
-
*/
|
|
30228
|
-
type CustomerPaymentInstrumentUpdateRequest = {
|
|
30229
|
-
default?: boolean;
|
|
30230
|
-
paymentCard?: CustomerPaymentInstrumentUpdateRequestPaymentCard;
|
|
30231
|
-
} & {
|
|
30232
|
-
[key: string]: any;
|
|
30233
|
-
};
|
|
30234
29630
|
/**
|
|
30235
29631
|
* @type ProductListEvent: Document representing a product list event.
|
|
30236
29632
|
*
|
|
@@ -30873,14 +30269,6 @@ declare namespace ShopperCustomersApiTypes {
|
|
|
30873
30269
|
customerId: string;
|
|
30874
30270
|
organizationId: string;
|
|
30875
30271
|
};
|
|
30876
|
-
type updateCustomerPaymentInstrumentQueryParameters = {
|
|
30877
|
-
siteId: string;
|
|
30878
|
-
};
|
|
30879
|
-
type updateCustomerPaymentInstrumentPathParameters = {
|
|
30880
|
-
paymentInstrumentId: string;
|
|
30881
|
-
customerId: string;
|
|
30882
|
-
organizationId: string;
|
|
30883
|
-
};
|
|
30884
30272
|
type updateCustomerProductListQueryParameters = {
|
|
30885
30273
|
siteId: string;
|
|
30886
30274
|
};
|
|
@@ -30901,11 +30289,11 @@ declare namespace ShopperCustomersApiTypes {
|
|
|
30901
30289
|
/**
|
|
30902
30290
|
* All path parameters that are used by at least one ShopperCustomers method.
|
|
30903
30291
|
*/
|
|
30904
|
-
type ShopperCustomersPathParameters = Partial<createCustomerAddressPathParameters & createCustomerPaymentInstrumentPathParameters & createCustomerProductListPathParameters & createCustomerProductListItemPathParameters & deleteCustomerPaymentInstrumentPathParameters & deleteCustomerProductListPathParameters & deleteCustomerProductListItemPathParameters & getCustomerPathParameters & getCustomerAddressPathParameters & getCustomerBasketsPathParameters & getCustomerOrdersPathParameters & getCustomerPaymentInstrumentPathParameters & getCustomerProductListPathParameters & getCustomerProductListItemPathParameters & getCustomerProductListsPathParameters & getExternalProfilePathParameters & getProductListItemPathParameters & getPublicProductListPathParameters & getPublicProductListsBySearchTermPathParameters & getResetPasswordTokenPathParameters & registerCustomerPathParameters & registerExternalProfilePathParameters & removeCustomerAddressPathParameters & resetPasswordPathParameters & updateCustomerPathParameters & updateCustomerAddressPathParameters & updateCustomerPasswordPathParameters &
|
|
30292
|
+
type ShopperCustomersPathParameters = Partial<createCustomerAddressPathParameters & createCustomerPaymentInstrumentPathParameters & createCustomerProductListPathParameters & createCustomerProductListItemPathParameters & deleteCustomerPaymentInstrumentPathParameters & deleteCustomerProductListPathParameters & deleteCustomerProductListItemPathParameters & getCustomerPathParameters & getCustomerAddressPathParameters & getCustomerBasketsPathParameters & getCustomerOrdersPathParameters & getCustomerPaymentInstrumentPathParameters & getCustomerProductListPathParameters & getCustomerProductListItemPathParameters & getCustomerProductListsPathParameters & getExternalProfilePathParameters & getProductListItemPathParameters & getPublicProductListPathParameters & getPublicProductListsBySearchTermPathParameters & getResetPasswordTokenPathParameters & registerCustomerPathParameters & registerExternalProfilePathParameters & removeCustomerAddressPathParameters & resetPasswordPathParameters & updateCustomerPathParameters & updateCustomerAddressPathParameters & updateCustomerPasswordPathParameters & updateCustomerProductListPathParameters & updateCustomerProductListItemPathParameters & {}>;
|
|
30905
30293
|
/**
|
|
30906
30294
|
* All query parameters that are used by at least one ShopperCustomers method.
|
|
30907
30295
|
*/
|
|
30908
|
-
type ShopperCustomersQueryParameters = Partial<createCustomerAddressQueryParameters & createCustomerPaymentInstrumentQueryParameters & createCustomerProductListQueryParameters & createCustomerProductListItemQueryParameters & deleteCustomerPaymentInstrumentQueryParameters & deleteCustomerProductListQueryParameters & deleteCustomerProductListItemQueryParameters & getCustomerQueryParameters & getCustomerAddressQueryParameters & getCustomerBasketsQueryParameters & getCustomerOrdersQueryParameters & getCustomerPaymentInstrumentQueryParameters & getCustomerProductListQueryParameters & getCustomerProductListItemQueryParameters & getCustomerProductListsQueryParameters & getExternalProfileQueryParameters & getProductListItemQueryParameters & getPublicProductListQueryParameters & getPublicProductListsBySearchTermQueryParameters & getResetPasswordTokenQueryParameters & registerCustomerQueryParameters & registerExternalProfileQueryParameters & removeCustomerAddressQueryParameters & resetPasswordQueryParameters & updateCustomerQueryParameters & updateCustomerAddressQueryParameters & updateCustomerPasswordQueryParameters &
|
|
30296
|
+
type ShopperCustomersQueryParameters = Partial<createCustomerAddressQueryParameters & createCustomerPaymentInstrumentQueryParameters & createCustomerProductListQueryParameters & createCustomerProductListItemQueryParameters & deleteCustomerPaymentInstrumentQueryParameters & deleteCustomerProductListQueryParameters & deleteCustomerProductListItemQueryParameters & getCustomerQueryParameters & getCustomerAddressQueryParameters & getCustomerBasketsQueryParameters & getCustomerOrdersQueryParameters & getCustomerPaymentInstrumentQueryParameters & getCustomerProductListQueryParameters & getCustomerProductListItemQueryParameters & getCustomerProductListsQueryParameters & getExternalProfileQueryParameters & getProductListItemQueryParameters & getPublicProductListQueryParameters & getPublicProductListsBySearchTermQueryParameters & getResetPasswordTokenQueryParameters & registerCustomerQueryParameters & registerExternalProfileQueryParameters & removeCustomerAddressQueryParameters & resetPasswordQueryParameters & updateCustomerQueryParameters & updateCustomerAddressQueryParameters & updateCustomerPasswordQueryParameters & updateCustomerProductListQueryParameters & updateCustomerProductListItemQueryParameters & {}>;
|
|
30909
30297
|
/**
|
|
30910
30298
|
* All parameters that are used by ShopperCustomers.
|
|
30911
30299
|
*/
|
|
@@ -31025,7 +30413,6 @@ declare namespace ShopperCustomersApiTypes {
|
|
|
31025
30413
|
updateCustomer: string;
|
|
31026
30414
|
updateCustomerAddress: string;
|
|
31027
30415
|
updateCustomerPassword: string;
|
|
31028
|
-
updateCustomerPaymentInstrument: string;
|
|
31029
30416
|
updateCustomerProductList: string;
|
|
31030
30417
|
updateCustomerProductListItem: string;
|
|
31031
30418
|
};
|
|
@@ -31328,18 +30715,6 @@ declare namespace ShopperCustomersApiTypes {
|
|
|
31328
30715
|
"organizationId",
|
|
31329
30716
|
"siteId"
|
|
31330
30717
|
];
|
|
31331
|
-
readonly updateCustomerPaymentInstrument: readonly [
|
|
31332
|
-
"paymentInstrumentId",
|
|
31333
|
-
"customerId",
|
|
31334
|
-
"organizationId",
|
|
31335
|
-
"siteId"
|
|
31336
|
-
];
|
|
31337
|
-
readonly updateCustomerPaymentInstrumentRequired: readonly [
|
|
31338
|
-
"paymentInstrumentId",
|
|
31339
|
-
"customerId",
|
|
31340
|
-
"organizationId",
|
|
31341
|
-
"siteId"
|
|
31342
|
-
];
|
|
31343
30718
|
readonly updateCustomerProductList: readonly [
|
|
31344
30719
|
"listId",
|
|
31345
30720
|
"customerId",
|
|
@@ -32774,61 +32149,6 @@ declare namespace ShopperCustomersApiTypes {
|
|
|
32774
32149
|
};
|
|
32775
32150
|
body: PasswordChangeRequest & CustomRequestBody;
|
|
32776
32151
|
}>, rawResponse?: T): Promise<T extends true ? Response : void>;
|
|
32777
|
-
/**
|
|
32778
|
-
*
|
|
32779
|
-
*
|
|
32780
|
-
* If you would like to get a raw Response object use the other updateCustomerPaymentInstrument function.
|
|
32781
|
-
*
|
|
32782
|
-
* @param options - An object containing the options for this method.
|
|
32783
|
-
* @param options.parameters - An object containing the parameters for this method.
|
|
32784
|
-
* @param options.parameters.paymentInstrumentId - The ID of the payment instrument to be retrievedCustomer.
|
|
32785
|
-
* @param options.parameters.customerId - The customer ID.
|
|
32786
|
-
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
|
|
32787
|
-
* @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.
|
|
32788
|
-
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
|
|
32789
|
-
* @param options.body - The data to send as the request body.
|
|
32790
|
-
*
|
|
32791
|
-
* @returns A promise of type CustomerPaymentInstrument.
|
|
32792
|
-
*/
|
|
32793
|
-
updateCustomerPaymentInstrument(options: RequireParametersUnlessAllAreOptional<{
|
|
32794
|
-
parameters?: CompositeParameters<{
|
|
32795
|
-
paymentInstrumentId: string;
|
|
32796
|
-
customerId: string;
|
|
32797
|
-
organizationId: string;
|
|
32798
|
-
siteId: string;
|
|
32799
|
-
} & QueryParameters, ConfigParameters>;
|
|
32800
|
-
headers?: {
|
|
32801
|
-
[key: string]: string;
|
|
32802
|
-
};
|
|
32803
|
-
body: CustomerPaymentInstrumentUpdateRequest & CustomRequestBody;
|
|
32804
|
-
}>): Promise<CustomerPaymentInstrument>;
|
|
32805
|
-
/**
|
|
32806
|
-
*
|
|
32807
|
-
*
|
|
32808
|
-
* @param options - An object containing the options for this method.
|
|
32809
|
-
* @param options.parameters - An object containing the parameters for this method.
|
|
32810
|
-
* @param options.parameters.paymentInstrumentId - The ID of the payment instrument to be retrievedCustomer.
|
|
32811
|
-
* @param options.parameters.customerId - The customer ID.
|
|
32812
|
-
* @param options.parameters.organizationId - An identifier for the organization the request is being made by
|
|
32813
|
-
* @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.
|
|
32814
|
-
* @param options.headers - An object literal of key value pairs of the headers to be sent with this request.
|
|
32815
|
-
* @param options.body - The data to send as the request body.
|
|
32816
|
-
* @param rawResponse - Set to true to return entire Response object instead of DTO.
|
|
32817
|
-
*
|
|
32818
|
-
* @returns A promise of type Response if rawResponse is true, a promise of type CustomerPaymentInstrument otherwise.
|
|
32819
|
-
*/
|
|
32820
|
-
updateCustomerPaymentInstrument<T extends boolean>(options: RequireParametersUnlessAllAreOptional<{
|
|
32821
|
-
parameters?: CompositeParameters<{
|
|
32822
|
-
paymentInstrumentId: string;
|
|
32823
|
-
customerId: string;
|
|
32824
|
-
organizationId: string;
|
|
32825
|
-
siteId: string;
|
|
32826
|
-
} & QueryParameters, ConfigParameters>;
|
|
32827
|
-
headers?: {
|
|
32828
|
-
[key: string]: string;
|
|
32829
|
-
};
|
|
32830
|
-
body: CustomerPaymentInstrumentUpdateRequest & CustomRequestBody;
|
|
32831
|
-
}>, rawResponse?: T): Promise<T extends true ? Response : CustomerPaymentInstrument>;
|
|
32832
32152
|
/**
|
|
32833
32153
|
*
|
|
32834
32154
|
*
|
|
@@ -34986,34 +34306,6 @@ declare namespace ShopperCustomersModelTypes {
|
|
|
34986
34306
|
} & {
|
|
34987
34307
|
[key: string]: any;
|
|
34988
34308
|
};
|
|
34989
|
-
/**
|
|
34990
|
-
* @type CustomerPaymentInstrumentUpdateRequestPaymentCard: The payment card expiration information.
|
|
34991
|
-
*
|
|
34992
|
-
* @property expirationMonth: The month when the payment card expires.
|
|
34993
|
-
*
|
|
34994
|
-
* @property expirationYear: The year when the payment card expires.
|
|
34995
|
-
*
|
|
34996
|
-
*/
|
|
34997
|
-
type CustomerPaymentInstrumentUpdateRequestPaymentCard = {
|
|
34998
|
-
expirationMonth?: number;
|
|
34999
|
-
expirationYear?: number;
|
|
35000
|
-
} & {
|
|
35001
|
-
[key: string]: any;
|
|
35002
|
-
};
|
|
35003
|
-
/**
|
|
35004
|
-
* @type CustomerPaymentInstrumentUpdateRequest: Document representing a customer payment instrument update request. Only allows updating the default flag and card expiration date.
|
|
35005
|
-
*
|
|
35006
|
-
* @property default: The default payment instrument.
|
|
35007
|
-
*
|
|
35008
|
-
* @property paymentCard:
|
|
35009
|
-
*
|
|
35010
|
-
*/
|
|
35011
|
-
type CustomerPaymentInstrumentUpdateRequest = {
|
|
35012
|
-
default?: boolean;
|
|
35013
|
-
paymentCard?: CustomerPaymentInstrumentUpdateRequestPaymentCard;
|
|
35014
|
-
} & {
|
|
35015
|
-
[key: string]: any;
|
|
35016
|
-
};
|
|
35017
34309
|
/**
|
|
35018
34310
|
* @type ProductListEvent: Document representing a product list event.
|
|
35019
34311
|
*
|
|
@@ -35508,8 +34800,6 @@ declare namespace ShopperCustomersTypes {
|
|
|
35508
34800
|
type updateCustomerAddressPathParameters = ShopperCustomersApiTypes.updateCustomerAddressPathParameters;
|
|
35509
34801
|
type updateCustomerPasswordQueryParameters = ShopperCustomersApiTypes.updateCustomerPasswordQueryParameters;
|
|
35510
34802
|
type updateCustomerPasswordPathParameters = ShopperCustomersApiTypes.updateCustomerPasswordPathParameters;
|
|
35511
|
-
type updateCustomerPaymentInstrumentQueryParameters = ShopperCustomersApiTypes.updateCustomerPaymentInstrumentQueryParameters;
|
|
35512
|
-
type updateCustomerPaymentInstrumentPathParameters = ShopperCustomersApiTypes.updateCustomerPaymentInstrumentPathParameters;
|
|
35513
34803
|
type updateCustomerProductListQueryParameters = ShopperCustomersApiTypes.updateCustomerProductListQueryParameters;
|
|
35514
34804
|
type updateCustomerProductListPathParameters = ShopperCustomersApiTypes.updateCustomerProductListPathParameters;
|
|
35515
34805
|
type updateCustomerProductListItemQueryParameters = ShopperCustomersApiTypes.updateCustomerProductListItemQueryParameters;
|
|
@@ -35535,8 +34825,6 @@ declare namespace ShopperCustomersTypes {
|
|
|
35535
34825
|
type CustomerPaymentCardRequest = ShopperCustomersModelTypes.CustomerPaymentCardRequest;
|
|
35536
34826
|
type CustomerPaymentInstrument = ShopperCustomersModelTypes.CustomerPaymentInstrument;
|
|
35537
34827
|
type CustomerPaymentInstrumentRequest = ShopperCustomersModelTypes.CustomerPaymentInstrumentRequest;
|
|
35538
|
-
type CustomerPaymentInstrumentUpdateRequest = ShopperCustomersModelTypes.CustomerPaymentInstrumentUpdateRequest;
|
|
35539
|
-
type CustomerPaymentInstrumentUpdateRequestPaymentCard = ShopperCustomersModelTypes.CustomerPaymentInstrumentUpdateRequestPaymentCard;
|
|
35540
34828
|
type CustomerProductList = ShopperCustomersModelTypes.CustomerProductList;
|
|
35541
34829
|
type CustomerProductListTypeEnum = ShopperCustomersModelTypes.CustomerProductListTypeEnum;
|
|
35542
34830
|
type CustomerProductListItem = ShopperCustomersModelTypes.CustomerProductListItem;
|
|
@@ -36073,6 +35361,7 @@ declare namespace ShopperExperienceApiTypes {
|
|
|
36073
35361
|
* Using the right properties in the right context is left to the user.
|
|
36074
35362
|
*/
|
|
36075
35363
|
type FetchOptions = NodeRequestInit & BrowserRequestInit;
|
|
35364
|
+
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
36076
35365
|
/**
|
|
36077
35366
|
* Base options that can be passed to the `ClientConfig` class.
|
|
36078
35367
|
*/
|
|
@@ -36084,12 +35373,12 @@ declare namespace ShopperExperienceApiTypes {
|
|
|
36084
35373
|
};
|
|
36085
35374
|
parameters: Params;
|
|
36086
35375
|
fetchOptions?: FetchOptions;
|
|
35376
|
+
fetch?: FetchFunction;
|
|
36087
35377
|
transformRequest?: (data: unknown, headers: {
|
|
36088
35378
|
[key: string]: string;
|
|
36089
35379
|
}) => Required<FetchOptions>["body"];
|
|
36090
35380
|
throwOnBadResponse?: boolean;
|
|
36091
35381
|
}
|
|
36092
|
-
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
36093
35382
|
/**
|
|
36094
35383
|
* Configuration parameters common to Commerce SDK clients
|
|
36095
35384
|
*/
|
|
@@ -36101,6 +35390,7 @@ declare namespace ShopperExperienceApiTypes {
|
|
|
36101
35390
|
};
|
|
36102
35391
|
parameters: Params;
|
|
36103
35392
|
fetchOptions: FetchOptions;
|
|
35393
|
+
fetch?: FetchFunction;
|
|
36104
35394
|
transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
|
|
36105
35395
|
throwOnBadResponse: boolean;
|
|
36106
35396
|
constructor(config: ClientConfigInit<Params>);
|
|
@@ -36931,6 +36221,7 @@ declare namespace ShopperGiftCertificatesApiTypes {
|
|
|
36931
36221
|
* Using the right properties in the right context is left to the user.
|
|
36932
36222
|
*/
|
|
36933
36223
|
type FetchOptions = NodeRequestInit & BrowserRequestInit;
|
|
36224
|
+
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
36934
36225
|
/**
|
|
36935
36226
|
* Base options that can be passed to the `ClientConfig` class.
|
|
36936
36227
|
*/
|
|
@@ -36942,12 +36233,12 @@ declare namespace ShopperGiftCertificatesApiTypes {
|
|
|
36942
36233
|
};
|
|
36943
36234
|
parameters: Params;
|
|
36944
36235
|
fetchOptions?: FetchOptions;
|
|
36236
|
+
fetch?: FetchFunction;
|
|
36945
36237
|
transformRequest?: (data: unknown, headers: {
|
|
36946
36238
|
[key: string]: string;
|
|
36947
36239
|
}) => Required<FetchOptions>["body"];
|
|
36948
36240
|
throwOnBadResponse?: boolean;
|
|
36949
36241
|
}
|
|
36950
|
-
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
36951
36242
|
/**
|
|
36952
36243
|
* Configuration parameters common to Commerce SDK clients
|
|
36953
36244
|
*/
|
|
@@ -36959,6 +36250,7 @@ declare namespace ShopperGiftCertificatesApiTypes {
|
|
|
36959
36250
|
};
|
|
36960
36251
|
parameters: Params;
|
|
36961
36252
|
fetchOptions: FetchOptions;
|
|
36253
|
+
fetch?: FetchFunction;
|
|
36962
36254
|
transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
|
|
36963
36255
|
throwOnBadResponse: boolean;
|
|
36964
36256
|
constructor(config: ClientConfigInit<Params>);
|
|
@@ -39053,6 +38345,7 @@ declare namespace ShopperLoginApiTypes {
|
|
|
39053
38345
|
* Using the right properties in the right context is left to the user.
|
|
39054
38346
|
*/
|
|
39055
38347
|
type FetchOptions = NodeRequestInit & BrowserRequestInit;
|
|
38348
|
+
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
39056
38349
|
/**
|
|
39057
38350
|
* Base options that can be passed to the `ClientConfig` class.
|
|
39058
38351
|
*/
|
|
@@ -39064,12 +38357,12 @@ declare namespace ShopperLoginApiTypes {
|
|
|
39064
38357
|
};
|
|
39065
38358
|
parameters: Params;
|
|
39066
38359
|
fetchOptions?: FetchOptions;
|
|
38360
|
+
fetch?: FetchFunction;
|
|
39067
38361
|
transformRequest?: (data: unknown, headers: {
|
|
39068
38362
|
[key: string]: string;
|
|
39069
38363
|
}) => Required<FetchOptions>["body"];
|
|
39070
38364
|
throwOnBadResponse?: boolean;
|
|
39071
38365
|
}
|
|
39072
|
-
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
39073
38366
|
/**
|
|
39074
38367
|
* Configuration parameters common to Commerce SDK clients
|
|
39075
38368
|
*/
|
|
@@ -39081,6 +38374,7 @@ declare namespace ShopperLoginApiTypes {
|
|
|
39081
38374
|
};
|
|
39082
38375
|
parameters: Params;
|
|
39083
38376
|
fetchOptions: FetchOptions;
|
|
38377
|
+
fetch?: FetchFunction;
|
|
39084
38378
|
transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
|
|
39085
38379
|
throwOnBadResponse: boolean;
|
|
39086
38380
|
constructor(config: ClientConfigInit<Params>);
|
|
@@ -42966,6 +42260,7 @@ declare namespace ShopperOrdersApiTypes {
|
|
|
42966
42260
|
* Using the right properties in the right context is left to the user.
|
|
42967
42261
|
*/
|
|
42968
42262
|
type FetchOptions = NodeRequestInit & BrowserRequestInit;
|
|
42263
|
+
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
42969
42264
|
/**
|
|
42970
42265
|
* Base options that can be passed to the `ClientConfig` class.
|
|
42971
42266
|
*/
|
|
@@ -42977,12 +42272,12 @@ declare namespace ShopperOrdersApiTypes {
|
|
|
42977
42272
|
};
|
|
42978
42273
|
parameters: Params;
|
|
42979
42274
|
fetchOptions?: FetchOptions;
|
|
42275
|
+
fetch?: FetchFunction;
|
|
42980
42276
|
transformRequest?: (data: unknown, headers: {
|
|
42981
42277
|
[key: string]: string;
|
|
42982
42278
|
}) => Required<FetchOptions>["body"];
|
|
42983
42279
|
throwOnBadResponse?: boolean;
|
|
42984
42280
|
}
|
|
42985
|
-
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
42986
42281
|
/**
|
|
42987
42282
|
* Configuration parameters common to Commerce SDK clients
|
|
42988
42283
|
*/
|
|
@@ -42994,6 +42289,7 @@ declare namespace ShopperOrdersApiTypes {
|
|
|
42994
42289
|
};
|
|
42995
42290
|
parameters: Params;
|
|
42996
42291
|
fetchOptions: FetchOptions;
|
|
42292
|
+
fetch?: FetchFunction;
|
|
42997
42293
|
transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
|
|
42998
42294
|
throwOnBadResponse: boolean;
|
|
42999
42295
|
constructor(config: ClientConfigInit<Params>);
|
|
@@ -47534,6 +46830,7 @@ declare namespace ShopperProductsApiTypes {
|
|
|
47534
46830
|
* Using the right properties in the right context is left to the user.
|
|
47535
46831
|
*/
|
|
47536
46832
|
type FetchOptions = NodeRequestInit & BrowserRequestInit;
|
|
46833
|
+
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
47537
46834
|
/**
|
|
47538
46835
|
* Base options that can be passed to the `ClientConfig` class.
|
|
47539
46836
|
*/
|
|
@@ -47545,12 +46842,12 @@ declare namespace ShopperProductsApiTypes {
|
|
|
47545
46842
|
};
|
|
47546
46843
|
parameters: Params;
|
|
47547
46844
|
fetchOptions?: FetchOptions;
|
|
46845
|
+
fetch?: FetchFunction;
|
|
47548
46846
|
transformRequest?: (data: unknown, headers: {
|
|
47549
46847
|
[key: string]: string;
|
|
47550
46848
|
}) => Required<FetchOptions>["body"];
|
|
47551
46849
|
throwOnBadResponse?: boolean;
|
|
47552
46850
|
}
|
|
47553
|
-
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
47554
46851
|
/**
|
|
47555
46852
|
* Configuration parameters common to Commerce SDK clients
|
|
47556
46853
|
*/
|
|
@@ -47562,6 +46859,7 @@ declare namespace ShopperProductsApiTypes {
|
|
|
47562
46859
|
};
|
|
47563
46860
|
parameters: Params;
|
|
47564
46861
|
fetchOptions: FetchOptions;
|
|
46862
|
+
fetch?: FetchFunction;
|
|
47565
46863
|
transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
|
|
47566
46864
|
throwOnBadResponse: boolean;
|
|
47567
46865
|
constructor(config: ClientConfigInit<Params>);
|
|
@@ -49970,6 +49268,7 @@ declare namespace ShopperPromotionsApiTypes {
|
|
|
49970
49268
|
* Using the right properties in the right context is left to the user.
|
|
49971
49269
|
*/
|
|
49972
49270
|
type FetchOptions = NodeRequestInit & BrowserRequestInit;
|
|
49271
|
+
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
49973
49272
|
/**
|
|
49974
49273
|
* Base options that can be passed to the `ClientConfig` class.
|
|
49975
49274
|
*/
|
|
@@ -49981,12 +49280,12 @@ declare namespace ShopperPromotionsApiTypes {
|
|
|
49981
49280
|
};
|
|
49982
49281
|
parameters: Params;
|
|
49983
49282
|
fetchOptions?: FetchOptions;
|
|
49283
|
+
fetch?: FetchFunction;
|
|
49984
49284
|
transformRequest?: (data: unknown, headers: {
|
|
49985
49285
|
[key: string]: string;
|
|
49986
49286
|
}) => Required<FetchOptions>["body"];
|
|
49987
49287
|
throwOnBadResponse?: boolean;
|
|
49988
49288
|
}
|
|
49989
|
-
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
49990
49289
|
/**
|
|
49991
49290
|
* Configuration parameters common to Commerce SDK clients
|
|
49992
49291
|
*/
|
|
@@ -49998,6 +49297,7 @@ declare namespace ShopperPromotionsApiTypes {
|
|
|
49998
49297
|
};
|
|
49999
49298
|
parameters: Params;
|
|
50000
49299
|
fetchOptions: FetchOptions;
|
|
49300
|
+
fetch?: FetchFunction;
|
|
50001
49301
|
transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
|
|
50002
49302
|
throwOnBadResponse: boolean;
|
|
50003
49303
|
constructor(config: ClientConfigInit<Params>);
|
|
@@ -51661,6 +50961,7 @@ declare namespace ShopperSearchApiTypes {
|
|
|
51661
50961
|
* Using the right properties in the right context is left to the user.
|
|
51662
50962
|
*/
|
|
51663
50963
|
type FetchOptions = NodeRequestInit & BrowserRequestInit;
|
|
50964
|
+
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
51664
50965
|
/**
|
|
51665
50966
|
* Base options that can be passed to the `ClientConfig` class.
|
|
51666
50967
|
*/
|
|
@@ -51672,12 +50973,12 @@ declare namespace ShopperSearchApiTypes {
|
|
|
51672
50973
|
};
|
|
51673
50974
|
parameters: Params;
|
|
51674
50975
|
fetchOptions?: FetchOptions;
|
|
50976
|
+
fetch?: FetchFunction;
|
|
51675
50977
|
transformRequest?: (data: unknown, headers: {
|
|
51676
50978
|
[key: string]: string;
|
|
51677
50979
|
}) => Required<FetchOptions>["body"];
|
|
51678
50980
|
throwOnBadResponse?: boolean;
|
|
51679
50981
|
}
|
|
51680
|
-
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
51681
50982
|
/**
|
|
51682
50983
|
* Configuration parameters common to Commerce SDK clients
|
|
51683
50984
|
*/
|
|
@@ -51689,6 +50990,7 @@ declare namespace ShopperSearchApiTypes {
|
|
|
51689
50990
|
};
|
|
51690
50991
|
parameters: Params;
|
|
51691
50992
|
fetchOptions: FetchOptions;
|
|
50993
|
+
fetch?: FetchFunction;
|
|
51692
50994
|
transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
|
|
51693
50995
|
throwOnBadResponse: boolean;
|
|
51694
50996
|
constructor(config: ClientConfigInit<Params>);
|
|
@@ -53951,6 +53253,7 @@ declare namespace ShopperSEOApiTypes {
|
|
|
53951
53253
|
* Using the right properties in the right context is left to the user.
|
|
53952
53254
|
*/
|
|
53953
53255
|
type FetchOptions = NodeRequestInit & BrowserRequestInit;
|
|
53256
|
+
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
53954
53257
|
/**
|
|
53955
53258
|
* Base options that can be passed to the `ClientConfig` class.
|
|
53956
53259
|
*/
|
|
@@ -53962,12 +53265,12 @@ declare namespace ShopperSEOApiTypes {
|
|
|
53962
53265
|
};
|
|
53963
53266
|
parameters: Params;
|
|
53964
53267
|
fetchOptions?: FetchOptions;
|
|
53268
|
+
fetch?: FetchFunction;
|
|
53965
53269
|
transformRequest?: (data: unknown, headers: {
|
|
53966
53270
|
[key: string]: string;
|
|
53967
53271
|
}) => Required<FetchOptions>["body"];
|
|
53968
53272
|
throwOnBadResponse?: boolean;
|
|
53969
53273
|
}
|
|
53970
|
-
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
53971
53274
|
/**
|
|
53972
53275
|
* Configuration parameters common to Commerce SDK clients
|
|
53973
53276
|
*/
|
|
@@ -53979,6 +53282,7 @@ declare namespace ShopperSEOApiTypes {
|
|
|
53979
53282
|
};
|
|
53980
53283
|
parameters: Params;
|
|
53981
53284
|
fetchOptions: FetchOptions;
|
|
53285
|
+
fetch?: FetchFunction;
|
|
53982
53286
|
transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
|
|
53983
53287
|
throwOnBadResponse: boolean;
|
|
53984
53288
|
constructor(config: ClientConfigInit<Params>);
|
|
@@ -54778,6 +54082,7 @@ declare namespace ShopperStoresApiTypes {
|
|
|
54778
54082
|
* Using the right properties in the right context is left to the user.
|
|
54779
54083
|
*/
|
|
54780
54084
|
type FetchOptions = NodeRequestInit & BrowserRequestInit;
|
|
54085
|
+
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
54781
54086
|
/**
|
|
54782
54087
|
* Base options that can be passed to the `ClientConfig` class.
|
|
54783
54088
|
*/
|
|
@@ -54789,12 +54094,12 @@ declare namespace ShopperStoresApiTypes {
|
|
|
54789
54094
|
};
|
|
54790
54095
|
parameters: Params;
|
|
54791
54096
|
fetchOptions?: FetchOptions;
|
|
54097
|
+
fetch?: FetchFunction;
|
|
54792
54098
|
transformRequest?: (data: unknown, headers: {
|
|
54793
54099
|
[key: string]: string;
|
|
54794
54100
|
}) => Required<FetchOptions>["body"];
|
|
54795
54101
|
throwOnBadResponse?: boolean;
|
|
54796
54102
|
}
|
|
54797
|
-
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
54798
54103
|
/**
|
|
54799
54104
|
* Configuration parameters common to Commerce SDK clients
|
|
54800
54105
|
*/
|
|
@@ -54806,6 +54111,7 @@ declare namespace ShopperStoresApiTypes {
|
|
|
54806
54111
|
};
|
|
54807
54112
|
parameters: Params;
|
|
54808
54113
|
fetchOptions: FetchOptions;
|
|
54114
|
+
fetch?: FetchFunction;
|
|
54809
54115
|
transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
|
|
54810
54116
|
throwOnBadResponse: boolean;
|
|
54811
54117
|
constructor(config: ClientConfigInit<Params>);
|
|
@@ -55567,6 +54873,7 @@ declare namespace helpers {
|
|
|
55567
54873
|
* Using the right properties in the right context is left to the user.
|
|
55568
54874
|
*/
|
|
55569
54875
|
type FetchOptions = NodeRequestInit & BrowserRequestInit;
|
|
54876
|
+
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
55570
54877
|
/**
|
|
55571
54878
|
* Base options that can be passed to the `ClientConfig` class.
|
|
55572
54879
|
*/
|
|
@@ -55578,12 +54885,12 @@ declare namespace helpers {
|
|
|
55578
54885
|
};
|
|
55579
54886
|
parameters: Params;
|
|
55580
54887
|
fetchOptions?: FetchOptions;
|
|
54888
|
+
fetch?: FetchFunction;
|
|
55581
54889
|
transformRequest?: (data: unknown, headers: {
|
|
55582
54890
|
[key: string]: string;
|
|
55583
54891
|
}) => Required<FetchOptions>["body"];
|
|
55584
54892
|
throwOnBadResponse?: boolean;
|
|
55585
54893
|
}
|
|
55586
|
-
type FetchFunction = (input: RequestInfo, init?: FetchOptions | undefined) => Promise<Response>;
|
|
55587
54894
|
/**
|
|
55588
54895
|
* Configuration parameters common to Commerce SDK clients
|
|
55589
54896
|
*/
|
|
@@ -55595,23 +54902,22 @@ declare namespace helpers {
|
|
|
55595
54902
|
};
|
|
55596
54903
|
parameters: Params;
|
|
55597
54904
|
fetchOptions: FetchOptions;
|
|
54905
|
+
fetch?: FetchFunction;
|
|
55598
54906
|
transformRequest: NonNullable<ClientConfigInit<Params>["transformRequest"]>;
|
|
55599
54907
|
throwOnBadResponse: boolean;
|
|
55600
54908
|
constructor(config: ClientConfigInit<Params>);
|
|
55601
54909
|
static readonly defaults: Pick<Required<ClientConfigInit<never>>, "transformRequest">;
|
|
55602
54910
|
}
|
|
55603
|
-
/*
|
|
55604
|
-
* Copyright (c) 2022, Salesforce, Inc.
|
|
55605
|
-
* All rights reserved.
|
|
55606
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
55607
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
55608
|
-
*/
|
|
55609
54911
|
const isBrowser: boolean;
|
|
55610
54912
|
const isNode: boolean;
|
|
55611
54913
|
const globalObject: typeof globalThis;
|
|
55612
54914
|
const hasFetchAvailable: boolean;
|
|
55613
|
-
// TODO:
|
|
55614
|
-
//
|
|
54915
|
+
// TODO: Adopt native fetch in the next major version.
|
|
54916
|
+
// Using the built-in fetch (Node 18+) caused downstream unit tests that rely on
|
|
54917
|
+
// `nock` to fail because `nock` hooks into the core HTTP/HTTPS modules, while
|
|
54918
|
+
// the native fetch implementation leverages undici instead. Until we can roll
|
|
54919
|
+
// out a coordinated breaking change, we continue to use the node-fetch
|
|
54920
|
+
// polyfill so existing tests keep passing.
|
|
55615
54921
|
const fetch: FetchFunction;
|
|
55616
54922
|
/**
|
|
55617
54923
|
* Grant Type
|
|
@@ -57739,7 +57045,6 @@ declare namespace helpers {
|
|
|
57739
57045
|
declare const pkg: {
|
|
57740
57046
|
ShopperBaskets: typeof ShopperBaskets;
|
|
57741
57047
|
ShopperBasketsV2: typeof ShopperBasketsV2;
|
|
57742
|
-
ShopperConfigurations: typeof ShopperConfigurations;
|
|
57743
57048
|
ShopperConsents: typeof ShopperConsents;
|
|
57744
57049
|
ShopperContexts: typeof ShopperContexts;
|
|
57745
57050
|
ShopperCustomers: typeof ShopperCustomers;
|
|
@@ -57752,6 +57057,9 @@ declare const pkg: {
|
|
|
57752
57057
|
ShopperSearch: typeof ShopperSearch;
|
|
57753
57058
|
ShopperSEO: typeof ShopperSEO;
|
|
57754
57059
|
ShopperStores: typeof ShopperStores;
|
|
57060
|
+
helpers: typeof helpers;
|
|
57061
|
+
ClientConfig: typeof ClientConfig;
|
|
57062
|
+
TemplateURL: typeof TemplateURL;
|
|
57755
57063
|
};
|
|
57756
|
-
export { pkg as default, ShopperBaskets, ShopperBasketsV2,
|
|
57757
|
-
export type { ShopperBasketsTypes, ShopperBasketsV2Types,
|
|
57064
|
+
export { pkg as default, ShopperBaskets, ShopperBasketsV2, ShopperConsents, ShopperContexts, ShopperCustomers, ShopperExperience, ShopperGiftCertificates, ShopperLogin, ShopperOrders, ShopperProducts, ShopperPromotions, ShopperSearch, ShopperSEO, ShopperStores, ClientConfig, TemplateURL, helpers };
|
|
57065
|
+
export type { ShopperBasketsTypes, ShopperBasketsV2Types, ShopperConsentsTypes, ShopperContextsTypes, ShopperCustomersTypes, ShopperExperienceTypes, ShopperGiftCertificatesTypes, ShopperLoginTypes, ShopperOrdersTypes, ShopperProductsTypes, ShopperPromotionsTypes, ShopperSearchTypes, ShopperSEOTypes, ShopperStoresTypes, ClientConfigInit, FetchFunction, FetchOptions };
|