@snagsolutions/sdk 0.1.0-alpha.10
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 +125 -0
- package/LICENSE +201 -0
- package/README.md +297 -0
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/_shims/auto/runtime-bun.d.ts +5 -0
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +101 -0
- package/_shims/auto/types.js +3 -0
- package/_shims/auto/types.mjs +3 -0
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +81 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +89 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +56 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +37 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +41 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +37 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +78 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +71 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +83 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +241 -0
- package/core.d.ts.map +1 -0
- package/core.js +908 -0
- package/core.js.map +1 -0
- package/core.mjs +876 -0
- package/core.mjs.map +1 -0
- package/error.d.ts +47 -0
- package/error.d.ts.map +1 -0
- package/error.js +113 -0
- package/error.js.map +1 -0
- package/error.mjs +97 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +126 -0
- package/index.d.ts +126 -0
- package/index.d.ts.map +1 -0
- package/index.js +141 -0
- package/index.js.map +1 -0
- package/index.mjs +98 -0
- package/index.mjs.map +1 -0
- package/internal/qs/formats.d.ts +6 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +11 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +8 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +280 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +276 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.ts +14 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +229 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/package.json +103 -0
- package/resource.d.ts +6 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +11 -0
- package/resource.js.map +1 -0
- package/resource.mjs +7 -0
- package/resource.mjs.map +1 -0
- package/resources/assets.d.ts +50 -0
- package/resources/assets.d.ts.map +1 -0
- package/resources/assets.js +17 -0
- package/resources/assets.js.map +1 -0
- package/resources/assets.mjs +13 -0
- package/resources/assets.mjs.map +1 -0
- package/resources/auction-bids.d.ts +81 -0
- package/resources/auction-bids.d.ts.map +1 -0
- package/resources/auction-bids.js +30 -0
- package/resources/auction-bids.js.map +1 -0
- package/resources/auction-bids.mjs +26 -0
- package/resources/auction-bids.mjs.map +1 -0
- package/resources/drip/drip.d.ts +14 -0
- package/resources/drip/drip.d.ts.map +1 -0
- package/resources/drip/drip.js +43 -0
- package/resources/drip/drip.js.map +1 -0
- package/resources/drip/drip.mjs +16 -0
- package/resources/drip/drip.mjs.map +1 -0
- package/resources/drip/index.d.ts +4 -0
- package/resources/drip/index.d.ts.map +1 -0
- package/resources/drip/index.js +11 -0
- package/resources/drip/index.js.map +1 -0
- package/resources/drip/index.mjs +5 -0
- package/resources/drip/index.mjs.map +1 -0
- package/resources/drip/quests.d.ts +168 -0
- package/resources/drip/quests.d.ts.map +1 -0
- package/resources/drip/quests.js +17 -0
- package/resources/drip/quests.js.map +1 -0
- package/resources/drip/quests.mjs +13 -0
- package/resources/drip/quests.mjs.map +1 -0
- package/resources/drip/status.d.ts +26 -0
- package/resources/drip/status.d.ts.map +1 -0
- package/resources/drip/status.js +16 -0
- package/resources/drip/status.js.map +1 -0
- package/resources/drip/status.mjs +12 -0
- package/resources/drip/status.mjs.map +1 -0
- package/resources/index.d.ts +7 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +17 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +8 -0
- package/resources/index.mjs.map +1 -0
- package/resources/loyalty/accounts.d.ts +157 -0
- package/resources/loyalty/accounts.d.ts.map +1 -0
- package/resources/loyalty/accounts.js +16 -0
- package/resources/loyalty/accounts.js.map +1 -0
- package/resources/loyalty/accounts.mjs +12 -0
- package/resources/loyalty/accounts.mjs.map +1 -0
- package/resources/loyalty/badges.d.ts +299 -0
- package/resources/loyalty/badges.d.ts.map +1 -0
- package/resources/loyalty/badges.js +46 -0
- package/resources/loyalty/badges.js.map +1 -0
- package/resources/loyalty/badges.mjs +42 -0
- package/resources/loyalty/badges.mjs.map +1 -0
- package/resources/loyalty/currencies.d.ts +252 -0
- package/resources/loyalty/currencies.d.ts.map +1 -0
- package/resources/loyalty/currencies.js +21 -0
- package/resources/loyalty/currencies.js.map +1 -0
- package/resources/loyalty/currencies.mjs +17 -0
- package/resources/loyalty/currencies.mjs.map +1 -0
- package/resources/loyalty/index.d.ts +9 -0
- package/resources/loyalty/index.d.ts.map +1 -0
- package/resources/loyalty/index.js +21 -0
- package/resources/loyalty/index.js.map +1 -0
- package/resources/loyalty/index.mjs +10 -0
- package/resources/loyalty/index.mjs.map +1 -0
- package/resources/loyalty/loyalty.d.ts +34 -0
- package/resources/loyalty/loyalty.d.ts.map +1 -0
- package/resources/loyalty/loyalty.js +63 -0
- package/resources/loyalty/loyalty.js.map +1 -0
- package/resources/loyalty/loyalty.mjs +36 -0
- package/resources/loyalty/loyalty.mjs.map +1 -0
- package/resources/loyalty/multipliers.d.ts +129 -0
- package/resources/loyalty/multipliers.d.ts.map +1 -0
- package/resources/loyalty/multipliers.js +34 -0
- package/resources/loyalty/multipliers.js.map +1 -0
- package/resources/loyalty/multipliers.mjs +30 -0
- package/resources/loyalty/multipliers.mjs.map +1 -0
- package/resources/loyalty/rule-edits.d.ts +330 -0
- package/resources/loyalty/rule-edits.d.ts.map +1 -0
- package/resources/loyalty/rule-edits.js +21 -0
- package/resources/loyalty/rule-edits.js.map +1 -0
- package/resources/loyalty/rule-edits.mjs +17 -0
- package/resources/loyalty/rule-edits.mjs.map +1 -0
- package/resources/loyalty/rules.d.ts +2430 -0
- package/resources/loyalty/rules.d.ts.map +1 -0
- package/resources/loyalty/rules.js +46 -0
- package/resources/loyalty/rules.js.map +1 -0
- package/resources/loyalty/rules.mjs +42 -0
- package/resources/loyalty/rules.mjs.map +1 -0
- package/resources/loyalty/transaction-entries.d.ts +175 -0
- package/resources/loyalty/transaction-entries.d.ts.map +1 -0
- package/resources/loyalty/transaction-entries.js +16 -0
- package/resources/loyalty/transaction-entries.js.map +1 -0
- package/resources/loyalty/transaction-entries.mjs +12 -0
- package/resources/loyalty/transaction-entries.mjs.map +1 -0
- package/resources/users/index.d.ts +4 -0
- package/resources/users/index.d.ts.map +1 -0
- package/resources/users/index.js +11 -0
- package/resources/users/index.js.map +1 -0
- package/resources/users/index.mjs +5 -0
- package/resources/users/index.mjs.map +1 -0
- package/resources/users/metadatas.d.ts +64 -0
- package/resources/users/metadatas.d.ts.map +1 -0
- package/resources/users/metadatas.js +16 -0
- package/resources/users/metadatas.js.map +1 -0
- package/resources/users/metadatas.mjs +12 -0
- package/resources/users/metadatas.mjs.map +1 -0
- package/resources/users/users.d.ts +14 -0
- package/resources/users/users.d.ts.map +1 -0
- package/resources/users/users.js +43 -0
- package/resources/users/users.js.map +1 -0
- package/resources/users/users.mjs +16 -0
- package/resources/users/users.mjs.map +1 -0
- package/resources/users/wallets.d.ts +193 -0
- package/resources/users/wallets.d.ts.map +1 -0
- package/resources/users/wallets.js +28 -0
- package/resources/users/wallets.js.map +1 -0
- package/resources/users/wallets.mjs +24 -0
- package/resources/users/wallets.mjs.map +1 -0
- package/resources/websites.d.ts +203 -0
- package/resources/websites.d.ts.map +1 -0
- package/resources/websites.js +22 -0
- package/resources/websites.js.map +1 -0
- package/resources/websites.mjs +18 -0
- package/resources/websites.mjs.map +1 -0
- package/shims/node.d.ts +30 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +101 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +81 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +81 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +67 -0
- package/src/_shims/web-runtime.ts +103 -0
- package/src/_shims/web-types.d.ts +83 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +1201 -0
- package/src/error.ts +130 -0
- package/src/index.ts +235 -0
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +9 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +388 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/lib/.keep +4 -0
- package/src/resource.ts +11 -0
- package/src/resources/assets.ts +71 -0
- package/src/resources/auction-bids.ts +123 -0
- package/src/resources/drip/drip.ts +25 -0
- package/src/resources/drip/index.ts +5 -0
- package/src/resources/drip/quests.ts +210 -0
- package/src/resources/drip/status.ts +33 -0
- package/src/resources/index.ts +14 -0
- package/src/resources/loyalty/accounts.ts +199 -0
- package/src/resources/loyalty/badges.ts +435 -0
- package/src/resources/loyalty/currencies.ts +321 -0
- package/src/resources/loyalty/index.ts +61 -0
- package/src/resources/loyalty/loyalty.ts +159 -0
- package/src/resources/loyalty/multipliers.ts +238 -0
- package/src/resources/loyalty/rule-edits.ts +421 -0
- package/src/resources/loyalty/rules.ts +3513 -0
- package/src/resources/loyalty/transaction-entries.ts +229 -0
- package/src/resources/users/index.ts +12 -0
- package/src/resources/users/metadatas.ts +103 -0
- package/src/resources/users/users.ts +39 -0
- package/src/resources/users/wallets.ts +271 -0
- package/src/resources/websites.ts +259 -0
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +255 -0
- package/src/version.ts +1 -0
- package/uploads.d.ts +75 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +171 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +158 -0
- package/uploads.mjs.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../resource';
|
|
4
|
+
import * as Core from '../../core';
|
|
5
|
+
|
|
6
|
+
export class Status extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Retrieves the current status of a drip quest verification using the verification
|
|
9
|
+
* ID.
|
|
10
|
+
*/
|
|
11
|
+
retrieve(verificationId: string, options?: Core.RequestOptions): Core.APIPromise<StatusRetrieveResponse> {
|
|
12
|
+
return this._client.get(`/api/drip/status/${verificationId}`, options);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Schema for verification status
|
|
18
|
+
*/
|
|
19
|
+
export interface StatusRetrieveResponse {
|
|
20
|
+
/**
|
|
21
|
+
* Current status of the verification
|
|
22
|
+
*/
|
|
23
|
+
status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Unique identifier for the verification
|
|
27
|
+
*/
|
|
28
|
+
verificationId: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export declare namespace Status {
|
|
32
|
+
export { type StatusRetrieveResponse as StatusRetrieveResponse };
|
|
33
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export { Assets, type AssetCreateResponse, type AssetCreateParams } from './assets';
|
|
4
|
+
export { AuctionBids, type AuctionBidCreateParams, type AuctionBidListParams } from './auction-bids';
|
|
5
|
+
export { Drip } from './drip/drip';
|
|
6
|
+
export { Loyalty } from './loyalty/loyalty';
|
|
7
|
+
export { Users } from './users/users';
|
|
8
|
+
export {
|
|
9
|
+
Websites,
|
|
10
|
+
type WebsiteCreateResponse,
|
|
11
|
+
type WebsiteListResponse,
|
|
12
|
+
type WebsiteCreateParams,
|
|
13
|
+
type WebsiteListParams,
|
|
14
|
+
} from './websites';
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../resource';
|
|
4
|
+
import { isRequestOptions } from '../../core';
|
|
5
|
+
import * as Core from '../../core';
|
|
6
|
+
|
|
7
|
+
export class Accounts extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Get loyalty accounts
|
|
10
|
+
*/
|
|
11
|
+
list(query?: AccountListParams, options?: Core.RequestOptions): Core.APIPromise<AccountListResponse>;
|
|
12
|
+
list(options?: Core.RequestOptions): Core.APIPromise<AccountListResponse>;
|
|
13
|
+
list(
|
|
14
|
+
query: AccountListParams | Core.RequestOptions = {},
|
|
15
|
+
options?: Core.RequestOptions,
|
|
16
|
+
): Core.APIPromise<AccountListResponse> {
|
|
17
|
+
if (isRequestOptions(query)) {
|
|
18
|
+
return this.list({}, query);
|
|
19
|
+
}
|
|
20
|
+
return this._client.get('/', { query, ...options });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Schema for the response of getting loyalty accounts
|
|
26
|
+
*/
|
|
27
|
+
export interface AccountListResponse {
|
|
28
|
+
/**
|
|
29
|
+
* Array of loyalty accounts
|
|
30
|
+
*/
|
|
31
|
+
data: Array<AccountListResponse.Data>;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Indicates if there is a next page of results
|
|
35
|
+
*/
|
|
36
|
+
hasNextPage: boolean;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Optional message
|
|
40
|
+
*/
|
|
41
|
+
message?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export namespace AccountListResponse {
|
|
45
|
+
/**
|
|
46
|
+
* Schema for a loyalty account
|
|
47
|
+
*/
|
|
48
|
+
export interface Data {
|
|
49
|
+
/**
|
|
50
|
+
* Unique identifier for the loyalty account
|
|
51
|
+
*/
|
|
52
|
+
id: string;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Unique identifier for the loyalty currency
|
|
56
|
+
*/
|
|
57
|
+
loyaltyCurrencyId: string;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* User associated with the loyalty account
|
|
61
|
+
*/
|
|
62
|
+
user: Data.User | null;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Unique identifier for the user
|
|
66
|
+
*/
|
|
67
|
+
userId: string | null;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Balance amount in the loyalty account
|
|
71
|
+
*/
|
|
72
|
+
amount?: unknown;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Version number used for optimistic locking
|
|
76
|
+
*/
|
|
77
|
+
lockVersion?: unknown;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export namespace Data {
|
|
81
|
+
/**
|
|
82
|
+
* Schema for a user
|
|
83
|
+
*/
|
|
84
|
+
export interface User {
|
|
85
|
+
/**
|
|
86
|
+
* Unique identifier for the user
|
|
87
|
+
*/
|
|
88
|
+
id: string;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Array of metadata associated with the user
|
|
92
|
+
*/
|
|
93
|
+
userMetadata: Array<User.UserMetadata>;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Ethereum wallet address of the user
|
|
97
|
+
*/
|
|
98
|
+
walletAddress: string | null;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export namespace User {
|
|
102
|
+
/**
|
|
103
|
+
* Schema for user metadata
|
|
104
|
+
*/
|
|
105
|
+
export interface UserMetadata {
|
|
106
|
+
/**
|
|
107
|
+
* Discord username associated with the user
|
|
108
|
+
*/
|
|
109
|
+
discordUser: string | null;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Display name of the user
|
|
113
|
+
*/
|
|
114
|
+
displayName: string | null;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* URL of the user's logo
|
|
118
|
+
*/
|
|
119
|
+
logoUrl: string | null;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Twitter username associated with the user
|
|
123
|
+
*/
|
|
124
|
+
twitterUser: string | null;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Identifier for the wallet group
|
|
128
|
+
*/
|
|
129
|
+
walletGroupIdentifier: string | null;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface AccountListParams {
|
|
136
|
+
/**
|
|
137
|
+
* Discord username to filter accounts by
|
|
138
|
+
*/
|
|
139
|
+
discordUser?: string;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Whether to include wallet group information
|
|
143
|
+
*/
|
|
144
|
+
includeWalletGroup?: boolean | null;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Maximum number of accounts to return
|
|
148
|
+
*/
|
|
149
|
+
limit?: number | null;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Unique identifier for the loyalty currency
|
|
153
|
+
*/
|
|
154
|
+
loyaltyCurrencyId?: string;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Order the accounts by amount in ascending or descending order
|
|
158
|
+
*/
|
|
159
|
+
'orderBy[amount]'?: 'asc' | 'desc';
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Unique identifier for the organization to filter by
|
|
163
|
+
*/
|
|
164
|
+
organizationId?: string;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Pagination cursor to start after a specific account ID
|
|
168
|
+
*/
|
|
169
|
+
startingAfter?: string;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Twitter username to filter accounts by
|
|
173
|
+
*/
|
|
174
|
+
twitterUser?: string;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* User ID(s) to filter accounts by
|
|
178
|
+
*/
|
|
179
|
+
userId?: string | Array<string>;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Wallet address(es) to filter accounts by
|
|
183
|
+
*/
|
|
184
|
+
walletAddress?: string | Array<string>;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Wallet group identifier to filter accounts by
|
|
188
|
+
*/
|
|
189
|
+
walletGroupIdentifier?: string;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Unique identifier for the website to filter by
|
|
193
|
+
*/
|
|
194
|
+
websiteId?: string;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export declare namespace Accounts {
|
|
198
|
+
export { type AccountListResponse as AccountListResponse, type AccountListParams as AccountListParams };
|
|
199
|
+
}
|
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../resource';
|
|
4
|
+
import { isRequestOptions } from '../../core';
|
|
5
|
+
import * as Core from '../../core';
|
|
6
|
+
|
|
7
|
+
export class Badges extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* This endpoint allows you to configure a new badge.
|
|
10
|
+
*/
|
|
11
|
+
create(body: BadgeCreateParams, options?: Core.RequestOptions): Core.APIPromise<BadgeCreateResponse> {
|
|
12
|
+
return this._client.post('/api/loyalty/badges', { body, ...options });
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* This endpoint allows you to update an existing badge.
|
|
17
|
+
*/
|
|
18
|
+
update(
|
|
19
|
+
id: string,
|
|
20
|
+
body?: BadgeUpdateParams,
|
|
21
|
+
options?: Core.RequestOptions,
|
|
22
|
+
): Core.APIPromise<BadgeUpdateResponse>;
|
|
23
|
+
update(id: string, options?: Core.RequestOptions): Core.APIPromise<BadgeUpdateResponse>;
|
|
24
|
+
update(
|
|
25
|
+
id: string,
|
|
26
|
+
body: BadgeUpdateParams | Core.RequestOptions = {},
|
|
27
|
+
options?: Core.RequestOptions,
|
|
28
|
+
): Core.APIPromise<BadgeUpdateResponse> {
|
|
29
|
+
if (isRequestOptions(body)) {
|
|
30
|
+
return this.update(id, {}, body);
|
|
31
|
+
}
|
|
32
|
+
return this._client.post(`/api/loyalty/badges/${id}`, { body, ...options });
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* This endpoint allows you to fetch badge(s) data.
|
|
37
|
+
*/
|
|
38
|
+
list(query?: BadgeListParams, options?: Core.RequestOptions): Core.APIPromise<BadgeListResponse>;
|
|
39
|
+
list(options?: Core.RequestOptions): Core.APIPromise<BadgeListResponse>;
|
|
40
|
+
list(
|
|
41
|
+
query: BadgeListParams | Core.RequestOptions = {},
|
|
42
|
+
options?: Core.RequestOptions,
|
|
43
|
+
): Core.APIPromise<BadgeListResponse> {
|
|
44
|
+
if (isRequestOptions(query)) {
|
|
45
|
+
return this.list({}, query);
|
|
46
|
+
}
|
|
47
|
+
return this._client.get('/api/loyalty/badges', { query, ...options });
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* This endpoint allows you to delete a badge.
|
|
52
|
+
*/
|
|
53
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<BadgeDeleteResponse> {
|
|
54
|
+
return this._client.delete(`/api/loyalty/badges/${id}`, options);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* This endpoint allows you to revoke a badge from an account
|
|
59
|
+
*/
|
|
60
|
+
revoke(
|
|
61
|
+
id: string,
|
|
62
|
+
body?: BadgeRevokeParams,
|
|
63
|
+
options?: Core.RequestOptions,
|
|
64
|
+
): Core.APIPromise<BadgeRevokeResponse>;
|
|
65
|
+
revoke(id: string, options?: Core.RequestOptions): Core.APIPromise<BadgeRevokeResponse>;
|
|
66
|
+
revoke(
|
|
67
|
+
id: string,
|
|
68
|
+
body: BadgeRevokeParams | Core.RequestOptions = {},
|
|
69
|
+
options?: Core.RequestOptions,
|
|
70
|
+
): Core.APIPromise<BadgeRevokeResponse> {
|
|
71
|
+
if (isRequestOptions(body)) {
|
|
72
|
+
return this.revoke(id, {}, body);
|
|
73
|
+
}
|
|
74
|
+
return this._client.post(`/api/loyalty/badges/${id}/revoke`, { body, ...options });
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* This endpoint allows you to reward a badge for an account
|
|
79
|
+
*/
|
|
80
|
+
reward(
|
|
81
|
+
id: string,
|
|
82
|
+
body?: BadgeRewardParams,
|
|
83
|
+
options?: Core.RequestOptions,
|
|
84
|
+
): Core.APIPromise<BadgeRewardResponse>;
|
|
85
|
+
reward(id: string, options?: Core.RequestOptions): Core.APIPromise<BadgeRewardResponse>;
|
|
86
|
+
reward(
|
|
87
|
+
id: string,
|
|
88
|
+
body: BadgeRewardParams | Core.RequestOptions = {},
|
|
89
|
+
options?: Core.RequestOptions,
|
|
90
|
+
): Core.APIPromise<BadgeRewardResponse> {
|
|
91
|
+
if (isRequestOptions(body)) {
|
|
92
|
+
return this.reward(id, {}, body);
|
|
93
|
+
}
|
|
94
|
+
return this._client.post(`/api/loyalty/badges/${id}/reward`, { body, ...options });
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Response returned upon successful creation of the badge.
|
|
100
|
+
*/
|
|
101
|
+
export interface BadgeCreateResponse {
|
|
102
|
+
id: string;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Response returned upon successful update of the badge.
|
|
107
|
+
*/
|
|
108
|
+
export interface BadgeUpdateResponse {
|
|
109
|
+
id: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Response returned upon successful fetching of the badges.
|
|
114
|
+
*/
|
|
115
|
+
export interface BadgeListResponse {
|
|
116
|
+
badges: Array<BadgeListResponse.Badge>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export namespace BadgeListResponse {
|
|
120
|
+
export interface Badge {
|
|
121
|
+
/**
|
|
122
|
+
* UUID of the badge (converted to lowercase)
|
|
123
|
+
*/
|
|
124
|
+
id: string;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Count of rules and accounts with the badge
|
|
128
|
+
*/
|
|
129
|
+
_count: Badge._Count;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* The URL of the badge image
|
|
133
|
+
*/
|
|
134
|
+
imageUrl: string;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Array of rules for the badge
|
|
138
|
+
*/
|
|
139
|
+
loyaltyConditions: Array<Badge.LoyaltyCondition>;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* The name of the badge
|
|
143
|
+
*/
|
|
144
|
+
name: string;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* The description of the badge
|
|
148
|
+
*/
|
|
149
|
+
description?: string;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export namespace Badge {
|
|
153
|
+
/**
|
|
154
|
+
* Count of rules and accounts with the badge
|
|
155
|
+
*/
|
|
156
|
+
export interface _Count {
|
|
157
|
+
/**
|
|
158
|
+
* The number of accounts with the badge
|
|
159
|
+
*/
|
|
160
|
+
LoyaltyBadgeUser: number;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* The number of rules
|
|
164
|
+
*/
|
|
165
|
+
loyaltyConditions: number;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface LoyaltyCondition {
|
|
169
|
+
/**
|
|
170
|
+
* UUID of the rule (converted to lowercase)
|
|
171
|
+
*/
|
|
172
|
+
id: string;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* The type of rule
|
|
176
|
+
*/
|
|
177
|
+
type: 'rule' | 'section' | 'level' | 'points' | 'api' | 'badge';
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* The amount of the rule
|
|
181
|
+
*/
|
|
182
|
+
amount?: number;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* The description of the rule
|
|
186
|
+
*/
|
|
187
|
+
description?: string;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* UUID of the currency (optional, converted to lowercase)
|
|
191
|
+
*/
|
|
192
|
+
loyaltyCurrencyId?: string;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* UUID of the rule group (optional, converted to lowercase)
|
|
196
|
+
*/
|
|
197
|
+
loyaltyRuleGroupId?: string;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* UUID of the rule (optional, converted to lowercase)
|
|
201
|
+
*/
|
|
202
|
+
loyaltyRuleId?: string;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Response returned upon successful deletion of the badge.
|
|
209
|
+
*/
|
|
210
|
+
export interface BadgeDeleteResponse {
|
|
211
|
+
id: string;
|
|
212
|
+
|
|
213
|
+
deletedAt: string;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Response returned upon successful update of the user badge
|
|
218
|
+
*/
|
|
219
|
+
export interface BadgeRevokeResponse {
|
|
220
|
+
data: BadgeRevokeResponse.Data;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* The message returned upon update of the badge
|
|
224
|
+
*/
|
|
225
|
+
message: string;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export namespace BadgeRevokeResponse {
|
|
229
|
+
export interface Data {
|
|
230
|
+
id: string;
|
|
231
|
+
|
|
232
|
+
loyaltyBadgeId: string;
|
|
233
|
+
|
|
234
|
+
status: 'active' | 'inactive' | 'revoked';
|
|
235
|
+
|
|
236
|
+
userId: string;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Response returned upon successful update of the user badge
|
|
242
|
+
*/
|
|
243
|
+
export interface BadgeRewardResponse {
|
|
244
|
+
data: BadgeRewardResponse.Data;
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* The message returned upon update of the badge
|
|
248
|
+
*/
|
|
249
|
+
message: string;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export namespace BadgeRewardResponse {
|
|
253
|
+
export interface Data {
|
|
254
|
+
id: string;
|
|
255
|
+
|
|
256
|
+
loyaltyBadgeId: string;
|
|
257
|
+
|
|
258
|
+
status: 'active' | 'inactive' | 'revoked';
|
|
259
|
+
|
|
260
|
+
userId: string;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export interface BadgeCreateParams {
|
|
265
|
+
/**
|
|
266
|
+
* The URL of the badge image
|
|
267
|
+
*/
|
|
268
|
+
imageUrl: string;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* The name of the badge
|
|
272
|
+
*/
|
|
273
|
+
name: string;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* UUID of the organization (optional, converted to lowercase)
|
|
277
|
+
*/
|
|
278
|
+
organizationId: string;
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Array of rules for the badge
|
|
282
|
+
*/
|
|
283
|
+
rules: Array<BadgeCreateParams.Rule>;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* UUID of the website (optional, converted to lowercase)
|
|
287
|
+
*/
|
|
288
|
+
websiteId: string;
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* The description of the badge
|
|
292
|
+
*/
|
|
293
|
+
description?: string;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export namespace BadgeCreateParams {
|
|
297
|
+
/**
|
|
298
|
+
* Schema for a loyalty condition rule.
|
|
299
|
+
*/
|
|
300
|
+
export interface Rule {
|
|
301
|
+
/**
|
|
302
|
+
* The type of rule
|
|
303
|
+
*/
|
|
304
|
+
type: 'rule' | 'section' | 'level' | 'points' | 'api' | 'badge';
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* The amount of the rule
|
|
308
|
+
*/
|
|
309
|
+
amount?: number | null;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* The description of the rule
|
|
313
|
+
*/
|
|
314
|
+
description?: string;
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* UUID of the badge (optional, converted to lowercase)
|
|
318
|
+
*/
|
|
319
|
+
loyaltyBadgeId?: string | null;
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* UUID of the currency (optional, converted to lowercase)
|
|
323
|
+
*/
|
|
324
|
+
loyaltyCurrencyId?: string | null;
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* UUID of the Loyalty Leaderboard (optional, converted to lowercase)
|
|
328
|
+
*/
|
|
329
|
+
loyaltyLeaderboardViewId?: string | null;
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* UUID of the rule group (optional, converted to lowercase)
|
|
333
|
+
*/
|
|
334
|
+
loyaltyRuleGroupId?: string | null;
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* UUID of the rule (optional, converted to lowercase)
|
|
338
|
+
*/
|
|
339
|
+
loyaltyRuleId?: string | null;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export interface BadgeUpdateParams {
|
|
344
|
+
/**
|
|
345
|
+
* The description of the badge
|
|
346
|
+
*/
|
|
347
|
+
description?: string;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* The URL of the badge image
|
|
351
|
+
*/
|
|
352
|
+
imageUrl?: string;
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* The name of the badge
|
|
356
|
+
*/
|
|
357
|
+
name?: string;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export interface BadgeListParams {
|
|
361
|
+
/**
|
|
362
|
+
* Array of badge IDs (converted to lowercase) to fetch
|
|
363
|
+
*/
|
|
364
|
+
badgeIds?: Array<string>;
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Include deleted badges in the response
|
|
368
|
+
*/
|
|
369
|
+
includeDeleted?: boolean | null;
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Number of badges to fetch
|
|
373
|
+
*/
|
|
374
|
+
limit?: number | null;
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* UUID of the organization (optional, converted to lowercase)
|
|
378
|
+
*/
|
|
379
|
+
organizationId?: string;
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* UUID of the badge to start after (converted to lowercase)
|
|
383
|
+
*/
|
|
384
|
+
startingAfter?: string;
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* UUID of the user (optional, converted to lowercase)
|
|
388
|
+
*/
|
|
389
|
+
userId?: string;
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* UUID of the website (optional, converted to lowercase)
|
|
393
|
+
*/
|
|
394
|
+
websiteId?: string;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
export interface BadgeRevokeParams {
|
|
398
|
+
/**
|
|
399
|
+
* UUID of the user (converted to lowercase)
|
|
400
|
+
*/
|
|
401
|
+
userId?: string;
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Validated and formatted wallet address
|
|
405
|
+
*/
|
|
406
|
+
walletAddress?: string;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
export interface BadgeRewardParams {
|
|
410
|
+
/**
|
|
411
|
+
* UUID of the user (converted to lowercase)
|
|
412
|
+
*/
|
|
413
|
+
userId?: string;
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Validated and formatted wallet address
|
|
417
|
+
*/
|
|
418
|
+
walletAddress?: string;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
export declare namespace Badges {
|
|
422
|
+
export {
|
|
423
|
+
type BadgeCreateResponse as BadgeCreateResponse,
|
|
424
|
+
type BadgeUpdateResponse as BadgeUpdateResponse,
|
|
425
|
+
type BadgeListResponse as BadgeListResponse,
|
|
426
|
+
type BadgeDeleteResponse as BadgeDeleteResponse,
|
|
427
|
+
type BadgeRevokeResponse as BadgeRevokeResponse,
|
|
428
|
+
type BadgeRewardResponse as BadgeRewardResponse,
|
|
429
|
+
type BadgeCreateParams as BadgeCreateParams,
|
|
430
|
+
type BadgeUpdateParams as BadgeUpdateParams,
|
|
431
|
+
type BadgeListParams as BadgeListParams,
|
|
432
|
+
type BadgeRevokeParams as BadgeRevokeParams,
|
|
433
|
+
type BadgeRewardParams as BadgeRewardParams,
|
|
434
|
+
};
|
|
435
|
+
}
|