@gradientedge/commercetools-utils 6.6.0 → 6.7.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 (200) hide show
  1. package/dist/cjs/api/CommercetoolsApi.d.ts +1 -3
  2. package/dist/cjs/api/CommercetoolsApi.d.ts.map +1 -1
  3. package/dist/cjs/api/CommercetoolsApi.js.map +1 -1
  4. package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
  5. package/dist/cjs/types/models/business-unit.d.ts +18 -12
  6. package/dist/cjs/types/models/business-unit.d.ts.map +1 -1
  7. package/dist/cjs/types/models/cart-discount.d.ts +44 -10
  8. package/dist/cjs/types/models/cart-discount.d.ts.map +1 -1
  9. package/dist/cjs/types/models/cart-discount.js.map +1 -1
  10. package/dist/cjs/types/models/cart.d.ts +131 -103
  11. package/dist/cjs/types/models/cart.d.ts.map +1 -1
  12. package/dist/cjs/types/models/cart.js +5 -1
  13. package/dist/cjs/types/models/cart.js.map +1 -1
  14. package/dist/cjs/types/models/common.d.ts +19 -10
  15. package/dist/cjs/types/models/common.d.ts.map +1 -1
  16. package/dist/cjs/types/models/common.js +4 -0
  17. package/dist/cjs/types/models/common.js.map +1 -1
  18. package/dist/cjs/types/models/customer.d.ts +37 -13
  19. package/dist/cjs/types/models/customer.d.ts.map +1 -1
  20. package/dist/cjs/types/models/discount-group.d.ts +252 -0
  21. package/dist/cjs/types/models/discount-group.d.ts.map +1 -0
  22. package/dist/cjs/types/models/discount-group.js +8 -0
  23. package/dist/cjs/types/models/discount-group.js.map +1 -0
  24. package/dist/cjs/types/models/error.d.ts +68 -4
  25. package/dist/cjs/types/models/error.d.ts.map +1 -1
  26. package/dist/cjs/types/models/event.d.ts +405 -58
  27. package/dist/cjs/types/models/event.d.ts.map +1 -1
  28. package/dist/cjs/types/models/extension.d.ts +2 -1
  29. package/dist/cjs/types/models/extension.d.ts.map +1 -1
  30. package/dist/cjs/types/models/extension.js +1 -0
  31. package/dist/cjs/types/models/extension.js.map +1 -1
  32. package/dist/cjs/types/models/index.d.ts +4 -3
  33. package/dist/cjs/types/models/index.d.ts.map +1 -1
  34. package/dist/cjs/types/models/index.js +4 -3
  35. package/dist/cjs/types/models/index.js.map +1 -1
  36. package/dist/cjs/types/models/me.d.ts +135 -10
  37. package/dist/cjs/types/models/me.d.ts.map +1 -1
  38. package/dist/cjs/types/models/me.js.map +1 -1
  39. package/dist/cjs/types/models/message.d.ts +7118 -3267
  40. package/dist/cjs/types/models/message.d.ts.map +1 -1
  41. package/dist/cjs/types/models/order-edit.d.ts +29 -3
  42. package/dist/cjs/types/models/order-edit.d.ts.map +1 -1
  43. package/dist/cjs/types/models/order.d.ts +23 -9
  44. package/dist/cjs/types/models/order.d.ts.map +1 -1
  45. package/dist/cjs/types/models/order.js.map +1 -1
  46. package/dist/cjs/types/models/payment-method.d.ts +439 -0
  47. package/dist/cjs/types/models/payment-method.d.ts.map +1 -0
  48. package/dist/cjs/types/models/payment-method.js +14 -0
  49. package/dist/cjs/types/models/payment-method.js.map +1 -0
  50. package/dist/cjs/types/models/payment.d.ts +225 -8
  51. package/dist/cjs/types/models/payment.d.ts.map +1 -1
  52. package/dist/cjs/types/models/payment.js.map +1 -1
  53. package/dist/cjs/types/models/product-search.d.ts +77 -2
  54. package/dist/cjs/types/models/product-search.d.ts.map +1 -1
  55. package/dist/cjs/types/models/product-search.js.map +1 -1
  56. package/dist/cjs/types/models/product-tailoring.d.ts +54 -1
  57. package/dist/cjs/types/models/product-tailoring.d.ts.map +1 -1
  58. package/dist/cjs/types/models/product-type.d.ts +20 -2
  59. package/dist/cjs/types/models/product-type.d.ts.map +1 -1
  60. package/dist/cjs/types/models/product-type.js +6 -1
  61. package/dist/cjs/types/models/product-type.js.map +1 -1
  62. package/dist/cjs/types/models/product.d.ts +67 -16
  63. package/dist/cjs/types/models/product.d.ts.map +1 -1
  64. package/dist/cjs/types/models/product.js.map +1 -1
  65. package/dist/cjs/types/models/project.d.ts +35 -4
  66. package/dist/cjs/types/models/project.d.ts.map +1 -1
  67. package/dist/cjs/types/models/project.js.map +1 -1
  68. package/dist/cjs/types/models/quote-request.d.ts +6 -0
  69. package/dist/cjs/types/models/quote-request.d.ts.map +1 -1
  70. package/dist/cjs/types/models/quote-request.js.map +1 -1
  71. package/dist/cjs/types/models/quote.d.ts +6 -0
  72. package/dist/cjs/types/models/quote.d.ts.map +1 -1
  73. package/dist/cjs/types/models/quote.js.map +1 -1
  74. package/dist/cjs/types/models/recurrence-policy.d.ts +233 -71
  75. package/dist/cjs/types/models/recurrence-policy.d.ts.map +1 -1
  76. package/dist/cjs/types/models/recurrence-policy.js +14 -8
  77. package/dist/cjs/types/models/recurrence-policy.js.map +1 -1
  78. package/dist/cjs/types/models/recurring-order.d.ts +463 -103
  79. package/dist/cjs/types/models/recurring-order.d.ts.map +1 -1
  80. package/dist/cjs/types/models/recurring-order.js +23 -15
  81. package/dist/cjs/types/models/recurring-order.js.map +1 -1
  82. package/dist/cjs/types/models/search.d.ts +1 -1
  83. package/dist/cjs/types/models/search.d.ts.map +1 -1
  84. package/dist/cjs/types/models/shopping-list.d.ts +11 -4
  85. package/dist/cjs/types/models/shopping-list.d.ts.map +1 -1
  86. package/dist/cjs/types/models/standalone-price.d.ts +10 -8
  87. package/dist/cjs/types/models/standalone-price.d.ts.map +1 -1
  88. package/dist/cjs/types/models/state.d.ts +2 -1
  89. package/dist/cjs/types/models/state.d.ts.map +1 -1
  90. package/dist/cjs/types/models/state.js +1 -0
  91. package/dist/cjs/types/models/state.js.map +1 -1
  92. package/dist/cjs/types/models/subscription.d.ts +31 -19
  93. package/dist/cjs/types/models/subscription.d.ts.map +1 -1
  94. package/dist/cjs/types/models/subscription.js +12 -0
  95. package/dist/cjs/types/models/subscription.js.map +1 -1
  96. package/dist/cjs/types/models/type.d.ts +2 -1
  97. package/dist/cjs/types/models/type.d.ts.map +1 -1
  98. package/dist/cjs/types/models/type.js +1 -0
  99. package/dist/cjs/types/models/type.js.map +1 -1
  100. package/dist/mjs/api/CommercetoolsApi.d.ts +1 -3
  101. package/dist/mjs/api/CommercetoolsApi.d.ts.map +1 -1
  102. package/dist/mjs/api/CommercetoolsApi.js +1 -1
  103. package/dist/mjs/api/CommercetoolsApi.js.map +1 -1
  104. package/dist/mjs/tsconfig.tsbuildinfo +1 -1
  105. package/dist/mjs/types/models/business-unit.d.ts +18 -12
  106. package/dist/mjs/types/models/business-unit.d.ts.map +1 -1
  107. package/dist/mjs/types/models/cart-discount.d.ts +44 -10
  108. package/dist/mjs/types/models/cart-discount.d.ts.map +1 -1
  109. package/dist/mjs/types/models/cart-discount.js.map +1 -1
  110. package/dist/mjs/types/models/cart.d.ts +131 -103
  111. package/dist/mjs/types/models/cart.d.ts.map +1 -1
  112. package/dist/mjs/types/models/cart.js +5 -1
  113. package/dist/mjs/types/models/cart.js.map +1 -1
  114. package/dist/mjs/types/models/common.d.ts +19 -10
  115. package/dist/mjs/types/models/common.d.ts.map +1 -1
  116. package/dist/mjs/types/models/common.js +4 -0
  117. package/dist/mjs/types/models/common.js.map +1 -1
  118. package/dist/mjs/types/models/customer.d.ts +37 -13
  119. package/dist/mjs/types/models/customer.d.ts.map +1 -1
  120. package/dist/mjs/types/models/discount-group.d.ts +252 -0
  121. package/dist/mjs/types/models/discount-group.d.ts.map +1 -0
  122. package/dist/mjs/types/models/discount-group.js +7 -0
  123. package/dist/mjs/types/models/discount-group.js.map +1 -0
  124. package/dist/mjs/types/models/error.d.ts +68 -4
  125. package/dist/mjs/types/models/error.d.ts.map +1 -1
  126. package/dist/mjs/types/models/event.d.ts +405 -58
  127. package/dist/mjs/types/models/event.d.ts.map +1 -1
  128. package/dist/mjs/types/models/extension.d.ts +2 -1
  129. package/dist/mjs/types/models/extension.d.ts.map +1 -1
  130. package/dist/mjs/types/models/extension.js +1 -0
  131. package/dist/mjs/types/models/extension.js.map +1 -1
  132. package/dist/mjs/types/models/index.d.ts +4 -3
  133. package/dist/mjs/types/models/index.d.ts.map +1 -1
  134. package/dist/mjs/types/models/index.js +4 -3
  135. package/dist/mjs/types/models/index.js.map +1 -1
  136. package/dist/mjs/types/models/me.d.ts +135 -10
  137. package/dist/mjs/types/models/me.d.ts.map +1 -1
  138. package/dist/mjs/types/models/me.js.map +1 -1
  139. package/dist/mjs/types/models/message.d.ts +7118 -3267
  140. package/dist/mjs/types/models/message.d.ts.map +1 -1
  141. package/dist/mjs/types/models/order-edit.d.ts +29 -3
  142. package/dist/mjs/types/models/order-edit.d.ts.map +1 -1
  143. package/dist/mjs/types/models/order.d.ts +23 -9
  144. package/dist/mjs/types/models/order.d.ts.map +1 -1
  145. package/dist/mjs/types/models/order.js.map +1 -1
  146. package/dist/mjs/types/models/payment-method.d.ts +439 -0
  147. package/dist/mjs/types/models/payment-method.d.ts.map +1 -0
  148. package/dist/mjs/types/models/payment-method.js +11 -0
  149. package/dist/mjs/types/models/payment-method.js.map +1 -0
  150. package/dist/mjs/types/models/payment.d.ts +225 -8
  151. package/dist/mjs/types/models/payment.d.ts.map +1 -1
  152. package/dist/mjs/types/models/payment.js.map +1 -1
  153. package/dist/mjs/types/models/product-search.d.ts +77 -2
  154. package/dist/mjs/types/models/product-search.d.ts.map +1 -1
  155. package/dist/mjs/types/models/product-search.js.map +1 -1
  156. package/dist/mjs/types/models/product-tailoring.d.ts +54 -1
  157. package/dist/mjs/types/models/product-tailoring.d.ts.map +1 -1
  158. package/dist/mjs/types/models/product-type.d.ts +20 -2
  159. package/dist/mjs/types/models/product-type.d.ts.map +1 -1
  160. package/dist/mjs/types/models/product-type.js +5 -0
  161. package/dist/mjs/types/models/product-type.js.map +1 -1
  162. package/dist/mjs/types/models/product.d.ts +67 -16
  163. package/dist/mjs/types/models/product.d.ts.map +1 -1
  164. package/dist/mjs/types/models/product.js.map +1 -1
  165. package/dist/mjs/types/models/project.d.ts +35 -4
  166. package/dist/mjs/types/models/project.d.ts.map +1 -1
  167. package/dist/mjs/types/models/project.js.map +1 -1
  168. package/dist/mjs/types/models/quote-request.d.ts +6 -0
  169. package/dist/mjs/types/models/quote-request.d.ts.map +1 -1
  170. package/dist/mjs/types/models/quote-request.js.map +1 -1
  171. package/dist/mjs/types/models/quote.d.ts +6 -0
  172. package/dist/mjs/types/models/quote.d.ts.map +1 -1
  173. package/dist/mjs/types/models/quote.js.map +1 -1
  174. package/dist/mjs/types/models/recurrence-policy.d.ts +233 -71
  175. package/dist/mjs/types/models/recurrence-policy.d.ts.map +1 -1
  176. package/dist/mjs/types/models/recurrence-policy.js +13 -7
  177. package/dist/mjs/types/models/recurrence-policy.js.map +1 -1
  178. package/dist/mjs/types/models/recurring-order.d.ts +463 -103
  179. package/dist/mjs/types/models/recurring-order.d.ts.map +1 -1
  180. package/dist/mjs/types/models/recurring-order.js +22 -14
  181. package/dist/mjs/types/models/recurring-order.js.map +1 -1
  182. package/dist/mjs/types/models/search.d.ts +1 -1
  183. package/dist/mjs/types/models/search.d.ts.map +1 -1
  184. package/dist/mjs/types/models/shopping-list.d.ts +11 -4
  185. package/dist/mjs/types/models/shopping-list.d.ts.map +1 -1
  186. package/dist/mjs/types/models/standalone-price.d.ts +10 -8
  187. package/dist/mjs/types/models/standalone-price.d.ts.map +1 -1
  188. package/dist/mjs/types/models/state.d.ts +2 -1
  189. package/dist/mjs/types/models/state.d.ts.map +1 -1
  190. package/dist/mjs/types/models/state.js +1 -0
  191. package/dist/mjs/types/models/state.js.map +1 -1
  192. package/dist/mjs/types/models/subscription.d.ts +31 -19
  193. package/dist/mjs/types/models/subscription.d.ts.map +1 -1
  194. package/dist/mjs/types/models/subscription.js +12 -0
  195. package/dist/mjs/types/models/subscription.js.map +1 -1
  196. package/dist/mjs/types/models/type.d.ts +2 -1
  197. package/dist/mjs/types/models/type.d.ts.map +1 -1
  198. package/dist/mjs/types/models/type.js +1 -0
  199. package/dist/mjs/types/models/type.js.map +1 -1
  200. package/package.json +1 -1
