@wix/auto_sdk_benefit-programs_program-definitions 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-definition-program-definitions.context.d.ts +10 -0
  11. package/build/cjs/src/benefit-programs-v1-program-definition-program-definitions.context.js +16 -0
  12. package/build/cjs/src/benefit-programs-v1-program-definition-program-definitions.context.js.map +1 -0
  13. package/build/cjs/src/benefit-programs-v1-program-definition-program-definitions.http.d.ts +35 -0
  14. package/build/cjs/src/benefit-programs-v1-program-definition-program-definitions.http.js +283 -0
  15. package/build/cjs/src/benefit-programs-v1-program-definition-program-definitions.http.js.map +1 -0
  16. package/build/cjs/src/benefit-programs-v1-program-definition-program-definitions.meta.d.ts +24 -0
  17. package/build/cjs/src/benefit-programs-v1-program-definition-program-definitions.meta.js +142 -0
  18. package/build/cjs/src/benefit-programs-v1-program-definition-program-definitions.meta.js.map +1 -0
  19. package/build/cjs/src/benefit-programs-v1-program-definition-program-definitions.public.d.ts +72 -0
  20. package/build/cjs/src/benefit-programs-v1-program-definition-program-definitions.public.js +46 -0
  21. package/build/cjs/src/benefit-programs-v1-program-definition-program-definitions.public.js.map +1 -0
  22. package/build/cjs/src/benefit-programs-v1-program-definition-program-definitions.types.d.ts +319 -0
  23. package/build/cjs/src/benefit-programs-v1-program-definition-program-definitions.types.js +42 -0
  24. package/build/cjs/src/benefit-programs-v1-program-definition-program-definitions.types.js.map +1 -0
  25. package/build/cjs/src/benefit-programs-v1-program-definition-program-definitions.universal.d.ts +528 -0
  26. package/build/cjs/src/benefit-programs-v1-program-definition-program-definitions.universal.js +323 -0
  27. package/build/cjs/src/benefit-programs-v1-program-definition-program-definitions.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-definition-program-definitions.context.d.ts +10 -0
  39. package/build/es/src/benefit-programs-v1-program-definition-program-definitions.context.js +10 -0
  40. package/build/es/src/benefit-programs-v1-program-definition-program-definitions.context.js.map +1 -0
  41. package/build/es/src/benefit-programs-v1-program-definition-program-definitions.http.d.ts +35 -0
  42. package/build/es/src/benefit-programs-v1-program-definition-program-definitions.http.js +274 -0
  43. package/build/es/src/benefit-programs-v1-program-definition-program-definitions.http.js.map +1 -0
  44. package/build/es/src/benefit-programs-v1-program-definition-program-definitions.meta.d.ts +24 -0
  45. package/build/es/src/benefit-programs-v1-program-definition-program-definitions.meta.js +110 -0
  46. package/build/es/src/benefit-programs-v1-program-definition-program-definitions.meta.js.map +1 -0
  47. package/build/es/src/benefit-programs-v1-program-definition-program-definitions.public.d.ts +72 -0
  48. package/build/es/src/benefit-programs-v1-program-definition-program-definitions.public.js +34 -0
  49. package/build/es/src/benefit-programs-v1-program-definition-program-definitions.public.js.map +1 -0
  50. package/build/es/src/benefit-programs-v1-program-definition-program-definitions.types.d.ts +319 -0
  51. package/build/es/src/benefit-programs-v1-program-definition-program-definitions.types.js +39 -0
  52. package/build/es/src/benefit-programs-v1-program-definition-program-definitions.types.js.map +1 -0
  53. package/build/es/src/benefit-programs-v1-program-definition-program-definitions.universal.d.ts +528 -0
  54. package/build/es/src/benefit-programs-v1-program-definition-program-definitions.universal.js +291 -0
  55. package/build/es/src/benefit-programs-v1-program-definition-program-definitions.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-definition-program-definitions.context.d.ts +10 -0
  66. package/build/internal/cjs/src/benefit-programs-v1-program-definition-program-definitions.context.js +16 -0
  67. package/build/internal/cjs/src/benefit-programs-v1-program-definition-program-definitions.context.js.map +1 -0
  68. package/build/internal/cjs/src/benefit-programs-v1-program-definition-program-definitions.http.d.ts +35 -0
  69. package/build/internal/cjs/src/benefit-programs-v1-program-definition-program-definitions.http.js +283 -0
  70. package/build/internal/cjs/src/benefit-programs-v1-program-definition-program-definitions.http.js.map +1 -0
  71. package/build/internal/cjs/src/benefit-programs-v1-program-definition-program-definitions.meta.d.ts +24 -0
  72. package/build/internal/cjs/src/benefit-programs-v1-program-definition-program-definitions.meta.js +142 -0
  73. package/build/internal/cjs/src/benefit-programs-v1-program-definition-program-definitions.meta.js.map +1 -0
  74. package/build/internal/cjs/src/benefit-programs-v1-program-definition-program-definitions.public.d.ts +72 -0
  75. package/build/internal/cjs/src/benefit-programs-v1-program-definition-program-definitions.public.js +46 -0
  76. package/build/internal/cjs/src/benefit-programs-v1-program-definition-program-definitions.public.js.map +1 -0
  77. package/build/internal/cjs/src/benefit-programs-v1-program-definition-program-definitions.types.d.ts +319 -0
  78. package/build/internal/cjs/src/benefit-programs-v1-program-definition-program-definitions.types.js +42 -0
  79. package/build/internal/cjs/src/benefit-programs-v1-program-definition-program-definitions.types.js.map +1 -0
  80. package/build/internal/cjs/src/benefit-programs-v1-program-definition-program-definitions.universal.d.ts +528 -0
  81. package/build/internal/cjs/src/benefit-programs-v1-program-definition-program-definitions.universal.js +323 -0
  82. package/build/internal/cjs/src/benefit-programs-v1-program-definition-program-definitions.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-definition-program-definitions.context.d.ts +10 -0
  93. package/build/internal/es/src/benefit-programs-v1-program-definition-program-definitions.context.js +10 -0
  94. package/build/internal/es/src/benefit-programs-v1-program-definition-program-definitions.context.js.map +1 -0
  95. package/build/internal/es/src/benefit-programs-v1-program-definition-program-definitions.http.d.ts +35 -0
  96. package/build/internal/es/src/benefit-programs-v1-program-definition-program-definitions.http.js +274 -0
  97. package/build/internal/es/src/benefit-programs-v1-program-definition-program-definitions.http.js.map +1 -0
  98. package/build/internal/es/src/benefit-programs-v1-program-definition-program-definitions.meta.d.ts +24 -0
  99. package/build/internal/es/src/benefit-programs-v1-program-definition-program-definitions.meta.js +110 -0
  100. package/build/internal/es/src/benefit-programs-v1-program-definition-program-definitions.meta.js.map +1 -0
  101. package/build/internal/es/src/benefit-programs-v1-program-definition-program-definitions.public.d.ts +72 -0
  102. package/build/internal/es/src/benefit-programs-v1-program-definition-program-definitions.public.js +34 -0
  103. package/build/internal/es/src/benefit-programs-v1-program-definition-program-definitions.public.js.map +1 -0
  104. package/build/internal/es/src/benefit-programs-v1-program-definition-program-definitions.types.d.ts +319 -0
  105. package/build/internal/es/src/benefit-programs-v1-program-definition-program-definitions.types.js +39 -0
  106. package/build/internal/es/src/benefit-programs-v1-program-definition-program-definitions.types.js.map +1 -0
  107. package/build/internal/es/src/benefit-programs-v1-program-definition-program-definitions.universal.d.ts +528 -0
  108. package/build/internal/es/src/benefit-programs-v1-program-definition-program-definitions.universal.js +291 -0
  109. package/build/internal/es/src/benefit-programs-v1-program-definition-program-definitions.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,528 @@
