@venizia/ignis-worker 0.2.2 → 0.3.1

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 (121) hide show
  1. package/dist/cjs/applications/common/index.d.ts +0 -1
  2. package/dist/cjs/applications/common/index.js.map +1 -1
  3. package/dist/cjs/applications/common/types.d.ts +0 -1
  4. package/dist/cjs/applications/common/types.js.map +1 -1
  5. package/dist/cjs/applications/index.d.ts +0 -1
  6. package/dist/cjs/applications/index.js.map +1 -1
  7. package/dist/cjs/applications/worker.d.ts +0 -1
  8. package/dist/cjs/applications/worker.js.map +1 -1
  9. package/dist/cjs/envelope/common/index.d.ts +0 -1
  10. package/dist/cjs/envelope/common/index.js.map +1 -1
  11. package/dist/cjs/envelope/common/types.d.ts +0 -1
  12. package/dist/cjs/envelope/common/types.js.map +1 -1
  13. package/dist/cjs/envelope/encode.d.ts +0 -1
  14. package/dist/cjs/envelope/encode.js.map +1 -1
  15. package/dist/cjs/envelope/index.d.ts +0 -1
  16. package/dist/cjs/envelope/index.js.map +1 -1
  17. package/dist/cjs/index.d.ts +0 -1
  18. package/dist/cjs/index.js.map +1 -1
  19. package/dist/cjs/transport/common/index.d.ts +0 -1
  20. package/dist/cjs/transport/common/index.js.map +1 -1
  21. package/dist/cjs/transport/common/types.d.ts +0 -1
  22. package/dist/cjs/transport/common/types.js.map +1 -1
  23. package/dist/cjs/transport/fetch-bridge.d.ts +0 -1
  24. package/dist/cjs/transport/fetch-bridge.js.map +1 -1
  25. package/dist/cjs/transport/in-process.d.ts +0 -1
  26. package/dist/cjs/transport/in-process.js.map +1 -1
  27. package/dist/cjs/transport/index.d.ts +0 -1
  28. package/dist/cjs/transport/index.js.map +1 -1
  29. package/dist/cjs/transport/shared/common/constants.d.ts +0 -1
  30. package/dist/cjs/transport/shared/common/constants.js.map +1 -1
  31. package/dist/cjs/transport/shared/common/index.d.ts +0 -1
  32. package/dist/cjs/transport/shared/common/index.js.map +1 -1
  33. package/dist/cjs/transport/shared/common/types.d.ts +0 -1
  34. package/dist/cjs/transport/shared/common/types.js.map +1 -1
  35. package/dist/cjs/transport/shared/index.d.ts +0 -1
  36. package/dist/cjs/transport/shared/index.js.map +1 -1
  37. package/dist/cjs/transport/shared/transport.d.ts +0 -1
  38. package/dist/cjs/transport/shared/transport.js.map +1 -1
  39. package/dist/cjs/transport/worker.d.ts +0 -1
  40. package/dist/cjs/transport/worker.js.map +1 -1
  41. package/dist/esm/applications/common/index.d.ts +0 -1
  42. package/dist/esm/applications/common/index.js.map +1 -1
  43. package/dist/esm/applications/common/types.d.ts +0 -1
  44. package/dist/esm/applications/common/types.js.map +1 -1
  45. package/dist/esm/applications/index.d.ts +0 -1
  46. package/dist/esm/applications/index.js.map +1 -1
  47. package/dist/esm/applications/worker.d.ts +0 -1
  48. package/dist/esm/applications/worker.js.map +1 -1
  49. package/dist/esm/envelope/common/index.d.ts +0 -1
  50. package/dist/esm/envelope/common/index.js.map +1 -1
  51. package/dist/esm/envelope/common/types.d.ts +0 -1
  52. package/dist/esm/envelope/common/types.js.map +1 -1
  53. package/dist/esm/envelope/encode.d.ts +0 -1
  54. package/dist/esm/envelope/encode.js.map +1 -1
  55. package/dist/esm/envelope/index.d.ts +0 -1
  56. package/dist/esm/envelope/index.js.map +1 -1
  57. package/dist/esm/index.d.ts +0 -1
  58. package/dist/esm/index.js.map +1 -1
  59. package/dist/esm/transport/common/index.d.ts +0 -1
  60. package/dist/esm/transport/common/index.js.map +1 -1
  61. package/dist/esm/transport/common/types.d.ts +0 -1
  62. package/dist/esm/transport/common/types.js.map +1 -1
  63. package/dist/esm/transport/fetch-bridge.d.ts +0 -1
  64. package/dist/esm/transport/fetch-bridge.js.map +1 -1
  65. package/dist/esm/transport/in-process.d.ts +0 -1
  66. package/dist/esm/transport/in-process.js.map +1 -1
  67. package/dist/esm/transport/index.d.ts +0 -1
  68. package/dist/esm/transport/index.js.map +1 -1
  69. package/dist/esm/transport/shared/common/constants.d.ts +0 -1
  70. package/dist/esm/transport/shared/common/constants.js.map +1 -1
  71. package/dist/esm/transport/shared/common/index.d.ts +0 -1
  72. package/dist/esm/transport/shared/common/index.js.map +1 -1
  73. package/dist/esm/transport/shared/common/types.d.ts +0 -1
  74. package/dist/esm/transport/shared/common/types.js.map +1 -1
  75. package/dist/esm/transport/shared/index.d.ts +0 -1
  76. package/dist/esm/transport/shared/index.js.map +1 -1
  77. package/dist/esm/transport/shared/transport.d.ts +0 -1
  78. package/dist/esm/transport/shared/transport.js.map +1 -1
  79. package/dist/esm/transport/worker.d.ts +0 -1
  80. package/dist/esm/transport/worker.js.map +1 -1
  81. package/package.json +4 -4
  82. package/dist/cjs/applications/common/index.d.ts.map +0 -1
  83. package/dist/cjs/applications/common/types.d.ts.map +0 -1
  84. package/dist/cjs/applications/index.d.ts.map +0 -1
  85. package/dist/cjs/applications/worker.d.ts.map +0 -1
  86. package/dist/cjs/envelope/common/index.d.ts.map +0 -1
  87. package/dist/cjs/envelope/common/types.d.ts.map +0 -1
  88. package/dist/cjs/envelope/encode.d.ts.map +0 -1
  89. package/dist/cjs/envelope/index.d.ts.map +0 -1
  90. package/dist/cjs/index.d.ts.map +0 -1
  91. package/dist/cjs/transport/common/index.d.ts.map +0 -1
  92. package/dist/cjs/transport/common/types.d.ts.map +0 -1
  93. package/dist/cjs/transport/fetch-bridge.d.ts.map +0 -1
  94. package/dist/cjs/transport/in-process.d.ts.map +0 -1
  95. package/dist/cjs/transport/index.d.ts.map +0 -1
  96. package/dist/cjs/transport/shared/common/constants.d.ts.map +0 -1
  97. package/dist/cjs/transport/shared/common/index.d.ts.map +0 -1
  98. package/dist/cjs/transport/shared/common/types.d.ts.map +0 -1
  99. package/dist/cjs/transport/shared/index.d.ts.map +0 -1
  100. package/dist/cjs/transport/shared/transport.d.ts.map +0 -1
  101. package/dist/cjs/transport/worker.d.ts.map +0 -1
  102. package/dist/esm/applications/common/index.d.ts.map +0 -1
  103. package/dist/esm/applications/common/types.d.ts.map +0 -1
  104. package/dist/esm/applications/index.d.ts.map +0 -1
  105. package/dist/esm/applications/worker.d.ts.map +0 -1
  106. package/dist/esm/envelope/common/index.d.ts.map +0 -1
  107. package/dist/esm/envelope/common/types.d.ts.map +0 -1
  108. package/dist/esm/envelope/encode.d.ts.map +0 -1
  109. package/dist/esm/envelope/index.d.ts.map +0 -1
  110. package/dist/esm/index.d.ts.map +0 -1
  111. package/dist/esm/transport/common/index.d.ts.map +0 -1
  112. package/dist/esm/transport/common/types.d.ts.map +0 -1
  113. package/dist/esm/transport/fetch-bridge.d.ts.map +0 -1
  114. package/dist/esm/transport/in-process.d.ts.map +0 -1
  115. package/dist/esm/transport/index.d.ts.map +0 -1
  116. package/dist/esm/transport/shared/common/constants.d.ts.map +0 -1
  117. package/dist/esm/transport/shared/common/index.d.ts.map +0 -1
  118. package/dist/esm/transport/shared/common/types.d.ts.map +0 -1
  119. package/dist/esm/transport/shared/index.d.ts.map +0 -1
  120. package/dist/esm/transport/shared/transport.d.ts.map +0 -1
  121. package/dist/esm/transport/worker.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"worker.js","sourceRoot":"","sources":["../../../src/applications/worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAiBhD;;;;;GAKG;AACH,MAAM,OAAgB,iBAIpB,SAAQ,eAA4C;IAJtD;;QAaU,cAAS,GAAG,KAAK,CAAC;IA0N5B,CAAC;IAxNC;;;;;;;OAOG;IACM,cAAc;QACrB,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,IAAI,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,IAAI,EA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AC,SAAS,GAAG,IAAI,CAAC;QAEtB,IAAI,CAAC,eAAe,EAAE,EAAE,CAAC;QACzB,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;QAEjC,MAAM,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAClC,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAE9B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;IACrE,CAAC;CACF","sourcesContent":["import { getError, ProjectRootRegistry } from '@venizia/ignis-helpers/core';\nimport { HTTP } from '@venizia/ignis-helpers/common';\nimport { CoreBindings, RestApplication } from '@venizia/ignis-kernel';\nimport type { Env, Schema } from 'hono';\nimport { BffEnvelope } from '@/envelope/encode';\nimport type { IBffRequestEnvelope, IBffResponseEnvelope } from '@/envelope/common';\nimport type { IWorkerApplicationConfigs } from './common';\n\n/**\n * Structural shape of the two globals `listen()` can attach to. Never `DedicatedWorkerGlobalScope`:\n * naming it emits it into the published `.d.ts` and forces every consumer to compile with\n * `lib.webworker`. `start` is optional because a `MessagePort`s queue starts disabled and only\n * `start()` enables it, while a worker global scope has no such method at all.\n */\nexport interface IWorkerMessageScope {\n postMessage(message: unknown, transfer?: Array<ArrayBuffer | MessagePort>): void;\n addEventListener(type: 'message', listener: (event: MessageEvent) => void): void;\n removeEventListener?(type: 'message', listener: (event: MessageEvent) => void): void;\n start?(): void;\n}\n\n/**\n * Runs an IGNIS application inside a browser Web Worker: `listen()` replaces what\n * `ServerApplication.start()` does with a socket, attaching `onmessage` instead. Gets REST\n * controller registration by inheritance - `RestApplication.registerControllers()` - the whole\n * reason the DI helpers and `RestComponent` sit in the kernel.\n */\nexport abstract class WorkerApplication<\n AppEnv extends Env = Env,\n AppSchema extends Schema = {},\n BasePath extends string = '/',\n> extends RestApplication<AppEnv, AppSchema, BasePath> {\n /** Widened by this layer, the only one with an optional `projectRoot` to read. Assigned by the base constructor - `declare` so no field initializer runs here and overwrites it with `undefined`. */\n declare protected configs: IWorkerApplicationConfigs;\n\n /** Resolves once the router tree is mounted - what an envelope arriving during boot waits on. */\n private servingPromise?: Promise<void>;\n /** The whole `listen()` call, kept so a second one is a no-op instead of a second listener. */\n private listenPromise?: Promise<void>;\n private detachFromScope?: () => void;\n private isStopped = false;\n\n /**\n * `configs.projectRoot` wins, else the host's own working directory - read as\n * `globalThis.process?.cwd?.()`, never a bare `process.cwd()`, because a real browser Worker has no\n * such global and this class ships there. Bound AND shared with `ModuleUtility` (through the\n * purity-safe `ProjectRootRegistry`), the same seam `ServerApplication` gives a socket host. No\n * `node_modules` check here, unlike that host: a browser has no filesystem to check, and `node:fs`\n * would bundle a Node builtin straight into a Worker.\n */\n override getProjectRoot(): string {\n const projectRoot = this.configs.projectRoot ?? globalThis.process?.cwd?.() ?? '';\n\n this.bind<string>({ key: CoreBindings.APPLICATION_PROJECT_ROOT }).toValue(projectRoot);\n ProjectRootRegistry.set({ projectRoot });\n\n return projectRoot;\n }\n\n /**\n * Every failure here is posted back as an `IBffErrorEnvelope`, the failed `postMessage` included:\n * an exception nobody posts leaves the UI waiting out the transport timeout.\n */\n private async handleMessage(opts: {\n scope: MessagePort | IWorkerMessageScope;\n envelope: IBffRequestEnvelope;\n }): Promise<void> {\n const { scope, envelope } = opts;\n const logger = this.logger.for(this.handleMessage.name);\n\n let responseEnvelope: IBffResponseEnvelope | undefined;\n let failure: unknown;\n\n try {\n const request = BffEnvelope.decodeRequest({ envelope });\n const response = await this.getServer().fetch(request);\n responseEnvelope = await BffEnvelope.encodeResponse({ response, id: envelope.id });\n } catch (error) {\n logger.error('Failed to handle worker message | id: %s | error: %s', envelope.id, error);\n failure = error;\n }\n\n if (responseEnvelope) {\n try {\n scope.postMessage(responseEnvelope, responseEnvelope.body ? [responseEnvelope.body] : []);\n return;\n } catch (postError) {\n logger.error(\n 'Failed to post response back to scope, falling back to an error envelope | id: %s | error: %s',\n envelope.id,\n postError,\n );\n failure = postError;\n }\n }\n\n this.postErrorEnvelope({ scope, id: envelope.id, error: failure });\n }\n\n /** No transfer list: an error envelope carries no `ArrayBuffer` body, and this is already the fallback path - nothing left to hand off if this post fails too. */\n private postErrorEnvelope(opts: {\n scope: MessagePort | IWorkerMessageScope;\n id: string;\n error: unknown;\n }): void {\n const { scope, id, error } = opts;\n\n try {\n scope.postMessage(BffEnvelope.encodeError({ id, error }));\n } catch (postError) {\n this.logger\n .for(this.postErrorEnvelope.name)\n .error('Failed to post error envelope back to scope | id: %s | error: %s', id, postError);\n }\n }\n\n /** Everything `ServerApplication.start()` does short of binding a socket. Once this resolves the application answers requests. */\n private async startServing(): Promise<void> {\n // The stack itself is `RestApplication.registerDefaultMiddlewares()` - a BFF must answer with\n // the framework's envelope exactly as the server does, so it adds nothing and overrides nothing.\n await this.registerDefaultMiddlewares();\n\n await this.initialize();\n await this.setupMiddlewares();\n\n this.getServer().route(this.configs.path.base, this.rootRouter);\n }\n\n /**\n * Holds an envelope until the application is serving. A dedicated worker's queue is enabled when\n * its module script is evaluated, so anything posted during boot - PGlite takes ~350ms - reaches\n * this listener and would otherwise be dropped. One shared promise also hands them on in arrival\n * order.\n */\n private async dispatchMessage(opts: {\n scope: MessagePort | IWorkerMessageScope;\n envelope: IBffRequestEnvelope;\n }): Promise<void> {\n const { scope, envelope } = opts;\n const logger = this.logger.for(this.dispatchMessage.name);\n\n try {\n await this.servingPromise;\n } catch (error) {\n logger.error(\n 'The application failed to start, answering with an error envelope | id: %s | error: %s',\n envelope.id,\n error,\n );\n this.postErrorEnvelope({ scope, id: envelope.id, error });\n return;\n }\n\n // Answered, not dropped: a request admitted before `stop()` and still waiting on the boot has\n // a caller holding a promise, and silence there is the timeout this whole path exists to avoid.\n if (this.isStopped) {\n logger.warn('Refusing a request that arrived after stop() | id: %s', envelope.id);\n this.postErrorEnvelope({\n scope,\n id: envelope.id,\n error: getError({\n statusCode: HTTP.ResultCodes.RS_5.ServiceUnavailable,\n message: `[WorkerApplication] The application was stopped before this request could run | id: ${envelope.id}`,\n }),\n });\n return;\n }\n\n await this.handleMessage({ scope, envelope });\n }\n\n private attachTo(opts: { scope: MessagePort | IWorkerMessageScope }): void {\n const { scope } = opts;\n const logger = this.logger.for(this.attachTo.name);\n\n // Typed as the broader `Event`, not `MessageEvent`: Node's ambient `worker_threads.MessagePort`\n // (the fallback this package's DOM-less tsconfig resolves `MessagePort` to) declares\n // `addEventListener` over `Event | MessageEvent`, and a handler narrower than that is not\n // assignable to it.\n const listener = (event: Event): void => {\n const envelope = (event as MessageEvent).data as IBffRequestEnvelope | undefined;\n\n // A worker scope receives every `postMessage` sent to it, not only ours - a dev-server ping,\n // a devtools/extension probe, a library's own init handshake. None of those carry an `id`;\n // silently dropping them (rather than dereferencing `envelope.id` inside `handleMessage`'s\n // own catch block) is what keeps a foreign message from throwing a bare `TypeError` that\n // would otherwise escape this listener entirely, unlogged and unposted.\n if (!envelope?.id) {\n logger.debug('Ignoring worker message with no request id | data: %j', envelope);\n return;\n }\n\n // `dispatchMessage` never rejects - every failure inside it, including a failed post, is\n // caught and handled internally. This `.catch` only guards the sliver of code before its own\n // try block ever runs.\n this.dispatchMessage({ scope, envelope }).catch(error => {\n logger.error('Unexpected failure handling worker message | error: %s', error);\n });\n };\n\n scope.addEventListener('message', listener);\n\n scope.start?.();\n\n this.detachFromScope = () => {\n scope.removeEventListener?.('message', listener);\n };\n }\n\n /**\n * `ServerApplication.start()` minus the socket. `opts.scope` defaults to `globalThis`, never a\n * bare `self`, which would tie the published types to `lib.webworker`. Idempotent: without the\n * guard one envelope runs its handler once per call - a POST inserting two rows - and Vite HMR\n * re-evaluating the worker module is the everyday trigger. A boot failure keeps the listener\n * attached so every request hears the failure instead of waiting out the transport timeout.\n */\n async listen(opts?: { scope?: MessagePort | IWorkerMessageScope }): Promise<void> {\n if (this.listenPromise) {\n this.logger\n .for(this.listen.name)\n .warn('Already listening - ignoring this call | one scope, one listener');\n return this.listenPromise;\n }\n\n // Everything down to the first `await` runs synchronously with the caller, which is what makes\n // the listener observable to anything posted in the same turn.\n const scope: MessagePort | IWorkerMessageScope =\n opts?.scope ?? (globalThis as IWorkerMessageScope);\n\n this.attachTo({ scope });\n\n this.servingPromise = this.startServing();\n this.listenPromise = this.servingPromise.then(() => this.executePostStartHooks());\n\n return this.listenPromise;\n }\n\n /**\n * The counterpart to `listen()`, and to `ServerApplication.stop()`: runs the post-stop hooks, then\n * closes every datasource the boot configured. Without it the OPFS exclusive lock a PGlite holds\n * is never released - the next Worker then fails with `NoModificationAllowedError` until a full\n * page reload. The Vite recipe is `import.meta.hot?.dispose(() => application.stop())`.\n *\n * Detaches BEFORE draining, unlike the server: here the listener IS the socket, and a request\n * admitted while a datasource is closing has nothing left to run against. A stopped application\n * is not restartable - build a new one.\n */\n async stop(): Promise<void> {\n this.isStopped = true;\n\n this.detachFromScope?.();\n this.detachFromScope = undefined;\n\n await this.executePostStopHooks();\n await this.closeDataSources();\n\n this.logger.for(this.stop.name).info('Worker application STOPPED');\n }\n}\n"]}