@@ -1,263 +1,623 @@
1
- import { BaseResource, CreatedBy, IReference, IResourceIdentifier, LastModifiedBy } from './common.js';
1
+ /**
2
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
3
+ * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
4
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
5
+ */
6
+ import { BusinessUnitKeyReference } from './business-unit.js';
2
7
  import { CartReference, CartResourceIdentifier } from './cart.js';
8
+ import { BaseResource, CreatedBy, IReference, IResourceIdentifier, LastModifiedBy } from './common.js';
9
+ import { CustomerReference } from './customer.js';
3
10
  import { OrderReference } from './order.js';
4
- import { BusinessUnitKeyReference } from './business-unit.js';
11
+ import { RecurrencePolicyReference, RecurrencePolicyResourceIdentifier, RecurrencePolicySchedule } from './recurrence-policy.js';
5
12
  import { StateReference, StateResourceIdentifier } from './state.js';
6
- import { CustomerReference } from './customer.js';
13
+ import { StoreKeyReference } from './store.js';
7
14
  import { CustomFields, CustomFieldsDraft, FieldContainer, TypeResourceIdentifier } from './type.js';
8
- import { RecurrencePolicySchedule } from './recurrence-policy.js';
9
15
  /**
10
- * Represents a recurring order that automates the reordering process for a customer.
16
+ * Information about recurring orders and frequencies.
17
+ *
11
18
  */
