@wix/auto_sdk_loyalty_imports 1.0.6 → 1.0.8

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 (133) 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 +473 -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/{internal/loyalty-imports-v1-loyalty-import-imports.universal-2D8oFVKm.d.mts → cjs/src/loyalty-imports-v1-loyalty-import-imports.universal.d.ts} +170 -53
  26. package/build/cjs/src/loyalty-imports-v1-loyalty-import-imports.universal.js +338 -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/src/loyalty-imports-v1-loyalty-import-imports.context.d.ts +16 -0
  38. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.context.js +16 -0
  39. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.context.js.map +1 -0
  40. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.http.d.ts +46 -0
  41. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.http.js +234 -0
  42. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.http.js.map +1 -0
  43. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.meta.d.ts +18 -0
  44. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.meta.js +110 -0
  45. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.meta.js.map +1 -0
  46. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.public.d.ts +77 -0
  47. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.public.js +48 -0
  48. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.public.js.map +1 -0
  49. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.types.d.ts +473 -0
  50. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.types.js +38 -0
  51. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.types.js.map +1 -0
  52. package/build/{internal/loyalty-imports-v1-loyalty-import-imports.universal-2D8oFVKm.d.ts → es/src/loyalty-imports-v1-loyalty-import-imports.universal.d.ts} +170 -53
  53. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.universal.js +306 -0
  54. package/build/es/src/loyalty-imports-v1-loyalty-import-imports.universal.js.map +1 -0
  55. package/build/internal/cjs/index.d.ts +1 -0
  56. package/build/internal/cjs/index.js +18 -0
  57. package/build/internal/cjs/index.js.map +1 -0
  58. package/build/internal/cjs/index.typings.d.ts +1 -0
  59. package/build/internal/cjs/index.typings.js +18 -0
  60. package/build/internal/cjs/index.typings.js.map +1 -0
  61. package/build/internal/cjs/meta.d.ts +1 -0
  62. package/build/internal/cjs/meta.js +18 -0
  63. package/build/internal/cjs/meta.js.map +1 -0
  64. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.context.d.ts +16 -0
  65. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.context.js +23 -0
  66. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.context.js.map +1 -0
  67. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.http.d.ts +46 -0
  68. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.http.js +243 -0
  69. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.http.js.map +1 -0
  70. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.meta.d.ts +18 -0
  71. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.meta.js +142 -0
  72. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.meta.js.map +1 -0
  73. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.public.d.ts +77 -0
  74. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.public.js +61 -0
  75. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.public.js.map +1 -0
  76. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.types.d.ts +473 -0
  77. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.types.js +41 -0
  78. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.types.js.map +1 -0
  79. package/build/{loyalty-imports-v1-loyalty-import-imports.universal-2D8oFVKm.d.mts → internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.universal.d.ts} +170 -53
  80. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.universal.js +338 -0
  81. package/build/internal/cjs/src/loyalty-imports-v1-loyalty-import-imports.universal.js.map +1 -0
  82. package/build/internal/es/index.d.ts +1 -0
  83. package/build/internal/es/index.js +2 -0
  84. package/build/internal/es/index.js.map +1 -0
  85. package/build/internal/es/index.typings.d.ts +1 -0
  86. package/build/internal/es/index.typings.js +2 -0
  87. package/build/internal/es/index.typings.js.map +1 -0
  88. package/build/internal/es/meta.d.ts +1 -0
  89. package/build/internal/es/meta.js +2 -0
  90. package/build/internal/es/meta.js.map +1 -0
  91. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.context.d.ts +16 -0
  92. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.context.js +16 -0
  93. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.context.js.map +1 -0
  94. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.http.d.ts +46 -0
  95. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.http.js +234 -0
  96. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.http.js.map +1 -0
  97. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.meta.d.ts +18 -0
  98. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.meta.js +110 -0
  99. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.meta.js.map +1 -0
  100. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.public.d.ts +77 -0
  101. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.public.js +48 -0
  102. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.public.js.map +1 -0
  103. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.types.d.ts +473 -0
  104. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.types.js +38 -0
  105. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.types.js.map +1 -0
  106. package/build/{loyalty-imports-v1-loyalty-import-imports.universal-2D8oFVKm.d.ts → internal/es/src/loyalty-imports-v1-loyalty-import-imports.universal.d.ts} +170 -53
  107. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.universal.js +306 -0
  108. package/build/internal/es/src/loyalty-imports-v1-loyalty-import-imports.universal.js.map +1 -0
  109. package/package.json +11 -12
  110. package/build/index.d.mts +0 -88
  111. package/build/index.d.ts +0 -88
  112. package/build/index.js +0 -536
  113. package/build/index.js.map +0 -1
  114. package/build/index.mjs +0 -502
  115. package/build/index.mjs.map +0 -1
  116. package/build/internal/index.d.mts +0 -88
  117. package/build/internal/index.d.ts +0 -88
  118. package/build/internal/index.js +0 -536
  119. package/build/internal/index.js.map +0 -1
  120. package/build/internal/index.mjs +0 -502
  121. package/build/internal/index.mjs.map +0 -1
  122. package/build/internal/meta.d.mts +0 -332
  123. package/build/internal/meta.d.ts +0 -332
  124. package/build/internal/meta.js +0 -348
  125. package/build/internal/meta.js.map +0 -1
  126. package/build/internal/meta.mjs +0 -316
  127. package/build/internal/meta.mjs.map +0 -1
  128. package/build/meta.d.mts +0 -332
  129. package/build/meta.d.ts +0 -332
  130. package/build/meta.js +0 -348
  131. package/build/meta.js.map +0 -1
  132. package/build/meta.mjs +0 -316
  133. package/build/meta.mjs.map +0 -1
