@snagsolutions/sdk 0.1.0-alpha.13 → 0.1.0-alpha.130

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 (378) hide show
  1. package/CHANGELOG.md +1125 -0
  2. package/README.md +24 -28
  3. package/_shims/index.d.ts +2 -0
  4. package/_shims/index.js +5 -1
  5. package/_shims/index.mjs +5 -1
  6. package/core.d.ts +19 -5
  7. package/core.d.ts.map +1 -1
  8. package/core.js +35 -19
  9. package/core.js.map +1 -1
  10. package/core.mjs +36 -20
  11. package/core.mjs.map +1 -1
  12. package/index.d.mts +25 -16
  13. package/index.d.ts +25 -16
  14. package/index.d.ts.map +1 -1
  15. package/index.js +20 -10
  16. package/index.js.map +1 -1
  17. package/index.mjs +21 -11
  18. package/index.mjs.map +1 -1
  19. package/package.json +4 -5
  20. package/resource.d.ts +1 -1
  21. package/resource.d.ts.map +1 -1
  22. package/resource.js.map +1 -1
  23. package/resource.mjs.map +1 -1
  24. package/resources/assets.d.ts +23 -9
  25. package/resources/assets.d.ts.map +1 -1
  26. package/resources/assets.js +12 -4
  27. package/resources/assets.js.map +1 -1
  28. package/resources/assets.mjs +12 -4
  29. package/resources/assets.mjs.map +1 -1
  30. package/resources/auctions/auctions.d.ts +285 -0
  31. package/resources/auctions/auctions.d.ts.map +1 -0
  32. package/resources/auctions/auctions.js +76 -0
  33. package/resources/auctions/auctions.js.map +1 -0
  34. package/resources/auctions/auctions.mjs +49 -0
  35. package/resources/auctions/auctions.mjs.map +1 -0
  36. package/resources/auctions/index.d.ts +3 -0
  37. package/resources/auctions/index.d.ts.map +1 -0
  38. package/resources/auctions/index.js +9 -0
  39. package/resources/auctions/index.js.map +1 -0
  40. package/resources/auctions/index.mjs +4 -0
  41. package/resources/auctions/index.mjs.map +1 -0
  42. package/resources/auctions/website-user-attributes/index.d.ts +3 -0
  43. package/resources/auctions/website-user-attributes/index.d.ts.map +1 -0
  44. package/resources/auctions/website-user-attributes/index.js +9 -0
  45. package/resources/auctions/website-user-attributes/index.js.map +1 -0
  46. package/resources/auctions/website-user-attributes/index.mjs +4 -0
  47. package/resources/auctions/website-user-attributes/index.mjs.map +1 -0
  48. package/resources/auctions/website-user-attributes/values.d.ts +122 -0
  49. package/resources/auctions/website-user-attributes/values.d.ts.map +1 -0
  50. package/resources/auctions/website-user-attributes/values.js +49 -0
  51. package/resources/auctions/website-user-attributes/values.js.map +1 -0
  52. package/resources/auctions/website-user-attributes/values.mjs +45 -0
  53. package/resources/auctions/website-user-attributes/values.mjs.map +1 -0
  54. package/resources/auctions/website-user-attributes/website-user-attributes.d.ts +132 -0
  55. package/resources/auctions/website-user-attributes/website-user-attributes.d.ts.map +1 -0
  56. package/resources/auctions/website-user-attributes/website-user-attributes.js +76 -0
  57. package/resources/auctions/website-user-attributes/website-user-attributes.js.map +1 -0
  58. package/resources/auctions/website-user-attributes/website-user-attributes.mjs +49 -0
  59. package/resources/auctions/website-user-attributes/website-user-attributes.mjs.map +1 -0
  60. package/resources/auctions/website-user-attributes.d.ts +2 -0
  61. package/resources/auctions/website-user-attributes.d.ts.map +1 -0
  62. package/resources/auctions/website-user-attributes.js +19 -0
  63. package/resources/auctions/website-user-attributes.js.map +1 -0
  64. package/resources/auctions/website-user-attributes.mjs +3 -0
  65. package/resources/auctions/website-user-attributes.mjs.map +1 -0
  66. package/resources/auctions.d.ts +2 -0
  67. package/resources/auctions.d.ts.map +1 -0
  68. package/resources/auctions.js +19 -0
  69. package/resources/auctions.js.map +1 -0
  70. package/resources/auctions.mjs +3 -0
  71. package/resources/auctions.mjs.map +1 -0
  72. package/resources/auth.d.ts +44 -0
  73. package/resources/auth.d.ts.map +1 -0
  74. package/resources/auth.js +16 -0
  75. package/resources/auth.js.map +1 -0
  76. package/resources/auth.mjs +12 -0
  77. package/resources/auth.mjs.map +1 -0
  78. package/resources/index.d.ts +7 -5
  79. package/resources/index.d.ts.map +1 -1
  80. package/resources/index.js +10 -6
  81. package/resources/index.js.map +1 -1
  82. package/resources/index.mjs +6 -4
  83. package/resources/index.mjs.map +1 -1
  84. package/resources/loyalty/account-streaks.d.ts +81 -0
  85. package/resources/loyalty/account-streaks.d.ts.map +1 -0
  86. package/resources/loyalty/account-streaks.js +24 -0
  87. package/resources/loyalty/account-streaks.js.map +1 -0
  88. package/resources/loyalty/account-streaks.mjs +20 -0
  89. package/resources/loyalty/account-streaks.mjs.map +1 -0
  90. package/resources/loyalty/accounts.d.ts +62 -15
  91. package/resources/loyalty/accounts.d.ts.map +1 -1
  92. package/resources/loyalty/accounts.js +22 -1
  93. package/resources/loyalty/accounts.js.map +1 -1
  94. package/resources/loyalty/accounts.mjs +22 -1
  95. package/resources/loyalty/accounts.mjs.map +1 -1
  96. package/resources/loyalty/badges.d.ts +980 -77
  97. package/resources/loyalty/badges.d.ts.map +1 -1
  98. package/resources/loyalty/badges.js +19 -1
  99. package/resources/loyalty/badges.js.map +1 -1
  100. package/resources/loyalty/badges.mjs +19 -1
  101. package/resources/loyalty/badges.mjs.map +1 -1
  102. package/resources/loyalty/currencies.d.ts +20 -1
  103. package/resources/loyalty/currencies.d.ts.map +1 -1
  104. package/resources/loyalty/currencies.js +19 -0
  105. package/resources/loyalty/currencies.js.map +1 -1
  106. package/resources/loyalty/currencies.mjs +19 -0
  107. package/resources/loyalty/currencies.mjs.map +1 -1
  108. package/resources/loyalty/index.d.ts +9 -5
  109. package/resources/loyalty/index.d.ts.map +1 -1
  110. package/resources/loyalty/index.js +11 -3
  111. package/resources/loyalty/index.js.map +1 -1
  112. package/resources/loyalty/index.mjs +6 -2
  113. package/resources/loyalty/index.mjs.map +1 -1
  114. package/resources/loyalty/loyalty.d.ts +33 -17
  115. package/resources/loyalty/loyalty.d.ts.map +1 -1
  116. package/resources/loyalty/loyalty.js +28 -12
  117. package/resources/loyalty/loyalty.js.map +1 -1
  118. package/resources/loyalty/loyalty.mjs +29 -13
  119. package/resources/loyalty/loyalty.mjs.map +1 -1
  120. package/resources/loyalty/multipliers.d.ts +97 -4
  121. package/resources/loyalty/multipliers.d.ts.map +1 -1
  122. package/resources/loyalty/multipliers.js +29 -0
  123. package/resources/loyalty/multipliers.js.map +1 -1
  124. package/resources/loyalty/multipliers.mjs +29 -0
  125. package/resources/loyalty/multipliers.mjs.map +1 -1
  126. package/resources/loyalty/questions-responses.d.ts +112 -0
  127. package/resources/loyalty/questions-responses.d.ts.map +1 -0
  128. package/resources/loyalty/questions-responses.js +31 -0
  129. package/resources/loyalty/questions-responses.js.map +1 -0
  130. package/resources/loyalty/questions-responses.mjs +27 -0
  131. package/resources/loyalty/questions-responses.mjs.map +1 -0
  132. package/resources/loyalty/questions.d.ts +183 -0
  133. package/resources/loyalty/questions.d.ts.map +1 -0
  134. package/resources/loyalty/questions.js +60 -0
  135. package/resources/loyalty/questions.js.map +1 -0
  136. package/resources/loyalty/questions.mjs +56 -0
  137. package/resources/loyalty/questions.mjs.map +1 -0
  138. package/resources/loyalty/rule-edits.d.ts +2585 -11
  139. package/resources/loyalty/rule-edits.d.ts.map +1 -1
  140. package/resources/loyalty/rule-edits.js +16 -2
  141. package/resources/loyalty/rule-edits.js.map +1 -1
  142. package/resources/loyalty/rule-edits.mjs +16 -2
  143. package/resources/loyalty/rule-edits.mjs.map +1 -1
  144. package/resources/loyalty/rule-groups.d.ts +762 -0
  145. package/resources/loyalty/rule-groups.d.ts.map +1 -0
  146. package/resources/loyalty/rule-groups.js +52 -0
  147. package/resources/loyalty/rule-groups.js.map +1 -0
  148. package/resources/loyalty/rule-groups.mjs +48 -0
  149. package/resources/loyalty/rule-groups.mjs.map +1 -0
  150. package/resources/loyalty/rules.d.ts +1871 -296
  151. package/resources/loyalty/rules.d.ts.map +1 -1
  152. package/resources/loyalty/rules.js +40 -9
  153. package/resources/loyalty/rules.js.map +1 -1
  154. package/resources/loyalty/rules.mjs +40 -9
  155. package/resources/loyalty/rules.mjs.map +1 -1
  156. package/resources/loyalty/transactions/index.d.ts +3 -0
  157. package/resources/loyalty/transactions/index.d.ts.map +1 -0
  158. package/resources/loyalty/transactions/index.js +9 -0
  159. package/resources/loyalty/transactions/index.js.map +1 -0
  160. package/resources/loyalty/transactions/index.mjs +4 -0
  161. package/resources/loyalty/transactions/index.mjs.map +1 -0
  162. package/resources/loyalty/transactions/rule-statuses.d.ts +120 -0
  163. package/resources/loyalty/transactions/rule-statuses.d.ts.map +1 -0
  164. package/resources/loyalty/transactions/rule-statuses.js +30 -0
  165. package/resources/loyalty/transactions/rule-statuses.js.map +1 -0
  166. package/resources/loyalty/transactions/rule-statuses.mjs +26 -0
  167. package/resources/loyalty/transactions/rule-statuses.mjs.map +1 -0
  168. package/resources/loyalty/transactions/transactions.d.ts +410 -0
  169. package/resources/loyalty/transactions/transactions.d.ts.map +1 -0
  170. package/resources/loyalty/transactions/transactions.js +76 -0
  171. package/resources/loyalty/transactions/transactions.js.map +1 -0
  172. package/resources/loyalty/transactions/transactions.mjs +49 -0
  173. package/resources/loyalty/transactions/transactions.mjs.map +1 -0
  174. package/resources/loyalty/transactions.d.ts +2 -0
  175. package/resources/loyalty/transactions.d.ts.map +1 -0
  176. package/resources/loyalty/transactions.js +19 -0
  177. package/resources/loyalty/transactions.js.map +1 -0
  178. package/resources/loyalty/transactions.mjs +3 -0
  179. package/resources/loyalty/transactions.mjs.map +1 -0
  180. package/resources/loyalty.d.ts +2 -0
  181. package/resources/loyalty.d.ts.map +1 -0
  182. package/resources/loyalty.js +19 -0
  183. package/resources/loyalty.js.map +1 -0
  184. package/resources/loyalty.mjs +3 -0
  185. package/resources/loyalty.mjs.map +1 -0
  186. package/resources/minting.d.ts +95 -0
  187. package/resources/minting.d.ts.map +1 -0
  188. package/resources/minting.js +15 -0
  189. package/resources/minting.js.map +1 -0
  190. package/resources/minting.mjs +11 -0
  191. package/resources/minting.mjs.map +1 -0
  192. package/resources/referral/index.d.ts +3 -0
  193. package/resources/referral/index.d.ts.map +1 -0
  194. package/resources/referral/index.js +9 -0
  195. package/resources/referral/index.js.map +1 -0
  196. package/resources/referral/index.mjs +4 -0
  197. package/resources/referral/index.mjs.map +1 -0
  198. package/resources/referral/referral.d.ts +39 -0
  199. package/resources/referral/referral.d.ts.map +1 -0
  200. package/resources/{drip/drip.js → referral/referral.js} +21 -12
  201. package/resources/referral/referral.js.map +1 -0
  202. package/resources/referral/referral.mjs +25 -0
  203. package/resources/referral/referral.mjs.map +1 -0
  204. package/resources/referral/users.d.ts +83 -0
  205. package/resources/referral/users.d.ts.map +1 -0
  206. package/resources/referral/users.js +35 -0
  207. package/resources/referral/users.js.map +1 -0
  208. package/resources/referral/users.mjs +31 -0
  209. package/resources/referral/users.mjs.map +1 -0
  210. package/resources/referral.d.ts +2 -0
  211. package/resources/referral.d.ts.map +1 -0
  212. package/resources/referral.js +19 -0
  213. package/resources/referral.js.map +1 -0
  214. package/resources/referral.mjs +3 -0
  215. package/resources/referral.mjs.map +1 -0
  216. package/resources/users/index.d.ts +2 -3
  217. package/resources/users/index.d.ts.map +1 -1
  218. package/resources/users/index.js +1 -3
  219. package/resources/users/index.js.map +1 -1
  220. package/resources/users/index.mjs +2 -3
  221. package/resources/users/index.mjs.map +1 -1
  222. package/resources/users/metadatas.d.ts +112 -9
  223. package/resources/users/metadatas.d.ts.map +1 -1
  224. package/resources/users/metadatas.js +6 -0
  225. package/resources/users/metadatas.js.map +1 -1
  226. package/resources/users/metadatas.mjs +6 -0
  227. package/resources/users/metadatas.mjs.map +1 -1
  228. package/resources/users/users.d.ts +414 -6
  229. package/resources/users/users.d.ts.map +1 -1
  230. package/resources/users/users.js +77 -4
  231. package/resources/users/users.js.map +1 -1
  232. package/resources/users/users.mjs +78 -5
  233. package/resources/users/users.mjs.map +1 -1
  234. package/resources/users.d.ts +2 -0
  235. package/resources/users.d.ts.map +1 -0
  236. package/resources/users.js +19 -0
  237. package/resources/users.js.map +1 -0
  238. package/resources/users.mjs +3 -0
  239. package/resources/users.mjs.map +1 -0
  240. package/resources/websites/index.d.ts +4 -0
  241. package/resources/websites/index.d.ts.map +1 -0
  242. package/resources/websites/index.js +11 -0
  243. package/resources/websites/index.js.map +1 -0
  244. package/resources/websites/index.mjs +5 -0
  245. package/resources/websites/index.mjs.map +1 -0
  246. package/resources/websites/website-collections.d.ts +94 -0
  247. package/resources/websites/website-collections.d.ts.map +1 -0
  248. package/resources/websites/website-collections.js +46 -0
  249. package/resources/websites/website-collections.js.map +1 -0
  250. package/resources/websites/website-collections.mjs +42 -0
  251. package/resources/websites/website-collections.mjs.map +1 -0
  252. package/resources/websites/website-user-roles.d.ts +96 -0
  253. package/resources/websites/website-user-roles.d.ts.map +1 -0
  254. package/resources/websites/website-user-roles.js +45 -0
  255. package/resources/websites/website-user-roles.js.map +1 -0
  256. package/resources/websites/website-user-roles.mjs +41 -0
  257. package/resources/websites/website-user-roles.mjs.map +1 -0
  258. package/resources/websites/websites.d.ts +223 -0
  259. package/resources/websites/websites.d.ts.map +1 -0
  260. package/resources/websites/websites.js +63 -0
  261. package/resources/websites/websites.js.map +1 -0
  262. package/resources/websites/websites.mjs +36 -0
  263. package/resources/websites/websites.mjs.map +1 -0
  264. package/resources/websites.d.ts +1 -202
  265. package/resources/websites.d.ts.map +1 -1
  266. package/resources/websites.js +15 -18
  267. package/resources/websites.js.map +1 -1
  268. package/resources/websites.mjs +1 -16
  269. package/resources/websites.mjs.map +1 -1
  270. package/resources.d.ts +2 -0
  271. package/resources.d.ts.map +1 -0
  272. package/resources.js +18 -0
  273. package/resources.js.map +1 -0
  274. package/resources.mjs +2 -0
  275. package/resources.mjs.map +1 -0
  276. package/src/_shims/index.d.ts +2 -0
  277. package/src/_shims/index.js +5 -1
  278. package/src/_shims/index.mjs +5 -1
  279. package/src/core.ts +56 -20
  280. package/src/index.ts +97 -24
  281. package/src/resource.ts +1 -1
  282. package/src/resources/assets.ts +31 -9
  283. package/src/resources/auctions/auctions.ts +436 -0
  284. package/src/resources/auctions/index.ts +18 -0
  285. package/src/resources/auctions/website-user-attributes/index.ts +18 -0
  286. package/src/resources/auctions/website-user-attributes/values.ts +165 -0
  287. package/src/resources/auctions/website-user-attributes/website-user-attributes.ts +207 -0
  288. package/src/resources/auctions/website-user-attributes.ts +3 -0
  289. package/src/resources/auctions.ts +3 -0
  290. package/src/resources/auth.ts +74 -0
  291. package/src/resources/index.ts +31 -5
  292. package/src/resources/loyalty/account-streaks.ts +110 -0
  293. package/src/resources/loyalty/accounts.ts +79 -16
  294. package/src/resources/loyalty/badges.ts +1192 -92
  295. package/src/resources/loyalty/currencies.ts +20 -1
  296. package/src/resources/loyalty/index.ts +53 -9
  297. package/src/resources/loyalty/loyalty.ts +160 -60
  298. package/src/resources/loyalty/multipliers.ts +124 -4
  299. package/src/resources/loyalty/questions-responses.ts +161 -0
  300. package/src/resources/loyalty/questions.ts +241 -0
  301. package/src/resources/loyalty/rule-edits.ts +3622 -63
  302. package/src/resources/loyalty/rule-groups.ts +1181 -0
  303. package/src/resources/loyalty/rules.ts +3068 -579
  304. package/src/resources/loyalty/transactions/index.ts +18 -0
  305. package/src/resources/loyalty/transactions/rule-statuses.ts +178 -0
  306. package/src/resources/loyalty/transactions/transactions.ts +675 -0
  307. package/src/resources/loyalty/transactions.ts +3 -0
  308. package/src/resources/loyalty.ts +3 -0
  309. package/src/resources/minting.ts +170 -0
  310. package/src/resources/referral/index.ts +10 -0
  311. package/src/resources/referral/referral.ts +72 -0
  312. package/src/resources/referral/users.ts +122 -0
  313. package/src/resources/referral.ts +3 -0
  314. package/src/resources/users/index.ts +21 -9
  315. package/src/resources/users/metadatas.ts +167 -8
  316. package/src/resources/users/users.ts +581 -17
  317. package/src/resources/users.ts +3 -0
  318. package/src/resources/websites/index.ts +22 -0
  319. package/src/resources/websites/website-collections.ts +182 -0
  320. package/src/resources/websites/website-user-roles.ts +130 -0
  321. package/src/resources/websites/websites.ts +311 -0
  322. package/src/resources/websites.ts +1 -257
  323. package/src/resources.ts +1 -0
  324. package/src/version.ts +1 -1
  325. package/version.d.ts +1 -1
  326. package/version.d.ts.map +1 -1
  327. package/version.js +1 -1
  328. package/version.js.map +1 -1
  329. package/version.mjs +1 -1
  330. package/version.mjs.map +1 -1
  331. package/resources/auction-bids.d.ts +0 -81
  332. package/resources/auction-bids.d.ts.map +0 -1
  333. package/resources/auction-bids.js +0 -30
  334. package/resources/auction-bids.js.map +0 -1
  335. package/resources/auction-bids.mjs +0 -26
  336. package/resources/auction-bids.mjs.map +0 -1
  337. package/resources/drip/drip.d.ts +0 -14
  338. package/resources/drip/drip.d.ts.map +0 -1
  339. package/resources/drip/drip.js.map +0 -1
  340. package/resources/drip/drip.mjs +0 -16
  341. package/resources/drip/drip.mjs.map +0 -1
  342. package/resources/drip/index.d.ts +0 -4
  343. package/resources/drip/index.d.ts.map +0 -1
  344. package/resources/drip/index.js +0 -11
  345. package/resources/drip/index.js.map +0 -1
  346. package/resources/drip/index.mjs +0 -5
  347. package/resources/drip/index.mjs.map +0 -1
  348. package/resources/drip/quests.d.ts +0 -168
  349. package/resources/drip/quests.d.ts.map +0 -1
  350. package/resources/drip/quests.js +0 -17
  351. package/resources/drip/quests.js.map +0 -1
  352. package/resources/drip/quests.mjs +0 -13
  353. package/resources/drip/quests.mjs.map +0 -1
  354. package/resources/drip/status.d.ts +0 -26
  355. package/resources/drip/status.d.ts.map +0 -1
  356. package/resources/drip/status.js +0 -16
  357. package/resources/drip/status.js.map +0 -1
  358. package/resources/drip/status.mjs +0 -12
  359. package/resources/drip/status.mjs.map +0 -1
  360. package/resources/loyalty/transaction-entries.d.ts +0 -175
  361. package/resources/loyalty/transaction-entries.d.ts.map +0 -1
  362. package/resources/loyalty/transaction-entries.js +0 -16
  363. package/resources/loyalty/transaction-entries.js.map +0 -1
  364. package/resources/loyalty/transaction-entries.mjs +0 -12
  365. package/resources/loyalty/transaction-entries.mjs.map +0 -1
  366. package/resources/users/wallets.d.ts +0 -193
  367. package/resources/users/wallets.d.ts.map +0 -1
  368. package/resources/users/wallets.js +0 -28
  369. package/resources/users/wallets.js.map +0 -1
  370. package/resources/users/wallets.mjs +0 -24
  371. package/resources/users/wallets.mjs.map +0 -1
  372. package/src/resources/auction-bids.ts +0 -123
  373. package/src/resources/drip/drip.ts +0 -25
  374. package/src/resources/drip/index.ts +0 -5
  375. package/src/resources/drip/quests.ts +0 -210
  376. package/src/resources/drip/status.ts +0 -33
  377. package/src/resources/loyalty/transaction-entries.ts +0 -229
  378. package/src/resources/users/wallets.ts +0 -271
