@snagsolutions/sdk 0.1.0-alpha.19 → 0.1.0-alpha.190
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 +1544 -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 +7 -4
- package/index.d.ts +7 -4
- package/index.d.ts.map +1 -1
- package/index.js +8 -4
- package/index.js.map +1 -1
- package/index.mjs +8 -4
- 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 +343 -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 +17 -4
- 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 +2 -2
- 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 +1 -1
- 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 +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 +4 -4
- 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 +3 -3
- package/resources/loyalty/index.mjs.map +1 -1
- package/resources/loyalty/loyalty.d.ts +11 -11
- 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 +7 -7
- 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 +52 -6
- 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 +2630 -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 -64
- package/resources/loyalty/rule-groups.d.ts.map +1 -1
- package/resources/loyalty/rule-groups.js +38 -2
- package/resources/loyalty/rule-groups.js.map +1 -1
- package/resources/loyalty/rule-groups.mjs +38 -2
- package/resources/loyalty/rule-groups.mjs.map +1 -1
- package/resources/loyalty/rules.d.ts +1902 -269
- 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 +120 -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 +410 -0
- package/resources/loyalty/transactions/transactions.d.ts.map +1 -0
- package/resources/loyalty/transactions/transactions.js +76 -0
- package/resources/loyalty/transactions/transactions.js.map +1 -0
- package/resources/loyalty/transactions/transactions.mjs +49 -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.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 +29 -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/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 +34 -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 +184 -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 +12 -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 +39 -16
- package/src/index.ts +31 -2
- package/src/resource.ts +1 -1
- package/src/resources/assets.ts +18 -3
- package/src/resources/auctions/auctions.ts +528 -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 +21 -5
- package/src/resources/index.ts +12 -1
- package/src/resources/loyalty/account-streaks.ts +110 -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 +19 -3
- package/src/resources/loyalty/loyalty.ts +39 -15
- package/src/resources/loyalty/multipliers.ts +43 -4
- package/src/resources/loyalty/questions-responses.ts +64 -4
- package/src/resources/loyalty/questions.ts +56 -6
- package/src/resources/loyalty/rule-edits.ts +3822 -100
- package/src/resources/loyalty/rule-groups.ts +489 -76
- package/src/resources/loyalty/rules.ts +2968 -310
- package/src/resources/loyalty/transactions/index.ts +18 -0
- package/src/resources/loyalty/transactions/rule-statuses.ts +178 -0
- package/src/resources/loyalty/transactions/transactions.ts +683 -0
- package/src/resources/loyalty/transactions.ts +1 -440
- package/src/resources/minting.ts +24 -5
- package/src/resources/referral/referral.ts +13 -11
- package/src/resources/referral/users.ts +43 -5
- package/src/resources/users/index.ts +4 -0
- package/src/resources/users/metadatas.ts +57 -3
- package/src/resources/users/users.ts +249 -38
- package/src/resources/websites/website-collections.ts +41 -1
- package/src/resources/websites/website-user-roles.ts +25 -1
- package/src/resources/websites/websites.ts +12 -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
|
@@ -15,23 +15,80 @@ export class Users extends APIResource {
|
|
|
15
15
|
return this._client.get('/api/users', { query, ...options });
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
* This endpoint allows you to
|
|
18
|
+
* This endpoint allows you to connect a user to a user group
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const response = await client.users.connect({
|
|
23
|
+
* organizationId: '123e4567-e89b-12d3-a456-426614174001',
|
|
24
|
+
* walletAddress:
|
|
25
|
+
* '0x1234567890abcdef1234567890abcdef12345678',
|
|
26
|
+
* walletType: 'evm',
|
|
27
|
+
* websiteId: '123e4567-e89b-12d3-a456-426614174000',
|
|
28
|
+
* });
|
|
29
|
+
* ```
|
|
19
30
|
*/
|
|
20
31
|
connect(body, options) {
|
|
21
32
|
return this._client.post('/api/users/connect', { body, ...options });
|
|
22
33
|
}
|
|
23
34
|
/**
|
|
24
35
|
* This endpoint returns the total user count
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const response = await client.users.count({
|
|
40
|
+
* organizationId: '123e4567-e89b-12d3-a456-426614174001',
|
|
41
|
+
* websiteId: '123e4567-e89b-12d3-a456-426614174000',
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
25
44
|
*/
|
|
26
45
|
count(query, options) {
|
|
27
46
|
return this._client.get('/api/users/count', { query, ...options });
|
|
28
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* This endpoint is used to create user devices for fraud tracking
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* const response = await client.users.createDevice({
|
|
54
|
+
* ipAddress: '123.456.789.012',
|
|
55
|
+
* });
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
createDevice(body, options) {
|
|
59
|
+
return this._client.post('/api/users/devices', { body, ...options });
|
|
60
|
+
}
|
|
29
61
|
/**
|
|
30
62
|
* This endpoint allows you to disconnect a user from another user
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* const response = await client.users.disconnect({
|
|
67
|
+
* organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
68
|
+
* userId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
69
|
+
* websiteId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
70
|
+
* });
|
|
71
|
+
* ```
|
|
31
72
|
*/
|
|
32
73
|
disconnect(body, options) {
|
|
33
74
|
return this._client.post('/api/users/disconnect', { body, ...options });
|
|
34
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Transfers a social account from one user to another when a conflict is detected.
|
|
78
|
+
* Disconnects the account from the previous user and connects it to the current
|
|
79
|
+
* user's profile. Used when a social account is already linked to a different user
|
|
80
|
+
* (MAXIMUM_ACCOUNT_LINKED error).
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* const response = await client.users.verify({
|
|
85
|
+
* accountLinkData: 'accountLinkData',
|
|
86
|
+
* });
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
verify(body, options) {
|
|
90
|
+
return this._client.post('/api/users/verify', { body, ...options });
|
|
91
|
+
}
|
|
35
92
|
}
|
|
36
93
|
Users.Metadatas = Metadatas;
|
|
37
94
|
//# sourceMappingURL=users.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.mjs","sourceRoot":"","sources":["../../src/resources/users/users.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAEpB,KAAK,YAAY;OACjB,EAKL,SAAS,GACV;AAED,MAAM,OAAO,KAAM,SAAQ,WAAW;IAAtC;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"users.mjs","sourceRoot":"","sources":["../../src/resources/users/users.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAEpB,KAAK,YAAY;OACjB,EAKL,SAAS,GACV;AAED,MAAM,OAAO,KAAM,SAAQ,WAAW;IAAtC;;QACE,cAAS,GAA2B,IAAI,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA2G/E,CAAC;IA/FC,IAAI,CACF,QAA8C,EAAE,EAChD,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,YAAY,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,IAAuB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,KAAsB,EAAE,OAA6B;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;OASG;IACH,YAAY,CACV,IAA4B,EAC5B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;IAED;;;;;;;;;;;OAWG;IACH,UAAU,CACR,IAA0B,EAC1B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,IAAsB,EAAE,OAA6B;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;CACF;AA8fD,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC"}
|
|
@@ -3,10 +3,31 @@ import * as Core from "../../core.js";
|
|
|
3
3
|
export declare 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: WebsiteCollectionCreateParams, options?: Core.RequestOptions): Core.APIPromise<void>;
|
|
8
21
|
/**
|
|
9
22
|
* Retrieves collections for a specific website.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const websiteCollections =
|
|
27
|
+
* await client.websites.websiteCollections.list({
|
|
28
|
+
* websiteId: '123e4567-e89b-12d3-a456-426614174000',
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
10
31
|
*/
|
|
11
32
|
list(query: WebsiteCollectionListParams, options?: Core.RequestOptions): Core.APIPromise<WebsiteCollectionListResponse>;
|
|
12
33
|
}
|
|
@@ -34,7 +55,7 @@ export declare namespace WebsiteCollectionListResponse {
|
|
|
34
55
|
export interface WebsiteCollectionCreateParams {
|
|
35
56
|
collectionAddress: string;
|
|
36
57
|
name: string;
|
|
37
|
-
network: 'apechain' | 'arbitrum' | 'avalanche' | 'avalancheFuji' | 'base' | 'baseSepolia' | 'berachainArtio' | 'binance' | 'bscTestnet' | 'campTestnet' | 'fantom' | 'fantomTestnet' | 'flowMainnet' | 'mainnet' | 'optimism' | 'polygon' | 'polygon_mumbai' | 'skaleNebula' | 'solana' | 'sophon' | 'sui' | 'superseed' | 'superseedSepolia' | 'vanar' | 'xai' | 'zksync' | 'sepolia' | 'optimism_sepolia' | 'arbitrumSepolia' | 'goerli' | 'optimism_goerli' | 'arbitrumGoerli' | 'basecamp' | '
|
|
58
|
+
network: 'abstract' | 'abstractTestnet' | 'apechain' | 'arbitrum' | 'avalanche' | 'avalancheFuji' | 'base' | 'baseSepolia' | 'berachain' | 'berachainArtio' | 'berachainBepolia' | 'binance' | 'bscTestnet' | 'campTestnet' | 'fantom' | 'fantomTestnet' | 'flowMainnet' | 'mainnet' | 'nexusTestnet' | 'optimism' | 'polygon' | 'polygon_mumbai' | 'skaleNebula' | 'skaleEuropa' | 'skaleCalypso' | 'solana' | 'sophon' | 'sophonTestnet' | 'sui' | 'superseed' | 'superseedSepolia' | 'vanar' | 'xai' | 'zksync' | 'coti' | 'cotiTestnet' | 'morph' | 'morphTestnet' | 'morphHolesky' | 'ultra' | 'ultraTestnet' | 'nitrograph' | 'sepolia' | 'optimism_sepolia' | 'arbitrumSepolia' | 'goerli' | 'optimism_goerli' | 'arbitrumGoerli' | 'basecamp' | 'somnia' | 'polkadot' | 'kusama' | 'flow_cadence';
|
|
38
59
|
organizationId: string;
|
|
39
60
|
sortId: number;
|
|
40
61
|
websiteId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"website-collections.d.ts","sourceRoot":"","sources":["../../src/resources/websites/website-collections.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC,qBAAa,kBAAmB,SAAQ,WAAW;IACjD
|
|
1
|
+
{"version":3,"file":"website-collections.d.ts","sourceRoot":"","sources":["../../src/resources/websites/website-collections.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC,qBAAa,kBAAmB,SAAQ,WAAW;IACjD;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,IAAI,EAAE,6BAA6B,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;IAQjG;;;;;;;;;;OAUG;IACH,IAAI,CACF,KAAK,EAAE,2BAA2B,EAClC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,6BAA6B,CAAC;CAGlD;AAED;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,6BAA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AAE,MAAM,GAAG,IAAI,CAAC;IAElC,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,WAAW,kBAAkB,CAAC;IAC1C,OAAO,EACL,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,2BAA2B,IAAI,2BAA2B,GAChE,CAAC;CACH"}
|
|
@@ -6,6 +6,19 @@ const resource_1 = require("../../resource.js");
|
|
|
6
6
|
class WebsiteCollections extends resource_1.APIResource {
|
|
7
7
|
/**
|
|
8
8
|
* Creates a new collection under a website
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* await client.websites.websiteCollections.create({
|
|
13
|
+
* collectionAddress:
|
|
14
|
+
* '0x2c02efDd09B3BA1AEaDd3dCAa7aC7A37C1CBDA8A',
|
|
15
|
+
* name: 'x',
|
|
16
|
+
* network: 'abstract',
|
|
17
|
+
* organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
18
|
+
* sortId: 99999,
|
|
19
|
+
* websiteId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
9
22
|
*/
|
|
10
23
|
create(body, options) {
|
|
11
24
|
return this._client.post('/api/website_collections', {
|
|
@@ -16,6 +29,14 @@ class WebsiteCollections extends resource_1.APIResource {
|
|
|
16
29
|
}
|
|
17
30
|
/**
|
|
18
31
|
* Retrieves collections for a specific website.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const websiteCollections =
|
|
36
|
+
* await client.websites.websiteCollections.list({
|
|
37
|
+
* websiteId: '123e4567-e89b-12d3-a456-426614174000',
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
19
40
|
*/
|
|
20
41
|
list(query, options) {
|
|
21
42
|
return this._client.get('/api/website_collections', { query, ...options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"website-collections.js","sourceRoot":"","sources":["../../src/resources/websites/website-collections.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAG7C,MAAa,kBAAmB,SAAQ,sBAAW;IACjD
|
|
1
|
+
{"version":3,"file":"website-collections.js","sourceRoot":"","sources":["../../src/resources/websites/website-collections.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAG7C,MAAa,kBAAmB,SAAQ,sBAAW;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;AA1CD,gDA0CC"}
|
|
@@ -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';
|
|
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;;;;;;;;;;;;;;;;;O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Resource {
|
|
|
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>;
|
|
@@ -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,u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,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,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;AA8ND,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;AA8ND,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);
|