@snagsolutions/sdk 0.1.0-alpha.21 → 0.1.0-alpha.210

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 (273) hide show
  1. package/CHANGELOG.md +1703 -0
  2. package/LICENSE +1 -1
  3. package/README.md +15 -23
  4. package/core.d.ts +19 -5
  5. package/core.d.ts.map +1 -1
  6. package/core.js +24 -17
  7. package/core.js.map +1 -1
  8. package/core.mjs +24 -17
  9. package/core.mjs.map +1 -1
  10. package/index.d.mts +7 -4
  11. package/index.d.ts +7 -4
  12. package/index.d.ts.map +1 -1
  13. package/index.js +8 -4
  14. package/index.js.map +1 -1
  15. package/index.mjs +8 -4
  16. package/index.mjs.map +1 -1
  17. package/package.json +4 -5
  18. package/resource.d.ts +1 -1
  19. package/resource.d.ts.map +1 -1
  20. package/resource.js.map +1 -1
  21. package/resource.mjs.map +1 -1
  22. package/resources/assets.d.ts +16 -2
  23. package/resources/assets.d.ts.map +1 -1
  24. package/resources/assets.js +8 -0
  25. package/resources/assets.js.map +1 -1
  26. package/resources/assets.mjs +8 -0
  27. package/resources/assets.mjs.map +1 -1
  28. package/resources/auctions/auctions.d.ts +368 -0
  29. package/resources/auctions/auctions.d.ts.map +1 -0
  30. package/resources/auctions/auctions.js +72 -0
  31. package/resources/auctions/auctions.js.map +1 -0
  32. package/resources/auctions/auctions.mjs +45 -0
  33. package/resources/auctions/auctions.mjs.map +1 -0
  34. package/resources/auctions/index.d.ts +3 -0
  35. package/resources/auctions/index.d.ts.map +1 -0
  36. package/resources/auctions/index.js +9 -0
  37. package/resources/auctions/index.js.map +1 -0
  38. package/resources/auctions/index.mjs +4 -0
  39. package/resources/auctions/index.mjs.map +1 -0
  40. package/resources/auctions/website-user-attributes/index.d.ts +3 -0
  41. package/resources/auctions/website-user-attributes/index.d.ts.map +1 -0
  42. package/resources/auctions/website-user-attributes/index.js +9 -0
  43. package/resources/auctions/website-user-attributes/index.js.map +1 -0
  44. package/resources/auctions/website-user-attributes/index.mjs +4 -0
  45. package/resources/auctions/website-user-attributes/index.mjs.map +1 -0
  46. package/resources/auctions/website-user-attributes/values.d.ts +126 -0
  47. package/resources/auctions/website-user-attributes/values.d.ts.map +1 -0
  48. package/resources/auctions/website-user-attributes/values.js +49 -0
  49. package/resources/auctions/website-user-attributes/values.js.map +1 -0
  50. package/resources/auctions/website-user-attributes/values.mjs +45 -0
  51. package/resources/auctions/website-user-attributes/values.mjs.map +1 -0
  52. package/resources/auctions/website-user-attributes/website-user-attributes.d.ts +136 -0
  53. package/resources/auctions/website-user-attributes/website-user-attributes.d.ts.map +1 -0
  54. package/resources/auctions/website-user-attributes/website-user-attributes.js +76 -0
  55. package/resources/auctions/website-user-attributes/website-user-attributes.js.map +1 -0
  56. package/resources/auctions/website-user-attributes/website-user-attributes.mjs +49 -0
  57. package/resources/auctions/website-user-attributes/website-user-attributes.mjs.map +1 -0
  58. package/resources/auctions/website-user-attributes.d.ts +2 -0
  59. package/resources/auctions/website-user-attributes.d.ts.map +1 -0
  60. package/resources/auctions/website-user-attributes.js +19 -0
  61. package/resources/auctions/website-user-attributes.js.map +1 -0
  62. package/resources/auctions/website-user-attributes.mjs +3 -0
  63. package/resources/auctions/website-user-attributes.mjs.map +1 -0
  64. package/resources/auctions.d.ts +1 -133
  65. package/resources/auctions.d.ts.map +1 -1
  66. package/resources/auctions.js +15 -22
  67. package/resources/auctions.js.map +1 -1
  68. package/resources/auctions.mjs +1 -20
  69. package/resources/auctions.mjs.map +1 -1
  70. package/resources/auth.d.ts +17 -4
  71. package/resources/auth.d.ts.map +1 -1
  72. package/resources/auth.js.map +1 -1
  73. package/resources/auth.mjs.map +1 -1
  74. package/resources/index.d.ts +2 -2
  75. package/resources/index.d.ts.map +1 -1
  76. package/resources/index.js +1 -1
  77. package/resources/index.js.map +1 -1
  78. package/resources/index.mjs +1 -1
  79. package/resources/index.mjs.map +1 -1
  80. package/resources/loyalty/account-streaks.d.ts +96 -0
  81. package/resources/loyalty/account-streaks.d.ts.map +1 -0
  82. package/resources/loyalty/account-streaks.js +24 -0
  83. package/resources/loyalty/account-streaks.js.map +1 -0
  84. package/resources/loyalty/account-streaks.mjs +20 -0
  85. package/resources/loyalty/account-streaks.mjs.map +1 -0
  86. package/resources/loyalty/accounts.d.ts +60 -16
  87. package/resources/loyalty/accounts.d.ts.map +1 -1
  88. package/resources/loyalty/accounts.js +14 -0
  89. package/resources/loyalty/accounts.js.map +1 -1
  90. package/resources/loyalty/accounts.mjs +14 -0
  91. package/resources/loyalty/accounts.mjs.map +1 -1
  92. package/resources/loyalty/badges.d.ts +666 -135
  93. package/resources/loyalty/badges.d.ts.map +1 -1
  94. package/resources/loyalty/badges.js +19 -1
  95. package/resources/loyalty/badges.js.map +1 -1
  96. package/resources/loyalty/badges.mjs +19 -1
  97. package/resources/loyalty/badges.mjs.map +1 -1
  98. package/resources/loyalty/currencies.d.ts +19 -0
  99. package/resources/loyalty/currencies.d.ts.map +1 -1
  100. package/resources/loyalty/currencies.js +19 -0
  101. package/resources/loyalty/currencies.js.map +1 -1
  102. package/resources/loyalty/currencies.mjs +19 -0
  103. package/resources/loyalty/currencies.mjs.map +1 -1
  104. package/resources/loyalty/index.d.ts +4 -4
  105. package/resources/loyalty/index.d.ts.map +1 -1
  106. package/resources/loyalty/index.js +5 -5
  107. package/resources/loyalty/index.js.map +1 -1
  108. package/resources/loyalty/index.mjs +3 -3
  109. package/resources/loyalty/index.mjs.map +1 -1
  110. package/resources/loyalty/loyalty.d.ts +11 -11
  111. package/resources/loyalty/loyalty.d.ts.map +1 -1
  112. package/resources/loyalty/loyalty.js +6 -6
  113. package/resources/loyalty/loyalty.js.map +1 -1
  114. package/resources/loyalty/loyalty.mjs +7 -7
  115. package/resources/loyalty/loyalty.mjs.map +1 -1
  116. package/resources/loyalty/multipliers.d.ts +39 -2
  117. package/resources/loyalty/multipliers.d.ts.map +1 -1
  118. package/resources/loyalty/multipliers.js +23 -0
  119. package/resources/loyalty/multipliers.js.map +1 -1
  120. package/resources/loyalty/multipliers.mjs +23 -0
  121. package/resources/loyalty/multipliers.mjs.map +1 -1
  122. package/resources/loyalty/questions-responses.d.ts +55 -4
  123. package/resources/loyalty/questions-responses.d.ts.map +1 -1
  124. package/resources/loyalty/questions-responses.js +9 -0
  125. package/resources/loyalty/questions-responses.js.map +1 -1
  126. package/resources/loyalty/questions-responses.mjs +9 -0
  127. package/resources/loyalty/questions-responses.mjs.map +1 -1
  128. package/resources/loyalty/questions.d.ts +60 -6
  129. package/resources/loyalty/questions.d.ts.map +1 -1
  130. package/resources/loyalty/questions.js +39 -0
  131. package/resources/loyalty/questions.js.map +1 -1
  132. package/resources/loyalty/questions.mjs +39 -0
  133. package/resources/loyalty/questions.mjs.map +1 -1
  134. package/resources/loyalty/rule-edits.d.ts +2714 -8
  135. package/resources/loyalty/rule-edits.d.ts.map +1 -1
  136. package/resources/loyalty/rule-edits.js +14 -0
  137. package/resources/loyalty/rule-edits.js.map +1 -1
  138. package/resources/loyalty/rule-edits.mjs +14 -0
  139. package/resources/loyalty/rule-edits.mjs.map +1 -1
  140. package/resources/loyalty/rule-groups.d.ts +300 -64
  141. package/resources/loyalty/rule-groups.d.ts.map +1 -1
  142. package/resources/loyalty/rule-groups.js +38 -2
  143. package/resources/loyalty/rule-groups.js.map +1 -1
  144. package/resources/loyalty/rule-groups.mjs +38 -2
  145. package/resources/loyalty/rule-groups.mjs.map +1 -1
  146. package/resources/loyalty/rules.d.ts +2036 -290
  147. package/resources/loyalty/rules.d.ts.map +1 -1
  148. package/resources/loyalty/rules.js +40 -9
  149. package/resources/loyalty/rules.js.map +1 -1
  150. package/resources/loyalty/rules.mjs +40 -9
  151. package/resources/loyalty/rules.mjs.map +1 -1
  152. package/resources/loyalty/transactions/index.d.ts +3 -0
  153. package/resources/loyalty/transactions/index.d.ts.map +1 -0
  154. package/resources/loyalty/transactions/index.js +9 -0
  155. package/resources/loyalty/transactions/index.js.map +1 -0
  156. package/resources/loyalty/transactions/index.mjs +4 -0
  157. package/resources/loyalty/transactions/index.mjs.map +1 -0
  158. package/resources/loyalty/transactions/rule-statuses.d.ts +120 -0
  159. package/resources/loyalty/transactions/rule-statuses.d.ts.map +1 -0
  160. package/resources/loyalty/transactions/rule-statuses.js +30 -0
  161. package/resources/loyalty/transactions/rule-statuses.js.map +1 -0
  162. package/resources/loyalty/transactions/rule-statuses.mjs +26 -0
  163. package/resources/loyalty/transactions/rule-statuses.mjs.map +1 -0
  164. package/resources/loyalty/transactions/transactions.d.ts +410 -0
  165. package/resources/loyalty/transactions/transactions.d.ts.map +1 -0
  166. package/resources/loyalty/transactions/transactions.js +76 -0
  167. package/resources/loyalty/transactions/transactions.js.map +1 -0
  168. package/resources/loyalty/transactions/transactions.mjs +49 -0
  169. package/resources/loyalty/transactions/transactions.mjs.map +1 -0
  170. package/resources/loyalty/transactions.d.ts +1 -248
  171. package/resources/loyalty/transactions.d.ts.map +1 -1
  172. package/resources/loyalty/transactions.js +15 -18
  173. package/resources/loyalty/transactions.js.map +1 -1
  174. package/resources/loyalty/transactions.mjs +1 -16
  175. package/resources/loyalty/transactions.mjs.map +1 -1
  176. package/resources/minting.d.ts +5 -5
  177. package/resources/minting.d.ts.map +1 -1
  178. package/resources/referral/referral.d.ts +12 -3
  179. package/resources/referral/referral.d.ts.map +1 -1
  180. package/resources/referral/referral.js +11 -5
  181. package/resources/referral/referral.js.map +1 -1
  182. package/resources/referral/referral.mjs +11 -5
  183. package/resources/referral/referral.mjs.map +1 -1
  184. package/resources/referral/users.d.ts +30 -3
  185. package/resources/referral/users.d.ts.map +1 -1
  186. package/resources/referral/users.js +12 -4
  187. package/resources/referral/users.js.map +1 -1
  188. package/resources/referral/users.mjs +12 -4
  189. package/resources/referral/users.mjs.map +1 -1
  190. package/resources/users/index.d.ts +1 -1
  191. package/resources/users/index.d.ts.map +1 -1
  192. package/resources/users/index.js.map +1 -1
  193. package/resources/users/index.mjs.map +1 -1
  194. package/resources/users/metadatas.d.ts +36 -3
  195. package/resources/users/metadatas.d.ts.map +1 -1
  196. package/resources/users/metadatas.js.map +1 -1
  197. package/resources/users/metadatas.mjs.map +1 -1
  198. package/resources/users/users.d.ts +192 -35
  199. package/resources/users/users.d.ts.map +1 -1
  200. package/resources/users/users.js +58 -1
  201. package/resources/users/users.js.map +1 -1
  202. package/resources/users/users.mjs +58 -1
  203. package/resources/users/users.mjs.map +1 -1
  204. package/resources/websites/website-collections.d.ts +22 -1
  205. package/resources/websites/website-collections.d.ts.map +1 -1
  206. package/resources/websites/website-collections.js +21 -0
  207. package/resources/websites/website-collections.js.map +1 -1
  208. package/resources/websites/website-collections.mjs +21 -0
  209. package/resources/websites/website-collections.mjs.map +1 -1
  210. package/resources/websites/website-user-roles.d.ts +24 -1
  211. package/resources/websites/website-user-roles.d.ts.map +1 -1
  212. package/resources/websites/website-user-roles.js +23 -0
  213. package/resources/websites/website-user-roles.js.map +1 -1
  214. package/resources/websites/website-user-roles.mjs +23 -0
  215. package/resources/websites/website-user-roles.mjs.map +1 -1
  216. package/resources/websites/websites.d.ts +12 -0
  217. package/resources/websites/websites.d.ts.map +1 -1
  218. package/resources/websites/websites.js +7 -0
  219. package/resources/websites/websites.js.map +1 -1
  220. package/resources/websites/websites.mjs +7 -0
  221. package/resources/websites/websites.mjs.map +1 -1
  222. package/src/core.ts +39 -16
  223. package/src/index.ts +31 -2
  224. package/src/resource.ts +1 -1
  225. package/src/resources/assets.ts +18 -3
  226. package/src/resources/auctions/auctions.ts +561 -0
  227. package/src/resources/auctions/index.ts +19 -0
  228. package/src/resources/auctions/website-user-attributes/index.ts +18 -0
  229. package/src/resources/auctions/website-user-attributes/values.ts +170 -0
  230. package/src/resources/auctions/website-user-attributes/website-user-attributes.ts +212 -0
  231. package/src/resources/auctions/website-user-attributes.ts +3 -0
  232. package/src/resources/auctions.ts +1 -207
  233. package/src/resources/auth.ts +21 -5
  234. package/src/resources/index.ts +12 -1
  235. package/src/resources/loyalty/account-streaks.ts +128 -0
  236. package/src/resources/loyalty/accounts.ts +65 -18
  237. package/src/resources/loyalty/badges.ts +790 -146
  238. package/src/resources/loyalty/currencies.ts +19 -0
  239. package/src/resources/loyalty/index.ts +19 -3
  240. package/src/resources/loyalty/loyalty.ts +39 -15
  241. package/src/resources/loyalty/multipliers.ts +43 -4
  242. package/src/resources/loyalty/questions-responses.ts +64 -4
  243. package/src/resources/loyalty/questions.ts +64 -6
  244. package/src/resources/loyalty/rule-edits.ts +3942 -100
  245. package/src/resources/loyalty/rule-groups.ts +527 -76
  246. package/src/resources/loyalty/rules.ts +3143 -301
  247. package/src/resources/loyalty/transactions/index.ts +18 -0
  248. package/src/resources/loyalty/transactions/rule-statuses.ts +178 -0
  249. package/src/resources/loyalty/transactions/transactions.ts +699 -0
  250. package/src/resources/loyalty/transactions.ts +1 -440
  251. package/src/resources/minting.ts +25 -5
  252. package/src/resources/referral/referral.ts +15 -11
  253. package/src/resources/referral/users.ts +45 -5
  254. package/src/resources/users/index.ts +4 -0
  255. package/src/resources/users/metadatas.ts +61 -3
  256. package/src/resources/users/users.ts +259 -38
  257. package/src/resources/websites/website-collections.ts +42 -1
  258. package/src/resources/websites/website-user-roles.ts +25 -1
  259. package/src/resources/websites/websites.ts +12 -0
  260. package/src/version.ts +1 -1
  261. package/version.d.ts +1 -1
  262. package/version.d.ts.map +1 -1
  263. package/version.js +1 -1
  264. package/version.js.map +1 -1
  265. package/version.mjs +1 -1
  266. package/version.mjs.map +1 -1
  267. package/resources/loyalty/rule-chains.d.ts +0 -34
  268. package/resources/loyalty/rule-chains.d.ts.map +0 -1
  269. package/resources/loyalty/rule-chains.js +0 -15
  270. package/resources/loyalty/rule-chains.js.map +0 -1
  271. package/resources/loyalty/rule-chains.mjs +0 -11
  272. package/resources/loyalty/rule-chains.mjs.map +0 -1
  273. package/src/resources/loyalty/rule-chains.ts +0 -45
