@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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '
|
|
4
|
-
import { isRequestOptions } from '
|
|
5
|
-
import * as Core from '
|
|
3
|
+
import { APIResource } from '../../../resource';
|
|
4
|
+
import { isRequestOptions } from '../../../core';
|
|
5
|
+
import * as Core from '../../../core';
|
|
6
6
|
|
|
7
7
|
export class Multipliers extends APIResource {
|
|
8
8
|
/**
|
|
@@ -56,6 +56,16 @@ export class Multipliers extends APIResource {
|
|
|
56
56
|
delete(multiplierId: string, options?: Core.RequestOptions): Core.APIPromise<MultiplierDeleteResponse> {
|
|
57
57
|
return this._client.delete(`/api/loyalty/multipliers/${multiplierId}`, options);
|
|
58
58
|
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Delete a loyalty multiplier by its external identifier.
|
|
62
|
+
*/
|
|
63
|
+
deleteByExternalId(
|
|
64
|
+
body: MultiplierDeleteByExternalIDParams,
|
|
65
|
+
options?: Core.RequestOptions,
|
|
66
|
+
): Core.APIPromise<MultiplierDeleteByExternalIDResponse> {
|
|
67
|
+
return this._client.delete('/api/loyalty/multipliers', { body, ...options });
|
|
68
|
+
}
|
|
59
69
|
}
|
|
60
70
|
|
|
61
71
|
/**
|
|
@@ -181,6 +191,43 @@ export interface MultiplierDeleteResponse {
|
|
|
181
191
|
id: string;
|
|
182
192
|
}
|
|
183
193
|
|
|
194
|
+
/**
|
|
195
|
+
* Schema for loyalty multiplier
|
|
196
|
+
*/
|
|
197
|
+
export interface MultiplierDeleteByExternalIDResponse {
|
|
198
|
+
id: string;
|
|
199
|
+
|
|
200
|
+
createdAt: string;
|
|
201
|
+
|
|
202
|
+
deletedAt: string | null;
|
|
203
|
+
|
|
204
|
+
description: string | null;
|
|
205
|
+
|
|
206
|
+
externalIdentifier: string | null;
|
|
207
|
+
|
|
208
|
+
multiplier: number;
|
|
209
|
+
|
|
210
|
+
organizationId: string;
|
|
211
|
+
|
|
212
|
+
title: string | null;
|
|
213
|
+
|
|
214
|
+
updatedAt: string;
|
|
215
|
+
|
|
216
|
+
user: MultiplierDeleteByExternalIDResponse.User;
|
|
217
|
+
|
|
218
|
+
userId: string;
|
|
219
|
+
|
|
220
|
+
websiteId: string;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export namespace MultiplierDeleteByExternalIDResponse {
|
|
224
|
+
export interface User {
|
|
225
|
+
id: string;
|
|
226
|
+
|
|
227
|
+
walletAddress: string;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
184
231
|
export interface MultiplierCreateParams {
|
|
185
232
|
multiplier: number;
|
|
186
233
|
|
|
@@ -206,7 +253,7 @@ export interface MultiplierListParams {
|
|
|
206
253
|
|
|
207
254
|
externalIdentifier?: string;
|
|
208
255
|
|
|
209
|
-
includeDeleted?:
|
|
256
|
+
includeDeleted?: string;
|
|
210
257
|
|
|
211
258
|
limit?: number;
|
|
212
259
|
|
|
@@ -216,6 +263,10 @@ export interface MultiplierListParams {
|
|
|
216
263
|
|
|
217
264
|
twitterUser?: string;
|
|
218
265
|
|
|
266
|
+
userGroupExternalIdentifier?: string;
|
|
267
|
+
|
|
268
|
+
userGroupId?: string;
|
|
269
|
+
|
|
219
270
|
userId?: string | Array<string>;
|
|
220
271
|
|
|
221
272
|
walletAddress?: string | Array<string>;
|
|
@@ -225,14 +276,20 @@ export interface MultiplierListParams {
|
|
|
225
276
|
websiteId?: string;
|
|
226
277
|
}
|
|
227
278
|
|
|
279
|
+
export interface MultiplierDeleteByExternalIDParams {
|
|
280
|
+
externalIdentifier: string;
|
|
281
|
+
}
|
|
282
|
+
|
|
228
283
|
export declare namespace Multipliers {
|
|
229
284
|
export {
|
|
230
285
|
type MultiplierCreateResponse as MultiplierCreateResponse,
|
|
231
286
|
type MultiplierUpdateResponse as MultiplierUpdateResponse,
|
|
232
287
|
type MultiplierListResponse as MultiplierListResponse,
|
|
233
288
|
type MultiplierDeleteResponse as MultiplierDeleteResponse,
|
|
289
|
+
type MultiplierDeleteByExternalIDResponse as MultiplierDeleteByExternalIDResponse,
|
|
234
290
|
type MultiplierCreateParams as MultiplierCreateParams,
|
|
235
291
|
type MultiplierUpdateParams as MultiplierUpdateParams,
|
|
236
292
|
type MultiplierListParams as MultiplierListParams,
|
|
293
|
+
type MultiplierDeleteByExternalIDParams as MultiplierDeleteByExternalIDParams,
|
|
237
294
|
};
|
|
238
295
|
}
|
|
@@ -0,0 +1,146 @@
|
|
|
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 QuestionsResponses extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Retrieve responses submitted by the authenticated user, optionally filtered by
|
|
10
|
+
* question IDs
|
|
11
|
+
*/
|
|
12
|
+
list(
|
|
13
|
+
query?: QuestionsResponseListParams,
|
|
14
|
+
options?: Core.RequestOptions,
|
|
15
|
+
): Core.APIPromise<QuestionsResponseListResponse>;
|
|
16
|
+
list(options?: Core.RequestOptions): Core.APIPromise<QuestionsResponseListResponse>;
|
|
17
|
+
list(
|
|
18
|
+
query: QuestionsResponseListParams | Core.RequestOptions = {},
|
|
19
|
+
options?: Core.RequestOptions,
|
|
20
|
+
): Core.APIPromise<QuestionsResponseListResponse> {
|
|
21
|
+
if (isRequestOptions(query)) {
|
|
22
|
+
return this.list({}, query);
|
|
23
|
+
}
|
|
24
|
+
return this._client.get('/api/loyalty/questions_responses', { query, ...options });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* This endpoint allows you to submit a response to a question.
|
|
29
|
+
*/
|
|
30
|
+
submit(
|
|
31
|
+
body: QuestionsResponseSubmitParams,
|
|
32
|
+
options?: Core.RequestOptions,
|
|
33
|
+
): Core.APIPromise<QuestionsResponseSubmitResponse> {
|
|
34
|
+
return this._client.post('/api/loyalty/questions_responses', { body, ...options });
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* List of question responses with details
|
|
40
|
+
*/
|
|
41
|
+
export interface QuestionsResponseListResponse {
|
|
42
|
+
responses: Array<QuestionsResponseListResponse.Response>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export namespace QuestionsResponseListResponse {
|
|
46
|
+
/**
|
|
47
|
+
* Response details including the question and choice information
|
|
48
|
+
*/
|
|
49
|
+
export interface Response {
|
|
50
|
+
id: string;
|
|
51
|
+
|
|
52
|
+
createdAt: string;
|
|
53
|
+
|
|
54
|
+
isCorrect: boolean;
|
|
55
|
+
|
|
56
|
+
loyaltyQuestionChoiceId: string;
|
|
57
|
+
|
|
58
|
+
loyaltyQuestionId: string;
|
|
59
|
+
|
|
60
|
+
question: Response.Question;
|
|
61
|
+
|
|
62
|
+
userId: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export namespace Response {
|
|
66
|
+
export interface Question {
|
|
67
|
+
loyaltyQuestionChoices: Array<Question.LoyaltyQuestionChoice>;
|
|
68
|
+
|
|
69
|
+
text: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export namespace Question {
|
|
73
|
+
export interface LoyaltyQuestionChoice {
|
|
74
|
+
id: string;
|
|
75
|
+
|
|
76
|
+
isCorrect: boolean;
|
|
77
|
+
|
|
78
|
+
text: string;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Response returned when submitting an answer to a question
|
|
86
|
+
*/
|
|
87
|
+
export interface QuestionsResponseSubmitResponse {
|
|
88
|
+
/**
|
|
89
|
+
* Whether the user had already submitted an answer to this question
|
|
90
|
+
*/
|
|
91
|
+
alreadySubmitted: boolean;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Whether the submitted answer was correct
|
|
95
|
+
*/
|
|
96
|
+
isCorrect: boolean;
|
|
97
|
+
|
|
98
|
+
response: QuestionsResponseSubmitResponse.Response;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export namespace QuestionsResponseSubmitResponse {
|
|
102
|
+
export interface Response {
|
|
103
|
+
/**
|
|
104
|
+
* UUID of the response
|
|
105
|
+
*/
|
|
106
|
+
id: string;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* UUID of the selected choice
|
|
110
|
+
*/
|
|
111
|
+
loyaltyQuestionChoiceId: string;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* UUID of the question being answered
|
|
115
|
+
*/
|
|
116
|
+
loyaltyQuestionId: string;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* UUID of the user who submitted the response
|
|
120
|
+
*/
|
|
121
|
+
userId: string;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface QuestionsResponseListParams {
|
|
126
|
+
/**
|
|
127
|
+
* UUID(s) of the questions to filter responses
|
|
128
|
+
*/
|
|
129
|
+
questionsId?: string | Array<string>;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface QuestionsResponseSubmitParams {
|
|
133
|
+
/**
|
|
134
|
+
* UUID of the selected choice
|
|
135
|
+
*/
|
|
136
|
+
loyaltyQuestionChoiceId: string;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export declare namespace QuestionsResponses {
|
|
140
|
+
export {
|
|
141
|
+
type QuestionsResponseListResponse as QuestionsResponseListResponse,
|
|
142
|
+
type QuestionsResponseSubmitResponse as QuestionsResponseSubmitResponse,
|
|
143
|
+
type QuestionsResponseListParams as QuestionsResponseListParams,
|
|
144
|
+
type QuestionsResponseSubmitParams as QuestionsResponseSubmitParams,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
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 Questions extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* This endpoint allows you to create a new question.
|
|
9
|
+
*/
|
|
10
|
+
create(body: QuestionCreateParams, options?: Core.RequestOptions): Core.APIPromise<QuestionCreateResponse> {
|
|
11
|
+
return this._client.post('/api/loyalty/questions', { body, ...options });
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* This endpoint allows you to update an existing question.
|
|
16
|
+
*/
|
|
17
|
+
update(
|
|
18
|
+
id: string,
|
|
19
|
+
body: QuestionUpdateParams,
|
|
20
|
+
options?: Core.RequestOptions,
|
|
21
|
+
): Core.APIPromise<QuestionUpdateResponse> {
|
|
22
|
+
return this._client.post(`/api/loyalty/questions/${id}`, { body, ...options });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* This endpoint allows you to fetch questions for a loyalty rule.
|
|
27
|
+
*/
|
|
28
|
+
list(query: QuestionListParams, options?: Core.RequestOptions): Core.APIPromise<QuestionListResponse> {
|
|
29
|
+
return this._client.get('/api/loyalty/questions', { query, ...options });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Response returned for a question
|
|
35
|
+
*/
|
|
36
|
+
export interface QuestionCreateResponse {
|
|
37
|
+
id: string;
|
|
38
|
+
|
|
39
|
+
loyaltyQuestionChoices: Array<QuestionCreateResponse.LoyaltyQuestionChoice>;
|
|
40
|
+
|
|
41
|
+
text: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export namespace QuestionCreateResponse {
|
|
45
|
+
export interface LoyaltyQuestionChoice {
|
|
46
|
+
id: string;
|
|
47
|
+
|
|
48
|
+
sortIdentifier: number;
|
|
49
|
+
|
|
50
|
+
text: string;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Response returned for a question
|
|
56
|
+
*/
|
|
57
|
+
export interface QuestionUpdateResponse {
|
|
58
|
+
id: string;
|
|
59
|
+
|
|
60
|
+
loyaltyQuestionChoices: Array<QuestionUpdateResponse.LoyaltyQuestionChoice>;
|
|
61
|
+
|
|
62
|
+
text: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export namespace QuestionUpdateResponse {
|
|
66
|
+
export interface LoyaltyQuestionChoice {
|
|
67
|
+
id: string;
|
|
68
|
+
|
|
69
|
+
sortIdentifier: number;
|
|
70
|
+
|
|
71
|
+
text: string;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export type QuestionListResponse = Array<QuestionListResponse.QuestionListResponseItem>;
|
|
76
|
+
|
|
77
|
+
export namespace QuestionListResponse {
|
|
78
|
+
/**
|
|
79
|
+
* Response returned for a question
|
|
80
|
+
*/
|
|
81
|
+
export interface QuestionListResponseItem {
|
|
82
|
+
id: string;
|
|
83
|
+
|
|
84
|
+
loyaltyQuestionChoices: Array<QuestionListResponseItem.LoyaltyQuestionChoice>;
|
|
85
|
+
|
|
86
|
+
text: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export namespace QuestionListResponseItem {
|
|
90
|
+
export interface LoyaltyQuestionChoice {
|
|
91
|
+
id: string;
|
|
92
|
+
|
|
93
|
+
sortIdentifier: number;
|
|
94
|
+
|
|
95
|
+
text: string;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface QuestionCreateParams {
|
|
101
|
+
/**
|
|
102
|
+
* Array of choices for the question
|
|
103
|
+
*/
|
|
104
|
+
loyaltyQuestionAnswers: Array<QuestionCreateParams.LoyaltyQuestionAnswer>;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* UUID of the loyalty rule
|
|
108
|
+
*/
|
|
109
|
+
loyaltyRuleId: string;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* The text of the question
|
|
113
|
+
*/
|
|
114
|
+
questionText: string;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Whether the question allows multiple attempts
|
|
118
|
+
*/
|
|
119
|
+
allowMultipleAttempts?: boolean;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export namespace QuestionCreateParams {
|
|
123
|
+
export interface LoyaltyQuestionAnswer {
|
|
124
|
+
/**
|
|
125
|
+
* Whether this choice is correct
|
|
126
|
+
*/
|
|
127
|
+
isCorrect: boolean;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* The order in which to display the choice
|
|
131
|
+
*/
|
|
132
|
+
sortIdentifier: number;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* The text of the choice
|
|
136
|
+
*/
|
|
137
|
+
text: string;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* UUID of the choice (optional for new choices)
|
|
141
|
+
*/
|
|
142
|
+
id?: string;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export interface QuestionUpdateParams {
|
|
147
|
+
/**
|
|
148
|
+
* Array of choices for the question
|
|
149
|
+
*/
|
|
150
|
+
loyaltyQuestionAnswers: Array<QuestionUpdateParams.LoyaltyQuestionAnswer>;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* The text of the question
|
|
154
|
+
*/
|
|
155
|
+
questionText: string;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export namespace QuestionUpdateParams {
|
|
159
|
+
export interface LoyaltyQuestionAnswer {
|
|
160
|
+
/**
|
|
161
|
+
* Whether this choice is correct
|
|
162
|
+
*/
|
|
163
|
+
isCorrect: boolean;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* The order in which to display the choice
|
|
167
|
+
*/
|
|
168
|
+
sortIdentifier: number;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* The text of the choice
|
|
172
|
+
*/
|
|
173
|
+
text: string;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* UUID of the choice (optional for new choices)
|
|
177
|
+
*/
|
|
178
|
+
id?: string;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface QuestionListParams {
|
|
183
|
+
/**
|
|
184
|
+
* UUID of the loyalty rule to fetch questions for
|
|
185
|
+
*/
|
|
186
|
+
loyaltyRuleIds: string | Array<string>;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* UUID of the organization to fetch questions for
|
|
190
|
+
*/
|
|
191
|
+
organizationId: string;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* UUID of the website to fetch questions for
|
|
195
|
+
*/
|
|
196
|
+
websiteId: string;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export declare namespace Questions {
|
|
200
|
+
export {
|
|
201
|
+
type QuestionCreateResponse as QuestionCreateResponse,
|
|
202
|
+
type QuestionUpdateResponse as QuestionUpdateResponse,
|
|
203
|
+
type QuestionListResponse as QuestionListResponse,
|
|
204
|
+
type QuestionCreateParams as QuestionCreateParams,
|
|
205
|
+
type QuestionUpdateParams as QuestionUpdateParams,
|
|
206
|
+
type QuestionListParams as QuestionListParams,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '
|
|
4
|
-
import * as Core from '
|
|
3
|
+
import { APIResource } from '../../../resource';
|
|
4
|
+
import * as Core from '../../../core';
|
|
5
5
|
|
|
6
6
|
export class RuleEdits extends APIResource {
|
|
7
7
|
/**
|
|
8
8
|
* Retrieve configured loyalty rule edits with optional pagination and filters
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
query: RuleEditRetrieveParams,
|
|
12
|
-
options?: Core.RequestOptions,
|
|
13
|
-
): Core.APIPromise<RuleEditRetrieveResponse> {
|
|
10
|
+
list(query: RuleEditListParams, options?: Core.RequestOptions): Core.APIPromise<RuleEditListResponse> {
|
|
14
11
|
return this._client.get('/api/loyalty/rule_edits', { query, ...options });
|
|
15
12
|
}
|
|
16
13
|
|
|
@@ -22,17 +19,17 @@ export class RuleEdits extends APIResource {
|
|
|
22
19
|
body?: RuleEditRestoreParams | null | undefined,
|
|
23
20
|
options?: Core.RequestOptions,
|
|
24
21
|
): Core.APIPromise<RuleEditRestoreResponse> {
|
|
25
|
-
return this._client.post(`/api/
|
|
22
|
+
return this._client.post(`/api/loyalty/rule_edits/${id}/restore`, { body, ...options });
|
|
26
23
|
}
|
|
27
24
|
}
|
|
28
25
|
|
|
29
|
-
export interface
|
|
30
|
-
data: Array<
|
|
26
|
+
export interface RuleEditListResponse {
|
|
27
|
+
data: Array<RuleEditListResponse.Data>;
|
|
31
28
|
|
|
32
29
|
hasNextPage: boolean;
|
|
33
30
|
}
|
|
34
31
|
|
|
35
|
-
export namespace
|
|
32
|
+
export namespace RuleEditListResponse {
|
|
36
33
|
export interface Data {
|
|
37
34
|
/**
|
|
38
35
|
* Unique identifier for the rule edit
|
|
@@ -382,7 +379,7 @@ export namespace RuleEditRestoreResponse {
|
|
|
382
379
|
}
|
|
383
380
|
}
|
|
384
381
|
|
|
385
|
-
export interface
|
|
382
|
+
export interface RuleEditListParams {
|
|
386
383
|
/**
|
|
387
384
|
* ID of the loyalty rule
|
|
388
385
|
*/
|
|
@@ -391,7 +388,7 @@ export interface RuleEditRetrieveParams {
|
|
|
391
388
|
/**
|
|
392
389
|
* Maximum number of edits to return
|
|
393
390
|
*/
|
|
394
|
-
limit?: number
|
|
391
|
+
limit?: number;
|
|
395
392
|
|
|
396
393
|
/**
|
|
397
394
|
* Unique identifier for the organization to filter by
|
|
@@ -413,9 +410,9 @@ export interface RuleEditRestoreParams {}
|
|
|
413
410
|
|
|
414
411
|
export declare namespace RuleEdits {
|
|
415
412
|
export {
|
|
416
|
-
type
|
|
413
|
+
type RuleEditListResponse as RuleEditListResponse,
|
|
417
414
|
type RuleEditRestoreResponse as RuleEditRestoreResponse,
|
|
418
|
-
type
|
|
415
|
+
type RuleEditListParams as RuleEditListParams,
|
|
419
416
|
type RuleEditRestoreParams as RuleEditRestoreParams,
|
|
420
417
|
};
|
|
421
418
|
}
|