@whop/sdk 0.0.25 → 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.
- package/CHANGELOG.md +21 -0
- package/client.d.mts +23 -20
- package/client.d.mts.map +1 -1
- package/client.d.ts +23 -20
- package/client.d.ts.map +1 -1
- package/client.js +6 -2
- package/client.js.map +1 -1
- package/client.mjs +8 -4
- package/client.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/ai-chats.d.mts +7 -103
- package/resources/ai-chats.d.mts.map +1 -1
- package/resources/ai-chats.d.ts +7 -103
- package/resources/ai-chats.d.ts.map +1 -1
- package/resources/ai-chats.js.map +1 -1
- package/resources/ai-chats.mjs.map +1 -1
- package/resources/authorized-users.d.mts +39 -5
- package/resources/authorized-users.d.mts.map +1 -1
- package/resources/authorized-users.d.ts +39 -5
- package/resources/authorized-users.d.ts.map +1 -1
- package/resources/authorized-users.js +1 -1
- package/resources/authorized-users.js.map +1 -1
- package/resources/authorized-users.mjs +1 -1
- package/resources/authorized-users.mjs.map +1 -1
- package/resources/company-token-transactions.d.mts +13 -99
- package/resources/company-token-transactions.d.mts.map +1 -1
- package/resources/company-token-transactions.d.ts +13 -99
- package/resources/company-token-transactions.d.ts.map +1 -1
- package/resources/dm-channels.d.mts +161 -0
- package/resources/dm-channels.d.mts.map +1 -0
- package/resources/dm-channels.d.ts +161 -0
- package/resources/dm-channels.d.ts.map +1 -0
- package/resources/dm-channels.js +87 -0
- package/resources/dm-channels.js.map +1 -0
- package/resources/dm-channels.mjs +83 -0
- package/resources/dm-channels.mjs.map +1 -0
- package/resources/dm-members.d.mts +14 -66
- package/resources/dm-members.d.mts.map +1 -1
- package/resources/dm-members.d.ts +14 -66
- package/resources/dm-members.d.ts.map +1 -1
- package/resources/files.d.mts +7 -3
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +7 -3
- package/resources/files.d.ts.map +1 -1
- package/resources/index.d.mts +11 -10
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +11 -10
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -2
- package/resources/index.mjs.map +1 -1
- package/resources/leads.d.mts +9 -177
- package/resources/leads.d.mts.map +1 -1
- package/resources/leads.d.ts +9 -177
- package/resources/leads.d.ts.map +1 -1
- package/resources/ledger-accounts.d.mts +3 -2
- package/resources/ledger-accounts.d.mts.map +1 -1
- package/resources/ledger-accounts.d.ts +3 -2
- package/resources/ledger-accounts.d.ts.map +1 -1
- package/resources/ledger-accounts.js.map +1 -1
- package/resources/ledger-accounts.mjs.map +1 -1
- package/resources/members.d.mts +5 -5
- package/resources/members.d.mts.map +1 -1
- package/resources/members.d.ts +5 -5
- package/resources/members.d.ts.map +1 -1
- package/resources/members.js +1 -1
- package/resources/members.js.map +1 -1
- package/resources/members.mjs +1 -1
- package/resources/members.mjs.map +1 -1
- package/resources/memberships.d.mts +8 -3
- package/resources/memberships.d.mts.map +1 -1
- package/resources/memberships.d.ts +8 -3
- package/resources/memberships.d.ts.map +1 -1
- package/resources/payments.d.mts +33 -0
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +33 -0
- package/resources/payments.d.ts.map +1 -1
- package/resources/payout-methods.d.mts +8 -3
- package/resources/payout-methods.d.mts.map +1 -1
- package/resources/payout-methods.d.ts +8 -3
- package/resources/payout-methods.d.ts.map +1 -1
- package/resources/payout-methods.js.map +1 -1
- package/resources/payout-methods.mjs.map +1 -1
- package/resources/shared.d.mts +35 -1
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +35 -1
- package/resources/shared.d.ts.map +1 -1
- package/resources/verifications.d.mts +11 -3
- package/resources/verifications.d.mts.map +1 -1
- package/resources/verifications.d.ts +11 -3
- package/resources/verifications.d.ts.map +1 -1
- package/resources/webhooks.d.mts +34 -293
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +34 -293
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +2 -2
- package/resources/webhooks.mjs.map +1 -1
- package/resources/withdrawals.d.mts +17 -128
- package/resources/withdrawals.d.mts.map +1 -1
- package/resources/withdrawals.d.ts +17 -128
- package/resources/withdrawals.d.ts.map +1 -1
- package/src/client.ts +68 -34
- package/src/internal/parse.ts +6 -0
- package/src/resources/ai-chats.ts +7 -126
- package/src/resources/authorized-users.ts +45 -5
- package/src/resources/company-token-transactions.ts +14 -116
- package/src/resources/dm-channels.ts +212 -0
- package/src/resources/dm-members.ts +16 -78
- package/src/resources/files.ts +8 -2
- package/src/resources/index.ts +36 -17
- package/src/resources/leads.ts +9 -205
- package/src/resources/ledger-accounts.ts +3 -35
- package/src/resources/members.ts +6 -6
- package/src/resources/memberships.ts +16 -18
- package/src/resources/payments.ts +40 -0
- package/src/resources/payout-methods.ts +15 -2
- package/src/resources/shared.ts +42 -9
- package/src/resources/verifications.ts +49 -36
- package/src/resources/webhooks.ts +67 -728
- package/src/resources/withdrawals.ts +24 -205
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -24,7 +24,7 @@ export declare class CompanyTokenTransactions extends APIResource {
|
|
|
24
24
|
* });
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
|
-
create(body: CompanyTokenTransactionCreateParams, options?: RequestOptions): APIPromise<
|
|
27
|
+
create(body: CompanyTokenTransactionCreateParams, options?: RequestOptions): APIPromise<CompanyTokenTransaction>;
|
|
28
28
|
/**
|
|
29
29
|
* Retrieves a token transaction by ID
|
|
30
30
|
*
|
|
@@ -34,7 +34,7 @@ export declare class CompanyTokenTransactions extends APIResource {
|
|
|
34
34
|
* - `member:basic:read`
|
|
35
35
|
* - `company:basic:read`
|
|
36
36
|
*/
|
|
37
|
-
retrieve(id: string, options?: RequestOptions): APIPromise<
|
|
37
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<CompanyTokenTransaction>;
|
|
38
38
|
/**
|
|
39
39
|
* Lists token transactions for a company
|
|
40
40
|
*
|
|
@@ -48,99 +48,13 @@ export declare class CompanyTokenTransactions extends APIResource {
|
|
|
48
48
|
}
|
|
49
49
|
export type CompanyTokenTransactionListResponsesCursorPage = CursorPage<CompanyTokenTransactionListResponse>;
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
51
|
+
* The type of token transaction
|
|
52
52
|
*/
|
|
53
|
-
export
|
|
54
|
-
/**
|
|
55
|
-
* The ID of the transaction
|
|
56
|
-
*/
|
|
57
|
-
id: string;
|
|
58
|
-
/**
|
|
59
|
-
* The transaction amount (always positive)
|
|
60
|
-
*/
|
|
61
|
-
amount: number;
|
|
62
|
-
/**
|
|
63
|
-
* The company
|
|
64
|
-
*/
|
|
65
|
-
company: CompanyTokenTransactionCreateResponse.Company;
|
|
66
|
-
/**
|
|
67
|
-
* When the transaction was created
|
|
68
|
-
*/
|
|
69
|
-
created_at: string;
|
|
70
|
-
/**
|
|
71
|
-
* Optional description
|
|
72
|
-
*/
|
|
73
|
-
description: string | null;
|
|
74
|
-
/**
|
|
75
|
-
* Optional idempotency key to prevent duplicate transactions
|
|
76
|
-
*/
|
|
77
|
-
idempotency_key: string | null;
|
|
78
|
-
/**
|
|
79
|
-
* For transfers, the ID of the linked transaction
|
|
80
|
-
*/
|
|
81
|
-
linked_transaction_id: string | null;
|
|
82
|
-
/**
|
|
83
|
-
* The member
|
|
84
|
-
*/
|
|
85
|
-
member: CompanyTokenTransactionCreateResponse.Member;
|
|
86
|
-
/**
|
|
87
|
-
* The type of transaction
|
|
88
|
-
*/
|
|
89
|
-
transaction_type: 'add' | 'subtract' | 'transfer';
|
|
90
|
-
/**
|
|
91
|
-
* The user whose balance changed
|
|
92
|
-
*/
|
|
93
|
-
user: CompanyTokenTransactionCreateResponse.User;
|
|
94
|
-
}
|
|
95
|
-
export declare namespace CompanyTokenTransactionCreateResponse {
|
|
96
|
-
/**
|
|
97
|
-
* The company
|
|
98
|
-
*/
|
|
99
|
-
interface Company {
|
|
100
|
-
/**
|
|
101
|
-
* The ID of the company
|
|
102
|
-
*/
|
|
103
|
-
id: string;
|
|
104
|
-
/**
|
|
105
|
-
* The slug/route of the company on the Whop site.
|
|
106
|
-
*/
|
|
107
|
-
route: string;
|
|
108
|
-
/**
|
|
109
|
-
* The written name of the company.
|
|
110
|
-
*/
|
|
111
|
-
title: string;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* The member
|
|
115
|
-
*/
|
|
116
|
-
interface Member {
|
|
117
|
-
/**
|
|
118
|
-
* The ID of the member
|
|
119
|
-
*/
|
|
120
|
-
id: string;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* The user whose balance changed
|
|
124
|
-
*/
|
|
125
|
-
interface User {
|
|
126
|
-
/**
|
|
127
|
-
* The internal ID of the user.
|
|
128
|
-
*/
|
|
129
|
-
id: string;
|
|
130
|
-
/**
|
|
131
|
-
* The name of the user from their Whop account.
|
|
132
|
-
*/
|
|
133
|
-
name: string | null;
|
|
134
|
-
/**
|
|
135
|
-
* The username of the user from their Whop account.
|
|
136
|
-
*/
|
|
137
|
-
username: string;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
53
|
+
export type BotTokenTransactionTypes = 'add' | 'subtract' | 'transfer';
|
|
140
54
|
/**
|
|
141
55
|
* A token transaction within a company
|
|
142
56
|
*/
|
|
143
|
-
export interface
|
|
57
|
+
export interface CompanyTokenTransaction {
|
|
144
58
|
/**
|
|
145
59
|
* The ID of the transaction
|
|
146
60
|
*/
|
|
@@ -152,7 +66,7 @@ export interface CompanyTokenTransactionRetrieveResponse {
|
|
|
152
66
|
/**
|
|
153
67
|
* The company
|
|
154
68
|
*/
|
|
155
|
-
company:
|
|
69
|
+
company: CompanyTokenTransaction.Company;
|
|
156
70
|
/**
|
|
157
71
|
* When the transaction was created
|
|
158
72
|
*/
|
|
@@ -172,17 +86,17 @@ export interface CompanyTokenTransactionRetrieveResponse {
|
|
|
172
86
|
/**
|
|
173
87
|
* The member
|
|
174
88
|
*/
|
|
175
|
-
member:
|
|
89
|
+
member: CompanyTokenTransaction.Member;
|
|
176
90
|
/**
|
|
177
91
|
* The type of transaction
|
|
178
92
|
*/
|
|
179
|
-
transaction_type:
|
|
93
|
+
transaction_type: BotTokenTransactionTypes;
|
|
180
94
|
/**
|
|
181
95
|
* The user whose balance changed
|
|
182
96
|
*/
|
|
183
|
-
user:
|
|
97
|
+
user: CompanyTokenTransaction.User;
|
|
184
98
|
}
|
|
185
|
-
export declare namespace
|
|
99
|
+
export declare namespace CompanyTokenTransaction {
|
|
186
100
|
/**
|
|
187
101
|
* The company
|
|
188
102
|
*/
|
|
@@ -266,7 +180,7 @@ export interface CompanyTokenTransactionListResponse {
|
|
|
266
180
|
/**
|
|
267
181
|
* The type of transaction
|
|
268
182
|
*/
|
|
269
|
-
transaction_type:
|
|
183
|
+
transaction_type: BotTokenTransactionTypes;
|
|
270
184
|
/**
|
|
271
185
|
* The user whose balance changed
|
|
272
186
|
*/
|
|
@@ -413,13 +327,13 @@ export interface CompanyTokenTransactionListParams extends CursorPageParams {
|
|
|
413
327
|
/**
|
|
414
328
|
* The type of token transaction
|
|
415
329
|
*/
|
|
416
|
-
transaction_type?:
|
|
330
|
+
transaction_type?: BotTokenTransactionTypes | null;
|
|
417
331
|
/**
|
|
418
332
|
* Filter by user ID
|
|
419
333
|
*/
|
|
420
334
|
user_id?: string | null;
|
|
421
335
|
}
|
|
422
336
|
export declare namespace CompanyTokenTransactions {
|
|
423
|
-
export { type
|
|
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, };
|
|
424
338
|
}
|
|
425
339
|
//# sourceMappingURL=company-token-transactions.d.ts.map
|
|
@@ -1 +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,
|
|
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,mCAA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,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,CAAC,OAAO,WAAW,wBAAwB,CAAC;IAChD,OAAO,EACL,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,8CAA8C,IAAI,8CAA8C,EACrG,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,iCAAiC,IAAI,iCAAiC,GAC5E,CAAC;CACH"}
|
|
@@ -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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;AAED,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EACL,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
|
@@ -0,0 +1,161 @@
|
|
|
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 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.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dm-channels.d.ts","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,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C;;OAEG;IACH,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAE7B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,OAAO,EACL,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
|
|
@@ -0,0 +1,87 @@
|
|
|
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.DmChannels = 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 DmChannels extends resource_1.APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Creates a DM channel
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const dmChannel = await client.dmChannels.create({
|
|
15
|
+
* with_user_ids: ['string'],
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
create(body, options) {
|
|
20
|
+
return this._client.post('/dm_channels', { body, ...options });
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves a DM channel
|
|
24
|
+
*
|
|
25
|
+
* Required permissions:
|
|
26
|
+
*
|
|
27
|
+
* - `dms:read`
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const dmChannel = await client.dmChannels.retrieve('id');
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
retrieve(id, options) {
|
|
35
|
+
return this._client.get((0, path_1.path) `/dm_channels/${id}`, options);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Updates a DM channel
|
|
39
|
+
*
|
|
40
|
+
* Required permissions:
|
|
41
|
+
*
|
|
42
|
+
* - `dms:channel:manage`
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const dmChannel = await client.dmChannels.update('id');
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
update(id, body = {}, options) {
|
|
50
|
+
return this._client.patch((0, path_1.path) `/dm_channels/${id}`, { body, ...options });
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Lists DM channels for the current user
|
|
54
|
+
*
|
|
55
|
+
* Required permissions:
|
|
56
|
+
*
|
|
57
|
+
* - `dms:read`
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* // Automatically fetches more pages as needed.
|
|
62
|
+
* for await (const dmChannelListResponse of client.dmChannels.list()) {
|
|
63
|
+
* // ...
|
|
64
|
+
* }
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
list(query = {}, options) {
|
|
68
|
+
return this._client.getAPIList('/dm_channels', (pagination_1.CursorPage), { query, ...options });
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Deletes a DM channel
|
|
72
|
+
*
|
|
73
|
+
* Required permissions:
|
|
74
|
+
*
|
|
75
|
+
* - `dms:channel:manage`
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* const dmChannel = await client.dmChannels.delete('id');
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
delete(id, options) {
|
|
83
|
+
return this._client.delete((0, path_1.path) `/dm_channels/${id}`, options);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.DmChannels = DmChannels;
|
|
87
|
+
//# sourceMappingURL=dm-channels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dm-channels.js","sourceRoot":"","sources":["../src/resources/dm-channels.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAAoF;AAEpF,oDAA8C;AAE9C,MAAa,UAAW,SAAQ,sBAAW;IACzC;;;;;;;;;OASG;IACH,MAAM,CAAC,IAA2B,EAAE,OAAwB;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,gBAAgB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,EAAU,EACV,OAAiD,EAAE,EACnD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,gBAAgB,EAAE,EAAE,E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