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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/CHANGELOG.md +1408 -0
  2. package/README.md +13 -23
  3. package/core.d.ts +19 -5
  4. package/core.d.ts.map +1 -1
  5. package/core.js +24 -17
  6. package/core.js.map +1 -1
  7. package/core.mjs +24 -17
  8. package/core.mjs.map +1 -1
  9. package/index.d.mts +9 -6
  10. package/index.d.ts +9 -6
  11. package/index.d.ts.map +1 -1
  12. package/index.js +8 -4
  13. package/index.js.map +1 -1
  14. package/index.mjs +9 -5
  15. package/index.mjs.map +1 -1
  16. package/package.json +4 -5
  17. package/resource.d.ts +1 -1
  18. package/resource.d.ts.map +1 -1
  19. package/resource.js.map +1 -1
  20. package/resource.mjs.map +1 -1
  21. package/resources/assets.d.ts +16 -2
  22. package/resources/assets.d.ts.map +1 -1
  23. package/resources/assets.js +8 -0
  24. package/resources/assets.js.map +1 -1
  25. package/resources/assets.mjs +8 -0
  26. package/resources/assets.mjs.map +1 -1
  27. package/resources/auctions/auctions.d.ts +285 -0
  28. package/resources/auctions/auctions.d.ts.map +1 -0
  29. package/resources/auctions/auctions.js +76 -0
  30. package/resources/auctions/auctions.js.map +1 -0
  31. package/resources/auctions/auctions.mjs +49 -0
  32. package/resources/auctions/auctions.mjs.map +1 -0
  33. package/resources/auctions/index.d.ts +3 -0
  34. package/resources/auctions/index.d.ts.map +1 -0
  35. package/resources/auctions/index.js +9 -0
  36. package/resources/auctions/index.js.map +1 -0
  37. package/resources/auctions/index.mjs +4 -0
  38. package/resources/auctions/index.mjs.map +1 -0
  39. package/resources/auctions/website-user-attributes/index.d.ts +3 -0
  40. package/resources/auctions/website-user-attributes/index.d.ts.map +1 -0
  41. package/resources/auctions/website-user-attributes/index.js +9 -0
  42. package/resources/auctions/website-user-attributes/index.js.map +1 -0
  43. package/resources/auctions/website-user-attributes/index.mjs +4 -0
  44. package/resources/auctions/website-user-attributes/index.mjs.map +1 -0
  45. package/resources/auctions/website-user-attributes/values.d.ts +76 -0
  46. package/resources/auctions/website-user-attributes/values.d.ts.map +1 -0
  47. package/resources/auctions/website-user-attributes/values.js +35 -0
  48. package/resources/auctions/website-user-attributes/values.js.map +1 -0
  49. package/resources/auctions/website-user-attributes/values.mjs +31 -0
  50. package/resources/auctions/website-user-attributes/values.mjs.map +1 -0
  51. package/resources/auctions/website-user-attributes/website-user-attributes.d.ts +92 -0
  52. package/resources/auctions/website-user-attributes/website-user-attributes.d.ts.map +1 -0
  53. package/resources/auctions/website-user-attributes/website-user-attributes.js +69 -0
  54. package/resources/auctions/website-user-attributes/website-user-attributes.js.map +1 -0
  55. package/resources/auctions/website-user-attributes/website-user-attributes.mjs +42 -0
  56. package/resources/auctions/website-user-attributes/website-user-attributes.mjs.map +1 -0
  57. package/resources/auctions/website-user-attributes.d.ts +2 -0
  58. package/resources/auctions/website-user-attributes.d.ts.map +1 -0
  59. package/resources/auctions/website-user-attributes.js +19 -0
  60. package/resources/auctions/website-user-attributes.js.map +1 -0
  61. package/resources/auctions/website-user-attributes.mjs +3 -0
  62. package/resources/auctions/website-user-attributes.mjs.map +1 -0
  63. package/resources/auctions.d.ts +1 -133
  64. package/resources/auctions.d.ts.map +1 -1
  65. package/resources/auctions.js +15 -22
  66. package/resources/auctions.js.map +1 -1
  67. package/resources/auctions.mjs +1 -20
  68. package/resources/auctions.mjs.map +1 -1
  69. package/resources/auth.d.ts +17 -4
  70. package/resources/auth.d.ts.map +1 -1
  71. package/resources/auth.js.map +1 -1
  72. package/resources/auth.mjs.map +1 -1
  73. package/resources/index.d.ts +3 -3
  74. package/resources/index.d.ts.map +1 -1
  75. package/resources/index.js +1 -1
  76. package/resources/index.js.map +1 -1
  77. package/resources/index.mjs +2 -2
  78. package/resources/index.mjs.map +1 -1
  79. package/resources/loyalty/account-streaks.d.ts +81 -0
  80. package/resources/loyalty/account-streaks.d.ts.map +1 -0
  81. package/resources/loyalty/account-streaks.js +24 -0
  82. package/resources/loyalty/account-streaks.js.map +1 -0
  83. package/resources/loyalty/account-streaks.mjs +20 -0
  84. package/resources/loyalty/account-streaks.mjs.map +1 -0
  85. package/resources/loyalty/accounts.d.ts +58 -16
  86. package/resources/loyalty/accounts.d.ts.map +1 -1
  87. package/resources/loyalty/accounts.js +13 -0
  88. package/resources/loyalty/accounts.js.map +1 -1
  89. package/resources/loyalty/accounts.mjs +13 -0
  90. package/resources/loyalty/accounts.mjs.map +1 -1
  91. package/resources/loyalty/badges.d.ts +472 -22
  92. package/resources/loyalty/badges.d.ts.map +1 -1
  93. package/resources/loyalty/badges.js +19 -1
  94. package/resources/loyalty/badges.js.map +1 -1
  95. package/resources/loyalty/badges.mjs +19 -1
  96. package/resources/loyalty/badges.mjs.map +1 -1
  97. package/resources/loyalty/currencies.d.ts +19 -0
  98. package/resources/loyalty/currencies.d.ts.map +1 -1
  99. package/resources/loyalty/currencies.js +19 -0
  100. package/resources/loyalty/currencies.js.map +1 -1
  101. package/resources/loyalty/currencies.mjs +19 -0
  102. package/resources/loyalty/currencies.mjs.map +1 -1
  103. package/resources/loyalty/index.d.ts +4 -4
  104. package/resources/loyalty/index.d.ts.map +1 -1
  105. package/resources/loyalty/index.js +5 -5
  106. package/resources/loyalty/index.js.map +1 -1
  107. package/resources/loyalty/index.mjs +2 -2
  108. package/resources/loyalty/index.mjs.map +1 -1
  109. package/resources/loyalty/loyalty.d.ts +10 -10
  110. package/resources/loyalty/loyalty.d.ts.map +1 -1
  111. package/resources/loyalty/loyalty.js +6 -6
  112. package/resources/loyalty/loyalty.js.map +1 -1
  113. package/resources/loyalty/loyalty.mjs +7 -7
  114. package/resources/loyalty/loyalty.mjs.map +1 -1
  115. package/resources/loyalty/multipliers.d.ts +39 -2
  116. package/resources/loyalty/multipliers.d.ts.map +1 -1
  117. package/resources/loyalty/multipliers.js +23 -0
  118. package/resources/loyalty/multipliers.js.map +1 -1
  119. package/resources/loyalty/multipliers.mjs +23 -0
  120. package/resources/loyalty/multipliers.mjs.map +1 -1
  121. package/resources/loyalty/questions-responses.d.ts +39 -0
  122. package/resources/loyalty/questions-responses.d.ts.map +1 -1
  123. package/resources/loyalty/questions-responses.js +9 -0
  124. package/resources/loyalty/questions-responses.js.map +1 -1
  125. package/resources/loyalty/questions-responses.mjs +9 -0
  126. package/resources/loyalty/questions-responses.mjs.map +1 -1
  127. package/resources/loyalty/questions.d.ts +37 -2
  128. package/resources/loyalty/questions.d.ts.map +1 -1
  129. package/resources/loyalty/questions.js +31 -0
  130. package/resources/loyalty/questions.js.map +1 -1
  131. package/resources/loyalty/questions.mjs +31 -0
  132. package/resources/loyalty/questions.mjs.map +1 -1
  133. package/resources/loyalty/rule-edits.d.ts +2626 -4
  134. package/resources/loyalty/rule-edits.d.ts.map +1 -1
  135. package/resources/loyalty/rule-edits.js +14 -0
  136. package/resources/loyalty/rule-edits.js.map +1 -1
  137. package/resources/loyalty/rule-edits.mjs +14 -0
  138. package/resources/loyalty/rule-edits.mjs.map +1 -1
  139. package/resources/loyalty/rule-groups.d.ts +273 -58
  140. package/resources/loyalty/rule-groups.d.ts.map +1 -1
  141. package/resources/loyalty/rule-groups.js +36 -0
  142. package/resources/loyalty/rule-groups.js.map +1 -1
  143. package/resources/loyalty/rule-groups.mjs +36 -0
  144. package/resources/loyalty/rule-groups.mjs.map +1 -1
  145. package/resources/loyalty/rules.d.ts +1887 -270
  146. package/resources/loyalty/rules.d.ts.map +1 -1
  147. package/resources/loyalty/rules.js +40 -9
  148. package/resources/loyalty/rules.js.map +1 -1
  149. package/resources/loyalty/rules.mjs +40 -9
  150. package/resources/loyalty/rules.mjs.map +1 -1
  151. package/resources/loyalty/transactions/index.d.ts +3 -0
  152. package/resources/loyalty/transactions/index.d.ts.map +1 -0
  153. package/resources/loyalty/transactions/index.js +9 -0
  154. package/resources/loyalty/transactions/index.js.map +1 -0
  155. package/resources/loyalty/transactions/index.mjs +4 -0
  156. package/resources/loyalty/transactions/index.mjs.map +1 -0
  157. package/resources/loyalty/transactions/rule-statuses.d.ts +61 -0
  158. package/resources/loyalty/transactions/rule-statuses.d.ts.map +1 -0
  159. package/resources/loyalty/transactions/rule-statuses.js +23 -0
  160. package/resources/loyalty/transactions/rule-statuses.js.map +1 -0
  161. package/resources/loyalty/transactions/rule-statuses.mjs +19 -0
  162. package/resources/loyalty/transactions/rule-statuses.mjs.map +1 -0
  163. package/resources/loyalty/transactions/transactions.d.ts +292 -0
  164. package/resources/loyalty/transactions/transactions.d.ts.map +1 -0
  165. package/resources/loyalty/transactions/transactions.js +61 -0
  166. package/resources/loyalty/transactions/transactions.js.map +1 -0
  167. package/resources/loyalty/transactions/transactions.mjs +34 -0
  168. package/resources/loyalty/transactions/transactions.mjs.map +1 -0
  169. package/resources/loyalty/transactions.d.ts +1 -247
  170. package/resources/loyalty/transactions.d.ts.map +1 -1
  171. package/resources/loyalty/transactions.js +15 -18
  172. package/resources/loyalty/transactions.js.map +1 -1
  173. package/resources/loyalty/transactions.mjs +1 -16
  174. package/resources/loyalty/transactions.mjs.map +1 -1
  175. package/resources/minting.d.ts +5 -5
  176. package/resources/minting.d.ts.map +1 -1
  177. package/resources/referral/referral.d.ts +11 -3
  178. package/resources/referral/referral.d.ts.map +1 -1
  179. package/resources/referral/referral.js +11 -5
  180. package/resources/referral/referral.js.map +1 -1
  181. package/resources/referral/referral.mjs +11 -5
  182. package/resources/referral/referral.mjs.map +1 -1
  183. package/resources/referral/users.d.ts +28 -1
  184. package/resources/referral/users.d.ts.map +1 -1
  185. package/resources/referral/users.js +14 -0
  186. package/resources/referral/users.js.map +1 -1
  187. package/resources/referral/users.mjs +14 -0
  188. package/resources/referral/users.mjs.map +1 -1
  189. package/resources/users/index.d.ts +1 -1
  190. package/resources/users/index.d.ts.map +1 -1
  191. package/resources/users/index.js.map +1 -1
  192. package/resources/users/index.mjs.map +1 -1
  193. package/resources/users/metadatas.d.ts +27 -0
  194. package/resources/users/metadatas.d.ts.map +1 -1
  195. package/resources/users/metadatas.js.map +1 -1
  196. package/resources/users/metadatas.mjs.map +1 -1
  197. package/resources/users/users.d.ts +159 -6
  198. package/resources/users/users.d.ts.map +1 -1
  199. package/resources/users/users.js +53 -1
  200. package/resources/users/users.js.map +1 -1
  201. package/resources/users/users.mjs +53 -1
  202. package/resources/users/users.mjs.map +1 -1
  203. package/resources/websites/index.d.ts +2 -2
  204. package/resources/websites/index.d.ts.map +1 -1
  205. package/resources/websites/index.js.map +1 -1
  206. package/resources/websites/index.mjs +2 -2
  207. package/resources/websites/index.mjs.map +1 -1
  208. package/resources/websites/website-collections.d.ts +0 -69
  209. package/resources/websites/website-collections.d.ts.map +1 -1
  210. package/resources/websites/website-collections.js +0 -16
  211. package/resources/websites/website-collections.js.map +1 -1
  212. package/resources/websites/website-collections.mjs +0 -16
  213. package/resources/websites/website-collections.mjs.map +1 -1
  214. package/resources/websites/website-user-roles.d.ts +23 -0
  215. package/resources/websites/website-user-roles.d.ts.map +1 -1
  216. package/resources/websites/website-user-roles.js +23 -0
  217. package/resources/websites/website-user-roles.js.map +1 -1
  218. package/resources/websites/website-user-roles.mjs +23 -0
  219. package/resources/websites/website-user-roles.mjs.map +1 -1
  220. package/resources/websites/websites.d.ts +8 -98
  221. package/resources/websites/websites.d.ts.map +1 -1
  222. package/resources/websites/websites.js +0 -6
  223. package/resources/websites/websites.js.map +1 -1
  224. package/resources/websites/websites.mjs +1 -7
  225. package/resources/websites/websites.mjs.map +1 -1
  226. package/src/core.ts +39 -16
  227. package/src/index.ts +30 -11
  228. package/src/resource.ts +1 -1
  229. package/src/resources/assets.ts +18 -2
  230. package/src/resources/auctions/auctions.ts +432 -0
  231. package/src/resources/auctions/index.ts +16 -0
  232. package/src/resources/auctions/website-user-attributes/index.ts +10 -0
  233. package/src/resources/auctions/website-user-attributes/values.ts +97 -0
  234. package/src/resources/auctions/website-user-attributes/website-user-attributes.ts +137 -0
  235. package/src/resources/auctions/website-user-attributes.ts +3 -0
  236. package/src/resources/auctions.ts +1 -207
  237. package/src/resources/auth.ts +21 -5
  238. package/src/resources/index.ts +12 -8
  239. package/src/resources/loyalty/account-streaks.ts +110 -0
  240. package/src/resources/loyalty/accounts.ts +63 -18
  241. package/src/resources/loyalty/badges.ts +567 -24
  242. package/src/resources/loyalty/currencies.ts +19 -0
  243. package/src/resources/loyalty/index.ts +12 -2
  244. package/src/resources/loyalty/loyalty.ts +33 -9
  245. package/src/resources/loyalty/multipliers.ts +43 -4
  246. package/src/resources/loyalty/questions-responses.ts +45 -0
  247. package/src/resources/loyalty/questions.ts +38 -2
  248. package/src/resources/loyalty/rule-edits.ts +3799 -97
  249. package/src/resources/loyalty/rule-groups.ts +465 -65
  250. package/src/resources/loyalty/rules.ts +2906 -313
  251. package/src/resources/loyalty/transactions/index.ts +10 -0
  252. package/src/resources/loyalty/transactions/rule-statuses.ts +87 -0
  253. package/src/resources/loyalty/transactions/transactions.ts +520 -0
  254. package/src/resources/loyalty/transactions.ts +1 -330
  255. package/src/resources/minting.ts +22 -5
  256. package/src/resources/referral/referral.ts +13 -11
  257. package/src/resources/referral/users.ts +33 -2
  258. package/src/resources/users/index.ts +4 -0
  259. package/src/resources/users/metadatas.ts +52 -0
  260. package/src/resources/users/users.ts +213 -5
  261. package/src/resources/websites/index.ts +2 -13
  262. package/src/resources/websites/website-collections.ts +1 -145
  263. package/src/resources/websites/website-user-roles.ts +23 -0
  264. package/src/resources/websites/websites.ts +8 -134
  265. package/src/version.ts +1 -1
  266. package/version.d.ts +1 -1
  267. package/version.d.ts.map +1 -1
  268. package/version.js +1 -1
  269. package/version.js.map +1 -1
  270. package/version.mjs +1 -1
  271. package/version.mjs.map +1 -1
  272. package/resources/loyalty/rule-chains.d.ts +0 -4
  273. package/resources/loyalty/rule-chains.d.ts.map +0 -1
  274. package/resources/loyalty/rule-chains.js +0 -9
  275. package/resources/loyalty/rule-chains.js.map +0 -1
  276. package/resources/loyalty/rule-chains.mjs +0 -5
  277. package/resources/loyalty/rule-chains.mjs.map +0 -1
  278. package/src/resources/loyalty/rule-chains.ts +0 -5
