@wix/auto_sdk_loyalty_earning-rules 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.context.d.ts +28 -0
  11. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.context.js +35 -0
  12. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.context.js.map +1 -0
  13. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.http.d.ts +48 -0
  14. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.http.js +353 -0
  15. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.http.js.map +1 -0
  16. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.meta.d.ts +28 -0
  17. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.meta.js +180 -0
  18. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.meta.js.map +1 -0
  19. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.d.ts +93 -0
  20. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.js +93 -0
  21. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.js.map +1 -0
  22. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.d.ts +483 -0
  23. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.js +37 -0
  24. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.js.map +1 -0
  25. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.d.ts +762 -0
  26. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.js +383 -0
  27. package/build/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.context.d.ts +28 -0
  39. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.context.js +28 -0
  40. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.context.js.map +1 -0
  41. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.http.d.ts +48 -0
  42. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.http.js +342 -0
  43. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.http.js.map +1 -0
  44. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.meta.d.ts +28 -0
  45. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.meta.js +146 -0
  46. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.meta.js.map +1 -0
  47. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.d.ts +93 -0
  48. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.js +78 -0
  49. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.js.map +1 -0
  50. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.d.ts +483 -0
  51. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.js +34 -0
  52. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.js.map +1 -0
  53. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.d.ts +762 -0
  54. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.js +349 -0
  55. package/build/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.context.d.ts +28 -0
  66. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.context.js +35 -0
  67. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.context.js.map +1 -0
  68. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.http.d.ts +48 -0
  69. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.http.js +353 -0
  70. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.http.js.map +1 -0
  71. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.meta.d.ts +28 -0
  72. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.meta.js +180 -0
  73. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.meta.js.map +1 -0
  74. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.d.ts +93 -0
  75. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.js +93 -0
  76. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.js.map +1 -0
  77. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.d.ts +488 -0
  78. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.js +37 -0
  79. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.js.map +1 -0
  80. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.d.ts +772 -0
  81. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.js +383 -0
  82. package/build/internal/cjs/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.context.d.ts +28 -0
  93. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.context.js +28 -0
  94. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.context.js.map +1 -0
  95. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.http.d.ts +48 -0
  96. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.http.js +342 -0
  97. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.http.js.map +1 -0
  98. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.meta.d.ts +28 -0
  99. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.meta.js +146 -0
  100. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.meta.js.map +1 -0
  101. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.d.ts +93 -0
  102. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.js +78 -0
  103. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.public.js.map +1 -0
  104. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.d.ts +488 -0
  105. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.js +34 -0
  106. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.types.js.map +1 -0
  107. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.d.ts +772 -0
  108. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.js +349 -0
  109. package/build/internal/es/src/loyalty-v1-loyalty-earning-rule-earning-rules.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,78 @@
