@snagsolutions/sdk 0.1.0-alpha.17 → 0.1.0-alpha.171

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 (278) hide show
  1. package/CHANGELOG.md +1408 -0
  2. package/README.md +13 -23
  3. package/core.d.ts +19 -5
  4. package/core.d.ts.map +1 -1
  5. package/core.js +24 -17
  6. package/core.js.map +1 -1
  7. package/core.mjs +24 -17
  8. package/core.mjs.map +1 -1
  9. package/index.d.mts +9 -6
  10. package/index.d.ts +9 -6
  11. package/index.d.ts.map +1 -1
  12. package/index.js +8 -4
  13. package/index.js.map +1 -1
  14. package/index.mjs +9 -5
  15. package/index.mjs.map +1 -1
  16. package/package.json +4 -5
  17. package/resource.d.ts +1 -1
  18. package/resource.d.ts.map +1 -1
  19. package/resource.js.map +1 -1
  20. package/resource.mjs.map +1 -1
  21. package/resources/assets.d.ts +16 -2
  22. package/resources/assets.d.ts.map +1 -1
  23. package/resources/assets.js +8 -0
  24. package/resources/assets.js.map +1 -1
  25. package/resources/assets.mjs +8 -0
  26. package/resources/assets.mjs.map +1 -1
  27. package/resources/auctions/auctions.d.ts +285 -0
  28. package/resources/auctions/auctions.d.ts.map +1 -0
  29. package/resources/auctions/auctions.js +76 -0
  30. package/resources/auctions/auctions.js.map +1 -0
  31. package/resources/auctions/auctions.mjs +49 -0
  32. package/resources/auctions/auctions.mjs.map +1 -0
  33. package/resources/auctions/index.d.ts +3 -0
  34. package/resources/auctions/index.d.ts.map +1 -0
  35. package/resources/auctions/index.js +9 -0
  36. package/resources/auctions/index.js.map +1 -0
  37. package/resources/auctions/index.mjs +4 -0
  38. package/resources/auctions/index.mjs.map +1 -0
  39. package/resources/auctions/website-user-attributes/index.d.ts +3 -0
  40. package/resources/auctions/website-user-attributes/index.d.ts.map +1 -0
  41. package/resources/auctions/website-user-attributes/index.js +9 -0
  42. package/resources/auctions/website-user-attributes/index.js.map +1 -0
  43. package/resources/auctions/website-user-attributes/index.mjs +4 -0
  44. package/resources/auctions/website-user-attributes/index.mjs.map +1 -0
  45. package/resources/auctions/website-user-attributes/values.d.ts +76 -0
  46. package/resources/auctions/website-user-attributes/values.d.ts.map +1 -0
  47. package/resources/auctions/website-user-attributes/values.js +35 -0
  48. package/resources/auctions/website-user-attributes/values.js.map +1 -0
  49. package/resources/auctions/website-user-attributes/values.mjs +31 -0
  50. package/resources/auctions/website-user-attributes/values.mjs.map +1 -0
  51. package/resources/auctions/website-user-attributes/website-user-attributes.d.ts +92 -0
  52. package/resources/auctions/website-user-attributes/website-user-attributes.d.ts.map +1 -0
  53. package/resources/auctions/website-user-attributes/website-user-attributes.js +69 -0
  54. package/resources/auctions/website-user-attributes/website-user-attributes.js.map +1 -0
  55. package/resources/auctions/website-user-attributes/website-user-attributes.mjs +42 -0
  56. package/resources/auctions/website-user-attributes/website-user-attributes.mjs.map +1 -0
  57. package/resources/auctions/website-user-attributes.d.ts +2 -0
  58. package/resources/auctions/website-user-attributes.d.ts.map +1 -0
  59. package/resources/auctions/website-user-attributes.js +19 -0
  60. package/resources/auctions/website-user-attributes.js.map +1 -0
  61. package/resources/auctions/website-user-attributes.mjs +3 -0
  62. package/resources/auctions/website-user-attributes.mjs.map +1 -0
  63. package/resources/auctions.d.ts +1 -133
  64. package/resources/auctions.d.ts.map +1 -1
  65. package/resources/auctions.js +15 -22
  66. package/resources/auctions.js.map +1 -1
  67. package/resources/auctions.mjs +1 -20
  68. package/resources/auctions.mjs.map +1 -1
  69. package/resources/auth.d.ts +17 -4
  70. package/resources/auth.d.ts.map +1 -1
  71. package/resources/auth.js.map +1 -1
  72. package/resources/auth.mjs.map +1 -1
  73. package/resources/index.d.ts +3 -3
  74. package/resources/index.d.ts.map +1 -1
  75. package/resources/index.js +1 -1
  76. package/resources/index.js.map +1 -1
  77. package/resources/index.mjs +2 -2
  78. package/resources/index.mjs.map +1 -1
  79. package/resources/loyalty/account-streaks.d.ts +81 -0
  80. package/resources/loyalty/account-streaks.d.ts.map +1 -0
  81. package/resources/loyalty/account-streaks.js +24 -0
  82. package/resources/loyalty/account-streaks.js.map +1 -0
  83. package/resources/loyalty/account-streaks.mjs +20 -0
  84. package/resources/loyalty/account-streaks.mjs.map +1 -0
  85. package/resources/loyalty/accounts.d.ts +58 -16
  86. package/resources/loyalty/accounts.d.ts.map +1 -1
  87. package/resources/loyalty/accounts.js +13 -0
  88. package/resources/loyalty/accounts.js.map +1 -1
  89. package/resources/loyalty/accounts.mjs +13 -0
  90. package/resources/loyalty/accounts.mjs.map +1 -1
  91. package/resources/loyalty/badges.d.ts +472 -22
  92. package/resources/loyalty/badges.d.ts.map +1 -1
  93. package/resources/loyalty/badges.js +19 -1
  94. package/resources/loyalty/badges.js.map +1 -1
  95. package/resources/loyalty/badges.mjs +19 -1
  96. package/resources/loyalty/badges.mjs.map +1 -1
  97. package/resources/loyalty/currencies.d.ts +19 -0
  98. package/resources/loyalty/currencies.d.ts.map +1 -1
  99. package/resources/loyalty/currencies.js +19 -0
  100. package/resources/loyalty/currencies.js.map +1 -1
  101. package/resources/loyalty/currencies.mjs +19 -0
  102. package/resources/loyalty/currencies.mjs.map +1 -1
  103. package/resources/loyalty/index.d.ts +4 -4
  104. package/resources/loyalty/index.d.ts.map +1 -1
  105. package/resources/loyalty/index.js +5 -5
  106. package/resources/loyalty/index.js.map +1 -1
  107. package/resources/loyalty/index.mjs +2 -2
  108. package/resources/loyalty/index.mjs.map +1 -1
  109. package/resources/loyalty/loyalty.d.ts +10 -10
  110. package/resources/loyalty/loyalty.d.ts.map +1 -1
  111. package/resources/loyalty/loyalty.js +6 -6
  112. package/resources/loyalty/loyalty.js.map +1 -1
  113. package/resources/loyalty/loyalty.mjs +7 -7
  114. package/resources/loyalty/loyalty.mjs.map +1 -1
  115. package/resources/loyalty/multipliers.d.ts +39 -2
  116. package/resources/loyalty/multipliers.d.ts.map +1 -1
  117. package/resources/loyalty/multipliers.js +23 -0
  118. package/resources/loyalty/multipliers.js.map +1 -1
  119. package/resources/loyalty/multipliers.mjs +23 -0
  120. package/resources/loyalty/multipliers.mjs.map +1 -1
  121. package/resources/loyalty/questions-responses.d.ts +39 -0
  122. package/resources/loyalty/questions-responses.d.ts.map +1 -1
  123. package/resources/loyalty/questions-responses.js +9 -0
  124. package/resources/loyalty/questions-responses.js.map +1 -1
  125. package/resources/loyalty/questions-responses.mjs +9 -0
  126. package/resources/loyalty/questions-responses.mjs.map +1 -1
  127. package/resources/loyalty/questions.d.ts +37 -2
  128. package/resources/loyalty/questions.d.ts.map +1 -1
  129. package/resources/loyalty/questions.js +31 -0
  130. package/resources/loyalty/questions.js.map +1 -1
  131. package/resources/loyalty/questions.mjs +31 -0
  132. package/resources/loyalty/questions.mjs.map +1 -1
  133. package/resources/loyalty/rule-edits.d.ts +2626 -4
  134. package/resources/loyalty/rule-edits.d.ts.map +1 -1
  135. package/resources/loyalty/rule-edits.js +14 -0
  136. package/resources/loyalty/rule-edits.js.map +1 -1
  137. package/resources/loyalty/rule-edits.mjs +14 -0
  138. package/resources/loyalty/rule-edits.mjs.map +1 -1
  139. package/resources/loyalty/rule-groups.d.ts +273 -58
  140. package/resources/loyalty/rule-groups.d.ts.map +1 -1
  141. package/resources/loyalty/rule-groups.js +36 -0
  142. package/resources/loyalty/rule-groups.js.map +1 -1
  143. package/resources/loyalty/rule-groups.mjs +36 -0
  144. package/resources/loyalty/rule-groups.mjs.map +1 -1
  145. package/resources/loyalty/rules.d.ts +1887 -270
  146. package/resources/loyalty/rules.d.ts.map +1 -1
  147. package/resources/loyalty/rules.js +40 -9
  148. package/resources/loyalty/rules.js.map +1 -1
  149. package/resources/loyalty/rules.mjs +40 -9
  150. package/resources/loyalty/rules.mjs.map +1 -1
  151. package/resources/loyalty/transactions/index.d.ts +3 -0
  152. package/resources/loyalty/transactions/index.d.ts.map +1 -0
  153. package/resources/loyalty/transactions/index.js +9 -0
  154. package/resources/loyalty/transactions/index.js.map +1 -0
  155. package/resources/loyalty/transactions/index.mjs +4 -0
  156. package/resources/loyalty/transactions/index.mjs.map +1 -0
  157. package/resources/loyalty/transactions/rule-statuses.d.ts +61 -0
  158. package/resources/loyalty/transactions/rule-statuses.d.ts.map +1 -0
  159. package/resources/loyalty/transactions/rule-statuses.js +23 -0
  160. package/resources/loyalty/transactions/rule-statuses.js.map +1 -0
  161. package/resources/loyalty/transactions/rule-statuses.mjs +19 -0
  162. package/resources/loyalty/transactions/rule-statuses.mjs.map +1 -0
  163. package/resources/loyalty/transactions/transactions.d.ts +292 -0
  164. package/resources/loyalty/transactions/transactions.d.ts.map +1 -0
  165. package/resources/loyalty/transactions/transactions.js +61 -0
  166. package/resources/loyalty/transactions/transactions.js.map +1 -0
  167. package/resources/loyalty/transactions/transactions.mjs +34 -0
  168. package/resources/loyalty/transactions/transactions.mjs.map +1 -0
  169. package/resources/loyalty/transactions.d.ts +1 -247
  170. package/resources/loyalty/transactions.d.ts.map +1 -1
  171. package/resources/loyalty/transactions.js +15 -18
  172. package/resources/loyalty/transactions.js.map +1 -1
  173. package/resources/loyalty/transactions.mjs +1 -16
  174. package/resources/loyalty/transactions.mjs.map +1 -1
  175. package/resources/minting.d.ts +5 -5
  176. package/resources/minting.d.ts.map +1 -1
  177. package/resources/referral/referral.d.ts +11 -3
  178. package/resources/referral/referral.d.ts.map +1 -1
  179. package/resources/referral/referral.js +11 -5
  180. package/resources/referral/referral.js.map +1 -1
  181. package/resources/referral/referral.mjs +11 -5
  182. package/resources/referral/referral.mjs.map +1 -1
  183. package/resources/referral/users.d.ts +28 -1
  184. package/resources/referral/users.d.ts.map +1 -1
  185. package/resources/referral/users.js +14 -0
  186. package/resources/referral/users.js.map +1 -1
  187. package/resources/referral/users.mjs +14 -0
  188. package/resources/referral/users.mjs.map +1 -1
  189. package/resources/users/index.d.ts +1 -1
  190. package/resources/users/index.d.ts.map +1 -1
  191. package/resources/users/index.js.map +1 -1
  192. package/resources/users/index.mjs.map +1 -1
  193. package/resources/users/metadatas.d.ts +27 -0
  194. package/resources/users/metadatas.d.ts.map +1 -1
  195. package/resources/users/metadatas.js.map +1 -1
  196. package/resources/users/metadatas.mjs.map +1 -1
  197. package/resources/users/users.d.ts +159 -6
  198. package/resources/users/users.d.ts.map +1 -1
  199. package/resources/users/users.js +53 -1
  200. package/resources/users/users.js.map +1 -1
  201. package/resources/users/users.mjs +53 -1
  202. package/resources/users/users.mjs.map +1 -1
  203. package/resources/websites/index.d.ts +2 -2
  204. package/resources/websites/index.d.ts.map +1 -1
  205. package/resources/websites/index.js.map +1 -1
  206. package/resources/websites/index.mjs +2 -2
  207. package/resources/websites/index.mjs.map +1 -1
  208. package/resources/websites/website-collections.d.ts +0 -69
  209. package/resources/websites/website-collections.d.ts.map +1 -1
  210. package/resources/websites/website-collections.js +0 -16
  211. package/resources/websites/website-collections.js.map +1 -1
  212. package/resources/websites/website-collections.mjs +0 -16
  213. package/resources/websites/website-collections.mjs.map +1 -1
  214. package/resources/websites/website-user-roles.d.ts +23 -0
  215. package/resources/websites/website-user-roles.d.ts.map +1 -1
  216. package/resources/websites/website-user-roles.js +23 -0
  217. package/resources/websites/website-user-roles.js.map +1 -1
  218. package/resources/websites/website-user-roles.mjs +23 -0
  219. package/resources/websites/website-user-roles.mjs.map +1 -1
  220. package/resources/websites/websites.d.ts +8 -98
  221. package/resources/websites/websites.d.ts.map +1 -1
  222. package/resources/websites/websites.js +0 -6
  223. package/resources/websites/websites.js.map +1 -1
  224. package/resources/websites/websites.mjs +1 -7
  225. package/resources/websites/websites.mjs.map +1 -1
  226. package/src/core.ts +39 -16
  227. package/src/index.ts +30 -11
  228. package/src/resource.ts +1 -1
  229. package/src/resources/assets.ts +18 -2
  230. package/src/resources/auctions/auctions.ts +432 -0
  231. package/src/resources/auctions/index.ts +16 -0
  232. package/src/resources/auctions/website-user-attributes/index.ts +10 -0
  233. package/src/resources/auctions/website-user-attributes/values.ts +97 -0
  234. package/src/resources/auctions/website-user-attributes/website-user-attributes.ts +137 -0
  235. package/src/resources/auctions/website-user-attributes.ts +3 -0
  236. package/src/resources/auctions.ts +1 -207
  237. package/src/resources/auth.ts +21 -5
  238. package/src/resources/index.ts +12 -8
  239. package/src/resources/loyalty/account-streaks.ts +110 -0
  240. package/src/resources/loyalty/accounts.ts +63 -18
  241. package/src/resources/loyalty/badges.ts +567 -24
  242. package/src/resources/loyalty/currencies.ts +19 -0
  243. package/src/resources/loyalty/index.ts +12 -2
  244. package/src/resources/loyalty/loyalty.ts +33 -9
  245. package/src/resources/loyalty/multipliers.ts +43 -4
  246. package/src/resources/loyalty/questions-responses.ts +45 -0
  247. package/src/resources/loyalty/questions.ts +38 -2
  248. package/src/resources/loyalty/rule-edits.ts +3799 -97
  249. package/src/resources/loyalty/rule-groups.ts +465 -65
  250. package/src/resources/loyalty/rules.ts +2906 -313
  251. package/src/resources/loyalty/transactions/index.ts +10 -0
  252. package/src/resources/loyalty/transactions/rule-statuses.ts +87 -0
  253. package/src/resources/loyalty/transactions/transactions.ts +520 -0
  254. package/src/resources/loyalty/transactions.ts +1 -330
  255. package/src/resources/minting.ts +22 -5
  256. package/src/resources/referral/referral.ts +13 -11
  257. package/src/resources/referral/users.ts +33 -2
  258. package/src/resources/users/index.ts +4 -0
  259. package/src/resources/users/metadatas.ts +52 -0
  260. package/src/resources/users/users.ts +213 -5
  261. package/src/resources/websites/index.ts +2 -13
  262. package/src/resources/websites/website-collections.ts +1 -145
  263. package/src/resources/websites/website-user-roles.ts +23 -0
  264. package/src/resources/websites/websites.ts +8 -134
  265. package/src/version.ts +1 -1
  266. package/version.d.ts +1 -1
  267. package/version.d.ts.map +1 -1
  268. package/version.js +1 -1
  269. package/version.js.map +1 -1
  270. package/version.mjs +1 -1
  271. package/version.mjs.map +1 -1
  272. package/resources/loyalty/rule-chains.d.ts +0 -4
  273. package/resources/loyalty/rule-chains.d.ts.map +0 -1
  274. package/resources/loyalty/rule-chains.js +0 -9
  275. package/resources/loyalty/rule-chains.js.map +0 -1
  276. package/resources/loyalty/rule-chains.mjs +0 -5
  277. package/resources/loyalty/rule-chains.mjs.map +0 -1
  278. package/src/resources/loyalty/rule-chains.ts +0 -5
