@getstrata/bootstrap 3.1.6 → 3.1.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # @getstrata/bootstrap changelog
2
2
 
3
+ ## 3.1.7
4
+
5
+ Fix graceful shutdown for admitted queue jobs
6
+
3
7
  ## 3.1.6
4
8
 
5
9
  fix: drain admitted request bookkeeping during shutdown
@@ -171,11 +171,11 @@ import { createScopedPolicy } from "@getstrata/core/tenant/scopedDatabasePolicy"
171
171
  function createPersistenceInvocation(application, connection) {
172
172
  if (!connection.trim())
173
173
  throw new TypeError("A configured persistence connection is required.");
174
- return (envelope, work) => application.run(envelope, (scope) => {
174
+ return (envelope, work, options) => application.run(envelope, (scope) => {
175
175
  const database = scope.resolve(DATABASE_SESSION_TOKEN).connection(connection);
176
176
  const policy = createScopedPolicy(scope.resolve(CORE_EXECUTION_OWNERSHIP_TOKEN), scope.context, database);
177
177
  return work(Object.freeze({ database, policy }));
178
- });
178
+ }, options);
179
179
  }
180
180
 
181
181
  // ../../src/bootstrap/providers/index.ts
@@ -939,7 +939,7 @@ function createApplicationContext(providers, options) {
939
939
  return result;
940
940
  };
941
941
  let application;
942
- const invoke = (envelope, work) => createPersistenceInvocation(application, options.connection)(envelope, work);
942
+ const invoke = (...args) => createPersistenceInvocation(application, options.connection)(...args);
943
943
  const dependencies = { container, invoke };
944
944
  const context = {
945
945
  container,
@@ -171,11 +171,11 @@ import { createScopedPolicy } from "@getstrata/core/tenant/scopedDatabasePolicy"
171
171
  function createPersistenceInvocation(application, connection) {
172
172
  if (!connection.trim())
173
173
  throw new TypeError("A configured persistence connection is required.");
174
- return (envelope, work) => application.run(envelope, (scope) => {
174
+ return (envelope, work, options) => application.run(envelope, (scope) => {
175
175
  const database = scope.resolve(DATABASE_SESSION_TOKEN).connection(connection);
176
176
  const policy = createScopedPolicy(scope.resolve(CORE_EXECUTION_OWNERSHIP_TOKEN), scope.context, database);
177
177
  return work(Object.freeze({ database, policy }));
178
- });
178
+ }, options);
179
179
  }
180
180
 
181
181
  // ../../src/bootstrap/providers/index.ts
@@ -939,7 +939,7 @@ function createApplicationContext(providers, options) {
939
939
  return result;
940
940
  };
941
941
  let application;
942
- const invoke = (envelope, work) => createPersistenceInvocation(application, options.connection)(envelope, work);
942
+ const invoke = (...args) => createPersistenceInvocation(application, options.connection)(...args);
943
943
  const dependencies = { container, invoke };
944
944
  const context = {
945
945
  container,
@@ -6,11 +6,11 @@ import { createScopedPolicy } from "@getstrata/core/tenant/scopedDatabasePolicy"
6
6
  function createPersistenceInvocation(application, connection) {
7
7
  if (!connection.trim())
8
8
  throw new TypeError("A configured persistence connection is required.");
9
- return (envelope, work) => application.run(envelope, (scope) => {
9
+ return (envelope, work, options) => application.run(envelope, (scope) => {
10
10
  const database = scope.resolve(DATABASE_SESSION_TOKEN).connection(connection);
11
11
  const policy = createScopedPolicy(scope.resolve(CORE_EXECUTION_OWNERSHIP_TOKEN), scope.context, database);
12
12
  return work(Object.freeze({ database, policy }));
13
- });
13
+ }, options);
14
14
  }
15
15
  export {
16
16
  createPersistenceInvocation
package/dist/index.js CHANGED
@@ -174,11 +174,11 @@ import { createScopedPolicy } from "@getstrata/core/tenant/scopedDatabasePolicy"
174
174
  function createPersistenceInvocation(application, connection) {
175
175
  if (!connection.trim())
176
176
  throw new TypeError("A configured persistence connection is required.");
177
- return (envelope, work) => application.run(envelope, (scope) => {
177
+ return (envelope, work, options) => application.run(envelope, (scope) => {
178
178
  const database = scope.resolve(DATABASE_SESSION_TOKEN).connection(connection);
179
179
  const policy = createScopedPolicy(scope.resolve(CORE_EXECUTION_OWNERSHIP_TOKEN), scope.context, database);
180
180
  return work(Object.freeze({ database, policy }));
181
- });
181
+ }, options);
182
182
  }
183
183
 
184
184
  // ../../src/bootstrap/providers/index.ts
@@ -901,7 +901,7 @@ function createApplicationContext(providers, options) {
901
901
  return result;
902
902
  };
903
903
  let application;
904
- const invoke = (envelope, work) => createPersistenceInvocation(application, options.connection)(envelope, work);
904
+ const invoke = (...args) => createPersistenceInvocation(application, options.connection)(...args);
905
905
  const dependencies = { container, invoke };
906
906
  const context = {
907
907
  container,
@@ -3155,10 +3155,10 @@ function defineApp(input) {
3155
3155
  const catalog = [cacheEffects, ...listenerDeclarations];
3156
3156
  let invoke;
3157
3157
  let auditExport;
3158
- const run = (envelope, work) => {
3158
+ const run = (...args) => {
3159
3159
  if (!invoke)
3160
3160
  throw new Error("Application owner has not been constructed.");
3161
- return invoke(envelope, work);
3161
+ return invoke(...args);
3162
3162
  };
3163
3163
  let readyQueueServices;
3164
3164
  let readyRegistry;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getstrata/bootstrap",
3
- "version": "3.1.6",
3
+ "version": "3.1.7",
4
4
  "description": "Application startup, routing, middleware, and service configuration for Strata.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -246,7 +246,7 @@
246
246
  "access": "public"
247
247
  },
248
248
  "peerDependencies": {
249
- "@getstrata/core": "^3.1.6",
249
+ "@getstrata/core": "^3.1.7",
250
250
  "typescript": "^5.9.0 || ^6.0.0 || ^7.0.0"
251
251
  },
252
252
  "engines": {