@wix/auto_sdk_benefit-programs_programs 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 (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/benefit-programs-v1-program-programs.context.d.ts +13 -0
  11. package/build/cjs/src/benefit-programs-v1-program-programs.context.js +22 -0
  12. package/build/cjs/src/benefit-programs-v1-program-programs.context.js.map +1 -0
  13. package/build/cjs/src/benefit-programs-v1-program-programs.http.d.ts +55 -0
  14. package/build/cjs/src/benefit-programs-v1-program-programs.http.js +388 -0
  15. package/build/cjs/src/benefit-programs-v1-program-programs.http.js.map +1 -0
  16. package/build/cjs/src/benefit-programs-v1-program-programs.meta.d.ts +25 -0
  17. package/build/cjs/src/benefit-programs-v1-program-programs.meta.js +199 -0
  18. package/build/cjs/src/benefit-programs-v1-program-programs.meta.js.map +1 -0
  19. package/build/cjs/src/benefit-programs-v1-program-programs.public.d.ts +109 -0
  20. package/build/cjs/src/benefit-programs-v1-program-programs.public.js +67 -0
  21. package/build/cjs/src/benefit-programs-v1-program-programs.public.js.map +1 -0
  22. package/build/cjs/src/benefit-programs-v1-program-programs.types.d.ts +576 -0
  23. package/build/cjs/src/benefit-programs-v1-program-programs.types.js +67 -0
  24. package/build/cjs/src/benefit-programs-v1-program-programs.types.js.map +1 -0
  25. package/build/cjs/src/benefit-programs-v1-program-programs.universal.d.ts +921 -0
  26. package/build/cjs/src/benefit-programs-v1-program-programs.universal.js +497 -0
  27. package/build/cjs/src/benefit-programs-v1-program-programs.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/benefit-programs-v1-program-programs.context.d.ts +13 -0
  39. package/build/es/src/benefit-programs-v1-program-programs.context.js +13 -0
  40. package/build/es/src/benefit-programs-v1-program-programs.context.js.map +1 -0
  41. package/build/es/src/benefit-programs-v1-program-programs.http.d.ts +55 -0
  42. package/build/es/src/benefit-programs-v1-program-programs.http.js +376 -0
  43. package/build/es/src/benefit-programs-v1-program-programs.http.js.map +1 -0
  44. package/build/es/src/benefit-programs-v1-program-programs.meta.d.ts +25 -0
  45. package/build/es/src/benefit-programs-v1-program-programs.meta.js +164 -0
  46. package/build/es/src/benefit-programs-v1-program-programs.meta.js.map +1 -0
  47. package/build/es/src/benefit-programs-v1-program-programs.public.d.ts +109 -0
  48. package/build/es/src/benefit-programs-v1-program-programs.public.js +49 -0
  49. package/build/es/src/benefit-programs-v1-program-programs.public.js.map +1 -0
  50. package/build/es/src/benefit-programs-v1-program-programs.types.d.ts +576 -0
  51. package/build/es/src/benefit-programs-v1-program-programs.types.js +64 -0
  52. package/build/es/src/benefit-programs-v1-program-programs.types.js.map +1 -0
  53. package/build/es/src/benefit-programs-v1-program-programs.universal.d.ts +921 -0
  54. package/build/es/src/benefit-programs-v1-program-programs.universal.js +462 -0
  55. package/build/es/src/benefit-programs-v1-program-programs.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/benefit-programs-v1-program-programs.context.d.ts +13 -0
  66. package/build/internal/cjs/src/benefit-programs-v1-program-programs.context.js +22 -0
  67. package/build/internal/cjs/src/benefit-programs-v1-program-programs.context.js.map +1 -0
  68. package/build/internal/cjs/src/benefit-programs-v1-program-programs.http.d.ts +55 -0
  69. package/build/internal/cjs/src/benefit-programs-v1-program-programs.http.js +388 -0
  70. package/build/internal/cjs/src/benefit-programs-v1-program-programs.http.js.map +1 -0
  71. package/build/internal/cjs/src/benefit-programs-v1-program-programs.meta.d.ts +25 -0
  72. package/build/internal/cjs/src/benefit-programs-v1-program-programs.meta.js +199 -0
  73. package/build/internal/cjs/src/benefit-programs-v1-program-programs.meta.js.map +1 -0
  74. package/build/internal/cjs/src/benefit-programs-v1-program-programs.public.d.ts +109 -0
  75. package/build/internal/cjs/src/benefit-programs-v1-program-programs.public.js +67 -0
  76. package/build/internal/cjs/src/benefit-programs-v1-program-programs.public.js.map +1 -0
  77. package/build/internal/cjs/src/benefit-programs-v1-program-programs.types.d.ts +576 -0
  78. package/build/internal/cjs/src/benefit-programs-v1-program-programs.types.js +67 -0
  79. package/build/internal/cjs/src/benefit-programs-v1-program-programs.types.js.map +1 -0
  80. package/build/internal/cjs/src/benefit-programs-v1-program-programs.universal.d.ts +921 -0
  81. package/build/internal/cjs/src/benefit-programs-v1-program-programs.universal.js +497 -0
  82. package/build/internal/cjs/src/benefit-programs-v1-program-programs.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/benefit-programs-v1-program-programs.context.d.ts +13 -0
  93. package/build/internal/es/src/benefit-programs-v1-program-programs.context.js +13 -0
  94. package/build/internal/es/src/benefit-programs-v1-program-programs.context.js.map +1 -0
  95. package/build/internal/es/src/benefit-programs-v1-program-programs.http.d.ts +55 -0
  96. package/build/internal/es/src/benefit-programs-v1-program-programs.http.js +376 -0
  97. package/build/internal/es/src/benefit-programs-v1-program-programs.http.js.map +1 -0
  98. package/build/internal/es/src/benefit-programs-v1-program-programs.meta.d.ts +25 -0
  99. package/build/internal/es/src/benefit-programs-v1-program-programs.meta.js +164 -0
  100. package/build/internal/es/src/benefit-programs-v1-program-programs.meta.js.map +1 -0
  101. package/build/internal/es/src/benefit-programs-v1-program-programs.public.d.ts +109 -0
  102. package/build/internal/es/src/benefit-programs-v1-program-programs.public.js +49 -0
  103. package/build/internal/es/src/benefit-programs-v1-program-programs.public.js.map +1 -0
  104. package/build/internal/es/src/benefit-programs-v1-program-programs.types.d.ts +576 -0
  105. package/build/internal/es/src/benefit-programs-v1-program-programs.types.js +64 -0
  106. package/build/internal/es/src/benefit-programs-v1-program-programs.types.js.map +1 -0
  107. package/build/internal/es/src/benefit-programs-v1-program-programs.universal.d.ts +921 -0
  108. package/build/internal/es/src/benefit-programs-v1-program-programs.universal.js +462 -0
  109. package/build/internal/es/src/benefit-programs-v1-program-programs.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,576 @@
1
+ export interface Program {
2
+ /**
3
+ * Program ID.
4
+ * @readonly
5
+ */
6
+ id?: string | null;
7
+ /**
8
+ * Revision number, which increments by 1 each time the program is updated.
9
+ * To prevent conflicting changes, the current revision must be specified when updating the program.
10
+ *
11
+ * Ignored when creating a program.
12
+ * @readonly
13
+ */
14
+ revision?: string | null;
15
+ /**
16
+ * Date and time the program was created.
17
+ * @readonly
18
+ */
19
+ createdDate?: Date | null;
20
+ /**
21
+ * Date and time the program was updated.
22
+ * @readonly
23
+ */
24
+ updatedDate?: Date | null;
25
+ /**
26
+ * ID of program definition that provisioned this benefit pool.
27
+ * @readonly
28
+ */
29
+ programDefinitionId?: string | null;
30
+ /**
31
+ * Program status.
32
+ * @readonly
33
+ */
34
+ status?: ProgramStatus;
35
+ /**
36
+ * Identity of the individual that enrolled in the program, granting access to its associated benefits.
37
+ * @readonly
38
+ */
39
+ beneficiary?: CommonIdentificationData;
40
+ /**
41
+ * Program name.
42
+ *
43
+ * Suggest setting the same value that was already specified in the program definition's `displayName`.
44
+ */
45
+ displayName?: string | null;
46
+ /** External system that is the source of the program creation. For example, `wix-pricing-plans`, `wix-loyalty`. */
47
+ namespace?: string | null;
48
+ /**
49
+ * Custom field data for the program object.
50
+ *
51
+ * [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields) must be configured in the app dashboard before they can be accessed with API calls.
52
+ */
53
+ extendedFields?: ExtendedFields;
54
+ /**
55
+ * External program ID.
56
+ *
57
+ * Must be unique to every app's namespace.
58
+ */
59
+ externalId?: string | null;
60
+ /**
61
+ * Program definition info
62
+ * @readonly
63
+ */
64
+ programDefinition?: ProgramDefinitionInfo;
65
+ /**
66
+ * Intended status of a program after the completion of an action.
67
+ * @readonly
68
+ */
69
+ targetStatus?: ProgramStatus;
70
+ }
71
+ export declare enum ProgramStatus {
72
+ /** Undefined program status. */
73
+ UNDEFINED = "UNDEFINED",
74
+ /** Active program. */
75
+ ACTIVE = "ACTIVE",
76
+ /** Paused program. */
77
+ PAUSED = "PAUSED",
78
+ /**
79
+ * Inactive program.
80
+ *
81
+ * Benefits of a program with an `ENDED` status can't be redeemed or reserved.
82
+ */
83
+ ENDED = "ENDED",
84
+ /** Process state for programs that are currently being activated but have not yet completed the provisioning process. */
85
+ PROVISIONING = "PROVISIONING",
86
+ /** Process state for programs that are currently pausing. */
87
+ PAUSING = "PAUSING",
88
+ /** Process state for programs that are currently resuming. */
89
+ RESUMING = "RESUMING",
90
+ /** Process state for programs that are currently ending. */
91
+ ENDING = "ENDING"
92
+ }
93
+ export interface CommonIdentificationData extends CommonIdentificationDataIdOneOf {
94
+ /** ID of a site visitor that has not logged in to the site. */
95
+ anonymousVisitorId?: string;
96
+ /** ID of a site visitor that has logged in to the site. */
97
+ memberId?: string;
98
+ /** ID of a Wix user (site owner, contributor, etc.). */
99
+ wixUserId?: string;
100
+ }
101
+ /** @oneof */
102
+ export interface CommonIdentificationDataIdOneOf {
103
+ /** ID of a site visitor that has not logged in to the site. */
104
+ anonymousVisitorId?: string;
105
+ /** ID of a site visitor that has logged in to the site. */
106
+ memberId?: string;
107
+ /** ID of a Wix user (site owner, contributor, etc.). */
108
+ wixUserId?: string;
109
+ }
110
+ export declare enum IdentityType {
111
+ /** Unknown type. This value is not used. */
112
+ UNKNOWN = "UNKNOWN",
113
+ /** A site visitor who has not logged in. */
114
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
115
+ /** A logged-in site member. */
116
+ MEMBER = "MEMBER",
117
+ /** A Wix account holder, such as a site owner or contributor. */
118
+ WIX_USER = "WIX_USER"
119
+ }
120
+ export interface ExtendedFields {
121
+ /**
122
+ * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
123
+ * The value of each key is structured according to the schema defined when the extended fields were configured.
124
+ *
125
+ * You can only access fields for which you have the appropriate permissions.
126
+ *
127
+ * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
128
+ */
129
+ namespaces?: Record<string, Record<string, any>>;
130
+ }
131
+ export interface ProgramDefinitionInfo {
132
+ /**
133
+ * ID of the program definition that provisioned the program associated with this benefit pool.
134
+ * @readonly
135
+ */
136
+ id?: string;
137
+ /**
138
+ * External ID of the program definition that provisioned this program.
139
+ *
140
+ * This identifies the source program definition in the external system.
141
+ * @readonly
142
+ */
143
+ externalId?: string | null;
144
+ }
145
+ export interface ProgramProvisioned {
146
+ /** Program which has been provisioned */
147
+ program?: Program;
148
+ }
149
+ export interface ProgramRenewed {
150
+ /** Program which has been renewed */
151
+ program?: Program;
152
+ }
153
+ export interface ProgramEnded {
154
+ /** Program which has been ended */
155
+ program?: Program;
156
+ }
157
+ export interface ProgramPaused {
158
+ /** Program which has been paused */
159
+ program?: Program;
160
+ }
161
+ export interface ProgramResumed {
162
+ /** Program which has been resumed */
163
+ program?: Program;
164
+ }
165
+ /** In case pool_definition_id is provided should test if it's part of a package. If it is, reject the request */
166
+ export interface ProvisionProgramRequest {
167
+ /**
168
+ * Used to locate the pool definition for creating its benefit pools within the program.
169
+ *
170
+ * This object must contain either `programDefinitionId` or `poolDefinitionId`:
171
+ * + Use `programDefinitionId` for programs with multiple benefit pools.
172
+ * + Use `poolDefinitionId` for a program with just 1 benefit pool.
173
+ */
174
+ poolDefinitionLookupId: PoolDefinitionLookupId;
175
+ /**
176
+ * Identity of the individual that enrolled in the program, granting access to its associated benefits.
177
+ *
178
+ * The beneficiary's identity information is in their access token. To retrieve their identity, pass the access token from your frontend site to your backend, then call the Token Info ([SDK](https://dev.wix.com/docs/sdk/core-modules/essentials/auth#gettokeninfo)|[REST](https://dev.wix.com/docs/rest/app-management/oauth-2/token-info)) method. The returned `subjectType` and `subjectId` correspond to the identity type and ID of the beneficiary.
179
+ */
180
+ beneficiary: CommonIdentificationData;
181
+ /**
182
+ * Set the status of the program upon provision.
183
+ *
184
+ * Default: `ACTIVE`
185
+ */
186
+ programStatus?: ProvisionProgramRequestProgramStatus;
187
+ /**
188
+ * Application sub-module that is the source of the program creation.
189
+ *
190
+ * Use the namespace that was designated to the program definition.
191
+ */
192
+ namespace: string;
193
+ /**
194
+ * Program name.
195
+ *
196
+ * Suggest using the same value that was already specified in the program definition's `displayName`.
197
+ */
198
+ displayName?: string | null;
199
+ /**
200
+ * External program ID.
201
+ *
202
+ * Must be unique to every app owner's namespace.
203
+ */
204
+ externalProgramId: string;
205
+ }
206
+ export interface PoolDefinitionLookupId extends PoolDefinitionLookupIdIdOneOf {
207
+ /** Pool definition ID. */
208
+ poolDefinitionId?: string;
209
+ /** Program definition ID. */
210
+ programDefinitionId?: string;
211
+ }
212
+ /** @oneof */
213
+ export interface PoolDefinitionLookupIdIdOneOf {
214
+ /** Pool definition ID. */
215
+ poolDefinitionId?: string;
216
+ /** Program definition ID. */
217
+ programDefinitionId?: string;
218
+ }
219
+ export declare enum ProvisionProgramRequestProgramStatus {
220
+ /** Active program. */
221
+ ACTIVE = "ACTIVE",
222
+ /** Paused program. */
223
+ PAUSED = "PAUSED"
224
+ }
225
+ export interface ProvisionProgramResponse {
226
+ /** Job ID of the provisioned program. */
227
+ jobId?: string;
228
+ /** Provisioned program. */
229
+ program?: Program;
230
+ }
231
+ export interface ProgramAlreadyExists {
232
+ /** Key of a program that already exists */
233
+ externalProgramId?: string;
234
+ /** Key of a program that already exists */
235
+ namespace?: string;
236
+ }
237
+ /** Updates the pool credit amount according to the configuration. */
238
+ export interface RenewProgramRequest {
239
+ /** ID of the program to renew. */
240
+ programId: string;
241
+ }
242
+ export interface RenewProgramResponse {
243
+ /** Job ID of the renewed program. */
244
+ jobId?: string;
245
+ }
246
+ export interface PauseProgramRequest {
247
+ /** ID of the program to pause. */
248
+ programId: string;
249
+ }
250
+ export interface PauseProgramResponse {
251
+ /** Job ID of the paused program. */
252
+ jobId?: string;
253
+ }
254
+ export interface ProgramStatusTransitionNotAllowed {
255
+ /** Current status of the program */
256
+ currentStatus?: ProgramStatus;
257
+ /** Status to which the program is being transitioned */
258
+ requestedStatus?: ProgramStatus;
259
+ }
260
+ export interface ResumeProgramRequest {
261
+ /** ID of program to resume. */
262
+ programId: string;
263
+ }
264
+ export interface ResumeProgramResponse {
265
+ /** Job ID of the resumed program. */
266
+ jobId?: string;
267
+ }
268
+ export interface EndProgramRequest {
269
+ /** Package of pools */
270
+ programId: string;
271
+ }
272
+ export interface EndProgramResponse {
273
+ /** Job ID of the discontinued program. */
274
+ jobId?: string;
275
+ }
276
+ export interface UpdateProgramStatusRequest {
277
+ /** Program to update */
278
+ programId?: string;
279
+ /** Program revision */
280
+ programRevision?: string;
281
+ /** Status to update */
282
+ status?: ProgramStatus;
283
+ /** Status to update */
284
+ targetStatus?: ProgramStatus;
285
+ }
286
+ export interface UpdateProgramStatusResponse {
287
+ /** The updated Program */
288
+ program?: Program;
289
+ }
290
+ export interface UpsertMigratedProgramRequest {
291
+ /** Order id */
292
+ orderId?: string;
293
+ /** Plan id */
294
+ planId?: string;
295
+ /** Order member id */
296
+ memberId?: string;
297
+ /** Order status */
298
+ status?: OrderStatus;
299
+ /** Plan name */
300
+ planName?: string;
301
+ }
302
+ export declare enum OrderStatus {
303
+ UNKNOWN = "UNKNOWN",
304
+ ACTIVE = "ACTIVE",
305
+ PAUSED = "PAUSED",
306
+ ENDED = "ENDED"
307
+ }
308
+ export interface UpsertMigratedProgramResponse {
309
+ /** Inserted or updated program */
310
+ program?: Program;
311
+ }
312
+ export interface UpdateProgramRequest {
313
+ /** Program to be updated. */
314
+ program: Program;
315
+ }
316
+ export interface UpdateProgramResponse {
317
+ /** Updated program. */
318
+ program?: Program;
319
+ }
320
+ export interface GetProgramRequest {
321
+ /** ID of the program to retrieve. */
322
+ programId: string;
323
+ }
324
+ export interface GetProgramResponse {
325
+ /** Retrieved program. */
326
+ program?: Program;
327
+ }
328
+ export interface QueryProgramsRequest {
329
+ /** Query to select programs. */
330
+ query?: CursorQuery;
331
+ }
332
+ export interface CursorQuery extends CursorQueryPagingMethodOneOf {
333
+ /** 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`. */
334
+ cursorPaging?: CursorPaging;
335
+ /**
336
+ * Filter object in the following format:
337
+ * `"filter" : {
338
+ * "fieldName1": "value1",
339
+ * "fieldName2":{"$operator":"value2"}
340
+ * }`
341
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
342
+ */
343
+ filter?: Record<string, any> | null;
344
+ /**
345
+ * Sort object in the following format:
346
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
347
+ */
348
+ sort?: Sorting[];
349
+ }
350
+ /** @oneof */
351
+ export interface CursorQueryPagingMethodOneOf {
352
+ /** 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`. */
353
+ cursorPaging?: CursorPaging;
354
+ }
355
+ export interface Sorting {
356
+ /** Name of the field to sort by. */
357
+ fieldName?: string;
358
+ /** Sort order. */
359
+ order?: SortOrder;
360
+ }
361
+ export declare enum SortOrder {
362
+ /** Ascending sort order. */
363
+ ASC = "ASC",
364
+ /** Descending sort order. */
365
+ DESC = "DESC"
366
+ }
367
+ export interface CursorPaging {
368
+ /** Maximum number of items to return in the results. */
369
+ limit?: number | null;
370
+ /**
371
+ * Pointer to the next or previous page in the list of results.
372
+ *
373
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
374
+ * Not relevant for the first request.
375
+ */
376
+ cursor?: string | null;
377
+ }
378
+ export interface QueryProgramsResponse {
379
+ /** List of programs. */
380
+ programs?: Program[];
381
+ /** Metadata for the paginated results. */
382
+ metadata?: CursorPagingMetadata;
383
+ }
384
+ export interface CursorPagingMetadata {
385
+ /** Number of items returned in the response. */
386
+ count?: number | null;
387
+ /** Cursor strings that point to the next page, previous page, or both. */
388
+ cursors?: Cursors;
389
+ /**
390
+ * Whether there are more pages to retrieve following the current page.
391
+ *
392
+ * + `true`: Another page of results can be retrieved.
393
+ * + `false`: This is the last page.
394
+ */
395
+ hasNext?: boolean | null;
396
+ }
397
+ export interface Cursors {
398
+ /** Cursor string pointing to the next page in the list of results. */
399
+ next?: string | null;
400
+ /** Cursor pointing to the previous page in the list of results. */
401
+ prev?: string | null;
402
+ }
403
+ export interface GetProgramByExternalIdAndNamespaceRequest {
404
+ /**
405
+ * Application sub-module that is the source of the program creation.
406
+ *
407
+ * Use the namespace that was designated to the program definition.
408
+ */
409
+ namespace: string;
410
+ /**
411
+ * External program ID.
412
+ *
413
+ * Must be unique to every app's namespace.
414
+ */
415
+ externalId: string;
416
+ }
417
+ export interface GetProgramByExternalIdAndNamespaceResponse {
418
+ /** Retrieved program. */
419
+ program?: Program;
420
+ }
421
+ export interface DomainEvent extends DomainEventBodyOneOf {
422
+ createdEvent?: EntityCreatedEvent;
423
+ updatedEvent?: EntityUpdatedEvent;
424
+ deletedEvent?: EntityDeletedEvent;
425
+ actionEvent?: ActionEvent;
426
+ /**
427
+ * Unique event ID.
428
+ * Allows clients to ignore duplicate webhooks.
429
+ */
430
+ id?: string;
431
+ /**
432
+ * Assumes actions are also always typed to an entity_type
433
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
434
+ */
435
+ entityFqdn?: string;
436
+ /**
437
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
438
+ * This is although the created/updated/deleted notion is duplication of the oneof types
439
+ * Example: created/updated/deleted/started/completed/email_opened
440
+ */
441
+ slug?: string;
442
+ /** ID of the entity associated with the event. */
443
+ entityId?: string;
444
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
445
+ eventTime?: Date | null;
446
+ /**
447
+ * Whether the event was triggered as a result of a privacy regulation application
448
+ * (for example, GDPR).
449
+ */
450
+ triggeredByAnonymizeRequest?: boolean | null;
451
+ /** If present, indicates the action that triggered the event. */
452
+ originatedFrom?: string | null;
453
+ /**
454
+ * A sequence number defining the order of updates to the underlying entity.
455
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
456
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
457
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
458
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
459
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
460
+ */
461
+ entityEventSequence?: string | null;
462
+ }
463
+ /** @oneof */
464
+ export interface DomainEventBodyOneOf {
465
+ createdEvent?: EntityCreatedEvent;
466
+ updatedEvent?: EntityUpdatedEvent;
467
+ deletedEvent?: EntityDeletedEvent;
468
+ actionEvent?: ActionEvent;
469
+ }
470
+ export interface EntityCreatedEvent {
471
+ entityAsJson?: string;
472
+ /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */
473
+ restoreInfo?: RestoreInfo;
474
+ }
475
+ export interface RestoreInfo {
476
+ deletedDate?: Date | null;
477
+ }
478
+ export interface EntityUpdatedEvent {
479
+ /**
480
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
481
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
482
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
483
+ */
484
+ currentEntityAsJson?: string;
485
+ }
486
+ export interface EntityDeletedEvent {
487
+ /** Entity that was deleted */
488
+ deletedEntityAsJson?: string | null;
489
+ }
490
+ export interface ActionEvent {
491
+ bodyAsJson?: string;
492
+ }
493
+ export interface MessageEnvelope {
494
+ /** App instance ID. */
495
+ instanceId?: string | null;
496
+ /** Event type. */
497
+ eventType?: string;
498
+ /** The identification type and identity data. */
499
+ identity?: IdentificationData;
500
+ /** Stringify payload. */
501
+ data?: string;
502
+ }
503
+ export interface IdentificationData extends IdentificationDataIdOneOf {
504
+ /** ID of a site visitor that has not logged in to the site. */
505
+ anonymousVisitorId?: string;
506
+ /** ID of a site visitor that has logged in to the site. */
507
+ memberId?: string;
508
+ /** ID of a Wix user (site owner, contributor, etc.). */
509
+ wixUserId?: string;
510
+ /** ID of an app. */
511
+ appId?: string;
512
+ /** @readonly */
513
+ identityType?: WebhookIdentityType;
514
+ }
515
+ /** @oneof */
516
+ export interface IdentificationDataIdOneOf {
517
+ /** ID of a site visitor that has not logged in to the site. */
518
+ anonymousVisitorId?: string;
519
+ /** ID of a site visitor that has logged in to the site. */
520
+ memberId?: string;
521
+ /** ID of a Wix user (site owner, contributor, etc.). */
522
+ wixUserId?: string;
523
+ /** ID of an app. */
524
+ appId?: string;
525
+ }
526
+ export declare enum WebhookIdentityType {
527
+ UNKNOWN = "UNKNOWN",
528
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
529
+ MEMBER = "MEMBER",
530
+ WIX_USER = "WIX_USER",
531
+ APP = "APP"
532
+ }
533
+ interface CommonIdentificationDataNonNullableFields {
534
+ anonymousVisitorId: string;
535
+ memberId: string;
536
+ wixUserId: string;
537
+ identityType: IdentityType;
538
+ }
539
+ interface ProgramDefinitionInfoNonNullableFields {
540
+ id: string;
541
+ }
542
+ interface ProgramNonNullableFields {
543
+ status: ProgramStatus;
544
+ beneficiary?: CommonIdentificationDataNonNullableFields;
545
+ programDefinition?: ProgramDefinitionInfoNonNullableFields;
546
+ targetStatus: ProgramStatus;
547
+ }
548
+ export interface ProvisionProgramResponseNonNullableFields {
549
+ jobId: string;
550
+ program?: ProgramNonNullableFields;
551
+ }
552
+ export interface RenewProgramResponseNonNullableFields {
553
+ jobId: string;
554
+ }
555
+ export interface PauseProgramResponseNonNullableFields {
556
+ jobId: string;
557
+ }
558
+ export interface ResumeProgramResponseNonNullableFields {
559
+ jobId: string;
560
+ }
561
+ export interface EndProgramResponseNonNullableFields {
562
+ jobId: string;
563
+ }
564
+ export interface UpdateProgramResponseNonNullableFields {
565
+ program?: ProgramNonNullableFields;
566
+ }
567
+ export interface GetProgramResponseNonNullableFields {
568
+ program?: ProgramNonNullableFields;
569
+ }
570
+ export interface QueryProgramsResponseNonNullableFields {
571
+ programs: ProgramNonNullableFields[];
572
+ }
573
+ export interface GetProgramByExternalIdAndNamespaceResponseNonNullableFields {
574
+ program?: ProgramNonNullableFields;
575
+ }
576
+ export {};
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebhookIdentityType = exports.SortOrder = exports.OrderStatus = exports.ProvisionProgramRequestProgramStatus = exports.IdentityType = exports.ProgramStatus = void 0;
4
+ var ProgramStatus;
5
+ (function (ProgramStatus) {
6
+ /** Undefined program status. */
7
+ ProgramStatus["UNDEFINED"] = "UNDEFINED";
8
+ /** Active program. */
9
+ ProgramStatus["ACTIVE"] = "ACTIVE";
10
+ /** Paused program. */
11
+ ProgramStatus["PAUSED"] = "PAUSED";
12
+ /**
13
+ * Inactive program.
14
+ *
15
+ * Benefits of a program with an `ENDED` status can't be redeemed or reserved.
16
+ */
17
+ ProgramStatus["ENDED"] = "ENDED";
18
+ /** Process state for programs that are currently being activated but have not yet completed the provisioning process. */
19
+ ProgramStatus["PROVISIONING"] = "PROVISIONING";
20
+ /** Process state for programs that are currently pausing. */
21
+ ProgramStatus["PAUSING"] = "PAUSING";
22
+ /** Process state for programs that are currently resuming. */
23
+ ProgramStatus["RESUMING"] = "RESUMING";
24
+ /** Process state for programs that are currently ending. */
25
+ ProgramStatus["ENDING"] = "ENDING";
26
+ })(ProgramStatus || (exports.ProgramStatus = ProgramStatus = {}));
27
+ var IdentityType;
28
+ (function (IdentityType) {
29
+ /** Unknown type. This value is not used. */
30
+ IdentityType["UNKNOWN"] = "UNKNOWN";
31
+ /** A site visitor who has not logged in. */
32
+ IdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
33
+ /** A logged-in site member. */
34
+ IdentityType["MEMBER"] = "MEMBER";
35
+ /** A Wix account holder, such as a site owner or contributor. */
36
+ IdentityType["WIX_USER"] = "WIX_USER";
37
+ })(IdentityType || (exports.IdentityType = IdentityType = {}));
38
+ var ProvisionProgramRequestProgramStatus;
39
+ (function (ProvisionProgramRequestProgramStatus) {
40
+ /** Active program. */
41
+ ProvisionProgramRequestProgramStatus["ACTIVE"] = "ACTIVE";
42
+ /** Paused program. */
43
+ ProvisionProgramRequestProgramStatus["PAUSED"] = "PAUSED";
44
+ })(ProvisionProgramRequestProgramStatus || (exports.ProvisionProgramRequestProgramStatus = ProvisionProgramRequestProgramStatus = {}));
45
+ var OrderStatus;
46
+ (function (OrderStatus) {
47
+ OrderStatus["UNKNOWN"] = "UNKNOWN";
48
+ OrderStatus["ACTIVE"] = "ACTIVE";
49
+ OrderStatus["PAUSED"] = "PAUSED";
50
+ OrderStatus["ENDED"] = "ENDED";
51
+ })(OrderStatus || (exports.OrderStatus = OrderStatus = {}));
52
+ var SortOrder;
53
+ (function (SortOrder) {
54
+ /** Ascending sort order. */
55
+ SortOrder["ASC"] = "ASC";
56
+ /** Descending sort order. */
57
+ SortOrder["DESC"] = "DESC";
58
+ })(SortOrder || (exports.SortOrder = SortOrder = {}));
59
+ var WebhookIdentityType;
60
+ (function (WebhookIdentityType) {
61
+ WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
62
+ WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
63
+ WebhookIdentityType["MEMBER"] = "MEMBER";
64
+ WebhookIdentityType["WIX_USER"] = "WIX_USER";
65
+ WebhookIdentityType["APP"] = "APP";
66
+ })(WebhookIdentityType || (exports.WebhookIdentityType = WebhookIdentityType = {}));
67
+ //# sourceMappingURL=benefit-programs-v1-program-programs.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"benefit-programs-v1-program-programs.types.js","sourceRoot":"","sources":["../../../src/benefit-programs-v1-program-programs.types.ts"],"names":[],"mappings":";;;AAuEA,IAAY,aAqBX;AArBD,WAAY,aAAa;IACvB,gCAAgC;IAChC,wCAAuB,CAAA;IACvB,sBAAsB;IACtB,kCAAiB,CAAA;IACjB,sBAAsB;IACtB,kCAAiB,CAAA;IACjB;;;;OAIG;IACH,gCAAe,CAAA;IACf,yHAAyH;IACzH,8CAA6B,CAAA;IAC7B,6DAA6D;IAC7D,oCAAmB,CAAA;IACnB,8DAA8D;IAC9D,sCAAqB,CAAA;IACrB,4DAA4D;IAC5D,kCAAiB,CAAA;AACnB,CAAC,EArBW,aAAa,6BAAb,aAAa,QAqBxB;AAsBD,IAAY,YASX;AATD,WAAY,YAAY;IACtB,4CAA4C;IAC5C,mCAAmB,CAAA;IACnB,4CAA4C;IAC5C,uDAAuC,CAAA;IACvC,+BAA+B;IAC/B,iCAAiB,CAAA;IACjB,iEAAiE;IACjE,qCAAqB,CAAA;AACvB,CAAC,EATW,YAAY,4BAAZ,YAAY,QASvB;AA+GD,IAAY,oCAKX;AALD,WAAY,oCAAoC;IAC9C,sBAAsB;IACtB,yDAAiB,CAAA;IACjB,sBAAsB;IACtB,yDAAiB,CAAA;AACnB,CAAC,EALW,oCAAoC,oDAApC,oCAAoC,QAK/C;AA6FD,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,gCAAiB,CAAA;IACjB,gCAAiB,CAAA;IACjB,8BAAe,CAAA;AACjB,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAgED,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,4BAA4B;IAC5B,wBAAW,CAAA;IACX,6BAA6B;IAC7B,0BAAa,CAAA;AACf,CAAC,EALW,SAAS,yBAAT,SAAS,QAKpB;AAiLD,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,8DAAuC,CAAA;IACvC,wCAAiB,CAAA;IACjB,4CAAqB,CAAA;IACrB,kCAAW,CAAA;AACb,CAAC,EANW,mBAAmB,mCAAnB,mBAAmB,QAM9B"}