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

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 (325) hide show
  1. package/CHANGELOG.md +98 -0
  2. package/README.md +22 -14
  3. package/core.d.ts.map +1 -1
  4. package/core.js +14 -7
  5. package/core.js.map +1 -1
  6. package/core.mjs +14 -7
  7. package/core.mjs.map +1 -1
  8. package/index.d.mts +11 -26
  9. package/index.d.ts +11 -26
  10. package/index.d.ts.map +1 -1
  11. package/index.js +8 -23
  12. package/index.js.map +1 -1
  13. package/index.mjs +8 -23
  14. package/index.mjs.map +1 -1
  15. package/package.json +1 -1
  16. package/resources/api/api.d.ts +365 -0
  17. package/resources/api/api.d.ts.map +1 -0
  18. package/resources/api/api.js +94 -0
  19. package/resources/api/api.js.map +1 -0
  20. package/resources/api/api.mjs +67 -0
  21. package/resources/api/api.mjs.map +1 -0
  22. package/resources/api/index.d.ts +9 -0
  23. package/resources/api/index.d.ts.map +1 -0
  24. package/resources/api/index.js +21 -0
  25. package/resources/api/index.js.map +1 -0
  26. package/resources/api/index.mjs +10 -0
  27. package/resources/api/index.mjs.map +1 -0
  28. package/resources/{loyalty → api/loyalty}/accounts.d.ts +44 -6
  29. package/resources/api/loyalty/accounts.d.ts.map +1 -0
  30. package/resources/api/loyalty/accounts.js +24 -0
  31. package/resources/api/loyalty/accounts.js.map +1 -0
  32. package/resources/api/loyalty/accounts.mjs +20 -0
  33. package/resources/api/loyalty/accounts.mjs.map +1 -0
  34. package/resources/api/loyalty/badges.d.ts +870 -0
  35. package/resources/api/loyalty/badges.d.ts.map +1 -0
  36. package/resources/{loyalty → api/loyalty}/badges.js +2 -2
  37. package/resources/api/loyalty/badges.js.map +1 -0
  38. package/resources/{loyalty → api/loyalty}/badges.mjs +2 -2
  39. package/resources/api/loyalty/badges.mjs.map +1 -0
  40. package/resources/{loyalty → api/loyalty}/currencies.d.ts +3 -9
  41. package/resources/api/loyalty/currencies.d.ts.map +1 -0
  42. package/resources/{loyalty → api/loyalty}/currencies.js +1 -1
  43. package/resources/api/loyalty/currencies.js.map +1 -0
  44. package/resources/{loyalty → api/loyalty}/currencies.mjs +1 -1
  45. package/resources/api/loyalty/currencies.mjs.map +1 -0
  46. package/resources/api/loyalty/index.d.ts +10 -0
  47. package/resources/api/loyalty/index.d.ts.map +1 -0
  48. package/resources/{loyalty → api/loyalty}/index.js +5 -3
  49. package/resources/api/loyalty/index.js.map +1 -0
  50. package/resources/{loyalty → api/loyalty}/index.mjs +4 -3
  51. package/resources/api/loyalty/index.mjs.map +1 -0
  52. package/resources/api/loyalty/loyalty.d.ts +807 -0
  53. package/resources/api/loyalty/loyalty.d.ts.map +1 -0
  54. package/resources/{loyalty → api/loyalty}/loyalty.js +36 -13
  55. package/resources/api/loyalty/loyalty.js.map +1 -0
  56. package/resources/api/loyalty/loyalty.mjs +59 -0
  57. package/resources/api/loyalty/loyalty.mjs.map +1 -0
  58. package/resources/{loyalty → api/loyalty}/multipliers.d.ts +36 -4
  59. package/resources/api/loyalty/multipliers.d.ts.map +1 -0
  60. package/resources/{loyalty → api/loyalty}/multipliers.js +8 -2
  61. package/resources/api/loyalty/multipliers.js.map +1 -0
  62. package/resources/{loyalty → api/loyalty}/multipliers.mjs +8 -2
  63. package/resources/api/loyalty/multipliers.mjs.map +1 -0
  64. package/resources/api/loyalty/questions-responses.d.ts +97 -0
  65. package/resources/api/loyalty/questions-responses.d.ts.map +1 -0
  66. package/resources/api/loyalty/questions-responses.js +22 -0
  67. package/resources/api/loyalty/questions-responses.js.map +1 -0
  68. package/resources/api/loyalty/questions-responses.mjs +18 -0
  69. package/resources/api/loyalty/questions-responses.mjs.map +1 -0
  70. package/resources/api/loyalty/questions.d.ts +150 -0
  71. package/resources/api/loyalty/questions.d.ts.map +1 -0
  72. package/resources/api/loyalty/questions.js +27 -0
  73. package/resources/api/loyalty/questions.js.map +1 -0
  74. package/resources/api/loyalty/questions.mjs +23 -0
  75. package/resources/api/loyalty/questions.mjs.map +1 -0
  76. package/resources/{loyalty → api/loyalty}/rule-edits.d.ts +9 -9
  77. package/resources/api/loyalty/rule-edits.d.ts.map +1 -0
  78. package/resources/{loyalty → api/loyalty}/rule-edits.js +3 -3
  79. package/resources/api/loyalty/rule-edits.js.map +1 -0
  80. package/resources/{loyalty → api/loyalty}/rule-edits.mjs +3 -3
  81. package/resources/api/loyalty/rule-edits.mjs.map +1 -0
  82. package/resources/{loyalty → api/loyalty}/rules.d.ts +167 -90
  83. package/resources/api/loyalty/rules.d.ts.map +1 -0
  84. package/resources/{loyalty → api/loyalty}/rules.js +3 -3
  85. package/resources/api/loyalty/rules.js.map +1 -0
  86. package/resources/{loyalty → api/loyalty}/rules.mjs +3 -3
  87. package/resources/api/loyalty/rules.mjs.map +1 -0
  88. package/resources/api/loyalty.d.ts +2 -0
  89. package/resources/api/loyalty.d.ts.map +1 -0
  90. package/resources/api/loyalty.js +19 -0
  91. package/resources/api/loyalty.js.map +1 -0
  92. package/resources/api/loyalty.mjs +3 -0
  93. package/resources/api/loyalty.mjs.map +1 -0
  94. package/resources/api/minting.d.ts +95 -0
  95. package/resources/api/minting.d.ts.map +1 -0
  96. package/resources/api/minting.js +15 -0
  97. package/resources/api/minting.js.map +1 -0
  98. package/resources/api/minting.mjs +11 -0
  99. package/resources/api/minting.mjs.map +1 -0
  100. package/resources/api/referral/index.d.ts +3 -0
  101. package/resources/api/referral/index.d.ts.map +1 -0
  102. package/resources/api/referral/index.js +9 -0
  103. package/resources/api/referral/index.js.map +1 -0
  104. package/resources/api/referral/index.mjs +4 -0
  105. package/resources/api/referral/index.mjs.map +1 -0
  106. package/resources/api/referral/referral.d.ts +31 -0
  107. package/resources/api/referral/referral.d.ts.map +1 -0
  108. package/resources/{drip/drip.js → api/referral/referral.js} +16 -13
  109. package/resources/api/referral/referral.js.map +1 -0
  110. package/resources/api/referral/referral.mjs +19 -0
  111. package/resources/api/referral/referral.mjs.map +1 -0
  112. package/resources/api/referral/users.d.ts +57 -0
  113. package/resources/api/referral/users.d.ts.map +1 -0
  114. package/resources/api/referral/users.js +21 -0
  115. package/resources/api/referral/users.js.map +1 -0
  116. package/resources/api/referral/users.mjs +17 -0
  117. package/resources/api/referral/users.mjs.map +1 -0
  118. package/resources/api/referral.d.ts +2 -0
  119. package/resources/api/referral.d.ts.map +1 -0
  120. package/resources/api/referral.js +19 -0
  121. package/resources/api/referral.js.map +1 -0
  122. package/resources/api/referral.mjs +3 -0
  123. package/resources/api/referral.mjs.map +1 -0
  124. package/resources/api/users/index.d.ts +3 -0
  125. package/resources/api/users/index.d.ts.map +1 -0
  126. package/resources/{users → api/users}/index.js +1 -3
  127. package/resources/api/users/index.js.map +1 -0
  128. package/resources/api/users/index.mjs +4 -0
  129. package/resources/api/users/index.mjs.map +1 -0
  130. package/resources/api/users/metadatas.d.ts +137 -0
  131. package/resources/api/users/metadatas.d.ts.map +1 -0
  132. package/resources/{users → api/users}/metadatas.js +8 -2
  133. package/resources/api/users/metadatas.js.map +1 -0
  134. package/resources/api/users/metadatas.mjs +18 -0
  135. package/resources/api/users/metadatas.mjs.map +1 -0
  136. package/resources/api/users/users.d.ts +133 -0
  137. package/resources/api/users/users.d.ts.map +1 -0
  138. package/resources/{users → api/users}/users.js +19 -5
  139. package/resources/api/users/users.js.map +1 -0
  140. package/resources/api/users/users.mjs +30 -0
  141. package/resources/api/users/users.mjs.map +1 -0
  142. package/resources/api/users.d.ts +2 -0
  143. package/resources/api/users.d.ts.map +1 -0
  144. package/resources/api/users.js +19 -0
  145. package/resources/api/users.js.map +1 -0
  146. package/resources/api/users.mjs +3 -0
  147. package/resources/api/users.mjs.map +1 -0
  148. package/resources/api/website-collections.d.ts +73 -0
  149. package/resources/api/website-collections.d.ts.map +1 -0
  150. package/resources/api/website-collections.js +25 -0
  151. package/resources/api/website-collections.js.map +1 -0
  152. package/resources/api/website-collections.mjs +21 -0
  153. package/resources/api/website-collections.mjs.map +1 -0
  154. package/resources/api/website-user-roles.d.ts +73 -0
  155. package/resources/api/website-user-roles.d.ts.map +1 -0
  156. package/resources/api/website-user-roles.js +22 -0
  157. package/resources/api/website-user-roles.js.map +1 -0
  158. package/resources/api/website-user-roles.mjs +18 -0
  159. package/resources/api/website-user-roles.mjs.map +1 -0
  160. package/resources/{websites.d.ts → api/websites.d.ts} +2 -2
  161. package/resources/api/websites.d.ts.map +1 -0
  162. package/resources/{websites.js → api/websites.js} +2 -2
  163. package/resources/api/websites.js.map +1 -0
  164. package/resources/{websites.mjs → api/websites.mjs} +2 -2
  165. package/resources/api/websites.mjs.map +1 -0
  166. package/resources/api.d.ts +2 -0
  167. package/resources/api.d.ts.map +1 -0
  168. package/resources/api.js +19 -0
  169. package/resources/api.js.map +1 -0
  170. package/resources/api.mjs +3 -0
  171. package/resources/api.mjs.map +1 -0
  172. package/resources/index.d.ts +1 -6
  173. package/resources/index.d.ts.map +1 -1
  174. package/resources/index.js +3 -13
  175. package/resources/index.js.map +1 -1
  176. package/resources/index.mjs +1 -6
  177. package/resources/index.mjs.map +1 -1
  178. package/resources.d.ts +2 -0
  179. package/resources.d.ts.map +1 -0
  180. package/resources.js +18 -0
  181. package/resources.js.map +1 -0
  182. package/resources.mjs +2 -0
  183. package/resources.mjs.map +1 -0
  184. package/src/core.ts +16 -8
  185. package/src/index.ts +28 -57
  186. package/src/resources/api/api.ts +629 -0
  187. package/src/resources/api/index.ts +51 -0
  188. package/src/resources/{loyalty → api/loyalty}/accounts.ts +65 -8
  189. package/src/resources/api/loyalty/badges.ts +1142 -0
  190. package/src/resources/{loyalty → api/loyalty}/currencies.ts +3 -9
  191. package/src/resources/{loyalty → api/loyalty}/index.ts +38 -11
  192. package/src/resources/api/loyalty/loyalty.ts +1297 -0
  193. package/src/resources/{loyalty → api/loyalty}/multipliers.ts +61 -4
  194. package/src/resources/api/loyalty/questions-responses.ts +146 -0
  195. package/src/resources/api/loyalty/questions.ts +208 -0
  196. package/src/resources/{loyalty → api/loyalty}/rule-edits.ts +11 -14
  197. package/src/resources/{loyalty → api/loyalty}/rules.ts +339 -180
  198. package/src/resources/api/loyalty.ts +3 -0
  199. package/src/resources/api/minting.ts +157 -0
  200. package/src/resources/api/referral/index.ts +10 -0
  201. package/src/resources/api/referral/referral.ts +70 -0
  202. package/src/resources/api/referral/users.ts +93 -0
  203. package/src/resources/api/referral.ts +3 -0
  204. package/src/resources/api/users/index.ts +18 -0
  205. package/src/resources/api/users/metadatas.ts +206 -0
  206. package/src/resources/api/users/users.ts +203 -0
  207. package/src/resources/api/users.ts +3 -0
  208. package/src/resources/api/website-collections.ts +148 -0
  209. package/src/resources/api/website-user-roles.ts +107 -0
  210. package/src/resources/{websites.ts → api/websites.ts} +3 -3
  211. package/src/resources/api.ts +3 -0
  212. package/src/resources/index.ts +8 -11
  213. package/src/resources.ts +1 -0
  214. package/src/version.ts +1 -1
  215. package/version.d.ts +1 -1
  216. package/version.js +1 -1
  217. package/version.mjs +1 -1
  218. package/resources/assets.d.ts +0 -50
  219. package/resources/assets.d.ts.map +0 -1
  220. package/resources/assets.js +0 -17
  221. package/resources/assets.js.map +0 -1
  222. package/resources/assets.mjs +0 -13
  223. package/resources/assets.mjs.map +0 -1
  224. package/resources/auction-bids.d.ts +0 -81
  225. package/resources/auction-bids.d.ts.map +0 -1
  226. package/resources/auction-bids.js +0 -30
  227. package/resources/auction-bids.js.map +0 -1
  228. package/resources/auction-bids.mjs +0 -26
  229. package/resources/auction-bids.mjs.map +0 -1
  230. package/resources/drip/drip.d.ts +0 -14
  231. package/resources/drip/drip.d.ts.map +0 -1
  232. package/resources/drip/drip.js.map +0 -1
  233. package/resources/drip/drip.mjs +0 -16
  234. package/resources/drip/drip.mjs.map +0 -1
  235. package/resources/drip/index.d.ts +0 -4
  236. package/resources/drip/index.d.ts.map +0 -1
  237. package/resources/drip/index.js +0 -11
  238. package/resources/drip/index.js.map +0 -1
  239. package/resources/drip/index.mjs +0 -5
  240. package/resources/drip/index.mjs.map +0 -1
  241. package/resources/drip/quests.d.ts +0 -168
  242. package/resources/drip/quests.d.ts.map +0 -1
  243. package/resources/drip/quests.js +0 -17
  244. package/resources/drip/quests.js.map +0 -1
  245. package/resources/drip/quests.mjs +0 -13
  246. package/resources/drip/quests.mjs.map +0 -1
  247. package/resources/drip/status.d.ts +0 -26
  248. package/resources/drip/status.d.ts.map +0 -1
  249. package/resources/drip/status.js +0 -16
  250. package/resources/drip/status.js.map +0 -1
  251. package/resources/drip/status.mjs +0 -12
  252. package/resources/drip/status.mjs.map +0 -1
  253. package/resources/loyalty/accounts.d.ts.map +0 -1
  254. package/resources/loyalty/accounts.js +0 -16
  255. package/resources/loyalty/accounts.js.map +0 -1
  256. package/resources/loyalty/accounts.mjs +0 -12
  257. package/resources/loyalty/accounts.mjs.map +0 -1
  258. package/resources/loyalty/badges.d.ts +0 -299
  259. package/resources/loyalty/badges.d.ts.map +0 -1
  260. package/resources/loyalty/badges.js.map +0 -1
  261. package/resources/loyalty/badges.mjs.map +0 -1
  262. package/resources/loyalty/currencies.d.ts.map +0 -1
  263. package/resources/loyalty/currencies.js.map +0 -1
  264. package/resources/loyalty/currencies.mjs.map +0 -1
  265. package/resources/loyalty/index.d.ts +0 -9
  266. package/resources/loyalty/index.d.ts.map +0 -1
  267. package/resources/loyalty/index.js.map +0 -1
  268. package/resources/loyalty/index.mjs.map +0 -1
  269. package/resources/loyalty/loyalty.d.ts +0 -34
  270. package/resources/loyalty/loyalty.d.ts.map +0 -1
  271. package/resources/loyalty/loyalty.js.map +0 -1
  272. package/resources/loyalty/loyalty.mjs +0 -36
  273. package/resources/loyalty/loyalty.mjs.map +0 -1
  274. package/resources/loyalty/multipliers.d.ts.map +0 -1
  275. package/resources/loyalty/multipliers.js.map +0 -1
  276. package/resources/loyalty/multipliers.mjs.map +0 -1
  277. package/resources/loyalty/rule-edits.d.ts.map +0 -1
  278. package/resources/loyalty/rule-edits.js.map +0 -1
  279. package/resources/loyalty/rule-edits.mjs.map +0 -1
  280. package/resources/loyalty/rules.d.ts.map +0 -1
  281. package/resources/loyalty/rules.js.map +0 -1
  282. package/resources/loyalty/rules.mjs.map +0 -1
  283. package/resources/loyalty/transaction-entries.d.ts +0 -175
  284. package/resources/loyalty/transaction-entries.d.ts.map +0 -1
  285. package/resources/loyalty/transaction-entries.js +0 -16
  286. package/resources/loyalty/transaction-entries.js.map +0 -1
  287. package/resources/loyalty/transaction-entries.mjs +0 -12
  288. package/resources/loyalty/transaction-entries.mjs.map +0 -1
  289. package/resources/users/index.d.ts +0 -4
  290. package/resources/users/index.d.ts.map +0 -1
  291. package/resources/users/index.js.map +0 -1
  292. package/resources/users/index.mjs +0 -5
  293. package/resources/users/index.mjs.map +0 -1
  294. package/resources/users/metadatas.d.ts +0 -64
  295. package/resources/users/metadatas.d.ts.map +0 -1
  296. package/resources/users/metadatas.js.map +0 -1
  297. package/resources/users/metadatas.mjs +0 -12
  298. package/resources/users/metadatas.mjs.map +0 -1
  299. package/resources/users/users.d.ts +0 -14
  300. package/resources/users/users.d.ts.map +0 -1
  301. package/resources/users/users.js.map +0 -1
  302. package/resources/users/users.mjs +0 -16
  303. package/resources/users/users.mjs.map +0 -1
  304. package/resources/users/wallets.d.ts +0 -193
  305. package/resources/users/wallets.d.ts.map +0 -1
  306. package/resources/users/wallets.js +0 -28
  307. package/resources/users/wallets.js.map +0 -1
  308. package/resources/users/wallets.mjs +0 -24
  309. package/resources/users/wallets.mjs.map +0 -1
  310. package/resources/websites.d.ts.map +0 -1
  311. package/resources/websites.js.map +0 -1
  312. package/resources/websites.mjs.map +0 -1
  313. package/src/resources/assets.ts +0 -71
  314. package/src/resources/auction-bids.ts +0 -123
  315. package/src/resources/drip/drip.ts +0 -25
  316. package/src/resources/drip/index.ts +0 -5
  317. package/src/resources/drip/quests.ts +0 -210
  318. package/src/resources/drip/status.ts +0 -33
  319. package/src/resources/loyalty/badges.ts +0 -435
  320. package/src/resources/loyalty/loyalty.ts +0 -159
  321. package/src/resources/loyalty/transaction-entries.ts +0 -229
  322. package/src/resources/users/index.ts +0 -12
  323. package/src/resources/users/metadatas.ts +0 -103
  324. package/src/resources/users/users.ts +0 -39
  325. package/src/resources/users/wallets.ts +0 -271
