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

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 (342) hide show
  1. package/CHANGELOG.md +31 -48
  2. package/README.md +12 -14
  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.map +1 -1
  7. package/core.js +2 -0
  8. package/core.js.map +1 -1
  9. package/core.mjs +3 -1
  10. package/core.mjs.map +1 -1
  11. package/index.d.mts +27 -6
  12. package/index.d.ts +27 -6
  13. package/index.d.ts.map +1 -1
  14. package/index.js +29 -8
  15. package/index.js.map +1 -1
  16. package/index.mjs +29 -8
  17. package/index.mjs.map +1 -1
  18. package/package.json +1 -1
  19. package/resources/assets.d.ts +50 -0
  20. package/resources/assets.d.ts.map +1 -0
  21. package/resources/assets.js +17 -0
  22. package/resources/assets.js.map +1 -0
  23. package/resources/assets.mjs +13 -0
  24. package/resources/assets.mjs.map +1 -0
  25. package/resources/auctions.d.ts +134 -0
  26. package/resources/auctions.d.ts.map +1 -0
  27. package/resources/auctions.js +26 -0
  28. package/resources/auctions.js.map +1 -0
  29. package/resources/auctions.mjs +22 -0
  30. package/resources/auctions.mjs.map +1 -0
  31. package/resources/auth.d.ts +40 -0
  32. package/resources/auth.d.ts.map +1 -0
  33. package/resources/auth.js +16 -0
  34. package/resources/auth.js.map +1 -0
  35. package/resources/auth.mjs +12 -0
  36. package/resources/auth.mjs.map +1 -0
  37. package/resources/index.d.ts +8 -1
  38. package/resources/index.d.ts.map +1 -1
  39. package/resources/index.js +17 -3
  40. package/resources/index.js.map +1 -1
  41. package/resources/index.mjs +8 -1
  42. package/resources/index.mjs.map +1 -1
  43. package/resources/{api/loyalty → loyalty}/accounts.d.ts +9 -10
  44. package/resources/loyalty/accounts.d.ts.map +1 -0
  45. package/resources/{api/loyalty → loyalty}/accounts.js +4 -4
  46. package/resources/loyalty/accounts.js.map +1 -0
  47. package/resources/{api/loyalty → loyalty}/accounts.mjs +4 -4
  48. package/resources/loyalty/accounts.mjs.map +1 -0
  49. package/resources/{api/loyalty → loyalty}/badges.d.ts +2 -2
  50. package/resources/loyalty/badges.d.ts.map +1 -0
  51. package/resources/{api/loyalty → loyalty}/badges.js +2 -2
  52. package/resources/loyalty/badges.js.map +1 -0
  53. package/resources/{api/loyalty → loyalty}/badges.mjs +2 -2
  54. package/resources/loyalty/badges.mjs.map +1 -0
  55. package/resources/{api/loyalty → loyalty}/currencies.d.ts +8 -2
  56. package/resources/loyalty/currencies.d.ts.map +1 -0
  57. package/resources/{api/loyalty → loyalty}/currencies.js +1 -1
  58. package/resources/loyalty/currencies.js.map +1 -0
  59. package/resources/{api/loyalty → loyalty}/currencies.mjs +1 -1
  60. package/resources/loyalty/currencies.mjs.map +1 -0
  61. package/resources/{api/loyalty → loyalty}/index.d.ts +5 -2
  62. package/resources/loyalty/index.d.ts.map +1 -0
  63. package/resources/{api/loyalty → loyalty}/index.js +7 -1
  64. package/resources/loyalty/index.js.map +1 -0
  65. package/resources/{api/loyalty → loyalty}/index.mjs +4 -1
  66. package/resources/loyalty/index.mjs.map +1 -0
  67. package/resources/loyalty/loyalty.d.ts +50 -0
  68. package/resources/loyalty/loyalty.d.ts.map +1 -0
  69. package/resources/{api/loyalty → loyalty}/loyalty.js +13 -20
  70. package/resources/loyalty/loyalty.js.map +1 -0
  71. package/resources/{api/loyalty → loyalty}/loyalty.mjs +13 -20
  72. package/resources/loyalty/loyalty.mjs.map +1 -0
  73. package/resources/{api/loyalty → loyalty}/multipliers.d.ts +26 -2
  74. package/resources/loyalty/multipliers.d.ts.map +1 -0
  75. package/resources/{api/loyalty → loyalty}/multipliers.js +2 -2
  76. package/resources/loyalty/multipliers.js.map +1 -0
  77. package/resources/{api/loyalty → loyalty}/multipliers.mjs +2 -2
  78. package/resources/loyalty/multipliers.mjs.map +1 -0
  79. package/resources/{api/loyalty → loyalty}/questions-responses.d.ts +2 -2
  80. package/resources/loyalty/questions-responses.d.ts.map +1 -0
  81. package/resources/{api/loyalty → loyalty}/questions-responses.js +2 -2
  82. package/resources/loyalty/questions-responses.js.map +1 -0
  83. package/resources/{api/loyalty → loyalty}/questions-responses.mjs +2 -2
  84. package/resources/loyalty/questions-responses.mjs.map +1 -0
  85. package/resources/{api/loyalty → loyalty}/questions.d.ts +2 -2
  86. package/resources/loyalty/questions.d.ts.map +1 -0
  87. package/resources/{api/loyalty → loyalty}/questions.js +1 -1
  88. package/resources/loyalty/questions.js.map +1 -0
  89. package/resources/{api/loyalty → loyalty}/questions.mjs +1 -1
  90. package/resources/loyalty/questions.mjs.map +1 -0
  91. package/resources/loyalty/rule-chains.d.ts +4 -0
  92. package/resources/loyalty/rule-chains.d.ts.map +1 -0
  93. package/resources/loyalty/rule-chains.js +9 -0
  94. package/resources/loyalty/rule-chains.js.map +1 -0
  95. package/resources/loyalty/rule-chains.mjs +5 -0
  96. package/resources/loyalty/rule-chains.mjs.map +1 -0
  97. package/resources/{api/loyalty → loyalty}/rule-edits.d.ts +2 -2
  98. package/resources/loyalty/rule-edits.d.ts.map +1 -0
  99. package/resources/{api/loyalty → loyalty}/rule-edits.js +1 -1
  100. package/resources/loyalty/rule-edits.js.map +1 -0
  101. package/resources/{api/loyalty → loyalty}/rule-edits.mjs +1 -1
  102. package/resources/loyalty/rule-edits.mjs.map +1 -0
  103. package/resources/{api/loyalty/loyalty.d.ts → loyalty/rule-groups.d.ts} +37 -285
  104. package/resources/loyalty/rule-groups.d.ts.map +1 -0
  105. package/resources/loyalty/rule-groups.js +16 -0
  106. package/resources/loyalty/rule-groups.js.map +1 -0
  107. package/resources/loyalty/rule-groups.mjs +12 -0
  108. package/resources/loyalty/rule-groups.mjs.map +1 -0
  109. package/resources/{api/loyalty → loyalty}/rules.d.ts +119 -14
  110. package/resources/loyalty/rules.d.ts.map +1 -0
  111. package/resources/{api/loyalty → loyalty}/rules.js +2 -2
  112. package/resources/loyalty/rules.js.map +1 -0
  113. package/resources/{api/loyalty → loyalty}/rules.mjs +2 -2
  114. package/resources/loyalty/rules.mjs.map +1 -0
  115. package/resources/loyalty/transactions.d.ts +248 -0
  116. package/resources/loyalty/transactions.d.ts.map +1 -0
  117. package/resources/loyalty/transactions.js +22 -0
  118. package/resources/loyalty/transactions.js.map +1 -0
  119. package/resources/loyalty/transactions.mjs +18 -0
  120. package/resources/loyalty/transactions.mjs.map +1 -0
  121. package/resources/loyalty.d.ts.map +1 -0
  122. package/resources/loyalty.js.map +1 -0
  123. package/resources/loyalty.mjs.map +1 -0
  124. package/resources/{api/minting.d.ts → minting.d.ts} +3 -3
  125. package/resources/minting.d.ts.map +1 -0
  126. package/resources/{api/minting.js → minting.js} +1 -1
  127. package/resources/minting.js.map +1 -0
  128. package/resources/{api/minting.mjs → minting.mjs} +1 -1
  129. package/resources/minting.mjs.map +1 -0
  130. package/resources/referral/index.d.ts.map +1 -0
  131. package/resources/referral/index.js.map +1 -0
  132. package/resources/referral/index.mjs.map +1 -0
  133. package/resources/{api/referral → referral}/referral.d.ts +2 -2
  134. package/resources/referral/referral.d.ts.map +1 -0
  135. package/resources/{api/referral → referral}/referral.js +2 -2
  136. package/resources/referral/referral.js.map +1 -0
  137. package/resources/{api/referral → referral}/referral.mjs +2 -2
  138. package/resources/referral/referral.mjs.map +1 -0
  139. package/resources/{api/referral → referral}/users.d.ts +2 -2
  140. package/resources/referral/users.d.ts.map +1 -0
  141. package/resources/{api/referral → referral}/users.js +1 -1
  142. package/resources/referral/users.js.map +1 -0
  143. package/resources/{api/referral → referral}/users.mjs +1 -1
  144. package/resources/referral/users.mjs.map +1 -0
  145. package/resources/referral.d.ts.map +1 -0
  146. package/resources/referral.js.map +1 -0
  147. package/resources/referral.mjs.map +1 -0
  148. package/resources/users/index.d.ts +3 -0
  149. package/resources/users/index.d.ts.map +1 -0
  150. package/resources/users/index.js.map +1 -0
  151. package/resources/users/index.mjs.map +1 -0
  152. package/resources/{api/users → users}/metadatas.d.ts +7 -2
  153. package/resources/users/metadatas.d.ts.map +1 -0
  154. package/resources/{api/users → users}/metadatas.js +2 -2
  155. package/resources/users/metadatas.js.map +1 -0
  156. package/resources/{api/users → users}/metadatas.mjs +2 -2
  157. package/resources/users/metadatas.mjs.map +1 -0
  158. package/resources/users/users.d.ts +304 -0
  159. package/resources/users/users.d.ts.map +1 -0
  160. package/resources/{api/users → users}/users.js +8 -1
  161. package/resources/users/users.js.map +1 -0
  162. package/resources/{api/users → users}/users.mjs +8 -1
  163. package/resources/users/users.mjs.map +1 -0
  164. package/resources/users.d.ts.map +1 -0
  165. package/resources/users.js.map +1 -0
  166. package/resources/users.mjs.map +1 -0
  167. package/resources/websites/index.d.ts +4 -0
  168. package/resources/websites/index.d.ts.map +1 -0
  169. package/resources/websites/index.js +11 -0
  170. package/resources/websites/index.js.map +1 -0
  171. package/resources/{api → websites}/index.mjs +0 -5
  172. package/resources/websites/index.mjs.map +1 -0
  173. package/resources/{api → websites}/website-collections.d.ts +1 -1
  174. package/resources/websites/website-collections.d.ts.map +1 -0
  175. package/resources/websites/website-collections.js.map +1 -0
  176. package/resources/websites/website-collections.mjs.map +1 -0
  177. package/resources/websites/website-user-roles.d.ts.map +1 -0
  178. package/resources/websites/website-user-roles.js.map +1 -0
  179. package/resources/websites/website-user-roles.mjs.map +1 -0
  180. package/resources/{api → websites}/websites.d.ts +8 -0
  181. package/resources/websites/websites.d.ts.map +1 -0
  182. package/resources/websites/websites.js +56 -0
  183. package/resources/websites/websites.js.map +1 -0
  184. package/resources/websites/websites.mjs +29 -0
  185. package/resources/websites/websites.mjs.map +1 -0
  186. package/resources/websites.d.ts +2 -0
  187. package/resources/websites.d.ts.map +1 -0
  188. package/resources/{api.js → websites.js} +2 -2
  189. package/resources/websites.js.map +1 -0
  190. package/resources/{api.mjs → websites.mjs} +2 -2
  191. package/resources/websites.mjs.map +1 -0
  192. package/src/_shims/index.d.ts +2 -0
  193. package/src/_shims/index.js +5 -1
  194. package/src/_shims/index.mjs +5 -1
  195. package/src/core.ts +6 -1
  196. package/src/index.ts +98 -23
  197. package/src/resources/assets.ts +77 -0
  198. package/src/resources/auctions.ts +209 -0
  199. package/src/resources/auth.ts +69 -0
  200. package/src/resources/index.ts +27 -8
  201. package/src/resources/{api/loyalty → loyalty}/accounts.ts +15 -17
  202. package/src/resources/{api/loyalty → loyalty}/badges.ts +3 -3
  203. package/src/resources/{api/loyalty → loyalty}/currencies.ts +8 -2
  204. package/src/resources/{api/loyalty → loyalty}/index.ts +16 -11
  205. package/src/resources/loyalty/loyalty.ts +231 -0
  206. package/src/resources/{api/loyalty → loyalty}/multipliers.ts +27 -3
  207. package/src/resources/{api/loyalty → loyalty}/questions-responses.ts +3 -3
  208. package/src/resources/{api/loyalty → loyalty}/questions.ts +2 -2
  209. package/src/resources/loyalty/rule-chains.ts +5 -0
  210. package/src/resources/{api/loyalty → loyalty}/rule-edits.ts +2 -2
  211. package/src/resources/{api/loyalty/loyalty.ts → loyalty/rule-groups.ts} +62 -541
  212. package/src/resources/{api/loyalty → loyalty}/rules.ts +326 -183
  213. package/src/resources/loyalty/transactions.ts +332 -0
  214. package/src/resources/{api/minting.ts → minting.ts} +18 -17
  215. package/src/resources/{api/referral → referral}/referral.ts +3 -3
  216. package/src/resources/{api/referral → referral}/users.ts +2 -2
  217. package/src/resources/{api/users → users}/index.ts +2 -0
  218. package/src/resources/{api/users → users}/metadatas.ts +10 -3
  219. package/src/resources/users/users.ts +447 -0
  220. package/src/resources/websites/index.ts +22 -0
  221. package/src/resources/{api → websites}/website-collections.ts +16 -15
  222. package/src/resources/{api → websites}/websites.ts +40 -0
  223. package/src/resources/{api.ts → websites.ts} +1 -1
  224. package/src/version.ts +1 -1
  225. package/version.d.ts +1 -1
  226. package/version.js +1 -1
  227. package/version.mjs +1 -1
  228. package/resources/api/api.d.ts +0 -365
  229. package/resources/api/api.d.ts.map +0 -1
  230. package/resources/api/api.js +0 -94
  231. package/resources/api/api.js.map +0 -1
  232. package/resources/api/api.mjs +0 -67
  233. package/resources/api/api.mjs.map +0 -1
  234. package/resources/api/index.d.ts +0 -9
  235. package/resources/api/index.d.ts.map +0 -1
  236. package/resources/api/index.js +0 -21
  237. package/resources/api/index.js.map +0 -1
  238. package/resources/api/index.mjs.map +0 -1
  239. package/resources/api/loyalty/accounts.d.ts.map +0 -1
  240. package/resources/api/loyalty/accounts.js.map +0 -1
  241. package/resources/api/loyalty/accounts.mjs.map +0 -1
  242. package/resources/api/loyalty/badges.d.ts.map +0 -1
  243. package/resources/api/loyalty/badges.js.map +0 -1
  244. package/resources/api/loyalty/badges.mjs.map +0 -1
  245. package/resources/api/loyalty/currencies.d.ts.map +0 -1
  246. package/resources/api/loyalty/currencies.js.map +0 -1
  247. package/resources/api/loyalty/currencies.mjs.map +0 -1
  248. package/resources/api/loyalty/index.d.ts.map +0 -1
  249. package/resources/api/loyalty/index.js.map +0 -1
  250. package/resources/api/loyalty/index.mjs.map +0 -1
  251. package/resources/api/loyalty/loyalty.d.ts.map +0 -1
  252. package/resources/api/loyalty/loyalty.js.map +0 -1
  253. package/resources/api/loyalty/loyalty.mjs.map +0 -1
  254. package/resources/api/loyalty/multipliers.d.ts.map +0 -1
  255. package/resources/api/loyalty/multipliers.js.map +0 -1
  256. package/resources/api/loyalty/multipliers.mjs.map +0 -1
  257. package/resources/api/loyalty/questions-responses.d.ts.map +0 -1
  258. package/resources/api/loyalty/questions-responses.js.map +0 -1
  259. package/resources/api/loyalty/questions-responses.mjs.map +0 -1
  260. package/resources/api/loyalty/questions.d.ts.map +0 -1
  261. package/resources/api/loyalty/questions.js.map +0 -1
  262. package/resources/api/loyalty/questions.mjs.map +0 -1
  263. package/resources/api/loyalty/rule-edits.d.ts.map +0 -1
  264. package/resources/api/loyalty/rule-edits.js.map +0 -1
  265. package/resources/api/loyalty/rule-edits.mjs.map +0 -1
  266. package/resources/api/loyalty/rules.d.ts.map +0 -1
  267. package/resources/api/loyalty/rules.js.map +0 -1
  268. package/resources/api/loyalty/rules.mjs.map +0 -1
  269. package/resources/api/loyalty.d.ts.map +0 -1
  270. package/resources/api/loyalty.js.map +0 -1
  271. package/resources/api/loyalty.mjs.map +0 -1
  272. package/resources/api/minting.d.ts.map +0 -1
  273. package/resources/api/minting.js.map +0 -1
  274. package/resources/api/minting.mjs.map +0 -1
  275. package/resources/api/referral/index.d.ts.map +0 -1
  276. package/resources/api/referral/index.js.map +0 -1
  277. package/resources/api/referral/index.mjs.map +0 -1
  278. package/resources/api/referral/referral.d.ts.map +0 -1
  279. package/resources/api/referral/referral.js.map +0 -1
  280. package/resources/api/referral/referral.mjs.map +0 -1
  281. package/resources/api/referral/users.d.ts.map +0 -1
  282. package/resources/api/referral/users.js.map +0 -1
  283. package/resources/api/referral/users.mjs.map +0 -1
  284. package/resources/api/referral.d.ts.map +0 -1
  285. package/resources/api/referral.js.map +0 -1
  286. package/resources/api/referral.mjs.map +0 -1
  287. package/resources/api/users/index.d.ts +0 -3
  288. package/resources/api/users/index.d.ts.map +0 -1
  289. package/resources/api/users/index.js.map +0 -1
  290. package/resources/api/users/index.mjs.map +0 -1
  291. package/resources/api/users/metadatas.d.ts.map +0 -1
  292. package/resources/api/users/metadatas.js.map +0 -1
  293. package/resources/api/users/metadatas.mjs.map +0 -1
  294. package/resources/api/users/users.d.ts +0 -133
  295. package/resources/api/users/users.d.ts.map +0 -1
  296. package/resources/api/users/users.js.map +0 -1
  297. package/resources/api/users/users.mjs.map +0 -1
  298. package/resources/api/users.d.ts.map +0 -1
  299. package/resources/api/users.js.map +0 -1
  300. package/resources/api/users.mjs.map +0 -1
  301. package/resources/api/website-collections.d.ts.map +0 -1
  302. package/resources/api/website-collections.js.map +0 -1
  303. package/resources/api/website-collections.mjs.map +0 -1
  304. package/resources/api/website-user-roles.d.ts.map +0 -1
  305. package/resources/api/website-user-roles.js.map +0 -1
  306. package/resources/api/website-user-roles.mjs.map +0 -1
  307. package/resources/api/websites.d.ts.map +0 -1
  308. package/resources/api/websites.js +0 -22
  309. package/resources/api/websites.js.map +0 -1
  310. package/resources/api/websites.mjs +0 -18
  311. package/resources/api/websites.mjs.map +0 -1
  312. package/resources/api.d.ts +0 -2
  313. package/resources/api.d.ts.map +0 -1
  314. package/resources/api.js.map +0 -1
  315. package/resources/api.mjs.map +0 -1
  316. package/src/resources/api/api.ts +0 -629
  317. package/src/resources/api/index.ts +0 -51
  318. package/src/resources/api/users/users.ts +0 -203
  319. /package/resources/{api/loyalty.d.ts → loyalty.d.ts} +0 -0
  320. /package/resources/{api/loyalty.js → loyalty.js} +0 -0
  321. /package/resources/{api/loyalty.mjs → loyalty.mjs} +0 -0
  322. /package/resources/{api/referral → referral}/index.d.ts +0 -0
  323. /package/resources/{api/referral → referral}/index.js +0 -0
  324. /package/resources/{api/referral → referral}/index.mjs +0 -0
  325. /package/resources/{api/referral.d.ts → referral.d.ts} +0 -0
  326. /package/resources/{api/referral.js → referral.js} +0 -0
  327. /package/resources/{api/referral.mjs → referral.mjs} +0 -0
  328. /package/resources/{api/users → users}/index.js +0 -0
  329. /package/resources/{api/users → users}/index.mjs +0 -0
  330. /package/resources/{api/users.d.ts → users.d.ts} +0 -0
  331. /package/resources/{api/users.js → users.js} +0 -0
  332. /package/resources/{api/users.mjs → users.mjs} +0 -0
  333. /package/resources/{api → websites}/website-collections.js +0 -0
  334. /package/resources/{api → websites}/website-collections.mjs +0 -0
  335. /package/resources/{api → websites}/website-user-roles.d.ts +0 -0
  336. /package/resources/{api → websites}/website-user-roles.js +0 -0
  337. /package/resources/{api → websites}/website-user-roles.mjs +0 -0
  338. /package/src/resources/{api/loyalty.ts → loyalty.ts} +0 -0
  339. /package/src/resources/{api/referral → referral}/index.ts +0 -0
  340. /package/src/resources/{api/referral.ts → referral.ts} +0 -0
  341. /package/src/resources/{api/users.ts → users.ts} +0 -0
  342. /package/src/resources/{api → websites}/website-user-roles.ts +0 -0