@@ -1,2 +1 @@
1
1
  export * from './types.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/envelope/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/envelope/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC","sourcesContent":["export * from './types';\n"]}
@@ -34,4 +34,3 @@ export interface IBffErrorEnvelope {
34
34
  args?: unknown;
35
35
  };
36
36
  }
37
- //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/envelope/common/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/envelope/common/types.ts"],"names":[],"mappings":"","sourcesContent":["/** Headers are carried as tuples: a `Headers` instance is not structured-cloneable. */\nexport type TEnvelopeHeaders = Array<[string, string]>;\n\nexport interface IBffRequestEnvelope {\n id: string;\n method: string;\n url: string;\n headers: TEnvelopeHeaders;\n /** Buffered, never a stream - `ReadableStream` does not transfer in Safari. */\n body?: ArrayBuffer;\n}\n\nexport interface IBffResponseEnvelope {\n id: string;\n status: number;\n statusText?: string;\n headers: TEnvelopeHeaders;\n body?: ArrayBuffer;\n}\n\n/**\n * A custom `Error` subclass loses its name, its own properties and its prototype through structured\n * clone, so an `ApplicationError` cannot cross as itself. It crosses as its normalised shape and is\n * rebuilt with `fromError` on the far side.\n */\nexport interface IBffErrorEnvelope {\n id: string;\n /**\n * Carried explicitly, because `fromError` defaults a missing one to 400. This envelope is only\n * ever produced when something escaped Hono's `onError` - the 500-class failures a UI must not\n * classify as its own bad request.\n */\n statusCode: number;\n error: { text: string; code?: string; args?: unknown };\n}\n"]}
@@ -58,4 +58,3 @@ export declare class BffEnvelope {
58
58
  envelope: IBffErrorEnvelope;
59
59
  }): ApplicationError;
