@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.
- package/CHANGELOG.md +31 -48
- package/README.md +12 -14
- package/_shims/index.d.ts +2 -0
- package/_shims/index.js +5 -1
- package/_shims/index.mjs +5 -1
- package/core.d.ts.map +1 -1
- package/core.js +2 -0
- package/core.js.map +1 -1
- package/core.mjs +3 -1
- package/core.mjs.map +1 -1
- package/index.d.mts +27 -6
- package/index.d.ts +27 -6
- package/index.d.ts.map +1 -1
- package/index.js +29 -8
- package/index.js.map +1 -1
- package/index.mjs +29 -8
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/assets.d.ts +50 -0
- package/resources/assets.d.ts.map +1 -0
- package/resources/assets.js +17 -0
- package/resources/assets.js.map +1 -0
- package/resources/assets.mjs +13 -0
- package/resources/assets.mjs.map +1 -0
- package/resources/auctions.d.ts +134 -0
- package/resources/auctions.d.ts.map +1 -0
- package/resources/auctions.js +26 -0
- package/resources/auctions.js.map +1 -0
- package/resources/auctions.mjs +22 -0
- package/resources/auctions.mjs.map +1 -0
- package/resources/auth.d.ts +40 -0
- package/resources/auth.d.ts.map +1 -0
- package/resources/auth.js +16 -0
- package/resources/auth.js.map +1 -0
- package/resources/auth.mjs +12 -0
- package/resources/auth.mjs.map +1 -0
- package/resources/index.d.ts +8 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +17 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +8 -1
- package/resources/index.mjs.map +1 -1
- package/resources/{api/loyalty → loyalty}/accounts.d.ts +9 -10
- package/resources/loyalty/accounts.d.ts.map +1 -0
- package/resources/{api/loyalty → loyalty}/accounts.js +4 -4
- package/resources/loyalty/accounts.js.map +1 -0
- package/resources/{api/loyalty → loyalty}/accounts.mjs +4 -4
- package/resources/loyalty/accounts.mjs.map +1 -0
- package/resources/{api/loyalty → loyalty}/badges.d.ts +2 -2
- package/resources/loyalty/badges.d.ts.map +1 -0
- package/resources/{api/loyalty → loyalty}/badges.js +2 -2
- package/resources/loyalty/badges.js.map +1 -0
- package/resources/{api/loyalty → loyalty}/badges.mjs +2 -2
- package/resources/loyalty/badges.mjs.map +1 -0
- package/resources/{api/loyalty → loyalty}/currencies.d.ts +8 -2
- package/resources/loyalty/currencies.d.ts.map +1 -0
- package/resources/{api/loyalty → loyalty}/currencies.js +1 -1
- package/resources/loyalty/currencies.js.map +1 -0
- package/resources/{api/loyalty → loyalty}/currencies.mjs +1 -1
- package/resources/loyalty/currencies.mjs.map +1 -0
- package/resources/{api/loyalty → loyalty}/index.d.ts +5 -2
- package/resources/loyalty/index.d.ts.map +1 -0
- package/resources/{api/loyalty → loyalty}/index.js +7 -1
- package/resources/loyalty/index.js.map +1 -0
- package/resources/{api/loyalty → loyalty}/index.mjs +4 -1
- package/resources/loyalty/index.mjs.map +1 -0
- package/resources/loyalty/loyalty.d.ts +50 -0
- package/resources/loyalty/loyalty.d.ts.map +1 -0
- package/resources/{api/loyalty → loyalty}/loyalty.js +13 -20
- package/resources/loyalty/loyalty.js.map +1 -0
- package/resources/{api/loyalty → loyalty}/loyalty.mjs +13 -20
- package/resources/loyalty/loyalty.mjs.map +1 -0
- package/resources/{api/loyalty → loyalty}/multipliers.d.ts +26 -2
- package/resources/loyalty/multipliers.d.ts.map +1 -0
- package/resources/{api/loyalty → loyalty}/multipliers.js +2 -2
- package/resources/loyalty/multipliers.js.map +1 -0
- package/resources/{api/loyalty → loyalty}/multipliers.mjs +2 -2
- package/resources/loyalty/multipliers.mjs.map +1 -0
- package/resources/{api/loyalty → loyalty}/questions-responses.d.ts +2 -2
- package/resources/loyalty/questions-responses.d.ts.map +1 -0
- package/resources/{api/loyalty → loyalty}/questions-responses.js +2 -2
- package/resources/loyalty/questions-responses.js.map +1 -0
- package/resources/{api/loyalty → loyalty}/questions-responses.mjs +2 -2
- package/resources/loyalty/questions-responses.mjs.map +1 -0
- package/resources/{api/loyalty → loyalty}/questions.d.ts +2 -2
- package/resources/loyalty/questions.d.ts.map +1 -0
- package/resources/{api/loyalty → loyalty}/questions.js +1 -1
- package/resources/loyalty/questions.js.map +1 -0
- package/resources/{api/loyalty → loyalty}/questions.mjs +1 -1
- package/resources/loyalty/questions.mjs.map +1 -0
- package/resources/loyalty/rule-chains.d.ts +4 -0
- package/resources/loyalty/rule-chains.d.ts.map +1 -0
- package/resources/loyalty/rule-chains.js +9 -0
- package/resources/loyalty/rule-chains.js.map +1 -0
- package/resources/loyalty/rule-chains.mjs +5 -0
- package/resources/loyalty/rule-chains.mjs.map +1 -0
- package/resources/{api/loyalty → loyalty}/rule-edits.d.ts +2 -2
- package/resources/loyalty/rule-edits.d.ts.map +1 -0
- package/resources/{api/loyalty → loyalty}/rule-edits.js +1 -1
- package/resources/loyalty/rule-edits.js.map +1 -0
- package/resources/{api/loyalty → loyalty}/rule-edits.mjs +1 -1
- package/resources/loyalty/rule-edits.mjs.map +1 -0
- package/resources/{api/loyalty/loyalty.d.ts → loyalty/rule-groups.d.ts} +37 -285
- package/resources/loyalty/rule-groups.d.ts.map +1 -0
- package/resources/loyalty/rule-groups.js +16 -0
- package/resources/loyalty/rule-groups.js.map +1 -0
- package/resources/loyalty/rule-groups.mjs +12 -0
- package/resources/loyalty/rule-groups.mjs.map +1 -0
- package/resources/{api/loyalty → loyalty}/rules.d.ts +119 -14
- package/resources/loyalty/rules.d.ts.map +1 -0
- package/resources/{api/loyalty → loyalty}/rules.js +2 -2
- package/resources/loyalty/rules.js.map +1 -0
- package/resources/{api/loyalty → loyalty}/rules.mjs +2 -2
- package/resources/loyalty/rules.mjs.map +1 -0
- package/resources/loyalty/transactions.d.ts +248 -0
- package/resources/loyalty/transactions.d.ts.map +1 -0
- package/resources/loyalty/transactions.js +22 -0
- package/resources/loyalty/transactions.js.map +1 -0
- package/resources/loyalty/transactions.mjs +18 -0
- package/resources/loyalty/transactions.mjs.map +1 -0
- package/resources/loyalty.d.ts.map +1 -0
- package/resources/loyalty.js.map +1 -0
- package/resources/loyalty.mjs.map +1 -0
- package/resources/{api/minting.d.ts → minting.d.ts} +3 -3
- package/resources/minting.d.ts.map +1 -0
- package/resources/{api/minting.js → minting.js} +1 -1
- package/resources/minting.js.map +1 -0
- package/resources/{api/minting.mjs → minting.mjs} +1 -1
- package/resources/minting.mjs.map +1 -0
- package/resources/referral/index.d.ts.map +1 -0
- package/resources/referral/index.js.map +1 -0
- package/resources/referral/index.mjs.map +1 -0
- package/resources/{api/referral → referral}/referral.d.ts +2 -2
- package/resources/referral/referral.d.ts.map +1 -0
- package/resources/{api/referral → referral}/referral.js +2 -2
- package/resources/referral/referral.js.map +1 -0
- package/resources/{api/referral → referral}/referral.mjs +2 -2
- package/resources/referral/referral.mjs.map +1 -0
- package/resources/{api/referral → referral}/users.d.ts +2 -2
- package/resources/referral/users.d.ts.map +1 -0
- package/resources/{api/referral → referral}/users.js +1 -1
- package/resources/referral/users.js.map +1 -0
- package/resources/{api/referral → referral}/users.mjs +1 -1
- package/resources/referral/users.mjs.map +1 -0
- package/resources/referral.d.ts.map +1 -0
- package/resources/referral.js.map +1 -0
- package/resources/referral.mjs.map +1 -0
- package/resources/users/index.d.ts +3 -0
- package/resources/users/index.d.ts.map +1 -0
- package/resources/users/index.js.map +1 -0
- package/resources/users/index.mjs.map +1 -0
- package/resources/{api/users → users}/metadatas.d.ts +7 -2
- package/resources/users/metadatas.d.ts.map +1 -0
- package/resources/{api/users → users}/metadatas.js +2 -2
- package/resources/users/metadatas.js.map +1 -0
- package/resources/{api/users → users}/metadatas.mjs +2 -2
- package/resources/users/metadatas.mjs.map +1 -0
- package/resources/users/users.d.ts +304 -0
- package/resources/users/users.d.ts.map +1 -0
- package/resources/{api/users → users}/users.js +8 -1
- package/resources/users/users.js.map +1 -0
- package/resources/{api/users → users}/users.mjs +8 -1
- package/resources/users/users.mjs.map +1 -0
- package/resources/users.d.ts.map +1 -0
- package/resources/users.js.map +1 -0
- package/resources/users.mjs.map +1 -0
- package/resources/websites/index.d.ts +4 -0
- package/resources/websites/index.d.ts.map +1 -0
- package/resources/websites/index.js +11 -0
- package/resources/websites/index.js.map +1 -0
- package/resources/{api → websites}/index.mjs +0 -5
- package/resources/websites/index.mjs.map +1 -0
- package/resources/{api → websites}/website-collections.d.ts +1 -1
- package/resources/websites/website-collections.d.ts.map +1 -0
- package/resources/websites/website-collections.js.map +1 -0
- package/resources/websites/website-collections.mjs.map +1 -0
- package/resources/websites/website-user-roles.d.ts.map +1 -0
- package/resources/websites/website-user-roles.js.map +1 -0
- package/resources/websites/website-user-roles.mjs.map +1 -0
- package/resources/{api → websites}/websites.d.ts +8 -0
- package/resources/websites/websites.d.ts.map +1 -0
- package/resources/websites/websites.js +56 -0
- package/resources/websites/websites.js.map +1 -0
- package/resources/websites/websites.mjs +29 -0
- package/resources/websites/websites.mjs.map +1 -0
- package/resources/websites.d.ts +2 -0
- package/resources/websites.d.ts.map +1 -0
- package/resources/{api.js → websites.js} +2 -2
- package/resources/websites.js.map +1 -0
- package/resources/{api.mjs → websites.mjs} +2 -2
- package/resources/websites.mjs.map +1 -0
- package/src/_shims/index.d.ts +2 -0
- package/src/_shims/index.js +5 -1
- package/src/_shims/index.mjs +5 -1
- package/src/core.ts +6 -1
- package/src/index.ts +98 -23
- package/src/resources/assets.ts +77 -0
- package/src/resources/auctions.ts +209 -0
- package/src/resources/auth.ts +69 -0
- package/src/resources/index.ts +27 -8
- package/src/resources/{api/loyalty → loyalty}/accounts.ts +15 -17
- package/src/resources/{api/loyalty → loyalty}/badges.ts +3 -3
- package/src/resources/{api/loyalty → loyalty}/currencies.ts +8 -2
- package/src/resources/{api/loyalty → loyalty}/index.ts +16 -11
- package/src/resources/loyalty/loyalty.ts +231 -0
- package/src/resources/{api/loyalty → loyalty}/multipliers.ts +27 -3
- package/src/resources/{api/loyalty → loyalty}/questions-responses.ts +3 -3
- package/src/resources/{api/loyalty → loyalty}/questions.ts +2 -2
- package/src/resources/loyalty/rule-chains.ts +5 -0
- package/src/resources/{api/loyalty → loyalty}/rule-edits.ts +2 -2
- package/src/resources/{api/loyalty/loyalty.ts → loyalty/rule-groups.ts} +62 -541
- package/src/resources/{api/loyalty → loyalty}/rules.ts +326 -183
- package/src/resources/loyalty/transactions.ts +332 -0
- package/src/resources/{api/minting.ts → minting.ts} +18 -17
- package/src/resources/{api/referral → referral}/referral.ts +3 -3
- package/src/resources/{api/referral → referral}/users.ts +2 -2
- package/src/resources/{api/users → users}/index.ts +2 -0
- package/src/resources/{api/users → users}/metadatas.ts +10 -3
- package/src/resources/users/users.ts +447 -0
- package/src/resources/websites/index.ts +22 -0
- package/src/resources/{api → websites}/website-collections.ts +16 -15
- package/src/resources/{api → websites}/websites.ts +40 -0
- package/src/resources/{api.ts → websites.ts} +1 -1
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/api/api.d.ts +0 -365
- package/resources/api/api.d.ts.map +0 -1
- package/resources/api/api.js +0 -94
- package/resources/api/api.js.map +0 -1
- package/resources/api/api.mjs +0 -67
- package/resources/api/api.mjs.map +0 -1
- package/resources/api/index.d.ts +0 -9
- package/resources/api/index.d.ts.map +0 -1
- package/resources/api/index.js +0 -21
- package/resources/api/index.js.map +0 -1
- package/resources/api/index.mjs.map +0 -1
- package/resources/api/loyalty/accounts.d.ts.map +0 -1
- package/resources/api/loyalty/accounts.js.map +0 -1
- package/resources/api/loyalty/accounts.mjs.map +0 -1
- package/resources/api/loyalty/badges.d.ts.map +0 -1
- package/resources/api/loyalty/badges.js.map +0 -1
- package/resources/api/loyalty/badges.mjs.map +0 -1
- package/resources/api/loyalty/currencies.d.ts.map +0 -1
- package/resources/api/loyalty/currencies.js.map +0 -1
- package/resources/api/loyalty/currencies.mjs.map +0 -1
- package/resources/api/loyalty/index.d.ts.map +0 -1
- package/resources/api/loyalty/index.js.map +0 -1
- package/resources/api/loyalty/index.mjs.map +0 -1
- package/resources/api/loyalty/loyalty.d.ts.map +0 -1
- package/resources/api/loyalty/loyalty.js.map +0 -1
- package/resources/api/loyalty/loyalty.mjs.map +0 -1
- package/resources/api/loyalty/multipliers.d.ts.map +0 -1
- package/resources/api/loyalty/multipliers.js.map +0 -1
- package/resources/api/loyalty/multipliers.mjs.map +0 -1
- package/resources/api/loyalty/questions-responses.d.ts.map +0 -1
- package/resources/api/loyalty/questions-responses.js.map +0 -1
- package/resources/api/loyalty/questions-responses.mjs.map +0 -1
- package/resources/api/loyalty/questions.d.ts.map +0 -1
- package/resources/api/loyalty/questions.js.map +0 -1
- package/resources/api/loyalty/questions.mjs.map +0 -1
- package/resources/api/loyalty/rule-edits.d.ts.map +0 -1
- package/resources/api/loyalty/rule-edits.js.map +0 -1
- package/resources/api/loyalty/rule-edits.mjs.map +0 -1
- package/resources/api/loyalty/rules.d.ts.map +0 -1
- package/resources/api/loyalty/rules.js.map +0 -1
- package/resources/api/loyalty/rules.mjs.map +0 -1
- package/resources/api/loyalty.d.ts.map +0 -1
- package/resources/api/loyalty.js.map +0 -1
- package/resources/api/loyalty.mjs.map +0 -1
- package/resources/api/minting.d.ts.map +0 -1
- package/resources/api/minting.js.map +0 -1
- package/resources/api/minting.mjs.map +0 -1
- package/resources/api/referral/index.d.ts.map +0 -1
- package/resources/api/referral/index.js.map +0 -1
- package/resources/api/referral/index.mjs.map +0 -1
- package/resources/api/referral/referral.d.ts.map +0 -1
- package/resources/api/referral/referral.js.map +0 -1
- package/resources/api/referral/referral.mjs.map +0 -1
- package/resources/api/referral/users.d.ts.map +0 -1
- package/resources/api/referral/users.js.map +0 -1
- package/resources/api/referral/users.mjs.map +0 -1
- package/resources/api/referral.d.ts.map +0 -1
- package/resources/api/referral.js.map +0 -1
- package/resources/api/referral.mjs.map +0 -1
- package/resources/api/users/index.d.ts +0 -3
- package/resources/api/users/index.d.ts.map +0 -1
- package/resources/api/users/index.js.map +0 -1
- package/resources/api/users/index.mjs.map +0 -1
- package/resources/api/users/metadatas.d.ts.map +0 -1
- package/resources/api/users/metadatas.js.map +0 -1
- package/resources/api/users/metadatas.mjs.map +0 -1
- package/resources/api/users/users.d.ts +0 -133
- package/resources/api/users/users.d.ts.map +0 -1
- package/resources/api/users/users.js.map +0 -1
- package/resources/api/users/users.mjs.map +0 -1
- package/resources/api/users.d.ts.map +0 -1
- package/resources/api/users.js.map +0 -1
- package/resources/api/users.mjs.map +0 -1
- package/resources/api/website-collections.d.ts.map +0 -1
- package/resources/api/website-collections.js.map +0 -1
- package/resources/api/website-collections.mjs.map +0 -1
- package/resources/api/website-user-roles.d.ts.map +0 -1
- package/resources/api/website-user-roles.js.map +0 -1
- package/resources/api/website-user-roles.mjs.map +0 -1
- package/resources/api/websites.d.ts.map +0 -1
- package/resources/api/websites.js +0 -22
- package/resources/api/websites.js.map +0 -1
- package/resources/api/websites.mjs +0 -18
- package/resources/api/websites.mjs.map +0 -1
- package/resources/api.d.ts +0 -2
- package/resources/api.d.ts.map +0 -1
- package/resources/api.js.map +0 -1
- package/resources/api.mjs.map +0 -1
- package/src/resources/api/api.ts +0 -629
- package/src/resources/api/index.ts +0 -51
- package/src/resources/api/users/users.ts +0 -203
- /package/resources/{api/loyalty.d.ts → loyalty.d.ts} +0 -0
- /package/resources/{api/loyalty.js → loyalty.js} +0 -0
- /package/resources/{api/loyalty.mjs → loyalty.mjs} +0 -0
- /package/resources/{api/referral → referral}/index.d.ts +0 -0
- /package/resources/{api/referral → referral}/index.js +0 -0
- /package/resources/{api/referral → referral}/index.mjs +0 -0
- /package/resources/{api/referral.d.ts → referral.d.ts} +0 -0
- /package/resources/{api/referral.js → referral.js} +0 -0
- /package/resources/{api/referral.mjs → referral.mjs} +0 -0
- /package/resources/{api/users → users}/index.js +0 -0
- /package/resources/{api/users → users}/index.mjs +0 -0
- /package/resources/{api/users.d.ts → users.d.ts} +0 -0
- /package/resources/{api/users.js → users.js} +0 -0
- /package/resources/{api/users.mjs → users.mjs} +0 -0
- /package/resources/{api → websites}/website-collections.js +0 -0
- /package/resources/{api → websites}/website-collections.mjs +0 -0
- /package/resources/{api → websites}/website-user-roles.d.ts +0 -0
- /package/resources/{api → websites}/website-user-roles.js +0 -0
- /package/resources/{api → websites}/website-user-roles.mjs +0 -0
- /package/src/resources/{api/loyalty.ts → loyalty.ts} +0 -0
- /package/src/resources/{api/referral → referral}/index.ts +0 -0
- /package/src/resources/{api/referral.ts → referral.ts} +0 -0
- /package/src/resources/{api/users.ts → users.ts} +0 -0
- /package/src/resources/{api → websites}/website-user-roles.ts +0 -0
package/index.d.mts
CHANGED
|
@@ -3,10 +3,17 @@ import * as Core from "./core.js";
|
|
|
3
3
|
import * as Errors from "./error.js";
|
|
4
4
|
import * as Uploads from "./uploads.js";
|
|
5
5
|
import * as API from "./resources/index.js";
|
|
6
|
-
import {
|
|
6
|
+
import { AssetCreateAssetParams, AssetCreateAssetResponse, Assets } from "./resources/assets.js";
|
|
7
|
+
import { AuctionListAuctionBidsParams, AuctionListAuctionsResponse, Auctions } from "./resources/auctions.js";
|
|
8
|
+
import { Auth, AuthConnectAuthParams, AuthConnectAuthResponse } from "./resources/auth.js";
|
|
9
|
+
import { Minting, MintingGetAssetsParams, MintingGetAssetsResponse } from "./resources/minting.js";
|
|
10
|
+
import { Loyalty } from "./resources/loyalty/loyalty.js";
|
|
11
|
+
import { Referral, ReferralCreateCodeParams, ReferralCreateCodeResponse } from "./resources/referral/referral.js";
|
|
12
|
+
import { UserConnectParams, UserConnectResponse, UserCountParams, UserCountResponse, UserDisconnectParams, UserDisconnectResponse, UserListParams, UserListResponse, Users } from "./resources/users/users.js";
|
|
13
|
+
import { WebsiteCreateParams, WebsiteCreateResponse, WebsiteListParams, WebsiteListResponse, Websites } from "./resources/websites/websites.js";
|
|
7
14
|
export interface ClientOptions {
|
|
8
15
|
/**
|
|
9
|
-
*
|
|
16
|
+
* API key required to authenticate with the Snag Solutions API.
|
|
10
17
|
*/
|
|
11
18
|
apiKey?: string | undefined;
|
|
12
19
|
/**
|
|
@@ -68,8 +75,8 @@ export declare class SnagSolutions extends Core.APIClient {
|
|
|
68
75
|
/**
|
|
69
76
|
* API Client for interfacing with the Snag Solutions API.
|
|
70
77
|
*
|
|
71
|
-
* @param {string | undefined} [opts.apiKey=process.env['
|
|
72
|
-
* @param {string} [opts.baseURL=process.env['SNAG_SOLUTIONS_BASE_URL'] ?? https://
|
|
78
|
+
* @param {string | undefined} [opts.apiKey=process.env['X_API_KEY'] ?? undefined]
|
|
79
|
+
* @param {string} [opts.baseURL=process.env['SNAG_SOLUTIONS_BASE_URL'] ?? https://admin.snagsolutions.io/] - Override the default base URL for the API.
|
|
73
80
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
74
81
|
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
75
82
|
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
@@ -78,7 +85,14 @@ export declare class SnagSolutions extends Core.APIClient {
|
|
|
78
85
|
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
79
86
|
*/
|
|
80
87
|
constructor({ baseURL, apiKey, ...opts }?: ClientOptions);
|
|
81
|
-
|
|
88
|
+
assets: API.Assets;
|
|
89
|
+
auth: API.Auth;
|
|
90
|
+
auctions: API.Auctions;
|
|
91
|
+
users: API.Users;
|
|
92
|
+
loyalty: API.Loyalty;
|
|
93
|
+
minting: API.Minting;
|
|
94
|
+
referral: API.Referral;
|
|
95
|
+
websites: API.Websites;
|
|
82
96
|
protected defaultQuery(): Core.DefaultQuery | undefined;
|
|
83
97
|
protected defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
84
98
|
protected authHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
@@ -103,7 +117,14 @@ export declare class SnagSolutions extends Core.APIClient {
|
|
|
103
117
|
}
|
|
104
118
|
export declare namespace SnagSolutions {
|
|
105
119
|
export type RequestOptions = Core.RequestOptions;
|
|
106
|
-
export {
|
|
120
|
+
export { Assets as Assets, type AssetCreateAssetResponse as AssetCreateAssetResponse, type AssetCreateAssetParams as AssetCreateAssetParams, };
|
|
121
|
+
export { Auth as Auth, type AuthConnectAuthResponse as AuthConnectAuthResponse, type AuthConnectAuthParams as AuthConnectAuthParams, };
|
|
122
|
+
export { Auctions as Auctions, type AuctionListAuctionsResponse as AuctionListAuctionsResponse, type AuctionListAuctionBidsParams as AuctionListAuctionBidsParams, };
|
|
123
|
+
export { Users as Users, type UserListResponse as UserListResponse, type UserConnectResponse as UserConnectResponse, type UserCountResponse as UserCountResponse, type UserDisconnectResponse as UserDisconnectResponse, type UserListParams as UserListParams, type UserConnectParams as UserConnectParams, type UserCountParams as UserCountParams, type UserDisconnectParams as UserDisconnectParams, };
|
|
124
|
+
export { Loyalty as Loyalty };
|
|
125
|
+
export { Minting as Minting, type MintingGetAssetsResponse as MintingGetAssetsResponse, type MintingGetAssetsParams as MintingGetAssetsParams, };
|
|
126
|
+
export { Referral as Referral, type ReferralCreateCodeResponse as ReferralCreateCodeResponse, type ReferralCreateCodeParams as ReferralCreateCodeParams, };
|
|
127
|
+
export { Websites as Websites, type WebsiteCreateResponse as WebsiteCreateResponse, type WebsiteListResponse as WebsiteListResponse, type WebsiteCreateParams as WebsiteCreateParams, type WebsiteListParams as WebsiteListParams, };
|
|
107
128
|
}
|
|
108
129
|
export { toFile, fileFromPath } from "./uploads.js";
|
|
109
130
|
export { SnagSolutionsError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.js";
|
package/index.d.ts
CHANGED
|
@@ -3,10 +3,17 @@ import * as Core from "./core.js";
|
|
|
3
3
|
import * as Errors from "./error.js";
|
|
4
4
|
import * as Uploads from "./uploads.js";
|
|
5
5
|
import * as API from "./resources/index.js";
|
|
6
|
-
import {
|
|
6
|
+
import { AssetCreateAssetParams, AssetCreateAssetResponse, Assets } from "./resources/assets.js";
|
|
7
|
+
import { AuctionListAuctionBidsParams, AuctionListAuctionsResponse, Auctions } from "./resources/auctions.js";
|
|
8
|
+
import { Auth, AuthConnectAuthParams, AuthConnectAuthResponse } from "./resources/auth.js";
|
|
9
|
+
import { Minting, MintingGetAssetsParams, MintingGetAssetsResponse } from "./resources/minting.js";
|
|
10
|
+
import { Loyalty } from "./resources/loyalty/loyalty.js";
|
|
11
|
+
import { Referral, ReferralCreateCodeParams, ReferralCreateCodeResponse } from "./resources/referral/referral.js";
|
|
12
|
+
import { UserConnectParams, UserConnectResponse, UserCountParams, UserCountResponse, UserDisconnectParams, UserDisconnectResponse, UserListParams, UserListResponse, Users } from "./resources/users/users.js";
|
|
13
|
+
import { WebsiteCreateParams, WebsiteCreateResponse, WebsiteListParams, WebsiteListResponse, Websites } from "./resources/websites/websites.js";
|
|
7
14
|
export interface ClientOptions {
|
|
8
15
|
/**
|
|
9
|
-
*
|
|
16
|
+
* API key required to authenticate with the Snag Solutions API.
|
|
10
17
|
*/
|
|
11
18
|
apiKey?: string | undefined;
|
|
12
19
|
/**
|
|
@@ -68,8 +75,8 @@ export declare class SnagSolutions extends Core.APIClient {
|
|
|
68
75
|
/**
|
|
69
76
|
* API Client for interfacing with the Snag Solutions API.
|
|
70
77
|
*
|
|
71
|
-
* @param {string | undefined} [opts.apiKey=process.env['
|
|
72
|
-
* @param {string} [opts.baseURL=process.env['SNAG_SOLUTIONS_BASE_URL'] ?? https://
|
|
78
|
+
* @param {string | undefined} [opts.apiKey=process.env['X_API_KEY'] ?? undefined]
|
|
79
|
+
* @param {string} [opts.baseURL=process.env['SNAG_SOLUTIONS_BASE_URL'] ?? https://admin.snagsolutions.io/] - Override the default base URL for the API.
|
|
73
80
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
74
81
|
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
75
82
|
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
@@ -78,7 +85,14 @@ export declare class SnagSolutions extends Core.APIClient {
|
|
|
78
85
|
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
79
86
|
*/
|
|
80
87
|
constructor({ baseURL, apiKey, ...opts }?: ClientOptions);
|
|
81
|
-
|
|
88
|
+
assets: API.Assets;
|
|
89
|
+
auth: API.Auth;
|
|
90
|
+
auctions: API.Auctions;
|
|
91
|
+
users: API.Users;
|
|
92
|
+
loyalty: API.Loyalty;
|
|
93
|
+
minting: API.Minting;
|
|
94
|
+
referral: API.Referral;
|
|
95
|
+
websites: API.Websites;
|
|
82
96
|
protected defaultQuery(): Core.DefaultQuery | undefined;
|
|
83
97
|
protected defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
84
98
|
protected authHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
@@ -103,7 +117,14 @@ export declare class SnagSolutions extends Core.APIClient {
|
|
|
103
117
|
}
|
|
104
118
|
export declare namespace SnagSolutions {
|
|
105
119
|
export type RequestOptions = Core.RequestOptions;
|
|
106
|
-
export {
|
|
120
|
+
export { Assets as Assets, type AssetCreateAssetResponse as AssetCreateAssetResponse, type AssetCreateAssetParams as AssetCreateAssetParams, };
|
|
121
|
+
export { Auth as Auth, type AuthConnectAuthResponse as AuthConnectAuthResponse, type AuthConnectAuthParams as AuthConnectAuthParams, };
|
|
122
|
+
export { Auctions as Auctions, type AuctionListAuctionsResponse as AuctionListAuctionsResponse, type AuctionListAuctionBidsParams as AuctionListAuctionBidsParams, };
|
|
123
|
+
export { Users as Users, type UserListResponse as UserListResponse, type UserConnectResponse as UserConnectResponse, type UserCountResponse as UserCountResponse, type UserDisconnectResponse as UserDisconnectResponse, type UserListParams as UserListParams, type UserConnectParams as UserConnectParams, type UserCountParams as UserCountParams, type UserDisconnectParams as UserDisconnectParams, };
|
|
124
|
+
export { Loyalty as Loyalty };
|
|
125
|
+
export { Minting as Minting, type MintingGetAssetsResponse as MintingGetAssetsResponse, type MintingGetAssetsParams as MintingGetAssetsParams, };
|
|
126
|
+
export { Referral as Referral, type ReferralCreateCodeResponse as ReferralCreateCodeResponse, type ReferralCreateCodeParams as ReferralCreateCodeParams, };
|
|
127
|
+
export { Websites as Websites, type WebsiteCreateResponse as WebsiteCreateResponse, type WebsiteListResponse as WebsiteListResponse, type WebsiteCreateParams as WebsiteCreateParams, type WebsiteListParams as WebsiteListParams, };
|
|
107
128
|
}
|
|
108
129
|
export { toFile, fileFromPath } from "./uploads.js";
|
|
109
130
|
export { SnagSolutionsError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.js";
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAA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0B,IAAI,0BAA0B,EAC7D,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH;AAED,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EACL,kBAAkB,EAClB,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAEjB,eAAe,aAAa,CAAC"}
|
package/index.js
CHANGED
|
@@ -31,7 +31,14 @@ const Core = __importStar(require("./core.js"));
|
|
|
31
31
|
const Errors = __importStar(require("./error.js"));
|
|
32
32
|
const Uploads = __importStar(require("./uploads.js"));
|
|
33
33
|
const API = __importStar(require("./resources/index.js"));
|
|
34
|
-
const
|
|
34
|
+
const assets_1 = require("./resources/assets.js");
|
|
35
|
+
const auctions_1 = require("./resources/auctions.js");
|
|
36
|
+
const auth_1 = require("./resources/auth.js");
|
|
37
|
+
const minting_1 = require("./resources/minting.js");
|
|
38
|
+
const loyalty_1 = require("./resources/loyalty/loyalty.js");
|
|
39
|
+
const referral_1 = require("./resources/referral/referral.js");
|
|
40
|
+
const users_1 = require("./resources/users/users.js");
|
|
41
|
+
const websites_1 = require("./resources/websites/websites.js");
|
|
35
42
|
/**
|
|
36
43
|
* API Client for interfacing with the Snag Solutions API.
|
|
37
44
|
*/
|
|
@@ -39,8 +46,8 @@ class SnagSolutions extends Core.APIClient {
|
|
|
39
46
|
/**
|
|
40
47
|
* API Client for interfacing with the Snag Solutions API.
|
|
41
48
|
*
|
|
42
|
-
* @param {string | undefined} [opts.apiKey=process.env['
|
|
43
|
-
* @param {string} [opts.baseURL=process.env['SNAG_SOLUTIONS_BASE_URL'] ?? https://
|
|
49
|
+
* @param {string | undefined} [opts.apiKey=process.env['X_API_KEY'] ?? undefined]
|
|
50
|
+
* @param {string} [opts.baseURL=process.env['SNAG_SOLUTIONS_BASE_URL'] ?? https://admin.snagsolutions.io/] - Override the default base URL for the API.
|
|
44
51
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
45
52
|
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
46
53
|
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
@@ -48,14 +55,14 @@ class SnagSolutions extends Core.APIClient {
|
|
|
48
55
|
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
49
56
|
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
50
57
|
*/
|
|
51
|
-
constructor({ baseURL = Core.readEnv('SNAG_SOLUTIONS_BASE_URL'), apiKey = Core.readEnv('
|
|
58
|
+
constructor({ baseURL = Core.readEnv('SNAG_SOLUTIONS_BASE_URL'), apiKey = Core.readEnv('X_API_KEY'), ...opts } = {}) {
|
|
52
59
|
if (apiKey === undefined) {
|
|
53
|
-
throw new Errors.SnagSolutionsError("The
|
|
60
|
+
throw new Errors.SnagSolutionsError("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' }).");
|
|
54
61
|
}
|
|
55
62
|
const options = {
|
|
56
63
|
apiKey,
|
|
57
64
|
...opts,
|
|
58
|
-
baseURL: baseURL || `https://
|
|
65
|
+
baseURL: baseURL || `https://admin.snagsolutions.io/`,
|
|
59
66
|
};
|
|
60
67
|
super({
|
|
61
68
|
baseURL: options.baseURL,
|
|
@@ -64,7 +71,14 @@ class SnagSolutions extends Core.APIClient {
|
|
|
64
71
|
maxRetries: options.maxRetries,
|
|
65
72
|
fetch: options.fetch,
|
|
66
73
|
});
|
|
67
|
-
this.
|
|
74
|
+
this.assets = new API.Assets(this);
|
|
75
|
+
this.auth = new API.Auth(this);
|
|
76
|
+
this.auctions = new API.Auctions(this);
|
|
77
|
+
this.users = new API.Users(this);
|
|
78
|
+
this.loyalty = new API.Loyalty(this);
|
|
79
|
+
this.minting = new API.Minting(this);
|
|
80
|
+
this.referral = new API.Referral(this);
|
|
81
|
+
this.websites = new API.Websites(this);
|
|
68
82
|
this._options = options;
|
|
69
83
|
this.apiKey = apiKey;
|
|
70
84
|
}
|
|
@@ -103,7 +117,14 @@ SnagSolutions.PermissionDeniedError = Errors.PermissionDeniedError;
|
|
|
103
117
|
SnagSolutions.UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
104
118
|
SnagSolutions.toFile = Uploads.toFile;
|
|
105
119
|
SnagSolutions.fileFromPath = Uploads.fileFromPath;
|
|
106
|
-
SnagSolutions.
|
|
120
|
+
SnagSolutions.Assets = assets_1.Assets;
|
|
121
|
+
SnagSolutions.Auth = auth_1.Auth;
|
|
122
|
+
SnagSolutions.Auctions = auctions_1.Auctions;
|
|
123
|
+
SnagSolutions.Users = users_1.Users;
|
|
124
|
+
SnagSolutions.Loyalty = loyalty_1.Loyalty;
|
|
125
|
+
SnagSolutions.Minting = minting_1.Minting;
|
|
126
|
+
SnagSolutions.Referral = referral_1.Referral;
|
|
127
|
+
SnagSolutions.Websites = websites_1.Websites;
|
|
107
128
|
var uploads_1 = require("./uploads.js");
|
|
108
129
|
Object.defineProperty(exports, "toFile", { enumerable: true, get: function () { return uploads_1.toFile; } });
|
|
109
130
|
Object.defineProperty(exports, "fileFromPath", { enumerable: true, get: function () { return uploads_1.fileFromPath; } });
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";AAAA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B,OAAA;AACnB,4GAAA,mBAAmB,OAAA;AACnB,8GAAA,qBAAqB,OAAA;AACrB,iHAAA,wBAAwB,OAAA;AAG1B,kBAAe,aAAa,CAAC"}
|
package/index.mjs
CHANGED
|
@@ -5,7 +5,14 @@ import * as Core from "./core.mjs";
|
|
|
5
5
|
import * as Errors from "./error.mjs";
|
|
6
6
|
import * as Uploads from "./uploads.mjs";
|
|
7
7
|
import * as API from "./resources/index.mjs";
|
|
8
|
-
import {
|
|
8
|
+
import { Assets } from "./resources/assets.mjs";
|
|
9
|
+
import { Auctions } from "./resources/auctions.mjs";
|
|
10
|
+
import { Auth } from "./resources/auth.mjs";
|
|
11
|
+
import { Minting } from "./resources/minting.mjs";
|
|
12
|
+
import { Loyalty } from "./resources/loyalty/loyalty.mjs";
|
|
13
|
+
import { Referral, } from "./resources/referral/referral.mjs";
|
|
14
|
+
import { Users, } from "./resources/users/users.mjs";
|
|
15
|
+
import { Websites, } from "./resources/websites/websites.mjs";
|
|
9
16
|
/**
|
|
10
17
|
* API Client for interfacing with the Snag Solutions API.
|
|
11
18
|
*/
|
|
@@ -13,8 +20,8 @@ export class SnagSolutions extends Core.APIClient {
|
|
|
13
20
|
/**
|
|
14
21
|
* API Client for interfacing with the Snag Solutions API.
|
|
15
22
|
*
|
|
16
|
-
* @param {string | undefined} [opts.apiKey=process.env['
|
|
17
|
-
* @param {string} [opts.baseURL=process.env['SNAG_SOLUTIONS_BASE_URL'] ?? https://
|
|
23
|
+
* @param {string | undefined} [opts.apiKey=process.env['X_API_KEY'] ?? undefined]
|
|
24
|
+
* @param {string} [opts.baseURL=process.env['SNAG_SOLUTIONS_BASE_URL'] ?? https://admin.snagsolutions.io/] - Override the default base URL for the API.
|
|
18
25
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
19
26
|
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
20
27
|
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
@@ -22,14 +29,14 @@ export class SnagSolutions extends Core.APIClient {
|
|
|
22
29
|
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
23
30
|
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
24
31
|
*/
|
|
25
|
-
constructor({ baseURL = Core.readEnv('SNAG_SOLUTIONS_BASE_URL'), apiKey = Core.readEnv('
|
|
32
|
+
constructor({ baseURL = Core.readEnv('SNAG_SOLUTIONS_BASE_URL'), apiKey = Core.readEnv('X_API_KEY'), ...opts } = {}) {
|
|
26
33
|
if (apiKey === undefined) {
|
|
27
|
-
throw new Errors.SnagSolutionsError("The
|
|
34
|
+
throw new Errors.SnagSolutionsError("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' }).");
|
|
28
35
|
}
|
|
29
36
|
const options = {
|
|
30
37
|
apiKey,
|
|
31
38
|
...opts,
|
|
32
|
-
baseURL: baseURL || `https://
|
|
39
|
+
baseURL: baseURL || `https://admin.snagsolutions.io/`,
|
|
33
40
|
};
|
|
34
41
|
super({
|
|
35
42
|
baseURL: options.baseURL,
|
|
@@ -38,7 +45,14 @@ export class SnagSolutions extends Core.APIClient {
|
|
|
38
45
|
maxRetries: options.maxRetries,
|
|
39
46
|
fetch: options.fetch,
|
|
40
47
|
});
|
|
41
|
-
this.
|
|
48
|
+
this.assets = new API.Assets(this);
|
|
49
|
+
this.auth = new API.Auth(this);
|
|
50
|
+
this.auctions = new API.Auctions(this);
|
|
51
|
+
this.users = new API.Users(this);
|
|
52
|
+
this.loyalty = new API.Loyalty(this);
|
|
53
|
+
this.minting = new API.Minting(this);
|
|
54
|
+
this.referral = new API.Referral(this);
|
|
55
|
+
this.websites = new API.Websites(this);
|
|
42
56
|
this._options = options;
|
|
43
57
|
this.apiKey = apiKey;
|
|
44
58
|
}
|
|
@@ -76,7 +90,14 @@ SnagSolutions.PermissionDeniedError = Errors.PermissionDeniedError;
|
|
|
76
90
|
SnagSolutions.UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
77
91
|
SnagSolutions.toFile = Uploads.toFile;
|
|
78
92
|
SnagSolutions.fileFromPath = Uploads.fileFromPath;
|
|
79
|
-
SnagSolutions.
|
|
93
|
+
SnagSolutions.Assets = Assets;
|
|
94
|
+
SnagSolutions.Auth = Auth;
|
|
95
|
+
SnagSolutions.Auctions = Auctions;
|
|
96
|
+
SnagSolutions.Users = Users;
|
|
97
|
+
SnagSolutions.Loyalty = Loyalty;
|
|
98
|
+
SnagSolutions.Minting = Minting;
|
|
99
|
+
SnagSolutions.Referral = Referral;
|
|
100
|
+
SnagSolutions.Websites = Websites;
|
|
80
101
|
export { toFile, fileFromPath } from "./uploads.mjs";
|
|
81
102
|
export { SnagSolutionsError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.mjs";
|
|
82
103
|
export default SnagSolutions;
|
package/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAG/E,KAAK,EAAE;OACP,KAAK,IAAI;OACT,KAAK,MAAM;OACX,KAAK,OAAO;OACZ,KAAK,GAAG;OACR,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAG/E,KAAK,EAAE;OACP,KAAK,IAAI;OACT,KAAK,MAAM;OACX,KAAK,OAAO;OACZ,KAAK,GAAG;OACR,EAAoD,MAAM,EAAE;OAC5D,EAA6D,QAAQ,EAAE;OACvE,EAAE,IAAI,EAAkD;OACxD,EAAE,OAAO,EAAoD;OAC7D,EAAE,OAAO,EAAE;OACX,EACL,QAAQ,G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BAAqB,CAAC;AACrD,sCAAwB,GAAG,MAAM,CAAC,wBAAwB,CAAC;AAE3D,oBAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AACxB,0BAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AAG7C,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC;AAC9B,aAAa,CAAC,IAAI,GAAG,IAAI,CAAC;AAC1B,aAAa,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAClC,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC;AAC5B,aAAa,CAAC,OAAO,GAAG,OAAO,CAAC;AAChC,aAAa,CAAC,OAAO,GAAG,OAAO,CAAC;AAChC,aAAa,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAClC,aAAa,CAAC,QAAQ,GAAG,QAAQ,CAAC;OAyD3B,EAAE,MAAM,EAAE,YAAY,EAAE;OACxB,EACL,kBAAkB,EAClB,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB;AAED,eAAe,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { APIResource } from "../resource.js";
|
|
2
|
+
import * as Core from "../core.js";
|
|
3
|
+
export declare class Assets extends APIResource {
|
|
4
|
+
/**
|
|
5
|
+
* This endpoint enables you to upload a file to the resource. Returns a presigned
|
|
6
|
+
* URL and the asset's public URL. Call PUT with the file as the body to upload the
|
|
7
|
+
* asset using the presigned URL.
|
|
8
|
+
*/
|
|
9
|
+
createAsset(body: AssetCreateAssetParams, options?: Core.RequestOptions): Core.APIPromise<AssetCreateAssetResponse>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Response returned upon successful generation of the signed URL for uploading the
|
|
13
|
+
* file.
|
|
14
|
+
*/
|
|
15
|
+
export interface AssetCreateAssetResponse {
|
|
16
|
+
/**
|
|
17
|
+
* The pre-signed URL to be used for uploading the file.
|
|
18
|
+
*/
|
|
19
|
+
signedUrl: string;
|
|
20
|
+
/**
|
|
21
|
+
* The URL of the uploaded file.
|
|
22
|
+
*/
|
|
23
|
+
url: string;
|
|
24
|
+
}
|
|
25
|
+
export interface AssetCreateAssetParams {
|
|
26
|
+
/**
|
|
27
|
+
* The name of the file, must match the regex pattern (converted to lowercase)
|
|
28
|
+
*/
|
|
29
|
+
fileName: string;
|
|
30
|
+
/**
|
|
31
|
+
* The file path, must be a valid enum value.
|
|
32
|
+
*/
|
|
33
|
+
filePath?: 'announcements' | 'images' | 'videos' | 'banners' | 'fonts' | 'posts' | 'profiles' | 'minting' | 'loyalty';
|
|
34
|
+
/**
|
|
35
|
+
* UUID of the organization (optional, converted to lowercase)
|
|
36
|
+
*/
|
|
37
|
+
organizationId?: string;
|
|
38
|
+
/**
|
|
39
|
+
* UUID of the user (optional, converted to lowercase)
|
|
40
|
+
*/
|
|
41
|
+
userId?: string;
|
|
42
|
+
/**
|
|
43
|
+
* UUID of the website (optional, converted to lowercase)
|
|
44
|
+
*/
|
|
45
|
+
websiteId?: string;
|
|
46
|
+
}
|
|
47
|
+
export declare namespace Assets {
|
|
48
|
+
export { type AssetCreateAssetResponse as AssetCreateAssetResponse, type AssetCreateAssetParams as AssetCreateAssetParams, };
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=assets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../src/resources/assets.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;OAIG;IACH,WAAW,CACT,IAAI,EAAE,sBAAsB,EAC5B,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,wBAAwB,CAAC;CAG7C;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,EACL,eAAe,GACf,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,OAAO,GACP,OAAO,GACP,UAAU,GACV,SAAS,GACT,SAAS,CAAC;IAEd;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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.Assets = void 0;
|
|
5
|
+
const resource_1 = require("../resource.js");
|
|
6
|
+
class Assets extends resource_1.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(body, options) {
|
|
13
|
+
return this._client.post('/api/assets', { body, ...options });
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.Assets = Assets;
|
|
17
|
+
//# sourceMappingURL=assets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.js","sourceRoot":"","sources":["../src/resources/assets.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAG1C,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;;OAIG;IACH,WAAW,CACT,IAA4B,EAC5B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;CACF;AAZD,wBAYC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../resource.mjs";
|
|
3
|
+
export class Assets extends APIResource {
|
|
4
|
+
/**
|
|
5
|
+
* This endpoint enables you to upload a file to the resource. Returns a presigned
|
|
6
|
+
* URL and the asset's public URL. Call PUT with the file as the body to upload the
|
|
7
|
+
* asset using the presigned URL.
|
|
8
|
+
*/
|
|
9
|
+
createAsset(body, options) {
|
|
10
|
+
return this._client.post('/api/assets', { body, ...options });
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=assets.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.mjs","sourceRoot":"","sources":["../src/resources/assets.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;;OAIG;IACH,WAAW,CACT,IAA4B,EAC5B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;CACF"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { APIResource } from "../resource.js";
|
|
2
|
+
import * as Core from "../core.js";
|
|
3
|
+
export declare class Auctions extends APIResource {
|
|
4
|
+
/**
|
|
5
|
+
* Returns a list of auction bids with optional filtering and pagination.
|
|
6
|
+
*/
|
|
7
|
+
listAuctionBids(query?: AuctionListAuctionBidsParams, options?: Core.RequestOptions): Core.APIPromise<void>;
|
|
8
|
+
listAuctionBids(options?: Core.RequestOptions): Core.APIPromise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Returns a list of auctions with optional filtering and pagination.
|
|
11
|
+
*/
|
|
12
|
+
listAuctions(options?: Core.RequestOptions): Core.APIPromise<AuctionListAuctionsResponse>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Schema for the response when fetching auctions
|
|
16
|
+
*/
|
|
17
|
+
export interface AuctionListAuctionsResponse {
|
|
18
|
+
data: Array<AuctionListAuctionsResponse.Data>;
|
|
19
|
+
hasNextPage: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare namespace AuctionListAuctionsResponse {
|
|
22
|
+
interface Data {
|
|
23
|
+
id: string;
|
|
24
|
+
auctionBids: Array<Data.AuctionBid>;
|
|
25
|
+
auctionItems: Array<Data.AuctionItem>;
|
|
26
|
+
biddersOwnCollectionAddresses: Array<string>;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
currencyAddress: string | null;
|
|
29
|
+
currencyDecimals: number;
|
|
30
|
+
deletedAt: string | null;
|
|
31
|
+
description: string;
|
|
32
|
+
endsAt: string;
|
|
33
|
+
extendedDurationInSeconds: number | null;
|
|
34
|
+
hideBids: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Schema representing a loyalty currency
|
|
37
|
+
*/
|
|
38
|
+
loyaltyCurrency: Data.LoyaltyCurrency | null;
|
|
39
|
+
loyaltyCurrencyId: string | null;
|
|
40
|
+
minBidAmount: string;
|
|
41
|
+
minBidIncrement: string | null;
|
|
42
|
+
mintingContractId: string;
|
|
43
|
+
name: string;
|
|
44
|
+
network: 'ethereum' | 'zksync';
|
|
45
|
+
organizationId: string;
|
|
46
|
+
reservePrice: string | null;
|
|
47
|
+
signature: string;
|
|
48
|
+
startsAt: string;
|
|
49
|
+
status: 'in_progress' | 'completed' | 'cancelled';
|
|
50
|
+
type: 'first_price' | 'second_price' | 'english';
|
|
51
|
+
updatedAt: string;
|
|
52
|
+
userId: string;
|
|
53
|
+
websiteId: string;
|
|
54
|
+
}
|
|
55
|
+
namespace Data {
|
|
56
|
+
/**
|
|
57
|
+
* Schema representing an auction bid
|
|
58
|
+
*/
|
|
59
|
+
interface AuctionBid {
|
|
60
|
+
id: string;
|
|
61
|
+
amount: string;
|
|
62
|
+
createdAt: string;
|
|
63
|
+
}
|
|
64
|
+
interface AuctionItem {
|
|
65
|
+
id: string;
|
|
66
|
+
/**
|
|
67
|
+
* Schema representing a minting contract asset
|
|
68
|
+
*/
|
|
69
|
+
mintingContractAsset: AuctionItem.MintingContractAsset;
|
|
70
|
+
quantity: number;
|
|
71
|
+
sortId: number;
|
|
72
|
+
}
|
|
73
|
+
namespace AuctionItem {
|
|
74
|
+
/**
|
|
75
|
+
* Schema representing a minting contract asset
|
|
76
|
+
*/
|
|
77
|
+
interface MintingContractAsset {
|
|
78
|
+
id: string;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Schema representing a loyalty currency
|
|
83
|
+
*/
|
|
84
|
+
interface LoyaltyCurrency {
|
|
85
|
+
id: string;
|
|
86
|
+
decimals: number;
|
|
87
|
+
imageUrl: string | null;
|
|
88
|
+
name: string;
|
|
89
|
+
symbol: string;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
export interface AuctionListAuctionBidsParams {
|
|
94
|
+
/**
|
|
95
|
+
* The bid ID
|
|
96
|
+
*/
|
|
97
|
+
id?: string;
|
|
98
|
+
/**
|
|
99
|
+
* ID of the auction
|
|
100
|
+
*/
|
|
101
|
+
auctionId?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Maximum number of bids to return
|
|
104
|
+
*/
|
|
105
|
+
limit?: number;
|
|
106
|
+
/**
|
|
107
|
+
* ID of the organization
|
|
108
|
+
*/
|
|
109
|
+
organizationId?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Pagination cursor to start after a specific bid ID
|
|
112
|
+
*/
|
|
113
|
+
startingAfter?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Status of the bid
|
|
116
|
+
*/
|
|
117
|
+
status?: 'submitted' | 'accepted' | 'rejected' | 'fulfilled';
|
|
118
|
+
/**
|
|
119
|
+
* ID of the user who made the bid
|
|
120
|
+
*/
|
|
121
|
+
userId?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Wallet address of the bidder
|
|
124
|
+
*/
|
|
125
|
+
walletAddress?: string;
|
|
126
|
+
/**
|
|
127
|
+
* ID of the website
|
|
128
|
+
*/
|
|
129
|
+
websiteId?: string;
|
|
130
|
+
}
|
|
131
|
+
export declare namespace Auctions {
|
|
132
|
+
export { type AuctionListAuctionsResponse as AuctionListAuctionsResponse, type AuctionListAuctionBidsParams as AuctionListAuctionBidsParams, };
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=auctions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auctions.d.ts","sourceRoot":"","sources":["../src/resources/auctions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,qBAAa,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,eAAe,CAAC,KAAK,CAAC,EAAE,4BAA4B,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;IAC3G,eAAe,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;IAerE;;OAEG;IACH,YAAY,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,2BAA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AAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,4BAA4B,IAAI,4BAA4B,GAClE,CAAC;CACH"}
|
|
@@ -0,0 +1,26 @@
|
|
|
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.Auctions = void 0;
|
|
5
|
+
const resource_1 = require("../resource.js");
|
|
6
|
+
const core_1 = require("../core.js");
|
|
7
|
+
class Auctions extends resource_1.APIResource {
|
|
8
|
+
listAuctionBids(query = {}, options) {
|
|
9
|
+
if ((0, core_1.isRequestOptions)(query)) {
|
|
10
|
+
return this.listAuctionBids({}, query);
|
|
11
|
+
}
|
|
12
|
+
return this._client.get('/api/auction_bids', {
|
|
13
|
+
query,
|
|
14
|
+
...options,
|
|
15
|
+
headers: { Accept: '*/*', ...options?.headers },
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Returns a list of auctions with optional filtering and pagination.
|
|
20
|
+
*/
|
|
21
|
+
listAuctions(options) {
|
|
22
|
+
return this._client.get('/api/auctions', options);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.Auctions = Auctions;
|
|
26
|
+
//# sourceMappingURL=auctions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auctions.js","sourceRoot":"","sources":["../src/resources/auctions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAC1C,qCAA2C;AAG3C,MAAa,QAAS,SAAQ,sBAAW;IAMvC,eAAe,CACb,QAA4D,EAAE,EAC9D,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,eAAe,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SACxC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE;YAC3C,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,YAAY,CAAC,OAA6B;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;CACF;AA1BD,4BA0BC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../resource.mjs";
|
|
3
|
+
import { isRequestOptions } from "../core.mjs";
|
|
4
|
+
export class Auctions extends APIResource {
|
|
5
|
+
listAuctionBids(query = {}, options) {
|
|
6
|
+
if (isRequestOptions(query)) {
|
|
7
|
+
return this.listAuctionBids({}, query);
|
|
8
|
+
}
|
|
9
|
+
return this._client.get('/api/auction_bids', {
|
|
10
|
+
query,
|
|
11
|
+
...options,
|
|
12
|
+
headers: { Accept: '*/*', ...options?.headers },
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Returns a list of auctions with optional filtering and pagination.
|
|
17
|
+
*/
|
|
18
|
+
listAuctions(options) {
|
|
19
|
+
return this._client.get('/api/auctions', options);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=auctions.mjs.map
|