@salesforce/b2c-tooling-sdk 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/data/schemas/dw.schema.json +14 -0
  2. package/data/tooling/index.json +5 -5
  3. package/dist/esm/cli/base-command.js +4 -3
  4. package/dist/esm/cli/base-command.js.map +1 -1
  5. package/dist/esm/cli/cartridge-command.js +2 -1
  6. package/dist/esm/cli/cartridge-command.js.map +1 -1
  7. package/dist/esm/cli/config.js +3 -1
  8. package/dist/esm/cli/config.js.map +1 -1
  9. package/dist/esm/cli/hooks.d.ts +13 -0
  10. package/dist/esm/cli/hooks.js +11 -0
  11. package/dist/esm/cli/hooks.js.map +1 -1
  12. package/dist/esm/cli/instance-command.js +2 -1
  13. package/dist/esm/cli/instance-command.js.map +1 -1
  14. package/dist/esm/clients/scapi-backend-utils.d.ts +15 -0
  15. package/dist/esm/clients/scapi-backend-utils.js +28 -1
  16. package/dist/esm/clients/scapi-backend-utils.js.map +1 -1
  17. package/dist/esm/clients/scapi-fallback-backend.js +2 -2
  18. package/dist/esm/clients/scapi-fallback-backend.js.map +1 -1
  19. package/dist/esm/clients/scapi-schemas.generated.d.ts +2 -2
  20. package/dist/esm/compat/dispatcher.js +2 -2
  21. package/dist/esm/compat/dispatcher.js.map +1 -1
  22. package/dist/esm/config/config-origins.d.ts +19 -0
  23. package/dist/esm/config/config-origins.js +11 -0
  24. package/dist/esm/config/config-origins.js.map +1 -0
  25. package/dist/esm/config/config-write.d.ts +86 -0
  26. package/dist/esm/config/config-write.js +296 -0
  27. package/dist/esm/config/config-write.js.map +1 -0
  28. package/dist/esm/config/dw-json-schema.js +4 -0
  29. package/dist/esm/config/dw-json-schema.js.map +1 -1
  30. package/dist/esm/config/dw-json.d.ts +2 -0
  31. package/dist/esm/config/dw-json.js +10 -6
  32. package/dist/esm/config/dw-json.js.map +1 -1
  33. package/dist/esm/config/index.d.ts +8 -3
  34. package/dist/esm/config/index.js +5 -2
  35. package/dist/esm/config/index.js.map +1 -1
  36. package/dist/esm/config/instance-manager.d.ts +64 -28
  37. package/dist/esm/config/instance-manager.js +145 -63
  38. package/dist/esm/config/instance-manager.js.map +1 -1
  39. package/dist/esm/config/mapping.js +6 -0
  40. package/dist/esm/config/mapping.js.map +1 -1
  41. package/dist/esm/config/resolver.d.ts +22 -0
  42. package/dist/esm/config/resolver.js +54 -29
  43. package/dist/esm/config/resolver.js.map +1 -1
  44. package/dist/esm/config/sources/dw-json-source.d.ts +9 -1
  45. package/dist/esm/config/sources/dw-json-source.js +34 -20
  46. package/dist/esm/config/sources/dw-json-source.js.map +1 -1
  47. package/dist/esm/config/sources/env-source.d.ts +30 -3
  48. package/dist/esm/config/sources/env-source.js +126 -1
  49. package/dist/esm/config/sources/env-source.js.map +1 -1
  50. package/dist/esm/config/types.d.ts +46 -0
  51. package/dist/esm/operations/jobs/run-system-job.js +2 -2
  52. package/dist/esm/operations/jobs/run-system-job.js.map +1 -1
  53. package/dist/esm/plugins/discovery.js +2 -1
  54. package/dist/esm/plugins/discovery.js.map +1 -1
  55. package/dist/esm/scapi/index.d.ts +5 -2
  56. package/dist/esm/scapi/index.js +3 -2
  57. package/dist/esm/scapi/index.js.map +1 -1
  58. package/dist/esm/scapi/live.d.ts +12 -1
  59. package/dist/esm/scapi/live.js +30 -2
  60. package/dist/esm/scapi/live.js.map +1 -1
  61. package/dist/esm/scapi/local.d.ts +17 -0
  62. package/dist/esm/scapi/local.js +68 -16
  63. package/dist/esm/scapi/local.js.map +1 -1
  64. package/dist/esm/scapi/request.d.ts +2 -2
  65. package/dist/esm/scapi/request.js +2 -1
  66. package/dist/esm/scapi/request.js.map +1 -1
  67. package/dist/esm/scapi/runtime.d.ts +5 -0
  68. package/dist/esm/scapi/runtime.js.map +1 -1
  69. package/dist/esm/scapi/schema-source.d.ts +90 -0
  70. package/dist/esm/scapi/schema-source.js +146 -0
  71. package/dist/esm/scapi/schema-source.js.map +1 -0
  72. package/dist/esm/scapi/worker-source.js +30 -6
  73. package/dist/esm/scapi/worker-source.js.map +1 -1
  74. package/dist/esm/test-utils/config-isolation.js +9 -2
  75. package/dist/esm/test-utils/config-isolation.js.map +1 -1
  76. package/node_modules/@salesforce/b2c-api-schemas/manifest.json +83 -42
  77. package/node_modules/@salesforce/b2c-api-schemas/package.json +1 -1
  78. package/node_modules/@salesforce/b2c-api-schemas/scapi/cdn/zones/v1.json +6798 -238
  79. package/node_modules/@salesforce/b2c-api-schemas/scapi/checkout/orders/v1.json +2296 -205
  80. package/node_modules/@salesforce/b2c-api-schemas/scapi/checkout/shopper-baskets/v1.json +5571 -666
  81. package/node_modules/@salesforce/b2c-api-schemas/scapi/checkout/shopper-baskets/v2.json +6062 -371
  82. package/node_modules/@salesforce/b2c-api-schemas/scapi/checkout/shopper-orders/v1.json +3426 -360
  83. package/node_modules/@salesforce/b2c-api-schemas/scapi/checkout/shopper-payments/v1.json +351 -99
  84. package/node_modules/@salesforce/b2c-api-schemas/scapi/configuration/cors/v1.json +172 -12
  85. package/node_modules/@salesforce/b2c-api-schemas/scapi/configuration/preferences/v1.json +1497 -111
  86. package/node_modules/@salesforce/b2c-api-schemas/scapi/configuration/shopper-configurations/v1.json +202 -36
  87. package/node_modules/@salesforce/b2c-api-schemas/scapi/configuration/timeouts/v1.json +79 -10
  88. package/node_modules/@salesforce/b2c-api-schemas/scapi/custom-object/custom-objects/v1.json +785 -49
  89. package/node_modules/@salesforce/b2c-api-schemas/scapi/custom-object/shopper-custom-objects/v1.json +191 -40
  90. package/node_modules/@salesforce/b2c-api-schemas/scapi/customer/customers/v1.json +1483 -107
  91. package/node_modules/@salesforce/b2c-api-schemas/scapi/customer/shopper-customers/v1.json +4854 -787
  92. package/node_modules/@salesforce/b2c-api-schemas/scapi/dx/custom-apis/v1.json +119 -15
  93. package/node_modules/@salesforce/b2c-api-schemas/scapi/dx/object-definitions/v1.json +1699 -80
  94. package/node_modules/@salesforce/b2c-api-schemas/scapi/dx/scapi-schemas/v1.json +252 -18
  95. package/node_modules/@salesforce/b2c-api-schemas/scapi/dx/scripts/v1.json +329 -23
  96. package/node_modules/@salesforce/b2c-api-schemas/scapi/experience/experiences/v1.json +4208 -234
  97. package/node_modules/@salesforce/b2c-api-schemas/scapi/experience/shopper-experience/v1.json +1591 -247
  98. package/node_modules/@salesforce/b2c-api-schemas/scapi/intelligence/analytics/v1.json +396 -8
  99. package/node_modules/@salesforce/b2c-api-schemas/scapi/inventory/availability/v1.json +1242 -69
  100. package/node_modules/@salesforce/b2c-api-schemas/scapi/inventory/impex/v1.json +2354 -248
  101. package/node_modules/@salesforce/b2c-api-schemas/scapi/inventory/reservation/v1.json +1550 -45
  102. package/node_modules/@salesforce/b2c-api-schemas/scapi/inventory/segmentation/v1.json +6615 -0
  103. package/node_modules/@salesforce/b2c-api-schemas/scapi/merchant/roles/v1.json +1520 -59
  104. package/node_modules/@salesforce/b2c-api-schemas/scapi/merchant/users/v1.json +397 -17
  105. package/node_modules/@salesforce/b2c-api-schemas/scapi/observability/metrics/v1.json +1241 -27
  106. package/node_modules/@salesforce/b2c-api-schemas/scapi/operation/jobs/v1.json +1069 -68
  107. package/node_modules/@salesforce/b2c-api-schemas/scapi/operation/replications/v1.json +410 -23
  108. package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/assignments/v1.json +502 -102
  109. package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/campaigns/v1.json +1112 -94
  110. package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/coupons/v1.json +820 -93
  111. package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/gift-certificates/v1.json +845 -92
  112. package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/promotions/v1.json +2716 -674
  113. package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/shopper-gift-certificates/v1.json +130 -47
  114. package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/shopper-promotions/v1.json +233 -63
  115. package/node_modules/@salesforce/b2c-api-schemas/scapi/pricing/source-code-groups/v1.json +630 -70
  116. package/node_modules/@salesforce/b2c-api-schemas/scapi/product/catalogs/v1.json +2886 -348
  117. package/node_modules/@salesforce/b2c-api-schemas/scapi/product/inventory-lists/v1.json +520 -19
  118. package/node_modules/@salesforce/b2c-api-schemas/scapi/product/price-books/v1.json +3115 -293
  119. package/node_modules/@salesforce/b2c-api-schemas/scapi/product/products/v1.json +3313 -138
  120. package/node_modules/@salesforce/b2c-api-schemas/scapi/product/shopper-availability/v1.json +266 -52
  121. package/node_modules/@salesforce/b2c-api-schemas/scapi/product/shopper-delivery-estimates/v1.json +256 -48
  122. package/node_modules/@salesforce/b2c-api-schemas/scapi/product/shopper-products/v1.json +1744 -306
  123. package/node_modules/@salesforce/b2c-api-schemas/scapi/search/shopper-search/v1.json +1661 -120
  124. package/node_modules/@salesforce/b2c-api-schemas/scapi/shopper/auth/v1.json +2174 -118
  125. package/node_modules/@salesforce/b2c-api-schemas/scapi/shopper/auth-admin/v1.json +1373 -24
  126. package/node_modules/@salesforce/b2c-api-schemas/scapi/shopper/consents/v1.json +531 -20
  127. package/node_modules/@salesforce/b2c-api-schemas/scapi/shopper/shopper-agents/v1.json +154 -6
  128. package/node_modules/@salesforce/b2c-api-schemas/scapi/shopper/shopper-consents/v1.json +596 -79
  129. package/node_modules/@salesforce/b2c-api-schemas/scapi/shopper/shopper-context/v1.json +456 -42
  130. package/node_modules/@salesforce/b2c-api-schemas/scapi/site/seo/v1.json +101 -23
  131. package/node_modules/@salesforce/b2c-api-schemas/scapi/site/shopper-seo/v1.json +184 -41
  132. package/node_modules/@salesforce/b2c-api-schemas/scapi/site/sites/v1.json +995 -47
  133. package/node_modules/@salesforce/b2c-api-schemas/scapi/store/shopper-stores/v1.json +370 -67
  134. package/node_modules/@salesforce/b2c-api-schemas/scapi/store/store-redirect-mappings/v1.json +319 -11
  135. package/node_modules/@salesforce/b2c-api-schemas/scapi/store/stores/v1.json +1109 -64
  136. package/node_modules/@salesforce/b2c-api-schemas/scapi/storefront/deployments/v1.json +1442 -0
  137. package/node_modules/@salesforce/b2c-api-schemas/scapi/storefront/environments/v1.json +4293 -0
  138. package/node_modules/@salesforce/b2c-api-schemas/scapi/storefront/storefronts/v1.json +1371 -0
  139. package/package.json +2 -2
  140. package/specs/scapi-schemas-v1.yaml +4 -1
