@snagsolutions/sdk 0.1.0-alpha.23 → 0.1.0-alpha.231
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 +13 -254
- package/LICENSE +1 -1
- package/README.md +15 -23
- package/core.d.ts +19 -5
- package/core.d.ts.map +1 -1
- package/core.js +29 -17
- package/core.js.map +1 -1
- package/core.mjs +29 -17
- package/core.mjs.map +1 -1
- package/index.d.mts +14 -8
- package/index.d.ts +14 -8
- package/index.d.ts.map +1 -1
- package/index.js +12 -5
- package/index.js.map +1 -1
- package/index.mjs +13 -6
- 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 +368 -0
- package/resources/auctions/auctions.d.ts.map +1 -0
- package/resources/auctions/auctions.js +72 -0
- package/resources/auctions/auctions.js.map +1 -0
- package/resources/auctions/auctions.mjs +45 -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 +126 -0
- package/resources/auctions/website-user-attributes/values.d.ts.map +1 -0
- package/resources/auctions/website-user-attributes/values.js +49 -0
- package/resources/auctions/website-user-attributes/values.js.map +1 -0
- package/resources/auctions/website-user-attributes/values.mjs +45 -0
- package/resources/auctions/website-user-attributes/values.mjs.map +1 -0
- package/resources/auctions/website-user-attributes/website-user-attributes.d.ts +136 -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 +76 -0
- package/resources/auctions/website-user-attributes/website-user-attributes.js.map +1 -0
- package/resources/auctions/website-user-attributes/website-user-attributes.mjs +49 -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 +66 -6
- package/resources/auth.d.ts.map +1 -1
- package/resources/auth.js +6 -0
- package/resources/auth.js.map +1 -1
- package/resources/auth.mjs +6 -0
- package/resources/auth.mjs.map +1 -1
- package/resources/index.d.ts +5 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +4 -3
- package/resources/index.mjs.map +1 -1
- package/resources/loyalty/account-streaks.d.ts +96 -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 +60 -16
- package/resources/loyalty/accounts.d.ts.map +1 -1
- package/resources/loyalty/accounts.js +14 -0
- package/resources/loyalty/accounts.js.map +1 -1
- package/resources/loyalty/accounts.mjs +14 -0
- package/resources/loyalty/accounts.mjs.map +1 -1
- package/resources/loyalty/badges.d.ts +666 -135
- 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 +3 -3
- package/resources/loyalty/index.d.ts.map +1 -1
- package/resources/loyalty/index.js +5 -5
- package/resources/loyalty/index.js.map +1 -1
- package/resources/loyalty/index.mjs +2 -2
- package/resources/loyalty/index.mjs.map +1 -1
- package/resources/loyalty/loyalty.d.ts +9 -9
- package/resources/loyalty/loyalty.d.ts.map +1 -1
- package/resources/loyalty/loyalty.js +6 -6
- package/resources/loyalty/loyalty.js.map +1 -1
- package/resources/loyalty/loyalty.mjs +6 -6
- 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 +55 -4
- 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 +60 -6
- package/resources/loyalty/questions.d.ts.map +1 -1
- package/resources/loyalty/questions.js +39 -0
- package/resources/loyalty/questions.js.map +1 -1
- package/resources/loyalty/questions.mjs +39 -0
- package/resources/loyalty/questions.mjs.map +1 -1
- package/resources/loyalty/rule-edits.d.ts +2842 -8
- 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 +279 -56
- package/resources/loyalty/rule-groups.d.ts.map +1 -1
- package/resources/loyalty/rule-groups.js +18 -0
- package/resources/loyalty/rule-groups.js.map +1 -1
- package/resources/loyalty/rule-groups.mjs +18 -0
- package/resources/loyalty/rule-groups.mjs.map +1 -1
- package/resources/loyalty/rules.d.ts +2299 -365
- 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 +4 -0
- package/resources/loyalty/transactions/index.d.ts.map +1 -0
- package/resources/loyalty/transactions/index.js +11 -0
- package/resources/loyalty/transactions/index.js.map +1 -0
- package/resources/loyalty/transactions/index.mjs +5 -0
- package/resources/loyalty/transactions/index.mjs.map +1 -0
- package/resources/loyalty/transactions/posts.d.ts +145 -0
- package/resources/loyalty/transactions/posts.d.ts.map +1 -0
- package/resources/loyalty/transactions/posts.js +32 -0
- package/resources/loyalty/transactions/posts.js.map +1 -0
- package/resources/loyalty/transactions/posts.mjs +28 -0
- package/resources/loyalty/transactions/posts.mjs.map +1 -0
- package/resources/loyalty/transactions/rule-statuses.d.ts +121 -0
- package/resources/loyalty/transactions/rule-statuses.d.ts.map +1 -0
- package/resources/loyalty/transactions/rule-statuses.js +30 -0
- package/resources/loyalty/transactions/rule-statuses.js.map +1 -0
- package/resources/loyalty/transactions/rule-statuses.mjs +26 -0
- package/resources/loyalty/transactions/rule-statuses.mjs.map +1 -0
- package/resources/loyalty/transactions/transactions.d.ts +564 -0
- package/resources/loyalty/transactions/transactions.d.ts.map +1 -0
- package/resources/loyalty/transactions/transactions.js +110 -0
- package/resources/loyalty/transactions/transactions.js.map +1 -0
- package/resources/loyalty/transactions/transactions.mjs +83 -0
- package/resources/loyalty/transactions/transactions.mjs.map +1 -0
- package/resources/loyalty/transactions.d.ts +1 -248
- 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/allowlist.d.ts +84 -0
- package/resources/minting/allowlist.d.ts.map +1 -0
- package/resources/minting/allowlist.js +42 -0
- package/resources/minting/allowlist.js.map +1 -0
- package/resources/minting/allowlist.mjs +38 -0
- package/resources/minting/allowlist.mjs.map +1 -0
- package/resources/minting/contracts.d.ts +165 -0
- package/resources/minting/contracts.d.ts.map +1 -0
- package/resources/minting/contracts.js +30 -0
- package/resources/minting/contracts.js.map +1 -0
- package/resources/minting/contracts.mjs +26 -0
- package/resources/minting/contracts.mjs.map +1 -0
- package/resources/minting/index.d.ts +5 -0
- package/resources/minting/index.d.ts.map +1 -0
- package/resources/minting/index.js +13 -0
- package/resources/minting/index.js.map +1 -0
- package/resources/minting/index.mjs +6 -0
- package/resources/minting/index.mjs.map +1 -0
- package/resources/minting/minting.d.ts +142 -0
- package/resources/minting/minting.d.ts.map +1 -0
- package/resources/minting/minting.js +79 -0
- package/resources/minting/minting.js.map +1 -0
- package/resources/minting/minting.mjs +52 -0
- package/resources/minting/minting.mjs.map +1 -0
- package/resources/minting/status.d.ts +44 -0
- package/resources/minting/status.d.ts.map +1 -0
- package/resources/minting/status.js +33 -0
- package/resources/minting/status.js.map +1 -0
- package/resources/minting/status.mjs +29 -0
- package/resources/minting/status.mjs.map +1 -0
- package/resources/minting.d.ts +1 -94
- package/resources/minting.d.ts.map +1 -1
- package/resources/minting.js +15 -11
- package/resources/minting.js.map +1 -1
- package/resources/minting.mjs +1 -9
- package/resources/minting.mjs.map +1 -1
- package/resources/referral/referral.d.ts +12 -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 +30 -3
- package/resources/referral/users.d.ts.map +1 -1
- package/resources/referral/users.js +12 -4
- package/resources/referral/users.js.map +1 -1
- package/resources/referral/users.mjs +12 -4
- package/resources/referral/users.mjs.map +1 -1
- package/resources/token-claims.d.ts +160 -0
- package/resources/token-claims.d.ts.map +1 -0
- package/resources/token-claims.js +46 -0
- package/resources/token-claims.js.map +1 -0
- package/resources/token-claims.mjs +42 -0
- package/resources/token-claims.mjs.map +1 -0
- 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 +36 -3
- 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 +196 -35
- package/resources/users/users.d.ts.map +1 -1
- package/resources/users/users.js +58 -1
- package/resources/users/users.js.map +1 -1
- package/resources/users/users.mjs +58 -1
- package/resources/users/users.mjs.map +1 -1
- package/resources/websites/website-collections.d.ts +22 -1
- package/resources/websites/website-collections.d.ts.map +1 -1
- package/resources/websites/website-collections.js +21 -0
- package/resources/websites/website-collections.js.map +1 -1
- package/resources/websites/website-collections.mjs +21 -0
- package/resources/websites/website-collections.mjs.map +1 -1
- package/resources/websites/website-user-roles.d.ts +24 -1
- 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 +118 -0
- package/resources/websites/websites.d.ts.map +1 -1
- package/resources/websites/websites.js +7 -0
- package/resources/websites/websites.js.map +1 -1
- package/resources/websites/websites.mjs +7 -0
- package/resources/websites/websites.mjs.map +1 -1
- package/src/core.ts +45 -16
- package/src/index.ts +82 -4
- package/src/resource.ts +1 -1
- package/src/resources/assets.ts +18 -3
- package/src/resources/auctions/auctions.ts +561 -0
- package/src/resources/auctions/index.ts +19 -0
- package/src/resources/auctions/website-user-attributes/index.ts +18 -0
- package/src/resources/auctions/website-user-attributes/values.ts +170 -0
- package/src/resources/auctions/website-user-attributes/website-user-attributes.ts +212 -0
- package/src/resources/auctions/website-user-attributes.ts +3 -0
- package/src/resources/auctions.ts +1 -207
- package/src/resources/auth.ts +121 -6
- package/src/resources/index.ts +41 -3
- package/src/resources/loyalty/account-streaks.ts +128 -0
- package/src/resources/loyalty/accounts.ts +65 -18
- package/src/resources/loyalty/badges.ts +790 -146
- package/src/resources/loyalty/currencies.ts +19 -0
- package/src/resources/loyalty/index.ts +13 -2
- package/src/resources/loyalty/loyalty.ts +30 -12
- package/src/resources/loyalty/multipliers.ts +43 -4
- package/src/resources/loyalty/questions-responses.ts +64 -4
- package/src/resources/loyalty/questions.ts +64 -6
- package/src/resources/loyalty/rule-edits.ts +4118 -100
- package/src/resources/loyalty/rule-groups.ts +454 -64
- package/src/resources/loyalty/rules.ts +3499 -372
- package/src/resources/loyalty/transactions/index.ts +29 -0
- package/src/resources/loyalty/transactions/posts.ts +221 -0
- package/src/resources/loyalty/transactions/rule-statuses.ts +179 -0
- package/src/resources/loyalty/transactions/transactions.ts +914 -0
- package/src/resources/loyalty/transactions.ts +1 -440
- package/src/resources/minting/allowlist.ts +116 -0
- package/src/resources/minting/contracts.ts +408 -0
- package/src/resources/minting/index.ts +29 -0
- package/src/resources/minting/minting.ts +277 -0
- package/src/resources/minting/status.ts +70 -0
- package/src/resources/minting.ts +1 -157
- package/src/resources/referral/referral.ts +15 -11
- package/src/resources/referral/users.ts +45 -5
- package/src/resources/token-claims.ts +307 -0
- package/src/resources/users/index.ts +4 -0
- package/src/resources/users/metadatas.ts +61 -3
- package/src/resources/users/users.ts +264 -38
- package/src/resources/websites/website-collections.ts +41 -1
- package/src/resources/websites/website-user-roles.ts +26 -1
- package/src/resources/websites/websites.ts +142 -0
- 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
- package/resources/loyalty/rule-chains.d.ts +0 -34
- package/resources/loyalty/rule-chains.d.ts.map +0 -1
- package/resources/loyalty/rule-chains.js +0 -15
- package/resources/loyalty/rule-chains.js.map +0 -1
- package/resources/loyalty/rule-chains.mjs +0 -11
- package/resources/loyalty/rule-chains.mjs.map +0 -1
- package/src/resources/loyalty/rule-chains.ts +0 -45
|
@@ -3,6 +3,19 @@ import { APIResource } from "../../resource.mjs";
|
|
|
3
3
|
export class WebsiteCollections extends APIResource {
|
|
4
4
|
/**
|
|
5
5
|
* Creates a new collection under a website
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* await client.websites.websiteCollections.create({
|
|
10
|
+
* collectionAddress:
|
|
11
|
+
* '0x2c02efDd09B3BA1AEaDd3dCAa7aC7A37C1CBDA8A',
|
|
12
|
+
* name: 'x',
|
|
13
|
+
* network: 'abstract',
|
|
14
|
+
* organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
15
|
+
* sortId: 99999,
|
|
16
|
+
* websiteId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
6
19
|
*/
|
|
7
20
|
create(body, options) {
|
|
8
21
|
return this._client.post('/api/website_collections', {
|
|
@@ -13,6 +26,14 @@ export class WebsiteCollections extends APIResource {
|
|
|
13
26
|
}
|
|
14
27
|
/**
|
|
15
28
|
* Retrieves collections for a specific website.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const websiteCollections =
|
|
33
|
+
* await client.websites.websiteCollections.list({
|
|
34
|
+
* websiteId: '123e4567-e89b-12d3-a456-426614174000',
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
16
37
|
*/
|
|
17
38
|
list(query, options) {
|
|
18
39
|
return this._client.get('/api/website_collections', { query, ...options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"website-collections.mjs","sourceRoot":"","sources":["../../src/resources/websites/website-collections.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,kBAAmB,SAAQ,WAAW;IACjD
|
|
1
|
+
{"version":3,"file":"website-collections.mjs","sourceRoot":"","sources":["../../src/resources/websites/website-collections.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,kBAAmB,SAAQ,WAAW;IACjD;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,IAAmC,EAAE,OAA6B;QACvE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE;YACnD,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,KAAkC,EAClC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;CACF"}
|
|
@@ -4,10 +4,33 @@ export declare class WebsiteUserRoles extends APIResource {
|
|
|
4
4
|
/**
|
|
5
5
|
* Retrieves roles of users for a specific website. If userId is provided,
|
|
6
6
|
* retrieves the role of that specific user for the website.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const websiteUserRoles =
|
|
11
|
+
* await client.websites.websiteUserRoles.list({
|
|
12
|
+
* websiteId: '123e4567-e89b-12d3-a456-426614174000',
|
|
13
|
+
* });
|
|
14
|
+
* ```
|
|
7
15
|
*/
|
|
8
16
|
list(query: WebsiteUserRoleListParams, options?: Core.RequestOptions): Core.APIPromise<WebsiteUserRoleListResponse>;
|
|
9
17
|
/**
|
|
10
18
|
* Assign roles to users for a specific website
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const response =
|
|
23
|
+
* await client.websites.websiteUserRoles.assign({
|
|
24
|
+
* websiteId: '123e4567-e89b-12d3-a456-426614174000',
|
|
25
|
+
* websiteUserRoles: [
|
|
26
|
+
* {
|
|
27
|
+
* roleType: 'WEBSITE_SUPER_ADMIN',
|
|
28
|
+
* walletAddress:
|
|
29
|
+
* '0x1234567890abcdef1234567890abcdef12345678',
|
|
30
|
+
* },
|
|
31
|
+
* ],
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
11
34
|
*/
|
|
12
35
|
assign(body: WebsiteUserRoleAssignParams, options?: Core.RequestOptions): Core.APIPromise<WebsiteUserRoleAssignResponse>;
|
|
13
36
|
}
|
|
@@ -56,7 +79,7 @@ export declare namespace WebsiteUserRoleAssignParams {
|
|
|
56
79
|
/**
|
|
57
80
|
* Role type of the user
|
|
58
81
|
*/
|
|
59
|
-
roleType: 'WEBSITE_SUPER_ADMIN' | 'WEBSITE_ADMIN' | 'WEBSITE_MODERATOR' | 'WEBSITE_API_KEY' | 'STRATUS_API_KEY';
|
|
82
|
+
roleType: 'WEBSITE_SUPER_ADMIN' | 'WEBSITE_ADMIN' | 'WEBSITE_MODERATOR' | 'WEBSITE_API_KEY' | 'STRATUS_API_KEY' | 'WEBSITE_READ_ONLY_API_KEY' | 'ORGANIZATION_API_KEY';
|
|
60
83
|
/**
|
|
61
84
|
* Wallet address of the user
|
|
62
85
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"website-user-roles.d.ts","sourceRoot":"","sources":["../../src/resources/websites/website-user-roles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C
|
|
1
|
+
{"version":3,"file":"website-user-roles.d.ts","sourceRoot":"","sources":["../../src/resources/websites/website-user-roles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C;;;;;;;;;;;OAWG;IACH,IAAI,CACF,KAAK,EAAE,yBAAyB,EAChC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,2BAA2B,CAAC;IAI/C;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CACJ,IAAI,EAAE,2BAA2B,EACjC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,6BAA6B,CAAC;CAGlD;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,KAAK,CAAC,2BAA2B,CAAC,IAAI,CAAC,CAAC;CAC/C;AAED,yBAAiB,2BAA2B,CAAC;IAC3C,UAAiB,IAAI;QACnB;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;KACZ;CACF;AAED;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,gBAAgB,EAAE,KAAK,CAAC,2BAA2B,CAAC,eAAe,CAAC,CAAC;CACtE;AAED,yBAAiB,2BAA2B,CAAC;IAC3C,UAAiB,eAAe;QAC9B;;WAEG;QACH,QAAQ,EACJ,qBAAqB,GACrB,eAAe,GACf,mBAAmB,GACnB,iBAAiB,GACjB,iBAAiB,GACjB,2BAA2B,GAC3B,sBAAsB,CAAC;QAE3B;;WAEG;QACH,aAAa,EAAE,MAAM,CAAC;QAEtB;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;CACF;AAED,MAAM,CAAC,OAAO,WAAW,gBAAgB,CAAC;IACxC,OAAO,EACL,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,2BAA2B,IAAI,2BAA2B,GAChE,CAAC;CACH"}
|
|
@@ -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"}
|
|
@@ -9,11 +9,23 @@ export declare class Websites extends APIResource {
|
|
|
9
9
|
websiteUserRoles: WebsiteUserRolesAPI.WebsiteUserRoles;
|
|
10
10
|
/**
|
|
11
11
|
* Creates a new website
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const website = await client.websites.create({
|
|
16
|
+
* name: 'My New Website',
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
12
19
|
*/
|
|
13
20
|
create(body: WebsiteCreateParams, options?: Core.RequestOptions): Core.APIPromise<WebsiteCreateResponse>;
|
|
14
21
|
/**
|
|
15
22
|
* Returns a list of websites. Includes optional query parameters for filtering and
|
|
16
23
|
* pagination.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const websites = await client.websites.list();
|
|
28
|
+
* ```
|
|
17
29
|
*/
|
|
18
30
|
list(query?: WebsiteListParams, options?: Core.RequestOptions): Core.APIPromise<WebsiteListResponse>;
|
|
19
31
|
list(options?: Core.RequestOptions): Core.APIPromise<WebsiteListResponse>;
|
|
@@ -38,6 +50,10 @@ export interface WebsiteCreateResponse {
|
|
|
38
50
|
* Website name
|
|
39
51
|
*/
|
|
40
52
|
name: string;
|
|
53
|
+
/**
|
|
54
|
+
* Onchain tokens associated with the website
|
|
55
|
+
*/
|
|
56
|
+
onchainTokens: Array<WebsiteCreateResponse.OnchainToken>;
|
|
41
57
|
/**
|
|
42
58
|
* Date when terms were signed
|
|
43
59
|
*/
|
|
@@ -78,6 +94,55 @@ export declare namespace WebsiteCreateResponse {
|
|
|
78
94
|
*/
|
|
79
95
|
royaltyFeeAddress: string;
|
|
80
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Schema representing an onchain token
|
|
99
|
+
*/
|
|
100
|
+
interface OnchainToken {
|
|
101
|
+
/**
|
|
102
|
+
* OnchainToken ID
|
|
103
|
+
*/
|
|
104
|
+
id: string;
|
|
105
|
+
/**
|
|
106
|
+
* Contract address of the onchain token
|
|
107
|
+
*/
|
|
108
|
+
address: string;
|
|
109
|
+
/**
|
|
110
|
+
* Chain ID where the token is deployed
|
|
111
|
+
*/
|
|
112
|
+
chainId: string;
|
|
113
|
+
/**
|
|
114
|
+
* Creation timestamp
|
|
115
|
+
*/
|
|
116
|
+
createdAt: string;
|
|
117
|
+
/**
|
|
118
|
+
* Associated loyalty currency ID
|
|
119
|
+
*/
|
|
120
|
+
currencyId: string;
|
|
121
|
+
/**
|
|
122
|
+
* Deletion timestamp
|
|
123
|
+
*/
|
|
124
|
+
deletedAt: string | null;
|
|
125
|
+
/**
|
|
126
|
+
* Organization ID
|
|
127
|
+
*/
|
|
128
|
+
organizationId: string;
|
|
129
|
+
/**
|
|
130
|
+
* Relayer ID for transaction processing
|
|
131
|
+
*/
|
|
132
|
+
relayerId: string | null;
|
|
133
|
+
/**
|
|
134
|
+
* Last sync timestamp
|
|
135
|
+
*/
|
|
136
|
+
syncedAt: string | null;
|
|
137
|
+
/**
|
|
138
|
+
* Last update timestamp
|
|
139
|
+
*/
|
|
140
|
+
updatedAt: string;
|
|
141
|
+
/**
|
|
142
|
+
* Website ID
|
|
143
|
+
*/
|
|
144
|
+
websiteId: string;
|
|
145
|
+
}
|
|
81
146
|
}
|
|
82
147
|
/**
|
|
83
148
|
* Response schema for fetching websites
|
|
@@ -113,6 +178,10 @@ export declare namespace WebsiteListResponse {
|
|
|
113
178
|
* Website name
|
|
114
179
|
*/
|
|
115
180
|
name: string;
|
|
181
|
+
/**
|
|
182
|
+
* Onchain tokens associated with the website
|
|
183
|
+
*/
|
|
184
|
+
onchainTokens: Array<Data.OnchainToken>;
|
|
116
185
|
/**
|
|
117
186
|
* Date when terms were signed
|
|
118
187
|
*/
|
|
@@ -153,6 +222,55 @@ export declare namespace WebsiteListResponse {
|
|
|
153
222
|
*/
|
|
154
223
|
royaltyFeeAddress: string;
|
|
155
224
|
}
|
|
225
|
+
/**
|
|
226
|
+
* Schema representing an onchain token
|
|
227
|
+
*/
|
|
228
|
+
interface OnchainToken {
|
|
229
|
+
/**
|
|
230
|
+
* OnchainToken ID
|
|
231
|
+
*/
|
|
232
|
+
id: string;
|
|
233
|
+
/**
|
|
234
|
+
* Contract address of the onchain token
|
|
235
|
+
*/
|
|
236
|
+
address: string;
|
|
237
|
+
/**
|
|
238
|
+
* Chain ID where the token is deployed
|
|
239
|
+
*/
|
|
240
|
+
chainId: string;
|
|
241
|
+
/**
|
|
242
|
+
* Creation timestamp
|
|
243
|
+
*/
|
|
244
|
+
createdAt: string;
|
|
245
|
+
/**
|
|
246
|
+
* Associated loyalty currency ID
|
|
247
|
+
*/
|
|
248
|
+
currencyId: string;
|
|
249
|
+
/**
|
|
250
|
+
* Deletion timestamp
|
|
251
|
+
*/
|
|
252
|
+
deletedAt: string | null;
|
|
253
|
+
/**
|
|
254
|
+
* Organization ID
|
|
255
|
+
*/
|
|
256
|
+
organizationId: string;
|
|
257
|
+
/**
|
|
258
|
+
* Relayer ID for transaction processing
|
|
259
|
+
*/
|
|
260
|
+
relayerId: string | null;
|
|
261
|
+
/**
|
|
262
|
+
* Last sync timestamp
|
|
263
|
+
*/
|
|
264
|
+
syncedAt: string | null;
|
|
265
|
+
/**
|
|
266
|
+
* Last update timestamp
|
|
267
|
+
*/
|
|
268
|
+
updatedAt: string;
|
|
269
|
+
/**
|
|
270
|
+
* Website ID
|
|
271
|
+
*/
|
|
272
|
+
websiteId: string;
|
|
273
|
+
}
|
|
156
274
|
}
|
|
157
275
|
}
|
|
158
276
|
export interface WebsiteCreateParams {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"websites.d.ts","sourceRoot":"","sources":["../../src/resources/websites/websites.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,qBAAqB,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,6BAA6B,EAC7B,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,mBAAmB,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC7B,yBAAyB,EACzB,2BAA2B,EAC3B,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAE9B,qBAAa,QAAS,SAAQ,WAAW;IACvC,kBAAkB,EAAE,qBAAqB,CAAC,kBAAkB,CAE1D;IACF,gBAAgB,EAAE,mBAAmB,CAAC,gBAAgB,CAEpD;IAEF
|
|
1
|
+
{"version":3,"file":"websites.d.ts","sourceRoot":"","sources":["../../src/resources/websites/websites.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,qBAAqB,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,6BAA6B,EAC7B,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,mBAAmB,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EA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,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;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,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;IAEF,OAAO,EACL,kBAAkB,IAAI,kBAAkB,EACxC,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,2BAA2B,IAAI,2BAA2B,GAChE,CAAC;IAEF,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"}
|
|
@@ -39,6 +39,13 @@ class Websites extends resource_1.APIResource {
|
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Creates a new website
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const website = await client.websites.create({
|
|
46
|
+
* name: 'My New Website',
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
42
49
|
*/
|
|
43
50
|
create(body, options) {
|
|
44
51
|
return this._client.post('/api/websites', { body, ...options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"websites.js","sourceRoot":"","sources":["../../src/resources/websites/websites.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAE9C,gFAA+D;AAC/D,kEAK+B;AAC/B,6EAA4D;AAC5D,gEAM8B;AAE9B,MAAa,QAAS,SAAQ,sBAAW;IAAzC;;QACE,uBAAkB,GAA6C,IAAI,qBAAqB,CAAC,kBAAkB,CACzG,IAAI,CAAC,OAAO,CACb,CAAC;QACF,qBAAgB,GAAyC,IAAI,mBAAmB,CAAC,gBAAgB,CAC/F,IAAI,CAAC,OAAO,CACb,CAAC;
|
|
1
|
+
{"version":3,"file":"websites.js","sourceRoot":"","sources":["../../src/resources/websites/websites.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAE9C,gFAA+D;AAC/D,kEAK+B;AAC/B,6EAA4D;AAC5D,gEAM8B;AAE9B,MAAa,QAAS,SAAQ,sBAAW;IAAzC;;QACE,uBAAkB,GAA6C,IAAI,qBAAqB,CAAC,kBAAkB,CACzG,IAAI,CAAC,OAAO,CACb,CAAC;QACF,qBAAgB,GAAyC,IAAI,mBAAmB,CAAC,gBAAgB,CAC/F,IAAI,CAAC,OAAO,CACb,CAAC;IAoCJ,CAAC;IAlCC;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAyB,EAAE,OAA6B;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAaD,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;AA1CD,4BA0CC;AAgWD,QAAQ,CAAC,kBAAkB,GAAG,wCAAkB,CAAC;AACjD,QAAQ,CAAC,gBAAgB,GAAG,qCAAgB,CAAC"}
|
|
@@ -13,6 +13,13 @@ export class Websites extends APIResource {
|
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* Creates a new website
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const website = await client.websites.create({
|
|
20
|
+
* name: 'My New Website',
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
16
23
|
*/
|
|
17
24
|
create(body, options) {
|
|
18
25
|
return this._client.post('/api/websites', { body, ...options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"websites.mjs","sourceRoot":"","sources":["../../src/resources/websites/websites.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAEpB,KAAK,qBAAqB;OAC1B,EAIL,kBAAkB,GACnB;OACM,KAAK,mBAAmB;OACxB,EAKL,gBAAgB,GACjB;AAED,MAAM,OAAO,QAAS,SAAQ,WAAW;IAAzC;;QACE,uBAAkB,GAA6C,IAAI,qBAAqB,CAAC,kBAAkB,CACzG,IAAI,CAAC,OAAO,CACb,CAAC;QACF,qBAAgB,GAAyC,IAAI,mBAAmB,CAAC,gBAAgB,CAC/F,IAAI,CAAC,OAAO,CACb,CAAC;
|
|
1
|
+
{"version":3,"file":"websites.mjs","sourceRoot":"","sources":["../../src/resources/websites/websites.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAEpB,KAAK,qBAAqB;OAC1B,EAIL,kBAAkB,GACnB;OACM,KAAK,mBAAmB;OACxB,EAKL,gBAAgB,GACjB;AAED,MAAM,OAAO,QAAS,SAAQ,WAAW;IAAzC;;QACE,uBAAkB,GAA6C,IAAI,qBAAqB,CAAC,kBAAkB,CACzG,IAAI,CAAC,OAAO,CACb,CAAC;QACF,qBAAgB,GAAyC,IAAI,mBAAmB,CAAC,gBAAgB,CAC/F,IAAI,CAAC,OAAO,CACb,CAAC;IAoCJ,CAAC;IAlCC;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAyB,EAAE,OAA6B;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;IAaD,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;AAgWD,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 = {
|
|
@@ -56,6 +70,12 @@ async function defaultParseResponse<T>(props: APIResponseProps): Promise<T> {
|
|
|
56
70
|
const mediaType = contentType?.split(';')[0]?.trim();
|
|
57
71
|
const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
|
|
58
72
|
if (isJSON) {
|
|
73
|
+
const contentLength = response.headers.get('content-length');
|
|
74
|
+
if (contentLength === '0') {
|
|
75
|
+
// if there is no content we can't do anything
|
|
76
|
+
return undefined as T;
|
|
77
|
+
}
|
|
78
|
+
|
|
59
79
|
const json = await response.json();
|
|
60
80
|
|
|
61
81
|
debug('response', response.status, response.url, response.headers, json);
|
|
@@ -156,6 +176,7 @@ export class APIPromise<T> extends Promise<T> {
|
|
|
156
176
|
|
|
157
177
|
export abstract class APIClient {
|
|
158
178
|
baseURL: string;
|
|
179
|
+
#baseURLOverridden: boolean;
|
|
159
180
|
maxRetries: number;
|
|
160
181
|
timeout: number;
|
|
161
182
|
httpAgent: Agent | undefined;
|
|
@@ -165,18 +186,21 @@ export abstract class APIClient {
|
|
|
165
186
|
|
|
166
187
|
constructor({
|
|
167
188
|
baseURL,
|
|
189
|
+
baseURLOverridden,
|
|
168
190
|
maxRetries = 2,
|
|
169
191
|
timeout = 60000, // 1 minute
|
|
170
192
|
httpAgent,
|
|
171
193
|
fetch: overriddenFetch,
|
|
172
194
|
}: {
|
|
173
195
|
baseURL: string;
|
|
196
|
+
baseURLOverridden: boolean;
|
|
174
197
|
maxRetries?: number | undefined;
|
|
175
198
|
timeout: number | undefined;
|
|
176
199
|
httpAgent: Agent | undefined;
|
|
177
200
|
fetch: Fetch | undefined;
|
|
178
201
|
}) {
|
|
179
202
|
this.baseURL = baseURL;
|
|
203
|
+
this.#baseURLOverridden = baseURLOverridden;
|
|
180
204
|
this.maxRetries = validatePositiveInteger('maxRetries', maxRetries);
|
|
181
205
|
this.timeout = validatePositiveInteger('timeout', timeout);
|
|
182
206
|
this.httpAgent = httpAgent;
|
|
@@ -199,7 +223,7 @@ export abstract class APIClient {
|
|
|
199
223
|
protected defaultHeaders(opts: FinalRequestOptions): Headers {
|
|
200
224
|
return {
|
|
201
225
|
Accept: 'application/json',
|
|
202
|
-
'Content-Type': 'application/json',
|
|
226
|
+
...(['head', 'get'].includes(opts.method) ? {} : { 'Content-Type': 'application/json' }),
|
|
203
227
|
'User-Agent': this.getUserAgent(),
|
|
204
228
|
...getPlatformHeaders(),
|
|
205
229
|
...this.authHeaders(opts),
|
|
@@ -281,12 +305,12 @@ export abstract class APIClient {
|
|
|
281
305
|
return null;
|
|
282
306
|
}
|
|
283
307
|
|
|
284
|
-
buildRequest<Req>(
|
|
285
|
-
|
|
308
|
+
async buildRequest<Req>(
|
|
309
|
+
inputOptions: FinalRequestOptions<Req>,
|
|
286
310
|
{ retryCount = 0 }: { retryCount?: number } = {},
|
|
287
|
-
): { req: RequestInit; url: string; timeout: number } {
|
|
288
|
-
options = { ...
|
|
289
|
-
const { method, path, query, headers: headers = {} } = options;
|
|
311
|
+
): Promise<{ req: RequestInit; url: string; timeout: number }> {
|
|
312
|
+
const options = { ...inputOptions };
|
|
313
|
+
const { method, path, query, defaultBaseURL, headers: headers = {} } = options;
|
|
290
314
|
|
|
291
315
|
const body =
|
|
292
316
|
ArrayBuffer.isView(options.body) || (options.__binaryRequest && typeof options.body === 'string') ?
|
|
@@ -296,7 +320,7 @@ export abstract class APIClient {
|
|
|
296
320
|
: null;
|
|
297
321
|
const contentLength = this.calculateContentLength(body);
|
|
298
322
|
|
|
299
|
-
const url = this.buildURL(path!, query);
|
|
323
|
+
const url = this.buildURL(path!, query, defaultBaseURL);
|
|
300
324
|
if ('timeout' in options) validatePositiveInteger('timeout', options.timeout);
|
|
301
325
|
options.timeout = options.timeout ?? this.timeout;
|
|
302
326
|
const httpAgent = options.httpAgent ?? this.httpAgent ?? getDefaultAgent(url);
|
|
@@ -313,8 +337,8 @@ export abstract class APIClient {
|
|
|
313
337
|
}
|
|
314
338
|
|
|
315
339
|
if (this.idempotencyHeader && method !== 'get') {
|
|
316
|
-
if (!
|
|
317
|
-
headers[this.idempotencyHeader] =
|
|
340
|
+
if (!inputOptions.idempotencyKey) inputOptions.idempotencyKey = this.defaultIdempotencyKey();
|
|
341
|
+
headers[this.idempotencyHeader] = inputOptions.idempotencyKey;
|
|
318
342
|
}
|
|
319
343
|
|
|
320
344
|
const reqHeaders = this.buildHeaders({ options, headers, contentLength, retryCount });
|
|
@@ -371,7 +395,7 @@ export abstract class APIClient {
|
|
|
371
395
|
getHeader(headers, 'x-stainless-timeout') === undefined &&
|
|
372
396
|
options.timeout
|
|
373
397
|
) {
|
|
374
|
-
reqHeaders['x-stainless-timeout'] = String(options.timeout);
|
|
398
|
+
reqHeaders['x-stainless-timeout'] = String(Math.trunc(options.timeout / 1000));
|
|
375
399
|
}
|
|
376
400
|
|
|
377
401
|
this.validateHeaders(reqHeaders, headers);
|
|
@@ -432,7 +456,9 @@ export abstract class APIClient {
|
|
|
432
456
|
|
|
433
457
|
await this.prepareOptions(options);
|
|
434
458
|
|
|
435
|
-
const { req, url, timeout } = this.buildRequest(options, {
|
|
459
|
+
const { req, url, timeout } = await this.buildRequest(options, {
|
|
460
|
+
retryCount: maxRetries - retriesRemaining,
|
|
461
|
+
});
|
|
436
462
|
|
|
437
463
|
await this.prepareRequest(req, { url, options });
|
|
438
464
|
|
|
@@ -489,11 +515,12 @@ export abstract class APIClient {
|
|
|
489
515
|
return new PagePromise<PageClass, Item>(this, request, Page);
|
|
490
516
|
}
|
|
491
517
|
|
|
492
|
-
buildURL<Req>(path: string, query: Req | null | undefined): string {
|
|
518
|
+
buildURL<Req>(path: string, query: Req | null | undefined, defaultBaseURL?: string | undefined): string {
|
|
519
|
+
const baseURL = (!this.#baseURLOverridden && defaultBaseURL) || this.baseURL;
|
|
493
520
|
const url =
|
|
494
521
|
isAbsoluteURL(path) ?
|
|
495
522
|
new URL(path)
|
|
496
|
-
: new URL(
|
|
523
|
+
: new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
|
|
497
524
|
|
|
498
525
|
const defaultQuery = this.defaultQuery();
|
|
499
526
|
if (!isEmptyObj(defaultQuery)) {
|
|
@@ -778,6 +805,7 @@ export type RequestOptions<
|
|
|
778
805
|
query?: Req | undefined;
|
|
779
806
|
body?: Req | null | undefined;
|
|
780
807
|
headers?: Headers | undefined;
|
|
808
|
+
defaultBaseURL?: string | undefined;
|
|
781
809
|
|
|
782
810
|
maxRetries?: number;
|
|
783
811
|
stream?: boolean | undefined;
|
|
@@ -799,6 +827,7 @@ const requestOptionsKeys: KeysEnum<RequestOptions> = {
|
|
|
799
827
|
query: true,
|
|
800
828
|
body: true,
|
|
801
829
|
headers: true,
|
|
830
|
+
defaultBaseURL: true,
|
|
802
831
|
|
|
803
832
|
maxRetries: true,
|
|
804
833
|
stream: true,
|
|
@@ -1065,21 +1094,21 @@ export const coerceBoolean = (value: unknown): boolean => {
|
|
|
1065
1094
|
};
|
|
1066
1095
|
|
|
1067
1096
|
export const maybeCoerceInteger = (value: unknown): number | undefined => {
|
|
1068
|
-
if (value
|
|
1097
|
+
if (value == null) {
|
|
1069
1098
|
return undefined;
|
|
1070
1099
|
}
|
|
1071
1100
|
return coerceInteger(value);
|
|
1072
1101
|
};
|
|
1073
1102
|
|
|
1074
1103
|
export const maybeCoerceFloat = (value: unknown): number | undefined => {
|
|
1075
|
-
if (value
|
|
1104
|
+
if (value == null) {
|
|
1076
1105
|
return undefined;
|
|
1077
1106
|
}
|
|
1078
1107
|
return coerceFloat(value);
|
|
1079
1108
|
};
|
|
1080
1109
|
|
|
1081
1110
|
export const maybeCoerceBoolean = (value: unknown): boolean | undefined => {
|
|
1082
|
-
if (value
|
|
1111
|
+
if (value == null) {
|
|
1083
1112
|
return undefined;
|
|
1084
1113
|
}
|
|
1085
1114
|
return coerceBoolean(value);
|