60
60
  }
61
- //# sourceMappingURL=encode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"encode.js","sourceRoot":"","sources":["../../../src/envelope/encode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtF,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAGrD;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAE5D,+IAA+I;AAC/I,MAAM,OAAO,WAAW;IACtB;;;OAGG;aACqB,uBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IAEtE;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,IAAqB;QACzC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;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;QAE1B,OAAO,SAAS,CAAC;YACf,KAAK,EAAE;gBACL,UAAU,EAAE,QAAQ,CAAC,UAAU;gBAC/B,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI;oBACzB,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI;oBACzB,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,IAA2C;iBACjE;aACF;SACF,CAAC,CAAC;IACL,CAAC","sourcesContent":["import type { ApplicationError } from '@venizia/ignis-helpers/core';\nimport { fromError, getError, isApplicationError } from '@venizia/ignis-helpers/core';\nimport { HTTP } from '@venizia/ignis-helpers/common';\nimport type { IBffErrorEnvelope, IBffRequestEnvelope, IBffResponseEnvelope } from './common';\n\n/**\n * Every request built inside the Worker uses this origin. Never `self.location.href`: a `blob:`\n * worker origin is opaque and `new URL(path, blobUrl)` throws, and Hono's `getPath()` mis-parses\n * `file://`. Hono never resolves the host - it string-scans from `indexOf(':') + 4`.\n */\nexport const BFF_SYNTHETIC_ORIGIN = 'http://ignis.internal';\n\n/** Turns `Request`/`Response`/`Error` into plain structured-cloneable shapes and back - none of the three survives `postMessage` as itself. */\nexport class BffEnvelope {\n /**\n * Statuses the Fetch spec forbids a body on - `new Response(body, { status })` throws if `body`\n * is anything but `null` for one of these, even an empty `ArrayBuffer`.\n */\n private static readonly NULL_BODY_STATUSES = new Set([204, 205, 304]);\n\n /**\n * Moves a URL onto the synthetic origin, keeping everything below it. A caller builds a request\n * against the page's real origin (or a relative path resolved against it); `decodeRequest` on the\n * far side always reconstructs on `BFF_SYNTHETIC_ORIGIN`.\n */\n static toSyntheticUrl(opts: { url: string }): string {\n const url = new URL(opts.url);\n return `${BFF_SYNTHETIC_ORIGIN}${url.pathname}${url.search}${url.hash}`;\n }\n\n /**\n * `url` overrides the request's own, so the origin rewrite costs nothing: rebuilding the `Request`\n * to change its URL would read the body a second time, and a 10 MB upload would hold 20 MB on the\n * UI thread. Reading the body here disturbs the caller's request exactly as `globalThis.fetch`\n * does with the one it is handed.\n */\n static async encodeRequest(opts: {\n request: Request;\n id: string;\n url?: string;\n }): Promise<IBffRequestEnvelope> {\n const { request, id, url } = opts;\n const hasBody = request.method !== 'GET' && request.method !== 'HEAD';\n\n return {\n id,\n method: request.method,\n url: url ?? request.url,\n headers: [...request.headers.entries()],\n body: hasBody ? await request.arrayBuffer() : undefined,\n };\n }\n\n static decodeRequest(opts: { envelope: IBffRequestEnvelope }): Request {\n const { envelope } = opts;\n\n return new Request(envelope.url, {\n method: envelope.method,\n headers: envelope.headers,\n body: envelope.body,\n });\n }\n\n static async encodeResponse(opts: {\n response: Response;\n id: string;\n }): Promise<IBffResponseEnvelope> {\n const { response, id } = opts;\n const hasBody = !BffEnvelope.NULL_BODY_STATUSES.has(response.status);\n\n return {\n id,\n status: response.status,\n statusText: response.statusText,\n headers: [...response.headers.entries()],\n body: hasBody ? await response.arrayBuffer() : undefined,\n };\n }\n\n static decodeResponse(opts: { envelope: IBffResponseEnvelope }): Response {\n const { envelope } = opts;\n const body = BffEnvelope.NULL_BODY_STATUSES.has(envelope.status)\n ? null\n : (envelope.body ?? null);\n\n return new Response(body, {\n status: envelope.status,\n statusText: envelope.statusText,\n headers: envelope.headers,\n });\n }\n\n /**\n * Builds the shape an error crosses `postMessage` as. An `ApplicationError` cannot cross as itself\n * - a custom `Error` subclass loses its name, its own properties and its prototype through\n * structured clone - so it crosses normalised and `decodeError` rebuilds it on the far side.\n *\n * A foreign error gets `500`, matching what the framework's error middleware gives an UNEXPECTED\n * one on the server. Anything reaching here already escaped the whole HTTP layer.\n */\n static encodeError(opts: { id: string; error: unknown }): IBffErrorEnvelope {\n const { id, error } = opts;\n const applicationError = isApplicationError(error)\n ? error\n : getError({\n statusCode: HTTP.ResultCodes.RS_5.InternalServerError,\n message: error instanceof Error ? error.message : String(error),\n });\n\n return {\n id,\n statusCode: applicationError.statusCode,\n error: {\n text: applicationError.normalized.text,\n code: applicationError.normalized.code,\n args: applicationError.normalized.args,\n },\n };\n }\n\n static decodeError(opts: { envelope: IBffErrorEnvelope }): ApplicationError {\n const { envelope } = opts;\n\n return fromError({\n error: {\n statusCode: envelope.statusCode,\n normalized: {\n text: envelope.error.text,\n code: envelope.error.code,\n args: envelope.error.args as Record<string, unknown> | undefined,\n },\n },\n });\n }\n}\n"]}
@@ -1,3 +1,2 @@
1
1
  export * from './common/index.js';
2
2
  export * from './encode.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/envelope/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/envelope/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC","sourcesContent":["export * from './common';\nexport * from './encode';\n"]}
@@ -2,4 +2,3 @@ import 'reflect-metadata';
2
2
  export * from './applications/index.js';
3
3
  export * from './envelope/index.js';
4
4
  export * from './transport/index.js';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC","sourcesContent":["import 'reflect-metadata';\n\nexport * from './applications';\nexport * from './envelope';\nexport * from './transport';\n"]}
@@ -1,2 +1 @@
1
1
  export * from './types.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/transport/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/transport/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC","sourcesContent":["export * from './types';\n"]}
@@ -3,4 +3,3 @@ export interface IBffTransport {
3
3
  request: Request;
4
4
  }): Promise<Response>;
5
5
  }