@@ -2,7 +2,8 @@
2
2
  "openapi": "3.0.3",
3
3
  "info": {
4
4
  "title": "Cors",
5
- "version": "1.1.0",
5
+ "description": "[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/cors/cors-oas-v1-public.yaml)\n\n# API Overview\n\nThe CORS Preferences API allows you to manage your Cross-Origin Resource Sharing (CORS) preferences.\n\nBy specifying which domains are permitted to access a site, you can define exceptions to the same-site policy that browsers would otherwise enforce.\n\n## Authentication & Authorization\n\nFor resource access, you must use a client ID and client secret from Account Manager to request an access token. The access token is used as a bearer token and added to the Authorization header of your API request.\n\nYou must include `sfcc.cors-preferences.rw` (read-write access) or `sfcc.cors-preferences` (read-only access) in the client ID used to generate the token. For a full list of permissions, see the [Authorization Scopes Catalog.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/auth-z-scope-catalog.html)\n\nFor detailed setup instructions, see the [Authorization for Admin APIs.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-admin-apis.html)\n\n## Response Details\n\n### Timeouts\n\nAdmin API requests must respond within 60 seconds. If a response exceeds this threshold, an HTTP 504 status code is returned. For details, see [Timeouts and Limits.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/timeouts-limits.html)\n\n### Error Handling\n\nError responses follow the [RFC 7807](https://datatracker.ietf.org/doc/html/rfc7807) problem detail format. To trace errors, include a `correlation-id` header in your request — the response returns it as `x-correlation-id`. For details, see [HTTP Status Codes and Errors.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/error-response-codes.html)\n\n## Use Cases\n\n### Manage CORS configuration\n\nYou can use the preferences/cors endpoint to retrieve, set, or delete your configuration for CORS origins.\n\n## Usage Notes\n\n1. This configuration is made per client ID and site.\n2. All known domain names and aliases are added to the list automatically and do not need to be configured for CORS explicitly.\n3. If a configuration is absent, CORS will not be active. To enable cors for a client without specifying custom origins, configure the client and site with an empty origin list. The known domain names and aliases will still apply.",
6
+ "version": "1.1.1",
6
7
  "x-api-type": "Admin",
7
8
  "x-api-family": "Configuration"
8
9
  },
