@crowbartools/firebot-types 5.67.0-alpha15 → 5.67.0-alpha16

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.
@@ -32,7 +32,7 @@ declare class ScriptManager {
32
32
  * Handle a config change. Starts/stops as needed, and on a still-enabled plugin
33
33
  * either re-loads (if file may have changed) or invokes onParameterUpdate.
34
34
  */
35
- reloadPluginConfig(pluginConfig: InstalledPluginConfig): Promise<void>;
35
+ reloadPluginConfig(pluginConfig: InstalledPluginConfig, isNewInstall?: boolean): Promise<void>;
36
36
  setPluginEnabled(pluginId: string, enabled: boolean): Promise<void>;
37
37
  getInstalledPlugins(): Promise<InstalledPlugin[]>;
38
38
  /**
@@ -1,5 +1,4 @@
1
- import type { ScriptWebhook, WebhookConfig } from "../../types";
2
- import type { ScriptWebhookEventHandler } from "../../types/script-api";
1
+ import type { PluginWebhook, PluginWebhookEventHandler, WebhookConfig } from "../../types";
3
2
  import JsonDbManager from "../database/json-db-manager";
4
3
  type ExtraEvents = {
5
4
  "webhook-received": (data: {
@@ -15,12 +14,12 @@ declare class WebhookConfigManager extends JsonDbManager<WebhookConfig, ExtraEve
15
14
  getWebhookUrlById(webhookId: string): string;
16
15
  private toPublic;
17
16
  findPluginWebhookByName(pluginId: string, webhookName: string): WebhookConfig;
18
- getPluginWebhook(pluginId: string, webhookName: string): ScriptWebhook;
19
- getAllPluginWebhooks(pluginId: string): ScriptWebhook[];
20
- savePluginWebhook(pluginId: string, webhookName: string): ScriptWebhook;
17
+ getPluginWebhook(pluginId: string, webhookName: string): PluginWebhook;
18
+ getAllPluginWebhooks(pluginId: string): PluginWebhook[];
19
+ savePluginWebhook(pluginId: string, webhookName: string): PluginWebhook;
21
20
  deletePluginWebhook(pluginId: string, webhookName: string): boolean;
22
21
  getPluginWebhookUrl(pluginId: string, webhookName: string): string;
23
- registerPluginHandler(pluginId: string, handler: ScriptWebhookEventHandler): boolean;
22
+ registerPluginHandler(pluginId: string, handler: PluginWebhookEventHandler): boolean;
24
23
  unregisterPluginHandler(pluginId: string): boolean;
25
24
  }
26
25
  declare const webhookConfigManager: WebhookConfigManager;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowbartools/firebot-types",
3
- "version": "5.67.0-alpha15",
3
+ "version": "5.67.0-alpha16",
4
4
  "description": "Type definitions and script API for Firebot plugins and custom scripts.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -203,4 +203,4 @@ export type LegacyCustomScript = {
203
203
  stop?: () => Awaitable<void>;
204
204
  };
205
205
  export type FirebotScriptApi = import("./script-api").FirebotScriptApi;
206
- export type { ScriptLoggerApi, ScriptWebhooksApi, ScriptWebhook, ScriptWebhookEvent } from "./script-api";
206
+ export type { ScriptLoggerApi, ScriptWebhooksApi } from "./script-api";
@@ -5,6 +5,7 @@ import type { Notification } from "./notifications";
5
5
  import type { FirebotAccount } from "./accounts";
6
6
  import type { FirebotSettingsTypes } from "./settings";
7
7
  import type { InstalledPlugin } from "./plugins";
8
+ import type { PluginWebhook } from "./webhooks";
8
9
  export type ScriptLogMethod = (message: string, ...meta: unknown[]) => void;
9
10
  export interface ScriptLoggerApi {
10
11
  debug: ScriptLogMethod;
@@ -12,22 +13,11 @@ export interface ScriptLoggerApi {
12
13
  warn: ScriptLogMethod;
13
14
  error: ScriptLogMethod;
14
15
  }
15
- export interface ScriptWebhook {
16
- id: string;
17
- name: string;
18
- }
19
- export interface ScriptWebhookEvent {
20
- webhook: ScriptWebhook;
21
- payload: unknown;
22
- rawPayload?: string;
23
- headers: Record<string, string>;
24
- }
25
- export type ScriptWebhookEventHandler = (event: ScriptWebhookEvent) => void;
26
16
  export interface ScriptWebhooksApi {
27
17
  /** Look up a webhook by name. */
28
- get(name: string): ScriptWebhook | null;
18
+ get(name: string): PluginWebhook | null;
29
19
  /** All webhooks owned by this script. */
30
- list(): ScriptWebhook[];
20
+ list(): PluginWebhook[];
31
21
  /** Public URL for a webhook by name, or null if not found. */
32
22
  getUrl(name: string): string | null;
33
23
  }
@@ -1,10 +1,20 @@
1
- import type { ScriptWebhookEventHandler } from "./script-api";
2
1
  export type WebhookConfig = {
3
2
  id: string;
4
3
  name: string;
5
4
  scriptId?: string;
6
5
  };
6
+ export interface PluginWebhook {
7
+ id: string;
8
+ name: string;
9
+ }
10
+ export interface PluginWebhookEvent {
11
+ webhook: PluginWebhook;
12
+ payload: unknown;
13
+ rawPayload?: string;
14
+ headers: Record<string, string>;
15
+ }
16
+ export type PluginWebhookEventHandler = (event: PluginWebhookEvent) => void;
7
17
  export type PluginWebhooks = {
8
18
  webhookNames: string[];
9
- handler: ScriptWebhookEventHandler;
19
+ handler: PluginWebhookEventHandler;
10
20
  };