@snagsolutions/sdk 0.1.0-alpha.13 → 0.1.0-alpha.15
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 +98 -0
- package/README.md +22 -14
- package/core.d.ts.map +1 -1
- package/core.js +14 -7
- package/core.js.map +1 -1
- package/core.mjs +14 -7
- package/core.mjs.map +1 -1
- package/index.d.mts +11 -26
- package/index.d.ts +11 -26
- package/index.d.ts.map +1 -1
- package/index.js +8 -23
- package/index.js.map +1 -1
- package/index.mjs +8 -23
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/api/api.d.ts +365 -0
- package/resources/api/api.d.ts.map +1 -0
- package/resources/api/api.js +94 -0
- package/resources/api/api.js.map +1 -0
- package/resources/api/api.mjs +67 -0
- package/resources/api/api.mjs.map +1 -0
- package/resources/api/index.d.ts +9 -0
- package/resources/api/index.d.ts.map +1 -0
- package/resources/api/index.js +21 -0
- package/resources/api/index.js.map +1 -0
- package/resources/api/index.mjs +10 -0
- package/resources/api/index.mjs.map +1 -0
- package/resources/{loyalty → api/loyalty}/accounts.d.ts +44 -6
- package/resources/api/loyalty/accounts.d.ts.map +1 -0
- package/resources/api/loyalty/accounts.js +24 -0
- package/resources/api/loyalty/accounts.js.map +1 -0
- package/resources/api/loyalty/accounts.mjs +20 -0
- package/resources/api/loyalty/accounts.mjs.map +1 -0
- package/resources/api/loyalty/badges.d.ts +870 -0
- package/resources/api/loyalty/badges.d.ts.map +1 -0
- package/resources/{loyalty → api/loyalty}/badges.js +2 -2
- package/resources/api/loyalty/badges.js.map +1 -0
- package/resources/{loyalty → api/loyalty}/badges.mjs +2 -2
- package/resources/api/loyalty/badges.mjs.map +1 -0
- package/resources/{loyalty → api/loyalty}/currencies.d.ts +3 -9
- package/resources/api/loyalty/currencies.d.ts.map +1 -0
- package/resources/{loyalty → api/loyalty}/currencies.js +1 -1
- package/resources/api/loyalty/currencies.js.map +1 -0
- package/resources/{loyalty → api/loyalty}/currencies.mjs +1 -1
- package/resources/api/loyalty/currencies.mjs.map +1 -0
- package/resources/api/loyalty/index.d.ts +10 -0
- package/resources/api/loyalty/index.d.ts.map +1 -0
- package/resources/{loyalty → api/loyalty}/index.js +5 -3
- package/resources/api/loyalty/index.js.map +1 -0
- package/resources/{loyalty → api/loyalty}/index.mjs +4 -3
- package/resources/api/loyalty/index.mjs.map +1 -0
- package/resources/api/loyalty/loyalty.d.ts +807 -0
- package/resources/api/loyalty/loyalty.d.ts.map +1 -0
- package/resources/{loyalty → api/loyalty}/loyalty.js +36 -13
- package/resources/api/loyalty/loyalty.js.map +1 -0
- package/resources/api/loyalty/loyalty.mjs +59 -0
- package/resources/api/loyalty/loyalty.mjs.map +1 -0
- package/resources/{loyalty → api/loyalty}/multipliers.d.ts +36 -4
- package/resources/api/loyalty/multipliers.d.ts.map +1 -0
- package/resources/{loyalty → api/loyalty}/multipliers.js +8 -2
- package/resources/api/loyalty/multipliers.js.map +1 -0
- package/resources/{loyalty → api/loyalty}/multipliers.mjs +8 -2
- package/resources/api/loyalty/multipliers.mjs.map +1 -0
- package/resources/api/loyalty/questions-responses.d.ts +97 -0
- package/resources/api/loyalty/questions-responses.d.ts.map +1 -0
- package/resources/api/loyalty/questions-responses.js +22 -0
- package/resources/api/loyalty/questions-responses.js.map +1 -0
- package/resources/api/loyalty/questions-responses.mjs +18 -0
- package/resources/api/loyalty/questions-responses.mjs.map +1 -0
- package/resources/api/loyalty/questions.d.ts +150 -0
- package/resources/api/loyalty/questions.d.ts.map +1 -0
- package/resources/api/loyalty/questions.js +27 -0
- package/resources/api/loyalty/questions.js.map +1 -0
- package/resources/api/loyalty/questions.mjs +23 -0
- package/resources/api/loyalty/questions.mjs.map +1 -0
- package/resources/{loyalty → api/loyalty}/rule-edits.d.ts +9 -9
- package/resources/api/loyalty/rule-edits.d.ts.map +1 -0
- package/resources/{loyalty → api/loyalty}/rule-edits.js +3 -3
- package/resources/api/loyalty/rule-edits.js.map +1 -0
- package/resources/{loyalty → api/loyalty}/rule-edits.mjs +3 -3
- package/resources/api/loyalty/rule-edits.mjs.map +1 -0
- package/resources/{loyalty → api/loyalty}/rules.d.ts +167 -90
- package/resources/api/loyalty/rules.d.ts.map +1 -0
- package/resources/{loyalty → api/loyalty}/rules.js +3 -3
- package/resources/api/loyalty/rules.js.map +1 -0
- package/resources/{loyalty → api/loyalty}/rules.mjs +3 -3
- package/resources/api/loyalty/rules.mjs.map +1 -0
- package/resources/api/loyalty.d.ts +2 -0
- package/resources/api/loyalty.d.ts.map +1 -0
- package/resources/api/loyalty.js +19 -0
- package/resources/api/loyalty.js.map +1 -0
- package/resources/api/loyalty.mjs +3 -0
- package/resources/api/loyalty.mjs.map +1 -0
- package/resources/api/minting.d.ts +95 -0
- package/resources/api/minting.d.ts.map +1 -0
- package/resources/api/minting.js +15 -0
- package/resources/api/minting.js.map +1 -0
- package/resources/api/minting.mjs +11 -0
- package/resources/api/minting.mjs.map +1 -0
- package/resources/api/referral/index.d.ts +3 -0
- package/resources/api/referral/index.d.ts.map +1 -0
- package/resources/api/referral/index.js +9 -0
- package/resources/api/referral/index.js.map +1 -0
- package/resources/api/referral/index.mjs +4 -0
- package/resources/api/referral/index.mjs.map +1 -0
- package/resources/api/referral/referral.d.ts +31 -0
- package/resources/api/referral/referral.d.ts.map +1 -0
- package/resources/{drip/drip.js → api/referral/referral.js} +16 -13
- package/resources/api/referral/referral.js.map +1 -0
- package/resources/api/referral/referral.mjs +19 -0
- package/resources/api/referral/referral.mjs.map +1 -0
- package/resources/api/referral/users.d.ts +57 -0
- package/resources/api/referral/users.d.ts.map +1 -0
- package/resources/api/referral/users.js +21 -0
- package/resources/api/referral/users.js.map +1 -0
- package/resources/api/referral/users.mjs +17 -0
- package/resources/api/referral/users.mjs.map +1 -0
- package/resources/api/referral.d.ts +2 -0
- package/resources/api/referral.d.ts.map +1 -0
- package/resources/api/referral.js +19 -0
- package/resources/api/referral.js.map +1 -0
- package/resources/api/referral.mjs +3 -0
- package/resources/api/referral.mjs.map +1 -0
- package/resources/api/users/index.d.ts +3 -0
- package/resources/api/users/index.d.ts.map +1 -0
- package/resources/{users → api/users}/index.js +1 -3
- package/resources/api/users/index.js.map +1 -0
- package/resources/api/users/index.mjs +4 -0
- package/resources/api/users/index.mjs.map +1 -0
- package/resources/api/users/metadatas.d.ts +137 -0
- package/resources/api/users/metadatas.d.ts.map +1 -0
- package/resources/{users → api/users}/metadatas.js +8 -2
- package/resources/api/users/metadatas.js.map +1 -0
- package/resources/api/users/metadatas.mjs +18 -0
- package/resources/api/users/metadatas.mjs.map +1 -0
- package/resources/api/users/users.d.ts +133 -0
- package/resources/api/users/users.d.ts.map +1 -0
- package/resources/{users → api/users}/users.js +19 -5
- package/resources/api/users/users.js.map +1 -0
- package/resources/api/users/users.mjs +30 -0
- package/resources/api/users/users.mjs.map +1 -0
- package/resources/api/users.d.ts +2 -0
- package/resources/api/users.d.ts.map +1 -0
- package/resources/api/users.js +19 -0
- package/resources/api/users.js.map +1 -0
- package/resources/api/users.mjs +3 -0
- package/resources/api/users.mjs.map +1 -0
- package/resources/api/website-collections.d.ts +73 -0
- package/resources/api/website-collections.d.ts.map +1 -0
- package/resources/api/website-collections.js +25 -0
- package/resources/api/website-collections.js.map +1 -0
- package/resources/api/website-collections.mjs +21 -0
- package/resources/api/website-collections.mjs.map +1 -0
- package/resources/api/website-user-roles.d.ts +73 -0
- package/resources/api/website-user-roles.d.ts.map +1 -0
- package/resources/api/website-user-roles.js +22 -0
- package/resources/api/website-user-roles.js.map +1 -0
- package/resources/api/website-user-roles.mjs +18 -0
- package/resources/api/website-user-roles.mjs.map +1 -0
- package/resources/{websites.d.ts → api/websites.d.ts} +2 -2
- package/resources/api/websites.d.ts.map +1 -0
- package/resources/{websites.js → api/websites.js} +2 -2
- package/resources/api/websites.js.map +1 -0
- package/resources/{websites.mjs → api/websites.mjs} +2 -2
- package/resources/api/websites.mjs.map +1 -0
- package/resources/api.d.ts +2 -0
- package/resources/api.d.ts.map +1 -0
- package/resources/api.js +19 -0
- package/resources/api.js.map +1 -0
- package/resources/api.mjs +3 -0
- package/resources/api.mjs.map +1 -0
- package/resources/index.d.ts +1 -6
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -13
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -6
- package/resources/index.mjs.map +1 -1
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +18 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/core.ts +16 -8
- package/src/index.ts +28 -57
- package/src/resources/api/api.ts +629 -0
- package/src/resources/api/index.ts +51 -0
- package/src/resources/{loyalty → api/loyalty}/accounts.ts +65 -8
- package/src/resources/api/loyalty/badges.ts +1142 -0
- package/src/resources/{loyalty → api/loyalty}/currencies.ts +3 -9
- package/src/resources/{loyalty → api/loyalty}/index.ts +38 -11
- package/src/resources/api/loyalty/loyalty.ts +1297 -0
- package/src/resources/{loyalty → api/loyalty}/multipliers.ts +61 -4
- package/src/resources/api/loyalty/questions-responses.ts +146 -0
- package/src/resources/api/loyalty/questions.ts +208 -0
- package/src/resources/{loyalty → api/loyalty}/rule-edits.ts +11 -14
- package/src/resources/{loyalty → api/loyalty}/rules.ts +339 -180
- package/src/resources/api/loyalty.ts +3 -0
- package/src/resources/api/minting.ts +157 -0
- package/src/resources/api/referral/index.ts +10 -0
- package/src/resources/api/referral/referral.ts +70 -0
- package/src/resources/api/referral/users.ts +93 -0
- package/src/resources/api/referral.ts +3 -0
- package/src/resources/api/users/index.ts +18 -0
- package/src/resources/api/users/metadatas.ts +206 -0
- package/src/resources/api/users/users.ts +203 -0
- package/src/resources/api/users.ts +3 -0
- package/src/resources/api/website-collections.ts +148 -0
- package/src/resources/api/website-user-roles.ts +107 -0
- package/src/resources/{websites.ts → api/websites.ts} +3 -3
- package/src/resources/api.ts +3 -0
- package/src/resources/index.ts +8 -11
- package/src/resources.ts +1 -0
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/assets.d.ts +0 -50
- package/resources/assets.d.ts.map +0 -1
- package/resources/assets.js +0 -17
- package/resources/assets.js.map +0 -1
- package/resources/assets.mjs +0 -13
- package/resources/assets.mjs.map +0 -1
- package/resources/auction-bids.d.ts +0 -81
- package/resources/auction-bids.d.ts.map +0 -1
- package/resources/auction-bids.js +0 -30
- package/resources/auction-bids.js.map +0 -1
- package/resources/auction-bids.mjs +0 -26
- package/resources/auction-bids.mjs.map +0 -1
- package/resources/drip/drip.d.ts +0 -14
- package/resources/drip/drip.d.ts.map +0 -1
- package/resources/drip/drip.js.map +0 -1
- package/resources/drip/drip.mjs +0 -16
- package/resources/drip/drip.mjs.map +0 -1
- package/resources/drip/index.d.ts +0 -4
- package/resources/drip/index.d.ts.map +0 -1
- package/resources/drip/index.js +0 -11
- package/resources/drip/index.js.map +0 -1
- package/resources/drip/index.mjs +0 -5
- package/resources/drip/index.mjs.map +0 -1
- package/resources/drip/quests.d.ts +0 -168
- package/resources/drip/quests.d.ts.map +0 -1
- package/resources/drip/quests.js +0 -17
- package/resources/drip/quests.js.map +0 -1
- package/resources/drip/quests.mjs +0 -13
- package/resources/drip/quests.mjs.map +0 -1
- package/resources/drip/status.d.ts +0 -26
- package/resources/drip/status.d.ts.map +0 -1
- package/resources/drip/status.js +0 -16
- package/resources/drip/status.js.map +0 -1
- package/resources/drip/status.mjs +0 -12
- package/resources/drip/status.mjs.map +0 -1
- package/resources/loyalty/accounts.d.ts.map +0 -1
- package/resources/loyalty/accounts.js +0 -16
- package/resources/loyalty/accounts.js.map +0 -1
- package/resources/loyalty/accounts.mjs +0 -12
- package/resources/loyalty/accounts.mjs.map +0 -1
- package/resources/loyalty/badges.d.ts +0 -299
- package/resources/loyalty/badges.d.ts.map +0 -1
- package/resources/loyalty/badges.js.map +0 -1
- package/resources/loyalty/badges.mjs.map +0 -1
- package/resources/loyalty/currencies.d.ts.map +0 -1
- package/resources/loyalty/currencies.js.map +0 -1
- package/resources/loyalty/currencies.mjs.map +0 -1
- package/resources/loyalty/index.d.ts +0 -9
- package/resources/loyalty/index.d.ts.map +0 -1
- package/resources/loyalty/index.js.map +0 -1
- package/resources/loyalty/index.mjs.map +0 -1
- package/resources/loyalty/loyalty.d.ts +0 -34
- package/resources/loyalty/loyalty.d.ts.map +0 -1
- package/resources/loyalty/loyalty.js.map +0 -1
- package/resources/loyalty/loyalty.mjs +0 -36
- package/resources/loyalty/loyalty.mjs.map +0 -1
- package/resources/loyalty/multipliers.d.ts.map +0 -1
- package/resources/loyalty/multipliers.js.map +0 -1
- package/resources/loyalty/multipliers.mjs.map +0 -1
- package/resources/loyalty/rule-edits.d.ts.map +0 -1
- package/resources/loyalty/rule-edits.js.map +0 -1
- package/resources/loyalty/rule-edits.mjs.map +0 -1
- package/resources/loyalty/rules.d.ts.map +0 -1
- package/resources/loyalty/rules.js.map +0 -1
- package/resources/loyalty/rules.mjs.map +0 -1
- package/resources/loyalty/transaction-entries.d.ts +0 -175
- package/resources/loyalty/transaction-entries.d.ts.map +0 -1
- package/resources/loyalty/transaction-entries.js +0 -16
- package/resources/loyalty/transaction-entries.js.map +0 -1
- package/resources/loyalty/transaction-entries.mjs +0 -12
- package/resources/loyalty/transaction-entries.mjs.map +0 -1
- package/resources/users/index.d.ts +0 -4
- package/resources/users/index.d.ts.map +0 -1
- package/resources/users/index.js.map +0 -1
- package/resources/users/index.mjs +0 -5
- package/resources/users/index.mjs.map +0 -1
- package/resources/users/metadatas.d.ts +0 -64
- package/resources/users/metadatas.d.ts.map +0 -1
- package/resources/users/metadatas.js.map +0 -1
- package/resources/users/metadatas.mjs +0 -12
- package/resources/users/metadatas.mjs.map +0 -1
- package/resources/users/users.d.ts +0 -14
- package/resources/users/users.d.ts.map +0 -1
- package/resources/users/users.js.map +0 -1
- package/resources/users/users.mjs +0 -16
- package/resources/users/users.mjs.map +0 -1
- package/resources/users/wallets.d.ts +0 -193
- package/resources/users/wallets.d.ts.map +0 -1
- package/resources/users/wallets.js +0 -28
- package/resources/users/wallets.js.map +0 -1
- package/resources/users/wallets.mjs +0 -24
- package/resources/users/wallets.mjs.map +0 -1
- package/resources/websites.d.ts.map +0 -1
- package/resources/websites.js.map +0 -1
- package/resources/websites.mjs.map +0 -1
- package/src/resources/assets.ts +0 -71
- package/src/resources/auction-bids.ts +0 -123
- package/src/resources/drip/drip.ts +0 -25
- package/src/resources/drip/index.ts +0 -5
- package/src/resources/drip/quests.ts +0 -210
- package/src/resources/drip/status.ts +0 -33
- package/src/resources/loyalty/badges.ts +0 -435
- package/src/resources/loyalty/loyalty.ts +0 -159
- package/src/resources/loyalty/transaction-entries.ts +0 -229
- package/src/resources/users/index.ts +0 -12
- package/src/resources/users/metadatas.ts +0 -103
- package/src/resources/users/users.ts +0 -39
- package/src/resources/users/wallets.ts +0 -271
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { APIResource } from "../../resource.js";
|
|
2
|
+
import * as Core from "../../core.js";
|
|
3
|
+
export declare class WebsiteUserRoles extends APIResource {
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves roles of users for a specific website. If userId is provided,
|
|
6
|
+
* retrieves the role of that specific user for the website.
|
|
7
|
+
*/
|
|
8
|
+
list(query: WebsiteUserRoleListParams, options?: Core.RequestOptions): Core.APIPromise<WebsiteUserRoleListResponse>;
|
|
9
|
+
/**
|
|
10
|
+
* Assign roles to users for a specific website
|
|
11
|
+
*/
|
|
12
|
+
assign(body: WebsiteUserRoleAssignParams, options?: Core.RequestOptions): Core.APIPromise<WebsiteUserRoleAssignResponse>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Schema for getWebsiteUserRoles response
|
|
16
|
+
*/
|
|
17
|
+
export interface WebsiteUserRoleListResponse {
|
|
18
|
+
data: Array<WebsiteUserRoleListResponse.Data>;
|
|
19
|
+
}
|
|
20
|
+
export declare namespace WebsiteUserRoleListResponse {
|
|
21
|
+
interface Data {
|
|
22
|
+
/**
|
|
23
|
+
* UUID of the website user role
|
|
24
|
+
*/
|
|
25
|
+
id: string;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Schema for postWebsiteUserRoles response
|
|
30
|
+
*/
|
|
31
|
+
export interface WebsiteUserRoleAssignResponse {
|
|
32
|
+
data?: unknown;
|
|
33
|
+
}
|
|
34
|
+
export interface WebsiteUserRoleListParams {
|
|
35
|
+
/**
|
|
36
|
+
* UUID of the website
|
|
37
|
+
*/
|
|
38
|
+
websiteId: string;
|
|
39
|
+
/**
|
|
40
|
+
* UUID of the user
|
|
41
|
+
*/
|
|
42
|
+
userId?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface WebsiteUserRoleAssignParams {
|
|
45
|
+
/**
|
|
46
|
+
* UUID of the website
|
|
47
|
+
*/
|
|
48
|
+
websiteId: string;
|
|
49
|
+
/**
|
|
50
|
+
* Array of website user roles
|
|
51
|
+
*/
|
|
52
|
+
websiteUserRoles: Array<WebsiteUserRoleAssignParams.WebsiteUserRole>;
|
|
53
|
+
}
|
|
54
|
+
export declare namespace WebsiteUserRoleAssignParams {
|
|
55
|
+
interface WebsiteUserRole {
|
|
56
|
+
/**
|
|
57
|
+
* Role type of the user
|
|
58
|
+
*/
|
|
59
|
+
roleType: 'WEBSITE_SUPER_ADMIN' | 'WEBSITE_ADMIN' | 'WEBSITE_MODERATOR' | 'WEBSITE_API_KEY' | 'STRATUS_API_KEY';
|
|
60
|
+
/**
|
|
61
|
+
* Wallet address of the user
|
|
62
|
+
*/
|
|
63
|
+
walletAddress: string;
|
|
64
|
+
/**
|
|
65
|
+
* Deletion date of the user role
|
|
66
|
+
*/
|
|
67
|
+
deletedAt?: string;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export declare namespace WebsiteUserRoles {
|
|
71
|
+
export { type WebsiteUserRoleListResponse as WebsiteUserRoleListResponse, type WebsiteUserRoleAssignResponse as WebsiteUserRoleAssignResponse, type WebsiteUserRoleListParams as WebsiteUserRoleListParams, type WebsiteUserRoleAssignParams as WebsiteUserRoleAssignParams, };
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=website-user-roles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"website-user-roles.d.ts","sourceRoot":"","sources":["../../src/resources/api/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;;;OAGG;IACH,IAAI,CACF,KAAK,EAAE,yBAAyB,EAChC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,2BAA2B,CAAC;IAI/C;;OAEG;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,CAAC;QAEtB;;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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.WebsiteUserRoles = void 0;
|
|
5
|
+
const resource_1 = require("../../resource.js");
|
|
6
|
+
class WebsiteUserRoles extends resource_1.APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Retrieves roles of users for a specific website. If userId is provided,
|
|
9
|
+
* retrieves the role of that specific user for the website.
|
|
10
|
+
*/
|
|
11
|
+
list(query, options) {
|
|
12
|
+
return this._client.get('/api/website_user_roles', { query, ...options });
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Assign roles to users for a specific website
|
|
16
|
+
*/
|
|
17
|
+
assign(body, options) {
|
|
18
|
+
return this._client.post('/api/website_user_roles', { body, ...options });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.WebsiteUserRoles = WebsiteUserRoles;
|
|
22
|
+
//# sourceMappingURL=website-user-roles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"website-user-roles.js","sourceRoot":"","sources":["../../src/resources/api/website-user-roles.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAG7C,MAAa,gBAAiB,SAAQ,sBAAW;IAC/C;;;OAGG;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;;OAEG;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;AArBD,4CAqBC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../resource.mjs";
|
|
3
|
+
export class WebsiteUserRoles extends APIResource {
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves roles of users for a specific website. If userId is provided,
|
|
6
|
+
* retrieves the role of that specific user for the website.
|
|
7
|
+
*/
|
|
8
|
+
list(query, options) {
|
|
9
|
+
return this._client.get('/api/website_user_roles', { query, ...options });
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Assign roles to users for a specific website
|
|
13
|
+
*/
|
|
14
|
+
assign(body, options) {
|
|
15
|
+
return this._client.post('/api/website_user_roles', { body, ...options });
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=website-user-roles.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"website-user-roles.mjs","sourceRoot":"","sources":["../../src/resources/api/website-user-roles.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAC/C;;;OAGG;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;;OAEG;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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"websites.d.ts","sourceRoot":"","sources":["../../src/resources/api/websites.ts"],"names":[],"mappings":"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"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Websites = void 0;
|
|
5
|
-
const resource_1 = require("
|
|
6
|
-
const core_1 = require("
|
|
5
|
+
const resource_1 = require("../../resource.js");
|
|
6
|
+
const core_1 = require("../../core.js");
|
|
7
7
|
class Websites extends resource_1.APIResource {
|
|
8
8
|
/**
|
|
9
9
|
* Creates a new website
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"websites.js","sourceRoot":"","sources":["../../src/resources/api/websites.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAG9C,MAAa,QAAS,SAAQ,sBAAW;IACvC;;OAEG;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;IAQD,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;AAvBD,4BAuBC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
import { APIResource } from "
|
|
3
|
-
import { isRequestOptions } from "
|
|
2
|
+
import { APIResource } from "../../resource.mjs";
|
|
3
|
+
import { isRequestOptions } from "../../core.mjs";
|
|
4
4
|
export class Websites extends APIResource {
|
|
5
5
|
/**
|
|
6
6
|
* Creates a new website
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"websites.mjs","sourceRoot":"","sources":["../../src/resources/api/websites.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;AAG3B,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;OAEG;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;IAQD,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/resources/api.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC"}
|
package/resources/api.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
__exportStar(require("./api/index.js"), exports);
|
|
19
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/resources/api.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;AAEtF,iDAA4B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.mjs","sourceRoot":"","sources":["../src/resources/api.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
package/resources/index.d.ts
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { AuctionBids, type AuctionBidCreateParams, type AuctionBidListParams } from "./auction-bids.js";
|
|
3
|
-
export { Drip } from "./drip/drip.js";
|
|
4
|
-
export { Loyalty } from "./loyalty/loyalty.js";
|
|
5
|
-
export { Users } from "./users/users.js";
|
|
6
|
-
export { Websites, type WebsiteCreateResponse, type WebsiteListResponse, type WebsiteCreateParams, type WebsiteListParams, } from "./websites.js";
|
|
1
|
+
export { API, type APICreateAssetUploadURLResponse, type APIListAuctionsResponse, type APIListUsersResponse, type APICreateAssetUploadURLParams, type APIListAuctionBidsParams, type APIListUsersParams, } from "./api/api.js";
|
|
7
2
|
//# sourceMappingURL=index.d.ts.map
|
package/resources/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,GAAG,EACH,KAAK,+BAA+B,EACpC,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,6BAA6B,EAClC,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,GACxB,MAAM,WAAW,CAAC"}
|
package/resources/index.js
CHANGED
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
5
|
-
var
|
|
6
|
-
Object.defineProperty(exports, "
|
|
7
|
-
var auction_bids_1 = require("./auction-bids.js");
|
|
8
|
-
Object.defineProperty(exports, "AuctionBids", { enumerable: true, get: function () { return auction_bids_1.AuctionBids; } });
|
|
9
|
-
var drip_1 = require("./drip/drip.js");
|
|
10
|
-
Object.defineProperty(exports, "Drip", { enumerable: true, get: function () { return drip_1.Drip; } });
|
|
11
|
-
var loyalty_1 = require("./loyalty/loyalty.js");
|
|
12
|
-
Object.defineProperty(exports, "Loyalty", { enumerable: true, get: function () { return loyalty_1.Loyalty; } });
|
|
13
|
-
var users_1 = require("./users/users.js");
|
|
14
|
-
Object.defineProperty(exports, "Users", { enumerable: true, get: function () { return users_1.Users; } });
|
|
15
|
-
var websites_1 = require("./websites.js");
|
|
16
|
-
Object.defineProperty(exports, "Websites", { enumerable: true, get: function () { return websites_1.Websites; } });
|
|
4
|
+
exports.API = void 0;
|
|
5
|
+
var api_1 = require("./api/api.js");
|
|
6
|
+
Object.defineProperty(exports, "API", { enumerable: true, get: function () { return api_1.API; } });
|
|
17
7
|
//# sourceMappingURL=index.js.map
|
package/resources/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,oCAQmB;AAPjB,0FAAA,GAAG,OAAA"}
|
package/resources/index.mjs
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
export {
|
|
3
|
-
export { AuctionBids } from "./auction-bids.mjs";
|
|
4
|
-
export { Drip } from "./drip/drip.mjs";
|
|
5
|
-
export { Loyalty } from "./loyalty/loyalty.mjs";
|
|
6
|
-
export { Users } from "./users/users.mjs";
|
|
7
|
-
export { Websites, } from "./websites.mjs";
|
|
2
|
+
export { API, } from "./api/api.mjs";
|
|
8
3
|
//# sourceMappingURL=index.mjs.map
|
package/resources/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,GAAG,GAOJ"}
|
package/resources.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
package/resources.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./resources/index.js"), exports);
|
|
18
|
+
//# sourceMappingURL=resources.js.map
|
package/resources.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.js","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAkC"}
|
package/resources.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.mjs","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":""}
|
package/src/core.ts
CHANGED
|
@@ -48,8 +48,8 @@ async function defaultParseResponse<T>(props: APIResponseProps): Promise<T> {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
const contentType = response.headers.get('content-type');
|
|
51
|
-
const
|
|
52
|
-
|
|
51
|
+
const mediaType = contentType?.split(';')[0]?.trim();
|
|
52
|
+
const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
|
|
53
53
|
if (isJSON) {
|
|
54
54
|
const json = await response.json();
|
|
55
55
|
|
|
@@ -280,6 +280,7 @@ export abstract class APIClient {
|
|
|
280
280
|
options: FinalRequestOptions<Req>,
|
|
281
281
|
{ retryCount = 0 }: { retryCount?: number } = {},
|
|
282
282
|
): { req: RequestInit; url: string; timeout: number } {
|
|
283
|
+
options = { ...options };
|
|
283
284
|
const { method, path, query, headers: headers = {} } = options;
|
|
284
285
|
|
|
285
286
|
const body =
|
|
@@ -292,9 +293,9 @@ export abstract class APIClient {
|
|
|
292
293
|
|
|
293
294
|
const url = this.buildURL(path!, query);
|
|
294
295
|
if ('timeout' in options) validatePositiveInteger('timeout', options.timeout);
|
|
295
|
-
|
|
296
|
+
options.timeout = options.timeout ?? this.timeout;
|
|
296
297
|
const httpAgent = options.httpAgent ?? this.httpAgent ?? getDefaultAgent(url);
|
|
297
|
-
const minAgentTimeout = timeout + 1000;
|
|
298
|
+
const minAgentTimeout = options.timeout + 1000;
|
|
298
299
|
if (
|
|
299
300
|
typeof (httpAgent as any)?.options?.timeout === 'number' &&
|
|
300
301
|
minAgentTimeout > ((httpAgent as any).options.timeout ?? 0)
|
|
@@ -323,7 +324,7 @@ export abstract class APIClient {
|
|
|
323
324
|
signal: options.signal ?? null,
|
|
324
325
|
};
|
|
325
326
|
|
|
326
|
-
return { req, url, timeout };
|
|
327
|
+
return { req, url, timeout: options.timeout };
|
|
327
328
|
}
|
|
328
329
|
|
|
329
330
|
private buildHeaders({
|
|
@@ -351,15 +352,22 @@ export abstract class APIClient {
|
|
|
351
352
|
delete reqHeaders['content-type'];
|
|
352
353
|
}
|
|
353
354
|
|
|
354
|
-
// Don't set
|
|
355
|
-
//
|
|
356
|
-
//
|
|
355
|
+
// Don't set theses headers if they were already set or removed through default headers or by the caller.
|
|
356
|
+
// We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to account
|
|
357
|
+
// for the removal case.
|
|
357
358
|
if (
|
|
358
359
|
getHeader(defaultHeaders, 'x-stainless-retry-count') === undefined &&
|
|
359
360
|
getHeader(headers, 'x-stainless-retry-count') === undefined
|
|
360
361
|
) {
|
|
361
362
|
reqHeaders['x-stainless-retry-count'] = String(retryCount);
|
|
362
363
|
}
|
|
364
|
+
if (
|
|
365
|
+
getHeader(defaultHeaders, 'x-stainless-timeout') === undefined &&
|
|
366
|
+
getHeader(headers, 'x-stainless-timeout') === undefined &&
|
|
367
|
+
options.timeout
|
|
368
|
+
) {
|
|
369
|
+
reqHeaders['x-stainless-timeout'] = String(options.timeout);
|
|
370
|
+
}
|
|
363
371
|
|
|
364
372
|
this.validateHeaders(reqHeaders, headers);
|
|
365
373
|
|
package/src/index.ts
CHANGED
|
@@ -6,22 +6,19 @@ import * as Core from './core';
|
|
|
6
6
|
import * as Errors from './error';
|
|
7
7
|
import * as Uploads from './uploads';
|
|
8
8
|
import * as API from './resources/index';
|
|
9
|
-
import { AssetCreateParams, AssetCreateResponse, Assets } from './resources/assets';
|
|
10
|
-
import { AuctionBidCreateParams, AuctionBidListParams, AuctionBids } from './resources/auction-bids';
|
|
11
9
|
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
import { Users } from './resources/users/users';
|
|
10
|
+
API as ApiapiAPI,
|
|
11
|
+
APICreateAssetUploadURLParams,
|
|
12
|
+
APICreateAssetUploadURLResponse,
|
|
13
|
+
APIListAuctionBidsParams,
|
|
14
|
+
APIListAuctionsResponse,
|
|
15
|
+
APIListUsersParams,
|
|
16
|
+
APIListUsersResponse,
|
|
17
|
+
} from './resources/api/api';
|
|
21
18
|
|
|
22
19
|
export interface ClientOptions {
|
|
23
20
|
/**
|
|
24
|
-
*
|
|
21
|
+
* Defaults to process.env['SNAG_SOLUTIONS_API_KEY'].
|
|
25
22
|
*/
|
|
26
23
|
apiKey?: string | undefined;
|
|
27
24
|
|
|
@@ -39,7 +36,7 @@ export interface ClientOptions {
|
|
|
39
36
|
* Note that request timeouts are retried by default, so in a worst-case scenario you may wait
|
|
40
37
|
* much longer than this timeout before the promise succeeds or fails.
|
|
41
38
|
*/
|
|
42
|
-
timeout?: number;
|
|
39
|
+
timeout?: number | undefined;
|
|
43
40
|
|
|
44
41
|
/**
|
|
45
42
|
* An HTTP agent used to manage HTTP(S) connections.
|
|
@@ -47,7 +44,7 @@ export interface ClientOptions {
|
|
|
47
44
|
* If not provided, an agent will be constructed by default in the Node.js environment,
|
|
48
45
|
* otherwise no agent is used.
|
|
49
46
|
*/
|
|
50
|
-
httpAgent?: Agent;
|
|
47
|
+
httpAgent?: Agent | undefined;
|
|
51
48
|
|
|
52
49
|
/**
|
|
53
50
|
* Specify a custom `fetch` function implementation.
|
|
@@ -63,7 +60,7 @@ export interface ClientOptions {
|
|
|
63
60
|
*
|
|
64
61
|
* @default 2
|
|
65
62
|
*/
|
|
66
|
-
maxRetries?: number;
|
|
63
|
+
maxRetries?: number | undefined;
|
|
67
64
|
|
|
68
65
|
/**
|
|
69
66
|
* Default headers to include with every request to the API.
|
|
@@ -71,7 +68,7 @@ export interface ClientOptions {
|
|
|
71
68
|
* These can be removed in individual requests by explicitly setting the
|
|
72
69
|
* header to `undefined` or `null` in request options.
|
|
73
70
|
*/
|
|
74
|
-
defaultHeaders?: Core.Headers;
|
|
71
|
+
defaultHeaders?: Core.Headers | undefined;
|
|
75
72
|
|
|
76
73
|
/**
|
|
77
74
|
* Default query parameters to include with every request to the API.
|
|
@@ -79,7 +76,7 @@ export interface ClientOptions {
|
|
|
79
76
|
* These can be removed in individual requests by explicitly setting the
|
|
80
77
|
* param to `undefined` in request options.
|
|
81
78
|
*/
|
|
82
|
-
defaultQuery?: Core.DefaultQuery;
|
|
79
|
+
defaultQuery?: Core.DefaultQuery | undefined;
|
|
83
80
|
}
|
|
84
81
|
|
|
85
82
|
/**
|
|
@@ -93,8 +90,8 @@ export class SnagSolutions extends Core.APIClient {
|
|
|
93
90
|
/**
|
|
94
91
|
* API Client for interfacing with the Snag Solutions API.
|
|
95
92
|
*
|
|
96
|
-
* @param {string | undefined} [opts.apiKey=process.env['
|
|
97
|
-
* @param {string} [opts.baseURL=process.env['SNAG_SOLUTIONS_BASE_URL'] ?? https://
|
|
93
|
+
* @param {string | undefined} [opts.apiKey=process.env['SNAG_SOLUTIONS_API_KEY'] ?? undefined]
|
|
94
|
+
* @param {string} [opts.baseURL=process.env['SNAG_SOLUTIONS_BASE_URL'] ?? https://api.example.com] - Override the default base URL for the API.
|
|
98
95
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
99
96
|
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
100
97
|
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
@@ -104,19 +101,19 @@ export class SnagSolutions extends Core.APIClient {
|
|
|
104
101
|
*/
|
|
105
102
|
constructor({
|
|
106
103
|
baseURL = Core.readEnv('SNAG_SOLUTIONS_BASE_URL'),
|
|
107
|
-
apiKey = Core.readEnv('
|
|
104
|
+
apiKey = Core.readEnv('SNAG_SOLUTIONS_API_KEY'),
|
|
108
105
|
...opts
|
|
109
106
|
}: ClientOptions = {}) {
|
|
110
107
|
if (apiKey === undefined) {
|
|
111
108
|
throw new Errors.SnagSolutionsError(
|
|
112
|
-
"The
|
|
109
|
+
"The SNAG_SOLUTIONS_API_KEY environment variable is missing or empty; either provide it, or instantiate the SnagSolutions client with an apiKey option, like new SnagSolutions({ apiKey: 'My API Key' }).",
|
|
113
110
|
);
|
|
114
111
|
}
|
|
115
112
|
|
|
116
113
|
const options: ClientOptions = {
|
|
117
114
|
apiKey,
|
|
118
115
|
...opts,
|
|
119
|
-
baseURL: baseURL || `https://
|
|
116
|
+
baseURL: baseURL || `https://api.example.com`,
|
|
120
117
|
};
|
|
121
118
|
|
|
122
119
|
super({
|
|
@@ -132,12 +129,7 @@ export class SnagSolutions extends Core.APIClient {
|
|
|
132
129
|
this.apiKey = apiKey;
|
|
133
130
|
}
|
|
134
131
|
|
|
135
|
-
|
|
136
|
-
users: API.Users = new API.Users(this);
|
|
137
|
-
loyalty: API.Loyalty = new API.Loyalty(this);
|
|
138
|
-
auctionBids: API.AuctionBids = new API.AuctionBids(this);
|
|
139
|
-
websites: API.Websites = new API.Websites(this);
|
|
140
|
-
drip: API.Drip = new API.Drip(this);
|
|
132
|
+
api: API.API = new API.API(this);
|
|
141
133
|
|
|
142
134
|
protected override defaultQuery(): Core.DefaultQuery | undefined {
|
|
143
135
|
return this._options.defaultQuery;
|
|
@@ -179,40 +171,19 @@ export class SnagSolutions extends Core.APIClient {
|
|
|
179
171
|
static fileFromPath = Uploads.fileFromPath;
|
|
180
172
|
}
|
|
181
173
|
|
|
182
|
-
SnagSolutions.
|
|
183
|
-
SnagSolutions.Users = Users;
|
|
184
|
-
SnagSolutions.Loyalty = Loyalty;
|
|
185
|
-
SnagSolutions.AuctionBids = AuctionBids;
|
|
186
|
-
SnagSolutions.Websites = Websites;
|
|
187
|
-
SnagSolutions.Drip = Drip;
|
|
174
|
+
SnagSolutions.API = ApiapiAPI;
|
|
188
175
|
export declare namespace SnagSolutions {
|
|
189
176
|
export type RequestOptions = Core.RequestOptions;
|
|
190
177
|
|
|
191
178
|
export {
|
|
192
|
-
|
|
193
|
-
type
|
|
194
|
-
type
|
|
179
|
+
ApiapiAPI as API,
|
|
180
|
+
type APICreateAssetUploadURLResponse as APICreateAssetUploadURLResponse,
|
|
181
|
+
type APIListAuctionsResponse as APIListAuctionsResponse,
|
|
182
|
+
type APIListUsersResponse as APIListUsersResponse,
|
|
183
|
+
type APICreateAssetUploadURLParams as APICreateAssetUploadURLParams,
|
|
184
|
+
type APIListAuctionBidsParams as APIListAuctionBidsParams,
|
|
185
|
+
type APIListUsersParams as APIListUsersParams,
|
|
195
186
|
};
|
|
196
|
-
|
|
197
|
-
export { Users as Users };
|
|
198
|
-
|
|
199
|
-
export { Loyalty as Loyalty };
|
|
200
|
-
|
|
201
|
-
export {
|
|
202
|
-
AuctionBids as AuctionBids,
|
|
203
|
-
type AuctionBidCreateParams as AuctionBidCreateParams,
|
|
204
|
-
type AuctionBidListParams as AuctionBidListParams,
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
export {
|
|
208
|
-
Websites as Websites,
|
|
209
|
-
type WebsiteCreateResponse as WebsiteCreateResponse,
|
|
210
|
-
type WebsiteListResponse as WebsiteListResponse,
|
|
211
|
-
type WebsiteCreateParams as WebsiteCreateParams,
|
|
212
|
-
type WebsiteListParams as WebsiteListParams,
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
export { Drip as Drip };
|
|
216
187
|
}
|
|
217
188
|
|
|
218
189
|
export { toFile, fileFromPath } from './uploads';
|