19
+ export interface CustomLineItemRecurrenceInfo {
20
+ /**
21
+ * [Reference](ctp:api:type:Reference) to a RecurrencePolicy.
22
+ *
23
+ *
24
+ */
25
+ readonly recurrencePolicy: RecurrencePolicyReference;
26
+ }
27
+ /**
28
+ * Information about recurring orders and frequencies.
29
+ *
30
+ */
31
+ export interface CustomLineItemRecurrenceInfoDraft {
32
+ /**
33
+ * [ResourceIdentifier](ctp:api:type:ResourceIdentifier) to a RecurrencePolicy.
34
+ *
35
+ *
36
+ */
37
+ readonly recurrencePolicy: RecurrencePolicyResourceIdentifier;
38
+ }
39
+ /**
40
+ * Information about recurring orders and frequencies.
41
+ *
42
+ */
43
+ export interface LineItemRecurrenceInfo {
44
+ /**
45
+ * [Reference](ctp:api:type:Reference) to a RecurrencePolicy.
46
+ *
47
+ *
48
+ */
49
+ readonly recurrencePolicy: RecurrencePolicyReference;
50
+ /**
51
+ * Indicates how the price of a line item will be selected during order creation.
52
+ *
53
+ *
54
+ */
55
+ readonly priceSelectionMode: PriceSelectionMode;
56
+ }
57
+ /**
58
+ * Information about recurring orders and frequencies.
59
+ *
60
+ */
61
+ export interface LineItemRecurrenceInfoDraft {
62
+ /**
63
+ * [ResourceIdentifier](ctp:api:type:ResourceIdentifier) to a RecurrencePolicy.
64
+ *
65
+ *
66
+ */
67
+ readonly recurrencePolicy: RecurrencePolicyResourceIdentifier;
68
+ /**
69
+ * Determines how the price of a line item will be selected during order creation.
70
+ *
71
+ *
72
+ */
73
+ readonly priceSelectionMode: PriceSelectionMode;
74
+ }
75
+ /**
76
+ * Indicates how the price of a [Line Item](ctp:api:type:LineItem) or [Custom Line Item](ctp:api:type:CustomLineItem) is selected during Order creation.
77
+ *
78
+ */
79
+ export declare enum PriceSelectionModeValues {
80
+ Dynamic = "Dynamic",
81
+ Fixed = "Fixed"
82
+ }
83
+ export type PriceSelectionMode = 'Dynamic' | 'Fixed' | (string & {});
12
84
  export interface RecurringOrder extends BaseResource {
13
85
  /**
14
- * Unique identifier of the RecurringOrder.
86
+ * Unique identifier of the RecurringOrder.
87
+ *
88
+ *
15
89
  */
16
90
  readonly id: string;
17
91
  /**
18
- * Current version of the RecurringOrder.
92
+ * User-defined unique identifier of the RecurringOrder.
93
+ *
94
+ *
19
95
  */
20
- readonly version: number;
96
+ readonly key?: string;
21
97
  /**
22
- * User-defined unique identifier for the RecurringOrder.
98
+ * Current version of the RecurringOrder.
99
+ *
100
+ *
23
101
  */
24
- readonly key?: string;
102
+ readonly version: number;
25
103
  /**
26
- * Reference to the Cart for a RecurringOrder.
104
+ * [Reference](ctp:api:type:Reference) to the Cart for a RecurringOrder.
105
+ * The referenced Cart will have the `RecurringOrder` [CartOrigin](ctp:api:type:CartOrigin).
106
+ *
107
+ *
27
108
  */
28
109
  readonly cart: CartReference;
29
110
  /**
30
- * Reference to the Order that generated this RecurringOrder.
111
+ * [Reference](ctp:api:type:Reference) to the original [Order](ctp:api:type:Order) that generated this RecurringOrder.
112
+ *
113
+ *
31
114
  */
32
- readonly originOrder?: OrderReference;
115
+ readonly originOrder: OrderReference;
33
116
  /**
34
- * Date and time (UTC) the RecurringOrder starts creating new orders.
117
+ * Date and time (UTC) when the RecurringOrder starts creating new Orders.
118
+ *
119
+ *
35
120
  */
36
121
  readonly startsAt: string;
37
122
  /**
38
- * Date and time (UTC) the RecurringOrder resumes subsequent order creation after it is unpaused.
123
+ * Date and time (UTC) when the RecurringOrder resumes creating Orders after being unpaused.
124
+ *
125
+ *
39
126
  */
40
127
  readonly resumesAt?: string;
41
128
  /**
42
- * Date and time (UTC) the RecurringOrder expires.
129
+ * Date and time (UTC) when the RecurringOrder expires.
130
+ *
131
+ *
43
132
  */
44
133
  readonly expiresAt?: string;
45
134
  /**
46
- * Date and time (UTC) when the last order was created from this RecurringOrder.
135
+ * Date and time (UTC) when the last Order was created from this RecurringOrder.
136
+ *
137
+ *
47
138
  */
48
139
  readonly lastOrderAt?: string;
49
140
  /**
50
- * Date and time (UTC) when the next order will be created from this RecurringOrder.
141
+ * Date and time (UTC) when the next Order will be created from this RecurringOrder.
142
+ *
143
+ *
51
144
  */
52
145
  readonly nextOrderAt?: string;
53
146
  /**
54
- * Information about current and future skips of this RecurringOrder.
147
+ * Information about current and future skips for this RecurringOrder.
148
+ *
149
+ *
55
150
  */
56
151
  readonly skipConfiguration?: SkipConfiguration;
57
152
  /**
58
- * Reference to a Business Unit the RecurringOrder belongs to.
153
+ * [Reference](ctp:api:type:Reference) to a Store.
154
+ *
155
+ *
156
+ */
157
+ readonly store?: StoreKeyReference;
158
+ /**
159
+ * [Reference](ctp:api:type:Reference) to the Business Unit that the RecurringOrder belongs to.
160
+ *
161
+ *
59
162
  */
60
163
  readonly businessUnit?: BusinessUnitKeyReference;
61
164
  /**
62
- * State of the RecurringOrder in a custom workflow.
165
+ * [State](ctp:api:type:State) of the RecurringOrder in a custom workflow.
166
+ *
167
+ *
63
168
  */
64
169
  readonly state?: StateReference;
65
170
  /**
66
- * Current state of the RecurringOrder.
171
+ * Current state of the RecurringOrder.
172
+ *
173
+ *
67
174
  */
68
175
  readonly recurringOrderState: RecurringOrderState;
69
176
  /**
70
- * Schedule of the RecurringOrder.
177
+ * Schedule of the RecurringOrder.
178
+ *
179
+ *
71
180
  */
72
181
  readonly schedule: RecurrencePolicySchedule;
73
182
  /**
74
- * The Customer that the RecurringOrder belongs to.
183
+ * The [Customer](ctp:api:type:Customer) that the RecurringOrder belongs to.
184
+ *
185
+ *
75
186
  */
76
187
  readonly customer?: CustomerReference;
77
188
  /**
78
- * Email address of the Customer that the RecurringOrder belongs to.
189
+ * Email address of the Customer that the RecurringOrder belongs to.
190
+ *
191
+ *
79
192
  */
80
193
  readonly customerEmail?: string;
81
194
  /**
82
- * Custom Fields of the RecurringOrder.
195
+ * Custom Fields of the RecurringOrder.
196
+ *
197
+ *
83
198
  */
84
199
  readonly custom?: CustomFields;
85
200
  /**
86
- * IDs and references that created the RecurringOrder.
201
+ * Date and time (UTC) when the RecurringOrder was created.
202
+ *
203
+ *
87
204
  */
88
- readonly createdBy?: CreatedBy;
205
+ readonly createdAt: string;
206
+ /**
207
+ * Date and time (UTC) when the RecurringOrder was last updated.
208
+ *
209
+ *
210
+ */
211
+ readonly lastModifiedAt: string;
89
212
  /**
90
- * IDs and references that last modified the RecurringOrder.
213
+ * IDs and references that last modified the RecurringOrder.
214
+ *
215
+ *
91
216
  */
92
217
  readonly lastModifiedBy?: LastModifiedBy;
218
+ /**
219
+ * IDs and references that created the RecurringOrder.
220
+ *
221
+ *
222
+ */
223
+ readonly createdBy?: CreatedBy;
93
224
  }
