@wix/riseevent 1.0.13 → 1.0.14

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 (48) hide show
  1. package/build/cjs/context.d.ts +1 -0
  2. package/build/cjs/context.js +28 -0
  3. package/build/cjs/context.js.map +1 -0
  4. package/build/cjs/index.d.ts +2 -1
  5. package/build/cjs/index.js +7 -2
  6. package/build/cjs/index.js.map +1 -1
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +28 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/es/context.d.ts +1 -0
  11. package/build/es/context.js +2 -0
  12. package/build/es/context.js.map +1 -0
  13. package/build/es/index.d.ts +2 -1
  14. package/build/es/index.js +2 -1
  15. package/build/es/index.js.map +1 -1
  16. package/build/es/meta.d.ts +1 -0
  17. package/build/es/meta.js +2 -0
  18. package/build/es/meta.js.map +1 -0
  19. package/context/package.json +7 -0
  20. package/meta/package.json +7 -0
  21. package/package.json +26 -8
  22. package/type-bundles/context.bundle.d.ts +1225 -0
  23. package/type-bundles/index.bundle.d.ts +1225 -0
  24. package/type-bundles/meta.bundle.d.ts +441 -0
  25. package/build/cjs/src/rise-v1-event.http.d.ts +0 -18
  26. package/build/cjs/src/rise-v1-event.http.js +0 -190
  27. package/build/cjs/src/rise-v1-event.http.js.map +0 -1
  28. package/build/cjs/src/rise-v1-event.public.d.ts +0 -12
  29. package/build/cjs/src/rise-v1-event.public.js +0 -40
  30. package/build/cjs/src/rise-v1-event.public.js.map +0 -1
  31. package/build/cjs/src/rise-v1-event.types.d.ts +0 -446
  32. package/build/cjs/src/rise-v1-event.types.js +0 -22
  33. package/build/cjs/src/rise-v1-event.types.js.map +0 -1
  34. package/build/cjs/src/rise-v1-event.universal.d.ts +0 -548
  35. package/build/cjs/src/rise-v1-event.universal.js +0 -346
  36. package/build/cjs/src/rise-v1-event.universal.js.map +0 -1
  37. package/build/es/src/rise-v1-event.http.d.ts +0 -18
  38. package/build/es/src/rise-v1-event.http.js +0 -182
  39. package/build/es/src/rise-v1-event.http.js.map +0 -1
  40. package/build/es/src/rise-v1-event.public.d.ts +0 -12
  41. package/build/es/src/rise-v1-event.public.js +0 -29
  42. package/build/es/src/rise-v1-event.public.js.map +0 -1
  43. package/build/es/src/rise-v1-event.types.d.ts +0 -446
  44. package/build/es/src/rise-v1-event.types.js +0 -19
  45. package/build/es/src/rise-v1-event.types.js.map +0 -1
  46. package/build/es/src/rise-v1-event.universal.d.ts +0 -548
  47. package/build/es/src/rise-v1-event.universal.js +0 -319
  48. package/build/es/src/rise-v1-event.universal.js.map +0 -1
