@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": "Scripts",
5
- "version": "1.0.0",
5
+ "description": "[Download API specification](https://developer.salesforce.com/static/commercecloud/commerce-api/scripts/scripts-oas-v1-public.yaml)\n\n# API Overview\n\nThe Scripts API provides endpoints for managing code versions on a Commerce Cloud instance.\n\n## Overview\n\nCode versions represent deployable bundles of cartridge code. This API allows administrators to list, create, read, update, and delete code versions on their Commerce Cloud instance.\n\n## Key Features\n\n- **List Code Versions**: Retrieve all code versions available on the instance\n- **Get Code Version**: Get detailed information about a specific code version\n- **Create Code Version**: Create or replace a code version using PUT\n- **Update Code Version**: Modify code version properties, such as activating a code version\n- **Delete Code Version**: Remove a code version (the active code version cannot be deleted)\n\n## Authentication\n\nThis API requires OAuth 2.0 authentication with the appropriate scopes:\n- `sfcc.scripts` - Read access to code version resources\n- `sfcc.scripts.rw` - Read and write access to code version resources\n\n## Best Practices\n\n1. Always verify which code version is active before making changes\n2. Use PATCH to update specific properties like activating a code version\n3. Avoid deleting the active code version - deactivate it first\n4. Use the GET list endpoint to discover available code versions before performing operations",
6
+ "version": "1.0.1",
6
7
  "x-api-type": "Admin",
7
8
  "x-api-family": "DX"
8
9
  },
@@ -11,6 +12,7 @@
11
12
  "url": "https://{shortCode}.api.commercecloud.salesforce.com/dx/scripts/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,31 +21,40 @@
19
21
  "paths": {
20
22
  "/organizations/{organizationId}/code-versions": {
21
23
  "get": {
24
+ "summary": "Get a list of code versions.",
25
+ "description": "Retrieves a list of all code versions available on the instance.",
22
26
  "operationId": "getCodeVersions",
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": "expand",
36
42
  "in": "query",
43
+ "description": "Specifies which related resources to include in the response.\nUse `size` to include the total size of the code version.\n",
37
44
  "required": false,
38
45
  "style": "form",
39
46
  "explode": false,
40
47
  "schema": {
41
48
  "type": "array",
49
+ "example": [
50
+ "size"
51
+ ],
42
52
  "items": {
43
53
  "type": "string",
44
54
  "enum": [
45
55
  "size"
46
- ]
56
+ ],
57
+ "example": "size"
47
58
  }
48
59
  }
49
60
  }
@@ -55,6 +66,11 @@
55
66
  "application/json": {
56
67
  "schema": {
57
68
  "$ref": "#/components/schemas/CodeVersionResult"
69
+ },
70
+ "examples": {
71
+ "CodeVersionListSuccess": {
72
+ "$ref": "#/components/examples/CodeVersionListSuccess"
73
+ }
58
74
  }
59
75
  }
60
76
  }
@@ -78,26 +94,32 @@
78
94
  },
