@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
@@ -0,0 +1,441 @@
1
+ /** Event is the main entity of EventService */
2
+ interface Event$1 {
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 | null;
15
+ /**
16
+ * Represents the time this Event was last updated
17
+ * @readonly
18
+ */
19
+ updatedDate?: Date | null;
20
+ /** Wallet ID */
21
+ walletId?: string;
22
+ /** Represents the time when the event's amount will be added to the account */
23
+ startDate?: Date | null;
24
+ /** Represents the time when the unused balance will be deducted from the account */
25
+ expiresAt?: Date | null;
26
+ /** Represents the time when the event was manually disabled */
27
+ disabledAt?: Date | null;
28
+ /** The amount to be added to the customer */
29
+ amount?: string;
30
+ /** Free text comment regarding the Event context */
31
+ note?: string | null;
32
+ /** Indicates the kind of the specific event */
33
+ type?: EventType$1;
34
+ /**
35
+ * The transactionId that added the event's amount;
36
+ * @readonly
37
+ */
38
+ eventAddedTransactionId?: string | null;
39
+ /**
40
+ * The transactionId that removed the remaining event's balance;
41
+ * @readonly
42
+ */
43
+ eventRemovedTransactionId?: string | null;
44
+ status?: EventStatus$1;
45
+ }
46
+ declare enum EventType$1 {
47
+ UNKNOWN = "UNKNOWN",
48
+ REWARD = "REWARD",
49
+ REFUND = "REFUND"
50
+ }
51
+ declare enum EventStatus$1 {
52
+ PENDING = "PENDING",
53
+ ACTIVE = "ACTIVE",
54
+ DISABLED = "DISABLED",
55
+ EXPIRED = "EXPIRED"
56
+ }
57
+ interface CreateEventRequest$1 {
58
+ /** Event to be created */
59
+ event: Event$1;
60
+ }
61
+ interface CreateEventResponse$1 {
62
+ /** The created Event */
63
+ event?: Event$1;
64
+ }
65
+ interface GetEventRequest$1 {
66
+ /** ID of the Event to retrieve */
67
+ eventId: string;
68
+ }
69
+ interface GetEventResponse$1 {
70
+ /** The retrieved Event */
71
+ event?: Event$1;
72
+ }
73
+ interface UpdateEventRequest$1 {
74
+ /** Event to be updated, may be partial */
75
+ event: Event$1;
76
+ }
77
+ interface UpdateEventResponse$1 {
78
+ /** The updated Event */
79
+ event?: Event$1;
80
+ }
81
+ interface DisableEventRequest$1 {
82
+ /** ID of the Event to delete */
83
+ eventId: string;
84
+ /** The revision of the Event */
85
+ revision: string;
86
+ }
87
+ interface DisableEventResponse$1 {
88
+ /** The expired Event */
89
+ event?: Event$1;
90
+ }
91
+ interface QueryV2$1 extends QueryV2PagingMethodOneOf$1 {
92
+ /** Paging options to limit and skip the number of items. */
93
+ paging?: Paging$1;
94
+ /** 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`. */
95
+ cursorPaging?: CursorPaging$1;
96
+ /**
97
+ * Filter object.
98
+ *
99
+ * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
100
+ */
101
+ filter?: Record<string, any> | null;
102
+ /**
103
+ * Sort object.
104
+ *
105
+ * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
106
+ */
107
+ sort?: Sorting$1[];
108
+ /** 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. */
109
+ fields?: string[];
110
+ /** 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. */
111
+ fieldsets?: string[];
112
+ }
113
+ /** @oneof */
114
+ interface QueryV2PagingMethodOneOf$1 {
115
+ /** Paging options to limit and skip the number of items. */
116
+ paging?: Paging$1;
117
+ /** 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`. */
118
+ cursorPaging?: CursorPaging$1;
119
+ }
120
+ interface Sorting$1 {
121
+ /** Name of the field to sort by. */
122
+ fieldName?: string;
123
+ /** Sort order. */
124
+ order?: SortOrder$1;
125
+ }
126
+ declare enum SortOrder$1 {
127
+ ASC = "ASC",
128
+ DESC = "DESC"
129
+ }
130
+ interface Paging$1 {
131
+ /** Number of items to load. */
132
+ limit?: number | null;
133
+ /** Number of items to skip in the current sort order. */
134
+ offset?: number | null;
135
+ }
136
+ interface CursorPaging$1 {
137
+ /** Maximum number of items to return in the results. */
138
+ limit?: number | null;
139
+ /**
140
+ * Pointer to the next or previous page in the list of results.
141
+ *
142
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
143
+ * Not relevant for the first request.
144
+ */
145
+ cursor?: string | null;
146
+ }
147
+ interface PagingMetadataV2$1 {
148
+ /** Number of items returned in the response. */
149
+ count?: number | null;
150
+ /** Offset that was requested. */
151
+ offset?: number | null;
152
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
153
+ total?: number | null;
154
+ /** Flag that indicates the server failed to calculate the `total` field. */
155
+ tooManyToCount?: boolean | null;
156
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
157
+ cursors?: Cursors$1;
158
+ }
159
+ interface Cursors$1 {
160
+ /** Cursor string pointing to the next page in the list of results. */
161
+ next?: string | null;
162
+ /** Cursor pointing to the previous page in the list of results. */
163
+ prev?: string | null;
164
+ }
165
+ interface QueryEventBalancesRequest$1 {
166
+ /** WQL expression */
167
+ query: QueryV2$1;
168
+ }
169
+ interface QueryEventBalancesResponse$1 {
170
+ /** The retrieved Events with their balance */
171
+ events?: EventWithBalance$1[];
172
+ pagingMetadata?: PagingMetadataV2$1;
173
+ }
174
+ interface EventWithBalance$1 {
175
+ /** Event */
176
+ event?: Event$1;
177
+ /** Event balance */
178
+ balance?: string | null;
179
+ }
180
+ interface EventNonNullableFields$1 {
181
+ walletId: string;
182
+ amount: string;
183
+ type: EventType$1;
184
+ status: EventStatus$1;
185
+ }
186
+ interface CreateEventResponseNonNullableFields$1 {
187
+ event?: EventNonNullableFields$1;
188
+ }
189
+ interface GetEventResponseNonNullableFields$1 {
190
+ event?: EventNonNullableFields$1;
191
+ }
192
+ interface UpdateEventResponseNonNullableFields$1 {
193
+ event?: EventNonNullableFields$1;
194
+ }
195
+ interface DisableEventResponseNonNullableFields$1 {
196
+ event?: EventNonNullableFields$1;
197
+ }
198
+ interface EventWithBalanceNonNullableFields$1 {
199
+ event?: EventNonNullableFields$1;
200
+ }
201
+ interface QueryEventBalancesResponseNonNullableFields$1 {
202
+ events: EventWithBalanceNonNullableFields$1[];
203
+ }
204
+
205
+ /** Event is the main entity of EventService */
206
+ interface Event {
207
+ /**
208
+ * Event ID
209
+ * @readonly
210
+ */
211
+ _id?: string | null;
212
+ /** 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 */
213
+ revision?: string | null;
214
+ /**
215
+ * Represents the time this Event was created
216
+ * @readonly
217
+ */
218
+ _createdDate?: Date | null;
219
+ /**
220
+ * Represents the time this Event was last updated
221
+ * @readonly
222
+ */
223
+ _updatedDate?: Date | null;
224
+ /** Wallet ID */
225
+ walletId?: string;
226
+ /** Represents the time when the event's amount will be added to the account */
227
+ startDate?: Date | null;
228
+ /** Represents the time when the unused balance will be deducted from the account */
229
+ expiresAt?: Date | null;
230
+ /** Represents the time when the event was manually disabled */
231
+ disabledAt?: Date | null;
232
+ /** The amount to be added to the customer */
233
+ amount?: string;
234
+ /** Free text comment regarding the Event context */
235
+ note?: string | null;
236
+ /** Indicates the kind of the specific event */
237
+ type?: EventType;
238
+ /**
239
+ * The transactionId that added the event's amount;
240
+ * @readonly
241
+ */
242
+ eventAddedTransactionId?: string | null;
243
+ /**
244
+ * The transactionId that removed the remaining event's balance;
245
+ * @readonly
246
+ */
247
+ eventRemovedTransactionId?: string | null;
248
+ status?: EventStatus;
249
+ }
250
+ declare enum EventType {
251
+ UNKNOWN = "UNKNOWN",
252
+ REWARD = "REWARD",
253
+ REFUND = "REFUND"
254
+ }
255
+ declare enum EventStatus {
256
+ PENDING = "PENDING",
257
+ ACTIVE = "ACTIVE",
258
+ DISABLED = "DISABLED",
259
+ EXPIRED = "EXPIRED"
260
+ }
261
+ interface CreateEventRequest {
262
+ /** Event to be created */
263
+ event: Event;
264
+ }
265
+ interface CreateEventResponse {
266
+ /** The created Event */
267
+ event?: Event;
268
+ }
269
+ interface GetEventRequest {
270
+ /** ID of the Event to retrieve */
271
+ eventId: string;
272
+ }
273
+ interface GetEventResponse {
274
+ /** The retrieved Event */
275
+ event?: Event;
276
+ }
277
+ interface UpdateEventRequest {
278
+ /** Event to be updated, may be partial */
279
+ event: Event;
280
+ }
281
+ interface UpdateEventResponse {
282
+ /** The updated Event */
283
+ event?: Event;
284
+ }
285
+ interface DisableEventRequest {
286
+ /** ID of the Event to delete */
287
+ eventId: string;
288
+ /** The revision of the Event */
289
+ revision: string;
290
+ }
291
+ interface DisableEventResponse {
292
+ /** The expired Event */
293
+ event?: Event;
294
+ }
295
+ interface QueryV2 extends QueryV2PagingMethodOneOf {
296
+ /** Paging options to limit and skip the number of items. */
297
+ paging?: Paging;
298
+ /** 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`. */
299
+ cursorPaging?: CursorPaging;
300
+ /**
301
+ * Filter object.
302
+ *
303
+ * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
304
+ */
305
+ filter?: Record<string, any> | null;
306
+ /**
307
+ * Sort object.
308
+ *
309
+ * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
310
+ */
311
+ sort?: Sorting[];
312
+ /** 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. */
313
+ fields?: string[];
314
+ /** 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. */
315
+ fieldsets?: string[];
316
+ }
317
+ /** @oneof */
318
+ interface QueryV2PagingMethodOneOf {
319
+ /** Paging options to limit and skip the number of items. */
320
+ paging?: Paging;
321
+ /** 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`. */
322
+ cursorPaging?: CursorPaging;
323
+ }
324
+ interface Sorting {
325
+ /** Name of the field to sort by. */
326
+ fieldName?: string;
327
+ /** Sort order. */
328
+ order?: SortOrder;
329
+ }
330
+ declare enum SortOrder {
331
+ ASC = "ASC",
332
+ DESC = "DESC"
333
+ }
334
+ interface Paging {
335
+ /** Number of items to load. */
336
+ limit?: number | null;
337
+ /** Number of items to skip in the current sort order. */
338
+ offset?: number | null;
339
+ }
340
+ interface CursorPaging {
341
+ /** Maximum number of items to return in the results. */
342
+ limit?: number | null;
343
+ /**
344
+ * Pointer to the next or previous page in the list of results.
345
+ *
346
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
347
+ * Not relevant for the first request.
348
+ */
349
+ cursor?: string | null;
350
+ }
351
+ interface PagingMetadataV2 {
352
+ /** Number of items returned in the response. */
353
+ count?: number | null;
354
+ /** Offset that was requested. */
355
+ offset?: number | null;
356
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
357
+ total?: number | null;
358
+ /** Flag that indicates the server failed to calculate the `total` field. */
359
+ tooManyToCount?: boolean | null;
360
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
361
+ cursors?: Cursors;
362
+ }
363
+ interface Cursors {
364
+ /** Cursor string pointing to the next page in the list of results. */
365
+ next?: string | null;
366
+ /** Cursor pointing to the previous page in the list of results. */
367
+ prev?: string | null;
368
+ }
369
+ interface QueryEventBalancesRequest {
370
+ /** WQL expression */
371
+ query: QueryV2;
372
+ }
373
+ interface QueryEventBalancesResponse {
374
+ /** The retrieved Events with their balance */
375
+ events?: EventWithBalance[];
376
+ pagingMetadata?: PagingMetadataV2;
377
+ }
378
+ interface EventWithBalance {
379
+ /** Event */
380
+ event?: Event;
381
+ /** Event balance */
382
+ balance?: string | null;
383
+ }
384
+ interface EventNonNullableFields {
385
+ walletId: string;
386
+ amount: string;
387
+ type: EventType;
388
+ status: EventStatus;
389
+ }
390
+ interface CreateEventResponseNonNullableFields {
391
+ event?: EventNonNullableFields;
392
+ }
393
+ interface GetEventResponseNonNullableFields {
394
+ event?: EventNonNullableFields;
395
+ }
396
+ interface UpdateEventResponseNonNullableFields {
397
+ event?: EventNonNullableFields;
398
+ }
399
+ interface DisableEventResponseNonNullableFields {
400
+ event?: EventNonNullableFields;
401
+ }
402
+ interface EventWithBalanceNonNullableFields {
403
+ event?: EventNonNullableFields;
404
+ }
405
+ interface QueryEventBalancesResponseNonNullableFields {
406
+ events: EventWithBalanceNonNullableFields[];
407
+ }
408
+
409
+ type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
410
+ getUrl: (context: any) => string;
411
+ httpMethod: K;
412
+ path: string;
413
+ pathParams: M;
414
+ __requestType: T;
415
+ __originalRequestType: S;
416
+ __responseType: Q;
417
+ __originalResponseType: R;
418
+ };
419
+ declare function createEvent(): __PublicMethodMetaInfo<'POST', {}, CreateEventRequest, CreateEventRequest$1, CreateEventResponse & CreateEventResponseNonNullableFields, CreateEventResponse$1 & CreateEventResponseNonNullableFields$1>;
420
+ declare function getEvent(): __PublicMethodMetaInfo<'GET', {
421
+ eventId: string;
422
+ }, GetEventRequest, GetEventRequest$1, GetEventResponse & GetEventResponseNonNullableFields, GetEventResponse$1 & GetEventResponseNonNullableFields$1>;
423
+ declare function updateEvent(): __PublicMethodMetaInfo<'PATCH', {
424
+ eventId: string;
425
+ }, UpdateEventRequest, UpdateEventRequest$1, UpdateEventResponse & UpdateEventResponseNonNullableFields, UpdateEventResponse$1 & UpdateEventResponseNonNullableFields$1>;
426
+ declare function disableEvent(): __PublicMethodMetaInfo<'POST', {
427
+ eventId: string;
428
+ }, DisableEventRequest, DisableEventRequest$1, DisableEventResponse & DisableEventResponseNonNullableFields, DisableEventResponse$1 & DisableEventResponseNonNullableFields$1>;
429
+ declare function queryEventBalances(): __PublicMethodMetaInfo<'POST', {}, QueryEventBalancesRequest, QueryEventBalancesRequest$1, QueryEventBalancesResponse & QueryEventBalancesResponseNonNullableFields, QueryEventBalancesResponse$1 & QueryEventBalancesResponseNonNullableFields$1>;
430
+
431
+ type meta___PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = __PublicMethodMetaInfo<K, M, T, S, Q, R>;
432
+ declare const meta_createEvent: typeof createEvent;
433
+ declare const meta_disableEvent: typeof disableEvent;
434
+ declare const meta_getEvent: typeof getEvent;
435
+ declare const meta_queryEventBalances: typeof queryEventBalances;
436
+ declare const meta_updateEvent: typeof updateEvent;
437
+ declare namespace meta {
438
+ export { type meta___PublicMethodMetaInfo as __PublicMethodMetaInfo, meta_createEvent as createEvent, meta_disableEvent as disableEvent, meta_getEvent as getEvent, meta_queryEventBalances as queryEventBalances, meta_updateEvent as updateEvent };
439
+ }
440
+
441
+ export { meta as event };
@@ -1,18 +0,0 @@
1
- import { RequestOptionsFactory } from '@wix/sdk-types';
2
- import { CreateEventRequest, CreateEventResponse, DisableEventRequest, DisableEventResponse, GetEventRequest, GetEventResponse, QueryEventBalancesRequest, QueryEventBalancesResponse, UpdateEventRequest, UpdateEventResponse } from './rise-v1-event.types';
3
- /** Creates a new Event */
4
- export declare function createEvent(payload: CreateEventRequest): RequestOptionsFactory<CreateEventResponse>;
5
- /** Get an Event by ID */
6
- export declare function getEvent(payload: GetEventRequest): RequestOptionsFactory<GetEventResponse>;
7
- /**
8
- * Update an Event, supports partial update
9
- * Pass the latest `revision` for a successful update
10
- */
11
- export declare function updateEvent(payload: UpdateEventRequest): RequestOptionsFactory<UpdateEventResponse>;
12
- /** Expire an Event immediately and deducting the remaining balance from the gift card */
13
- export declare function disableEvent(payload: DisableEventRequest): RequestOptionsFactory<DisableEventResponse>;
14
- /**
15
- * Query Events using [WQL - Wix Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language)
16
- * Results will be enriched with calculated balances
17
- */
18
- export declare function queryEventBalances(payload: QueryEventBalancesRequest): RequestOptionsFactory<QueryEventBalancesResponse>;
@@ -1,190 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.queryEventBalances = exports.disableEvent = exports.updateEvent = exports.getEvent = exports.createEvent = void 0;
4
- const metro_runtime_1 = require("@wix/metro-runtime");
5
- const ambassador_1 = require("@wix/metro-runtime/ambassador");
6
- const metro_runtime_2 = require("@wix/metro-runtime");
7
- const _createEventRequest = { event: '_event' };
8
- const _createEventResponse = { event: '_event' };
9
- const _disableEventRequest = {};
10
- const _disableEventResponse = { event: '_event' };
11
- const _event = {
12
- createdDate: 'google.protobuf.Timestamp',
13
- updatedDate: 'google.protobuf.Timestamp',
14
- startDate: 'google.protobuf.Timestamp',
15
- expiresAt: 'google.protobuf.Timestamp',
16
- disabledAt: 'google.protobuf.Timestamp',
17
- };
18
- const _eventWithBalance = { event: '_event' };
19
- const _getEventRequest = {};
20
- const _getEventResponse = { event: '_event' };
21
- const _queryEventBalancesRequest = {};
22
- const _queryEventBalancesResponse = { events: '_eventWithBalance' };
23
- const _updateEventRequest = {
24
- mask: 'google.protobuf.FieldMask',
25
- event: '_event',
26
- };
27
- const _updateEventResponse = { event: '_event' };
28
- function resolveWixRiseV1EventServiceUrl(opts) {
29
- const domainToMappings = {
30
- 'www._base_domain_': [
31
- {
32
- srcPath: '/_api/event-service',
33
- destPath: '/v1/rise',
34
- },
35
- ],
36
- 'www.wixapis.com': [
37
- {
38
- srcPath: '/rise/v1/event-service',
39
- destPath: '/v1/rise',
40
- },
41
- ],
42
- '*.dev.wix-code.com': [
43
- {
44
- srcPath: '/_api/event-service',
45
- destPath: '/v1/rise',
46
- },
47
- ],
48
- 'bo._base_domain_': [
49
- {
50
- srcPath: '/_api/event-service',
51
- destPath: '/v1/rise',
52
- },
53
- ],
54
- };
55
- return (0, metro_runtime_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
56
- }
57
- /** Creates a new Event */
58
- function createEvent(payload) {
59
- const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_createEventRequest, {
60
- _event,
61
- });
62
- const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_createEventResponse, { _event });
63
- function __createEvent({ host }) {
64
- const serializedData = toReq(payload);
65
- const metadata = {
66
- entityFqdn: 'wix.rise.v1.event',
67
- method: 'POST',
68
- methodFqn: 'wix.rise.v1.EventService.CreateEvent',
69
- url: resolveWixRiseV1EventServiceUrl({
70
- protoPath: '/v1/rise/events',
71
- data: serializedData,
72
- host,
73
- }),
74
- data: serializedData,
75
- transformResponse: fromRes,
76
- };
77
- return metadata;
78
- }
79
- __createEvent.fromReq = fromReq;
80
- return __createEvent;
81
- }
82
- exports.createEvent = createEvent;
83
- /** Get an Event by ID */
84
- function getEvent(payload) {
85
- const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_getEventRequest, {});
86
- const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_getEventResponse, { _event });
87
- function __getEvent({ host }) {
88
- const serializedData = toReq(payload);
89
- const metadata = {
90
- entityFqdn: 'wix.rise.v1.event',
91
- method: 'GET',
92
- methodFqn: 'wix.rise.v1.EventService.GetEvent',
93
- url: resolveWixRiseV1EventServiceUrl({
94
- protoPath: '/v1/rise/events/{eventId}',
95
- data: serializedData,
96
- host,
97
- }),
98
- params: (0, metro_runtime_1.toURLSearchParams)(serializedData),
99
- transformResponse: fromRes,
100
- };
101
- return metadata;
102
- }
103
- __getEvent.fromReq = fromReq;
104
- return __getEvent;
105
- }
106
- exports.getEvent = getEvent;
107
- /**
108
- * Update an Event, supports partial update
109
- * Pass the latest `revision` for a successful update
110
- */
111
- function updateEvent(payload) {
112
- const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_updateEventRequest, {
113
- _event,
114
- });
115
- const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_updateEventResponse, { _event });
116
- function __updateEvent({ host }) {
117
- const serializedData = toReq(payload);
118
- const metadata = {
119
- entityFqdn: 'wix.rise.v1.event',
120
- method: 'PATCH',
121
- methodFqn: 'wix.rise.v1.EventService.UpdateEvent',
122
- url: resolveWixRiseV1EventServiceUrl({
123
- protoPath: '/v1/rise/events/{event.id}',
124
- data: serializedData,
125
- host,
126
- }),
127
- data: serializedData,
128
- transformResponse: fromRes,
129
- };
130
- return metadata;
131
- }
132
- __updateEvent.fromReq = fromReq;
133
- return __updateEvent;
134
- }
135
- exports.updateEvent = updateEvent;
136
- /** Expire an Event immediately and deducting the remaining balance from the gift card */
137
- function disableEvent(payload) {
138
- const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_disableEventRequest, {});
139
- const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_disableEventResponse, { _event });
140
- function __disableEvent({ host }) {
141
- const serializedData = toReq(payload);
142
- const metadata = {
143
- entityFqdn: 'wix.rise.v1.event',
144
- method: 'POST',
145
- methodFqn: 'wix.rise.v1.EventService.DisableEvent',
146
- url: resolveWixRiseV1EventServiceUrl({
147
- protoPath: '/v1/rise/events/{eventId}/disable',
148
- data: serializedData,
149
- host,
150
- }),
151
- data: serializedData,
152
- transformResponse: fromRes,
153
- };
154
- return metadata;
155
- }
156
- __disableEvent.fromReq = fromReq;
157
- return __disableEvent;
158
- }
159
- exports.disableEvent = disableEvent;
160
- /**
161
- * Query Events using [WQL - Wix Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language)
162
- * Results will be enriched with calculated balances
163
- */
164
- function queryEventBalances(payload) {
165
- const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_queryEventBalancesRequest, {});
166
- const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_queryEventBalancesResponse, {
167
- _event,
168
- _eventWithBalance,
169
- });
170
- function __queryEventBalances({ host }) {
171
- const serializedData = toReq(payload);
172
- const metadata = {
173
- entityFqdn: 'wix.rise.v1.event',
174
- method: 'POST',
175
- methodFqn: 'wix.rise.v1.EventService.QueryEventBalances',
176
- url: resolveWixRiseV1EventServiceUrl({
177
- protoPath: '/v1/rise/events/query/balances',
178
- data: serializedData,
179
- host,
180
- }),
181
- data: serializedData,
182
- transformResponse: fromRes,
183
- };
184
- return metadata;
185
- }
186
- __queryEventBalances.fromReq = fromReq;
187
- return __queryEventBalances;
188
- }
189
- exports.queryEventBalances = queryEventBalances;
190
- //# sourceMappingURL=rise-v1-event.http.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rise-v1-event.http.js","sourceRoot":"","sources":["../../../src/rise-v1-event.http.ts"],"names":[],"mappings":";;;AAAA,sDAAuD;AACvD,8DAA2D;AAC3D,sDAAgD;AAgBhD,MAAM,mBAAmB,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAChD,MAAM,oBAAoB,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACjD,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAChC,MAAM,qBAAqB,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAClD,MAAM,MAAM,GAAG;IACb,WAAW,EAAE,2BAA2B;IACxC,WAAW,EAAE,2BAA2B;IACxC,SAAS,EAAE,2BAA2B;IACtC,SAAS,EAAE,2BAA2B;IACtC,UAAU,EAAE,2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C,OAAO,GAAG,OAAO,CAAC;IAEvC,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AAjCD,gDAiCC"}
@@ -1,12 +0,0 @@
1
- import { HttpClient } from '@wix/sdk-types';
2
- import { Event, UpdateEvent, QueryV2 } from './rise-v1-event.universal';
3
- export declare const __metadata: {
4
- PACKAGE_NAME: string;
5
- };
6
- export declare function createEvent(httpClient: HttpClient): (event: Event) => Promise<Event>;
7
- export declare function getEvent(httpClient: HttpClient): (eventId: string) => Promise<Event>;
8
- export declare function updateEvent(httpClient: HttpClient): (_id: string | null, event: UpdateEvent) => Promise<Event>;
9
- export declare function disableEvent(httpClient: HttpClient): (eventId: string, revision: string) => Promise<import("./rise-v1-event.universal").DisableEventResponse>;
10
- export declare function queryEventBalances(httpClient: HttpClient): (query: QueryV2) => Promise<import("./rise-v1-event.universal").QueryEventBalancesResponse>;
11
- export { EventType, EventStatus, SortOrder } from './rise-v1-event.universal';
12
- export { Event, CreateEventRequest, CreateEventResponse, EventCreationExpirationDateInThePastDetails, EventCreationStartLaterThanExpirationDetails, EventCreationDisabledAtDateSetDetails, GetEventRequest, GetEventResponse, UpdateEventRequest, UpdateEventResponse, InvalidEventDetails, EventUpdateStartDateInThePastDetails, EventUpdateExpirationDateInThePastDetails, EventUpdateStartLaterThanExpirationDetails, DisableEventRequest, DisableEventResponse, EventDisabled, DeleteEventRequest, DeleteEventResponse, QueryEventRequest, QueryV2, QueryV2PagingMethodOneOf, Sorting, Paging, CursorPaging, QueryEventResponse, PagingMetadataV2, Cursors, QueryEventBalancesRequest, QueryEventBalancesResponse, EventWithBalance, Task, TaskTriggerOneOf, TaskId, Empty, EventExpired, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityUpdatedEvent, EntityDeletedEvent, ActionEvent, UpdateEvent, } from './rise-v1-event.universal';