@@ -11,6 +12,7 @@
11
12
  "url": "https://{shortCode}.api.commercecloud.salesforce.com/configuration/cors/v1",
12
13
  "variables": {
13
14
  "shortCode": {
15
+ "description": "An eight-character string assigned to a realm for routing purposes. See [Base URL and Request Formation.](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html)",
14
16
  "default": "shortCode"
15
17
  }
16
18
  }
@@ -19,26 +21,36 @@
19
21
  "paths": {
20
22
  "/organizations/{organizationId}/cors": {
21
23
  "get": {
24
+ "summary": "Return all CORS preferences for the given site.",
25
+ "description": "Return all CORS preferences for the given site.",
22
26
  "operationId": "getCorsPreferences",
23
27
  "parameters": [
24
28
  {
25
29
  "name": "organizationId",
26
30
  "in": "path",
31
+ "description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
27
32
  "required": true,
28
33
  "style": "simple",
29
34
  "explode": false,
30
35
  "schema": {
31
36
  "$ref": "#/components/schemas/OrganizationId"
32
- }
37
+ },
38
+ "example": "f_ecom_zzxy_prd"
33
39
  },
34
40
  {
35
41
  "name": "siteId",
36
42
  "in": "query",
43
+ "description": "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.",
37
44
  "required": true,
38
45
  "style": "form",
39
46
  "explode": true,
40
47
  "schema": {
41
48
  "$ref": "#/components/schemas/SiteId"
49
+ },
50
+ "examples": {
51
+ "SiteId": {
52
+ "value": "RefArch"
53
+ }
42
54
  }
43
55
  }
44
56
  ],
@@ -49,6 +61,14 @@
49
61
  "application/json": {
50
62
  "schema": {
51
63
  "$ref": "#/components/schemas/CorsPreferences"
64
+ },
65
+ "examples": {
66
+ "getCorsResultWithMappingsExample": {
67
+ "$ref": "#/components/examples/getCorsResultWithMappingsExample"
68
+ },
69
+ "getCorsResultWithoutMappingsExample": {
70
+ "$ref": "#/components/examples/getCorsResultWithoutMappingsExample"
71
+ }
52
72
  }
53
73
  }
54
74
  }
@@ -64,26 +84,36 @@
64
84
  ]
