opencode-discord-notify 0.3.1 → 0.3.2

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.ts CHANGED
@@ -1,68 +1,5 @@
1
1
  import { Plugin } from '@opencode-ai/plugin';
2
2
 
3
- type DiscordWebhookMessageResponse = {
4
- id: string;
5
- channel_id: string;
6
- };
7
- type DiscordEmbed = {
8
- title?: string;
9
- description?: string;
10
- url?: string;
11
- color?: number;
12
- timestamp?: string;
13
- fields?: Array<{
14
- name: string;
15
- value: string;
16
- inline?: boolean;
17
- }>;
18
- };
19
- type DiscordAllowedMentions = {
20
- parse?: Array<'everyone' | 'roles' | 'users'>;
21
- roles?: string[];
22
- users?: string[];
23
- };
24
- type DiscordExecuteWebhookBody = {
25
- content?: string;
26
- username?: string;
27
- avatar_url?: string;
28
- thread_name?: string;
29
- embeds?: DiscordEmbed[];
30
- allowed_mentions?: DiscordAllowedMentions;
31
- };
32
- declare function toIsoTimestamp(ms: unknown): string | undefined;
33
- declare function buildFields(fields: Array<[string, unknown]>, inline?: boolean): DiscordEmbed['fields'];
34
- declare function buildMention(mention: string | undefined, nameForLog: string): {
35
- content?: string;
36
- allowed_mentions?: DiscordAllowedMentions;
37
- } | undefined;
38
- declare function buildTodoChecklist(todos: unknown): string;
39
- type ToastVariant = 'info' | 'success' | 'warning' | 'error';
40
- type MaybeAlertError = (input: {
41
- key: string;
42
- title?: string;
43
- message: string;
44
- variant: ToastVariant;
45
- }) => Promise<void>;
46
- type PostDiscordWebhookDeps = {
47
- showErrorAlert: boolean;
48
- maybeAlertError: MaybeAlertError;
49
- waitOnRateLimitMs: number;
50
- fetchImpl?: typeof fetch;
51
- sleepImpl?: (ms: number) => Promise<void>;
52
- };
53
- declare function postDiscordWebhook(input: {
54
- webhookUrl: string;
55
- threadId?: string;
56
- wait?: boolean;
57
- body: DiscordExecuteWebhookBody;
58
- }, deps: PostDiscordWebhookDeps): Promise<DiscordWebhookMessageResponse | undefined>;
59
3
  declare const plugin: Plugin;
60
- declare const __test__: {
61
- buildMention: typeof buildMention;
62
- buildTodoChecklist: typeof buildTodoChecklist;
63
- buildFields: typeof buildFields;
64
- toIsoTimestamp: typeof toIsoTimestamp;
65
- postDiscordWebhook: typeof postDiscordWebhook;
66
- };
67
4
 
68
- export { __test__, plugin as default };
5
+ export { plugin as default };
package/dist/index.js CHANGED
@@ -588,7 +588,7 @@ var plugin = async ({ client }) => {
588
588
  }
589
589
  };
590
590
  };
591
- var __test__ = {
591
+ plugin.__test__ = {
592
592
  buildMention,
593
593
  buildTodoChecklist,
594
594
  buildFields,
@@ -597,6 +597,5 @@ var __test__ = {
597
597
  };
598
598
  var index_default = plugin;
599
599
  export {
600
- __test__,
601
600
  index_default as default
602
601
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-discord-notify",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "A plugin that posts OpenCode events to a Discord webhook.",
5
5
  "license": "MIT",
6
6
  "type": "module",