@lunora/runtime 1.0.0-alpha.2 → 1.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { toAirbyteMessages, toFivetranResponse } from './packem_shared/toAirbyteMessages-DrHdplb4.mjs';
|
|
2
|
-
export { composeWorker, createWorker, defineRpcEnvelope, withFrameworkWorker } from './packem_shared/composeWorker-
|
|
2
|
+
export { composeWorker, createWorker, defineRpcEnvelope, withFrameworkWorker } from './packem_shared/composeWorker-CjF1xUIO.mjs';
|
|
3
3
|
export { createCrossShardRelationCapabilities } from './packem_shared/createCrossShardRelationCapabilities-C0KOf7er.mjs';
|
|
4
4
|
export { DEFAULT_REGISTRY_CACHE_TTL_MS, SHARD_REGISTRY_DO_NAME, createDynamicShardRegistry } from './packem_shared/DEFAULT_REGISTRY_CACHE_TTL_MS-BpCwo_mo.mjs';
|
|
5
5
|
export { LunoraError, toErrorResponse } from './packem_shared/LunoraError-CL0aOtpo.mjs';
|
|
@@ -2377,6 +2377,7 @@ const createWorker = (options) => {
|
|
|
2377
2377
|
}
|
|
2378
2378
|
return authResponse;
|
|
2379
2379
|
};
|
|
2380
|
+
const customRoutes = options.routes !== void 0 && Object.keys(options.routes).length > 0 ? options.routes : void 0;
|
|
2380
2381
|
const internalRoutes = {
|
|
2381
2382
|
[WS_PATH]: (request, env, url) => handleWebSocketUpgrade(request, env, url),
|
|
2382
2383
|
[RPC_PATH]: (request, env, _url, context) => handleRpc(request, env, context),
|
|
@@ -2425,10 +2426,12 @@ const createWorker = (options) => {
|
|
|
2425
2426
|
if (authResponse) {
|
|
2426
2427
|
return authResponse;
|
|
2427
2428
|
}
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2429
|
+
if (customRoutes) {
|
|
2430
|
+
const methodAndPath = `${request.method} ${url.pathname}`;
|
|
2431
|
+
const route = customRoutes[methodAndPath] ?? customRoutes[url.pathname];
|
|
2432
|
+
if (route) {
|
|
2433
|
+
return route(request, env, context);
|
|
2434
|
+
}
|
|
2432
2435
|
}
|
|
2433
2436
|
const internalRoute = internalRoutes[url.pathname];
|
|
2434
2437
|
if (internalRoute) {
|