65
85
  },
66
86
  "put": {
87
+ "summary": "Create or replace all CORS preferences for the given site.",
88
+ "description": "Create or replace all CORS preferences for the given site.",
67
89
  "operationId": "updateCorsPreferences",
68
90
  "parameters": [
69
91
  {
70
92
  "name": "organizationId",
71
93
  "in": "path",
94
+ "description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
72
95
  "required": true,
73
96
  "style": "simple",
74
97
  "explode": false,
75
98
  "schema": {
76
99
  "$ref": "#/components/schemas/OrganizationId"
77
- }
100
+ },
101
+ "example": "f_ecom_zzxy_prd"
78
102
  },
79
103
  {
80
104
  "name": "siteId",
81
105
  "in": "query",
106
+ "description": "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.",
82
107
  "required": true,
83
108
  "style": "form",
84
109
  "explode": true,
85
110
  "schema": {
86
111
  "$ref": "#/components/schemas/SiteId"
112
+ },
113
+ "examples": {
114
+ "SiteId": {
115
+ "value": "RefArch"
116
+ }
87
117
  }
88
118
  }
89
119
  ],
@@ -92,6 +122,11 @@
92
122
  "application/json": {
93
123
  "schema": {
94
124
  "$ref": "#/components/schemas/CorsPreferences"
125
+ },
126
+ "examples": {
127
+ "CorsPutBodyExample": {
128
+ "$ref": "#/components/examples/CorsPutBodyExample"
129
+ }
95
130
  }
96
131
  }