79
95
  "/organizations/{organizationId}/code-versions/{codeVersionId}": {
80
96
  "get": {
97
+ "summary": "Get a code version.",
98
+ "description": "Retrieves the details of a specific code version by its ID.",
81
99
  "operationId": "getCodeVersion",
82
100
  "parameters": [
83
101
  {
84
102
  "name": "organizationId",
85
103
  "in": "path",
104
+ "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).",
86
105
  "required": true,
87
106
  "style": "simple",
88
107
  "explode": false,
89
108
  "schema": {
90
109
  "$ref": "#/components/schemas/OrganizationId"
91
- }
110
+ },
111
+ "example": "f_ecom_zzxy_prd"
92
112
  },
93
113
  {
94
114
  "name": "codeVersionId",
95
115
  "in": "path",
116
+ "description": "The ID of the code version.",
96
117
  "required": true,
97
118
  "style": "simple",
98
119
  "explode": false,
99
120
  "schema": {
100
121
  "type": "string",
122
+ "example": "version1",
101
123
  "maxLength": 256,
102
124
  "minLength": 1
103
125
  }
@@ -105,16 +127,21 @@
105
127
  {
106
128
  "name": "expand",
107
129
  "in": "query",
130
+ "description": "Specifies which related resources to include in the response.\nUse `size` to include the total size of the code version.\n",
108
131
  "required": false,
109
132
  "style": "form",
110
133
  "explode": false,
111
134
  "schema": {
112
135
  "type": "array",
136
+ "example": [
137
+ "size"
138
+ ],
113
139
  "items": {
114
140
  "type": "string",
115
141
  "enum": [
116
142
  "size"
117
- ]
143
+ ],
144
+ "example": "size"
118
145
  }
119
146
  }
120
147
  }
@@ -126,6 +153,14 @@
126
153
  "application/json": {
127
154
  "schema": {
128
155
  "$ref": "#/components/schemas/CodeVersion"
156
+ },
157
+ "examples": {
158
+ "CodeVersionSuccess": {
159
+ "$ref": "#/components/examples/CodeVersionSuccess"
160
+ },
161
+ "CodeVersionSuccessWithSize": {
162
+ "$ref": "#/components/examples/CodeVersionSuccessWithSize"
163
+ }
129
164
  }
130
165
  }
131
166
  }
@@ -142,6 +177,11 @@
142
177
  "application/problem+json": {
143
178
  "schema": {
144
179
  "$ref": "#/components/schemas/ErrorResponse"
180
+ },
181
+ "examples": {
182
+ "CodeVersionIdNotFound": {
183
+ "$ref": "#/components/examples/CodeVersionIdNotFound"
184
+ }
145
185
  }
146
186
  }
147
187
  }
@@ -157,26 +197,32 @@
157
197
  ]
158
198
  },
159
199
  "put": {
200
+ "summary": "Create or replace a code version.",
201
+ "description": "Creates a new code version or replaces an existing one with the given ID.",
160
202
  "operationId": "createCodeVersion",
161
203
  "parameters": [
162
204
  {
163
205
  "name": "organizationId",
164
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).",
165
208
  "required": true,
166
209
  "style": "simple",
167
210
  "explode": false,
168
211
  "schema": {
169
212
  "$ref": "#/components/schemas/OrganizationId"
170
- }
213
+ },
214
+ "example": "f_ecom_zzxy_prd"
171
215
  },
172
216
  {
173
217
  "name": "codeVersionId",
174
218
  "in": "path",
219
+ "description": "The ID of the code version.",
175
220
  "required": true,
176
221
  "style": "simple",
177
222
  "explode": false,
178
223
  "schema": {
179
224
  "type": "string",
225
+ "example": "version1",
180
226
  "maxLength": 256,
181
227
  "minLength": 1
182
228
  }
@@ -189,6 +235,11 @@
189
235
  "application/json": {
190
236
  "schema": {
191
237
  "$ref": "#/components/schemas/CodeVersion"
238
+ },
239
+ "examples": {
240
+ "CodeVersionReplacedSuccess": {
241
+ "$ref": "#/components/examples/CodeVersionReplacedSuccess"
242
+ }
192
243
  }
193
244
  }
194
245
  }
@@ -199,6 +250,11 @@
199
250
  "application/json": {
200
251
  "schema": {
201
252
  "$ref": "#/components/schemas/CodeVersion"
253
+ },
254
+ "examples": {
255
+ "CodeVersionCreatedSuccess": {
256
+ "$ref": "#/components/examples/CodeVersionCreatedSuccess"
257
+ }
202
258
  }
203
259
  }
204
260
  }
