@ever-works/slack-channel-plugin 1.0.0 → 1.0.4
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/index.cjs +984 -0
- package/dist/index.d.cts +31 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +981 -0
- package/package.json +84 -74
- package/LICENSE +0 -661
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { INotificationChannelPlugin, PluginCategory, ChannelShape, JsonSchema, ChannelTargetConfig, ChannelOptions, ChannelVerification, ChannelSendInput, ChannelSendResult } from '@ever-works/plugin';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Slack notification channel — posts messages to a Slack incoming
|
|
5
|
+
* webhook URL. Block Kit blocks are forwarded when the caller supplies
|
|
6
|
+
* the `slack-blocks` rich payload kind.
|
|
7
|
+
*
|
|
8
|
+
* Built on the official `@slack/webhook` SDK (`IncomingWebhook`) — the
|
|
9
|
+
* vendor SDK for the incoming-webhook mechanism this channel uses
|
|
10
|
+
* (`@slack/web-api` is the bot-token `chat.postMessage` path, a
|
|
11
|
+
* different config contract). Incoming webhooks return the literal
|
|
12
|
+
* string `ok` on success (no message id), so `providerMessageId` is
|
|
13
|
+
* synthesized from the idempotency `messageRef`.
|
|
14
|
+
*/
|
|
15
|
+
declare class SlackChannelPlugin implements INotificationChannelPlugin {
|
|
16
|
+
readonly id = "slack-channel";
|
|
17
|
+
readonly name = "Slack";
|
|
18
|
+
readonly version = "1.0.0";
|
|
19
|
+
readonly category: PluginCategory;
|
|
20
|
+
readonly capabilities: readonly ["notification-channel", "notification-channel-slack"];
|
|
21
|
+
readonly shape: ChannelShape;
|
|
22
|
+
readonly settingsSchema: JsonSchema;
|
|
23
|
+
onLoad(): Promise<void>;
|
|
24
|
+
onUnload(): Promise<void>;
|
|
25
|
+
private readonly idempotencyCache;
|
|
26
|
+
verifyTarget(config: ChannelTargetConfig, _options: ChannelOptions): Promise<ChannelVerification>;
|
|
27
|
+
send(payload: ChannelSendInput, options: ChannelOptions): Promise<ChannelSendResult>;
|
|
28
|
+
}
|
|
29
|
+
declare const slackChannelPlugin: SlackChannelPlugin;
|
|
30
|
+
|
|
31
|
+
export { SlackChannelPlugin, slackChannelPlugin };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { INotificationChannelPlugin, PluginCategory, ChannelShape, JsonSchema, ChannelTargetConfig, ChannelOptions, ChannelVerification, ChannelSendInput, ChannelSendResult } from '@ever-works/plugin';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Slack notification channel — posts messages to a Slack incoming
|
|
5
|
+
* webhook URL. Block Kit blocks are forwarded when the caller supplies
|
|
6
|
+
* the `slack-blocks` rich payload kind.
|
|
7
|
+
*
|
|
8
|
+
* Built on the official `@slack/webhook` SDK (`IncomingWebhook`) — the
|
|
9
|
+
* vendor SDK for the incoming-webhook mechanism this channel uses
|
|
10
|
+
* (`@slack/web-api` is the bot-token `chat.postMessage` path, a
|
|
11
|
+
* different config contract). Incoming webhooks return the literal
|
|
12
|
+
* string `ok` on success (no message id), so `providerMessageId` is
|
|
13
|
+
* synthesized from the idempotency `messageRef`.
|
|
14
|
+
*/
|
|
15
|
+
declare class SlackChannelPlugin implements INotificationChannelPlugin {
|
|
16
|
+
readonly id = "slack-channel";
|
|
17
|
+
readonly name = "Slack";
|
|
18
|
+
readonly version = "1.0.0";
|
|
19
|
+
readonly category: PluginCategory;
|
|
20
|
+
readonly capabilities: readonly ["notification-channel", "notification-channel-slack"];
|
|
21
|
+
readonly shape: ChannelShape;
|
|
22
|
+
readonly settingsSchema: JsonSchema;
|
|
23
|
+
onLoad(): Promise<void>;
|
|
24
|
+
onUnload(): Promise<void>;
|
|
25
|
+
private readonly idempotencyCache;
|
|
26
|
+
verifyTarget(config: ChannelTargetConfig, _options: ChannelOptions): Promise<ChannelVerification>;
|
|
27
|
+
send(payload: ChannelSendInput, options: ChannelOptions): Promise<ChannelSendResult>;
|
|
28
|
+
}
|
|
29
|
+
declare const slackChannelPlugin: SlackChannelPlugin;
|
|
30
|
+
|
|
31
|
+
export { SlackChannelPlugin, slackChannelPlugin };
|