@gradientedge/commercetools-utils 5.36.0 → 6.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.
Files changed (189) hide show
  1. package/dist/cjs/auth/utils.d.ts.map +1 -1
  2. package/dist/cjs/auth/utils.js +1 -6
  3. package/dist/cjs/auth/utils.js.map +1 -1
  4. package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
  5. package/dist/cjs/types/models/approval-flow.d.ts +1 -1
  6. package/dist/cjs/types/models/approval-flow.d.ts.map +1 -1
  7. package/dist/cjs/types/models/approval-rule.d.ts +1 -1
  8. package/dist/cjs/types/models/approval-rule.d.ts.map +1 -1
  9. package/dist/cjs/types/models/associate-role.d.ts +11 -3
  10. package/dist/cjs/types/models/associate-role.d.ts.map +1 -1
  11. package/dist/cjs/types/models/associate-role.js +9 -1
  12. package/dist/cjs/types/models/associate-role.js.map +1 -1
  13. package/dist/cjs/types/models/business-unit.d.ts +76 -22
  14. package/dist/cjs/types/models/business-unit.d.ts.map +1 -1
  15. package/dist/cjs/types/models/business-unit.js.map +1 -1
  16. package/dist/cjs/types/models/cart-discount.d.ts +12 -11
  17. package/dist/cjs/types/models/cart-discount.d.ts.map +1 -1
  18. package/dist/cjs/types/models/cart-discount.js.map +1 -1
  19. package/dist/cjs/types/models/cart.d.ts +57 -19
  20. package/dist/cjs/types/models/cart.d.ts.map +1 -1
  21. package/dist/cjs/types/models/cart.js.map +1 -1
  22. package/dist/cjs/types/models/channel.d.ts +1 -1
  23. package/dist/cjs/types/models/channel.d.ts.map +1 -1
  24. package/dist/cjs/types/models/common.d.ts +16 -6
  25. package/dist/cjs/types/models/common.d.ts.map +1 -1
  26. package/dist/cjs/types/models/common.js.map +1 -1
  27. package/dist/cjs/types/models/customer.d.ts +70 -3
  28. package/dist/cjs/types/models/customer.d.ts.map +1 -1
  29. package/dist/cjs/types/models/error.d.ts +16 -6
  30. package/dist/cjs/types/models/error.d.ts.map +1 -1
  31. package/dist/cjs/types/models/event.d.ts +384 -0
  32. package/dist/cjs/types/models/event.d.ts.map +1 -0
  33. package/dist/cjs/types/models/event.js +8 -0
  34. package/dist/cjs/types/models/event.js.map +1 -0
  35. package/dist/cjs/types/models/extension.d.ts +2 -2
  36. package/dist/cjs/types/models/extension.d.ts.map +1 -1
  37. package/dist/cjs/types/models/index.d.ts +1 -0
  38. package/dist/cjs/types/models/index.d.ts.map +1 -1
  39. package/dist/cjs/types/models/index.js +1 -0
  40. package/dist/cjs/types/models/index.js.map +1 -1
  41. package/dist/cjs/types/models/me.d.ts +4 -4
  42. package/dist/cjs/types/models/me.d.ts.map +1 -1
  43. package/dist/cjs/types/models/me.js.map +1 -1
  44. package/dist/cjs/types/models/message.d.ts +564 -6
  45. package/dist/cjs/types/models/message.d.ts.map +1 -1
  46. package/dist/cjs/types/models/order-edit.d.ts +19 -1
  47. package/dist/cjs/types/models/order-edit.d.ts.map +1 -1
  48. package/dist/cjs/types/models/order.d.ts +38 -15
  49. package/dist/cjs/types/models/order.d.ts.map +1 -1
  50. package/dist/cjs/types/models/order.js.map +1 -1
  51. package/dist/cjs/types/models/payment.d.ts +2 -2
  52. package/dist/cjs/types/models/payment.d.ts.map +1 -1
  53. package/dist/cjs/types/models/product-discount.d.ts +2 -2
  54. package/dist/cjs/types/models/product-search.d.ts +15 -8
  55. package/dist/cjs/types/models/product-search.d.ts.map +1 -1
  56. package/dist/cjs/types/models/product-search.js.map +1 -1
  57. package/dist/cjs/types/models/product-selection.d.ts +13 -16
  58. package/dist/cjs/types/models/product-selection.d.ts.map +1 -1
  59. package/dist/cjs/types/models/product-selection.js.map +1 -1
  60. package/dist/cjs/types/models/product-tailoring.d.ts +10 -8
  61. package/dist/cjs/types/models/product-tailoring.d.ts.map +1 -1
  62. package/dist/cjs/types/models/product-type.d.ts +33 -9
  63. package/dist/cjs/types/models/product-type.d.ts.map +1 -1
  64. package/dist/cjs/types/models/product-type.js.map +1 -1
  65. package/dist/cjs/types/models/product.d.ts +97 -15
  66. package/dist/cjs/types/models/product.d.ts.map +1 -1
  67. package/dist/cjs/types/models/product.js +4 -0
  68. package/dist/cjs/types/models/product.js.map +1 -1
  69. package/dist/cjs/types/models/project.d.ts +12 -12
  70. package/dist/cjs/types/models/project.d.ts.map +1 -1
  71. package/dist/cjs/types/models/quote-request.d.ts +2 -2
  72. package/dist/cjs/types/models/quote-request.d.ts.map +1 -1
  73. package/dist/cjs/types/models/quote.d.ts +2 -2
  74. package/dist/cjs/types/models/quote.d.ts.map +1 -1
  75. package/dist/cjs/types/models/search.d.ts +4 -4
  76. package/dist/cjs/types/models/search.d.ts.map +1 -1
  77. package/dist/cjs/types/models/shipping-method.d.ts +5 -3
  78. package/dist/cjs/types/models/shipping-method.d.ts.map +1 -1
  79. package/dist/cjs/types/models/shipping-method.js.map +1 -1
  80. package/dist/cjs/types/models/shopping-list.d.ts +10 -2
  81. package/dist/cjs/types/models/shopping-list.d.ts.map +1 -1
  82. package/dist/cjs/types/models/staged-quote.d.ts +2 -2
  83. package/dist/cjs/types/models/staged-quote.d.ts.map +1 -1
  84. package/dist/cjs/types/models/state.d.ts +2 -2
  85. package/dist/cjs/types/models/state.d.ts.map +1 -1
  86. package/dist/cjs/types/models/subscription.d.ts +349 -237
  87. package/dist/cjs/types/models/subscription.d.ts.map +1 -1
  88. package/dist/cjs/types/models/subscription.js +22 -1
  89. package/dist/cjs/types/models/subscription.js.map +1 -1
  90. package/dist/cjs/types/models/type.d.ts +3 -3
  91. package/dist/cjs/types/models/type.d.ts.map +1 -1
  92. package/dist/cjs/utils/axios/create-instance.d.ts.map +1 -1
  93. package/dist/cjs/utils/axios/create-instance.js +4 -16
  94. package/dist/cjs/utils/axios/create-instance.js.map +1 -1
  95. package/dist/mjs/auth/utils.d.ts.map +1 -1
  96. package/dist/mjs/auth/utils.js +1 -6
  97. package/dist/mjs/auth/utils.js.map +1 -1
  98. package/dist/mjs/tsconfig.tsbuildinfo +1 -1
  99. package/dist/mjs/types/models/approval-flow.d.ts +1 -1
  100. package/dist/mjs/types/models/approval-flow.d.ts.map +1 -1
  101. package/dist/mjs/types/models/approval-rule.d.ts +1 -1
  102. package/dist/mjs/types/models/approval-rule.d.ts.map +1 -1
  103. package/dist/mjs/types/models/associate-role.d.ts +11 -3
  104. package/dist/mjs/types/models/associate-role.d.ts.map +1 -1
  105. package/dist/mjs/types/models/associate-role.js +9 -1
  106. package/dist/mjs/types/models/associate-role.js.map +1 -1
  107. package/dist/mjs/types/models/business-unit.d.ts +76 -22
  108. package/dist/mjs/types/models/business-unit.d.ts.map +1 -1
  109. package/dist/mjs/types/models/business-unit.js.map +1 -1
  110. package/dist/mjs/types/models/cart-discount.d.ts +12 -11
  111. package/dist/mjs/types/models/cart-discount.d.ts.map +1 -1
  112. package/dist/mjs/types/models/cart-discount.js.map +1 -1
  113. package/dist/mjs/types/models/cart.d.ts +57 -19
  114. package/dist/mjs/types/models/cart.d.ts.map +1 -1
  115. package/dist/mjs/types/models/cart.js.map +1 -1
  116. package/dist/mjs/types/models/channel.d.ts +1 -1
  117. package/dist/mjs/types/models/channel.d.ts.map +1 -1
  118. package/dist/mjs/types/models/common.d.ts +16 -6
  119. package/dist/mjs/types/models/common.d.ts.map +1 -1
  120. package/dist/mjs/types/models/common.js.map +1 -1
  121. package/dist/mjs/types/models/customer.d.ts +70 -3
  122. package/dist/mjs/types/models/customer.d.ts.map +1 -1
  123. package/dist/mjs/types/models/error.d.ts +16 -6
  124. package/dist/mjs/types/models/error.d.ts.map +1 -1
  125. package/dist/mjs/types/models/event.d.ts +384 -0
  126. package/dist/mjs/types/models/event.d.ts.map +1 -0
  127. package/dist/mjs/types/models/event.js +7 -0
  128. package/dist/mjs/types/models/event.js.map +1 -0
  129. package/dist/mjs/types/models/extension.d.ts +2 -2
  130. package/dist/mjs/types/models/extension.d.ts.map +1 -1
  131. package/dist/mjs/types/models/index.d.ts +1 -0
  132. package/dist/mjs/types/models/index.d.ts.map +1 -1
  133. package/dist/mjs/types/models/index.js +1 -0
  134. package/dist/mjs/types/models/index.js.map +1 -1
  135. package/dist/mjs/types/models/me.d.ts +4 -4
  136. package/dist/mjs/types/models/me.d.ts.map +1 -1
  137. package/dist/mjs/types/models/me.js.map +1 -1
  138. package/dist/mjs/types/models/message.d.ts +564 -6
  139. package/dist/mjs/types/models/message.d.ts.map +1 -1
  140. package/dist/mjs/types/models/order-edit.d.ts +19 -1
  141. package/dist/mjs/types/models/order-edit.d.ts.map +1 -1
  142. package/dist/mjs/types/models/order.d.ts +38 -15
  143. package/dist/mjs/types/models/order.d.ts.map +1 -1
  144. package/dist/mjs/types/models/order.js.map +1 -1
  145. package/dist/mjs/types/models/payment.d.ts +2 -2
  146. package/dist/mjs/types/models/payment.d.ts.map +1 -1
  147. package/dist/mjs/types/models/product-discount.d.ts +2 -2
  148. package/dist/mjs/types/models/product-search.d.ts +15 -8
  149. package/dist/mjs/types/models/product-search.d.ts.map +1 -1
  150. package/dist/mjs/types/models/product-search.js.map +1 -1
  151. package/dist/mjs/types/models/product-selection.d.ts +13 -16
  152. package/dist/mjs/types/models/product-selection.d.ts.map +1 -1
  153. package/dist/mjs/types/models/product-selection.js.map +1 -1
  154. package/dist/mjs/types/models/product-tailoring.d.ts +10 -8
  155. package/dist/mjs/types/models/product-tailoring.d.ts.map +1 -1
  156. package/dist/mjs/types/models/product-type.d.ts +33 -9
  157. package/dist/mjs/types/models/product-type.d.ts.map +1 -1
  158. package/dist/mjs/types/models/product-type.js.map +1 -1
  159. package/dist/mjs/types/models/product.d.ts +97 -15
  160. package/dist/mjs/types/models/product.d.ts.map +1 -1
  161. package/dist/mjs/types/models/product.js +4 -0
  162. package/dist/mjs/types/models/product.js.map +1 -1
  163. package/dist/mjs/types/models/project.d.ts +12 -12
  164. package/dist/mjs/types/models/project.d.ts.map +1 -1
  165. package/dist/mjs/types/models/quote-request.d.ts +2 -2
  166. package/dist/mjs/types/models/quote-request.d.ts.map +1 -1
  167. package/dist/mjs/types/models/quote.d.ts +2 -2
  168. package/dist/mjs/types/models/quote.d.ts.map +1 -1
  169. package/dist/mjs/types/models/search.d.ts +4 -4
  170. package/dist/mjs/types/models/search.d.ts.map +1 -1
  171. package/dist/mjs/types/models/shipping-method.d.ts +5 -3
  172. package/dist/mjs/types/models/shipping-method.d.ts.map +1 -1
  173. package/dist/mjs/types/models/shipping-method.js.map +1 -1
  174. package/dist/mjs/types/models/shopping-list.d.ts +10 -2
  175. package/dist/mjs/types/models/shopping-list.d.ts.map +1 -1
  176. package/dist/mjs/types/models/staged-quote.d.ts +2 -2
  177. package/dist/mjs/types/models/staged-quote.d.ts.map +1 -1
  178. package/dist/mjs/types/models/state.d.ts +2 -2
  179. package/dist/mjs/types/models/state.d.ts.map +1 -1
  180. package/dist/mjs/types/models/subscription.d.ts +349 -237
  181. package/dist/mjs/types/models/subscription.d.ts.map +1 -1
  182. package/dist/mjs/types/models/subscription.js +21 -0
  183. package/dist/mjs/types/models/subscription.js.map +1 -1
  184. package/dist/mjs/types/models/type.d.ts +3 -3
  185. package/dist/mjs/types/models/type.d.ts.map +1 -1
  186. package/dist/mjs/utils/axios/create-instance.d.ts.map +1 -1
  187. package/dist/mjs/utils/axios/create-instance.js +4 -16
  188. package/dist/mjs/utils/axios/create-instance.js.map +1 -1
  189. package/package.json +2 -2
