@wix/auto_sdk_benefit-programs_pool-definition-items 1.0.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 (52) hide show
  1. package/build/cjs/index.d.ts +25 -0
  2. package/build/cjs/index.js +203 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +543 -0
  5. package/build/cjs/index.typings.js +180 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +507 -0
  8. package/build/cjs/meta.js +154 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/schemas.d.ts +26 -0
  11. package/build/cjs/schemas.js +87 -0
  12. package/build/cjs/schemas.js.map +1 -0
  13. package/build/es/index.d.mts +25 -0
  14. package/build/es/index.mjs +172 -0
  15. package/build/es/index.mjs.map +1 -0
  16. package/build/es/index.typings.d.mts +543 -0
  17. package/build/es/index.typings.mjs +149 -0
  18. package/build/es/index.typings.mjs.map +1 -0
  19. package/build/es/meta.d.mts +507 -0
  20. package/build/es/meta.mjs +123 -0
  21. package/build/es/meta.mjs.map +1 -0
  22. package/build/es/package.json +3 -0
  23. package/build/es/schemas.d.mts +26 -0
  24. package/build/es/schemas.mjs +47 -0
  25. package/build/es/schemas.mjs.map +1 -0
  26. package/build/internal/cjs/index.d.ts +25 -0
  27. package/build/internal/cjs/index.js +203 -0
  28. package/build/internal/cjs/index.js.map +1 -0
  29. package/build/internal/cjs/index.typings.d.ts +574 -0
  30. package/build/internal/cjs/index.typings.js +180 -0
  31. package/build/internal/cjs/index.typings.js.map +1 -0
  32. package/build/internal/cjs/meta.d.ts +507 -0
  33. package/build/internal/cjs/meta.js +154 -0
  34. package/build/internal/cjs/meta.js.map +1 -0
  35. package/build/internal/cjs/schemas.d.ts +26 -0
  36. package/build/internal/cjs/schemas.js +87 -0
  37. package/build/internal/cjs/schemas.js.map +1 -0
  38. package/build/internal/es/index.d.mts +25 -0
  39. package/build/internal/es/index.mjs +172 -0
  40. package/build/internal/es/index.mjs.map +1 -0
  41. package/build/internal/es/index.typings.d.mts +574 -0
  42. package/build/internal/es/index.typings.mjs +149 -0
  43. package/build/internal/es/index.typings.mjs.map +1 -0
  44. package/build/internal/es/meta.d.mts +507 -0
  45. package/build/internal/es/meta.mjs +123 -0
  46. package/build/internal/es/meta.mjs.map +1 -0
  47. package/build/internal/es/schemas.d.mts +26 -0
  48. package/build/internal/es/schemas.mjs +47 -0
  49. package/build/internal/es/schemas.mjs.map +1 -0
  50. package/meta/package.json +3 -0
  51. package/package.json +61 -0
  52. package/schemas/package.json +3 -0