@@ -1,548 +0,0 @@
1
- export declare const __debug: {
2
- verboseLogging: {
3
- on: () => boolean;
4
- off: () => boolean;
5
- };
6
- };
7
- /** Event is the main entity of EventService */
8
- export interface Event {
9
- /**
10
- * Event ID
11
- * @readonly
12
- */
13
- _id?: string | null;
14
- /** Represents the current state of an item. Each time the item is modified, its `revision` changes. For an update operation to succeed, you MUST pass the latest revision */
15
- revision?: string | null;
16
- /**
17
- * Represents the time this Event was created
18
- * @readonly
19
- */
20
- _createdDate?: Date;
21
- /**
22
- * Represents the time this Event was last updated
23
- * @readonly
24
- */
25
- _updatedDate?: Date;
26
- /** Wallet ID */
27
- walletId?: string;
28
- /** Represents the time when the event's amount will be added to the account */
29
- startDate?: Date;
30
- /** Represents the time when the unused balance will be deducted from the account */
31
- expiresAt?: Date;
32
- /** Represents the time when the event was manually disabled */
33
- disabledAt?: Date;
34
- /** The amount to be added to the customer */
35
- amount?: string;
36
- /** Free text comment regarding the Event context */
37
- note?: string | null;
38
- /** Indicates the kind of the specific event */
39
- type?: EventType;
40
- /**
41
- * The transactionId that added the event's amount;
42
- * @readonly
43
- */
44
- eventAddedTransactionId?: string | null;
45
- /**
46
- * The transactionId that removed the remaining event's balance;
47
- * @readonly
48
- */
49
- eventRemovedTransactionId?: string | null;
50
- status?: EventStatus;
51
- }
52
- export declare enum EventType {
53
- UNKNOWN = "UNKNOWN",
54
- REWARD = "REWARD",
55
- REFUND = "REFUND"
56
- }
57
- export declare enum EventStatus {
58
- PENDING = "PENDING",
59
- ACTIVE = "ACTIVE",
60
- DISABLED = "DISABLED",
61
- EXPIRED = "EXPIRED"
62
- }
63
- export interface CreateEventRequest {
64
- /** Event to be created */
65
- event: Event;
66
- }
67
- export interface CreateEventResponse {
68
- /** The created Event */
69
- event?: Event;
70
- }
71
- export interface EventCreationExpirationDateInThePastDetails {
72
- /** The date when the event expires. */
73
- expiresAt?: Date;
74
- /** The date when the event was tried to be created. */
75
- currentDate?: Date;
76
- }
77
- export interface EventCreationStartLaterThanExpirationDetails {
78
- /** The start date of the event. */
79
- startDate?: Date;
80
- /** The date when the event expires. */
81
- expiresAt?: Date;
82
- }
83
- export interface EventCreationDisabledAtDateSetDetails {
84
- /** Represents the time when the event was disabled. */
85
- disabledAt?: Date;
86
- }
87
- export interface GetEventRequest {
88
- /** ID of the Event to retrieve */
89
- eventId: string;
90
- }
91
- export interface GetEventResponse {
92
- /** The retrieved Event */
93
- event?: Event;
94
- }
95
- export interface UpdateEventRequest {
96
- /** Event to be updated, may be partial */
97
- event: Event;
98
- }
99
- export interface UpdateEventResponse {
100
- /** The updated Event */
101
- event?: Event;
102
- }
103
- export interface InvalidEventDetails {
104
- /** Event ID. */
105
- eventId?: string;
106
- }
107
- export interface EventUpdateStartDateInThePastDetails {
108
- /** Event ID. */
109
- eventId?: string;
110
- /** The date when the event expires. */
111
- newStartDate?: Date;
112
- /** The date when the event was tried to be updated. */
113
- currentDate?: Date;
114
- }
115
- export interface EventUpdateExpirationDateInThePastDetails {
116
- /** Event ID. */
117
- eventId?: string;
118
- /** The date when the event expires. */
119
- newExpiresAt?: Date;
120
- /** The date when the event was tried to be updated. */
121
- currentDate?: Date;
122
- }
123
- export interface EventUpdateStartLaterThanExpirationDetails {
124
- /** Event ID. */
125
- eventId?: string;
126
- /** The start date of the event. */
127
- startDate?: Date;
128
- /** The date when the event expires. */
129
- expiresAt?: Date;
130
- }
131
- export interface DisableEventRequest {
132
- /** ID of the Event to delete */
133
- eventId: string;
134
- /** The revision of the Event */
135
- revision: string;
136
- }
137
- export interface DisableEventResponse {
138
- /** The expired Event */
139
- event?: Event;
140
- }
141
- export interface EventDisabled {
142
- event?: Event;
143
- }
144
- export interface DeleteEventRequest {
145
- /** ID of the Event to delete */
146
- eventId?: string;
147
- /** The revision of the Event */
148
- revision?: string;
149
- }
150
- export interface DeleteEventResponse {
151
- }
152
- export interface QueryEventRequest {
153
- /** WQL expression */
154
- query?: QueryV2;
155
- }
156
- export interface QueryV2 extends QueryV2PagingMethodOneOf {
157
- /** Paging options to limit and skip the number of items. */
158
- paging?: Paging;
159
- /** 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`. */
160
- cursorPaging?: CursorPaging;
161
- /**
162
- * Filter object in the following format:
163
- * `"filter" : {
164
- * "fieldName1": "value1",
165
- * "fieldName2":{"$operator":"value2"}
166
- * }`
167
- * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
168
- */
169
- filter?: Record<string, any> | null;
170
- /**
171
- * Sort object in the following format:
172
- * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
173
- */
174
- sort?: Sorting[];
175
- /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */
176
- fields?: string[];
177
- /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */
178
- fieldsets?: string[];
179
- }
180
- /** @oneof */
181
- export interface QueryV2PagingMethodOneOf {
182
- /** Paging options to limit and skip the number of items. */
183
- paging?: Paging;
184
- /** 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`. */
185
- cursorPaging?: CursorPaging;
186
- }
187
- export interface Sorting {
188
- /** Name of the field to sort by. */
189
- fieldName?: string;
190
- /** Sort order. */
191
- order?: SortOrder;
192
- }
193
- export declare enum SortOrder {
194
- ASC = "ASC",
195
- DESC = "DESC"
196
- }
197
- export interface Paging {
198
- /** Number of items to load. */
199
- limit?: number | null;
200
- /** Number of items to skip in the current sort order. */
201
- offset?: number | null;
202
- }
203
- export interface CursorPaging {
204
- /** Number of items to load. */
205
- limit?: number | null;
206
- /**
207
- * Pointer to the next or previous page in the list of results.
208
- *
209
- * You can get the relevant cursor token
210
- * from the `pagingMetadata` object in the previous call's response.
211
- * Not relevant for the first request.
212
- */
213
- cursor?: string | null;
214
- }
215
- export interface QueryEventResponse {
216
- /** The retrieved Events */
217
- events?: Event[];
218
- pagingMetadata?: PagingMetadataV2;
219
- }
220
- export interface PagingMetadataV2 {
221
- /** Number of items returned in the response. */
222
- count?: number | null;
223
- /** Offset that was requested. */
224
- offset?: number | null;
225
- /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
226
- total?: number | null;
227
- /** Flag that indicates the server failed to calculate the `total` field. */
228
- tooManyToCount?: boolean | null;
229
- /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
230
- cursors?: Cursors;
231
- }
232
- export interface Cursors {
233
- /** Cursor pointing to next page in the list of results. */
234
- next?: string | null;
235
- /** Cursor pointing to previous page in the list of results. */
236
- prev?: string | null;
237
- }
238
- export interface QueryEventBalancesRequest {
239
- /** WQL expression */
240
- query: QueryV2;
241
- }
242
- export interface QueryEventBalancesResponse {
243
- /** The retrieved Events with their balance */
244
- events?: EventWithBalance[];
245
- pagingMetadata?: PagingMetadataV2;
246
- }
247
- export interface EventWithBalance {
248
- /** Event */
249
- event?: Event;
250
- /** Event balance */
251
- balance?: string | null;
252
- }
253
- export interface Task extends TaskTriggerOneOf {
254
- /** A trigger which will fire once at a specified timestamp */
255
- oneTime?: Date;
256
- /**
257
- * A recurrent trigger defined by a specified cron expression.
258
- *
259
- * Cron expression is a string of five space-separated sub-expressions
260
- *
261
- * * * * * *
262
- * | | | | |
263
- * minute of hour | | | day of week
264
- * hour of day | month of year
265
- * day of month
266
- *
267
- * Field Accepted values
268
- * ----- ---------------
269
- * minute of hour 0..59 / * ,
270
- * hour of day 0..23 / * ,
271
- * day of month 1..31 / * , W L
272
- * month of year 1..12 / * ,
273
- * day of week 0..7 MON..SUN / * W L #
274
- *
275
- * Coma separates multiple values:
276
- * 0,20,40 * * * * => on 0th, 20th and 40th minute
277
- * Slash selects every Nth value:
278
- * * /20 * * * * => equivalent to 0,20,40
279
- * 5/20 * * * * => on 5th, 25th and 45th minute
280
- * W selects working days
281
- * 0 2 * * W => 2am on Mon..Fri
282
- * L selects the last day of ...
283
- * 0 0 L * * => last day of each month
284
- * 0 0 LW * * => last working day of each month
285
- * 0 0 * * FRIL => midnight of the last Friday of the month
286
- * Hash selects Nth day of week
287
- * 0 0 * * Mon#1 => midnight of the first Monday of the month
288
- *
289
- * Following aliases are supported: @hourly, @daily, @weekly, @monthly
290
- *
291
- * The first execution time will be evaluated based on the client invocation time (approximately the moment the
292
- * client call returns).
293
- * All executions will be evaluated in UTC.
294
- *
295
- * Example:
296
- * 00:19:59 - client schedules a task with cron = 0/20 * * * * (every 20-th minute of the hour)
297
- * 00:20:02 - task reaches Time Capsule database
298
- * 00:21:00 - task is executed by Time Capsule, the client is triggered with a ~1 minute delay
299
- * 00:40:00 - task is executed by Time Capsule according to the schedule with no delay
300
- */
301
- cron?: string;
302
- /** Task id */
303
- _id?: TaskId;
304
- /** Task payload */
305
- payload?: Record<string, any> | null;
306
- /**
307
- * A Greyhound topic to which the task will be produced when triggered
308
- * @readonly
309
- */
310
- topic?: string;
311
- /**
312
- * The time when this task is scheduled to trigger. For reoccurring tasks, this will be hold the next time this task will run and will be updated after every run
313
- * @readonly
314
- */
315
- scheduledFor?: Date;
316
- }
317
- /** @oneof */
318
- export interface TaskTriggerOneOf {
319
- /** A trigger which will fire once at a specified timestamp */
320
- oneTime?: Date;
321
- /**
322
- * A recurrent trigger defined by a specified cron expression.
323
- *
324
- * Cron expression is a string of five space-separated sub-expressions
325
- *
326
- * * * * * *
327
- * | | | | |
328
- * minute of hour | | | day of week
329
- * hour of day | month of year
330
- * day of month
331
- *
332
- * Field Accepted values
333
- * ----- ---------------
334
- * minute of hour 0..59 / * ,
335
- * hour of day 0..23 / * ,
336
- * day of month 1..31 / * , W L
337
- * month of year 1..12 / * ,
338
- * day of week 0..7 MON..SUN / * W L #
339
- *
340
- * Coma separates multiple values:
341
- * 0,20,40 * * * * => on 0th, 20th and 40th minute
342
- * Slash selects every Nth value:
343
- * * /20 * * * * => equivalent to 0,20,40
344
- * 5/20 * * * * => on 5th, 25th and 45th minute
345
- * W selects working days
346
- * 0 2 * * W => 2am on Mon..Fri
347
- * L selects the last day of ...
348
- * 0 0 L * * => last day of each month
349
- * 0 0 LW * * => last working day of each month
350
- * 0 0 * * FRIL => midnight of the last Friday of the month
351
- * Hash selects Nth day of week
352
- * 0 0 * * Mon#1 => midnight of the first Monday of the month
353
- *
354
- * Following aliases are supported: @hourly, @daily, @weekly, @monthly
355
- *
356
- * The first execution time will be evaluated based on the client invocation time (approximately the moment the
357
- * client call returns).
358
- * All executions will be evaluated in UTC.
359
- *
360
- * Example:
361
- * 00:19:59 - client schedules a task with cron = 0/20 * * * * (every 20-th minute of the hour)
362
- * 00:20:02 - task reaches Time Capsule database
363
- * 00:21:00 - task is executed by Time Capsule, the client is triggered with a ~1 minute delay
364
- * 00:40:00 - task is executed by Time Capsule according to the schedule with no delay
365
- */
366
- cron?: string;
367
- }
368
- export interface TaskId {
369
- /** A unique identifier of an application or a source that define the task. In most cases this would be the appDefId */
370
- namespace?: string;
371
- /**
372
- * A free-form string distinguishing different families of tasks within a namespace.
373
- * For example: "send-promo-email", "ClearTrashBin", "premium expiration reminder"
374
- */
375
- taskType?: string;
376
- /**
377
- * A free-form string that together with `namespace` and `task_type` uniquely identifies a task.
378
- * When there is an entity involved, setting this to be equal to the ID of an entity related to the task is a good option.
379
- */
380
- key?: string;
381
- }
382
- export interface Empty {
383
- }
384
- export interface EventExpired {
385
- event?: Event;
386
- }
387
- export interface DomainEvent extends DomainEventBodyOneOf {
388
- createdEvent?: EntityCreatedEvent;
389
- updatedEvent?: EntityUpdatedEvent;
390
- deletedEvent?: EntityDeletedEvent;
391
- actionEvent?: ActionEvent;
392
- /** random GUID so clients can tell if event was already handled */
393
- _id?: string;
394
- /**
395
- * Assumes actions are also always typed to an entity_type
396
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
397
- */
398
- entityFqdn?: string;
399
- /**
400
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
401
- * This is although the created/updated/deleted notion is duplication of the oneof types
402
- * Example: created/updated/deleted/started/completed/email_opened
403
- */
404
- slug?: string;
405
- /**
406
- * Assuming that all messages including Actions have id
407
- * Example: The id of the specific order, the id of a specific campaign
408
- */
409
- entityId?: string;
410
- /** The time of the event. Useful if there was a delay in dispatching */
411
- eventTime?: Date;
412
- /**
413
- * A field that should be set if this event was triggered by an anonymize request.
414
- * For example you must set it to true when sending an event as a result of a GDPR right to be forgotten request.
415
- * NOTE: This field is not relevant for `EntityCreatedEvent` but is located here for better ergonomics of consumers.
416
- */
417
- triggeredByAnonymizeRequest?: boolean | null;
418
- /** If present, indicates the action that triggered the event. */
419
- originatedFrom?: string | null;
420
- /**
421
- * A sequence number defining the order of updates to the underlying entity.
422
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
423
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
424
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
425
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
426
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
427
- */
428
- entityEventSequence?: string | null;
429
- }
430
- /** @oneof */
431
- export interface DomainEventBodyOneOf {
432
- createdEvent?: EntityCreatedEvent;
433
- updatedEvent?: EntityUpdatedEvent;
434
- deletedEvent?: EntityDeletedEvent;
435
- actionEvent?: ActionEvent;
436
- }
437
- export interface EntityCreatedEvent {
438
- entityAsJson?: string;
439
- }
440
- export interface EntityUpdatedEvent {
441
- /**
442
- * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
443
- * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
444
- * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
445
- */
446
- currentEntityAsJson?: string;
447
- }
448
- export interface EntityDeletedEvent {
449
- }
450
- export interface ActionEvent {
451
- bodyAsJson?: string;
452
- }
453
- /**
454
- * Creates a new Event
455
- * @param event - Event to be created
456
- * @public
457
- * @documentationMaturity preview
458
- * @requiredField event
459
- * @requiredField event.amount
460
- * @requiredField event.type
461
- * @requiredField event.walletId
462
- * @returns The created Event
463
- */
464
- export declare function createEvent(event: Event): Promise<Event>;
465
- /**
466
- * Get an Event by ID
467
- * @param eventId - ID of the Event to retrieve
468
- * @public
469
- * @documentationMaturity preview
470
- * @requiredField eventId
471
- * @returns The retrieved Event
472
- */
473
- export declare function getEvent(eventId: string): Promise<Event>;
474
- /**
475
- * Update an Event, supports partial update
476
- * Pass the latest `revision` for a successful update
477
- * @param _id - Event ID
478
- * @public
479
- * @documentationMaturity preview
480
- * @requiredField _id
481
- * @requiredField event
482
- * @requiredField event.revision
483
- * @returns The updated Event
484
- */
485
- export declare function updateEvent(_id: string | null, event: UpdateEvent): Promise<Event>;
486
- export interface UpdateEvent {
487
- /**
488
- * Event ID
489
- * @readonly
490
- */
491
- _id?: string | null;
492
- /** Represents the current state of an item. Each time the item is modified, its `revision` changes. For an update operation to succeed, you MUST pass the latest revision */
493
- revision?: string | null;
494
- /**
495
- * Represents the time this Event was created
496
- * @readonly
497
- */
498
- _createdDate?: Date;
499
- /**
500
- * Represents the time this Event was last updated
501
- * @readonly
502
- */
503
- _updatedDate?: Date;
504
- /** Wallet ID */
505
- walletId?: string;
506
- /** Represents the time when the event's amount will be added to the account */
507
- startDate?: Date;
508
- /** Represents the time when the unused balance will be deducted from the account */
509
- expiresAt?: Date;
510
- /** Represents the time when the event was manually disabled */
511
- disabledAt?: Date;
512
- /** The amount to be added to the customer */
513
- amount?: string;
514
- /** Free text comment regarding the Event context */
515
- note?: string | null;
516
- /** Indicates the kind of the specific event */
517
- type?: EventType;
518
- /**
519
- * The transactionId that added the event's amount;
520
- * @readonly
521
- */
522
- eventAddedTransactionId?: string | null;
523
- /**
524
- * The transactionId that removed the remaining event's balance;
525
- * @readonly
526
- */
527
- eventRemovedTransactionId?: string | null;
528
- status?: EventStatus;
529
- }
530
- /**
531
- * Expire an Event immediately and deducting the remaining balance from the gift card
532
- * @param eventId - ID of the Event to delete
533
- * @param revision - The revision of the Event
534
- * @public
535
- * @documentationMaturity preview
536
- * @requiredField eventId
537
- * @requiredField revision
538
- */
539
- export declare function disableEvent(eventId: string, revision: string): Promise<DisableEventResponse>;
540
- /**
541
- * Query Events using [WQL - Wix Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language)
542
- * Results will be enriched with calculated balances
543
- * @param query - WQL expression
544
- * @public
545
- * @documentationMaturity preview
546
- * @requiredField query
547
- */
548
- export declare function queryEventBalances(query: QueryV2): Promise<QueryEventBalancesResponse>;