@opentag/slack 0.3.0 → 0.3.1
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/dist/dispatcher-events.d.ts +5 -0
- package/dist/dispatcher-events.d.ts.map +1 -1
- package/dist/events.d.ts +61 -1
- package/dist/events.d.ts.map +1 -1
- package/dist/index.js +986 -161
- package/dist/index.js.map +1 -1
- package/dist/ingress.d.ts +10 -0
- package/dist/ingress.d.ts.map +1 -1
- package/dist/normalize.d.ts +1 -0
- package/dist/normalize.d.ts.map +1 -1
- package/dist/render.d.ts +22 -5
- package/dist/render.d.ts.map +1 -1
- package/dist/socket-mode.d.ts +3 -0
- package/dist/socket-mode.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/render.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type OpenTagRunResult } from "@opentag/core";
|
|
1
|
+
import { type ActionReceiptContext, type OpenTagActionReceiptPresentation, type OpenTagDoctorSummaryPresentation, type OpenTagFinalSummaryPresentation, type OpenTagSourceThreadStatusPresentation, type OpenTagRunResult } from "@opentag/core";
|
|
2
2
|
export type SlackTextBlock = {
|
|
3
3
|
type: "section";
|
|
4
4
|
text: {
|
|
@@ -9,6 +9,13 @@ export type SlackTextBlock = {
|
|
|
9
9
|
export type SlackDividerBlock = {
|
|
10
10
|
type: "divider";
|
|
11
11
|
};
|
|
12
|
+
export type SlackContextBlock = {
|
|
13
|
+
type: "context";
|
|
14
|
+
elements: Array<{
|
|
15
|
+
type: "mrkdwn";
|
|
16
|
+
text: string;
|
|
17
|
+
}>;
|
|
18
|
+
};
|
|
12
19
|
export type SlackButtonElement = {
|
|
13
20
|
type: "button";
|
|
14
21
|
text: {
|
|
@@ -25,7 +32,7 @@ export type SlackActionsBlock = {
|
|
|
25
32
|
block_id?: string;
|
|
26
33
|
elements: SlackButtonElement[];
|
|
27
34
|
};
|
|
28
|
-
export type SlackBlock = SlackTextBlock | SlackDividerBlock | SlackActionsBlock;
|
|
35
|
+
export type SlackBlock = SlackTextBlock | SlackDividerBlock | SlackContextBlock | SlackActionsBlock;
|
|
29
36
|
export type SlackSuggestedActionButtonValue = {
|
|
30
37
|
version: 1;
|
|
31
38
|
command: string;
|
|
@@ -44,7 +51,11 @@ export type SlackReactionPayload = {
|
|
|
44
51
|
timestamp: string;
|
|
45
52
|
name: string;
|
|
46
53
|
};
|
|
47
|
-
export type SlackSourceReceiptState = "received";
|
|
54
|
+
export type SlackSourceReceiptState = "received" | "running";
|
|
55
|
+
export type SlackRenderOptions = {
|
|
56
|
+
receiptContext?: ActionReceiptContext;
|
|
57
|
+
auditRunId?: string;
|
|
58
|
+
};
|
|
48
59
|
export declare function buildSlackSuggestedActionButtonValue(input: SlackSuggestedActionButtonValue): string;
|
|
49
60
|
export declare function parseSlackSuggestedActionButtonValue(value: string): SlackSuggestedActionButtonValue | null;
|
|
50
61
|
export declare function markdownToSlackMrkdwn(text: string): string;
|
|
@@ -55,8 +66,14 @@ export declare function createSlackReactionPayload(input: {
|
|
|
55
66
|
messageTs: string;
|
|
56
67
|
name: string;
|
|
57
68
|
}): SlackReactionPayload;
|
|
58
|
-
export declare function
|
|
59
|
-
export declare function
|
|
69
|
+
export declare function renderSlackActionReceiptPresentation(presentation: OpenTagActionReceiptPresentation): string;
|
|
70
|
+
export declare function createSlackActionReceiptBlocks(presentation: OpenTagActionReceiptPresentation): SlackBlock[];
|
|
71
|
+
export declare function renderSlackFinalResult(result: OpenTagRunResult, options?: SlackRenderOptions): string;
|
|
72
|
+
export declare function renderSlackFinalSummaryPresentation(presentation: OpenTagFinalSummaryPresentation): string;
|
|
73
|
+
export declare function createSlackFinalResultBlocks(result: OpenTagRunResult, options?: SlackRenderOptions): SlackBlock[];
|
|
74
|
+
export declare function createSlackFinalSummaryBlocks(presentation: OpenTagFinalSummaryPresentation): SlackBlock[];
|
|
75
|
+
export declare function createSlackDoctorSummaryBlocks(presentation: OpenTagDoctorSummaryPresentation): SlackBlock[];
|
|
76
|
+
export declare function createSlackSourceThreadStatusBlocks(presentation: OpenTagSourceThreadStatusPresentation): SlackBlock[];
|
|
60
77
|
export declare function createSlackPostMessagePayload(input: {
|
|
61
78
|
channelId: string;
|
|
62
79
|
text: string;
|
package/dist/render.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oBAAoB,EAEzB,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,EACrC,KAAK,+BAA+B,EAEpC,KAAK,qCAAqC,EAE1C,KAAK,gBAAgB,EACtB,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,KAAK,CAAC;QACd,IAAI,EAAE,QAAQ,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;CACJ,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,GAAG,QAAQ,CA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AE,GAAG,mBAAmB,CAOzJ"}
|
package/dist/socket-mode.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import WebSocket from "ws";
|
|
2
|
+
import { type RecordControlPlaneEventInput } from "@opentag/client";
|
|
2
3
|
import { type SlackDispatcherEventConfig } from "./dispatcher-events.js";
|
|
3
4
|
import { type SlackAppRuntimeConfig, type SlackEventProcessorInput, type SlackIngressPayload } from "./events.js";
|
|
4
5
|
export type SlackSocketModeEnvelope = {
|
|
@@ -10,12 +11,14 @@ export type SlackSocketModeEnvelope = {
|
|
|
10
11
|
export type SlackSocketModeAppInput = {
|
|
11
12
|
appToken: string;
|
|
12
13
|
slackApp: SlackAppRuntimeConfig;
|
|
14
|
+
recordControlPlaneEvent?(event: RecordControlPlaneEventInput): Promise<void>;
|
|
13
15
|
} & SlackEventProcessorInput;
|
|
14
16
|
export type SlackSocketModeIngressConfig = SlackDispatcherEventConfig & {
|
|
15
17
|
appToken: string;
|
|
16
18
|
agentId?: string;
|
|
17
19
|
appId?: string;
|
|
18
20
|
callbackUri?: string;
|
|
21
|
+
botToken?: string;
|
|
19
22
|
};
|
|
20
23
|
export type SlackSocketModeIngressHandle = {
|
|
21
24
|
startPromise: Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socket-mode.d.ts","sourceRoot":"","sources":["../src/socket-mode.ts"],"names":[],"mappings":"AAAA,OAAO,SAA2B,MAAM,IAAI,CAAC;AAC7C,OAAO,EAA4C,KAAK,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACnH,OAAO,EAA6B,KAAK,qBAAqB,EAAE,KAAK,wBAAwB,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAkC7I,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,wBAAwB,CAA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C,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,eAAe,CAAC,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACnD,CAAC;AAmGF,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,uBAAuB,EAC9B,YAAY,GAAE,2BAAgC,GAC7C,4BAA4B,CA4F9B;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,4BAA4B,EACpC,YAAY,GAAE,2BAAgC,GAC7C,4BAA4B,CAqB9B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentag/slack",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Slack app mention normalization and callback helpers for OpenTag.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"@hono/node-server": "^1.13.7",
|
|
35
35
|
"hono": "^4.6.15",
|
|
36
36
|
"ws": "^8.21.0",
|
|
37
|
-
"@opentag/client": "0.3.
|
|
38
|
-
"@opentag/core": "0.3.
|
|
37
|
+
"@opentag/client": "0.3.1",
|
|
38
|
+
"@opentag/core": "0.3.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/ws": "^8.18.1",
|