@whop/sdk 0.0.24 → 0.0.26

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 (181) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/README.md +2 -2
  3. package/client.d.mts +30 -18
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +30 -18
  6. package/client.d.ts.map +1 -1
  7. package/client.js +15 -2
  8. package/client.js.map +1 -1
  9. package/client.mjs +17 -4
  10. package/client.mjs.map +1 -1
  11. package/internal/parse.d.mts.map +1 -1
  12. package/internal/parse.d.ts.map +1 -1
  13. package/internal/parse.js +5 -0
  14. package/internal/parse.js.map +1 -1
  15. package/internal/parse.mjs +5 -0
  16. package/internal/parse.mjs.map +1 -1
  17. package/package.json +1 -1
  18. package/resources/ai-chats.d.mts +169 -0
  19. package/resources/ai-chats.d.mts.map +1 -0
  20. package/resources/ai-chats.d.ts +169 -0
  21. package/resources/ai-chats.d.ts.map +1 -0
  22. package/resources/ai-chats.js +53 -0
  23. package/resources/ai-chats.js.map +1 -0
  24. package/resources/ai-chats.mjs +49 -0
  25. package/resources/ai-chats.mjs.map +1 -0
  26. package/resources/apps.d.mts +1 -1
  27. package/resources/apps.d.mts.map +1 -1
  28. package/resources/apps.d.ts +1 -1
  29. package/resources/apps.d.ts.map +1 -1
  30. package/resources/authorized-users.d.mts +39 -5
  31. package/resources/authorized-users.d.mts.map +1 -1
  32. package/resources/authorized-users.d.ts +39 -5
  33. package/resources/authorized-users.d.ts.map +1 -1
  34. package/resources/authorized-users.js +1 -1
  35. package/resources/authorized-users.js.map +1 -1
  36. package/resources/authorized-users.mjs +1 -1
  37. package/resources/authorized-users.mjs.map +1 -1
  38. package/resources/checkout-configurations.d.mts +12 -0
  39. package/resources/checkout-configurations.d.mts.map +1 -1
  40. package/resources/checkout-configurations.d.ts +12 -0
  41. package/resources/checkout-configurations.d.ts.map +1 -1
  42. package/resources/company-token-transactions.d.mts +339 -0
  43. package/resources/company-token-transactions.d.mts.map +1 -0
  44. package/resources/company-token-transactions.d.ts +339 -0
  45. package/resources/company-token-transactions.d.ts.map +1 -0
  46. package/resources/company-token-transactions.js +59 -0
  47. package/resources/company-token-transactions.js.map +1 -0
  48. package/resources/company-token-transactions.mjs +55 -0
  49. package/resources/company-token-transactions.mjs.map +1 -0
  50. package/resources/dm-channels.d.mts +161 -0
  51. package/resources/dm-channels.d.mts.map +1 -0
  52. package/resources/dm-channels.d.ts +161 -0
  53. package/resources/dm-channels.d.ts.map +1 -0
  54. package/resources/dm-channels.js +87 -0
  55. package/resources/dm-channels.js.map +1 -0
  56. package/resources/dm-channels.mjs +83 -0
  57. package/resources/dm-channels.mjs.map +1 -0
  58. package/resources/dm-members.d.mts +190 -0
  59. package/resources/dm-members.d.mts.map +1 -0
  60. package/resources/dm-members.d.ts +190 -0
  61. package/resources/dm-members.d.ts.map +1 -0
  62. package/resources/dm-members.js +94 -0
  63. package/resources/dm-members.js.map +1 -0
  64. package/resources/dm-members.mjs +90 -0
  65. package/resources/dm-members.mjs.map +1 -0
  66. package/resources/files.d.mts +7 -3
  67. package/resources/files.d.mts.map +1 -1
  68. package/resources/files.d.ts +7 -3
  69. package/resources/files.d.ts.map +1 -1
  70. package/resources/index.d.mts +13 -9
  71. package/resources/index.d.mts.map +1 -1
  72. package/resources/index.d.ts +13 -9
  73. package/resources/index.d.ts.map +1 -1
  74. package/resources/index.js +9 -1
  75. package/resources/index.js.map +1 -1
  76. package/resources/index.mjs +6 -2
  77. package/resources/index.mjs.map +1 -1
  78. package/resources/leads.d.mts +9 -177
  79. package/resources/leads.d.mts.map +1 -1
  80. package/resources/leads.d.ts +9 -177
  81. package/resources/leads.d.ts.map +1 -1
  82. package/resources/ledger-accounts.d.mts +3 -2
  83. package/resources/ledger-accounts.d.mts.map +1 -1
  84. package/resources/ledger-accounts.d.ts +3 -2
  85. package/resources/ledger-accounts.d.ts.map +1 -1
  86. package/resources/ledger-accounts.js.map +1 -1
  87. package/resources/ledger-accounts.mjs.map +1 -1
  88. package/resources/members.d.mts +13 -5
  89. package/resources/members.d.mts.map +1 -1
  90. package/resources/members.d.ts +13 -5
  91. package/resources/members.d.ts.map +1 -1
  92. package/resources/members.js +1 -1
  93. package/resources/members.js.map +1 -1
  94. package/resources/members.mjs +1 -1
  95. package/resources/members.mjs.map +1 -1
  96. package/resources/memberships.d.mts +32 -2
  97. package/resources/memberships.d.mts.map +1 -1
  98. package/resources/memberships.d.ts +32 -2
  99. package/resources/memberships.d.ts.map +1 -1
  100. package/resources/memberships.js +18 -0
  101. package/resources/memberships.js.map +1 -1
  102. package/resources/memberships.mjs +18 -0
  103. package/resources/memberships.mjs.map +1 -1
  104. package/resources/messages.d.mts +17 -1
  105. package/resources/messages.d.mts.map +1 -1
  106. package/resources/messages.d.ts +17 -1
  107. package/resources/messages.d.ts.map +1 -1
  108. package/resources/messages.js +10 -0
  109. package/resources/messages.js.map +1 -1
  110. package/resources/messages.mjs +10 -0
  111. package/resources/messages.mjs.map +1 -1
  112. package/resources/payments.d.mts +42 -1
  113. package/resources/payments.d.mts.map +1 -1
  114. package/resources/payments.d.ts +42 -1
  115. package/resources/payments.d.ts.map +1 -1
  116. package/resources/payout-methods.d.mts +26 -3
  117. package/resources/payout-methods.d.mts.map +1 -1
  118. package/resources/payout-methods.d.ts +26 -3
  119. package/resources/payout-methods.d.ts.map +1 -1
  120. package/resources/payout-methods.js.map +1 -1
  121. package/resources/payout-methods.mjs.map +1 -1
  122. package/resources/reactions.d.mts +24 -1
  123. package/resources/reactions.d.mts.map +1 -1
  124. package/resources/reactions.d.ts +24 -1
  125. package/resources/reactions.d.ts.map +1 -1
  126. package/resources/reactions.js +11 -0
  127. package/resources/reactions.js.map +1 -1
  128. package/resources/reactions.mjs +11 -0
  129. package/resources/reactions.mjs.map +1 -1
  130. package/resources/refunds.d.mts +1 -1
  131. package/resources/refunds.d.mts.map +1 -1
  132. package/resources/refunds.d.ts +1 -1
  133. package/resources/refunds.d.ts.map +1 -1
  134. package/resources/shared.d.mts +73 -1
  135. package/resources/shared.d.mts.map +1 -1
  136. package/resources/shared.d.ts +73 -1
  137. package/resources/shared.d.ts.map +1 -1
  138. package/resources/verifications.d.mts +11 -3
  139. package/resources/verifications.d.mts.map +1 -1
  140. package/resources/verifications.d.ts +11 -3
  141. package/resources/verifications.d.ts.map +1 -1
  142. package/resources/webhooks.d.mts +43 -293
  143. package/resources/webhooks.d.mts.map +1 -1
  144. package/resources/webhooks.d.ts +43 -293
  145. package/resources/webhooks.d.ts.map +1 -1
  146. package/resources/webhooks.js.map +1 -1
  147. package/resources/webhooks.mjs +2 -2
  148. package/resources/webhooks.mjs.map +1 -1
  149. package/resources/withdrawals.d.mts +21 -128
  150. package/resources/withdrawals.d.mts.map +1 -1
  151. package/resources/withdrawals.d.ts +21 -128
  152. package/resources/withdrawals.d.ts.map +1 -1
  153. package/src/client.ts +133 -18
  154. package/src/internal/parse.ts +6 -0
  155. package/src/resources/ai-chats.ts +227 -0
  156. package/src/resources/apps.ts +6 -0
  157. package/src/resources/authorized-users.ts +45 -5
  158. package/src/resources/checkout-configurations.ts +15 -0
  159. package/src/resources/company-token-transactions.ts +433 -0
  160. package/src/resources/dm-channels.ts +212 -0
  161. package/src/resources/dm-members.ts +248 -0
  162. package/src/resources/files.ts +8 -2
  163. package/src/resources/index.ts +64 -9
  164. package/src/resources/leads.ts +9 -205
  165. package/src/resources/ledger-accounts.ts +3 -35
  166. package/src/resources/members.ts +16 -6
  167. package/src/resources/memberships.ts +45 -9
  168. package/src/resources/messages.ts +22 -0
  169. package/src/resources/payments.ts +109 -57
  170. package/src/resources/payout-methods.ts +37 -2
  171. package/src/resources/reactions.ts +36 -0
  172. package/src/resources/refunds.ts +2 -1
  173. package/src/resources/shared.ts +110 -11
  174. package/src/resources/verifications.ts +49 -36
  175. package/src/resources/webhooks.ts +78 -728
  176. package/src/resources/withdrawals.ts +29 -205
  177. package/src/version.ts +1 -1
  178. package/version.d.mts +1 -1
  179. package/version.d.ts +1 -1
  180. package/version.js +1 -1
  181. package/version.mjs +1 -1