6
- //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/transport/common/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/transport/common/types.ts"],"names":[],"mappings":"","sourcesContent":["export interface IBffTransport {\n fetch(opts: { request: Request }): Promise<Response>;\n}\n"]}
@@ -38,4 +38,3 @@ export interface IInstallBffFetchOptions {
38
38
  */
39
39
  export declare const installBffFetch: (opts: IInstallBffFetchOptions) => (() => void);
40
40
  export {};
41
- //# sourceMappingURL=fetch-bridge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetch-bridge.js","sourceRoot":"","sources":["../../../src/transport/fetch-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAGvD;;;GAGG;AACH,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;AA2BpE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,iBAAiB,GAAG,CAAC,KAAwB,EAAU,EAAE;IAC7D,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,IAAI,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC;IACxD,CAAC;IAED,IAAI,KAAK,YAAY,GAAG,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,IAAI,CAAC;IACpB,CAAC;IAED,OAAO,KAAK,CAAC,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E,QAAQ,EAAE,GAAG,GAAG,CAAC;QACzB,MAAM,WAAW,GAAG,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACrE,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAC7B,MAAM,CAAC,EAAE,CAAC,QAAQ,KAAK,MAAM,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,MAAM,GAAG,CAAC,CACnE,CAAC;QAEF,IAAI,CAAC,WAAW,IAAI,CAAC,SAAS,EAAE,CAAC;YAC/B,OAAO,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACnC,CAAC;QAED,8FAA8F;QAC9F,sDAAsD;QACtD,OAAO,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,IAAI,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAChE,CAAC,CAAC;IAEF,wFAAwF;IACxF,iGAAiG;IACjG,gFAAgF;IAChF,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,yBAAyB,CAAC,aAAa,CAAC,CAAC,CAAC;IAClF,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAE/D,OAAO,CAAC,KAAK,GAAG,OAAiB,CAAC;IAElC,OAAO,GAAG,EAAE;QACV,IAAI,OAAO,CAAC,KAAK,KAAK,OAAO,EAAE,CAAC;YAC9B,OAAO;QACT,CAAC;QAED,OAAO,CAAC,KAAK,GAAG,aAAa,CAAC;IAChC,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { getError } from '@venizia/ignis-helpers/core';\nimport type { IBffTransport } from './common/types';\n\n/**\n * Marks the patched `fetch` so a second install is refused rather than silently stacking. `Symbol.for`\n * and not a private symbol: two copies of this package in one page must still see each other's mark.\n */\nconst BRIDGE_MARKER = Symbol.for('@venizia/ignis-worker/bff-fetch');\n\ntype TFetch = typeof globalThis.fetch;\n\n/** The carrier whose `fetch` is replaced - `globalThis` in a page, an object a test controls otherwise. */\ninterface IFetchCarrier {\n fetch: TFetch;\n}\n\nexport interface IInstallBffFetchOptions {\n /** Anything implementing the transport contract, so an in-process transport works in a test. */\n transport: IBffTransport;\n /**\n * Path prefixes the BFF owns, matched on a segment boundary: `/api` claims `/api` and `/api/...`,\n * never `/apix`. Everything else is passed to the original `fetch` untouched.\n */\n basePath: string | Array<string>;\n /**\n * The origin, or origins, the BFF answers for - the page's own, or an upstream gateway whose\n * calls the BFF stands in for. A request to any other origin goes to the network whatever its path.\n * Unset, only the path decides, so a call to ANY origin under `basePath` is claimed.\n */\n origin?: string | Array<string>;\n /** Defaults to `globalThis`. */\n carrier?: IFetchCarrier;\n}\n\n/**\n * Resolves a request's absolute URL WITHOUT constructing a `Request`.\n *\n * This is the whole reason this helper exists rather than one obvious line. `new Request(input)`,\n * where `input` is a `Request` carrying a body, marks that body disturbed - so building one just to\n * read `.url` breaks the very pass-through it is deciding about: the next line hands the same, now\n * unreadable, request to the network.\n *\n * Measured, because the runtimes disagree. Chromium:\n *\n * original.bodyUsed // false\n * new Request(original)\n * original.bodyUsed // true\n * await original.text() // TypeError: body stream already read\n *\n * Bun does NOT disturb it, so the unit tests pass either way and cannot guard this. The browser is\n * where this code runs, so the browser is the behaviour to write for.\n */\nconst resolveRequestUrl = (input: RequestInfo | URL): string => {\n if (typeof input === 'string') {\n return new URL(input, globalThis.location?.href).href;\n }\n\n if (input instanceof URL) {\n return input.href;\n }\n\n return input.url;\n};\n\nconst toPrefixList = (basePath: string | Array<string>): Array<string> => {\n // Trailing slashes trimmed once, so the boundary test below is one comparison and one prefix check.\n const prefixes = (Array.isArray(basePath) ? basePath : [basePath])\n .map(prefix => prefix.replace(/\\/+$/, ''))\n .filter(prefix => prefix.length > 0);\n\n if (prefixes.length === 0) {\n throw getError({\n message:\n '[installBffFetch] Invalid basePath | At least one non-empty path prefix is required',\n });\n }\n\n return prefixes;\n};\n\n/**\n * Routes the page's own `fetch` into a BFF transport for anything under `basePath`, and leaves every\n * other call on the network untouched.\n *\n * This is the seam that lets an existing HTTP client talk to an in-browser IGNIS application without\n * knowing one exists. A data provider, an SDK or a generated client reaches the network through the\n * global `fetch` and usually accepts no custom fetcher, so answering that `fetch` is the only place\n * an in-browser backend becomes a drop-in swap rather than a fork of the client.\n *\n * Install it BEFORE the application that will use it boots: a request issued while the original\n * `fetch` is still in place leaves the page and 404s against whatever is serving it.\n *\n * @returns The uninstall function. It restores the previous `fetch` only if this bridge is still the\n * installed one - if something patched `fetch` afterwards, restoring would silently discard that.\n */\nexport const installBffFetch = (opts: IInstallBffFetchOptions): (() => void) => {\n const { transport, basePath } = opts;\n const origins =\n opts.origin === undefined\n ? undefined\n : new Set(\n (Array.isArray(opts.origin) ? opts.origin : [opts.origin]).map(\n value => new URL(value).origin,\n ),\n );\n const carrier = opts.carrier ?? (globalThis as unknown as IFetchCarrier);\n\n const prefixes = toPrefixList(basePath);\n const previousFetch = carrier.fetch;\n\n if (Object.getOwnPropertyDescriptor(previousFetch, BRIDGE_MARKER)) {\n throw getError({\n message:\n '[installBffFetch] A BFF fetch bridge is already installed | Uninstall it first, or pass every prefix to a single install',\n });\n }\n\n const networkFetch = previousFetch.bind(carrier) as TFetch;\n\n const bridged = async (input: RequestInfo | URL, init?: RequestInit): Promise<Response> => {\n const url = new URL(resolveRequestUrl(input));\n const { pathname } = url;\n const isOwnOrigin = origins === undefined || origins.has(url.origin);\n const isOwnPath = prefixes.some(\n prefix => pathname === prefix || pathname.startsWith(`${prefix}/`),\n );\n\n if (!isOwnOrigin || !isOwnPath) {\n return networkFetch(input, init);\n }\n\n // Constructed only now, on the branch that owns the request - so the pass-through above never\n // disturbs a body it is about to hand to the network.\n return transport.fetch({ request: new Request(input, init) });\n };\n\n // Whatever the runtime hung on `fetch` comes along - Bun puts `preconnect` there, and a\n // replacement that dropped it would break any caller reaching for it. Copying the descriptors is\n // also what makes this satisfy `typeof fetch` rather than merely resembling it.\n Object.defineProperties(bridged, Object.getOwnPropertyDescriptors(previousFetch));\n Object.defineProperty(bridged, BRIDGE_MARKER, { value: true });\n\n carrier.fetch = bridged as TFetch;\n\n return () => {\n if (carrier.fetch !== bridged) {\n return;\n }\n\n carrier.fetch = previousFetch;\n };\n};\n"]}
@@ -20,4 +20,3 @@ export declare class InProcessBffTransport extends BaseHelper implements IBffTra
20
20
  request: Request;
21
21
  }): Promise<Response>;
22
22
  }
23
- //# sourceMappingURL=in-process.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"in-process.js","sourceRoot":"","sources":["../../../src/transport/in-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD;;;;;;;;;GASG;AACH,MAAM,OAAO,qBAAsB,SAAQ,UAAU;IAMnD,YAAY,IAA0D;QACpE,KAAK,CAAC,EAAE,KAAK,EAAE,qBAAqB,CAAC,IAAI,EAAE,CAAC,CAAC;QAL9B,uBAAkB,GAAG,IAAI,kBAAkB,CAAC;YAC3D,KAAK,EAAE,qBAAqB,CAAC,IAAI;SAClC,CAAC,CAAC;QAKD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,IAA0B;QACpC,MAAM,EAAE,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC;QAE5C,MAAM,eAAe,GAAG,MAAM,WAAW,CAAC,aAAa,CAAC;YACtD,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,EAAE;YACF,GAAG,EAAE,WAAW,CAAC,cAAc,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;SAC3D,CAAC,CAAC;QAEH,IAAI,gBAAsC,CAAC;QAE3C,IA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C,KAAK,CAAC,IAA0B;QACpC,MAAM,EAAE,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC;QAE5C,MAAM,eAAe,GAAG,MAAM,WAAW,CAAC,aAAa,CAAC;YACtD,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,EAAE;YACF,GAAG,EAAE,WAAW,CAAC,cAAc,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;SAC3D,CAAC,CAAC;QAEH,IAAI,gBAAsC,CAAC;QAE3C,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC;YAC9F,gBAAgB,GAAG,MAAM,WAAW,CAAC,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;QACxE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,qCAAqC,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;YAEzF,uFAAuF;YACvF,6FAA6F;YAC7F,4BAA4B;YAC5B,MAAM,WAAW,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,WAAW,CAAC,WAAW,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;QACtF,CAAC;QAED,OAAO,WAAW,CAAC,cAAc,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC,CAAC;IACpE,CAAC;CACF","sourcesContent":["import { BaseHelper, RequestIdGenerator } from '@venizia/ignis-helpers/core';\nimport { BffEnvelope } from '@/envelope/encode';\nimport type { IBffResponseEnvelope } from '@/envelope/common';\nimport type { IBffTransport } from './common/types';\n\n/**\n * No worker, no browser - the seam that makes a BFF testable in-process. It still runs the full\n * envelope round trip, and that is the whole point: a bare pass-through lets a route pass here and\n * hang over a real Worker, because only the envelope applies the synthetic origin, buffers a\n * streaming body, and reduces a thrown error to `{ text, code, args }`. A test is worth what its\n * differences from production are worth.\n *\n * What it deliberately does NOT mirror is the timeout: in-process there is no message that can be\n * lost, so a handler either settles or the caller's own test timeout fires.\n */\nexport class InProcessBffTransport extends BaseHelper implements IBffTransport {\n private readonly handler: (request: Request) => Promise<Response>;\n private readonly requestIdGenerator = new RequestIdGenerator({\n scope: InProcessBffTransport.name,\n });\n\n constructor(opts: { handler: (request: Request) => Promise<Response> }) {\n super({ scope: InProcessBffTransport.name });\n\n this.handler = opts.handler;\n }\n\n async fetch(opts: { request: Request }): Promise<Response> {\n const id = this.requestIdGenerator.nextId();\n\n const requestEnvelope = await BffEnvelope.encodeRequest({\n request: opts.request,\n id,\n url: BffEnvelope.toSyntheticUrl({ url: opts.request.url }),\n });\n\n let responseEnvelope: IBffResponseEnvelope;\n\n try {\n const response = await this.handler(BffEnvelope.decodeRequest({ envelope: requestEnvelope }));\n responseEnvelope = await BffEnvelope.encodeResponse({ response, id });\n } catch (error) {\n this.logger.for(this.fetch.name).error('Handler failed | id: %s | error: %s', id, error);\n\n // Encoded and decoded rather than rethrown: what a UI receives over a real Worker is a\n // rebuilt `ApplicationError` carrying only the normalised shape - never the original object,\n // its stack or its `extra`.\n throw BffEnvelope.decodeError({ envelope: BffEnvelope.encodeError({ id, error }) });\n }\n\n return BffEnvelope.decodeResponse({ envelope: responseEnvelope });\n }\n}\n"]}
@@ -3,4 +3,3 @@ export * from './fetch-bridge.js';
3
3
  export * from './in-process.js';
4
4
  export * from './shared/index.js';
5
5
  export * from './worker.js';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/transport/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/transport/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC","sourcesContent":["export * from './common';\nexport * from './fetch-bridge';\nexport * from './in-process';\nexport * from './shared';\nexport * from './worker';\n"]}
@@ -11,4 +11,3 @@ export declare class ChannelMessageKinds {
11
11
  static readonly RESPONSE = "ignis.bff.response";
12
12
  static readonly ERROR = "ignis.bff.error";
13
13
  }