1
+ import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';
2
+ import { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';
3
+ import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
4
+ import { EventDefinition } from '@wix/sdk-types';
5
+ import { bulkCreateLoyaltyEarningRules as universalBulkCreateLoyaltyEarningRules, createCustomLoyaltyEarningRule as universalCreateCustomLoyaltyEarningRule, createLoyaltyEarningRule as universalCreateLoyaltyEarningRule, deleteAutomationEarningRule as universalDeleteAutomationEarningRule, deleteLoyaltyEarningRule as universalDeleteLoyaltyEarningRule, getLoyaltyEarningRule as universalGetLoyaltyEarningRule, listEarningRules as universalListEarningRules, updateLoyaltyEarningRule as universalUpdateLoyaltyEarningRule, } from './loyalty-v1-loyalty-earning-rule-earning-rules.universal.js';
6
+ export const __metadata = { PACKAGE_NAME: '@wix/loyalty' };
7
+ export function createLoyaltyEarningRule(httpClient) {
8
+ return (earningRule) => universalCreateLoyaltyEarningRule(earningRule,
9
+ // @ts-ignore
10
+ { httpClient });
11
+ }
12
+ export function bulkCreateLoyaltyEarningRules(httpClient) {
13
+ return (earningRules) => universalBulkCreateLoyaltyEarningRules(earningRules,
14
+ // @ts-ignore
15
+ { httpClient });
16
+ }
17
+ export function createCustomLoyaltyEarningRule(httpClient) {
18
+ return (type, options) => universalCreateCustomLoyaltyEarningRule(type, options,
19
+ // @ts-ignore
20
+ { httpClient });
21
+ }
22
+ export function getLoyaltyEarningRule(httpClient) {
23
+ return (_id) => universalGetLoyaltyEarningRule(_id,
24
+ // @ts-ignore
25
+ { httpClient });
26
+ }
27
+ export function updateLoyaltyEarningRule(httpClient) {
28
+ return (_id, earningRule) => universalUpdateLoyaltyEarningRule(_id, earningRule,
29
+ // @ts-ignore
30
+ { httpClient });
31
+ }
32
+ export function deleteLoyaltyEarningRule(httpClient) {
33
+ return (_id, options) => universalDeleteLoyaltyEarningRule(_id, options,
34
+ // @ts-ignore
35
+ { httpClient });
36
+ }
37
+ export function deleteAutomationEarningRule(httpClient) {
38
+ return (_id) => universalDeleteAutomationEarningRule(_id,
39
+ // @ts-ignore
40
+ { httpClient });
41
+ }
42
+ export function listEarningRules(httpClient) {
43
+ return (options) => universalListEarningRules(options,
44
+ // @ts-ignore
45
+ { httpClient });
46
+ }
47
+ export const onLoyaltyEarningRuleCreated = EventDefinition('wix.loyalty.v1.loyalty_earning_rule_created', true, (event) => renameKeysFromRESTResponseToSDKResponse(transformPaths(event, [
48
+ {
49
+ transformFn: transformRESTTimestampToSDKTimestamp,
50
+ paths: [
51
+ { path: 'entity.createdDate' },
52
+ { path: 'entity.updatedDate' },
53
+ { path: 'metadata.eventTime' },
54
+ ],
55
+ },
56
+ ])))();
57
+ export const onLoyaltyEarningRuleDeleted = EventDefinition('wix.loyalty.v1.loyalty_earning_rule_deleted', true, (event) => renameKeysFromRESTResponseToSDKResponse(transformPaths(event, [
58
+ {
59
+ transformFn: transformRESTTimestampToSDKTimestamp,
60
+ paths: [
61
+ { path: 'undefined.createdDate' },
62
+ { path: 'undefined.updatedDate' },
63
+ { path: 'metadata.eventTime' },
64
+ ],
65
+ },
66
+ ])))();
67
+ export const onLoyaltyEarningRuleUpdated = EventDefinition('wix.loyalty.v1.loyalty_earning_rule_updated', true, (event) => renameKeysFromRESTResponseToSDKResponse(transformPaths(event, [
68
+ {
69
+ transformFn: transformRESTTimestampToSDKTimestamp,
70
+ paths: [
71
+ { path: 'entity.createdDate' },
72
+ { path: 'entity.updatedDate' },
73
+ { path: 'metadata.eventTime' },
74
+ ],
75
+ },
76
+ ])))();
77
+ export { LoyaltyEarningRuleTypeTagType, Status, Type, WebhookIdentityType, } from './loyalty-v1-loyalty-earning-rule-earning-rules.universal.js';
78
+ //# sourceMappingURL=loyalty-v1-loyalty-earning-rule-earning-rules.public.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loyalty-v1-loyalty-earning-rule-earning-rules.public.js","sourceRoot":"","sources":["../../../src/loyalty-v1-loyalty-earning-rule-earning-rules.public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uCAAuC,EAAE,MAAM,yCAAyC,CAAC;AAClG,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAClF,OAAO,EAAE,eAAe,EAAc,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAmBL,6BAA6B,IAAI,sCAAsC,EACvE,8BAA8B,IAAI,uCAAuC,EACzE,wBAAwB,IAAI,iCAAiC,EAC7D,2BAA2B,IAAI,oCAAoC,EACnE,wBAAwB,IAAI,iCAAiC,EAC7D,qBAAqB,IAAI,8BAA8B,EACvD,gBAAgB,IAAI,yBAAyB,EAC7C,wBAAwB,IAAI,iCAAiC,GAC9D,MAAM,8DAA8D,CAAC;AAEtE,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC;AAE3D,MAAM,UAAU,wBAAwB,CAC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ACN,IAAI,EAKJ,mBAAmB,GACpB,MAAM,8DAA8D,CAAC"}
@@ -0,0 +1,483 @@
1
+ /**
2
+ * A loyalty earning rule defines how customers earn points in a loyalty program.
3
+ * You can create rules for different activities, such as making purchases.
4
+ */
5
+ export interface LoyaltyEarningRule extends LoyaltyEarningRuleTypeOneOf {
6
+ /** Fixed amount of points awarded for each qualifying activity. */
7
+ fixedAmount?: FixedAmount;
8
+ /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */
9
+ conversionRate?: ConversionRate;
10
+ /**
11
+ * Loyalty earning rule ID.
12
+ * @readonly
13
+ */
14
+ id?: string | null;
15
+ /** ID of the app managing the earning rule. Can be a loyalty app ID or a Wix automations app ID. */
16
+ sourceAppId?: string;
17
+ /** ID of the app that triggers point assignment. Examples: Wix Stores, Wix Bookings, Wix Events. */
18
+ triggerAppId?: string;
19
+ /** Type of activity that triggers point assignment. For example, `wix-restaurants/orderSubmitted` or `birthday`. */
20
+ triggerActivityType?: string;
21
+ /** Name of the earning rule. */
22
+ title?: string;
23
+ /** Current status of the earning rule. */
24
+ status?: Status;
25
+ /**
26
+ * Revision number, incremented by 1 each time the earning rule is updated.
27
+ * Pass the latest revision when updating to prevent conflicting changes.
28
+ */
29
+ revision?: string | null;
30
+ /**
31
+ * Date and time the earning rule was created.
32
+ * @readonly
33
+ */
34
+ createdDate?: Date | null;
35
+ /**
36
+ * Date and time the earning rule was last updated.
37
+ * @readonly
38
+ */
39
+ updatedDate?: Date | null;
40
+ /**
41
+ * Additional metadata about the earning rule.
42
+ * @readonly
43
+ */
44
+ metadata?: Metadata;
45
+ }
46
+ /** @oneof */
47
+ export interface LoyaltyEarningRuleTypeOneOf {
48
+ /** Fixed amount of points awarded for each qualifying activity. */
49
+ fixedAmount?: FixedAmount;
50
+ /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */
51
+ conversionRate?: ConversionRate;
52
+ }
53
+ /** Fixed amount type of earning rule. */
54
+ export interface FixedAmount {
55
+ /** Fixed amount configurations for each tier. */
56
+ configs?: FixedAmountConfig[];
57
+ }
58
+ export interface FixedAmountConfig {
59
+ /**
60
+ * Tier ID. If empty, the [base tier](https://dev.wix.com/docs/rest/crm/loyalty-program/tiers/introduction#terminology) is used.
61
+ * @readonly
62
+ */
63
+ tierId?: string | null;
64
+ /** Number of points to award. */
65
+ points?: number;
66
+ }
67
+ /**
68
+ * Conversion rate type of earning rule.
69
+ * Customers earn points based on the amount spent.
70
+ * For example, for every $10 spent, a customer might earn 1 point.
71
+ */
72
+ export interface ConversionRate {
73
+ /**
74
+ * Conversion rate configurations for each tier.
75
+ *
76
+ * Points are awarded proportionally to the amount spent.
77
+ *
78
+ * Formula: `(amount spent) / (money_amount * points)`.
79
+ */
80
+ configs?: ConversionRateConfig[];
81
+ /**
82
+ * 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.
83
+ * For example, if set to "priceSummary.totalAmount", the rule uses the total order amount to calculate loyalty points to be awarded.
84
+ * This field is only applicable for automated earning rules.
85
+ */
86
+ field?: string | null;
87
+ }
88
+ export interface ConversionRateConfig {
89
+ /**
90
+ * Tier ID. If empty, the [base tier](https://dev.wix.com/docs/rest/crm/loyalty-program/tiers/introduction) is used.
91
+ * @readonly
92
+ */
93
+ tierId?: string | null;
94
+ /**
95
+ * The amount of money used as a reference for point calculation.
96
+ * Points are awarded proportionally to the amount spent.
97
+ *
98
+ * For example, if set to 10, 1 point is awarded for every 10 units of currency spent (assuming `points` is set to 1).
99
+ *
100
+ * Formula for points is: `(amount spent) / (money_amount * points)`.
101
+ */
102
+ moneyAmount?: number;
103
+ /**
104
+ * Points given for the specified `money_amount`.
105
+ * Works in conjunction with `money_amount` to define the earning rule.
106
+ *
107
+ * For example: If `money_amount` is 20 and `points` is 10:
108
+ * - Spending 10 units of currency earns 5 points
109
+ * - Spending 20 units of currency earns 10 points
110
+ * - Spending 30 units of currency earns 15 points
111
+ */
112
+ points?: number;
113
+ }
114
+ export declare enum Status {
115
+ /** Status is unknown or not specified. */
116
+ UNKNOWN = "UNKNOWN",
117
+ /** Earning rule is active and can assign points. */
118
+ ACTIVE = "ACTIVE",
119
+ /** Earning rule is paused and can't assign points. */
120
+ PAUSED = "PAUSED"
121
+ }
122
+ export interface Metadata {
123
+ /** Whether the earning rule can be deleted. */
124
+ canBeDeleted?: boolean;
125
+ }
126
+ export interface LoyaltyEarningRuleTypeTag {
127
+ /** Type of custom earning rule. */
128
+ ruleType?: LoyaltyEarningRuleTypeTagType;
129
+ }
130
+ export declare enum LoyaltyEarningRuleTypeTagType {
131
+ /** Type is unknown or not specified. */
132
+ UNKNOWN_TYPE = "UNKNOWN_TYPE",
133
+ /** Earning rule for a customer's birthday. */
134
+ BIRTHDAY = "BIRTHDAY"
135
+ }
136
+ export interface EarningRuleDisabled {
137
+ }
138
+ export interface CreateLoyaltyEarningRuleRequest {
139
+ /** Earning rule to create. */
140
+ earningRule: LoyaltyEarningRule;
141
+ }
142
+ export interface CreateLoyaltyEarningRuleResponse {
143
+ /** Created earning rule. */
144
+ earningRule?: LoyaltyEarningRule;
145
+ }
146
+ export interface BulkCreateLoyaltyEarningRulesRequest {
147
+ /** Earning rules to create. */
148
+ earningRules: LoyaltyEarningRule[];
149
+ }
150
+ export interface BulkCreateLoyaltyEarningRulesResponse {
151
+ /** Created earning rules. */
152
+ results?: BulkLoyaltyEarningRuleResult[];
153
+ /** Additional metadata for the created earning rules. */
154
+ bulkActionMetadata?: BulkActionMetadata;
155
+ }
156
+ export interface BulkLoyaltyEarningRuleResult {
157
+ /** Additional metadata for the created earning rules. */
158
+ itemMetadata?: ItemMetadata;
159
+ /** Created earning rule. */
160
+ item?: LoyaltyEarningRule;
161
+ }
162
+ export interface ItemMetadata {
163
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
164
+ id?: string | null;
165
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
166
+ originalIndex?: number;
167
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
168
+ success?: boolean;
169
+ /** Details about the error in case of failure. */
170
+ error?: ApplicationError;
171
+ }
172
+ export interface ApplicationError {
173
+ /** Error code. */
174
+ code?: string;
175
+ /** Description of the error. */
176
+ description?: string;
177
+ /** Data related to the error. */
178
+ data?: Record<string, any> | null;
179
+ }
180
+ export interface BulkActionMetadata {
181
+ /** Number of items that were successfully processed. */
182
+ totalSuccesses?: number;
183
+ /** Number of items that couldn't be processed. */
184
+ totalFailures?: number;
185
+ /** Number of failures without details because detailed failure threshold was exceeded. */
186
+ undetailedFailures?: number;
187
+ }
188
+ export interface CreateCustomLoyaltyEarningRuleRequest {
189
+ /** Type of the custom earning rule. */
190
+ type: Type;
191
+ /** Custom earning rule to create. */
192
+ earningRule?: CustomLoyaltyEarningRule;
193
+ }
194
+ export declare enum Type {
195
+ /** Unknown type. This value is not used. */
196
+ UNKNOWN_TYPE = "UNKNOWN_TYPE",
197
+ /** Earning rule for social media. */
198
+ SOCIAL_MEDIA = "SOCIAL_MEDIA",
199
+ /** Earning rule for birthdays. */
200
+ BIRTHDAY = "BIRTHDAY"
201
+ }
202
+ /** Used in CreateCustomLoyaltyEarningRuleRequest */
203
+ export interface CustomLoyaltyEarningRule extends CustomLoyaltyEarningRuleTypeOneOf {
204
+ /** Fixed amount of points awarded for each qualifying activity. */
205
+ fixedAmount?: FixedAmount;
206
+ /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */
207
+ conversionRate?: ConversionRate;
208
+ /** Name of the earning rule. */
209
+ title?: string;
210
+ }
211
+ /** @oneof */
212
+ export interface CustomLoyaltyEarningRuleTypeOneOf {
213
+ /** Fixed amount of points awarded for each qualifying activity. */
214
+ fixedAmount?: FixedAmount;
215
+ /** Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`. */
216
+ conversionRate?: ConversionRate;
217
+ }
218
+ export interface CreateCustomLoyaltyEarningRuleResponse {
219
+ /** Created earning rule. */
220
+ earningRule?: LoyaltyEarningRule;
221
+ }
222
+ export interface GetLoyaltyEarningRuleRequest {
223
+ /** ID of the earning rule to retrieve. */
224
+ id: string;
225
+ }
226
+ export interface GetLoyaltyEarningRuleResponse {
227
+ /** Retrieved earning rule. */
228
+ earningRule?: LoyaltyEarningRule;
229
+ }
230
+ export interface UpdateLoyaltyEarningRuleRequest {
231
+ /** Earning rule to update. */
232
+ earningRule: LoyaltyEarningRule;
233
+ }
234
+ export interface UpdateLoyaltyEarningRuleResponse {
235
+ /** The updated earning rule. */
236
+ earningRule?: LoyaltyEarningRule;
237
+ }
238
+ export interface DeleteLoyaltyEarningRuleRequest {
239
+ /** ID of the earning rule to delete. */
240
+ id: string;
241
+ /**
242
+ * Revision of the earning rule. Incremented by 1 each time the earning rule is updated.
243
+ * Pass the latest revision when updating to prevent conflicting changes.
244
+ */
245
+ revision?: string;
246
+ }
247
+ export interface DeleteLoyaltyEarningRuleResponse {
248
+ }
249
+ export interface DeleteAutomationEarningRuleRequest {
250
+ /** ID of the earning rule to delete. */
251
+ id: string;
252
+ }
253
+ export interface DeleteAutomationEarningRuleResponse {
254
+ }
255
+ export interface ListEarningRulesRequest {
256
+ /** App ID that triggers the point assignment. For example, `9a5d83fd-8570-482e-81ab-cfa88942ee60`. */
257
+ triggerAppId?: string | null;
258
+ /** Type of activity that triggers the point assignment. For example, `restaurants-order-is-pending`. */
259
+ triggerActivityType?: string | null;
260
+ }
261
+ export interface ListEarningRulesResponse {
262
+ /** Retrieved earning rules. */
263
+ earningRules?: LoyaltyEarningRule[];
264
+ }
265
+ export interface ListEarningRulesInTierRequest {
266
+ /** ID of the tier for which the earning rules will be returned. */
267
+ tierId?: string | null;
268
+ /** Pagination options. */
269
+ paging?: CursorPaging;
270
+ }
271
+ export interface CursorPaging {
272
+ /** Maximum number of items to return in the results. */
273
+ limit?: number | null;
274
+ /**
275
+ * Pointer to the next or previous page in the list of results.
276
+ *
277
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
278
+ * Not relevant for the first request.
279
+ */
280
+ cursor?: string | null;
281
+ }
282
+ export interface ListEarningRulesInTierResponse {
283
+ /** Retrieved earning rules. */
284
+ earningRules?: LoyaltyEarningRule[];
285
+ /** Details on the paged set of results returned. */
286
+ pagingMetadata?: PagingMetadataV2;
287
+ }
288
+ export interface PagingMetadataV2 {
289
+ /** Number of items returned in the response. */
290
+ count?: number | null;
291
+ /** Offset that was requested. */
292
+ offset?: number | null;
293
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
294
+ total?: number | null;
295
+ /** Flag that indicates the server failed to calculate the `total` field. */
296
+ tooManyToCount?: boolean | null;
297
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
298
+ cursors?: Cursors;
299
+ }
300
+ export interface Cursors {
301
+ /** Cursor string pointing to the next page in the list of results. */
302
+ next?: string | null;
303
+ /** Cursor pointing to the previous page in the list of results. */
304
+ prev?: string | null;
305
+ }
306
+ export interface DomainEvent extends DomainEventBodyOneOf {
307
+ createdEvent?: EntityCreatedEvent;
308
+ updatedEvent?: EntityUpdatedEvent;
309
+ deletedEvent?: EntityDeletedEvent;
310
+ actionEvent?: ActionEvent;
311
+ /**
312
+ * Unique event ID.
313
+ * Allows clients to ignore duplicate webhooks.
314
+ */
315
+ id?: string;
316
+ /**
317
+ * Assumes actions are also always typed to an entity_type
318
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
319
+ */
320
+ entityFqdn?: string;
321
+ /**
322
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
323
+ * This is although the created/updated/deleted notion is duplication of the oneof types
324
+ * Example: created/updated/deleted/started/completed/email_opened
325
+ */
326
+ slug?: string;
327
+ /** ID of the entity associated with the event. */
328
+ entityId?: string;
329
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
330
+ eventTime?: Date | null;
331
+ /**
332
+ * Whether the event was triggered as a result of a privacy regulation application
333
+ * (for example, GDPR).
334
+ */
335
+ triggeredByAnonymizeRequest?: boolean | null;
336
+ /** If present, indicates the action that triggered the event. */
337
+ originatedFrom?: string | null;
338
+ /**
339
+ * A sequence number defining the order of updates to the underlying entity.
340
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
341
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
342
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
343
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
344
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
345
+ */
346
+ entityEventSequence?: string | null;
347
+ }
348
+ /** @oneof */
349
+ export interface DomainEventBodyOneOf {
350
+ createdEvent?: EntityCreatedEvent;
351
+ updatedEvent?: EntityUpdatedEvent;
352
+ deletedEvent?: EntityDeletedEvent;
353
+ actionEvent?: ActionEvent;
354
+ }
355
+ export interface EntityCreatedEvent {
356
+ entityAsJson?: string;
357
+ /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */
358
+ restoreInfo?: RestoreInfo;
359
+ }
360
+ export interface RestoreInfo {
361
+ deletedDate?: Date | null;
362
+ }
363
+ export interface EntityUpdatedEvent {
364
+ /**
365
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
366
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
367
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
368
+ */
369
+ currentEntityAsJson?: string;
370
+ }
371
+ export interface EntityDeletedEvent {
372
+ /** Entity that was deleted */
373
+ deletedEntityAsJson?: string | null;
374
+ }
375
+ export interface ActionEvent {
376
+ bodyAsJson?: string;
377
+ }
378
+ export interface Empty {
379
+ }
380
+ export interface MessageEnvelope {
381
+ /** App instance ID. */
382
+ instanceId?: string | null;
383
+ /** Event type. */
384
+ eventType?: string;
385
+ /** The identification type and identity data. */
386
+ identity?: IdentificationData;
387
+ /** Stringify payload. */
388
+ data?: string;
389
+ }
390
+ export interface IdentificationData extends IdentificationDataIdOneOf {
391
+ /** ID of a site visitor that has not logged in to the site. */
392
+ anonymousVisitorId?: string;
393
+ /** ID of a site visitor that has logged in to the site. */
394
+ memberId?: string;
395
+ /** ID of a Wix user (site owner, contributor, etc.). */
396
+ wixUserId?: string;
397
+ /** ID of an app. */
398
+ appId?: string;
399
+ /** @readonly */
400
+ identityType?: WebhookIdentityType;
401
+ }
402
+ /** @oneof */
403
+ export interface IdentificationDataIdOneOf {
404
+ /** ID of a site visitor that has not logged in to the site. */
405
+ anonymousVisitorId?: string;
406
+ /** ID of a site visitor that has logged in to the site. */
407
+ memberId?: string;
408
+ /** ID of a Wix user (site owner, contributor, etc.). */
409
+ wixUserId?: string;
410
+ /** ID of an app. */
411
+ appId?: string;
412
+ }
413
+ export declare enum WebhookIdentityType {
414
+ UNKNOWN = "UNKNOWN",
415
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
416
+ MEMBER = "MEMBER",
417
+ WIX_USER = "WIX_USER",
418
+ APP = "APP"
419
+ }
420
+ interface FixedAmountConfigNonNullableFields {
421
+ points: number;
422
+ }
423
+ interface FixedAmountNonNullableFields {
424
+ configs: FixedAmountConfigNonNullableFields[];
425
+ }
426
+ interface ConversionRateConfigNonNullableFields {
427
+ moneyAmount: number;
428
+ points: number;
429
+ }
430
+ interface ConversionRateNonNullableFields {
431
+ configs: ConversionRateConfigNonNullableFields[];
432
+ }
433
+ interface MetadataNonNullableFields {
434
+ canBeDeleted: boolean;
435
+ }
436
+ interface LoyaltyEarningRuleNonNullableFields {
437
+ fixedAmount?: FixedAmountNonNullableFields;
438
+ conversionRate?: ConversionRateNonNullableFields;
439
+ sourceAppId: string;
440
+ triggerAppId: string;
441
+ triggerActivityType: string;
442
+ title: string;
443
+ status: Status;
444
+ metadata?: MetadataNonNullableFields;
445
+ }
446
+ export interface CreateLoyaltyEarningRuleResponseNonNullableFields {
447
+ earningRule?: LoyaltyEarningRuleNonNullableFields;
448
+ }
449
+ interface ApplicationErrorNonNullableFields {
450
+ code: string;
451
+ description: string;
452
+ }
453
+ interface ItemMetadataNonNullableFields {
454
+ originalIndex: number;
455
+ success: boolean;
456
+ error?: ApplicationErrorNonNullableFields;
457
+ }
458
+ interface BulkLoyaltyEarningRuleResultNonNullableFields {
459
+ itemMetadata?: ItemMetadataNonNullableFields;
460
+ item?: LoyaltyEarningRuleNonNullableFields;
461
+ }
462
+ interface BulkActionMetadataNonNullableFields {
463
+ totalSuccesses: number;
464
+ totalFailures: number;
465
+ undetailedFailures: number;
466
+ }
467
+ export interface BulkCreateLoyaltyEarningRulesResponseNonNullableFields {
468
+ results: BulkLoyaltyEarningRuleResultNonNullableFields[];
469
+ bulkActionMetadata?: BulkActionMetadataNonNullableFields;
470
+ }
471
+ export interface CreateCustomLoyaltyEarningRuleResponseNonNullableFields {
472
+ earningRule?: LoyaltyEarningRuleNonNullableFields;
473
+ }
474
+ export interface GetLoyaltyEarningRuleResponseNonNullableFields {
475
+ earningRule?: LoyaltyEarningRuleNonNullableFields;
476
+ }
477
+ export interface UpdateLoyaltyEarningRuleResponseNonNullableFields {
478
+ earningRule?: LoyaltyEarningRuleNonNullableFields;
479
+ }
480
+ export interface ListEarningRulesResponseNonNullableFields {
481
+ earningRules: LoyaltyEarningRuleNonNullableFields[];
482
+ }
483
+ export {};
@@ -0,0 +1,34 @@
1
+ export var Status;
2
+ (function (Status) {
3
+ /** Status is unknown or not specified. */
4
+ Status["UNKNOWN"] = "UNKNOWN";
5
+ /** Earning rule is active and can assign points. */
6
+ Status["ACTIVE"] = "ACTIVE";
7
+ /** Earning rule is paused and can't assign points. */
8
+ Status["PAUSED"] = "PAUSED";
9
+ })(Status || (Status = {}));
10
+ export var LoyaltyEarningRuleTypeTagType;
11
+ (function (LoyaltyEarningRuleTypeTagType) {
12
+ /** Type is unknown or not specified. */
13
+ LoyaltyEarningRuleTypeTagType["UNKNOWN_TYPE"] = "UNKNOWN_TYPE";
14
+ /** Earning rule for a customer's birthday. */
15
+ LoyaltyEarningRuleTypeTagType["BIRTHDAY"] = "BIRTHDAY";
16
+ })(LoyaltyEarningRuleTypeTagType || (LoyaltyEarningRuleTypeTagType = {}));
17
+ export var Type;
18
+ (function (Type) {
19
+ /** Unknown type. This value is not used. */
20
+ Type["UNKNOWN_TYPE"] = "UNKNOWN_TYPE";
21
+ /** Earning rule for social media. */
22
+ Type["SOCIAL_MEDIA"] = "SOCIAL_MEDIA";
23
+ /** Earning rule for birthdays. */
24
+ Type["BIRTHDAY"] = "BIRTHDAY";
25
+ })(Type || (Type = {}));
26
+ export var WebhookIdentityType;
27
+ (function (WebhookIdentityType) {
28
+ WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
29
+ WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
30
+ WebhookIdentityType["MEMBER"] = "MEMBER";
31
+ WebhookIdentityType["WIX_USER"] = "WIX_USER";
32
+ WebhookIdentityType["APP"] = "APP";
33
+ })(WebhookIdentityType || (WebhookIdentityType = {}));
34
+ //# sourceMappingURL=loyalty-v1-loyalty-earning-rule-earning-rules.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loyalty-v1-loyalty-earning-rule-earning-rules.types.js","sourceRoot":"","sources":["../../../src/loyalty-v1-loyalty-earning-rule-earning-rules.types.ts"],"names":[],"mappings":"AAuHA,MAAM,CAAN,IAAY,MAOX;AAPD,WAAY,MAAM;IAChB,0CAA0C;IAC1C,6BAAmB,CAAA;IACnB,oDAAoD;IACpD,2BAAiB,CAAA;IACjB,sDAAsD;IACtD,2BAAiB,CAAA;AACnB,CAAC,EAPW,MAAM,KAAN,MAAM,QAOjB;AAYD,MAAM,CAAN,IAAY,6BAKX;AALD,WAAY,6BAA6B;IACvC,wCAAwC;IACxC,8DAA6B,CAAA;IAC7B,8CAA8C;IAC9C,sDAAqB,CAAA;AACvB,CAAC,EALW,6BAA6B,KAA7B,6BAA6B,QAKxC;AAqED,MAAM,CAAN,IAAY,IAOX;AAPD,WAAY,IAAI;IACd,4CAA4C;IAC5C,qCAA6B,CAAA;IAC7B,qCAAqC;IACrC,qCAA6B,CAAA;IAC7B,kCAAkC;IAClC,6BAAqB,CAAA;AACvB,CAAC,EAPW,IAAI,KAAJ,IAAI,QAOf;AAgPD,MAAM,CAAN,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,8DAAuC,CAAA;IACvC,wCAAiB,CAAA;IACjB,4CAAqB,CAAA;IACrB,kCAAW,CAAA;AACb,CAAC,EANW,mBAAmB,KAAnB,mBAAmB,QAM9B"}