@@ -0,0 +1,339 @@
1
+ import { APIResource } from "../core/resource.js";
2
+ import { APIPromise } from "../core/api-promise.js";
3
+ import { CursorPage, type CursorPageParams, PagePromise } from "../core/pagination.js";
4
+ import { RequestOptions } from "../internal/request-options.js";
5
+ export declare class CompanyTokenTransactions extends APIResource {
6
+ /**
7
+ * Create a token transaction (add/subtract/transfer) for a member
8
+ *
9
+ * Required permissions:
10
+ *
11
+ * - `company_token_transaction:create`
12
+ * - `member:basic:read`
13
+ * - `company:basic:read`
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const companyTokenTransaction =
18
+ * await client.companyTokenTransactions.create({
19
+ * amount: 6.9,
20
+ * company_id: 'biz_xxxxxxxxxxxxxx',
21
+ * destination_user_id: 'destination_user_id',
22
+ * transaction_type: 'transfer',
23
+ * user_id: 'user_xxxxxxxxxxxxx',
24
+ * });
25
+ * ```
26
+ */
27
+ create(body: CompanyTokenTransactionCreateParams, options?: RequestOptions): APIPromise<CompanyTokenTransaction>;
28
+ /**
29
+ * Retrieves a token transaction by ID
30
+ *
31
+ * Required permissions:
32
+ *
33
+ * - `company_token_transaction:read`
34
+ * - `member:basic:read`
35
+ * - `company:basic:read`
36
+ */
37
+ retrieve(id: string, options?: RequestOptions): APIPromise<CompanyTokenTransaction>;
38
+ /**
39
+ * Lists token transactions for a company
40
+ *
41
+ * Required permissions:
42
+ *
43
+ * - `company_token_transaction:read`
44
+ * - `member:basic:read`
45
+ * - `company:basic:read`
46
+ */
47
+ list(query: CompanyTokenTransactionListParams, options?: RequestOptions): PagePromise<CompanyTokenTransactionListResponsesCursorPage, CompanyTokenTransactionListResponse>;
48
+ }
49
+ export type CompanyTokenTransactionListResponsesCursorPage = CursorPage<CompanyTokenTransactionListResponse>;
50
+ /**
51
+ * The type of token transaction
52
+ */
53
+ export type BotTokenTransactionTypes = 'add' | 'subtract' | 'transfer';
54
+ /**
55
+ * A token transaction within a company
56
+ */
57
+ export interface CompanyTokenTransaction {
58
+ /**
59
+ * The ID of the transaction
60
+ */
61
+ id: string;
62
+ /**
63
+ * The transaction amount (always positive)
64
+ */
65
+ amount: number;
66
+ /**
67
+ * The company
68
+ */
69
+ company: CompanyTokenTransaction.Company;
70
+ /**
71
+ * When the transaction was created
72
+ */
73
+ created_at: string;
74
+ /**
75
+ * Optional description
76
+ */
77
+ description: string | null;
78
+ /**
79
+ * Optional idempotency key to prevent duplicate transactions
80
+ */
81
+ idempotency_key: string | null;
82
+ /**
83
+ * For transfers, the ID of the linked transaction
84
+ */
85
+ linked_transaction_id: string | null;
86
+ /**
87
+ * The member
88
+ */
89
+ member: CompanyTokenTransaction.Member;
90
+ /**
91
+ * The type of transaction
92
+ */
93
+ transaction_type: BotTokenTransactionTypes;
94
+ /**
95
+ * The user whose balance changed
96
+ */
97
+ user: CompanyTokenTransaction.User;
98
+ }
99
+ export declare namespace CompanyTokenTransaction {
100
+ /**
101
+ * The company
102
+ */
103
+ interface Company {
104
+ /**
105
+ * The ID of the company
106
+ */
107
+ id: string;
108
+ /**
109
+ * The slug/route of the company on the Whop site.
110
+ */
111
+ route: string;
112
+ /**
113
+ * The written name of the company.
114
+ */
115
+ title: string;
116
+ }
117
+ /**
118
+ * The member
119
+ */
120
+ interface Member {
121
+ /**
122
+ * The ID of the member
123
+ */
124
+ id: string;
125
+ }
126
+ /**
127
+ * The user whose balance changed
128
+ */
129
+ interface User {
130
+ /**
131
+ * The internal ID of the user.
132
+ */
133
+ id: string;
134
+ /**
135
+ * The name of the user from their Whop account.
136
+ */
137
+ name: string | null;
138
+ /**
139
+ * The username of the user from their Whop account.
140
+ */
141
+ username: string;
142
+ }
143
+ }
144
+ /**
145
+ * A token transaction within a company
146
+ */
147
+ export interface CompanyTokenTransactionListResponse {
148
+ /**
149
+ * The ID of the transaction
150
+ */
151
+ id: string;
152
+ /**
153
+ * The transaction amount (always positive)
154
+ */
155
+ amount: number;
156
+ /**
157
+ * The company
158
+ */
159
+ company: CompanyTokenTransactionListResponse.Company;
160
+ /**
161
+ * When the transaction was created
162
+ */
163
+ created_at: string;
164
+ /**
165
+ * Optional description
166
+ */
167
+ description: string | null;
168
+ /**
169
+ * Optional idempotency key to prevent duplicate transactions
170
+ */
171
+ idempotency_key: string | null;
172
+ /**
173
+ * For transfers, the ID of the linked transaction
174
+ */
175
+ linked_transaction_id: string | null;
176
+ /**
177
+ * The member
178
+ */
179
+ member: CompanyTokenTransactionListResponse.Member;
180
+ /**
181
+ * The type of transaction
182
+ */
183
+ transaction_type: BotTokenTransactionTypes;
184
+ /**
185
+ * The user whose balance changed
186
+ */
187
+ user: CompanyTokenTransactionListResponse.User;
188
+ }
189
+ export declare namespace CompanyTokenTransactionListResponse {
190
+ /**
191
+ * The company
192
+ */
193
+ interface Company {
194
+ /**
195
+ * The ID of the company
196
+ */
197
+ id: string;
198
+ /**
199
+ * The slug/route of the company on the Whop site.
200
+ */
201
+ route: string;
202
+ /**
203
+ * The written name of the company.
204
+ */
205
+ title: string;
206
+ }
207
+ /**
208
+ * The member
209
+ */
210
+ interface Member {
211
+ /**
212
+ * The ID of the member
213
+ */
214
+ id: string;
215
+ }
216
+ /**
217
+ * The user whose balance changed
218
+ */
219
+ interface User {
220
+ /**
221
+ * The internal ID of the user.
222
+ */
223
+ id: string;
224
+ /**
225
+ * The name of the user from their Whop account.
226
+ */
227
+ name: string | null;
228
+ /**
229
+ * The username of the user from their Whop account.
230
+ */
231
+ username: string;
232
+ }
233
+ }
234
+ export type CompanyTokenTransactionCreateParams = CompanyTokenTransactionCreateParams.CreateCompanyTokenTransactionInputTransactionTypeTransfer | CompanyTokenTransactionCreateParams.CreateCompanyTokenTransactionInputTransactionTypeAdd | CompanyTokenTransactionCreateParams.CreateCompanyTokenTransactionInputTransactionTypeSubtract;
235
+ export declare namespace CompanyTokenTransactionCreateParams {
236
+ interface CreateCompanyTokenTransactionInputTransactionTypeTransfer {
237
+ /**
238
+ * The positive amount of tokens
239
+ */
240
+ amount: number;
241
+ /**
242
+ * The company ID
243
+ */
244
+ company_id: string;
245
+ /**
246
+ * Required for transfers - the user to receive tokens
247
+ */
248
+ destination_user_id: string;
249
+ transaction_type: 'transfer';
250
+ /**
251
+ * The user ID whose balance will change
252
+ */
253
+ user_id: string;
254
+ /**
255
+ * Optional description for the transaction
256
+ */
257
+ description?: string | null;
258
+ /**
259
+ * Optional key to prevent duplicate transactions
260
+ */
261
+ idempotency_key?: string | null;
262
+ }
263
+ interface CreateCompanyTokenTransactionInputTransactionTypeAdd {
264
+ /**
265
+ * The positive amount of tokens
266
+ */
267
+ amount: number;
268
+ /**
269
+ * The company ID
270
+ */
271
+ company_id: string;
272
+ transaction_type: 'add';
273
+ /**
274
+ * The user ID whose balance will change
275
+ */
276
+ user_id: string;
277
+ /**
278
+ * Optional description for the transaction
279
+ */
280
+ description?: string | null;
281
+ /**
282
+ * Optional key to prevent duplicate transactions
283
+ */
284
+ idempotency_key?: string | null;
285
+ }
286
+ interface CreateCompanyTokenTransactionInputTransactionTypeSubtract {
287
+ /**
288
+ * The positive amount of tokens
289
+ */
290
+ amount: number;
291
+ /**
292
+ * The company ID
293
+ */
294
+ company_id: string;
295
+ transaction_type: 'subtract';
296
+ /**
297
+ * The user ID whose balance will change
298
+ */
299
+ user_id: string;
300
+ /**
301
+ * Optional description for the transaction
302
+ */
303
+ description?: string | null;
304
+ /**
305
+ * Optional key to prevent duplicate transactions
306
+ */
307
+ idempotency_key?: string | null;
308
+ }
309
+ }
310
+ export interface CompanyTokenTransactionListParams extends CursorPageParams {
311
+ /**
312
+ * The ID of the company
313
+ */
314
+ company_id: string;
315
+ /**
316
+ * Returns the elements in the list that come before the specified cursor.
317
+ */
318
+ before?: string | null;
319
+ /**
320
+ * Returns the first _n_ elements from the list.
321
+ */
322
+ first?: number | null;
323
+ /**
324
+ * Returns the last _n_ elements from the list.
325
+ */
326
+ last?: number | null;
327
+ /**
328
+ * The type of token transaction
329
+ */
330
+ transaction_type?: BotTokenTransactionTypes | null;
331
+ /**
332
+ * Filter by user ID
333
+ */
334
+ user_id?: string | null;
335
+ }
336
+ export declare namespace CompanyTokenTransactions {
337
+ export { type BotTokenTransactionTypes as BotTokenTransactionTypes, type CompanyTokenTransaction as CompanyTokenTransaction, type CompanyTokenTransactionListResponse as CompanyTokenTransactionListResponse, type CompanyTokenTransactionListResponsesCursorPage as CompanyTokenTransactionListResponsesCursorPage, type CompanyTokenTransactionCreateParams as CompanyTokenTransactionCreateParams, type CompanyTokenTransactionListParams as CompanyTokenTransactionListParams, };
338
+ }
339
+ //# sourceMappingURL=company-token-transactions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"company-token-transactions.d.ts","sourceRoot":"","sources":["../src/resources/company-token-transactions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,cAAc,EAAE;AAGzB,qBAAa,wBAAyB,SAAQ,WAAW;IACvD;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CACJ,IAAI,EAAE,mCAAmC,EACzC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,uBAAuB,CAAC;IAItC;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;IAInF;;;;;;;;OAQG;IACH,IAAI,CACF,KAAK,EAAE,iCAAiC,EACxC,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,8CAA8C,EAAE,mCAAmC,CAAC;CAOpG;AAED,MAAM,MAAM,8CAA8C,GAAG,UAAU,CAAC,mCAAmC,CAAC,CAAC;AAE7G;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,KAAK,GAAG,UAAU,GAAG,UAAU,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAE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AAI,8CAA8C,EACrG,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,iCAAiC,IAAI,iCAAiC,GAC5E,CAAC;CACH"}
@@ -0,0 +1,59 @@
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.CompanyTokenTransactions = void 0;
5
+ const resource_1 = require("../core/resource.js");
6
+ const pagination_1 = require("../core/pagination.js");
7
+ const path_1 = require("../internal/utils/path.js");
8
+ class CompanyTokenTransactions extends resource_1.APIResource {
9
+ /**
10
+ * Create a token transaction (add/subtract/transfer) for a member
11
+ *
12
+ * Required permissions:
13
+ *
14
+ * - `company_token_transaction:create`
15
+ * - `member:basic:read`
16
+ * - `company:basic:read`
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const companyTokenTransaction =
21
+ * await client.companyTokenTransactions.create({
22
+ * amount: 6.9,
23
+ * company_id: 'biz_xxxxxxxxxxxxxx',
24
+ * destination_user_id: 'destination_user_id',
25
+ * transaction_type: 'transfer',
26
+ * user_id: 'user_xxxxxxxxxxxxx',
27
+ * });
28
+ * ```
29
+ */
30
+ create(body, options) {
31
+ return this._client.post('/company_token_transactions', { body, ...options });
32
+ }
33
+ /**
34
+ * Retrieves a token transaction by ID
35
+ *
36
+ * Required permissions:
37
+ *
38
+ * - `company_token_transaction:read`
39
+ * - `member:basic:read`
40
+ * - `company:basic:read`
41
+ */
42
+ retrieve(id, options) {
43
+ return this._client.get((0, path_1.path) `/company_token_transactions/${id}`, options);
44
+ }
45
+ /**
46
+ * Lists token transactions for a company
47
+ *
48
+ * Required permissions:
49
+ *
50
+ * - `company_token_transaction:read`
51
+ * - `member:basic:read`
52
+ * - `company:basic:read`
53
+ */
54
+ list(query, options) {
55
+ return this._client.getAPIList('/company_token_transactions', (pagination_1.CursorPage), { query, ...options });
56
+ }
57
+ }
58
+ exports.CompanyTokenTransactions = CompanyTokenTransactions;
59
+ //# sourceMappingURL=company-token-transactions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"company-token-transactions.js","sourceRoot":"","sources":["../src/resources/company-token-transactions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAAoF;AAEpF,oDAA8C;AAE9C,MAAa,wBAAyB,SAAQ,sBAAW;IACvD;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CACJ,IAAyC,EACzC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IAED;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,+BAA+B,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CACF,KAAwC,EACxC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,6BAA6B,EAC7B,CAAA,uBAA+C,CAAA,EAC/C,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;CACF;AA7DD,4DA6DC"}
@@ -0,0 +1,55 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../core/resource.mjs";
3
+ import { CursorPage } from "../core/pagination.mjs";
4
+ import { path } from "../internal/utils/path.mjs";
5
+ export class CompanyTokenTransactions extends APIResource {
6
+ /**
7
+ * Create a token transaction (add/subtract/transfer) for a member
8
+ *
9
+ * Required permissions:
10
+ *
11
+ * - `company_token_transaction:create`
12
+ * - `member:basic:read`
13
+ * - `company:basic:read`
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const companyTokenTransaction =
18
+ * await client.companyTokenTransactions.create({
19
+ * amount: 6.9,
20
+ * company_id: 'biz_xxxxxxxxxxxxxx',
21
+ * destination_user_id: 'destination_user_id',
22
+ * transaction_type: 'transfer',
23
+ * user_id: 'user_xxxxxxxxxxxxx',
24
+ * });
25
+ * ```
26
+ */
27
+ create(body, options) {
28
+ return this._client.post('/company_token_transactions', { body, ...options });
29
+ }
30
+ /**
31
+ * Retrieves a token transaction by ID
32
+ *
33
+ * Required permissions:
34
+ *
35
+ * - `company_token_transaction:read`
36
+ * - `member:basic:read`
37
+ * - `company:basic:read`
38
+ */
39
+ retrieve(id, options) {
40
+ return this._client.get(path `/company_token_transactions/${id}`, options);
41
+ }
42
+ /**
43
+ * Lists token transactions for a company
44
+ *
45
+ * Required permissions:
46
+ *
47
+ * - `company_token_transaction:read`
48
+ * - `member:basic:read`
49
+ * - `company:basic:read`
50
+ */
51
+ list(query, options) {
52
+ return this._client.getAPIList('/company_token_transactions', (CursorPage), { query, ...options });
53
+ }
54
+ }
55
+ //# sourceMappingURL=company-token-transactions.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"company-token-transactions.mjs","sourceRoot":"","sources":["../src/resources/company-token-transactions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,UAAU,EAAsC;OAElD,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,wBAAyB,SAAQ,WAAW;IACvD;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CACJ,IAAyC,EACzC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IAED;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,+BAA+B,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CACF,KAAwC,EACxC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,6BAA6B,EAC7B,CAAA,UAA+C,CAAA,EAC/C,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,161 @@
1
+ import { APIResource } from "../core/resource.mjs";
2
+ import { APIPromise } from "../core/api-promise.mjs";
3
+ import { CursorPage, type CursorPageParams, PagePromise } from "../core/pagination.mjs";
4
+ import { RequestOptions } from "../internal/request-options.mjs";
5
+ export declare class DmChannels extends APIResource {
6
+ /**
7
+ * Creates a DM channel
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const dmChannel = await client.dmChannels.create({
12
+ * with_user_ids: ['string'],
13
+ * });
14
+ * ```
15
+ */
16
+ create(body: DmChannelCreateParams, options?: RequestOptions): APIPromise<DmChannel>;
17
+ /**
18
+ * Retrieves a DM channel
19
+ *
20
+ * Required permissions:
21
+ *
22
+ * - `dms:read`
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const dmChannel = await client.dmChannels.retrieve('id');
27
+ * ```
28
+ */
29
+ retrieve(id: string, options?: RequestOptions): APIPromise<DmChannel>;
30
+ /**
31
+ * Updates a DM channel
32
+ *
33
+ * Required permissions:
34
+ *
35
+ * - `dms:channel:manage`
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * const dmChannel = await client.dmChannels.update('id');
40
+ * ```
41
+ */
42
+ update(id: string, body?: DmChannelUpdateParams | null | undefined, options?: RequestOptions): APIPromise<DmChannel>;
43
+ /**
44
+ * Lists DM channels for the current user
45
+ *
46
+ * Required permissions:
47
+ *
48
+ * - `dms:read`
49
+ *
50
+ * @example
51
+ * ```ts
52
+ * // Automatically fetches more pages as needed.
53
+ * for await (const dmChannelListResponse of client.dmChannels.list()) {
54
+ * // ...
55
+ * }
56
+ * ```
57
+ */
58
+ list(query?: DmChannelListParams | null | undefined, options?: RequestOptions): PagePromise<DmChannelListResponsesCursorPage, DmChannelListResponse>;
59
+ /**
60
+ * Deletes a DM channel
61
+ *
62
+ * Required permissions:
63
+ *
64
+ * - `dms:channel:manage`
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * const dmChannel = await client.dmChannels.delete('id');
69
+ * ```
70
+ */
71
+ delete(id: string, options?: RequestOptions): APIPromise<DmChannelDeleteResponse>;
72
+ }
73
+ export type DmChannelListResponsesCursorPage = CursorPage<DmChannelListResponse>;
74
+ /**
75
+ * Represents a DM channel
76
+ */
77
+ export interface DmChannel {
78
+ /**
79
+ * The unique identifier for the entity
80
+ */
81
+ id: string;
82
+ /**
83
+ * The time the entity was created (in milliseconds since Unix epoch)
84
+ */
85
+ created_at: string;
86
+ /**
87
+ * When the last message was sent
88
+ */
89
+ last_message_at: string | null;
90
+ /**
91
+ * The custom name of the DM channel, if any
92
+ */
93
+ name: string | null;
94
+ }
95
+ /**
96
+ * Represents a DM channel
97
+ */
98
+ export interface DmChannelListResponse {
99
+ /**
100
+ * The unique identifier for the entity
101
+ */
102
+ id: string;
103
+ /**
104
+ * The time the entity was created (in milliseconds since Unix epoch)
105
+ */
106
+ created_at: string;
107
+ /**
108
+ * When the last message was sent
109
+ */
110
+ last_message_at: string | null;
111
+ /**
112
+ * The custom name of the DM channel, if any
113
+ */
114
+ name: string | null;
115
+ }
116
+ /**
117
+ * Represents `true` or `false` values.
118
+ */
119
+ export type DmChannelDeleteResponse = boolean;
120
+ export interface DmChannelCreateParams {
121
+ /**
122
+ * The user ids to create a DM with. Can be email, username or user_id (tag)
123
+ */
124
+ with_user_ids: Array<string>;
125
+ /**
126
+ * The ID of the company to scope this DM channel to.
127
+ */
128
+ company_id?: string | null;
129
+ /**
130
+ * The custom name for the DM channel
131
+ */
132
+ custom_name?: string | null;
133
+ }
134
+ export interface DmChannelUpdateParams {
135
+ /**
136
+ * The custom name for the DM channel
137
+ */
138
+ custom_name?: string | null;
139
+ }
140
+ export interface DmChannelListParams extends CursorPageParams {
141
+ /**
142
+ * Returns the elements in the list that come before the specified cursor.
143
+ */
144
+ before?: string | null;
145
+ /**
146
+ * Filter DM channels scoped to a specific company
147
+ */
148
+ company_id?: string | null;
149
+ /**
150
+ * Returns the first _n_ elements from the list.
151
+ */
152
+ first?: number | null;
153
+ /**
154
+ * Returns the last _n_ elements from the list.
155
+ */
156
+ last?: number | null;
157
+ }
158
+ export declare namespace DmChannels {
159
+ export { type DmChannel as DmChannel, type DmChannelListResponse as DmChannelListResponse, type DmChannelDeleteResponse as DmChannelDeleteResponse, type DmChannelListResponsesCursorPage as DmChannelListResponsesCursorPage, type DmChannelCreateParams as DmChannelCreateParams, type DmChannelUpdateParams as DmChannelUpdateParams, type DmChannelListParams as DmChannelListParams, };
160
+ }
161
+ //# sourceMappingURL=dm-channels.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dm-channels.d.mts","sourceRoot":"","sources":["../src/resources/dm-channels.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,cAAc,EAAE;AAGzB,qBAAa,UAAW,SAAQ,WAAW;IACzC;;;;;;;;;OASG;IACH,MAAM,CAAC,IAAI,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC;IAIpF;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC;IAIrE;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,EAAE,EAAE,MAAM,EACV,IAAI,GAAE,qBAAqB,GAAG,IAAI,GAAG,SAAc,EACnD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,SAAS,CAAC;IAIxB;;;;;;;;;;;;;;OAcG;IACH,IAAI,CACF,KAAK,GAAE,mBAAmB,GAA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