@voyantjs/plugin-netopia 0.13.0 → 0.15.0

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.
@@ -6,5 +6,8 @@ export type NetopiaNotificationRuntime = {
6
6
  export type NetopiaNotificationRuntimeOptions = Pick<NetopiaRuntimeOptions, "resolveNotificationProviders"> & {
7
7
  notificationProviders?: ReadonlyArray<NotificationProvider>;
8
8
  };
9
+ export declare class NetopiaNotificationRuntimeError extends Error {
10
+ constructor(message: string);
11
+ }
9
12
  export declare function buildNetopiaNotificationRuntime(bindings: Record<string, unknown> | undefined, runtimeOptions?: NetopiaNotificationRuntimeOptions, dispatcherOverride?: NotificationService): NetopiaNotificationRuntime;
10
13
  //# sourceMappingURL=notification-runtime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification-runtime.d.ts","sourceRoot":"","sources":["../src/notification-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,MAAM,yBAAyB,CAAA;AAEhC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAEvD,MAAM,MAAM,0BAA0B,GAAG;IACvC,UAAU,EAAE,mBAAmB,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,iCAAiC,GAAG,IAAI,CAClD,qBAAqB,EACrB,8BAA8B,CAC/B,GAAG;IACF,qBAAqB,CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAA;CAC5D,CAAA;AAED,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC7C,cAAc,GAAE,iCAAsC,EACtD,kBAAkB,CAAC,EAAE,mBAAmB,GACvC,0BAA0B,CAe5B"}
1
+ {"version":3,"file":"notification-runtime.d.ts","sourceRoot":"","sources":["../src/notification-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,MAAM,yBAAyB,CAAA;AAEhC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAEvD,MAAM,MAAM,0BAA0B,GAAG;IACvC,UAAU,EAAE,mBAAmB,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,iCAAiC,GAAG,IAAI,CAClD,qBAAqB,EACrB,8BAA8B,CAC/B,GAAG;IACF,qBAAqB,CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAA;CAC5D,CAAA;AAED,qBAAa,+BAAgC,SAAQ,KAAK;gBAC5C,OAAO,EAAE,MAAM;CAI5B;AAED,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC7C,cAAc,GAAE,iCAAsC,EACtD,kBAAkB,CAAC,EAAE,mBAAmB,GACvC,0BAA0B,CAoB5B"}
@@ -1,4 +1,10 @@
1
- import { createDefaultNotificationProviders, createNotificationService, } from "@voyantjs/notifications";
1
+ import { createNotificationService, } from "@voyantjs/notifications";
2
+ export class NetopiaNotificationRuntimeError extends Error {
3
+ constructor(message) {
4
+ super(message);
5
+ this.name = "NetopiaNotificationRuntimeError";
6
+ }
7
+ }
2
8
  export function buildNetopiaNotificationRuntime(bindings, runtimeOptions = {}, dispatcherOverride) {
3
9
  if (dispatcherOverride) {
4
10
  return {
@@ -6,8 +12,10 @@ export function buildNetopiaNotificationRuntime(bindings, runtimeOptions = {}, d
6
12
  };
7
13
  }
8
14
  const providers = runtimeOptions.resolveNotificationProviders?.(bindings ?? {}) ??
9
- runtimeOptions.notificationProviders ??
10
- createDefaultNotificationProviders(bindings ?? {});
15
+ runtimeOptions.notificationProviders;
16
+ if (!providers) {
17
+ throw new NetopiaNotificationRuntimeError("Netopia plugin requires `resolveNotificationProviders` or `notificationProviders` — there are no default providers.");
18
+ }
11
19
  return {
12
20
  dispatcher: createNotificationService(providers),
13
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voyantjs/plugin-netopia",
3
- "version": "0.13.0",
3
+ "version": "0.15.0",
4
4
  "license": "FSL-1.1-Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -33,11 +33,11 @@
33
33
  "drizzle-orm": "^0.45.2",
34
34
  "hono": "^4.12.10",
35
35
  "zod": "^4.3.6",
36
- "@voyantjs/checkout": "0.13.0",
37
- "@voyantjs/core": "0.13.0",
38
- "@voyantjs/finance": "0.13.0",
39
- "@voyantjs/hono": "0.13.0",
40
- "@voyantjs/notifications": "0.13.0"
36
+ "@voyantjs/checkout": "0.15.0",
37
+ "@voyantjs/core": "0.15.0",
38
+ "@voyantjs/finance": "0.15.0",
39
+ "@voyantjs/hono": "0.15.0",
40
+ "@voyantjs/notifications": "0.15.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "typescript": "^6.0.2",