@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.
Files changed (31) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +24 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/src/rise-v1-event.http.d.ts +18 -0
  5. package/build/cjs/src/rise-v1-event.http.js +165 -0
  6. package/build/cjs/src/rise-v1-event.http.js.map +1 -0
  7. package/build/cjs/src/rise-v1-event.public.d.ts +12 -0
  8. package/build/cjs/src/rise-v1-event.public.js +38 -0
  9. package/build/cjs/src/rise-v1-event.public.js.map +1 -0
  10. package/build/cjs/src/rise-v1-event.types.d.ts +328 -0
  11. package/build/cjs/src/rise-v1-event.types.js +9 -0
  12. package/build/cjs/src/rise-v1-event.types.js.map +1 -0
  13. package/build/cjs/src/rise-v1-event.universal.d.ts +416 -0
  14. package/build/cjs/src/rise-v1-event.universal.js +330 -0
  15. package/build/cjs/src/rise-v1-event.universal.js.map +1 -0
  16. package/build/es/index.d.ts +1 -0
  17. package/build/es/index.js +2 -0
  18. package/build/es/index.js.map +1 -0
  19. package/build/es/src/rise-v1-event.http.d.ts +18 -0
  20. package/build/es/src/rise-v1-event.http.js +157 -0
  21. package/build/es/src/rise-v1-event.http.js.map +1 -0
  22. package/build/es/src/rise-v1-event.public.d.ts +12 -0
  23. package/build/es/src/rise-v1-event.public.js +29 -0
  24. package/build/es/src/rise-v1-event.public.js.map +1 -0
  25. package/build/es/src/rise-v1-event.types.d.ts +328 -0
  26. package/build/es/src/rise-v1-event.types.js +6 -0
  27. package/build/es/src/rise-v1-event.types.js.map +1 -0
  28. package/build/es/src/rise-v1-event.universal.d.ts +416 -0
  29. package/build/es/src/rise-v1-event.universal.js +303 -0
  30. package/build/es/src/rise-v1-event.universal.js.map +1 -0
  31. package/package.json +37 -0