97
132
  },
@@ -104,6 +139,14 @@
104
139
  "application/json": {
105
140
  "schema": {
106
141
  "$ref": "#/components/schemas/CorsPreferences"
142
+ },
143
+ "examples": {
144
+ "updateCorsResultWithMappingsExample": {
145
+ "$ref": "#/components/examples/updateCorsResultWithMappingsExample"
146
+ },
147
+ "updateCorsResultWithoutMappingsExample": {
148
+ "$ref": "#/components/examples/updateCorsResultWithoutMappingsExample"
149
+ }
107
150
  }
108
151
  }
109
152
  }
@@ -114,6 +157,14 @@
114
157
  "application/json": {
115
158
  "schema": {
116
159
  "$ref": "#/components/schemas/CorsPreferences"
160
+ },
161
+ "examples": {
162
+ "updateCorsResultWithMappingsExample": {
163
+ "$ref": "#/components/examples/updateCorsResultWithMappingsExample"
164
+ },
165
+ "updateCorsResultWithoutMappingsExample": {
166
+ "$ref": "#/components/examples/updateCorsResultWithoutMappingsExample"
167
+ }
117
168
  }
118
169
  }
119
170
  }
@@ -124,6 +175,14 @@
124
175
  "application/json": {
125
176
  "schema": {
126
177
  "$ref": "#/components/schemas/ErrorResponse"
178
+ },
179
+ "examples": {
180
+ "CorsBadRequestMissingClientIdExample": {
181
+ "$ref": "#/components/examples/CorsBadRequestMissingClientIdExample"
182
+ },
183
+ "CorsBadRequestInvalidDomainNamesExample": {
184
+ "$ref": "#/components/examples/CorsBadRequestInvalidDomainNamesExample"
185
+ }
127
186
  }
128
187
  }
129
188
  }
@@ -138,26 +197,36 @@
138
197
  ]
139
198
  },
140
199
  "delete": {
200
+ "summary": "Delete all CORS preferences for the given site.",
201
+ "description": "Delete all CORS preferences for the given site.",
141
202
  "operationId": "deleteCorsPreferences",
142
203
  "parameters": [
143
204
  {
144
205
  "name": "organizationId",
145
206
  "in": "path",
207
+ "description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
146
208
  "required": true,
147
209
  "style": "simple",
148
210
  "explode": false,
149
211
  "schema": {
150
212
  "$ref": "#/components/schemas/OrganizationId"
151
- }
213
+ },
214
+ "example": "f_ecom_zzxy_prd"
152
215
  },
153
216
  {
154
217
  "name": "siteId",
155
218
  "in": "query",
219
+ "description": "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.",
156
220
  "required": true,
157
221
  "style": "form",
158
222
  "explode": true,
159
223
  "schema": {
160
224
  "$ref": "#/components/schemas/SiteId"
225
+ },
226
+ "examples": {
227
+ "SiteId": {
228
+ "value": "RefArch"
229
+ }
161
230
  }
162
231
  }
163
232
  ],
