@wix/auto_sdk_loyalty_earning-rules 1.0.31 → 1.0.33
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.
- package/build/cjs/index.d.ts +1 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +18 -1
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +18 -1
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +1 -1
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +18 -1
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +18 -1
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +1 -1
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +18 -1
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +18 -1
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +1 -1
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +18 -1
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +18 -1
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +3 -3
package/build/es/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/loyalty-v1-loyalty-earning-rule-earning-rules.public.ts","../../src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.ts","../../src/loyalty-v1-loyalty-earning-rule-earning-rules.http.ts","../../src/loyalty-v1-loyalty-earning-rule-earning-rules.context.ts"],"sourcesContent":["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 BulkCreateLoyaltyEarningRulesResponse,\n CreateCustomLoyaltyEarningRuleOptions,\n CreateCustomLoyaltyEarningRuleResponse,\n DeleteLoyaltyEarningRuleOptions,\n ListEarningRulesOptions,\n ListEarningRulesResponse,\n LoyaltyEarningRule,\n LoyaltyEarningRuleCreatedEnvelope,\n LoyaltyEarningRuleDeletedEnvelope,\n LoyaltyEarningRuleUpdatedEnvelope,\n TypeWithLiterals,\n UpdateLoyaltyEarningRule,\n UpdateLoyaltyEarningRuleResponse,\n bulkCreateLoyaltyEarningRules as universalBulkCreateLoyaltyEarningRules,\n createCustomLoyaltyEarningRule as universalCreateCustomLoyaltyEarningRule,\n createLoyaltyEarningRule as universalCreateLoyaltyEarningRule,\n deleteAutomationEarningRule as universalDeleteAutomationEarningRule,\n deleteLoyaltyEarningRule as universalDeleteLoyaltyEarningRule,\n getLoyaltyEarningRule as universalGetLoyaltyEarningRule,\n listEarningRules as universalListEarningRules,\n updateLoyaltyEarningRule as universalUpdateLoyaltyEarningRule,\n} from './loyalty-v1-loyalty-earning-rule-earning-rules.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/loyalty' };\n\nexport function createLoyaltyEarningRule(\n httpClient: HttpClient\n): CreateLoyaltyEarningRuleSignature {\n return (\n earningRule: NonNullablePaths<\n LoyaltyEarningRule,\n | `sourceAppId`\n | `status`\n | `title`\n | `triggerActivityType`\n | `triggerAppId`,\n 2\n >\n ) =>\n universalCreateLoyaltyEarningRule(\n earningRule,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateLoyaltyEarningRuleSignature {\n /**\n * Creates a non-automated earning rule.\n *\n * >**Note**: You can only create non-automated earning rules from a supported list.\n * For the supported list of services, see the Introduction.\n * @param - Earning rule to create.\n * @returns Created earning rule.\n */\n (\n earningRule: NonNullablePaths<\n LoyaltyEarningRule,\n | `sourceAppId`\n | `status`\n | `title`\n | `triggerActivityType`\n | `triggerAppId`,\n 2\n >\n ): Promise<\n NonNullablePaths<\n LoyaltyEarningRule,\n | `fixedAmount.configs`\n | `fixedAmount.configs.${number}.points`\n | `conversionRate.configs`\n | `conversionRate.configs.${number}.moneyAmount`\n | `conversionRate.configs.${number}.points`\n | `sourceAppId`\n | `triggerAppId`\n | `triggerActivityType`\n | `title`\n | `status`\n | `metadata.canBeDeleted`,\n 5\n >\n >;\n}\n\nexport function bulkCreateLoyaltyEarningRules(\n httpClient: HttpClient\n): BulkCreateLoyaltyEarningRulesSignature {\n return (\n earningRules: NonNullablePaths<\n LoyaltyEarningRule,\n | `sourceAppId`\n | `status`\n | `title`\n | `triggerActivityType`\n | `triggerAppId`,\n 2\n >[]\n ) =>\n universalBulkCreateLoyaltyEarningRules(\n earningRules,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface BulkCreateLoyaltyEarningRulesSignature {\n /**\n * Creates multiple non-automated earning rules.\n *\n * >**Note**: You can only create non-automated earning rules from a supported list.\n * For the supported list of services, see the Introduction.\n * @param - Earning rules to create.\n */\n (\n earningRules: NonNullablePaths<\n LoyaltyEarningRule,\n | `sourceAppId`\n | `status`\n | `title`\n | `triggerActivityType`\n | `triggerAppId`,\n 2\n >[]\n ): Promise<\n NonNullablePaths<\n BulkCreateLoyaltyEarningRulesResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `results.${number}.item.sourceAppId`\n | `results.${number}.item.triggerAppId`\n | `results.${number}.item.triggerActivityType`\n | `results.${number}.item.title`\n | `results.${number}.item.status`\n | `results.${number}.item.metadata.canBeDeleted`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 6\n >\n >;\n}\n\nexport function createCustomLoyaltyEarningRule(\n httpClient: HttpClient\n): CreateCustomLoyaltyEarningRuleSignature {\n return (\n type: TypeWithLiterals,\n options?: CreateCustomLoyaltyEarningRuleOptions\n ) =>\n universalCreateCustomLoyaltyEarningRule(\n type,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateCustomLoyaltyEarningRuleSignature {\n /**\n * Creates a custom automated earning rule.\n *\n * To learn more about the automated rules, see the Introduction.\n * @param - Type of the custom earning rule.\n */\n (\n type: TypeWithLiterals,\n options?: CreateCustomLoyaltyEarningRuleOptions\n ): Promise<\n NonNullablePaths<\n CreateCustomLoyaltyEarningRuleResponse,\n | `earningRule.fixedAmount.configs`\n | `earningRule.fixedAmount.configs.${number}.points`\n | `earningRule.conversionRate.configs`\n | `earningRule.conversionRate.configs.${number}.moneyAmount`\n | `earningRule.conversionRate.configs.${number}.points`\n | `earningRule.sourceAppId`\n | `earningRule.triggerAppId`\n | `earningRule.triggerActivityType`\n | `earningRule.title`\n | `earningRule.status`\n | `earningRule.metadata.canBeDeleted`,\n 6\n >\n >;\n}\n\nexport function getLoyaltyEarningRule(\n httpClient: HttpClient\n): GetLoyaltyEarningRuleSignature {\n return (_id: string) =>\n universalGetLoyaltyEarningRule(\n _id,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetLoyaltyEarningRuleSignature {\n /**\n * Retrieves a specified non-automated earning rule.\n *\n * To retrieve both automated and non-automated earning rules, call List Earning Rules.\n * @param - ID of the earning rule to retrieve.\n * @returns Retrieved earning rule.\n */\n (_id: string): Promise<\n NonNullablePaths<\n LoyaltyEarningRule,\n | `fixedAmount.configs`\n | `fixedAmount.configs.${number}.points`\n | `conversionRate.configs`\n | `conversionRate.configs.${number}.moneyAmount`\n | `conversionRate.configs.${number}.points`\n | `sourceAppId`\n | `triggerAppId`\n | `triggerActivityType`\n | `title`\n | `status`\n | `metadata.canBeDeleted`,\n 5\n >\n >;\n}\n\nexport function updateLoyaltyEarningRule(\n httpClient: HttpClient\n): UpdateLoyaltyEarningRuleSignature {\n return (_id: string, earningRule: UpdateLoyaltyEarningRule) =>\n universalUpdateLoyaltyEarningRule(\n _id,\n earningRule,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateLoyaltyEarningRuleSignature {\n /**\n * Updates an earning rule.\n *\n * Supports partial updates.\n *\n * Revision number, which increments by 1 each time the earning rule is updated. To prevent conflicting changes,\n * the current `revision` must be passed when updating the earning rule.\n * @param - Loyalty earning rule ID.\n */\n (_id: string, earningRule: UpdateLoyaltyEarningRule): Promise<\n NonNullablePaths<\n UpdateLoyaltyEarningRuleResponse,\n | `earningRule.fixedAmount.configs`\n | `earningRule.fixedAmount.configs.${number}.points`\n | `earningRule.conversionRate.configs`\n | `earningRule.conversionRate.configs.${number}.moneyAmount`\n | `earningRule.conversionRate.configs.${number}.points`\n | `earningRule.sourceAppId`\n | `earningRule.triggerAppId`\n | `earningRule.triggerActivityType`\n | `earningRule.title`\n | `earningRule.status`\n | `earningRule.metadata.canBeDeleted`,\n 6\n >\n >;\n}\n\nexport function deleteLoyaltyEarningRule(\n httpClient: HttpClient\n): DeleteLoyaltyEarningRuleSignature {\n return (_id: string, options?: DeleteLoyaltyEarningRuleOptions) =>\n universalDeleteLoyaltyEarningRule(\n _id,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteLoyaltyEarningRuleSignature {\n /**\n * Deletes a non-automated earning rule.\n *\n * To delete an automated earning rule, call\n * Delete Automation Earning Rule.\n *\n * To update an earning rule's status instead of deleting it, call\n * Update Loyalty Earning Rule.\n * @param - ID of the earning rule to delete.\n */\n (_id: string, options?: DeleteLoyaltyEarningRuleOptions): Promise<void>;\n}\n\nexport function deleteAutomationEarningRule(\n httpClient: HttpClient\n): DeleteAutomationEarningRuleSignature {\n return (_id: string) =>\n universalDeleteAutomationEarningRule(\n _id,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteAutomationEarningRuleSignature {\n /**\n * Deletes a custom automated earning rule.\n * Pre-installed automated rules can only be paused, not deleted.\n *\n * To update an earning rule's status instead of deleting it, call\n * Update Loyalty Earning Rule.\n *\n * To delete a non-automated earning rule, call\n * Delete Loyalty Earning Rule.\n * @param - ID of the earning rule to delete.\n */\n (_id: string): Promise<void>;\n}\n\nexport function listEarningRules(\n httpClient: HttpClient\n): ListEarningRulesSignature {\n return (options?: ListEarningRulesOptions) =>\n universalListEarningRules(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListEarningRulesSignature {\n /**\n * Retrieves a list of earning rules.\n *\n * Returns both automated and non-automated earning rules.\n *\n * You can filter the results by `triggerAppId` or `triggerActivityType`.\n */\n (options?: ListEarningRulesOptions): Promise<\n NonNullablePaths<\n ListEarningRulesResponse,\n | `earningRules`\n | `earningRules.${number}.sourceAppId`\n | `earningRules.${number}.triggerAppId`\n | `earningRules.${number}.triggerActivityType`\n | `earningRules.${number}.title`\n | `earningRules.${number}.status`\n | `earningRules.${number}.metadata.canBeDeleted`,\n 5\n >\n >;\n}\n\nexport const onLoyaltyEarningRuleCreated = EventDefinition(\n 'wix.loyalty.v1.loyalty_earning_rule_created',\n true,\n (event: LoyaltyEarningRuleCreatedEnvelope) =>\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)<LoyaltyEarningRuleCreatedEnvelope>();\nexport const onLoyaltyEarningRuleDeleted = EventDefinition(\n 'wix.loyalty.v1.loyalty_earning_rule_deleted',\n true,\n (event: LoyaltyEarningRuleDeletedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'undefined.createdDate' },\n { path: 'undefined.updatedDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<LoyaltyEarningRuleDeletedEnvelope>();\nexport const onLoyaltyEarningRuleUpdated = EventDefinition(\n 'wix.loyalty.v1.loyalty_earning_rule_updated',\n true,\n (event: LoyaltyEarningRuleUpdatedEnvelope) =>\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)<LoyaltyEarningRuleUpdatedEnvelope>();\n\nexport {\n ActionEvent,\n AppInstallationInLoyaltySite,\n ApplicationError,\n BaseEventMetadata,\n BulkActionMetadata,\n BulkCreateLoyaltyEarningRulesRequest,\n BulkCreateLoyaltyEarningRulesResponse,\n BulkLoyaltyEarningRuleResult,\n CacheInvalidated,\n ConversionRate,\n ConversionRateConfig,\n CreateCustomLoyaltyEarningRuleOptions,\n CreateCustomLoyaltyEarningRuleRequest,\n CreateCustomLoyaltyEarningRuleResponse,\n CreateLoyaltyEarningRuleRequest,\n CreateLoyaltyEarningRuleResponse,\n CursorPaging,\n Cursors,\n CustomLoyaltyEarningRule,\n CustomLoyaltyEarningRuleTypeOneOf,\n DeleteAutomationEarningRuleRequest,\n DeleteAutomationEarningRuleResponse,\n DeleteLoyaltyEarningRuleOptions,\n DeleteLoyaltyEarningRuleRequest,\n DeleteLoyaltyEarningRuleResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EarningRuleDisabled,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n FixedAmount,\n FixedAmountConfig,\n GetLoyaltyEarningRuleRequest,\n GetLoyaltyEarningRuleResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n InvalidateEarningRuleCacheRequest,\n InvalidateEarningRuleCacheResponse,\n ItemMetadata,\n ListEarningRulesInTierRequest,\n ListEarningRulesInTierResponse,\n ListEarningRulesOptions,\n ListEarningRulesRequest,\n ListEarningRulesResponse,\n LoyaltyEarningRule,\n LoyaltyEarningRuleCreatedEnvelope,\n LoyaltyEarningRuleDeletedEnvelope,\n LoyaltyEarningRuleTypeOneOf,\n LoyaltyEarningRuleTypeTag,\n LoyaltyEarningRuleTypeTagType,\n LoyaltyEarningRuleUpdatedEnvelope,\n MessageEnvelope,\n Metadata,\n PagingMetadataV2,\n RestoreInfo,\n Status,\n Type,\n UpdateLoyaltyEarningRule,\n UpdateLoyaltyEarningRuleRequest,\n UpdateLoyaltyEarningRuleResponse,\n V1Type,\n WebhookIdentityType,\n} from './loyalty-v1-loyalty-earning-rule-earning-rules.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixLoyaltyV1LoyaltyEarningRule from './loyalty-v1-loyalty-earning-rule-earning-rules.http.js';\n\n/**\n * A loyalty earning rule defines how customers earn points in a loyalty program.\n * You can create rules for different activities, such as making purchases.\n */\nexport interface LoyaltyEarningRule extends LoyaltyEarningRuleTypeOneOf {\n /** Fixed amount of points awarded for each qualifying activity. */\n fixedAmount?: FixedAmount;\n /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */\n conversionRate?: ConversionRate;\n /**\n * Loyalty earning rule ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * ID of the app managing the earning rule. Can be a loyalty app ID or a Wix automations app ID.\n * @format GUID\n */\n sourceAppId?: string;\n /**\n * ID of the app that triggers point assignment. Examples: Wix Stores, Wix Bookings, Wix Events.\n * @minLength 1\n * @maxLength 80\n */\n triggerAppId?: string;\n /**\n * Type of activity that triggers point assignment. For example, `wix-restaurants/orderSubmitted` or `birthday`.\n * @minLength 1\n * @maxLength 80\n */\n triggerActivityType?: string;\n /**\n * Name of the earning rule.\n * @minLength 1\n * @maxLength 50\n */\n title?: string;\n /** Current status of the earning rule. */\n status?: StatusWithLiterals;\n /**\n * Revision number, incremented by 1 each time the earning rule is updated.\n * Pass the latest `revision` when updating to prevent conflicting changes.\n */\n revision?: string | null;\n /**\n * Date and time the earning rule was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the earning rule was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * Additional metadata about the earning rule.\n * @readonly\n */\n metadata?: Metadata;\n}\n\n/** @oneof */\nexport interface LoyaltyEarningRuleTypeOneOf {\n /** Fixed amount of points awarded for each qualifying activity. */\n fixedAmount?: FixedAmount;\n /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */\n conversionRate?: ConversionRate;\n}\n\n/** Fixed amount type of earning rule. */\nexport interface FixedAmount {\n /**\n * Fixed amount configurations for each tier.\n * @maxSize 21\n */\n configs?: FixedAmountConfig[];\n}\n\nexport interface FixedAmountConfig {\n /**\n * Tier ID. If empty, the base tier is used. See the Tiers API for more information.\n * @format GUID\n * @readonly\n */\n tierId?: string | null;\n /** Number of points to award. */\n points?: number;\n}\n\n/**\n * Conversion rate type of earning rule.\n * Customers earn points based on the amount spent.\n * For example, for every $10 spent, a customer might earn 1 point.\n */\nexport interface ConversionRate {\n /**\n * Conversion rate configurations for each tier.\n *\n * Points are awarded proportionally to the amount spent.\n *\n * Formula: `(amount spent) / (money_amount * points)`.\n * @maxSize 21\n */\n configs?: ConversionRateConfig[];\n /**\n * Specifies which field in the Wix automations trigger payload [REST](https://dev.wix.com/docs/rest/business-management/automations/introduction#how-do-automations-work)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/automations/triggered-events/reporting-and-canceling-events) to use for calculating points in conversion rate rules.\n * For example, if set to \"priceSummary.totalAmount\", the rule uses the total order amount to calculate loyalty points to be awarded.\n * This field is only applicable for automated earning rules.\n */\n field?: string | null;\n}\n\nexport interface ConversionRateConfig {\n /**\n * Tier ID. If empty, the base tier is used. See the Tiers API for more information.\n * @format GUID\n * @readonly\n */\n tierId?: string | null;\n /**\n * The amount of money used as a reference for point calculation.\n * Points are awarded proportionally to the amount spent.\n *\n * For example, if set to 10, 1 point is awarded for every 10 units of currency spent (assuming `points` is set to 1).\n *\n * Formula for points is: `(amount spent) / (money_amount * points)`.\n */\n moneyAmount?: number;\n /**\n * Points given for the specified `money_amount`.\n * Works in conjunction with `money_amount` to define the earning rule.\n *\n * For example: If `money_amount` is 20 and `points` is 10:\n * - Spending 10 units of currency earns 5 points\n * - Spending 20 units of currency earns 10 points\n * - Spending 30 units of currency earns 15 points\n */\n points?: number;\n}\n\nexport enum Status {\n /** Status is unknown or not specified. */\n UNKNOWN = 'UNKNOWN',\n /** Earning rule is active and can assign points. */\n ACTIVE = 'ACTIVE',\n /** Earning rule is paused and can't assign points. */\n PAUSED = 'PAUSED',\n}\n\n/** @enumType */\nexport type StatusWithLiterals = Status | 'UNKNOWN' | 'ACTIVE' | 'PAUSED';\n\nexport interface Metadata {\n /** Whether the earning rule can be deleted. */\n canBeDeleted?: boolean;\n /**\n * Information about the type of custom earning rule.\n * @internal\n */\n ruleTypeTag?: LoyaltyEarningRuleTypeTag;\n}\n\nexport interface LoyaltyEarningRuleTypeTag {\n /** Type of custom earning rule. */\n ruleType?: LoyaltyEarningRuleTypeTagTypeWithLiterals;\n}\n\nexport enum LoyaltyEarningRuleTypeTagType {\n /** Type is unknown or not specified. */\n UNKNOWN_TYPE = 'UNKNOWN_TYPE',\n /** Earning rule for a customer's birthday. */\n BIRTHDAY = 'BIRTHDAY',\n}\n\n/** @enumType */\nexport type LoyaltyEarningRuleTypeTagTypeWithLiterals =\n | LoyaltyEarningRuleTypeTagType\n | 'UNKNOWN_TYPE'\n | 'BIRTHDAY';\n\nexport interface CacheInvalidated {}\n\nexport interface EarningRuleDisabled {}\n\nexport interface CreateLoyaltyEarningRuleRequest {\n /** Earning rule to create. */\n earningRule: LoyaltyEarningRule;\n}\n\nexport interface CreateLoyaltyEarningRuleResponse {\n /** Created earning rule. */\n earningRule?: LoyaltyEarningRule;\n}\n\nexport interface BulkCreateLoyaltyEarningRulesRequest {\n /**\n * Earning rules to create.\n * @minSize 1\n * @maxSize 100\n */\n earningRules: LoyaltyEarningRule[];\n}\n\nexport interface BulkCreateLoyaltyEarningRulesResponse {\n /** Created earning rules. */\n results?: BulkLoyaltyEarningRuleResult[];\n /** Additional metadata for the created earning rules. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface BulkLoyaltyEarningRuleResult {\n /** Additional metadata for the created earning rules. */\n itemMetadata?: ItemMetadata;\n /** Created earning rule. */\n item?: LoyaltyEarningRule;\n}\n\nexport interface ItemMetadata {\n /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */\n _id?: string | null;\n /** Index of the item within the request array. Allows for correlation between request and response items. */\n originalIndex?: number;\n /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */\n success?: boolean;\n /** Details about the error in case of failure. */\n error?: ApplicationError;\n}\n\nexport interface ApplicationError {\n /** Error code. */\n code?: string;\n /** Description of the error. */\n description?: string;\n /** Data related to the error. */\n data?: Record<string, any> | null;\n}\n\nexport interface BulkActionMetadata {\n /** Number of items that were successfully processed. */\n totalSuccesses?: number;\n /** Number of items that couldn't be processed. */\n totalFailures?: number;\n /** Number of failures without details because detailed failure threshold was exceeded. */\n undetailedFailures?: number;\n}\n\nexport interface CreateCustomLoyaltyEarningRuleRequest {\n /** Type of the custom earning rule. */\n type: TypeWithLiterals;\n /** Custom earning rule to create. */\n earningRule?: CustomLoyaltyEarningRule;\n}\n\nexport enum Type {\n /** Unknown type. This value is not used. */\n UNKNOWN_TYPE = 'UNKNOWN_TYPE',\n /** Earning rule for social media. */\n SOCIAL_MEDIA = 'SOCIAL_MEDIA',\n /** Earning rule for birthdays. */\n BIRTHDAY = 'BIRTHDAY',\n}\n\n/** @enumType */\nexport type TypeWithLiterals =\n | Type\n | 'UNKNOWN_TYPE'\n | 'SOCIAL_MEDIA'\n | 'BIRTHDAY';\n\n/** Used in CreateCustomLoyaltyEarningRuleRequest */\nexport interface CustomLoyaltyEarningRule\n extends CustomLoyaltyEarningRuleTypeOneOf {\n /** Fixed amount of points awarded for each qualifying activity. */\n fixedAmount?: FixedAmount;\n /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */\n conversionRate?: ConversionRate;\n /**\n * Name of the earning rule.\n * @minLength 1\n * @maxLength 50\n */\n title?: string;\n}\n\n/** @oneof */\nexport interface CustomLoyaltyEarningRuleTypeOneOf {\n /** Fixed amount of points awarded for each qualifying activity. */\n fixedAmount?: FixedAmount;\n /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */\n conversionRate?: ConversionRate;\n}\n\nexport interface CreateCustomLoyaltyEarningRuleResponse {\n /** Created earning rule. */\n earningRule?: LoyaltyEarningRule;\n}\n\nexport interface GetLoyaltyEarningRuleRequest {\n /**\n * ID of the earning rule to retrieve.\n * @format GUID\n */\n _id: string;\n}\n\nexport interface GetLoyaltyEarningRuleResponse {\n /** Retrieved earning rule. */\n earningRule?: LoyaltyEarningRule;\n}\n\nexport interface UpdateLoyaltyEarningRuleRequest {\n /** Earning rule to update. */\n earningRule: LoyaltyEarningRule;\n}\n\nexport interface UpdateLoyaltyEarningRuleResponse {\n /** The updated earning rule. */\n earningRule?: LoyaltyEarningRule;\n}\n\nexport interface DeleteLoyaltyEarningRuleRequest {\n /**\n * ID of the earning rule to delete.\n * @format GUID\n */\n _id: string;\n /**\n * Revision of the earning rule. Incremented by 1 each time the earning rule is updated.\n * Pass the latest `revision` when updating to prevent conflicting changes.\n */\n revision?: string;\n}\n\nexport interface DeleteLoyaltyEarningRuleResponse {}\n\nexport interface DeleteAutomationEarningRuleRequest {\n /**\n * ID of the earning rule to delete.\n * @format GUID\n */\n _id: string;\n}\n\nexport interface DeleteAutomationEarningRuleResponse {}\n\nexport interface ListEarningRulesRequest {\n /** App ID that triggers the point assignment. For example, `9a5d83fd-8570-482e-81ab-cfa88942ee60`. */\n triggerAppId?: string | null;\n /** Type of activity that triggers the point assignment. For example, `restaurants-order-is-pending`. */\n triggerActivityType?: string | null;\n}\n\nexport interface ListEarningRulesResponse {\n /** Retrieved earning rules. */\n earningRules?: LoyaltyEarningRule[];\n}\n\nexport interface ListEarningRulesInTierRequest {\n /**\n * ID of the tier for which the earning rules will be returned.\n * @format GUID\n */\n tierId?: string | null;\n /** Pagination options. */\n paging?: CursorPaging;\n}\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 ListEarningRulesInTierResponse {\n /** Retrieved earning rules. */\n earningRules?: LoyaltyEarningRule[];\n /** Details on the paged set of results returned. */\n pagingMetadata?: PagingMetadataV2;\n}\n\nexport interface PagingMetadataV2 {\n /** Number of items returned in the response. */\n count?: number | null;\n /** Offset that was requested. */\n offset?: number | null;\n /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */\n total?: number | null;\n /** Flag that indicates the server failed to calculate the `total` field. */\n tooManyToCount?: boolean | null;\n /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */\n cursors?: Cursors;\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 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 InvalidateEarningRuleCacheRequest {}\n\nexport interface InvalidateEarningRuleCacheResponse {}\n\nexport interface AppInstallationInLoyaltySite {\n /** @format GUID */\n appDefId?: string;\n type?: V1TypeWithLiterals;\n}\n\nexport enum V1Type {\n UNSPECIFIED = 'UNSPECIFIED',\n INSTALLED = 'INSTALLED',\n DELETED = 'DELETED',\n}\n\n/** @enumType */\nexport type V1TypeWithLiterals =\n | V1Type\n | 'UNSPECIFIED'\n | 'INSTALLED'\n | 'DELETED';\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 LoyaltyEarningRuleCreatedEnvelope {\n entity: LoyaltyEarningRule;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when an earning rule is created.\n * @permissionScope Read Loyalty\n * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY\n * @permissionScope Manage Loyalty\n * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionId LOYALTY.READ_EARNING_RULES\n * @webhook\n * @eventType wix.loyalty.v1.loyalty_earning_rule_created\n * @slug created\n */\nexport declare function onLoyaltyEarningRuleCreated(\n handler: (event: LoyaltyEarningRuleCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface LoyaltyEarningRuleDeletedEnvelope {\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when an earning rule is deleted.\n * @permissionScope Read Loyalty\n * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY\n * @permissionScope Manage Loyalty\n * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionId LOYALTY.READ_EARNING_RULES\n * @webhook\n * @eventType wix.loyalty.v1.loyalty_earning_rule_deleted\n * @slug deleted\n */\nexport declare function onLoyaltyEarningRuleDeleted(\n handler: (event: LoyaltyEarningRuleDeletedEnvelope) => void | Promise<void>\n): void;\n\nexport interface LoyaltyEarningRuleUpdatedEnvelope {\n entity: LoyaltyEarningRule;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when an earning rule is updated.\n * @permissionScope Read Loyalty\n * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY\n * @permissionScope Manage Loyalty\n * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionId LOYALTY.READ_EARNING_RULES\n * @webhook\n * @eventType wix.loyalty.v1.loyalty_earning_rule_updated\n * @slug updated\n */\nexport declare function onLoyaltyEarningRuleUpdated(\n handler: (event: LoyaltyEarningRuleUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates a non-automated earning rule.\n *\n * >**Note**: You can only create non-automated earning rules from a supported list.\n * For the supported list of services, see the Introduction.\n * @param earningRule - Earning rule to create.\n * @public\n * @requiredField earningRule\n * @requiredField earningRule.sourceAppId\n * @requiredField earningRule.status\n * @requiredField earningRule.title\n * @requiredField earningRule.triggerActivityType\n * @requiredField earningRule.triggerAppId\n * @permissionId LOYALTY.MANAGE_EARNING_RULES\n * @applicableIdentity APP\n * @returns Created earning rule.\n * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.CreateLoyaltyEarningRule\n */\nexport async function createLoyaltyEarningRule(\n earningRule: NonNullablePaths<\n LoyaltyEarningRule,\n `sourceAppId` | `status` | `title` | `triggerActivityType` | `triggerAppId`,\n 2\n >\n): Promise<\n NonNullablePaths<\n LoyaltyEarningRule,\n | `fixedAmount.configs`\n | `fixedAmount.configs.${number}.points`\n | `conversionRate.configs`\n | `conversionRate.configs.${number}.moneyAmount`\n | `conversionRate.configs.${number}.points`\n | `sourceAppId`\n | `triggerAppId`\n | `triggerActivityType`\n | `title`\n | `status`\n | `metadata.canBeDeleted`,\n 5\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 earningRule: earningRule,\n });\n\n const reqOpts =\n ambassadorWixLoyaltyV1LoyaltyEarningRule.createLoyaltyEarningRule(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.earningRule!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { earningRule: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['earningRule']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates multiple non-automated earning rules.\n *\n * >**Note**: You can only create non-automated earning rules from a supported list.\n * For the supported list of services, see the Introduction.\n * @param earningRules - Earning rules to create.\n * @public\n * @requiredField earningRules\n * @requiredField earningRules.sourceAppId\n * @requiredField earningRules.status\n * @requiredField earningRules.title\n * @requiredField earningRules.triggerActivityType\n * @requiredField earningRules.triggerAppId\n * @permissionId LOYALTY.MANAGE_EARNING_RULES\n * @applicableIdentity APP\n * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.BulkCreateLoyaltyEarningRules\n */\nexport async function bulkCreateLoyaltyEarningRules(\n earningRules: NonNullablePaths<\n LoyaltyEarningRule,\n `sourceAppId` | `status` | `title` | `triggerActivityType` | `triggerAppId`,\n 2\n >[]\n): Promise<\n NonNullablePaths<\n BulkCreateLoyaltyEarningRulesResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `results.${number}.item.sourceAppId`\n | `results.${number}.item.triggerAppId`\n | `results.${number}.item.triggerActivityType`\n | `results.${number}.item.title`\n | `results.${number}.item.status`\n | `results.${number}.item.metadata.canBeDeleted`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\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 earningRules: earningRules,\n });\n\n const reqOpts =\n ambassadorWixLoyaltyV1LoyaltyEarningRule.bulkCreateLoyaltyEarningRules(\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: { earningRules: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['earningRules']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates a custom automated earning rule.\n *\n * To learn more about the automated rules, see the Introduction.\n * @param type - Type of the custom earning rule.\n * @public\n * @requiredField type\n * @permissionId LOYALTY.MANAGE_EARNING_RULES\n * @applicableIdentity APP\n * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.CreateCustomLoyaltyEarningRule\n */\nexport async function createCustomLoyaltyEarningRule(\n type: TypeWithLiterals,\n options?: CreateCustomLoyaltyEarningRuleOptions\n): Promise<\n NonNullablePaths<\n CreateCustomLoyaltyEarningRuleResponse,\n | `earningRule.fixedAmount.configs`\n | `earningRule.fixedAmount.configs.${number}.points`\n | `earningRule.conversionRate.configs`\n | `earningRule.conversionRate.configs.${number}.moneyAmount`\n | `earningRule.conversionRate.configs.${number}.points`\n | `earningRule.sourceAppId`\n | `earningRule.triggerAppId`\n | `earningRule.triggerActivityType`\n | `earningRule.title`\n | `earningRule.status`\n | `earningRule.metadata.canBeDeleted`,\n 6\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 type: type,\n earningRule: options?.earningRule,\n });\n\n const reqOpts =\n ambassadorWixLoyaltyV1LoyaltyEarningRule.createCustomLoyaltyEarningRule(\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 type: '$[0]',\n earningRule: '$[1].earningRule',\n },\n singleArgumentUnchanged: false,\n },\n ['type', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface CreateCustomLoyaltyEarningRuleOptions {\n /** Custom earning rule to create. */\n earningRule?: CustomLoyaltyEarningRule;\n}\n\n/**\n * Retrieves a specified non-automated earning rule.\n *\n * To retrieve both automated and non-automated earning rules, call List Earning Rules.\n * @param _id - ID of the earning rule to retrieve.\n * @public\n * @requiredField _id\n * @permissionId LOYALTY.READ_EARNING_RULES\n * @applicableIdentity APP\n * @returns Retrieved earning rule.\n * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.GetLoyaltyEarningRule\n */\nexport async function getLoyaltyEarningRule(\n _id: string\n): Promise<\n NonNullablePaths<\n LoyaltyEarningRule,\n | `fixedAmount.configs`\n | `fixedAmount.configs.${number}.points`\n | `conversionRate.configs`\n | `conversionRate.configs.${number}.moneyAmount`\n | `conversionRate.configs.${number}.points`\n | `sourceAppId`\n | `triggerAppId`\n | `triggerActivityType`\n | `title`\n | `status`\n | `metadata.canBeDeleted`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });\n\n const reqOpts =\n ambassadorWixLoyaltyV1LoyaltyEarningRule.getLoyaltyEarningRule(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.earningRule!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { id: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates an earning rule.\n *\n * Supports partial updates.\n *\n * Revision number, which increments by 1 each time the earning rule is updated. To prevent conflicting changes,\n * the current `revision` must be passed when updating the earning rule.\n * @param _id - Loyalty earning rule ID.\n * @public\n * @requiredField _id\n * @requiredField earningRule\n * @permissionId LOYALTY.MANAGE_EARNING_RULES\n * @applicableIdentity APP\n * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.UpdateLoyaltyEarningRule\n */\nexport async function updateLoyaltyEarningRule(\n _id: string,\n earningRule: UpdateLoyaltyEarningRule\n): Promise<\n NonNullablePaths<\n UpdateLoyaltyEarningRuleResponse,\n | `earningRule.fixedAmount.configs`\n | `earningRule.fixedAmount.configs.${number}.points`\n | `earningRule.conversionRate.configs`\n | `earningRule.conversionRate.configs.${number}.moneyAmount`\n | `earningRule.conversionRate.configs.${number}.points`\n | `earningRule.sourceAppId`\n | `earningRule.triggerAppId`\n | `earningRule.triggerActivityType`\n | `earningRule.title`\n | `earningRule.status`\n | `earningRule.metadata.canBeDeleted`,\n 6\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 earningRule: { ...earningRule, id: _id },\n });\n\n const reqOpts =\n ambassadorWixLoyaltyV1LoyaltyEarningRule.updateLoyaltyEarningRule(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: { earningRule: '$[1]' },\n explicitPathsToArguments: { 'earningRule.id': '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'earningRule']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateLoyaltyEarningRule {\n /** Fixed amount of points awarded for each qualifying activity. */\n fixedAmount?: FixedAmount;\n /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */\n conversionRate?: ConversionRate;\n /**\n * Loyalty earning rule ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * ID of the app managing the earning rule. Can be a loyalty app ID or a Wix automations app ID.\n * @format GUID\n */\n sourceAppId?: string;\n /**\n * ID of the app that triggers point assignment. Examples: Wix Stores, Wix Bookings, Wix Events.\n * @minLength 1\n * @maxLength 80\n */\n triggerAppId?: string;\n /**\n * Type of activity that triggers point assignment. For example, `wix-restaurants/orderSubmitted` or `birthday`.\n * @minLength 1\n * @maxLength 80\n */\n triggerActivityType?: string;\n /**\n * Name of the earning rule.\n * @minLength 1\n * @maxLength 50\n */\n title?: string;\n /** Current status of the earning rule. */\n status?: StatusWithLiterals;\n /**\n * Revision number, incremented by 1 each time the earning rule is updated.\n * Pass the latest `revision` when updating to prevent conflicting changes.\n */\n revision?: string | null;\n /**\n * Date and time the earning rule was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the earning rule was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * Additional metadata about the earning rule.\n * @readonly\n */\n metadata?: Metadata;\n}\n\n/**\n * Deletes a non-automated earning rule.\n *\n * To delete an automated earning rule, call\n * Delete Automation Earning Rule.\n *\n * To update an earning rule's status instead of deleting it, call\n * Update Loyalty Earning Rule.\n * @param _id - ID of the earning rule to delete.\n * @public\n * @requiredField _id\n * @permissionId LOYALTY.MANAGE_EARNING_RULES\n * @applicableIdentity APP\n * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.DeleteLoyaltyEarningRule\n */\nexport async function deleteLoyaltyEarningRule(\n _id: string,\n options?: DeleteLoyaltyEarningRuleOptions\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n id: _id,\n revision: options?.revision,\n });\n\n const reqOpts =\n ambassadorWixLoyaltyV1LoyaltyEarningRule.deleteLoyaltyEarningRule(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { id: '$[0]', revision: '$[1].revision' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface DeleteLoyaltyEarningRuleOptions {\n /**\n * Revision of the earning rule. Incremented by 1 each time the earning rule is updated.\n * Pass the latest `revision` when updating to prevent conflicting changes.\n */\n revision?: string;\n}\n\n/**\n * Deletes a custom automated earning rule.\n * Pre-installed automated rules can only be paused, not deleted.\n *\n * To update an earning rule's status instead of deleting it, call\n * Update Loyalty Earning Rule.\n *\n * To delete a non-automated earning rule, call\n * Delete Loyalty Earning Rule.\n * @param _id - ID of the earning rule to delete.\n * @public\n * @requiredField _id\n * @permissionId LOYALTY.MANAGE_EARNING_RULES\n * @applicableIdentity APP\n * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.DeleteAutomationEarningRule\n */\nexport async function deleteAutomationEarningRule(_id: string): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });\n\n const reqOpts =\n ambassadorWixLoyaltyV1LoyaltyEarningRule.deleteAutomationEarningRule(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { id: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a list of earning rules.\n *\n * Returns both automated and non-automated earning rules.\n *\n * You can filter the results by `triggerAppId` or `triggerActivityType`.\n * @public\n * @permissionId LOYALTY.READ_EARNING_RULES\n * @applicableIdentity APP\n * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.ListEarningRules\n */\nexport async function listEarningRules(\n options?: ListEarningRulesOptions\n): Promise<\n NonNullablePaths<\n ListEarningRulesResponse,\n | `earningRules`\n | `earningRules.${number}.sourceAppId`\n | `earningRules.${number}.triggerAppId`\n | `earningRules.${number}.triggerActivityType`\n | `earningRules.${number}.title`\n | `earningRules.${number}.status`\n | `earningRules.${number}.metadata.canBeDeleted`,\n 5\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 triggerAppId: options?.triggerAppId,\n triggerActivityType: options?.triggerActivityType,\n });\n\n const reqOpts =\n ambassadorWixLoyaltyV1LoyaltyEarningRule.listEarningRules(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 triggerAppId: '$[0].triggerAppId',\n triggerActivityType: '$[0].triggerActivityType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListEarningRulesOptions {\n /** App ID that triggers the point assignment. For example, `9a5d83fd-8570-482e-81ab-cfa88942ee60`. */\n triggerAppId?: string | null;\n /** Type of activity that triggers the point assignment. For example, `restaurants-order-is-pending`. */\n triggerActivityType?: string | null;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\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 resolveComWixpressLoyaltyEarningruleLoyaltyEarningRulesUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/loyalty-earning-rules',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/loyalty-earning-rules',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/loyalty-earning-rules',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/loyalty-earning-rules',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/loyalty-earning-rules',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/_api/loyalty-earning-rules',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/loyalty-earning-rules',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/loyalty-earning-rules',\n destPath: '',\n },\n ],\n '*.pub.wix-code.com': [\n {\n srcPath: '/_api/loyalty-earning-rules',\n destPath: '',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/loyalty-earning-rules',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/_api/loyalty-earning-rules',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_loyalty_earning-rules';\n\n/**\n * Creates a non-automated earning rule.\n *\n * >**Note**: You can only create non-automated earning rules from a supported list.\n * For the supported list of services, see the Introduction.\n */\nexport function createLoyaltyEarningRule(\n payload: object\n): RequestOptionsFactory<any> {\n function __createLoyaltyEarningRule({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'earningRule.createdDate' },\n { path: 'earningRule.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.loyalty.v1.loyalty_earning_rule',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.loyalty.earningrule.LoyaltyEarningRules.CreateLoyaltyEarningRule',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressLoyaltyEarningruleLoyaltyEarningRulesUrl({\n protoPath: '/v1/earning-rules',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'earningRule.createdDate' },\n { path: 'earningRule.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createLoyaltyEarningRule;\n}\n\n/**\n * Creates multiple non-automated earning rules.\n *\n * >**Note**: You can only create non-automated earning rules from a supported list.\n * For the supported list of services, see the Introduction.\n */\nexport function bulkCreateLoyaltyEarningRules(\n payload: object\n): RequestOptionsFactory<any> {\n function __bulkCreateLoyaltyEarningRules({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'earningRules.createdDate' },\n { path: 'earningRules.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.loyalty.v1.loyalty_earning_rule',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.loyalty.earningrule.LoyaltyEarningRules.BulkCreateLoyaltyEarningRules',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressLoyaltyEarningruleLoyaltyEarningRulesUrl({\n protoPath: '/v1/bulk/earning-rules/create',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'results.item.createdDate' },\n { path: 'results.item.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __bulkCreateLoyaltyEarningRules;\n}\n\n/**\n * Creates a custom automated earning rule.\n *\n * To learn more about the automated rules, see the Introduction.\n */\nexport function createCustomLoyaltyEarningRule(\n payload: object\n): RequestOptionsFactory<any> {\n function __createCustomLoyaltyEarningRule({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.v1.loyalty_earning_rule',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.loyalty.earningrule.LoyaltyEarningRules.CreateCustomLoyaltyEarningRule',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressLoyaltyEarningruleLoyaltyEarningRulesUrl({\n protoPath: '/v1/earning-rules/custom',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'earningRule.createdDate' },\n { path: 'earningRule.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createCustomLoyaltyEarningRule;\n}\n\n/**\n * Retrieves a specified non-automated earning rule.\n *\n * To retrieve both automated and non-automated earning rules, call List Earning Rules.\n */\nexport function getLoyaltyEarningRule(\n payload: object\n): RequestOptionsFactory<any> {\n function __getLoyaltyEarningRule({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.v1.loyalty_earning_rule',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.loyalty.earningrule.LoyaltyEarningRules.GetLoyaltyEarningRule',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressLoyaltyEarningruleLoyaltyEarningRulesUrl({\n protoPath: '/v1/earning-rules/{id}',\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: 'earningRule.createdDate' },\n { path: 'earningRule.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getLoyaltyEarningRule;\n}\n\n/**\n * Updates an earning rule.\n *\n * Supports partial updates.\n *\n * Revision number, which increments by 1 each time the earning rule is updated. To prevent conflicting changes,\n * the current `revision` must be passed when updating the earning rule.\n */\nexport function updateLoyaltyEarningRule(\n payload: object\n): RequestOptionsFactory<any> {\n function __updateLoyaltyEarningRule({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'earningRule.createdDate' },\n { path: 'earningRule.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.loyalty.v1.loyalty_earning_rule',\n method: 'PUT' as any,\n methodFqn:\n 'com.wixpress.loyalty.earningrule.LoyaltyEarningRules.UpdateLoyaltyEarningRule',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressLoyaltyEarningruleLoyaltyEarningRulesUrl({\n protoPath: '/v1/earning-rules/{earningRule.id}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'earningRule.createdDate' },\n { path: 'earningRule.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateLoyaltyEarningRule;\n}\n\n/**\n * Deletes a non-automated earning rule.\n *\n * To delete an automated earning rule, call\n * Delete Automation Earning Rule.\n *\n * To update an earning rule's status instead of deleting it, call\n * Update Loyalty Earning Rule.\n */\nexport function deleteLoyaltyEarningRule(\n payload: object\n): RequestOptionsFactory<any> {\n function __deleteLoyaltyEarningRule({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.v1.loyalty_earning_rule',\n method: 'DELETE' as any,\n methodFqn:\n 'com.wixpress.loyalty.earningrule.LoyaltyEarningRules.DeleteLoyaltyEarningRule',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressLoyaltyEarningruleLoyaltyEarningRulesUrl({\n protoPath: '/v1/earning-rules/{id}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteLoyaltyEarningRule;\n}\n\n/**\n * Deletes a custom automated earning rule.\n * Pre-installed automated rules can only be paused, not deleted.\n *\n * To update an earning rule's status instead of deleting it, call\n * Update Loyalty Earning Rule.\n *\n * To delete a non-automated earning rule, call\n * Delete Loyalty Earning Rule.\n */\nexport function deleteAutomationEarningRule(\n payload: object\n): RequestOptionsFactory<any> {\n function __deleteAutomationEarningRule({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.v1.loyalty_earning_rule',\n method: 'DELETE' as any,\n methodFqn:\n 'com.wixpress.loyalty.earningrule.LoyaltyEarningRules.DeleteAutomationEarningRule',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressLoyaltyEarningruleLoyaltyEarningRulesUrl({\n protoPath: '/v1/automation-earning-rules/{id}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteAutomationEarningRule;\n}\n\n/**\n * Retrieves a list of earning rules.\n *\n * Returns both automated and non-automated earning rules.\n *\n * You can filter the results by `triggerAppId` or `triggerActivityType`.\n */\nexport function listEarningRules(payload: object): RequestOptionsFactory<any> {\n function __listEarningRules({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.v1.loyalty_earning_rule',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.loyalty.earningrule.LoyaltyEarningRules.ListEarningRules',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressLoyaltyEarningruleLoyaltyEarningRulesUrl({\n protoPath: '/v1/earning-rules/rules',\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: 'earningRules.createdDate' },\n { path: 'earningRules.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listEarningRules;\n}\n","import {\n createLoyaltyEarningRule as publicCreateLoyaltyEarningRule,\n bulkCreateLoyaltyEarningRules as publicBulkCreateLoyaltyEarningRules,\n createCustomLoyaltyEarningRule as publicCreateCustomLoyaltyEarningRule,\n getLoyaltyEarningRule as publicGetLoyaltyEarningRule,\n updateLoyaltyEarningRule as publicUpdateLoyaltyEarningRule,\n deleteLoyaltyEarningRule as publicDeleteLoyaltyEarningRule,\n deleteAutomationEarningRule as publicDeleteAutomationEarningRule,\n listEarningRules as publicListEarningRules,\n} from './loyalty-v1-loyalty-earning-rule-earning-rules.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 { onLoyaltyEarningRuleCreated as publicOnLoyaltyEarningRuleCreated } from './loyalty-v1-loyalty-earning-rule-earning-rules.public.js';\nimport { onLoyaltyEarningRuleDeleted as publicOnLoyaltyEarningRuleDeleted } from './loyalty-v1-loyalty-earning-rule-earning-rules.public.js';\nimport { onLoyaltyEarningRuleUpdated as publicOnLoyaltyEarningRuleUpdated } from './loyalty-v1-loyalty-earning-rule-earning-rules.public.js';\n\nexport const createLoyaltyEarningRule: MaybeContext<\n BuildRESTFunction<typeof publicCreateLoyaltyEarningRule> &\n typeof publicCreateLoyaltyEarningRule\n> = /*#__PURE__*/ createRESTModule(publicCreateLoyaltyEarningRule);\nexport const bulkCreateLoyaltyEarningRules: MaybeContext<\n BuildRESTFunction<typeof publicBulkCreateLoyaltyEarningRules> &\n typeof publicBulkCreateLoyaltyEarningRules\n> = /*#__PURE__*/ createRESTModule(publicBulkCreateLoyaltyEarningRules);\nexport const createCustomLoyaltyEarningRule: MaybeContext<\n BuildRESTFunction<typeof publicCreateCustomLoyaltyEarningRule> &\n typeof publicCreateCustomLoyaltyEarningRule\n> = /*#__PURE__*/ createRESTModule(publicCreateCustomLoyaltyEarningRule);\nexport const getLoyaltyEarningRule: MaybeContext<\n BuildRESTFunction<typeof publicGetLoyaltyEarningRule> &\n typeof publicGetLoyaltyEarningRule\n> = /*#__PURE__*/ createRESTModule(publicGetLoyaltyEarningRule);\nexport const updateLoyaltyEarningRule: MaybeContext<\n BuildRESTFunction<typeof publicUpdateLoyaltyEarningRule> &\n typeof publicUpdateLoyaltyEarningRule\n> = /*#__PURE__*/ createRESTModule(publicUpdateLoyaltyEarningRule);\nexport const deleteLoyaltyEarningRule: MaybeContext<\n BuildRESTFunction<typeof publicDeleteLoyaltyEarningRule> &\n typeof publicDeleteLoyaltyEarningRule\n> = /*#__PURE__*/ createRESTModule(publicDeleteLoyaltyEarningRule);\nexport const deleteAutomationEarningRule: MaybeContext<\n BuildRESTFunction<typeof publicDeleteAutomationEarningRule> &\n typeof publicDeleteAutomationEarningRule\n> = /*#__PURE__*/ createRESTModule(publicDeleteAutomationEarningRule);\nexport const listEarningRules: MaybeContext<\n BuildRESTFunction<typeof publicListEarningRules> &\n typeof publicListEarningRules\n> = /*#__PURE__*/ createRESTModule(publicListEarningRules);\n/**\n * Triggered when an earning rule is created.\n */\nexport const onLoyaltyEarningRuleCreated: BuildEventDefinition<\n typeof publicOnLoyaltyEarningRuleCreated\n> &\n typeof publicOnLoyaltyEarningRuleCreated = createEventModule(\n publicOnLoyaltyEarningRuleCreated\n);\n/**\n * Triggered when an earning rule is deleted.\n */\nexport const onLoyaltyEarningRuleDeleted: BuildEventDefinition<\n typeof publicOnLoyaltyEarningRuleDeleted\n> &\n typeof publicOnLoyaltyEarningRuleDeleted = createEventModule(\n publicOnLoyaltyEarningRuleDeleted\n);\n/**\n * Triggered when an earning rule is updated.\n */\nexport const onLoyaltyEarningRuleUpdated: BuildEventDefinition<\n typeof publicOnLoyaltyEarningRuleUpdated\n> &\n typeof publicOnLoyaltyEarningRuleUpdated = createEventModule(\n publicOnLoyaltyEarningRuleUpdated\n);\n\nexport {\n Status,\n LoyaltyEarningRuleTypeTagType,\n Type,\n V1Type,\n WebhookIdentityType,\n} from './loyalty-v1-loyalty-earning-rule-earning-rules.universal.js';\nexport {\n LoyaltyEarningRule,\n LoyaltyEarningRuleTypeOneOf,\n FixedAmount,\n FixedAmountConfig,\n ConversionRate,\n ConversionRateConfig,\n Metadata,\n LoyaltyEarningRuleTypeTag,\n CacheInvalidated,\n EarningRuleDisabled,\n CreateLoyaltyEarningRuleRequest,\n CreateLoyaltyEarningRuleResponse,\n BulkCreateLoyaltyEarningRulesRequest,\n BulkCreateLoyaltyEarningRulesResponse,\n BulkLoyaltyEarningRuleResult,\n ItemMetadata,\n ApplicationError,\n BulkActionMetadata,\n CreateCustomLoyaltyEarningRuleRequest,\n CustomLoyaltyEarningRule,\n CustomLoyaltyEarningRuleTypeOneOf,\n CreateCustomLoyaltyEarningRuleResponse,\n GetLoyaltyEarningRuleRequest,\n GetLoyaltyEarningRuleResponse,\n UpdateLoyaltyEarningRuleRequest,\n UpdateLoyaltyEarningRuleResponse,\n DeleteLoyaltyEarningRuleRequest,\n DeleteLoyaltyEarningRuleResponse,\n DeleteAutomationEarningRuleRequest,\n DeleteAutomationEarningRuleResponse,\n ListEarningRulesRequest,\n ListEarningRulesResponse,\n ListEarningRulesInTierRequest,\n CursorPaging,\n ListEarningRulesInTierResponse,\n PagingMetadataV2,\n Cursors,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n Empty,\n InvalidateEarningRuleCacheRequest,\n InvalidateEarningRuleCacheResponse,\n AppInstallationInLoyaltySite,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n BaseEventMetadata,\n EventMetadata,\n LoyaltyEarningRuleCreatedEnvelope,\n LoyaltyEarningRuleDeletedEnvelope,\n LoyaltyEarningRuleUpdatedEnvelope,\n CreateCustomLoyaltyEarningRuleOptions,\n UpdateLoyaltyEarningRule,\n DeleteLoyaltyEarningRuleOptions,\n ListEarningRulesOptions,\n} from './loyalty-v1-loyalty-earning-rule-earning-rules.universal.js';\nexport {\n StatusWithLiterals,\n LoyaltyEarningRuleTypeTagTypeWithLiterals,\n TypeWithLiterals,\n V1TypeWithLiterals,\n WebhookIdentityTypeWithLiterals,\n} from './loyalty-v1-loyalty-earning-rule-earning-rules.universal.js';\n"],"mappings":";AAAA,SAAS,2CAAAA,gDAA+C;AACxD,SAAS,wCAAAC,6CAA4C;AACrD,SAAS,kBAAAC,uBAAsB;AAC/B,SAAS,uBAAqD;;;ACH9D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AAA,EAC3C;AACF;AAIO,IAAMC,+BAGgC;AAAA,EAC3C;AACF;","names":["renameKeysFromRESTResponseToSDKResponse","transformRESTTimestampToSDKTimestamp","transformPaths","payload","Status","LoyaltyEarningRuleTypeTagType","Type","V1Type","WebhookIdentityType","createLoyaltyEarningRule","bulkCreateLoyaltyEarningRules","createCustomLoyaltyEarningRule","getLoyaltyEarningRule","updateLoyaltyEarningRule","deleteLoyaltyEarningRule","deleteAutomationEarningRule","listEarningRules","createLoyaltyEarningRule","bulkCreateLoyaltyEarningRules","createCustomLoyaltyEarningRule","getLoyaltyEarningRule","updateLoyaltyEarningRule","deleteLoyaltyEarningRule","deleteAutomationEarningRule","listEarningRules","renameKeysFromRESTResponseToSDKResponse","transformPaths","transformRESTTimestampToSDKTimestamp","createLoyaltyEarningRule","bulkCreateLoyaltyEarningRules","createCustomLoyaltyEarningRule","getLoyaltyEarningRule","updateLoyaltyEarningRule","deleteLoyaltyEarningRule","deleteAutomationEarningRule","listEarningRules","onLoyaltyEarningRuleCreated","onLoyaltyEarningRuleDeleted","onLoyaltyEarningRuleUpdated"]}
|
|
1
|
+
{"version":3,"sources":["../../src/loyalty-v1-loyalty-earning-rule-earning-rules.public.ts","../../src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.ts","../../src/loyalty-v1-loyalty-earning-rule-earning-rules.http.ts","../../src/loyalty-v1-loyalty-earning-rule-earning-rules.context.ts"],"sourcesContent":["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 BulkCreateLoyaltyEarningRulesResponse,\n CreateCustomLoyaltyEarningRuleOptions,\n CreateCustomLoyaltyEarningRuleResponse,\n DeleteLoyaltyEarningRuleOptions,\n ListEarningRulesOptions,\n ListEarningRulesResponse,\n LoyaltyEarningRule,\n LoyaltyEarningRuleCreatedEnvelope,\n LoyaltyEarningRuleDeletedEnvelope,\n LoyaltyEarningRuleUpdatedEnvelope,\n TypeWithLiterals,\n UpdateLoyaltyEarningRule,\n UpdateLoyaltyEarningRuleResponse,\n bulkCreateLoyaltyEarningRules as universalBulkCreateLoyaltyEarningRules,\n createCustomLoyaltyEarningRule as universalCreateCustomLoyaltyEarningRule,\n createLoyaltyEarningRule as universalCreateLoyaltyEarningRule,\n deleteAutomationEarningRule as universalDeleteAutomationEarningRule,\n deleteLoyaltyEarningRule as universalDeleteLoyaltyEarningRule,\n getLoyaltyEarningRule as universalGetLoyaltyEarningRule,\n listEarningRules as universalListEarningRules,\n updateLoyaltyEarningRule as universalUpdateLoyaltyEarningRule,\n} from './loyalty-v1-loyalty-earning-rule-earning-rules.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/loyalty' };\n\nexport function createLoyaltyEarningRule(\n httpClient: HttpClient\n): CreateLoyaltyEarningRuleSignature {\n return (\n earningRule: NonNullablePaths<\n LoyaltyEarningRule,\n | `sourceAppId`\n | `status`\n | `title`\n | `triggerActivityType`\n | `triggerAppId`,\n 2\n >\n ) =>\n universalCreateLoyaltyEarningRule(\n earningRule,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateLoyaltyEarningRuleSignature {\n /**\n * Creates a non-automated earning rule.\n *\n * >**Note**: You can only create non-automated earning rules from a supported list.\n * For the supported list of services, see the Introduction.\n * @param - Earning rule to create.\n * @returns Created earning rule.\n */\n (\n earningRule: NonNullablePaths<\n LoyaltyEarningRule,\n | `sourceAppId`\n | `status`\n | `title`\n | `triggerActivityType`\n | `triggerAppId`,\n 2\n >\n ): Promise<\n NonNullablePaths<\n LoyaltyEarningRule,\n | `fixedAmount.configs`\n | `fixedAmount.configs.${number}.points`\n | `conversionRate.configs`\n | `conversionRate.configs.${number}.moneyAmount`\n | `conversionRate.configs.${number}.points`\n | `sourceAppId`\n | `triggerAppId`\n | `triggerActivityType`\n | `title`\n | `status`\n | `metadata.canBeDeleted`,\n 5\n >\n >;\n}\n\nexport function bulkCreateLoyaltyEarningRules(\n httpClient: HttpClient\n): BulkCreateLoyaltyEarningRulesSignature {\n return (\n earningRules: NonNullablePaths<\n LoyaltyEarningRule,\n | `sourceAppId`\n | `status`\n | `title`\n | `triggerActivityType`\n | `triggerAppId`,\n 2\n >[]\n ) =>\n universalBulkCreateLoyaltyEarningRules(\n earningRules,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface BulkCreateLoyaltyEarningRulesSignature {\n /**\n * Creates multiple non-automated earning rules.\n *\n * >**Note**: You can only create non-automated earning rules from a supported list.\n * For the supported list of services, see the Introduction.\n * @param - Earning rules to create.\n */\n (\n earningRules: NonNullablePaths<\n LoyaltyEarningRule,\n | `sourceAppId`\n | `status`\n | `title`\n | `triggerActivityType`\n | `triggerAppId`,\n 2\n >[]\n ): Promise<\n NonNullablePaths<\n BulkCreateLoyaltyEarningRulesResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `results.${number}.item.sourceAppId`\n | `results.${number}.item.triggerAppId`\n | `results.${number}.item.triggerActivityType`\n | `results.${number}.item.title`\n | `results.${number}.item.status`\n | `results.${number}.item.metadata.canBeDeleted`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 6\n >\n >;\n}\n\nexport function createCustomLoyaltyEarningRule(\n httpClient: HttpClient\n): CreateCustomLoyaltyEarningRuleSignature {\n return (\n type: TypeWithLiterals,\n options?: CreateCustomLoyaltyEarningRuleOptions\n ) =>\n universalCreateCustomLoyaltyEarningRule(\n type,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateCustomLoyaltyEarningRuleSignature {\n /**\n * Creates a custom automated earning rule.\n *\n * To learn more about the automated rules, see the Introduction.\n * @param - Type of the custom earning rule.\n */\n (\n type: TypeWithLiterals,\n options?: CreateCustomLoyaltyEarningRuleOptions\n ): Promise<\n NonNullablePaths<\n CreateCustomLoyaltyEarningRuleResponse,\n | `earningRule.fixedAmount.configs`\n | `earningRule.fixedAmount.configs.${number}.points`\n | `earningRule.conversionRate.configs`\n | `earningRule.conversionRate.configs.${number}.moneyAmount`\n | `earningRule.conversionRate.configs.${number}.points`\n | `earningRule.sourceAppId`\n | `earningRule.triggerAppId`\n | `earningRule.triggerActivityType`\n | `earningRule.title`\n | `earningRule.status`\n | `earningRule.metadata.canBeDeleted`,\n 6\n >\n >;\n}\n\nexport function getLoyaltyEarningRule(\n httpClient: HttpClient\n): GetLoyaltyEarningRuleSignature {\n return (_id: string) =>\n universalGetLoyaltyEarningRule(\n _id,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetLoyaltyEarningRuleSignature {\n /**\n * Retrieves a specified non-automated earning rule.\n *\n * To retrieve both automated and non-automated earning rules, call List Earning Rules.\n * @param - ID of the earning rule to retrieve.\n * @returns Retrieved earning rule.\n */\n (_id: string): Promise<\n NonNullablePaths<\n LoyaltyEarningRule,\n | `fixedAmount.configs`\n | `fixedAmount.configs.${number}.points`\n | `conversionRate.configs`\n | `conversionRate.configs.${number}.moneyAmount`\n | `conversionRate.configs.${number}.points`\n | `sourceAppId`\n | `triggerAppId`\n | `triggerActivityType`\n | `title`\n | `status`\n | `metadata.canBeDeleted`,\n 5\n >\n >;\n}\n\nexport function updateLoyaltyEarningRule(\n httpClient: HttpClient\n): UpdateLoyaltyEarningRuleSignature {\n return (_id: string, earningRule: UpdateLoyaltyEarningRule) =>\n universalUpdateLoyaltyEarningRule(\n _id,\n earningRule,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateLoyaltyEarningRuleSignature {\n /**\n * Updates an earning rule.\n *\n * Supports partial updates.\n *\n * Revision number, which increments by 1 each time the earning rule is updated. To prevent conflicting changes,\n * the current `revision` must be passed when updating the earning rule.\n * @param - Loyalty earning rule ID.\n */\n (_id: string, earningRule: UpdateLoyaltyEarningRule): Promise<\n NonNullablePaths<\n UpdateLoyaltyEarningRuleResponse,\n | `earningRule.fixedAmount.configs`\n | `earningRule.fixedAmount.configs.${number}.points`\n | `earningRule.conversionRate.configs`\n | `earningRule.conversionRate.configs.${number}.moneyAmount`\n | `earningRule.conversionRate.configs.${number}.points`\n | `earningRule.sourceAppId`\n | `earningRule.triggerAppId`\n | `earningRule.triggerActivityType`\n | `earningRule.title`\n | `earningRule.status`\n | `earningRule.metadata.canBeDeleted`,\n 6\n >\n >;\n}\n\nexport function deleteLoyaltyEarningRule(\n httpClient: HttpClient\n): DeleteLoyaltyEarningRuleSignature {\n return (_id: string, options?: DeleteLoyaltyEarningRuleOptions) =>\n universalDeleteLoyaltyEarningRule(\n _id,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteLoyaltyEarningRuleSignature {\n /**\n * Deletes a non-automated earning rule.\n *\n * To delete an automated earning rule, call\n * Delete Automation Earning Rule.\n *\n * To update an earning rule's status instead of deleting it, call\n * Update Loyalty Earning Rule.\n * @param - ID of the earning rule to delete.\n */\n (_id: string, options?: DeleteLoyaltyEarningRuleOptions): Promise<void>;\n}\n\nexport function deleteAutomationEarningRule(\n httpClient: HttpClient\n): DeleteAutomationEarningRuleSignature {\n return (_id: string) =>\n universalDeleteAutomationEarningRule(\n _id,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteAutomationEarningRuleSignature {\n /**\n * Deletes a custom automated earning rule.\n * Pre-installed automated rules can only be paused, not deleted.\n *\n * To update an earning rule's status instead of deleting it, call\n * Update Loyalty Earning Rule.\n *\n * To delete a non-automated earning rule, call\n * Delete Loyalty Earning Rule.\n * @param - ID of the earning rule to delete.\n */\n (_id: string): Promise<void>;\n}\n\nexport function listEarningRules(\n httpClient: HttpClient\n): ListEarningRulesSignature {\n return (options?: ListEarningRulesOptions) =>\n universalListEarningRules(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListEarningRulesSignature {\n /**\n * Retrieves a list of earning rules.\n *\n * Returns both automated and non-automated earning rules.\n *\n * You can filter the results by `triggerAppId` or `triggerActivityType`.\n */\n (options?: ListEarningRulesOptions): Promise<\n NonNullablePaths<\n ListEarningRulesResponse,\n | `earningRules`\n | `earningRules.${number}.sourceAppId`\n | `earningRules.${number}.triggerAppId`\n | `earningRules.${number}.triggerActivityType`\n | `earningRules.${number}.title`\n | `earningRules.${number}.status`\n | `earningRules.${number}.metadata.canBeDeleted`,\n 5\n >\n >;\n}\n\nexport const onLoyaltyEarningRuleCreated = EventDefinition(\n 'wix.loyalty.v1.loyalty_earning_rule_created',\n true,\n (event: LoyaltyEarningRuleCreatedEnvelope) =>\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)<LoyaltyEarningRuleCreatedEnvelope>();\nexport const onLoyaltyEarningRuleDeleted = EventDefinition(\n 'wix.loyalty.v1.loyalty_earning_rule_deleted',\n true,\n (event: LoyaltyEarningRuleDeletedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'undefined.createdDate' },\n { path: 'undefined.updatedDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<LoyaltyEarningRuleDeletedEnvelope>();\nexport const onLoyaltyEarningRuleUpdated = EventDefinition(\n 'wix.loyalty.v1.loyalty_earning_rule_updated',\n true,\n (event: LoyaltyEarningRuleUpdatedEnvelope) =>\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)<LoyaltyEarningRuleUpdatedEnvelope>();\n\nexport {\n AccountDetails,\n ActionEvent,\n AppInstallationInLoyaltySite,\n ApplicationError,\n BaseEventMetadata,\n BulkActionMetadata,\n BulkCreateLoyaltyEarningRulesRequest,\n BulkCreateLoyaltyEarningRulesResponse,\n BulkLoyaltyEarningRuleResult,\n CacheInvalidated,\n ConversionRate,\n ConversionRateConfig,\n CreateCustomLoyaltyEarningRuleOptions,\n CreateCustomLoyaltyEarningRuleRequest,\n CreateCustomLoyaltyEarningRuleResponse,\n CreateLoyaltyEarningRuleRequest,\n CreateLoyaltyEarningRuleResponse,\n CursorPaging,\n Cursors,\n CustomLoyaltyEarningRule,\n CustomLoyaltyEarningRuleTypeOneOf,\n DeleteAutomationEarningRuleRequest,\n DeleteAutomationEarningRuleResponse,\n DeleteLoyaltyEarningRuleOptions,\n DeleteLoyaltyEarningRuleRequest,\n DeleteLoyaltyEarningRuleResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EarningRuleDisabled,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n FixedAmount,\n FixedAmountConfig,\n GetLoyaltyEarningRuleRequest,\n GetLoyaltyEarningRuleResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n InvalidateEarningRuleCacheRequest,\n InvalidateEarningRuleCacheResponse,\n ItemMetadata,\n ListEarningRulesInTierRequest,\n ListEarningRulesInTierResponse,\n ListEarningRulesOptions,\n ListEarningRulesRequest,\n ListEarningRulesResponse,\n LoyaltyEarningRule,\n LoyaltyEarningRuleCreatedEnvelope,\n LoyaltyEarningRuleDeletedEnvelope,\n LoyaltyEarningRuleTypeOneOf,\n LoyaltyEarningRuleTypeTag,\n LoyaltyEarningRuleTypeTagType,\n LoyaltyEarningRuleUpdatedEnvelope,\n MessageEnvelope,\n Metadata,\n PagingMetadataV2,\n RestoreInfo,\n Status,\n Type,\n UpdateLoyaltyEarningRule,\n UpdateLoyaltyEarningRuleRequest,\n UpdateLoyaltyEarningRuleResponse,\n V1Type,\n WebhookIdentityType,\n} from './loyalty-v1-loyalty-earning-rule-earning-rules.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixLoyaltyV1LoyaltyEarningRule from './loyalty-v1-loyalty-earning-rule-earning-rules.http.js';\n\n/**\n * A loyalty earning rule defines how customers earn points in a loyalty program.\n * You can create rules for different activities, such as making purchases.\n */\nexport interface LoyaltyEarningRule extends LoyaltyEarningRuleTypeOneOf {\n /** Fixed amount of points awarded for each qualifying activity. */\n fixedAmount?: FixedAmount;\n /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */\n conversionRate?: ConversionRate;\n /**\n * Loyalty earning rule ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * ID of the app managing the earning rule. Can be a loyalty app ID or a Wix automations app ID.\n * @format GUID\n */\n sourceAppId?: string;\n /**\n * ID of the app that triggers point assignment. Examples: Wix Stores, Wix Bookings, Wix Events.\n * @minLength 1\n * @maxLength 80\n */\n triggerAppId?: string;\n /**\n * Type of activity that triggers point assignment. For example, `wix-restaurants/orderSubmitted` or `birthday`.\n * @minLength 1\n * @maxLength 80\n */\n triggerActivityType?: string;\n /**\n * Name of the earning rule.\n * @minLength 1\n * @maxLength 50\n */\n title?: string;\n /** Current status of the earning rule. */\n status?: StatusWithLiterals;\n /**\n * Revision number, incremented by 1 each time the earning rule is updated.\n * Pass the latest `revision` when updating to prevent conflicting changes.\n */\n revision?: string | null;\n /**\n * Date and time the earning rule was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the earning rule was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * Additional metadata about the earning rule.\n * @readonly\n */\n metadata?: Metadata;\n}\n\n/** @oneof */\nexport interface LoyaltyEarningRuleTypeOneOf {\n /** Fixed amount of points awarded for each qualifying activity. */\n fixedAmount?: FixedAmount;\n /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */\n conversionRate?: ConversionRate;\n}\n\n/** Fixed amount type of earning rule. */\nexport interface FixedAmount {\n /**\n * Fixed amount configurations for each tier.\n * @maxSize 21\n */\n configs?: FixedAmountConfig[];\n}\n\nexport interface FixedAmountConfig {\n /**\n * Tier ID. If empty, the base tier is used. See the Tiers API for more information.\n * @format GUID\n * @readonly\n */\n tierId?: string | null;\n /** Number of points to award. */\n points?: number;\n}\n\n/**\n * Conversion rate type of earning rule.\n * Customers earn points based on the amount spent.\n * For example, for every $10 spent, a customer might earn 1 point.\n */\nexport interface ConversionRate {\n /**\n * Conversion rate configurations for each tier.\n *\n * Points are awarded proportionally to the amount spent.\n *\n * Formula: `(amount spent) / (money_amount * points)`.\n * @maxSize 21\n */\n configs?: ConversionRateConfig[];\n /**\n * Specifies which field in the Wix automations trigger payload [REST](https://dev.wix.com/docs/rest/business-management/automations/introduction#how-do-automations-work)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/automations/triggered-events/reporting-and-canceling-events) to use for calculating points in conversion rate rules.\n * For example, if set to \"priceSummary.totalAmount\", the rule uses the total order amount to calculate loyalty points to be awarded.\n * This field is only applicable for automated earning rules.\n */\n field?: string | null;\n}\n\nexport interface ConversionRateConfig {\n /**\n * Tier ID. If empty, the base tier is used. See the Tiers API for more information.\n * @format GUID\n * @readonly\n */\n tierId?: string | null;\n /**\n * The amount of money used as a reference for point calculation.\n * Points are awarded proportionally to the amount spent.\n *\n * For example, if set to 10, 1 point is awarded for every 10 units of currency spent (assuming `points` is set to 1).\n *\n * Formula for points is: `(amount spent) / (money_amount * points)`.\n */\n moneyAmount?: number;\n /**\n * Points given for the specified `money_amount`.\n * Works in conjunction with `money_amount` to define the earning rule.\n *\n * For example: If `money_amount` is 20 and `points` is 10:\n * - Spending 10 units of currency earns 5 points\n * - Spending 20 units of currency earns 10 points\n * - Spending 30 units of currency earns 15 points\n */\n points?: number;\n}\n\nexport enum Status {\n /** Status is unknown or not specified. */\n UNKNOWN = 'UNKNOWN',\n /** Earning rule is active and can assign points. */\n ACTIVE = 'ACTIVE',\n /** Earning rule is paused and can't assign points. */\n PAUSED = 'PAUSED',\n}\n\n/** @enumType */\nexport type StatusWithLiterals = Status | 'UNKNOWN' | 'ACTIVE' | 'PAUSED';\n\nexport interface Metadata {\n /** Whether the earning rule can be deleted. */\n canBeDeleted?: boolean;\n /**\n * Information about the type of custom earning rule.\n * @internal\n */\n ruleTypeTag?: LoyaltyEarningRuleTypeTag;\n}\n\nexport interface LoyaltyEarningRuleTypeTag {\n /** Type of custom earning rule. */\n ruleType?: LoyaltyEarningRuleTypeTagTypeWithLiterals;\n}\n\nexport enum LoyaltyEarningRuleTypeTagType {\n /** Type is unknown or not specified. */\n UNKNOWN_TYPE = 'UNKNOWN_TYPE',\n /** Earning rule for a customer's birthday. */\n BIRTHDAY = 'BIRTHDAY',\n}\n\n/** @enumType */\nexport type LoyaltyEarningRuleTypeTagTypeWithLiterals =\n | LoyaltyEarningRuleTypeTagType\n | 'UNKNOWN_TYPE'\n | 'BIRTHDAY';\n\nexport interface CacheInvalidated {}\n\nexport interface EarningRuleDisabled {}\n\nexport interface CreateLoyaltyEarningRuleRequest {\n /** Earning rule to create. */\n earningRule: LoyaltyEarningRule;\n}\n\nexport interface CreateLoyaltyEarningRuleResponse {\n /** Created earning rule. */\n earningRule?: LoyaltyEarningRule;\n}\n\nexport interface BulkCreateLoyaltyEarningRulesRequest {\n /**\n * Earning rules to create.\n * @minSize 1\n * @maxSize 100\n */\n earningRules: LoyaltyEarningRule[];\n}\n\nexport interface BulkCreateLoyaltyEarningRulesResponse {\n /** Created earning rules. */\n results?: BulkLoyaltyEarningRuleResult[];\n /** Additional metadata for the created earning rules. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface BulkLoyaltyEarningRuleResult {\n /** Additional metadata for the created earning rules. */\n itemMetadata?: ItemMetadata;\n /** Created earning rule. */\n item?: LoyaltyEarningRule;\n}\n\nexport interface ItemMetadata {\n /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */\n _id?: string | null;\n /** Index of the item within the request array. Allows for correlation between request and response items. */\n originalIndex?: number;\n /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */\n success?: boolean;\n /** Details about the error in case of failure. */\n error?: ApplicationError;\n}\n\nexport interface ApplicationError {\n /** Error code. */\n code?: string;\n /** Description of the error. */\n description?: string;\n /** Data related to the error. */\n data?: Record<string, any> | null;\n}\n\nexport interface BulkActionMetadata {\n /** Number of items that were successfully processed. */\n totalSuccesses?: number;\n /** Number of items that couldn't be processed. */\n totalFailures?: number;\n /** Number of failures without details because detailed failure threshold was exceeded. */\n undetailedFailures?: number;\n}\n\nexport interface CreateCustomLoyaltyEarningRuleRequest {\n /** Type of the custom earning rule. */\n type: TypeWithLiterals;\n /** Custom earning rule to create. */\n earningRule?: CustomLoyaltyEarningRule;\n}\n\nexport enum Type {\n /** Unknown type. This value is not used. */\n UNKNOWN_TYPE = 'UNKNOWN_TYPE',\n /** Earning rule for social media. */\n SOCIAL_MEDIA = 'SOCIAL_MEDIA',\n /** Earning rule for birthdays. */\n BIRTHDAY = 'BIRTHDAY',\n}\n\n/** @enumType */\nexport type TypeWithLiterals =\n | Type\n | 'UNKNOWN_TYPE'\n | 'SOCIAL_MEDIA'\n | 'BIRTHDAY';\n\n/** Used in CreateCustomLoyaltyEarningRuleRequest */\nexport interface CustomLoyaltyEarningRule\n extends CustomLoyaltyEarningRuleTypeOneOf {\n /** Fixed amount of points awarded for each qualifying activity. */\n fixedAmount?: FixedAmount;\n /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */\n conversionRate?: ConversionRate;\n /**\n * Name of the earning rule.\n * @minLength 1\n * @maxLength 50\n */\n title?: string;\n}\n\n/** @oneof */\nexport interface CustomLoyaltyEarningRuleTypeOneOf {\n /** Fixed amount of points awarded for each qualifying activity. */\n fixedAmount?: FixedAmount;\n /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */\n conversionRate?: ConversionRate;\n}\n\nexport interface CreateCustomLoyaltyEarningRuleResponse {\n /** Created earning rule. */\n earningRule?: LoyaltyEarningRule;\n}\n\nexport interface GetLoyaltyEarningRuleRequest {\n /**\n * ID of the earning rule to retrieve.\n * @format GUID\n */\n _id: string;\n}\n\nexport interface GetLoyaltyEarningRuleResponse {\n /** Retrieved earning rule. */\n earningRule?: LoyaltyEarningRule;\n}\n\nexport interface UpdateLoyaltyEarningRuleRequest {\n /** Earning rule to update. */\n earningRule: LoyaltyEarningRule;\n}\n\nexport interface UpdateLoyaltyEarningRuleResponse {\n /** The updated earning rule. */\n earningRule?: LoyaltyEarningRule;\n}\n\nexport interface DeleteLoyaltyEarningRuleRequest {\n /**\n * ID of the earning rule to delete.\n * @format GUID\n */\n _id: string;\n /**\n * Revision of the earning rule. Incremented by 1 each time the earning rule is updated.\n * Pass the latest `revision` when updating to prevent conflicting changes.\n */\n revision?: string;\n}\n\nexport interface DeleteLoyaltyEarningRuleResponse {}\n\nexport interface DeleteAutomationEarningRuleRequest {\n /**\n * ID of the earning rule to delete.\n * @format GUID\n */\n _id: string;\n}\n\nexport interface DeleteAutomationEarningRuleResponse {}\n\nexport interface ListEarningRulesRequest {\n /** App ID that triggers the point assignment. For example, `9a5d83fd-8570-482e-81ab-cfa88942ee60`. */\n triggerAppId?: string | null;\n /** Type of activity that triggers the point assignment. For example, `restaurants-order-is-pending`. */\n triggerActivityType?: string | null;\n}\n\nexport interface ListEarningRulesResponse {\n /** Retrieved earning rules. */\n earningRules?: LoyaltyEarningRule[];\n}\n\nexport interface ListEarningRulesInTierRequest {\n /**\n * ID of the tier for which the earning rules will be returned.\n * @format GUID\n */\n tierId?: string | null;\n /** Pagination options. */\n paging?: CursorPaging;\n}\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 ListEarningRulesInTierResponse {\n /** Retrieved earning rules. */\n earningRules?: LoyaltyEarningRule[];\n /** Details on the paged set of results returned. */\n pagingMetadata?: PagingMetadataV2;\n}\n\nexport interface PagingMetadataV2 {\n /** Number of items returned in the response. */\n count?: number | null;\n /** Offset that was requested. */\n offset?: number | null;\n /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */\n total?: number | null;\n /** Flag that indicates the server failed to calculate the `total` field. */\n tooManyToCount?: boolean | null;\n /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */\n cursors?: Cursors;\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 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 InvalidateEarningRuleCacheRequest {}\n\nexport interface InvalidateEarningRuleCacheResponse {}\n\nexport interface AppInstallationInLoyaltySite {\n /** @format GUID */\n appDefId?: string;\n type?: V1TypeWithLiterals;\n}\n\nexport enum V1Type {\n UNSPECIFIED = 'UNSPECIFIED',\n INSTALLED = 'INSTALLED',\n DELETED = 'DELETED',\n}\n\n/** @enumType */\nexport type V1TypeWithLiterals =\n | V1Type\n | 'UNSPECIFIED'\n | 'INSTALLED'\n | 'DELETED';\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 AccountDetails {\n /**\n * ID of the account.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the site, if applicable.\n * @format GUID\n */\n siteId?: string | null;\n}\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 LoyaltyEarningRuleCreatedEnvelope {\n entity: LoyaltyEarningRule;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when an earning rule is created.\n * @permissionScope Read Loyalty\n * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY\n * @permissionScope Manage Loyalty\n * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionId LOYALTY.READ_EARNING_RULES\n * @webhook\n * @eventType wix.loyalty.v1.loyalty_earning_rule_created\n * @slug created\n */\nexport declare function onLoyaltyEarningRuleCreated(\n handler: (event: LoyaltyEarningRuleCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface LoyaltyEarningRuleDeletedEnvelope {\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when an earning rule is deleted.\n * @permissionScope Read Loyalty\n * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY\n * @permissionScope Manage Loyalty\n * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionId LOYALTY.READ_EARNING_RULES\n * @webhook\n * @eventType wix.loyalty.v1.loyalty_earning_rule_deleted\n * @slug deleted\n */\nexport declare function onLoyaltyEarningRuleDeleted(\n handler: (event: LoyaltyEarningRuleDeletedEnvelope) => void | Promise<void>\n): void;\n\nexport interface LoyaltyEarningRuleUpdatedEnvelope {\n entity: LoyaltyEarningRule;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when an earning rule is updated.\n * @permissionScope Read Loyalty\n * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY\n * @permissionScope Manage Loyalty\n * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionId LOYALTY.READ_EARNING_RULES\n * @webhook\n * @eventType wix.loyalty.v1.loyalty_earning_rule_updated\n * @slug updated\n */\nexport declare function onLoyaltyEarningRuleUpdated(\n handler: (event: LoyaltyEarningRuleUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates a non-automated earning rule.\n *\n * >**Note**: You can only create non-automated earning rules from a supported list.\n * For the supported list of services, see the Introduction.\n * @param earningRule - Earning rule to create.\n * @public\n * @requiredField earningRule\n * @requiredField earningRule.sourceAppId\n * @requiredField earningRule.status\n * @requiredField earningRule.title\n * @requiredField earningRule.triggerActivityType\n * @requiredField earningRule.triggerAppId\n * @permissionId LOYALTY.MANAGE_EARNING_RULES\n * @applicableIdentity APP\n * @returns Created earning rule.\n * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.CreateLoyaltyEarningRule\n */\nexport async function createLoyaltyEarningRule(\n earningRule: NonNullablePaths<\n LoyaltyEarningRule,\n `sourceAppId` | `status` | `title` | `triggerActivityType` | `triggerAppId`,\n 2\n >\n): Promise<\n NonNullablePaths<\n LoyaltyEarningRule,\n | `fixedAmount.configs`\n | `fixedAmount.configs.${number}.points`\n | `conversionRate.configs`\n | `conversionRate.configs.${number}.moneyAmount`\n | `conversionRate.configs.${number}.points`\n | `sourceAppId`\n | `triggerAppId`\n | `triggerActivityType`\n | `title`\n | `status`\n | `metadata.canBeDeleted`,\n 5\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 earningRule: earningRule,\n });\n\n const reqOpts =\n ambassadorWixLoyaltyV1LoyaltyEarningRule.createLoyaltyEarningRule(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.earningRule!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { earningRule: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['earningRule']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates multiple non-automated earning rules.\n *\n * >**Note**: You can only create non-automated earning rules from a supported list.\n * For the supported list of services, see the Introduction.\n * @param earningRules - Earning rules to create.\n * @public\n * @requiredField earningRules\n * @requiredField earningRules.sourceAppId\n * @requiredField earningRules.status\n * @requiredField earningRules.title\n * @requiredField earningRules.triggerActivityType\n * @requiredField earningRules.triggerAppId\n * @permissionId LOYALTY.MANAGE_EARNING_RULES\n * @applicableIdentity APP\n * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.BulkCreateLoyaltyEarningRules\n */\nexport async function bulkCreateLoyaltyEarningRules(\n earningRules: NonNullablePaths<\n LoyaltyEarningRule,\n `sourceAppId` | `status` | `title` | `triggerActivityType` | `triggerAppId`,\n 2\n >[]\n): Promise<\n NonNullablePaths<\n BulkCreateLoyaltyEarningRulesResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `results.${number}.item.sourceAppId`\n | `results.${number}.item.triggerAppId`\n | `results.${number}.item.triggerActivityType`\n | `results.${number}.item.title`\n | `results.${number}.item.status`\n | `results.${number}.item.metadata.canBeDeleted`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\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 earningRules: earningRules,\n });\n\n const reqOpts =\n ambassadorWixLoyaltyV1LoyaltyEarningRule.bulkCreateLoyaltyEarningRules(\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: { earningRules: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['earningRules']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates a custom automated earning rule.\n *\n * To learn more about the automated rules, see the Introduction.\n * @param type - Type of the custom earning rule.\n * @public\n * @requiredField type\n * @permissionId LOYALTY.MANAGE_EARNING_RULES\n * @applicableIdentity APP\n * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.CreateCustomLoyaltyEarningRule\n */\nexport async function createCustomLoyaltyEarningRule(\n type: TypeWithLiterals,\n options?: CreateCustomLoyaltyEarningRuleOptions\n): Promise<\n NonNullablePaths<\n CreateCustomLoyaltyEarningRuleResponse,\n | `earningRule.fixedAmount.configs`\n | `earningRule.fixedAmount.configs.${number}.points`\n | `earningRule.conversionRate.configs`\n | `earningRule.conversionRate.configs.${number}.moneyAmount`\n | `earningRule.conversionRate.configs.${number}.points`\n | `earningRule.sourceAppId`\n | `earningRule.triggerAppId`\n | `earningRule.triggerActivityType`\n | `earningRule.title`\n | `earningRule.status`\n | `earningRule.metadata.canBeDeleted`,\n 6\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 type: type,\n earningRule: options?.earningRule,\n });\n\n const reqOpts =\n ambassadorWixLoyaltyV1LoyaltyEarningRule.createCustomLoyaltyEarningRule(\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 type: '$[0]',\n earningRule: '$[1].earningRule',\n },\n singleArgumentUnchanged: false,\n },\n ['type', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface CreateCustomLoyaltyEarningRuleOptions {\n /** Custom earning rule to create. */\n earningRule?: CustomLoyaltyEarningRule;\n}\n\n/**\n * Retrieves a specified non-automated earning rule.\n *\n * To retrieve both automated and non-automated earning rules, call List Earning Rules.\n * @param _id - ID of the earning rule to retrieve.\n * @public\n * @requiredField _id\n * @permissionId LOYALTY.READ_EARNING_RULES\n * @applicableIdentity APP\n * @returns Retrieved earning rule.\n * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.GetLoyaltyEarningRule\n */\nexport async function getLoyaltyEarningRule(\n _id: string\n): Promise<\n NonNullablePaths<\n LoyaltyEarningRule,\n | `fixedAmount.configs`\n | `fixedAmount.configs.${number}.points`\n | `conversionRate.configs`\n | `conversionRate.configs.${number}.moneyAmount`\n | `conversionRate.configs.${number}.points`\n | `sourceAppId`\n | `triggerAppId`\n | `triggerActivityType`\n | `title`\n | `status`\n | `metadata.canBeDeleted`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });\n\n const reqOpts =\n ambassadorWixLoyaltyV1LoyaltyEarningRule.getLoyaltyEarningRule(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.earningRule!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { id: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates an earning rule.\n *\n * Supports partial updates.\n *\n * Revision number, which increments by 1 each time the earning rule is updated. To prevent conflicting changes,\n * the current `revision` must be passed when updating the earning rule.\n * @param _id - Loyalty earning rule ID.\n * @public\n * @requiredField _id\n * @requiredField earningRule\n * @permissionId LOYALTY.MANAGE_EARNING_RULES\n * @applicableIdentity APP\n * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.UpdateLoyaltyEarningRule\n */\nexport async function updateLoyaltyEarningRule(\n _id: string,\n earningRule: UpdateLoyaltyEarningRule\n): Promise<\n NonNullablePaths<\n UpdateLoyaltyEarningRuleResponse,\n | `earningRule.fixedAmount.configs`\n | `earningRule.fixedAmount.configs.${number}.points`\n | `earningRule.conversionRate.configs`\n | `earningRule.conversionRate.configs.${number}.moneyAmount`\n | `earningRule.conversionRate.configs.${number}.points`\n | `earningRule.sourceAppId`\n | `earningRule.triggerAppId`\n | `earningRule.triggerActivityType`\n | `earningRule.title`\n | `earningRule.status`\n | `earningRule.metadata.canBeDeleted`,\n 6\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 earningRule: { ...earningRule, id: _id },\n });\n\n const reqOpts =\n ambassadorWixLoyaltyV1LoyaltyEarningRule.updateLoyaltyEarningRule(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: { earningRule: '$[1]' },\n explicitPathsToArguments: { 'earningRule.id': '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'earningRule']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateLoyaltyEarningRule {\n /** Fixed amount of points awarded for each qualifying activity. */\n fixedAmount?: FixedAmount;\n /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */\n conversionRate?: ConversionRate;\n /**\n * Loyalty earning rule ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * ID of the app managing the earning rule. Can be a loyalty app ID or a Wix automations app ID.\n * @format GUID\n */\n sourceAppId?: string;\n /**\n * ID of the app that triggers point assignment. Examples: Wix Stores, Wix Bookings, Wix Events.\n * @minLength 1\n * @maxLength 80\n */\n triggerAppId?: string;\n /**\n * Type of activity that triggers point assignment. For example, `wix-restaurants/orderSubmitted` or `birthday`.\n * @minLength 1\n * @maxLength 80\n */\n triggerActivityType?: string;\n /**\n * Name of the earning rule.\n * @minLength 1\n * @maxLength 50\n */\n title?: string;\n /** Current status of the earning rule. */\n status?: StatusWithLiterals;\n /**\n * Revision number, incremented by 1 each time the earning rule is updated.\n * Pass the latest `revision` when updating to prevent conflicting changes.\n */\n revision?: string | null;\n /**\n * Date and time the earning rule was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the earning rule was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * Additional metadata about the earning rule.\n * @readonly\n */\n metadata?: Metadata;\n}\n\n/**\n * Deletes a non-automated earning rule.\n *\n * To delete an automated earning rule, call\n * Delete Automation Earning Rule.\n *\n * To update an earning rule's status instead of deleting it, call\n * Update Loyalty Earning Rule.\n * @param _id - ID of the earning rule to delete.\n * @public\n * @requiredField _id\n * @permissionId LOYALTY.MANAGE_EARNING_RULES\n * @applicableIdentity APP\n * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.DeleteLoyaltyEarningRule\n */\nexport async function deleteLoyaltyEarningRule(\n _id: string,\n options?: DeleteLoyaltyEarningRuleOptions\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n id: _id,\n revision: options?.revision,\n });\n\n const reqOpts =\n ambassadorWixLoyaltyV1LoyaltyEarningRule.deleteLoyaltyEarningRule(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { id: '$[0]', revision: '$[1].revision' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface DeleteLoyaltyEarningRuleOptions {\n /**\n * Revision of the earning rule. Incremented by 1 each time the earning rule is updated.\n * Pass the latest `revision` when updating to prevent conflicting changes.\n */\n revision?: string;\n}\n\n/**\n * Deletes a custom automated earning rule.\n * Pre-installed automated rules can only be paused, not deleted.\n *\n * To update an earning rule's status instead of deleting it, call\n * Update Loyalty Earning Rule.\n *\n * To delete a non-automated earning rule, call\n * Delete Loyalty Earning Rule.\n * @param _id - ID of the earning rule to delete.\n * @public\n * @requiredField _id\n * @permissionId LOYALTY.MANAGE_EARNING_RULES\n * @applicableIdentity APP\n * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.DeleteAutomationEarningRule\n */\nexport async function deleteAutomationEarningRule(_id: string): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });\n\n const reqOpts =\n ambassadorWixLoyaltyV1LoyaltyEarningRule.deleteAutomationEarningRule(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { id: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a list of earning rules.\n *\n * Returns both automated and non-automated earning rules.\n *\n * You can filter the results by `triggerAppId` or `triggerActivityType`.\n * @public\n * @permissionId LOYALTY.READ_EARNING_RULES\n * @applicableIdentity APP\n * @fqn com.wixpress.loyalty.earningrule.LoyaltyEarningRules.ListEarningRules\n */\nexport async function listEarningRules(\n options?: ListEarningRulesOptions\n): Promise<\n NonNullablePaths<\n ListEarningRulesResponse,\n | `earningRules`\n | `earningRules.${number}.sourceAppId`\n | `earningRules.${number}.triggerAppId`\n | `earningRules.${number}.triggerActivityType`\n | `earningRules.${number}.title`\n | `earningRules.${number}.status`\n | `earningRules.${number}.metadata.canBeDeleted`,\n 5\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 triggerAppId: options?.triggerAppId,\n triggerActivityType: options?.triggerActivityType,\n });\n\n const reqOpts =\n ambassadorWixLoyaltyV1LoyaltyEarningRule.listEarningRules(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 triggerAppId: '$[0].triggerAppId',\n triggerActivityType: '$[0].triggerActivityType',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListEarningRulesOptions {\n /** App ID that triggers the point assignment. For example, `9a5d83fd-8570-482e-81ab-cfa88942ee60`. */\n triggerAppId?: string | null;\n /** Type of activity that triggers the point assignment. For example, `restaurants-order-is-pending`. */\n triggerActivityType?: string | null;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\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 resolveComWixpressLoyaltyEarningruleLoyaltyEarningRulesUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/loyalty-earning-rules',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/loyalty-earning-rules',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/loyalty-earning-rules',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/loyalty-earning-rules',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/loyalty-earning-rules',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/_api/loyalty-earning-rules',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/loyalty-earning-rules',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/loyalty-earning-rules',\n destPath: '',\n },\n ],\n '*.pub.wix-code.com': [\n {\n srcPath: '/_api/loyalty-earning-rules',\n destPath: '',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/loyalty-earning-rules',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/_api/loyalty-earning-rules',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_loyalty_earning-rules';\n\n/**\n * Creates a non-automated earning rule.\n *\n * >**Note**: You can only create non-automated earning rules from a supported list.\n * For the supported list of services, see the Introduction.\n */\nexport function createLoyaltyEarningRule(\n payload: object\n): RequestOptionsFactory<any> {\n function __createLoyaltyEarningRule({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'earningRule.createdDate' },\n { path: 'earningRule.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.loyalty.v1.loyalty_earning_rule',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.loyalty.earningrule.LoyaltyEarningRules.CreateLoyaltyEarningRule',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressLoyaltyEarningruleLoyaltyEarningRulesUrl({\n protoPath: '/v1/earning-rules',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'earningRule.createdDate' },\n { path: 'earningRule.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createLoyaltyEarningRule;\n}\n\n/**\n * Creates multiple non-automated earning rules.\n *\n * >**Note**: You can only create non-automated earning rules from a supported list.\n * For the supported list of services, see the Introduction.\n */\nexport function bulkCreateLoyaltyEarningRules(\n payload: object\n): RequestOptionsFactory<any> {\n function __bulkCreateLoyaltyEarningRules({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'earningRules.createdDate' },\n { path: 'earningRules.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.loyalty.v1.loyalty_earning_rule',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.loyalty.earningrule.LoyaltyEarningRules.BulkCreateLoyaltyEarningRules',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressLoyaltyEarningruleLoyaltyEarningRulesUrl({\n protoPath: '/v1/bulk/earning-rules/create',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'results.item.createdDate' },\n { path: 'results.item.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __bulkCreateLoyaltyEarningRules;\n}\n\n/**\n * Creates a custom automated earning rule.\n *\n * To learn more about the automated rules, see the Introduction.\n */\nexport function createCustomLoyaltyEarningRule(\n payload: object\n): RequestOptionsFactory<any> {\n function __createCustomLoyaltyEarningRule({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.v1.loyalty_earning_rule',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.loyalty.earningrule.LoyaltyEarningRules.CreateCustomLoyaltyEarningRule',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressLoyaltyEarningruleLoyaltyEarningRulesUrl({\n protoPath: '/v1/earning-rules/custom',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'earningRule.createdDate' },\n { path: 'earningRule.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createCustomLoyaltyEarningRule;\n}\n\n/**\n * Retrieves a specified non-automated earning rule.\n *\n * To retrieve both automated and non-automated earning rules, call List Earning Rules.\n */\nexport function getLoyaltyEarningRule(\n payload: object\n): RequestOptionsFactory<any> {\n function __getLoyaltyEarningRule({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.v1.loyalty_earning_rule',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.loyalty.earningrule.LoyaltyEarningRules.GetLoyaltyEarningRule',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressLoyaltyEarningruleLoyaltyEarningRulesUrl({\n protoPath: '/v1/earning-rules/{id}',\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: 'earningRule.createdDate' },\n { path: 'earningRule.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getLoyaltyEarningRule;\n}\n\n/**\n * Updates an earning rule.\n *\n * Supports partial updates.\n *\n * Revision number, which increments by 1 each time the earning rule is updated. To prevent conflicting changes,\n * the current `revision` must be passed when updating the earning rule.\n */\nexport function updateLoyaltyEarningRule(\n payload: object\n): RequestOptionsFactory<any> {\n function __updateLoyaltyEarningRule({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'earningRule.createdDate' },\n { path: 'earningRule.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.loyalty.v1.loyalty_earning_rule',\n method: 'PUT' as any,\n methodFqn:\n 'com.wixpress.loyalty.earningrule.LoyaltyEarningRules.UpdateLoyaltyEarningRule',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressLoyaltyEarningruleLoyaltyEarningRulesUrl({\n protoPath: '/v1/earning-rules/{earningRule.id}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'earningRule.createdDate' },\n { path: 'earningRule.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateLoyaltyEarningRule;\n}\n\n/**\n * Deletes a non-automated earning rule.\n *\n * To delete an automated earning rule, call\n * Delete Automation Earning Rule.\n *\n * To update an earning rule's status instead of deleting it, call\n * Update Loyalty Earning Rule.\n */\nexport function deleteLoyaltyEarningRule(\n payload: object\n): RequestOptionsFactory<any> {\n function __deleteLoyaltyEarningRule({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.v1.loyalty_earning_rule',\n method: 'DELETE' as any,\n methodFqn:\n 'com.wixpress.loyalty.earningrule.LoyaltyEarningRules.DeleteLoyaltyEarningRule',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressLoyaltyEarningruleLoyaltyEarningRulesUrl({\n protoPath: '/v1/earning-rules/{id}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteLoyaltyEarningRule;\n}\n\n/**\n * Deletes a custom automated earning rule.\n * Pre-installed automated rules can only be paused, not deleted.\n *\n * To update an earning rule's status instead of deleting it, call\n * Update Loyalty Earning Rule.\n *\n * To delete a non-automated earning rule, call\n * Delete Loyalty Earning Rule.\n */\nexport function deleteAutomationEarningRule(\n payload: object\n): RequestOptionsFactory<any> {\n function __deleteAutomationEarningRule({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.v1.loyalty_earning_rule',\n method: 'DELETE' as any,\n methodFqn:\n 'com.wixpress.loyalty.earningrule.LoyaltyEarningRules.DeleteAutomationEarningRule',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressLoyaltyEarningruleLoyaltyEarningRulesUrl({\n protoPath: '/v1/automation-earning-rules/{id}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteAutomationEarningRule;\n}\n\n/**\n * Retrieves a list of earning rules.\n *\n * Returns both automated and non-automated earning rules.\n *\n * You can filter the results by `triggerAppId` or `triggerActivityType`.\n */\nexport function listEarningRules(payload: object): RequestOptionsFactory<any> {\n function __listEarningRules({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.v1.loyalty_earning_rule',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.loyalty.earningrule.LoyaltyEarningRules.ListEarningRules',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressLoyaltyEarningruleLoyaltyEarningRulesUrl({\n protoPath: '/v1/earning-rules/rules',\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: 'earningRules.createdDate' },\n { path: 'earningRules.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listEarningRules;\n}\n","import {\n createLoyaltyEarningRule as publicCreateLoyaltyEarningRule,\n bulkCreateLoyaltyEarningRules as publicBulkCreateLoyaltyEarningRules,\n createCustomLoyaltyEarningRule as publicCreateCustomLoyaltyEarningRule,\n getLoyaltyEarningRule as publicGetLoyaltyEarningRule,\n updateLoyaltyEarningRule as publicUpdateLoyaltyEarningRule,\n deleteLoyaltyEarningRule as publicDeleteLoyaltyEarningRule,\n deleteAutomationEarningRule as publicDeleteAutomationEarningRule,\n listEarningRules as publicListEarningRules,\n} from './loyalty-v1-loyalty-earning-rule-earning-rules.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 { onLoyaltyEarningRuleCreated as publicOnLoyaltyEarningRuleCreated } from './loyalty-v1-loyalty-earning-rule-earning-rules.public.js';\nimport { onLoyaltyEarningRuleDeleted as publicOnLoyaltyEarningRuleDeleted } from './loyalty-v1-loyalty-earning-rule-earning-rules.public.js';\nimport { onLoyaltyEarningRuleUpdated as publicOnLoyaltyEarningRuleUpdated } from './loyalty-v1-loyalty-earning-rule-earning-rules.public.js';\n\nexport const createLoyaltyEarningRule: MaybeContext<\n BuildRESTFunction<typeof publicCreateLoyaltyEarningRule> &\n typeof publicCreateLoyaltyEarningRule\n> = /*#__PURE__*/ createRESTModule(publicCreateLoyaltyEarningRule);\nexport const bulkCreateLoyaltyEarningRules: MaybeContext<\n BuildRESTFunction<typeof publicBulkCreateLoyaltyEarningRules> &\n typeof publicBulkCreateLoyaltyEarningRules\n> = /*#__PURE__*/ createRESTModule(publicBulkCreateLoyaltyEarningRules);\nexport const createCustomLoyaltyEarningRule: MaybeContext<\n BuildRESTFunction<typeof publicCreateCustomLoyaltyEarningRule> &\n typeof publicCreateCustomLoyaltyEarningRule\n> = /*#__PURE__*/ createRESTModule(publicCreateCustomLoyaltyEarningRule);\nexport const getLoyaltyEarningRule: MaybeContext<\n BuildRESTFunction<typeof publicGetLoyaltyEarningRule> &\n typeof publicGetLoyaltyEarningRule\n> = /*#__PURE__*/ createRESTModule(publicGetLoyaltyEarningRule);\nexport const updateLoyaltyEarningRule: MaybeContext<\n BuildRESTFunction<typeof publicUpdateLoyaltyEarningRule> &\n typeof publicUpdateLoyaltyEarningRule\n> = /*#__PURE__*/ createRESTModule(publicUpdateLoyaltyEarningRule);\nexport const deleteLoyaltyEarningRule: MaybeContext<\n BuildRESTFunction<typeof publicDeleteLoyaltyEarningRule> &\n typeof publicDeleteLoyaltyEarningRule\n> = /*#__PURE__*/ createRESTModule(publicDeleteLoyaltyEarningRule);\nexport const deleteAutomationEarningRule: MaybeContext<\n BuildRESTFunction<typeof publicDeleteAutomationEarningRule> &\n typeof publicDeleteAutomationEarningRule\n> = /*#__PURE__*/ createRESTModule(publicDeleteAutomationEarningRule);\nexport const listEarningRules: MaybeContext<\n BuildRESTFunction<typeof publicListEarningRules> &\n typeof publicListEarningRules\n> = /*#__PURE__*/ createRESTModule(publicListEarningRules);\n/**\n * Triggered when an earning rule is created.\n */\nexport const onLoyaltyEarningRuleCreated: BuildEventDefinition<\n typeof publicOnLoyaltyEarningRuleCreated\n> &\n typeof publicOnLoyaltyEarningRuleCreated = createEventModule(\n publicOnLoyaltyEarningRuleCreated\n);\n/**\n * Triggered when an earning rule is deleted.\n */\nexport const onLoyaltyEarningRuleDeleted: BuildEventDefinition<\n typeof publicOnLoyaltyEarningRuleDeleted\n> &\n typeof publicOnLoyaltyEarningRuleDeleted = createEventModule(\n publicOnLoyaltyEarningRuleDeleted\n);\n/**\n * Triggered when an earning rule is updated.\n */\nexport const onLoyaltyEarningRuleUpdated: BuildEventDefinition<\n typeof publicOnLoyaltyEarningRuleUpdated\n> &\n typeof publicOnLoyaltyEarningRuleUpdated = createEventModule(\n publicOnLoyaltyEarningRuleUpdated\n);\n\nexport {\n Status,\n LoyaltyEarningRuleTypeTagType,\n Type,\n V1Type,\n WebhookIdentityType,\n} from './loyalty-v1-loyalty-earning-rule-earning-rules.universal.js';\nexport {\n LoyaltyEarningRule,\n LoyaltyEarningRuleTypeOneOf,\n FixedAmount,\n FixedAmountConfig,\n ConversionRate,\n ConversionRateConfig,\n Metadata,\n LoyaltyEarningRuleTypeTag,\n CacheInvalidated,\n EarningRuleDisabled,\n CreateLoyaltyEarningRuleRequest,\n CreateLoyaltyEarningRuleResponse,\n BulkCreateLoyaltyEarningRulesRequest,\n BulkCreateLoyaltyEarningRulesResponse,\n BulkLoyaltyEarningRuleResult,\n ItemMetadata,\n ApplicationError,\n BulkActionMetadata,\n CreateCustomLoyaltyEarningRuleRequest,\n CustomLoyaltyEarningRule,\n CustomLoyaltyEarningRuleTypeOneOf,\n CreateCustomLoyaltyEarningRuleResponse,\n GetLoyaltyEarningRuleRequest,\n GetLoyaltyEarningRuleResponse,\n UpdateLoyaltyEarningRuleRequest,\n UpdateLoyaltyEarningRuleResponse,\n DeleteLoyaltyEarningRuleRequest,\n DeleteLoyaltyEarningRuleResponse,\n DeleteAutomationEarningRuleRequest,\n DeleteAutomationEarningRuleResponse,\n ListEarningRulesRequest,\n ListEarningRulesResponse,\n ListEarningRulesInTierRequest,\n CursorPaging,\n ListEarningRulesInTierResponse,\n PagingMetadataV2,\n Cursors,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n Empty,\n InvalidateEarningRuleCacheRequest,\n InvalidateEarningRuleCacheResponse,\n AppInstallationInLoyaltySite,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountDetails,\n BaseEventMetadata,\n EventMetadata,\n LoyaltyEarningRuleCreatedEnvelope,\n LoyaltyEarningRuleDeletedEnvelope,\n LoyaltyEarningRuleUpdatedEnvelope,\n CreateCustomLoyaltyEarningRuleOptions,\n UpdateLoyaltyEarningRule,\n DeleteLoyaltyEarningRuleOptions,\n ListEarningRulesOptions,\n} from './loyalty-v1-loyalty-earning-rule-earning-rules.universal.js';\nexport {\n StatusWithLiterals,\n LoyaltyEarningRuleTypeTagTypeWithLiterals,\n TypeWithLiterals,\n V1TypeWithLiterals,\n WebhookIdentityTypeWithLiterals,\n} from './loyalty-v1-loyalty-earning-rule-earning-rules.universal.js';\n"],"mappings":";AAAA,SAAS,2CAAAA,gDAA+C;AACxD,SAAS,wCAAAC,6CAA4C;AACrD,SAAS,kBAAAC,uBAAsB;AAC/B,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AAIO,IAAMC,+BAGgC;AAAA,EAC3C;AACF;AAIO,IAAMC,+BAGgC;AAAA,EAC3C;AACF;","names":["renameKeysFromRESTResponseToSDKResponse","transformRESTTimestampToSDKTimestamp","transformPaths","payload","Status","LoyaltyEarningRuleTypeTagType","Type","V1Type","WebhookIdentityType","createLoyaltyEarningRule","bulkCreateLoyaltyEarningRules","createCustomLoyaltyEarningRule","getLoyaltyEarningRule","updateLoyaltyEarningRule","deleteLoyaltyEarningRule","deleteAutomationEarningRule","listEarningRules","createLoyaltyEarningRule","bulkCreateLoyaltyEarningRules","createCustomLoyaltyEarningRule","getLoyaltyEarningRule","updateLoyaltyEarningRule","deleteLoyaltyEarningRule","deleteAutomationEarningRule","listEarningRules","renameKeysFromRESTResponseToSDKResponse","transformPaths","transformRESTTimestampToSDKTimestamp","createLoyaltyEarningRule","bulkCreateLoyaltyEarningRules","createCustomLoyaltyEarningRule","getLoyaltyEarningRule","updateLoyaltyEarningRule","deleteLoyaltyEarningRule","deleteAutomationEarningRule","listEarningRules","onLoyaltyEarningRuleCreated","onLoyaltyEarningRuleDeleted","onLoyaltyEarningRuleUpdated"]}
|
|
@@ -517,6 +517,23 @@ declare enum WebhookIdentityType {
|
|
|
517
517
|
}
|
|
518
518
|
/** @enumType */
|
|
519
519
|
type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
|
|
520
|
+
interface AccountDetails {
|
|
521
|
+
/**
|
|
522
|
+
* ID of the account.
|
|
523
|
+
* @format GUID
|
|
524
|
+
*/
|
|
525
|
+
accountId?: string | null;
|
|
526
|
+
/**
|
|
527
|
+
* ID of the parent account.
|
|
528
|
+
* @format GUID
|
|
529
|
+
*/
|
|
530
|
+
parentAccountId?: string | null;
|
|
531
|
+
/**
|
|
532
|
+
* ID of the site, if applicable.
|
|
533
|
+
* @format GUID
|
|
534
|
+
*/
|
|
535
|
+
siteId?: string | null;
|
|
536
|
+
}
|
|
520
537
|
interface BaseEventMetadata {
|
|
521
538
|
/**
|
|
522
539
|
* App instance ID.
|
|
@@ -812,4 +829,4 @@ interface ListEarningRulesOptions {
|
|
|
812
829
|
triggerActivityType?: string | null;
|
|
813
830
|
}
|
|
814
831
|
|
|
815
|
-
export { type ActionEvent, type AppInstallationInLoyaltySite, type ApplicationError, type BaseEventMetadata, type BulkActionMetadata, type BulkCreateLoyaltyEarningRulesRequest, type BulkCreateLoyaltyEarningRulesResponse, type BulkLoyaltyEarningRuleResult, type CacheInvalidated, type ConversionRate, type ConversionRateConfig, type CreateCustomLoyaltyEarningRuleOptions, type CreateCustomLoyaltyEarningRuleRequest, type CreateCustomLoyaltyEarningRuleResponse, type CreateLoyaltyEarningRuleRequest, type CreateLoyaltyEarningRuleResponse, type CursorPaging, type Cursors, type CustomLoyaltyEarningRule, type CustomLoyaltyEarningRuleTypeOneOf, type DeleteAutomationEarningRuleRequest, type DeleteAutomationEarningRuleResponse, type DeleteLoyaltyEarningRuleOptions, type DeleteLoyaltyEarningRuleRequest, type DeleteLoyaltyEarningRuleResponse, type DomainEvent, type DomainEventBodyOneOf, type EarningRuleDisabled, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type FixedAmount, type FixedAmountConfig, type GetLoyaltyEarningRuleRequest, type GetLoyaltyEarningRuleResponse, type IdentificationData, type IdentificationDataIdOneOf, type InvalidateEarningRuleCacheRequest, type InvalidateEarningRuleCacheResponse, type ItemMetadata, type ListEarningRulesInTierRequest, type ListEarningRulesInTierResponse, type ListEarningRulesOptions, type ListEarningRulesRequest, type ListEarningRulesResponse, type LoyaltyEarningRule, type LoyaltyEarningRuleCreatedEnvelope, type LoyaltyEarningRuleDeletedEnvelope, type LoyaltyEarningRuleTypeOneOf, type LoyaltyEarningRuleTypeTag, LoyaltyEarningRuleTypeTagType, type LoyaltyEarningRuleTypeTagTypeWithLiterals, type LoyaltyEarningRuleUpdatedEnvelope, type MessageEnvelope, type Metadata, type PagingMetadataV2, type RestoreInfo, Status, type StatusWithLiterals, Type, type TypeWithLiterals, type UpdateLoyaltyEarningRule, type UpdateLoyaltyEarningRuleRequest, type UpdateLoyaltyEarningRuleResponse, V1Type, type V1TypeWithLiterals, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, bulkCreateLoyaltyEarningRules, createCustomLoyaltyEarningRule, createLoyaltyEarningRule, deleteAutomationEarningRule, deleteLoyaltyEarningRule, getLoyaltyEarningRule, listEarningRules, onLoyaltyEarningRuleCreated, onLoyaltyEarningRuleDeleted, onLoyaltyEarningRuleUpdated, updateLoyaltyEarningRule };
|
|
832
|
+
export { type AccountDetails, type ActionEvent, type AppInstallationInLoyaltySite, type ApplicationError, type BaseEventMetadata, type BulkActionMetadata, type BulkCreateLoyaltyEarningRulesRequest, type BulkCreateLoyaltyEarningRulesResponse, type BulkLoyaltyEarningRuleResult, type CacheInvalidated, type ConversionRate, type ConversionRateConfig, type CreateCustomLoyaltyEarningRuleOptions, type CreateCustomLoyaltyEarningRuleRequest, type CreateCustomLoyaltyEarningRuleResponse, type CreateLoyaltyEarningRuleRequest, type CreateLoyaltyEarningRuleResponse, type CursorPaging, type Cursors, type CustomLoyaltyEarningRule, type CustomLoyaltyEarningRuleTypeOneOf, type DeleteAutomationEarningRuleRequest, type DeleteAutomationEarningRuleResponse, type DeleteLoyaltyEarningRuleOptions, type DeleteLoyaltyEarningRuleRequest, type DeleteLoyaltyEarningRuleResponse, type DomainEvent, type DomainEventBodyOneOf, type EarningRuleDisabled, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type FixedAmount, type FixedAmountConfig, type GetLoyaltyEarningRuleRequest, type GetLoyaltyEarningRuleResponse, type IdentificationData, type IdentificationDataIdOneOf, type InvalidateEarningRuleCacheRequest, type InvalidateEarningRuleCacheResponse, type ItemMetadata, type ListEarningRulesInTierRequest, type ListEarningRulesInTierResponse, type ListEarningRulesOptions, type ListEarningRulesRequest, type ListEarningRulesResponse, type LoyaltyEarningRule, type LoyaltyEarningRuleCreatedEnvelope, type LoyaltyEarningRuleDeletedEnvelope, type LoyaltyEarningRuleTypeOneOf, type LoyaltyEarningRuleTypeTag, LoyaltyEarningRuleTypeTagType, type LoyaltyEarningRuleTypeTagTypeWithLiterals, type LoyaltyEarningRuleUpdatedEnvelope, type MessageEnvelope, type Metadata, type PagingMetadataV2, type RestoreInfo, Status, type StatusWithLiterals, Type, type TypeWithLiterals, type UpdateLoyaltyEarningRule, type UpdateLoyaltyEarningRuleRequest, type UpdateLoyaltyEarningRuleResponse, V1Type, type V1TypeWithLiterals, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, bulkCreateLoyaltyEarningRules, createCustomLoyaltyEarningRule, createLoyaltyEarningRule, deleteAutomationEarningRule, deleteLoyaltyEarningRule, getLoyaltyEarningRule, listEarningRules, onLoyaltyEarningRuleCreated, onLoyaltyEarningRuleDeleted, onLoyaltyEarningRuleUpdated, updateLoyaltyEarningRule };
|