@@ -0,0 +1,26 @@
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
+ export class RuleStatuses extends APIResource {
5
+ /**
6
+ * Update a loyalty rule status
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const ruleStatus =
11
+ * await client.loyalty.transactions.ruleStatuses.update({
12
+ * loyaltyRuleId: '123e4567-e89b-12d3-a456-426614174030',
13
+ * });
14
+ * ```
15
+ */
16
+ update(body, options) {
17
+ return this._client.post('/api/loyalty/rule_statuses', { body, ...options });
18
+ }
19
+ list(query = {}, options) {
20
+ if (isRequestOptions(query)) {
21
+ return this.list({}, query);
22
+ }
23
+ return this._client.get('/api/loyalty/rule_statuses', { query, ...options });
24
+ }
25
+ }
26
+ //# sourceMappingURL=rule-statuses.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rule-statuses.mjs","sourceRoot":"","sources":["../../../src/resources/loyalty/transactions/rule-statuses.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;AAG3B,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;OAUG;IACH,MAAM,CACJ,IAA4B,EAC5B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAaD,IAAI,CACF,QAAoD,EAAE,EACtD,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF"}
@@ -0,0 +1,410 @@
1
+ import { APIResource } from "../../../resource.js";
2
+ import * as Core from "../../../core.js";
3
+ import * as RuleStatusesAPI from "./rule-statuses.js";
4
+ import { RuleStatusListParams, RuleStatusListResponse, 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
+ * Retrieve configured loyalty rule chains
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * const response =
38
+ * await client.loyalty.transactions.listRuleChains({
39
+ * organizationId: '123e4567-e89b-12d3-a456-426614174001',
40
+ * websiteId: '123e4567-e89b-12d3-a456-426614174002',
41
+ * });
42
+ * ```
43
+ */
44
+ listRuleChains(query: TransactionListRuleChainsParams, options?: Core.RequestOptions): Core.APIPromise<TransactionListRuleChainsResponse>;
45
+ }
46
+ export interface TransactionCreateTransactionResponse {
47
+ id: string;
48
+ createdAt: string;
49
+ description: string;
50
+ entries: Array<TransactionCreateTransactionResponse.Entry>;
51
+ updatedAt: string;
52
+ }
53
+ export declare namespace TransactionCreateTransactionResponse {
54
+ interface Entry {
55
+ amount: number;
56
+ /**
57
+ * Direction of the transaction entry
58
+ */
59
+ direction: 'credit' | 'debit';
60
+ walletAddress: string;
61
+ idempotencyKey?: string;
62
+ }
63
+ }
64
+ export interface TransactionGetTransactionEntriesResponse {
65
+ data: Array<TransactionGetTransactionEntriesResponse.Data>;
66
+ hasNextPage: boolean;
67
+ }
68
+ export declare namespace TransactionGetTransactionEntriesResponse {
69
+ /**
70
+ * Schema for a loyalty transaction entry
71
+ */
72
+ interface Data {
73
+ /**
74
+ * Unique identifier for the transaction entry
75
+ */
76
+ id: string;
77
+ /**
78
+ * Amount involved in the transaction
79
+ */
80
+ amount: number;
81
+ /**
82
+ * Timestamp when the transaction entry was created
83
+ */
84
+ createdAt: string;
85
+ /**
86
+ * Direction of the transaction entry
87
+ */
88
+ direction: 'credit' | 'debit';
89
+ /**
90
+ * Unique identifier for the loyalty account
91
+ */
92
+ loyaltyAccountId: string;
93
+ /**
94
+ * Details of the loyalty transaction
95
+ */
96
+ loyaltyTransaction: Data.LoyaltyTransaction;
97
+ /**
98
+ * Unique identifier for the organization
99
+ */
100
+ organizationId: string;
101
+ /**
102
+ * Type of the loyalty transaction
103
+ */
104
+ type: 'auction_bid' | 'direct_mint' | 'loyalty_rule' | 'api_key' | 'order' | null;
105
+ /**
106
+ * Timestamp when the transaction entry was last updated
107
+ */
108
+ updatedAt: string;
109
+ /**
110
+ * Unique identifier for the website
111
+ */
112
+ websiteId: string;
113
+ /**
114
+ * Optional metadata for the transaction entry
115
+ */
116
+ metadata?: {
117
+ [key: string]: unknown;
118
+ };
119
+ }
120
+ namespace Data {
121
+ /**
122
+ * Details of the loyalty transaction
123
+ */
124
+ interface LoyaltyTransaction {
125
+ /**
126
+ * Unique identifier for the loyalty transaction
127
+ */
128
+ id: string;
129
+ /**
130
+ * Type of the loyalty transaction
131
+ */
132
+ type: 'auction_bid' | 'direct_mint' | 'loyalty_rule' | 'api_key' | 'order' | null;
133
+ /**
134
+ * Details of the loyalty rule associated with the transaction
135
+ */
136
+ loyaltyRule?: LoyaltyTransaction.LoyaltyRule;
137
+ }
138
+ namespace LoyaltyTransaction {
139
+ /**
140
+ * Details of the loyalty rule associated with the transaction
141
+ */
142
+ interface LoyaltyRule {
143
+ /**
144
+ * Unique identifier for the loyalty rule
145
+ */
146
+ id: string;
147
+ /**
148
+ * Type of the loyalty rule
149
+ */
150
+ type: string;
151
+ /**
152
+ * Description of the loyalty rule
153
+ */
154
+ description?: string;
155
+ loyaltyRuleGroupItem?: LoyaltyRule.LoyaltyRuleGroupItem;
156
+ /**
157
+ * Optional metadata for the loyalty rule
158
+ */
159
+ metadata?: {
160
+ [key: string]: unknown;
161
+ };
162
+ /**
163
+ * Name of the loyalty rule
164
+ */
165
+ name?: string;
166
+ }
167
+ namespace LoyaltyRule {
168
+ interface LoyaltyRuleGroupItem {
169
+ loyaltyRuleGroupId: string;
170
+ }
171
+ }
172
+ }
173
+ }
174
+ }
175
+ export interface TransactionListRuleChainsResponse {
176
+ data: Array<TransactionListRuleChainsResponse.Data>;
177
+ hasNextPage: boolean;
178
+ }
179
+ export declare namespace TransactionListRuleChainsResponse {
180
+ interface Data {
181
+ /**
182
+ * Unique identifier for the rule chain
183
+ */
184
+ id: string;
185
+ loyaltyConditions: Array<Data.LoyaltyCondition>;
186
+ /**
187
+ * Unique identifier for the loyalty rule
188
+ */
189
+ loyaltyRuleId: string;
190
+ /**
191
+ * Name of the rule chain
192
+ */
193
+ name: string;
194
+ }
195
+ namespace Data {
196
+ interface LoyaltyCondition {
197
+ /**
198
+ * Unique identifier for the condition
199
+ */
200
+ id: string;
201
+ /**
202
+ * Amount of the condition
203
+ */
204
+ amount: number | null;
205
+ association: Array<LoyaltyCondition.Association>;
206
+ /**
207
+ * URL of the CSV file
208
+ */
209
+ csvUrl: string | null;
210
+ /**
211
+ * Description of the condition
212
+ */
213
+ description: string | null;
214
+ /**
215
+ * Number of times the condition must be met
216
+ */
217
+ repeatCount: number | null;
218
+ /**
219
+ * Number of times the condition must be met
220
+ */
221
+ requiredCount: number | null;
222
+ /**
223
+ * Type of the condition
224
+ */
225
+ type: 'rule' | 'rules' | 'points' | 'section' | 'level' | 'api' | 'badge' | 'badges' | 'csv';
226
+ }
227
+ namespace LoyaltyCondition {
228
+ interface Association {
229
+ /**
230
+ * Unique identifier for the association
231
+ */
232
+ id: string;
233
+ /**
234
+ * Unique identifier for the loyalty badge
235
+ */
236
+ loyaltyBadgeId: string | null;
237
+ /**
238
+ * Unique identifier for the loyalty currency
239
+ */
240
+ loyaltyCurrencyId: string | null;
241
+ loyaltyRule: Association.LoyaltyRule | null;
242
+ /**
243
+ * Unique identifier for the loyalty rule group
244
+ */
245
+ loyaltyRuleGroupId: string | null;
246
+ /**
247
+ * Unique identifier for the loyalty rule
248
+ */
249
+ loyaltyRuleId: string | null;
250
+ }
251
+ namespace Association {
252
+ interface LoyaltyRule {
253
+ /**
254
+ * Name of the loyalty rule
255
+ */
256
+ name: string;
257
+ }
258
+ }
259
+ }
260
+ }
261
+ }
262
+ export interface TransactionCreateTransactionParams {
263
+ /**
264
+ * Description of the loyalty transaction
265
+ */
266
+ description: string;
267
+ /**
268
+ * Array of transaction entries
269
+ */
270
+ entries: Array<TransactionCreateTransactionParams.Entry>;
271
+ /**
272
+ * Unique identifier for the loyalty currency
273
+ */
274
+ loyaltyCurrencyId?: string;
275
+ }
276
+ export declare namespace TransactionCreateTransactionParams {
277
+ interface Entry {
278
+ /**
279
+ * Transaction entry amount.
280
+ */
281
+ amount: number;
282
+ /**
283
+ * Direction of the transaction entry for this wallet address
284
+ */
285
+ direction?: 'credit' | 'debit';
286
+ /**
287
+ * Idempotency key for the transaction entry. Creation will fail if already exists
288
+ * for this wallet address.
289
+ */
290
+ idempotencyKey?: string;
291
+ /**
292
+ * Unique identifier for the loyalty currency for the wallet. Can only use
293
+ * entry-level currency or transaction-level currency.
294
+ */
295
+ loyaltyCurrencyId?: string;
296
+ /**
297
+ * The wallet address of the user
298
+ */
299
+ walletAddress?: string;
300
+ }
301
+ }
302
+ export interface TransactionGetTransactionEntriesParams {
303
+ /**
304
+ * End date to filter by (exclusive, less than)
305
+ */
306
+ createdAtEnd?: string;
307
+ /**
308
+ * Start date to filter by (inclusive, greater than or equal to)
309
+ */
310
+ createdAtStart?: string;
311
+ /**
312
+ * Key to ensure idempotency of the request
313
+ */
314
+ idempotencyKey?: string;
315
+ /**
316
+ * Maximum number of records to return (max 100)
317
+ */
318
+ limit?: number;
319
+ /**
320
+ * UUID of the loyalty currency IDs to filter by. Use this to exclude deleted
321
+ * currencies
322
+ */
323
+ loyaltyCurrencyId?: string | Array<string>;
324
+ /**
325
+ * UUID of the rule group (converted to lowercase)
326
+ */
327
+ loyaltyRuleGroupId?: string;
328
+ /**
329
+ * Unique identifier for the loyalty rule to filter by
330
+ */
331
+ loyaltyRuleId?: string;
332
+ 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_github' | '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' | 'stratus_function' | 'connected_tiktok' | 'tiktok_follow' | 'github_repo_star' | 'github_repo_fork' | 'github_repo_collaborator' | 'github_merge_PR' | 'discord_role_grant' | 'connected_reddit' | 'reddit_comment' | 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_github' | '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' | 'stratus_function' | 'connected_tiktok' | 'tiktok_follow' | 'github_repo_star' | 'github_repo_fork' | 'github_repo_collaborator' | 'github_merge_PR' | 'discord_role_grant' | 'connected_reddit' | 'reddit_comment'>;
333
+ /**
334
+ * Unique identifier for the loyalty transaction to filter by
335
+ */
336
+ loyaltyTransactionId?: string;
337
+ /**
338
+ * Unique identifier for the organization to filter by
339
+ */
340
+ organizationId?: string;
341
+ /**
342
+ * Field to sort the results by
343
+ */
344
+ sortBy?: 'createdAt' | 'updatedAt' | 'loyaltyAccountLockVersion';
345
+ /**
346
+ * Direction to sort the results by
347
+ */
348
+ sortDir?: 'asc' | 'desc';
349
+ /**
350
+ * Pagination cursor to start after a specific resource ID
351
+ */
352
+ startingAfter?: string;
353
+ /**
354
+ * Type of the loyalty transaction to filter by
355
+ */
356
+ type?: 'auction_bid' | 'direct_mint' | 'loyalty_rule' | 'api_key' | 'order';
357
+ /**
358
+ * When passed in return the list of fulfilled entries for loyalty rules. If a
359
+ * loyalty rule has a fulfilled entry this means the user cannot currently complete
360
+ * the rule. Must be passed in with userId or walletAddress.
361
+ */
362
+ userCompletedLoyaltyRuleId?: string | Array<string>;
363
+ /**
364
+ * External identifier for the user group controlled by you.
365
+ */
366
+ userGroupExternalIdentifier?: string;
367
+ /**
368
+ * Unique identifier for the user group
369
+ */
370
+ userGroupId?: string;
371
+ /**
372
+ * User ID or array of User IDs to filter by
373
+ */
374
+ userId?: string | Array<string>;
375
+ /**
376
+ * Wallet address or array of wallet addresses to filter by
377
+ */
378
+ walletAddress?: string | Array<string>;
379
+ /**
380
+ * Identifier for the wallet group to filter by
381
+ */
382
+ walletGroupIdentifier?: string;
383
+ /**
384
+ * Unique identifier for the website to filter by
385
+ */
386
+ websiteId?: string;
387
+ }
388
+ export interface TransactionListRuleChainsParams {
389
+ /**
390
+ * Unique identifier for the organization
391
+ */
392
+ organizationId: string;
393
+ /**
394
+ * Unique identifier for the website
395
+ */
396
+ websiteId: string;
397
+ /**
398
+ * Number of rule chains to return
399
+ */
400
+ limit?: number;
401
+ /**
402
+ * Starting after the given rule chain ID
403
+ */
404
+ startingAfter?: string;
405
+ }
406
+ export declare namespace Transactions {
407
+ export { type TransactionCreateTransactionResponse as TransactionCreateTransactionResponse, type TransactionGetTransactionEntriesResponse as TransactionGetTransactionEntriesResponse, type TransactionListRuleChainsResponse as TransactionListRuleChainsResponse, type TransactionCreateTransactionParams as TransactionCreateTransactionParams, type TransactionGetTransactionEntriesParams as TransactionGetTransactionEntriesParams, type TransactionListRuleChainsParams as TransactionListRuleChainsParams, };
408
+ export { RuleStatuses as RuleStatuses, type RuleStatusUpdateResponse as RuleStatusUpdateResponse, type RuleStatusListResponse as RuleStatusListResponse, type RuleStatusUpdateParams as RuleStatusUpdateParams, type RuleStatusListParams as RuleStatusListParams, };
409
+ }
410
+ //# 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,EACL,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,YAAY,EACb,MAAM,iBAAiB,CAAC;AAEzB,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,CAAC,UAAU,CAAC,oCAAoC,CAAC;IAIxD;;;;;;;;;OASG;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;IAW5D;;;;;;;;;;;OAWG;IACH,cAAc,CACZ,KAAK,EAAE,+BAA+B,EACtC,OAAO,CAAC,E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C;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAID,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,oCAAoC,IAAI,oCAAoC,EACjF,KAAK,wCAAwC,IAAI,wCAAwC,EACzF,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,kCAAkC,IAAI,kCAAkC,EAC7E,KAAK,sCAAsC,IAAI,sCAAsC,EACrF,KAAK,+BAA+B,IAAI,+BAA+B,GACxE,CAAC;IAEF,OAAO,EACL,YAAY,IAAI,YAAY,EAC5B,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
@@ -0,0 +1,76 @@
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
+ * Retrieve configured loyalty rule chains
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * const response =
64
+ * await client.loyalty.transactions.listRuleChains({
65
+ * organizationId: '123e4567-e89b-12d3-a456-426614174001',
66
+ * websiteId: '123e4567-e89b-12d3-a456-426614174002',
67
+ * });
68
+ * ```
69
+ */
70
+ listRuleChains(query, options) {
71
+ return this._client.get('/api/loyalty/rule_chains', { query, ...options });
72
+ }
73
+ }
74
+ exports.Transactions = Transactions;
75
+ Transactions.RuleStatuses = rule_statuses_1.RuleStatuses;
76
+ //# 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,sDAMyB;AAEzB,MAAa,YAAa,SAAQ,sBAAW;IAA7C;;QACE,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAkE9F,CAAC;IAhEC;;;;;;;;;;;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;IAED;;;;;;;;;;;OAWG;IACH,cAAc,CACZ,KAAsC,EACtC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;CACF;AAnED,oCAmEC;AAslBD,YAAY,CAAC,YAAY,GAAG,4BAAY,CAAC"}
@@ -0,0 +1,49 @@
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
+ * Retrieve configured loyalty rule chains
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * const response =
38
+ * await client.loyalty.transactions.listRuleChains({
39
+ * organizationId: '123e4567-e89b-12d3-a456-426614174001',
40
+ * websiteId: '123e4567-e89b-12d3-a456-426614174002',
41
+ * });
42
+ * ```
43
+ */
44
+ listRuleChains(query, options) {
45
+ return this._client.get('/api/loyalty/rule_chains', { query, ...options });
46
+ }
47
+ }
48
+ Transactions.RuleStatuses = RuleStatuses;
49
+ //# 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,EAKL,YAAY,GACb;AAED,MAAM,OAAO,YAAa,SAAQ,WAAW;IAA7C;;QACE,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAkE9F,CAAC;IAhEC;;;;;;;;;;;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;IAED;;;;;;;;;;;OAWG;IACH,cAAc,CACZ,KAAsC,EACtC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;CACF;AAslBD,YAAY,CAAC,YAAY,GAAG,YAAY,CAAC"}