@@ -0,0 +1,306 @@
1
+ import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
2
+ import { queryBuilder } from '@wix/sdk-runtime/query-builder';
3
+ import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
4
+ import * as ambassadorWixLoyaltyImportsV1LoyaltyImport from './loyalty-imports-v1-loyalty-import-imports.http.js';
5
+ export var ImportStatus;
6
+ (function (ImportStatus) {
7
+ /** Status is unknown or not specified. */
8
+ ImportStatus["UNKNOWN"] = "UNKNOWN";
9
+ /** The import has been initiated but processing has not yet begun. */
10
+ ImportStatus["INITIATED"] = "INITIATED";
11
+ /** The system is currently parsing the import file. */
12
+ ImportStatus["PARSING"] = "PARSING";
13
+ /** The import file has been successfully parsed and is ready for importing. */
14
+ ImportStatus["PARSED"] = "PARSED";
15
+ /** The system is currently importing the parsed data. */
16
+ ImportStatus["IMPORTING"] = "IMPORTING";
17
+ /** The import process is complete. This status indicates the process finished, but doesn't guarantee all data imported successfully. */
18
+ ImportStatus["IMPORTED"] = "IMPORTED";
19
+ /** The import process has failed. */
20
+ ImportStatus["FAILED"] = "FAILED";
21
+ })(ImportStatus || (ImportStatus = {}));
22
+ export var ColumnName;
23
+ (function (ColumnName) {
24
+ /** Column containing the customer's email address. */
25
+ ColumnName["EMAIL"] = "EMAIL";
26
+ /** Column containing the customer's loyalty point balance to be imported or updated. */
27
+ ColumnName["POINTS"] = "POINTS";
28
+ })(ColumnName || (ColumnName = {}));
29
+ export var SortOrder;
30
+ (function (SortOrder) {
31
+ SortOrder["ASC"] = "ASC";
32
+ SortOrder["DESC"] = "DESC";
33
+ })(SortOrder || (SortOrder = {}));
34
+ export var WebhookIdentityType;
35
+ (function (WebhookIdentityType) {
36
+ WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
37
+ WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
38
+ WebhookIdentityType["MEMBER"] = "MEMBER";
39
+ WebhookIdentityType["WIX_USER"] = "WIX_USER";
40
+ WebhookIdentityType["APP"] = "APP";
41
+ })(WebhookIdentityType || (WebhookIdentityType = {}));
42
+ /**
43
+ * Creates an import object based on an uploaded file.
44
+ *
45
+ * Call this method after uploading your file to the URL obtained from `createLoyaltyImportFileUrl()`.
46
+ * @param fileUrl - URL of the file to import.
47
+ * @public
48
+ * @requiredField fileUrl
49
+ * @permissionId LOYALTY.MANAGE_IMPORTS
50
+ * @permissionScope Manage Loyalty
51
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
52
+ * @permissionScope Manage Restaurants - all permissions
53
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
54
+ * @applicableIdentity APP
55
+ * @fqn wix.loyalty.imports.v1.LoyaltyImports.CreateLoyaltyImport
56
+ */
57
+ export async function createLoyaltyImport(fileUrl, options) {
58
+ // @ts-ignore
59
+ const { httpClient, sideEffects } = arguments[2];
60
+ const payload = renameKeysFromSDKRequestToRESTRequest({
61
+ fileUrl: fileUrl,
62
+ fileName: options?.fileName,
63
+ fileSize: options?.fileSize,
64
+ });
65
+ const reqOpts = ambassadorWixLoyaltyImportsV1LoyaltyImport.createLoyaltyImport(payload);
66
+ sideEffects?.onSiteCall?.();
67
+ try {
68
+ const result = await httpClient.request(reqOpts);
69
+ sideEffects?.onSuccess?.(result);
70
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
71
+ }
72
+ catch (err) {
73
+ const transformedError = sdkTransformError(err, {
74
+ spreadPathsToArguments: {},
75
+ explicitPathsToArguments: {
76
+ fileUrl: '$[0]',
77
+ fileName: '$[1].fileName',
78
+ fileSize: '$[1].fileSize',
79
+ },
80
+ singleArgumentUnchanged: false,
81
+ }, ['fileUrl', 'options']);
82
+ sideEffects?.onError?.(err);
83
+ throw transformedError;
84
+ }
85
+ }
86
+ /**
87
+ * Retrieves a loyalty import.
88
+ * @param loyaltyImportId - Loyalty import ID.
89
+ * @public
90
+ * @requiredField loyaltyImportId
91
+ * @permissionId LOYALTY.MANAGE_IMPORTS
92
+ * @permissionScope Manage Loyalty
93
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
94
+ * @permissionScope Manage Restaurants - all permissions
95
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
96
+ * @applicableIdentity APP
97
+ * @returns Retrieved loyalty import.
98
+ * @fqn wix.loyalty.imports.v1.LoyaltyImports.GetLoyaltyImport
99
+ */
100
+ export async function getLoyaltyImport(loyaltyImportId) {
101
+ // @ts-ignore
102
+ const { httpClient, sideEffects } = arguments[1];
103
+ const payload = renameKeysFromSDKRequestToRESTRequest({
104
+ loyaltyImportId: loyaltyImportId,
105
+ });
106
+ const reqOpts = ambassadorWixLoyaltyImportsV1LoyaltyImport.getLoyaltyImport(payload);
107
+ sideEffects?.onSiteCall?.();
108
+ try {
109
+ const result = await httpClient.request(reqOpts);
110
+ sideEffects?.onSuccess?.(result);
111
+ return renameKeysFromRESTResponseToSDKResponse(result.data)?.loyaltyImport;
112
+ }
113
+ catch (err) {
114
+ const transformedError = sdkTransformError(err, {
115
+ spreadPathsToArguments: {},
116
+ explicitPathsToArguments: { loyaltyImportId: '$[0]' },
117
+ singleArgumentUnchanged: false,
118
+ }, ['loyaltyImportId']);
119
+ sideEffects?.onError?.(err);
120
+ throw transformedError;
121
+ }
122
+ }
123
+ /**
124
+ * Retrieves the download URL for the error file of a failed loyalty import.
125
+ *
126
+ * If an import fails, the `importResult.errorFileExists` field in the `LoyaltyImport` object is set to `true`.
127
+ *
128
+ * Use this method to get the URL of the error file, which contains details about which items couldn't be imported and why.
129
+ * @param loyaltyImportId - Loyalty import ID.
130
+ * @public
131
+ * @requiredField loyaltyImportId
132
+ * @permissionId LOYALTY.MANAGE_IMPORTS
133
+ * @permissionScope Manage Loyalty
134
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
135
+ * @permissionScope Manage Restaurants - all permissions
136
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
137
+ * @applicableIdentity APP
138
+ * @fqn wix.loyalty.imports.v1.LoyaltyImports.GetErrorFileDownloadUrl
139
+ */
140
+ export async function getErrorFileDownloadUrl(loyaltyImportId) {
141
+ // @ts-ignore
142
+ const { httpClient, sideEffects } = arguments[1];
143
+ const payload = renameKeysFromSDKRequestToRESTRequest({
144
+ loyaltyImportId: loyaltyImportId,
145
+ });
146
+ const reqOpts = ambassadorWixLoyaltyImportsV1LoyaltyImport.getErrorFileDownloadUrl(payload);
147
+ sideEffects?.onSiteCall?.();
148
+ try {
149
+ const result = await httpClient.request(reqOpts);
150
+ sideEffects?.onSuccess?.(result);
151
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
152
+ }
153
+ catch (err) {
154
+ const transformedError = sdkTransformError(err, {
155
+ spreadPathsToArguments: {},
156
+ explicitPathsToArguments: { loyaltyImportId: '$[0]' },
157
+ singleArgumentUnchanged: false,
158
+ }, ['loyaltyImportId']);
159
+ sideEffects?.onError?.(err);
160
+ throw transformedError;
161
+ }
162
+ }
163
+ /**
164
+ * Starts the actual import process for a loyalty import.
165
+ *
166
+ * Call this method after the loyalty import object reaches the `PARSED` status.
167
+ * @param loyaltyImportId - Loyalty import ID.
168
+ * @public
169
+ * @requiredField loyaltyImportId
170
+ * @permissionId LOYALTY.MANAGE_IMPORTS
171
+ * @permissionScope Manage Loyalty
172
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
173
+ * @permissionScope Manage Restaurants - all permissions
174
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
175
+ * @applicableIdentity APP
176
+ * @fqn wix.loyalty.imports.v1.LoyaltyImports.ExecuteLoyaltyImport
177
+ */
178
+ export async function executeLoyaltyImport(loyaltyImportId, options) {
179
+ // @ts-ignore
180
+ const { httpClient, sideEffects } = arguments[2];
181
+ const payload = renameKeysFromSDKRequestToRESTRequest({
182
+ loyaltyImportId: loyaltyImportId,
183
+ headerMappingInfo: options?.headerMappingInfo,
184
+ });
185
+ const reqOpts = ambassadorWixLoyaltyImportsV1LoyaltyImport.executeLoyaltyImport(payload);
186
+ sideEffects?.onSiteCall?.();
187
+ try {
188
+ const result = await httpClient.request(reqOpts);
189
+ sideEffects?.onSuccess?.(result);
190
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
191
+ }
192
+ catch (err) {
193
+ const transformedError = sdkTransformError(err, {
194
+ spreadPathsToArguments: {},
195
+ explicitPathsToArguments: {
196
+ loyaltyImportId: '$[0]',
197
+ headerMappingInfo: '$[1].headerMappingInfo',
198
+ },
199
+ singleArgumentUnchanged: false,
200
+ }, ['loyaltyImportId', 'options']);
201
+ sideEffects?.onError?.(err);
202
+ throw transformedError;
203
+ }
204
+ }
205
+ /**
206
+ * Creates a URL for uploading a loyalty import file.
207
+ *
208
+ * 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.
209
+ * @public
210
+ * @permissionId LOYALTY.MANAGE_IMPORTS
211
+ * @permissionScope Manage Loyalty
212
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
213
+ * @permissionScope Manage Restaurants - all permissions
214
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
215
+ * @applicableIdentity APP
216
+ * @fqn wix.loyalty.imports.v1.LoyaltyImports.CreateLoyaltyImportFileUrl
217
+ */
218
+ export async function createLoyaltyImportFileUrl() {
219
+ // @ts-ignore
220
+ const { httpClient, sideEffects } = arguments[0];
221
+ const payload = renameKeysFromSDKRequestToRESTRequest({});
222
+ const reqOpts = ambassadorWixLoyaltyImportsV1LoyaltyImport.createLoyaltyImportFileUrl(payload);
223
+ sideEffects?.onSiteCall?.();
224
+ try {
225
+ const result = await httpClient.request(reqOpts);
226
+ sideEffects?.onSuccess?.(result);
227
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
228
+ }
229
+ catch (err) {
230
+ const transformedError = sdkTransformError(err, {
231
+ spreadPathsToArguments: {},
232
+ explicitPathsToArguments: {},
233
+ singleArgumentUnchanged: false,
234
+ }, []);
235
+ sideEffects?.onError?.(err);
236
+ throw transformedError;
237
+ }
238
+ }
239
+ /**
240
+ * Creates a query to retrieve a list of loyalty imports.
241
+ *
242
+ * The `queryLoyaltyImports()` function builds a query to retrieve a list of imports and returns a `LoyaltyImportsQueryBuilder` object.
243
+ *
244
+ * The returned object contains the query definition, which is typically used to run the query using the `find()` function.
245
+ *
246
+ * 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.
247
+ *
248
+ * `queryLoyaltyImports()` runs with these `LoyaltyImportsQueryBuilder` defaults, which you can override:
249
+ *
250
+ * - `limit(50)`
251
+ * - `descending("_createdDate")`
252
+ *
253
+ * 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.
254
+ * @public
255
+ * @permissionScope Manage Loyalty
256
+ * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY
257
+ * @permissionScope Manage Restaurants - all permissions
258
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
259
+ * @permissionId LOYALTY.MANAGE_IMPORTS
260
+ * @applicableIdentity APP
261
+ * @fqn wix.loyalty.imports.v1.LoyaltyImports.QueryLoyaltyImports
262
+ */
263
+ export function queryLoyaltyImports() {
264
+ // @ts-ignore
265
+ const { httpClient, sideEffects } = arguments[0];
266
+ return queryBuilder({
267
+ func: async (payload) => {
268
+ const reqOpts = ambassadorWixLoyaltyImportsV1LoyaltyImport.queryLoyaltyImports(payload);
269
+ sideEffects?.onSiteCall?.();
270
+ try {
271
+ const result = await httpClient.request(reqOpts);
272
+ sideEffects?.onSuccess?.(result);
273
+ return result;
274
+ }
275
+ catch (err) {
276
+ sideEffects?.onError?.(err);
277
+ throw err;
278
+ }
279
+ },
280
+ requestTransformer: (query) => {
281
+ const args = [query, {}];
282
+ return renameKeysFromSDKRequestToRESTRequest({
283
+ ...args?.[1],
284
+ query: args?.[0],
285
+ });
286
+ },
287
+ responseTransformer: ({ data, }) => {
288
+ const transformedData = renameKeysFromRESTResponseToSDKResponse(data);
289
+ return {
290
+ items: transformedData?.loyaltyImports,
291
+ pagingMetadata: transformedData?.pagingMetadata,
292
+ };
293
+ },
294
+ errorTransformer: (err) => {
295
+ const transformedError = sdkTransformError(err, {
296
+ spreadPathsToArguments: {},
297
+ explicitPathsToArguments: { query: '$[0]' },
298
+ singleArgumentUnchanged: false,
299
+ });
300
+ throw transformedError;
301
+ },
302
+ pagingMethod: 'CURSOR',
303
+ transformationPaths: {},
304
+ });
305
+ }
306
+ //# sourceMappingURL=loyalty-imports-v1-loyalty-import-imports.universal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loyalty-imports-v1-loyalty-import-imports.universal.js","sourceRoot":"","sources":["../../../../src/loyalty-imports-v1-loyalty-import-imports.universal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EACL,qCAAqC,EACrC,uCAAuC,GACxC,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,0CAA0C,MAAM,qDAAqD,CAAC;AAoDlH,MAAM,CAAN,IAAY,YAeX;AAfD,WAAY,YAAY;IACtB,0CAA0C;IAC1C,mCAAmB,CAAA;IACnB,sEAAsE;IACtE,uCAAuB,CAAA;IACvB,uDAAuD;IACvD,mCAAmB,CAAA;IACnB,+EAA+E;IAC/E,iCAAiB,CAAA;IACjB,yDAAyD;IACzD,uCAAuB,CAAA;IACvB,wIAAwI;IACxI,qCAAqB,CAAA;IACrB,qCAAqC;IACrC,iCAAiB,CAAA;AACnB,CAAC,EAfW,YAAY,KAAZ,YAAY,QAevB;AAiED,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,sDAAsD;IACtD,6BAAe,CAAA;IACf,wFAAwF;IACxF,+BAAiB,CAAA;AACnB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAsJD,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf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AE,EAAE;YACjC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,GAAG,EAAE;gBAC9C,sBAAsB,EAAE,EAAE;gBAC1B,wBAAwB,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;gBAC3C,uBAAuB,EAAE,KAAK;aAC/B,CAAC,CAAC;YAEH,MAAM,gBAAgB,CAAC;QACzB,CAAC;QACD,YAAY,EAAE,QAAQ;QACtB,mBAAmB,EAAE,EAAE;KACxB,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,25 +1,25 @@
1
1
  {
2
2
  "name": "@wix/auto_sdk_loyalty_imports",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
7
7
  },
