@wix/auto_sdk_loyalty_imports 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/loyalty-imports-v1-loyalty-import-imports.context.d.ts +16 -0
  11. package/build/cjs/src/loyalty-imports-v1-loyalty-import-imports.context.js +23 -0
  12. package/build/cjs/src/loyalty-imports-v1-loyalty-import-imports.context.js.map +1 -0
  13. package/build/cjs/src/loyalty-imports-v1-loyalty-import-imports.http.d.ts +46 -0
  14. package/build/cjs/src/loyalty-imports-v1-loyalty-import-imports.http.js +243 -0
  15. package/build/cjs/src/loyalty-imports-v1-loyalty-import-imports.http.js.map +1 -0
  16. package/build/cjs/src/loyalty-imports-v1-loyalty-import-imports.meta.d.ts +18 -0
  17. package/build/cjs/src/loyalty-imports-v1-loyalty-import-imports.meta.js +142 -0
  18. package/build/cjs/src/loyalty-imports-v1-loyalty-import-imports.meta.js.map +1 -0
  19. package/build/cjs/src/loyalty-imports-v1-loyalty-import-imports.public.d.ts +77 -0
  20. package/build/cjs/src/loyalty-imports-v1-loyalty-import-imports.public.js +61 -0
  21. package/build/cjs/src/loyalty-imports-v1-loyalty-import-imports.public.js.map +1 -0
  22. package/build/cjs/src/loyalty-imports-v1-loyalty-import-imports.types.d.ts +446 -0
  23. package/build/cjs/src/loyalty-imports-v1-loyalty-import-imports.types.js +41 -0
  24. package/build/cjs/src/loyalty-imports-v1-loyalty-import-imports.types.js.map +1 -0
  25. package/build/cjs/src/loyalty-imports-v1-loyalty-import-imports.universal.d.ts +656 -0
  26. package/build/cjs/src/loyalty-imports-v1-loyalty-import-imports.universal.js +326 -0
  27. package/build/cjs/src/loyalty-imports-v1-loyalty-import-imports.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.context.d.ts +16 -0
  39. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.context.js +16 -0
  40. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.context.js.map +1 -0
  41. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.http.d.ts +46 -0
  42. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.http.js +234 -0
  43. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.http.js.map +1 -0
  44. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.meta.d.ts +18 -0
  45. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.meta.js +110 -0
  46. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.meta.js.map +1 -0
  47. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.public.d.ts +77 -0
  48. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.public.js +48 -0
  49. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.public.js.map +1 -0
  50. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.types.d.ts +446 -0
  51. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.types.js +38 -0
  52. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.types.js.map +1 -0
  53. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.universal.d.ts +656 -0
  54. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.universal.js +294 -0
  55. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.context.d.ts +16 -0
  66. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.context.js +23 -0
  67. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.context.js.map +1 -0
  68. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.http.d.ts +46 -0
  69. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.http.js +243 -0
  70. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.http.js.map +1 -0
  71. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.meta.d.ts +18 -0
  72. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.meta.js +142 -0
  73. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.meta.js.map +1 -0
  74. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.public.d.ts +77 -0
  75. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.public.js +61 -0
  76. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.public.js.map +1 -0
  77. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.types.d.ts +446 -0
  78. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.types.js +41 -0
  79. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.types.js.map +1 -0
  80. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.universal.d.ts +656 -0
  81. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.universal.js +326 -0
  82. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.context.d.ts +16 -0
  93. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.context.js +16 -0
  94. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.context.js.map +1 -0
  95. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.http.d.ts +46 -0
  96. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.http.js +234 -0
  97. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.http.js.map +1 -0
  98. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.meta.d.ts +18 -0
  99. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.meta.js +110 -0
  100. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.meta.js.map +1 -0
  101. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.public.d.ts +77 -0
  102. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.public.js +48 -0
  103. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.public.js.map +1 -0
  104. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.types.d.ts +446 -0
  105. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.types.js +38 -0
  106. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.types.js.map +1 -0
  107. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.universal.d.ts +656 -0
  108. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.universal.js +294 -0
  109. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,656 @@