@@ -6,7 +6,18 @@ import * as Core from '../../core';
6
6
 
7
7
  export class Badges extends APIResource {
8
8
  /**
9
- * This endpoint allows you to configure a new badge.
9
+ * This endpoint allows you to configure a new badge
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const badge = await client.loyalty.badges.create({
14
+ * conditions: [{}],
15
+ * imageUrl: 'https://example.com/image.png',
16
+ * name: 'Example Badge',
17
+ * organizationId: '123e4567-e89b-12d3-a456-426614174222',
18
+ * websiteId: '123e4567-e89b-12d3-a456-426614174111',
19
+ * });
20
+ * ```
10
21
  */
11
22
  create(body: BadgeCreateParams, options?: Core.RequestOptions): Core.APIPromise<BadgeCreateResponse> {
12
23
  return this._client.post('/api/loyalty/badges', { body, ...options });
@@ -14,6 +25,13 @@ export class Badges extends APIResource {
14
25
 
15
26
  /**
16
27
  * This endpoint allows you to update an existing badge.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const badge = await client.loyalty.badges.update(
32
+ * '123e4567-e89b-12d3-a456-426614174333',
33
+ * );
34
+ * ```
17
35
  */
18
36
  update(
19
37
  id: string,
@@ -34,6 +52,11 @@ export class Badges extends APIResource {
34
52
 
35
53
  /**
36
54
  * This endpoint allows you to fetch badge(s) data.
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * const badges = await client.loyalty.badges.list();
59
+ * ```
37
60
  */
38
61
  list(query?: BadgeListParams, options?: Core.RequestOptions): Core.APIPromise<BadgeListResponse>;
39
62
  list(options?: Core.RequestOptions): Core.APIPromise<BadgeListResponse>;
@@ -49,6 +72,13 @@ export class Badges extends APIResource {
49
72
 
50
73
  /**
51
74
  * This endpoint allows you to delete a badge.
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * const badge = await client.loyalty.badges.delete(
79
+ * '123e4567-e89b-12d3-a456-426614174333',
80
+ * );
81
+ * ```
52
82
  */
53
83
  delete(id: string, options?: Core.RequestOptions): Core.APIPromise<BadgeDeleteResponse> {
54
84
  return this._client.delete(`/api/loyalty/badges/${id}`, options);
@@ -56,6 +86,13 @@ export class Badges extends APIResource {
56
86
 
57
87
  /**
58
88
  * This endpoint allows you to revoke a badge from an account
89
+ *
90
+ * @example
91
+ * ```ts
92
+ * const response = await client.loyalty.badges.revoke(
93
+ * '123e4567-e89b-12d3-a456-426614174333',
94
+ * );
95
+ * ```
59
96
  */
60
97
  revoke(
61
98
  id: string,
@@ -76,6 +113,13 @@ export class Badges extends APIResource {
76
113
 
77
114
  /**
78
115
  * This endpoint allows you to reward a badge for an account
116
+ *
117
+ * @example
118
+ * ```ts
119
+ * const response = await client.loyalty.badges.reward(
120
+ * '123e4567-e89b-12d3-a456-426614174333',
121
+ * );
122
+ * ```
79
123
  */
80
124
  reward(
81
125
  id: string,
@@ -99,118 +143,1132 @@ export class Badges extends APIResource {
99
143
  * Response returned upon successful creation of the badge.
100
144
  */
101
145
  export interface BadgeCreateResponse {
146
+ /**
147
+ * UUID of the badge (converted to lowercase)
148
+ */
102
149
  id: string;
150
+
151
+ /**
152
+ * The description of the badge
153
+ */
154
+ description: string | null;
155
+
156
+ /**
157
+ * The URL of the badge image
158
+ */
159
+ imageUrl: string | null;
160
+
161
+ /**
162
+ * Array of conditions of the badge
163
+ */
164
+ loyaltyConditions: Array<BadgeCreateResponse.LoyaltyCondition>;
165
+
166
+ /**
167
+ * The name of the badge
168
+ */
169
+ name: string;
170
+
171
+ /**
172
+ * Array of data jobs associated with the badge
173
+ */
174
+ dataJobs?: Array<BadgeCreateResponse.DataJob>;
175
+
176
+ /**
177
+ * Array of user badges
178
+ */
179
+ loyaltyBadgeUsers?: Array<BadgeCreateResponse.LoyaltyBadgeUser>;
180
+
181
+ /**
182
+ * Array of loyalty rules associated with the badge
183
+ */
184
+ loyaltyRules?: Array<BadgeCreateResponse.LoyaltyRule>;
103
185
  }
104
186
 
105
- /**
106
- * Response returned upon successful update of the badge.
107
- */
108
- export interface BadgeUpdateResponse {
109
- id: string;
110
- }
187
+ export namespace BadgeCreateResponse {
188
+ /**
189
+ * Schema for a loyalty condition rule.
190
+ */
191
+ export interface LoyaltyCondition {
192
+ /**
193
+ * UUID of the condition (converted to lowercase)
194
+ */
195
+ id: string;
196
+
197
+ /**
198
+ * The amount of the condition
199
+ */
200
+ amount: number | null;
201
+
202
+ association: Array<LoyaltyCondition.Association>;
203
+
204
+ /**
205
+ * The URL of the CSV file
206
+ */
207
+ csvUrl: string | null;
208
+
209
+ /**
210
+ * The description of the condition
211
+ */
212
+ description: string | null;
213
+
214
+ /**
215
+ * UUID of the currency (converted to lowercase)
216
+ */
217
+ loyaltyCurrencyId: string | null;
218
+
219
+ /**
220
+ * UUID of the rule group (converted to lowercase)
221
+ */
222
+ loyaltyRuleGroupId: string | null;
223
+
224
+ /**
225
+ * The repeat count of the condition
226
+ */
227
+ repeatCount: number | null;
228
+
229
+ /**
230
+ * The required count of the condition
231
+ */
232
+ requiredCount: number | null;
233
+
234
+ /**
235
+ * The type of the condition
236
+ */
237
+ type: 'rule' | 'rules' | 'points' | 'section' | 'level' | 'api' | 'badge' | 'badges' | 'csv';
238
+ }
239
+
240
+ export namespace LoyaltyCondition {
241
+ export interface Association {
242
+ loyaltyBadge: Association.LoyaltyBadge | null;
243
+
244
+ loyaltyCurrency: Association.LoyaltyCurrency | null;
245
+
246
+ loyaltyLeaderboardView: Association.LoyaltyLeaderboardView | null;
247
+
248
+ loyaltyRule: Association.LoyaltyRule | null;
249
+
250
+ loyaltyRuleGroup: Association.LoyaltyRuleGroup | null;
251
+ }
252
+
253
+ export namespace Association {
254
+ export interface LoyaltyBadge {
255
+ /**
256
+ * UUID of the association (converted to lowercase)
257
+ */
258
+ id: string;
259
+
260
+ /**
261
+ * The name of the association
262
+ */
263
+ name: string;
264
+ }
265
+
266
+ export interface LoyaltyCurrency {
267
+ /**
268
+ * UUID of the association (converted to lowercase)
269
+ */
270
+ id: string;
271
+
272
+ /**
273
+ * The name of the association
274
+ */
275
+ name: string;
276
+ }
277
+
278
+ export interface LoyaltyLeaderboardView {
279
+ /**
280
+ * UUID of the association (converted to lowercase)
281
+ */
282
+ id: string;
283
+
284
+ /**
285
+ * The name of the association
286
+ */
287
+ name: string;
288
+ }
289
+
290
+ export interface LoyaltyRule {
291
+ /**
292
+ * UUID of the association (converted to lowercase)
293
+ */
294
+ id: string;
295
+
296
+ /**
297
+ * The name of the association
298
+ */
299
+ name: string;
300
+ }
301
+
302
+ export interface LoyaltyRuleGroup {
303
+ /**
304
+ * UUID of the association (converted to lowercase)
305
+ */
306
+ id: string;
307
+
308
+ /**
309
+ * The name of the association
310
+ */
311
+ name: string;
312
+ }
313
+ }
314
+ }
315
+
316
+ export interface DataJob {
317
+ /**
318
+ * UUID of the data job (converted to lowercase)
319
+ */
320
+ id: string;
321
+
322
+ /**
323
+ * The date and time the data job was created
324
+ */
325
+ createdAt: string;
326
+
327
+ /**
328
+ * The status of the data job
329
+ */
330
+ status: 'pending' | 'complete' | 'failed';
331
+
332
+ /**
333
+ * The date and time the data job was updated
334
+ */
335
+ updatedAt: string;
336
+
337
+ /**
338
+ * The message associated with the data job
339
+ */
340
+ message?: string | null;
341
+ }
342
+
343
+ export interface LoyaltyBadgeUser {
344
+ /**
345
+ * UUID of the user badge (converted to lowercase)
346
+ */
347
+ id: string;
348
+
349
+ /**
350
+ * The date and time the user badge was created
351
+ */
352
+ createdAt: string;
353
+
354
+ /**
355
+ * UUID of the badge (converted to lowercase)
356
+ */
357
+ loyaltyBadgeId: string;
358
+
359
+ /**
360
+ * UUID of the organization (converted to lowercase)
361
+ */
362
+ organizationId: string;
363
+
364
+ /**
365
+ * The status of the badge
366
+ */
367
+ status: 'active' | 'inactive' | 'revoked';
368
+
369
+ /**
370
+ * The date and time the user badge was updated
371
+ */
372
+ updatedAt: string;
373
+
374
+ /**
375
+ * UUID of the user (converted to lowercase)
376
+ */
377
+ userId: string;
378
+
379
+ /**
380
+ * UUID of the website (converted to lowercase)
381
+ */
382
+ websiteId: string;
383
+
384
+ /**
385
+ * Array of progress for the badge
386
+ */
387
+ progress?: unknown;
388
+
389
+ /**
390
+ * User associated with the user badge
391
+ */
392
+ user?: LoyaltyBadgeUser.User;
393
+ }
394
+
395
+ export namespace LoyaltyBadgeUser {
396
+ /**
397
+ * User associated with the user badge
398
+ */
399
+ export interface User {
400
+ /**
401
+ * UUID of the user (converted to lowercase)
402
+ */
403
+ id: string;
404
+
405
+ /**
406
+ * Wallet address of the user
407
+ */
408
+ walletAddress: string;
409
+ }
410
+ }
411
+
412
+ export interface LoyaltyRule {
413
+ /**
414
+ * UUID of the loyalty rule (converted to lowercase)
415
+ */
416
+ id: string;
417
+
418
+ /**
419
+ * The name of the loyalty rule
420
+ */
421
+ name: string;
422
+ }
423
+ }
424
+
425
+ /**
426
+ * Response returned upon successful update of the badge.
427
+ */
428
+ export interface BadgeUpdateResponse {
429
+ /**
430
+ * UUID of the badge (converted to lowercase)
431
+ */
432
+ id: string;
433
+
434
+ /**
435
+ * The description of the badge
436
+ */
437
+ description: string | null;
438
+
439
+ /**
440
+ * The URL of the badge image
441
+ */
442
+ imageUrl: string | null;
443
+
444
+ /**
445
+ * Array of conditions of the badge
446
+ */
447
+ loyaltyConditions: Array<BadgeUpdateResponse.LoyaltyCondition>;
448
+
449
+ /**
450
+ * The name of the badge
451
+ */
452
+ name: string;
453
+
454
+ /**
455
+ * Array of data jobs associated with the badge
456
+ */
457
+ dataJobs?: Array<BadgeUpdateResponse.DataJob>;
458
+
459
+ /**
460
+ * Array of user badges
461
+ */
462
+ loyaltyBadgeUsers?: Array<BadgeUpdateResponse.LoyaltyBadgeUser>;
463
+
464
+ /**
465
+ * Array of loyalty rules associated with the badge
466
+ */
467
+ loyaltyRules?: Array<BadgeUpdateResponse.LoyaltyRule>;
468
+ }
469
+
470
+ export namespace BadgeUpdateResponse {
471
+ /**
472
+ * Schema for a loyalty condition rule.
473
+ */
474
+ export interface LoyaltyCondition {
475
+ /**
476
+ * UUID of the condition (converted to lowercase)
477
+ */
478
+ id: string;
479
+
480
+ /**
481
+ * The amount of the condition
482
+ */
483
+ amount: number | null;
484
+
485
+ association: Array<LoyaltyCondition.Association>;
486
+
487
+ /**
488
+ * The URL of the CSV file
489
+ */
490
+ csvUrl: string | null;
491
+
492
+ /**
493
+ * The description of the condition
494
+ */
495
+ description: string | null;
496
+
497
+ /**
498
+ * UUID of the currency (converted to lowercase)
499
+ */
500
+ loyaltyCurrencyId: string | null;
501
+
502
+ /**
503
+ * UUID of the rule group (converted to lowercase)
504
+ */
505
+ loyaltyRuleGroupId: string | null;
506
+
507
+ /**
508
+ * The repeat count of the condition
509
+ */
510
+ repeatCount: number | null;
511
+
512
+ /**
513
+ * The required count of the condition
514
+ */
515
+ requiredCount: number | null;
516
+
517
+ /**
518
+ * The type of the condition
519
+ */
520
+ type: 'rule' | 'rules' | 'points' | 'section' | 'level' | 'api' | 'badge' | 'badges' | 'csv';
521
+ }
522
+
523
+ export namespace LoyaltyCondition {
524
+ export interface Association {
525
+ loyaltyBadge: Association.LoyaltyBadge | null;
526
+
527
+ loyaltyCurrency: Association.LoyaltyCurrency | null;
528
+
529
+ loyaltyLeaderboardView: Association.LoyaltyLeaderboardView | null;
530
+
531
+ loyaltyRule: Association.LoyaltyRule | null;
532
+
533
+ loyaltyRuleGroup: Association.LoyaltyRuleGroup | null;
534
+ }
535
+
536
+ export namespace Association {
537
+ export interface LoyaltyBadge {
538
+ /**
539
+ * UUID of the association (converted to lowercase)
540
+ */
541
+ id: string;
542
+
543
+ /**
544
+ * The name of the association
545
+ */
546
+ name: string;
547
+ }
548
+
549
+ export interface LoyaltyCurrency {
550
+ /**
551
+ * UUID of the association (converted to lowercase)
552
+ */
553
+ id: string;
554
+
555
+ /**
556
+ * The name of the association
557
+ */
558
+ name: string;
559
+ }
560
+
561
+ export interface LoyaltyLeaderboardView {
562
+ /**
563
+ * UUID of the association (converted to lowercase)
564
+ */
565
+ id: string;
566
+
567
+ /**
568
+ * The name of the association
569
+ */
570
+ name: string;
571
+ }
572
+
573
+ export interface LoyaltyRule {
574
+ /**
575
+ * UUID of the association (converted to lowercase)
576
+ */
577
+ id: string;
578
+
579
+ /**
580
+ * The name of the association
581
+ */
582
+ name: string;
583
+ }
584
+
585
+ export interface LoyaltyRuleGroup {
586
+ /**
587
+ * UUID of the association (converted to lowercase)
588
+ */
589
+ id: string;
590
+
591
+ /**
592
+ * The name of the association
593
+ */
594
+ name: string;
595
+ }
596
+ }
597
+ }
598
+
599
+ export interface DataJob {
600
+ /**
601
+ * UUID of the data job (converted to lowercase)
602
+ */
603
+ id: string;
604
+
605
+ /**
606
+ * The date and time the data job was created
607
+ */
608
+ createdAt: string;
609
+
610
+ /**
611
+ * The status of the data job
612
+ */
613
+ status: 'pending' | 'complete' | 'failed';
614
+
615
+ /**
616
+ * The date and time the data job was updated
617
+ */
618
+ updatedAt: string;
619
+
620
+ /**
621
+ * The message associated with the data job
622
+ */
623
+ message?: string | null;
624
+ }
625
+
626
+ export interface LoyaltyBadgeUser {
627
+ /**
628
+ * UUID of the user badge (converted to lowercase)
629
+ */
630
+ id: string;
631
+
632
+ /**
633
+ * The date and time the user badge was created
634
+ */
635
+ createdAt: string;
636
+
637
+ /**
638
+ * UUID of the badge (converted to lowercase)
639
+ */
640
+ loyaltyBadgeId: string;
641
+
642
+ /**
643
+ * UUID of the organization (converted to lowercase)
644
+ */
645
+ organizationId: string;
646
+
647
+ /**
648
+ * The status of the badge
649
+ */
650
+ status: 'active' | 'inactive' | 'revoked';
651
+
652
+ /**
653
+ * The date and time the user badge was updated
654
+ */
655
+ updatedAt: string;
656
+
657
+ /**
658
+ * UUID of the user (converted to lowercase)
659
+ */
660
+ userId: string;
661
+
662
+ /**
663
+ * UUID of the website (converted to lowercase)
664
+ */
665
+ websiteId: string;
666
+
667
+ /**
668
+ * Array of progress for the badge
669
+ */
670
+ progress?: unknown;
671
+
672
+ /**
673
+ * User associated with the user badge
674
+ */
675
+ user?: LoyaltyBadgeUser.User;
676
+ }
677
+
678
+ export namespace LoyaltyBadgeUser {
679
+ /**
680
+ * User associated with the user badge
681
+ */
682
+ export interface User {
683
+ /**
684
+ * UUID of the user (converted to lowercase)
685
+ */
686
+ id: string;
687
+
688
+ /**
689
+ * Wallet address of the user
690
+ */
691
+ walletAddress: string;
692
+ }
693
+ }
694
+
695
+ export interface LoyaltyRule {
696
+ /**
697
+ * UUID of the loyalty rule (converted to lowercase)
698
+ */
699
+ id: string;
700
+
701
+ /**
702
+ * The name of the loyalty rule
703
+ */
704
+ name: string;
705
+ }
706
+ }
707
+
708
+ /**
709
+ * Response returned upon successful fetching of the badges.
710
+ */
711
+ export interface BadgeListResponse {
712
+ /**
713
+ * UUID of the badge (converted to lowercase)
714
+ */
715
+ id: string;
716
+
717
+ /**
718
+ * The description of the badge
719
+ */
720
+ description: string | null;
721
+
722
+ /**
723
+ * The URL of the badge image
724
+ */
725
+ imageUrl: string | null;
726
+
727
+ /**
728
+ * Array of conditions of the badge
729
+ */
730
+ loyaltyConditions: Array<BadgeListResponse.LoyaltyCondition>;
731
+
732
+ /**
733
+ * The name of the badge
734
+ */
735
+ name: string;
736
+
737
+ /**
738
+ * Array of data jobs associated with the badge
739
+ */
740
+ dataJobs?: Array<BadgeListResponse.DataJob>;
741
+
742
+ /**
743
+ * Array of user badges
744
+ */
745
+ loyaltyBadgeUsers?: Array<BadgeListResponse.LoyaltyBadgeUser>;
746
+
747
+ /**
748
+ * Array of loyalty rules associated with the badge
749
+ */
750
+ loyaltyRules?: Array<BadgeListResponse.LoyaltyRule>;
751
+ }
752
+
753
+ export namespace BadgeListResponse {
754
+ /**
755
+ * Schema for a loyalty condition rule.
756
+ */
757
+ export interface LoyaltyCondition {
758
+ /**
759
+ * UUID of the condition (converted to lowercase)
760
+ */
761
+ id: string;
762
+
763
+ /**
764
+ * The amount of the condition
765
+ */
766
+ amount: number | null;
767
+
768
+ association: Array<LoyaltyCondition.Association>;
769
+
770
+ /**
771
+ * The URL of the CSV file
772
+ */
773
+ csvUrl: string | null;
774
+
775
+ /**
776
+ * The description of the condition
777
+ */
778
+ description: string | null;
779
+
780
+ /**
781
+ * UUID of the currency (converted to lowercase)
782
+ */
783
+ loyaltyCurrencyId: string | null;
784
+
785
+ /**
786
+ * UUID of the rule group (converted to lowercase)
787
+ */
788
+ loyaltyRuleGroupId: string | null;
789
+
790
+ /**
791
+ * The repeat count of the condition
792
+ */
793
+ repeatCount: number | null;
794
+
795
+ /**
796
+ * The required count of the condition
797
+ */
798
+ requiredCount: number | null;
799
+
800
+ /**
801
+ * The type of the condition
802
+ */
803
+ type: 'rule' | 'rules' | 'points' | 'section' | 'level' | 'api' | 'badge' | 'badges' | 'csv';
804
+ }
805
+
806
+ export namespace LoyaltyCondition {
807
+ export interface Association {
808
+ loyaltyBadge: Association.LoyaltyBadge | null;
809
+
810
+ loyaltyCurrency: Association.LoyaltyCurrency | null;
811
+
812
+ loyaltyLeaderboardView: Association.LoyaltyLeaderboardView | null;
813
+
814
+ loyaltyRule: Association.LoyaltyRule | null;
815
+
816
+ loyaltyRuleGroup: Association.LoyaltyRuleGroup | null;
817
+ }
111
818
 
112
- /**
113
- * Response returned upon successful fetching of the badges.
114
- */
115
- export interface BadgeListResponse {
116
- badges: Array<BadgeListResponse.Badge>;
117
- }
819
+ export namespace Association {
820
+ export interface LoyaltyBadge {
821
+ /**
822
+ * UUID of the association (converted to lowercase)
823
+ */
824
+ id: string;
825
+
826
+ /**
827
+ * The name of the association
828
+ */
829
+ name: string;
830
+ }
831
+
832
+ export interface LoyaltyCurrency {
833
+ /**
834
+ * UUID of the association (converted to lowercase)
835
+ */
836
+ id: string;
837
+
838
+ /**
839
+ * The name of the association
840
+ */
841
+ name: string;
842
+ }
843
+
844
+ export interface LoyaltyLeaderboardView {
845
+ /**
846
+ * UUID of the association (converted to lowercase)
847
+ */
848
+ id: string;
849
+
850
+ /**
851
+ * The name of the association
852
+ */
853
+ name: string;
854
+ }
855
+
856
+ export interface LoyaltyRule {
857
+ /**
858
+ * UUID of the association (converted to lowercase)
859
+ */
860
+ id: string;
861
+
862
+ /**
863
+ * The name of the association
864
+ */
865
+ name: string;
866
+ }
867
+
868
+ export interface LoyaltyRuleGroup {
869
+ /**
870
+ * UUID of the association (converted to lowercase)
871
+ */
872
+ id: string;
873
+
874
+ /**
875
+ * The name of the association
876
+ */
877
+ name: string;
878
+ }
879
+ }
880
+ }
118
881
 
119
- export namespace BadgeListResponse {
120
- export interface Badge {
882
+ export interface DataJob {
121
883
  /**
122
- * UUID of the badge (converted to lowercase)
884
+ * UUID of the data job (converted to lowercase)
123
885
  */
124
886
  id: string;
125
887
 
126
888
  /**
127
- * Count of rules and accounts with the badge
889
+ * The date and time the data job was created
128
890
  */
129
- _count: Badge._Count;
891
+ createdAt: string;
130
892
 
131
893
  /**
132
- * The URL of the badge image
894
+ * The status of the data job
133
895
  */
134
- imageUrl: string;
896
+ status: 'pending' | 'complete' | 'failed';
135
897
 
136
898
  /**
137
- * Array of rules for the badge
899
+ * The date and time the data job was updated
138
900
  */
139
- loyaltyConditions: Array<Badge.LoyaltyCondition>;
901
+ updatedAt: string;
140
902
 
141
903
  /**
142
- * The name of the badge
904
+ * The message associated with the data job
143
905
  */
144
- name: string;
906
+ message?: string | null;
907
+ }
145
908
 
909
+ export interface LoyaltyBadgeUser {
146
910
  /**
147
- * The description of the badge
911
+ * UUID of the user badge (converted to lowercase)
148
912
  */
149
- description?: string;
150
- }
913
+ id: string;
151
914
 
152
- export namespace Badge {
153
915
  /**
154
- * Count of rules and accounts with the badge
916
+ * The date and time the user badge was created
155
917
  */
156
- export interface _Count {
157
- /**
158
- * The number of accounts with the badge
159
- */
160
- LoyaltyBadgeUser: number;
918
+ createdAt: string;
161
919
 
162
- /**
163
- * The number of rules
164
- */
165
- loyaltyConditions: number;
166
- }
920
+ /**
921
+ * UUID of the badge (converted to lowercase)
922
+ */
923
+ loyaltyBadgeId: string;
167
924
 
168
- export interface LoyaltyCondition {
169
- /**
170
- * UUID of the rule (converted to lowercase)
171
- */
172
- id: string;
925
+ /**
926
+ * UUID of the organization (converted to lowercase)
927
+ */
928
+ organizationId: string;
173
929
 
174
- /**
175
- * The type of rule
176
- */
177
- type: 'rule' | 'section' | 'level' | 'points' | 'api' | 'badge';
930
+ /**
931
+ * The status of the badge
932
+ */
933
+ status: 'active' | 'inactive' | 'revoked';
178
934
 
179
- /**
180
- * The amount of the rule
181
- */
182
- amount?: number;
935
+ /**
936
+ * The date and time the user badge was updated
937
+ */
938
+ updatedAt: string;
183
939
 
184
- /**
185
- * The description of the rule
186
- */
187
- description?: string;
940
+ /**
941
+ * UUID of the user (converted to lowercase)
942
+ */
943
+ userId: string;
188
944
 
189
- /**
190
- * UUID of the currency (optional, converted to lowercase)
191
- */
192
- loyaltyCurrencyId?: string;
945
+ /**
946
+ * UUID of the website (converted to lowercase)
947
+ */
948
+ websiteId: string;
949
+
950
+ /**
951
+ * Array of progress for the badge
952
+ */
953
+ progress?: unknown;
954
+
955
+ /**
956
+ * User associated with the user badge
957
+ */
958
+ user?: LoyaltyBadgeUser.User;
959
+ }
193
960
 
961
+ export namespace LoyaltyBadgeUser {
962
+ /**
963
+ * User associated with the user badge
964
+ */
965
+ export interface User {
194
966
  /**
195
- * UUID of the rule group (optional, converted to lowercase)
967
+ * UUID of the user (converted to lowercase)
196
968
  */
197
- loyaltyRuleGroupId?: string;
969
+ id: string;
198
970
 
199
971
  /**
200
- * UUID of the rule (optional, converted to lowercase)
972
+ * Wallet address of the user
201
973
  */
202
- loyaltyRuleId?: string;
974
+ walletAddress: string;
203
975
  }
204
976
  }
977
+
978
+ export interface LoyaltyRule {
979
+ /**
980
+ * UUID of the loyalty rule (converted to lowercase)
981
+ */
982
+ id: string;
983
+
984
+ /**
985
+ * The name of the loyalty rule
986
+ */
987
+ name: string;
988
+ }
205
989
  }
206
990
 
207
991
  /**
208
992
  * Response returned upon successful deletion of the badge.
209
993
  */
210
994
  export interface BadgeDeleteResponse {
995
+ /**
996
+ * UUID of the badge (converted to lowercase)
997
+ */
211
998
  id: string;
212
999
 
213
- deletedAt: string;
1000
+ /**
1001
+ * The description of the badge
1002
+ */
1003
+ description: string | null;
1004
+
1005
+ /**
1006
+ * The URL of the badge image
1007
+ */
1008
+ imageUrl: string | null;
1009
+
1010
+ /**
1011
+ * Array of conditions of the badge
1012
+ */
1013
+ loyaltyConditions: Array<BadgeDeleteResponse.LoyaltyCondition>;
1014
+
1015
+ /**
1016
+ * The name of the badge
1017
+ */
1018
+ name: string;
1019
+
1020
+ /**
1021
+ * Array of data jobs associated with the badge
1022
+ */
1023
+ dataJobs?: Array<BadgeDeleteResponse.DataJob>;
1024
+
1025
+ /**
1026
+ * Array of user badges
1027
+ */
1028
+ loyaltyBadgeUsers?: Array<BadgeDeleteResponse.LoyaltyBadgeUser>;
1029
+
1030
+ /**
1031
+ * Array of loyalty rules associated with the badge
1032
+ */
1033
+ loyaltyRules?: Array<BadgeDeleteResponse.LoyaltyRule>;
1034
+ }
1035
+
1036
+ export namespace BadgeDeleteResponse {
1037
+ /**
1038
+ * Schema for a loyalty condition rule.
1039
+ */
1040
+ export interface LoyaltyCondition {
1041
+ /**
1042
+ * UUID of the condition (converted to lowercase)
1043
+ */
1044
+ id: string;
1045
+
1046
+ /**
1047
+ * The amount of the condition
1048
+ */
1049
+ amount: number | null;
1050
+
1051
+ association: Array<LoyaltyCondition.Association>;
1052
+
1053
+ /**
1054
+ * The URL of the CSV file
1055
+ */
1056
+ csvUrl: string | null;
1057
+
1058
+ /**
1059
+ * The description of the condition
1060
+ */
1061
+ description: string | null;
1062
+
1063
+ /**
1064
+ * UUID of the currency (converted to lowercase)
1065
+ */
1066
+ loyaltyCurrencyId: string | null;
1067
+
1068
+ /**
1069
+ * UUID of the rule group (converted to lowercase)
1070
+ */
1071
+ loyaltyRuleGroupId: string | null;
1072
+
1073
+ /**
1074
+ * The repeat count of the condition
1075
+ */
1076
+ repeatCount: number | null;
1077
+
1078
+ /**
1079
+ * The required count of the condition
1080
+ */
1081
+ requiredCount: number | null;
1082
+
1083
+ /**
1084
+ * The type of the condition
1085
+ */
1086
+ type: 'rule' | 'rules' | 'points' | 'section' | 'level' | 'api' | 'badge' | 'badges' | 'csv';
1087
+ }
1088
+
1089
+ export namespace LoyaltyCondition {
1090
+ export interface Association {
1091
+ loyaltyBadge: Association.LoyaltyBadge | null;
1092
+
1093
+ loyaltyCurrency: Association.LoyaltyCurrency | null;
1094
+
1095
+ loyaltyLeaderboardView: Association.LoyaltyLeaderboardView | null;
1096
+
1097
+ loyaltyRule: Association.LoyaltyRule | null;
1098
+
1099
+ loyaltyRuleGroup: Association.LoyaltyRuleGroup | null;
1100
+ }
1101
+
1102
+ export namespace Association {
1103
+ export interface LoyaltyBadge {
1104
+ /**
1105
+ * UUID of the association (converted to lowercase)
1106
+ */
1107
+ id: string;
1108
+
1109
+ /**
1110
+ * The name of the association
1111
+ */
1112
+ name: string;
1113
+ }
1114
+
1115
+ export interface LoyaltyCurrency {
1116
+ /**
1117
+ * UUID of the association (converted to lowercase)
1118
+ */
1119
+ id: string;
1120
+
1121
+ /**
1122
+ * The name of the association
1123
+ */
1124
+ name: string;
1125
+ }
1126
+
1127
+ export interface LoyaltyLeaderboardView {
1128
+ /**
1129
+ * UUID of the association (converted to lowercase)
1130
+ */
1131
+ id: string;
1132
+
1133
+ /**
1134
+ * The name of the association
1135
+ */
1136
+ name: string;
1137
+ }
1138
+
1139
+ export interface LoyaltyRule {
1140
+ /**
1141
+ * UUID of the association (converted to lowercase)
1142
+ */
1143
+ id: string;
1144
+
1145
+ /**
1146
+ * The name of the association
1147
+ */
1148
+ name: string;
1149
+ }
1150
+
1151
+ export interface LoyaltyRuleGroup {
1152
+ /**
1153
+ * UUID of the association (converted to lowercase)
1154
+ */
1155
+ id: string;
1156
+
1157
+ /**
1158
+ * The name of the association
1159
+ */
1160
+ name: string;
1161
+ }
1162
+ }
1163
+ }
1164
+
1165
+ export interface DataJob {
1166
+ /**
1167
+ * UUID of the data job (converted to lowercase)
1168
+ */
1169
+ id: string;
1170
+
1171
+ /**
1172
+ * The date and time the data job was created
1173
+ */
1174
+ createdAt: string;
1175
+
1176
+ /**
1177
+ * The status of the data job
1178
+ */
1179
+ status: 'pending' | 'complete' | 'failed';
1180
+
1181
+ /**
1182
+ * The date and time the data job was updated
1183
+ */
1184
+ updatedAt: string;
1185
+
1186
+ /**
1187
+ * The message associated with the data job
1188
+ */
1189
+ message?: string | null;
1190
+ }
1191
+
1192
+ export interface LoyaltyBadgeUser {
1193
+ /**
1194
+ * UUID of the user badge (converted to lowercase)
1195
+ */
1196
+ id: string;
1197
+
1198
+ /**
1199
+ * The date and time the user badge was created
1200
+ */
1201
+ createdAt: string;
1202
+
1203
+ /**
1204
+ * UUID of the badge (converted to lowercase)
1205
+ */
1206
+ loyaltyBadgeId: string;
1207
+
1208
+ /**
1209
+ * UUID of the organization (converted to lowercase)
1210
+ */
1211
+ organizationId: string;
1212
+
1213
+ /**
1214
+ * The status of the badge
1215
+ */
1216
+ status: 'active' | 'inactive' | 'revoked';
1217
+
1218
+ /**
1219
+ * The date and time the user badge was updated
1220
+ */
1221
+ updatedAt: string;
1222
+
1223
+ /**
1224
+ * UUID of the user (converted to lowercase)
1225
+ */
1226
+ userId: string;
1227
+
1228
+ /**
1229
+ * UUID of the website (converted to lowercase)
1230
+ */
1231
+ websiteId: string;
1232
+
1233
+ /**
1234
+ * Array of progress for the badge
1235
+ */
1236
+ progress?: unknown;
1237
+
1238
+ /**
1239
+ * User associated with the user badge
1240
+ */
1241
+ user?: LoyaltyBadgeUser.User;
1242
+ }
1243
+
1244
+ export namespace LoyaltyBadgeUser {
1245
+ /**
1246
+ * User associated with the user badge
1247
+ */
1248
+ export interface User {
1249
+ /**
1250
+ * UUID of the user (converted to lowercase)
1251
+ */
1252
+ id: string;
1253
+
1254
+ /**
1255
+ * Wallet address of the user
1256
+ */
1257
+ walletAddress: string;
1258
+ }
1259
+ }
1260
+
1261
+ export interface LoyaltyRule {
1262
+ /**
1263
+ * UUID of the loyalty rule (converted to lowercase)
1264
+ */
1265
+ id: string;
1266
+
1267
+ /**
1268
+ * The name of the loyalty rule
1269
+ */
1270
+ name: string;
1271
+ }
214
1272
  }
215
1273
 
216
1274
  /**
@@ -262,6 +1320,11 @@ export namespace BadgeRewardResponse {
262
1320
  }
263
1321
 
264
1322
  export interface BadgeCreateParams {
1323
+ /**
1324
+ * Array of conditions for the badge
1325
+ */
1326
+ conditions: Array<BadgeCreateParams.Condition>;
1327
+
265
1328
  /**
266
1329
  * The URL of the badge image
267
1330
  */
@@ -277,11 +1340,6 @@ export interface BadgeCreateParams {
277
1340
  */
278
1341
  organizationId: string;
279
1342
 
280
- /**
281
- * Array of rules for the badge
282
- */
283
- rules: Array<BadgeCreateParams.Rule>;
284
-
285
1343
  /**
286
1344
  * UUID of the website (optional, converted to lowercase)
287
1345
  */
@@ -294,49 +1352,66 @@ export interface BadgeCreateParams {
294
1352
  }
295
1353
 
296
1354
  export namespace BadgeCreateParams {
297
- /**
298
- * Schema for a loyalty condition rule.
299
- */
300
- export interface Rule {
1355
+ export interface Condition {
301
1356
  /**
302
- * The type of rule
1357
+ * The amount of the rule
303
1358
  */
304
- type: 'rule' | 'section' | 'level' | 'points' | 'api' | 'badge';
1359
+ amount?: number | null;
305
1360
 
306
1361
  /**
307
- * The amount of the rule
1362
+ * URL of the CSV file (optional)
308
1363
  */
309
- amount?: number | null;
1364
+ csvUrl?: string | null;
310
1365
 
311
1366
  /**
312
1367
  * The description of the rule
313
1368
  */
314
- description?: string;
1369
+ description?: string | null;
1370
+
1371
+ /**
1372
+ * Array of UUIDs of the badge (optional, converted to lowercase)
1373
+ */
1374
+ loyaltyBadgeIds?: Array<string>;
1375
+
1376
+ /**
1377
+ * Array of UUIDs of the currency (optional, converted to lowercase)
1378
+ */
1379
+ loyaltyCurrencyIds?: Array<string>;
1380
+
1381
+ /**
1382
+ * Array of UUIDs of the Loyalty Leaderboard (optional, converted to lowercase)
1383
+ */
1384
+ loyaltyLeaderboardViewIds?: Array<string>;
315
1385
 
316
1386
  /**
317
- * UUID of the badge (optional, converted to lowercase)
1387
+ * UUID of the loyalty rule chain (optional, converted to lowercase)
318
1388
  */
319
- loyaltyBadgeId?: string | null;
1389
+ loyaltyRuleChainId?: string;
320
1390
 
321
1391
  /**
322
- * UUID of the currency (optional, converted to lowercase)
1392
+ * Array of UUIDs of the rule group (optional, converted to lowercase)
323
1393
  */
324
- loyaltyCurrencyId?: string | null;
1394
+ loyaltyRuleGroupIds?: Array<string>;
325
1395
 
326
1396
  /**
327
- * UUID of the Loyalty Leaderboard (optional, converted to lowercase)
1397
+ * Array of UUIDs of the rules (optional, converted to lowercase)
328
1398
  */
329
- loyaltyLeaderboardViewId?: string | null;
1399
+ loyaltyRuleIds?: Array<string>;
330
1400
 
331
1401
  /**
332
- * UUID of the rule group (optional, converted to lowercase)
1402
+ * The number of times the rule should be repeated to fulfill the condition
333
1403
  */
334
- loyaltyRuleGroupId?: string | null;
1404
+ repeatCount?: number | null;
335
1405
 
336
1406
  /**
337
- * UUID of the rule (optional, converted to lowercase)
1407
+ * The number of rules that need to be fulfilled to satisfy the condition
1408
+ */
1409
+ requiredCount?: number | null;
1410
+
1411
+ /**
1412
+ * The type of rule
338
1413
  */
339
- loyaltyRuleId?: string | null;
1414
+ type?: 'rule' | 'rules' | 'points' | 'section' | 'level' | 'api' | 'badge' | 'badges' | 'csv';
340
1415
  }
341
1416
  }
342
1417
 
@@ -371,7 +1446,7 @@ export interface BadgeListParams {
371
1446
  /**
372
1447
  * Number of badges to fetch
373
1448
  */
374
- limit?: number | null;
1449
+ limit?: number;
375
1450
 
376
1451
  /**
377
1452
  * UUID of the organization (optional, converted to lowercase)
@@ -384,9 +1459,24 @@ export interface BadgeListParams {
384
1459
  startingAfter?: string;
385
1460
 
386
1461
  /**
387
- * UUID of the user (optional, converted to lowercase)
1462
+ * External identifier of the user group
388
1463
  */
389
- userId?: string;
1464
+ userGroupExternalIdentifier?: string;
1465
+
1466
+ /**
1467
+ * UUID of the user group
1468
+ */
1469
+ userGroupId?: string;
1470
+
1471
+ /**
1472
+ * UUID of the user, or array of UUID.
1473
+ */
1474
+ userId?: string | Array<string>;
1475
+
1476
+ /**
1477
+ * Wallet Address of the user, or array of wallet addresses.
1478
+ */
1479
+ walletAddress?: string | Array<string>;
390
1480
 
391
1481
  /**
392
1482
  * UUID of the website (optional, converted to lowercase)
@@ -395,6 +1485,11 @@ export interface BadgeListParams {
395
1485
  }
396
1486
 
397
1487
  export interface BadgeRevokeParams {
1488
+ /**
1489
+ * Status of the badge
1490
+ */
1491
+ status?: 'active' | 'inactive' | 'revoked';
1492
+
398
1493
  /**
399
1494
  * UUID of the user (converted to lowercase)
400
1495
  */
@@ -407,6 +1502,11 @@ export interface BadgeRevokeParams {
407
1502
  }
408
1503
 
409
1504
  export interface BadgeRewardParams {
1505
+ /**
1506
+ * Status of the badge
1507
+ */
1508
+ status?: 'active' | 'inactive' | 'revoked';
1509
+
410
1510
  /**
411
1511
  * UUID of the user (converted to lowercase)
412
1512
  */