8
8
  "keywords": [],
9
9
  "sideEffects": false,
10
- "main": "/build/index.js",
11
- "types": "./build/index.d.mts",
10
+ "main": "./build/cjs/index.js",
11
+ "types": "./build/es/index.d.ts",
12
12
  "exports": {
13
13
  ".": {
14
- "import": "./build/index.mjs",
15
- "require": "./build/index.js",
16
- "types": "./build/index.d.mts"
14
+ "import": "./build/es/index.js",
15
+ "require": "./build/cjs/index.js",
16
+ "types": "./build/es/index.d.ts"
17
17
  },
18
18
  "./package.json": "./package.json",
19
19
  "./meta": {
20
- "import": "./build/meta.mjs",
21
- "require": "./build/meta.js",
22
- "types": "./build/meta.d.mts"
20
+ "import": "./build/es/meta.js",
21
+ "require": "./build/cjs/meta.js",
22
+ "types": "./build/es/meta.d.ts"
23
23
  }
24
24
  },
25
25
  "files": [
@@ -32,11 +32,10 @@
32
32
  "@wix/sdk-types": "^1.13.16"
33
33
  },
34
34
  "devDependencies": {
35
- "tsup": "^8.4.0",
36
35
  "typescript": "^5.3.2"
37
36
  },