14
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/transport/shared/common/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,WAAW,CAAC;AAChD,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAEzC,yFAAyF;AACzF,MAAM,OAAO,QAAQ;aACH,aAAQ,GAAG,UAAU,CAAC;aACtB,WAAM,GAAG,QAAQ,CAAC;aAClB,aAAQ,GAAG,UAAU,CAAC;;AAGxC,MAAM,OAAO,mBAAmB;aACd,YAAO,GAAG,mBAAmB,CAAC;aAC9B,aAAQ,GAAG,oBAAoB,CAAC;aAChC,UAAK,GAAG,iBAAiB,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/transport/shared/common/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,WAAW,CAAC;AAChD,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAEzC,yFAAyF;AACzF,MAAM,OAAO,QAAQ;aACH,aAAQ,GAAG,UAAU,CAAC;aACtB,WAAM,GAAG,QAAQ,CAAC;aAClB,aAAQ,GAAG,UAAU,CAAC;;AAGxC,MAAM,OAAO,mBAAmB;aACd,YAAO,GAAG,mBAAmB,CAAC;aAC9B,aAAQ,GAAG,oBAAoB,CAAC;aAChC,UAAK,GAAG,iBAAiB,CAAC","sourcesContent":["export const DEFAULT_CHANNEL_NAME = 'ignis.bff';\nexport const DEFAULT_TIMEOUT_MS = 30_000;\n\n/** Which part this tab plays. `ELECTING` is the brief window before the lock answers. */\nexport class BffRoles {\n static readonly ELECTING = 'electing';\n static readonly LEADER = 'leader';\n static readonly FOLLOWER = 'follower';\n}\n\nexport class ChannelMessageKinds {\n static readonly REQUEST = 'ignis.bff.request';\n static readonly RESPONSE = 'ignis.bff.response';\n static readonly ERROR = 'ignis.bff.error';\n}\n"]}
@@ -1,3 +1,2 @@
1
1
  export * from './constants.js';
2
2
  export * from './types.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/transport/shared/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/transport/shared/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC","sourcesContent":["export * from './constants';\nexport * from './types';\n"]}
@@ -32,4 +32,3 @@ export interface ISharedBffTransportOptions {
32
32
  timeoutMs?: number;
33
33
  scope?: string;
34
34
  }
35
- //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/transport/shared/common/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/transport/shared/common/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TConstValue } from '@venizia/ignis-helpers/common';\nimport type {\n IBffErrorEnvelope,\n IBffRequestEnvelope,\n IBffResponseEnvelope,\n} from '@/envelope/common';\nimport { type BffRoles, type ChannelMessageKinds } from './constants';\n\nexport type TBffRole = TConstValue<typeof BffRoles>;\n\n/**\n * There is deliberately no \"a new leader is ready\" broadcast. A follower cannot act on one safely:\n * BroadcastChannel does not order messages across senders, so a request posted around the moment of\n * promotion may well be answered by the new leader - and a follower that failed its in-flight\n * requests on hearing the announcement would turn some of those successes into errors. The request\n * timeout is the one honest answer for that window.\n */\nexport type TChannelMessage =\n | { kind: typeof ChannelMessageKinds.REQUEST; envelope: IBffRequestEnvelope }\n | { kind: typeof ChannelMessageKinds.RESPONSE; envelope: IBffResponseEnvelope }\n | { kind: typeof ChannelMessageKinds.ERROR; envelope: IBffErrorEnvelope };\n\nexport interface IPendingRequest {\n resolve: (response: Response) => void;\n reject: (error: unknown) => void;\n release: () => void;\n}\n\nexport interface ISharedBffTransportOptions {\n /** Builds the Worker. Called ONLY by whichever tab wins the election - the others never start one. */\n createWorker: () => Worker;\n /** Distinguishes independent BFFs on one origin. The lock name is derived from it. */\n channelName?: string;\n timeoutMs?: number;\n scope?: string;\n}\n"]}
@@ -1,4 +1,3 @@
1
1
  export { BffRoles } from './common/constants.js';
2
2
  export type { ISharedBffTransportOptions, TBffRole } from './common/types.js';
3
3
  export { SharedBffTransport } from './transport.js';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/transport/shared/index.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,8FAA8F;AAC9F,wBAAwB;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/transport/shared/index.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,8FAA8F;AAC9F,wBAAwB;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC","sourcesContent":["// `export * from './common'` would also publish five module-private names - `DEFAULT_CHANNEL_NAME`,\n// `DEFAULT_TIMEOUT_MS`, `ChannelMessageKinds`, `TChannelMessage`, `IPendingRequest` - through\n// `transport/index.ts`.\nexport { BffRoles } from './common/constants';\nexport type { ISharedBffTransportOptions, TBffRole } from './common/types';\nexport { SharedBffTransport } from './transport';\n"]}
@@ -84,4 +84,3 @@ export declare class SharedBffTransport extends BaseHelper implements IBffTransp
84
84
  private readonly handleChannelMessage;
85
85
  private serveAsLeader;
86
86
  }