94
225
  /**
95
- * Draft for creating a RecurringOrder.
226
+ * Recurring Orders are automatically assigned the Store and/or Business Unit from the associated Cart.
227
+ *
96
228
  */
97
229
  export interface RecurringOrderDraft {
98
230
  /**
99
- * User-defined unique identifier of the RecurringOrder.
231
+ * User-defined unique identifier of the [RecurringOrder](ctp:api:type:RecurringOrder).
232
+ *
233
+ *
100
234
  */
101
- key?: string;
235
+ readonly key?: string;
102
236
  /**
103
- * ResourceIdentifier to the Cart from which the RecurringOrder is created.
237
+ * [ResourceIdentifier](ctp:api:type:ResourceIdentifier) to the Cart from which the RecurringOrder is created.
238
+ *
239
+ *
104
240
  */
105
- cart: CartResourceIdentifier;
241
+ readonly cart: CartResourceIdentifier;
106
242
  /**
107
- * Current version of the referenced Cart.
243
+ * Current version of the referenced [Cart](ctp:api:type:Cart).
244
+ *
245
+ *
108
246
  */
109
- cartVersion: number;
247
+ readonly cartVersion: number;
110
248
  /**
111
- * Date and time (UTC) the RecurringOrder will start.
249
+ * Date and time (UTC) when the RecurringOrder will start.
250
+ *
251
+ *
112
252
  */
113
- startsAt: string;
253
+ readonly startsAt: string;
114
254
  /**
115
- * State for the RecurringOrder in a custom workflow.
255
+ * State for the RecurringOrder in a custom workflow.
256
+ *
257
+ *
116
258
  */
117
- state?: StateResourceIdentifier;
259
+ readonly state?: StateResourceIdentifier;
118
260
  /**
119
- * Custom Fields to be added to the RecurringOrder.
261
+ * Custom Fields for the RecurringOrder.
262
+ *
263
+ *
120
264
  */
121
- custom?: CustomFieldsDraft;
265
+ readonly custom?: CustomFieldsDraft;
122
266
  }