@@ -215,6 +271,11 @@
215
271
  "application/problem+json": {
216
272
  "schema": {
217
273
  "$ref": "#/components/schemas/ErrorResponse"
274
+ },
275
+ "examples": {
276
+ "CodeVersionIdAlreadyExists": {
277
+ "$ref": "#/components/examples/CodeVersionIdAlreadyExists"
278
+ }
218
279
  }
219
280
  }
220
281
  }
@@ -229,26 +290,32 @@
229
290
  ]
230
291
  },
231
292
  "delete": {
293
+ "summary": "Delete a code version.",
294
+ "description": "Deletes an existing code version by its ID. The active code version cannot be deleted.",
232
295
  "operationId": "deleteCodeVersion",
233
296
  "parameters": [
234
297
  {
235
298
  "name": "organizationId",
236
299
  "in": "path",
300
+ "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).",
237
301
  "required": true,
238
302
  "style": "simple",
239
303
  "explode": false,
240
304
  "schema": {
241
305
  "$ref": "#/components/schemas/OrganizationId"
242
- }
306
+ },
307
+ "example": "f_ecom_zzxy_prd"
243
308
  },
244
309
  {
245
310
  "name": "codeVersionId",
246
311
  "in": "path",
312
+ "description": "The ID of the code version.",
247
313
  "required": true,
248
314
  "style": "simple",
249
315
  "explode": false,
250
316
  "schema": {
251
317
  "type": "string",
318
+ "example": "version1",
252
319
  "maxLength": 256,
253
320
  "minLength": 1
254
321
  }
@@ -264,6 +331,11 @@
264
331
  "application/problem+json": {
265
332
  "schema": {
266
333
  "$ref": "#/components/schemas/ErrorResponse"
334
+ },
335
+ "examples": {
336
+ "CodeVersionModification": {
337
+ "$ref": "#/components/examples/CodeVersionModification"
338
+ }
267
339
  }
268
340
  }
269
341
  }
@@ -280,6 +352,11 @@
280
352
  "application/problem+json": {
281
353
  "schema": {
282
354
  "$ref": "#/components/schemas/ErrorResponse"
355
+ },
356
+ "examples": {
357
+ "CodeVersionIdNotFound": {
358
+ "$ref": "#/components/examples/CodeVersionIdNotFound"
359
+ }
283
360
  }
284
361
  }
285
362
  }
@@ -294,26 +371,32 @@
294
371
  ]
295
372
  },
296
373
  "patch": {
374
+ "summary": "Update a code version.",
375
+ "description": "Updates an existing code version with the provided properties. Use this endpoint to activate a code version.",
297
376
  "operationId": "updateCodeVersion",
298
377
  "parameters": [
299
378
  {
300
379
  "name": "organizationId",
301
380
  "in": "path",
381
+ "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).",
302
382
  "required": true,
303
383
  "style": "simple",
304
384
  "explode": false,
305
385
  "schema": {
306
386
  "$ref": "#/components/schemas/OrganizationId"
307
- }
387
+ },
388
+ "example": "f_ecom_zzxy_prd"
308
389
  },
309
390
  {
310
391
  "name": "codeVersionId",
311
392
  "in": "path",
393
+ "description": "The ID of the code version.",
312
394
  "required": true,
313
395
  "style": "simple",
314
396
  "explode": false,
315
397
  "schema": {
316
398
  "type": "string",
399
+ "example": "version1",
317
400
  "maxLength": 256,
318
401
  "minLength": 1
319
402
  }
@@ -324,6 +407,11 @@
324
407
  "application/json": {
325
408
  "schema": {
326
409
  "$ref": "#/components/schemas/CodeVersion"
410
+ },
411
+ "examples": {
412
+ "ActivateCodeVersion": {
413
+ "$ref": "#/components/examples/ActivateCodeVersion"
414
+ }
327
415
  }
328
416
  }
329
417
  },
@@ -336,6 +424,11 @@
336
424
  "application/json": {
337
425
  "schema": {
338
426
  "$ref": "#/components/schemas/CodeVersion"
427
+ },
428
+ "examples": {
429
+ "CodeVersionSuccess": {
430
+ "$ref": "#/components/examples/CodeVersionSuccess"
431
+ }
339
432
  }
340
433
  }
341
434
  }
