@rexezuge/runtime 0.0.0-stage → 1.0.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.
Files changed (71) hide show
  1. package/LICENSE +21 -0
  2. package/dist/base/AbstractDurableObjectWorker.d.ts +26 -0
  3. package/dist/base/AbstractDurableObjectWorker.d.ts.map +1 -0
  4. package/dist/base/AbstractDurableObjectWorker.js +38 -0
  5. package/dist/base/AbstractDurableObjectWorker.js.map +1 -0
  6. package/dist/base/AbstractEntrypointWorker.d.ts +40 -0
  7. package/dist/base/AbstractEntrypointWorker.d.ts.map +1 -0
  8. package/dist/base/AbstractEntrypointWorker.js +35 -0
  9. package/dist/base/AbstractEntrypointWorker.js.map +1 -0
  10. package/dist/base/AbstractQueueWorker.d.ts +20 -0
  11. package/dist/base/AbstractQueueWorker.d.ts.map +1 -0
  12. package/dist/base/AbstractQueueWorker.js +13 -0
  13. package/dist/base/AbstractQueueWorker.js.map +1 -0
  14. package/dist/base/AbstractWorkflowWorker.d.ts +22 -0
  15. package/dist/base/AbstractWorkflowWorker.d.ts.map +1 -0
  16. package/dist/base/AbstractWorkflowWorker.js +13 -0
  17. package/dist/base/AbstractWorkflowWorker.js.map +1 -0
  18. package/dist/base/index.d.ts +8 -0
  19. package/dist/base/index.d.ts.map +1 -0
  20. package/dist/base/index.js +5 -0
  21. package/dist/base/index.js.map +1 -0
  22. package/dist/config/AppConfiguration.d.ts +36 -0
  23. package/dist/config/AppConfiguration.d.ts.map +1 -0
  24. package/dist/config/AppConfiguration.js +63 -0
  25. package/dist/config/AppConfiguration.js.map +1 -0
  26. package/dist/config/ConfigurationDefaults.d.ts +12 -0
  27. package/dist/config/ConfigurationDefaults.d.ts.map +1 -0
  28. package/dist/config/ConfigurationDefaults.js +12 -0
  29. package/dist/config/ConfigurationDefaults.js.map +1 -0
  30. package/dist/config/EnvParser.d.ts +30 -0
  31. package/dist/config/EnvParser.d.ts.map +1 -0
  32. package/dist/config/EnvParser.js +46 -0
  33. package/dist/config/EnvParser.js.map +1 -0
  34. package/dist/config/index.d.ts +4 -0
  35. package/dist/config/index.d.ts.map +1 -0
  36. package/dist/config/index.js +4 -0
  37. package/dist/config/index.js.map +1 -0
  38. package/dist/di/Container.d.ts +39 -0
  39. package/dist/di/Container.d.ts.map +1 -0
  40. package/dist/di/Container.js +48 -0
  41. package/dist/di/Container.js.map +1 -0
  42. package/dist/di/RequestScope.d.ts +32 -0
  43. package/dist/di/RequestScope.d.ts.map +1 -0
  44. package/dist/di/RequestScope.js +22 -0
  45. package/dist/di/RequestScope.js.map +1 -0
  46. package/dist/di/index.d.ts +5 -0
  47. package/dist/di/index.d.ts.map +1 -0
  48. package/dist/di/index.js +3 -0
  49. package/dist/di/index.js.map +1 -0
  50. package/dist/index.d.ts +24 -0
  51. package/dist/index.d.ts.map +1 -0
  52. package/dist/index.js +17 -0
  53. package/dist/index.js.map +1 -0
  54. package/dist/kv/KvCache.d.ts +74 -0
  55. package/dist/kv/KvCache.d.ts.map +1 -0
  56. package/dist/kv/KvCache.js +198 -0
  57. package/dist/kv/KvCache.js.map +1 -0
  58. package/dist/kv/KvDomains.d.ts +34 -0
  59. package/dist/kv/KvDomains.d.ts.map +1 -0
  60. package/dist/kv/KvDomains.js +101 -0
  61. package/dist/kv/KvDomains.js.map +1 -0
  62. package/dist/kv/index.d.ts +5 -0
  63. package/dist/kv/index.d.ts.map +1 -0
  64. package/dist/kv/index.js +3 -0
  65. package/dist/kv/index.js.map +1 -0
  66. package/dist/logger.d.ts +26 -0
  67. package/dist/logger.d.ts.map +1 -0
  68. package/dist/logger.js +47 -0
  69. package/dist/logger.js.map +1 -0
  70. package/package.json +34 -3
  71. package/README.md +0 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Rexezuge
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,26 @@
1
+ import { DurableObject } from 'cloudflare:workers';
2
+ /**
3
+ * The Durable Object base: one `fetch` entry, error containment inside it.
4
+ *
5
+ * Converged from the `AbstractDurableObjectWorker` copies in AWS-AccessBridge,
6
+ * CalDAV-Bridge, ChordDHT-Tracker, Edge-Git, Mail-Meow and Mail-Otter (the
7
+ * union is exactly Mail-Meow's shape: the fetch wrapper plus
8
+ * `createExecutionContext` for handlers that need to forward `waitUntil`).
9
+ * Durable-DAV's DO writes more context per handler, but the *base* is the same.
10
+ *
11
+ * A DO has no routing layer, so an unhandled rejection here would surface as a
12
+ * raw 500 with no JSON body and no log. The catch is the boundary: it logs the
13
+ * sanitized error and answers `{ error: 'Internal Error' }` so a caller always
14
+ * gets a parseable response.
15
+ */
16
+ declare abstract class AbstractDurableObjectWorker<TEnv = Env> extends DurableObject<TEnv> {
17
+ fetch(request: Request): Promise<Response>;
18
+ /**
19
+ * The platform `ExecutionContext` shape, forwards `waitUntil` into the DO's
20
+ * own `ctx` so a handler can keep a task alive past the response.
21
+ */
22
+ protected createExecutionContext(): ExecutionContext;
23
+ protected abstract onRequest(request: Request): Promise<Response>;
24
+ }
25
+ export { AbstractDurableObjectWorker };
26
+ //# sourceMappingURL=AbstractDurableObjectWorker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractDurableObjectWorker.d.ts","sourceRoot":"","sources":["../../src/base/AbstractDurableObjectWorker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;;;;;;;;;;GAaG;AACH,uBAAe,2BAA2B,CAAC,IAAI,GAAG,GAAG,CAAE,SAAQ,aAAa,CAAC,IAAI,CAAC;IACnE,KAAK,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC;IASvD;;;OAGG;IACH,SAAS,CAAC,sBAAsB,IAAI,gBAAgB;IAOpD,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC;CAClE;AAED,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { DurableObject } from 'cloudflare:workers';
2
+ /**
3
+ * The Durable Object base: one `fetch` entry, error containment inside it.
4
+ *
5
+ * Converged from the `AbstractDurableObjectWorker` copies in AWS-AccessBridge,
6
+ * CalDAV-Bridge, ChordDHT-Tracker, Edge-Git, Mail-Meow and Mail-Otter (the
7
+ * union is exactly Mail-Meow's shape: the fetch wrapper plus
8
+ * `createExecutionContext` for handlers that need to forward `waitUntil`).
9
+ * Durable-DAV's DO writes more context per handler, but the *base* is the same.
10
+ *
11
+ * A DO has no routing layer, so an unhandled rejection here would surface as a
12
+ * raw 500 with no JSON body and no log. The catch is the boundary: it logs the
13
+ * sanitized error and answers `{ error: 'Internal Error' }` so a caller always
14
+ * gets a parseable response.
15
+ */
16
+ class AbstractDurableObjectWorker extends DurableObject {
17
+ async fetch(request) {
18
+ try {
19
+ return await this.onRequest(request);
20
+ }
21
+ catch (err) {
22
+ console.error('Unhandled error in durable object fetch():', err);
23
+ return Response.json({ error: 'Internal Error' }, { status: 500 });
24
+ }
25
+ }
26
+ /**
27
+ * The platform `ExecutionContext` shape, forwards `waitUntil` into the DO's
28
+ * own `ctx` so a handler can keep a task alive past the response.
29
+ */
30
+ createExecutionContext() {
31
+ return {
32
+ waitUntil: (promise) => this.ctx.waitUntil(promise),
33
+ passThroughOnException: () => undefined,
34
+ };
35
+ }
36
+ }
37
+ export { AbstractDurableObjectWorker };
38
+ //# sourceMappingURL=AbstractDurableObjectWorker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractDurableObjectWorker.js","sourceRoot":"","sources":["../../src/base/AbstractDurableObjectWorker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;;;;;;;;;;GAaG;AACH,MAAe,2BAAwC,SAAQ,aAAmB;IACzE,KAAK,CAAC,KAAK,CAAC,OAAgB;QACjC,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC;QAAC,OAAO,GAAY,EAAE,CAAC;YACtB,OAAO,CAAC,KAAK,CAAC,4CAA4C,EAAE,GAAG,CAAC,CAAC;YACjE,OAAO,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;IAED;;;OAGG;IACO,sBAAsB;QAC9B,OAAO;YACL,SAAS,EAAE,CAAC,OAAyB,EAAQ,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC;YAC3E,sBAAsB,EAAE,GAAS,EAAE,CAAC,SAAS;SACf,CAAC;IACnC,CAAC;CAGF;AAED,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Minimal Workers-compatible context types so backend-runtime typechecks
3
+ * without @cloudflare/workers-types. Apps pass the real ExecutionContext /
4
+ * ScheduledController which satisfy these structurally.
5
+ *
6
+ * Converged verbatim from `backend-runtime/src/base/AbstractEntrypointWorker.ts`
7
+ * (identical in all nine repos).
8
+ */
9
+ interface WorkerExecutionContext {
10
+ waitUntil(promise: Promise<unknown>): void;
11
+ passThroughOnException(): void;
12
+ }
13
+ interface WorkerScheduledController {
14
+ cron: string;
15
+ scheduledTime: number;
16
+ noRetry(): void;
17
+ }
18
+ declare abstract class AbstractEntrypointWorker {
19
+ /**
20
+ * The HTTP request path.
21
+ *
22
+ * There is deliberately no `/__scheduled` branch here. It used to run before
23
+ * `onRequest`, which made `GET /__scheduled` an unauthenticated, un-rated
24
+ * trigger for the scheduled work: it bypassed the app's security headers, its
25
+ * request scope, and its rate limits, and any caller could fire the cron
26
+ * Durable Object on demand. `noRetry` was a `(): void => undefined` stub, so
27
+ * the retry semantics were lost too.
28
+ *
29
+ * Nothing needed it — `scheduled()` is wired through the platform by the
30
+ * `triggers.crons` entry in the wrangler config, which is how the cron
31
+ * actually runs.
32
+ */
33
+ fetch(request: Request, env: Env, ctx: WorkerExecutionContext): Promise<Response>;
34
+ scheduled(event: WorkerScheduledController, env: Env, ctx: WorkerExecutionContext): Promise<void>;
35
+ protected abstract onRequest(request: Request, env: Env, ctx: WorkerExecutionContext): Promise<Response>;
36
+ protected abstract onScheduled(event: WorkerScheduledController, env: Env, ctx: WorkerExecutionContext): Promise<void>;
37
+ }
38
+ export { AbstractEntrypointWorker };
39
+ export type { WorkerExecutionContext, WorkerScheduledController };
40
+ //# sourceMappingURL=AbstractEntrypointWorker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractEntrypointWorker.d.ts","sourceRoot":"","sources":["../../src/base/AbstractEntrypointWorker.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,UAAU,sBAAsB;IAC9B,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAC3C,sBAAsB,IAAI,IAAI,CAAC;CAChC;AAED,UAAU,yBAAyB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,uBAAe,wBAAwB;IACrC;;;;;;;;;;;;;OAaG;IACU,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,sBAAsB,GAAG,OAAO,CAAC,QAAQ,CAAC;IASjF,SAAS,CAAC,KAAK,EAAE,yBAAyB,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ9G,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,sBAAsB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAExG,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,yBAAyB,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;CACvH;AAED,OAAO,EAAE,wBAAwB,EAAE,CAAC;AACpC,YAAY,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,CAAC"}
@@ -0,0 +1,35 @@
1
+ class AbstractEntrypointWorker {
2
+ /**
3
+ * The HTTP request path.
4
+ *
5
+ * There is deliberately no `/__scheduled` branch here. It used to run before
6
+ * `onRequest`, which made `GET /__scheduled` an unauthenticated, un-rated
7
+ * trigger for the scheduled work: it bypassed the app's security headers, its
8
+ * request scope, and its rate limits, and any caller could fire the cron
9
+ * Durable Object on demand. `noRetry` was a `(): void => undefined` stub, so
10
+ * the retry semantics were lost too.
11
+ *
12
+ * Nothing needed it — `scheduled()` is wired through the platform by the
13
+ * `triggers.crons` entry in the wrangler config, which is how the cron
14
+ * actually runs.
15
+ */
16
+ async fetch(request, env, ctx) {
17
+ try {
18
+ return await this.onRequest(request, env, ctx);
19
+ }
20
+ catch (err) {
21
+ console.error('Unhandled error in fetch():', err);
22
+ return new Response('Internal Error', { status: 500 });
23
+ }
24
+ }
25
+ async scheduled(event, env, ctx) {
26
+ try {
27
+ await this.onScheduled(event, env, ctx);
28
+ }
29
+ catch (err) {
30
+ console.error('Unhandled error in scheduled():', err);
31
+ }
32
+ }
33
+ }
34
+ export { AbstractEntrypointWorker };
35
+ //# sourceMappingURL=AbstractEntrypointWorker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractEntrypointWorker.js","sourceRoot":"","sources":["../../src/base/AbstractEntrypointWorker.ts"],"names":[],"mappings":"AAmBA,MAAe,wBAAwB;IACrC;;;;;;;;;;;;;OAaG;IACI,KAAK,CAAC,KAAK,CAAC,OAAgB,EAAE,GAAQ,EAAE,GAA2B;QACxE,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACjD,CAAC;QAAC,OAAO,GAAY,EAAE,CAAC;YACtB,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;YAClD,OAAO,IAAI,QAAQ,CAAC,gBAAgB,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,KAAgC,EAAE,GAAQ,EAAE,GAA2B;QAC5F,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAC1C,CAAC;QAAC,OAAO,GAAY,EAAE,CAAC;YACtB,OAAO,CAAC,KAAK,CAAC,iCAAiC,EAAE,GAAG,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;CAKF;AAED,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { WorkerExecutionContext } from './AbstractEntrypointWorker';
2
+ /**
3
+ * The queue consumer base, converged verbatim from `AbstractQueueWorker.ts`
4
+ * (identical in Edge-Git and Mail-Otter; the only two repos with queue
5
+ * consumers).
6
+ *
7
+ * It rethrows after logging: a queue message that failed must be *retried* by
8
+ * the platform, and a base that swallowed the rejection would turn a transient
9
+ * handler failure into an acked, dropped message.
10
+ */
11
+ interface WorkerMessageBatch<T = unknown> {
12
+ messages: T[];
13
+ }
14
+ declare abstract class AbstractQueueWorker<T = unknown> {
15
+ queue(batch: WorkerMessageBatch<T>, env: Env, ctx: WorkerExecutionContext): Promise<void>;
16
+ protected abstract onQueue(batch: WorkerMessageBatch<T>, env: Env, ctx: WorkerExecutionContext): Promise<void>;
17
+ }
18
+ export { AbstractQueueWorker };
19
+ export type { WorkerMessageBatch };
20
+ //# sourceMappingURL=AbstractQueueWorker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractQueueWorker.d.ts","sourceRoot":"","sources":["../../src/base/AbstractQueueWorker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEzE;;;;;;;;GAQG;AACH,UAAU,kBAAkB,CAAC,CAAC,GAAG,OAAO;IACtC,QAAQ,EAAE,CAAC,EAAE,CAAC;CACf;AAED,uBAAe,mBAAmB,CAAC,CAAC,GAAG,OAAO;IAC/B,KAAK,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAStG,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;CAC/G;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAC/B,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
@@ -0,0 +1,13 @@
1
+ class AbstractQueueWorker {
2
+ async queue(batch, env, ctx) {
3
+ try {
4
+ await this.onQueue(batch, env, ctx);
5
+ }
6
+ catch (err) {
7
+ console.error('Unhandled error in queue():', err);
8
+ throw err;
9
+ }
10
+ }
11
+ }
12
+ export { AbstractQueueWorker };
13
+ //# sourceMappingURL=AbstractQueueWorker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractQueueWorker.js","sourceRoot":"","sources":["../../src/base/AbstractQueueWorker.ts"],"names":[],"mappings":"AAeA,MAAe,mBAAmB;IACzB,KAAK,CAAC,KAAK,CAAC,KAA4B,EAAE,GAAQ,EAAE,GAA2B;QACpF,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACtC,CAAC;QAAC,OAAO,GAAY,EAAE,CAAC;YACtB,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;YAClD,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;CAGF;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The Workflow base, converged verbatim from `AbstractWorkflowWorker.ts`
3
+ * (identical in Edge-Git and Mail-Otter; Edge-Sonic ships the same shape as
4
+ * `runWorkflow.ts` with a `WorkflowEntrypoint` wrapper around it).
5
+ *
6
+ * `WorkflowStepLike` is the minimal `step.do` surface: a workflow whose steps
7
+ * are not retried by the platform is just a coroutine, and the wrapper exists
8
+ * to keep the retry semantics visible in one place.
9
+ */
10
+ interface WorkflowEventLike<T = unknown> {
11
+ payload: T;
12
+ }
13
+ interface WorkflowStepLike {
14
+ do<T>(name: string, callback: () => Promise<T>): Promise<T>;
15
+ }
16
+ declare abstract class AbstractWorkflowWorker<TPayload = unknown, TResult = unknown> {
17
+ run(event: Readonly<WorkflowEventLike<TPayload>>, step: WorkflowStepLike): Promise<TResult>;
18
+ protected abstract onWorkflow(event: Readonly<WorkflowEventLike<TPayload>>, step: WorkflowStepLike): Promise<TResult>;
19
+ }
20
+ export { AbstractWorkflowWorker };
21
+ export type { WorkflowEventLike, WorkflowStepLike };
22
+ //# sourceMappingURL=AbstractWorkflowWorker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractWorkflowWorker.d.ts","sourceRoot":"","sources":["../../src/base/AbstractWorkflowWorker.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,UAAU,iBAAiB,CAAC,CAAC,GAAG,OAAO;IACrC,OAAO,EAAE,CAAC,CAAC;CACZ;AAED,UAAU,gBAAgB;IACxB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAC7D;AAED,uBAAe,sBAAsB,CAAC,QAAQ,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO;IAC5D,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IASxG,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;CACtH;AAED,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAClC,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,13 @@
1
+ class AbstractWorkflowWorker {
2
+ async run(event, step) {
3
+ try {
4
+ return await this.onWorkflow(event, step);
5
+ }
6
+ catch (err) {
7
+ console.error('Unhandled error in workflow run():', err);
8
+ throw err;
9
+ }
10
+ }
11
+ }
12
+ export { AbstractWorkflowWorker };
13
+ //# sourceMappingURL=AbstractWorkflowWorker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractWorkflowWorker.js","sourceRoot":"","sources":["../../src/base/AbstractWorkflowWorker.ts"],"names":[],"mappings":"AAiBA,MAAe,sBAAsB;IAC5B,KAAK,CAAC,GAAG,CAAC,KAA4C,EAAE,IAAsB;QACnF,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAC5C,CAAC;QAAC,OAAO,GAAY,EAAE,CAAC;YACtB,OAAO,CAAC,KAAK,CAAC,oCAAoC,EAAE,GAAG,CAAC,CAAC;YACzD,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;CAGF;AAED,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ export { AbstractEntrypointWorker } from './AbstractEntrypointWorker';
2
+ export type { WorkerExecutionContext, WorkerScheduledController } from './AbstractEntrypointWorker';
3
+ export { AbstractDurableObjectWorker } from './AbstractDurableObjectWorker';
4
+ export { AbstractQueueWorker } from './AbstractQueueWorker';
5
+ export type { WorkerMessageBatch } from './AbstractQueueWorker';
6
+ export { AbstractWorkflowWorker } from './AbstractWorkflowWorker';
7
+ export type { WorkflowEventLike, WorkflowStepLike } from './AbstractWorkflowWorker';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/base/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,YAAY,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACpG,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { AbstractEntrypointWorker } from './AbstractEntrypointWorker';
2
+ export { AbstractDurableObjectWorker } from './AbstractDurableObjectWorker';
3
+ export { AbstractQueueWorker } from './AbstractQueueWorker';
4
+ export { AbstractWorkflowWorker } from './AbstractWorkflowWorker';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/base/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * The base class every consumer's `AppConfiguration` extends.
3
+ *
4
+ * Converged from the six `config/AppConfiguration.ts` files and Mail-Meow's
5
+ * `config/AppConfig.ts` (the same class under a different name — consumers
6
+ * adapt to this one). The family's design — a thin facade over typed section
7
+ * objects, each owning one group of getters — is kept, minus the sections,
8
+ * which are per-project by nature: a consumer subclasses this and composes its
9
+ * own sections (limits, auth, replication …), each of which reads the env once
10
+ * through `EnvParser`.
11
+ *
12
+ * `validate()` returns warnings rather than throwing: a config typo must be a
13
+ * startup log line, not a 500 on a request path.
14
+ */
15
+ declare abstract class AppConfiguration {
16
+ protected readonly env: unknown;
17
+ protected constructor(env: unknown);
18
+ static fromEnv<T extends AppConfiguration>(this: new (env: unknown) => T, env: unknown): T;
19
+ /**
20
+ * The public origin, trailing slashes stripped. Callers concatenate paths
21
+ * onto it, so a trailing `/` would double them in every generated link.
22
+ */
23
+ getSiteUrl(): string;
24
+ /** The deployment stage this configuration believes itself in. */
25
+ getEnvironment(): string;
26
+ /**
27
+ * Warnings for suspicious settings, logged at startup. The base checks the
28
+ * one the whole family agrees on — a dev bypass left enabled in production;
29
+ * a subclass appends its own.
30
+ */
31
+ validate(): string[];
32
+ /** The raw env, for subclasses that need a key this base does not know. */
33
+ protected raw(): unknown;
34
+ }
35
+ export { AppConfiguration };
36
+ //# sourceMappingURL=AppConfiguration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppConfiguration.d.ts","sourceRoot":"","sources":["../../src/config/AppConfiguration.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AACH,uBAAe,gBAAgB;IACP,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,OAAO;IAArD,SAAS,aAAgC,GAAG,EAAE,OAAO;WAEvC,OAAO,CAAC,CAAC,SAAS,gBAAgB,EAAE,IAAI,EAAE,KAAK,GAAG,EAAE,OAAO,KAAK,CAAC,EAAE,GAAG,EAAE,OAAO,GAAG,CAAC;IAIjG;;;OAGG;IACI,UAAU,IAAI,MAAM;IAM3B,kEAAkE;IAC3D,cAAc,IAAI,MAAM;IAI/B;;;;OAIG;IACI,QAAQ,IAAI,MAAM,EAAE;IAc3B,2EAA2E;IAC3E,SAAS,CAAC,GAAG,IAAI,OAAO;CAGzB;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,63 @@
1
+ import { EnvParser } from './EnvParser';
2
+ import { DEFAULT_SITE_URL } from './ConfigurationDefaults';
3
+ /**
4
+ * The base class every consumer's `AppConfiguration` extends.
5
+ *
6
+ * Converged from the six `config/AppConfiguration.ts` files and Mail-Meow's
7
+ * `config/AppConfig.ts` (the same class under a different name — consumers
8
+ * adapt to this one). The family's design — a thin facade over typed section
9
+ * objects, each owning one group of getters — is kept, minus the sections,
10
+ * which are per-project by nature: a consumer subclasses this and composes its
11
+ * own sections (limits, auth, replication …), each of which reads the env once
12
+ * through `EnvParser`.
13
+ *
14
+ * `validate()` returns warnings rather than throwing: a config typo must be a
15
+ * startup log line, not a 500 on a request path.
16
+ */
17
+ class AppConfiguration {
18
+ env;
19
+ constructor(env) {
20
+ this.env = env;
21
+ }
22
+ static fromEnv(env) {
23
+ return new this(env);
24
+ }
25
+ /**
26
+ * The public origin, trailing slashes stripped. Callers concatenate paths
27
+ * onto it, so a trailing `/` would double them in every generated link.
28
+ */
29
+ getSiteUrl() {
30
+ let url = EnvParser.string(this.env, 'SITE_URL', DEFAULT_SITE_URL);
31
+ while (url.endsWith('/'))
32
+ url = url.slice(0, -1);
33
+ return url;
34
+ }
35
+ /** The deployment stage this configuration believes itself in. */
36
+ getEnvironment() {
37
+ return EnvParser.string(this.env, 'ENVIRONMENT', 'development');
38
+ }
39
+ /**
40
+ * Warnings for suspicious settings, logged at startup. The base checks the
41
+ * one the whole family agrees on — a dev bypass left enabled in production;
42
+ * a subclass appends its own.
43
+ */
44
+ validate() {
45
+ const warnings = [];
46
+ const environment = this.getEnvironment();
47
+ if (environment === 'production') {
48
+ if (EnvParser.boolean(this.env, 'DEMO_MODE', 'false')) {
49
+ warnings.push('DEMO_MODE is enabled in production — every request will bypass authentication.');
50
+ }
51
+ if (EnvParser.readString(this.env, 'DEV_AUTH_EMAIL') !== undefined) {
52
+ warnings.push('DEV_AUTH_EMAIL is set in production — a fixed identity can authenticate.');
53
+ }
54
+ }
55
+ return warnings;
56
+ }
57
+ /** The raw env, for subclasses that need a key this base does not know. */
58
+ raw() {
59
+ return this.env;
60
+ }
61
+ }
62
+ export { AppConfiguration };
63
+ //# sourceMappingURL=AppConfiguration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppConfiguration.js","sourceRoot":"","sources":["../../src/config/AppConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;;;;;;;;;;GAaG;AACH,MAAe,gBAAgB;IACY;IAAzC,YAAyC,GAAY;QAAZ,QAAG,GAAH,GAAG,CAAS;IAAG,CAAC;IAElD,MAAM,CAAC,OAAO,CAA4D,GAAY;QAC3F,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC;IAED;;;OAGG;IACI,UAAU;QACf,IAAI,GAAG,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,gBAAgB,CAAC,CAAC;QACnE,OAAO,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC;YAAE,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACjD,OAAO,GAAG,CAAC;IACb,CAAC;IAED,kEAAkE;IAC3D,cAAc;QACnB,OAAO,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC;IAClE,CAAC;IAED;;;;OAIG;IACI,QAAQ;QACb,MAAM,QAAQ,GAAa,EAAE,CAAC;QAC9B,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QAC1C,IAAI,WAAW,KAAK,YAAY,EAAE,CAAC;YACjC,IAAI,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,CAAC;gBACtD,QAAQ,CAAC,IAAI,CAAC,gFAAgF,CAAC,CAAC;YAClG,CAAC;YACD,IAAI,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,gBAAgB,CAAC,KAAK,SAAS,EAAE,CAAC;gBACnE,QAAQ,CAAC,IAAI,CAAC,0EAA0E,CAAC,CAAC;YAC5F,CAAC;QACH,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,2EAA2E;IACjE,GAAG;QACX,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;CACF;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Defaults shared by the family's configuration layers.
3
+ *
4
+ * Converged from `backend-runtime/src/config/ConfigurationDefaults.ts` (five
5
+ * repos) and the `ConfigurationManager` default table in the other four. Only
6
+ * the values every repo agrees on live here; a project-specific default belongs
7
+ * in that project's config section.
8
+ */
9
+ /** Used when `SITE_URL` is unset — the value that renders correct absolute links in tests. */
10
+ declare const DEFAULT_SITE_URL = "http://localhost:8787";
11
+ export { DEFAULT_SITE_URL };
12
+ //# sourceMappingURL=ConfigurationDefaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigurationDefaults.d.ts","sourceRoot":"","sources":["../../src/config/ConfigurationDefaults.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,8FAA8F;AAC9F,QAAA,MAAM,gBAAgB,0BAA0B,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Defaults shared by the family's configuration layers.
3
+ *
4
+ * Converged from `backend-runtime/src/config/ConfigurationDefaults.ts` (five
5
+ * repos) and the `ConfigurationManager` default table in the other four. Only
6
+ * the values every repo agrees on live here; a project-specific default belongs
7
+ * in that project's config section.
8
+ */
9
+ /** Used when `SITE_URL` is unset — the value that renders correct absolute links in tests. */
10
+ const DEFAULT_SITE_URL = 'http://localhost:8787';
11
+ export { DEFAULT_SITE_URL };
12
+ //# sourceMappingURL=ConfigurationDefaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigurationDefaults.js","sourceRoot":"","sources":["../../src/config/ConfigurationDefaults.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,8FAA8F;AAC9F,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Typed readers for a Worker `env` binding.
3
+ *
4
+ * Converged from `backend-runtime/src/config/EnvParser.ts` — effectively
5
+ * identical in all six repos that have the file (Mail-Meow/CalDAV-Bridge call
6
+ * their copy `ConfigurationManager` with the same three readers).
7
+ *
8
+ * The var table is `Record<string, string | undefined>` by contract: Cloudflare
9
+ * passes every binding as a string, so a reader that returned `number` for
10
+ * `MAX_*` would be inventing a parse that never happened. `boolean` is
11
+ * presence-of-"true", and anything else is `false` — never "absent means true".
12
+ */
13
+ declare class EnvParser {
14
+ static positiveInt(env: unknown, key: string, defaultValue: string): number;
15
+ /**
16
+ * Whether an explicitly-set numeric var is a usable positive integer.
17
+ *
18
+ * Used by `AppConfiguration.validate()` to *report* misconfiguration at
19
+ * startup while still running with the default. The throwing counterpart
20
+ * (`strictPositiveInt`) is gone: no caller opted in, and a fail-fast parse on
21
+ * a request path would turn a config typo into a 500 rather than a warning.
22
+ */
23
+ static isValidPositiveInt(env: unknown, key: string): boolean;
24
+ static string(env: unknown, key: string, defaultValue: string): string;
25
+ static boolean(env: unknown, key: string, defaultValue: string): boolean;
26
+ /** The raw value, or undefined when unset. Public because presence checks (validate) need it. */
27
+ static readString(env: unknown, key: string): string | undefined;
28
+ }
29
+ export { EnvParser };
30
+ //# sourceMappingURL=EnvParser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnvParser.d.ts","sourceRoot":"","sources":["../../src/config/EnvParser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,cAAM,SAAS;WACC,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM;IAMlF;;;;;;;OAOG;WACW,kBAAkB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;WAOtD,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM;WAI/D,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO;IAI/E,iGAAiG;WACnF,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAGxE;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Typed readers for a Worker `env` binding.
3
+ *
4
+ * Converged from `backend-runtime/src/config/EnvParser.ts` — effectively
5
+ * identical in all six repos that have the file (Mail-Meow/CalDAV-Bridge call
6
+ * their copy `ConfigurationManager` with the same three readers).
7
+ *
8
+ * The var table is `Record<string, string | undefined>` by contract: Cloudflare
9
+ * passes every binding as a string, so a reader that returned `number` for
10
+ * `MAX_*` would be inventing a parse that never happened. `boolean` is
11
+ * presence-of-"true", and anything else is `false` — never "absent means true".
12
+ */
13
+ class EnvParser {
14
+ static positiveInt(env, key, defaultValue) {
15
+ const value = this.readString(env, key);
16
+ const parsed = Number(value ?? defaultValue);
17
+ return Number.isSafeInteger(parsed) && parsed > 0 ? parsed : Number(defaultValue);
18
+ }
19
+ /**
20
+ * Whether an explicitly-set numeric var is a usable positive integer.
21
+ *
22
+ * Used by `AppConfiguration.validate()` to *report* misconfiguration at
23
+ * startup while still running with the default. The throwing counterpart
24
+ * (`strictPositiveInt`) is gone: no caller opted in, and a fail-fast parse on
25
+ * a request path would turn a config typo into a 500 rather than a warning.
26
+ */
27
+ static isValidPositiveInt(env, key) {
28
+ const value = this.readString(env, key);
29
+ if (value === undefined)
30
+ return true;
31
+ const parsed = Number(value);
32
+ return Number.isSafeInteger(parsed) && parsed > 0;
33
+ }
34
+ static string(env, key, defaultValue) {
35
+ return this.readString(env, key) ?? defaultValue;
36
+ }
37
+ static boolean(env, key, defaultValue) {
38
+ return (this.readString(env, key) ?? defaultValue) === 'true';
39
+ }
40
+ /** The raw value, or undefined when unset. Public because presence checks (validate) need it. */
41
+ static readString(env, key) {
42
+ return env[key];
43
+ }
44
+ }
45
+ export { EnvParser };
46
+ //# sourceMappingURL=EnvParser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnvParser.js","sourceRoot":"","sources":["../../src/config/EnvParser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,SAAS;IACN,MAAM,CAAC,WAAW,CAAC,GAAY,EAAE,GAAW,EAAE,YAAoB;QACvE,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACxC,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,IAAI,YAAY,CAAC,CAAC;QAC7C,OAAO,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACpF,CAAC;IAED;;;;;;;OAOG;IACI,MAAM,CAAC,kBAAkB,CAAC,GAAY,EAAE,GAAW;QACxD,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACxC,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC;QACrC,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7B,OAAO,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC;IACpD,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,GAAY,EAAE,GAAW,EAAE,YAAoB;QAClE,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,YAAY,CAAC;IACnD,CAAC;IAEM,MAAM,CAAC,OAAO,CAAC,GAAY,EAAE,GAAW,EAAE,YAAoB;QACnE,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,YAAY,CAAC,KAAK,MAAM,CAAC;IAChE,CAAC;IAED,iGAAiG;IAC1F,MAAM,CAAC,UAAU,CAAC,GAAY,EAAE,GAAW;QAChD,OAAQ,GAA0C,CAAC,GAAG,CAAC,CAAC;IAC1D,CAAC;CACF;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { AppConfiguration } from './AppConfiguration';
2
+ export { EnvParser } from './EnvParser';
3
+ export { DEFAULT_SITE_URL } from './ConfigurationDefaults';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { AppConfiguration } from './AppConfiguration';
2
+ export { EnvParser } from './EnvParser';
3
+ export { DEFAULT_SITE_URL } from './ConfigurationDefaults';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * The dependency-injection container.
3
+ *
4
+ * Converged verbatim from `backend-runtime/src/di/Container.ts` — the file is
5
+ * byte-identical (modulo scope) across all nine full-framework consumer repos,
6
+ * because the last divergence in it was fixed in all of them at once.
7
+ *
8
+ * Minimal by design: factory + singleton scopes, branded tokens for inference,
9
+ * nothing else. A DI container that grows features grows coupling with it.
10
+ */
11
+ type Factory<T> = (container: Container) => T;
12
+ /**
13
+ * Branded token so `scope.get(Tokens.X)` infers `X` without an explicit generic
14
+ * at call sites. The brand is optional (and `unknown`-compatible) so
15
+ * `Token<Service>` remains assignable to `Token<unknown>` for Map storage.
16
+ */
17
+ type Token<T = unknown> = (string | symbol) & {
18
+ readonly __type?: T;
19
+ };
20
+ /**
21
+ * Composition roots (a request scope, a cron entrypoint, tests) wire concrete
22
+ * implementations once; handlers resolve via `scope.get(Tokens.X)`. Prefer
23
+ * constructor injection of ports at registration time over inline
24
+ * `scope.get()` in business logic.
25
+ */
26
+ declare class Container {
27
+ private readonly factories;
28
+ private readonly singletons;
29
+ bind<T>(token: Token<T>, factory: Factory<T>): this;
30
+ bindValue<T>(token: Token<T>, value: T): this;
31
+ /**
32
+ * Is a token bound (as a value or a factory)? Used to assert wiring.
33
+ */
34
+ has<T>(token: Token<T>): boolean;
35
+ get<T>(token: Token<T>): T;
36
+ }
37
+ export { Container };
38
+ export type { Factory, Token };
39
+ //# sourceMappingURL=Container.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../src/di/Container.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,KAAK,CAAC,CAAC;AAE9C;;;;GAIG;AACH,KAAK,KAAK,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;CAAE,CAAC;AAEtE;;;;;GAKG;AACH,cAAM,SAAS;IACb,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA+C;IAEzE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAsC;IAE1D,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI;IAKnD,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAKpD;;OAEG;IACI,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO;IAIhC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;CAYlC;AAED,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC"}