123
267
  /**
124
- * Response containing a paged list of RecurringOrders.
268
+ * [PagedQueryResult](/../api/general-concepts#pagedqueryresult) with `results` containing an array of [RecurringOrder](ctp:api:type:RecurringOrder).
269
+ *
125
270
  */
126
271
  export interface RecurringOrderPagedQueryResponse {
127
272
  /**
128
- * Number of results requested.
273
+ * Number of [results requested](/../api/general-concepts#limit).
274
+ *
275
+ *
129
276
  */
130
- limit: number;
277
+ readonly limit: number;
131
278
  /**
132
- * Number of elements skipped.
279
+ * Number of [elements skipped](/../api/general-concepts#offset).
280
+ *
281
+ *
133
282
  */
134
- offset: number;
283
+ readonly offset: number;
135
284
  /**
136
- * Actual number of results returned.
285
+ * Actual number of results returned.
286
+ *
287
+ *
137
288
  */
138
- count: number;
289
+ readonly count: number;
139
290
  /**
140
- * Total number of results matching the query.
291
+ * Total number of results matching the query.
292
+ * This number is an estimation that is not [strongly consistent](/../api/general-concepts#strong-consistency).
293
+ * This field is returned by default.
294
+ * For improved performance, calculating this field can be deactivated by using the query parameter `withTotal=false`.
295
+ * When the results are filtered with a [Query Predicate](/../api/predicates/query), `total` is subject to a [limit](/../api/limits#queries).
296
+ *
297
+ *
141
298
  */
142
- total?: number;
299
+ readonly total?: number;
143
300
  /**
144
- * RecurringOrders matching the query.
301
+ * [RecurringOrders](ctp:api:type:RecurringOrder) matching the query.
302
+ *
303
+ *
145
304
  */
146
- results: RecurringOrder[];
305
+ readonly results: RecurringOrder[];
147
306
  }
