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