87
- //# sourceMappingURL=transport.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../../src/transport/shared/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAQnG;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAO,kBAAmB,SAAQ,UAAU;IAgChD,YAAY,IAAgC;QAC1C,KAAK,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,kBAAkB,CAAC,IAAI,EAAE,CAAC,CAAC;QA3BzC,oBAAe,GAAG,IAAI,GAAG,EAA2B,CAAC;QAE9D,SAAI,GAAa,QAAQ,CAAC,QAAQ,CAAC;QAEnC,aAAQ,GAAG,KAAK,CAAC;QAgBzB,+FAA+F;QAC9E,yBAAoB,GAAG,IAAI,eAAe,EAAE,CAAC;QAE9D,uEAAuE;QAC/D,gBAAW,GAAsB,EAAE,CAAC;QA2T5C;;;;;WAKG;QACc,yBAAoB,GAAG,CAAC,KAAmB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ope/encode';\nimport type { IBffRequestEnvelope } from '@/envelope/common';\nimport type { IBffTransport } from '../common/types';\nimport { WorkerBffTransport } from '../worker';\nimport { BffRoles, ChannelMessageKinds, DEFAULT_CHANNEL_NAME, DEFAULT_TIMEOUT_MS } from './common';\nimport type {\n IPendingRequest,\n ISharedBffTransportOptions,\n TBffRole,\n TChannelMessage,\n} from './common';\n\n/**\n * One BFF for every tab of an origin, instead of one per tab.\n *\n * The problem it solves is not a framework limitation, it is a storage one. PGlite in\n * `opfs-ahp://` mode holds an exclusive access handle on the database file, and OPFS access handles\n * are exclusive PER ORIGIN. Measured in Chromium with two tabs of the same page: the first tab\n * works, and the second never boots its database -\n * `Failed to execute 'createSyncAccessHandle' on 'FileSystemFileHandle': Access Handles cannot be\n * created if there is another open Access Handle or Writable stream associated with the same file`.\n * The first tab is unaffected, and closing it lets the second recover on reload - so the failure is\n * contained and self-healing, but the second tab is simply dead until then.\n *\n * So exactly one tab may own the database. This transport elects that tab with the Web Locks API,\n * gives it the Worker, and forwards every other tab's request to it over a `BroadcastChannel`,\n * carried in the same envelope the Worker itself speaks. When the leader's tab closes, the lock is\n * released by the browser and a follower is promoted automatically - no heartbeat, no timeout, no\n * stale-leader window to reason about.\n *\n * A host with no `navigator.locks` runs single-tab, exactly as before. That is not a compromise:\n * measured on a plain-http origin, `navigator.locks` and `navigator.storage.getDirectory` are BOTH\n * undefined, because both are secure-context only. Wherever OPFS works the lock exists, and where it\n * does not the database could not have started either.\n */\nexport class SharedBffTransport extends BaseHelper implements IBffTransport {\n private readonly createWorker: () => Worker;\n private readonly channel: BroadcastChannel;\n private readonly lockName: string;\n private readonly timeoutMs: number;\n private readonly requestIdGenerator: RequestIdGenerator;\n private readonly pendingRequests = new Map<string, IPendingRequest>();\n\n private role: TBffRole = BffRoles.ELECTING;\n private leaderTransport?: WorkerBffTransport;\n private isClosed = false;\n\n /**\n * Held because THIS class created it. `WorkerBffTransport.close()` deliberately leaves a worker\n * running - it did not create the one it was handed - so without this reference the worker would\n * outlive `close()` still holding the exclusive OPFS access handle, while the lock has already\n * gone to another tab that opens the same database.\n */\n private leaderWorker?: Worker;\n\n /** Set when `createWorker()` throws, so callers get that failure instead of parking forever. */\n private leaderStartupError?: unknown;\n\n /** Resolving this releases the Web Lock, which is what promotes a follower. */\n private releaseLeadership?: () => void;\n\n /** Drops this tab out of the lock QUEUE on close, so a closed transport cannot be promoted. */\n private readonly leadershipQueueAbort = new AbortController();\n\n /** Callers parked in `fetch()` while the election is still running. */\n private roleWaiters: Array<() => void> = [];\n\n constructor(opts: ISharedBffTransportOptions) {\n super({ scope: opts.scope ?? SharedBffTransport.name });\n\n const channelName = opts.channelName ?? DEFAULT_CHANNEL_NAME;\n\n this.createWorker = opts.createWorker;\n this.timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n this.lockName = `${channelName}.leader`;\n this.requestIdGenerator = new RequestIdGenerator({ scope: SharedBffTransport.name });\n\n // Attached BEFORE the election starts: a tab that becomes leader a moment later must not miss a\n // request a follower posted while it was still deciding.\n this.channel = new BroadcastChannel(channelName);\n this.channel.addEventListener('message', this.handleChannelMessage);\n\n // A failed election must not leave `fetch()` parked forever waiting for a role that never\n // arrives: this tab falls back to serving itself, which is the pre-election behaviour.\n this.elect().catch((error: unknown) => {\n // `close()` aborts the queued lock request, and the rejection that produces is the expected\n // end of the election - not a failure to report.\n if (this.isClosed) {\n return;\n }\n\n this.logger\n .for(this.elect.name)\n .error('Leader election failed, falling back to single-tab | error: %s', error);\n\n if (this.role === BffRoles.ELECTING) {\n this.becomeLeader();\n }\n });\n }\n\n getRole(): TBffRole {\n return this.role;\n }\n\n async fetch(opts: { request: Request }): Promise<Response> {\n if (this.isClosed) {\n throw getError({\n message: '[SharedBffTransport] The transport is closed | open a new one to make requests',\n });\n }\n\n await this.whenRoleSettled();\n\n // Re-checked AFTER the await: `close()` can land while the election is still running, and\n // posting then reaches a channel that is already closed - the caller would get a raw\n // `DOMException` instead of this error, and a pending entry plus a live timer would be left\n // behind on a transport nothing can settle.\n if (this.isClosed) {\n throw getError({\n message: '[SharedBffTransport] The transport is closed | open a new one to make requests',\n });\n }\n\n if (this.leaderStartupError) {\n throw getError({\n message:\n '[SharedBffTransport] This tab leads but its BFF worker never started | reload the page',\n cause: this.leaderStartupError,\n });\n }\n\n if (this.role === BffRoles.LEADER && this.leaderTransport) {\n return this.leaderTransport.fetch(opts);\n }\n\n return this.fetchViaLeader(opts);\n }\n\n close(): void {\n this.isClosed = true;\n\n // A follower is parked in the lock QUEUE rather than holding anything. Without this it stays\n // queued after close, and the browser would eventually hand leadership to a dead transport -\n // which returns straight away, but only after the tab that could have served was skipped.\n this.leadershipQueueAbort.abort();\n\n // ORDER IS THE POINT, and it is the opposite of the obvious one. The worker has to be GONE\n // before the lock is released: releasing first promotes another tab, which opens the same OPFS\n // database while this worker still holds the exclusive access handle - the exact failure this\n // transport exists to prevent, reintroduced by its own teardown.\n //\n // `terminate()` is abrupt by design. It is no worse than the tab-close path the browser already\n // takes on every leader, and leaving the worker alive is strictly worse than an abrupt stop.\n this.leaderTransport?.close();\n this.leaderTransport = undefined;\n this.leaderWorker?.terminate();\n this.leaderWorker = undefined;\n\n // Only now: the next tab may open the database.\n this.releaseLeadership?.();\n this.releaseLeadership = undefined;\n\n this.channel.removeEventListener('message', this.handleChannelMessage);\n this.channel.close();\n\n this.rejectAllPending({ reason: 'the transport was closed' });\n this.settleRoleWaiters();\n }\n\n private async elect(): Promise<void> {\n const locks = globalThis.navigator?.locks;\n\n if (!locks) {\n this.logger\n .for(this.elect.name)\n .warn(\n 'navigator.locks is unavailable - running single-tab | a second tab cannot open the same OPFS database',\n );\n this.becomeLeader();\n return;\n }\n\n // `ifAvailable` answers NOW instead of queueing, which is what lets this tab find out it is a\n // follower rather than hanging until the current leader goes away.\n const hasWon = await locks.request(this.lockName, { ifAvailable: true }, async lock => {\n if (!lock) {\n return false;\n }\n\n // Symmetric with the queued branch below, and not defensive padding. A real `LockManager`\n // grants from a queued task - it never runs this callback synchronously inside `request()` -\n // so `close()` can land between the constructor and this line. Without the guard a CLOSED\n // transport starts a worker, reports itself leader, and then holds the lock for the lifetime\n // of the page: `close()` has already read and cleared `releaseLeadership`, so the assignment\n // `heldUntilClosed()` makes below can never be resolved by anything. No other tab is ever\n // promoted, and this one answers nobody - its channel listener is already detached.\n //\n // Returning true, not false: this tab DID hold the lock. Returning releases it immediately,\n // which is exactly what a closed transport should do with it.\n if (this.isClosed) {\n return true;\n }\n\n this.becomeLeader();\n await this.heldUntilClosed();\n return true;\n });\n\n if (hasWon || this.isClosed) {\n return;\n }\n\n this.becomeFollower();\n\n // Queues behind the current leader. The browser releases its lock when that tab goes away - a\n // crash included - so this resolves without anything having to detect the death.\n await locks.request(this.lockName, { signal: this.leadershipQueueAbort.signal }, async () => {\n if (this.isClosed) {\n return;\n }\n\n this.logger\n .for(this.elect.name)\n .info('Promoted to leader | previous leader released the lock');\n this.becomeLeader();\n await this.heldUntilClosed();\n });\n }\n\n private becomeLeader(): void {\n // Anything this tab had in flight was addressed to the leader that just went away. It cannot be\n // replayed - a write may well have been applied - so it is failed explicitly rather than left\n // to run out its timeout under a leader that will never answer it.\n this.rejectAllPending({\n reason: 'the leader serving it went away before this tab was promoted',\n });\n\n try {\n this.leaderWorker = this.createWorker();\n this.leaderTransport = new WorkerBffTransport({\n worker: this.leaderWorker,\n timeoutMs: this.timeoutMs,\n });\n } catch (error) {\n // A CSP refusal or a bad worker URL must still SETTLE the role. `whenRoleSettled()` has no\n // timeout of its own and the per-request timer is armed only inside `fetchViaLeader()`, which\n // this tab never reaches - so leaving the role unsettled hangs every caller forever, with no\n // error and no log per request.\n this.leaderStartupError = error;\n this.logger\n .for(this.becomeLeader.name)\n .error('Could not start the BFF worker | error: %s', error);\n }\n\n this.role = BffRoles.LEADER;\n this.settleRoleWaiters();\n }\n\n private becomeFollower(): void {\n this.role = BffRoles.FOLLOWER;\n this.settleRoleWaiters();\n }\n\n private heldUntilClosed(): Promise<void> {\n return new Promise<void>(resolve => {\n this.releaseLeadership = resolve;\n });\n }\n\n private whenRoleSettled(): Promise<void> {\n if (this.role !== BffRoles.ELECTING) {\n return Promise.resolve();\n }\n\n return new Promise<void>(resolve => {\n this.roleWaiters.push(resolve);\n });\n }\n\n private settleRoleWaiters(): void {\n const waiters = this.roleWaiters;\n this.roleWaiters = [];\n\n for (const waiter of waiters) {\n waiter();\n }\n }\n\n /**\n * The caller's `AbortSignal` is honoured HERE as well as in `WorkerBffTransport`. Without it the\n * same page code behaves differently depending on which tab won the lock: abort works in the\n * leader and silently does nothing in every follower, so a data provider that aborts on unmount\n * leaves promises pending for the full timeout in every tab but one.\n *\n * Aborting settles the CALLER. It does not cancel the leader's work - there is no cancel message,\n * and a write already dispatched cannot be taken back.\n */\n private async fetchViaLeader(opts: { request: Request }): Promise<Response> {\n const { signal } = opts.request;\n\n if (signal?.aborted) {\n throw this.toAbortError({ signal });\n }\n\n const id = this.requestIdGenerator.nextId();\n\n const envelope = await BffEnvelope.encodeRequest({\n request: opts.request,\n id,\n url: BffEnvelope.toSyntheticUrl({ url: opts.request.url }),\n });\n\n return new Promise<Response>((resolve, reject) => {\n const timer = setTimeout(() => {\n this.takePending({ id })?.reject(\n getError({\n message: `[SharedBffTransport] Timed out waiting for the leader tab | id: ${id} | timeoutMs: ${this.timeoutMs}`,\n }),\n );\n }, this.timeoutMs);\n\n const handleAbort = (): void => {\n this.takePending({ id })?.reject(this.toAbortError({ signal }));\n };\n signal?.addEventListener('abort', handleAbort);\n\n this.pendingRequests.set(id, {\n resolve,\n reject,\n release: () => {\n clearTimeout(timer);\n signal?.removeEventListener('abort', handleAbort);\n },\n });\n\n // Buffering the body took an await, and `addEventListener('abort')` never fires on a signal\n // that aborted before it was attached - without this re-read that window loses the abort.\n if (signal?.aborted) {\n handleAbort();\n return;\n }\n\n this.channel.postMessage({\n kind: ChannelMessageKinds.REQUEST,\n envelope,\n } satisfies TChannelMessage);\n });\n }\n\n /** `signal.reason` first, the way `globalThis.fetch` rejects, so a custom abort reason survives. */\n private toAbortError(opts: { signal?: AbortSignal }): unknown {\n return (\n opts.signal?.reason ??\n getError({ message: '[SharedBffTransport] The request was aborted by its caller' })\n );\n }\n\n private takePending(opts: { id: string }): IPendingRequest | undefined {\n const pending = this.pendingRequests.get(opts.id);\n if (!pending) {\n return undefined;\n }\n\n this.pendingRequests.delete(opts.id);\n pending.release();\n return pending;\n }\n\n private rejectAllPending(opts: { reason: string }): void {\n const pendingRequestsKeys = [...this.pendingRequests.keys()];\n for (const id of pendingRequestsKeys) {\n this.takePending({ id })?.reject(\n getError({\n message: `[SharedBffTransport] Request abandoned | id: ${id} | reason: ${opts.reason}`,\n }),\n );\n }\n }\n\n /**\n * A `BroadcastChannel` never delivers a message to the instance that sent it, so a leader does not\n * hear its own answers and a follower does not hear its own requests. Every tab does hear every\n * OTHER tab, which is why a response is matched by id and silently ignored when it belongs to\n * someone else.\n */\n private readonly handleChannelMessage = (event: MessageEvent): void => {\n const message = event.data as TChannelMessage | undefined;\n\n switch (message?.kind) {\n case ChannelMessageKinds.REQUEST: {\n if (this.role !== BffRoles.LEADER) {\n return;\n }\n\n // `serveAsLeader` answers its own failures on the channel; this catch is for the one case\n // it cannot - the channel itself refusing the message, e.g. a body that will not clone.\n this.serveAsLeader({ envelope: message.envelope }).catch((error: unknown) => {\n this.logger\n .for(this.serveAsLeader.name)\n .error(\n 'Could not answer a follower at all | id: %s | error: %s',\n message.envelope.id,\n error,\n );\n });\n return;\n }\n\n // Both decodes are guarded. The channel is origin-wide and its name is the application's, not\n // a secret, and version skew is the realistic trigger: a long-lived tab on v1 and a new tab\n // on v2 share the same channel and lock BY DESIGN. An envelope this build cannot read must\n // fail its caller, never leave the promise unsettled for the full timeout.\n case ChannelMessageKinds.RESPONSE: {\n const pending = this.takePending({ id: message.envelope.id });\n if (!pending) {\n return;\n }\n\n try {\n pending.resolve(BffEnvelope.decodeResponse({ envelope: message.envelope }));\n } catch (error) {\n this.logger\n .for(this.handleChannelMessage.name)\n .error(\n 'Undecodable response envelope | id: %s | error: %s',\n message.envelope.id,\n error,\n );\n pending.reject(\n getError({\n message: `[SharedBffTransport] The leader's response could not be decoded | id: ${message.envelope.id}`,\n cause: error,\n }),\n );\n }\n return;\n }\n\n case ChannelMessageKinds.ERROR: {\n const pending = this.takePending({ id: message.envelope.id });\n if (!pending) {\n return;\n }\n\n try {\n pending.reject(BffEnvelope.decodeError({ envelope: message.envelope }));\n } catch (error) {\n pending.reject(\n getError({\n message: `[SharedBffTransport] The leader's error envelope could not be decoded | id: ${message.envelope.id}`,\n cause: error,\n }),\n );\n }\n return;\n }\n\n default: {\n return;\n }\n }\n };\n\n private async serveAsLeader(opts: { envelope: IBffRequestEnvelope }): Promise<void> {\n const { envelope } = opts;\n\n try {\n const response = await this.leaderTransport!.fetch({\n request: BffEnvelope.decodeRequest({ envelope }),\n });\n\n this.channel.postMessage({\n kind: ChannelMessageKinds.RESPONSE,\n envelope: await BffEnvelope.encodeResponse({ response, id: envelope.id }),\n } satisfies TChannelMessage);\n } catch (error) {\n // The follower gets the failure as a failure, rather than waiting out a timeout that would\n // tell it nothing about what went wrong.\n this.logger\n .for(this.serveAsLeader.name)\n .error('Failed to serve a follower request | id: %s | error: %s', envelope.id, error);\n\n this.channel.postMessage({\n kind: ChannelMessageKinds.ERROR,\n envelope: BffEnvelope.encodeError({ id: envelope.id, error }),\n } satisfies TChannelMessage);\n }\n }\n}\n"]}
@@ -59,4 +59,3 @@ export declare class WorkerBffTransport extends BaseHelper implements IBffTransp
59
59
  */
