@snagsolutions/sdk 0.1.0-alpha.13 → 0.1.0-alpha.14

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.
Files changed (241) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +1 -1
  3. package/core.d.ts.map +1 -1
  4. package/core.js +12 -6
  5. package/core.js.map +1 -1
  6. package/core.mjs +12 -6
  7. package/core.mjs.map +1 -1
  8. package/index.d.mts +9 -9
  9. package/index.d.ts +9 -9
  10. package/index.d.ts.map +1 -1
  11. package/index.js +1 -1
  12. package/index.js.map +1 -1
  13. package/index.mjs +1 -1
  14. package/index.mjs.map +1 -1
  15. package/package.json +29 -8
  16. package/resources/assets/assets.d.ts +153 -0
  17. package/resources/assets/assets.d.ts.map +1 -0
  18. package/resources/assets/assets.js +69 -0
  19. package/resources/assets/assets.js.map +1 -0
  20. package/resources/assets/assets.mjs +42 -0
  21. package/resources/assets/assets.mjs.map +1 -0
  22. package/resources/assets/index.d.ts +7 -0
  23. package/resources/assets/index.d.ts.map +1 -0
  24. package/resources/assets/index.js +17 -0
  25. package/resources/assets/index.js.map +1 -0
  26. package/resources/assets/index.mjs +8 -0
  27. package/resources/assets/index.mjs.map +1 -0
  28. package/resources/assets/minting.d.ts +95 -0
  29. package/resources/assets/minting.d.ts.map +1 -0
  30. package/resources/assets/minting.js +15 -0
  31. package/resources/assets/minting.js.map +1 -0
  32. package/resources/assets/minting.mjs +11 -0
  33. package/resources/assets/minting.mjs.map +1 -0
  34. package/resources/assets/referral/index.d.ts +3 -0
  35. package/resources/assets/referral/index.d.ts.map +1 -0
  36. package/resources/assets/referral/index.js +9 -0
  37. package/resources/assets/referral/index.js.map +1 -0
  38. package/resources/assets/referral/index.mjs +4 -0
  39. package/resources/assets/referral/index.mjs.map +1 -0
  40. package/resources/assets/referral/referral.d.ts +30 -0
  41. package/resources/assets/referral/referral.d.ts.map +1 -0
  42. package/resources/assets/referral/referral.js +46 -0
  43. package/resources/assets/referral/referral.js.map +1 -0
  44. package/resources/assets/referral/referral.mjs +19 -0
  45. package/resources/assets/referral/referral.mjs.map +1 -0
  46. package/resources/assets/referral/users.d.ts +57 -0
  47. package/resources/assets/referral/users.d.ts.map +1 -0
  48. package/resources/assets/referral/users.js +21 -0
  49. package/resources/assets/referral/users.js.map +1 -0
  50. package/resources/assets/referral/users.mjs +17 -0
  51. package/resources/assets/referral/users.mjs.map +1 -0
  52. package/resources/assets/users.d.ts +285 -0
  53. package/resources/assets/users.d.ts.map +1 -0
  54. package/resources/assets/users.js +34 -0
  55. package/resources/assets/users.js.map +1 -0
  56. package/resources/assets/users.mjs +30 -0
  57. package/resources/assets/users.mjs.map +1 -0
  58. package/resources/assets/website-collections.d.ts +73 -0
  59. package/resources/assets/website-collections.d.ts.map +1 -0
  60. package/resources/assets/website-collections.js +25 -0
  61. package/resources/assets/website-collections.js.map +1 -0
  62. package/resources/assets/website-collections.mjs +21 -0
  63. package/resources/assets/website-collections.mjs.map +1 -0
  64. package/resources/assets/website-user-roles.d.ts +73 -0
  65. package/resources/assets/website-user-roles.d.ts.map +1 -0
  66. package/resources/assets/website-user-roles.js +22 -0
  67. package/resources/assets/website-user-roles.js.map +1 -0
  68. package/resources/assets/website-user-roles.mjs +18 -0
  69. package/resources/assets/website-user-roles.mjs.map +1 -0
  70. package/resources/auction-bids.d.ts +2 -32
  71. package/resources/auction-bids.d.ts.map +1 -1
  72. package/resources/auction-bids.js +0 -10
  73. package/resources/auction-bids.js.map +1 -1
  74. package/resources/auction-bids.mjs +0 -10
  75. package/resources/auction-bids.mjs.map +1 -1
  76. package/resources/drip/drip.d.ts +4 -4
  77. package/resources/drip/drip.d.ts.map +1 -1
  78. package/resources/drip/drip.js.map +1 -1
  79. package/resources/drip/drip.mjs.map +1 -1
  80. package/resources/drip/index.d.ts +2 -2
  81. package/resources/drip/index.d.ts.map +1 -1
  82. package/resources/drip/index.js.map +1 -1
  83. package/resources/drip/index.mjs.map +1 -1
  84. package/resources/drip/quests.d.ts +0 -164
  85. package/resources/drip/quests.d.ts.map +1 -1
  86. package/resources/drip/quests.js +0 -8
  87. package/resources/drip/quests.js.map +1 -1
  88. package/resources/drip/quests.mjs +0 -8
  89. package/resources/drip/quests.mjs.map +1 -1
  90. package/resources/drip/status.d.ts +0 -22
  91. package/resources/drip/status.d.ts.map +1 -1
  92. package/resources/drip/status.js +0 -7
  93. package/resources/drip/status.js.map +1 -1
  94. package/resources/drip/status.mjs +0 -7
  95. package/resources/drip/status.mjs.map +1 -1
  96. package/resources/index.d.ts +2 -2
  97. package/resources/index.d.ts.map +1 -1
  98. package/resources/index.js +1 -1
  99. package/resources/index.js.map +1 -1
  100. package/resources/index.mjs +1 -1
  101. package/resources/index.mjs.map +1 -1
  102. package/resources/loyalty/accounts.d.ts +0 -153
  103. package/resources/loyalty/accounts.d.ts.map +1 -1
  104. package/resources/loyalty/accounts.js +0 -7
  105. package/resources/loyalty/accounts.js.map +1 -1
  106. package/resources/loyalty/accounts.mjs +0 -7
  107. package/resources/loyalty/accounts.mjs.map +1 -1
  108. package/resources/loyalty/badges.d.ts +639 -72
  109. package/resources/loyalty/badges.d.ts.map +1 -1
  110. package/resources/loyalty/currencies.d.ts +1 -7
  111. package/resources/loyalty/currencies.d.ts.map +1 -1
  112. package/resources/loyalty/index.d.ts +3 -3
  113. package/resources/loyalty/index.d.ts.map +1 -1
  114. package/resources/loyalty/index.js +2 -2
  115. package/resources/loyalty/index.js.map +1 -1
  116. package/resources/loyalty/index.mjs +1 -1
  117. package/resources/loyalty/index.mjs.map +1 -1
  118. package/resources/loyalty/loyalty.d.ts +7 -7
  119. package/resources/loyalty/loyalty.d.ts.map +1 -1
  120. package/resources/loyalty/loyalty.js +2 -2
  121. package/resources/loyalty/loyalty.js.map +1 -1
  122. package/resources/loyalty/loyalty.mjs +2 -2
  123. package/resources/loyalty/loyalty.mjs.map +1 -1
  124. package/resources/loyalty/multipliers.d.ts +29 -4
  125. package/resources/loyalty/multipliers.d.ts.map +1 -1
  126. package/resources/loyalty/multipliers.js +3 -3
  127. package/resources/loyalty/multipliers.js.map +1 -1
  128. package/resources/loyalty/multipliers.mjs +3 -3
  129. package/resources/loyalty/multipliers.mjs.map +1 -1
  130. package/resources/loyalty/rule-edits.d.ts +1 -1
  131. package/resources/loyalty/rule-edits.d.ts.map +1 -1
  132. package/resources/loyalty/rule-edits.js +1 -1
  133. package/resources/loyalty/rule-edits.js.map +1 -1
  134. package/resources/loyalty/rule-edits.mjs +1 -1
  135. package/resources/loyalty/rule-edits.mjs.map +1 -1
  136. package/resources/loyalty/rules.d.ts +132 -71
  137. package/resources/loyalty/rules.d.ts.map +1 -1
  138. package/resources/loyalty/transaction-entries/accounts.d.ts +191 -0
  139. package/resources/loyalty/transaction-entries/accounts.d.ts.map +1 -0
  140. package/resources/loyalty/transaction-entries/accounts.js +24 -0
  141. package/resources/loyalty/transaction-entries/accounts.js.map +1 -0
  142. package/resources/loyalty/transaction-entries/accounts.mjs +20 -0
  143. package/resources/loyalty/transaction-entries/accounts.mjs.map +1 -0
  144. package/resources/loyalty/transaction-entries/index.d.ts +5 -0
  145. package/resources/loyalty/transaction-entries/index.d.ts.map +1 -0
  146. package/resources/loyalty/transaction-entries/index.js +13 -0
  147. package/resources/loyalty/transaction-entries/index.js.map +1 -0
  148. package/resources/loyalty/transaction-entries/index.mjs +6 -0
  149. package/resources/loyalty/transaction-entries/index.mjs.map +1 -0
  150. package/resources/loyalty/transaction-entries/questions-responses.d.ts +97 -0
  151. package/resources/loyalty/transaction-entries/questions-responses.d.ts.map +1 -0
  152. package/resources/loyalty/transaction-entries/questions-responses.js +22 -0
  153. package/resources/loyalty/transaction-entries/questions-responses.js.map +1 -0
  154. package/resources/loyalty/transaction-entries/questions-responses.mjs +18 -0
  155. package/resources/loyalty/transaction-entries/questions-responses.mjs.map +1 -0
  156. package/resources/loyalty/transaction-entries/questions.d.ts +150 -0
  157. package/resources/loyalty/transaction-entries/questions.d.ts.map +1 -0
  158. package/resources/loyalty/transaction-entries/questions.js +27 -0
  159. package/resources/loyalty/transaction-entries/questions.js.map +1 -0
  160. package/resources/loyalty/transaction-entries/questions.mjs +23 -0
  161. package/resources/loyalty/transaction-entries/questions.mjs.map +1 -0
  162. package/resources/loyalty/transaction-entries/transaction-entries.d.ts +300 -0
  163. package/resources/loyalty/transaction-entries/transaction-entries.d.ts.map +1 -0
  164. package/resources/loyalty/transaction-entries/transaction-entries.js +66 -0
  165. package/resources/loyalty/transaction-entries/transaction-entries.js.map +1 -0
  166. package/resources/loyalty/transaction-entries/transaction-entries.mjs +39 -0
  167. package/resources/loyalty/transaction-entries/transaction-entries.mjs.map +1 -0
  168. package/resources/users/index.d.ts +2 -2
  169. package/resources/users/index.d.ts.map +1 -1
  170. package/resources/users/index.js.map +1 -1
  171. package/resources/users/index.mjs +2 -2
  172. package/resources/users/index.mjs.map +1 -1
  173. package/resources/users/metadatas.d.ts +79 -11
  174. package/resources/users/metadatas.d.ts.map +1 -1
  175. package/resources/users/metadatas.js +6 -0
  176. package/resources/users/metadatas.js.map +1 -1
  177. package/resources/users/metadatas.mjs +6 -0
  178. package/resources/users/metadatas.mjs.map +1 -1
  179. package/resources/users/users.d.ts +4 -4
  180. package/resources/users/users.d.ts.map +1 -1
  181. package/resources/users/users.js.map +1 -1
  182. package/resources/users/users.mjs +2 -2
  183. package/resources/users/users.mjs.map +1 -1
  184. package/resources/users/wallets.d.ts +0 -189
  185. package/resources/users/wallets.d.ts.map +1 -1
  186. package/resources/users/wallets.js +0 -19
  187. package/resources/users/wallets.js.map +1 -1
  188. package/resources/users/wallets.mjs +0 -19
  189. package/resources/users/wallets.mjs.map +1 -1
  190. package/src/core.ts +14 -6
  191. package/src/index.ts +14 -12
  192. package/src/resources/assets/assets.ts +294 -0
  193. package/src/resources/assets/index.ts +38 -0
  194. package/src/resources/assets/minting.ts +153 -0
  195. package/src/resources/assets/referral/index.ts +14 -0
  196. package/src/resources/assets/referral/referral.ts +74 -0
  197. package/src/resources/assets/referral/users.ts +99 -0
  198. package/src/resources/assets/users.ts +415 -0
  199. package/src/resources/assets/website-collections.ts +147 -0
  200. package/src/resources/assets/website-user-roles.ts +107 -0
  201. package/src/resources/auction-bids.ts +2 -48
  202. package/src/resources/drip/drip.ts +4 -8
  203. package/src/resources/drip/index.ts +2 -2
  204. package/src/resources/drip/quests.ts +1 -206
  205. package/src/resources/drip/status.ts +1 -29
  206. package/src/resources/index.ts +7 -2
  207. package/src/resources/loyalty/accounts.ts +1 -195
  208. package/src/resources/loyalty/badges.ts +779 -77
  209. package/src/resources/loyalty/currencies.ts +1 -7
  210. package/src/resources/loyalty/index.ts +7 -2
  211. package/src/resources/loyalty/loyalty.ts +14 -8
  212. package/src/resources/loyalty/multipliers.ts +49 -4
  213. package/src/resources/loyalty/rule-edits.ts +2 -2
  214. package/src/resources/loyalty/rules.ts +247 -159
  215. package/src/resources/loyalty/transaction-entries/accounts.ts +251 -0
  216. package/src/resources/loyalty/transaction-entries/index.ts +34 -0
  217. package/src/resources/loyalty/transaction-entries/questions-responses.ts +146 -0
  218. package/src/resources/loyalty/transaction-entries/questions.ts +208 -0
  219. package/src/resources/loyalty/transaction-entries/transaction-entries.ts +525 -0
  220. package/src/resources/users/index.ts +8 -9
  221. package/src/resources/users/metadatas.ts +109 -10
  222. package/src/resources/users/users.ts +11 -17
  223. package/src/resources/users/wallets.ts +1 -267
  224. package/src/version.ts +1 -1
  225. package/version.d.ts +1 -1
  226. package/version.js +1 -1
  227. package/version.mjs +1 -1
  228. package/resources/assets.d.ts +0 -50
  229. package/resources/assets.d.ts.map +0 -1
  230. package/resources/assets.js +0 -17
  231. package/resources/assets.js.map +0 -1
  232. package/resources/assets.mjs +0 -13
  233. package/resources/assets.mjs.map +0 -1
  234. package/resources/loyalty/transaction-entries.d.ts +0 -175
  235. package/resources/loyalty/transaction-entries.d.ts.map +0 -1
  236. package/resources/loyalty/transaction-entries.js +0 -16
  237. package/resources/loyalty/transaction-entries.js.map +0 -1
  238. package/resources/loyalty/transaction-entries.mjs +0 -12
  239. package/resources/loyalty/transaction-entries.mjs.map +0 -1
  240. package/src/resources/assets.ts +0 -71
  241. package/src/resources/loyalty/transaction-entries.ts +0 -229