@@ -180,25 +249,33 @@
180
249
  "schemas": {
181
250
  "OrganizationId": {
182
251
  "type": "string",
183
- "maxLength": 32,
184
- "minLength": 1
252
+ "description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
253
+ "example": "f_ecom_zzxy_prd",
254
+ "pattern": "^f_ecom_[a-z]{4}_(prd|stg|dev|s[0-9]{2}|[0-9]{3})$"
185
255
  },
186
256
  "SiteId": {
187
257
  "type": "string",
258
+ "description": "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",
259
+ "example": "RefArch",
188
260
  "maxLength": 32,
189
261
  "minLength": 1
190
262
  },
191
263
  "CorsClientPreferences": {
192
264
  "type": "object",
265
+ "description": "Document representing all CORS preferences of a specific client",
193
266
  "properties": {
194
267
  "clientId": {
195
268
  "type": "string",
269
+ "description": "Client ID",
270
+ "example": "12345678-90ab-cdef-fedc-ba0987654321",
196
271
  "pattern": "^[-a-zA-Z0-9]+$"
197
272
  },
198
273
  "origins": {
199
274
  "type": "array",
275
+ "description": "List containing allowed origins in the format '<scheme>://<domain>.<tld>'",
200
276
  "items": {
201
277
  "type": "string",
278
+ "example": "[\"http://foo.com\",\"https://foo.bar.com\",\"myapp://example.com\"]",
202
279
  "pattern": "^[a-zA-Z_0-9][-.+a-zA-Z_0-9]+://[-.a-zA-Z_0-9]{1,253}$"
203
280
  }
204
281
  }
@@ -210,9 +287,11 @@
210
287
  },
211
288
  "CorsPreferences": {
212
289
  "type": "object",
290
+ "description": "Document representing all CORS preferences for a given site",
213
291
  "properties": {
214
292
  "corsClientPreferences": {
215
293
  "type": "array",
294
+ "description": "List of client-specific CORS preferences",
216
295
  "items": {
217
296
  "$ref": "#/components/schemas/CorsClientPreferences"
218
297
  }
@@ -225,17 +304,25 @@
225
304
  "properties": {
226
305
  "title": {
227
306
  "type": "string",
307
+ "description": "A short, human-readable summary of the problem\ntype. It will not change from occurrence to occurrence of the \nproblem, except for purposes of localization\n",
308
+ "example": "You do not have enough credit",
228
309
  "maxLength": 256
229
310
  },
230
311
  "type": {
231
312
  "type": "string",
313
+ "description": "A URI reference [RFC3986] that identifies the\nproblem type. This specification encourages that, when\ndereferenced, it provide human-readable documentation for the\nproblem type (e.g., using HTML [W3C.REC-html5-20141028]). When\nthis member is not present, its value is assumed to be\n\"about:blank\". It accepts relative URIs; this means\nthat they must be resolved relative to the document's base URI, as\nper [RFC3986], Section 5.\n",
314
+ "example": "NotEnoughMoney",
232
315
  "maxLength": 2048
233
316
  },
234
317
  "detail": {
235
- "type": "string"
318
+ "type": "string",
319
+ "description": "A human-readable explanation specific to this occurrence of the problem.",
320
+ "example": "Your current balance is 30, but that costs 50"
236
321
  },
237
322
  "instance": {
238
323
  "type": "string",
324
+ "description": "A URI reference that identifies the specific\noccurrence of the problem. It may or may not yield further\ninformation if dereferenced. It accepts relative URIs; this means\nthat they must be resolved relative to the document's base URI, as\nper [RFC3986], Section 5.\n",
325
+ "example": "/account/12345/msgs/abc",
239
326
  "maxLength": 2048
240
327
  }
241
328
  },
@@ -250,27 +337,102 @@
250
337
  "organizationId": {
251
338
  "name": "organizationId",
252
339
  "in": "path",
340
+ "description": "An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).",
253
341
  "required": true,
254
342
  "style": "simple",
255
343
  "explode": false,
256
344
  "schema": {
257
345
  "$ref": "#/components/schemas/OrganizationId"
258
- }
346
+ },
347
+ "example": "f_ecom_zzxy_prd"
259
348
  },
260
349
  "siteId": {
261
350
  "name": "siteId",
262
351
  "in": "query",
352
+ "description": "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.",
263
353
  "required": true,
264
354
  "style": "form",
265
355
  "explode": true,
266
356
  "schema": {
267
357
  "$ref": "#/components/schemas/SiteId"
358
+ },
359
+ "examples": {
360
+ "SiteId": {
361
+ "value": "RefArch"
362
+ }
363
+ }
364
+ }
365
+ },
366
+ "examples": {
367
+ "getCorsResultWithMappingsExample": {
368
+ "value": {
369
+ "corsClientPreferences": [
370
+ {
371
+ "clientId": "12345678-90ab-cdef-fedc-ba0987654321",
372
+ "origins": [
373
+ "http://foo.com",
374
+ "https://foo.bar.com",
375
+ "myapp://example.com"
376
+ ]
377
+ }
378
+ ]
379
+ }
380
+ },
381
+ "getCorsResultWithoutMappingsExample": {
382
+ "value": {}
383
+ },
384
+ "CorsPutBodyExample": {
385
+ "value": {
386
+ "corsClientPreferences": [
387
+ {
388
+ "clientId": "12345678-90ab-cdef-fedc-ba0987654321",
389
+ "origins": [
390
+ "http://foo.com",
391
+ "https://foo.bar.com",
392
+ "myapp://example.com"
393
+ ]
394
+ }
395
+ ]
396
+ }
397
+ },
398
+ "updateCorsResultWithMappingsExample": {
399
+ "value": {
400
+ "corsClientPreferences": [
401
+ {
402
+ "clientId": "12345678-90ab-cdef-fedc-ba0987654321",
403
+ "origins": [
404
+ "http://foo.com",
405
+ "https://foo.bar.com",
406
+ "myapp://example.com"
407
+ ]
408
+ }
409
+ ]
410
+ }
411
+ },
412
+ "updateCorsResultWithoutMappingsExample": {
413
+ "value": {}
414
+ },
415
+ "CorsBadRequestMissingClientIdExample": {
416
+ "value": {
417
+ "title": "Bad Request",
418
+ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/bad-request",
419
+ "detail": "Submitted content was invalid: Client ID must not be null or empty",
420
+ "parameter": "Submitted content was invalid: Client ID must not be null or empty"
421
+ }
422
+ },
423
+ "CorsBadRequestInvalidDomainNamesExample": {
424
+ "value": {
425
+ "title": "Bad Request",
426
+ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/bad-request",
427
+ "detail": "Submitted content was invalid: Origins must contain only valid domain names in the format '<scheme>://<domain>.<tld>', without a port or path.",
428
+ "parameter": "Submitted content was invalid: Origins must contain only valid domain names in the format '<scheme>://<domain>.<tld>', without a port or path."
268
429
  }
269
430
  }
270
431
  },
271
432
  "securitySchemes": {
272
433
  "AmOAuth2": {
273
434
  "type": "oauth2",
435
+ "description": "AccountManager OAuth 2.0 bearer token Authentication.",
274
436
  "flows": {
275
437
  "clientCredentials": {
276
438
  "tokenUrl": "https://account.demandware.com/dwsso/oauth2/access_token",
@@ -282,10 +444,8 @@
282
444
  "authorizationCode": {
283
445
  "authorizationUrl": "https://account.demandware.com/dwsso/oauth2/authorize",
284
446
  "tokenUrl": "https://account.demandware.com/dwsso/oauth2/access_token",
285
- "scopes": {
286
- "sfcc.cors-preferences": "CORS preferences READONLY scope",
287
- "sfcc.cors-preferences.rw": "CORS preferences scope"
288
- }
447
+ "refreshUrl": "https://account.demandware.com/dwsso/oauth2/access_token",
448
+ "scopes": {}
289
449
  }
290
450
  }
291
451
  }