@@ -0,0 +1 @@
1
+ export * as event from './src/rise-v1-event.public';
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.event = void 0;
23
+ exports.event = __importStar(require("./src/rise-v1-event.public"));
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,oEAAoD"}
@@ -0,0 +1,18 @@
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>;
@@ -0,0 +1,165 @@
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
+ return (0, metro_runtime_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
31
+ }
32
+ /** Creates a new Event */
33
+ function createEvent(payload) {
34
+ const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_createEventRequest, {
35
+ _event,
36
+ });
37
+ const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_createEventResponse, { _event });
38
+ function __createEvent({ host }) {
39
+ const serializedData = toReq(payload);
40
+ const metadata = {
41
+ entityFqdn: 'wix.rise.v1.event',
42
+ method: 'POST',
43
+ methodFqn: 'wix.rise.v1.EventService.CreateEvent',
44
+ url: resolveWixRiseV1EventServiceUrl({
45
+ protoPath: '/v1/rise/events',
46
+ data: serializedData,
47
+ host,
48
+ }),
49
+ data: serializedData,
50
+ transformResponse: fromRes,
51
+ };
52
+ return metadata;
53
+ }
54
+ __createEvent.fromReq = fromReq;
55
+ return __createEvent;
56
+ }
57
+ exports.createEvent = createEvent;
58
+ /** Get an Event by ID */
59
+ function getEvent(payload) {
60
+ const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_getEventRequest, {});
61
+ const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_getEventResponse, { _event });
62
+ function __getEvent({ host }) {
63
+ const serializedData = toReq(payload);
64
+ const metadata = {
65
+ entityFqdn: 'wix.rise.v1.event',
66
+ method: 'GET',
67
+ methodFqn: 'wix.rise.v1.EventService.GetEvent',
68
+ url: resolveWixRiseV1EventServiceUrl({
69
+ protoPath: '/v1/rise/events/{eventId}',
70
+ data: serializedData,
71
+ host,
72
+ }),
73
+ params: (0, metro_runtime_1.toURLSearchParams)(serializedData),
74
+ transformResponse: fromRes,
75
+ };
76
+ return metadata;
77
+ }
78
+ __getEvent.fromReq = fromReq;
79
+ return __getEvent;
80
+ }
81
+ exports.getEvent = getEvent;
82
+ /**
83
+ * Update an Event, supports partial update
84
+ * Pass the latest `revision` for a successful update
85
+ */
86
+ function updateEvent(payload) {
87
+ const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_updateEventRequest, {
88
+ _event,
89
+ });
90
+ const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_updateEventResponse, { _event });
91
+ function __updateEvent({ host }) {
92
+ const serializedData = toReq(payload);
93
+ const metadata = {
94
+ entityFqdn: 'wix.rise.v1.event',
95
+ method: 'PATCH',
96
+ methodFqn: 'wix.rise.v1.EventService.UpdateEvent',
97
+ url: resolveWixRiseV1EventServiceUrl({
98
+ protoPath: '/v1/rise/events/{event.id}',
99
+ data: serializedData,
100
+ host,
101
+ }),
102
+ data: serializedData,
103
+ transformResponse: fromRes,
104
+ };
105
+ return metadata;
106
+ }
107
+ __updateEvent.fromReq = fromReq;
108
+ return __updateEvent;
109
+ }
110
+ exports.updateEvent = updateEvent;
111
+ /** Expire an Event immediately and deducting the remaining balance from the gift card */
112
+ function disableEvent(payload) {
113
+ const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_disableEventRequest, {});
114
+ const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_disableEventResponse, { _event });
115
+ function __disableEvent({ host }) {
116
+ const serializedData = toReq(payload);
117
+ const metadata = {
118
+ entityFqdn: 'wix.rise.v1.event',
119
+ method: 'POST',
120
+ methodFqn: 'wix.rise.v1.EventService.DisableEvent',
121
+ url: resolveWixRiseV1EventServiceUrl({
122
+ protoPath: '/v1/rise/events/{eventId}/disable',
123
+ data: serializedData,
124
+ host,
125
+ }),
126
+ data: serializedData,
127
+ transformResponse: fromRes,
128
+ };
129
+ return metadata;
130
+ }
131
+ __disableEvent.fromReq = fromReq;
132
+ return __disableEvent;
133
+ }
134
+ exports.disableEvent = disableEvent;
135
+ /**
136
+ * Query Events using [WQL - Wix Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language)
137
+ * Results will be enriched with calculated balances
138
+ */
139
+ function queryEventBalances(payload) {
140
+ const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_queryEventBalancesRequest, {});
141
+ const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_queryEventBalancesResponse, {
142
+ _event,
143
+ _eventWithBalance,
144
+ });
145
+ function __queryEventBalances({ host }) {
146
+ const serializedData = toReq(payload);
147
+ const metadata = {
148
+ entityFqdn: 'wix.rise.v1.event',
149
+ method: 'POST',
150
+ methodFqn: 'wix.rise.v1.EventService.QueryEventBalances',
151
+ url: resolveWixRiseV1EventServiceUrl({
152
+ protoPath: '/v1/rise/events/query/balances',
153
+ data: serializedData,
154
+ host,
155
+ }),
156
+ data: serializedData,
157
+ transformResponse: fromRes,
158
+ };
159
+ return metadata;
160
+ }
161
+ __queryEventBalances.fromReq = fromReq;
162
+ return __queryEventBalances;
163
+ }
164
+ exports.queryEventBalances = queryEventBalances;
165
+ //# sourceMappingURL=rise-v1-event.http.js.map
@@ -0,0 +1 @@
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,2BAA2B;CACxC,CAAC;AACF,MAAM,iBAAiB,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAC9C,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAC5B,MAAM,iBAAiB,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAC9C,MAAM,0BAA0B,GAAG,EAAE,CAAC;AACtC,MAAM,2BAA2B,GAAG,EAAE,MAAM,EAAE,mBAAmB,EAAE,CAAC;AACpE,MAAM,mBAAmB,GAAG;IAC1B,IAAI,EAAE,2BAA2B;IACjC,KAAK,EAA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,GAAG,IAAA,uBAAU,EAAC,2BAA2B,EAAE;QACpE,MAAM;QACN,iBAAiB;KAClB,CAAC,CAAC;IAEH,SAAS,oBAAoB,CAAC,EAAE,IAAI,EAAO;QACzC,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG;YACf,UAAU,EAAE,mBAAmB;YAC/B,MAAM,EAAE,MAAa;YACrB,SAAS,EAAE,6CAA6C;YACxD,GAAG,EAAE,+BAA+B,CAAC;gBACnC,SAAS,EAAE,gCAAgC;gBAC3C,IAAI,EAAE,cAAc;gBACpB,IAAI;aACL,CAAC;YACF,IAAI,EAAE,cAAc;YACpB,iBAAiB,EAAE,OAAO;SAC3B,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,oBAAoB,CAAC,OAAO,GAAG,OAAO,CAAC;IAEvC,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AAjCD,gDAiCC"}
@@ -0,0 +1,12 @@
1
+ import { HttpClient } from '@wix/sdk-types';
2
+ import { Event, UpdateEvent, QueryV2, DisableEventOptions } 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, options?: DisableEventOptions | undefined) => 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 { SortOrder } from './rise-v1-event.universal';
12
+ export { Event, CreateEventRequest, CreateEventResponse, EventCreationExpirationDateInThePastDetails, EventCreationStartLaterThanExpirationDetails, EventCreationDisabledAtDateSetDetails, GetEventRequest, GetEventResponse, UpdateEventRequest, UpdateEventResponse, InvalidEventDetails, EventUpdateStartDateInThePastDetails, EventUpdateExpirationDateInThePastDetails, EventUpdateStartLaterThanExpirationDetails, DisableEventRequest, DisableEventResponse, DeleteEventRequest, DeleteEventResponse, QueryEventRequest, QueryV2, QueryV2PagingMethodOneOf, Sorting, Paging, CursorPaging, QueryEventResponse, QueryEventBalancesRequest, QueryEventBalancesResponse, EventWithBalance, Task, TaskTriggerOneOf, TaskId, Empty, UpdateEvent, DisableEventOptions, } from './rise-v1-event.universal';
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SortOrder = exports.queryEventBalances = exports.disableEvent = exports.updateEvent = exports.getEvent = exports.createEvent = exports.__metadata = void 0;
4
+ const rise_v1_event_universal_1 = require("./rise-v1-event.universal");
5
+ exports.__metadata = { PACKAGE_NAME: '@wix/riseevent' };
6
+ function createEvent(httpClient) {
7
+ return (event) => (0, rise_v1_event_universal_1.createEvent)(event,
8
+ // @ts-ignore
9
+ { httpClient });
10
+ }
11
+ exports.createEvent = createEvent;
12
+ function getEvent(httpClient) {
13
+ return (eventId) => (0, rise_v1_event_universal_1.getEvent)(eventId,
14
+ // @ts-ignore
15
+ { httpClient });
16
+ }
17
+ exports.getEvent = getEvent;
18
+ function updateEvent(httpClient) {
19
+ return (_id, event) => (0, rise_v1_event_universal_1.updateEvent)(_id, event,
20
+ // @ts-ignore
21
+ { httpClient });
22
+ }
23
+ exports.updateEvent = updateEvent;
24
+ function disableEvent(httpClient) {
25
+ return (eventId, options) => (0, rise_v1_event_universal_1.disableEvent)(eventId, options,
26
+ // @ts-ignore
27
+ { httpClient });
28
+ }
29
+ exports.disableEvent = disableEvent;
30
+ function queryEventBalances(httpClient) {
31
+ return (query) => (0, rise_v1_event_universal_1.queryEventBalances)(query,
32
+ // @ts-ignore
33
+ { httpClient });
34
+ }
35
+ exports.queryEventBalances = queryEventBalances;
36
+ var rise_v1_event_universal_2 = require("./rise-v1-event.universal");
37
+ Object.defineProperty(exports, "SortOrder", { enumerable: true, get: function () { return rise_v1_event_universal_2.SortOrder; } });
38
+ //# sourceMappingURL=rise-v1-event.public.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rise-v1-event.public.js","sourceRoot":"","sources":["../../../src/rise-v1-event.public.ts"],"names":[],"mappings":";;;AACA,uEAUmC;AAEtB,QAAA,UAAU,GAAG,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAE7D,SAAgB,WAAW,CAAC,UAAsB;IAChD,OAAO,CAAC,KAAY,EAAE,EAAE,CACtB,IAAA,qCAAoB,EAClB,KAAK;IACL,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,kCAOC;AAED,SAAgB,QAAQ,CAAC,UAAsB;IAC7C,OAAO,CAAC,OAAe,EAAE,EAAE,CACzB,IAAA,kCAAiB,EACf,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,4BAOC;AAED,SAAgB,WAAW,CAAC,UAAsB;IAChD,OAAO,CAAC,GAAkB,EAAE,KAAkB,EAAE,EAAE,CAChD,IAAA,qCAAoB,EAClB,GAAG,EACH,KAAK;IACL,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,kCAQC;AAED,SAAgB,YAAY,CAAC,UAAsB;IACjD,OAAO,CAAC,OAAe,EAAE,OAA6B,EAAE,EAAE,CACxD,IAAA,sCAAqB,EACnB,OAAO,EACP,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,oCAQC;AAED,SAAgB,kBAAkB,CAAC,UAAsB;IACvD,OAAO,CAAC,KAAc,EAAE,EAAE,CACxB,IAAA,4CAA2B,EACzB,KAAK;IACL,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,gDAOC;AAED,qEAAsD;AAA7C,oHAAA,SAAS,OAAA"}
@@ -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,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SortOrder = void 0;
4
+ var SortOrder;
5
+ (function (SortOrder) {
6
+ SortOrder["ASC"] = "ASC";
7
+ SortOrder["DESC"] = "DESC";
8
+ })(SortOrder = exports.SortOrder || (exports.SortOrder = {}));
9
+ //# sourceMappingURL=rise-v1-event.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rise-v1-event.types.js","sourceRoot":"","sources":["../../../src/rise-v1-event.types.ts"],"names":[],"mappings":";;;AAkLA,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAGpB"}