@@ -12,7 +12,7 @@ export declare enum AwsAuthenticationModeValues {
12
12
  Credentials = "Credentials",
13
13
  Iam = "IAM"
14
14
  }
15
- export type AwsAuthenticationMode = 'Credentials' | 'IAM' | string;
15
+ export type AwsAuthenticationMode = 'Credentials' | 'IAM' | (string & {});
16
16
  /**
17
17
  * Notification about changes to a resource. The payload format differs for resource [creation](ctp:api:type:ResourceCreatedDeliveryPayload),
18
18
  * [update](ctp:api:type:ResourceUpdatedDeliveryPayload),
@@ -71,7 +71,7 @@ export declare enum ChangeSubscriptionResourceTypeIdValues {
71
71
  Type = "type",
72
72
  Zone = "zone"
73
73
  }
74
- export type ChangeSubscriptionResourceTypeId = 'approval-flow' | 'approval-rule' | 'associate-role' | 'attribute-group' | 'business-unit' | 'cart' | 'cart-discount' | 'category' | 'channel' | 'customer' | 'customer-email-token' | 'customer-group' | 'customer-password-token' | 'discount-code' | 'extension' | 'inventory-entry' | 'key-value-document' | 'order' | 'order-edit' | 'payment' | 'product' | 'product-discount' | 'product-selection' | 'product-tailoring' | 'product-type' | 'quote' | 'quote-request' | 'review' | 'shipping-method' | 'shopping-list' | 'staged-quote' | 'standalone-price' | 'state' | 'store' | 'subscription' | 'tax-category' | 'type' | 'zone' | string;
74
+ export type ChangeSubscriptionResourceTypeId = 'approval-flow' | 'approval-rule' | 'associate-role' | 'attribute-group' | 'business-unit' | 'cart' | 'cart-discount' | 'category' | 'channel' | 'customer' | 'customer-email-token' | 'customer-group' | 'customer-password-token' | 'discount-code' | 'extension' | 'inventory-entry' | 'key-value-document' | 'order' | 'order-edit' | 'payment' | 'product' | 'product-discount' | 'product-selection' | 'product-tailoring' | 'product-type' | 'quote' | 'quote-request' | 'review' | 'shipping-method' | 'shopping-list' | 'staged-quote' | 'standalone-price' | 'state' | 'store' | 'subscription' | 'tax-category' | 'type' | 'zone' | (string & {});
75
75
  /**
76
76
  * The [CloudEventsFormat](ctp:api:type:CloudEventsFormat) represents event data in a way that conforms to a common specification. The payload can be found inside the `data` field.
77
77
  *
@@ -133,7 +133,7 @@ export interface CloudEventsPayload {
133
133
  */