@@ -0,0 +1,543 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
3
+ interface PoolDefinitionItem {
4
+ /**
5
+ * Benefit item ID.
6
+ * @format GUID
7
+ * @readonly
8
+ */
9
+ _id?: string;
10
+ /**
11
+ * Revision number, which increments by 1 each time the benefit item is updated.
12
+ * To prevent conflicting changes, the current revision must be passed when updating the item.
13
+ *
14
+ * Ignored when creating an item.
15
+ * @readonly
16
+ */
17
+ revision?: string | null;
18
+ /**
19
+ * Date and time the item was created.
20
+ * @readonly
21
+ */
22
+ _createdDate?: Date | null;
23
+ /**
24
+ * Date and time the item was updated.
25
+ * @readonly
26
+ */
27
+ _updatedDate?: Date | null;
28
+ /**
29
+ * External item ID assigned by the provider of the items.
30
+ *
31
+ * For example, if the benefit items are products, this ID corresponds to the specific product ID in the supplier's system.
32
+ * @format GUID
33
+ * @immutable
34
+ * @readonly
35
+ */
36
+ externalId?: string;
37
+ /**
38
+ * Item category. Groups benefit items together for organization and management purposes. For example, classes, posts, groups.
39
+ * @maxLength 20
40
+ * @immutable
41
+ * @readonly
42
+ */
43
+ category?: string;
44
+ /**
45
+ * ID of the application providing the benefit item.
46
+ *
47
+ * ID of the external application supplying the items. Each item's external ID is unique to its respective provider's application.
48
+ * @format GUID
49
+ * @immutable
50
+ * @readonly
51
+ */
52
+ providerAppId?: string;
53
+ /**
54
+ * Module name of the item provider's application that originated the items.
55
+ *
56
+ * For example, `store-inventory` or `fitness-resources`.
57
+ * @minLength 1
58
+ * @maxLength 20
59
+ * @immutable
60
+ * @readonly
61
+ */
62
+ namespace?: string;
63
+ /**
64
+ * Pool definition id
65
+ * @format GUID
66
+ * @immutable
67
+ * @readonly
68
+ */
69
+ poolDefinitionId?: string;
70
+ /**
71
+ * Item set ID.
72
+ * @format GUID
73
+ * @immutable
74
+ * @readonly
75
+ */
76
+ itemSetId?: string;
77
+ /**
78
+ * Item set ID.
79
+ * @format GUID
80
+ * @immutable
81
+ * @readonly
82
+ */
83
+ itemId?: string;
84
+ /**
85
+ * Unique identifier for the benefit associated with this item.
86
+ * @maxLength 64
87
+ * @immutable
88
+ * @readonly
89
+ */
90
+ benefitKey?: string;
91
+ }
92
+ interface PoolDefinitionInfo {
93
+ /**
94
+ * Pool definition name.
95
+ * @maxLength 64
96
+ */
97
+ displayName?: string;
98
+ /**
99
+ * Pool definition description.
100
+ * @maxLength 450
101
+ */
102
+ description?: string | null;
103
+ /**
104
+ * Credit settings.
105
+ *
106
+ * If this object is empty, you can't set a price for the benefit.
107
+ */
108
+ creditConfiguration?: CreditConfiguration;
109
+ }
110
+ interface CreditConfiguration {
111
+ /**
112
+ * Initial available amount for associated balances.
113
+ * @decimalValue options { gte:0, maxScale:4 }
114
+ */
115
+ amount?: string;
116
+ /**
117
+ * Credit unit display name.
118
+ * @maxLength 32
119
+ */
120
+ unitDisplayName?: string | null;
121
+ }
122
+ interface ProgramDefinitionInfo {
123
+ /**
124
+ * Program definition id
125
+ * @format GUID
126
+ */
127
+ _id?: string;
128
+ /**
129
+ * Program definition external id
130
+ * @format GUID
131
+ */
132
+ externalId?: string | null;
133
+ /**
134
+ * Program definition name
135
+ * @maxLength 64
136
+ */
137
+ displayName?: string | null;
138
+ /**
139
+ * Program definition description.
140
+ * @maxLength 450
141
+ */
142
+ description?: string | null;
143
+ }
144
+ interface BenefitInfo {
145
+ /**
146
+ * Price of the benefit in credits. The price is the same for all of this benefit's items.
147
+ * @decimalValue options { gte:0, maxScale:4 }
148
+ */
149
+ price?: string | null;
150
+ /**
151
+ * Benefit name.
152
+ * @maxLength 40
153
+ */
154
+ displayName?: string | null;
155
+ /**
156
+ * Benefit description.
157
+ * @maxLength 255
158
+ */
159
+ description?: string | null;
160
+ }
161
+ interface ItemInfo {
162
+ /**
163
+ * Item display name.
164
+ * @maxLength 64
165
+ */
166
+ displayName?: string | null;
167
+ }
168
+ interface QueryPoolDefinitionItemsRequest {
169
+ /** Query to select benefit items. */
170
+ query?: CursorQuery;
171
+ /**
172
+ * Fields to be included in the response.
173
+ * @maxSize 4
174
+ */
175
+ fields?: RequestedFieldsWithLiterals[];
176
+ }
177
+ interface CursorQuery extends CursorQueryPagingMethodOneOf {
178
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
179
+ cursorPaging?: CursorPaging;
180
+ /**
181
+ * Filter object in the following format:
182
+ * `"filter" : {
183
+ * "fieldName1": "value1",
184
+ * "fieldName2":{"$operator":"value2"}
185
+ * }`
186
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
187
+ */
188
+ filter?: Record<string, any> | null;
189
+ /**
190
+ * Sort object in the following format:
191
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
192
+ * @maxSize 5
193
+ */
194
+ sort?: Sorting[];
195
+ }
196
+ /** @oneof */
197
+ interface CursorQueryPagingMethodOneOf {
198
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
199
+ cursorPaging?: CursorPaging;
200
+ }
201
+ interface Sorting {
202
+ /**
203
+ * Name of the field to sort by.
204
+ * @maxLength 512
205
+ */
206
+ fieldName?: string;
207
+ /** Sort order. */
208
+ order?: SortOrderWithLiterals;
209
+ }
210
+ declare enum SortOrder {
211
+ ASC = "ASC",
212
+ DESC = "DESC"
213
+ }
214
+ /** @enumType */
215
+ type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
216
+ interface CursorPaging {
217
+ /**
218
+ * Maximum number of items to return in the results.
219
+ * @max 1000
220
+ */
221
+ limit?: number | null;
222
+ /**
223
+ * Pointer to the next or previous page in the list of results.
224
+ *
225
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
226
+ * Not relevant for the first request.
227
+ * @maxLength 16000
228
+ */
229
+ cursor?: string | null;
230
+ }
231
+ declare enum RequestedFields {
232
+ POOL_DEFINITION = "POOL_DEFINITION",
233
+ PROGRAM_DEFINITION = "PROGRAM_DEFINITION",
234
+ BENEFIT = "BENEFIT",
235
+ ITEM = "ITEM"
236
+ }
237
+ /** @enumType */
238
+ type RequestedFieldsWithLiterals = RequestedFields | 'POOL_DEFINITION' | 'PROGRAM_DEFINITION' | 'BENEFIT' | 'ITEM';
239
+ interface QueryPoolDefinitionItemsResponse {
240
+ /** List of items. */
241
+ poolDefinitionItems?: PoolDefinitionItem[];
242
+ /** Metadata for paginated results. */
243
+ metadata?: CursorPagingMetadata;
244
+ }
245
+ interface CursorPagingMetadata {
246
+ /** Number of items returned in the response. */
247
+ count?: number | null;
248
+ /** Cursor strings that point to the next page, previous page, or both. */
249
+ cursors?: Cursors;
250
+ /**
251
+ * Whether there are more pages to retrieve following the current page.
252
+ *
253
+ * + `true`: Another page of results can be retrieved.
254
+ * + `false`: This is the last page.
255
+ */
256
+ hasNext?: boolean | null;
257
+ }
258
+ interface Cursors {
259
+ /**
260
+ * Cursor string pointing to the next page in the list of results.
261
+ * @maxLength 16000
262
+ */
263
+ next?: string | null;
264
+ /**
265
+ * Cursor pointing to the previous page in the list of results.
266
+ * @maxLength 16000
267
+ */
268
+ prev?: string | null;
269
+ }
270
+ interface InvalidatePoolDefinitionItemsRequest {
271
+ /**
272
+ * The pool definition ID whose items are to be invalidated
273
+ * @format GUID
274
+ */
275
+ poolDefinitionId?: string;
276
+ /**
277
+ * List of item set ids whose items are to be invalidated
278
+ * @maxSize 10
279
+ * @format GUID
280
+ */
281
+ itemSetIds?: string[];
282
+ }
283
+ interface InvalidatePoolDefinitionItemsResponse {
284
+ }
285
+ interface RemoveItemsFromBenefitRequest {
286
+ /**
287
+ * Items to remove from the benefit's item set.
288
+ * @minSize 1
289
+ * @maxSize 100
290
+ */
291
+ itemReferences: ItemReference[];
292
+ /**
293
+ * ID of the pool definition associated with the benefit.
294
+ * @format GUID
295
+ */
296
+ poolDefinitionId: string;
297
+ /**
298
+ * Key identifying the benefit within the pool definition.
299
+ * @maxLength 64
300
+ */
301
+ benefitKey: string;
302
+ }
303
+ interface ItemReference {
304
+ /**
305
+ * External item ID assigned by the provider.
306
+ * @format GUID
307
+ */
308
+ externalId?: string;
309
+ /**
310
+ * Item category.
311
+ * @maxLength 20
312
+ */
313
+ category?: string;
314
+ }
315
+ interface RemoveItemsFromBenefitResponse {
316
+ }
317
+ interface AddItemsToBenefitRequest {
318
+ /**
319
+ * Items to add to the benefit's item set.
320
+ * @minSize 1
321
+ * @maxSize 100
322
+ */
323
+ itemReferences: ItemReference[];
324
+ /**
325
+ * ID of the pool definition associated with the benefit.
326
+ * @format GUID
327
+ */
328
+ poolDefinitionId: string;
329
+ /**
330
+ * Key identifying the benefit within the pool definition.
331
+ * @maxLength 64
332
+ */
333
+ benefitKey: string;
334
+ }
335
+ interface AddItemsToBenefitResponse {
336
+ }
337
+ interface DomainEvent extends DomainEventBodyOneOf {
338
+ createdEvent?: EntityCreatedEvent;
339
+ updatedEvent?: EntityUpdatedEvent;
340
+ deletedEvent?: EntityDeletedEvent;
341
+ actionEvent?: ActionEvent;
342
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
343
+ _id?: string;
344
+ /**
345
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
346
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
347
+ */
348
+ entityFqdn?: string;
349
+ /**
350
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
351
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
352
+ */
353
+ slug?: string;
354
+ /** ID of the entity associated with the event. */
355
+ entityId?: string;
356
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
357
+ eventTime?: Date | null;
358
+ /**
359
+ * Whether the event was triggered as a result of a privacy regulation application
360
+ * (for example, GDPR).
361
+ */
362
+ triggeredByAnonymizeRequest?: boolean | null;
363
+ /** If present, indicates the action that triggered the event. */
364
+ originatedFrom?: string | null;
365
+ /**
366
+ * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.
367
+ * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
368
+ */
369
+ entityEventSequence?: string | null;
370
+ }
371
+ /** @oneof */
372
+ interface DomainEventBodyOneOf {
373
+ createdEvent?: EntityCreatedEvent;
374
+ updatedEvent?: EntityUpdatedEvent;
375
+ deletedEvent?: EntityDeletedEvent;
376
+ actionEvent?: ActionEvent;
377
+ }
378
+ interface EntityCreatedEvent {
379
+ entity?: string;
380
+ }
381
+ interface RestoreInfo {
382
+ deletedDate?: Date | null;
383
+ }
384
+ interface EntityUpdatedEvent {
385
+ /**
386
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
387
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
388
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
389
+ */
390
+ currentEntity?: string;
391
+ }
392
+ interface EntityDeletedEvent {
393
+ /** Entity that was deleted. */
394
+ deletedEntity?: string | null;
395
+ }
396
+ interface ActionEvent {
397
+ body?: string;
398
+ }
399
+ interface MessageEnvelope {
400
+ /**
401
+ * App instance ID.
402
+ * @format GUID
403
+ */
404
+ instanceId?: string | null;
405
+ /**
406
+ * Event type.
407
+ * @maxLength 150
408
+ */
409
+ eventType?: string;
410
+ /** The identification type and identity data. */
411
+ identity?: IdentificationData;
412
+ /** Stringify payload. */
413
+ data?: string;
414
+ /** Details related to the account */
415
+ accountInfo?: AccountInfo;
416
+ }
417
+ interface IdentificationData extends IdentificationDataIdOneOf {
418
+ /**
419
+ * ID of a site visitor that has not logged in to the site.
420
+ * @format GUID
421
+ */
422
+ anonymousVisitorId?: string;
423
+ /**
424
+ * ID of a site visitor that has logged in to the site.
425
+ * @format GUID
426
+ */
427
+ memberId?: string;
428
+ /**
429
+ * ID of a Wix user (site owner, contributor, etc.).
430
+ * @format GUID
431
+ */
432
+ wixUserId?: string;
433
+ /**
434
+ * ID of an app.
435
+ * @format GUID
436
+ */
437
+ appId?: string;
438
+ /** @readonly */
439
+ identityType?: WebhookIdentityTypeWithLiterals;
440
+ }
441
+ /** @oneof */
442
+ interface IdentificationDataIdOneOf {
443
+ /**
444
+ * ID of a site visitor that has not logged in to the site.
445
+ * @format GUID
446
+ */
447
+ anonymousVisitorId?: string;
448
+ /**
449
+ * ID of a site visitor that has logged in to the site.
450
+ * @format GUID
451
+ */
452
+ memberId?: string;
453
+ /**
454
+ * ID of a Wix user (site owner, contributor, etc.).
455
+ * @format GUID
456
+ */
457
+ wixUserId?: string;
458
+ /**
459
+ * ID of an app.
460
+ * @format GUID
461
+ */
462
+ appId?: string;
463
+ }
464
+ declare enum WebhookIdentityType {
465
+ UNKNOWN = "UNKNOWN",
466
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
467
+ MEMBER = "MEMBER",
468
+ WIX_USER = "WIX_USER",
469
+ APP = "APP"
470
+ }
471
+ /** @enumType */
472
+ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
473
+ interface AccountInfo {
474
+ /**
475
+ * ID of the Wix account associated with the event.
476
+ * @format GUID
477
+ */
478
+ accountId?: string | null;
479
+ /**
480
+ * ID of the parent Wix account. Only included when accountId belongs to a child account.
481
+ * @format GUID
482
+ */
483
+ parentAccountId?: string | null;
484
+ /**
485
+ * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.
486
+ * @format GUID
487
+ */
488
+ siteId?: string | null;
489
+ }
490
+ /**
491
+ * Removes items from a benefit's item set, resolved by pool definition ID and benefit key.
492
+ * @param itemReferences - Items to remove from the benefit's item set.
493
+ * @public
494
+ * @documentationMaturity preview
495
+ * @requiredField itemReferences
496
+ * @requiredField itemReferences.externalId
497
+ * @requiredField options
498
+ * @requiredField options.benefitKey
499
+ * @requiredField options.poolDefinitionId
500
+ * @permissionId benefit_programs:v1:pool_definition_item:remove_items_from_benefit
501
+ * @fqn wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.RemoveItemsFromBenefit
502
+ */
503
+ declare function removeItemsFromBenefit(itemReferences: NonNullablePaths<ItemReference, `externalId`, 2>[], options: NonNullablePaths<RemoveItemsFromBenefitOptions, `benefitKey` | `poolDefinitionId`, 2>): Promise<void>;
504
+ interface RemoveItemsFromBenefitOptions {
505
+ /**
506
+ * ID of the pool definition associated with the benefit.
507
+ * @format GUID
508
+ */
509
+ poolDefinitionId: string;
510
+ /**
511
+ * Key identifying the benefit within the pool definition.
512
+ * @maxLength 64
513
+ */
514
+ benefitKey: string;
515
+ }
516
+ /**
517
+ * Adds items to a benefit's item set, resolved by pool definition ID and benefit key.
518
+ * @param itemReferences - Items to add to the benefit's item set.
519
+ * @public
520
+ * @documentationMaturity preview
521
+ * @requiredField itemReferences
522
+ * @requiredField itemReferences.externalId
523
+ * @requiredField options
524
+ * @requiredField options.benefitKey
525
+ * @requiredField options.poolDefinitionId
526
+ * @permissionId benefit_programs:v1:pool_definition_item:add_items_to_benefit
527
+ * @fqn wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.AddItemsToBenefit
528
+ */
529
+ declare function addItemsToBenefit(itemReferences: NonNullablePaths<ItemReference, `externalId`, 2>[], options: NonNullablePaths<AddItemsToBenefitOptions, `benefitKey` | `poolDefinitionId`, 2>): Promise<void>;
530
+ interface AddItemsToBenefitOptions {
531
+ /**
532
+ * ID of the pool definition associated with the benefit.
533
+ * @format GUID
534
+ */
535
+ poolDefinitionId: string;
536
+ /**
537
+ * Key identifying the benefit within the pool definition.
538
+ * @maxLength 64
539
+ */
540
+ benefitKey: string;
541
+ }
542
+
543
+ export { type AccountInfo, type ActionEvent, type AddItemsToBenefitOptions, type AddItemsToBenefitRequest, type AddItemsToBenefitResponse, type BenefitInfo, type CreditConfiguration, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type IdentificationData, type IdentificationDataIdOneOf, type InvalidatePoolDefinitionItemsRequest, type InvalidatePoolDefinitionItemsResponse, type ItemInfo, type ItemReference, type MessageEnvelope, type PoolDefinitionInfo, type PoolDefinitionItem, type ProgramDefinitionInfo, type QueryPoolDefinitionItemsRequest, type QueryPoolDefinitionItemsResponse, type RemoveItemsFromBenefitOptions, type RemoveItemsFromBenefitRequest, type RemoveItemsFromBenefitResponse, RequestedFields, type RequestedFieldsWithLiterals, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, addItemsToBenefit, removeItemsFromBenefit };