@@ -0,0 +1,73 @@
1
+ import { APIResource } from "../../resource.js";
2
+ import * as Core from "../../core.js";
3
+ export declare class WebsiteUserRoles extends APIResource {
4
+ /**
5
+ * Retrieves roles of users for a specific website. If userId is provided,
6
+ * retrieves the role of that specific user for the website.
7
+ */
8
+ list(query: WebsiteUserRoleListParams, options?: Core.RequestOptions): Core.APIPromise<WebsiteUserRoleListResponse>;
9
+ /**
10
+ * Assign roles to users for a specific website
11
+ */
12
+ assign(body: WebsiteUserRoleAssignParams, options?: Core.RequestOptions): Core.APIPromise<WebsiteUserRoleAssignResponse>;
13
+ }
14
+ /**
15
+ * Schema for getWebsiteUserRoles response
16
+ */
17
+ export interface WebsiteUserRoleListResponse {
18
+ data: Array<WebsiteUserRoleListResponse.Data>;
19
+ }
20
+ export declare namespace WebsiteUserRoleListResponse {
21
+ interface Data {
22
+ /**
23
+ * UUID of the website user role
24
+ */
25
+ id: string;
26
+ }
27
+ }
28
+ /**
29
+ * Schema for postWebsiteUserRoles response
30
+ */
31
+ export interface WebsiteUserRoleAssignResponse {
32
+ data?: unknown;
33
+ }
34
+ export interface WebsiteUserRoleListParams {
35
+ /**
36
+ * UUID of the website
37
+ */
38
+ websiteId: string;
39
+ /**
40
+ * UUID of the user
41
+ */
42
+ userId?: string;
43
+ }
44
+ export interface WebsiteUserRoleAssignParams {
45
+ /**
46
+ * UUID of the website
47
+ */
48
+ websiteId: string;
49
+ /**
50
+ * Array of website user roles
51
+ */
52
+ websiteUserRoles: Array<WebsiteUserRoleAssignParams.WebsiteUserRole>;
53
+ }
54
+ export declare namespace WebsiteUserRoleAssignParams {
55
+ interface WebsiteUserRole {
56
+ /**
57
+ * Role type of the user
58
+ */
59
+ roleType: 'WEBSITE_SUPER_ADMIN' | 'WEBSITE_ADMIN' | 'WEBSITE_MODERATOR' | 'WEBSITE_API_KEY' | 'STRATUS_API_KEY';
60
+ /**
61
+ * Wallet address of the user
62
+ */
63
+ walletAddress: string;
64
+ /**
65
+ * Deletion date of the user role
66
+ */
67
+ deletedAt?: string;
68
+ }
69
+ }
70
+ export declare namespace WebsiteUserRoles {
71
+ export { type WebsiteUserRoleListResponse as WebsiteUserRoleListResponse, type WebsiteUserRoleAssignResponse as WebsiteUserRoleAssignResponse, type WebsiteUserRoleListParams as WebsiteUserRoleListParams, type WebsiteUserRoleAssignParams as WebsiteUserRoleAssignParams, };
72
+ }
73
+ //# sourceMappingURL=website-user-roles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"website-user-roles.d.ts","sourceRoot":"","sources":["../../src/resources/api/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"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.WebsiteUserRoles = void 0;
5
+ const resource_1 = require("../../resource.js");
6
+ class WebsiteUserRoles extends resource_1.APIResource {
7
+ /**
8
+ * Retrieves roles of users for a specific website. If userId is provided,
9
+ * retrieves the role of that specific user for the website.
10
+ */
11
+ list(query, options) {
12
+ return this._client.get('/api/website_user_roles', { query, ...options });
13
+ }
14
+ /**
15
+ * Assign roles to users for a specific website
16
+ */
17
+ assign(body, options) {
18
+ return this._client.post('/api/website_user_roles', { body, ...options });
19
+ }
20
+ }
21
+ exports.WebsiteUserRoles = WebsiteUserRoles;
22
+ //# sourceMappingURL=website-user-roles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"website-user-roles.js","sourceRoot":"","sources":["../../src/resources/api/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"}
@@ -0,0 +1,18 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../resource.mjs";
3
+ export class WebsiteUserRoles extends APIResource {
4
+ /**
5
+ * Retrieves roles of users for a specific website. If userId is provided,
6
+ * retrieves the role of that specific user for the website.
7
+ */
8
+ list(query, options) {
9
+ return this._client.get('/api/website_user_roles', { query, ...options });
10
+ }
11
+ /**
12
+ * Assign roles to users for a specific website
13
+ */
14
+ assign(body, options) {
15
+ return this._client.post('/api/website_user_roles', { body, ...options });
16
+ }
17
+ }
18
+ //# sourceMappingURL=website-user-roles.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"website-user-roles.mjs","sourceRoot":"","sources":["../../src/resources/api/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,5 +1,5 @@
1
- import { APIResource } from "../resource.js";
2
- import * as Core from "../core.js";
1
+ import { APIResource } from "../../resource.js";
2
+ import * as Core from "../../core.js";
3
3
  export declare class Websites extends APIResource {
4
4
  /**
5
5
  * Creates a new website
@@ -0,0 +1 @@
1
+ {"version":3,"file":"websites.d.ts","sourceRoot":"","sources":["../../src/resources/api/websites.ts"],"names":[],"mappings":"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"}
@@ -2,8 +2,8 @@
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Websites = void 0;
5
- const resource_1 = require("../resource.js");
6
- const core_1 = require("../core.js");
5
+ const resource_1 = require("../../resource.js");
6
+ const core_1 = require("../../core.js");
7
7
  class Websites extends resource_1.APIResource {
8
8
  /**
9
9
  * Creates a new website
@@ -0,0 +1 @@
1
+ {"version":3,"file":"websites.js","sourceRoot":"","sources":["../../src/resources/api/websites.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAG9C,MAAa,QAAS,SAAQ,sBAAW;IACvC;;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;AAvBD,4BAuBC"}
@@ -1,6 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { APIResource } from "../resource.mjs";
3
- import { isRequestOptions } from "../core.mjs";
2
+ import { APIResource } from "../../resource.mjs";
3
+ import { isRequestOptions } from "../../core.mjs";
4
4
  export class Websites extends APIResource {
5
5
  /**
6
6
  * Creates a new website
@@ -0,0 +1 @@
1
+ {"version":3,"file":"websites.mjs","sourceRoot":"","sources":["../../src/resources/api/websites.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;AAG3B,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;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"}
@@ -0,0 +1,2 @@
1
+ export * from "./api/index.js";
2
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/resources/api.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ __exportStar(require("./api/index.js"), exports);
19
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../src/resources/api.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;AAEtF,iDAA4B"}
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export * from "./api/index.mjs";
3
+ //# sourceMappingURL=api.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.mjs","sourceRoot":"","sources":["../src/resources/api.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
@@ -1,7 +1,2 @@
1
- export { Assets, type AssetCreateResponse, type AssetCreateParams } from "./assets.js";
2
- export { AuctionBids, type AuctionBidCreateParams, type AuctionBidListParams } from "./auction-bids.js";
3
- export { Drip } from "./drip/drip.js";
4
- export { Loyalty } from "./loyalty/loyalty.js";
5
- export { Users } from "./users/users.js";
6
- export { Websites, type WebsiteCreateResponse, type WebsiteListResponse, type WebsiteCreateParams, type WebsiteListParams, } from "./websites.js";
1
+ export { API, type APICreateAssetUploadURLResponse, type APIListAuctionsResponse, type APIListUsersResponse, type APICreateAssetUploadURLParams, type APIListAuctionBidsParams, type APIListUsersParams, } from "./api/api.js";
7
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,KAAK,mBAAmB,EAAE,KAAK,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,KAAK,sBAAsB,EAAE,KAAK,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACrG,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EACL,QAAQ,EACR,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,GACvB,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,GAAG,EACH,KAAK,+BAA+B,EACpC,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,6BAA6B,EAClC,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,GACxB,MAAM,WAAW,CAAC"}
@@ -1,17 +1,7 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Websites = exports.Users = exports.Loyalty = exports.Drip = exports.AuctionBids = exports.Assets = void 0;
5
- var assets_1 = require("./assets.js");
6
- Object.defineProperty(exports, "Assets", { enumerable: true, get: function () { return assets_1.Assets; } });
7
- var auction_bids_1 = require("./auction-bids.js");
8
- Object.defineProperty(exports, "AuctionBids", { enumerable: true, get: function () { return auction_bids_1.AuctionBids; } });
9
- var drip_1 = require("./drip/drip.js");
10
- Object.defineProperty(exports, "Drip", { enumerable: true, get: function () { return drip_1.Drip; } });
11
- var loyalty_1 = require("./loyalty/loyalty.js");
12
- Object.defineProperty(exports, "Loyalty", { enumerable: true, get: function () { return loyalty_1.Loyalty; } });
13
- var users_1 = require("./users/users.js");
14
- Object.defineProperty(exports, "Users", { enumerable: true, get: function () { return users_1.Users; } });
15
- var websites_1 = require("./websites.js");
16
- Object.defineProperty(exports, "Websites", { enumerable: true, get: function () { return websites_1.Websites; } });
4
+ exports.API = void 0;
5
+ var api_1 = require("./api/api.js");
6
+ Object.defineProperty(exports, "API", { enumerable: true, get: function () { return api_1.API; } });
17
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,sCAAoF;AAA3E,gGAAA,MAAM,OAAA;AACf,kDAAqG;AAA5F,2GAAA,WAAW,OAAA;AACpB,uCAAmC;AAA1B,4FAAA,IAAI,OAAA;AACb,gDAA4C;AAAnC,kGAAA,OAAO,OAAA;AAChB,0CAAsC;AAA7B,8FAAA,KAAK,OAAA;AACd,0CAMoB;AALlB,oGAAA,QAAQ,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,oCAQmB;AAPjB,0FAAA,GAAG,OAAA"}
@@ -1,8 +1,3 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- export { Assets } from "./assets.mjs";
3
- export { AuctionBids } from "./auction-bids.mjs";
4
- export { Drip } from "./drip/drip.mjs";
5
- export { Loyalty } from "./loyalty/loyalty.mjs";
6
- export { Users } from "./users/users.mjs";
7
- export { Websites, } from "./websites.mjs";
2
+ export { API, } from "./api/api.mjs";
8
3
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,MAAM,EAAoD;OAC5D,EAAE,WAAW,EAA0D;OACvE,EAAE,IAAI,EAAE;OACR,EAAE,OAAO,EAAE;OACX,EAAE,KAAK,EAAE;OACT,EACL,QAAQ,GAKT"}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,GAAG,GAOJ"}
package/resources.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./resources/index.js";
2
+ //# sourceMappingURL=resources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
package/resources.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./resources/index.js"), exports);
18
+ //# sourceMappingURL=resources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.js","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAkC"}
package/resources.mjs ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./resources/index.mjs";
2
+ //# sourceMappingURL=resources.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.mjs","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":""}
package/src/core.ts CHANGED
@@ -48,8 +48,8 @@ async function defaultParseResponse<T>(props: APIResponseProps): Promise<T> {
48
48
  }
49
49
 
50
50
  const contentType = response.headers.get('content-type');
51
- const isJSON =
52
- contentType?.includes('application/json') || contentType?.includes('application/vnd.api+json');
51
+ const mediaType = contentType?.split(';')[0]?.trim();
52
+ const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
53
53
  if (isJSON) {
54
54
  const json = await response.json();
55
55
 
@@ -280,6 +280,7 @@ export abstract class APIClient {
280
280
  options: FinalRequestOptions<Req>,
281
281
  { retryCount = 0 }: { retryCount?: number } = {},
282
282
  ): { req: RequestInit; url: string; timeout: number } {
283
+ options = { ...options };
283
284
  const { method, path, query, headers: headers = {} } = options;
284
285
 
285
286
  const body =
@@ -292,9 +293,9 @@ export abstract class APIClient {
292
293
 
293
294
  const url = this.buildURL(path!, query);
294
295
  if ('timeout' in options) validatePositiveInteger('timeout', options.timeout);
295
- const timeout = options.timeout ?? this.timeout;
296
+ options.timeout = options.timeout ?? this.timeout;
296
297
  const httpAgent = options.httpAgent ?? this.httpAgent ?? getDefaultAgent(url);
297
- const minAgentTimeout = timeout + 1000;
298
+ const minAgentTimeout = options.timeout + 1000;
298
299
  if (
299
300
  typeof (httpAgent as any)?.options?.timeout === 'number' &&
300
301
  minAgentTimeout > ((httpAgent as any).options.timeout ?? 0)
@@ -323,7 +324,7 @@ export abstract class APIClient {
323
324
  signal: options.signal ?? null,
324
325
  };
325
326
 
326
- return { req, url, timeout };
327
+ return { req, url, timeout: options.timeout };
327
328
  }
328
329
 
329
330
  private buildHeaders({
@@ -351,15 +352,22 @@ export abstract class APIClient {
351
352
  delete reqHeaders['content-type'];
352
353
  }
353
354
 
354
- // Don't set the retry count header if it was already set or removed through default headers or by the
355
- // caller. We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to
356
- // account for the removal case.
355
+ // Don't set theses headers if they were already set or removed through default headers or by the caller.
356
+ // We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to account
357
+ // for the removal case.
357
358
  if (
358
359
  getHeader(defaultHeaders, 'x-stainless-retry-count') === undefined &&
359
360
  getHeader(headers, 'x-stainless-retry-count') === undefined
360
361
  ) {
361
362
  reqHeaders['x-stainless-retry-count'] = String(retryCount);
362
363
  }
364
+ if (
365
+ getHeader(defaultHeaders, 'x-stainless-timeout') === undefined &&
366
+ getHeader(headers, 'x-stainless-timeout') === undefined &&
367
+ options.timeout
368
+ ) {
369
+ reqHeaders['x-stainless-timeout'] = String(options.timeout);
370
+ }
363
371
 
364
372
  this.validateHeaders(reqHeaders, headers);
365
373
 
package/src/index.ts CHANGED
@@ -6,22 +6,19 @@ import * as Core from './core';
6
6
  import * as Errors from './error';
7
7
  import * as Uploads from './uploads';
8
8
  import * as API from './resources/index';
9
- import { AssetCreateParams, AssetCreateResponse, Assets } from './resources/assets';
10
- import { AuctionBidCreateParams, AuctionBidListParams, AuctionBids } from './resources/auction-bids';
11
9
  import {
12
- WebsiteCreateParams,
13
- WebsiteCreateResponse,
14
- WebsiteListParams,
15
- WebsiteListResponse,
16
- Websites,
17
- } from './resources/websites';
18
- import { Drip } from './resources/drip/drip';
19
- import { Loyalty } from './resources/loyalty/loyalty';
20
- import { Users } from './resources/users/users';
10
+ API as ApiapiAPI,
11
+ APICreateAssetUploadURLParams,
12
+ APICreateAssetUploadURLResponse,
13
+ APIListAuctionBidsParams,
14
+ APIListAuctionsResponse,
15
+ APIListUsersParams,
16
+ APIListUsersResponse,
17
+ } from './resources/api/api';
21
18
 
22
19
  export interface ClientOptions {
23
20
  /**
24
- * API key required to authenticate with the Snag Solutions API.
21
+ * Defaults to process.env['SNAG_SOLUTIONS_API_KEY'].
25
22
  */
26
23
  apiKey?: string | undefined;
27
24
 
@@ -39,7 +36,7 @@ export interface ClientOptions {
39
36
  * Note that request timeouts are retried by default, so in a worst-case scenario you may wait
40
37
  * much longer than this timeout before the promise succeeds or fails.
41
38
  */
42
- timeout?: number;
39
+ timeout?: number | undefined;
43
40
 
44
41
  /**
45
42
  * An HTTP agent used to manage HTTP(S) connections.
@@ -47,7 +44,7 @@ export interface ClientOptions {
47
44
  * If not provided, an agent will be constructed by default in the Node.js environment,
48
45
  * otherwise no agent is used.
49
46
  */
50
- httpAgent?: Agent;
47
+ httpAgent?: Agent | undefined;
51
48
 
52
49
  /**
53
50
  * Specify a custom `fetch` function implementation.
@@ -63,7 +60,7 @@ export interface ClientOptions {
63
60
  *
64
61
  * @default 2
65
62
  */
66
- maxRetries?: number;
63
+ maxRetries?: number | undefined;
67
64
 
68
65
  /**
69
66
  * Default headers to include with every request to the API.
@@ -71,7 +68,7 @@ export interface ClientOptions {
71
68
  * These can be removed in individual requests by explicitly setting the
72
69
  * header to `undefined` or `null` in request options.
73
70
  */
74
- defaultHeaders?: Core.Headers;
71
+ defaultHeaders?: Core.Headers | undefined;
75
72
 
76
73
  /**
77
74
  * Default query parameters to include with every request to the API.
@@ -79,7 +76,7 @@ export interface ClientOptions {
79
76
  * These can be removed in individual requests by explicitly setting the
80
77
  * param to `undefined` in request options.
81
78
  */
82
- defaultQuery?: Core.DefaultQuery;
79
+ defaultQuery?: Core.DefaultQuery | undefined;
83
80
  }
84
81
 
85
82
  /**
@@ -93,8 +90,8 @@ export class SnagSolutions extends Core.APIClient {
93
90
  /**
94
91
  * API Client for interfacing with the Snag Solutions API.
95
92
  *
96
- * @param {string | undefined} [opts.apiKey=process.env['X_API_KEY'] ?? undefined]
97
- * @param {string} [opts.baseURL=process.env['SNAG_SOLUTIONS_BASE_URL'] ?? https://admin.snagsolutions.io/] - Override the default base URL for the API.
93
+ * @param {string | undefined} [opts.apiKey=process.env['SNAG_SOLUTIONS_API_KEY'] ?? undefined]
94
+ * @param {string} [opts.baseURL=process.env['SNAG_SOLUTIONS_BASE_URL'] ?? https://api.example.com] - Override the default base URL for the API.
98
95
  * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
99
96
  * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
100
97
  * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
@@ -104,19 +101,19 @@ export class SnagSolutions extends Core.APIClient {
104
101
  */
105
102
  constructor({
106
103
  baseURL = Core.readEnv('SNAG_SOLUTIONS_BASE_URL'),
107
- apiKey = Core.readEnv('X_API_KEY'),
104
+ apiKey = Core.readEnv('SNAG_SOLUTIONS_API_KEY'),
108
105
  ...opts
109
106
  }: ClientOptions = {}) {
110
107
  if (apiKey === undefined) {
111
108
  throw new Errors.SnagSolutionsError(
112
- "The X_API_KEY environment variable is missing or empty; either provide it, or instantiate the SnagSolutions client with an apiKey option, like new SnagSolutions({ apiKey: 'My API Key' }).",
109
+ "The SNAG_SOLUTIONS_API_KEY environment variable is missing or empty; either provide it, or instantiate the SnagSolutions client with an apiKey option, like new SnagSolutions({ apiKey: 'My API Key' }).",
113
110
  );
114
111
  }
115
112
 
116
113
  const options: ClientOptions = {
117
114
  apiKey,
118
115
  ...opts,
119
- baseURL: baseURL || `https://admin.snagsolutions.io/`,
116
+ baseURL: baseURL || `https://api.example.com`,
120
117
  };
121
118
 
122
119
  super({
@@ -132,12 +129,7 @@ export class SnagSolutions extends Core.APIClient {
132
129
  this.apiKey = apiKey;
133
130
  }
134
131
 
135
- assets: API.Assets = new API.Assets(this);
136
- users: API.Users = new API.Users(this);
137
- loyalty: API.Loyalty = new API.Loyalty(this);
138
- auctionBids: API.AuctionBids = new API.AuctionBids(this);
139
- websites: API.Websites = new API.Websites(this);
140
- drip: API.Drip = new API.Drip(this);
132
+ api: API.API = new API.API(this);
141
133
 
142
134
  protected override defaultQuery(): Core.DefaultQuery | undefined {
143
135
  return this._options.defaultQuery;
@@ -179,40 +171,19 @@ export class SnagSolutions extends Core.APIClient {
179
171
  static fileFromPath = Uploads.fileFromPath;
180
172
  }
181
173
 
182
- SnagSolutions.Assets = Assets;
183
- SnagSolutions.Users = Users;
184
- SnagSolutions.Loyalty = Loyalty;
185
- SnagSolutions.AuctionBids = AuctionBids;
186
- SnagSolutions.Websites = Websites;
187
- SnagSolutions.Drip = Drip;
174
+ SnagSolutions.API = ApiapiAPI;
188
175
  export declare namespace SnagSolutions {
189
176
  export type RequestOptions = Core.RequestOptions;
190
177
 
191
178
  export {
192
- Assets as Assets,
193
- type AssetCreateResponse as AssetCreateResponse,
194
- type AssetCreateParams as AssetCreateParams,
179
+ ApiapiAPI as API,
180
+ type APICreateAssetUploadURLResponse as APICreateAssetUploadURLResponse,
181
+ type APIListAuctionsResponse as APIListAuctionsResponse,
182
+ type APIListUsersResponse as APIListUsersResponse,
183
+ type APICreateAssetUploadURLParams as APICreateAssetUploadURLParams,
184
+ type APIListAuctionBidsParams as APIListAuctionBidsParams,
185
+ type APIListUsersParams as APIListUsersParams,
195
186
  };
196
-
197
- export { Users as Users };
198
-
199
- export { Loyalty as Loyalty };
200
-
201
- export {
202
- AuctionBids as AuctionBids,
203
- type AuctionBidCreateParams as AuctionBidCreateParams,
204
- type AuctionBidListParams as AuctionBidListParams,
205
- };
206
-
207
- export {
208
- Websites as Websites,
209
- type WebsiteCreateResponse as WebsiteCreateResponse,
210
- type WebsiteListResponse as WebsiteListResponse,
211
- type WebsiteCreateParams as WebsiteCreateParams,
212
- type WebsiteListParams as WebsiteListParams,
213
- };
214
-
215
- export { Drip as Drip };
216
187
  }
217
188
 
218
189
  export { toFile, fileFromPath } from './uploads';