-
Notifications
You must be signed in to change notification settings - Fork 212
Expand file tree
/
Copy pathconstant.ts
More file actions
63 lines (54 loc) · 2.72 KB
/
constant.ts
File metadata and controls
63 lines (54 loc) · 2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* Copyright (c) 2023, Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
/**
* This list contains domains that can host code in iframe
*/
export const IFRAME_HOST_ALLOW_LIST = Object.freeze([
'https://runtime.commercecloud.com',
'https://runtime-admin-staging.mobify-storefront.com',
'https://runtime-admin-preview.mobify-storefront.com'
])
export const SLAS_SECRET_WARNING_MSG =
'You are potentially exposing SLAS secret on browser. Make sure to keep it safe and secure!'
export const SLAS_SECRET_PLACEHOLDER = '_PLACEHOLDER_PROXY-PWA_KIT_SLAS_CLIENT_SECRET'
export const SLAS_SECRET_OVERRIDE_MSG =
'You have enabled PWA Kit Private Client mode which gets the SLAS secret from your environment variable. The SLAS secret you have set in the Auth provider will be ignored.'
export const SLAS_REFRESH_TOKEN_COOKIE_TTL_OVERRIDE_MSG =
'You are attempting to use an invalid refresh token TTL value.'
export const DNT_COOKIE_NAME = 'dw_dnt' as const
export const DWSID_COOKIE_NAME = 'dwsid'
// commerce-sdk-react namespaces cookies with siteID as suffixes to allow multisite setups.
// However some cookies are set and used outside of PWA Kit and must not be modified with suffixes.
export const EXCLUDE_COOKIE_SUFFIX = [DWSID_COOKIE_NAME, DNT_COOKIE_NAME]
/**
* For Hybrid Setups only!
* Unlike SCAPI/OCAPI, ECOM creates baskets in app-server cache initially and move the basket object
* to the db later based on basket state. In a hybrid storefront, storefront requests might be
* routed to different appservers, if the basket object is still in appserver cache, you will start
* seeing inconsistencies in basket state. To avoid this, if you have a dwsid cookie, you must send
* the value of the dwsid cookie with each SCAPI/OCAPI request in a hybrid storefront to maintain appserver affinity.
*
* Use the header key below to send dwsid value with SCAPI/OCAPI requests.
*/
export const SERVER_AFFINITY_HEADER_KEY = 'sfdc_dwsid'
export const CLIENT_KEYS = {
SHOPPER_BASKETS: 'shopperBaskets',
SHOPPER_BASKETS_V2: 'shopperBasketsV2',
SHOPPER_CONFIGURATIONS: 'shopperConfigurations',
SHOPPER_CONTEXTS: 'shopperContexts',
SHOPPER_CUSTOMERS: 'shopperCustomers',
SHOPPER_EXPERIENCE: 'shopperExperience',
SHOPPER_GIFT_CERTIFICATES: 'shopperGiftCertificates',
SHOPPER_LOGIN: 'shopperLogin',
SHOPPER_ORDERS: 'shopperOrders',
SHOPPER_PAYMENTS: 'shopperPayments',
SHOPPER_PRODUCTS: 'shopperProducts',
SHOPPER_PROMOTIONS: 'shopperPromotions',
SHOPPER_SEARCH: 'shopperSearch',
SHOPPER_SEO: 'shopperSeo',
SHOPPER_STORES: 'shopperStores'
} as const