@@ -3,7 +3,9 @@
3
3
  */
4
4
  const shims = require('./registry');
5
5
  const auto = require('@snagsolutions/sdk/_shims/auto/runtime');
6
- if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
6
+ exports.init = () => {
7
+ if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
8
+ };
7
9
  for (const property of Object.keys(shims)) {
8
10
  Object.defineProperty(exports, property, {
9
11
  get() {
@@ -11,3 +13,5 @@ for (const property of Object.keys(shims)) {
11
13
  },
12
14
  });
13
15
  }
16
+
17
+ exports.init();
@@ -3,5 +3,9 @@
3
3
  */
4
4
  import * as shims from './registry.mjs';
5
5
  import * as auto from "./auto/runtime";
6
- if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
6
+ export const init = () => {
7
+ if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
8
+ };
7
9
  export * from './registry.mjs';
10
+
11
+ init();
package/src/core.ts CHANGED
@@ -16,7 +16,12 @@ import {
16
16
  type RequestInit,
17
17
  type Response,
18
18
  type HeadersInit,
19
+ init,
19
20
  } from './_shims/index';
21
+
22
+ // try running side effects outside of _shims/index to workaround https://github.com/vercel/next.js/issues/76881
23
+ init();
24
+
20
25
  export { type Response };
21
26
  import { BlobLike, isBlobLike, isMultipartBody } from './uploads';
22
27
  export {
@@ -395,7 +400,7 @@ export abstract class APIClient {
395
400
  !headers ? {}
396
401
  : Symbol.iterator in headers ?
397
402
  Object.fromEntries(Array.from(headers as Iterable<string[]>).map((header) => [...header]))
398
- : { ...headers }
403
+ : { ...(headers as any as Record<string, string>) }
399
404
  );
400
405
  }
401
406
 
package/src/index.ts CHANGED
@@ -6,19 +6,38 @@ 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 { AssetCreateAssetParams, AssetCreateAssetResponse, Assets } from './resources/assets';
10
+ import { AuctionListAuctionBidsParams, AuctionListAuctionsResponse, Auctions } from './resources/auctions';
11
+ import { Auth, AuthConnectAuthParams, AuthConnectAuthResponse } from './resources/auth';
12
+ import { Minting, MintingGetAssetsParams, MintingGetAssetsResponse } from './resources/minting';
13
+ import { Loyalty } from './resources/loyalty/loyalty';
9
14
  import {
10
- API as ApiapiAPI,
11
- APICreateAssetUploadURLParams,
12
- APICreateAssetUploadURLResponse,
13
- APIListAuctionBidsParams,
14
- APIListAuctionsResponse,
15
- APIListUsersParams,
16
- APIListUsersResponse,
17
- } from './resources/api/api';
15
+ Referral,
16
+ ReferralCreateCodeParams,
17
+ ReferralCreateCodeResponse,
18
+ } from './resources/referral/referral';
19
+ import {
20
+ UserConnectParams,
21
+ UserConnectResponse,
22
+ UserCountParams,
23
+ UserCountResponse,
24
+ UserDisconnectParams,
25
+ UserDisconnectResponse,
26
+ UserListParams,
27
+ UserListResponse,
28
+ Users,
29
+ } from './resources/users/users';
30
+ import {
31
+ WebsiteCreateParams,
32
+ WebsiteCreateResponse,
33
+ WebsiteListParams,
34
+ WebsiteListResponse,
35
+ Websites,
36
+ } from './resources/websites/websites';
18
37
 