60
60
  close(): void;
61
61
  }
62
- //# sourceMappingURL=worker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"worker.js","sourceRoot":"","sources":["../../../src/transport/worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,WAAW,E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AAM,CAC9B,QAAQ,CAAC;gBACP,OAAO,EAAE,iFAAiF,EAAE,EAAE;aAC/F,CAAC,CACH,CAAC;QACJ,CAAC;IACH,CAAC;CACF","sourcesContent":["import { BaseHelper, getError } from '@venizia/ignis-helpers/core';\nimport { RequestIdGenerator } from '@venizia/ignis-helpers/core';\nimport { BffEnvelope } from '@/envelope/encode';\nimport type { IBffErrorEnvelope, IBffResponseEnvelope } from '@/envelope/common';\nimport type { IBffTransport } from './common/types';\n\nconst DEFAULT_TIMEOUT_MS = 30_000;\n\n/** How long a still-serving worker gets to answer after it reports an error - see `handleWorkerError`. */\nconst WORKER_ERROR_GRACE_MS = 250;\n\nconst isErrorEnvelope = (\n data: IBffResponseEnvelope | IBffErrorEnvelope,\n): data is IBffErrorEnvelope => {\n return 'error' in data;\n};\n\n/** One in-flight request: what settles it, and what has to be released the moment it settles. */\ninterface IPendingRequest {\n resolve: (response: Response) => void;\n reject: (error: unknown) => void;\n release: () => void;\n}\n\n/**\n * UI-side half of the BFF: posts an encoded request to a real `Worker` and resolves the matching\n * response by `id` - the far side of `WorkerApplication.listen()`.\n *\n * The three worker listeners are attached ONCE, in the constructor, and every request is tracked in\n * `pendingRequests` instead. Registering them per request looks equivalent and is not: they are\n * scoped to the shared `Worker`, so a single `messageerror` - which means exactly one message\n * failed to deserialise - would fire every in-flight request's handler, rejecting nine healthy\n * requests that are about to be answered normally.\n */\nexport class WorkerBffTransport extends BaseHelper implements IBffTransport {\n private readonly worker: Worker;\n private readonly timeoutMs: number;\n private readonly requestIdGenerator = new RequestIdGenerator({\n scope: WorkerBffTransport.name,\n });\n private readonly pendingRequests = new Map<string, IPendingRequest>();\n\n /** Set by `close()`, so a later `fetch()` is refused instead of reaching a worker nothing listens to. */\n private isClosed = false;\n\n /** Outstanding `handleWorkerError` grace timers, cleared by `close()` so none outlives the transport. */\n private readonly graceTimers = new Set<ReturnType<typeof setTimeout>>();\n\n constructor(opts: { worker: Worker; timeoutMs?: number }) {\n super({ scope: WorkerBffTransport.name });\n\n this.worker = opts.worker;\n this.timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n\n this.worker.addEventListener('message', this.handleMessage);\n this.worker.addEventListener('error', this.handleWorkerError);\n this.worker.addEventListener('messageerror', this.handleMessageError);\n }\n\n /** Removes a pending request from the map and releases its timer and abort listener, so nothing can settle it twice. */\n private readonly takePending = (opts: { id: string }): IPendingRequest | undefined => {\n const pending = this.pendingRequests.get(opts.id);\n if (!pending) {\n return undefined;\n }\n\n this.pendingRequests.delete(opts.id);\n pending.release();\n return pending;\n };\n\n private readonly handleMessage = (event: MessageEvent): void => {\n // `event.data` is untyped (`any`) until narrowed below - a worker posts to this page for its own\n // reasons too (a dev-server ping, a library handshake), and none of those carry an `id` this\n // transport is waiting on.\n const data = event.data as IBffResponseEnvelope | IBffErrorEnvelope | undefined;\n if (!data?.id) {\n return;\n }\n\n const pending = this.takePending({ id: data.id });\n if (!pending) {\n return;\n }\n\n if (isErrorEnvelope(data)) {\n pending.reject(BffEnvelope.decodeError({ envelope: data }));\n return;\n }\n\n // Settled inside its own try: `decodeResponse` throws a `RangeError` for a status outside\n // 200-599 and a `TypeError` on a malformed header tuple, and by this point the timer and the\n // listeners are already gone - a throw that escaped here would leave the promise with nothing\n // left to settle it, ever.\n try {\n pending.resolve(BffEnvelope.decodeResponse({ envelope: data }));\n } catch (error) {\n pending.reject(\n getError({\n message: `[WorkerBffTransport] Failed to decode the response envelope | id: ${data.id} | error: ${error}`,\n }),\n );\n }\n };\n\n /**\n * An `error` event does NOT mean the worker is dead.\n *\n * Measured in Chromium: a synchronous uncaught throw anywhere in the worker - a third-party timer,\n * say - fires this event while the worker keeps serving, and the genuine responses to the\n * in-flight requests arrive a moment later. Rejecting immediately reported a committed POST as\n * failed and then dropped its real 200 on the floor, because nothing was left waiting for it.\n *\n * So the event is logged at once and the requests are given a grace window. Whatever the worker\n * still answers inside it settles normally; whatever is left after it really is lost, and is\n * rejected with the diagnostics rather than left to run out its own timeout.\n */\n private readonly handleWorkerError = (event: Event): void => {\n // `String(event)` is always `[object ErrorEvent]` - it says nothing. Read the fields a browser\n // actually populates, so the log names the file and line that failed.\n const detail = this.describeErrorEvent(event);\n\n this.logger\n .for('handleWorkerError')\n .error(\n 'Worker reported an error | pending: %s | detail: %s',\n this.pendingRequests.size,\n detail,\n );\n\n const affected = [...this.pendingRequests.keys()];\n\n // Held so `close()` can clear it. A grace timer that outlives the transport keeps the process\n // (or a test runner) awake and fires against a map nobody is watching any more.\n const timer = setTimeout(() => {\n this.graceTimers.delete(timer);\n\n for (const id of affected) {\n // `takePending` answers undefined for anything the worker managed to settle in the window.\n this.takePending({ id })?.reject(\n getError({\n message: `[WorkerBffTransport] Worker failed while awaiting a response | id: ${id} | detail: ${detail}`,\n }),\n );\n }\n }, WORKER_ERROR_GRACE_MS);\n\n this.graceTimers.add(timer);\n };\n\n /** `ErrorEvent` carries the useful fields; a plain `Event` does not, so both shapes are handled. */\n private describeErrorEvent(event: Event): string {\n const candidate = event as Partial<{\n message: string;\n filename: string;\n lineno: number;\n colno: number;\n }>;\n\n if (!candidate.message) {\n return event.type;\n }\n\n return `${candidate.message} (${candidate.filename ?? 'unknown'}:${candidate.lineno ?? 0}:${candidate.colno ?? 0})`;\n }\n\n /**\n * `messageerror` means exactly ONE posted message failed to deserialise, and the event carries\n * nothing that says which. With a single request in flight that is unambiguous, so it settles\n * now; with several, the lost answer belongs to one of them and rejecting the rest would be a\n * lie - each then ends on its own timeout, under its own id.\n */\n private readonly handleMessageError = (event: Event): void => {\n if (this.pendingRequests.size !== 1) {\n this.logger\n .for(this.handleMessageError.name)\n .warn(\n 'A worker message could not be deserialised and no single request owns it | inFlight: %d | event: %s',\n this.pendingRequests.size,\n String(event),\n );\n return;\n }\n\n const [id] = [...this.pendingRequests.keys()];\n this.takePending({ id: id! })?.reject(\n getError({\n message: `[WorkerBffTransport] The worker's response could not be deserialised | id: ${id} | event: ${String(event)}`,\n }),\n );\n };\n\n async fetch(opts: { request: Request }): Promise<Response> {\n const { request } = opts;\n const { signal } = request;\n\n // Refused, not queued. `close()` detaches the message listener, so a request posted after it\n // still reached the worker - which EXECUTED it, writes included - while the answer had nowhere\n // to land and the caller waited out the full timeout.\n if (this.isClosed) {\n throw getError({\n message: '[WorkerBffTransport] The transport is closed | open a new one to make requests',\n });\n }\n\n if (signal?.aborted) {\n throw this.toAbortError({ signal });\n }\n\n const id = this.requestIdGenerator.nextId();\n\n // The URL is overridden rather than the request rebuilt: rebuilding reads the body once here\n // and once inside `encodeRequest`, and it silently drops `signal` on the way.\n const requestEnvelope = await BffEnvelope.encodeRequest({\n request,\n id,\n url: BffEnvelope.toSyntheticUrl({ url: request.url }),\n });\n\n return new Promise<Response>((resolve, reject) => {\n const timer = setTimeout(() => {\n this.takePending({ id })?.reject(\n getError({\n message: `[WorkerBffTransport] Timed out waiting for a response | id: ${id} | timeoutMs: ${this.timeoutMs}`,\n }),\n );\n }, this.timeoutMs);\n\n const handleAbort = (): void => {\n this.takePending({ id })?.reject(this.toAbortError({ signal }));\n };\n signal?.addEventListener('abort', handleAbort);\n\n this.pendingRequests.set(id, {\n resolve,\n reject,\n release: () => {\n clearTimeout(timer);\n signal?.removeEventListener('abort', handleAbort);\n },\n });\n\n // Buffering the body took an await, and `addEventListener('abort')` never fires on a signal\n // that aborted before it was attached - without this re-read that window loses the abort and\n // the caller waits out the whole timeout.\n if (signal?.aborted) {\n handleAbort();\n return;\n }\n\n // `close()` can land during that same await. The entry guard above is then stale, and posting\n // reaches a worker that EXECUTES the request - writes included - while the answer has nowhere\n // to land, because `close()` already detached the listener.\n if (this.isClosed) {\n this.takePending({ id })?.reject(\n getError({\n message: `[WorkerBffTransport] The transport closed while the request was being encoded | id: ${id}`,\n }),\n );\n return;\n }\n\n this.worker.postMessage(requestEnvelope, requestEnvelope.body ? [requestEnvelope.body] : []);\n });\n }\n\n /** `signal.reason` first, the way `globalThis.fetch` rejects, so `controller.abort(myReason)` still reaches the caller. */\n private toAbortError(opts: { signal?: AbortSignal }): unknown {\n return (\n opts.signal?.reason ??\n getError({ message: '[WorkerBffTransport] The request was aborted by its caller' })\n );\n }\n\n /**\n * Detaches the three worker listeners and fails whatever is still in flight. The worker itself is\n * left alone - this transport did not create it, and a page may hand the same one to another.\n */\n close(): void {\n this.isClosed = true;\n\n for (const timer of this.graceTimers) {\n clearTimeout(timer);\n }\n this.graceTimers.clear();\n this.worker.removeEventListener('message', this.handleMessage);\n this.worker.removeEventListener('error', this.handleWorkerError);\n this.worker.removeEventListener('messageerror', this.handleMessageError);\n\n const pendingRequestsKeys = [...this.pendingRequests.keys()];\n for (const id of pendingRequestsKeys) {\n this.takePending({ id })?.reject(\n getError({\n message: `[WorkerBffTransport] The transport was closed while awaiting a response | id: ${id}`,\n }),\n );\n }\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venizia/ignis-worker",
3
- "version": "0.2.2",
3
+ "version": "0.3.1",
4
4
  "description": "Browser Web Worker host for the IGNIS framework: the request/response envelope, the transport contract, and WorkerApplication - the layer that listens on `onmessage` instead of a socket, so a RestApplication can serve its controllers with no server anywhere.",
