@open-mercato/channel-apns 0.11.1-develop.8417.1.36c73b01e6 → 0.11.1-develop.8419.1.6d358af5ff

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.
@@ -1,3 +1,5 @@
1
+ import { validateAdapterCapabilities } from "@open-mercato/core/modules/communication_channels/lib/adapter-compat";
2
+ import { defineProcessDiRegistrar, registerProcessActivation } from "@open-mercato/shared/lib/di/process-registrar";
1
3
  import { asValue } from "awilix";
2
4
  import {
3
5
  hasChannelAdapter,
@@ -6,11 +8,17 @@ import {
6
8
  import { getApnsChannelAdapter } from "./lib/adapter.js";
7
9
  import { ensureApnsFakeProviderInstalled } from "./lib/fake-provider.js";
8
10
  import { channelApnsHealthCheck } from "./lib/health.js";
9
- function register(container) {
10
- ensureApnsFakeProviderInstalled();
11
- if (!hasChannelAdapter("apns")) {
12
- registerChannelAdapter(getApnsChannelAdapter());
13
- }
11
+ function registerWithActivation(container, activate) {
12
+ activate(() => {
13
+ ensureApnsFakeProviderInstalled();
14
+ });
15
+ activate(() => {
16
+ if (!hasChannelAdapter("apns")) {
17
+ registerChannelAdapter(getApnsChannelAdapter());
18
+ }
19
+ }, () => {
20
+ if (!hasChannelAdapter("apns")) validateAdapterCapabilities(getApnsChannelAdapter());
21
+ });
14
22
  container.register({
15
23
  channelApnsAdapter: asValue(getApnsChannelAdapter()),
16
24
  // Registered under the exact service name declared in `integration.ts`
@@ -18,6 +26,12 @@ function register(container) {
18
26
  channelApnsHealthCheck: asValue(channelApnsHealthCheck)
19
27
  });
20
28
  }
29
+ function register(container) {
30
+ registerWithActivation(container, (activate) => activate());
31
+ }
32
+ defineProcessDiRegistrar((container) => {
33
+ registerWithActivation(container, (activate, validate) => registerProcessActivation(container, activate, validate));
34
+ }, { legacy: register });
21
35
  export {
22
36
  register
23
37
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/modules/channel_apns/di.ts"],
4
- "sourcesContent": ["import { asValue } from 'awilix'\nimport type { AppContainer } from '@open-mercato/shared/lib/di/container'\nimport {\n hasChannelAdapter,\n registerChannelAdapter,\n} from '@open-mercato/core/modules/communication_channels/lib/adapter-registry-singleton'\nimport { getApnsChannelAdapter } from './lib/adapter'\nimport { ensureApnsFakeProviderInstalled } from './lib/fake-provider'\nimport { channelApnsHealthCheck } from './lib/health'\n\nexport function register(container: AppContainer): void {\n // Test-only: swap @parse/node-apn for a network-free fake when `OM_PUSH_FAKE_PROVIDERS` is set\n // (no-op in production), so integration specs exercise this adapter end-to-end. Swaps the SDK\n // client only \u2014 the adapter below stays registered. See lib/fake-provider.ts.\n ensureApnsFakeProviderInstalled()\n\n if (!hasChannelAdapter('apns')) {\n registerChannelAdapter(getApnsChannelAdapter())\n }\n container.register({\n channelApnsAdapter: asValue(getApnsChannelAdapter()),\n // Registered under the exact service name declared in `integration.ts`\n // (`healthCheck.service`); without it the hub's resolve throws.\n channelApnsHealthCheck: asValue(channelApnsHealthCheck),\n })\n}\n"],
5
- "mappings": "AAAA,SAAS,eAAe;AAExB;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,6BAA6B;AACtC,SAAS,uCAAuC;AAChD,SAAS,8BAA8B;AAEhC,SAAS,SAAS,WAA+B;AAItD,kCAAgC;AAEhC,MAAI,CAAC,kBAAkB,MAAM,GAAG;AAC9B,2BAAuB,sBAAsB,CAAC;AAAA,EAChD;AACA,YAAU,SAAS;AAAA,IACjB,oBAAoB,QAAQ,sBAAsB,CAAC;AAAA;AAAA;AAAA,IAGnD,wBAAwB,QAAQ,sBAAsB;AAAA,EACxD,CAAC;AACH;",
4
+ "sourcesContent": ["import { validateAdapterCapabilities } from '@open-mercato/core/modules/communication_channels/lib/adapter-compat'\nimport { defineProcessDiRegistrar, registerProcessActivation } from '@open-mercato/shared/lib/di/process-registrar'\nimport { asValue } from 'awilix'\nimport type { AppContainer } from '@open-mercato/shared/lib/di/container'\nimport {\n hasChannelAdapter,\n registerChannelAdapter,\n} from '@open-mercato/core/modules/communication_channels/lib/adapter-registry-singleton'\nimport { getApnsChannelAdapter } from './lib/adapter'\nimport { ensureApnsFakeProviderInstalled } from './lib/fake-provider'\nimport { channelApnsHealthCheck } from './lib/health'\n\nfunction registerWithActivation(container: AppContainer, activate: (callback: () => void, validate?: () => void) => void) {\n // Test-only: swap @parse/node-apn for a network-free fake when `OM_PUSH_FAKE_PROVIDERS` is set\n // (no-op in production), so integration specs exercise this adapter end-to-end. Swaps the SDK\n // client only \u2014 the adapter below stays registered. See lib/fake-provider.ts.\n activate(() => {\n ensureApnsFakeProviderInstalled()\n })\n\n activate(() => {\n if (!hasChannelAdapter('apns')) {\n registerChannelAdapter(getApnsChannelAdapter())\n }\n }, () => {\n if (!hasChannelAdapter('apns')) validateAdapterCapabilities(getApnsChannelAdapter())\n })\n container.register({\n channelApnsAdapter: asValue(getApnsChannelAdapter()),\n // Registered under the exact service name declared in `integration.ts`\n // (`healthCheck.service`); without it the hub's resolve throws.\n channelApnsHealthCheck: asValue(channelApnsHealthCheck),\n })\n}\n\nexport function register(container: AppContainer): void {\n registerWithActivation(container, (activate) => activate())\n}\n\ndefineProcessDiRegistrar((container: AppContainer) => {\n registerWithActivation(container, (activate, validate) => registerProcessActivation(container, activate, validate))\n}, { legacy: register })\n"],
5
+ "mappings": "AAAA,SAAS,mCAAmC;AAC5C,SAAS,0BAA0B,iCAAiC;AACpE,SAAS,eAAe;AAExB;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,6BAA6B;AACtC,SAAS,uCAAuC;AAChD,SAAS,8BAA8B;AAEvC,SAAS,uBAAuB,WAAyB,UAAiE;AAIxH,WAAS,MAAM;AACb,oCAAgC;AAAA,EAClC,CAAC;AAED,WAAS,MAAM;AACb,QAAI,CAAC,kBAAkB,MAAM,GAAG;AAC9B,6BAAuB,sBAAsB,CAAC;AAAA,IAChD;AAAA,EACF,GAAG,MAAM;AACP,QAAI,CAAC,kBAAkB,MAAM,EAAG,6BAA4B,sBAAsB,CAAC;AAAA,EACrF,CAAC;AACD,YAAU,SAAS;AAAA,IACjB,oBAAoB,QAAQ,sBAAsB,CAAC;AAAA;AAAA;AAAA,IAGnD,wBAAwB,QAAQ,sBAAsB;AAAA,EACxD,CAAC;AACH;AAEO,SAAS,SAAS,WAA+B;AACtD,yBAAuB,WAAW,CAAC,aAAa,SAAS,CAAC;AAC5D;AAEA,yBAAyB,CAAC,cAA4B;AACpD,yBAAuB,WAAW,CAAC,UAAU,aAAa,0BAA0B,WAAW,UAAU,QAAQ,CAAC;AACpH,GAAG,EAAE,QAAQ,SAAS,CAAC;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-mercato/channel-apns",
3
- "version": "0.11.1-develop.8417.1.36c73b01e6",
3
+ "version": "0.11.1-develop.8419.1.6d358af5ff",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -62,21 +62,21 @@
62
62
  }
63
63
  },
64
64
  "dependencies": {
65
- "@open-mercato/core": "0.11.1-develop.8417.1.36c73b01e6",
66
- "@open-mercato/ui": "0.11.1-develop.8417.1.36c73b01e6",
65
+ "@open-mercato/core": "0.11.1-develop.8419.1.6d358af5ff",
66
+ "@open-mercato/ui": "0.11.1-develop.8419.1.6d358af5ff",
67
67
  "@parse/node-apn": "^6.0.1"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "@mikro-orm/postgresql": "^7.0.14",
71
- "@open-mercato/ai-assistant": "0.11.1-develop.8417.1.36c73b01e6",
72
- "@open-mercato/shared": "0.11.1-develop.8417.1.36c73b01e6",
71
+ "@open-mercato/ai-assistant": "0.11.1-develop.8419.1.6d358af5ff",
72
+ "@open-mercato/shared": "0.11.1-develop.8419.1.6d358af5ff",
73
73
  "react": "^19.0.0",
74
74
  "react-dom": "^19.0.0",
75
75
  "react-is": ">=18.0.0"
76
76
  },
77
77
  "devDependencies": {
78
- "@open-mercato/ai-assistant": "0.11.1-develop.8417.1.36c73b01e6",
79
- "@open-mercato/shared": "0.11.1-develop.8417.1.36c73b01e6",
78
+ "@open-mercato/ai-assistant": "0.11.1-develop.8419.1.6d358af5ff",
79
+ "@open-mercato/shared": "0.11.1-develop.8419.1.6d358af5ff",
80
80
  "@types/jest": "^30.0.0",
81
81
  "@types/react": "^19.2.18",
82
82
  "@types/react-dom": "^19.2.5",
@@ -1,3 +1,5 @@
1
+ import { validateAdapterCapabilities } from '@open-mercato/core/modules/communication_channels/lib/adapter-compat'
2
+ import { defineProcessDiRegistrar, registerProcessActivation } from '@open-mercato/shared/lib/di/process-registrar'
1
3
  import { asValue } from 'awilix'
2
4
  import type { AppContainer } from '@open-mercato/shared/lib/di/container'
3
5
  import {
@@ -8,15 +10,21 @@ import { getApnsChannelAdapter } from './lib/adapter'
8
10
  import { ensureApnsFakeProviderInstalled } from './lib/fake-provider'
9
11
  import { channelApnsHealthCheck } from './lib/health'
10
12
 
11
- export function register(container: AppContainer): void {
13
+ function registerWithActivation(container: AppContainer, activate: (callback: () => void, validate?: () => void) => void) {
12
14
  // Test-only: swap @parse/node-apn for a network-free fake when `OM_PUSH_FAKE_PROVIDERS` is set
13
15
  // (no-op in production), so integration specs exercise this adapter end-to-end. Swaps the SDK
14
16
  // client only — the adapter below stays registered. See lib/fake-provider.ts.
15
- ensureApnsFakeProviderInstalled()
17
+ activate(() => {
18
+ ensureApnsFakeProviderInstalled()
19
+ })
16
20
 
17
- if (!hasChannelAdapter('apns')) {
18
- registerChannelAdapter(getApnsChannelAdapter())
19
- }
21
+ activate(() => {
22
+ if (!hasChannelAdapter('apns')) {
23
+ registerChannelAdapter(getApnsChannelAdapter())
24
+ }
25
+ }, () => {
26
+ if (!hasChannelAdapter('apns')) validateAdapterCapabilities(getApnsChannelAdapter())
27
+ })
20
28
  container.register({
21
29
  channelApnsAdapter: asValue(getApnsChannelAdapter()),
22
30
  // Registered under the exact service name declared in `integration.ts`
@@ -24,3 +32,11 @@ export function register(container: AppContainer): void {
24
32
  channelApnsHealthCheck: asValue(channelApnsHealthCheck),
25
33
  })
26
34
  }
35
+
36
+ export function register(container: AppContainer): void {
37
+ registerWithActivation(container, (activate) => activate())
38
+ }
39
+
40
+ defineProcessDiRegistrar((container: AppContainer) => {
41
+ registerWithActivation(container, (activate, validate) => registerProcessActivation(container, activate, validate))
42
+ }, { legacy: register })