148
307
  /**
149
- * Reference to a RecurringOrder.
308
+ * [Reference](ctp:api:type:Reference) to a [RecurringOrder](ctp:api:type:RecurringOrder).
309
+ *
150
310
  */
151
311
  export interface RecurringOrderReference extends IReference {
152
312
  readonly typeId: 'recurring-order';
313
+ /**
314
+ * Unique identifier of the referenced [RecurringOrder](ctp:api:type:RecurringOrder).
315
+ *
316
+ *
317
+ */
318
+ readonly id: string;
319
+ /**
320
+ * Contains the representation of the expanded RecurringOrder.
321
+ * Only present in responses to requests with [Reference Expansion](/../api/general-concepts#reference-expansion) for RecurringOrders.
322
+ *
323
+ *
324
+ */
153
325
  readonly obj?: RecurringOrder;
154
326
  }
155
327
  /**
156
- * ResourceIdentifier to a RecurringOrder.
328
+ * [ResourceIdentifier](ctp:api:type:ResourceIdentifier) to a [RecurringOrder](ctp:api:type:RecurringOrder). Either `id` or `key` is required. If both are set, an [InvalidJsonInput](/../api/errors#invalidjsoninput) error is returned.
329
+ *
157
330
  */
158
331
  export interface RecurringOrderResourceIdentifier extends IResourceIdentifier {
159
332
  readonly typeId: 'recurring-order';
333
+ /**
334
+ * Unique identifier of the referenced [RecurringOrder](ctp:api:type:RecurringOrder). Required if `key` is absent.
335
+ *
336
+ *
337
+ */
160
338
  readonly id?: string;
339
+ /**
340
+ * User-defined unique identifier of the referenced [RecurringOrder](ctp:api:type:RecurringOrder). Required if `id` is absent.
341
+ *
342
+ *
343
+ */
161
344
  readonly key?: string;
162
345
  }
163
346
  /**
164
- * States of a RecurringOrder.
347
+ * Indicates the state of the [RecurringOrder](ctp:api:type:RecurringOrder).
348
+ *
165
349
  */
