@snagsolutions/sdk 0.1.0-alpha.26 → 0.1.0-alpha.260
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 +140 -153
- package/LICENSE +1 -1
- package/README.md +15 -23
- package/core.d.ts +9 -6
- package/core.d.ts.map +1 -1
- package/core.js +36 -33
- package/core.js.map +1 -1
- package/core.mjs +36 -33
- package/core.mjs.map +1 -1
- package/index.d.mts +15 -9
- package/index.d.ts +15 -9
- package/index.d.ts.map +1 -1
- package/index.js +13 -6
- package/index.js.map +1 -1
- package/index.mjs +14 -7
- package/index.mjs.map +1 -1
- package/internal/utils/query.d.ts +2 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +33 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +6 -0
- package/internal/utils/query.mjs.map +1 -0
- 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 +341 -0
- package/resources/auctions/auctions.d.ts.map +1 -0
- package/resources/auctions/auctions.js +72 -0
- package/resources/auctions/auctions.js.map +1 -0
- package/resources/auctions/auctions.mjs +45 -0
- package/resources/auctions/auctions.mjs.map +1 -0
- package/resources/auctions/index.d.ts +3 -0
- package/resources/auctions/index.d.ts.map +1 -0
- package/resources/auctions/index.js +9 -0
- package/resources/auctions/index.js.map +1 -0
- package/resources/auctions/index.mjs +4 -0
- package/resources/auctions/index.mjs.map +1 -0
- package/resources/auctions/website-user-attributes/index.d.ts +3 -0
- package/resources/auctions/website-user-attributes/index.d.ts.map +1 -0
- package/resources/auctions/website-user-attributes/index.js +9 -0
- package/resources/auctions/website-user-attributes/index.js.map +1 -0
- package/resources/auctions/website-user-attributes/index.mjs +4 -0
- package/resources/auctions/website-user-attributes/index.mjs.map +1 -0
- package/resources/auctions/website-user-attributes/values.d.ts +126 -0
- package/resources/auctions/website-user-attributes/values.d.ts.map +1 -0
- package/resources/auctions/website-user-attributes/values.js +49 -0
- package/resources/auctions/website-user-attributes/values.js.map +1 -0
- package/resources/auctions/website-user-attributes/values.mjs +45 -0
- package/resources/auctions/website-user-attributes/values.mjs.map +1 -0
- package/resources/auctions/website-user-attributes/website-user-attributes.d.ts +136 -0
- package/resources/auctions/website-user-attributes/website-user-attributes.d.ts.map +1 -0
- package/resources/auctions/website-user-attributes/website-user-attributes.js +76 -0
- package/resources/auctions/website-user-attributes/website-user-attributes.js.map +1 -0
- package/resources/auctions/website-user-attributes/website-user-attributes.mjs +49 -0
- package/resources/auctions/website-user-attributes/website-user-attributes.mjs.map +1 -0
- package/resources/auctions/website-user-attributes.d.ts +2 -0
- package/resources/auctions/website-user-attributes.d.ts.map +1 -0
- package/resources/auctions/website-user-attributes.js +19 -0
- package/resources/auctions/website-user-attributes.js.map +1 -0
- package/resources/auctions/website-user-attributes.mjs +3 -0
- package/resources/auctions/website-user-attributes.mjs.map +1 -0
- package/resources/auctions.d.ts +1 -133
- package/resources/auctions.d.ts.map +1 -1
- package/resources/auctions.js +15 -22
- package/resources/auctions.js.map +1 -1
- package/resources/auctions.mjs +1 -20
- package/resources/auctions.mjs.map +1 -1
- package/resources/auth.d.ts +66 -6
- package/resources/auth.d.ts.map +1 -1
- package/resources/auth.js +6 -0
- package/resources/auth.js.map +1 -1
- package/resources/auth.mjs +6 -0
- package/resources/auth.mjs.map +1 -1
- package/resources/index.d.ts +5 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +4 -3
- package/resources/index.mjs.map +1 -1
- package/resources/loyalty/account-streaks.d.ts +96 -0
- package/resources/loyalty/account-streaks.d.ts.map +1 -0
- package/resources/loyalty/account-streaks.js +24 -0
- package/resources/loyalty/account-streaks.js.map +1 -0
- package/resources/loyalty/account-streaks.mjs +20 -0
- package/resources/loyalty/account-streaks.mjs.map +1 -0
- package/resources/loyalty/accounts.d.ts +60 -16
- package/resources/loyalty/accounts.d.ts.map +1 -1
- package/resources/loyalty/accounts.js +14 -0
- package/resources/loyalty/accounts.js.map +1 -1
- package/resources/loyalty/accounts.mjs +14 -0
- package/resources/loyalty/accounts.mjs.map +1 -1
- package/resources/loyalty/badges.d.ts +885 -136
- package/resources/loyalty/badges.d.ts.map +1 -1
- package/resources/loyalty/badges.js +19 -1
- package/resources/loyalty/badges.js.map +1 -1
- package/resources/loyalty/badges.mjs +19 -1
- package/resources/loyalty/badges.mjs.map +1 -1
- package/resources/loyalty/currencies.d.ts +19 -0
- package/resources/loyalty/currencies.d.ts.map +1 -1
- package/resources/loyalty/currencies.js +19 -0
- package/resources/loyalty/currencies.js.map +1 -1
- package/resources/loyalty/currencies.mjs +19 -0
- package/resources/loyalty/currencies.mjs.map +1 -1
- package/resources/loyalty/index.d.ts +3 -3
- package/resources/loyalty/index.d.ts.map +1 -1
- package/resources/loyalty/index.js +5 -5
- package/resources/loyalty/index.js.map +1 -1
- package/resources/loyalty/index.mjs +2 -2
- package/resources/loyalty/index.mjs.map +1 -1
- package/resources/loyalty/loyalty.d.ts +9 -9
- package/resources/loyalty/loyalty.d.ts.map +1 -1
- package/resources/loyalty/loyalty.js +6 -6
- package/resources/loyalty/loyalty.js.map +1 -1
- package/resources/loyalty/loyalty.mjs +6 -6
- package/resources/loyalty/loyalty.mjs.map +1 -1
- package/resources/loyalty/multipliers.d.ts +39 -2
- package/resources/loyalty/multipliers.d.ts.map +1 -1
- package/resources/loyalty/multipliers.js +23 -0
- package/resources/loyalty/multipliers.js.map +1 -1
- package/resources/loyalty/multipliers.mjs +23 -0
- package/resources/loyalty/multipliers.mjs.map +1 -1
- package/resources/loyalty/questions-responses.d.ts +55 -4
- package/resources/loyalty/questions-responses.d.ts.map +1 -1
- package/resources/loyalty/questions-responses.js +9 -0
- package/resources/loyalty/questions-responses.js.map +1 -1
- package/resources/loyalty/questions-responses.mjs +9 -0
- package/resources/loyalty/questions-responses.mjs.map +1 -1
- package/resources/loyalty/questions.d.ts +60 -6
- package/resources/loyalty/questions.d.ts.map +1 -1
- package/resources/loyalty/questions.js +39 -0
- package/resources/loyalty/questions.js.map +1 -1
- package/resources/loyalty/questions.mjs +39 -0
- package/resources/loyalty/questions.mjs.map +1 -1
- package/resources/loyalty/rule-edits.d.ts +2898 -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 +284 -56
- package/resources/loyalty/rule-groups.d.ts.map +1 -1
- package/resources/loyalty/rule-groups.js +18 -0
- package/resources/loyalty/rule-groups.js.map +1 -1
- package/resources/loyalty/rule-groups.mjs +18 -0
- package/resources/loyalty/rule-groups.mjs.map +1 -1
- package/resources/loyalty/rules.d.ts +2368 -346
- package/resources/loyalty/rules.d.ts.map +1 -1
- package/resources/loyalty/rules.js +40 -9
- package/resources/loyalty/rules.js.map +1 -1
- package/resources/loyalty/rules.mjs +40 -9
- package/resources/loyalty/rules.mjs.map +1 -1
- package/resources/loyalty/transactions/index.d.ts +4 -0
- package/resources/loyalty/transactions/index.d.ts.map +1 -0
- package/resources/loyalty/transactions/index.js +11 -0
- package/resources/loyalty/transactions/index.js.map +1 -0
- package/resources/loyalty/transactions/index.mjs +5 -0
- package/resources/loyalty/transactions/index.mjs.map +1 -0
- package/resources/loyalty/transactions/posts.d.ts +145 -0
- package/resources/loyalty/transactions/posts.d.ts.map +1 -0
- package/resources/loyalty/transactions/posts.js +32 -0
- package/resources/loyalty/transactions/posts.js.map +1 -0
- package/resources/loyalty/transactions/posts.mjs +28 -0
- package/resources/loyalty/transactions/posts.mjs.map +1 -0
- package/resources/loyalty/transactions/rule-statuses.d.ts +121 -0
- package/resources/loyalty/transactions/rule-statuses.d.ts.map +1 -0
- package/resources/loyalty/transactions/rule-statuses.js +30 -0
- package/resources/loyalty/transactions/rule-statuses.js.map +1 -0
- package/resources/loyalty/transactions/rule-statuses.mjs +26 -0
- package/resources/loyalty/transactions/rule-statuses.mjs.map +1 -0
- package/resources/loyalty/transactions/transactions.d.ts +566 -0
- package/resources/loyalty/transactions/transactions.d.ts.map +1 -0
- package/resources/loyalty/transactions/transactions.js +110 -0
- package/resources/loyalty/transactions/transactions.js.map +1 -0
- package/resources/loyalty/transactions/transactions.mjs +83 -0
- package/resources/loyalty/transactions/transactions.mjs.map +1 -0
- package/resources/loyalty/transactions.d.ts +1 -253
- package/resources/loyalty/transactions.d.ts.map +1 -1
- package/resources/loyalty/transactions.js +15 -18
- package/resources/loyalty/transactions.js.map +1 -1
- package/resources/loyalty/transactions.mjs +1 -16
- package/resources/loyalty/transactions.mjs.map +1 -1
- package/resources/minting/allowlist.d.ts +84 -0
- package/resources/minting/allowlist.d.ts.map +1 -0
- package/resources/minting/allowlist.js +42 -0
- package/resources/minting/allowlist.js.map +1 -0
- package/resources/minting/allowlist.mjs +38 -0
- package/resources/minting/allowlist.mjs.map +1 -0
- package/resources/minting/contracts.d.ts +165 -0
- package/resources/minting/contracts.d.ts.map +1 -0
- package/resources/minting/contracts.js +30 -0
- package/resources/minting/contracts.js.map +1 -0
- package/resources/minting/contracts.mjs +26 -0
- package/resources/minting/contracts.mjs.map +1 -0
- package/resources/minting/index.d.ts +5 -0
- package/resources/minting/index.d.ts.map +1 -0
- package/resources/minting/index.js +13 -0
- package/resources/minting/index.js.map +1 -0
- package/resources/minting/index.mjs +6 -0
- package/resources/minting/index.mjs.map +1 -0
- package/resources/minting/minting.d.ts +146 -0
- package/resources/minting/minting.d.ts.map +1 -0
- package/resources/minting/minting.js +79 -0
- package/resources/minting/minting.js.map +1 -0
- package/resources/minting/minting.mjs +52 -0
- package/resources/minting/minting.mjs.map +1 -0
- package/resources/minting/status.d.ts +44 -0
- package/resources/minting/status.d.ts.map +1 -0
- package/resources/minting/status.js +33 -0
- package/resources/minting/status.js.map +1 -0
- package/resources/minting/status.mjs +29 -0
- package/resources/minting/status.mjs.map +1 -0
- package/resources/minting.d.ts +1 -94
- package/resources/minting.d.ts.map +1 -1
- package/resources/minting.js +15 -11
- package/resources/minting.js.map +1 -1
- package/resources/minting.mjs +1 -9
- package/resources/minting.mjs.map +1 -1
- package/resources/referral/referral.d.ts +12 -3
- package/resources/referral/referral.d.ts.map +1 -1
- package/resources/referral/referral.js +11 -5
- package/resources/referral/referral.js.map +1 -1
- package/resources/referral/referral.mjs +11 -5
- package/resources/referral/referral.mjs.map +1 -1
- package/resources/referral/users.d.ts +30 -3
- package/resources/referral/users.d.ts.map +1 -1
- package/resources/referral/users.js +12 -4
- package/resources/referral/users.js.map +1 -1
- package/resources/referral/users.mjs +12 -4
- package/resources/referral/users.mjs.map +1 -1
- package/resources/token-claims.d.ts +162 -0
- package/resources/token-claims.d.ts.map +1 -0
- package/resources/token-claims.js +46 -0
- package/resources/token-claims.js.map +1 -0
- package/resources/token-claims.mjs +42 -0
- package/resources/token-claims.mjs.map +1 -0
- package/resources/users/index.d.ts +1 -1
- package/resources/users/index.d.ts.map +1 -1
- package/resources/users/index.js.map +1 -1
- package/resources/users/index.mjs.map +1 -1
- package/resources/users/metadatas.d.ts +40 -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 +203 -36
- 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/index.d.ts +1 -1
- package/resources/websites/index.d.ts.map +1 -1
- package/resources/websites/index.js.map +1 -1
- package/resources/websites/index.mjs +1 -1
- package/resources/websites/index.mjs.map +1 -1
- package/resources/websites/website-collections.d.ts +0 -69
- package/resources/websites/website-collections.d.ts.map +1 -1
- package/resources/websites/website-collections.js +0 -16
- package/resources/websites/website-collections.js.map +1 -1
- package/resources/websites/website-collections.mjs +0 -16
- package/resources/websites/website-collections.mjs.map +1 -1
- package/resources/websites/website-user-roles.d.ts +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 +21 -99
- package/resources/websites/websites.d.ts.map +1 -1
- package/resources/websites/websites.js +9 -1
- package/resources/websites/websites.js.map +1 -1
- package/resources/websites/websites.mjs +10 -2
- package/resources/websites/websites.mjs.map +1 -1
- package/src/core.ts +40 -36
- package/src/index.ts +84 -6
- package/src/internal/utils/query.ts +7 -0
- package/src/resource.ts +1 -1
- package/src/resources/assets.ts +18 -3
- package/src/resources/auctions/auctions.ts +523 -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 +124 -6
- package/src/resources/index.ts +41 -3
- package/src/resources/loyalty/account-streaks.ts +128 -0
- package/src/resources/loyalty/accounts.ts +65 -18
- package/src/resources/loyalty/badges.ts +1058 -146
- package/src/resources/loyalty/currencies.ts +19 -0
- package/src/resources/loyalty/index.ts +13 -2
- package/src/resources/loyalty/loyalty.ts +30 -12
- package/src/resources/loyalty/multipliers.ts +43 -4
- package/src/resources/loyalty/questions-responses.ts +64 -4
- package/src/resources/loyalty/questions.ts +64 -6
- package/src/resources/loyalty/rule-edits.ts +4208 -94
- package/src/resources/loyalty/rule-groups.ts +473 -64
- package/src/resources/loyalty/rules.ts +3706 -403
- package/src/resources/loyalty/transactions/index.ts +29 -0
- package/src/resources/loyalty/transactions/posts.ts +221 -0
- package/src/resources/loyalty/transactions/rule-statuses.ts +179 -0
- package/src/resources/loyalty/transactions/transactions.ts +930 -0
- package/src/resources/loyalty/transactions.ts +1 -446
- package/src/resources/minting/allowlist.ts +116 -0
- package/src/resources/minting/contracts.ts +415 -0
- package/src/resources/minting/index.ts +29 -0
- package/src/resources/minting/minting.ts +285 -0
- package/src/resources/minting/status.ts +70 -0
- package/src/resources/minting.ts +1 -157
- package/src/resources/referral/referral.ts +15 -11
- package/src/resources/referral/users.ts +45 -5
- package/src/resources/token-claims.ts +311 -0
- package/src/resources/users/index.ts +4 -0
- package/src/resources/users/metadatas.ts +66 -3
- package/src/resources/users/users.ts +277 -39
- package/src/resources/websites/index.ts +1 -6
- package/src/resources/websites/website-collections.ts +1 -146
- package/src/resources/websites/website-user-roles.ts +26 -1
- package/src/resources/websites/websites.ts +22 -127
- 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
|
@@ -0,0 +1,110 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.Transactions = void 0;
|
|
28
|
+
const resource_1 = require("../../../resource.js");
|
|
29
|
+
const core_1 = require("../../../core.js");
|
|
30
|
+
const PostsAPI = __importStar(require("./posts.js"));
|
|
31
|
+
const posts_1 = require("./posts.js");
|
|
32
|
+
const RuleStatusesAPI = __importStar(require("./rule-statuses.js"));
|
|
33
|
+
const rule_statuses_1 = require("./rule-statuses.js");
|
|
34
|
+
class Transactions extends resource_1.APIResource {
|
|
35
|
+
constructor() {
|
|
36
|
+
super(...arguments);
|
|
37
|
+
this.ruleStatuses = new RuleStatusesAPI.RuleStatuses(this._client);
|
|
38
|
+
this.posts = new PostsAPI.Posts(this._client);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Create a loyalty transaction to update account balances.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const response =
|
|
46
|
+
* await client.loyalty.transactions.createTransaction({
|
|
47
|
+
* description: 'Purchase of item X',
|
|
48
|
+
* entries: [{ amount: 5 }],
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
createTransaction(body, options) {
|
|
53
|
+
return this._client.post('/api/loyalty/transactions', { body, ...options });
|
|
54
|
+
}
|
|
55
|
+
getTransactionEntries(query = {}, options) {
|
|
56
|
+
if ((0, core_1.isRequestOptions)(query)) {
|
|
57
|
+
return this.getTransactionEntries({}, query);
|
|
58
|
+
}
|
|
59
|
+
return this._client.get('/api/loyalty/transaction_entries', { query, ...options });
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* This endpoint allows you to fetch users for a specific badge.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* const response =
|
|
67
|
+
* await client.loyalty.transactions.listBadgeUsers({
|
|
68
|
+
* loyaltyBadgeId: '123e4567-e89b-12d3-a456-426614174222',
|
|
69
|
+
* });
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
listBadgeUsers(query, options) {
|
|
73
|
+
return this._client.get('/api/loyalty/badge_users', { query, ...options });
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Retrieve configured loyalty rule chains
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* const response =
|
|
81
|
+
* await client.loyalty.transactions.listRuleChains({
|
|
82
|
+
* organizationId: '123e4567-e89b-12d3-a456-426614174001',
|
|
83
|
+
* websiteId: '123e4567-e89b-12d3-a456-426614174002',
|
|
84
|
+
* });
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
listRuleChains(query, options) {
|
|
88
|
+
return this._client.get('/api/loyalty/rule_chains', { query, ...options });
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Reset Loyalty Currency of a website
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```ts
|
|
95
|
+
* const response =
|
|
96
|
+
* await client.loyalty.transactions.resetLoyaltyCurrency({
|
|
97
|
+
* loyaltyCurrencyId:
|
|
98
|
+
* '123e4567-e89b-12d3-a456-426614174000',
|
|
99
|
+
* type: 'loyalty_reset_balances',
|
|
100
|
+
* });
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
resetLoyaltyCurrency(body, options) {
|
|
104
|
+
return this._client.post('/api/loyalty/reset', { body, ...options });
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
exports.Transactions = Transactions;
|
|
108
|
+
Transactions.RuleStatuses = rule_statuses_1.RuleStatuses;
|
|
109
|
+
Transactions.Posts = posts_1.Posts;
|
|
110
|
+
//# sourceMappingURL=transactions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../../../src/resources/loyalty/transactions/transactions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,mDAAgD;AAChD,2CAAiD;AAEjD,qDAAoC;AACpC,sCAAwG;AACxG,oEAAmD;AACnD,sDAMyB;AAEzB,MAAa,YAAa,SAAQ,sBAAW;IAA7C;;QACE,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5F,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAwG3D,CAAC;IAtGC;;;;;;;;;;;OAWG;IACH,iBAAiB,CACf,IAAwC,EACxC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;IAmBD,qBAAqB,CACnB,QAAsE,EAAE,EACxE,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,qBAAqB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC9C;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kCAAkC,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;IAED;;;;;;;;;;OAUG;IACH,cAAc,CACZ,KAAsC,EACtC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;;;;;;OAWG;IACH,cAAc,CACZ,KAAsC,EACtC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,oBAAoB,CAClB,IAA2C,EAC3C,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;CACF;AA1GD,oCA0GC;AAuwBD,YAAY,CAAC,YAAY,GAAG,4BAAY,CAAC;AACzC,YAAY,CAAC,KAAK,GAAG,aAAK,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../resource.mjs";
|
|
3
|
+
import { isRequestOptions } from "../../../core.mjs";
|
|
4
|
+
import * as PostsAPI from "./posts.mjs";
|
|
5
|
+
import { Posts } from "./posts.mjs";
|
|
6
|
+
import * as RuleStatusesAPI from "./rule-statuses.mjs";
|
|
7
|
+
import { RuleStatuses, } from "./rule-statuses.mjs";
|
|
8
|
+
export class Transactions extends APIResource {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.ruleStatuses = new RuleStatusesAPI.RuleStatuses(this._client);
|
|
12
|
+
this.posts = new PostsAPI.Posts(this._client);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Create a loyalty transaction to update account balances.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const response =
|
|
20
|
+
* await client.loyalty.transactions.createTransaction({
|
|
21
|
+
* description: 'Purchase of item X',
|
|
22
|
+
* entries: [{ amount: 5 }],
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
createTransaction(body, options) {
|
|
27
|
+
return this._client.post('/api/loyalty/transactions', { body, ...options });
|
|
28
|
+
}
|
|
29
|
+
getTransactionEntries(query = {}, options) {
|
|
30
|
+
if (isRequestOptions(query)) {
|
|
31
|
+
return this.getTransactionEntries({}, query);
|
|
32
|
+
}
|
|
33
|
+
return this._client.get('/api/loyalty/transaction_entries', { query, ...options });
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* This endpoint allows you to fetch users for a specific badge.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const response =
|
|
41
|
+
* await client.loyalty.transactions.listBadgeUsers({
|
|
42
|
+
* loyaltyBadgeId: '123e4567-e89b-12d3-a456-426614174222',
|
|
43
|
+
* });
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
listBadgeUsers(query, options) {
|
|
47
|
+
return this._client.get('/api/loyalty/badge_users', { query, ...options });
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Retrieve configured loyalty rule chains
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* const response =
|
|
55
|
+
* await client.loyalty.transactions.listRuleChains({
|
|
56
|
+
* organizationId: '123e4567-e89b-12d3-a456-426614174001',
|
|
57
|
+
* websiteId: '123e4567-e89b-12d3-a456-426614174002',
|
|
58
|
+
* });
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
listRuleChains(query, options) {
|
|
62
|
+
return this._client.get('/api/loyalty/rule_chains', { query, ...options });
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Reset Loyalty Currency of a website
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* const response =
|
|
70
|
+
* await client.loyalty.transactions.resetLoyaltyCurrency({
|
|
71
|
+
* loyaltyCurrencyId:
|
|
72
|
+
* '123e4567-e89b-12d3-a456-426614174000',
|
|
73
|
+
* type: 'loyalty_reset_balances',
|
|
74
|
+
* });
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
resetLoyaltyCurrency(body, options) {
|
|
78
|
+
return this._client.post('/api/loyalty/reset', { body, ...options });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
Transactions.RuleStatuses = RuleStatuses;
|
|
82
|
+
Transactions.Posts = Posts;
|
|
83
|
+
//# sourceMappingURL=transactions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transactions.mjs","sourceRoot":"","sources":["../../../src/resources/loyalty/transactions/transactions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAEpB,KAAK,QAAQ;OACb,EAA0E,KAAK,EAAE;OACjF,KAAK,eAAe;OACpB,EAKL,YAAY,GACb;AAED,MAAM,OAAO,YAAa,SAAQ,WAAW;IAA7C;;QACE,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5F,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAwG3D,CAAC;IAtGC;;;;;;;;;;;OAWG;IACH,iBAAiB,CACf,IAAwC,EACxC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;IAmBD,qBAAqB,CACnB,QAAsE,EAAE,EACxE,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,qBAAqB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC9C;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kCAAkC,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;IAED;;;;;;;;;;OAUG;IACH,cAAc,CACZ,KAAsC,EACtC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;;;;;;OAWG;IACH,cAAc,CACZ,KAAsC,EACtC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,oBAAoB,CAClB,IAA2C,EAC3C,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;CACF;AAuwBD,YAAY,CAAC,YAAY,GAAG,YAAY,CAAC;AACzC,YAAY,CAAC,KAAK,GAAG,KAAK,CAAC"}
|
|
@@ -1,254 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import * as Core from "../../core.js";
|
|
3
|
-
export declare class Transactions extends APIResource {
|
|
4
|
-
/**
|
|
5
|
-
* Create a loyalty transaction to update account balances.
|
|
6
|
-
*/
|
|
7
|
-
createTransaction(body: TransactionCreateTransactionParams, options?: Core.RequestOptions): Core.APIPromise<TransactionCreateTransactionResponse>;
|
|
8
|
-
/**
|
|
9
|
-
* Fetch loyalty transaction entries for wallets or users, representing account
|
|
10
|
-
* balance changes.
|
|
11
|
-
*/
|
|
12
|
-
getTransactionEntries(query?: TransactionGetTransactionEntriesParams, options?: Core.RequestOptions): Core.APIPromise<TransactionGetTransactionEntriesResponse>;
|
|
13
|
-
getTransactionEntries(options?: Core.RequestOptions): Core.APIPromise<TransactionGetTransactionEntriesResponse>;
|
|
14
|
-
}
|
|
15
|
-
export interface TransactionCreateTransactionResponse {
|
|
16
|
-
id: string;
|
|
17
|
-
createdAt: string;
|
|
18
|
-
description: string;
|
|
19
|
-
entries: Array<TransactionCreateTransactionResponse.Entry>;
|
|
20
|
-
updatedAt: string;
|
|
21
|
-
}
|
|
22
|
-
export declare namespace TransactionCreateTransactionResponse {
|
|
23
|
-
interface Entry {
|
|
24
|
-
amount: number;
|
|
25
|
-
/**
|
|
26
|
-
* Direction of the transaction entry
|
|
27
|
-
*/
|
|
28
|
-
direction: 'credit' | 'debit';
|
|
29
|
-
walletAddress: string;
|
|
30
|
-
idempotencyKey?: string;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
export interface TransactionGetTransactionEntriesResponse {
|
|
34
|
-
data: Array<TransactionGetTransactionEntriesResponse.Data>;
|
|
35
|
-
hasNextPage: boolean;
|
|
36
|
-
}
|
|
37
|
-
export declare namespace TransactionGetTransactionEntriesResponse {
|
|
38
|
-
/**
|
|
39
|
-
* Schema for a loyalty transaction entry
|
|
40
|
-
*/
|
|
41
|
-
interface Data {
|
|
42
|
-
/**
|
|
43
|
-
* Unique identifier for the transaction entry
|
|
44
|
-
*/
|
|
45
|
-
id: string;
|
|
46
|
-
/**
|
|
47
|
-
* Amount involved in the transaction
|
|
48
|
-
*/
|
|
49
|
-
amount: number;
|
|
50
|
-
/**
|
|
51
|
-
* Timestamp when the transaction entry was created
|
|
52
|
-
*/
|
|
53
|
-
createdAt: string;
|
|
54
|
-
/**
|
|
55
|
-
* Direction of the transaction entry
|
|
56
|
-
*/
|
|
57
|
-
direction: 'credit' | 'debit';
|
|
58
|
-
/**
|
|
59
|
-
* Unique identifier for the loyalty account
|
|
60
|
-
*/
|
|
61
|
-
loyaltyAccountId: string;
|
|
62
|
-
/**
|
|
63
|
-
* Details of the loyalty transaction
|
|
64
|
-
*/
|
|
65
|
-
loyaltyTransaction: Data.LoyaltyTransaction;
|
|
66
|
-
/**
|
|
67
|
-
* Unique identifier for the organization
|
|
68
|
-
*/
|
|
69
|
-
organizationId: string;
|
|
70
|
-
/**
|
|
71
|
-
* Type of the loyalty transaction
|
|
72
|
-
*/
|
|
73
|
-
type: 'auction_bid' | 'direct_mint' | 'loyalty_rule' | 'api_key' | 'order';
|
|
74
|
-
/**
|
|
75
|
-
* Timestamp when the transaction entry was last updated
|
|
76
|
-
*/
|
|
77
|
-
updatedAt: string;
|
|
78
|
-
/**
|
|
79
|
-
* Unique identifier for the website
|
|
80
|
-
*/
|
|
81
|
-
websiteId: string;
|
|
82
|
-
/**
|
|
83
|
-
* Optional metadata for the transaction entry
|
|
84
|
-
*/
|
|
85
|
-
metadata?: Record<string, unknown>;
|
|
86
|
-
}
|
|
87
|
-
namespace Data {
|
|
88
|
-
/**
|
|
89
|
-
* Details of the loyalty transaction
|
|
90
|
-
*/
|
|
91
|
-
interface LoyaltyTransaction {
|
|
92
|
-
/**
|
|
93
|
-
* Unique identifier for the loyalty transaction
|
|
94
|
-
*/
|
|
95
|
-
id: string;
|
|
96
|
-
/**
|
|
97
|
-
* Type of the loyalty transaction
|
|
98
|
-
*/
|
|
99
|
-
type: 'auction_bid' | 'direct_mint' | 'loyalty_rule' | 'api_key' | 'order';
|
|
100
|
-
/**
|
|
101
|
-
* Details of the loyalty rule associated with the transaction
|
|
102
|
-
*/
|
|
103
|
-
loyaltyRule?: LoyaltyTransaction.LoyaltyRule;
|
|
104
|
-
}
|
|
105
|
-
namespace LoyaltyTransaction {
|
|
106
|
-
/**
|
|
107
|
-
* Details of the loyalty rule associated with the transaction
|
|
108
|
-
*/
|
|
109
|
-
interface LoyaltyRule {
|
|
110
|
-
/**
|
|
111
|
-
* Unique identifier for the loyalty rule
|
|
112
|
-
*/
|
|
113
|
-
id: string;
|
|
114
|
-
/**
|
|
115
|
-
* Type of the loyalty rule
|
|
116
|
-
*/
|
|
117
|
-
type: string;
|
|
118
|
-
/**
|
|
119
|
-
* Description of the loyalty rule
|
|
120
|
-
*/
|
|
121
|
-
description?: string;
|
|
122
|
-
/**
|
|
123
|
-
* Optional metadata for the loyalty rule
|
|
124
|
-
*/
|
|
125
|
-
metadata?: Record<string, unknown>;
|
|
126
|
-
/**
|
|
127
|
-
* Name of the loyalty rule
|
|
128
|
-
*/
|
|
129
|
-
name?: string;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
export interface TransactionCreateTransactionParams {
|
|
135
|
-
/**
|
|
136
|
-
* Description of the loyalty transaction
|
|
137
|
-
*/
|
|
138
|
-
description: string;
|
|
139
|
-
/**
|
|
140
|
-
* Array of transaction entries
|
|
141
|
-
*/
|
|
142
|
-
entries: Array<TransactionCreateTransactionParams.Entry>;
|
|
143
|
-
/**
|
|
144
|
-
* Unique identifier for the loyalty currency
|
|
145
|
-
*/
|
|
146
|
-
loyaltyCurrencyId?: string;
|
|
147
|
-
}
|
|
148
|
-
export declare namespace TransactionCreateTransactionParams {
|
|
149
|
-
interface Entry {
|
|
150
|
-
/**
|
|
151
|
-
* Transaction entry amount.
|
|
152
|
-
*/
|
|
153
|
-
amount: number;
|
|
154
|
-
/**
|
|
155
|
-
* Direction of the transaction entry for this wallet address
|
|
156
|
-
*/
|
|
157
|
-
direction?: 'credit' | 'debit';
|
|
158
|
-
/**
|
|
159
|
-
* Idempotency key for the transaction entry. Creation will fail if already exists
|
|
160
|
-
* for this wallet address.
|
|
161
|
-
*/
|
|
162
|
-
idempotencyKey?: string;
|
|
163
|
-
/**
|
|
164
|
-
* Unique identifier for the loyalty currency for the wallet. Can only use
|
|
165
|
-
* entry-level currency or transaction-level currency.
|
|
166
|
-
*/
|
|
167
|
-
loyaltyCurrencyId?: string;
|
|
168
|
-
/**
|
|
169
|
-
* The wallet address of the user
|
|
170
|
-
*/
|
|
171
|
-
walletAddress?: string;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
export interface TransactionGetTransactionEntriesParams {
|
|
175
|
-
/**
|
|
176
|
-
* End date to filter by (exclusive, less than)
|
|
177
|
-
*/
|
|
178
|
-
createdAtEnd?: string;
|
|
179
|
-
/**
|
|
180
|
-
* Start date to filter by (inclusive, greater than or equal to)
|
|
181
|
-
*/
|
|
182
|
-
createdAtStart?: string;
|
|
183
|
-
/**
|
|
184
|
-
* Direction of the transaction entry to filter by
|
|
185
|
-
*/
|
|
186
|
-
direction?: 'credit' | 'debit';
|
|
187
|
-
/**
|
|
188
|
-
* Key to ensure idempotency of the request
|
|
189
|
-
*/
|
|
190
|
-
idempotencyKey?: string;
|
|
191
|
-
/**
|
|
192
|
-
* Maximum number of records to return (max 1000)
|
|
193
|
-
*/
|
|
194
|
-
limit?: number;
|
|
195
|
-
/**
|
|
196
|
-
* Unique identifier for the loyalty rule to filter by
|
|
197
|
-
*/
|
|
198
|
-
loyaltyRuleId?: string;
|
|
199
|
-
loyaltyRuleType?: 'Bonus' | 'BoughtOn' | 'BoughtWithRoyalties' | 'DiscordMessages' | 'Listing' | 'Lodging' | 'MintOn' | 'PoapClaim' | 'SnagSocialsConnected' | 'SnapshotFullset' | 'SnapshotHold' | 'SoldOn' | 'SoldWithRoyalties' | 'TokenHold' | 'TwitterBio' | 'TwitterHashTagPost' | 'Retweet' | 'check_in' | 'code_entry' | 'connect_wallet' | 'connected_discord' | 'connected_email' | 'connected_epic' | 'connected_steam' | 'connected_telegram' | 'connected_twitter' | 'create_partner_account' | 'discord_member' | 'drip_x_follow' | 'drip_x_new_tweet' | 'drip_x_text_in_bio' | 'drip_x_text_in_comment' | 'drip_x_text_in_name' | 'drip_x_tweet' | 'external_rule' | 'link_click' | 'manual_upload' | 'profile_completed' | 'referred_user' | 'smart_contract_event' | 'snapshot_governance' | 'telegram_join' | 'telegram_messages' | 'text_input' | 'token_hold_erc20' | 'tweet_liked_by_project' | 'twitter_comment' | 'twitter_follow' | 'twitter_followers' | 'twitter_like' | 'twitter_post_hashtag' | 'quiz' | 'poll' | Array<'Bonus' | 'BoughtOn' | 'BoughtWithRoyalties' | 'DiscordMessages' | 'Listing' | 'Lodging' | 'MintOn' | 'PoapClaim' | 'SnagSocialsConnected' | 'SnapshotFullset' | 'SnapshotHold' | 'SoldOn' | 'SoldWithRoyalties' | 'TokenHold' | 'TwitterBio' | 'TwitterHashTagPost' | 'Retweet' | 'check_in' | 'code_entry' | 'connect_wallet' | 'connected_discord' | 'connected_email' | 'connected_epic' | 'connected_steam' | 'connected_telegram' | 'connected_twitter' | 'create_partner_account' | 'discord_member' | 'drip_x_follow' | 'drip_x_new_tweet' | 'drip_x_text_in_bio' | 'drip_x_text_in_comment' | 'drip_x_text_in_name' | 'drip_x_tweet' | 'external_rule' | 'link_click' | 'manual_upload' | 'profile_completed' | 'referred_user' | 'smart_contract_event' | 'snapshot_governance' | 'telegram_join' | 'telegram_messages' | 'text_input' | 'token_hold_erc20' | 'tweet_liked_by_project' | 'twitter_comment' | 'twitter_follow' | 'twitter_followers' | 'twitter_like' | 'twitter_post_hashtag' | 'quiz' | 'poll'>;
|
|
200
|
-
/**
|
|
201
|
-
* Unique identifier for the loyalty transaction to filter by
|
|
202
|
-
*/
|
|
203
|
-
loyaltyTransactionId?: string;
|
|
204
|
-
/**
|
|
205
|
-
* Field to order the results by
|
|
206
|
-
*/
|
|
207
|
-
orderBy?: 'createdAt' | 'updatedAt' | 'loyaltyAccountLockVersion';
|
|
208
|
-
/**
|
|
209
|
-
* Unique identifier for the organization to filter by
|
|
210
|
-
*/
|
|
211
|
-
organizationId?: string;
|
|
212
|
-
/**
|
|
213
|
-
* Pagination cursor to start after a specific resource ID
|
|
214
|
-
*/
|
|
215
|
-
startingAfter?: string;
|
|
216
|
-
/**
|
|
217
|
-
* Type of the loyalty transaction to filter by
|
|
218
|
-
*/
|
|
219
|
-
type?: 'auction_bid' | 'direct_mint' | 'loyalty_rule' | 'api_key' | 'order';
|
|
220
|
-
/**
|
|
221
|
-
* When passed in return the list of fulfilled entries for loyalty rules. If a
|
|
222
|
-
* loyalty rule has a fulfilled entry this means the user cannot currently complete
|
|
223
|
-
* the rule. Must be passed in with userId or walletAddress.
|
|
224
|
-
*/
|
|
225
|
-
userCompletedLoyaltyRuleId?: string | Array<string>;
|
|
226
|
-
/**
|
|
227
|
-
* External identifier for the user group controlled by you
|
|
228
|
-
*/
|
|
229
|
-
userGroupExternalIdentifier?: string;
|
|
230
|
-
/**
|
|
231
|
-
* Unique identifier for the user group
|
|
232
|
-
*/
|
|
233
|
-
userGroupId?: string;
|
|
234
|
-
/**
|
|
235
|
-
* User ID or array of User IDs to filter by
|
|
236
|
-
*/
|
|
237
|
-
userId?: string | Array<string>;
|
|
238
|
-
/**
|
|
239
|
-
* Wallet address or array of wallet addresses to filter by
|
|
240
|
-
*/
|
|
241
|
-
walletAddress?: string | Array<string>;
|
|
242
|
-
/**
|
|
243
|
-
* Identifier for the wallet group to filter by
|
|
244
|
-
*/
|
|
245
|
-
walletGroupIdentifier?: string;
|
|
246
|
-
/**
|
|
247
|
-
* Unique identifier for the website to filter by
|
|
248
|
-
*/
|
|
249
|
-
websiteId?: string;
|
|
250
|
-
}
|
|
251
|
-
export declare namespace Transactions {
|
|
252
|
-
export { type TransactionCreateTransactionResponse as TransactionCreateTransactionResponse, type TransactionGetTransactionEntriesResponse as TransactionGetTransactionEntriesResponse, type TransactionCreateTransactionParams as TransactionCreateTransactionParams, type TransactionGetTransactionEntriesParams as TransactionGetTransactionEntriesParams, };
|
|
253
|
-
}
|
|
1
|
+
export * from "./transactions/index.js";
|
|
254
2
|
//# sourceMappingURL=transactions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../../src/resources/loyalty/transactions.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../../src/resources/loyalty/transactions.ts"],"names":[],"mappings":"AAEA,cAAc,sBAAsB,CAAC"}
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
-
Object.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Create a loyalty transaction to update account balances.
|
|
10
|
-
*/
|
|
11
|
-
createTransaction(body, options) {
|
|
12
|
-
return this._client.post('/api/loyalty/transactions', { body, ...options });
|
|
13
|
-
}
|
|
14
|
-
getTransactionEntries(query = {}, options) {
|
|
15
|
-
if ((0, core_1.isRequestOptions)(query)) {
|
|
16
|
-
return this.getTransactionEntries({}, query);
|
|
17
|
-
}
|
|
18
|
-
return this._client.get('/api/loyalty/transaction_entries', { query, ...options });
|
|
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]; } };
|
|
19
8
|
}
|
|
20
|
-
|
|
21
|
-
|
|
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("./transactions/index.js"), exports);
|
|
22
19
|
//# sourceMappingURL=transactions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../../src/resources/loyalty/transactions.ts"],"names":[],"mappings":";AAAA,sFAAsF
|
|
1
|
+
{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../../src/resources/loyalty/transactions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;AAEtF,0DAAqC"}
|
|
@@ -1,18 +1,3 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { isRequestOptions } from "../../core.mjs";
|
|
4
|
-
export class Transactions extends APIResource {
|
|
5
|
-
/**
|
|
6
|
-
* Create a loyalty transaction to update account balances.
|
|
7
|
-
*/
|
|
8
|
-
createTransaction(body, options) {
|
|
9
|
-
return this._client.post('/api/loyalty/transactions', { body, ...options });
|
|
10
|
-
}
|
|
11
|
-
getTransactionEntries(query = {}, options) {
|
|
12
|
-
if (isRequestOptions(query)) {
|
|
13
|
-
return this.getTransactionEntries({}, query);
|
|
14
|
-
}
|
|
15
|
-
return this._client.get('/api/loyalty/transaction_entries', { query, ...options });
|
|
16
|
-
}
|
|
17
|
-
}
|
|
2
|
+
export * from "./transactions/index.mjs";
|
|
18
3
|
//# sourceMappingURL=transactions.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactions.mjs","sourceRoot":"","sources":["../../src/resources/loyalty/transactions.ts"],"names":[],"mappings":"AAAA,sFAAsF
|
|
1
|
+
{"version":3,"file":"transactions.mjs","sourceRoot":"","sources":["../../src/resources/loyalty/transactions.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { APIResource } from "../../resource.js";
|
|
2
|
+
import * as Core from "../../core.js";
|
|
3
|
+
export declare class Allowlist extends APIResource {
|
|
4
|
+
/**
|
|
5
|
+
* Fetch allowlist entries for a minting contract asset
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* const allowlists = await client.minting.allowlist.list({
|
|
10
|
+
* mintingContractAssetId:
|
|
11
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
12
|
+
* });
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
list(query: AllowlistListParams, options?: Core.RequestOptions): Core.APIPromise<AllowlistListResponse>;
|
|
16
|
+
/**
|
|
17
|
+
* Create or update allowlist entries for a minting contract asset (max 25 entries
|
|
18
|
+
* per request). If an entry already exists, it will be updated with the new
|
|
19
|
+
* quantity.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const response = await client.minting.allowlist.upsert({
|
|
24
|
+
* entries: [
|
|
25
|
+
* { quantity: 1, walletAddress: 'walletAddress' },
|
|
26
|
+
* ],
|
|
27
|
+
* mintingContractAssetId:
|
|
28
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
upsert(body: AllowlistUpsertParams, options?: Core.RequestOptions): Core.APIPromise<AllowlistUpsertResponse>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Response schema for allowlist entries
|
|
36
|
+
*/
|
|
37
|
+
export interface AllowlistListResponse {
|
|
38
|
+
data: Array<AllowlistListResponse.Data>;
|
|
39
|
+
hasNextPage: boolean;
|
|
40
|
+
}
|
|
41
|
+
export declare namespace AllowlistListResponse {
|
|
42
|
+
interface Data {
|
|
43
|
+
mintingContractAssetId: string;
|
|
44
|
+
quantityMinted: number;
|
|
45
|
+
totalQuantity: number;
|
|
46
|
+
walletAddress: string;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Response schema for allowlist mutations
|
|
51
|
+
*/
|
|
52
|
+
export interface AllowlistUpsertResponse {
|
|
53
|
+
createdCount: number;
|
|
54
|
+
mintingContractAssetId: string;
|
|
55
|
+
}
|
|
56
|
+
export interface AllowlistListParams {
|
|
57
|
+
mintingContractAssetId: string;
|
|
58
|
+
/**
|
|
59
|
+
* Number of items to return
|
|
60
|
+
*/
|
|
61
|
+
limit?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Cursor for pagination (entry ID)
|
|
64
|
+
*/
|
|
65
|
+
startingAfter?: string;
|
|
66
|
+
walletAddress?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface AllowlistUpsertParams {
|
|
69
|
+
/**
|
|
70
|
+
* Allowlist entries (max 25 per request)
|
|
71
|
+
*/
|
|
72
|
+
entries: Array<AllowlistUpsertParams.Entry>;
|
|
73
|
+
mintingContractAssetId: string;
|
|
74
|
+
}
|
|
75
|
+
export declare namespace AllowlistUpsertParams {
|
|
76
|
+
interface Entry {
|
|
77
|
+
quantity: number;
|
|
78
|
+
walletAddress: string;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
export declare namespace Allowlist {
|
|
82
|
+
export { type AllowlistListResponse as AllowlistListResponse, type AllowlistUpsertResponse as AllowlistUpsertResponse, type AllowlistListParams as AllowlistListParams, type AllowlistUpsertParams as AllowlistUpsertParams, };
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=allowlist.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allowlist.d.ts","sourceRoot":"","sources":["../../src/resources/minting/allowlist.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAEnC,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;OAUG;IACH,IAAI,CAAC,KAAK,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,qBAAqB,CAAC;IAIvG;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CACJ,IAAI,EAAE,qBAAqB,EAC3B,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC;CAG5C;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,KAAK,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAExC,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,yBAAiB,qBAAqB,CAAC;IACrC,UAAiB,IAAI;QACnB,sBAAsB,EAAE,MAAM,CAAC;QAE/B,cAAc,EAAE,MAAM,CAAC;QAEvB,aAAa,EAAE,MAAM,CAAC;QAEtB,aAAa,EAAE,MAAM,CAAC;KACvB;CACF;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,MAAM,CAAC;IAErB,sBAAsB,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,mBAAmB;IAClC,sBAAsB,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAE5C,sBAAsB,EAAE,MAAM,CAAC;CAChC;AAED,yBAAiB,qBAAqB,CAAC;IACrC,UAAiB,KAAK;QACpB,QAAQ,EAAE,MAAM,CAAC;QAEjB,aAAa,EAAE,MAAM,CAAC;KACvB;CACF;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;CACH"}
|