134
134
  readonly dataref?: string;
135
135
  /**
136
- * [MessageDeliveryPayload](ctp:api:type:MessageDeliveryPayload), [ResourceCreatedDeliveryPayload](ctp:api:type:ResourceCreatedDeliveryPayload), [ResourceUpdatedDeliveryPayload](ctp:api:type:ResourceUpdatedDeliveryPayload), or [ResourceDeletedDeliveryPayload](ctp:api:type:ResourceDeletedDeliveryPayload).
136
+ * [MessageDeliveryPayload](ctp:api:type:MessageDeliveryPayload), [ResourceCreatedDeliveryPayload](ctp:api:type:ResourceCreatedDeliveryPayload), [ResourceUpdatedDeliveryPayload](ctp:api:type:ResourceUpdatedDeliveryPayload), or [ResourceDeletedDeliveryPayload](ctp:api:type:ResourceDeletedDeliveryPayload), [EventDeliveryPayload](ctp:api:type:EventDeliveryPayload).
137
137
  *
138
138
  *
139
139
  */
@@ -157,38 +157,6 @@ export interface CloudEventsFormat extends IDeliveryFormat {
157
157
  */
158
158
  readonly cloudEventsVersion: string;
159
159
  }
160
- /**
161
- * All payloads for the [PlatformFormat](ctp:api:type:PlatformFormat) share these common fields.
162
- *
163
- */
164
- export type DeliveryPayload = MessageDeliveryPayload | ResourceCreatedDeliveryPayload | ResourceDeletedDeliveryPayload | ResourceUpdatedDeliveryPayload;
165
- export interface IDeliveryPayload {
166
- /**
167
- * `key` of the [Project](ctp:api:type:Project).
168
- * Useful for processing notifications if the Destination receives them from multiple Projects.
169
- *
170
- *
171
- */
172
- readonly projectKey: string;
173
- /**
174
- * Identifies the payload.
175
- *
176
- *
177
- */
178
- readonly notificationType: string;
179
- /**
180
- * Reference to the resource that triggered the notification.
181
- *
182
- *
183
- */
184
- readonly resource: Reference;
185
- /**
186
- * User-defined unique identifiers of the resource.
187
- *
188
- *
189
- */
190
- readonly resourceUserProvidedIdentifiers?: UserProvidedIdentifiers;
191
- }
192
160
  export type Destination = AzureEventGridDestination | AzureServiceBusDestination | ConfluentCloudDestination | EventBridgeDestination | GoogleCloudPubSubDestination | SnsDestination | SqsDestination;