1
+ export interface ProgramDefinition {
2
+ /**
3
+ * Program definition ID.
4
+ * @readonly
5
+ */
6
+ _id?: string | null;
7
+ /**
8
+ * Revision number, which increments by 1 each time the program definition is updated.
9
+ * To prevent conflicting changes, the current revision must be passed when updating the program definition.
10
+ *
11
+ * Ignored when creating a program definition.
12
+ * @readonly
13
+ */
14
+ revision?: string | null;
15
+ /**
16
+ * Date and time the program definition was created.
17
+ * @readonly
18
+ */
19
+ _createdDate?: Date | null;
20
+ /**
21
+ * Date and time the program definition was updated.
22
+ * @readonly
23
+ */
24
+ _updatedDate?: Date | null;
25
+ /** Name of the program associated with this program definition. This name will be the same for all programs provisioned from this program definition. */
26
+ displayName?: string | null;
27
+ /** Application sub-module that represents the source of the program definition. Specified by the external developer. This namespace is used to handle and retrieve program definition and associated programs. */
28
+ namespace?: string | null;
29
+ /**
30
+ * Custom field data for the program definition object.
31
+ * [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls.
32
+ */
33
+ extendedFields?: ExtendedFields;
34
+ /** External program definition ID designated by the app owner. */
35
+ externalId?: string | null;
36
+ }
37
+ export interface ExtendedFields {
38
+ /**
39
+ * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
40
+ * The value of each key is structured according to the schema defined when the extended fields were configured.
41
+ *
42
+ * You can only access fields for which you have the appropriate permissions.
43
+ *
44
+ * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
45
+ */
46
+ namespaces?: Record<string, Record<string, any>>;
47
+ }
48
+ export interface CreateProgramDefinitionRequest {
49
+ /** Program definition to create. */
50
+ programDefinition: ProgramDefinition;
51
+ }
52
+ export interface CreateProgramDefinitionResponse {
53
+ /** Created program definition. */
54
+ programDefinition?: ProgramDefinition;
55
+ }
56
+ export interface UpdateProgramDefinitionRequest {
57
+ /** Program definition to updated. */
58
+ programDefinition: ProgramDefinition;
59
+ }
60
+ export interface UpdateProgramDefinitionResponse {
61
+ /** Updated program definition. */
62
+ programDefinition?: ProgramDefinition;
63
+ }
64
+ export interface DeleteProgramDefinitionRequest {
65
+ /** ID of the ProgramDefinition to delete. */
66
+ programDefinitionId: string;
67
+ /**
68
+ * Specifies the timing of ending the active benefit pools associated with this program definition.
69
+ * Determines how and when changes are applied to benefit pools.
70
+ */
71
+ cascadeType?: Cascade;
72
+ }
73
+ export declare enum Cascade {
74
+ /** Unknown cascade. */
75
+ UNKNOWN_CASCADE = "UNKNOWN_CASCADE",
76
+ /**
77
+ * Updates the associated benefit pools to reflect the new or modified pool definition. The benefits will appear in existing programs at the beginning of their next renewal cycle.
78
+ *
79
+ * Existing programs will be updated in their next renewal cycle.
80
+ */
81
+ NEXT_RENEWAL = "NEXT_RENEWAL",
82
+ /**
83
+ * Updates the associated benefit pools to reflect the new or modified pool definition immediately.
84
+ *
85
+ * Existing programs will be updated immediately.
86
+ */
87
+ IMMEDIATELY = "IMMEDIATELY",
88
+ /**
89
+ * Updates the associated benefit pools to reflect the new or modified pool definition the next time the benefit pools are provisioned to a program.
90
+ *
91
+ * Existing programs will remain unaffected. Only newly purchased programs will display the benefits of this pool definition.
92
+ */
93
+ FUTURE_PROVISIONS = "FUTURE_PROVISIONS"
94
+ }
95
+ export interface DeleteProgramDefinitionResponse {
96
+ }
97
+ export interface GetProgramDefinitionRequest {
98
+ /** ID of the program definition to retrieve. */
99
+ programDefinitionId: string;
100
+ }
101
+ export interface GetProgramDefinitionResponse {
102
+ /** Retrieved program definition. */
103
+ programDefinition?: ProgramDefinition;
104
+ }
105
+ export interface GetProgramDefinitionByExternalIdAndNamespaceRequest {
106
+ /** Application sub-module that represents the source of the program definition. Specified by the external developer. This namespace is used to handle and retrieve program definition and associated programs. */
107
+ namespace: string;
108
+ /** External program definition ID. */
109
+ externalId: string;
110
+ }
111
+ export interface GetProgramDefinitionByExternalIdAndNamespaceResponse {
112
+ /** The retrieved program definition. */
113
+ programDefinition?: ProgramDefinition;
114
+ }
115
+ export interface QueryProgramDefinitionsRequest {
116
+ /** Query to select program definitions. */
117
+ query?: CursorQuery;
118
+ }
119
+ export interface CursorQuery extends CursorQueryPagingMethodOneOf {
120
+ /** 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`. */
121
+ cursorPaging?: CursorPaging;
122
+ /**
123
+ * Filter object in the following format:
124
+ * `"filter" : {
125
+ * "fieldName1": "value1",
126
+ * "fieldName2":{"$operator":"value2"}
127
+ * }`
128
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
129
+ */
130
+ filter?: Record<string, any> | null;
131
+ /**
132
+ * Sort object in the following format:
133
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
134
+ */
135
+ sort?: Sorting[];
136
+ }
137
+ /** @oneof */
138
+ export interface CursorQueryPagingMethodOneOf {
139
+ /** 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`. */
140
+ cursorPaging?: CursorPaging;
141
+ }
142
+ export interface Sorting {
143
+ /** Name of the field to sort by. */
144
+ fieldName?: string;
145
+ /** Sort order. */
146
+ order?: SortOrder;
147
+ }
148
+ export declare enum SortOrder {
149
+ /** Ascending sort order. */
150
+ ASC = "ASC",
151
+ /** Descending sort order. */
152
+ DESC = "DESC"
153
+ }
154
+ export interface CursorPaging {
155
+ /** Maximum number of items to return in the results. */
156
+ limit?: number | null;
157
+ /**
158
+ * Pointer to the next or previous page in the list of results.
159
+ *
160
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
161
+ * Not relevant for the first request.
162
+ */
163
+ cursor?: string | null;
164
+ }
165
+ export interface QueryProgramDefinitionsResponse {
166
+ /** List of program definitions. */
167
+ programDefinitions?: ProgramDefinition[];
168
+ /** Metadata for the paginated results. */
169
+ metadata?: CursorPagingMetadata;
170
+ }
171
+ export interface CursorPagingMetadata {
172
+ /** Number of items returned in the response. */
173
+ count?: number | null;
174
+ /** Cursor strings that point to the next page, previous page, or both. */
175
+ cursors?: Cursors;
176
+ /**
177
+ * Whether there are more pages to retrieve following the current page.
178
+ *
179
+ * + `true`: Another page of results can be retrieved.
180
+ * + `false`: This is the last page.
181
+ */
182
+ hasNext?: boolean | null;
183
+ }
184
+ export interface Cursors {
185
+ /** Cursor string pointing to the next page in the list of results. */
186
+ next?: string | null;
187
+ /** Cursor pointing to the previous page in the list of results. */
188
+ prev?: string | null;
189
+ }
190
+ export interface UpsertProgramDefinitionRequest {
191
+ /** Program definition to be created or updated. */
192
+ programDefinition?: ProgramDefinition;
193
+ }
194
+ export interface UpsertProgramDefinitionResponse {
195
+ /** Created or updated program definition. */
196
+ programDefinition?: ProgramDefinition;
197
+ }
198
+ export interface GetOrCreateProgramDefinitionRequest {
199
+ /** Application sub-module that represents the source of the program definition. Specified by the external developer. This namespace is used to handle and retrieve program definition and associated programs. */
200
+ namespace?: string;
201
+ /** External program definition ID. */
202
+ externalId?: string;
203
+ }
204
+ export interface GetOrCreateProgramDefinitionResponse {
205
+ /** The created or updated program definition. */
206
+ programDefinition?: ProgramDefinition;
207
+ }
208
+ export interface DomainEvent extends DomainEventBodyOneOf {
209
+ createdEvent?: EntityCreatedEvent;
210
+ updatedEvent?: EntityUpdatedEvent;
211
+ deletedEvent?: EntityDeletedEvent;
212
+ actionEvent?: ActionEvent;
213
+ /**
214
+ * Unique event ID.
215
+ * Allows clients to ignore duplicate webhooks.
216
+ */
217
+ _id?: string;
218
+ /**
219
+ * Assumes actions are also always typed to an entity_type
220
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
221
+ */
222
+ entityFqdn?: string;
223
+ /**
224
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
225
+ * This is although the created/updated/deleted notion is duplication of the oneof types
226
+ * Example: created/updated/deleted/started/completed/email_opened
227
+ */
228
+ slug?: string;
229
+ /** ID of the entity associated with the event. */
230
+ entityId?: string;
231
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
232
+ eventTime?: Date | null;
233
+ /**
234
+ * Whether the event was triggered as a result of a privacy regulation application
235
+ * (for example, GDPR).
236
+ */
237
+ triggeredByAnonymizeRequest?: boolean | null;
238
+ /** If present, indicates the action that triggered the event. */
239
+ originatedFrom?: string | null;
240
+ /**
241
+ * A sequence number defining the order of updates to the underlying entity.
242
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
243
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
244
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
245
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
246
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
247
+ */
248
+ entityEventSequence?: string | null;
249
+ }
250
+ /** @oneof */
251
+ export interface DomainEventBodyOneOf {
252
+ createdEvent?: EntityCreatedEvent;
253
+ updatedEvent?: EntityUpdatedEvent;
254
+ deletedEvent?: EntityDeletedEvent;
255
+ actionEvent?: ActionEvent;
256
+ }
257
+ export interface EntityCreatedEvent {
258
+ entity?: string;
259
+ }
260
+ export interface RestoreInfo {
261
+ deletedDate?: Date | null;
262
+ }
263
+ export interface EntityUpdatedEvent {
264
+ /**
265
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
266
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
267
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
268
+ */
269
+ currentEntity?: string;
270
+ }
271
+ export interface EntityDeletedEvent {
272
+ /** Entity that was deleted */
273
+ deletedEntity?: string | null;
274
+ }
275
+ export interface ActionEvent {
276
+ body?: string;
277
+ }
278
+ export interface MessageEnvelope {
279
+ /** App instance ID. */
280
+ instanceId?: string | null;
281
+ /** Event type. */
282
+ eventType?: string;
283
+ /** The identification type and identity data. */
284
+ identity?: IdentificationData;
285
+ /** Stringify payload. */
286
+ data?: string;
287
+ }
288
+ export interface IdentificationData extends IdentificationDataIdOneOf {
289
+ /** ID of a site visitor that has not logged in to the site. */
290
+ anonymousVisitorId?: string;
291
+ /** ID of a site visitor that has logged in to the site. */
292
+ memberId?: string;
293
+ /** ID of a Wix user (site owner, contributor, etc.). */
294
+ wixUserId?: string;
295
+ /** ID of an app. */
296
+ appId?: string;
297
+ /** @readonly */
298
+ identityType?: WebhookIdentityType;
299
+ }
300
+ /** @oneof */
301
+ export interface IdentificationDataIdOneOf {
302
+ /** ID of a site visitor that has not logged in to the site. */
303
+ anonymousVisitorId?: string;
304
+ /** ID of a site visitor that has logged in to the site. */
305
+ memberId?: string;
306
+ /** ID of a Wix user (site owner, contributor, etc.). */
307
+ wixUserId?: string;
308
+ /** ID of an app. */
309
+ appId?: string;
310
+ }
311
+ export declare enum WebhookIdentityType {
312
+ UNKNOWN = "UNKNOWN",
313
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
314
+ MEMBER = "MEMBER",
315
+ WIX_USER = "WIX_USER",
316
+ APP = "APP"
317
+ }
318
+ /**
319
+ * Creates a new program definition.
320
+ * @param programDefinition - Program definition to create.
321
+ * @public
322
+ * @documentationMaturity preview
323
+ * @requiredField programDefinition
324
+ * @requiredField programDefinition.externalId
325
+ * @requiredField programDefinition.namespace
326
+ * @permissionId BENEFIT_PROGRAMS.PROGRAM_DEFINITION_CREATE
327
+ * @returns Created program definition.
328
+ * @fqn wix.benefit_programs.v1.program_definition.ProgramDefinitionService.CreateProgramDefinition
329
+ */
330
+ export declare function createProgramDefinition(programDefinition: ProgramDefinition): Promise<ProgramDefinition>;
331
+ /**
332
+ * Updates a program definition.
333
+ *
334
+ * Each time the program definition is updated,
335
+ * `revision` increments by 1.
336
+ * The current `revision` must be passed when updating the program definition.
337
+ * This ensures you're working with the latest program definition
338
+ * and prevents unintended overwrites.
339
+ * @param _id - Program definition ID.
340
+ * @public
341
+ * @documentationMaturity preview
342
+ * @requiredField _id
343
+ * @requiredField programDefinition
344
+ * @requiredField programDefinition.revision
345
+ * @permissionId BENEFIT_PROGRAMS.PROGRAM_DEFINITION_UPDATE
346
+ * @returns Updated program definition.
347
+ * @fqn wix.benefit_programs.v1.program_definition.ProgramDefinitionService.UpdateProgramDefinition
348
+ */
349
+ export declare function updateProgramDefinition(_id: string | null, programDefinition: UpdateProgramDefinition): Promise<ProgramDefinition>;
350
+ export interface UpdateProgramDefinition {
351
+ /**
352
+ * Program definition ID.
353
+ * @readonly
354
+ */
355
+ _id?: string | null;
356
+ /**
357
+ * Revision number, which increments by 1 each time the program definition is updated.
358
+ * To prevent conflicting changes, the current revision must be passed when updating the program definition.
359
+ *
360
+ * Ignored when creating a program definition.
361
+ * @readonly
362
+ */
363
+ revision?: string | null;
364
+ /**
365
+ * Date and time the program definition was created.
366
+ * @readonly
367
+ */
368
+ _createdDate?: Date | null;
369
+ /**
370
+ * Date and time the program definition was updated.
371
+ * @readonly
372
+ */
373
+ _updatedDate?: Date | null;
374
+ /** Name of the program associated with this program definition. This name will be the same for all programs provisioned from this program definition. */
375
+ displayName?: string | null;
376
+ /** Application sub-module that represents the source of the program definition. Specified by the external developer. This namespace is used to handle and retrieve program definition and associated programs. */
377
+ namespace?: string | null;
378
+ /**
379
+ * Custom field data for the program definition object.
380
+ * [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls.
381
+ */
382
+ extendedFields?: ExtendedFields;
383
+ /** External program definition ID designated by the app owner. */
384
+ externalId?: string | null;
385
+ }
386
+ /**
387
+ * Deletes a program definition.
388
+ * @param programDefinitionId - ID of the ProgramDefinition to delete.
389
+ * @public
390
+ * @documentationMaturity preview
391
+ * @requiredField programDefinitionId
392
+ * @permissionId BENEFIT_PROGRAMS.PROGRAM_DEFINITION_DELETE
393
+ * @fqn wix.benefit_programs.v1.program_definition.ProgramDefinitionService.DeleteProgramDefinition
394
+ */
395
+ export declare function deleteProgramDefinition(programDefinitionId: string, options?: DeleteProgramDefinitionOptions): Promise<void>;
396
+ export interface DeleteProgramDefinitionOptions {
397
+ /**
398
+ * Specifies the timing of ending the active benefit pools associated with this program definition.
399
+ * Determines how and when changes are applied to benefit pools.
400
+ */
401
+ cascadeType?: Cascade;
402
+ }
403
+ /**
404
+ * Retrieves a program definition.
405
+ * @param programDefinitionId - ID of the program definition to retrieve.
406
+ * @public
407
+ * @documentationMaturity preview
408
+ * @requiredField programDefinitionId
409
+ * @permissionId BENEFIT_PROGRAMS.PROGRAM_DEFINITION_READ
410
+ * @applicableIdentity VISITOR
411
+ * @returns Retrieved program definition.
412
+ * @fqn wix.benefit_programs.v1.program_definition.ProgramDefinitionService.GetProgramDefinition
413
+ */
414
+ export declare function getProgramDefinition(programDefinitionId: string): Promise<ProgramDefinition>;
415
+ /**
416
+ * Retrieves a program definition by specifying the program definition's external ID and associated namespace.
417
+ *
418
+ * Use this method when you need to retrieve a program definition without its program definition ID.
419
+ * @param namespace - Application sub-module that represents the source of the program definition. Specified by the external developer. This namespace is used to handle and retrieve program definition and associated programs.
420
+ * @public
421
+ * @documentationMaturity preview
422
+ * @requiredField namespace
423
+ * @requiredField options
424
+ * @requiredField options.externalId
425
+ * @permissionId BENEFIT_PROGRAMS.PROGRAM_DEFINITION_READ
426
+ * @applicableIdentity VISITOR
427
+ * @fqn wix.benefit_programs.v1.program_definition.ProgramDefinitionService.GetProgramDefinitionByExternalIdAndNamespace
428
+ */
429
+ export declare function getProgramDefinitionByExternalIdAndNamespace(namespace: string, options: GetProgramDefinitionByExternalIdAndNamespaceOptions): Promise<GetProgramDefinitionByExternalIdAndNamespaceResponse>;
430
+ export interface GetProgramDefinitionByExternalIdAndNamespaceOptions {
431
+ /** External program definition ID. */
432
+ externalId: string;
433
+ }
434
+ /**
435
+ * Creates a query to retrieve a list of program definitions.
436
+ *
437
+ * The `queryProgramDefinitions()` method builds a query to retrieve a list of program definitions and returns a `ProgramDefinitionsQueryBuilder` object.
438
+ *
439
+ * The returned object contains the query definition, which is used to run the query using the [`find()`](/program-definitions/program-definitions-query-builder/find) function.
440
+ *
441
+ * You can refine the query by chaining `ProgramDefinitionsQueryBuilder` methods onto the query. `ProgramDefinitionsQueryBuilder` methods enable you to filter, sort, and control the results that `queryProgramDefinitions()` returns.
442
+ *
443
+ * The following `ProgramDefinitionsQueryBuilder` functions are supported for `queryProgramDefinitions()`. For a full description of the program definition object, see the object returned for the [`items`](/program-definitions/program-definitions-query-result/items) property in `ProgramDefinitionsQueryResult`.
444
+ * @public
445
+ * @documentationMaturity preview
446
+ * @permissionId BENEFIT_PROGRAMS.PROGRAM_DEFINITION_READ
447
+ * @applicableIdentity VISITOR
448
+ * @fqn wix.benefit_programs.v1.program_definition.ProgramDefinitionService.QueryProgramDefinitions
449
+ */
450
+ export declare function queryProgramDefinitions(): ProgramDefinitionsQueryBuilder;
451
+ interface QueryCursorResult {
452
+ cursors: Cursors;
453
+ hasNext: () => boolean;
454
+ hasPrev: () => boolean;
455
+ length: number;
456
+ pageSize: number;
457
+ }
458
+ export interface ProgramDefinitionsQueryResult extends QueryCursorResult {
459
+ items: ProgramDefinition[];
460
+ query: ProgramDefinitionsQueryBuilder;
461
+ next: () => Promise<ProgramDefinitionsQueryResult>;
462
+ prev: () => Promise<ProgramDefinitionsQueryResult>;
463
+ }
464
+ export interface ProgramDefinitionsQueryBuilder {
465
+ /** @param propertyName - Property whose value is compared with `value`.
466
+ * @param value - Value to compare against.
467
+ * @documentationMaturity preview
468
+ */
469
+ eq: (propertyName: '_id' | '_createdDate' | 'namespace' | 'externalId', value: any) => ProgramDefinitionsQueryBuilder;
470
+ /** @param propertyName - Property whose value is compared with `value`.
471
+ * @param value - Value to compare against.
472
+ * @documentationMaturity preview
473
+ */
474
+ ne: (propertyName: '_id' | '_createdDate' | 'namespace' | 'externalId', value: any) => ProgramDefinitionsQueryBuilder;
475
+ /** @param propertyName - Property whose value is compared with `value`.
476
+ * @param value - Value to compare against.
477
+ * @documentationMaturity preview
478
+ */
479
+ ge: (propertyName: '_createdDate', value: any) => ProgramDefinitionsQueryBuilder;
480
+ /** @param propertyName - Property whose value is compared with `value`.
481
+ * @param value - Value to compare against.
482
+ * @documentationMaturity preview
483
+ */
484
+ gt: (propertyName: '_createdDate', value: any) => ProgramDefinitionsQueryBuilder;
485
+ /** @param propertyName - Property whose value is compared with `value`.
486
+ * @param value - Value to compare against.
487
+ * @documentationMaturity preview
488
+ */
489
+ le: (propertyName: '_createdDate', value: any) => ProgramDefinitionsQueryBuilder;
490
+ /** @param propertyName - Property whose value is compared with `value`.
491
+ * @param value - Value to compare against.
492
+ * @documentationMaturity preview
493
+ */
494
+ lt: (propertyName: '_createdDate', value: any) => ProgramDefinitionsQueryBuilder;
495
+ /** @param propertyName - Property whose value is compared with `string`.
496
+ * @param string - String to compare against. Case-insensitive.
497
+ * @documentationMaturity preview
498
+ */
499
+ startsWith: (propertyName: '_id' | 'namespace' | 'externalId', value: string) => ProgramDefinitionsQueryBuilder;
500
+ /** @param propertyName - Property whose value is compared with `values`.
501
+ * @param values - List of values to compare against.
502
+ * @documentationMaturity preview
503
+ */
504
+ hasSome: (propertyName: '_id' | '_createdDate' | 'namespace' | 'externalId', value: any[]) => ProgramDefinitionsQueryBuilder;
505
+ /** @documentationMaturity preview */
506
+ in: (propertyName: '_id' | '_createdDate' | 'namespace' | 'externalId', value: any) => ProgramDefinitionsQueryBuilder;
507
+ /** @documentationMaturity preview */
508
+ exists: (propertyName: '_id' | '_createdDate' | 'namespace' | 'externalId', value: boolean) => ProgramDefinitionsQueryBuilder;
509
+ /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
510
+ * @documentationMaturity preview
511
+ */
512
+ ascending: (...propertyNames: Array<'_id' | '_createdDate' | 'namespace' | 'externalId'>) => ProgramDefinitionsQueryBuilder;
513
+ /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
514
+ * @documentationMaturity preview
515
+ */
516
+ descending: (...propertyNames: Array<'_id' | '_createdDate' | 'namespace' | 'externalId'>) => ProgramDefinitionsQueryBuilder;
517
+ /** @param limit - Number of items to return, which is also the `pageSize` of the results object.
518
+ * @documentationMaturity preview
519
+ */
520
+ limit: (limit: number) => ProgramDefinitionsQueryBuilder;
521
+ /** @param cursor - A pointer to specific record
522
+ * @documentationMaturity preview
523
+ */
524
+ skipTo: (cursor: string) => ProgramDefinitionsQueryBuilder;
525
+ /** @documentationMaturity preview */
526
+ find: () => Promise<ProgramDefinitionsQueryResult>;
527
+ }
528
+ export {};