@wix/riseevent 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.
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +24 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/src/rise-v1-event.http.d.ts +18 -0
- package/build/cjs/src/rise-v1-event.http.js +165 -0
- package/build/cjs/src/rise-v1-event.http.js.map +1 -0
- package/build/cjs/src/rise-v1-event.public.d.ts +12 -0
- package/build/cjs/src/rise-v1-event.public.js +38 -0
- package/build/cjs/src/rise-v1-event.public.js.map +1 -0
- package/build/cjs/src/rise-v1-event.types.d.ts +328 -0
- package/build/cjs/src/rise-v1-event.types.js +9 -0
- package/build/cjs/src/rise-v1-event.types.js.map +1 -0
- package/build/cjs/src/rise-v1-event.universal.d.ts +416 -0
- package/build/cjs/src/rise-v1-event.universal.js +330 -0
- package/build/cjs/src/rise-v1-event.universal.js.map +1 -0
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +2 -0
- package/build/es/index.js.map +1 -0
- package/build/es/src/rise-v1-event.http.d.ts +18 -0
- package/build/es/src/rise-v1-event.http.js +157 -0
- package/build/es/src/rise-v1-event.http.js.map +1 -0
- package/build/es/src/rise-v1-event.public.d.ts +12 -0
- package/build/es/src/rise-v1-event.public.js +29 -0
- package/build/es/src/rise-v1-event.public.js.map +1 -0
- package/build/es/src/rise-v1-event.types.d.ts +328 -0
- package/build/es/src/rise-v1-event.types.js +6 -0
- package/build/es/src/rise-v1-event.types.js.map +1 -0
- package/build/es/src/rise-v1-event.universal.d.ts +416 -0
- package/build/es/src/rise-v1-event.universal.js +303 -0
- package/build/es/src/rise-v1-event.universal.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
/** Event is the main entity of EventService */
|
|
2
|
+
export interface Event {
|
|
3
|
+
/**
|
|
4
|
+
* Event ID
|
|
5
|
+
* @readonly
|
|
6
|
+
*/
|
|
7
|
+
id?: string | null;
|
|
8
|
+
/** 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 */
|
|
9
|
+
revision?: string | null;
|
|
10
|
+
/**
|
|
11
|
+
* Represents the time this Event was created
|
|
12
|
+
* @readonly
|
|
13
|
+
*/
|
|
14
|
+
createdDate?: Date;
|
|
15
|
+
/**
|
|
16
|
+
* Represents the time this Event was last updated
|
|
17
|
+
* @readonly
|
|
18
|
+
*/
|
|
19
|
+
updatedDate?: Date;
|
|
20
|
+
/** Wallet ID */
|
|
21
|
+
walletId?: string;
|
|
22
|
+
/** Represents the time when the event's amount will be added to the account */
|
|
23
|
+
startDate?: Date;
|
|
24
|
+
/** Represents the time when the unused balance will be deducted from the account */
|
|
25
|
+
expiresAt?: Date;
|
|
26
|
+
/** Represents the time when the event was manually disabled */
|
|
27
|
+
disabledAt?: Date;
|
|
28
|
+
/** The amount to be added to the customer */
|
|
29
|
+
amount?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface CreateEventRequest {
|
|
32
|
+
/** Event to be created */
|
|
33
|
+
event: Event;
|
|
34
|
+
}
|
|
35
|
+
export interface CreateEventResponse {
|
|
36
|
+
/** The created Event */
|
|
37
|
+
event?: Event;
|
|
38
|
+
}
|
|
39
|
+
export interface EventCreationExpirationDateInThePastDetails {
|
|
40
|
+
/** The date when the event expires. */
|
|
41
|
+
expiresAt?: Date;
|
|
42
|
+
/** The date when the event was tried to be created. */
|
|
43
|
+
currentDate?: Date;
|
|
44
|
+
}
|
|
45
|
+
export interface EventCreationStartLaterThanExpirationDetails {
|
|
46
|
+
/** The start date of the event. */
|
|
47
|
+
startDate?: Date;
|
|
48
|
+
/** The date when the event expires. */
|
|
49
|
+
expiresAt?: Date;
|
|
50
|
+
}
|
|
51
|
+
export interface EventCreationDisabledAtDateSetDetails {
|
|
52
|
+
/** Represents the time when the event was disabled. */
|
|
53
|
+
disabledAt?: Date;
|
|
54
|
+
}
|
|
55
|
+
export interface GetEventRequest {
|
|
56
|
+
/** ID of the Event to retrieve */
|
|
57
|
+
eventId: string;
|
|
58
|
+
}
|
|
59
|
+
export interface GetEventResponse {
|
|
60
|
+
/** The retrieved Event */
|
|
61
|
+
event?: Event;
|
|
62
|
+
}
|
|
63
|
+
export interface UpdateEventRequest {
|
|
64
|
+
/** Event to be updated, may be partial */
|
|
65
|
+
event: Event;
|
|
66
|
+
}
|
|
67
|
+
export interface UpdateEventResponse {
|
|
68
|
+
/** The updated Event */
|
|
69
|
+
event?: Event;
|
|
70
|
+
}
|
|
71
|
+
export interface InvalidEventDetails {
|
|
72
|
+
/** Event ID. */
|
|
73
|
+
eventId?: string;
|
|
74
|
+
}
|
|
75
|
+
export interface EventUpdateStartDateInThePastDetails {
|
|
76
|
+
/** Event ID. */
|
|
77
|
+
eventId?: string;
|
|
78
|
+
/** The date when the event expires. */
|
|
79
|
+
newStartDate?: Date;
|
|
80
|
+
/** The date when the event was tried to be updated. */
|
|
81
|
+
currentDate?: Date;
|
|
82
|
+
}
|
|
83
|
+
export interface EventUpdateExpirationDateInThePastDetails {
|
|
84
|
+
/** Event ID. */
|
|
85
|
+
eventId?: string;
|
|
86
|
+
/** The date when the event expires. */
|
|
87
|
+
newExpiresAt?: Date;
|
|
88
|
+
/** The date when the event was tried to be updated. */
|
|
89
|
+
currentDate?: Date;
|
|
90
|
+
}
|
|
91
|
+
export interface EventUpdateStartLaterThanExpirationDetails {
|
|
92
|
+
/** Event ID. */
|
|
93
|
+
eventId?: string;
|
|
94
|
+
/** The start date of the event. */
|
|
95
|
+
startDate?: Date;
|
|
96
|
+
/** The date when the event expires. */
|
|
97
|
+
expiresAt?: Date;
|
|
98
|
+
}
|
|
99
|
+
export interface DisableEventRequest {
|
|
100
|
+
/** ID of the Event to delete */
|
|
101
|
+
eventId: string;
|
|
102
|
+
/** The revision of the Event */
|
|
103
|
+
revision?: string;
|
|
104
|
+
}
|
|
105
|
+
export interface DisableEventResponse {
|
|
106
|
+
/** The expired Event */
|
|
107
|
+
event?: Event;
|
|
108
|
+
}
|
|
109
|
+
export interface DeleteEventRequest {
|
|
110
|
+
/** ID of the Event to delete */
|
|
111
|
+
eventId?: string;
|
|
112
|
+
/** The revision of the Event */
|
|
113
|
+
revision?: string;
|
|
114
|
+
}
|
|
115
|
+
export interface DeleteEventResponse {
|
|
116
|
+
}
|
|
117
|
+
export interface QueryEventRequest {
|
|
118
|
+
/** WQL expression */
|
|
119
|
+
query?: QueryV2;
|
|
120
|
+
}
|
|
121
|
+
export interface QueryV2 extends QueryV2PagingMethodOneOf {
|
|
122
|
+
/** Paging options to limit and skip the number of items. */
|
|
123
|
+
paging?: Paging;
|
|
124
|
+
/** 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`. */
|
|
125
|
+
cursorPaging?: CursorPaging;
|
|
126
|
+
/**
|
|
127
|
+
* Filter object in the following format:
|
|
128
|
+
* `"filter" : {
|
|
129
|
+
* "fieldName1": "value1",
|
|
130
|
+
* "fieldName2":{"$operator":"value2"}
|
|
131
|
+
* }`
|
|
132
|
+
* Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
|
|
133
|
+
*/
|
|
134
|
+
filter?: Record<string, any> | null;
|
|
135
|
+
/**
|
|
136
|
+
* Sort object in the following format:
|
|
137
|
+
* `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
|
|
138
|
+
*/
|
|
139
|
+
sort?: Sorting[];
|
|
140
|
+
/** 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. */
|
|
141
|
+
fields?: string[];
|
|
142
|
+
/** 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. */
|
|
143
|
+
fieldsets?: string[];
|
|
144
|
+
}
|
|
145
|
+
/** @oneof */
|
|
146
|
+
export interface QueryV2PagingMethodOneOf {
|
|
147
|
+
/** Paging options to limit and skip the number of items. */
|
|
148
|
+
paging?: Paging;
|
|
149
|
+
/** 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`. */
|
|
150
|
+
cursorPaging?: CursorPaging;
|
|
151
|
+
}
|
|
152
|
+
export interface Sorting {
|
|
153
|
+
/** Name of the field to sort by. */
|
|
154
|
+
fieldName?: string;
|
|
155
|
+
/** Sort order. */
|
|
156
|
+
order?: SortOrder;
|
|
157
|
+
}
|
|
158
|
+
export declare enum SortOrder {
|
|
159
|
+
ASC = "ASC",
|
|
160
|
+
DESC = "DESC"
|
|
161
|
+
}
|
|
162
|
+
export interface Paging {
|
|
163
|
+
/** Number of items to load. */
|
|
164
|
+
limit?: number | null;
|
|
165
|
+
/** Number of items to skip in the current sort order. */
|
|
166
|
+
offset?: number | null;
|
|
167
|
+
}
|
|
168
|
+
export interface CursorPaging {
|
|
169
|
+
/** Number of items to load. */
|
|
170
|
+
limit?: number | null;
|
|
171
|
+
/**
|
|
172
|
+
* Pointer to the next or previous page in the list of results.
|
|
173
|
+
*
|
|
174
|
+
* You can get the relevant cursor token
|
|
175
|
+
* from the `pagingMetadata` object in the previous call's response.
|
|
176
|
+
* Not relevant for the first request.
|
|
177
|
+
*/
|
|
178
|
+
cursor?: string | null;
|
|
179
|
+
}
|
|
180
|
+
export interface QueryEventResponse {
|
|
181
|
+
/** The retrieved Events */
|
|
182
|
+
events?: Event[];
|
|
183
|
+
}
|
|
184
|
+
export interface QueryEventBalancesRequest {
|
|
185
|
+
/** WQL expression */
|
|
186
|
+
query: QueryV2;
|
|
187
|
+
}
|
|
188
|
+
export interface QueryEventBalancesResponse {
|
|
189
|
+
/** The retrieved Events with their balance */
|
|
190
|
+
events?: EventWithBalance[];
|
|
191
|
+
}
|
|
192
|
+
export interface EventWithBalance {
|
|
193
|
+
/** Event */
|
|
194
|
+
event?: Event;
|
|
195
|
+
/** Event balance */
|
|
196
|
+
balance?: string | null;
|
|
197
|
+
}
|
|
198
|
+
export interface Task extends TaskTriggerOneOf {
|
|
199
|
+
/** A trigger which will fire once at a specified timestamp */
|
|
200
|
+
oneTime?: Date;
|
|
201
|
+
/**
|
|
202
|
+
* A recurrent trigger defined by a specified cron expression.
|
|
203
|
+
*
|
|
204
|
+
* Cron expression is a string of five space-separated sub-expressions
|
|
205
|
+
*
|
|
206
|
+
* * * * * *
|
|
207
|
+
* | | | | |
|
|
208
|
+
* minute of hour | | | day of week
|
|
209
|
+
* hour of day | month of year
|
|
210
|
+
* day of month
|
|
211
|
+
*
|
|
212
|
+
* Field Accepted values
|
|
213
|
+
* ----- ---------------
|
|
214
|
+
* minute of hour 0..59 / * ,
|
|
215
|
+
* hour of day 0..23 / * ,
|
|
216
|
+
* day of month 1..31 / * , W L
|
|
217
|
+
* month of year 1..12 / * ,
|
|
218
|
+
* day of week 0..7 MON..SUN / * W L #
|
|
219
|
+
*
|
|
220
|
+
* Coma separates multiple values:
|
|
221
|
+
* 0,20,40 * * * * => on 0th, 20th and 40th minute
|
|
222
|
+
* Slash selects every Nth value:
|
|
223
|
+
* * /20 * * * * => equivalent to 0,20,40
|
|
224
|
+
* 5/20 * * * * => on 5th, 25th and 45th minute
|
|
225
|
+
* W selects working days
|
|
226
|
+
* 0 2 * * W => 2am on Mon..Fri
|
|
227
|
+
* L selects the last day of ...
|
|
228
|
+
* 0 0 L * * => last day of each month
|
|
229
|
+
* 0 0 LW * * => last working day of each month
|
|
230
|
+
* 0 0 * * FRIL => midnight of the last Friday of the month
|
|
231
|
+
* Hash selects Nth day of week
|
|
232
|
+
* 0 0 * * Mon#1 => midnight of the first Monday of the month
|
|
233
|
+
*
|
|
234
|
+
* Following aliases are supported: @hourly, @daily, @weekly, @monthly
|
|
235
|
+
*
|
|
236
|
+
* The first execution time will be evaluated based on the client invocation time (approximately the moment the
|
|
237
|
+
* client call returns).
|
|
238
|
+
* All executions will be evaluated in UTC.
|
|
239
|
+
*
|
|
240
|
+
* Example:
|
|
241
|
+
* 00:19:59 - client schedules a task with cron = 0/20 * * * * (every 20-th minute of the hour)
|
|
242
|
+
* 00:20:02 - task reaches Time Capsule database
|
|
243
|
+
* 00:21:00 - task is executed by Time Capsule, the client is triggered with a ~1 minute delay
|
|
244
|
+
* 00:40:00 - task is executed by Time Capsule according to the schedule with no delay
|
|
245
|
+
*/
|
|
246
|
+
cron?: string;
|
|
247
|
+
/** Task id */
|
|
248
|
+
id?: TaskId;
|
|
249
|
+
/** Task payload */
|
|
250
|
+
payload?: Record<string, any> | null;
|
|
251
|
+
/**
|
|
252
|
+
* A Greyhound topic to which the task will be produced when triggered
|
|
253
|
+
* @readonly
|
|
254
|
+
*/
|
|
255
|
+
topic?: string;
|
|
256
|
+
/**
|
|
257
|
+
* 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
|
|
258
|
+
* @readonly
|
|
259
|
+
*/
|
|
260
|
+
scheduledFor?: Date;
|
|
261
|
+
}
|
|
262
|
+
/** @oneof */
|
|
263
|
+
export interface TaskTriggerOneOf {
|
|
264
|
+
/** A trigger which will fire once at a specified timestamp */
|
|
265
|
+
oneTime?: Date;
|
|
266
|
+
/**
|
|
267
|
+
* A recurrent trigger defined by a specified cron expression.
|
|
268
|
+
*
|
|
269
|
+
* Cron expression is a string of five space-separated sub-expressions
|
|
270
|
+
*
|
|
271
|
+
* * * * * *
|
|
272
|
+
* | | | | |
|
|
273
|
+
* minute of hour | | | day of week
|
|
274
|
+
* hour of day | month of year
|
|
275
|
+
* day of month
|
|
276
|
+
*
|
|
277
|
+
* Field Accepted values
|
|
278
|
+
* ----- ---------------
|
|
279
|
+
* minute of hour 0..59 / * ,
|
|
280
|
+
* hour of day 0..23 / * ,
|
|
281
|
+
* day of month 1..31 / * , W L
|
|
282
|
+
* month of year 1..12 / * ,
|
|
283
|
+
* day of week 0..7 MON..SUN / * W L #
|
|
284
|
+
*
|
|
285
|
+
* Coma separates multiple values:
|
|
286
|
+
* 0,20,40 * * * * => on 0th, 20th and 40th minute
|
|
287
|
+
* Slash selects every Nth value:
|
|
288
|
+
* * /20 * * * * => equivalent to 0,20,40
|
|
289
|
+
* 5/20 * * * * => on 5th, 25th and 45th minute
|
|
290
|
+
* W selects working days
|
|
291
|
+
* 0 2 * * W => 2am on Mon..Fri
|
|
292
|
+
* L selects the last day of ...
|
|
293
|
+
* 0 0 L * * => last day of each month
|
|
294
|
+
* 0 0 LW * * => last working day of each month
|
|
295
|
+
* 0 0 * * FRIL => midnight of the last Friday of the month
|
|
296
|
+
* Hash selects Nth day of week
|
|
297
|
+
* 0 0 * * Mon#1 => midnight of the first Monday of the month
|
|
298
|
+
*
|
|
299
|
+
* Following aliases are supported: @hourly, @daily, @weekly, @monthly
|
|
300
|
+
*
|
|
301
|
+
* The first execution time will be evaluated based on the client invocation time (approximately the moment the
|
|
302
|
+
* client call returns).
|
|
303
|
+
* All executions will be evaluated in UTC.
|
|
304
|
+
*
|
|
305
|
+
* Example:
|
|
306
|
+
* 00:19:59 - client schedules a task with cron = 0/20 * * * * (every 20-th minute of the hour)
|
|
307
|
+
* 00:20:02 - task reaches Time Capsule database
|
|
308
|
+
* 00:21:00 - task is executed by Time Capsule, the client is triggered with a ~1 minute delay
|
|
309
|
+
* 00:40:00 - task is executed by Time Capsule according to the schedule with no delay
|
|
310
|
+
*/
|
|
311
|
+
cron?: string;
|
|
312
|
+
}
|
|
313
|
+
export interface TaskId {
|
|
314
|
+
/** A unique identifier of an application or a source that define the task. In most cases this would be the appDefId */
|
|
315
|
+
namespace?: string;
|
|
316
|
+
/**
|
|
317
|
+
* A free-form string distinguishing different families of tasks within a namespace.
|
|
318
|
+
* For example: "send-promo-email", "ClearTrashBin", "premium expiration reminder"
|
|
319
|
+
*/
|
|
320
|
+
taskType?: string;
|
|
321
|
+
/**
|
|
322
|
+
* A free-form string that together with `namespace` and `task_type` uniquely identifies a task.
|
|
323
|
+
* 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.
|
|
324
|
+
*/
|
|
325
|
+
key?: string;
|
|
326
|
+
}
|
|
327
|
+
export interface Empty {
|
|
328
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rise-v1-event.types.js","sourceRoot":"","sources":["../../../src/rise-v1-event.types.ts"],"names":[],"mappings":"AAkLA,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB"}
|