@wildo-ai/saas-workers-node-lib 1.1.4 → 1.1.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildo-ai/saas-workers-node-lib",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "Node worker runtime host boundary for Wildo SaaS applications",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Wildo AI",
@@ -30,18 +30,17 @@
30
30
  "test:watch": "vitest"
31
31
  },
32
32
  "dependencies": {
33
- "inversify": "8.1.0",
33
+ "@wildo-ai/platform-config-lib": "1.1.5",
34
+ "@wildo-ai/platform-core-shared": "1.1.5",
35
+ "@wildo-ai/saas-backend-lib": "1.1.5",
36
+ "@wildo-ai/saas-models": "1.1.5",
34
37
  "express": "^5.1.0",
35
38
  "helmet": "^8.1.0",
36
39
  "jsonwebtoken": "^9.0.2",
37
- "@wildo-ai/saas-models": "1.1.4",
38
- "@wildo-ai/saas-backend-lib": "1.1.4",
39
- "@wildo-ai/platform-config-lib": "1.1.4",
40
- "@wildo-ai/platform-core-shared": "1.1.4"
40
+ "reflect-metadata": "0.2.2"
41
41
  },
42
42
  "peerDependencies": {
43
- "inversify": "^8.1.0",
44
- "reflect-metadata": "^0.2.2"
43
+ "inversify": "^8.1.0"
45
44
  },
46
45
  "devDependencies": {
47
46
  "@types/node": "^24.0.15",
@@ -91,6 +91,7 @@ function instantiate() {
91
91
  const bootstrapClient = {
92
92
  initialize: vi.fn(),
93
93
  getBootstrap: vi.fn().mockResolvedValue(createBootstrapResponse()),
94
+ getBootstrapAtStartup: vi.fn().mockResolvedValue(createBootstrapResponse()),
94
95
  } as unknown as WildoWorkerBootstrapClientService;
95
96
  const workerHttpServer = {
96
97
  initialize: vi.fn().mockResolvedValue(undefined),
@@ -142,6 +143,9 @@ describe('StartWorkerApplicationBackendService', () => {
142
143
  }),
143
144
  });
144
145
 
146
+ // Startup takes the read that waits out an apps-manager restart; the plain read is the refresh loop's.
147
+ expect(bootstrapClient.getBootstrapAtStartup).toHaveBeenCalledTimes(1);
148
+ expect(bootstrapClient.getBootstrap).not.toHaveBeenCalled();
145
149
  expect(bootstrapClient.initialize).toHaveBeenCalledWith({
146
150
  appsManagerBaseUrl: 'https://apps-manager.example.com',
147
151
  applicationId: 'app-1',
@@ -45,6 +45,7 @@ export interface WorkerProviderRuntimeArtifact {
45
45
  * services into the worker boundary and defeat the language-pluggable
46
46
  * isolation the worker kind exists to provide.
47
47
  */
48
+ /** @wildo_source:part:start workers.node.worker-init-contract facet:layer:backend facet:family:worker facet:audience:app-developer */
48
49
  export interface WorkerInitializationConfig {
49
50
  workerName: string;
50
51
  serviceKind: BackgroundRuntimeType.WORKER;
@@ -90,3 +91,4 @@ export function defineWorkerInit(
90
91
  ): WorkerInitializationConfig {
91
92
  return config;
92
93
  }
94
+ /** @wildo_source:part:end workers.node.worker-init-contract */
@@ -115,7 +115,8 @@ export class StartWorkerApplicationBackendService {
115
115
  platformApplicationPrimarySecret,
116
116
  refreshIntervalMs: config.publicKeyRefreshIntervalMs,
117
117
  });
118
- this.bootstrapResponse = await this.workerBootstrapClient.getBootstrap();
118
+ // The startup read tolerates apps-manager restarting; the refresh loop below keeps a single attempt.
119
+ this.bootstrapResponse = await this.workerBootstrapClient.getBootstrapAtStartup();
119
120
  this.scheduleRefresh(config.publicKeyRefreshIntervalMs);
120
121
 
121
122
  await this.workerHttpServer.initialize({