166
- export declare enum RecurringOrderState {
350
+ export declare enum RecurringOrderStateValues {
167
351
  Active = "Active",
168
- Paused = "Paused",
352
+ Canceled = "Canceled",
169
353
  Expired = "Expired",
170
- Canceled = "Canceled"
354
+ Failed = "Failed",
355
+ Paused = "Paused"
356
+ }
357
+ export type RecurringOrderState = 'Active' | 'Canceled' | 'Expired' | 'Failed' | 'Paused' | (string & {});
358
+ /**
359
+ * Defines the new state for the Recurring Order—for possible values, see [RecurringOrderActive](ctp:api:type:RecurringOrderActive), [RecurringOrderPaused](ctp:api:type:RecurringOrderPaused), [RecurringOrderExpired](ctp:api:type:RecurringOrderExpired), and [RecurringOrderCanceled](ctp:api:type:RecurringOrderCanceled).
360
+ *
361
+ */
362
+ export type RecurringOrderStateDraft = RecurringOrderActive | RecurringOrderCanceled | RecurringOrderExpired | RecurringOrderPaused;
363
+ export interface IRecurringOrderStateDraft {
364
+ /**
365
+ *
366
+ */
367
+ readonly type: string;
368
+ }
369
+ /**
370
+ * Changes the Recurring Order state to active.
371
+ *
372
+ */
373
+ export interface RecurringOrderActive extends IRecurringOrderStateDraft {
374
+ readonly type: 'active';
375
+ /**
376
+ * If set, the Recurring Order will automatically resume at the date and time (UTC) specified.
377
+ *
378
+ *
379
+ */
380
+ readonly resumesAt?: string;
381
+ }
382
+ /**
383
+ * Changes the Recurring Order state to canceled.
384
+ *
385
+ */
386
+ export interface RecurringOrderCanceled extends IRecurringOrderStateDraft {
387
+ readonly type: 'canceled';
388
+ /**
389
+ * The reason for the cancelation.
390
+ *
391
+ *
392
+ */
393
+ readonly reason?: string;
394
+ }
395
+ /**
396
+ * Changes the Recurring Order state to expired.
397
+ *
398
+ */
399
+ export interface RecurringOrderExpired extends IRecurringOrderStateDraft {
400
+ readonly type: 'expired';
171
401
  }
172
402
  /**
173
- * Defines how the next orders are going to be skipped.
403
+ * Changes the Recurring Order state to paused.
404
+ *
174
405
  */
175
- export interface SkipConfiguration {
406
+ export interface RecurringOrderPaused extends IRecurringOrderStateDraft {
407
+ readonly type: 'paused';
408
+ }
409
+ export interface RecurringOrderUpdate {
410
+ /**
411
+ * Expected version of the RecurringOrder on which the changes should be applied.
412
+ * If the expected version does not match the actual version, a [ConcurrentModification](ctp:api:type:ConcurrentModificationError) error will be returned.
413
+ *
414
+ *
415
+ */
416
+ readonly version: number;
176
417
  /**
177
- * Type of skip configuration.
418
+ * Update actions to be performed on the RecurringOrder.
419
+ *
420
+ *
178
421
  */
422
+ readonly actions: RecurringOrderUpdateAction[];
423
+ }
424
+ export type RecurringOrderUpdateAction = RecurringOrderSetCustomFieldAction | RecurringOrderSetCustomTypeAction | RecurringOrderSetKeyAction | RecurringOrderSetOrderSkipConfigurationAction | RecurringOrderSetScheduleAction | RecurringOrderSetStartsAtAction | RecurringOrderSetStateAction | RecurringOrderTransitionStateAction;
425
+ export interface IRecurringOrderUpdateAction {
426
+ /**
427
+ *
428
+ */
429
+ readonly action: string;
430
+ }
431
+ /**
432
+ * Defines how the next orders are going to be skipped.
433
+ *
434
+ */
435
+ export type SkipConfiguration = Counter;
436
+ export interface ISkipConfiguration {
437
+ /**
438
+ *
439
+ */
440
+ readonly type: string;
441
+ }
442
+ /**
443
+ * Configuration to track skips for a [RecurringOrder](ctp:api:type:RecurringOrder).
444
+ *
445
+ */
446
+ export interface Counter extends ISkipConfiguration {
179
447
  readonly type: 'counter';
180
448
  /**
181
- * Amount of orders that are going to be skipped.
449
+ * Number of Orders that will be skipped.
450
+ *
451
+ *
182
452
  */
183
453
  readonly totalToSkip: number;
184
454
  /**
185
- * Amount of orders that were already skipped.
455
+ * Number of Orders that were already skipped.
456
+ *
457
+ *
186
458
  */
187
459
  readonly skipped: number;
188
460
  /**
189
- * Date and time (UTC) when the last order creation was skipped.
461
+ * Date and time (UTC) when the last Order creation was skipped.
462
+ *
463
+ *
190
464
  */
191
465
  readonly lastSkippedAt?: string;
192
466
  }
193
467
  /**
194
- * Configuration that uses a counter to track the amount of orders that will be skipped.
468
+ * Defines how the next orders are going to be skipped.
469
+ *
195
470
  */
196
- export interface SkipConfigurationDraft {
471
+ export type SkipConfigurationDraft = CounterDraft;
472
+ export interface ISkipConfigurationDraft {
197
473
  /**
198
- * Type of skip configuration.
474
+ *
199
475
  */
476
+ readonly type: string;
477
+ }
478
+ /**
479
+ * Configuration that uses a counter to track the number of Orders that will be skipped.
480
+ *
481
+ */
482
+ export interface CounterDraft extends ISkipConfigurationDraft {
200
483
  readonly type: 'counter';
201
484
  /**
202
- * Amount of orders that are going to be skipped.
485
+ * Number of Orders that will be skipped.
486
+ *
487
+ *
203
488
  */
204
489
  readonly totalToSkip: number;
205
490
  }
206
491
  /**
207
- * Modes for selecting the price of a line item during order creation.
492
+ * Adding a Custom Field to a Recurring Order generates the [RecurringOrderCustomFieldAdded](ctp:api:type:RecurringOrderCustomFieldAddedMessage) Message, removing one generates the [RecurringOrderCustomFieldRemoved](ctp:api:type:RecurringOrderCustomFieldRemovedMessage) Message, and updating an existing one generates the [RecurringOrderCustomFieldChanged](ctp:api:type:RecurringOrderCustomFieldChangedMessage) Message.
493
+ *
208
494
  */
209
- export declare enum PriceSelectionMode {
210
- Fixed = "Fixed",
211
- Dynamic = "Dynamic"
495
+ export interface RecurringOrderSetCustomFieldAction extends IRecurringOrderUpdateAction {
496
+ readonly action: 'setCustomField';
497
+ /**
498
+ * Name of the [Custom Field](/../api/projects/custom-fields).
499
+ *
500
+ *
501
+ */
502
+ readonly name: string;
503
+ /**
504
+ * If `value` is absent or `null`, this field will be removed if it exists.
505
+ * Removing a field that does not exist returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
506
+ * If `value` is provided, it is set for the field defined by `name`.
507
+ *
508
+ *
509
+ */
510
+ readonly value?: any;
212
511
  }
213
512
  /**
214
- * Update action for RecurringOrder.
513
+ * Adding or updating a Custom Type on a Recurring Order generates the [RecurringOrderCustomTypeSet](ctp:api:type:RecurringOrderCustomTypeSetMessage) Message, removing one generates the [RecurringOrderCustomTypeRemoved](ctp:api:type:RecurringOrderCustomTypeRemovedMessage) Message.
514
+ *
215
515
  */
216
- export type RecurringOrderUpdateAction = RecurringOrderSetKeyAction | RecurringOrderTransitionStateAction | RecurringOrderSetRecurringOrderStateAction | RecurringOrderSetCustomFieldAction | RecurringOrderSetCustomTypeAction | RecurringOrderSetSkipConfigurationAction;
516
+ export interface RecurringOrderSetCustomTypeAction extends IRecurringOrderUpdateAction {
517
+ readonly action: 'setCustomType';
518
+ /**
519
+ * Defines the [Type](ctp:api:type:Type) that extends the RecurringOrder with [Custom Fields](/../api/projects/custom-fields).
520
+ * If absent, any existing Type and Custom Fields are removed from the RecurringOrder.
521
+ *
522
+ *
523
+ */
524
+ readonly type?: TypeResourceIdentifier;
525
+ /**
526
+ * Sets the [Custom Fields](/../api/projects/custom-fields) fields for the RecurringOrder.
527
+ *
528
+ *
529
+ */
530
+ readonly fields?: FieldContainer;
531
+ }
217
532
  /**
218
- * Update action to set the key of a RecurringOrder.
533
+ * This update action generates the [RecurringOrderKeySet](ctp:api:type:RecurringOrderKeySetMessage) Message.
534
+ *
219
535
  */
220
- export interface RecurringOrderSetKeyAction {
536
+ export interface RecurringOrderSetKeyAction extends IRecurringOrderUpdateAction {
221
537
  readonly action: 'setKey';
538
+ /**
539
+ * Value to set.
540
+ * If empty, any existing key will be removed.
541
+ *
542
+ *
543
+ */
222
544
  readonly key?: string;
223
545
  }
224
- /**
225
- * Update action to transition the state of a RecurringOrder.
226
- */
227
- export interface RecurringOrderTransitionStateAction {
228
- readonly action: 'transitionState';
229
- readonly state: StateResourceIdentifier;
230
- readonly force?: boolean;
546
+ export interface RecurringOrderSetOrderSkipConfigurationAction extends IRecurringOrderUpdateAction {
547
+ readonly action: 'setOrderSkipConfiguration';
548
+ /**
549
+ * Configuration for skipping the next orders of the [Recurring Order](ctp:api:type:RecurringOrder).
550
+ *
551
+ *
552
+ */
553
+ readonly skipConfiguration?: SkipConfigurationDraft;
554
+ /**
555
+ * Date and time (UTC) the Recurring Order will resume and start to generate new orders.
556
+ *
557
+ *
558
+ */
559
+ readonly updatedExpiresAt?: string;
231
560
  }
232
561
  /**
233
- * Update action to set the RecurringOrderState.
562
+ * To set the [schedule](ctp:api:type:RecurrencePolicySchedule), the [Recurring Order](ctp:api:type:RecurringOrder) must be active, with no active [Skip Configuration](ctp:api:type:SkipConfiguration) and with available prices for all Cart items for the new schedule.
563
+ * Setting the schedule generates the [RecurringOrderScheduleSet](ctp:api:type:RecurringOrderScheduleSetMessage) Message.
564
+ *
234
565
  */
235
- export interface RecurringOrderSetRecurringOrderStateAction {
236
- readonly action: 'setRecurringOrderState';
237
- readonly recurringOrderState: RecurringOrderState;
566
+ export interface RecurringOrderSetScheduleAction extends IRecurringOrderUpdateAction {
567
+ readonly action: 'setSchedule';
568
+ /**
569
+ * Value to set.
570
+ *
571
+ */
572
+ readonly recurrencePolicy: RecurrencePolicyResourceIdentifier;
238
573
  }
239
574
  /**
240
- * Update action to set a custom field.
575
+ * To set the start date and time, the [Recurring Order](ctp:api:type:RecurringOrder) must not have been started yet.
576
+ * Setting the start date and time generates the [RecurringOrderStartsAtSet](ctp:api:type:RecurringOrderStartsAtSetMessage) Message.
577
+ *
241
578
  */
242
- export interface RecurringOrderSetCustomFieldAction {
243
- readonly action: 'setCustomField';
244
- readonly name: string;
245
- readonly value?: any;
579
+ export interface RecurringOrderSetStartsAtAction extends IRecurringOrderUpdateAction {
580
+ readonly action: 'setStartsAt';
581
+ /**
582
+ * Date and time (UTC) the [Recurring Order](ctp:api:type:RecurringOrder) should be started. The date and time must be in the future.
583
+ *
584
+ */
585
+ readonly startsAt: string;
246
586
  }
247
587
  /**
248
- * Update action to set the custom type and fields.
588
+ * Setting the [RecurringOrderState](ctp:api:type:RecurringOrderState) generates the [RecurringOrderStateChanged](ctp:api:type:RecurringOrderStateChangedMessage) Message.
589
+ *
249
590
  */
250
- export interface RecurringOrderSetCustomTypeAction {
251
- readonly action: 'setCustomType';
252
- readonly type?: TypeResourceIdentifier;
253
- readonly fields?: FieldContainer;
591
+ export interface RecurringOrderSetStateAction extends IRecurringOrderUpdateAction {
592
+ readonly action: 'setRecurringOrderState';
593
+ /**
594
+ * New state of the RecurringOrder.
595
+ *
596
+ *
597
+ */
598
+ readonly recurringOrderState: RecurringOrderStateDraft;
254
599
  }
255
600
  /**
256
- * Update action to set the skip configuration.
601
+ * If the existing [State](ctp:api:type:State) has set `transitions`, there must be a direct transition to the new State.
602
+ * If `transitions` is not set, no validation is performed.
603
+ *
604
+ * This update action produces the [Recurring Order State Transition](ctp:api:type:RecurringOrderStateTransitionMessage) Message.
605
+ *
257
606
  */
258
- export interface RecurringOrderSetSkipConfigurationAction {
259
- readonly action: 'setOrderSkipConfiguration';
260
- readonly skipConfiguration: SkipConfigurationDraft;
261
- readonly updatedExpiresAt?: string;
607
+ export interface RecurringOrderTransitionStateAction extends IRecurringOrderUpdateAction {
608
+ readonly action: 'transitionState';
609
+ /**
610
+ * Value to set.
611
+ * If there is no State yet, the new State must be an initial State.
612
+ *
613
+ *
614
+ */
615
+ readonly state: StateResourceIdentifier;
616
+ /**
617
+ * Set to `true` to turn off validation.
618
+ *
619
+ *
620
+ */
621
+ readonly force?: boolean;
262
622
  }
263
623
  //# sourceMappingURL=recurring-order.d.ts.map