@fayz-ai/plugin-notifications 0.2.0 → 0.2.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.
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { NotificationsDataProvider } from '../data/types';
3
+ import { type MessageTemplate } from '../types';
4
+ export declare function TemplateEditorDialog({ open, template, provider, onClose, onSaved }: {
5
+ open: boolean;
6
+ template: MessageTemplate | null;
7
+ provider: NotificationsDataProvider;
8
+ onClose: () => void;
9
+ onSaved: () => void;
10
+ }): React.JSX.Element;
11
+ //# sourceMappingURL=TemplateEditorDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TemplateEditorDialog.d.ts","sourceRoot":"","sources":["../../src/components/TemplateEditorDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAA;AAC9D,OAAO,EAAoB,KAAK,eAAe,EAA4C,MAAM,UAAU,CAAA;AAc3G,wBAAgB,oBAAoB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IACnF,IAAI,EAAE,OAAO,CAAA;IACb,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAA;IAChC,QAAQ,EAAE,yBAAyB,CAAA;IACnC,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,qBA4HA"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { NotificationsDataProvider } from './data/types';
3
+ export declare function NotificationsContextProvider({ provider, children }: {
4
+ provider: NotificationsDataProvider;
5
+ children: React.ReactNode;
6
+ }): React.JSX.Element;
7
+ export declare function useNotificationsProvider(): NotificationsDataProvider;
8
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AAI7D,wBAAgB,4BAA4B,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE;IACnE,QAAQ,EAAE,yBAAyB,CAAA;IACnC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,qBAEA;AAED,wBAAgB,wBAAwB,IAAI,yBAAyB,CAIpE"}
@@ -0,0 +1,3 @@
1
+ import type { NotificationsDataProvider } from './types';
2
+ export declare function createMockNotificationsProvider(): NotificationsDataProvider;
3
+ //# sourceMappingURL=mock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../src/data/mock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AA+CxD,wBAAgB,+BAA+B,IAAI,yBAAyB,CAyD3E"}
@@ -0,0 +1,3 @@
1
+ import type { NotificationsDataProvider } from './types';
2
+ export declare function createSupabaseNotificationsProvider(): NotificationsDataProvider;
3
+ //# sourceMappingURL=supabase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supabase.d.ts","sourceRoot":"","sources":["../../src/data/supabase.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AA2BxD,wBAAgB,mCAAmC,IAAI,yBAAyB,CAiF/E"}
@@ -0,0 +1,7 @@
1
+ export declare const T: {
2
+ readonly templates: "plg_notifications_templates";
3
+ readonly queue: "plg_notifications_queue";
4
+ readonly deliveries: "plg_notifications_deliveries";
5
+ readonly history: "v_notification_history";
6
+ };
7
+ //# sourceMappingURL=tables.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tables.d.ts","sourceRoot":"","sources":["../../src/data/tables.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,CAAC;;;;;CAKJ,CAAA"}
@@ -0,0 +1,9 @@
1
+ import type { MessageTemplate, SaveTemplateInput, MessageHistoryRow, MessageHistorySummary, HistoryQuery } from '../types';
2
+ export interface NotificationsDataProvider {
3
+ getTemplates(): Promise<MessageTemplate[]>;
4
+ saveTemplate(input: SaveTemplateInput): Promise<MessageTemplate>;
5
+ deleteTemplate(id: string): Promise<void>;
6
+ getHistory(query?: HistoryQuery): Promise<MessageHistoryRow[]>;
7
+ getHistorySummary(days?: number): Promise<MessageHistorySummary>;
8
+ }
9
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/data/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,YAAY,EAC3F,MAAM,UAAU,CAAA;AAEjB,MAAM,WAAW,yBAAyB;IACxC,YAAY,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC,CAAA;IAC1C,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAA;IAChE,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACzC,UAAU,CAAC,KAAK,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAA;IAC9D,iBAAiB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;CACjE"}
package/dist/index.d.ts CHANGED
@@ -1,9 +1,22 @@
1
1
  import type { PluginManifest, PluginScope, VerticalId } from '@fayz-ai/core';
2
+ import type { NotificationsDataProvider } from './data/types';
2
3
  export interface NotificationsPluginOptions {
3
4
  scope?: PluginScope;
4
5
  verticalId?: VerticalId;
5
6
  /** Label override for the module name shown in settings and navigation. */
6
7
  name?: string;
8
+ /** Onde a régua aparece no rail. */
9
+ navPosition?: number;
10
+ navLabel?: string;
11
+ dataProvider?: NotificationsDataProvider;
12
+ /** Liga a régua para o app que a monta.
13
+ *
14
+ * O padrão continua DESLIGADO, e não por inércia: durante toda a fase em
15
+ * que este plugin era só motor, ligá-lo poria no rail um item que não abria
16
+ * nada. Agora que ele tem tela, quem a mostra é o app que a pediu — mudar o
17
+ * padrão para todos faria aparecer um "Comunicação" no rail de apps que
18
+ * nunca pediram por ele. */
19
+ defaultEnabled?: boolean;
7
20
  }
8
21
  /**
9
22
  * The engine dunning, appointment confirmation, order-ready, the post-service
@@ -11,11 +24,14 @@ export interface NotificationsPluginOptions {
11
24
  * template; what does not vary is the queue, the retry, the deduplication and
12
25
  * the recipient's right to choose the channel — so it is built once, here.
13
26
  *
14
- * The plugin ships no screen of its own yet: everything it does is reachable
15
- * from SQL (`notifications_enqueue`, `notifications_drain`) and from the event
16
- * subscriptions it declares. The admin surface is a follow-up, and shipping the
17
- * engine without it is deliberate — a campaign form that cannot send is what
18
- * this phase exists to stop building.
27
+ * O motor foi construído primeiro e ficou SEM PORTA de propósito: tudo o que
28
+ * ele faz era alcançável por SQL e pelas assinaturas de evento, e a superfície
29
+ * de administração era um trabalho seguinte. Este é o trabalho seguinte
30
+ * Modelos e Histórico de Envios.
31
+ *
32
+ * O Histórico é o que justifica a onda: o motor sempre registrou `last_error`,
33
+ * `blocked_reason` e a `error` de cada tentativa, e nada nunca leu nada disso.
34
+ * "Meus lembretes não estão chegando" não tinha onde ser respondido.
19
35
  */
20
36
  export declare function createNotificationsPlugin(options?: NotificationsPluginOptions): PluginManifest;
21
37
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAK5E,MAAM,WAAW,0BAA0B;IACzC,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,2EAA2E;IAC3E,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,CAAC,EAAE,0BAA0B,GAAG,cAAc,CAuD9F"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAQ5E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AAE7D,MAAM,WAAW,0BAA0B;IACzC,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,2EAA2E;IAC3E,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,yBAAyB,CAAA;IACxC;;;;;;iCAM6B;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,CAAC,EAAE,0BAA0B,GAAG,cAAc,CAwE9F"}