@@ -346,6 +439,11 @@
346
439
  "application/problem+json": {
347
440
  "schema": {
348
441
  "$ref": "#/components/schemas/ErrorResponse"
442
+ },
443
+ "examples": {
444
+ "CodeVersionModification": {
445
+ "$ref": "#/components/examples/CodeVersionModification"
446
+ }
349
447
  }
350
448
  }
351
449
  }
@@ -362,6 +460,11 @@
362
460
  "application/problem+json": {
363
461
  "schema": {
364
462
  "$ref": "#/components/schemas/ErrorResponse"
463
+ },
464
+ "examples": {
465
+ "CodeVersionIdNotFound": {
466
+ "$ref": "#/components/examples/CodeVersionIdNotFound"
467
+ }
365
468
  }
366
469
  }
367
470
  }
@@ -372,6 +475,11 @@
372
475
  "application/problem+json": {
373
476
  "schema": {
374
477
  "$ref": "#/components/schemas/ErrorResponse"
478
+ },
479
+ "examples": {
480
+ "CodeVersionIdAlreadyExists": {
481
+ "$ref": "#/components/examples/CodeVersionIdAlreadyExists"
482
+ }
375
483
  }
376
484
  }
377
485
  }
@@ -391,21 +499,27 @@
391
499
  "schemas": {
392
500
  "OrganizationId": {
393
501
  "type": "string",
394
- "maxLength": 32,
395
- "minLength": 1
502
+ "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).",
503
+ "example": "f_ecom_zzxy_prd",
504
+ "pattern": "^f_ecom_[a-z]{4}_(prd|stg|dev|s[0-9]{2}|[0-9]{3})$"
396
505
  },
397
506
  "Total": {
398
507
  "type": "integer",
399
508
  "format": "int32",
400
509
  "default": 0,
510
+ "description": "The total number of hits that match the search's criteria. This can be greater than the number of results returned as search results are pagenated.",
511
+ "example": 10,
401
512
  "minimum": 0
402
513
  },
403
514
  "ResultBase": {
404
515
  "type": "object",
516
+ "description": "Schema defining generic list result. Each response schema of a resource requiring a list response should extend this schema. \nAdditionally it needs to be defined what data is returned.",
405
517
  "properties": {
406
518
  "limit": {
407
519
  "type": "integer",
408
- "format": "int32"
520
+ "format": "int32",
521
+ "description": "Maximum records to retrieve per request. The limit with its constraints (minimum, maximum, default) is defined by the request parameter `limit` of the endpoint returning this schema.",
522
+ "example": 10
409
523
  },
410
524
  "total": {
411
525
  "$ref": "#/components/schemas/Total"
@@ -418,43 +532,66 @@
418
532
  },
419
533
  "CodeVersion": {
420
534
  "type": "object",
535
+ "description": "A code version represents a deployable bundle of cartridge code on a Commerce Cloud instance.",
421
536
  "properties": {
422
537
  "id": {
423
538
  "type": "string",
539
+ "description": "The ID of the code version.",
540
+ "example": "version1",
424
541
  "maxLength": 256,
425
542
  "minLength": 1
426
543
  },
427
544
  "active": {
428
- "type": "boolean"
545
+ "type": "boolean",
546
+ "description": "Whether this is the active code version.",
547
+ "example": true
429
548
  },
430
549
  "cartridges": {
431
550
  "type": "array",
551
+ "description": "A list containing the names of all cartridges participating in this code version.",
552
+ "example": [
553
+ "app_storefront_base",
554
+ "app_storefront_controllers"
555
+ ],
432
556
  "items": {
433
557
  "type": "string",
558
+ "example": "app_storefront_base",
434
559
  "maxLength": 256
435
560
  }
436
561
  },
437
562
  "compatibilityMode": {
438
563
  "type": "string",
564
+ "description": "The compatibility mode for this code version.",
565
+ "example": "25.6",
439
566
  "maxLength": 100
440
567
  },
441
568
  "activationTime": {
442
569
  "type": "string",
443
- "format": "date-time"
570
+ "format": "date-time",
571
+ "description": "The timestamp when this code version was activated.",
572
+ "example": "2025-01-15T10:00:00Z"
444
573
  },
445
574
  "lastModificationTime": {
446
575
  "type": "string",
447
- "format": "date-time"
576
+ "format": "date-time",
577
+ "description": "The timestamp when this code version was last modified.",
578
+ "example": "2025-01-15T10:30:00Z"
448
579
  },
449
580
  "rollback": {
450
- "type": "boolean"
581
+ "type": "boolean",
582
+ "description": "Whether this code version supports rollback.",
583
+ "example": false
451
584
  },
452
585
  "totalSize": {
453
586
  "type": "integer",
454
- "format": "int64"
587
+ "format": "int64",
588
+ "description": "The total size of the code version in bytes. Only included when `expand=size` is requested.",
589
+ "example": 104857600
455
590
  },
456
591
  "webDavUrl": {
457
592
  "type": "string",
593
+ "description": "The WebDAV URL for uploading code to this code version.",
594
+ "example": "https://example.com/on/demandware.servlet/webdav/Sites/Cartridges/version1",
458
595
  "maxLength": 4000
459
596
  }
460
597
  }
@@ -465,9 +602,11 @@
465
602
  "$ref": "#/components/schemas/ResultBase"
466
603
  }
467
604
  ],
605
+ "description": "Result containing a list of code versions.",
468
606
  "properties": {
469
607
  "data": {
470
608
  "type": "array",
609
+ "description": "List of code versions.",
471
610
  "items": {
472
611
  "$ref": "#/components/schemas/CodeVersion"
473
612
  }
@@ -480,17 +619,25 @@
480
619
  "properties": {
481
620
  "title": {
482
621
  "type": "string",
622
+ "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",
623
+ "example": "You do not have enough credit",
483
624
  "maxLength": 256
484
625
  },
485
626
  "type": {
486
627
  "type": "string",
628
+ "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",
629
+ "example": "NotEnoughMoney",
487
630
  "maxLength": 2048
488
631
  },
489
632
  "detail": {
490
- "type": "string"
633
+ "type": "string",
634
+ "description": "A human-readable explanation specific to this occurrence of the problem.",
635
+ "example": "Your current balance is 30, but that costs 50"
491
636
  },
492
637
  "instance": {
493
638
  "type": "string",
639
+ "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",
640
+ "example": "/account/12345/msgs/abc",
494
641
  "maxLength": 2048
495
642
  }
496
643
  },
@@ -508,6 +655,11 @@
508
655
  "application/problem+json": {
509
656
  "schema": {
510
657
  "$ref": "#/components/schemas/ErrorResponse"
658
+ },
659
+ "examples": {
660
+ "UnauthorizedExample": {
661
+ "$ref": "#/components/examples/UnauthorizedExample"
662
+ }
511
663
  }
512
664
  }
513
665
  }
@@ -518,6 +670,11 @@
518
670
  "application/problem+json": {
519
671
  "schema": {
520
672
  "$ref": "#/components/schemas/ErrorResponse"
673
+ },
674
+ "examples": {
675
+ "ForbiddenExample": {
676
+ "$ref": "#/components/examples/ForbiddenExample"
677
+ }
521
678
  }
522
679
  }
523
680
  }
@@ -527,45 +684,196 @@
527
684
  "organizationId": {
528
685
  "name": "organizationId",
529
686
  "in": "path",
687
+ "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).",
530
688
  "required": true,
531
689
  "style": "simple",
532
690
  "explode": false,
533
691
  "schema": {
534
692
  "$ref": "#/components/schemas/OrganizationId"
535
- }
693
+ },
694
+ "example": "f_ecom_zzxy_prd"
536
695
  },
537
696
  "expand": {
538
697
  "name": "expand",
539
698
  "in": "query",
699
+ "description": "Specifies which related resources to include in the response.\nUse `size` to include the total size of the code version.\n",
540
700
  "required": false,
541
701
  "style": "form",
542
702
  "explode": false,
543
703
  "schema": {
544
704
  "type": "array",
705
+ "example": [
706
+ "size"
707
+ ],
545
708
  "items": {
546
709
  "type": "string",
547
710
  "enum": [
548
711
  "size"
549
- ]
712
+ ],
713
+ "example": "size"
550
714
  }
551
715
  }
552
716
  },
