@wix/auto_sdk_loyalty_imports 1.0.25 → 1.0.26

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.
@@ -115,6 +115,9 @@ function createLoyaltyImport(payload) {
115
115
  method: "POST",
116
116
  methodFqn: "wix.loyalty.imports.v1.LoyaltyImports.CreateLoyaltyImport",
117
117
  packageName: PACKAGE_NAME,
118
+ migrationOptions: {
119
+ optInTransformResponse: true
120
+ },
118
121
  url: resolveWixLoyaltyImportsV1LoyaltyImportsUrl({
119
122
  protoPath: "/v1/loyalty-imports",
120
123
  data: payload,
@@ -142,6 +145,9 @@ function getLoyaltyImport(payload) {
142
145
  method: "GET",
143
146
  methodFqn: "wix.loyalty.imports.v1.LoyaltyImports.GetLoyaltyImport",
144
147
  packageName: PACKAGE_NAME,
148
+ migrationOptions: {
149
+ optInTransformResponse: true
150
+ },
145
151
  url: resolveWixLoyaltyImportsV1LoyaltyImportsUrl({
146
152
  protoPath: "/v1/loyalty-imports",
147
153
  data: payload,
@@ -169,6 +175,9 @@ function getErrorFileDownloadUrl(payload) {
169
175
  method: "GET",
170
176
  methodFqn: "wix.loyalty.imports.v1.LoyaltyImports.GetErrorFileDownloadUrl",
171
177
  packageName: PACKAGE_NAME,
178
+ migrationOptions: {
179
+ optInTransformResponse: true
180
+ },
172
181
  url: resolveWixLoyaltyImportsV1LoyaltyImportsUrl({
173
182
  protoPath: "/v1/loyalty-imports/error-file-download-url",
174
183
  data: payload,
@@ -187,6 +196,9 @@ function executeLoyaltyImport(payload) {
187
196
  method: "POST",
188
197
  methodFqn: "wix.loyalty.imports.v1.LoyaltyImports.ExecuteLoyaltyImport",
189
198
  packageName: PACKAGE_NAME,
199
+ migrationOptions: {
200
+ optInTransformResponse: true
201
+ },
190
202
  url: resolveWixLoyaltyImportsV1LoyaltyImportsUrl({
191
203
  protoPath: "/v1/loyalty-imports/execute",
192
204
  data: payload,
@@ -214,6 +226,9 @@ function createLoyaltyImportFileUrl(payload) {
214
226
  method: "POST",
215
227
  methodFqn: "wix.loyalty.imports.v1.LoyaltyImports.CreateLoyaltyImportFileUrl",
216
228
  packageName: PACKAGE_NAME,
229
+ migrationOptions: {
230
+ optInTransformResponse: true
231
+ },
217
232
  url: resolveWixLoyaltyImportsV1LoyaltyImportsUrl({
218
233
  protoPath: "/v1/loyalty-imports/wixmp-upload-url",
219
234
  data: payload,
@@ -232,6 +247,9 @@ function queryLoyaltyImports(payload) {
232
247
  method: "POST",
233
248
  methodFqn: "wix.loyalty.imports.v1.LoyaltyImports.QueryLoyaltyImports",
234
249
  packageName: PACKAGE_NAME,
250
+ migrationOptions: {
251
+ optInTransformResponse: true
252
+ },
235
253
  url: resolveWixLoyaltyImportsV1LoyaltyImportsUrl({
236
254
  protoPath: "/v1/loyalty-imports/query",
237
255
  data: payload,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../src/loyalty-imports-v1-loyalty-import-imports.public.ts","../../src/loyalty-imports-v1-loyalty-import-imports.universal.ts","../../src/loyalty-imports-v1-loyalty-import-imports.http.ts","../../src/loyalty-imports-v1-loyalty-import-imports.context.ts"],"sourcesContent":["export * from './src/loyalty-imports-v1-loyalty-import-imports.context.js';\n","import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n CreateLoyaltyImportFileUrlResponse,\n CreateLoyaltyImportOptions,\n CreateLoyaltyImportResponse,\n ExecuteLoyaltyImportOptions,\n ExecuteLoyaltyImportResponse,\n GetErrorFileDownloadUrlResponse,\n LoyaltyImport,\n LoyaltyImportCreatedEnvelope,\n LoyaltyImportsQueryBuilder,\n createLoyaltyImport as universalCreateLoyaltyImport,\n createLoyaltyImportFileUrl as universalCreateLoyaltyImportFileUrl,\n executeLoyaltyImport as universalExecuteLoyaltyImport,\n getErrorFileDownloadUrl as universalGetErrorFileDownloadUrl,\n getLoyaltyImport as universalGetLoyaltyImport,\n queryLoyaltyImports as universalQueryLoyaltyImports,\n} from './loyalty-imports-v1-loyalty-import-imports.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/loyalty' };\n\nexport function createLoyaltyImport(\n httpClient: HttpClient\n): CreateLoyaltyImportSignature {\n return (fileUrl: string, options?: CreateLoyaltyImportOptions) =>\n universalCreateLoyaltyImport(\n fileUrl,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateLoyaltyImportSignature {\n /**\n * Creates an import object based on an uploaded file.\n *\n * Call this method after uploading your file to the URL obtained from Create Loyalty Import File Url.\n * @param - URL of the file to import.\n */\n (fileUrl: string, options?: CreateLoyaltyImportOptions): Promise<\n NonNullablePaths<\n CreateLoyaltyImportResponse,\n | `loyaltyImport.status`\n | `loyaltyImport.fileMetadata.url`\n | `loyaltyImport.fileMetadata.header.values`\n | `loyaltyImport.fileMetadata.headerMappingInfo.headerMappings`\n | `loyaltyImport.fileMetadata.headerMappingInfo.headerMappings.${number}.columnName`\n | `loyaltyImport.fileMetadata.headerMappingInfo.headerMappings.${number}.columnIndex`\n | `loyaltyImport.fileMetadata.sampleDataRows`\n | `loyaltyImport.importResult.errorFileExists`,\n 7\n >\n >;\n}\n\nexport function getLoyaltyImport(\n httpClient: HttpClient\n): GetLoyaltyImportSignature {\n return (loyaltyImportId: string) =>\n universalGetLoyaltyImport(\n loyaltyImportId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetLoyaltyImportSignature {\n /**\n * Retrieves a loyalty import.\n * @param - Loyalty import ID.\n * @returns Retrieved loyalty import.\n */\n (loyaltyImportId: string): Promise<\n NonNullablePaths<\n LoyaltyImport,\n | `status`\n | `fileMetadata.url`\n | `fileMetadata.header.values`\n | `fileMetadata.headerMappingInfo.headerMappings`\n | `fileMetadata.headerMappingInfo.headerMappings.${number}.columnName`\n | `fileMetadata.headerMappingInfo.headerMappings.${number}.columnIndex`\n | `fileMetadata.sampleDataRows`\n | `importResult.errorFileExists`,\n 6\n >\n >;\n}\n\nexport function getErrorFileDownloadUrl(\n httpClient: HttpClient\n): GetErrorFileDownloadUrlSignature {\n return (loyaltyImportId: string) =>\n universalGetErrorFileDownloadUrl(\n loyaltyImportId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetErrorFileDownloadUrlSignature {\n /**\n * Retrieves the download URL for the error file of a failed loyalty import.\n *\n * If an import fails, the `importResult.errorFileExists` field in the `LoyaltyImport` object is set to `true`.\n *\n * Use this method to get the URL of the error file, which contains details about which items couldn't be imported and why.\n * @param - Loyalty import ID.\n */\n (loyaltyImportId: string): Promise<GetErrorFileDownloadUrlResponse>;\n}\n\nexport function executeLoyaltyImport(\n httpClient: HttpClient\n): ExecuteLoyaltyImportSignature {\n return (loyaltyImportId: string, options?: ExecuteLoyaltyImportOptions) =>\n universalExecuteLoyaltyImport(\n loyaltyImportId,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ExecuteLoyaltyImportSignature {\n /**\n * Starts the actual import process for a loyalty import.\n *\n * Call this method after the loyalty import object reaches the `\"PARSED\"` status.\n * @param - Loyalty import ID.\n */\n (loyaltyImportId: string, options?: ExecuteLoyaltyImportOptions): Promise<\n NonNullablePaths<\n ExecuteLoyaltyImportResponse,\n | `loyaltyImport.status`\n | `loyaltyImport.fileMetadata.url`\n | `loyaltyImport.fileMetadata.header.values`\n | `loyaltyImport.fileMetadata.headerMappingInfo.headerMappings`\n | `loyaltyImport.fileMetadata.headerMappingInfo.headerMappings.${number}.columnName`\n | `loyaltyImport.fileMetadata.headerMappingInfo.headerMappings.${number}.columnIndex`\n | `loyaltyImport.fileMetadata.sampleDataRows`\n | `loyaltyImport.importResult.errorFileExists`,\n 7\n >\n >;\n}\n\nexport function createLoyaltyImportFileUrl(\n httpClient: HttpClient\n): CreateLoyaltyImportFileUrlSignature {\n return () =>\n universalCreateLoyaltyImportFileUrl(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateLoyaltyImportFileUrlSignature {\n /**\n * Creates a URL for uploading a loyalty import file.\n *\n * 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.\n */\n (): Promise<CreateLoyaltyImportFileUrlResponse>;\n}\n\nexport function queryLoyaltyImports(\n httpClient: HttpClient\n): QueryLoyaltyImportsSignature {\n return () =>\n universalQueryLoyaltyImports(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface QueryLoyaltyImportsSignature {\n /**\n * Creates a query to retrieve a list of loyalty imports.\n *\n * The `queryLoyaltyImports()` method builds a query to retrieve a list of imports and returns a `LoyaltyImportsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is typically used to run the query using the `find()` method.\n *\n * You can refine the query by chaining `LoyaltyImportsQueryBuilder` methods onto the query. `LoyaltyImportsQueryBuilder` methods enable you to sort, filter, and control the results `queryLoyaltyImports()` returns.\n *\n * `queryLoyaltyImports()` runs with these `LoyaltyImportsQueryBuilder` defaults, which you can override:\n *\n * - `limit(50)`\n * - `descending(\"_createdDate\")`\n *\n * The methods 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.\n */\n (): LoyaltyImportsQueryBuilder;\n}\n\nexport const onLoyaltyImportCreated = EventDefinition(\n 'wix.loyalty.imports.v1.loyalty_import_created',\n true,\n (event: LoyaltyImportCreatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'entity.createdDate' },\n { path: 'entity.updatedDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<LoyaltyImportCreatedEnvelope>();\n\nexport {\n ActionEvent,\n BaseEventMetadata,\n ColumnName,\n CreateLoyaltyImportFileUrlRequest,\n CreateLoyaltyImportFileUrlResponse,\n CreateLoyaltyImportOptions,\n CreateLoyaltyImportRequest,\n CreateLoyaltyImportResponse,\n CursorPaging,\n CursorPagingMetadata,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Cursors,\n DeleteLoyaltyImportRequest,\n DeleteLoyaltyImportResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n ExecuteLoyaltyImportOptions,\n ExecuteLoyaltyImportRequest,\n ExecuteLoyaltyImportResponse,\n FileHeader,\n FileMetadata,\n GetErrorFileDownloadUrlRequest,\n GetErrorFileDownloadUrlResponse,\n GetLoyaltyImportRequest,\n GetLoyaltyImportResponse,\n HeaderMapping,\n HeaderMappingInfo,\n IdentificationData,\n IdentificationDataIdOneOf,\n ImportFinished,\n ImportResult,\n ImportStatus,\n LoyaltyImport,\n LoyaltyImportCreatedEnvelope,\n LoyaltyImportsQueryBuilder,\n LoyaltyImportsQueryResult,\n MessageEnvelope,\n ParseResult,\n QueryLoyaltyImportsRequest,\n QueryLoyaltyImportsResponse,\n RestoreInfo,\n SampleDataRow,\n SortOrder,\n Sorting,\n WebhookIdentityType,\n} from './loyalty-imports-v1-loyalty-import-imports.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { queryBuilder } from '@wix/sdk-runtime/query-builder';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, HttpResponse, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixLoyaltyImportsV1LoyaltyImport from './loyalty-imports-v1-loyalty-import-imports.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\n/**\n * An Import object is a batch import of loyalty points for existing customers.\n * You can use Loyalty Imports to import loyalty points from 3rd-party providers or update existing customer point balances.\n * This object tracks the entire import process from file upload to data processing.\n */\nexport interface LoyaltyImport {\n /**\n * The ID of the import.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * ID of the asynchronous import job associated with this import.\n * @format GUID\n * @readonly\n */\n asyncImportJobId?: string | null;\n /**\n * Revision number, which increments by 1 each time the loyalty import is updated.\n * To prevent conflicting changes, the current `revision` must be passed when updating the loyalty import.\n *\n * Ignored when creating a loyalty import.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the loyalty import was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the loyalty import was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * Current status of the import process.\n * @readonly\n */\n status?: ImportStatusWithLiterals;\n /** Metadata of the uploaded file containing loyalty points data. */\n fileMetadata?: FileMetadata;\n /** Results of parsing the uploaded file, including the number of rows parsed and any parse errors. */\n parseResult?: ParseResult;\n /** Results of the import process, including success and failure counts. */\n importResult?: ImportResult;\n}\n\nexport enum ImportStatus {\n /** Status is unknown or not specified. */\n UNKNOWN = 'UNKNOWN',\n /** The import has initiated but processing hasn't started yet. */\n INITIATED = 'INITIATED',\n /** The system is currently parsing the import file. */\n PARSING = 'PARSING',\n /** The import file has been successfully parsed and is ready to import. */\n PARSED = 'PARSED',\n /** The system is currently importing the parsed data. */\n IMPORTING = 'IMPORTING',\n /** The import process is complete. This status indicates the process finished, but doesn't guarantee all data imported successfully. */\n IMPORTED = 'IMPORTED',\n /** The import process has failed. */\n FAILED = 'FAILED',\n}\n\n/** @enumType */\nexport type ImportStatusWithLiterals =\n | ImportStatus\n | 'UNKNOWN'\n | 'INITIATED'\n | 'PARSING'\n | 'PARSED'\n | 'IMPORTING'\n | 'IMPORTED'\n | 'FAILED';\n\nexport interface FileMetadata {\n /**\n * Size of the uploaded file in bytes. Max: `10 MB`.\n * @max 104857600\n * @readonly\n */\n size?: number | null;\n /**\n * Name of the uploaded file.\n * @format GUID\n * @readonly\n */\n name?: string | null;\n /**\n * URL of the uploaded file.\n * @minLength 3\n * @maxLength 10000\n */\n url?: string;\n /** Column headings from the first row of the uploaded CSV file. */\n header?: FileHeader;\n /**\n * Mapping between loyalty data fields and the corresponding columns in the uploaded file.\n *\n * Must include mappings for both `EMAIL` and `POINTS` to be valid.\n */\n headerMappingInfo?: HeaderMappingInfo;\n /**\n * Up to 5 sample rows from the import file, providing a preview of the data to be imported.\n * @maxSize 5\n */\n sampleDataRows?: SampleDataRow[];\n}\n\nexport interface FileHeader {\n /**\n * Column headings from the first row of the uploaded file.\n * @maxSize 100\n * @maxLength 1000\n */\n values?: string[];\n}\n\nexport interface HeaderMappingInfo {\n /**\n * Mappings between required loyalty data fields and file columns.\n * Must contain exactly 2 mappings: one for `\"EMAIL\"` and one for `\"POINTS\"`.\n * @minSize 2\n * @maxSize 2\n */\n headerMappings?: HeaderMapping[];\n}\n\nexport interface HeaderMapping {\n /** The required loyalty data field that this mapping corresponds to. Must be either `\"EMAIL\"` or `\"POINTS\"`. */\n columnName?: ColumnNameWithLiterals;\n /**\n * The zero-based index of the column in the uploaded file that contains the data for this loyalty field.\n * For example, if the email addresses are in the second column of the CSV file, this value would be `1`.\n */\n columnIndex?: number;\n}\n\nexport enum ColumnName {\n /** Column containing the customer's email address. */\n EMAIL = 'EMAIL',\n /** Column containing the customer's loyalty point balance to be imported or updated. */\n POINTS = 'POINTS',\n}\n\n/** @enumType */\nexport type ColumnNameWithLiterals = ColumnName | 'EMAIL' | 'POINTS';\n\nexport interface SampleDataRow {\n /**\n * Values in one sample data row. Each value corresponds to a column in the CSV file.\n * The number of values matches the number of columns in the file.\n * @maxSize 20\n * @maxLength 1000\n */\n values?: string[];\n}\n\nexport interface ParseResult {\n /**\n * Number of rows parsed from the uploaded import file.\n * @readonly\n */\n parsedRowCount?: number | null;\n /**\n * Reason code explaining why parsing failed, if applicable.\n * @readonly\n * @maxLength 1000\n */\n parseErrorReason?: string | null;\n}\n\nexport interface ImportResult {\n /** Whether an error file detailing import failures is available for download. The file includes row-by-row import status, error reasons, and original data. */\n errorFileExists?: boolean;\n /**\n * Number of rows successfully imported.\n * @readonly\n */\n successCount?: number | null;\n /**\n * Number of rows that failed to import due to errors.\n * @readonly\n */\n failureCount?: number | null;\n}\n\nexport interface CreateLoyaltyImportRequest {\n /** URL of the file to import. */\n fileUrl: string | null;\n /** Name of the file to import. */\n fileName?: string | null;\n /** Size of the file to import, in bytes. */\n fileSize?: number | null;\n}\n\nexport interface CreateLoyaltyImportResponse {\n /** Created loyalty import. */\n loyaltyImport?: LoyaltyImport;\n}\n\nexport interface GetLoyaltyImportRequest {\n /** Loyalty import ID. */\n loyaltyImportId: string;\n}\n\nexport interface GetLoyaltyImportResponse {\n /** Retrieved loyalty import. */\n loyaltyImport?: LoyaltyImport;\n}\n\nexport interface GetErrorFileDownloadUrlRequest {\n /** Loyalty import ID. */\n loyaltyImportId: string;\n}\n\nexport interface GetErrorFileDownloadUrlResponse {\n /** URL for downloading the error file. */\n url?: string | null;\n}\n\nexport interface ExecuteLoyaltyImportRequest {\n /** Loyalty import ID. */\n loyaltyImportId: string;\n /** Header mapping information for the import file. */\n headerMappingInfo?: HeaderMappingInfo;\n}\n\nexport interface ExecuteLoyaltyImportResponse {\n /** Executed loyalty import. */\n loyaltyImport?: LoyaltyImport;\n}\n\nexport interface CreateLoyaltyImportFileUrlRequest {}\n\nexport interface CreateLoyaltyImportFileUrlResponse {\n /** Path where the file will be stored. */\n filePath?: string | null;\n /** URL for uploading the loyalty import file. */\n uploadUrl?: string | null;\n}\n\nexport interface QueryLoyaltyImportsRequest {\n /**\n * Filter object.\n * See [API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language)\n * for more information.\n *\n * For a detailed list of supported filters, see\n * [Loyalty Imports: Supported Filters and Sorting](https://dev.wix.com/docs/rest/crm/loyalty-program/imports/filter-and-sort).\n */\n query: CursorQuery;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n /**\n * Cursor paging options.\n *\n * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n */\n cursorPaging?: CursorPaging;\n /**\n * Filter object.\n *\n * Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).\n */\n filter?: Record<string, any> | null;\n /**\n * Sort object.\n *\n * Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting).\n * @maxSize 5\n */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n /**\n * Cursor paging options.\n *\n * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /**\n * Name of the field to sort by.\n * @maxLength 512\n */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface QueryLoyaltyImportsResponse {\n /** List of loyalty imports matching the query. */\n loyaltyImports?: LoyaltyImport[];\n /** Paging metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in current page. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface DeleteLoyaltyImportRequest {\n /**\n * Loyalty import ID.\n * @format GUID\n */\n loyaltyImportId?: string;\n /**\n * Revision number, which increments by 1 each time the loyalty import is updated.\n * To prevent conflicting changes, the current `revision` must be passed when updating the loyalty import.\n */\n revision?: string;\n}\n\nexport interface DeleteLoyaltyImportResponse {}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface Empty {}\n\nexport interface ImportFinished {\n /** Completed loyalty import. */\n loyaltyImport?: LoyaltyImport;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\nexport interface LoyaltyImportCreatedEnvelope {\n entity: LoyaltyImport;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a loyalty import is created.\n * @webhook\n * @eventType wix.loyalty.imports.v1.loyalty_import_created\n * @serviceIdentifier wix.loyalty.imports.v1.LoyaltyImports\n * @slug created\n */\nexport declare function onLoyaltyImportCreated(\n handler: (event: LoyaltyImportCreatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates an import object based on an uploaded file.\n *\n * Call this method after uploading your file to the URL obtained from Create Loyalty Import File Url.\n * @param fileUrl - URL of the file to import.\n * @public\n * @requiredField fileUrl\n * @permissionId LOYALTY.MANAGE_IMPORTS\n * @applicableIdentity APP\n * @fqn wix.loyalty.imports.v1.LoyaltyImports.CreateLoyaltyImport\n */\nexport async function createLoyaltyImport(\n fileUrl: string,\n options?: CreateLoyaltyImportOptions\n): Promise<\n NonNullablePaths<\n CreateLoyaltyImportResponse,\n | `loyaltyImport.status`\n | `loyaltyImport.fileMetadata.url`\n | `loyaltyImport.fileMetadata.header.values`\n | `loyaltyImport.fileMetadata.headerMappingInfo.headerMappings`\n | `loyaltyImport.fileMetadata.headerMappingInfo.headerMappings.${number}.columnName`\n | `loyaltyImport.fileMetadata.headerMappingInfo.headerMappings.${number}.columnIndex`\n | `loyaltyImport.fileMetadata.sampleDataRows`\n | `loyaltyImport.importResult.errorFileExists`,\n 7\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n fileUrl: fileUrl,\n fileName: options?.fileName,\n fileSize: options?.fileSize,\n });\n\n const reqOpts =\n ambassadorWixLoyaltyImportsV1LoyaltyImport.createLoyaltyImport(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n fileUrl: '$[0]',\n fileName: '$[1].fileName',\n fileSize: '$[1].fileSize',\n },\n singleArgumentUnchanged: false,\n },\n ['fileUrl', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface CreateLoyaltyImportOptions {\n /** Name of the file to import. */\n fileName?: string | null;\n /** Size of the file to import, in bytes. */\n fileSize?: number | null;\n}\n\n/**\n * Retrieves a loyalty import.\n * @param loyaltyImportId - Loyalty import ID.\n * @public\n * @requiredField loyaltyImportId\n * @permissionId LOYALTY.MANAGE_IMPORTS\n * @applicableIdentity APP\n * @returns Retrieved loyalty import.\n * @fqn wix.loyalty.imports.v1.LoyaltyImports.GetLoyaltyImport\n */\nexport async function getLoyaltyImport(\n loyaltyImportId: string\n): Promise<\n NonNullablePaths<\n LoyaltyImport,\n | `status`\n | `fileMetadata.url`\n | `fileMetadata.header.values`\n | `fileMetadata.headerMappingInfo.headerMappings`\n | `fileMetadata.headerMappingInfo.headerMappings.${number}.columnName`\n | `fileMetadata.headerMappingInfo.headerMappings.${number}.columnIndex`\n | `fileMetadata.sampleDataRows`\n | `importResult.errorFileExists`,\n 6\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n loyaltyImportId: loyaltyImportId,\n });\n\n const reqOpts =\n ambassadorWixLoyaltyImportsV1LoyaltyImport.getLoyaltyImport(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.loyaltyImport!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { loyaltyImportId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['loyaltyImportId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves the download URL for the error file of a failed loyalty import.\n *\n * If an import fails, the `importResult.errorFileExists` field in the `LoyaltyImport` object is set to `true`.\n *\n * Use this method to get the URL of the error file, which contains details about which items couldn't be imported and why.\n * @param loyaltyImportId - Loyalty import ID.\n * @public\n * @requiredField loyaltyImportId\n * @permissionId LOYALTY.MANAGE_IMPORTS\n * @applicableIdentity APP\n * @fqn wix.loyalty.imports.v1.LoyaltyImports.GetErrorFileDownloadUrl\n */\nexport async function getErrorFileDownloadUrl(\n loyaltyImportId: string\n): Promise<GetErrorFileDownloadUrlResponse> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n loyaltyImportId: loyaltyImportId,\n });\n\n const reqOpts =\n ambassadorWixLoyaltyImportsV1LoyaltyImport.getErrorFileDownloadUrl(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { loyaltyImportId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['loyaltyImportId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Starts the actual import process for a loyalty import.\n *\n * Call this method after the loyalty import object reaches the `\"PARSED\"` status.\n * @param loyaltyImportId - Loyalty import ID.\n * @public\n * @requiredField loyaltyImportId\n * @permissionId LOYALTY.MANAGE_IMPORTS\n * @applicableIdentity APP\n * @fqn wix.loyalty.imports.v1.LoyaltyImports.ExecuteLoyaltyImport\n */\nexport async function executeLoyaltyImport(\n loyaltyImportId: string,\n options?: ExecuteLoyaltyImportOptions\n): Promise<\n NonNullablePaths<\n ExecuteLoyaltyImportResponse,\n | `loyaltyImport.status`\n | `loyaltyImport.fileMetadata.url`\n | `loyaltyImport.fileMetadata.header.values`\n | `loyaltyImport.fileMetadata.headerMappingInfo.headerMappings`\n | `loyaltyImport.fileMetadata.headerMappingInfo.headerMappings.${number}.columnName`\n | `loyaltyImport.fileMetadata.headerMappingInfo.headerMappings.${number}.columnIndex`\n | `loyaltyImport.fileMetadata.sampleDataRows`\n | `loyaltyImport.importResult.errorFileExists`,\n 7\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n loyaltyImportId: loyaltyImportId,\n headerMappingInfo: options?.headerMappingInfo,\n });\n\n const reqOpts =\n ambassadorWixLoyaltyImportsV1LoyaltyImport.executeLoyaltyImport(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n loyaltyImportId: '$[0]',\n headerMappingInfo: '$[1].headerMappingInfo',\n },\n singleArgumentUnchanged: false,\n },\n ['loyaltyImportId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ExecuteLoyaltyImportOptions {\n /** Header mapping information for the import file. */\n headerMappingInfo?: HeaderMappingInfo;\n}\n\n/**\n * Creates a URL for uploading a loyalty import file.\n *\n * 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.\n * @public\n * @permissionId LOYALTY.MANAGE_IMPORTS\n * @applicableIdentity APP\n * @fqn wix.loyalty.imports.v1.LoyaltyImports.CreateLoyaltyImportFileUrl\n */\nexport async function createLoyaltyImportFileUrl(): Promise<CreateLoyaltyImportFileUrlResponse> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixLoyaltyImportsV1LoyaltyImport.createLoyaltyImportFileUrl(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates a query to retrieve a list of loyalty imports.\n *\n * The `queryLoyaltyImports()` method builds a query to retrieve a list of imports and returns a `LoyaltyImportsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is typically used to run the query using the `find()` method.\n *\n * You can refine the query by chaining `LoyaltyImportsQueryBuilder` methods onto the query. `LoyaltyImportsQueryBuilder` methods enable you to sort, filter, and control the results `queryLoyaltyImports()` returns.\n *\n * `queryLoyaltyImports()` runs with these `LoyaltyImportsQueryBuilder` defaults, which you can override:\n *\n * - `limit(50)`\n * - `descending(\"_createdDate\")`\n *\n * The methods 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.\n * @public\n * @permissionId LOYALTY.MANAGE_IMPORTS\n * @applicableIdentity APP\n * @fqn wix.loyalty.imports.v1.LoyaltyImports.QueryLoyaltyImports\n */\nexport function queryLoyaltyImports(): LoyaltyImportsQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<\n LoyaltyImport,\n 'CURSOR',\n QueryLoyaltyImportsRequest,\n QueryLoyaltyImportsResponse\n >({\n func: async (payload: QueryLoyaltyImportsRequest) => {\n const reqOpts =\n ambassadorWixLoyaltyImportsV1LoyaltyImport.queryLoyaltyImports(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n return result;\n } catch (err) {\n sideEffects?.onError?.(err);\n throw err;\n }\n },\n requestTransformer: (query: QueryLoyaltyImportsRequest['query']) => {\n const args = [query, {}] as [QueryLoyaltyImportsRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({\n data,\n }: HttpResponse<QueryLoyaltyImportsResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.loyaltyImports,\n pagingMetadata: transformedData?.pagingMetadata,\n };\n },\n errorTransformer: (err: unknown) => {\n const transformedError = sdkTransformError(err, {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n });\n\n throw transformedError;\n },\n pagingMethod: 'CURSOR',\n transformationPaths: {},\n });\n}\n\ninterface QueryCursorResult {\n cursors: Cursors;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface LoyaltyImportsQueryResult extends QueryCursorResult {\n items: LoyaltyImport[];\n query: LoyaltyImportsQueryBuilder;\n next: () => Promise<LoyaltyImportsQueryResult>;\n prev: () => Promise<LoyaltyImportsQueryResult>;\n}\n\nexport interface LoyaltyImportsQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n eq: (\n propertyName: '_createdDate' | '_updatedDate' | 'status',\n value: any\n ) => LoyaltyImportsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ne: (\n propertyName: '_createdDate' | '_updatedDate' | 'status',\n value: any\n ) => LoyaltyImportsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ge: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any\n ) => LoyaltyImportsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n gt: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any\n ) => LoyaltyImportsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n le: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any\n ) => LoyaltyImportsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n lt: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any\n ) => LoyaltyImportsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `values`.\n * @param values - List of values to compare against.\n */\n hasSome: (\n propertyName: '_createdDate' | '_updatedDate' | 'status',\n value: any[]\n ) => LoyaltyImportsQueryBuilder;\n in: (\n propertyName: '_createdDate' | '_updatedDate' | 'status',\n value: any\n ) => LoyaltyImportsQueryBuilder;\n exists: (\n propertyName: '_createdDate' | '_updatedDate' | 'status',\n value: boolean\n ) => LoyaltyImportsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n ascending: (\n ...propertyNames: Array<'_createdDate' | '_updatedDate' | 'status'>\n ) => LoyaltyImportsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n descending: (\n ...propertyNames: Array<'_createdDate' | '_updatedDate' | 'status'>\n ) => LoyaltyImportsQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */\n limit: (limit: number) => LoyaltyImportsQueryBuilder;\n /** @param cursor - A pointer to specific record */\n skipTo: (cursor: string) => LoyaltyImportsQueryBuilder;\n find: () => Promise<LoyaltyImportsQueryResult>;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixLoyaltyImportsV1LoyaltyImportsUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/loyalty-imports',\n destPath: '',\n },\n {\n srcPath: '/_api/loyalty-imports',\n destPath: '/api',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/loyalty-imports',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/loyalty-imports',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/loyalty-imports',\n destPath: '',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/loyalty-imports',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/_api/loyalty-imports',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/loyalty-imports',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/loyalty-imports',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_loyalty_imports';\n\n/**\n * Creates an import object based on an uploaded file.\n *\n * Call this method after uploading your file to the URL obtained from Create Loyalty Import File Url.\n */\nexport function createLoyaltyImport(\n payload: object\n): RequestOptionsFactory<any> {\n function __createLoyaltyImport({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.imports.v1.loyalty_import',\n method: 'POST' as any,\n methodFqn: 'wix.loyalty.imports.v1.LoyaltyImports.CreateLoyaltyImport',\n packageName: PACKAGE_NAME,\n url: resolveWixLoyaltyImportsV1LoyaltyImportsUrl({\n protoPath: '/v1/loyalty-imports',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'loyaltyImport.createdDate' },\n { path: 'loyaltyImport.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createLoyaltyImport;\n}\n\n/** Retrieves a loyalty import. */\nexport function getLoyaltyImport(payload: object): RequestOptionsFactory<any> {\n function __getLoyaltyImport({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.imports.v1.loyalty_import',\n method: 'GET' as any,\n methodFqn: 'wix.loyalty.imports.v1.LoyaltyImports.GetLoyaltyImport',\n packageName: PACKAGE_NAME,\n url: resolveWixLoyaltyImportsV1LoyaltyImportsUrl({\n protoPath: '/v1/loyalty-imports',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'loyaltyImport.createdDate' },\n { path: 'loyaltyImport.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getLoyaltyImport;\n}\n\n/**\n * Retrieves the download URL for the error file of a failed loyalty import.\n *\n * If an import fails, the `importResult.errorFileExists` field in the `LoyaltyImport` object is set to `true`.\n *\n * Use this method to get the URL of the error file, which contains details about which items couldn't be imported and why.\n */\nexport function getErrorFileDownloadUrl(\n payload: object\n): RequestOptionsFactory<any> {\n function __getErrorFileDownloadUrl({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.imports.v1.loyalty_import',\n method: 'GET' as any,\n methodFqn:\n 'wix.loyalty.imports.v1.LoyaltyImports.GetErrorFileDownloadUrl',\n packageName: PACKAGE_NAME,\n url: resolveWixLoyaltyImportsV1LoyaltyImportsUrl({\n protoPath: '/v1/loyalty-imports/error-file-download-url',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getErrorFileDownloadUrl;\n}\n\n/**\n * Starts the actual import process for a loyalty import.\n *\n * Call this method after the loyalty import object reaches the `\"PARSED\"` status.\n */\nexport function executeLoyaltyImport(\n payload: object\n): RequestOptionsFactory<any> {\n function __executeLoyaltyImport({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.imports.v1.loyalty_import',\n method: 'POST' as any,\n methodFqn: 'wix.loyalty.imports.v1.LoyaltyImports.ExecuteLoyaltyImport',\n packageName: PACKAGE_NAME,\n url: resolveWixLoyaltyImportsV1LoyaltyImportsUrl({\n protoPath: '/v1/loyalty-imports/execute',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'loyaltyImport.createdDate' },\n { path: 'loyaltyImport.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __executeLoyaltyImport;\n}\n\n/**\n * Creates a URL for uploading a loyalty import file.\n *\n * 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.\n */\nexport function createLoyaltyImportFileUrl(\n payload: object\n): RequestOptionsFactory<any> {\n function __createLoyaltyImportFileUrl({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.imports.v1.loyalty_import',\n method: 'POST' as any,\n methodFqn:\n 'wix.loyalty.imports.v1.LoyaltyImports.CreateLoyaltyImportFileUrl',\n packageName: PACKAGE_NAME,\n url: resolveWixLoyaltyImportsV1LoyaltyImportsUrl({\n protoPath: '/v1/loyalty-imports/wixmp-upload-url',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __createLoyaltyImportFileUrl;\n}\n\n/**\n * Creates a query to retrieve a list of loyalty imports.\n *\n * The `queryLoyaltyImports()` method builds a query to retrieve a list of imports and returns a `LoyaltyImportsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is typically used to run the query using the `find()` method.\n *\n * You can refine the query by chaining `LoyaltyImportsQueryBuilder` methods onto the query. `LoyaltyImportsQueryBuilder` methods enable you to sort, filter, and control the results `queryLoyaltyImports()` returns.\n *\n * `queryLoyaltyImports()` runs with these `LoyaltyImportsQueryBuilder` defaults, which you can override:\n *\n * - `limit(50)`\n * - `descending(\"_createdDate\")`\n *\n * The methods 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.\n */\nexport function queryLoyaltyImports(\n payload: object\n): RequestOptionsFactory<any> {\n function __queryLoyaltyImports({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.imports.v1.loyalty_import',\n method: 'POST' as any,\n methodFqn: 'wix.loyalty.imports.v1.LoyaltyImports.QueryLoyaltyImports',\n packageName: PACKAGE_NAME,\n url: resolveWixLoyaltyImportsV1LoyaltyImportsUrl({\n protoPath: '/v1/loyalty-imports/query',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'loyaltyImports.createdDate' },\n { path: 'loyaltyImports.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryLoyaltyImports;\n}\n","import {\n createLoyaltyImport as publicCreateLoyaltyImport,\n getLoyaltyImport as publicGetLoyaltyImport,\n getErrorFileDownloadUrl as publicGetErrorFileDownloadUrl,\n executeLoyaltyImport as publicExecuteLoyaltyImport,\n createLoyaltyImportFileUrl as publicCreateLoyaltyImportFileUrl,\n queryLoyaltyImports as publicQueryLoyaltyImports,\n} from './loyalty-imports-v1-loyalty-import-imports.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n BuildRESTFunction,\n MaybeContext,\n BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { onLoyaltyImportCreated as publicOnLoyaltyImportCreated } from './loyalty-imports-v1-loyalty-import-imports.public.js';\n\nexport const createLoyaltyImport: MaybeContext<\n BuildRESTFunction<typeof publicCreateLoyaltyImport> &\n typeof publicCreateLoyaltyImport\n> = /*#__PURE__*/ createRESTModule(publicCreateLoyaltyImport);\nexport const getLoyaltyImport: MaybeContext<\n BuildRESTFunction<typeof publicGetLoyaltyImport> &\n typeof publicGetLoyaltyImport\n> = /*#__PURE__*/ createRESTModule(publicGetLoyaltyImport);\nexport const getErrorFileDownloadUrl: MaybeContext<\n BuildRESTFunction<typeof publicGetErrorFileDownloadUrl> &\n typeof publicGetErrorFileDownloadUrl\n> = /*#__PURE__*/ createRESTModule(publicGetErrorFileDownloadUrl);\nexport const executeLoyaltyImport: MaybeContext<\n BuildRESTFunction<typeof publicExecuteLoyaltyImport> &\n typeof publicExecuteLoyaltyImport\n> = /*#__PURE__*/ createRESTModule(publicExecuteLoyaltyImport);\nexport const createLoyaltyImportFileUrl: MaybeContext<\n BuildRESTFunction<typeof publicCreateLoyaltyImportFileUrl> &\n typeof publicCreateLoyaltyImportFileUrl\n> = /*#__PURE__*/ createRESTModule(publicCreateLoyaltyImportFileUrl);\nexport const queryLoyaltyImports: MaybeContext<\n BuildRESTFunction<typeof publicQueryLoyaltyImports> &\n typeof publicQueryLoyaltyImports\n> = /*#__PURE__*/ createRESTModule(publicQueryLoyaltyImports);\n/**\n * Triggered when a loyalty import is created.\n */\nexport const onLoyaltyImportCreated: BuildEventDefinition<\n typeof publicOnLoyaltyImportCreated\n> &\n typeof publicOnLoyaltyImportCreated = createEventModule(\n publicOnLoyaltyImportCreated\n);\n\nexport {\n ImportStatus,\n ColumnName,\n SortOrder,\n WebhookIdentityType,\n} from './loyalty-imports-v1-loyalty-import-imports.universal.js';\nexport {\n LoyaltyImport,\n FileMetadata,\n FileHeader,\n HeaderMappingInfo,\n HeaderMapping,\n SampleDataRow,\n ParseResult,\n ImportResult,\n CreateLoyaltyImportRequest,\n CreateLoyaltyImportResponse,\n GetLoyaltyImportRequest,\n GetLoyaltyImportResponse,\n GetErrorFileDownloadUrlRequest,\n GetErrorFileDownloadUrlResponse,\n ExecuteLoyaltyImportRequest,\n ExecuteLoyaltyImportResponse,\n CreateLoyaltyImportFileUrlRequest,\n CreateLoyaltyImportFileUrlResponse,\n QueryLoyaltyImportsRequest,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Sorting,\n CursorPaging,\n QueryLoyaltyImportsResponse,\n CursorPagingMetadata,\n Cursors,\n DeleteLoyaltyImportRequest,\n DeleteLoyaltyImportResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n Empty,\n ImportFinished,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n BaseEventMetadata,\n EventMetadata,\n LoyaltyImportCreatedEnvelope,\n CreateLoyaltyImportOptions,\n ExecuteLoyaltyImportOptions,\n LoyaltyImportsQueryResult,\n LoyaltyImportsQueryBuilder,\n} from './loyalty-imports-v1-loyalty-import-imports.universal.js';\nexport {\n ImportStatusWithLiterals,\n ColumnNameWithLiterals,\n SortOrderWithLiterals,\n WebhookIdentityTypeWithLiterals,\n} from './loyalty-imports-v1-loyalty-import-imports.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAAA;AAAA,EAAA,kCAAAC;AAAA,EAAA,4BAAAC;AAAA,EAAA,+BAAAC;AAAA,EAAA,wBAAAC;AAAA,EAAA,8BAAAC;AAAA,EAAA,2BAAAC;AAAA;AAAA;;;ACAA,IAAAC,iCAAwD;AACxD,IAAAC,oBAAqD;AACrD,IAAAC,0BAA+B;AAC/B,uBAA8D;;;ACH9D,6BAAoD;AACpD,2BAA6B;AAC7B,oCAGO;;;ACLP,0BAAkC;AAClC,uBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,4CACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU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,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AAsBO,IAAM,6BAAyB;AAAA,EACpC;AAAA,EACA;AAAA,EACA,CAAC,cACC;AAAA,QACE,wCAAe,OAAO;AAAA,MACpB;AAAA,QACE,aAAa;AAAA,QACb,OAAO;AAAA,UACL,EAAE,MAAM,qBAAqB;AAAA,UAC7B,EAAE,MAAM,qBAAqB;AAAA,UAC7B,EAAE,MAAM,qBAAqB;AAAA,QAC/B;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAAgC;;;AG/MhC,IAAAC,uBAAiC;AACjC,sCAAkC;AAQ3B,IAAMC,uBAGK,2DAAiBA,oBAAyB;AACrD,IAAMC,oBAGK,2DAAiBA,iBAAsB;AAClD,IAAMC,2BAGK,2DAAiBA,wBAA6B;AACzD,IAAMC,wBAGK,2DAAiBA,qBAA0B;AACtD,IAAMC,8BAGK,2DAAiBA,2BAAgC;AAC5D,IAAMC,uBAGK,2DAAiBA,oBAAyB;AAIrD,IAAMC,8BAG2B;AAAA,EACtC;AACF;","names":["createLoyaltyImport","createLoyaltyImportFileUrl","executeLoyaltyImport","getErrorFileDownloadUrl","getLoyaltyImport","onLoyaltyImportCreated","queryLoyaltyImports","import_rename_all_nested_keys","import_timestamp","import_transform_paths","import_rest_modules","payload","import_transform_paths","ImportStatus","ColumnName","SortOrder","WebhookIdentityType","createLoyaltyImport","sdkTransformError","getLoyaltyImport","getErrorFileDownloadUrl","executeLoyaltyImport","createLoyaltyImportFileUrl","queryLoyaltyImports","createLoyaltyImport","getLoyaltyImport","getErrorFileDownloadUrl","executeLoyaltyImport","createLoyaltyImportFileUrl","queryLoyaltyImports","import_rest_modules","createLoyaltyImport","getLoyaltyImport","getErrorFileDownloadUrl","executeLoyaltyImport","createLoyaltyImportFileUrl","queryLoyaltyImports","onLoyaltyImportCreated"]}
1
+ {"version":3,"sources":["../../index.ts","../../src/loyalty-imports-v1-loyalty-import-imports.public.ts","../../src/loyalty-imports-v1-loyalty-import-imports.universal.ts","../../src/loyalty-imports-v1-loyalty-import-imports.http.ts","../../src/loyalty-imports-v1-loyalty-import-imports.context.ts"],"sourcesContent":["export * from './src/loyalty-imports-v1-loyalty-import-imports.context.js';\n","import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n CreateLoyaltyImportFileUrlResponse,\n CreateLoyaltyImportOptions,\n CreateLoyaltyImportResponse,\n ExecuteLoyaltyImportOptions,\n ExecuteLoyaltyImportResponse,\n GetErrorFileDownloadUrlResponse,\n LoyaltyImport,\n LoyaltyImportCreatedEnvelope,\n LoyaltyImportsQueryBuilder,\n createLoyaltyImport as universalCreateLoyaltyImport,\n createLoyaltyImportFileUrl as universalCreateLoyaltyImportFileUrl,\n executeLoyaltyImport as universalExecuteLoyaltyImport,\n getErrorFileDownloadUrl as universalGetErrorFileDownloadUrl,\n getLoyaltyImport as universalGetLoyaltyImport,\n queryLoyaltyImports as universalQueryLoyaltyImports,\n} from './loyalty-imports-v1-loyalty-import-imports.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/loyalty' };\n\nexport function createLoyaltyImport(\n httpClient: HttpClient\n): CreateLoyaltyImportSignature {\n return (fileUrl: string, options?: CreateLoyaltyImportOptions) =>\n universalCreateLoyaltyImport(\n fileUrl,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateLoyaltyImportSignature {\n /**\n * Creates an import object based on an uploaded file.\n *\n * Call this method after uploading your file to the URL obtained from Create Loyalty Import File Url.\n * @param - URL of the file to import.\n */\n (fileUrl: string, options?: CreateLoyaltyImportOptions): Promise<\n NonNullablePaths<\n CreateLoyaltyImportResponse,\n | `loyaltyImport.status`\n | `loyaltyImport.fileMetadata.url`\n | `loyaltyImport.fileMetadata.header.values`\n | `loyaltyImport.fileMetadata.headerMappingInfo.headerMappings`\n | `loyaltyImport.fileMetadata.headerMappingInfo.headerMappings.${number}.columnName`\n | `loyaltyImport.fileMetadata.headerMappingInfo.headerMappings.${number}.columnIndex`\n | `loyaltyImport.fileMetadata.sampleDataRows`\n | `loyaltyImport.importResult.errorFileExists`,\n 7\n >\n >;\n}\n\nexport function getLoyaltyImport(\n httpClient: HttpClient\n): GetLoyaltyImportSignature {\n return (loyaltyImportId: string) =>\n universalGetLoyaltyImport(\n loyaltyImportId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetLoyaltyImportSignature {\n /**\n * Retrieves a loyalty import.\n * @param - Loyalty import ID.\n * @returns Retrieved loyalty import.\n */\n (loyaltyImportId: string): Promise<\n NonNullablePaths<\n LoyaltyImport,\n | `status`\n | `fileMetadata.url`\n | `fileMetadata.header.values`\n | `fileMetadata.headerMappingInfo.headerMappings`\n | `fileMetadata.headerMappingInfo.headerMappings.${number}.columnName`\n | `fileMetadata.headerMappingInfo.headerMappings.${number}.columnIndex`\n | `fileMetadata.sampleDataRows`\n | `importResult.errorFileExists`,\n 6\n >\n >;\n}\n\nexport function getErrorFileDownloadUrl(\n httpClient: HttpClient\n): GetErrorFileDownloadUrlSignature {\n return (loyaltyImportId: string) =>\n universalGetErrorFileDownloadUrl(\n loyaltyImportId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetErrorFileDownloadUrlSignature {\n /**\n * Retrieves the download URL for the error file of a failed loyalty import.\n *\n * If an import fails, the `importResult.errorFileExists` field in the `LoyaltyImport` object is set to `true`.\n *\n * Use this method to get the URL of the error file, which contains details about which items couldn't be imported and why.\n * @param - Loyalty import ID.\n */\n (loyaltyImportId: string): Promise<GetErrorFileDownloadUrlResponse>;\n}\n\nexport function executeLoyaltyImport(\n httpClient: HttpClient\n): ExecuteLoyaltyImportSignature {\n return (loyaltyImportId: string, options?: ExecuteLoyaltyImportOptions) =>\n universalExecuteLoyaltyImport(\n loyaltyImportId,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ExecuteLoyaltyImportSignature {\n /**\n * Starts the actual import process for a loyalty import.\n *\n * Call this method after the loyalty import object reaches the `\"PARSED\"` status.\n * @param - Loyalty import ID.\n */\n (loyaltyImportId: string, options?: ExecuteLoyaltyImportOptions): Promise<\n NonNullablePaths<\n ExecuteLoyaltyImportResponse,\n | `loyaltyImport.status`\n | `loyaltyImport.fileMetadata.url`\n | `loyaltyImport.fileMetadata.header.values`\n | `loyaltyImport.fileMetadata.headerMappingInfo.headerMappings`\n | `loyaltyImport.fileMetadata.headerMappingInfo.headerMappings.${number}.columnName`\n | `loyaltyImport.fileMetadata.headerMappingInfo.headerMappings.${number}.columnIndex`\n | `loyaltyImport.fileMetadata.sampleDataRows`\n | `loyaltyImport.importResult.errorFileExists`,\n 7\n >\n >;\n}\n\nexport function createLoyaltyImportFileUrl(\n httpClient: HttpClient\n): CreateLoyaltyImportFileUrlSignature {\n return () =>\n universalCreateLoyaltyImportFileUrl(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateLoyaltyImportFileUrlSignature {\n /**\n * Creates a URL for uploading a loyalty import file.\n *\n * 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.\n */\n (): Promise<CreateLoyaltyImportFileUrlResponse>;\n}\n\nexport function queryLoyaltyImports(\n httpClient: HttpClient\n): QueryLoyaltyImportsSignature {\n return () =>\n universalQueryLoyaltyImports(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface QueryLoyaltyImportsSignature {\n /**\n * Creates a query to retrieve a list of loyalty imports.\n *\n * The `queryLoyaltyImports()` method builds a query to retrieve a list of imports and returns a `LoyaltyImportsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is typically used to run the query using the `find()` method.\n *\n * You can refine the query by chaining `LoyaltyImportsQueryBuilder` methods onto the query. `LoyaltyImportsQueryBuilder` methods enable you to sort, filter, and control the results `queryLoyaltyImports()` returns.\n *\n * `queryLoyaltyImports()` runs with these `LoyaltyImportsQueryBuilder` defaults, which you can override:\n *\n * - `limit(50)`\n * - `descending(\"_createdDate\")`\n *\n * The methods 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.\n */\n (): LoyaltyImportsQueryBuilder;\n}\n\nexport const onLoyaltyImportCreated = EventDefinition(\n 'wix.loyalty.imports.v1.loyalty_import_created',\n true,\n (event: LoyaltyImportCreatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'entity.createdDate' },\n { path: 'entity.updatedDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<LoyaltyImportCreatedEnvelope>();\n\nexport {\n ActionEvent,\n BaseEventMetadata,\n ColumnName,\n CreateLoyaltyImportFileUrlRequest,\n CreateLoyaltyImportFileUrlResponse,\n CreateLoyaltyImportOptions,\n CreateLoyaltyImportRequest,\n CreateLoyaltyImportResponse,\n CursorPaging,\n CursorPagingMetadata,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Cursors,\n DeleteLoyaltyImportRequest,\n DeleteLoyaltyImportResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n ExecuteLoyaltyImportOptions,\n ExecuteLoyaltyImportRequest,\n ExecuteLoyaltyImportResponse,\n FileHeader,\n FileMetadata,\n GetErrorFileDownloadUrlRequest,\n GetErrorFileDownloadUrlResponse,\n GetLoyaltyImportRequest,\n GetLoyaltyImportResponse,\n HeaderMapping,\n HeaderMappingInfo,\n IdentificationData,\n IdentificationDataIdOneOf,\n ImportFinished,\n ImportResult,\n ImportStatus,\n LoyaltyImport,\n LoyaltyImportCreatedEnvelope,\n LoyaltyImportsQueryBuilder,\n LoyaltyImportsQueryResult,\n MessageEnvelope,\n ParseResult,\n QueryLoyaltyImportsRequest,\n QueryLoyaltyImportsResponse,\n RestoreInfo,\n SampleDataRow,\n SortOrder,\n Sorting,\n WebhookIdentityType,\n} from './loyalty-imports-v1-loyalty-import-imports.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { queryBuilder } from '@wix/sdk-runtime/query-builder';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, HttpResponse, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixLoyaltyImportsV1LoyaltyImport from './loyalty-imports-v1-loyalty-import-imports.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\n/**\n * An Import object is a batch import of loyalty points for existing customers.\n * You can use Loyalty Imports to import loyalty points from 3rd-party providers or update existing customer point balances.\n * This object tracks the entire import process from file upload to data processing.\n */\nexport interface LoyaltyImport {\n /**\n * The ID of the import.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * ID of the asynchronous import job associated with this import.\n * @format GUID\n * @readonly\n */\n asyncImportJobId?: string | null;\n /**\n * Revision number, which increments by 1 each time the loyalty import is updated.\n * To prevent conflicting changes, the current `revision` must be passed when updating the loyalty import.\n *\n * Ignored when creating a loyalty import.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the loyalty import was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the loyalty import was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * Current status of the import process.\n * @readonly\n */\n status?: ImportStatusWithLiterals;\n /** Metadata of the uploaded file containing loyalty points data. */\n fileMetadata?: FileMetadata;\n /** Results of parsing the uploaded file, including the number of rows parsed and any parse errors. */\n parseResult?: ParseResult;\n /** Results of the import process, including success and failure counts. */\n importResult?: ImportResult;\n}\n\nexport enum ImportStatus {\n /** Status is unknown or not specified. */\n UNKNOWN = 'UNKNOWN',\n /** The import has initiated but processing hasn't started yet. */\n INITIATED = 'INITIATED',\n /** The system is currently parsing the import file. */\n PARSING = 'PARSING',\n /** The import file has been successfully parsed and is ready to import. */\n PARSED = 'PARSED',\n /** The system is currently importing the parsed data. */\n IMPORTING = 'IMPORTING',\n /** The import process is complete. This status indicates the process finished, but doesn't guarantee all data imported successfully. */\n IMPORTED = 'IMPORTED',\n /** The import process has failed. */\n FAILED = 'FAILED',\n}\n\n/** @enumType */\nexport type ImportStatusWithLiterals =\n | ImportStatus\n | 'UNKNOWN'\n | 'INITIATED'\n | 'PARSING'\n | 'PARSED'\n | 'IMPORTING'\n | 'IMPORTED'\n | 'FAILED';\n\nexport interface FileMetadata {\n /**\n * Size of the uploaded file in bytes. Max: `10 MB`.\n * @max 104857600\n * @readonly\n */\n size?: number | null;\n /**\n * Name of the uploaded file.\n * @format GUID\n * @readonly\n */\n name?: string | null;\n /**\n * URL of the uploaded file.\n * @minLength 3\n * @maxLength 10000\n */\n url?: string;\n /** Column headings from the first row of the uploaded CSV file. */\n header?: FileHeader;\n /**\n * Mapping between loyalty data fields and the corresponding columns in the uploaded file.\n *\n * Must include mappings for both `EMAIL` and `POINTS` to be valid.\n */\n headerMappingInfo?: HeaderMappingInfo;\n /**\n * Up to 5 sample rows from the import file, providing a preview of the data to be imported.\n * @maxSize 5\n */\n sampleDataRows?: SampleDataRow[];\n}\n\nexport interface FileHeader {\n /**\n * Column headings from the first row of the uploaded file.\n * @maxSize 100\n * @maxLength 1000\n */\n values?: string[];\n}\n\nexport interface HeaderMappingInfo {\n /**\n * Mappings between required loyalty data fields and file columns.\n * Must contain exactly 2 mappings: one for `\"EMAIL\"` and one for `\"POINTS\"`.\n * @minSize 2\n * @maxSize 2\n */\n headerMappings?: HeaderMapping[];\n}\n\nexport interface HeaderMapping {\n /** The required loyalty data field that this mapping corresponds to. Must be either `\"EMAIL\"` or `\"POINTS\"`. */\n columnName?: ColumnNameWithLiterals;\n /**\n * The zero-based index of the column in the uploaded file that contains the data for this loyalty field.\n * For example, if the email addresses are in the second column of the CSV file, this value would be `1`.\n */\n columnIndex?: number;\n}\n\nexport enum ColumnName {\n /** Column containing the customer's email address. */\n EMAIL = 'EMAIL',\n /** Column containing the customer's loyalty point balance to be imported or updated. */\n POINTS = 'POINTS',\n}\n\n/** @enumType */\nexport type ColumnNameWithLiterals = ColumnName | 'EMAIL' | 'POINTS';\n\nexport interface SampleDataRow {\n /**\n * Values in one sample data row. Each value corresponds to a column in the CSV file.\n * The number of values matches the number of columns in the file.\n * @maxSize 20\n * @maxLength 1000\n */\n values?: string[];\n}\n\nexport interface ParseResult {\n /**\n * Number of rows parsed from the uploaded import file.\n * @readonly\n */\n parsedRowCount?: number | null;\n /**\n * Reason code explaining why parsing failed, if applicable.\n * @readonly\n * @maxLength 1000\n */\n parseErrorReason?: string | null;\n}\n\nexport interface ImportResult {\n /** Whether an error file detailing import failures is available for download. The file includes row-by-row import status, error reasons, and original data. */\n errorFileExists?: boolean;\n /**\n * Number of rows successfully imported.\n * @readonly\n */\n successCount?: number | null;\n /**\n * Number of rows that failed to import due to errors.\n * @readonly\n */\n failureCount?: number | null;\n}\n\nexport interface CreateLoyaltyImportRequest {\n /** URL of the file to import. */\n fileUrl: string | null;\n /** Name of the file to import. */\n fileName?: string | null;\n /** Size of the file to import, in bytes. */\n fileSize?: number | null;\n}\n\nexport interface CreateLoyaltyImportResponse {\n /** Created loyalty import. */\n loyaltyImport?: LoyaltyImport;\n}\n\nexport interface GetLoyaltyImportRequest {\n /** Loyalty import ID. */\n loyaltyImportId: string;\n}\n\nexport interface GetLoyaltyImportResponse {\n /** Retrieved loyalty import. */\n loyaltyImport?: LoyaltyImport;\n}\n\nexport interface GetErrorFileDownloadUrlRequest {\n /** Loyalty import ID. */\n loyaltyImportId: string;\n}\n\nexport interface GetErrorFileDownloadUrlResponse {\n /** URL for downloading the error file. */\n url?: string | null;\n}\n\nexport interface ExecuteLoyaltyImportRequest {\n /** Loyalty import ID. */\n loyaltyImportId: string;\n /** Header mapping information for the import file. */\n headerMappingInfo?: HeaderMappingInfo;\n}\n\nexport interface ExecuteLoyaltyImportResponse {\n /** Executed loyalty import. */\n loyaltyImport?: LoyaltyImport;\n}\n\nexport interface CreateLoyaltyImportFileUrlRequest {}\n\nexport interface CreateLoyaltyImportFileUrlResponse {\n /** Path where the file will be stored. */\n filePath?: string | null;\n /** URL for uploading the loyalty import file. */\n uploadUrl?: string | null;\n}\n\nexport interface QueryLoyaltyImportsRequest {\n /**\n * Filter object.\n * See [API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language)\n * for more information.\n *\n * For a detailed list of supported filters, see\n * [Loyalty Imports: Supported Filters and Sorting](https://dev.wix.com/docs/rest/crm/loyalty-program/imports/filter-and-sort).\n */\n query: CursorQuery;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n /**\n * Cursor paging options.\n *\n * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n */\n cursorPaging?: CursorPaging;\n /**\n * Filter object.\n *\n * Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).\n */\n filter?: Record<string, any> | null;\n /**\n * Sort object.\n *\n * Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting).\n * @maxSize 5\n */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n /**\n * Cursor paging options.\n *\n * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /**\n * Name of the field to sort by.\n * @maxLength 512\n */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface QueryLoyaltyImportsResponse {\n /** List of loyalty imports matching the query. */\n loyaltyImports?: LoyaltyImport[];\n /** Paging metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in current page. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface DeleteLoyaltyImportRequest {\n /**\n * Loyalty import ID.\n * @format GUID\n */\n loyaltyImportId?: string;\n /**\n * Revision number, which increments by 1 each time the loyalty import is updated.\n * To prevent conflicting changes, the current `revision` must be passed when updating the loyalty import.\n */\n revision?: string;\n}\n\nexport interface DeleteLoyaltyImportResponse {}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface Empty {}\n\nexport interface ImportFinished {\n /** Completed loyalty import. */\n loyaltyImport?: LoyaltyImport;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\nexport interface LoyaltyImportCreatedEnvelope {\n entity: LoyaltyImport;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a loyalty import is created.\n * @webhook\n * @eventType wix.loyalty.imports.v1.loyalty_import_created\n * @serviceIdentifier wix.loyalty.imports.v1.LoyaltyImports\n * @slug created\n */\nexport declare function onLoyaltyImportCreated(\n handler: (event: LoyaltyImportCreatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates an import object based on an uploaded file.\n *\n * Call this method after uploading your file to the URL obtained from Create Loyalty Import File Url.\n * @param fileUrl - URL of the file to import.\n * @public\n * @requiredField fileUrl\n * @permissionId LOYALTY.MANAGE_IMPORTS\n * @applicableIdentity APP\n * @fqn wix.loyalty.imports.v1.LoyaltyImports.CreateLoyaltyImport\n */\nexport async function createLoyaltyImport(\n fileUrl: string,\n options?: CreateLoyaltyImportOptions\n): Promise<\n NonNullablePaths<\n CreateLoyaltyImportResponse,\n | `loyaltyImport.status`\n | `loyaltyImport.fileMetadata.url`\n | `loyaltyImport.fileMetadata.header.values`\n | `loyaltyImport.fileMetadata.headerMappingInfo.headerMappings`\n | `loyaltyImport.fileMetadata.headerMappingInfo.headerMappings.${number}.columnName`\n | `loyaltyImport.fileMetadata.headerMappingInfo.headerMappings.${number}.columnIndex`\n | `loyaltyImport.fileMetadata.sampleDataRows`\n | `loyaltyImport.importResult.errorFileExists`,\n 7\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n fileUrl: fileUrl,\n fileName: options?.fileName,\n fileSize: options?.fileSize,\n });\n\n const reqOpts =\n ambassadorWixLoyaltyImportsV1LoyaltyImport.createLoyaltyImport(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n fileUrl: '$[0]',\n fileName: '$[1].fileName',\n fileSize: '$[1].fileSize',\n },\n singleArgumentUnchanged: false,\n },\n ['fileUrl', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface CreateLoyaltyImportOptions {\n /** Name of the file to import. */\n fileName?: string | null;\n /** Size of the file to import, in bytes. */\n fileSize?: number | null;\n}\n\n/**\n * Retrieves a loyalty import.\n * @param loyaltyImportId - Loyalty import ID.\n * @public\n * @requiredField loyaltyImportId\n * @permissionId LOYALTY.MANAGE_IMPORTS\n * @applicableIdentity APP\n * @returns Retrieved loyalty import.\n * @fqn wix.loyalty.imports.v1.LoyaltyImports.GetLoyaltyImport\n */\nexport async function getLoyaltyImport(\n loyaltyImportId: string\n): Promise<\n NonNullablePaths<\n LoyaltyImport,\n | `status`\n | `fileMetadata.url`\n | `fileMetadata.header.values`\n | `fileMetadata.headerMappingInfo.headerMappings`\n | `fileMetadata.headerMappingInfo.headerMappings.${number}.columnName`\n | `fileMetadata.headerMappingInfo.headerMappings.${number}.columnIndex`\n | `fileMetadata.sampleDataRows`\n | `importResult.errorFileExists`,\n 6\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n loyaltyImportId: loyaltyImportId,\n });\n\n const reqOpts =\n ambassadorWixLoyaltyImportsV1LoyaltyImport.getLoyaltyImport(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.loyaltyImport!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { loyaltyImportId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['loyaltyImportId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves the download URL for the error file of a failed loyalty import.\n *\n * If an import fails, the `importResult.errorFileExists` field in the `LoyaltyImport` object is set to `true`.\n *\n * Use this method to get the URL of the error file, which contains details about which items couldn't be imported and why.\n * @param loyaltyImportId - Loyalty import ID.\n * @public\n * @requiredField loyaltyImportId\n * @permissionId LOYALTY.MANAGE_IMPORTS\n * @applicableIdentity APP\n * @fqn wix.loyalty.imports.v1.LoyaltyImports.GetErrorFileDownloadUrl\n */\nexport async function getErrorFileDownloadUrl(\n loyaltyImportId: string\n): Promise<GetErrorFileDownloadUrlResponse> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n loyaltyImportId: loyaltyImportId,\n });\n\n const reqOpts =\n ambassadorWixLoyaltyImportsV1LoyaltyImport.getErrorFileDownloadUrl(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { loyaltyImportId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['loyaltyImportId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Starts the actual import process for a loyalty import.\n *\n * Call this method after the loyalty import object reaches the `\"PARSED\"` status.\n * @param loyaltyImportId - Loyalty import ID.\n * @public\n * @requiredField loyaltyImportId\n * @permissionId LOYALTY.MANAGE_IMPORTS\n * @applicableIdentity APP\n * @fqn wix.loyalty.imports.v1.LoyaltyImports.ExecuteLoyaltyImport\n */\nexport async function executeLoyaltyImport(\n loyaltyImportId: string,\n options?: ExecuteLoyaltyImportOptions\n): Promise<\n NonNullablePaths<\n ExecuteLoyaltyImportResponse,\n | `loyaltyImport.status`\n | `loyaltyImport.fileMetadata.url`\n | `loyaltyImport.fileMetadata.header.values`\n | `loyaltyImport.fileMetadata.headerMappingInfo.headerMappings`\n | `loyaltyImport.fileMetadata.headerMappingInfo.headerMappings.${number}.columnName`\n | `loyaltyImport.fileMetadata.headerMappingInfo.headerMappings.${number}.columnIndex`\n | `loyaltyImport.fileMetadata.sampleDataRows`\n | `loyaltyImport.importResult.errorFileExists`,\n 7\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n loyaltyImportId: loyaltyImportId,\n headerMappingInfo: options?.headerMappingInfo,\n });\n\n const reqOpts =\n ambassadorWixLoyaltyImportsV1LoyaltyImport.executeLoyaltyImport(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n loyaltyImportId: '$[0]',\n headerMappingInfo: '$[1].headerMappingInfo',\n },\n singleArgumentUnchanged: false,\n },\n ['loyaltyImportId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ExecuteLoyaltyImportOptions {\n /** Header mapping information for the import file. */\n headerMappingInfo?: HeaderMappingInfo;\n}\n\n/**\n * Creates a URL for uploading a loyalty import file.\n *\n * 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.\n * @public\n * @permissionId LOYALTY.MANAGE_IMPORTS\n * @applicableIdentity APP\n * @fqn wix.loyalty.imports.v1.LoyaltyImports.CreateLoyaltyImportFileUrl\n */\nexport async function createLoyaltyImportFileUrl(): Promise<CreateLoyaltyImportFileUrlResponse> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixLoyaltyImportsV1LoyaltyImport.createLoyaltyImportFileUrl(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates a query to retrieve a list of loyalty imports.\n *\n * The `queryLoyaltyImports()` method builds a query to retrieve a list of imports and returns a `LoyaltyImportsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is typically used to run the query using the `find()` method.\n *\n * You can refine the query by chaining `LoyaltyImportsQueryBuilder` methods onto the query. `LoyaltyImportsQueryBuilder` methods enable you to sort, filter, and control the results `queryLoyaltyImports()` returns.\n *\n * `queryLoyaltyImports()` runs with these `LoyaltyImportsQueryBuilder` defaults, which you can override:\n *\n * - `limit(50)`\n * - `descending(\"_createdDate\")`\n *\n * The methods 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.\n * @public\n * @permissionId LOYALTY.MANAGE_IMPORTS\n * @applicableIdentity APP\n * @fqn wix.loyalty.imports.v1.LoyaltyImports.QueryLoyaltyImports\n */\nexport function queryLoyaltyImports(): LoyaltyImportsQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<\n LoyaltyImport,\n 'CURSOR',\n QueryLoyaltyImportsRequest,\n QueryLoyaltyImportsResponse\n >({\n func: async (payload: QueryLoyaltyImportsRequest) => {\n const reqOpts =\n ambassadorWixLoyaltyImportsV1LoyaltyImport.queryLoyaltyImports(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n return result;\n } catch (err) {\n sideEffects?.onError?.(err);\n throw err;\n }\n },\n requestTransformer: (query: QueryLoyaltyImportsRequest['query']) => {\n const args = [query, {}] as [QueryLoyaltyImportsRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({\n data,\n }: HttpResponse<QueryLoyaltyImportsResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.loyaltyImports,\n pagingMetadata: transformedData?.pagingMetadata,\n };\n },\n errorTransformer: (err: unknown) => {\n const transformedError = sdkTransformError(err, {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n });\n\n throw transformedError;\n },\n pagingMethod: 'CURSOR',\n transformationPaths: {},\n });\n}\n\ninterface QueryCursorResult {\n cursors: Cursors;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface LoyaltyImportsQueryResult extends QueryCursorResult {\n items: LoyaltyImport[];\n query: LoyaltyImportsQueryBuilder;\n next: () => Promise<LoyaltyImportsQueryResult>;\n prev: () => Promise<LoyaltyImportsQueryResult>;\n}\n\nexport interface LoyaltyImportsQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n eq: (\n propertyName: '_createdDate' | '_updatedDate' | 'status',\n value: any\n ) => LoyaltyImportsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ne: (\n propertyName: '_createdDate' | '_updatedDate' | 'status',\n value: any\n ) => LoyaltyImportsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ge: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any\n ) => LoyaltyImportsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n gt: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any\n ) => LoyaltyImportsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n le: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any\n ) => LoyaltyImportsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n lt: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any\n ) => LoyaltyImportsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `values`.\n * @param values - List of values to compare against.\n */\n hasSome: (\n propertyName: '_createdDate' | '_updatedDate' | 'status',\n value: any[]\n ) => LoyaltyImportsQueryBuilder;\n in: (\n propertyName: '_createdDate' | '_updatedDate' | 'status',\n value: any\n ) => LoyaltyImportsQueryBuilder;\n exists: (\n propertyName: '_createdDate' | '_updatedDate' | 'status',\n value: boolean\n ) => LoyaltyImportsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n ascending: (\n ...propertyNames: Array<'_createdDate' | '_updatedDate' | 'status'>\n ) => LoyaltyImportsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n descending: (\n ...propertyNames: Array<'_createdDate' | '_updatedDate' | 'status'>\n ) => LoyaltyImportsQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */\n limit: (limit: number) => LoyaltyImportsQueryBuilder;\n /** @param cursor - A pointer to specific record */\n skipTo: (cursor: string) => LoyaltyImportsQueryBuilder;\n find: () => Promise<LoyaltyImportsQueryResult>;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixLoyaltyImportsV1LoyaltyImportsUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/loyalty-imports',\n destPath: '',\n },\n {\n srcPath: '/_api/loyalty-imports',\n destPath: '/api',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/loyalty-imports',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/loyalty-imports',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/loyalty-imports',\n destPath: '',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/loyalty-imports',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/_api/loyalty-imports',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/loyalty-imports',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/loyalty-imports',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_loyalty_imports';\n\n/**\n * Creates an import object based on an uploaded file.\n *\n * Call this method after uploading your file to the URL obtained from Create Loyalty Import File Url.\n */\nexport function createLoyaltyImport(\n payload: object\n): RequestOptionsFactory<any> {\n function __createLoyaltyImport({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.imports.v1.loyalty_import',\n method: 'POST' as any,\n methodFqn: 'wix.loyalty.imports.v1.LoyaltyImports.CreateLoyaltyImport',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixLoyaltyImportsV1LoyaltyImportsUrl({\n protoPath: '/v1/loyalty-imports',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'loyaltyImport.createdDate' },\n { path: 'loyaltyImport.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createLoyaltyImport;\n}\n\n/** Retrieves a loyalty import. */\nexport function getLoyaltyImport(payload: object): RequestOptionsFactory<any> {\n function __getLoyaltyImport({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.imports.v1.loyalty_import',\n method: 'GET' as any,\n methodFqn: 'wix.loyalty.imports.v1.LoyaltyImports.GetLoyaltyImport',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixLoyaltyImportsV1LoyaltyImportsUrl({\n protoPath: '/v1/loyalty-imports',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'loyaltyImport.createdDate' },\n { path: 'loyaltyImport.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getLoyaltyImport;\n}\n\n/**\n * Retrieves the download URL for the error file of a failed loyalty import.\n *\n * If an import fails, the `importResult.errorFileExists` field in the `LoyaltyImport` object is set to `true`.\n *\n * Use this method to get the URL of the error file, which contains details about which items couldn't be imported and why.\n */\nexport function getErrorFileDownloadUrl(\n payload: object\n): RequestOptionsFactory<any> {\n function __getErrorFileDownloadUrl({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.imports.v1.loyalty_import',\n method: 'GET' as any,\n methodFqn:\n 'wix.loyalty.imports.v1.LoyaltyImports.GetErrorFileDownloadUrl',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixLoyaltyImportsV1LoyaltyImportsUrl({\n protoPath: '/v1/loyalty-imports/error-file-download-url',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getErrorFileDownloadUrl;\n}\n\n/**\n * Starts the actual import process for a loyalty import.\n *\n * Call this method after the loyalty import object reaches the `\"PARSED\"` status.\n */\nexport function executeLoyaltyImport(\n payload: object\n): RequestOptionsFactory<any> {\n function __executeLoyaltyImport({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.imports.v1.loyalty_import',\n method: 'POST' as any,\n methodFqn: 'wix.loyalty.imports.v1.LoyaltyImports.ExecuteLoyaltyImport',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixLoyaltyImportsV1LoyaltyImportsUrl({\n protoPath: '/v1/loyalty-imports/execute',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'loyaltyImport.createdDate' },\n { path: 'loyaltyImport.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __executeLoyaltyImport;\n}\n\n/**\n * Creates a URL for uploading a loyalty import file.\n *\n * 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.\n */\nexport function createLoyaltyImportFileUrl(\n payload: object\n): RequestOptionsFactory<any> {\n function __createLoyaltyImportFileUrl({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.imports.v1.loyalty_import',\n method: 'POST' as any,\n methodFqn:\n 'wix.loyalty.imports.v1.LoyaltyImports.CreateLoyaltyImportFileUrl',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixLoyaltyImportsV1LoyaltyImportsUrl({\n protoPath: '/v1/loyalty-imports/wixmp-upload-url',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __createLoyaltyImportFileUrl;\n}\n\n/**\n * Creates a query to retrieve a list of loyalty imports.\n *\n * The `queryLoyaltyImports()` method builds a query to retrieve a list of imports and returns a `LoyaltyImportsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is typically used to run the query using the `find()` method.\n *\n * You can refine the query by chaining `LoyaltyImportsQueryBuilder` methods onto the query. `LoyaltyImportsQueryBuilder` methods enable you to sort, filter, and control the results `queryLoyaltyImports()` returns.\n *\n * `queryLoyaltyImports()` runs with these `LoyaltyImportsQueryBuilder` defaults, which you can override:\n *\n * - `limit(50)`\n * - `descending(\"_createdDate\")`\n *\n * The methods 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.\n */\nexport function queryLoyaltyImports(\n payload: object\n): RequestOptionsFactory<any> {\n function __queryLoyaltyImports({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.imports.v1.loyalty_import',\n method: 'POST' as any,\n methodFqn: 'wix.loyalty.imports.v1.LoyaltyImports.QueryLoyaltyImports',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixLoyaltyImportsV1LoyaltyImportsUrl({\n protoPath: '/v1/loyalty-imports/query',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'loyaltyImports.createdDate' },\n { path: 'loyaltyImports.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryLoyaltyImports;\n}\n","import {\n createLoyaltyImport as publicCreateLoyaltyImport,\n getLoyaltyImport as publicGetLoyaltyImport,\n getErrorFileDownloadUrl as publicGetErrorFileDownloadUrl,\n executeLoyaltyImport as publicExecuteLoyaltyImport,\n createLoyaltyImportFileUrl as publicCreateLoyaltyImportFileUrl,\n queryLoyaltyImports as publicQueryLoyaltyImports,\n} from './loyalty-imports-v1-loyalty-import-imports.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n BuildRESTFunction,\n MaybeContext,\n BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { onLoyaltyImportCreated as publicOnLoyaltyImportCreated } from './loyalty-imports-v1-loyalty-import-imports.public.js';\n\nexport const createLoyaltyImport: MaybeContext<\n BuildRESTFunction<typeof publicCreateLoyaltyImport> &\n typeof publicCreateLoyaltyImport\n> = /*#__PURE__*/ createRESTModule(publicCreateLoyaltyImport);\nexport const getLoyaltyImport: MaybeContext<\n BuildRESTFunction<typeof publicGetLoyaltyImport> &\n typeof publicGetLoyaltyImport\n> = /*#__PURE__*/ createRESTModule(publicGetLoyaltyImport);\nexport const getErrorFileDownloadUrl: MaybeContext<\n BuildRESTFunction<typeof publicGetErrorFileDownloadUrl> &\n typeof publicGetErrorFileDownloadUrl\n> = /*#__PURE__*/ createRESTModule(publicGetErrorFileDownloadUrl);\nexport const executeLoyaltyImport: MaybeContext<\n BuildRESTFunction<typeof publicExecuteLoyaltyImport> &\n typeof publicExecuteLoyaltyImport\n> = /*#__PURE__*/ createRESTModule(publicExecuteLoyaltyImport);\nexport const createLoyaltyImportFileUrl: MaybeContext<\n BuildRESTFunction<typeof publicCreateLoyaltyImportFileUrl> &\n typeof publicCreateLoyaltyImportFileUrl\n> = /*#__PURE__*/ createRESTModule(publicCreateLoyaltyImportFileUrl);\nexport const queryLoyaltyImports: MaybeContext<\n BuildRESTFunction<typeof publicQueryLoyaltyImports> &\n typeof publicQueryLoyaltyImports\n> = /*#__PURE__*/ createRESTModule(publicQueryLoyaltyImports);\n/**\n * Triggered when a loyalty import is created.\n */\nexport const onLoyaltyImportCreated: BuildEventDefinition<\n typeof publicOnLoyaltyImportCreated\n> &\n typeof publicOnLoyaltyImportCreated = createEventModule(\n publicOnLoyaltyImportCreated\n);\n\nexport {\n ImportStatus,\n ColumnName,\n SortOrder,\n WebhookIdentityType,\n} from './loyalty-imports-v1-loyalty-import-imports.universal.js';\nexport {\n LoyaltyImport,\n FileMetadata,\n FileHeader,\n HeaderMappingInfo,\n HeaderMapping,\n SampleDataRow,\n ParseResult,\n ImportResult,\n CreateLoyaltyImportRequest,\n CreateLoyaltyImportResponse,\n GetLoyaltyImportRequest,\n GetLoyaltyImportResponse,\n GetErrorFileDownloadUrlRequest,\n GetErrorFileDownloadUrlResponse,\n ExecuteLoyaltyImportRequest,\n ExecuteLoyaltyImportResponse,\n CreateLoyaltyImportFileUrlRequest,\n CreateLoyaltyImportFileUrlResponse,\n QueryLoyaltyImportsRequest,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Sorting,\n CursorPaging,\n QueryLoyaltyImportsResponse,\n CursorPagingMetadata,\n Cursors,\n DeleteLoyaltyImportRequest,\n DeleteLoyaltyImportResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n Empty,\n ImportFinished,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n BaseEventMetadata,\n EventMetadata,\n LoyaltyImportCreatedEnvelope,\n CreateLoyaltyImportOptions,\n ExecuteLoyaltyImportOptions,\n LoyaltyImportsQueryResult,\n LoyaltyImportsQueryBuilder,\n} from './loyalty-imports-v1-loyalty-import-imports.universal.js';\nexport {\n ImportStatusWithLiterals,\n ColumnNameWithLiterals,\n SortOrderWithLiterals,\n WebhookIdentityTypeWithLiterals,\n} from './loyalty-imports-v1-loyalty-import-imports.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAAA;AAAA,EAAA,kCAAAC;AAAA,EAAA,4BAAAC;AAAA,EAAA,+BAAAC;AAAA,EAAA,wBAAAC;AAAA,EAAA,8BAAAC;AAAA,EAAA,2BAAAC;AAAA;AAAA;;;ACAA,IAAAC,iCAAwD;AACxD,IAAAC,oBAAqD;AACrD,IAAAC,0BAA+B;AAC/B,uBAA8D;;;ACH9D,6BAAoD;AACpD,2BAA6B;AAC7B,oCAGO;;;ACLP,0BAAkC;AAClC,uBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,4CACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,M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OAAO;AAAA,MACpB;AAAA,QACE,aAAa;AAAA,QACb,OAAO;AAAA,UACL,EAAE,MAAM,qBAAqB;AAAA,UAC7B,EAAE,MAAM,qBAAqB;AAAA,UAC7B,EAAE,MAAM,qBAAqB;AAAA,QAC/B;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAAgC;;;AG/MhC,IAAAC,uBAAiC;AACjC,sCAAkC;AAQ3B,IAAMC,uBAGK,2DAAiBA,oBAAyB;AACrD,IAAMC,oBAGK,2DAAiBA,iBAAsB;AAClD,IAAMC,2BAGK,2DAAiBA,wBAA6B;AACzD,IAAMC,wBAGK,2DAAiBA,qBAA0B;AACtD,IAAMC,8BAGK,2DAAiBA,2BAAgC;AAC5D,IAAMC,uBAGK,2DAAiBA,oBAAyB;AAIrD,IAAMC,8BAG2B;AAAA,EACtC;AACF;","names":["createLoyaltyImport","createLoyaltyImportFileUrl","executeLoyaltyImport","getErrorFileDownloadUrl","getLoyaltyImport","onLoyaltyImportCreated","queryLoyaltyImports","import_rename_all_nested_keys","import_timestamp","import_transform_paths","import_rest_modules","payload","import_transform_paths","ImportStatus","ColumnName","SortOrder","WebhookIdentityType","createLoyaltyImport","sdkTransformError","getLoyaltyImport","getErrorFileDownloadUrl","executeLoyaltyImport","createLoyaltyImportFileUrl","queryLoyaltyImports","createLoyaltyImport","getLoyaltyImport","getErrorFileDownloadUrl","executeLoyaltyImport","createLoyaltyImportFileUrl","queryLoyaltyImports","import_rest_modules","createLoyaltyImport","getLoyaltyImport","getErrorFileDownloadUrl","executeLoyaltyImport","createLoyaltyImportFileUrl","queryLoyaltyImports","onLoyaltyImportCreated"]}
@@ -108,6 +108,9 @@ function createLoyaltyImport(payload) {
108
108
  method: "POST",
109
109
  methodFqn: "wix.loyalty.imports.v1.LoyaltyImports.CreateLoyaltyImport",
110
110
  packageName: PACKAGE_NAME,
111
+ migrationOptions: {
112
+ optInTransformResponse: true
113
+ },
111
114
  url: resolveWixLoyaltyImportsV1LoyaltyImportsUrl({
112
115
  protoPath: "/v1/loyalty-imports",
113
116
  data: payload,
@@ -135,6 +138,9 @@ function getLoyaltyImport(payload) {
135
138
  method: "GET",
136
139
  methodFqn: "wix.loyalty.imports.v1.LoyaltyImports.GetLoyaltyImport",
137
140
  packageName: PACKAGE_NAME,
141
+ migrationOptions: {
142
+ optInTransformResponse: true
143
+ },
138
144
  url: resolveWixLoyaltyImportsV1LoyaltyImportsUrl({
139
145
  protoPath: "/v1/loyalty-imports",
140
146
  data: payload,
@@ -162,6 +168,9 @@ function getErrorFileDownloadUrl(payload) {
162
168
  method: "GET",
163
169
  methodFqn: "wix.loyalty.imports.v1.LoyaltyImports.GetErrorFileDownloadUrl",
164
170
  packageName: PACKAGE_NAME,
171
+ migrationOptions: {
172
+ optInTransformResponse: true
173
+ },
165
174
  url: resolveWixLoyaltyImportsV1LoyaltyImportsUrl({
166
175
  protoPath: "/v1/loyalty-imports/error-file-download-url",
167
176
  data: payload,
@@ -180,6 +189,9 @@ function executeLoyaltyImport(payload) {
180
189
  method: "POST",
181
190
  methodFqn: "wix.loyalty.imports.v1.LoyaltyImports.ExecuteLoyaltyImport",
182
191
  packageName: PACKAGE_NAME,
192
+ migrationOptions: {
193
+ optInTransformResponse: true
194
+ },
183
195
  url: resolveWixLoyaltyImportsV1LoyaltyImportsUrl({
184
196
  protoPath: "/v1/loyalty-imports/execute",
185
197
  data: payload,
@@ -207,6 +219,9 @@ function createLoyaltyImportFileUrl(payload) {
207
219
  method: "POST",
208
220
  methodFqn: "wix.loyalty.imports.v1.LoyaltyImports.CreateLoyaltyImportFileUrl",
209
221
  packageName: PACKAGE_NAME,
222
+ migrationOptions: {
223
+ optInTransformResponse: true
224
+ },
210
225
  url: resolveWixLoyaltyImportsV1LoyaltyImportsUrl({
211
226
  protoPath: "/v1/loyalty-imports/wixmp-upload-url",
212
227
  data: payload,
@@ -225,6 +240,9 @@ function queryLoyaltyImports(payload) {
225
240
  method: "POST",
226
241
  methodFqn: "wix.loyalty.imports.v1.LoyaltyImports.QueryLoyaltyImports",
227
242
  packageName: PACKAGE_NAME,
243
+ migrationOptions: {
244
+ optInTransformResponse: true
245
+ },
228
246
  url: resolveWixLoyaltyImportsV1LoyaltyImportsUrl({
229
247
  protoPath: "/v1/loyalty-imports/query",
230
248
  data: payload,