5
5
  "keywords": [
6
6
  "browser",
@@ -65,9 +65,9 @@
65
65
  "prepublishOnly": "make rebuild"
66
66
  },
67
67
  "dependencies": {
68
- "@venizia/ignis-helpers": "0.2.2",
69
- "@venizia/ignis-inversion": "0.2.2",
70
- "@venizia/ignis-kernel": "0.2.2",
68
+ "@venizia/ignis-helpers": "0.3.1",
69
+ "@venizia/ignis-inversion": "0.3.1",
70
+ "@venizia/ignis-kernel": "0.3.1",
71
71
  "reflect-metadata": "^0.2.2"
72
72
  },
73
73
  "peerDependencies": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/applications/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/applications/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE;;;GAGG;AACH,MAAM,WAAW,yBAA0B,SAAQ,mBAAmB;IACpE,qMAAqM;IACrM,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/applications/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../../src/applications/worker.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGxC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,WAAW,CAAC,GAAG,IAAI,CAAC;IACjF,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,GAAG,IAAI,CAAC;IACjF,mBAAmB,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,GAAG,IAAI,CAAC;IACrF,KAAK,CAAC,IAAI,IAAI,CAAC;CAChB;AAED;;;;;GAKG;AACH,8BAAsB,iBAAiB,CACrC,MAAM,SAAS,GAAG,GAAG,GAAG,EACxB,SAAS,SAAS,MAAM,GAAG,EAAE,EAC7B,QAAQ,SAAS,MAAM,GAAG,GAAG,CAC7B,SAAQ,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC;IACpD,qMAAqM;IACrM,UAAkB,OAAO,EAAE,yBAAyB,CAAC;IAErD,iGAAiG;IACjG,OAAO,CAAC,cAAc,CAAC,CAAgB;IACvC,+FAA+F;IAC/F,OAAO,CAAC,aAAa,CAAC,CAAgB;IACtC,OAAO,CAAC,eAAe,CAAC,CAAa;IACrC,OAAO,CAAC,SAAS,CAAS;IAE1B;;;;;;;OAOG;IACM,cAAc,IAAI,MAAM;IASjC;;;OAGG;YACW,aAAa;IAoC3B,kKAAkK;IAClK,OAAO,CAAC,iBAAiB;IAgBzB,kIAAkI;YACpH,YAAY;IAW1B;;;;;OAKG;YACW,eAAe;IAqC7B,OAAO,CAAC,QAAQ;IAsChB;;;;;;OAMG;IACG,MAAM,CAAC,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,WAAW,GAAG,mBAAmB,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBjF;;;;;;;;;OASG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAW5B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/envelope/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/envelope/common/types.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAEvD,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,gBAAgB,CAAC;IAC1B,+EAA+E;IAC/E,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,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;QACnB,EAAE,EAAE,MAAM,CAAC;KACZ,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAajC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,oBAAoB,CAAA;KAAE,GAAG,QAAQ;IAazE;;;;;;;OAOG;IACH,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,GAAG,iBAAiB;IAoB3E,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,iBAAiB,CAAA;KAAE,GAAG,gBAAgB;CAc5E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/envelope/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/transport/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/transport/common/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACtD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch-bridge.d.ts","sourceRoot":"","sources":["../../../src/transport/fetch-bridge.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAQpD,KAAK,MAAM,GAAG,OAAO,UAAU,CAAC,KAAK,CAAC;AAEtC,2GAA2G;AAC3G,UAAU,aAAa;IACrB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,uBAAuB;IACtC,gGAAgG;IAChG,SAAS,EAAE,aAAa,CAAC;IACzB;;;OAGG;IACH,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IACjC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAChC,gCAAgC;IAChC,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAgDD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,uBAAuB,KAAG,CAAC,MAAM,IAAI,CAwD1E,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"in-process.d.ts","sourceRoot":"","sources":["../../../src/transport/in-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,6BAA6B,CAAC;AAG7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;;;;;;;;GASG;AACH,qBAAa,qBAAsB,SAAQ,UAAW,YAAW,aAAa;IAC5E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA0C;IAClE,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAEhC;gBAES,IAAI,EAAE;QAAE,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;KAAE;IAMhE,KAAK,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,QAAQ,CAAC;CAyB3D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transport/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/transport/shared/common/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,cAAc,CAAC;AAChD,eAAO,MAAM,kBAAkB,QAAS,CAAC;AAEzC,yFAAyF;AACzF,qBAAa,QAAQ;IACnB,MAAM,CAAC,QAAQ,CAAC,QAAQ,cAAc;IACtC,MAAM,CAAC,QAAQ,CAAC,MAAM,YAAY;IAClC,MAAM,CAAC,QAAQ,CAAC,QAAQ,cAAc;CACvC;AAED,qBAAa,mBAAmB;IAC9B,MAAM,CAAC,QAAQ,CAAC,OAAO,uBAAuB;IAC9C,MAAM,CAAC,QAAQ,CAAC,QAAQ,wBAAwB;IAChD,MAAM,CAAC,QAAQ,CAAC,KAAK,qBAAqB;CAC3C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/transport/shared/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/transport/shared/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEtE,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,OAAO,mBAAmB,CAAC,OAAO,CAAC;IAAC,QAAQ,EAAE,mBAAmB,CAAA;CAAE,GAC3E;IAAE,IAAI,EAAE,OAAO,mBAAmB,CAAC,QAAQ,CAAC;IAAC,QAAQ,EAAE,oBAAoB,CAAA;CAAE,GAC7E;IAAE,IAAI,EAAE,OAAO,mBAAmB,CAAC,KAAK,CAAC;IAAC,QAAQ,EAAE,iBAAiB,CAAA;CAAE,CAAC;AAE5E,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;IACtC,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,0BAA0B;IACzC,sGAAsG;IACtG,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,sFAAsF;IACtF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/transport/shared/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,YAAY,EAAE,0BAA0B,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../../src/transport/shared/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAgC,MAAM,6BAA6B,CAAC;AAGvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,OAAO,KAAK,EAEV,0BAA0B,EAC1B,QAAQ,EAET,MAAM,UAAU,CAAC;AAElB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAA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@@
1
- {"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../../src/transport/worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAY,MAAM,6BAA6B,CAAC;AAInE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAoBpD;;;;;;;;;GASG;AACH,qBAAa,kBAAmB,SAAQ,UAAW,YAAW,aAAa;IACzE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAEhC;IACH,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAsC;IAEtE,yGAAyG;IACzG,OAAO,CAAC,QAAQ,CAAS;IAEzB,yGAAyG;IACzG,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA4C;gBAE5D,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE;IAWxD,wHAAwH;IACxH,OAAO,CAAC,QAAQ,CAAC,WAAW,CAS1B;IAEF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAgC5B;IAEF;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CA+BhC;IAEF,oGAAoG;IACpG,OAAO,CAAC,kBAAkB;IAe1B;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAkBjC;IAEI,KAAK,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,QAAQ,CAAC;IA0E1D,2HAA2H;IAC3H,OAAO,CAAC,YAAY;IAOpB;;;OAGG;IACH,KAAK,IAAI,IAAI;CAoBd"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/applications/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/applications/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE;;;GAGG;AACH,MAAM,WAAW,yBAA0B,SAAQ,mBAAmB;IACpE,qMAAqM;IACrM,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/applications/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}