slack.ts 0.0.3 → 0.0.5
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/README.md +14 -0
- package/dist/api/index.d.ts +19 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +1 -0
- package/dist/api/interactive/block_actions.d.ts +61 -0
- package/dist/api/interactive/block_actions.d.ts.map +1 -0
- package/dist/api/interactive/block_actions.js +1 -0
- package/dist/api/interactive/common.d.ts +23 -0
- package/dist/api/interactive/common.d.ts.map +1 -0
- package/dist/api/interactive/common.js +1 -0
- package/dist/api/interactive/view_submission.d.ts +8 -0
- package/dist/api/interactive/view_submission.d.ts.map +1 -0
- package/dist/api/interactive/view_submission.js +1 -0
- package/dist/api/types/user.d.ts +54 -0
- package/dist/api/types/user.d.ts.map +1 -0
- package/dist/api/types/user.js +1 -0
- package/dist/api/types/value.d.ts +6 -0
- package/dist/api/types/value.d.ts.map +1 -0
- package/dist/api/types/value.js +1 -0
- package/dist/api/types/view.d.ts +26 -0
- package/dist/api/types/view.d.ts.map +1 -0
- package/dist/api/types/view.js +1 -0
- package/dist/api/web/conversations.d.ts +12 -0
- package/dist/api/web/conversations.d.ts.map +1 -1
- package/dist/api/web/users.d.ts +11 -0
- package/dist/api/web/users.d.ts.map +1 -0
- package/dist/api/web/users.js +1 -0
- package/dist/api/web/views.d.ts +17 -0
- package/dist/api/web/views.d.ts.map +1 -0
- package/dist/api/web/views.js +1 -0
- package/dist/client.d.ts +71 -14
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +72 -35
- package/dist/error.d.ts +2 -0
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js +2 -0
- package/dist/events/receivers/socket.d.ts.map +1 -1
- package/dist/events/receivers/socket.js +11 -2
- package/dist/events/types/index.d.ts +8 -0
- package/dist/events/types/index.d.ts.map +1 -1
- package/dist/resources/action.d.ts +13 -0
- package/dist/resources/action.d.ts.map +1 -0
- package/dist/resources/action.js +22 -0
- package/dist/resources/channel.d.ts +27 -1
- package/dist/resources/channel.d.ts.map +1 -1
- package/dist/resources/channel.js +19 -0
- package/dist/resources/message.d.ts +95 -0
- package/dist/resources/message.d.ts.map +1 -1
- package/dist/resources/message.js +127 -1
- package/dist/resources/modal.d.ts +21 -0
- package/dist/resources/modal.d.ts.map +1 -0
- package/dist/resources/modal.js +54 -0
- package/dist/resources/submission.d.ts +11 -0
- package/dist/resources/submission.d.ts.map +1 -0
- package/dist/resources/submission.js +14 -0
- package/dist/resources/user.d.ts +38 -0
- package/dist/resources/user.d.ts.map +1 -0
- package/dist/resources/user.js +41 -0
- package/dist/utils/paginate.d.ts +10 -0
- package/dist/utils/paginate.d.ts.map +1 -0
- package/dist/utils/paginate.js +22 -0
- package/dist/utils/respond.d.ts +31 -0
- package/dist/utils/respond.d.ts.map +1 -0
- package/dist/utils/respond.js +71 -0
- package/dist/utils/typing.d.ts +3 -0
- package/dist/utils/typing.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,8 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
An opinionated Slack API library with full TypeScript support.
|
|
4
4
|
|
|
5
|
+
**NOTE**: This library is still in active development! Any version update (even patch, sorry) may introduce breaking changes! Use at your own risk!
|
|
6
|
+
|
|
5
7
|
## Usage
|
|
6
8
|
|
|
9
|
+
You can install this package from npm with
|
|
10
|
+
|
|
11
|
+
```shell
|
|
12
|
+
npm i slack.ts
|
|
13
|
+
# or
|
|
14
|
+
bun add slack.ts
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Sample usage:
|
|
18
|
+
|
|
7
19
|
```typescript
|
|
8
20
|
import { App } from 'slack.ts'
|
|
9
21
|
|
|
@@ -19,3 +31,5 @@ app.message(async ({ message }) => {
|
|
|
19
31
|
|
|
20
32
|
await app.start()
|
|
21
33
|
```
|
|
34
|
+
|
|
35
|
+
For more examples, see [the examples directory](./examples).
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import type { CursorPaginationResponse } from "./types/api.js";
|
|
1
2
|
import type { AppsConnectionsOpenParams, AppsConnectionsOpenResponse } from "./web/apps.js";
|
|
2
3
|
import type { AuthTestParams, AuthTestResponse } from "./web/auth.js";
|
|
3
4
|
import type { ChatPostMessageParams, ChatPostMessageResponse } from "./web/chat.js";
|
|
4
|
-
import type { ConversationsInfoParams, ConversationsInfoResponse, ConversationsRepliesParams, ConversationsRepliesResponse } from "./web/conversations.js";
|
|
5
|
+
import type { ConversationsHistoryParams, ConversationsHistoryResponse, ConversationsInfoParams, ConversationsInfoResponse, ConversationsRepliesParams, ConversationsRepliesResponse } from "./web/conversations.js";
|
|
5
6
|
import type { FilesCompleteUploadExternalParams, FilesCompleteUploadExternalResponse, FilesGetUploadURLExternalParams, FilesGetUploadURLExternalResponse } from "./web/files.js";
|
|
7
|
+
import type { UsersInfoParams, UsersInfoResponse } from "./web/users.js";
|
|
8
|
+
import type { ViewsOpenParams, ViewsOpenResponse } from "./web/views.js";
|
|
6
9
|
export interface SlackWebAPIMap {
|
|
7
10
|
"apps.connections.open": {
|
|
8
11
|
params: AppsConnectionsOpenParams;
|
|
@@ -20,6 +23,10 @@ export interface SlackWebAPIMap {
|
|
|
20
23
|
params: ConversationsInfoParams;
|
|
21
24
|
response: ConversationsInfoResponse;
|
|
22
25
|
};
|
|
26
|
+
"conversations.history": {
|
|
27
|
+
params: ConversationsHistoryParams;
|
|
28
|
+
response: ConversationsHistoryResponse;
|
|
29
|
+
};
|
|
23
30
|
"conversations.replies": {
|
|
24
31
|
params: ConversationsRepliesParams;
|
|
25
32
|
response: ConversationsRepliesResponse;
|
|
@@ -32,8 +39,19 @@ export interface SlackWebAPIMap {
|
|
|
32
39
|
params: FilesGetUploadURLExternalParams;
|
|
33
40
|
response: FilesGetUploadURLExternalResponse;
|
|
34
41
|
};
|
|
42
|
+
"users.info": {
|
|
43
|
+
params: UsersInfoParams;
|
|
44
|
+
response: UsersInfoResponse;
|
|
45
|
+
};
|
|
46
|
+
"views.open": {
|
|
47
|
+
params: ViewsOpenParams;
|
|
48
|
+
response: ViewsOpenResponse;
|
|
49
|
+
};
|
|
35
50
|
}
|
|
36
51
|
export type SlackAPIMethod = keyof SlackWebAPIMap;
|
|
52
|
+
export type SlackPaginatingAPIMethod = {
|
|
53
|
+
[K in SlackAPIMethod]: SlackWebAPIMap[K]["response"] extends CursorPaginationResponse ? K : never;
|
|
54
|
+
}[SlackAPIMethod];
|
|
37
55
|
export type SlackAPIParams<Method extends SlackAPIMethod> = SlackWebAPIMap[Method]["params"] & {
|
|
38
56
|
token?: string;
|
|
39
57
|
};
|
package/dist/api/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAA;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAClE,OAAO,KAAK,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAChF,OAAO,KAAK,EACX,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,4BAA4B,EAC5B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EACX,iCAAiC,EACjC,mCAAmC,EACnC,+BAA+B,EAC/B,iCAAiC,EACjC,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,KAAK,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAA;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAClE,OAAO,K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C,CAAA;IACD,YAAY,EAAE;QACb,MAAM,EAAE,eAAe,CAAA;QACvB,QAAQ,EAAE,iBAAiB,CAAA;KAC3B,CAAA;IACD,YAAY,EAAE;QACb,MAAM,EAAE,eAAe,CAAA;QACvB,QAAQ,EAAE,iBAAiB,CAAA;KAC3B,CAAA;CACD;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,cAAc,CAAA;AACjD,MAAM,MAAM,wBAAwB,GAAG;KACrC,CAAC,IAAI,cAAc,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,wBAAwB,GAAG,CAAC,GAAG,KAAK;CACjG,CAAC,cAAc,CAAC,CAAA;AACjB,MAAM,MAAM,cAAc,CAAC,MAAM,SAAS,cAAc,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,GAAG;IAC9F,KAAK,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AACD,MAAM,MAAM,gBAAgB,CAAC,MAAM,SAAS,cAAc,IACvD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC5B,CAAC;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC,CAAA;AAEtD,eAAO,MAAM,YAAY,EAAE,cAAc,EAKxC,CAAA"}
|
package/dist/api/index.js
CHANGED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { PlainTextElement } from "@slack/types";
|
|
2
|
+
import type { AnyMessage } from "../types/message.js";
|
|
3
|
+
import type { InteractionCommon } from "./common.js";
|
|
4
|
+
import type { StateValue } from "../types/value.js";
|
|
5
|
+
export interface BlockActions extends InteractionCommon {
|
|
6
|
+
type: "block_actions";
|
|
7
|
+
container: BlockActionContainer;
|
|
8
|
+
channel?: {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
};
|
|
12
|
+
message?: AnyMessage;
|
|
13
|
+
state?: {
|
|
14
|
+
values: Record<string, Record<string, StateValue>>;
|
|
15
|
+
};
|
|
16
|
+
response_url?: string;
|
|
17
|
+
actions: BlockAction[];
|
|
18
|
+
}
|
|
19
|
+
interface MessageAttachmentContainer {
|
|
20
|
+
type: "message_attachment";
|
|
21
|
+
message_ts: string;
|
|
22
|
+
attachment_id: number;
|
|
23
|
+
channel_id: string;
|
|
24
|
+
is_ephemeral: boolean;
|
|
25
|
+
is_app_unfurl: boolean;
|
|
26
|
+
}
|
|
27
|
+
interface ViewContainer {
|
|
28
|
+
type: "view";
|
|
29
|
+
view_id: string;
|
|
30
|
+
}
|
|
31
|
+
interface MessageContainer {
|
|
32
|
+
type: "message";
|
|
33
|
+
message_ts: string;
|
|
34
|
+
channel_id: string;
|
|
35
|
+
is_ephemeral: boolean;
|
|
36
|
+
}
|
|
37
|
+
type BlockActionContainer = MessageAttachmentContainer | ViewContainer | MessageContainer;
|
|
38
|
+
interface ActionCommon {
|
|
39
|
+
block_id: string;
|
|
40
|
+
action_id: string;
|
|
41
|
+
action_ts: string;
|
|
42
|
+
}
|
|
43
|
+
export interface ButtonAction extends ActionCommon {
|
|
44
|
+
type: "button";
|
|
45
|
+
text: PlainTextElement;
|
|
46
|
+
value?: string;
|
|
47
|
+
style?: "primary" | "danger";
|
|
48
|
+
}
|
|
49
|
+
export interface PlainTextInputAction extends ActionCommon {
|
|
50
|
+
type: "plain_text_input";
|
|
51
|
+
value: string | null;
|
|
52
|
+
}
|
|
53
|
+
export type BlockAction = ButtonAction | PlainTextInputAction;
|
|
54
|
+
export type BlockActionTypes = BlockAction["type"];
|
|
55
|
+
export type BlockActionMap = {
|
|
56
|
+
[K in BlockActionTypes]: BlockAction & {
|
|
57
|
+
type: K;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export {};
|
|
61
|
+
//# sourceMappingURL=block_actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block_actions.d.ts","sourceRoot":"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;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,YAAa,SAAQ,YAAY;IACjD,IAAI,EAAE,QAAQ,CAAA;IACd,IAAI,EAAE,gBAAgB,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;CAC5B;AAED,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACzD,IAAI,EAAE,kBAAkB,CAAA;IACxB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB;AAED,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,oBAAoB,CAAA;AAE7D,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,MAAM,CAAC,CAAA;AAElD,MAAM,MAAM,cAAc,GAAG;KAC3B,CAAC,IAAI,gBAAgB,GAAG,WAAW,GAAG;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE;CAClD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface InteractionCommon {
|
|
2
|
+
team: {
|
|
3
|
+
id: string;
|
|
4
|
+
domain: string;
|
|
5
|
+
enterprise_id?: string;
|
|
6
|
+
enterprise_name?: string;
|
|
7
|
+
};
|
|
8
|
+
user: {
|
|
9
|
+
id: string;
|
|
10
|
+
username: string;
|
|
11
|
+
name: string;
|
|
12
|
+
team_id: string;
|
|
13
|
+
};
|
|
14
|
+
api_app_id: string;
|
|
15
|
+
token: string;
|
|
16
|
+
trigger_id: string;
|
|
17
|
+
is_enterprise_install?: boolean;
|
|
18
|
+
enterprise?: {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/api/interactive/common.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACtF,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;IACrE,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,UAAU,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CACzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ModalView } from "../types/view.js";
|
|
2
|
+
import type { InteractionCommon } from "./common.js";
|
|
3
|
+
export interface ViewSubmission extends InteractionCommon {
|
|
4
|
+
type: "view_submission";
|
|
5
|
+
view: ModalView;
|
|
6
|
+
response_urls: string[];
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=view_submission.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view_submission.d.ts","sourceRoot":"","sources":["../../../src/api/interactive/view_submission.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAEjD,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACxD,IAAI,EAAE,iBAAiB,CAAA;IACvB,IAAI,EAAE,SAAS,CAAA;IACf,aAAa,EAAE,MAAM,EAAE,CAAA;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export interface User {
|
|
2
|
+
id: string;
|
|
3
|
+
team_id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
deleted: boolean;
|
|
6
|
+
color: string;
|
|
7
|
+
real_name: string;
|
|
8
|
+
tz: string;
|
|
9
|
+
tz_label: string;
|
|
10
|
+
tz_offset: number;
|
|
11
|
+
profile: UserProfile;
|
|
12
|
+
is_admin: boolean;
|
|
13
|
+
is_owner: boolean;
|
|
14
|
+
is_primary_owner: boolean;
|
|
15
|
+
is_restricted: boolean;
|
|
16
|
+
is_ultra_restricted: boolean;
|
|
17
|
+
is_bot: boolean;
|
|
18
|
+
updated: number;
|
|
19
|
+
is_app_user: boolean;
|
|
20
|
+
has_2fa: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface UserProfile {
|
|
23
|
+
real_name: string;
|
|
24
|
+
display_name?: string;
|
|
25
|
+
avatar_hash?: string;
|
|
26
|
+
real_name_normalized: string;
|
|
27
|
+
display_name_normalized?: string;
|
|
28
|
+
image_24: string;
|
|
29
|
+
image_32: string;
|
|
30
|
+
image_48: string;
|
|
31
|
+
image_72: string;
|
|
32
|
+
image_192: string;
|
|
33
|
+
image_512: string;
|
|
34
|
+
image_original?: string;
|
|
35
|
+
first_name?: string;
|
|
36
|
+
last_name?: string;
|
|
37
|
+
team: string;
|
|
38
|
+
email?: string;
|
|
39
|
+
title?: string;
|
|
40
|
+
pronouns?: string;
|
|
41
|
+
phone?: string;
|
|
42
|
+
skype?: string;
|
|
43
|
+
status_text?: string;
|
|
44
|
+
status_text_canonical?: string;
|
|
45
|
+
status_emoji?: string;
|
|
46
|
+
status_emoji_display_info?: {
|
|
47
|
+
emoji_name: string;
|
|
48
|
+
display_url: string;
|
|
49
|
+
}[];
|
|
50
|
+
status_expiration?: number;
|
|
51
|
+
huddle_state?: string;
|
|
52
|
+
huddle_state_expiration_ts?: number;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/api/types/user.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,WAAW,CAAA;IACpB,QAAQ,EAAE,OAAO,CAAA;IACjB,QAAQ,EAAE,OAAO,CAAA;IACjB,gBAAgB,EAAE,OAAO,CAAA;IACzB,aAAa,EAAE,OAAO,CAAA;IACtB,mBAAmB,EAAE,OAAO,CAAA;IAC5B,MAAM,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,OAAO,CAAA;IACpB,OAAO,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,WAAW,WAAW;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,yBAAyB,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACzE,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,0BAA0B,CAAC,EAAE,MAAM,CAAA;CACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value.d.ts","sourceRoot":"","sources":["../../../src/api/types/value.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,kBAAkB,CAAA;IACxB,KAAK,EAAE,MAAM,CAAA;CACb;AAED,MAAM,MAAM,UAAU,GAAG,mBAAmB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { KnownBlock, PlainTextElement } from "@slack/types";
|
|
2
|
+
import type { StateValue } from "./value.js";
|
|
3
|
+
export interface ModalView {
|
|
4
|
+
type: "modal";
|
|
5
|
+
id: string;
|
|
6
|
+
team_id: string;
|
|
7
|
+
title: PlainTextElement;
|
|
8
|
+
blocks: KnownBlock[];
|
|
9
|
+
close: PlainTextElement | null;
|
|
10
|
+
submit: PlainTextElement | null;
|
|
11
|
+
private_metadata: string;
|
|
12
|
+
callback_id: string;
|
|
13
|
+
state: {
|
|
14
|
+
values: Record<string, Record<string, StateValue>>;
|
|
15
|
+
};
|
|
16
|
+
hash: string;
|
|
17
|
+
clear_on_close: boolean;
|
|
18
|
+
notify_on_close: boolean;
|
|
19
|
+
external_id: string;
|
|
20
|
+
previous_view_id: string | null;
|
|
21
|
+
root_view_id: string | null;
|
|
22
|
+
app_id: string;
|
|
23
|
+
app_installed_team_id: string;
|
|
24
|
+
bot_id: string;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/api/types/view.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,OAAO,CAAA;IACb,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,gBAAgB,CAAA;IACvB,MAAM,EAAE,UAAU,EAAE,CAAA;IACpB,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAAA;IAC9B,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAA;IAC/B,gBAAgB,EAAE,MAAM,CAAA;IACxB,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAA;KAAE,CAAA;IAC7D,IAAI,EAAE,MAAM,CAAA;IACZ,cAAc,EAAE,OAAO,CAAA;IACvB,eAAe,EAAE,OAAO,CAAA;IACxB,WAAW,EAAE,MAAM,CAAA;IACnB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,qBAAqB,EAAE,MAAM,CAAA;IAC7B,MAAM,EAAE,MAAM,CAAA;CACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -20,6 +20,18 @@ export interface ConversationsInfoParams {
|
|
|
20
20
|
export interface ConversationsInfoResponse {
|
|
21
21
|
channel: Conversation;
|
|
22
22
|
}
|
|
23
|
+
export interface ConversationsHistoryParams extends CursorPaginationParams, TimestampPaginationParams {
|
|
24
|
+
/** Conversation ID to fetch history for. */
|
|
25
|
+
channel: string;
|
|
26
|
+
/** Return all metadata associated with this message. */
|
|
27
|
+
include_all_metadata?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface ConversationsHistoryResponse extends CursorPaginationResponse {
|
|
30
|
+
messages: AnyMessage[];
|
|
31
|
+
pin_count: number;
|
|
32
|
+
channel_actions_ts?: number | null;
|
|
33
|
+
channel_actions_count?: number;
|
|
34
|
+
}
|
|
23
35
|
export interface ConversationsRepliesParams extends CursorPaginationParams, TimestampPaginationParams {
|
|
24
36
|
/** Conversation ID to fetch thread from. */
|
|
25
37
|
channel: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../../../src/api/web/conversations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EACzB,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,MAAM,WAAW,uBAAuB;IACvC,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAA;IAEf;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IAExB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OA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CAAC,EAAE,MAAM,CAAA;CAC9B;AAED,MAAM,WAAW,0BAChB,SAAQ,sBAAsB,EAAE,yBAAyB;IACzD,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAA;IAEf;;;;;OAKG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV,wDAAwD;IACxD,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC9B;AAED,MAAM,WAAW,4BAA6B,SAAQ,wBAAwB;IAC7E,QAAQ,EAAE,UAAU,EAAE,CAAA;CACtB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { User } from "../types/user.js";
|
|
2
|
+
export interface UsersInfoParams {
|
|
3
|
+
/** User to get info on */
|
|
4
|
+
user: string;
|
|
5
|
+
/** Set this to `true` to receive the locale for this user. Defaults to `false` */
|
|
6
|
+
include_locale?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface UsersInfoResponse {
|
|
9
|
+
user: User;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=users.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../src/api/web/users.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAEzC,MAAM,WAAW,eAAe;IAC/B,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAA;IAEZ,kFAAkF;IAClF,cAAc,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,IAAI,CAAA;CACV"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { DistributivePick, NotNull } from "../../utils/typing.js";
|
|
2
|
+
import type { ModalView } from "../types/view.js";
|
|
3
|
+
export type ViewsOpenParams = {
|
|
4
|
+
view: Partial<{
|
|
5
|
+
[K in keyof ModalView]: NotNull<ModalView[K]>;
|
|
6
|
+
}> & DistributivePick<ModalView, "type" | "title" | "blocks">;
|
|
7
|
+
} & ({
|
|
8
|
+
trigger_id: string;
|
|
9
|
+
interactivity_pointer?: never;
|
|
10
|
+
} | {
|
|
11
|
+
trigger_id?: never;
|
|
12
|
+
interactivity_pointer: string;
|
|
13
|
+
});
|
|
14
|
+
export interface ViewsOpenResponse {
|
|
15
|
+
view: ModalView;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=views.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"views.d.ts","sourceRoot":"","sources":["../../../src/api/web/views.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,OAAO,CAAC;SAAG,CAAC,IAAI,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;KAAE,CAAC,GAC/D,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC,CAAA;CACzD,GAAG,CACD;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,qBAAqB,CAAC,EAAE,KAAK,CAAA;CAAE,GACrD;IAAE,UAAU,CAAC,EAAE,KAAK,CAAC;IAAC,qBAAqB,EAAE,MAAM,CAAA;CAAE,CACvD,CAAA;AAED,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,SAAS,CAAA;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/client.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import EventEmitter from "events";
|
|
2
2
|
import { type SlackAPIMethod, type SlackAPIParams, type SlackAPIResponse } from "./api/index.js";
|
|
3
|
+
import type { BlockAction, BlockActionMap, BlockActions, BlockActionTypes } from "./api/interactive/block_actions.js";
|
|
3
4
|
import { type SocketEventsReceiverOptions } from "./events/receivers/socket.js";
|
|
4
|
-
import type {
|
|
5
|
-
import type { AllEvents, EventWrapper } from "./events/types/index.js";
|
|
6
|
-
import { type MessageInstance } from "./resources/message.js";
|
|
5
|
+
import type { AllEvents, AllEventTypes, EventWrapper, SlackEventMap } from "./events/types/index.js";
|
|
7
6
|
import type { MessageEvent } from "./events/types/events.js";
|
|
7
|
+
import { Action, type ActionInstance } from "./resources/action.js";
|
|
8
|
+
import { ChannelRef } from "./resources/channel.js";
|
|
9
|
+
import { type MessageInstance } from "./resources/message.js";
|
|
10
|
+
import type { DistributiveOmit } from "./utils/typing.js";
|
|
11
|
+
import type { ViewSubmission } from "./api/interactive/view_submission.js";
|
|
8
12
|
type ReceiverOptions = ({
|
|
9
13
|
type: "socket";
|
|
10
14
|
} & DistributiveOmit<SocketEventsReceiverOptions, "client">) | {
|
|
@@ -15,35 +19,45 @@ interface AppOptions {
|
|
|
15
19
|
token?: string;
|
|
16
20
|
receiver?: ReceiverOptions;
|
|
17
21
|
}
|
|
18
|
-
type MessageCallbackData = {
|
|
22
|
+
export type MessageCallbackData = {
|
|
19
23
|
message: MessageInstance;
|
|
20
24
|
client: App;
|
|
21
25
|
event: EventWrapper<MessageEvent>;
|
|
22
26
|
};
|
|
23
|
-
type MessageCallback = (data: MessageCallbackData) => unknown;
|
|
24
|
-
type EventCallbackData<Event extends AllEvents> = {
|
|
27
|
+
export type MessageCallback = (data: MessageCallbackData) => unknown;
|
|
28
|
+
export type EventCallbackData<Event extends AllEvents> = {
|
|
25
29
|
client: App;
|
|
26
30
|
event: EventWrapper<Event>;
|
|
27
31
|
};
|
|
28
|
-
type EventCallback<Event extends AllEvents> = (data: EventCallbackData<Event>) => unknown;
|
|
29
|
-
export
|
|
32
|
+
export type EventCallback<Event extends AllEvents> = (data: EventCallbackData<Event>) => unknown;
|
|
33
|
+
export type BlockActionCallback<Type extends BlockAction> = (data: Action<Type>) => unknown;
|
|
34
|
+
export declare class App extends EventEmitter<AppEventMap> {
|
|
30
35
|
#private;
|
|
31
|
-
private messageCallbacks;
|
|
32
|
-
private eventCallbacks;
|
|
33
36
|
constructor({ token, receiver }?: AppOptions);
|
|
34
37
|
/**
|
|
35
38
|
* Registers a callback for `message` events.
|
|
36
39
|
*
|
|
40
|
+
* @deprecated Use `app.on('message', callback)` or `app.on('event:message', callback)`
|
|
37
41
|
* @param callback Function to execute when a new message is received
|
|
38
42
|
*/
|
|
39
43
|
message(callback: MessageCallback): void;
|
|
40
44
|
/**
|
|
41
45
|
* Registers a callback for a given type of event.
|
|
42
46
|
*
|
|
47
|
+
* @deprecated Use `app.on('event:type', callback)` instead
|
|
43
48
|
* @param type Type of event to register
|
|
44
49
|
* @param callback Function to execute when the event is received
|
|
45
50
|
*/
|
|
46
51
|
event<Event extends AllEvents>(type: Event["type"], callback: EventCallback<Event>): void;
|
|
52
|
+
/**
|
|
53
|
+
* Registers a callback for a given type of block actions.
|
|
54
|
+
*
|
|
55
|
+
* @deprecated Use `app.on('action:type', ...)`, `app.on('action.action_id', ...)`, or
|
|
56
|
+
* `app.on('action:type.action_id', ...)` instead
|
|
57
|
+
* @param type Type of event to register
|
|
58
|
+
* @param callback Function to execute when the event is received
|
|
59
|
+
*/
|
|
60
|
+
action<Type extends BlockAction>(type: Type["type"], callback: BlockActionCallback<Type>): void;
|
|
47
61
|
/**
|
|
48
62
|
* Starts the event receiver. If you don't use the events, interactions, and slash command APIs,
|
|
49
63
|
* you don't need to call this function.
|
|
@@ -60,14 +74,57 @@ export declare class App {
|
|
|
60
74
|
/**
|
|
61
75
|
* Makes a Slack Web API request.
|
|
62
76
|
*
|
|
63
|
-
* @param
|
|
77
|
+
* @param method The Slack Web API method to call
|
|
64
78
|
* @param params The parameters for the method
|
|
65
|
-
* @param [method='GET'] The HTTP method for the request. Default is `'GET'`
|
|
66
79
|
* @returns The response from the API call
|
|
67
80
|
*/
|
|
68
|
-
request<Method extends SlackAPIMethod>(
|
|
81
|
+
request<Method extends SlackAPIMethod>(method: Method, params: SlackAPIParams<Method>): Promise<SlackAPIResponse<Method> & {
|
|
69
82
|
ok: true;
|
|
70
83
|
}>;
|
|
71
84
|
}
|
|
85
|
+
type AppEventMap = {
|
|
86
|
+
event: [
|
|
87
|
+
EventWrapper
|
|
88
|
+
];
|
|
89
|
+
actions: [
|
|
90
|
+
BlockActions
|
|
91
|
+
];
|
|
92
|
+
action: [
|
|
93
|
+
ActionInstance
|
|
94
|
+
];
|
|
95
|
+
submit: [
|
|
96
|
+
ViewSubmission
|
|
97
|
+
];
|
|
98
|
+
message: [
|
|
99
|
+
MessageInstance
|
|
100
|
+
];
|
|
101
|
+
} & {
|
|
102
|
+
[K in AllEventTypes as `event:${K}`]: [
|
|
103
|
+
{
|
|
104
|
+
payload: SlackEventMap[K];
|
|
105
|
+
event: EventWrapper<SlackEventMap[K]>;
|
|
106
|
+
}
|
|
107
|
+
];
|
|
108
|
+
} & {
|
|
109
|
+
[K in BlockActionTypes as `action:${K}`]: [
|
|
110
|
+
ActionInstance<BlockActionMap[K]>
|
|
111
|
+
];
|
|
112
|
+
} & {
|
|
113
|
+
[K in `action.${string}`]: [
|
|
114
|
+
ActionInstance
|
|
115
|
+
];
|
|
116
|
+
} & {
|
|
117
|
+
[K in BlockActionTypes as `action:${K}.${string}`]: [
|
|
118
|
+
ActionInstance<BlockActionMap[K]>
|
|
119
|
+
];
|
|
120
|
+
} & {
|
|
121
|
+
[K in `submit.${string}`]: [
|
|
122
|
+
ViewSubmission
|
|
123
|
+
];
|
|
124
|
+
} & {
|
|
125
|
+
[K in `message#${string}`]: [
|
|
126
|
+
MessageInstance
|
|
127
|
+
];
|
|
128
|
+
};
|
|
72
129
|
export {};
|
|
73
130
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.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