193
161
  export interface IDestination {
194
162
  /**
@@ -304,95 +272,67 @@ export interface EventBridgeDestination extends IDestination {
304
272
  readonly source: string;
305
273
  }
306
274
  /**
307
- * Destination for [Google Cloud Pub/Sub](https://cloud.google.com/pubsub/) that can be used
308
- * for [Pull subscriptions](https://cloud.google.com/pubsub/docs/pull) as well as for [Push subscriptions](https://cloud.google.com/pubsub/docs/push).
309
- * The `topic` must give the `pubsub.topics.publish` permission to the service account `subscriptions@commercetools-platform.iam.gserviceaccount.com`.
310
- * If used with the [CloudEventsFormat](#cloudeventsformat), the notification conforms to the [PubSub Protocol Binding](https://github.com/google/knative-gcp/blob/master/docs/spec/pubsub-protocol-binding.md) of the [Structured Content Mode](https://github.com/google/knative-gcp/blob/master/docs/spec/pubsub-protocol-binding.md#32-structured-content-mode).
275
+ * For EventSubscription, the format of the payload is custom for each specific notification.
311
276
  *
312
277
  */
313
- export interface GoogleCloudPubSubDestination extends IDestination {
314
- readonly type: 'GoogleCloudPubSub';
278
+ export interface EventSubscription {
315
279
  /**
316
- * ID of the Google Cloud project that contains the Pub/Sub topic.
280
+ * Unique identifier for the type of resource, for example, `import-api`.
317
281
  *
318
282
  *
319
283
  */
320
- readonly projectId: string;
284
+ readonly resourceTypeId: EventSubscriptionResourceTypeId;
321
285
  /**
322
- * Name of the topic.
286
+ * Must contain valid event types for the resource.
287
+ * For example, for resource type `import-api` the event type `ImportContainerCreated` is valid.
288
+ * If no `types` are given, the Subscription will receive all events for this resource.
323
289
  *
324
290
  *
325
291
  */
326
- readonly topic: string;
292
+ readonly types?: EventType[];
327
293
  }
328
294
  /**
329
- * This payload is sent for a [MessageSubscription](ctp:api:type:MessageSubscription).
295
+ * Resource types supported by [EventSubscriptions](ctp:api:type:EventSubscription).
330
296
  *
331
297
  */
332
- export interface MessageDeliveryPayload extends IDeliveryPayload {
333
- readonly notificationType: 'Message';
334
- /**
335
- * `key` of the [Project](ctp:api:type:Project).
336
- * Useful for processing notifications if the Destination receives them from multiple Projects.
337
- *
338
- *
339
- */
340
- readonly projectKey: string;
341
- /**
342
- * Reference to the resource that triggered the notification.
343
- *
344
- *
345
- */
346
- readonly resource: Reference;
347
- /**
348
- * User-defined unique identifiers of the resource.
349
- *
350
- *
351
- */
352
- readonly resourceUserProvidedIdentifiers?: UserProvidedIdentifiers;
353
- /**
354
- * Unique ID of the message.
355
- *
356
- *
357
- */
358
- readonly id: string;
359
- /**
360
- * Last seen version of the resource.
361
- *
362
- *
363
- */
364
- readonly version: number;
365
- /**
366
- * Date and time (UTC) the resource was initially created.
367
- *
368
- *
369
- */
370
- readonly createdAt: string;
371
- /**
372
- * Date and time (UTC) the resource was last modified.
373
- *
374
- *
375
- */
376
- readonly lastModifiedAt: string;
377
- /**
378
- * Used to ensure all messages of the resource are processed in correct order.
379
- * The `sequenceNumber` of the next message of the resource is a successor of the `sequenceNumber` of the current message.
380
- *
381
- *
382
- */
383
- readonly sequenceNumber: number;
298
+ export declare enum EventSubscriptionResourceTypeIdValues {
299
+ ImportApi = "import-api"
300
+ }
301
+ export type EventSubscriptionResourceTypeId = 'import-api' | (string & {});
302
+ /**
303
+ * Type of events supported by [EventSubscriptions](ctp:api:type:EventSubscription).
304
+ *
305
+ */
306
+ export declare enum EventTypeValues {
307
+ ImportContainerCreated = "ImportContainerCreated",
308
+ ImportContainerDeleted = "ImportContainerDeleted",
309
+ ImportOperationRejected = "ImportOperationRejected",
310
+ ImportUnresolved = "ImportUnresolved",
311
+ ImportValidationFailed = "ImportValidationFailed",
312
+ ImportWaitForMasterVariant = "ImportWaitForMasterVariant"
313
+ }
314
+ export type EventType = 'ImportContainerCreated' | 'ImportContainerDeleted' | 'ImportOperationRejected' | 'ImportUnresolved' | 'ImportValidationFailed' | 'ImportWaitForMasterVariant' | (string & {});
315
+ /**
316
+ * Destination for [Google Cloud Pub/Sub](https://cloud.google.com/pubsub/) that can be used
317
+ * for [Pull subscriptions](https://cloud.google.com/pubsub/docs/pull) as well as for [Push subscriptions](https://cloud.google.com/pubsub/docs/push).
318
+ * The `topic` must give the `pubsub.topics.publish` permission to the service account `subscriptions@commercetools-platform.iam.gserviceaccount.com`.
319
+ * If used with the [CloudEventsFormat](#cloudeventsformat), the notification conforms to the [PubSub Protocol Binding](https://github.com/google/knative-gcp/blob/master/docs/spec/pubsub-protocol-binding.md) of the [Structured Content Mode](https://github.com/google/knative-gcp/blob/master/docs/spec/pubsub-protocol-binding.md#32-structured-content-mode).
320
+ *
321
+ */
322
+ export interface GoogleCloudPubSubDestination extends IDestination {
323
+ readonly type: 'GoogleCloudPubSub';
384
324
  /**
385
- * Version of the resource on which the update was performed.
325
+ * ID of the Google Cloud project that contains the Pub/Sub topic.
386
326
  *
387
327
  *
388
328
  */
389
- readonly resourceVersion: number;
329
+ readonly projectId: string;
390
330
  /**
391
- * If the payload does not fit into the size limit or its format is not accepted by the messaging service, the `payloadNotIncluded` field is present.
331
+ * Name of the topic.
392
332
  *
393
333
  *
394
334
  */
395
- readonly payloadNotIncluded?: PayloadNotIncluded;
335
+ readonly topic: string;
396
336
  }
397
337
  /**
398
338
  * Messages will be delivered even if the Messages Query HTTP API [is not enabled](/../api/projects/messages#enable-querying-messages-via-the-api).
@@ -443,7 +383,7 @@ export declare enum MessageSubscriptionResourceTypeIdValues {
443
383
  StandalonePrice = "standalone-price",
444
384
  Store = "store"
445
385
  }
446
- export type MessageSubscriptionResourceTypeId = 'approval-flow' | 'approval-rule' | 'associate-role' | 'business-unit' | 'category' | 'customer' | 'customer-email-token' | 'customer-group' | 'customer-password-token' | 'inventory-entry' | 'order' | 'payment' | 'product' | 'product-selection' | 'product-tailoring' | 'quote' | 'quote-request' | 'review' | 'shopping-list' | 'staged-quote' | 'standalone-price' | 'store' | string;
386
+ export type MessageSubscriptionResourceTypeId = 'approval-flow' | 'approval-rule' | 'associate-role' | 'business-unit' | 'category' | 'customer' | 'customer-email-token' | 'customer-group' | 'customer-password-token' | 'inventory-entry' | 'order' | 'payment' | 'product' | 'product-selection' | 'product-tailoring' | 'quote' | 'quote-request' | 'review' | 'shopping-list' | 'staged-quote' | 'standalone-price' | 'store' | (string & {});
447
387
  export interface PayloadNotIncluded {
448
388
  /**
449
389
  * Reason the payload is not included. For example, the payload is too large, or its content is not supported by the Subscription destination.
@@ -465,132 +405,6 @@ export interface PayloadNotIncluded {
465
405
  export interface PlatformFormat extends IDeliveryFormat {
466
406
  readonly type: 'Platform';
467
407
  }
468
- /**
469
- * This payload is sent for a [ChangeSubscription](ctp:api:type:ChangeSubscription) when a resource is created.
470
- *
471
- */
472
- export interface ResourceCreatedDeliveryPayload extends IDeliveryPayload {
473
- readonly notificationType: 'ResourceCreated';
474
- /**
475
- * `key` of the [Project](ctp:api:type:Project).
476
- * Useful for processing notifications if the Destination receives them from multiple Projects.
477
- *
478
- *
479
- */
480
- readonly projectKey: string;
481
- /**
482
- * Reference to the resource that triggered the notification.
483
- *
484
- *
485
- */
486
- readonly resource: Reference;
487
- /**
488
- * User-defined unique identifiers of the resource.
489
- *
490
- *
491
- */
492
- readonly resourceUserProvidedIdentifiers?: UserProvidedIdentifiers;
493
- /**
494
- * Last seen version of the resource.
495
- *
496
- *
497
- */
498
- readonly version: number;
499
- /**
500
- * Date and time (UTC) the resource was last modified.
501
- *
502
- *
503
- */
504
- readonly modifiedAt: string;
505
- }
506
- /**
507
- * This payload is sent for a [ChangeSubscription](ctp:api:type:ChangeSubscription) when a resource is deleted.
508
- *
509
- */
510
- export interface ResourceDeletedDeliveryPayload extends IDeliveryPayload {
511
- readonly notificationType: 'ResourceDeleted';
512
- /**
513
- * `key` of the [Project](ctp:api:type:Project).
514
- * Useful for processing notifications if the Destination receives them from multiple Projects.
515
- *
516
- *
517
- */
518
- readonly projectKey: string;
519
- /**
520
- * Reference to the resource that triggered the notification.
521
- *
522
- *
523
- */
524
- readonly resource: Reference;
525
- /**
526
- * User-defined unique identifiers of the resource.
527
- *
528
- *
529
- */
530
- readonly resourceUserProvidedIdentifiers?: UserProvidedIdentifiers;
531
- /**
532
- * Last seen version of the resource.
533
- *
534
- *
535
- */
536
- readonly version: number;
537
- /**
538
- * Date and time (UTC) the resource was last deleted.
539
- *
540
- *
541
- */
542
- readonly modifiedAt: string;
543
- /**
544
- * `true` if the `dataErasure` [parameter](/../api/gdpr#data-erasure-of-personal-data) on the `DELETE` request was set to `true`.
545
- *
546
- *
547
- */
548
- readonly dataErasure?: boolean;
549
- }
550
- /**
551
- * This payload is sent for a [ChangeSubscription](ctp:api:type:ChangeSubscription) when a resource is updated. This includes updates by a background process, like a change in product availability.
552
- *
553
- */
554
- export interface ResourceUpdatedDeliveryPayload extends IDeliveryPayload {
555
- readonly notificationType: 'ResourceUpdated';
556
- /**
557
- * `key` of the [Project](ctp:api:type:Project).
558
- * Useful for processing notifications if the Destination receives them from multiple Projects.
559
- *
560
- *
561
- */
562
- readonly projectKey: string;
563
- /**
564
- * Reference to the resource that triggered the notification.
565
- *
566
- *
567
- */
568
- readonly resource: Reference;
569
- /**
570
- * User-defined unique identifiers of the resource.
571
- *
572
- *
573
- */
574
- readonly resourceUserProvidedIdentifiers?: UserProvidedIdentifiers;
575
- /**
576
- * Last seen version of the resource.
577
- *
578
- *
579
- */
580
- readonly version: number;
581
- /**
582
- * Version of the resource before the update.
583
- *
584
- *
585
- */
586
- readonly oldVersion: number;
587
- /**
588
- * Date and time (UTC) the resource was last updated.
589
- *
590
- *
591
- */
592
- readonly modifiedAt: string;
593
- }
594
408
  /**
595
409
  * [AWS SNS](https://aws.amazon.com/sns/) can be used to push messages to AWS Lambda, HTTP endpoints (webhooks), or fan-out messages to SQS queues. The SQS queue must be a [Standard](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/standard-queues.html) queue type.
596
410
  *
@@ -726,6 +540,12 @@ export interface Subscription extends BaseResource {
726
540
  *
727
541
  */
728
542
  readonly messages: MessageSubscription[];
543
+ /**
544
+ * Events subscribed to.
545
+ *
546
+ *
547
+ */
548
+ readonly events: EventSubscription[];
729
549
  /**
730
550
  * Format in which the payload is delivered.
731
551
  *
@@ -768,6 +588,12 @@ export interface SubscriptionDraft {
768
588
  *
769
589
  */
770
590
  readonly messages?: MessageSubscription[];
591
+ /**
592
+ * Events to be subscribed to.
593
+ *
594
+ *
595
+ */
596
+ readonly events?: EventSubscription[];
771
597
  /**
772
598
  * Format in which the payload is delivered. When not provided, the [PlatformFormat](ctp:api:type:PlatformFormat) is selected by default.
773
599
  *
@@ -786,18 +612,295 @@ export declare enum SubscriptionHealthStatusValues {
786
612
  ManuallySuspended = "ManuallySuspended",
787
613
  TemporaryError = "TemporaryError"
788
614
  }
789
- export type SubscriptionHealthStatus = 'ConfigurationError' | 'ConfigurationErrorDeliveryStopped' | 'Healthy' | 'ManuallySuspended' | 'TemporaryError' | string;
615
+ export type SubscriptionHealthStatus = 'ConfigurationError' | 'ConfigurationErrorDeliveryStopped' | 'Healthy' | 'ManuallySuspended' | 'TemporaryError' | (string & {});
790
616
  /**
791
- * [PagedQueryResult](/../api/general-concepts#pagedqueryresult) with `results` containing an array of [Subscription](ctp:api:type:Subscription).
617
+ * All payloads for the [PlatformFormat](ctp:api:type:PlatformFormat) share these common fields.
792
618
  *
793
619
  */
794
- export interface SubscriptionPagedQueryResponse {
620
+ export type SubscriptionNotification = DeliveryPayload | EventDeliveryPayload | MessageDeliveryPayload | ResourceCreatedDeliveryPayload | ResourceDeletedDeliveryPayload | ResourceUpdatedDeliveryPayload;
621
+ export interface ISubscriptionNotification {
795
622
  /**
796
- * Number of [results requested](/../api/general-concepts#limit).
623
+ * Identifies the payload.
797
624
  *
798
625
  *
799
626
  */
800
- readonly limit: number;
627
+ readonly notificationType: string;
628
+ }
629
+ /**
630
+ * All payloads for the [PlatformFormat](ctp:api:type:PlatformFormat) share these common fields.
631
+ *
632
+ */
633
+ export type DeliveryPayload = MessageDeliveryPayload | ResourceCreatedDeliveryPayload | ResourceDeletedDeliveryPayload | ResourceUpdatedDeliveryPayload;
634
+ export interface IDeliveryPayload {
635
+ /**
636
+ * Identifies the payload.
637
+ *
638
+ *
639
+ */
640
+ readonly notificationType: string;
641
+ /**
642
+ * `key` of the [Project](ctp:api:type:Project).
643
+ * Useful for processing notifications if the Destination receives them from multiple Projects.
644
+ *
645
+ *
646
+ */
647
+ readonly projectKey: string;
648
+ /**
649
+ * Reference to the resource that triggered the notification.
650
+ *
651
+ *
652
+ */
653
+ readonly resource: Reference;
654
+ /**
655
+ * User-defined unique identifiers of the resource.
656
+ *
657
+ *
658
+ */
659
+ readonly resourceUserProvidedIdentifiers?: UserProvidedIdentifiers;
660
+ }
661
+ /**
662
+ * This payload is sent for an [EventSubscription](ctp:api:type:EventSubscription).
663
+ *
664
+ */
665
+ export interface EventDeliveryPayload extends ISubscriptionNotification {
666
+ readonly notificationType: 'Event';
667
+ /**
668
+ * Unique identifier of the Event.
669
+ *
670
+ *
671
+ */
672
+ readonly id: string;
673
+ /**
674
+ * The type of Event that has occurred.
675
+ *
676
+ *
677
+ */
678
+ readonly type: EventType;
679
+ /**
680
+ * The type of resource targeted by the Event.
681
+ *
682
+ *
683
+ */
684
+ readonly resourceType: string;
685
+ /**
686
+ * The data describing the event that has taken place.
687
+ *
688
+ *
689
+ */
690
+ readonly data: any;
691
+ /**
692
+ * Date and time (UTC) the resource was initially created.
693
+ *
694
+ *
695
+ */
696
+ readonly createdAt: string;
697
+ }
698
+ /**
699
+ * This payload is sent for a [MessageSubscription](ctp:api:type:MessageSubscription).
700
+ *
701
+ */
702
+ export interface MessageDeliveryPayload extends IDeliveryPayload {
703
+ readonly notificationType: 'Message';
704
+ /**
705
+ * `key` of the [Project](ctp:api:type:Project).
706
+ * Useful for processing notifications if the Destination receives them from multiple Projects.
707
+ *
708
+ *
709
+ */
710
+ readonly projectKey: string;
711
+ /**
712
+ * Reference to the resource that triggered the notification.
713
+ *
714
+ *
715
+ */
716
+ readonly resource: Reference;
717
+ /**
718
+ * User-defined unique identifiers of the resource.
719
+ *
720
+ *
721
+ */
722
+ readonly resourceUserProvidedIdentifiers?: UserProvidedIdentifiers;
723
+ /**
724
+ * Unique ID of the message.
725
+ *
726
+ *
727
+ */
728
+ readonly id: string;
729
+ /**
730
+ * Last seen version of the resource.
731
+ *
732
+ *
733
+ */
734
+ readonly version: number;
735
+ /**
736
+ * Date and time (UTC) the resource was initially created.
737
+ *
738
+ *
739
+ */
740
+ readonly createdAt: string;
741
+ /**
742
+ * Date and time (UTC) the resource was last modified.
743
+ *
744
+ *
745
+ */
746
+ readonly lastModifiedAt: string;
747
+ /**
748
+ * Used to ensure all messages of the resource are processed in correct order.
749
+ * The `sequenceNumber` of the next message of the resource is a successor of the `sequenceNumber` of the current message.
750
+ *
751
+ *
752
+ */
753
+ readonly sequenceNumber: number;
754
+ /**
755
+ * Version of the resource on which the update was performed.
756
+ *
757
+ *
758
+ */
759
+ readonly resourceVersion: number;
760
+ /**
761
+ * If the payload does not fit into the size limit or its format is not accepted by the messaging service, the `payloadNotIncluded` field is present.
762
+ *
763
+ *
764
+ */
765
+ readonly payloadNotIncluded?: PayloadNotIncluded;
766
+ }
767
+ /**
768
+ * This payload is sent for a [ChangeSubscription](ctp:api:type:ChangeSubscription) when a resource is created.
769
+ *
770
+ */
771
+ export interface ResourceCreatedDeliveryPayload extends IDeliveryPayload {
772
+ readonly notificationType: 'ResourceCreated';
773
+ /**
774
+ * `key` of the [Project](ctp:api:type:Project).
775
+ * Useful for processing notifications if the Destination receives them from multiple Projects.
776
+ *
777
+ *
778
+ */
779
+ readonly projectKey: string;
780
+ /**
781
+ * Reference to the resource that triggered the notification.
782
+ *
783
+ *
784
+ */
785
+ readonly resource: Reference;
786
+ /**
787
+ * User-defined unique identifiers of the resource.
788
+ *
789
+ *
790
+ */
791
+ readonly resourceUserProvidedIdentifiers?: UserProvidedIdentifiers;
792
+ /**
793
+ * Last seen version of the resource.
794
+ *
795
+ *
796
+ */
797
+ readonly version: number;
798
+ /**
799
+ * Date and time (UTC) the resource was last modified.
800
+ *
801
+ *
802
+ */
803
+ readonly modifiedAt: string;
804
+ }
805
+ /**
806
+ * This payload is sent for a [ChangeSubscription](ctp:api:type:ChangeSubscription) when a resource is deleted.
807
+ *
808
+ */
809
+ export interface ResourceDeletedDeliveryPayload extends IDeliveryPayload {
810
+ readonly notificationType: 'ResourceDeleted';
811
+ /**
812
+ * `key` of the [Project](ctp:api:type:Project).
813
+ * Useful for processing notifications if the Destination receives them from multiple Projects.
814
+ *
815
+ *
816
+ */
817
+ readonly projectKey: string;
818
+ /**
819
+ * Reference to the resource that triggered the notification.
820
+ *
821
+ *
822
+ */
823
+ readonly resource: Reference;
824
+ /**
825
+ * User-defined unique identifiers of the resource.
826
+ *
827
+ *
828
+ */
829
+ readonly resourceUserProvidedIdentifiers?: UserProvidedIdentifiers;
830
+ /**
831
+ * Last seen version of the resource.
832
+ *
833
+ *
834
+ */
835
+ readonly version: number;
836
+ /**
837
+ * Date and time (UTC) the resource was last deleted.
838
+ *
839
+ *
840
+ */
841
+ readonly modifiedAt: string;
842
+ /**
843
+ * `true` if the `dataErasure` [parameter](/../api/gdpr#data-erasure-of-personal-data) on the `DELETE` request was set to `true`.
844
+ *
845
+ *
846
+ */
847
+ readonly dataErasure?: boolean;
848
+ }
849
+ /**
850
+ * This payload is sent for a [ChangeSubscription](ctp:api:type:ChangeSubscription) when a resource is updated. This includes updates by a background process, like a change in product availability.
851
+ *
852
+ */
853
+ export interface ResourceUpdatedDeliveryPayload extends IDeliveryPayload {
854
+ readonly notificationType: 'ResourceUpdated';
855
+ /**
856
+ * `key` of the [Project](ctp:api:type:Project).
857
+ * Useful for processing notifications if the Destination receives them from multiple Projects.
858
+ *
859
+ *
860
+ */
861
+ readonly projectKey: string;
862
+ /**
863
+ * Reference to the resource that triggered the notification.
864
+ *
865
+ *
866
+ */
867
+ readonly resource: Reference;
868
+ /**
869
+ * User-defined unique identifiers of the resource.
870
+ *
871
+ *
872
+ */
873
+ readonly resourceUserProvidedIdentifiers?: UserProvidedIdentifiers;
874
+ /**
875
+ * Last seen version of the resource.
876
+ *
877
+ *
878
+ */
879
+ readonly version: number;
880
+ /**
881
+ * Version of the resource before the update.
882
+ *
883
+ *
884
+ */
885
+ readonly oldVersion: number;
886
+ /**
887
+ * Date and time (UTC) the resource was last updated.
888
+ *
889
+ *
890
+ */
891
+ readonly modifiedAt: string;
892
+ }
893
+ /**
894
+ * [PagedQueryResult](/../api/general-concepts#pagedqueryresult) with `results` containing an array of [Subscription](ctp:api:type:Subscription).
895
+ *
896
+ */
897
+ export interface SubscriptionPagedQueryResponse {
898
+ /**
899
+ * Number of [results requested](/../api/general-concepts#limit).
900
+ *
901
+ *
902
+ */
903
+ readonly limit: number;
801
904
  /**
802
905
  * Number of [elements skipped](/../api/general-concepts#offset).
803
906
  *
@@ -842,7 +945,7 @@ export interface SubscriptionUpdate {
842
945
  */
843
946
  readonly actions: SubscriptionUpdateAction[];
844
947
  }
845
- export type SubscriptionUpdateAction = SubscriptionChangeDestinationAction | SubscriptionSetChangesAction | SubscriptionSetKeyAction | SubscriptionSetMessagesAction;
948
+ export type SubscriptionUpdateAction = SubscriptionChangeDestinationAction | SubscriptionSetChangesAction | SubscriptionSetEventsAction | SubscriptionSetKeyAction | SubscriptionSetMessagesAction;
846
949
  export interface ISubscriptionUpdateAction {
847
950
  /**
848
951
  *
@@ -865,12 +968,21 @@ export interface SubscriptionChangeDestinationAction extends ISubscriptionUpdate
865
968
  export interface SubscriptionSetChangesAction extends ISubscriptionUpdateAction {
866
969
  readonly action: 'setChanges';
867
970
  /**
868
- * Value to set. Can only be unset if `messages` is set.
971
+ * Value to set. Can only be unset if either `messages` or `events` is set.
869
972
  *
870
973
  *
871
974
  */
872
975
  readonly changes?: ChangeSubscription[];
873
976
  }
977
+ export interface SubscriptionSetEventsAction extends ISubscriptionUpdateAction {
978
+ readonly action: 'setEvents';
979
+ /**
980
+ * Value to set. Can only be unset if either `messages` or `changes` is set.
981
+ *
982
+ *
983
+ */
984
+ readonly messages?: EventSubscription[];
985
+ }
874
986
  export interface SubscriptionSetKeyAction extends ISubscriptionUpdateAction {
875
987
  readonly action: 'setKey';
876
988
  /**
@@ -883,7 +995,7 @@ export interface SubscriptionSetKeyAction extends ISubscriptionUpdateAction {
883
995
  export interface SubscriptionSetMessagesAction extends ISubscriptionUpdateAction {
884
996
  readonly action: 'setMessages';
885
997
  /**
886
- * Value to set. Can only be unset if `changes` is set.
998
+ * Value to set. Can only be unset if either `changes` or `events` is set.
887
999
  *
888
1000
  *
889
1001
  */