@@ -0,0 +1,292 @@
1
+ import { APIResource } from "../../../resource.js";
2
+ import * as Core from "../../../core.js";
3
+ import * as RuleStatusesAPI from "./rule-statuses.js";
4
+ import { RuleStatusUpdateParams, RuleStatusUpdateResponse, RuleStatuses } from "./rule-statuses.js";
5
+ export declare class Transactions extends APIResource {
6
+ ruleStatuses: RuleStatusesAPI.RuleStatuses;
7
+ /**
8
+ * Create a loyalty transaction to update account balances.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const response =
13
+ * await client.loyalty.transactions.createTransaction({
14
+ * description: 'Purchase of item X',
15
+ * entries: [{ amount: 5 }],
16
+ * });
17
+ * ```
18
+ */
19
+ createTransaction(body: TransactionCreateTransactionParams, options?: Core.RequestOptions): Core.APIPromise<TransactionCreateTransactionResponse>;
20
+ /**
21
+ * Fetch loyalty transaction entries for wallets or users, representing account
22
+ * balance changes.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const response =
27
+ * await client.loyalty.transactions.getTransactionEntries();
28
+ * ```
29
+ */
30
+ getTransactionEntries(query?: TransactionGetTransactionEntriesParams, options?: Core.RequestOptions): Core.APIPromise<TransactionGetTransactionEntriesResponse>;
31
+ getTransactionEntries(options?: Core.RequestOptions): Core.APIPromise<TransactionGetTransactionEntriesResponse>;
32
+ }
33
+ export interface TransactionCreateTransactionResponse {
34
+ id: string;
35
+ createdAt: string;
36
+ description: string;
37
+ entries: Array<TransactionCreateTransactionResponse.Entry>;
38
+ updatedAt: string;
39
+ }
40
+ export declare namespace TransactionCreateTransactionResponse {
41
+ interface Entry {
42
+ amount: number;
43
+ /**
44
+ * Direction of the transaction entry
45
+ */
46
+ direction: 'credit' | 'debit';
47
+ walletAddress: string;
48
+ idempotencyKey?: string;
49
+ }
50
+ }
51
+ export interface TransactionGetTransactionEntriesResponse {
52
+ data: Array<TransactionGetTransactionEntriesResponse.Data>;
53
+ hasNextPage: boolean;
54
+ }
55
+ export declare namespace TransactionGetTransactionEntriesResponse {
56
+ /**
57
+ * Schema for a loyalty transaction entry
58
+ */
59
+ interface Data {
60
+ /**
61
+ * Unique identifier for the transaction entry
62
+ */
63
+ id: string;
64
+ /**
65
+ * Amount involved in the transaction
66
+ */
67
+ amount: number;
68
+ /**
69
+ * Timestamp when the transaction entry was created
70
+ */
71
+ createdAt: string;
72
+ /**
73
+ * Direction of the transaction entry
74
+ */
75
+ direction: 'credit' | 'debit';
76
+ /**
77
+ * Unique identifier for the loyalty account
78
+ */
79
+ loyaltyAccountId: string;
80
+ /**
81
+ * Details of the loyalty transaction
82
+ */
83
+ loyaltyTransaction: Data.LoyaltyTransaction;
84
+ /**
85
+ * Unique identifier for the organization
86
+ */
87
+ organizationId: string;
88
+ /**
89
+ * Type of the loyalty transaction
90
+ */
91
+ type: 'auction_bid' | 'direct_mint' | 'loyalty_rule' | 'api_key' | 'order';
92
+ /**
93
+ * Timestamp when the transaction entry was last updated
94
+ */
95
+ updatedAt: string;
96
+ /**
97
+ * Unique identifier for the website
98
+ */
99
+ websiteId: string;
100
+ /**
101
+ * Optional metadata for the transaction entry
102
+ */
103
+ metadata?: {
104
+ [key: string]: unknown;
105
+ };
106
+ }
107
+ namespace Data {
108
+ /**
109
+ * Details of the loyalty transaction
110
+ */
111
+ interface LoyaltyTransaction {
112
+ /**
113
+ * Unique identifier for the loyalty transaction
114
+ */
115
+ id: string;
116
+ /**
117
+ * Type of the loyalty transaction
118
+ */
119
+ type: 'auction_bid' | 'direct_mint' | 'loyalty_rule' | 'api_key' | 'order';
120
+ /**
121
+ * Details of the loyalty rule associated with the transaction
122
+ */
123
+ loyaltyRule?: LoyaltyTransaction.LoyaltyRule;
124
+ }
125
+ namespace LoyaltyTransaction {
126
+ /**
127
+ * Details of the loyalty rule associated with the transaction
128
+ */
129
+ interface LoyaltyRule {
130
+ /**
131
+ * Unique identifier for the loyalty rule
132
+ */
133
+ id: string;
134
+ /**
135
+ * Type of the loyalty rule
136
+ */
137
+ type: string;
138
+ /**
139
+ * Description of the loyalty rule
140
+ */
141
+ description?: string;
142
+ loyaltyRuleGroupItem?: LoyaltyRule.LoyaltyRuleGroupItem;
143
+ /**
144
+ * Optional metadata for the loyalty rule
145
+ */
146
+ metadata?: {
147
+ [key: string]: unknown;
148
+ };
149
+ /**
150
+ * Name of the loyalty rule
151
+ */
152
+ name?: string;
153
+ }
154
+ namespace LoyaltyRule {
155
+ interface LoyaltyRuleGroupItem {
156
+ loyaltyRuleGroupId: string;
157
+ }
158
+ }
159
+ }
160
+ }
161
+ }
162
+ export interface TransactionCreateTransactionParams {
163
+ /**
164
+ * Description of the loyalty transaction
165
+ */
166
+ description: string;
167
+ /**
168
+ * Array of transaction entries
169
+ */
170
+ entries: Array<TransactionCreateTransactionParams.Entry>;
171
+ /**
172
+ * Unique identifier for the loyalty currency
173
+ */
174
+ loyaltyCurrencyId?: string;
175
+ }
176
+ export declare namespace TransactionCreateTransactionParams {
177
+ interface Entry {
178
+ /**
179
+ * Transaction entry amount.
180
+ */
181
+ amount: number;
182
+ /**
183
+ * Direction of the transaction entry for this wallet address
184
+ */
185
+ direction?: 'credit' | 'debit';
186
+ /**
187
+ * Idempotency key for the transaction entry. Creation will fail if already exists
188
+ * for this wallet address.
189
+ */
190
+ idempotencyKey?: string;
191
+ /**
192
+ * Unique identifier for the loyalty currency for the wallet. Can only use
193
+ * entry-level currency or transaction-level currency.
194
+ */
195
+ loyaltyCurrencyId?: string;
196
+ /**
197
+ * The wallet address of the user
198
+ */
199
+ walletAddress?: string;
200
+ }
201
+ }
202
+ export interface TransactionGetTransactionEntriesParams {
203
+ /**
204
+ * End date to filter by (exclusive, less than)
205
+ */
206
+ createdAtEnd?: string;
207
+ /**
208
+ * Start date to filter by (inclusive, greater than or equal to)
209
+ */
210
+ createdAtStart?: string;
211
+ /**
212
+ * Key to ensure idempotency of the request
213
+ */
214
+ idempotencyKey?: string;
215
+ /**
216
+ * Maximum number of records to return (max 100)
217
+ */
218
+ limit?: number;
219
+ /**
220
+ * UUID of the loyalty currency IDs to filter by. Use this to exclude deleted
221
+ * currencies
222
+ */
223
+ loyaltyCurrencyId?: string | Array<string>;
224
+ /**
225
+ * UUID of the rule group (converted to lowercase)
226
+ */
227
+ loyaltyRuleGroupId?: string;
228
+ /**
229
+ * Unique identifier for the loyalty rule to filter by
230
+ */
231
+ loyaltyRuleId?: string;
232
+ loyaltyRuleType?: 'Bonus' | 'BoughtOn' | 'BoughtWithRoyalties' | 'DiscordMessages' | 'Listing' | 'Lodging' | 'MintOn' | 'PoapClaim' | 'SnagSocialsConnected' | 'SnapshotFullset' | 'SnapshotHold' | 'SoldOn' | 'SoldWithRoyalties' | 'TokenHold' | 'TwitterBio' | 'TwitterHashTagPost' | 'Retweet' | 'check_in' | 'code_entry' | 'connect_wallet' | 'connected_discord' | 'connected_email' | 'connected_epic' | 'connected_steam' | 'connected_telegram' | 'connected_twitter' | 'create_partner_account' | 'discord_member' | 'drip_x_follow' | 'drip_x_new_tweet' | 'drip_x_text_in_bio' | 'drip_x_text_in_comment' | 'drip_x_text_in_name' | 'drip_x_tweet' | 'external_rule' | 'link_click' | 'manual_upload' | 'profile_completed' | 'referred_user' | 'smart_contract_event' | 'snapshot_governance' | 'telegram_join' | 'telegram_messages' | 'text_input' | 'token_hold_erc20' | 'tweet_liked_by_project' | 'twitter_comment' | 'twitter_follow' | 'twitter_followers' | 'twitter_like' | 'twitter_post_hashtag' | 'quiz' | 'poll' | 'steam_wishlist' | 'liquidity_uniswap_v2' | 'liquidity_uniswap_v3' | 'points_airdrop' | 'youtube_subscribers' | 'youtube_comment' | 'shopify_spend' | 'swap' | 'tiktok_post' | 'post_impressions' | 'discord_join' | 'connected_youtube' | 'connected_tiktok' | Array<'Bonus' | 'BoughtOn' | 'BoughtWithRoyalties' | 'DiscordMessages' | 'Listing' | 'Lodging' | 'MintOn' | 'PoapClaim' | 'SnagSocialsConnected' | 'SnapshotFullset' | 'SnapshotHold' | 'SoldOn' | 'SoldWithRoyalties' | 'TokenHold' | 'TwitterBio' | 'TwitterHashTagPost' | 'Retweet' | 'check_in' | 'code_entry' | 'connect_wallet' | 'connected_discord' | 'connected_email' | 'connected_epic' | 'connected_steam' | 'connected_telegram' | 'connected_twitter' | 'create_partner_account' | 'discord_member' | 'drip_x_follow' | 'drip_x_new_tweet' | 'drip_x_text_in_bio' | 'drip_x_text_in_comment' | 'drip_x_text_in_name' | 'drip_x_tweet' | 'external_rule' | 'link_click' | 'manual_upload' | 'profile_completed' | 'referred_user' | 'smart_contract_event' | 'snapshot_governance' | 'telegram_join' | 'telegram_messages' | 'text_input' | 'token_hold_erc20' | 'tweet_liked_by_project' | 'twitter_comment' | 'twitter_follow' | 'twitter_followers' | 'twitter_like' | 'twitter_post_hashtag' | 'quiz' | 'poll' | 'steam_wishlist' | 'liquidity_uniswap_v2' | 'liquidity_uniswap_v3' | 'points_airdrop' | 'youtube_subscribers' | 'youtube_comment' | 'shopify_spend' | 'swap' | 'tiktok_post' | 'post_impressions' | 'discord_join' | 'connected_youtube' | 'connected_tiktok'>;
233
+ /**
234
+ * Unique identifier for the loyalty transaction to filter by
235
+ */
236
+ loyaltyTransactionId?: string;
237
+ /**
238
+ * Unique identifier for the organization to filter by
239
+ */
240
+ organizationId?: string;
241
+ /**
242
+ * Field to sort the results by
243
+ */
244
+ sortBy?: 'createdAt' | 'updatedAt' | 'loyaltyAccountLockVersion';
245
+ /**
246
+ * Direction to sort the results by
247
+ */
248
+ sortDir?: 'asc' | 'desc';
249
+ /**
250
+ * Pagination cursor to start after a specific resource ID
251
+ */
252
+ startingAfter?: string;
253
+ /**
254
+ * Type of the loyalty transaction to filter by
255
+ */
256
+ type?: 'auction_bid' | 'direct_mint' | 'loyalty_rule' | 'api_key' | 'order';
257
+ /**
258
+ * When passed in return the list of fulfilled entries for loyalty rules. If a
259
+ * loyalty rule has a fulfilled entry this means the user cannot currently complete
260
+ * the rule. Must be passed in with userId or walletAddress.
261
+ */
262
+ userCompletedLoyaltyRuleId?: string | Array<string>;
263
+ /**
264
+ * External identifier for the user group controlled by you.
265
+ */
266
+ userGroupExternalIdentifier?: string;
267
+ /**
268
+ * Unique identifier for the user group
269
+ */
270
+ userGroupId?: string;
271
+ /**
272
+ * User ID or array of User IDs to filter by
273
+ */
274
+ userId?: string | Array<string>;
275
+ /**
276
+ * Wallet address or array of wallet addresses to filter by
277
+ */
278
+ walletAddress?: string | Array<string>;
279
+ /**
280
+ * Identifier for the wallet group to filter by
281
+ */
282
+ walletGroupIdentifier?: string;
283
+ /**
284
+ * Unique identifier for the website to filter by
285
+ */
286
+ websiteId?: string;
287
+ }
288
+ export declare namespace Transactions {
289
+ export { type TransactionCreateTransactionResponse as TransactionCreateTransactionResponse, type TransactionGetTransactionEntriesResponse as TransactionGetTransactionEntriesResponse, type TransactionCreateTransactionParams as TransactionCreateTransactionParams, type TransactionGetTransactionEntriesParams as TransactionGetTransactionEntriesParams, };
290
+ export { RuleStatuses as RuleStatuses, type RuleStatusUpdateResponse as RuleStatusUpdateResponse, type RuleStatusUpdateParams as RuleStatusUpdateParams, };
291
+ }
292
+ //# sourceMappingURL=transactions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../../../src/resources/loyalty/transactions/transactions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,eAAe,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEjG,qBAAa,YAAa,SAAQ,WAAW;IAC3C,YAAY,EAAE,eAAe,CAAC,YAAY,CAAkD;IAE5F;;;;;;;;;;;OAWG;IACH,iBAAiB,CACf,IAAI,EAAE,kCAAkC,EACxC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAA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 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || function (mod) {
20
+ if (mod && mod.__esModule) return mod;
21
+ var result = {};
22
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
+ __setModuleDefault(result, mod);
24
+ return result;
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.Transactions = void 0;
28
+ const resource_1 = require("../../../resource.js");
29
+ const core_1 = require("../../../core.js");
30
+ const RuleStatusesAPI = __importStar(require("./rule-statuses.js"));
31
+ const rule_statuses_1 = require("./rule-statuses.js");
32
+ class Transactions extends resource_1.APIResource {
33
+ constructor() {
34
+ super(...arguments);
35
+ this.ruleStatuses = new RuleStatusesAPI.RuleStatuses(this._client);
36
+ }
37
+ /**
38
+ * Create a loyalty transaction to update account balances.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const response =
43
+ * await client.loyalty.transactions.createTransaction({
44
+ * description: 'Purchase of item X',
45
+ * entries: [{ amount: 5 }],
46
+ * });
47
+ * ```
48
+ */
49
+ createTransaction(body, options) {
50
+ return this._client.post('/api/loyalty/transactions', { body, ...options });
51
+ }
52
+ getTransactionEntries(query = {}, options) {
53
+ if ((0, core_1.isRequestOptions)(query)) {
54
+ return this.getTransactionEntries({}, query);
55
+ }
56
+ return this._client.get('/api/loyalty/transaction_entries', { query, ...options });
57
+ }
58
+ }
59
+ exports.Transactions = Transactions;
60
+ Transactions.RuleStatuses = rule_statuses_1.RuleStatuses;
61
+ //# sourceMappingURL=transactions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactions.js","sourceRoot":"","sources":["../../../src/resources/loyalty/transactions/transactions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,mDAAgD;AAChD,2CAAiD;AAEjD,oEAAmD;AACnD,sDAAiG;AAEjG,MAAa,YAAa,SAAQ,sBAAW;IAA7C;;QACE,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA+C9F,CAAC;IA7CC;;;;;;;;;;;OAWG;IACH,iBAAiB,CACf,IAAwC,EACxC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;IAmBD,qBAAqB,CACnB,QAAsE,EAAE,EACxE,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,qBAAqB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC9C;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kCAAkC,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;CACF;AAhDD,oCAgDC;AAgcD,YAAY,CAAC,YAAY,GAAG,4BAAY,CAAC"}
@@ -0,0 +1,34 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../../resource.mjs";
3
+ import { isRequestOptions } from "../../../core.mjs";
4
+ import * as RuleStatusesAPI from "./rule-statuses.mjs";
5
+ import { RuleStatuses } from "./rule-statuses.mjs";
6
+ export class Transactions extends APIResource {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.ruleStatuses = new RuleStatusesAPI.RuleStatuses(this._client);
10
+ }
11
+ /**
12
+ * Create a loyalty transaction to update account balances.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const response =
17
+ * await client.loyalty.transactions.createTransaction({
18
+ * description: 'Purchase of item X',
19
+ * entries: [{ amount: 5 }],
20
+ * });
21
+ * ```
22
+ */
23
+ createTransaction(body, options) {
24
+ return this._client.post('/api/loyalty/transactions', { body, ...options });
25
+ }
26
+ getTransactionEntries(query = {}, options) {
27
+ if (isRequestOptions(query)) {
28
+ return this.getTransactionEntries({}, query);
29
+ }
30
+ return this._client.get('/api/loyalty/transaction_entries', { query, ...options });
31
+ }
32
+ }
33
+ Transactions.RuleStatuses = RuleStatuses;
34
+ //# sourceMappingURL=transactions.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactions.mjs","sourceRoot":"","sources":["../../../src/resources/loyalty/transactions/transactions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAEpB,KAAK,eAAe;OACpB,EAAoD,YAAY,EAAE;AAEzE,MAAM,OAAO,YAAa,SAAQ,WAAW;IAA7C;;QACE,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA+C9F,CAAC;IA7CC;;;;;;;;;;;OAWG;IACH,iBAAiB,CACf,IAAwC,EACxC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;IAmBD,qBAAqB,CACnB,QAAsE,EAAE,EACxE,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,qBAAqB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC9C;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kCAAkC,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;CACF;AAgcD,YAAY,CAAC,YAAY,GAAG,YAAY,CAAC"}
@@ -1,248 +1,2 @@
1
- import { APIResource } from "../../resource.js";
2
- import * as Core from "../../core.js";
3
- export declare class Transactions extends APIResource {
4
- /**
5
- * Create a loyalty transaction to update account balances.
6
- */
7
- createTransaction(body: TransactionCreateTransactionParams, options?: Core.RequestOptions): Core.APIPromise<TransactionCreateTransactionResponse>;
8
- /**
9
- * Fetch loyalty transaction entries for wallets or users, representing account
10
- * balance changes.
11
- */
12
- getTransactionEntries(query?: TransactionGetTransactionEntriesParams, options?: Core.RequestOptions): Core.APIPromise<TransactionGetTransactionEntriesResponse>;
13
- getTransactionEntries(options?: Core.RequestOptions): Core.APIPromise<TransactionGetTransactionEntriesResponse>;
14
- }
15
- export interface TransactionCreateTransactionResponse {
16
- id: string;
17
- createdAt: string;
18
- description: string;
19
- entries: Array<TransactionCreateTransactionResponse.Entry>;
20
- updatedAt: string;
21
- }
22
- export declare namespace TransactionCreateTransactionResponse {
23
- interface Entry {
24
- amount: number;
25
- /**
26
- * Direction of the transaction entry
27
- */
28
- direction: 'credit' | 'debit';
29
- walletAddress: string;
30
- idempotencyKey?: string;
31
- }
32
- }
33
- export interface TransactionGetTransactionEntriesResponse {
34
- data: Array<TransactionGetTransactionEntriesResponse.Data>;
35
- hasNextPage: boolean;
36
- }
37
- export declare namespace TransactionGetTransactionEntriesResponse {
38
- /**
39
- * Schema for a loyalty transaction entry
40
- */
41
- interface Data {
42
- /**
43
- * Unique identifier for the transaction entry
44
- */
45
- id: string;
46
- /**
47
- * Amount involved in the transaction
48
- */
49
- amount: number;
50
- /**
51
- * Timestamp when the transaction entry was created
52
- */
53
- createdAt: string;
54
- /**
55
- * Direction of the transaction entry
56
- */
57
- direction: 'credit' | 'debit';
58
- /**
59
- * Unique identifier for the loyalty account
60
- */
61
- loyaltyAccountId: string;
62
- /**
63
- * Details of the loyalty transaction
64
- */
65
- loyaltyTransaction: Data.LoyaltyTransaction;
66
- /**
67
- * Unique identifier for the organization
68
- */
69
- organizationId: string;
70
- /**
71
- * Type of the loyalty transaction
72
- */
73
- type: 'auction_bid' | 'direct_mint' | 'loyalty_rule' | 'api_key' | 'order';
74
- /**
75
- * Timestamp when the transaction entry was last updated
76
- */
77
- updatedAt: string;
78
- /**
79
- * Unique identifier for the website
80
- */
81
- websiteId: string;
82
- /**
83
- * Optional metadata for the transaction entry
84
- */
85
- metadata?: Record<string, unknown>;
86
- }
87
- namespace Data {
88
- /**
89
- * Details of the loyalty transaction
90
- */
91
- interface LoyaltyTransaction {
92
- /**
93
- * Unique identifier for the loyalty transaction
94
- */
95
- id: string;
96
- /**
97
- * Type of the loyalty transaction
98
- */
99
- type: 'auction_bid' | 'direct_mint' | 'loyalty_rule' | 'api_key' | 'order';
100
- /**
101
- * Details of the loyalty rule associated with the transaction
102
- */
103
- loyaltyRule?: LoyaltyTransaction.LoyaltyRule;
104
- }
105
- namespace LoyaltyTransaction {
106
- /**
107
- * Details of the loyalty rule associated with the transaction
108
- */
109
- interface LoyaltyRule {
110
- /**
111
- * Unique identifier for the loyalty rule
112
- */
113
- id: string;
114
- /**
115
- * Type of the loyalty rule
116
- */
117
- type: string;
118
- /**
119
- * Description of the loyalty rule
120
- */
121
- description?: string;
122
- /**
123
- * Optional metadata for the loyalty rule
124
- */
125
- metadata?: Record<string, unknown>;
126
- /**
127
- * Name of the loyalty rule
128
- */
129
- name?: string;
130
- }
131
- }
132
- }
133
- }
134
- export interface TransactionCreateTransactionParams {
135
- /**
136
- * Description of the loyalty transaction
137
- */
138
- description: string;
139
- /**
140
- * Array of transaction entries
141
- */
142
- entries: Array<TransactionCreateTransactionParams.Entry>;
143
- /**
144
- * Unique identifier for the loyalty currency
145
- */
146
- loyaltyCurrencyId?: string;
147
- }
148
- export declare namespace TransactionCreateTransactionParams {
149
- interface Entry {
150
- /**
151
- * Transaction entry amount.
152
- */
153
- amount: number;
154
- /**
155
- * Direction of the transaction entry for this wallet address
156
- */
157
- direction?: 'credit' | 'debit';
158
- /**
159
- * Idempotency key for the transaction entry. Creation will fail if already exists
160
- * for this wallet address.
161
- */
162
- idempotencyKey?: string;
163
- /**
164
- * The wallet address of the user
165
- */
166
- walletAddress?: string;
167
- }
168
- }
169
- export interface TransactionGetTransactionEntriesParams {
170
- /**
171
- * End date to filter by (exclusive, less than)
172
- */
173
- createdAtEnd?: string;
174
- /**
175
- * Start date to filter by (inclusive, greater than or equal to)
176
- */
177
- createdAtStart?: string;
178
- /**
179
- * Direction of the transaction entry to filter by
180
- */
181
- direction?: 'credit' | 'debit';
182
- /**
183
- * Key to ensure idempotency of the request
184
- */
185
- idempotencyKey?: string;
186
- /**
187
- * Maximum number of records to return (max 1000)
188
- */
189
- limit?: number;
190
- /**
191
- * Unique identifier for the loyalty rule to filter by
192
- */
193
- loyaltyRuleId?: string;
194
- /**
195
- * Unique identifier for the loyalty transaction to filter by
196
- */
197
- loyaltyTransactionId?: string;
198
- /**
199
- * Field to order the results by
200
- */
201
- orderBy?: 'createdAt' | 'updatedAt' | 'loyaltyAccountLockVersion';
202
- /**
203
- * Unique identifier for the organization to filter by
204
- */
205
- organizationId?: string;
206
- /**
207
- * Pagination cursor to start after a specific resource ID
208
- */
209
- startingAfter?: string;
210
- /**
211
- * Type of the loyalty transaction to filter by
212
- */
213
- type?: 'auction_bid' | 'direct_mint' | 'loyalty_rule' | 'api_key' | 'order';
214
- /**
215
- * When passed in return the list of fulfilled entries for loyalty rules. If a
216
- * loyalty rule has a fulfilled entry this means the user cannot currently complete
217
- * the rule. Must be passed in with userId or walletAddress.
218
- */
219
- userCompletedLoyaltyRuleId?: string | Array<string>;
220
- /**
221
- * External identifier for the user group controlled by you
222
- */
223
- userGroupExternalIdentifier?: string;
224
- /**
225
- * Unique identifier for the user group
226
- */
227
- userGroupId?: string;
228
- /**
229
- * User ID or array of User IDs to filter by
230
- */
231
- userId?: string | Array<string>;
232
- /**
233
- * Wallet address or array of wallet addresses to filter by
234
- */
235
- walletAddress?: string | Array<string>;
236
- /**
237
- * Identifier for the wallet group to filter by
238
- */
239
- walletGroupIdentifier?: string;
240
- /**
241
- * Unique identifier for the website to filter by
242
- */
243
- websiteId?: string;
244
- }
245
- export declare namespace Transactions {
246
- export { type TransactionCreateTransactionResponse as TransactionCreateTransactionResponse, type TransactionGetTransactionEntriesResponse as TransactionGetTransactionEntriesResponse, type TransactionCreateTransactionParams as TransactionCreateTransactionParams, type TransactionGetTransactionEntriesParams as TransactionGetTransactionEntriesParams, };
247
- }
1
+ export * from "./transactions/index.js";
248
2
  //# sourceMappingURL=transactions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../../src/resources/loyalty/transactions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;OAEG;IACH,iBAAiB,CACf,IAAI,EAAE,kCAAkC,EACxC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,oCAAoC,CAAC;IAIxD;;;OAGG;IACH,qBAAqB,CACnB,KAAK,CAAC,EAAE,sCAAsC,EAC9C,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,wCAAwC,CAAC;IAC5D,qBAAqB,CACnB,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,wCAAwC,CAAC;CAU7D;AAED,MAAM,WAAW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