@theholocron/holocron-plugin-slack 5.0.0-alpha.245 → 5.0.0-alpha.247

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.d.mts CHANGED
@@ -1,14 +1,11 @@
1
1
  import { AuthError, Notifications, ResolveTokenInput, VerifyTokenFailure, VerifyTokenResult, VerifyTokenResult as VerifyTokenResult$1, VerifyTokenSuccess } from "@theholocron/cli";
2
2
  import { SlackClient, SlackClientOptions, createSlackClient } from "@theholocron/slack-client";
3
- //#region src/auth.d.ts
4
- declare const resolveToken: (input?: ResolveTokenInput) => string;
5
- //#endregion
6
- //#region src/capabilities/notifications.d.ts
3
+ export declare const resolveToken: (input?: ResolveTokenInput) => string;
7
4
  interface SlackNotificationsOptions {
8
5
  /** Default channel id used when `send()` is called without an explicit channel. */
9
6
  defaultChannel?: string;
10
7
  }
11
- declare class SlackNotifications implements Notifications {
8
+ export declare class SlackNotifications implements Notifications {
12
9
  /** Memoized client thunk — resolves the token on first authenticated call. */
13
10
  private readonly client;
14
11
  private readonly opts;
@@ -19,28 +16,24 @@ declare class SlackNotifications implements Notifications {
19
16
  client: () => SlackClient, opts: SlackNotificationsOptions);
20
17
  send(channel: string, message: string): Promise<void>;
21
18
  }
22
- //#endregion
23
- //#region src/verify-token.d.ts
24
19
  interface VerifyTokenOptions {
25
20
  baseUrl?: string;
26
21
  fetch?: typeof fetch;
27
22
  }
28
- declare function verifyToken(token: string, opts?: VerifyTokenOptions): Promise<VerifyTokenResult$1>;
29
- //#endregion
30
- //#region src/index.d.ts
31
- interface SlackPluginOptions extends ResolveTokenInput, SlackNotificationsOptions {
23
+ export declare function verifyToken(token: string, opts?: VerifyTokenOptions): Promise<VerifyTokenResult$1>;
24
+ export interface SlackPluginOptions extends ResolveTokenInput, SlackNotificationsOptions {
32
25
  /** Override base URL for tests. Default: https://slack.com/api */
33
26
  baseUrl?: string;
34
27
  fetch?: typeof fetch;
35
28
  }
36
- interface PluginContext {
29
+ export interface PluginContext {
37
30
  options: SlackPluginOptions;
38
31
  /** Memoized client — the token is resolved on first use, not at plugin load. */
39
32
  client: () => SlackClient;
40
33
  }
41
- declare function createContext(options?: SlackPluginOptions): PluginContext;
42
- declare function notifications(ctx: PluginContext): Notifications;
43
- declare function createPlugin(options?: SlackPluginOptions): {
34
+ export declare function createContext(options?: SlackPluginOptions): PluginContext;
35
+ export declare function notifications(ctx: PluginContext): Notifications;
36
+ export declare function createPlugin(options?: SlackPluginOptions): {
44
37
  name: string;
45
38
  probes: {
46
39
  connection: import("@theholocron/cli").Probe;
@@ -49,6 +42,5 @@ declare function createPlugin(options?: SlackPluginOptions): {
49
42
  notifications: () => Notifications;
50
43
  };
51
44
  };
52
- declare const AUTH_HINT: string;
53
- //#endregion
54
- export { AUTH_HINT, AuthError, PluginContext, type ResolveTokenInput, type SlackClient, type SlackClientOptions, SlackNotifications, type SlackNotificationsOptions, SlackPluginOptions, type VerifyTokenFailure, type VerifyTokenResult, type VerifyTokenSuccess, createContext, createPlugin, createSlackClient, notifications, resolveToken, verifyToken };
45
+ export declare const AUTH_HINT: string;
46
+ export { AuthError, type ResolveTokenInput, type SlackClient, type SlackClientOptions, type SlackNotificationsOptions, type VerifyTokenFailure, type VerifyTokenResult, type VerifyTokenSuccess, createSlackClient };
package/dist/index.mjs CHANGED
@@ -1,15 +1,14 @@
1
1
  import { AuthError, connectionProbe, createResolveToken } from "@theholocron/cli";
2
2
  import { createSlackClient } from "@theholocron/slack-client";
3
3
  import { errorMessage } from "@theholocron/misc-utils";
4
- //#region src/auth.ts
4
+ // src/auth.ts
5
5
  const resolveToken = createResolveToken({
6
6
  envName: "HOLOCRON_SLACK_TOKEN",
7
7
  vendorEnvName: "SLACK_BOT_TOKEN",
8
8
  keyringService: "slack",
9
9
  errorMessage: "no Slack bot token found. Pass --token <TOKEN>, set HOLOCRON_SLACK_TOKEN / SLACK_BOT_TOKEN, or run: holocron auth set slack <xoxb-TOKEN>"
10
10
  });
11
- //#endregion
12
- //#region src/capabilities/notifications.ts
11
+ // src/capabilities/notifications.ts
13
12
  var SlackNotifications = class {
14
13
  client;
15
14
  opts;
@@ -25,8 +24,7 @@ var SlackNotifications = class {
25
24
  await this.client().chat.postMessage(ch, message);
26
25
  }
27
26
  };
28
- //#endregion
29
- //#region src/verify-token.ts
27
+ // src/verify-token.ts
30
28
  async function verifyToken(token, opts = {}) {
31
29
  const client = createSlackClient({
32
30
  token,
@@ -46,8 +44,7 @@ async function verifyToken(token, opts = {}) {
46
44
  };
47
45
  }
48
46
  }
49
- //#endregion
50
- //#region src/index.ts
47
+ // src/index.ts
51
48
  function createContext(options = {}) {
52
49
  let client;
53
50
  return {
@@ -80,5 +77,4 @@ function createPlugin(options = {}) {
80
77
  };
81
78
  }
82
79
  const AUTH_HINT = "create a Slack app at https://api.slack.com/apps, add the chat:write bot scope, install it to your workspace, copy the Bot User OAuth Token (xoxb-...), then run: holocron auth set slack <xoxb-TOKEN>";
83
- //#endregion
84
80
  export { AUTH_HINT, AuthError, SlackNotifications, createContext, createPlugin, createSlackClient, notifications, resolveToken, verifyToken };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/holocron-plugin-slack",
3
- "version": "5.0.0-alpha.245",
3
+ "version": "5.0.0-alpha.247",
4
4
  "description": "Holocron plugin for Slack. Implements the notifications capability via Slack's bot API.",
5
5
  "keywords": [
6
6
  "holocron",
@@ -38,22 +38,22 @@
38
38
  "@theholocron/tsdown-config": "^8.8.2",
39
39
  "@theholocron/vitest-config": "^8.8.2",
40
40
  "@types/node": "^26",
41
- "@vitest/coverage-v8": "^4.1.11",
41
+ "@vitest/coverage-v8": "^5.0.5",
42
42
  "@vitest/eslint-plugin": "^1.6.27",
43
43
  "chalk": "^6.0.0",
44
44
  "eslint": "^10.8.1",
45
45
  "eslint-plugin-n": "^18.3.0",
46
46
  "globals": "^17.11.0",
47
- "tsdown": "^0.22.14",
47
+ "tsdown": "^0.23.3",
48
48
  "tsx": "4.23.15",
49
49
  "typescript": "^5.9.3",
50
- "vitest": "^4.1.11",
51
- "@theholocron/cli": "5.0.0-alpha.245"
50
+ "vitest": "^5.0.5",
51
+ "@theholocron/cli": "5.0.0-alpha.247"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@theholocron/misc-utils": "^1.16.0",
55
55
  "@theholocron/slack-client": "^1.43.1",
56
- "@theholocron/cli": "5.0.0-alpha.245"
56
+ "@theholocron/cli": "5.0.0-alpha.247"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">=22"