@@ -4,10 +4,33 @@ export declare class WebsiteUserRoles extends APIResource {
4
4
  /**
5
5
  * Retrieves roles of users for a specific website. If userId is provided,
6
6
  * retrieves the role of that specific user for the website.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const websiteUserRoles =
11
+ * await client.websites.websiteUserRoles.list({
12
+ * websiteId: '123e4567-e89b-12d3-a456-426614174000',
13
+ * });
14
+ * ```
7
15
  */
8
16
  list(query: WebsiteUserRoleListParams, options?: Core.RequestOptions): Core.APIPromise<WebsiteUserRoleListResponse>;
9
17
  /**
10
18
  * Assign roles to users for a specific website
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const response =
23
+ * await client.websites.websiteUserRoles.assign({
24
+ * websiteId: '123e4567-e89b-12d3-a456-426614174000',
25
+ * websiteUserRoles: [
26
+ * {
27
+ * roleType: 'WEBSITE_SUPER_ADMIN',
28
+ * walletAddress:
29
+ * '0x1234567890abcdef1234567890abcdef12345678',
30
+ * },
31
+ * ],
32
+ * });
33
+ * ```
11
34
  */
12
35
  assign(body: WebsiteUserRoleAssignParams, options?: Core.RequestOptions): Core.APIPromise<WebsiteUserRoleAssignResponse>;
13
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"website-user-roles.d.ts","sourceRoot":"","sources":["../../src/resources/websites/website-user-roles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C;;;OAGG;IACH,IAAI,CACF,KAAK,EAAE,yBAAyB,EAChC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,2BAA2B,CAAC;IAI/C;;OAEG;IACH,MAAM,CACJ,IAAI,EAAE,2BAA2B,EACjC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,6BAA6B,CAAC;CAGlD;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,KAAK,CAAC,2BAA2B,CAAC,IAAI,CAAC,CAAC;CAC/C;AAED,yBAAiB,2BAA2B,CAAC;IAC3C,UAAiB,IAAI;QACnB;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;KACZ;CACF;AAED;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,gBAAgB,EAAE,KAAK,CAAC,2BAA2B,CAAC,eAAe,CAAC,CAAC;CACtE;AAED,yBAAiB,2BAA2B,CAAC;IAC3C,UAAiB,eAAe;QAC9B;;WAEG;QACH,QAAQ,EACJ,qBAAqB,GACrB,eAAe,GACf,mBAAmB,GACnB,iBAAiB,GACjB,iBAAiB,CAAC;QAEtB;;WAEG;QACH,aAAa,EAAE,MAAM,CAAC;QAEtB;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;CACF;AAED,MAAM,CAAC,OAAO,WAAW,gBAAgB,CAAC;IACxC,OAAO,EACL,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,2BAA2B,IAAI,2BAA2B,GAChE,CAAC;CACH"}
1
+ {"version":3,"file":"website-user-roles.d.ts","sourceRoot":"","sources":["../../src/resources/websites/website-user-roles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C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,gBAAgB,CAAC;IACxC,OAAO,EACL,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,2BAA2B,IAAI,2BAA2B,GAChE,CAAC;CACH"}
@@ -7,12 +7,35 @@ class WebsiteUserRoles extends resource_1.APIResource {
7
7
  /**
8
8
  * Retrieves roles of users for a specific website. If userId is provided,
9
9
  * retrieves the role of that specific user for the website.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const websiteUserRoles =
14
+ * await client.websites.websiteUserRoles.list({
15
+ * websiteId: '123e4567-e89b-12d3-a456-426614174000',
16
+ * });
17
+ * ```
10
18
  */
11
19
  list(query, options) {
12
20
  return this._client.get('/api/website_user_roles', { query, ...options });
13
21
  }
14
22
  /**
15
23
  * Assign roles to users for a specific website
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const response =
28
+ * await client.websites.websiteUserRoles.assign({
29
+ * websiteId: '123e4567-e89b-12d3-a456-426614174000',
30
+ * websiteUserRoles: [
31
+ * {
32
+ * roleType: 'WEBSITE_SUPER_ADMIN',
33
+ * walletAddress:
34
+ * '0x1234567890abcdef1234567890abcdef12345678',
35
+ * },
36
+ * ],
37
+ * });
38
+ * ```
16
39
  */
17
40
  assign(body, options) {
18
41
  return this._client.post('/api/website_user_roles', { body, ...options });
@@ -1 +1 @@
1
- {"version":3,"file":"website-user-roles.js","sourceRoot":"","sources":["../../src/resources/websites/website-user-roles.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAG7C,MAAa,gBAAiB,SAAQ,sBAAW;IAC/C;;;OAGG;IACH,IAAI,CACF,KAAgC,EAChC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;OAEG;IACH,MAAM,CACJ,IAAiC,EACjC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;CACF;AArBD,4CAqBC"}
1
+ {"version":3,"file":"website-user-roles.js","sourceRoot":"","sources":["../../src/resources/websites/website-user-roles.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAG7C,MAAa,gBAAiB,SAAQ,sBAAW;IAC/C;;;;;;;;;;;OAWG;IACH,IAAI,CACF,KAAgC,EAChC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CACJ,IAAiC,EACjC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;CACF;AA5CD,4CA4CC"}
@@ -4,12 +4,35 @@ export class WebsiteUserRoles extends APIResource {
4
4
  /**
5
5
  * Retrieves roles of users for a specific website. If userId is provided,
6
6
  * retrieves the role of that specific user for the website.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const websiteUserRoles =
11
+ * await client.websites.websiteUserRoles.list({
12
+ * websiteId: '123e4567-e89b-12d3-a456-426614174000',
13
+ * });
14
+ * ```
7
15
  */
8
16
  list(query, options) {
9
17
  return this._client.get('/api/website_user_roles', { query, ...options });
10
18
  }
11
19
  /**
12
20
  * Assign roles to users for a specific website
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * const response =
25
+ * await client.websites.websiteUserRoles.assign({
26
+ * websiteId: '123e4567-e89b-12d3-a456-426614174000',
27
+ * websiteUserRoles: [
28
+ * {
29
+ * roleType: 'WEBSITE_SUPER_ADMIN',
30
+ * walletAddress:
31
+ * '0x1234567890abcdef1234567890abcdef12345678',
32
+ * },
33
+ * ],
34
+ * });
35
+ * ```
13
36
  */
14
37
  assign(body, options) {
15
38
  return this._client.post('/api/website_user_roles', { body, ...options });
@@ -1 +1 @@
1
- {"version":3,"file":"website-user-roles.mjs","sourceRoot":"","sources":["../../src/resources/websites/website-user-roles.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAC/C;;;OAGG;IACH,IAAI,CACF,KAAgC,EAChC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;OAEG;IACH,MAAM,CACJ,IAAiC,EACjC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;CACF"}
1
+ {"version":3,"file":"website-user-roles.mjs","sourceRoot":"","sources":["../../src/resources/websites/website-user-roles.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAC/C;;;;;;;;;;;OAWG;IACH,IAAI,CACF,KAAgC,EAChC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CACJ,IAAiC,EACjC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;CACF"}
@@ -1,84 +1,24 @@
1
1
  import { APIResource } from "../../resource.js";
2
2
  import * as Core from "../../core.js";
3
3
  import * as WebsiteCollectionsAPI from "./website-collections.js";
4
- import { WebsiteCollectionCreateParams, WebsiteCollectionListParams, WebsiteCollectionListResponse, WebsiteCollections } from "./website-collections.js";
4
+ import { WebsiteCollections } from "./website-collections.js";
5
5
  import * as WebsiteUserRolesAPI from "./website-user-roles.js";
6
6
  import { WebsiteUserRoleAssignParams, WebsiteUserRoleAssignResponse, WebsiteUserRoleListParams, WebsiteUserRoleListResponse, WebsiteUserRoles } from "./website-user-roles.js";
7
7
  export declare class Websites extends APIResource {
8
8
  websiteCollections: WebsiteCollectionsAPI.WebsiteCollections;
9
9
  websiteUserRoles: WebsiteUserRolesAPI.WebsiteUserRoles;
10
- /**
11
- * Creates a new website
12
- */
13
- create(body: WebsiteCreateParams, options?: Core.RequestOptions): Core.APIPromise<WebsiteCreateResponse>;
14
10
  /**
15
11
  * Returns a list of websites. Includes optional query parameters for filtering and
16
12
  * pagination.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const websites = await client.websites.list();
17
+ * ```
17
18
  */
18
19
  list(query?: WebsiteListParams, options?: Core.RequestOptions): Core.APIPromise<WebsiteListResponse>;
19
20
  list(options?: Core.RequestOptions): Core.APIPromise<WebsiteListResponse>;
20
21
  }
21
- /**
22
- * Schema representing a website
23
- */
24
- export interface WebsiteCreateResponse {
25
- /**
26
- * Website ID
27
- */
28
- id: string;
29
- /**
30
- * Counts of related entities
31
- */
32
- _count: WebsiteCreateResponse._Count;
33
- /**
34
- * Collections associated with the website
35
- */
36
- collections: Array<WebsiteCreateResponse.Collection>;
37
- /**
38
- * Website name
39
- */
40
- name: string;
41
- /**
42
- * Date when terms were signed
43
- */
44
- termsSignedAt: string | null;
45
- }
46
- export declare namespace WebsiteCreateResponse {
47
- /**
48
- * Counts of related entities
49
- */
50
- interface _Count {
51
- /**
52
- * Count of minting contract assets
53
- */
54
- mintingContractAssets: number;
55
- }
56
- /**
57
- * Schema representing a collection
58
- */
59
- interface Collection {
60
- /**
61
- * Collection ID
62
- */
63
- id: string;
64
- /**
65
- * URL of the collection image
66
- */
67
- imageUrl: string | null;
68
- /**
69
- * Collection name
70
- */
71
- name: string;
72
- /**
73
- * Royalty fee percentage
74
- */
75
- royaltyFee: number;
76
- /**
77
- * Address to receive royalty fees
78
- */
79
- royaltyFeeAddress: string;
80
- }
81
- }
82
22
  /**
83
23
  * Response schema for fetching websites
84
24
  */
@@ -155,36 +95,6 @@ export declare namespace WebsiteListResponse {
155
95
  }
156
96
  }
157
97
  }
158
- export interface WebsiteCreateParams {
159
- /**
160
- * Name of the website
161
- */
162
- name: string;
163
- /**
164
- * Discord URL of the website account
165
- */
166
- discordUrl?: string;
167
- /**
168
- * Home URL of the official website
169
- */
170
- homeUrl?: string;
171
- /**
172
- * Instagram username of the website account
173
- */
174
- instagramUsername?: string;
175
- /**
176
- * Organization ID for which this website is being created
177
- */
178
- organizationId?: string;
179
- /**
180
- * Telegram URL of the website account
181
- */
182
- telegramUrl?: string;
183
- /**
184
- * Twitter username of the website account
185
- */
186
- twitterUsername?: string;
187
- }
188
98
  export interface WebsiteListParams {
189
99
  /**
190
100
  * Number of items to return
@@ -204,8 +114,8 @@ export interface WebsiteListParams {
204
114
  startingAfter?: string;
205
115
  }
206
116
  export declare namespace Websites {
207
- export { type WebsiteCreateResponse as WebsiteCreateResponse, type WebsiteListResponse as WebsiteListResponse, type WebsiteCreateParams as WebsiteCreateParams, type WebsiteListParams as WebsiteListParams, };
208
- export { WebsiteCollections as WebsiteCollections, type WebsiteCollectionListResponse as WebsiteCollectionListResponse, type WebsiteCollectionCreateParams as WebsiteCollectionCreateParams, type WebsiteCollectionListParams as WebsiteCollectionListParams, };
117
+ export { type WebsiteListResponse as WebsiteListResponse, type WebsiteListParams as WebsiteListParams };
118
+ export { WebsiteCollections as WebsiteCollections };
209
119
  export { WebsiteUserRoles as WebsiteUserRoles, type WebsiteUserRoleListResponse as WebsiteUserRoleListResponse, type WebsiteUserRoleAssignResponse as WebsiteUserRoleAssignResponse, type WebsiteUserRoleListParams as WebsiteUserRoleListParams, type WebsiteUserRoleAssignParams as WebsiteUserRoleAssignParams, };
210
120
  }
211
121
  //# sourceMappingURL=websites.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"websites.d.ts","sourceRoot":"","sources":["../../src/resources/websites/websites.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,qBAAqB,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,6BAA6B,EAC7B,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,mBAAmB,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC7B,yBAAyB,EACzB,2BAA2B,EAC3B,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAE9B,qBAAa,QAAS,SAAQ,WAAW;IACvC,kBAAkB,EAAE,qBAAqB,CAAC,kBAAkB,CAE1D;IACF,gBAAgB,EAAE,mBAAmB,CAAC,gBAAgB,CAEpD;IAEF;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,qBAAqB,CAAC;IAIxG;;;OAGG;IACH,IAAI,CAAC,KAAK,CAAC,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC;IACpG,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC;CAU1E;AAED;;GAEG;AACH,MAAM,WAAW,qBA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KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,2BAA2B,IAAI,2BAA2B,GAChE,CAAC;CACH"}
@@ -37,12 +37,6 @@ class Websites extends resource_1.APIResource {
37
37
  this.websiteCollections = new WebsiteCollectionsAPI.WebsiteCollections(this._client);
38
38
  this.websiteUserRoles = new WebsiteUserRolesAPI.WebsiteUserRoles(this._client);
39
39
  }
40
- /**
41
- * Creates a new website
42
- */
43
- create(body, options) {
44
- return this._client.post('/api/websites', { body, ...options });
45
- }
46
40
  list(query = {}, options) {
47
41
  if ((0, core_1.isRequestOptions)(query)) {
48
42
  return this.list({}, query);
@@ -1 +1 @@
1
- {"version":3,"file":"websites.js","sourceRoot":"","sources":["../../src/resources/websites/websites.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAE9C,gFAA+D;AAC/D,kEAK+B;AAC/B,6EAA4D;AAC5D,gEAM8B;AAE9B,MAAa,QAAS,SAAQ,sBAAW;IAAzC;;QACE,uBAAkB,GAA6C,IAAI,qBAAqB,CAAC,kBAAkB,CACzG,IAAI,CAAC,OAAO,CACb,CAAC;QACF,qBAAgB,GAAyC,IAAI,mBAAmB,CAAC,gBAAgB,CAC/F,IAAI,CAAC,OAAO,CACb,CAAC;IAwBJ,CAAC;IAtBC;;OAEG;IACH,MAAM,CAAC,IAAyB,EAAE,OAA6B;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAQD,IAAI,CACF,QAAiD,EAAE,EACnD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;CACF;AA9BD,4BA8BC;AA8ND,QAAQ,CAAC,kBAAkB,GAAG,wCAAkB,CAAC;AACjD,QAAQ,CAAC,gBAAgB,GAAG,qCAAgB,CAAC"}
1
+ {"version":3,"file":"websites.js","sourceRoot":"","sources":["../../src/resources/websites/websites.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAE9C,gFAA+D;AAC/D,kEAA2D;AAC3D,6EAA4D;AAC5D,gEAM8B;AAE9B,MAAa,QAAS,SAAQ,sBAAW;IAAzC;;QACE,uBAAkB,GAA6C,IAAI,qBAAqB,CAAC,kBAAkB,CACzG,IAAI,CAAC,OAAO,CACb,CAAC;QACF,qBAAgB,GAAyC,IAAI,mBAAmB,CAAC,gBAAgB,CAC/F,IAAI,CAAC,OAAO,CACb,CAAC;IAsBJ,CAAC;IATC,IAAI,CACF,QAAiD,EAAE,EACnD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;CACF;AA5BD,4BA4BC;AAiHD,QAAQ,CAAC,kBAAkB,GAAG,wCAAkB,CAAC;AACjD,QAAQ,CAAC,gBAAgB,GAAG,qCAAgB,CAAC"}
@@ -2,7 +2,7 @@
2
2
  import { APIResource } from "../../resource.mjs";
3
3
  import { isRequestOptions } from "../../core.mjs";
4
4
  import * as WebsiteCollectionsAPI from "./website-collections.mjs";
5
- import { WebsiteCollections, } from "./website-collections.mjs";
5
+ import { WebsiteCollections } from "./website-collections.mjs";
6
6
  import * as WebsiteUserRolesAPI from "./website-user-roles.mjs";
7
7
  import { WebsiteUserRoles, } from "./website-user-roles.mjs";
8
8
  export class Websites extends APIResource {
@@ -11,12 +11,6 @@ export class Websites extends APIResource {
11
11
  this.websiteCollections = new WebsiteCollectionsAPI.WebsiteCollections(this._client);
12
12
  this.websiteUserRoles = new WebsiteUserRolesAPI.WebsiteUserRoles(this._client);
13
13
  }
14
- /**
15
- * Creates a new website
16
- */
17
- create(body, options) {
18
- return this._client.post('/api/websites', { body, ...options });
19
- }
20
14
  list(query = {}, options) {
21
15
  if (isRequestOptions(query)) {
22
16
  return this.list({}, query);
@@ -1 +1 @@
1
- {"version":3,"file":"websites.mjs","sourceRoot":"","sources":["../../src/resources/websites/websites.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAEpB,KAAK,qBAAqB;OAC1B,EAIL,kBAAkB,GACnB;OACM,KAAK,mBAAmB;OACxB,EAKL,gBAAgB,GACjB;AAED,MAAM,OAAO,QAAS,SAAQ,WAAW;IAAzC;;QACE,uBAAkB,GAA6C,IAAI,qBAAqB,CAAC,kBAAkB,CACzG,IAAI,CAAC,OAAO,CACb,CAAC;QACF,qBAAgB,GAAyC,IAAI,mBAAmB,CAAC,gBAAgB,CAC/F,IAAI,CAAC,OAAO,CACb,CAAC;IAwBJ,CAAC;IAtBC;;OAEG;IACH,MAAM,CAAC,IAAyB,EAAE,OAA6B;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAQD,IAAI,CACF,QAAiD,EAAE,EACnD,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,eAAe,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;CACF;AA8ND,QAAQ,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACjD,QAAQ,CAAC,gBAAgB,GAAG,gBAAgB,CAAC"}
1
+ {"version":3,"file":"websites.mjs","sourceRoot":"","sources":["../../src/resources/websites/websites.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAEpB,KAAK,qBAAqB;OAC1B,EAAE,kBAAkB,EAAE;OACtB,KAAK,mBAAmB;OACxB,EAKL,gBAAgB,GACjB;AAED,MAAM,OAAO,QAAS,SAAQ,WAAW;IAAzC;;QACE,uBAAkB,GAA6C,IAAI,qBAAqB,CAAC,kBAAkB,CACzG,IAAI,CAAC,OAAO,CACb,CAAC;QACF,qBAAgB,GAAyC,IAAI,mBAAmB,CAAC,gBAAgB,CAC/F,IAAI,CAAC,OAAO,CACb,CAAC;IAsBJ,CAAC;IATC,IAAI,CACF,QAAiD,EAAE,EACnD,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,eAAe,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;CACF;AAiHD,QAAQ,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;AACjD,QAAQ,CAAC,gBAAgB,GAAG,gBAAgB,CAAC"}
package/src/core.ts CHANGED
@@ -33,6 +33,20 @@ export {
33
33
 
34
34
  export type Fetch = (url: RequestInfo, init?: RequestInit) => Promise<Response>;
35
35
 
36
+ /**
37
+ * An alias to the builtin `Array` type so we can
38
+ * easily alias it in import statements if there are name clashes.
39
+ */
40
+ type _Array<T> = Array<T>;
41
+
42
+ /**
43
+ * An alias to the builtin `Record` type so we can
44
+ * easily alias it in import statements if there are name clashes.
45
+ */
46
+ type _Record<K extends keyof any, T> = Record<K, T>;
47
+
48
+ export type { _Array as Array, _Record as Record };
49
+
36
50
  type PromiseOrValue<T> = T | Promise<T>;
37
51
 
38
52
  type APIResponseProps = {
@@ -156,6 +170,7 @@ export class APIPromise<T> extends Promise<T> {
156
170
 
157
171
  export abstract class APIClient {
158
172
  baseURL: string;
173
+ #baseURLOverridden: boolean;
159
174
  maxRetries: number;
160
175
  timeout: number;
161
176
  httpAgent: Agent | undefined;
@@ -165,18 +180,21 @@ export abstract class APIClient {
165
180
 
166
181
  constructor({
167
182
  baseURL,
183
+ baseURLOverridden,
168
184
  maxRetries = 2,
169
185
  timeout = 60000, // 1 minute
170
186
  httpAgent,
171
187
  fetch: overriddenFetch,
172
188
  }: {
173
189
  baseURL: string;
190
+ baseURLOverridden: boolean;
174
191
  maxRetries?: number | undefined;
175
192
  timeout: number | undefined;
176
193
  httpAgent: Agent | undefined;
177
194
  fetch: Fetch | undefined;
178
195
  }) {
179
196
  this.baseURL = baseURL;
197
+ this.#baseURLOverridden = baseURLOverridden;
180
198
  this.maxRetries = validatePositiveInteger('maxRetries', maxRetries);
181
199
  this.timeout = validatePositiveInteger('timeout', timeout);
182
200
  this.httpAgent = httpAgent;
@@ -199,7 +217,7 @@ export abstract class APIClient {
199
217
  protected defaultHeaders(opts: FinalRequestOptions): Headers {
200
218
  return {
201
219
  Accept: 'application/json',
202
- 'Content-Type': 'application/json',
220
+ ...(['head', 'get'].includes(opts.method) ? {} : { 'Content-Type': 'application/json' }),
203
221
  'User-Agent': this.getUserAgent(),
204
222
  ...getPlatformHeaders(),
205
223
  ...this.authHeaders(opts),
@@ -281,12 +299,12 @@ export abstract class APIClient {
281
299
  return null;
282
300
  }
283
301
 
284
- buildRequest<Req>(
285
- options: FinalRequestOptions<Req>,
302
+ async buildRequest<Req>(
303
+ inputOptions: FinalRequestOptions<Req>,
286
304
  { retryCount = 0 }: { retryCount?: number } = {},
287
- ): { req: RequestInit; url: string; timeout: number } {
288
- options = { ...options };
289
- const { method, path, query, headers: headers = {} } = options;
305
+ ): Promise<{ req: RequestInit; url: string; timeout: number }> {
306
+ const options = { ...inputOptions };
307
+ const { method, path, query, defaultBaseURL, headers: headers = {} } = options;
290
308
 
291
309
  const body =
292
310
  ArrayBuffer.isView(options.body) || (options.__binaryRequest && typeof options.body === 'string') ?
@@ -296,7 +314,7 @@ export abstract class APIClient {
296
314
  : null;
297
315
  const contentLength = this.calculateContentLength(body);
298
316
 
299
- const url = this.buildURL(path!, query);
317
+ const url = this.buildURL(path!, query, defaultBaseURL);
300
318
  if ('timeout' in options) validatePositiveInteger('timeout', options.timeout);
301
319
  options.timeout = options.timeout ?? this.timeout;
302
320
  const httpAgent = options.httpAgent ?? this.httpAgent ?? getDefaultAgent(url);
@@ -313,8 +331,8 @@ export abstract class APIClient {
313
331
  }
314
332
 
315
333
  if (this.idempotencyHeader && method !== 'get') {
316
- if (!options.idempotencyKey) options.idempotencyKey = this.defaultIdempotencyKey();
317
- headers[this.idempotencyHeader] = options.idempotencyKey;
334
+ if (!inputOptions.idempotencyKey) inputOptions.idempotencyKey = this.defaultIdempotencyKey();
335
+ headers[this.idempotencyHeader] = inputOptions.idempotencyKey;
318
336
  }
319
337
 
320
338
  const reqHeaders = this.buildHeaders({ options, headers, contentLength, retryCount });
@@ -371,7 +389,7 @@ export abstract class APIClient {
371
389
  getHeader(headers, 'x-stainless-timeout') === undefined &&
372
390
  options.timeout
373
391
  ) {
374
- reqHeaders['x-stainless-timeout'] = String(options.timeout);
392
+ reqHeaders['x-stainless-timeout'] = String(Math.trunc(options.timeout / 1000));
375
393
  }
376
394
 
377
395
  this.validateHeaders(reqHeaders, headers);
@@ -432,7 +450,9 @@ export abstract class APIClient {
432
450
 
433
451
  await this.prepareOptions(options);
434
452
 
435
- const { req, url, timeout } = this.buildRequest(options, { retryCount: maxRetries - retriesRemaining });
453
+ const { req, url, timeout } = await this.buildRequest(options, {
454
+ retryCount: maxRetries - retriesRemaining,
455
+ });
436
456
 
437
457
  await this.prepareRequest(req, { url, options });
438
458
 
@@ -489,11 +509,12 @@ export abstract class APIClient {
489
509
  return new PagePromise<PageClass, Item>(this, request, Page);
490
510
  }
491
511
 
492
- buildURL<Req>(path: string, query: Req | null | undefined): string {
512
+ buildURL<Req>(path: string, query: Req | null | undefined, defaultBaseURL?: string | undefined): string {
513
+ const baseURL = (!this.#baseURLOverridden && defaultBaseURL) || this.baseURL;
493
514
  const url =
494
515
  isAbsoluteURL(path) ?
495
516
  new URL(path)
496
- : new URL(this.baseURL + (this.baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
517
+ : new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
497
518
 
498
519
  const defaultQuery = this.defaultQuery();
499
520
  if (!isEmptyObj(defaultQuery)) {
@@ -778,6 +799,7 @@ export type RequestOptions<
778
799
  query?: Req | undefined;
779
800
  body?: Req | null | undefined;
780
801
  headers?: Headers | undefined;
802
+ defaultBaseURL?: string | undefined;
781
803
 
782
804
  maxRetries?: number;
783
805
  stream?: boolean | undefined;
@@ -799,6 +821,7 @@ const requestOptionsKeys: KeysEnum<RequestOptions> = {
799
821
  query: true,
800
822
  body: true,
801
823
  headers: true,
824
+ defaultBaseURL: true,
802
825
 
803
826
  maxRetries: true,
804
827
  stream: true,
@@ -1065,21 +1088,21 @@ export const coerceBoolean = (value: unknown): boolean => {
1065
1088
  };
1066
1089
 
1067
1090
  export const maybeCoerceInteger = (value: unknown): number | undefined => {
1068
- if (value === undefined) {
1091
+ if (value == null) {
1069
1092
  return undefined;
1070
1093
  }
1071
1094
  return coerceInteger(value);
1072
1095
  };
1073
1096
 
1074
1097
  export const maybeCoerceFloat = (value: unknown): number | undefined => {
1075
- if (value === undefined) {
1098
+ if (value == null) {
1076
1099
  return undefined;
1077
1100
  }
1078
1101
  return coerceFloat(value);
1079
1102
  };
1080
1103
 
1081
1104
  export const maybeCoerceBoolean = (value: unknown): boolean | undefined => {
1082
- if (value === undefined) {
1105
+ if (value == null) {
1083
1106
  return undefined;
1084
1107
  }
1085
1108
  return coerceBoolean(value);
package/src/index.ts CHANGED
@@ -7,9 +7,15 @@ import * as Errors from './error';
7
7
  import * as Uploads from './uploads';
8
8
  import * as API from './resources/index';
9
9
  import { AssetCreateAssetParams, AssetCreateAssetResponse, Assets } from './resources/assets';
10
- import { AuctionListAuctionBidsParams, AuctionListAuctionsResponse, Auctions } from './resources/auctions';
11
10
  import { Auth, AuthConnectAuthParams, AuthConnectAuthResponse } from './resources/auth';
12
11
  import { Minting, MintingGetAssetsParams, MintingGetAssetsResponse } from './resources/minting';
12
+ import {
13
+ AuctionGetPageSectionsParams,
14
+ AuctionGetPageSectionsResponse,
15
+ AuctionListAuctionBidsParams,
16
+ AuctionListAuctionsResponse,
17
+ Auctions,
18
+ } from './resources/auctions/auctions';
13
19
  import { Loyalty } from './resources/loyalty/loyalty';
14
20
  import {
15
21
  Referral,
@@ -21,19 +27,17 @@ import {
21
27
  UserConnectResponse,
22
28
  UserCountParams,
23
29
  UserCountResponse,
30
+ UserCreateDeviceParams,
31
+ UserCreateDeviceResponse,
24
32
  UserDisconnectParams,
25
33
  UserDisconnectResponse,
26
34
  UserListParams,
27
35
  UserListResponse,
36
+ UserVerifyParams,
37
+ UserVerifyResponse,
28
38
  Users,
29
39
  } from './resources/users/users';
30
- import {
31
- WebsiteCreateParams,
32
- WebsiteCreateResponse,
33
- WebsiteListParams,
34
- WebsiteListResponse,
35
- Websites,
36
- } from './resources/websites/websites';
40
+ import { WebsiteListParams, WebsiteListResponse, Websites } from './resources/websites/websites';
37
41
 
38
42
  export interface ClientOptions {
39
43
  /**
@@ -54,6 +58,8 @@ export interface ClientOptions {
54
58
  *
55
59
  * Note that request timeouts are retried by default, so in a worst-case scenario you may wait
56
60
  * much longer than this timeout before the promise succeeds or fails.
61
+ *
62
+ * @unit milliseconds
57
63
  */
58
64
  timeout?: number | undefined;
59
65
 
@@ -137,6 +143,7 @@ export class SnagSolutions extends Core.APIClient {
137
143
 
138
144
  super({
139
145
  baseURL: options.baseURL!,
146
+ baseURLOverridden: baseURL ? baseURL !== 'https://admin.snagsolutions.io/' : false,
140
147
  timeout: options.timeout ?? 60000 /* 1 minute */,
141
148
  httpAgent: options.httpAgent,
142
149
  maxRetries: options.maxRetries,
@@ -157,6 +164,13 @@ export class SnagSolutions extends Core.APIClient {
157
164
  referral: API.Referral = new API.Referral(this);
158
165
  websites: API.Websites = new API.Websites(this);
159
166
 
167
+ /**
168
+ * Check whether the base URL is set to its default.
169
+ */
170
+ #baseURLOverridden(): boolean {
171
+ return this.baseURL !== 'https://admin.snagsolutions.io/';
172
+ }
173
+
160
174
  protected override defaultQuery(): Core.DefaultQuery | undefined {
161
175
  return this._options.defaultQuery;
162
176
  }
@@ -173,7 +187,7 @@ export class SnagSolutions extends Core.APIClient {
173
187
  }
174
188
 
175
189
  protected override stringifyQuery(query: Record<string, unknown>): string {
176
- return qs.stringify(query, { arrayFormat: 'comma' });
190
+ return qs.stringify(query, { arrayFormat: 'repeat' });
177
191
  }
178
192
 
179
193
  static SnagSolutions = this;
@@ -205,6 +219,7 @@ SnagSolutions.Loyalty = Loyalty;
205
219
  SnagSolutions.Minting = Minting;
206
220
  SnagSolutions.Referral = Referral;
207
221
  SnagSolutions.Websites = Websites;
222
+
208
223
  export declare namespace SnagSolutions {
209
224
  export type RequestOptions = Core.RequestOptions;
210
225
 
@@ -222,7 +237,9 @@ export declare namespace SnagSolutions {
222
237
 
223
238
  export {
224
239
  Auctions as Auctions,
240
+ type AuctionGetPageSectionsResponse as AuctionGetPageSectionsResponse,
225
241
  type AuctionListAuctionsResponse as AuctionListAuctionsResponse,
242
+ type AuctionGetPageSectionsParams as AuctionGetPageSectionsParams,
226
243
  type AuctionListAuctionBidsParams as AuctionListAuctionBidsParams,
227
244
  };
228
245
 
@@ -231,11 +248,15 @@ export declare namespace SnagSolutions {
231
248
  type UserListResponse as UserListResponse,
232
249
  type UserConnectResponse as UserConnectResponse,
233
250
  type UserCountResponse as UserCountResponse,
251
+ type UserCreateDeviceResponse as UserCreateDeviceResponse,
234
252
  type UserDisconnectResponse as UserDisconnectResponse,
253
+ type UserVerifyResponse as UserVerifyResponse,
235
254
  type UserListParams as UserListParams,
236
255
  type UserConnectParams as UserConnectParams,
237
256
  type UserCountParams as UserCountParams,
257
+ type UserCreateDeviceParams as UserCreateDeviceParams,
238
258
  type UserDisconnectParams as UserDisconnectParams,
259
+ type UserVerifyParams as UserVerifyParams,
239
260
  };
240
261
 
241
262
  export { Loyalty as Loyalty };
@@ -254,9 +275,7 @@ export declare namespace SnagSolutions {
254
275
 
255
276
  export {
256
277
  Websites as Websites,
257
- type WebsiteCreateResponse as WebsiteCreateResponse,
258
278
  type WebsiteListResponse as WebsiteListResponse,
259
- type WebsiteCreateParams as WebsiteCreateParams,
260
279
  type WebsiteListParams as WebsiteListParams,
261
280
  };
262
281
  }
package/src/resource.ts CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  import type { SnagSolutions } from './index';
4
4
 
5
- export class APIResource {
5
+ export abstract class APIResource {
6
6
  protected _client: SnagSolutions;
7
7
 
8
8
  constructor(client: SnagSolutions) {