@@ -0,0 +1,191 @@
1
+ import { APIResource } from "../../../resource.js";
2
+ import * as Core from "../../../core.js";
3
+ export declare class Accounts extends APIResource {
4
+ /**
5
+ * Get loyalty accounts
6
+ */
7
+ list(query?: AccountListParams, options?: Core.RequestOptions): Core.APIPromise<AccountListResponse>;
8
+ list(options?: Core.RequestOptions): Core.APIPromise<AccountListResponse>;
9
+ /**
10
+ * Returns the user's rank determined by their loyalty points for the specified
11
+ * loyalty currency. This can be a slow operation for large organizations. We
12
+ * recommend caching when possible.
13
+ */
14
+ retrieveRank(pathId: string, query: AccountRetrieveRankParams, options?: Core.RequestOptions): Core.APIPromise<AccountRetrieveRankResponse>;
15
+ }
16
+ /**
17
+ * Schema for the response of getting loyalty accounts
18
+ */
19
+ export interface AccountListResponse {
20
+ /**
21
+ * Array of loyalty accounts
22
+ */
23
+ data: Array<AccountListResponse.Data>;
24
+ /**
25
+ * Indicates if there is a next page of results
26
+ */
27
+ hasNextPage: boolean;
28
+ /**
29
+ * Optional message
30
+ */
31
+ message?: string;
32
+ }
33
+ export declare namespace AccountListResponse {
34
+ /**
35
+ * Schema for a loyalty account
36
+ */
37
+ interface Data {
38
+ /**
39
+ * Unique identifier for the loyalty account
40
+ */
41
+ id: string;
42
+ /**
43
+ * Unique identifier for the loyalty currency
44
+ */
45
+ loyaltyCurrencyId: string;
46
+ /**
47
+ * User associated with the loyalty account
48
+ */
49
+ user: Data.User | null;
50
+ /**
51
+ * Unique identifier for the user
52
+ */
53
+ userId: string | null;
54
+ /**
55
+ * Balance amount in the loyalty account
56
+ */
57
+ amount?: unknown;
58
+ /**
59
+ * Version number used for optimistic locking
60
+ */
61
+ lockVersion?: unknown;
62
+ }
63
+ namespace Data {
64
+ /**
65
+ * Schema for a user
66
+ */
67
+ interface User {
68
+ /**
69
+ * Unique identifier for the user
70
+ */
71
+ id: string;
72
+ /**
73
+ * Array of metadata associated with the user
74
+ */
75
+ userMetadata: Array<User.UserMetadata>;
76
+ /**
77
+ * Ethereum wallet address of the user
78
+ */
79
+ walletAddress: string | null;
80
+ }
81
+ namespace User {
82
+ /**
83
+ * Schema for user metadata
84
+ */
85
+ interface UserMetadata {
86
+ /**
87
+ * Discord username associated with the user
88
+ */
89
+ discordUser: string | null;
90
+ /**
91
+ * Display name of the user
92
+ */
93
+ displayName: string | null;
94
+ /**
95
+ * URL of the user's logo
96
+ */
97
+ logoUrl: string | null;
98
+ /**
99
+ * Twitter username associated with the user
100
+ */
101
+ twitterUser: string | null;
102
+ /**
103
+ * Identifier for the wallet group
104
+ */
105
+ walletGroupIdentifier: string | null;
106
+ }
107
+ }
108
+ }
109
+ }
110
+ export interface AccountRetrieveRankResponse {
111
+ /**
112
+ * Rank of the user
113
+ */
114
+ rank: number;
115
+ }
116
+ export interface AccountListParams {
117
+ /**
118
+ * Discord username to filter accounts by
119
+ */
120
+ discordUser?: string;
121
+ /**
122
+ * Maximum number of accounts to return
123
+ */
124
+ limit?: number;
125
+ /**
126
+ * Unique identifier for the loyalty currency
127
+ */
128
+ loyaltyCurrencyId?: string;
129
+ /**
130
+ * Order the accounts by amount in ascending or descending order
131
+ */
132
+ 'orderBy[amount]'?: 'asc' | 'desc';
133
+ /**
134
+ * Unique identifier for the organization to filter by
135
+ */
136
+ organizationId?: string;
137
+ /**
138
+ * Pagination cursor to start after a specific account ID
139
+ */
140
+ startingAfter?: string;
141
+ /**
142
+ * Twitter username to filter accounts by
143
+ */
144
+ twitterUser?: string;
145
+ /**
146
+ * External identifier for the user group controlled by you
147
+ */
148
+ userGroupExternalIdentifier?: string;
149
+ /**
150
+ * Unique identifier for the user group
151
+ */
152
+ userGroupId?: string;
153
+ /**
154
+ * User ID(s) to filter accounts by
155
+ */
156
+ userId?: string | Array<string>;
157
+ /**
158
+ * Wallet address(es) to filter accounts by
159
+ */
160
+ walletAddress?: string | Array<string>;
161
+ /**
162
+ * Wallet group identifier to filter accounts by
163
+ */
164
+ walletGroupIdentifier?: string;
165
+ /**
166
+ * Unique identifier for the website to filter by
167
+ */
168
+ websiteId?: string;
169
+ }
170
+ export interface AccountRetrieveRankParams {
171
+ /**
172
+ * UUID of the account
173
+ */
174
+ query_id: string;
175
+ /**
176
+ * UUID of the loyalty currency
177
+ */
178
+ loyaltyCurrencyId: string;
179
+ /**
180
+ * UUID of the organization
181
+ */
182
+ organizationId: string;
183
+ /**
184
+ * UUID of the website
185
+ */
186
+ websiteId: string;
187
+ }
188
+ export declare namespace Accounts {
189
+ export { type AccountListResponse as AccountListResponse, type AccountRetrieveRankResponse as AccountRetrieveRankResponse, type AccountListParams as AccountListParams, type AccountRetrieveRankParams as AccountRetrieveRankParams, };
190
+ }
191
+ //# sourceMappingURL=accounts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../../src/resources/loyalty/transaction-entries/accounts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AAEtC,qBAAa,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,IAAI,CAAC,KAAK,CAAC,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC;IACpG,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC;IAWzE;;;;OAIG;IACH,YAAY,CACV,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,yBAAyB,EAChC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,2BAA2B,CAAC;CAGhD;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;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ING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Accounts = void 0;
5
+ const resource_1 = require("../../../resource.js");
6
+ const core_1 = require("../../../core.js");
7
+ class Accounts extends resource_1.APIResource {
8
+ list(query = {}, options) {
9
+ if ((0, core_1.isRequestOptions)(query)) {
10
+ return this.list({}, query);
11
+ }
12
+ return this._client.get('/api/loyalty/accounts', { query, ...options });
13
+ }
14
+ /**
15
+ * Returns the user's rank determined by their loyalty points for the specified
16
+ * loyalty currency. This can be a slow operation for large organizations. We
17
+ * recommend caching when possible.
18
+ */
19
+ retrieveRank(pathId, query, options) {
20
+ return this._client.get(`/api/loyalty/accounts/${pathId}/rank`, { query, ...options });
21
+ }
22
+ }
23
+ exports.Accounts = Accounts;
24
+ //# sourceMappingURL=accounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../../src/resources/loyalty/transaction-entries/accounts.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,mDAAgD;AAChD,2CAAiD;AAGjD,MAAa,QAAS,SAAQ,sBAAW;IAMvC,IAAI,CACF,QAAiD,EAAE,EACnD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED;;;;OAIG;IACH,YAAY,CACV,MAAc,EACd,KAAgC,EAChC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,MAAM,OAAO,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;CACF;AA5BD,4BA4BC"}
@@ -0,0 +1,20 @@
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
+ export class Accounts extends APIResource {
5
+ list(query = {}, options) {
6
+ if (isRequestOptions(query)) {
7
+ return this.list({}, query);
8
+ }
9
+ return this._client.get('/api/loyalty/accounts', { query, ...options });
10
+ }
11
+ /**
12
+ * Returns the user's rank determined by their loyalty points for the specified
13
+ * loyalty currency. This can be a slow operation for large organizations. We
14
+ * recommend caching when possible.
15
+ */
16
+ retrieveRank(pathId, query, options) {
17
+ return this._client.get(`/api/loyalty/accounts/${pathId}/rank`, { query, ...options });
18
+ }
19
+ }
20
+ //# sourceMappingURL=accounts.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounts.mjs","sourceRoot":"","sources":["../../../src/resources/loyalty/transaction-entries/accounts.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;AAG3B,MAAM,OAAO,QAAS,SAAQ,WAAW;IAMvC,IAAI,CACF,QAAiD,EAAE,EACnD,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED;;;;OAIG;IACH,YAAY,CACV,MAAc,EACd,KAAgC,EAChC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,MAAM,OAAO,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;CACF"}
@@ -0,0 +1,5 @@
1
+ export { Accounts, type AccountListResponse, type AccountRetrieveRankResponse, type AccountListParams, type AccountRetrieveRankParams, } from "./accounts.js";
2
+ export { Questions, type QuestionCreateResponse, type QuestionUpdateResponse, type QuestionListResponse, type QuestionCreateParams, type QuestionUpdateParams, type QuestionListParams, } from "./questions.js";
3
+ export { QuestionsResponses, type QuestionsResponseListResponse, type QuestionsResponseSubmitResponse, type QuestionsResponseListParams, type QuestionsResponseSubmitParams, } from "./questions-responses.js";
4
+ export { TransactionEntries, type TransactionEntryListResponse, type TransactionEntryCreateTransactionResponse, type TransactionEntryListRuleGroupsResponse, type TransactionEntryListParams, type TransactionEntryCreateTransactionParams, type TransactionEntryListRuleGroupsParams, } from "./transaction-entries.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/loyalty/transaction-entries/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EACR,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,GAC/B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,SAAS,EACT,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,GACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,kBAAkB,EAClB,KAAK,6BAA6B,EAClC,KAAK,+BAA+B,EACpC,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,GACnC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,KAAK,4BAA4B,EACjC,KAAK,yCAAyC,EAC9C,KAAK,sCAAsC,EAC3C,KAAK,0BAA0B,EAC/B,KAAK,uCAAuC,EAC5C,KAAK,oCAAoC,GAC1C,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.TransactionEntries = exports.QuestionsResponses = exports.Questions = exports.Accounts = void 0;
5
+ var accounts_1 = require("./accounts.js");
6
+ Object.defineProperty(exports, "Accounts", { enumerable: true, get: function () { return accounts_1.Accounts; } });
7
+ var questions_1 = require("./questions.js");
8
+ Object.defineProperty(exports, "Questions", { enumerable: true, get: function () { return questions_1.Questions; } });
9
+ var questions_responses_1 = require("./questions-responses.js");
10
+ Object.defineProperty(exports, "QuestionsResponses", { enumerable: true, get: function () { return questions_responses_1.QuestionsResponses; } });
11
+ var transaction_entries_1 = require("./transaction-entries.js");
12
+ Object.defineProperty(exports, "TransactionEntries", { enumerable: true, get: function () { return transaction_entries_1.TransactionEntries; } });
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/loyalty/transaction-entries/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,0CAMoB;AALlB,oGAAA,QAAQ,OAAA;AAMV,4CAQqB;AAPnB,sGAAA,SAAS,OAAA;AAQX,gEAM+B;AAL7B,yHAAA,kBAAkB,OAAA;AAMpB,gEAQ+B;AAP7B,yHAAA,kBAAkB,OAAA"}
@@ -0,0 +1,6 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export { Accounts, } from "./accounts.mjs";
3
+ export { Questions, } from "./questions.mjs";
4
+ export { QuestionsResponses, } from "./questions-responses.mjs";
5
+ export { TransactionEntries, } from "./transaction-entries.mjs";
6
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/loyalty/transaction-entries/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,QAAQ,GAKT;OACM,EACL,SAAS,GAOV;OACM,EACL,kBAAkB,GAKnB;OACM,EACL,kBAAkB,GAOnB"}
@@ -0,0 +1,97 @@
1
+ import { APIResource } from "../../../resource.js";
2
+ import * as Core from "../../../core.js";
3
+ export declare class QuestionsResponses extends APIResource {
4
+ /**
5
+ * Retrieve responses submitted by the authenticated user, optionally filtered by
6
+ * question IDs
7
+ */
8
+ list(query?: QuestionsResponseListParams, options?: Core.RequestOptions): Core.APIPromise<QuestionsResponseListResponse>;
9
+ list(options?: Core.RequestOptions): Core.APIPromise<QuestionsResponseListResponse>;
10
+ /**
11
+ * This endpoint allows you to submit a response to a question.
12
+ */
13
+ submit(body: QuestionsResponseSubmitParams, options?: Core.RequestOptions): Core.APIPromise<QuestionsResponseSubmitResponse>;
14
+ }
15
+ /**
16
+ * List of question responses with details
17
+ */
18
+ export interface QuestionsResponseListResponse {
19
+ responses: Array<QuestionsResponseListResponse.Response>;
20
+ }
21
+ export declare namespace QuestionsResponseListResponse {
22
+ /**
23
+ * Response details including the question and choice information
24
+ */
25
+ interface Response {
26
+ id: string;
27
+ createdAt: string;
28
+ isCorrect: boolean;
29
+ loyaltyQuestionChoiceId: string;
30
+ loyaltyQuestionId: string;
31
+ question: Response.Question;
32
+ userId: string;
33
+ }
34
+ namespace Response {
35
+ interface Question {
36
+ loyaltyQuestionChoices: Array<Question.LoyaltyQuestionChoice>;
37
+ text: string;
38
+ }
39
+ namespace Question {
40
+ interface LoyaltyQuestionChoice {
41
+ id: string;
42
+ isCorrect: boolean;
43
+ text: string;
44
+ }
45
+ }
46
+ }
47
+ }
48
+ /**
49
+ * Response returned when submitting an answer to a question
50
+ */
51
+ export interface QuestionsResponseSubmitResponse {
52
+ /**
53
+ * Whether the user had already submitted an answer to this question
54
+ */
55
+ alreadySubmitted: boolean;
56
+ /**
57
+ * Whether the submitted answer was correct
58
+ */
59
+ isCorrect: boolean;
60
+ response: QuestionsResponseSubmitResponse.Response;
61
+ }
62
+ export declare namespace QuestionsResponseSubmitResponse {
63
+ interface Response {
64
+ /**
65
+ * UUID of the response
66
+ */
67
+ id: string;
68
+ /**
69
+ * UUID of the selected choice
70
+ */
71
+ loyaltyQuestionChoiceId: string;
72
+ /**
73
+ * UUID of the question being answered
74
+ */
75
+ loyaltyQuestionId: string;
76
+ /**
77
+ * UUID of the user who submitted the response
78
+ */
79
+ userId: string;
80
+ }
81
+ }
82
+ export interface QuestionsResponseListParams {
83
+ /**
84
+ * UUID(s) of the questions to filter responses
85
+ */
86
+ questionsId?: string | Array<string>;
87
+ }
88
+ export interface QuestionsResponseSubmitParams {
89
+ /**
90
+ * UUID of the selected choice
91
+ */
92
+ loyaltyQuestionChoiceId: string;
93
+ }
94
+ export declare namespace QuestionsResponses {
95
+ export { type QuestionsResponseListResponse as QuestionsResponseListResponse, type QuestionsResponseSubmitResponse as QuestionsResponseSubmitResponse, type QuestionsResponseListParams as QuestionsResponseListParams, type QuestionsResponseSubmitParams as QuestionsResponseSubmitParams, };
96
+ }
97
+ //# sourceMappingURL=questions-responses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"questions-responses.d.ts","sourceRoot":"","sources":["../../../src/resources/loyalty/transaction-entries/questions-responses.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AAEtC,qBAAa,kBAAmB,SAAQ,WAAW;IACjD;;;OAGG;IACH,IAAI,CACF,KAAK,CAAC,EAAE,2BAA2B,EACnC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,6BAA6B,CAAC;IACjD,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,6BAA6B,CAAC;IAWnF;;OAEG;IACH,MAAM,CACJ,IAAI,EAAE,6BAA6B,EACnC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,+BAA+B,CAAC;CAGpD;AAED;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,SAAS,EAAE,KAAK,CAA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uB,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,CAAC,OAAO,WAAW,kBAAkB,CAAC;IAC1C,OAAO,EACL,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,6BAA6B,IAAI,6BAA6B,GACpE,CAAC;CACH"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.QuestionsResponses = void 0;
5
+ const resource_1 = require("../../../resource.js");
6
+ const core_1 = require("../../../core.js");
7
+ class QuestionsResponses extends resource_1.APIResource {
8
+ list(query = {}, options) {
9
+ if ((0, core_1.isRequestOptions)(query)) {
10
+ return this.list({}, query);
11
+ }
12
+ return this._client.get('/api/loyalty/questions_responses', { query, ...options });
13
+ }
14
+ /**
15
+ * This endpoint allows you to submit a response to a question.
16
+ */
17
+ submit(body, options) {
18
+ return this._client.post('/api/loyalty/questions_responses', { body, ...options });
19
+ }
20
+ }
21
+ exports.QuestionsResponses = QuestionsResponses;
22
+ //# sourceMappingURL=questions-responses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"questions-responses.js","sourceRoot":"","sources":["../../../src/resources/loyalty/transaction-entries/questions-responses.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,mDAAgD;AAChD,2CAAiD;AAGjD,MAAa,kBAAmB,SAAQ,sBAAW;IAUjD,IAAI,CACF,QAA2D,EAAE,EAC7D,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kCAAkC,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;IAED;;OAEG;IACH,MAAM,CACJ,IAAmC,EACnC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kCAAkC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;CACF;AA7BD,gDA6BC"}
@@ -0,0 +1,18 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../../resource.mjs";
3
+ import { isRequestOptions } from "../../../core.mjs";
4
+ export class QuestionsResponses extends APIResource {
5
+ list(query = {}, options) {
6
+ if (isRequestOptions(query)) {
7
+ return this.list({}, query);
8
+ }
9
+ return this._client.get('/api/loyalty/questions_responses', { query, ...options });
10
+ }
11
+ /**
12
+ * This endpoint allows you to submit a response to a question.
13
+ */
14
+ submit(body, options) {
15
+ return this._client.post('/api/loyalty/questions_responses', { body, ...options });
16
+ }
17
+ }
18
+ //# sourceMappingURL=questions-responses.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"questions-responses.mjs","sourceRoot":"","sources":["../../../src/resources/loyalty/transaction-entries/questions-responses.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;AAG3B,MAAM,OAAO,kBAAmB,SAAQ,WAAW;IAUjD,IAAI,CACF,QAA2D,EAAE,EAC7D,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kCAAkC,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;IAED;;OAEG;IACH,MAAM,CACJ,IAAmC,EACnC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kCAAkC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;CACF"}
@@ -0,0 +1,150 @@
1
+ import { APIResource } from "../../../resource.js";
2
+ import * as Core from "../../../core.js";
3
+ export declare class Questions extends APIResource {
4
+ /**
5
+ * This endpoint allows you to create a new question.
6
+ */
7
+ create(body: QuestionCreateParams, options?: Core.RequestOptions): Core.APIPromise<QuestionCreateResponse>;
8
+ /**
9
+ * This endpoint allows you to update an existing question.
10
+ */
11
+ update(id: string, body: QuestionUpdateParams, options?: Core.RequestOptions): Core.APIPromise<QuestionUpdateResponse>;
12
+ /**
13
+ * This endpoint allows you to fetch questions for a loyalty rule.
14
+ */
15
+ list(query: QuestionListParams, options?: Core.RequestOptions): Core.APIPromise<QuestionListResponse>;
16
+ }
17
+ /**
18
+ * Response returned for a question
19
+ */
20
+ export interface QuestionCreateResponse {
21
+ id: string;
22
+ loyaltyQuestionChoices: Array<QuestionCreateResponse.LoyaltyQuestionChoice>;
23
+ text: string;
24
+ }
25
+ export declare namespace QuestionCreateResponse {
26
+ interface LoyaltyQuestionChoice {
27
+ id: string;
28
+ sortIdentifier: number;
29
+ text: string;
30
+ }
31
+ }
32
+ /**
33
+ * Response returned for a question
34
+ */
35
+ export interface QuestionUpdateResponse {
36
+ id: string;
37
+ loyaltyQuestionChoices: Array<QuestionUpdateResponse.LoyaltyQuestionChoice>;
38
+ text: string;
39
+ }
40
+ export declare namespace QuestionUpdateResponse {
41
+ interface LoyaltyQuestionChoice {
42
+ id: string;
43
+ sortIdentifier: number;
44
+ text: string;
45
+ }
46
+ }
47
+ export type QuestionListResponse = Array<QuestionListResponse.QuestionListResponseItem>;
48
+ export declare namespace QuestionListResponse {
49
+ /**
50
+ * Response returned for a question
51
+ */
52
+ interface QuestionListResponseItem {
53
+ id: string;
54
+ loyaltyQuestionChoices: Array<QuestionListResponseItem.LoyaltyQuestionChoice>;
55
+ text: string;
56
+ }
57
+ namespace QuestionListResponseItem {
58
+ interface LoyaltyQuestionChoice {
59
+ id: string;
60
+ sortIdentifier: number;
61
+ text: string;
62
+ }
63
+ }
64
+ }
65
+ export interface QuestionCreateParams {
66
+ /**
67
+ * Array of choices for the question
68
+ */
69
+ loyaltyQuestionAnswers: Array<QuestionCreateParams.LoyaltyQuestionAnswer>;
70
+ /**
71
+ * UUID of the loyalty rule
72
+ */
73
+ loyaltyRuleId: string;
74
+ /**
75
+ * The text of the question
76
+ */
77
+ questionText: string;
78
+ /**
79
+ * Whether the question allows multiple attempts
80
+ */
81
+ allowMultipleAttempts?: boolean;
82
+ }
83
+ export declare namespace QuestionCreateParams {
84
+ interface LoyaltyQuestionAnswer {
85
+ /**
86
+ * Whether this choice is correct
87
+ */
88
+ isCorrect: boolean;
89
+ /**
90
+ * The order in which to display the choice
91
+ */
92
+ sortIdentifier: number;
93
+ /**
94
+ * The text of the choice
95
+ */
96
+ text: string;
97
+ /**
98
+ * UUID of the choice (optional for new choices)
99
+ */
100
+ id?: string;
101
+ }
102
+ }
103
+ export interface QuestionUpdateParams {
104
+ /**
105
+ * Array of choices for the question
106
+ */
107
+ loyaltyQuestionAnswers: Array<QuestionUpdateParams.LoyaltyQuestionAnswer>;
108
+ /**
109
+ * The text of the question
110
+ */
111
+ questionText: string;
112
+ }
113
+ export declare namespace QuestionUpdateParams {
114
+ interface LoyaltyQuestionAnswer {
115
+ /**
116
+ * Whether this choice is correct
117
+ */
118
+ isCorrect: boolean;
119
+ /**
120
+ * The order in which to display the choice
121
+ */
122
+ sortIdentifier: number;
123
+ /**
124
+ * The text of the choice
125
+ */
126
+ text: string;
127
+ /**
128
+ * UUID of the choice (optional for new choices)
129
+ */
130
+ id?: string;
131
+ }
132
+ }
133
+ export interface QuestionListParams {
134
+ /**
135
+ * UUID of the loyalty rule to fetch questions for
136
+ */
137
+ loyaltyRuleIds: string | Array<string>;
138
+ /**
139
+ * UUID of the organization to fetch questions for
140
+ */
141
+ organizationId: string;
142
+ /**
143
+ * UUID of the website to fetch questions for
144
+ */
145
+ websiteId: string;
146
+ }
147
+ export declare namespace Questions {
148
+ export { type QuestionCreateResponse as QuestionCreateResponse, type QuestionUpdateResponse as QuestionUpdateResponse, type QuestionListResponse as QuestionListResponse, type QuestionCreateParams as QuestionCreateParams, type QuestionUpdateParams as QuestionUpdateParams, type QuestionListParams as QuestionListParams, };
149
+ }
150
+ //# sourceMappingURL=questions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"questions.d.ts","sourceRoot":"","sources":["../../../src/resources/loyalty/transaction-entries/questions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AAEtC,qBAAa,SAAU,SAAQ,WAAW;IACxC;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC;IAI1G;;OAEG;IACH,MAAM,CACJ,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,oBAAoB,EAC1B,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC;IAI1C;;OAEG;IACH,IAAI,CAAC,KAAK,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC;CAGtG;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IAEX,sBAAsB,EAAE,KAAK,CAAC,sBAAsB,CAAC,qBAAqB,CAAC,CAAC;IAE5E,IAAI,EAAE,MAAM,CAAC;CACd;AAED,yBAAiB,sBAAsB,CAAC;IACtC,UAAiB,qBAAqB;QACpC,EAAE,EAAE,MAAM,CAAC;QAEX,cAAc,EAAE,MAAM,CAAC;QAEvB,IAAI,EAAE,MAAM,CAA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AC;KACb;CACF;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,sBAAsB,EAAE,KAAK,CAAC,oBAAoB,CAAC,qBAAqB,CAAC,CAAC;IAE1E;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,yBAAiB,oBAAoB,CAAC;IACpC,UAAiB,qBAAqB;QACpC;;WAEG;QACH,SAAS,EAAE,OAAO,CAAC;QAEnB;;WAEG;QACH,cAAc,EAAE,MAAM,CAAC;QAEvB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,EAAE,CAAC,EAAE,MAAM,CAAC;KACb;CACF;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,cAAc,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAEvC;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Questions = void 0;
5
+ const resource_1 = require("../../../resource.js");
6
+ class Questions extends resource_1.APIResource {
7
+ /**
8
+ * This endpoint allows you to create a new question.
9
+ */
10
+ create(body, options) {
11
+ return this._client.post('/api/loyalty/questions', { body, ...options });
12
+ }
13
+ /**
14
+ * This endpoint allows you to update an existing question.
15
+ */
16
+ update(id, body, options) {
17
+ return this._client.post(`/api/loyalty/questions/${id}`, { body, ...options });
18
+ }
19
+ /**
20
+ * This endpoint allows you to fetch questions for a loyalty rule.
21
+ */
22
+ list(query, options) {
23
+ return this._client.get('/api/loyalty/questions', { query, ...options });
24
+ }
25
+ }
26
+ exports.Questions = Questions;
27
+ //# sourceMappingURL=questions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"questions.js","sourceRoot":"","sources":["../../../src/resources/loyalty/transaction-entries/questions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,mDAAgD;AAGhD,MAAa,SAAU,SAAQ,sBAAW;IACxC;;OAEG;IACH,MAAM,CAAC,IAA0B,EAAE,OAA6B;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED;;OAEG;IACH,MAAM,CACJ,EAAU,EACV,IAA0B,EAC1B,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,KAAyB,EAAE,OAA6B;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3E,CAAC;CACF;AAzBD,8BAyBC"}
@@ -0,0 +1,23 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../../resource.mjs";
3
+ export class Questions extends APIResource {
4
+ /**
5
+ * This endpoint allows you to create a new question.
6
+ */
7
+ create(body, options) {
8
+ return this._client.post('/api/loyalty/questions', { body, ...options });
9
+ }
10
+ /**
11
+ * This endpoint allows you to update an existing question.
12
+ */
13
+ update(id, body, options) {
14
+ return this._client.post(`/api/loyalty/questions/${id}`, { body, ...options });
15
+ }
16
+ /**
17
+ * This endpoint allows you to fetch questions for a loyalty rule.
18
+ */
19
+ list(query, options) {
20
+ return this._client.get('/api/loyalty/questions', { query, ...options });
21
+ }
22
+ }
23
+ //# sourceMappingURL=questions.mjs.map