553
717
  "codeVersionId": {
554
718
  "name": "codeVersionId",
555
719
  "in": "path",
720
+ "description": "The ID of the code version.",
556
721
  "required": true,
557
722
  "style": "simple",
558
723
  "explode": false,
559
724
  "schema": {
560
725
  "type": "string",
726
+ "example": "version1",
561
727
  "maxLength": 256,
562
728
  "minLength": 1
563
729
  }
564
730
  }
565
731
  },
732
+ "examples": {
733
+ "CodeVersionListSuccess": {
734
+ "summary": "Successful code version list result",
735
+ "description": "Example of a successful response returning a list of all code versions on the instance.",
736
+ "value": {
737
+ "limit": 2,
738
+ "total": 2,
739
+ "data": [
740
+ {
741
+ "id": "version1",
742
+ "active": true,
743
+ "cartridges": [
744
+ "app_storefront_base",
745
+ "app_storefront_controllers"
746
+ ],
747
+ "compatibilityMode": "25.6",
748
+ "lastModificationTime": "2025-01-15T10:30:00.000Z",
749
+ "rollback": false,
750
+ "webDavUrl": "https://example.com/on/demandware.servlet/webdav/Sites/Cartridges/version1"
751
+ },
752
+ {
753
+ "id": "version2",
754
+ "active": false,
755
+ "cartridges": [
756
+ "app_storefront_base"
757
+ ],
758
+ "compatibilityMode": "25.6",
759
+ "lastModificationTime": "2025-01-10T08:00:00.000Z",
760
+ "rollback": true,
761
+ "webDavUrl": "https://example.com/on/demandware.servlet/webdav/Sites/Cartridges/version2"
762
+ }
763
+ ]
764
+ }
765
+ },
766
+ "UnauthorizedExample": {
767
+ "value": {
768
+ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/unauthorized",
769
+ "title": "Unauthorized",
770
+ "detail": "Unauthorized request"
771
+ }
772
+ },
773
+ "ForbiddenExample": {
774
+ "value": {
775
+ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/forbidden",
776
+ "title": "Forbidden",
777
+ "detail": "Access to requested resource forbidden"
778
+ }
779
+ },
780
+ "CodeVersionSuccess": {
781
+ "summary": "Successful code version retrieval",
782
+ "description": "Example of a successful response returning a single code version with all properties.",
783
+ "value": {
784
+ "id": "version1",
785
+ "active": true,
786
+ "cartridges": [
787
+ "app_storefront_base",
788
+ "app_storefront_controllers"
789
+ ],
790
+ "compatibilityMode": "25.6",
791
+ "lastModificationTime": "2025-01-15T10:30:00.000Z",
792
+ "rollback": false,
793
+ "webDavUrl": "https://example.com/on/demandware.servlet/webdav/Sites/Cartridges/version1"
794
+ }
795
+ },
796
+ "CodeVersionSuccessWithSize": {
797
+ "summary": "Successful code version retrieval with size expanded",
798
+ "description": "Example of a successful response returning a single code version with the totalSize field included when `expand=size` is requested.",
799
+ "value": {
800
+ "id": "version1",
801
+ "active": true,
802
+ "cartridges": [
803
+ "app_storefront_base",
804
+ "app_storefront_controllers"
805
+ ],
806
+ "compatibilityMode": "25.6",
807
+ "lastModificationTime": "2025-01-15T10:30:00.000Z",
808
+ "rollback": false,
809
+ "totalSize": 104857600,
810
+ "webDavUrl": "https://example.com/on/demandware.servlet/webdav/Sites/Cartridges/version1"
811
+ }
812
+ },
813
+ "CodeVersionIdNotFound": {
814
+ "value": {
815
+ "title": "Code Version Id Not Found",
816
+ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/code-version-id-not-found",
817
+ "detail": "The code version with ID 'nonexistent_version' couldn't be found."
818
+ }
819
+ },
820
+ "CodeVersionReplacedSuccess": {
821
+ "summary": "Successful code version replacement",
822
+ "description": "Example of a successful response when an existing code version is replaced via PUT.",
823
+ "value": {
824
+ "id": "version1",
825
+ "active": true,
826
+ "cartridges": [
827
+ "app_storefront_base",
828
+ "app_storefront_controllers"
829
+ ],
830
+ "compatibilityMode": "25.6",
831
+ "lastModificationTime": "2025-01-16T12:00:00.000Z",
832
+ "rollback": false,
833
+ "webDavUrl": "https://example.com/on/demandware.servlet/webdav/Sites/Cartridges/version1"
834
+ }
835
+ },
836
+ "CodeVersionCreatedSuccess": {
837
+ "summary": "Successful code version creation",
838
+ "description": "Example of a successful response when a new code version is created via PUT.",
839
+ "value": {
840
+ "id": "new_version",
841
+ "active": false,
842
+ "cartridges": [
843
+ "app_storefront_base"
844
+ ],
845
+ "compatibilityMode": "25.6",
846
+ "lastModificationTime": "2025-01-16T09:00:00.000Z",
847
+ "rollback": false,
848
+ "webDavUrl": "https://example.com/on/demandware.servlet/webdav/Sites/Cartridges/new_version"
849
+ }
850
+ },
851
+ "CodeVersionIdAlreadyExists": {
852
+ "value": {
853
+ "title": "Code Version Id Already Exists",
854
+ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/code-version-id-already-exists",
855
+ "detail": "The code version ID 'version1' already exists."
856
+ }
857
+ },
858
+ "CodeVersionModification": {
859
+ "value": {
860
+ "title": "Code Version Modification",
861
+ "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/code-version-modification",
862
+ "detail": "The code version 'version1' is active and can't be changed."
863
+ }
864
+ },
865
+ "ActivateCodeVersion": {
866
+ "summary": "Activate a code version",
867
+ "description": "Example of activating a code version by setting active to true",
868
+ "value": {
869
+ "active": true
870
+ }
871
+ }
872
+ },
566
873
  "securitySchemes": {
567
874
  "AmOAuth2": {
568
875
  "type": "oauth2",
876
+ "description": "AccountManager OAuth 2.0 bearer token Authentication.",
569
877
  "flows": {
570
878
  "clientCredentials": {
571
879
  "tokenUrl": "https://account.demandware.com/dwsso/oauth2/access_token",
@@ -577,10 +885,8 @@
577
885
  "authorizationCode": {
578
886
  "authorizationUrl": "https://account.demandware.com/dwsso/oauth2/authorize",
579
887
  "tokenUrl": "https://account.demandware.com/dwsso/oauth2/access_token",
580
- "scopes": {
581
- "sfcc.scripts": "Scripts API READONLY scope",
582
- "sfcc.scripts.rw": "Scripts API scope"
583
- }
888
+ "refreshUrl": "https://account.demandware.com/dwsso/oauth2/access_token",
889
+ "scopes": {}
584
890
  }
585
891
  }
586
892
  }