38
37
  "scripts": {
39
- "build": "tsup",
38
+ "build": "tsc -b tsconfig.json tsconfig.esm.json tsconfig.internal.json tsconfig.internal.esm.json",
40
39
  "test": ":"
41
40
  },
42
41
  "wix": {
@@ -49,5 +48,5 @@
49
48
  "fqdn": "wix.loyalty.imports.v1.loyalty_import"
50
49
  }
51
50
  },
52
- "falconPackageHash": "f86b5f8a6158e96cda295284c59a41db8764a173bfdb50b95de67bd8"
51
+ "falconPackageHash": "69734b9eed71f170794cde081ad94e4ce329c6e38ba68df286b13833"
53
52
  }
package/build/index.d.mts DELETED
@@ -1,88 +0,0 @@
1
- import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
- import { C as CreateLoyaltyImportOptions, a as CreateLoyaltyImportResponse, L as LoyaltyImport, G as GetErrorFileDownloadUrlResponse, E as ExecuteLoyaltyImportOptions, b as ExecuteLoyaltyImportResponse, c as CreateLoyaltyImportFileUrlResponse, d as LoyaltyImportsQueryBuilder } from './loyalty-imports-v1-loyalty-import-imports.universal-2D8oFVKm.mjs';
3
- export { J as ActionEvent, U as BaseEventMetadata, e as ColumnName, o as CreateLoyaltyImportFileUrlRequest, j as CreateLoyaltyImportRequest, s as CursorPaging, u as CursorPagingMetadata, p as CursorQuery, q as CursorQueryPagingMethodOneOf, v as Cursors, D as DeleteLoyaltyImportRequest, w as DeleteLoyaltyImportResponse, x as DomainEvent, y as DomainEventBodyOneOf, K as Empty, z as EntityCreatedEvent, B as EntityDeletedEvent, A as EntityUpdatedEvent, V as EventMetadata, n as ExecuteLoyaltyImportRequest, f as FileHeader, F as FileMetadata, m as GetErrorFileDownloadUrlRequest, k as GetLoyaltyImportRequest, l as GetLoyaltyImportResponse, g as HeaderMapping, H as HeaderMappingInfo, O as IdentificationData, T as IdentificationDataIdOneOf, M as ImportFinished, i as ImportResult, I as ImportStatus, X as LoyaltyImportCreatedEnvelope, Y as LoyaltyImportsQueryResult, N as MessageEnvelope, P as ParseResult, Q as QueryLoyaltyImportsRequest, t as QueryLoyaltyImportsResponse, R as RestoreInfo, h as SampleDataRow, S as SortOrder, r as Sorting, W as WebhookIdentityType } from './loyalty-imports-v1-loyalty-import-imports.universal-2D8oFVKm.mjs';
4
- import { createEventModule } from '@wix/sdk-runtime/event-definition-modules';
5
-
6
- declare function createLoyaltyImport$1(httpClient: HttpClient): CreateLoyaltyImportSignature;
7
- interface CreateLoyaltyImportSignature {
8
- /**
9
- * Creates an import object based on an uploaded file.
10
- *
11
- * Call this method after uploading your file to the URL obtained from `createLoyaltyImportFileUrl()`.
12
- * @param - URL of the file to import.
13
- */
14
- (fileUrl: string, options?: CreateLoyaltyImportOptions | undefined): Promise<CreateLoyaltyImportResponse>;
15
- }
16
- declare function getLoyaltyImport$1(httpClient: HttpClient): GetLoyaltyImportSignature;
17
- interface GetLoyaltyImportSignature {
18
- /**
19
- * Retrieves a loyalty import.
20
- * @param - Loyalty import ID.
21
- * @returns Retrieved loyalty import.
22
- */
23
- (loyaltyImportId: string): Promise<LoyaltyImport>;
24
- }
25
- declare function getErrorFileDownloadUrl$1(httpClient: HttpClient): GetErrorFileDownloadUrlSignature;
26
- interface GetErrorFileDownloadUrlSignature {
27
- /**
28
- * Retrieves the download URL for the error file of a failed loyalty import.
29
- *
30
- * If an import fails, the `importResult.errorFileExists` field in the `LoyaltyImport` object is set to `true`.
31
- *
32
- * Use this method to get the URL of the error file, which contains details about which items couldn't be imported and why.
33
- * @param - Loyalty import ID.
34
- */
35
- (loyaltyImportId: string): Promise<GetErrorFileDownloadUrlResponse>;
36
- }
37
- declare function executeLoyaltyImport$1(httpClient: HttpClient): ExecuteLoyaltyImportSignature;
38
- interface ExecuteLoyaltyImportSignature {
39
- /**
40
- * Starts the actual import process for a loyalty import.
41
- *
42
- * Call this method after the loyalty import object reaches the `PARSED` status.
43
- * @param - Loyalty import ID.
44
- */
45
- (loyaltyImportId: string, options?: ExecuteLoyaltyImportOptions | undefined): Promise<ExecuteLoyaltyImportResponse>;
46
- }
47
- declare function createLoyaltyImportFileUrl$1(httpClient: HttpClient): CreateLoyaltyImportFileUrlSignature;
48
- interface CreateLoyaltyImportFileUrlSignature {
49
- /**
50
- * Creates a URL for uploading a loyalty import file.
51
- *
52
- * 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.
53
- */
54
- (): Promise<CreateLoyaltyImportFileUrlResponse>;
55
- }
56
- declare function queryLoyaltyImports$1(httpClient: HttpClient): QueryLoyaltyImportsSignature;
57
- interface QueryLoyaltyImportsSignature {
58
- /**
59
- * Creates a query to retrieve a list of loyalty imports.
60
- *
61
- * The `queryLoyaltyImports()` function builds a query to retrieve a list of imports and returns a `LoyaltyImportsQueryBuilder` object.
62
- *
63
- * The returned object contains the query definition, which is typically used to run the query using the `find()` function.
64
- *
65
- * 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.
66
- *
67
- * `queryLoyaltyImports()` runs with these `LoyaltyImportsQueryBuilder` defaults, which you can override:
68
- *
69
- * - `limit(50)`
70
- * - `descending("_createdDate")`
71
- *
72
- * 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.
73
- */
74
- (): LoyaltyImportsQueryBuilder;
75
- }
76
-
77
- declare const createLoyaltyImport: MaybeContext<BuildRESTFunction<typeof createLoyaltyImport$1> & typeof createLoyaltyImport$1>;
78
- declare const getLoyaltyImport: MaybeContext<BuildRESTFunction<typeof getLoyaltyImport$1> & typeof getLoyaltyImport$1>;
79
- declare const getErrorFileDownloadUrl: MaybeContext<BuildRESTFunction<typeof getErrorFileDownloadUrl$1> & typeof getErrorFileDownloadUrl$1>;
80
- declare const executeLoyaltyImport: MaybeContext<BuildRESTFunction<typeof executeLoyaltyImport$1> & typeof executeLoyaltyImport$1>;
81
- declare const createLoyaltyImportFileUrl: MaybeContext<BuildRESTFunction<typeof createLoyaltyImportFileUrl$1> & typeof createLoyaltyImportFileUrl$1>;
82
- declare const queryLoyaltyImports: MaybeContext<BuildRESTFunction<typeof queryLoyaltyImports$1> & typeof queryLoyaltyImports$1>;
83
- /**
84
- * Triggered when a loyalty import is created.
85
- */
86
- declare const onLoyaltyImportCreated: ReturnType<typeof createEventModule<typeof publicOnLoyaltyImportCreated>>;
87
-
88
- export { CreateLoyaltyImportFileUrlResponse, CreateLoyaltyImportOptions, CreateLoyaltyImportResponse, ExecuteLoyaltyImportOptions, ExecuteLoyaltyImportResponse, GetErrorFileDownloadUrlResponse, LoyaltyImport, LoyaltyImportsQueryBuilder, createLoyaltyImport, createLoyaltyImportFileUrl, executeLoyaltyImport, getErrorFileDownloadUrl, getLoyaltyImport, onLoyaltyImportCreated, queryLoyaltyImports };
package/build/index.d.ts DELETED
@@ -1,88 +0,0 @@
1
- import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
- import { C as CreateLoyaltyImportOptions, a as CreateLoyaltyImportResponse, L as LoyaltyImport, G as GetErrorFileDownloadUrlResponse, E as ExecuteLoyaltyImportOptions, b as ExecuteLoyaltyImportResponse, c as CreateLoyaltyImportFileUrlResponse, d as LoyaltyImportsQueryBuilder } from './loyalty-imports-v1-loyalty-import-imports.universal-2D8oFVKm.js';
3
- export { J as ActionEvent, U as BaseEventMetadata, e as ColumnName, o as CreateLoyaltyImportFileUrlRequest, j as CreateLoyaltyImportRequest, s as CursorPaging, u as CursorPagingMetadata, p as CursorQuery, q as CursorQueryPagingMethodOneOf, v as Cursors, D as DeleteLoyaltyImportRequest, w as DeleteLoyaltyImportResponse, x as DomainEvent, y as DomainEventBodyOneOf, K as Empty, z as EntityCreatedEvent, B as EntityDeletedEvent, A as EntityUpdatedEvent, V as EventMetadata, n as ExecuteLoyaltyImportRequest, f as FileHeader, F as FileMetadata, m as GetErrorFileDownloadUrlRequest, k as GetLoyaltyImportRequest, l as GetLoyaltyImportResponse, g as HeaderMapping, H as HeaderMappingInfo, O as IdentificationData, T as IdentificationDataIdOneOf, M as ImportFinished, i as ImportResult, I as ImportStatus, X as LoyaltyImportCreatedEnvelope, Y as LoyaltyImportsQueryResult, N as MessageEnvelope, P as ParseResult, Q as QueryLoyaltyImportsRequest, t as QueryLoyaltyImportsResponse, R as RestoreInfo, h as SampleDataRow, S as SortOrder, r as Sorting, W as WebhookIdentityType } from './loyalty-imports-v1-loyalty-import-imports.universal-2D8oFVKm.js';
4
- import { createEventModule } from '@wix/sdk-runtime/event-definition-modules';
5
-
6
- declare function createLoyaltyImport$1(httpClient: HttpClient): CreateLoyaltyImportSignature;
7
- interface CreateLoyaltyImportSignature {
8
- /**
9
- * Creates an import object based on an uploaded file.
10
- *
11
- * Call this method after uploading your file to the URL obtained from `createLoyaltyImportFileUrl()`.
12
- * @param - URL of the file to import.
13
- */
14
- (fileUrl: string, options?: CreateLoyaltyImportOptions | undefined): Promise<CreateLoyaltyImportResponse>;
15
- }
16
- declare function getLoyaltyImport$1(httpClient: HttpClient): GetLoyaltyImportSignature;
17
- interface GetLoyaltyImportSignature {
18
- /**
19
- * Retrieves a loyalty import.
20
- * @param - Loyalty import ID.
21
- * @returns Retrieved loyalty import.
22
- */
23
- (loyaltyImportId: string): Promise<LoyaltyImport>;
24
- }
25
- declare function getErrorFileDownloadUrl$1(httpClient: HttpClient): GetErrorFileDownloadUrlSignature;
26
- interface GetErrorFileDownloadUrlSignature {
27
- /**
28
- * Retrieves the download URL for the error file of a failed loyalty import.
29
- *
30
- * If an import fails, the `importResult.errorFileExists` field in the `LoyaltyImport` object is set to `true`.
31
- *
32
- * Use this method to get the URL of the error file, which contains details about which items couldn't be imported and why.
33
- * @param - Loyalty import ID.
34
- */
35
- (loyaltyImportId: string): Promise<GetErrorFileDownloadUrlResponse>;
36
- }
37
- declare function executeLoyaltyImport$1(httpClient: HttpClient): ExecuteLoyaltyImportSignature;
38
- interface ExecuteLoyaltyImportSignature {
39
- /**
40
- * Starts the actual import process for a loyalty import.
41
- *
42
- * Call this method after the loyalty import object reaches the `PARSED` status.
43
- * @param - Loyalty import ID.
44
- */
45
- (loyaltyImportId: string, options?: ExecuteLoyaltyImportOptions | undefined): Promise<ExecuteLoyaltyImportResponse>;
46
- }
47
- declare function createLoyaltyImportFileUrl$1(httpClient: HttpClient): CreateLoyaltyImportFileUrlSignature;
48
- interface CreateLoyaltyImportFileUrlSignature {
49
- /**
50
- * Creates a URL for uploading a loyalty import file.
51
- *
52
- * 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.
53
- */
54
- (): Promise<CreateLoyaltyImportFileUrlResponse>;
55
- }
56
- declare function queryLoyaltyImports$1(httpClient: HttpClient): QueryLoyaltyImportsSignature;
57
- interface QueryLoyaltyImportsSignature {
58
- /**
59
- * Creates a query to retrieve a list of loyalty imports.
60
- *
61
- * The `queryLoyaltyImports()` function builds a query to retrieve a list of imports and returns a `LoyaltyImportsQueryBuilder` object.
62
- *
63
- * The returned object contains the query definition, which is typically used to run the query using the `find()` function.
64
- *
65
- * 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.
66
- *
67
- * `queryLoyaltyImports()` runs with these `LoyaltyImportsQueryBuilder` defaults, which you can override:
68
- *
69
- * - `limit(50)`
70
- * - `descending("_createdDate")`
71
- *
72
- * 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.
73
- */
74
- (): LoyaltyImportsQueryBuilder;
75
- }
76
-
77
- declare const createLoyaltyImport: MaybeContext<BuildRESTFunction<typeof createLoyaltyImport$1> & typeof createLoyaltyImport$1>;
78
- declare const getLoyaltyImport: MaybeContext<BuildRESTFunction<typeof getLoyaltyImport$1> & typeof getLoyaltyImport$1>;
79
- declare const getErrorFileDownloadUrl: MaybeContext<BuildRESTFunction<typeof getErrorFileDownloadUrl$1> & typeof getErrorFileDownloadUrl$1>;
80
- declare const executeLoyaltyImport: MaybeContext<BuildRESTFunction<typeof executeLoyaltyImport$1> & typeof executeLoyaltyImport$1>;
81
- declare const createLoyaltyImportFileUrl: MaybeContext<BuildRESTFunction<typeof createLoyaltyImportFileUrl$1> & typeof createLoyaltyImportFileUrl$1>;
82
- declare const queryLoyaltyImports: MaybeContext<BuildRESTFunction<typeof queryLoyaltyImports$1> & typeof queryLoyaltyImports$1>;
83
- /**
84
- * Triggered when a loyalty import is created.
85
- */
86
- declare const onLoyaltyImportCreated: ReturnType<typeof createEventModule<typeof publicOnLoyaltyImportCreated>>;
87
-
88
- export { CreateLoyaltyImportFileUrlResponse, CreateLoyaltyImportOptions, CreateLoyaltyImportResponse, ExecuteLoyaltyImportOptions, ExecuteLoyaltyImportResponse, GetErrorFileDownloadUrlResponse, LoyaltyImport, LoyaltyImportsQueryBuilder, createLoyaltyImport, createLoyaltyImportFileUrl, executeLoyaltyImport, getErrorFileDownloadUrl, getLoyaltyImport, onLoyaltyImportCreated, queryLoyaltyImports };