19
38
  export interface ClientOptions {
20
39
  /**
21
- * Defaults to process.env['SNAG_SOLUTIONS_API_KEY'].
40
+ * API key required to authenticate with the Snag Solutions API.
22
41
  */
23
42
  apiKey?: string | undefined;
24
43
 
@@ -90,8 +109,8 @@ export class SnagSolutions extends Core.APIClient {
90
109
  /**
91
110
  * API Client for interfacing with the Snag Solutions API.
92
111
  *
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.
112
+ * @param {string | undefined} [opts.apiKey=process.env['X_API_KEY'] ?? undefined]
113
+ * @param {string} [opts.baseURL=process.env['SNAG_SOLUTIONS_BASE_URL'] ?? https://admin.snagsolutions.io/] - Override the default base URL for the API.
95
114
  * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
96
115
  * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
97
116
  * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
@@ -101,19 +120,19 @@ export class SnagSolutions extends Core.APIClient {
101
120
  */
102
121
  constructor({
103
122
  baseURL = Core.readEnv('SNAG_SOLUTIONS_BASE_URL'),
104
- apiKey = Core.readEnv('SNAG_SOLUTIONS_API_KEY'),
123
+ apiKey = Core.readEnv('X_API_KEY'),
105
124
  ...opts
106
125
  }: ClientOptions = {}) {
107
126
  if (apiKey === undefined) {
108
127
  throw new Errors.SnagSolutionsError(
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' }).",
128
+ "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' }).",
110
129
  );
111
130
  }
112
131
 
113
132
  const options: ClientOptions = {
114
133
  apiKey,
115
134
  ...opts,
116
- baseURL: baseURL || `https://api.example.com`,
135
+ baseURL: baseURL || `https://admin.snagsolutions.io/`,
117
136
  };
118
137
 
119
138
  super({
@@ -129,7 +148,14 @@ export class SnagSolutions extends Core.APIClient {
129
148
  this.apiKey = apiKey;
130
149
  }
131
150
 
132
- api: API.API = new API.API(this);
151
+ assets: API.Assets = new API.Assets(this);
152
+ auth: API.Auth = new API.Auth(this);
153
+ auctions: API.Auctions = new API.Auctions(this);
154
+ users: API.Users = new API.Users(this);
155
+ loyalty: API.Loyalty = new API.Loyalty(this);
156
+ minting: API.Minting = new API.Minting(this);
157
+ referral: API.Referral = new API.Referral(this);
158
+ websites: API.Websites = new API.Websites(this);
133
159
 
134
160
  protected override defaultQuery(): Core.DefaultQuery | undefined {
135
161
  return this._options.defaultQuery;
@@ -171,18 +197,67 @@ export class SnagSolutions extends Core.APIClient {
171
197
  static fileFromPath = Uploads.fileFromPath;
172
198
  }
173
199
 
174
- SnagSolutions.API = ApiapiAPI;
200
+ SnagSolutions.Assets = Assets;
201
+ SnagSolutions.Auth = Auth;
202
+ SnagSolutions.Auctions = Auctions;
203
+ SnagSolutions.Users = Users;
204
+ SnagSolutions.Loyalty = Loyalty;
205
+ SnagSolutions.Minting = Minting;
206
+ SnagSolutions.Referral = Referral;
207
+ SnagSolutions.Websites = Websites;
175
208
  export declare namespace SnagSolutions {
176
209
  export type RequestOptions = Core.RequestOptions;
177
210
 
178
211
  export {
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,
212
+ Assets as Assets,
213
+ type AssetCreateAssetResponse as AssetCreateAssetResponse,
214
+ type AssetCreateAssetParams as AssetCreateAssetParams,
215
+ };
216
+
217
+ export {
218
+ Auth as Auth,
219
+ type AuthConnectAuthResponse as AuthConnectAuthResponse,
220
+ type AuthConnectAuthParams as AuthConnectAuthParams,
221
+ };
222
+
223
+ export {
224
+ Auctions as Auctions,
225
+ type AuctionListAuctionsResponse as AuctionListAuctionsResponse,
226
+ type AuctionListAuctionBidsParams as AuctionListAuctionBidsParams,
227
+ };
228
+
229
+ export {
230
+ Users as Users,
231
+ type UserListResponse as UserListResponse,
232
+ type UserConnectResponse as UserConnectResponse,
233
+ type UserCountResponse as UserCountResponse,
234
+ type UserDisconnectResponse as UserDisconnectResponse,
235
+ type UserListParams as UserListParams,
236
+ type UserConnectParams as UserConnectParams,
237
+ type UserCountParams as UserCountParams,
238
+ type UserDisconnectParams as UserDisconnectParams,
239
+ };
240
+
241
+ export { Loyalty as Loyalty };
242
+
243
+ export {
244
+ Minting as Minting,
245
+ type MintingGetAssetsResponse as MintingGetAssetsResponse,
246
+ type MintingGetAssetsParams as MintingGetAssetsParams,
247
+ };
248
+
249
+ export {
250
+ Referral as Referral,
251
+ type ReferralCreateCodeResponse as ReferralCreateCodeResponse,
252
+ type ReferralCreateCodeParams as ReferralCreateCodeParams,
253
+ };
254
+
255
+ export {
256
+ Websites as Websites,
257
+ type WebsiteCreateResponse as WebsiteCreateResponse,
258
+ type WebsiteListResponse as WebsiteListResponse,
259
+ type WebsiteCreateParams as WebsiteCreateParams,
260
+ type WebsiteListParams as WebsiteListParams,
186
261
  };
187
262
  }
188
263
 
@@ -0,0 +1,77 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../resource';
4
+ import * as Core from '../core';
5
+
6
+ export class Assets extends APIResource {
7
+ /**
8
+ * This endpoint enables you to upload a file to the resource. Returns a presigned
9
+ * URL and the asset's public URL. Call PUT with the file as the body to upload the
10
+ * asset using the presigned URL.
11
+ */
12
+ createAsset(
13
+ body: AssetCreateAssetParams,
14
+ options?: Core.RequestOptions,
15
+ ): Core.APIPromise<AssetCreateAssetResponse> {
16
+ return this._client.post('/api/assets', { body, ...options });
17
+ }
18
+ }
19
+
20
+ /**
21
+ * Response returned upon successful generation of the signed URL for uploading the
22
+ * file.
23
+ */
24
+ export interface AssetCreateAssetResponse {
25
+ /**
26
+ * The pre-signed URL to be used for uploading the file.
27
+ */
28
+ signedUrl: string;
29
+
30
+ /**
31
+ * The URL of the uploaded file.
32
+ */
33
+ url: string;
34
+ }
35
+
36
+ export interface AssetCreateAssetParams {
37
+ /**
38
+ * The name of the file, must match the regex pattern (converted to lowercase)
39
+ */
40
+ fileName: string;
41
+
42
+ /**
43
+ * The file path, must be a valid enum value.
44
+ */
45
+ filePath?:
46
+ | 'announcements'
47
+ | 'images'
48
+ | 'videos'
49
+ | 'banners'
50
+ | 'fonts'
51
+ | 'posts'
52
+ | 'profiles'
53
+ | 'minting'
54
+ | 'loyalty';
55
+
56
+ /**
57
+ * UUID of the organization (optional, converted to lowercase)
58
+ */
59
+ organizationId?: string;
60
+
61
+ /**
62
+ * UUID of the user (optional, converted to lowercase)
63
+ */
64
+ userId?: string;
65
+
66
+ /**
67
+ * UUID of the website (optional, converted to lowercase)
68
+ */
69
+ websiteId?: string;
70
+ }
71
+
72
+ export declare namespace Assets {
73
+ export {
74
+ type AssetCreateAssetResponse as AssetCreateAssetResponse,
75
+ type AssetCreateAssetParams as AssetCreateAssetParams,
76
+ };
77
+ }
@@ -0,0 +1,209 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../resource';
4
+ import { isRequestOptions } from '../core';
5
+ import * as Core from '../core';
6
+
7
+ export class Auctions extends APIResource {
8
+ /**
9
+ * Returns a list of auction bids with optional filtering and pagination.
10
+ */
11
+ listAuctionBids(query?: AuctionListAuctionBidsParams, options?: Core.RequestOptions): Core.APIPromise<void>;
12
+ listAuctionBids(options?: Core.RequestOptions): Core.APIPromise<void>;
13
+ listAuctionBids(
14
+ query: AuctionListAuctionBidsParams | Core.RequestOptions = {},
15
+ options?: Core.RequestOptions,
16
+ ): Core.APIPromise<void> {
17
+ if (isRequestOptions(query)) {
18
+ return this.listAuctionBids({}, query);
19
+ }
20
+ return this._client.get('/api/auction_bids', {
21
+ query,
22
+ ...options,
23
+ headers: { Accept: '*/*', ...options?.headers },
24
+ });
25
+ }
26
+
27
+ /**
28
+ * Returns a list of auctions with optional filtering and pagination.
29
+ */
30
+ listAuctions(options?: Core.RequestOptions): Core.APIPromise<AuctionListAuctionsResponse> {
31
+ return this._client.get('/api/auctions', options);
32
+ }
33
+ }
34
+
35
+ /**
36
+ * Schema for the response when fetching auctions
37
+ */
38
+ export interface AuctionListAuctionsResponse {
39
+ data: Array<AuctionListAuctionsResponse.Data>;
40
+
41
+ hasNextPage: boolean;
42
+ }
43
+
44
+ export namespace AuctionListAuctionsResponse {
45
+ export interface Data {
46
+ id: string;
47
+
48
+ auctionBids: Array<Data.AuctionBid>;
49
+
50
+ auctionItems: Array<Data.AuctionItem>;
51
+
52
+ biddersOwnCollectionAddresses: Array<string>;
53
+
54
+ createdAt: string;
55
+
56
+ currencyAddress: string | null;
57
+
58
+ currencyDecimals: number;
59
+
60
+ deletedAt: string | null;
61
+
62
+ description: string;
63
+
64
+ endsAt: string;
65
+
66
+ extendedDurationInSeconds: number | null;
67
+
68
+ hideBids: boolean;
69
+
70
+ /**
71
+ * Schema representing a loyalty currency
72
+ */
73
+ loyaltyCurrency: Data.LoyaltyCurrency | null;
74
+
75
+ loyaltyCurrencyId: string | null;
76
+
77
+ minBidAmount: string;
78
+
79
+ minBidIncrement: string | null;
80
+
81
+ mintingContractId: string;
82
+
83
+ name: string;
84
+
85
+ network: 'ethereum' | 'zksync';
86
+
87
+ organizationId: string;
88
+
89
+ reservePrice: string | null;
90
+
91
+ signature: string;
92
+
93
+ startsAt: string;
94
+
95
+ status: 'in_progress' | 'completed' | 'cancelled';
96
+
97
+ type: 'first_price' | 'second_price' | 'english';
98
+
99
+ updatedAt: string;
100
+
101
+ userId: string;
102
+
103
+ websiteId: string;
104
+ }
105
+
106
+ export namespace Data {
107
+ /**
108
+ * Schema representing an auction bid
109
+ */
110
+ export interface AuctionBid {
111
+ id: string;
112
+
113
+ amount: string;
114
+
115
+ createdAt: string;
116
+ }
117
+
118
+ export interface AuctionItem {
119
+ id: string;
120
+
121
+ /**
122
+ * Schema representing a minting contract asset
123
+ */
124
+ mintingContractAsset: AuctionItem.MintingContractAsset;
125
+
126
+ quantity: number;
127
+
128
+ sortId: number;
129
+ }
130
+
131
+ export namespace AuctionItem {
132
+ /**
133
+ * Schema representing a minting contract asset
134
+ */
135
+ export interface MintingContractAsset {
136
+ id: string;
137
+ }
138
+ }
139
+
140
+ /**
141
+ * Schema representing a loyalty currency
142
+ */
143
+ export interface LoyaltyCurrency {
144
+ id: string;
145
+
146
+ decimals: number;
147
+
148
+ imageUrl: string | null;
149
+
150
+ name: string;
151
+
152
+ symbol: string;
153
+ }
154
+ }
155
+ }
156
+
157
+ export interface AuctionListAuctionBidsParams {
158
+ /**
159
+ * The bid ID
160
+ */
161
+ id?: string;
162
+
163
+ /**
164
+ * ID of the auction
165
+ */
166
+ auctionId?: string;
167
+
168
+ /**
169
+ * Maximum number of bids to return
170
+ */
171
+ limit?: number;
172
+
173
+ /**
174
+ * ID of the organization
175
+ */
176
+ organizationId?: string;
177
+
178
+ /**
179
+ * Pagination cursor to start after a specific bid ID
180
+ */
181
+ startingAfter?: string;
182
+
183
+ /**
184
+ * Status of the bid
185
+ */
186
+ status?: 'submitted' | 'accepted' | 'rejected' | 'fulfilled';
187
+
188
+ /**
189
+ * ID of the user who made the bid
190
+ */
191
+ userId?: string;
192
+
193
+ /**
194
+ * Wallet address of the bidder
195
+ */
196
+ walletAddress?: string;
197
+
198
+ /**
199
+ * ID of the website
200
+ */
201
+ websiteId?: string;
202
+ }
203
+
204
+ export declare namespace Auctions {
205
+ export {
206
+ type AuctionListAuctionsResponse as AuctionListAuctionsResponse,
207
+ type AuctionListAuctionBidsParams as AuctionListAuctionBidsParams,
208
+ };
209
+ }
@@ -0,0 +1,69 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../resource';
4
+ import { isRequestOptions } from '../core';
5
+ import * as Core from '../core';
6
+
7
+ export class Auth extends APIResource {
8
+ /**
9
+ * This endpoint allows you to connect your Twitter account to a Snag account
10
+ */
11
+ connectAuth(
12
+ authType: 'twitter' | 'discord' | 'telegram' | 'epic' | 'steam',
13
+ query?: AuthConnectAuthParams,
14
+ options?: Core.RequestOptions,
15
+ ): Core.APIPromise<AuthConnectAuthResponse>;
16
+ connectAuth(
17
+ authType: 'twitter' | 'discord' | 'telegram' | 'epic' | 'steam',
18
+ options?: Core.RequestOptions,
19
+ ): Core.APIPromise<AuthConnectAuthResponse>;
20
+ connectAuth(
21
+ authType: 'twitter' | 'discord' | 'telegram' | 'epic' | 'steam',
22
+ query: AuthConnectAuthParams | Core.RequestOptions = {},
23
+ options?: Core.RequestOptions,
24
+ ): Core.APIPromise<AuthConnectAuthResponse> {
25
+ if (isRequestOptions(query)) {
26
+ return this.connectAuth(authType, {}, query);
27
+ }
28
+ return this._client.get(`/api/${authType}/auth`, { query, ...options });
29
+ }
30
+ }
31
+
32
+ /**
33
+ * Schema for a connect social auth response schema
34
+ */
35
+ export interface AuthConnectAuthResponse {
36
+ /**
37
+ * The URL to redirect to
38
+ */
39
+ url: string;
40
+ }
41
+
42
+ export interface AuthConnectAuthParams {
43
+ /**
44
+ * The redirect URL where the user will land after completing the auth
45
+ */
46
+ redirect?: string;
47
+
48
+ /**
49
+ * The type of response to return
50
+ */
51
+ responseType?: 'redirect' | 'json';
52
+
53
+ /**
54
+ * The ID of the user
55
+ */
56
+ userId?: string;
57
+
58
+ /**
59
+ * The ID of the website
60
+ */
61
+ websiteId?: string;
62
+ }
63
+
64
+ export declare namespace Auth {
65
+ export {
66
+ type AuthConnectAuthResponse as AuthConnectAuthResponse,
67
+ type AuthConnectAuthParams as AuthConnectAuthParams,
68
+ };
69
+ }
@@ -1,11 +1,30 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
+ export { Assets, type AssetCreateAssetResponse, type AssetCreateAssetParams } from './assets';
4
+ export { Auctions, type AuctionListAuctionsResponse, type AuctionListAuctionBidsParams } from './auctions';
5
+ export { Auth, type AuthConnectAuthResponse, type AuthConnectAuthParams } from './auth';
6
+ export { Loyalty } from './loyalty/loyalty';
7
+ export { Minting, type MintingGetAssetsResponse, type MintingGetAssetsParams } from './minting';
3
8
  export {
4
- API,
5
- type APICreateAssetUploadURLResponse,
6
- type APIListAuctionsResponse,
7
- type APIListUsersResponse,
8
- type APICreateAssetUploadURLParams,
9
- type APIListAuctionBidsParams,
10
- type APIListUsersParams,
11
- } from './api/api';
9
+ Referral,
10
+ type ReferralCreateCodeResponse,
11
+ type ReferralCreateCodeParams,
12
+ } from './referral/referral';
13
+ export {
14
+ Users,
15
+ type UserListResponse,
16
+ type UserConnectResponse,
17
+ type UserCountResponse,
18
+ type UserDisconnectResponse,
19
+ type UserListParams,
20
+ type UserConnectParams,
21
+ type UserCountParams,
22
+ type UserDisconnectParams,
23
+ } from './users/users';
24
+ export {
25
+ Websites,
26
+ type WebsiteCreateResponse,
27
+ type WebsiteListResponse,
28
+ type WebsiteCreateParams,
29
+ type WebsiteListParams,
30
+ } from './websites/websites';
@@ -1,8 +1,8 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../../resource';
4
- import { isRequestOptions } from '../../../core';
5
- import * as Core from '../../../core';
3
+ import { APIResource } from '../../resource';
4
+ import { isRequestOptions } from '../../core';
5
+ import * as Core from '../../core';
6
6
 
7
7
  export class Accounts extends APIResource {
8
8
  /**
@@ -25,12 +25,12 @@ export class Accounts extends APIResource {
25
25
  * loyalty currency. This can be a slow operation for large organizations. We
26
26
  * recommend caching when possible.
27
27
  */
28
- getRank(
29
- pathId: string,
30
- query: AccountGetRankParams,
28
+ retrieveRank(
29
+ id: string,
30
+ query: AccountRetrieveRankParams,
31
31
  options?: Core.RequestOptions,
32
- ): Core.APIPromise<AccountGetRankResponse> {
33
- return this._client.get(`/api/loyalty/accounts/${pathId}/rank`, { query, ...options });
32
+ ): Core.APIPromise<AccountRetrieveRankResponse> {
33
+ return this._client.get(`/api/loyalty/accounts/${id}/rank`, { query, ...options });
34
34
  }
35
35
  }
36
36
 
@@ -145,7 +145,10 @@ export namespace AccountListResponse {
145
145
  }
146
146
  }
147
147
 
148
- export interface AccountGetRankResponse {
148
+ /**
149
+ * Schema for a get account rank response
150
+ */
151
+ export interface AccountRetrieveRankResponse {
149
152
  /**
150
153
  * Rank of the user
151
154
  */
@@ -224,12 +227,7 @@ export interface AccountListParams {
224
227
  websiteId?: string;
225
228
  }
226
229
 
227
- export interface AccountGetRankParams {
228
- /**
229
- * UUID of the account
230
- */
231
- query_id: string;
232
-
230
+ export interface AccountRetrieveRankParams {
233
231
  /**
234
232
  * UUID of the loyalty currency
235
233
  */
@@ -249,8 +247,8 @@ export interface AccountGetRankParams {
249
247
  export declare namespace Accounts {
250
248
  export {
251
249
  type AccountListResponse as AccountListResponse,
252
- type AccountGetRankResponse as AccountGetRankResponse,
250
+ type AccountRetrieveRankResponse as AccountRetrieveRankResponse,
253
251
  type AccountListParams as AccountListParams,
254
- type AccountGetRankParams as AccountGetRankParams,
252
+ type AccountRetrieveRankParams as AccountRetrieveRankParams,
255
253
  };
256
254
  }
@@ -1,8 +1,8 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../../resource';
4
- import { isRequestOptions } from '../../../core';
5
- import * as Core from '../../../core';
3
+ import { APIResource } from '../../resource';
4
+ import { isRequestOptions } from '../../core';
5
+ import * as Core from '../../core';
6
6
 
7
7
  export class Badges extends APIResource {
8
8
  /**