1
+ /**
2
+ * An Import object is a batch import of loyalty points for existing customers.
3
+ * You can use Loyalty Imports to import loyalty points from 3rd-party providers or update existing customer point balances.
4
+ * This object tracks the entire import process from file upload to data processing.
5
+ */
6
+ export interface LoyaltyImport {
7
+ /**
8
+ * The ID of the import.
9
+ * @readonly
10
+ */
11
+ _id?: string | null;
12
+ /**
13
+ * ID of the asynchronous import job associated with this import.
14
+ * @readonly
15
+ */
16
+ asyncImportJobId?: string | null;
17
+ /**
18
+ * Revision number, which increments by 1 each time the Loyalty Import is updated.
19
+ * To prevent conflicting changes, the current revision must be passed when updating the Loyalty Import.
20
+ *
21
+ * Ignored when creating a Loyalty Import.
22
+ * @readonly
23
+ */
24
+ revision?: string | null;
25
+ /**
26
+ * Date and time the Loyalty Import was created.
27
+ * @readonly
28
+ */
29
+ _createdDate?: Date | null;
30
+ /**
31
+ * Date and time the Loyalty Import was last updated.
32
+ * @readonly
33
+ */
34
+ _updatedDate?: Date | null;
35
+ /**
36
+ * Current status of the import process.
37
+ * @readonly
38
+ */
39
+ status?: ImportStatus;
40
+ /** Metadata of the uploaded file containing loyalty points data. */
41
+ fileMetadata?: FileMetadata;
42
+ /** Results of parsing the uploaded file, including the number of rows parsed and any parse errors. */
43
+ parseResult?: ParseResult;
44
+ /** Results of the import process, including success and failure counts. */
45
+ importResult?: ImportResult;
46
+ }
47
+ export declare enum ImportStatus {
48
+ /** Status is unknown or not specified. */
49
+ UNKNOWN = "UNKNOWN",
50
+ /** The import has been initiated but processing has not yet begun. */
51
+ INITIATED = "INITIATED",
52
+ /** The system is currently parsing the import file. */
53
+ PARSING = "PARSING",
54
+ /** The import file has been successfully parsed and is ready for importing. */
55
+ PARSED = "PARSED",
56
+ /** The system is currently importing the parsed data. */
57
+ IMPORTING = "IMPORTING",
58
+ /** The import process is complete. This status indicates the process finished, but doesn't guarantee all data imported successfully. */
59
+ IMPORTED = "IMPORTED",
60
+ /** The import process has failed. */
61
+ FAILED = "FAILED"
62
+ }
63
+ export interface FileMetadata {
64
+ /**
65
+ * Size of the uploaded file in bytes. Max: `10 MB`.
66
+ * @readonly
67
+ */
68
+ size?: number | null;
69
+ /**
70
+ * Name of the uploaded file.
71
+ * @readonly
72
+ */
73
+ name?: string | null;
74
+ /** URL of the uploaded file. */
75
+ url?: string;
76
+ /** Column headings from the first row of the uploaded CSV file. */
77
+ header?: FileHeader;
78
+ /**
79
+ * Mapping between loyalty data fields and the corresponding columns in the uploaded file.
80
+ *
81
+ * Must include mappings for both `EMAIL` and `POINTS` to be valid.
82
+ */
83
+ headerMappingInfo?: HeaderMappingInfo;
84
+ /** Up to 5 sample rows from the import file, providing a preview of the data to be imported. */
85
+ sampleDataRows?: SampleDataRow[];
86
+ }
87
+ export interface FileHeader {
88
+ /** Column headings from the first row of the uploaded file. */
89
+ values?: string[];
90
+ }
91
+ export interface HeaderMappingInfo {
92
+ /**
93
+ * Mappings between required loyalty data fields and file columns.
94
+ * Must contain exactly 2 mappings: one for `EMAIL` and one for `POINTS`.
95
+ */
96
+ headerMappings?: HeaderMapping[];
97
+ }
98
+ export interface HeaderMapping {
99
+ /** The required loyalty data field that this mapping corresponds to. Must be either `EMAIL` or `POINTS`. */
100
+ columnName?: ColumnName;
101
+ /**
102
+ * The zero-based index of the column in the uploaded file that contains the data for this loyalty field.
103
+ * For example, if the email addresses are in the second column of the CSV file, this value would be 1.
104
+ */
105
+ columnIndex?: number;
106
+ }
107
+ export declare enum ColumnName {
108
+ /** Column containing the customer's email address. */
109
+ EMAIL = "EMAIL",
110
+ /** Column containing the customer's loyalty point balance to be imported or updated. */
111
+ POINTS = "POINTS"
112
+ }
113
+ export interface SampleDataRow {
114
+ /**
115
+ * Values in one sample data row. Each value corresponds to a column in the CSV file.
116
+ * The number of values matches the number of columns in the file.
117
+ */
118
+ values?: string[];
119
+ }
120
+ export interface ParseResult {
121
+ /**
122
+ * Number of rows parsed from the uploaded import file.
123
+ * @readonly
124
+ */
125
+ parsedRowCount?: number | null;
126
+ /**
127
+ * Reason code explaining why parsing failed, if applicable.
128
+ * @readonly
129
+ */
130
+ parseErrorReason?: string | null;
131
+ }
132
+ export interface ImportResult {
133
+ /** Whether an error file detailing import failures is available for download. The file includes row-by-row import status, error reasons, and original data. */
134
+ errorFileExists?: boolean;
135
+ /**
136
+ * Number of rows successfully imported.
137
+ * @readonly
138
+ */
139
+ successCount?: number | null;
140
+ /**
141
+ * Number of rows that failed to import due to errors.
142
+ * @readonly
143
+ */
144
+ failureCount?: number | null;
145
+ }
146
+ export interface CreateLoyaltyImportRequest {
147
+ /** URL of the file to import. */
148
+ fileUrl: string | null;
149
+ /** Name of the file to import. */
150
+ fileName?: string | null;
151
+ /** Size of the file to import, in bytes. */
152
+ fileSize?: number | null;
153
+ }
154
+ export interface CreateLoyaltyImportResponse {
155
+ /** Created loyalty import. */
156
+ loyaltyImport?: LoyaltyImport;
157
+ }
158
+ export interface GetLoyaltyImportRequest {
159
+ /** Loyalty import ID. */
160
+ loyaltyImportId: string;
161
+ }
162
+ export interface GetLoyaltyImportResponse {
163
+ /** Retrieved loyalty import. */
164
+ loyaltyImport?: LoyaltyImport;
165
+ }
166
+ export interface GetErrorFileDownloadUrlRequest {
167
+ /** Loyalty import ID. */
168
+ loyaltyImportId: string;
169
+ }
170
+ export interface GetErrorFileDownloadUrlResponse {
171
+ /** URL for downloading the error file. */
172
+ url?: string | null;
173
+ }
174
+ export interface ExecuteLoyaltyImportRequest {
175
+ /** Loyalty import ID. */
176
+ loyaltyImportId: string;
177
+ /** Header mapping information for the import file. */
178
+ headerMappingInfo?: HeaderMappingInfo;
179
+ }
180
+ export interface ExecuteLoyaltyImportResponse {
181
+ /** Executed loyalty import. */
182
+ loyaltyImport?: LoyaltyImport;
183
+ }
184
+ export interface CreateLoyaltyImportFileUrlRequest {
185
+ }
186
+ export interface CreateLoyaltyImportFileUrlResponse {
187
+ /** Path where the file will be stored. */
188
+ filePath?: string | null;
189
+ /** URL for uploading the loyalty import file. */
190
+ uploadUrl?: string | null;
191
+ }
192
+ export interface QueryLoyaltyImportsRequest {
193
+ /**
194
+ * Filter object.
195
+ * See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language)
196
+ * for more information.
197
+ *
198
+ * For a detailed list of supported filters, see
199
+ * [Supported Filters](https://dev.wix.com/api/rest/wix-loyalty-program/loyalty-imports/supported-filters).
200
+ */
201
+ query: CursorQuery;
202
+ }
203
+ export interface CursorQuery extends CursorQueryPagingMethodOneOf {
204
+ /**
205
+ * Cursor paging options.
206
+ *
207
+ * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
208
+ */
209
+ cursorPaging?: CursorPaging;
210
+ /**
211
+ * Filter object.
212
+ *
213
+ * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
214
+ */
215
+ filter?: Record<string, any> | null;
216
+ /**
217
+ * Sort object.
218
+ *
219
+ * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
220
+ */
221
+ sort?: Sorting[];
222
+ }
223
+ /** @oneof */
224
+ export interface CursorQueryPagingMethodOneOf {
225
+ /**
226
+ * Cursor paging options.
227
+ *
228
+ * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
229
+ */
230
+ cursorPaging?: CursorPaging;
231
+ }
232
+ export interface Sorting {
233
+ /** Name of the field to sort by. */
234
+ fieldName?: string;
235
+ /** Sort order. */
236
+ order?: SortOrder;
237
+ }
238
+ export declare enum SortOrder {
239
+ ASC = "ASC",
240
+ DESC = "DESC"
241
+ }
242
+ export interface CursorPaging {
243
+ /** Maximum number of items to return in the results. */
244
+ limit?: number | null;
245
+ /**
246
+ * Pointer to the next or previous page in the list of results.
247
+ *
248
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
249
+ * Not relevant for the first request.
250
+ */
251
+ cursor?: string | null;
252
+ }
253
+ export interface QueryLoyaltyImportsResponse {
254
+ /** List of loyalty imports matching the query. */
255
+ loyaltyImports?: LoyaltyImport[];
256
+ /** Paging metadata. */
257
+ pagingMetadata?: CursorPagingMetadata;
258
+ }
259
+ export interface CursorPagingMetadata {
260
+ /** Number of items returned in current page. */
261
+ count?: number | null;
262
+ /** Cursor strings that point to the next page, previous page, or both. */
263
+ cursors?: Cursors;
264
+ /**
265
+ * Whether there are more pages to retrieve following the current page.
266
+ *
267
+ * + `true`: Another page of results can be retrieved.
268
+ * + `false`: This is the last page.
269
+ */
270
+ hasNext?: boolean | null;
271
+ }
272
+ export interface Cursors {
273
+ /** Cursor string pointing to the next page in the list of results. */
274
+ next?: string | null;
275
+ /** Cursor pointing to the previous page in the list of results. */
276
+ prev?: string | null;
277
+ }
278
+ export interface DeleteLoyaltyImportRequest {
279
+ /** Loyalty import ID. */
280
+ loyaltyImportId?: string;
281
+ /**
282
+ * Revision number, which increments by 1 each time the loyalty import is updated.
283
+ * To prevent conflicting changes, the current revision must be passed when updating the loyalty import.
284
+ */
285
+ revision?: string;
286
+ }
287
+ export interface DeleteLoyaltyImportResponse {
288
+ }
289
+ export interface DomainEvent extends DomainEventBodyOneOf {
290
+ createdEvent?: EntityCreatedEvent;
291
+ updatedEvent?: EntityUpdatedEvent;
292
+ deletedEvent?: EntityDeletedEvent;
293
+ actionEvent?: ActionEvent;
294
+ /**
295
+ * Unique event ID.
296
+ * Allows clients to ignore duplicate webhooks.
297
+ */
298
+ _id?: string;
299
+ /**
300
+ * Assumes actions are also always typed to an entity_type
301
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
302
+ */
303
+ entityFqdn?: string;
304
+ /**
305
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
306
+ * This is although the created/updated/deleted notion is duplication of the oneof types
307
+ * Example: created/updated/deleted/started/completed/email_opened
308
+ */
309
+ slug?: string;
310
+ /** ID of the entity associated with the event. */
311
+ entityId?: string;
312
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
313
+ eventTime?: Date | null;
314
+ /**
315
+ * Whether the event was triggered as a result of a privacy regulation application
316
+ * (for example, GDPR).
317
+ */
318
+ triggeredByAnonymizeRequest?: boolean | null;
319
+ /** If present, indicates the action that triggered the event. */
320
+ originatedFrom?: string | null;
321
+ /**
322
+ * A sequence number defining the order of updates to the underlying entity.
323
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
324
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
325
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
326
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
327
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
328
+ */
329
+ entityEventSequence?: string | null;
330
+ }
331
+ /** @oneof */
332
+ export interface DomainEventBodyOneOf {
333
+ createdEvent?: EntityCreatedEvent;
334
+ updatedEvent?: EntityUpdatedEvent;
335
+ deletedEvent?: EntityDeletedEvent;
336
+ actionEvent?: ActionEvent;
337
+ }
338
+ export interface EntityCreatedEvent {
339
+ entity?: string;
340
+ }
341
+ export interface RestoreInfo {
342
+ deletedDate?: Date | null;
343
+ }
344
+ export interface EntityUpdatedEvent {
345
+ /**
346
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
347
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
348
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
349
+ */
350
+ currentEntity?: string;
351
+ }
352
+ export interface EntityDeletedEvent {
353
+ /** Entity that was deleted */
354
+ deletedEntity?: string | null;
355
+ }
356
+ export interface ActionEvent {
357
+ body?: string;
358
+ }
359
+ export interface Empty {
360
+ }
361
+ export interface ImportFinished {
362
+ /** Completed loyalty import. */
363
+ loyaltyImport?: LoyaltyImport;
364
+ }
365
+ export interface MessageEnvelope {
366
+ /** App instance ID. */
367
+ instanceId?: string | null;
368
+ /** Event type. */
369
+ eventType?: string;
370
+ /** The identification type and identity data. */
371
+ identity?: IdentificationData;
372
+ /** Stringify payload. */
373
+ data?: string;
374
+ }
375
+ export interface IdentificationData extends IdentificationDataIdOneOf {
376
+ /** ID of a site visitor that has not logged in to the site. */
377
+ anonymousVisitorId?: string;
378
+ /** ID of a site visitor that has logged in to the site. */
379
+ memberId?: string;
380
+ /** ID of a Wix user (site owner, contributor, etc.). */
381
+ wixUserId?: string;
382
+ /** ID of an app. */
383
+ appId?: string;
384
+ /** @readonly */
385
+ identityType?: WebhookIdentityType;
386
+ }
387
+ /** @oneof */
388
+ export interface IdentificationDataIdOneOf {
389
+ /** ID of a site visitor that has not logged in to the site. */
390
+ anonymousVisitorId?: string;
391
+ /** ID of a site visitor that has logged in to the site. */
392
+ memberId?: string;
393
+ /** ID of a Wix user (site owner, contributor, etc.). */
394
+ wixUserId?: string;
395
+ /** ID of an app. */
396
+ appId?: string;
397
+ }
398
+ export declare enum WebhookIdentityType {
399
+ UNKNOWN = "UNKNOWN",
400
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
401
+ MEMBER = "MEMBER",
402
+ WIX_USER = "WIX_USER",
403
+ APP = "APP"
404
+ }
405
+ interface FileHeaderNonNullableFields {
406
+ values: string[];
407
+ }
408
+ interface HeaderMappingNonNullableFields {
409
+ columnName: ColumnName;
410
+ columnIndex: number;
411
+ }
412
+ interface HeaderMappingInfoNonNullableFields {
413
+ headerMappings: HeaderMappingNonNullableFields[];
414
+ }
415
+ interface SampleDataRowNonNullableFields {
416
+ values: string[];
417
+ }
418
+ interface FileMetadataNonNullableFields {
419
+ url: string;
420
+ header?: FileHeaderNonNullableFields;
421
+ headerMappingInfo?: HeaderMappingInfoNonNullableFields;
422
+ sampleDataRows: SampleDataRowNonNullableFields[];
423
+ }
424
+ interface ImportResultNonNullableFields {
425
+ errorFileExists: boolean;
426
+ }
427
+ export interface LoyaltyImportNonNullableFields {
428
+ status: ImportStatus;
429
+ fileMetadata?: FileMetadataNonNullableFields;
430
+ importResult?: ImportResultNonNullableFields;
431
+ }
432
+ export interface CreateLoyaltyImportResponseNonNullableFields {
433
+ loyaltyImport?: LoyaltyImportNonNullableFields;
434
+ }
435
+ export interface GetLoyaltyImportResponseNonNullableFields {
436
+ loyaltyImport?: LoyaltyImportNonNullableFields;
437
+ }
438
+ export interface ExecuteLoyaltyImportResponseNonNullableFields {
439
+ loyaltyImport?: LoyaltyImportNonNullableFields;
440
+ }
441
+ export interface QueryLoyaltyImportsResponseNonNullableFields {
442
+ loyaltyImports: LoyaltyImportNonNullableFields[];
443
+ }
444
+ export interface BaseEventMetadata {
445
+ /** App instance ID. */
446
+ instanceId?: string | null;
447
+ /** Event type. */
448
+ eventType?: string;
449
+ /** The identification type and identity data. */
450
+ identity?: IdentificationData;
451
+ }
452
+ export interface EventMetadata extends BaseEventMetadata {
453
+ /**
454
+ * Unique event ID.
455
+ * Allows clients to ignore duplicate webhooks.
456
+ */
457
+ _id?: string;
458
+ /**
459
+ * Assumes actions are also always typed to an entity_type
460
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
461
+ */
462
+ entityFqdn?: string;
463
+ /**
464
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
465
+ * This is although the created/updated/deleted notion is duplication of the oneof types
466
+ * Example: created/updated/deleted/started/completed/email_opened
467
+ */
468
+ slug?: string;
469
+ /** ID of the entity associated with the event. */
470
+ entityId?: string;
471
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
472
+ eventTime?: Date | null;
473
+ /**
474
+ * Whether the event was triggered as a result of a privacy regulation application
475
+ * (for example, GDPR).
476
+ */
477
+ triggeredByAnonymizeRequest?: boolean | null;
478
+ /** If present, indicates the action that triggered the event. */
479
+ originatedFrom?: string | null;
480
+ /**
481
+ * A sequence number defining the order of updates to the underlying entity.
482
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
483
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
484
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
485
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
486
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
487
+ */
488
+ entityEventSequence?: string | null;
489
+ }
490
+ export interface LoyaltyImportCreatedEnvelope {
491
+ entity: LoyaltyImport;
492
+ metadata: EventMetadata;
493
+ }
494
+ /**
495
+ * Triggered when a loyalty import is created.
496
+ * @webhook
497
+ * @eventType wix.loyalty.imports.v1.loyalty_import_created
498
+ */
499
+ export declare function onLoyaltyImportCreated(handler: (event: LoyaltyImportCreatedEnvelope) => void | Promise<void>): void;
500
+ /**
501
+ * Creates an import object based on an uploaded file.
502
+ *
503
+ * Call this method after uploading your file to the URL obtained from `createLoyaltyImportFileUrl()`.
504
+ * @param fileUrl - URL of the file to import.
505
+ * @public
506
+ * @requiredField fileUrl
507
+ * @permissionId LOYALTY.MANAGE_IMPORTS
508
+ * @permissionScope Manage Loyalty
509
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
510
+ * @applicableIdentity APP
511
+ * @fqn wix.loyalty.imports.v1.LoyaltyImports.CreateLoyaltyImport
512
+ */
513
+ export declare function createLoyaltyImport(fileUrl: string | null, options?: CreateLoyaltyImportOptions): Promise<CreateLoyaltyImportResponse & CreateLoyaltyImportResponseNonNullableFields>;
514
+ export interface CreateLoyaltyImportOptions {
515
+ /** Name of the file to import. */
516
+ fileName?: string | null;
517
+ /** Size of the file to import, in bytes. */
518
+ fileSize?: number | null;
519
+ }
520
+ /**
521
+ * Retrieves a loyalty import.
522
+ * @param loyaltyImportId - Loyalty import ID.
523
+ * @public
524
+ * @requiredField loyaltyImportId
525
+ * @permissionId LOYALTY.MANAGE_IMPORTS
526
+ * @permissionScope Manage Loyalty
527
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
528
+ * @applicableIdentity APP
529
+ * @returns Retrieved loyalty import.
530
+ * @fqn wix.loyalty.imports.v1.LoyaltyImports.GetLoyaltyImport
531
+ */
532
+ export declare function getLoyaltyImport(loyaltyImportId: string): Promise<LoyaltyImport & LoyaltyImportNonNullableFields>;
533
+ /**
534
+ * Retrieves the download URL for the error file of a failed loyalty import.
535
+ *
536
+ * If an import fails, the `importResult.errorFileExists` field in the `LoyaltyImport` object is set to `true`.
537
+ *
538
+ * Use this method to get the URL of the error file, which contains details about which items couldn't be imported and why.
539
+ * @param loyaltyImportId - Loyalty import ID.
540
+ * @public
541
+ * @requiredField loyaltyImportId
542
+ * @permissionId LOYALTY.MANAGE_IMPORTS
543
+ * @permissionScope Manage Loyalty
544
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
545
+ * @applicableIdentity APP
546
+ * @fqn wix.loyalty.imports.v1.LoyaltyImports.GetErrorFileDownloadUrl
547
+ */
548
+ export declare function getErrorFileDownloadUrl(loyaltyImportId: string): Promise<GetErrorFileDownloadUrlResponse>;
549
+ /**
550
+ * Starts the actual import process for a loyalty import.
551
+ *
552
+ * Call this method after the loyalty import object reaches the `PARSED` status.
553
+ * @param loyaltyImportId - Loyalty import ID.
554
+ * @public
555
+ * @requiredField loyaltyImportId
556
+ * @permissionId LOYALTY.MANAGE_IMPORTS
557
+ * @permissionScope Manage Loyalty
558
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
559
+ * @applicableIdentity APP
560
+ * @fqn wix.loyalty.imports.v1.LoyaltyImports.ExecuteLoyaltyImport
561
+ */
562
+ export declare function executeLoyaltyImport(loyaltyImportId: string, options?: ExecuteLoyaltyImportOptions): Promise<ExecuteLoyaltyImportResponse & ExecuteLoyaltyImportResponseNonNullableFields>;
563
+ export interface ExecuteLoyaltyImportOptions {
564
+ /** Header mapping information for the import file. */
565
+ headerMappingInfo?: HeaderMappingInfo;
566
+ }
567
+ /**
568
+ * Creates a URL for uploading a loyalty import file.
569
+ *
570
+ * This method is the first step in the loyalty import process. It returns a file path and an upload URL, which you'll use in subsequent steps of the import process.
571
+ * @public
572
+ * @permissionId LOYALTY.MANAGE_IMPORTS
573
+ * @permissionScope Manage Loyalty
574
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
575
+ * @applicableIdentity APP
576
+ * @fqn wix.loyalty.imports.v1.LoyaltyImports.CreateLoyaltyImportFileUrl
577
+ */
578
+ export declare function createLoyaltyImportFileUrl(): Promise<CreateLoyaltyImportFileUrlResponse>;
579
+ /**
580
+ * Creates a query to retrieve a list of loyalty imports.
581
+ *
582
+ * The `queryLoyaltyImports()` function builds a query to retrieve a list of imports and returns a `LoyaltyImportsQueryBuilder` object.
583
+ *
584
+ * The returned object contains the query definition, which is typically used to run the query using the `find()` function.
585
+ *
586
+ * You can refine the query by chaining `LoyaltyImportsQueryBuilder` functions onto the query. `LoyaltyImportsQueryBuilder` functions enable you to sort, filter, and control the results `queryLoyaltyImports()` returns.
587
+ *
588
+ * `queryLoyaltyImports()` runs with these `LoyaltyImportsQueryBuilder` defaults, which you can override:
589
+ *
590
+ * - `limit(50)`
591
+ * - `descending("_createdDate")`
592
+ *
593
+ * The functions that are chained to `queryLoyaltyImports()` are applied in the order they're called. For example, if you apply ascending('status') and then descending('_createdDate'), the results are sorted first by the status, and then, if there are multiple results with the same status, the items are sorted by the created date.
594
+ * @public
595
+ * @permissionScope Manage Loyalty
596
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
597
+ * @permissionId LOYALTY.MANAGE_IMPORTS
598
+ * @applicableIdentity APP
599
+ * @fqn wix.loyalty.imports.v1.LoyaltyImports.QueryLoyaltyImports
600
+ */
601
+ export declare function queryLoyaltyImports(): LoyaltyImportsQueryBuilder;
602
+ interface QueryCursorResult {
603
+ cursors: Cursors;
604
+ hasNext: () => boolean;
605
+ hasPrev: () => boolean;
606
+ length: number;
607
+ pageSize: number;
608
+ }
609
+ export interface LoyaltyImportsQueryResult extends QueryCursorResult {
610
+ items: LoyaltyImport[];
611
+ query: LoyaltyImportsQueryBuilder;
612
+ next: () => Promise<LoyaltyImportsQueryResult>;
613
+ prev: () => Promise<LoyaltyImportsQueryResult>;
614
+ }
615
+ export interface LoyaltyImportsQueryBuilder {
616
+ /** @param propertyName - Property whose value is compared with `value`.
617
+ * @param value - Value to compare against.
618
+ */
619
+ eq: (propertyName: '_createdDate' | '_updatedDate' | 'status', value: any) => LoyaltyImportsQueryBuilder;
620
+ /** @param propertyName - Property whose value is compared with `value`.
621
+ * @param value - Value to compare against.
622
+ */
623
+ ne: (propertyName: '_createdDate' | '_updatedDate' | 'status', value: any) => LoyaltyImportsQueryBuilder;
624
+ /** @param propertyName - Property whose value is compared with `value`.
625
+ * @param value - Value to compare against.
626
+ */
627
+ ge: (propertyName: '_createdDate' | '_updatedDate', value: any) => LoyaltyImportsQueryBuilder;
628
+ /** @param propertyName - Property whose value is compared with `value`.
629
+ * @param value - Value to compare against.
630
+ */
631
+ gt: (propertyName: '_createdDate' | '_updatedDate', value: any) => LoyaltyImportsQueryBuilder;
632
+ /** @param propertyName - Property whose value is compared with `value`.
633
+ * @param value - Value to compare against.
634
+ */
635
+ le: (propertyName: '_createdDate' | '_updatedDate', value: any) => LoyaltyImportsQueryBuilder;
636
+ /** @param propertyName - Property whose value is compared with `value`.
637
+ * @param value - Value to compare against.
638
+ */
639
+ lt: (propertyName: '_createdDate' | '_updatedDate', value: any) => LoyaltyImportsQueryBuilder;
640
+ /** @param propertyName - Property whose value is compared with `values`.
641
+ * @param values - List of values to compare against.
642
+ */
643
+ hasSome: (propertyName: '_createdDate' | '_updatedDate' | 'status', value: any[]) => LoyaltyImportsQueryBuilder;
644
+ in: (propertyName: '_createdDate' | '_updatedDate' | 'status', value: any) => LoyaltyImportsQueryBuilder;
645
+ exists: (propertyName: '_createdDate' | '_updatedDate' | 'status', value: boolean) => LoyaltyImportsQueryBuilder;
646
+ /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */
647
+ ascending: (...propertyNames: Array<'_createdDate' | '_updatedDate' | 'status'>) => LoyaltyImportsQueryBuilder;
648
+ /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */
649
+ descending: (...propertyNames: Array<'_createdDate' | '_updatedDate' | 'status'>) => LoyaltyImportsQueryBuilder;
650
+ /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */
651
+ limit: (limit: number) => LoyaltyImportsQueryBuilder;
652
+ /** @param cursor - A pointer to specific record */
653
+ skipTo: (cursor: string) => LoyaltyImportsQueryBuilder;
654
+ find: () => Promise<LoyaltyImportsQueryResult>;
655
+ }
656
+ export {};