@dxos/functions 0.5.5-main.288794c → 0.5.5-main.7ae47fc
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/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +2 -4
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +2 -4
- package/dist/lib/node/testing/index.cjs.map +3 -3
- package/dist/types/src/testing/setup.d.ts.map +1 -1
- package/package.json +14 -14
- package/src/runtime/dev-server.test.ts +2 -2
- package/src/runtime/scheduler.test.ts +2 -4
- package/src/testing/setup.ts +3 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"inject-globals:@inject-globals":{"bytes":384,"imports":[{"path":"@dxos/node-std/inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/types.ts":{"bytes":9711,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/function/function-registry.ts":{"bytes":12532,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"../types"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/function/index.ts":{"bytes":529,"imports":[{"path":"packages/core/functions/src/function/function-registry.ts","kind":"import-statement","original":"./function-registry"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/handler.ts":{"bytes":9375,"imports":[{"path":"@braneframe/types","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/dev-server.ts":{"bytes":28578,"imports":[{"path":"express","kind":"import-statement","external":true},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@inject-globals","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/scheduler.ts":{"bytes":18003,"imports":[{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/index.ts":{"bytes":598,"imports":[{"path":"packages/core/functions/src/runtime/dev-server.ts","kind":"import-statement","original":"./dev-server"},{"path":"packages/core/functions/src/runtime/scheduler.ts","kind":"import-statement","original":"./scheduler"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/subscription-trigger.ts":{"bytes":10741,"imports":[{"path":"@braneframe/types","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/timer-trigger.ts":{"bytes":4173,"imports":[{"path":"cron","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/webhook-trigger.ts":{"bytes":4388,"imports":[{"path":"get-port-please","kind":"import-statement","external":true},{"path":"@dxos/node-std/http","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/websocket-trigger.ts":{"bytes":10551,"imports":[{"path":"ws","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/index.ts":{"bytes":865,"imports":[{"path":"packages/core/functions/src/trigger/type/subscription-trigger.ts","kind":"import-statement","original":"./subscription-trigger"},{"path":"packages/core/functions/src/trigger/type/timer-trigger.ts","kind":"import-statement","original":"./timer-trigger"},{"path":"packages/core/functions/src/trigger/type/webhook-trigger.ts","kind":"import-statement","original":"./webhook-trigger"},{"path":"packages/core/functions/src/trigger/type/websocket-trigger.ts","kind":"import-statement","original":"./websocket-trigger"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/trigger-registry.ts":{"bytes":27381,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/functions/src/trigger/type/index.ts","kind":"import-statement","original":"./type"},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"../types"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/index.ts":{"bytes":523,"imports":[{"path":"packages/core/functions/src/trigger/trigger-registry.ts","kind":"import-statement","original":"./trigger-registry"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/index.ts":{"bytes":837,"imports":[{"path":"packages/core/functions/src/function/index.ts","kind":"import-statement","original":"./function"},{"path":"packages/core/functions/src/handler.ts","kind":"import-statement","original":"./handler"},{"path":"packages/core/functions/src/runtime/index.ts","kind":"import-statement","original":"./runtime"},{"path":"packages/core/functions/src/trigger/index.ts","kind":"import-statement","original":"./trigger"},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"./types"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/testing/types.ts":{"bytes":1131,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/testing/setup.ts":{"bytes":12412,"imports":[{"path":"get-port-please","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/functions/src/testing/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/functions/src/function/index.ts","kind":"import-statement","original":"../function"},{"path":"packages/core/functions/src/runtime/index.ts","kind":"import-statement","original":"../runtime"},{"path":"packages/core/functions/src/trigger/index.ts","kind":"import-statement","original":"../trigger"},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"../types"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/testing/util.ts":{"bytes":4292,"imports":[{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"../types"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/testing/manifest.ts":{"bytes":1139,"imports":[{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/testing/index.ts":{"bytes":749,"imports":[{"path":"packages/core/functions/src/testing/setup.ts","kind":"import-statement","original":"./setup"},{"path":"packages/core/functions/src/testing/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/functions/src/testing/util.ts","kind":"import-statement","original":"./util"},{"path":"packages/core/functions/src/testing/manifest.ts","kind":"import-statement","original":"./manifest"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"packages/core/functions/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4964},"packages/core/functions/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-ERL6PHMU.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/browser/chunk-4D4I3YMJ.mjs","kind":"import-statement"},{"path":"@braneframe/types","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["DevServer","FUNCTION_SCHEMA","FunctionDef","FunctionManifestSchema","FunctionRegistry","FunctionTrigger","Scheduler","TriggerRegistry","subscriptionHandler"],"entryPoint":"packages/core/functions/src/index.ts","inputs":{"packages/core/functions/src/index.ts":{"bytesInOutput":0},"packages/core/functions/src/handler.ts":{"bytesInOutput":1694}},"bytes":2205},"packages/core/functions/dist/lib/browser/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9618},"packages/core/functions/dist/lib/browser/testing/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-ERL6PHMU.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/browser/chunk-4D4I3YMJ.mjs","kind":"import-statement"},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true}],"exports":["TestType","createFunctionRuntime","createInitializedClients","inviteMember","startFunctionsHost","testFunctionManifest","triggerWebhook"],"entryPoint":"packages/core/functions/src/testing/index.ts","inputs":{"packages/core/functions/src/testing/setup.ts":{"bytesInOutput":2726},"packages/core/functions/src/testing/types.ts":{"bytesInOutput":182},"packages/core/functions/src/testing/index.ts":{"bytesInOutput":0},"packages/core/functions/src/testing/util.ts":{"bytesInOutput":1034},"packages/core/functions/src/testing/manifest.ts":{"bytesInOutput":146}},"bytes":4738},"packages/core/functions/dist/lib/browser/chunk-ERL6PHMU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":54572},"packages/core/functions/dist/lib/browser/chunk-ERL6PHMU.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-4D4I3YMJ.mjs","kind":"import-statement"},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"express","kind":"import-statement","external":true},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@braneframe/types","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"cron","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"@dxos/node-std/http","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"ws","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["DevServer","FunctionRegistry","Scheduler","TriggerRegistry"],"inputs":{"packages/core/functions/src/function/function-registry.ts":{"bytesInOutput":2928},"packages/core/functions/src/function/index.ts":{"bytesInOutput":0},"packages/core/functions/src/runtime/dev-server.ts":{"bytesInOutput":7861},"packages/core/functions/src/runtime/scheduler.ts":{"bytesInOutput":4612},"packages/core/functions/src/runtime/index.ts":{"bytesInOutput":0},"packages/core/functions/src/trigger/trigger-registry.ts":{"bytesInOutput":6996},"packages/core/functions/src/trigger/type/subscription-trigger.ts":{"bytesInOutput":2371},"packages/core/functions/src/trigger/type/index.ts":{"bytesInOutput":0},"packages/core/functions/src/trigger/type/timer-trigger.ts":{"bytesInOutput":898},"packages/core/functions/src/trigger/type/webhook-trigger.ts":{"bytesInOutput":839},"packages/core/functions/src/trigger/type/websocket-trigger.ts":{"bytesInOutput":2837},"packages/core/functions/src/trigger/index.ts":{"bytesInOutput":0}},"bytes":30132},"packages/core/functions/dist/lib/browser/types.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/browser/types.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-4D4I3YMJ.mjs","kind":"import-statement"}],"exports":["FUNCTION_SCHEMA","FunctionDef","FunctionManifestSchema","FunctionTrigger"],"entryPoint":"packages/core/functions/src/types.ts","inputs":{},"bytes":276},"packages/core/functions/dist/lib/browser/chunk-4D4I3YMJ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5396},"packages/core/functions/dist/lib/browser/chunk-4D4I3YMJ.mjs":{"imports":[{"path":"@dxos/node-std/inject-globals","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["FUNCTION_SCHEMA","FunctionDef","FunctionManifestSchema","FunctionTrigger","__require"],"inputs":{"inject-globals:@inject-globals":{"bytesInOutput":90},"packages/core/functions/src/types.ts":{"bytesInOutput":1848}},"bytes":2564}}}
|
|
1
|
+
{"inputs":{"inject-globals:@inject-globals":{"bytes":384,"imports":[{"path":"@dxos/node-std/inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/types.ts":{"bytes":9711,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/function/function-registry.ts":{"bytes":12532,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"../types"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/function/index.ts":{"bytes":529,"imports":[{"path":"packages/core/functions/src/function/function-registry.ts","kind":"import-statement","original":"./function-registry"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/handler.ts":{"bytes":9375,"imports":[{"path":"@braneframe/types","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/dev-server.ts":{"bytes":28578,"imports":[{"path":"express","kind":"import-statement","external":true},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@inject-globals","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/scheduler.ts":{"bytes":18003,"imports":[{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/index.ts":{"bytes":598,"imports":[{"path":"packages/core/functions/src/runtime/dev-server.ts","kind":"import-statement","original":"./dev-server"},{"path":"packages/core/functions/src/runtime/scheduler.ts","kind":"import-statement","original":"./scheduler"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/subscription-trigger.ts":{"bytes":10741,"imports":[{"path":"@braneframe/types","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/timer-trigger.ts":{"bytes":4173,"imports":[{"path":"cron","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/webhook-trigger.ts":{"bytes":4388,"imports":[{"path":"get-port-please","kind":"import-statement","external":true},{"path":"@dxos/node-std/http","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/websocket-trigger.ts":{"bytes":10551,"imports":[{"path":"ws","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/index.ts":{"bytes":865,"imports":[{"path":"packages/core/functions/src/trigger/type/subscription-trigger.ts","kind":"import-statement","original":"./subscription-trigger"},{"path":"packages/core/functions/src/trigger/type/timer-trigger.ts","kind":"import-statement","original":"./timer-trigger"},{"path":"packages/core/functions/src/trigger/type/webhook-trigger.ts","kind":"import-statement","original":"./webhook-trigger"},{"path":"packages/core/functions/src/trigger/type/websocket-trigger.ts","kind":"import-statement","original":"./websocket-trigger"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/trigger-registry.ts":{"bytes":27381,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/functions/src/trigger/type/index.ts","kind":"import-statement","original":"./type"},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"../types"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/index.ts":{"bytes":523,"imports":[{"path":"packages/core/functions/src/trigger/trigger-registry.ts","kind":"import-statement","original":"./trigger-registry"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/index.ts":{"bytes":837,"imports":[{"path":"packages/core/functions/src/function/index.ts","kind":"import-statement","original":"./function"},{"path":"packages/core/functions/src/handler.ts","kind":"import-statement","original":"./handler"},{"path":"packages/core/functions/src/runtime/index.ts","kind":"import-statement","original":"./runtime"},{"path":"packages/core/functions/src/trigger/index.ts","kind":"import-statement","original":"./trigger"},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"./types"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/testing/types.ts":{"bytes":1131,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/testing/setup.ts":{"bytes":12011,"imports":[{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/functions/src/testing/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/functions/src/function/index.ts","kind":"import-statement","original":"../function"},{"path":"packages/core/functions/src/runtime/index.ts","kind":"import-statement","original":"../runtime"},{"path":"packages/core/functions/src/trigger/index.ts","kind":"import-statement","original":"../trigger"},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"../types"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/testing/util.ts":{"bytes":4292,"imports":[{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"../types"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/testing/manifest.ts":{"bytes":1139,"imports":[{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/testing/index.ts":{"bytes":749,"imports":[{"path":"packages/core/functions/src/testing/setup.ts","kind":"import-statement","original":"./setup"},{"path":"packages/core/functions/src/testing/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/functions/src/testing/util.ts","kind":"import-statement","original":"./util"},{"path":"packages/core/functions/src/testing/manifest.ts","kind":"import-statement","original":"./manifest"},{"path":"@inject-globals","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"packages/core/functions/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4964},"packages/core/functions/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-ERL6PHMU.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/browser/chunk-4D4I3YMJ.mjs","kind":"import-statement"},{"path":"@braneframe/types","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["DevServer","FUNCTION_SCHEMA","FunctionDef","FunctionManifestSchema","FunctionRegistry","FunctionTrigger","Scheduler","TriggerRegistry","subscriptionHandler"],"entryPoint":"packages/core/functions/src/index.ts","inputs":{"packages/core/functions/src/index.ts":{"bytesInOutput":0},"packages/core/functions/src/handler.ts":{"bytesInOutput":1694}},"bytes":2205},"packages/core/functions/dist/lib/browser/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9399},"packages/core/functions/dist/lib/browser/testing/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-ERL6PHMU.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/browser/chunk-4D4I3YMJ.mjs","kind":"import-statement"},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true}],"exports":["TestType","createFunctionRuntime","createInitializedClients","inviteMember","startFunctionsHost","testFunctionManifest","triggerWebhook"],"entryPoint":"packages/core/functions/src/testing/index.ts","inputs":{"packages/core/functions/src/testing/setup.ts":{"bytesInOutput":2603},"packages/core/functions/src/testing/types.ts":{"bytesInOutput":182},"packages/core/functions/src/testing/index.ts":{"bytesInOutput":0},"packages/core/functions/src/testing/util.ts":{"bytesInOutput":1034},"packages/core/functions/src/testing/manifest.ts":{"bytesInOutput":146}},"bytes":4615},"packages/core/functions/dist/lib/browser/chunk-ERL6PHMU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":54572},"packages/core/functions/dist/lib/browser/chunk-ERL6PHMU.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-4D4I3YMJ.mjs","kind":"import-statement"},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"express","kind":"import-statement","external":true},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/node-std/path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@braneframe/types","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"cron","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"@dxos/node-std/http","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"ws","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["DevServer","FunctionRegistry","Scheduler","TriggerRegistry"],"inputs":{"packages/core/functions/src/function/function-registry.ts":{"bytesInOutput":2928},"packages/core/functions/src/function/index.ts":{"bytesInOutput":0},"packages/core/functions/src/runtime/dev-server.ts":{"bytesInOutput":7861},"packages/core/functions/src/runtime/scheduler.ts":{"bytesInOutput":4612},"packages/core/functions/src/runtime/index.ts":{"bytesInOutput":0},"packages/core/functions/src/trigger/trigger-registry.ts":{"bytesInOutput":6996},"packages/core/functions/src/trigger/type/subscription-trigger.ts":{"bytesInOutput":2371},"packages/core/functions/src/trigger/type/index.ts":{"bytesInOutput":0},"packages/core/functions/src/trigger/type/timer-trigger.ts":{"bytesInOutput":898},"packages/core/functions/src/trigger/type/webhook-trigger.ts":{"bytesInOutput":839},"packages/core/functions/src/trigger/type/websocket-trigger.ts":{"bytesInOutput":2837},"packages/core/functions/src/trigger/index.ts":{"bytesInOutput":0}},"bytes":30132},"packages/core/functions/dist/lib/browser/types.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/browser/types.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-4D4I3YMJ.mjs","kind":"import-statement"}],"exports":["FUNCTION_SCHEMA","FunctionDef","FunctionManifestSchema","FunctionTrigger"],"entryPoint":"packages/core/functions/src/types.ts","inputs":{},"bytes":276},"packages/core/functions/dist/lib/browser/chunk-4D4I3YMJ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5396},"packages/core/functions/dist/lib/browser/chunk-4D4I3YMJ.mjs":{"imports":[{"path":"@dxos/node-std/inject-globals","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["FUNCTION_SCHEMA","FunctionDef","FunctionManifestSchema","FunctionTrigger","__require"],"inputs":{"inject-globals:@inject-globals":{"bytesInOutput":90},"packages/core/functions/src/types.ts":{"bytesInOutput":1848}},"bytes":2564}}}
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
} from "../chunk-4D4I3YMJ.mjs";
|
|
12
12
|
|
|
13
13
|
// packages/core/functions/src/testing/setup.ts
|
|
14
|
-
import { getRandomPort } from "get-port-please";
|
|
15
14
|
import path from "@dxos/node-std/path";
|
|
16
15
|
import { waitForCondition } from "@dxos/async";
|
|
17
16
|
import { Client, Config } from "@dxos/client";
|
|
@@ -28,6 +27,7 @@ var TestType = class extends TypedObject({
|
|
|
28
27
|
};
|
|
29
28
|
|
|
30
29
|
// packages/core/functions/src/testing/setup.ts
|
|
30
|
+
var functionsPort = 8081;
|
|
31
31
|
var createInitializedClients = async (testBuilder, count = 1, config) => {
|
|
32
32
|
const clients = range(count).map(() => new Client({
|
|
33
33
|
config,
|
|
@@ -44,7 +44,6 @@ var createInitializedClients = async (testBuilder, count = 1, config) => {
|
|
|
44
44
|
}));
|
|
45
45
|
};
|
|
46
46
|
var createFunctionRuntime = async (testBuilder, pluginInitializer) => {
|
|
47
|
-
const functionsPort = await getRandomPort("127.0.0.1");
|
|
48
47
|
const config = new Config({
|
|
49
48
|
runtime: {
|
|
50
49
|
agent: {
|
|
@@ -52,7 +51,7 @@ var createFunctionRuntime = async (testBuilder, pluginInitializer) => {
|
|
|
52
51
|
{
|
|
53
52
|
id: "dxos.org/agent/plugin/functions",
|
|
54
53
|
config: {
|
|
55
|
-
port: functionsPort
|
|
54
|
+
port: functionsPort++
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
57
|
]
|
|
@@ -91,7 +90,6 @@ var startScheduler = async (testBuilder, client, devServer, functionRegistry) =>
|
|
|
91
90
|
var startDevServer = async (testBuilder, client, functionRegistry, options) => {
|
|
92
91
|
const server = new DevServer(client, functionRegistry, {
|
|
93
92
|
baseDir: path.join(__dirname, "../testing"),
|
|
94
|
-
port: await getRandomPort("127.0.0.1"),
|
|
95
93
|
...options
|
|
96
94
|
});
|
|
97
95
|
await server.start();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/testing/setup.ts", "../../../../src/testing/types.ts", "../../../../src/testing/util.ts", "../../../../src/testing/manifest.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;AAIA,
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport path from 'node:path';\n\nimport { waitForCondition } from '@dxos/async';\nimport { Client, Config } from '@dxos/client';\nimport { type Space } from '@dxos/client/echo';\nimport { type TestBuilder } from '@dxos/client/testing';\nimport { range } from '@dxos/util';\n\nimport { TestType } from './types';\nimport { FunctionRegistry } from '../function';\nimport { DevServer, type DevServerOptions, Scheduler } from '../runtime';\nimport { TriggerRegistry } from '../trigger';\nimport { FunctionDef, FunctionTrigger } from '../types';\n\nlet functionsPort = 8081;\n\nexport type FunctionsPluginInitializer = (client: Client) => Promise<{ close: () => Promise<void> }>;\n\n// TODO(burdon): Extend/wrap TestBuilder.\n\nexport const createInitializedClients = async (testBuilder: TestBuilder, count: number = 1, config?: Config) => {\n const clients = range(count).map(() => new Client({ config, services: testBuilder.createLocalClientServices() }));\n testBuilder.ctx.onDispose(() => Promise.all(clients.map((client) => client.destroy())));\n return Promise.all(\n clients.map(async (client, index) => {\n await client.initialize();\n await client.halo.createIdentity({ displayName: `Peer ${index}` });\n client.addSchema(FunctionDef, FunctionTrigger, TestType);\n return client;\n }),\n );\n};\n\nexport const createFunctionRuntime = async (\n testBuilder: TestBuilder,\n pluginInitializer: FunctionsPluginInitializer,\n): Promise<Client> => {\n const config = new Config({\n runtime: {\n agent: {\n plugins: [{ id: 'dxos.org/agent/plugin/functions', config: { port: functionsPort++ } }],\n },\n },\n });\n\n const [client] = await createInitializedClients(testBuilder, 1, config);\n const plugin = await pluginInitializer(client);\n testBuilder.ctx.onDispose(() => plugin.close());\n return client;\n};\n\nexport const startFunctionsHost = async (\n testBuilder: TestBuilder,\n pluginInitializer: FunctionsPluginInitializer,\n options?: DevServerOptions,\n) => {\n const functionRuntime = await createFunctionRuntime(testBuilder, pluginInitializer);\n const functionsRegistry = new FunctionRegistry(functionRuntime);\n const devServer = await startDevServer(testBuilder, functionRuntime, functionsRegistry, options);\n const scheduler = await startScheduler(testBuilder, functionRuntime, devServer, functionsRegistry);\n return {\n scheduler,\n client: functionRuntime,\n waitHasActiveTriggers: async (space: Space) => {\n await waitForCondition({ condition: () => scheduler.triggers.getActiveTriggers(space).length > 0 });\n },\n };\n};\n\nconst startScheduler = async (\n testBuilder: TestBuilder,\n client: Client,\n devServer: DevServer,\n functionRegistry: FunctionRegistry,\n) => {\n const triggerRegistry = new TriggerRegistry(client);\n const scheduler = new Scheduler(functionRegistry, triggerRegistry, { endpoint: devServer.endpoint });\n await scheduler.start();\n testBuilder.ctx.onDispose(() => scheduler.stop());\n return scheduler;\n};\n\nconst startDevServer = async (\n testBuilder: TestBuilder,\n client: Client,\n functionRegistry: FunctionRegistry,\n options?: { baseDir?: string },\n) => {\n const server = new DevServer(client, functionRegistry, {\n baseDir: path.join(__dirname, '../testing'),\n ...options,\n });\n await server.start();\n testBuilder.ctx.onDispose(() => server.stop());\n return server;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { S, TypedObject } from '@dxos/echo-schema';\n\nexport class TestType extends TypedObject({ typename: 'example.com/type/Test', version: '0.1.0' })({\n title: S.string,\n}) {}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type { Client } from '@dxos/client';\nimport { Filter, type Space } from '@dxos/client/echo';\nimport { performInvitation } from '@dxos/client/testing';\nimport { invariant } from '@dxos/invariant';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\n\nimport { FunctionTrigger } from '../types';\n\nexport const triggerWebhook = async (space: Space, uri: string) => {\n const trigger = (\n await space.db.query(Filter.schema(FunctionTrigger, (t: FunctionTrigger) => t.function === uri)).run()\n ).objects[0];\n invariant(trigger.spec.type === 'webhook');\n void fetch(`http://localhost:${trigger.spec.port}`);\n};\n\nexport const inviteMember = async (host: Space, guest: Client) => {\n const [{ invitation: hostInvitation }] = await Promise.all(performInvitation({ host, guest: guest.spaces }));\n if (hostInvitation?.state !== Invitation.State.SUCCESS) {\n throw new Error(`Expected ${hostInvitation?.state} to be ${Invitation.State.SUCCESS}.`);\n }\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type { FunctionManifest } from '../types';\n\nexport const testFunctionManifest: FunctionManifest = {\n functions: [\n {\n uri: 'example.com/function/test',\n route: 'test',\n handler: 'test',\n },\n ],\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["path", "waitForCondition", "Client", "Config", "range", "S", "TypedObject", "TestType", "TypedObject", "typename", "version", "title", "S", "string", "functionsPort", "createInitializedClients", "testBuilder", "count", "config", "clients", "range", "map", "Client", "services", "createLocalClientServices", "ctx", "onDispose", "Promise", "all", "client", "destroy", "index", "initialize", "halo", "createIdentity", "displayName", "addSchema", "FunctionDef", "FunctionTrigger", "TestType", "createFunctionRuntime", "pluginInitializer", "Config", "runtime", "agent", "plugins", "id", "port", "plugin", "close", "startFunctionsHost", "options", "functionRuntime", "functionsRegistry", "FunctionRegistry", "devServer", "startDevServer", "scheduler", "startScheduler", "waitHasActiveTriggers", "space", "waitForCondition", "condition", "triggers", "getActiveTriggers", "length", "functionRegistry", "triggerRegistry", "TriggerRegistry", "Scheduler", "endpoint", "start", "stop", "server", "DevServer", "baseDir", "path", "join", "__dirname", "Filter", "performInvitation", "invariant", "Invitation", "triggerWebhook", "space", "uri", "trigger", "db", "query", "Filter", "schema", "FunctionTrigger", "t", "function", "run", "objects", "invariant", "spec", "type", "fetch", "port", "inviteMember", "host", "guest", "invitation", "hostInvitation", "Promise", "all", "performInvitation", "spaces", "state", "Invitation", "State", "SUCCESS", "Error", "testFunctionManifest", "functions", "uri", "route", "handler"]
|
|
7
7
|
}
|
package/dist/lib/node/meta.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/core/functions/src/types.ts":{"bytes":9711,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/function/function-registry.ts":{"bytes":12532,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/function/index.ts":{"bytes":529,"imports":[{"path":"packages/core/functions/src/function/function-registry.ts","kind":"import-statement","original":"./function-registry"}],"format":"esm"},"packages/core/functions/src/handler.ts":{"bytes":9375,"imports":[{"path":"@braneframe/types","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/dev-server.ts":{"bytes":28578,"imports":[{"path":"express","kind":"import-statement","external":true},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/scheduler.ts":{"bytes":18003,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/index.ts":{"bytes":598,"imports":[{"path":"packages/core/functions/src/runtime/dev-server.ts","kind":"import-statement","original":"./dev-server"},{"path":"packages/core/functions/src/runtime/scheduler.ts","kind":"import-statement","original":"./scheduler"}],"format":"esm"},"packages/core/functions/src/trigger/type/subscription-trigger.ts":{"bytes":10741,"imports":[{"path":"@braneframe/types","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/timer-trigger.ts":{"bytes":4173,"imports":[{"path":"cron","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/webhook-trigger.ts":{"bytes":4388,"imports":[{"path":"get-port-please","kind":"import-statement","external":true},{"path":"node:http","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/websocket-trigger.ts":{"bytes":10551,"imports":[{"path":"ws","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/index.ts":{"bytes":865,"imports":[{"path":"packages/core/functions/src/trigger/type/subscription-trigger.ts","kind":"import-statement","original":"./subscription-trigger"},{"path":"packages/core/functions/src/trigger/type/timer-trigger.ts","kind":"import-statement","original":"./timer-trigger"},{"path":"packages/core/functions/src/trigger/type/webhook-trigger.ts","kind":"import-statement","original":"./webhook-trigger"},{"path":"packages/core/functions/src/trigger/type/websocket-trigger.ts","kind":"import-statement","original":"./websocket-trigger"}],"format":"esm"},"packages/core/functions/src/trigger/trigger-registry.ts":{"bytes":27381,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/functions/src/trigger/type/index.ts","kind":"import-statement","original":"./type"},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/trigger/index.ts":{"bytes":523,"imports":[{"path":"packages/core/functions/src/trigger/trigger-registry.ts","kind":"import-statement","original":"./trigger-registry"}],"format":"esm"},"packages/core/functions/src/index.ts":{"bytes":837,"imports":[{"path":"packages/core/functions/src/function/index.ts","kind":"import-statement","original":"./function"},{"path":"packages/core/functions/src/handler.ts","kind":"import-statement","original":"./handler"},{"path":"packages/core/functions/src/runtime/index.ts","kind":"import-statement","original":"./runtime"},{"path":"packages/core/functions/src/trigger/index.ts","kind":"import-statement","original":"./trigger"},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/core/functions/src/testing/types.ts":{"bytes":1131,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/testing/setup.ts":{"bytes":12412,"imports":[{"path":"get-port-please","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/functions/src/testing/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/functions/src/function/index.ts","kind":"import-statement","original":"../function"},{"path":"packages/core/functions/src/runtime/index.ts","kind":"import-statement","original":"../runtime"},{"path":"packages/core/functions/src/trigger/index.ts","kind":"import-statement","original":"../trigger"},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/testing/util.ts":{"bytes":4292,"imports":[{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/testing/manifest.ts":{"bytes":1139,"imports":[],"format":"esm"},"packages/core/functions/src/testing/index.ts":{"bytes":749,"imports":[{"path":"packages/core/functions/src/testing/setup.ts","kind":"import-statement","original":"./setup"},{"path":"packages/core/functions/src/testing/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/functions/src/testing/util.ts","kind":"import-statement","original":"./util"},{"path":"packages/core/functions/src/testing/manifest.ts","kind":"import-statement","original":"./manifest"}],"format":"esm"}},"outputs":{"packages/core/functions/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4963},"packages/core/functions/dist/lib/node/index.cjs":{"imports":[{"path":"packages/core/functions/dist/lib/node/chunk-INM6XAL7.cjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node/chunk-3UYUR5N5.cjs","kind":"import-statement"},{"path":"@braneframe/types","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["DevServer","FUNCTION_SCHEMA","FunctionDef","FunctionManifestSchema","FunctionRegistry","FunctionTrigger","Scheduler","TriggerRegistry","subscriptionHandler"],"entryPoint":"packages/core/functions/src/index.ts","inputs":{"packages/core/functions/src/index.ts":{"bytesInOutput":0},"packages/core/functions/src/handler.ts":{"bytesInOutput":1694}},"bytes":2172},"packages/core/functions/dist/lib/node/testing/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9617},"packages/core/functions/dist/lib/node/testing/index.cjs":{"imports":[{"path":"packages/core/functions/dist/lib/node/chunk-INM6XAL7.cjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node/chunk-3UYUR5N5.cjs","kind":"import-statement"},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true}],"exports":["TestType","createFunctionRuntime","createInitializedClients","inviteMember","startFunctionsHost","testFunctionManifest","triggerWebhook"],"entryPoint":"packages/core/functions/src/testing/index.ts","inputs":{"packages/core/functions/src/testing/setup.ts":{"bytesInOutput":2716},"packages/core/functions/src/testing/types.ts":{"bytesInOutput":182},"packages/core/functions/src/testing/index.ts":{"bytesInOutput":0},"packages/core/functions/src/testing/util.ts":{"bytesInOutput":1034},"packages/core/functions/src/testing/manifest.ts":{"bytesInOutput":146}},"bytes":4695},"packages/core/functions/dist/lib/node/chunk-INM6XAL7.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":54571},"packages/core/functions/dist/lib/node/chunk-INM6XAL7.cjs":{"imports":[{"path":"packages/core/functions/dist/lib/node/chunk-3UYUR5N5.cjs","kind":"import-statement"},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"express","kind":"import-statement","external":true},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@braneframe/types","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"cron","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"node:http","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"ws","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["DevServer","FunctionRegistry","Scheduler","TriggerRegistry"],"inputs":{"packages/core/functions/src/function/function-registry.ts":{"bytesInOutput":2928},"packages/core/functions/src/function/index.ts":{"bytesInOutput":0},"packages/core/functions/src/runtime/dev-server.ts":{"bytesInOutput":7851},"packages/core/functions/src/runtime/scheduler.ts":{"bytesInOutput":4602},"packages/core/functions/src/runtime/index.ts":{"bytesInOutput":0},"packages/core/functions/src/trigger/trigger-registry.ts":{"bytesInOutput":6996},"packages/core/functions/src/trigger/type/subscription-trigger.ts":{"bytesInOutput":2371},"packages/core/functions/src/trigger/type/index.ts":{"bytesInOutput":0},"packages/core/functions/src/trigger/type/timer-trigger.ts":{"bytesInOutput":898},"packages/core/functions/src/trigger/type/webhook-trigger.ts":{"bytesInOutput":829},"packages/core/functions/src/trigger/type/websocket-trigger.ts":{"bytesInOutput":2837},"packages/core/functions/src/trigger/index.ts":{"bytesInOutput":0}},"bytes":30069},"packages/core/functions/dist/lib/node/types.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/node/types.cjs":{"imports":[{"path":"packages/core/functions/dist/lib/node/chunk-3UYUR5N5.cjs","kind":"import-statement"}],"exports":["FUNCTION_SCHEMA","FunctionDef","FunctionManifestSchema","FunctionTrigger"],"entryPoint":"packages/core/functions/src/types.ts","inputs":{},"bytes":243},"packages/core/functions/dist/lib/node/chunk-3UYUR5N5.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5388},"packages/core/functions/dist/lib/node/chunk-3UYUR5N5.cjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["FUNCTION_SCHEMA","FunctionDef","FunctionManifestSchema","FunctionTrigger","__require"],"inputs":{"packages/core/functions/src/types.ts":{"bytesInOutput":1848}},"bytes":2406}}}
|
|
1
|
+
{"inputs":{"packages/core/functions/src/types.ts":{"bytes":9711,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/function/function-registry.ts":{"bytes":12532,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/function/index.ts":{"bytes":529,"imports":[{"path":"packages/core/functions/src/function/function-registry.ts","kind":"import-statement","original":"./function-registry"}],"format":"esm"},"packages/core/functions/src/handler.ts":{"bytes":9375,"imports":[{"path":"@braneframe/types","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/dev-server.ts":{"bytes":28578,"imports":[{"path":"express","kind":"import-statement","external":true},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/scheduler.ts":{"bytes":18003,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/index.ts":{"bytes":598,"imports":[{"path":"packages/core/functions/src/runtime/dev-server.ts","kind":"import-statement","original":"./dev-server"},{"path":"packages/core/functions/src/runtime/scheduler.ts","kind":"import-statement","original":"./scheduler"}],"format":"esm"},"packages/core/functions/src/trigger/type/subscription-trigger.ts":{"bytes":10741,"imports":[{"path":"@braneframe/types","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/timer-trigger.ts":{"bytes":4173,"imports":[{"path":"cron","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/webhook-trigger.ts":{"bytes":4388,"imports":[{"path":"get-port-please","kind":"import-statement","external":true},{"path":"node:http","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/websocket-trigger.ts":{"bytes":10551,"imports":[{"path":"ws","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/index.ts":{"bytes":865,"imports":[{"path":"packages/core/functions/src/trigger/type/subscription-trigger.ts","kind":"import-statement","original":"./subscription-trigger"},{"path":"packages/core/functions/src/trigger/type/timer-trigger.ts","kind":"import-statement","original":"./timer-trigger"},{"path":"packages/core/functions/src/trigger/type/webhook-trigger.ts","kind":"import-statement","original":"./webhook-trigger"},{"path":"packages/core/functions/src/trigger/type/websocket-trigger.ts","kind":"import-statement","original":"./websocket-trigger"}],"format":"esm"},"packages/core/functions/src/trigger/trigger-registry.ts":{"bytes":27381,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/functions/src/trigger/type/index.ts","kind":"import-statement","original":"./type"},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/trigger/index.ts":{"bytes":523,"imports":[{"path":"packages/core/functions/src/trigger/trigger-registry.ts","kind":"import-statement","original":"./trigger-registry"}],"format":"esm"},"packages/core/functions/src/index.ts":{"bytes":837,"imports":[{"path":"packages/core/functions/src/function/index.ts","kind":"import-statement","original":"./function"},{"path":"packages/core/functions/src/handler.ts","kind":"import-statement","original":"./handler"},{"path":"packages/core/functions/src/runtime/index.ts","kind":"import-statement","original":"./runtime"},{"path":"packages/core/functions/src/trigger/index.ts","kind":"import-statement","original":"./trigger"},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/core/functions/src/testing/types.ts":{"bytes":1131,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/testing/setup.ts":{"bytes":12011,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/functions/src/testing/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/functions/src/function/index.ts","kind":"import-statement","original":"../function"},{"path":"packages/core/functions/src/runtime/index.ts","kind":"import-statement","original":"../runtime"},{"path":"packages/core/functions/src/trigger/index.ts","kind":"import-statement","original":"../trigger"},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/testing/util.ts":{"bytes":4292,"imports":[{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/testing/manifest.ts":{"bytes":1139,"imports":[],"format":"esm"},"packages/core/functions/src/testing/index.ts":{"bytes":749,"imports":[{"path":"packages/core/functions/src/testing/setup.ts","kind":"import-statement","original":"./setup"},{"path":"packages/core/functions/src/testing/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/functions/src/testing/util.ts","kind":"import-statement","original":"./util"},{"path":"packages/core/functions/src/testing/manifest.ts","kind":"import-statement","original":"./manifest"}],"format":"esm"}},"outputs":{"packages/core/functions/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4963},"packages/core/functions/dist/lib/node/index.cjs":{"imports":[{"path":"packages/core/functions/dist/lib/node/chunk-INM6XAL7.cjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node/chunk-3UYUR5N5.cjs","kind":"import-statement"},{"path":"@braneframe/types","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["DevServer","FUNCTION_SCHEMA","FunctionDef","FunctionManifestSchema","FunctionRegistry","FunctionTrigger","Scheduler","TriggerRegistry","subscriptionHandler"],"entryPoint":"packages/core/functions/src/index.ts","inputs":{"packages/core/functions/src/index.ts":{"bytesInOutput":0},"packages/core/functions/src/handler.ts":{"bytesInOutput":1694}},"bytes":2172},"packages/core/functions/dist/lib/node/testing/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9398},"packages/core/functions/dist/lib/node/testing/index.cjs":{"imports":[{"path":"packages/core/functions/dist/lib/node/chunk-INM6XAL7.cjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node/chunk-3UYUR5N5.cjs","kind":"import-statement"},{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true}],"exports":["TestType","createFunctionRuntime","createInitializedClients","inviteMember","startFunctionsHost","testFunctionManifest","triggerWebhook"],"entryPoint":"packages/core/functions/src/testing/index.ts","inputs":{"packages/core/functions/src/testing/setup.ts":{"bytesInOutput":2593},"packages/core/functions/src/testing/types.ts":{"bytesInOutput":182},"packages/core/functions/src/testing/index.ts":{"bytesInOutput":0},"packages/core/functions/src/testing/util.ts":{"bytesInOutput":1034},"packages/core/functions/src/testing/manifest.ts":{"bytesInOutput":146}},"bytes":4572},"packages/core/functions/dist/lib/node/chunk-INM6XAL7.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":54571},"packages/core/functions/dist/lib/node/chunk-INM6XAL7.cjs":{"imports":[{"path":"packages/core/functions/dist/lib/node/chunk-3UYUR5N5.cjs","kind":"import-statement"},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"express","kind":"import-statement","external":true},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@braneframe/types","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"cron","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"node:http","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"ws","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["DevServer","FunctionRegistry","Scheduler","TriggerRegistry"],"inputs":{"packages/core/functions/src/function/function-registry.ts":{"bytesInOutput":2928},"packages/core/functions/src/function/index.ts":{"bytesInOutput":0},"packages/core/functions/src/runtime/dev-server.ts":{"bytesInOutput":7851},"packages/core/functions/src/runtime/scheduler.ts":{"bytesInOutput":4602},"packages/core/functions/src/runtime/index.ts":{"bytesInOutput":0},"packages/core/functions/src/trigger/trigger-registry.ts":{"bytesInOutput":6996},"packages/core/functions/src/trigger/type/subscription-trigger.ts":{"bytesInOutput":2371},"packages/core/functions/src/trigger/type/index.ts":{"bytesInOutput":0},"packages/core/functions/src/trigger/type/timer-trigger.ts":{"bytesInOutput":898},"packages/core/functions/src/trigger/type/webhook-trigger.ts":{"bytesInOutput":829},"packages/core/functions/src/trigger/type/websocket-trigger.ts":{"bytesInOutput":2837},"packages/core/functions/src/trigger/index.ts":{"bytesInOutput":0}},"bytes":30069},"packages/core/functions/dist/lib/node/types.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/node/types.cjs":{"imports":[{"path":"packages/core/functions/dist/lib/node/chunk-3UYUR5N5.cjs","kind":"import-statement"}],"exports":["FUNCTION_SCHEMA","FunctionDef","FunctionManifestSchema","FunctionTrigger"],"entryPoint":"packages/core/functions/src/types.ts","inputs":{},"bytes":243},"packages/core/functions/dist/lib/node/chunk-3UYUR5N5.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5388},"packages/core/functions/dist/lib/node/chunk-3UYUR5N5.cjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["FUNCTION_SCHEMA","FunctionDef","FunctionManifestSchema","FunctionTrigger","__require"],"inputs":{"packages/core/functions/src/types.ts":{"bytesInOutput":1848}},"bytes":2406}}}
|
|
@@ -39,7 +39,6 @@ __export(testing_exports, {
|
|
|
39
39
|
module.exports = __toCommonJS(testing_exports);
|
|
40
40
|
var import_chunk_INM6XAL7 = require("../chunk-INM6XAL7.cjs");
|
|
41
41
|
var import_chunk_3UYUR5N5 = require("../chunk-3UYUR5N5.cjs");
|
|
42
|
-
var import_get_port_please = require("get-port-please");
|
|
43
42
|
var import_node_path = __toESM(require("node:path"));
|
|
44
43
|
var import_async = require("@dxos/async");
|
|
45
44
|
var import_client = require("@dxos/client");
|
|
@@ -56,6 +55,7 @@ var TestType = class extends (0, import_echo_schema.TypedObject)({
|
|
|
56
55
|
title: import_echo_schema.S.string
|
|
57
56
|
}) {
|
|
58
57
|
};
|
|
58
|
+
var functionsPort = 8081;
|
|
59
59
|
var createInitializedClients = async (testBuilder, count = 1, config) => {
|
|
60
60
|
const clients = (0, import_util.range)(count).map(() => new import_client.Client({
|
|
61
61
|
config,
|
|
@@ -72,7 +72,6 @@ var createInitializedClients = async (testBuilder, count = 1, config) => {
|
|
|
72
72
|
}));
|
|
73
73
|
};
|
|
74
74
|
var createFunctionRuntime = async (testBuilder, pluginInitializer) => {
|
|
75
|
-
const functionsPort = await (0, import_get_port_please.getRandomPort)("127.0.0.1");
|
|
76
75
|
const config = new import_client.Config({
|
|
77
76
|
runtime: {
|
|
78
77
|
agent: {
|
|
@@ -80,7 +79,7 @@ var createFunctionRuntime = async (testBuilder, pluginInitializer) => {
|
|
|
80
79
|
{
|
|
81
80
|
id: "dxos.org/agent/plugin/functions",
|
|
82
81
|
config: {
|
|
83
|
-
port: functionsPort
|
|
82
|
+
port: functionsPort++
|
|
84
83
|
}
|
|
85
84
|
}
|
|
86
85
|
]
|
|
@@ -119,7 +118,6 @@ var startScheduler = async (testBuilder, client, devServer, functionRegistry) =>
|
|
|
119
118
|
var startDevServer = async (testBuilder, client, functionRegistry, options) => {
|
|
120
119
|
const server = new import_chunk_INM6XAL7.DevServer(client, functionRegistry, {
|
|
121
120
|
baseDir: import_node_path.default.join(__dirname, "../testing"),
|
|
122
|
-
port: await (0, import_get_port_please.getRandomPort)("127.0.0.1"),
|
|
123
121
|
...options
|
|
124
122
|
});
|
|
125
123
|
await server.start();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/testing/setup.ts", "../../../../src/testing/types.ts", "../../../../src/testing/util.ts", "../../../../src/testing/manifest.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,
|
|
6
|
-
"names": ["TestType", "TypedObject", "typename", "version", "title", "S", "string", "createInitializedClients", "testBuilder", "count", "config", "clients", "range", "map", "Client", "services", "createLocalClientServices", "ctx", "onDispose", "Promise", "all", "client", "destroy", "index", "initialize", "halo", "createIdentity", "displayName", "addSchema", "FunctionDef", "FunctionTrigger", "createFunctionRuntime", "pluginInitializer", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport path from 'node:path';\n\nimport { waitForCondition } from '@dxos/async';\nimport { Client, Config } from '@dxos/client';\nimport { type Space } from '@dxos/client/echo';\nimport { type TestBuilder } from '@dxos/client/testing';\nimport { range } from '@dxos/util';\n\nimport { TestType } from './types';\nimport { FunctionRegistry } from '../function';\nimport { DevServer, type DevServerOptions, Scheduler } from '../runtime';\nimport { TriggerRegistry } from '../trigger';\nimport { FunctionDef, FunctionTrigger } from '../types';\n\nlet functionsPort = 8081;\n\nexport type FunctionsPluginInitializer = (client: Client) => Promise<{ close: () => Promise<void> }>;\n\n// TODO(burdon): Extend/wrap TestBuilder.\n\nexport const createInitializedClients = async (testBuilder: TestBuilder, count: number = 1, config?: Config) => {\n const clients = range(count).map(() => new Client({ config, services: testBuilder.createLocalClientServices() }));\n testBuilder.ctx.onDispose(() => Promise.all(clients.map((client) => client.destroy())));\n return Promise.all(\n clients.map(async (client, index) => {\n await client.initialize();\n await client.halo.createIdentity({ displayName: `Peer ${index}` });\n client.addSchema(FunctionDef, FunctionTrigger, TestType);\n return client;\n }),\n );\n};\n\nexport const createFunctionRuntime = async (\n testBuilder: TestBuilder,\n pluginInitializer: FunctionsPluginInitializer,\n): Promise<Client> => {\n const config = new Config({\n runtime: {\n agent: {\n plugins: [{ id: 'dxos.org/agent/plugin/functions', config: { port: functionsPort++ } }],\n },\n },\n });\n\n const [client] = await createInitializedClients(testBuilder, 1, config);\n const plugin = await pluginInitializer(client);\n testBuilder.ctx.onDispose(() => plugin.close());\n return client;\n};\n\nexport const startFunctionsHost = async (\n testBuilder: TestBuilder,\n pluginInitializer: FunctionsPluginInitializer,\n options?: DevServerOptions,\n) => {\n const functionRuntime = await createFunctionRuntime(testBuilder, pluginInitializer);\n const functionsRegistry = new FunctionRegistry(functionRuntime);\n const devServer = await startDevServer(testBuilder, functionRuntime, functionsRegistry, options);\n const scheduler = await startScheduler(testBuilder, functionRuntime, devServer, functionsRegistry);\n return {\n scheduler,\n client: functionRuntime,\n waitHasActiveTriggers: async (space: Space) => {\n await waitForCondition({ condition: () => scheduler.triggers.getActiveTriggers(space).length > 0 });\n },\n };\n};\n\nconst startScheduler = async (\n testBuilder: TestBuilder,\n client: Client,\n devServer: DevServer,\n functionRegistry: FunctionRegistry,\n) => {\n const triggerRegistry = new TriggerRegistry(client);\n const scheduler = new Scheduler(functionRegistry, triggerRegistry, { endpoint: devServer.endpoint });\n await scheduler.start();\n testBuilder.ctx.onDispose(() => scheduler.stop());\n return scheduler;\n};\n\nconst startDevServer = async (\n testBuilder: TestBuilder,\n client: Client,\n functionRegistry: FunctionRegistry,\n options?: { baseDir?: string },\n) => {\n const server = new DevServer(client, functionRegistry, {\n baseDir: path.join(__dirname, '../testing'),\n ...options,\n });\n await server.start();\n testBuilder.ctx.onDispose(() => server.stop());\n return server;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { S, TypedObject } from '@dxos/echo-schema';\n\nexport class TestType extends TypedObject({ typename: 'example.com/type/Test', version: '0.1.0' })({\n title: S.string,\n}) {}\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type { Client } from '@dxos/client';\nimport { Filter, type Space } from '@dxos/client/echo';\nimport { performInvitation } from '@dxos/client/testing';\nimport { invariant } from '@dxos/invariant';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\n\nimport { FunctionTrigger } from '../types';\n\nexport const triggerWebhook = async (space: Space, uri: string) => {\n const trigger = (\n await space.db.query(Filter.schema(FunctionTrigger, (t: FunctionTrigger) => t.function === uri)).run()\n ).objects[0];\n invariant(trigger.spec.type === 'webhook');\n void fetch(`http://localhost:${trigger.spec.port}`);\n};\n\nexport const inviteMember = async (host: Space, guest: Client) => {\n const [{ invitation: hostInvitation }] = await Promise.all(performInvitation({ host, guest: guest.spaces }));\n if (hostInvitation?.state !== Invitation.State.SUCCESS) {\n throw new Error(`Expected ${hostInvitation?.state} to be ${Invitation.State.SUCCESS}.`);\n }\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type { FunctionManifest } from '../types';\n\nexport const testFunctionManifest: FunctionManifest = {\n functions: [\n {\n uri: 'example.com/function/test',\n route: 'test',\n handler: 'test',\n },\n ],\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,uBAAiB;AAEjB,mBAAiC;AACjC,oBAA+B;AAG/B,kBAAsB;ACNtB,yBAA+B;ACC/B,kBAAmC;AACnC,qBAAkC;AAClC,uBAA0B;AAC1B,sBAA2B;ADFpB,IAAMA,WAAN,kBAAuBC,gCAAY;EAAEC,UAAU;EAAyBC,SAAS;AAAQ,CAAA,EAAG;EACjGC,OAAOC,qBAAEC;AACX,CAAA,EAAA;AAAI;ADUJ,IAAIC,gBAAgB;AAMb,IAAMC,2BAA2B,OAAOC,aAA0BC,QAAgB,GAAGC,WAAAA;AAC1F,QAAMC,cAAUC,mBAAMH,KAAAA,EAAOI,IAAI,MAAM,IAAIC,qBAAO;IAAEJ;IAAQK,UAAUP,YAAYQ,0BAAyB;EAAG,CAAA,CAAA;AAC9GR,cAAYS,IAAIC,UAAU,MAAMC,QAAQC,IAAIT,QAAQE,IAAI,CAACQ,WAAWA,OAAOC,QAAO,CAAA,CAAA,CAAA;AAClF,SAAOH,QAAQC,IACbT,QAAQE,IAAI,OAAOQ,QAAQE,UAAAA;AACzB,UAAMF,OAAOG,WAAU;AACvB,UAAMH,OAAOI,KAAKC,eAAe;MAAEC,aAAa,QAAQJ,KAAAA;IAAQ,CAAA;AAChEF,WAAOO,UAAUC,mCAAaC,uCAAiB/B,QAAAA;AAC/C,WAAOsB;EACT,CAAA,CAAA;AAEJ;AAEO,IAAMU,wBAAwB,OACnCvB,aACAwB,sBAAAA;AAEA,QAAMtB,SAAS,IAAIuB,qBAAO;IACxBC,SAAS;MACPC,OAAO;QACLC,SAAS;UAAC;YAAEC,IAAI;YAAmC3B,QAAQ;cAAE4B,MAAMhC;YAAgB;UAAE;;MACvF;IACF;EACF,CAAA;AAEA,QAAM,CAACe,MAAAA,IAAU,MAAMd,yBAAyBC,aAAa,GAAGE,MAAAA;AAChE,QAAM6B,SAAS,MAAMP,kBAAkBX,MAAAA;AACvCb,cAAYS,IAAIC,UAAU,MAAMqB,OAAOC,MAAK,CAAA;AAC5C,SAAOnB;AACT;AAEO,IAAMoB,qBAAqB,OAChCjC,aACAwB,mBACAU,YAAAA;AAEA,QAAMC,kBAAkB,MAAMZ,sBAAsBvB,aAAawB,iBAAAA;AACjE,QAAMY,oBAAoB,IAAIC,uCAAiBF,eAAAA;AAC/C,QAAMG,YAAY,MAAMC,eAAevC,aAAamC,iBAAiBC,mBAAmBF,OAAAA;AACxF,QAAMM,YAAY,MAAMC,eAAezC,aAAamC,iBAAiBG,WAAWF,iBAAAA;AAChF,SAAO;IACLI;IACA3B,QAAQsB;IACRO,uBAAuB,OAAOC,UAAAA;AAC5B,gBAAMC,+BAAiB;QAAEC,WAAW,MAAML,UAAUM,SAASC,kBAAkBJ,KAAAA,EAAOK,SAAS;MAAE,CAAA;IACnG;EACF;AACF;AAEA,IAAMP,iBAAiB,OACrBzC,aACAa,QACAyB,WACAW,qBAAAA;AAEA,QAAMC,kBAAkB,IAAIC,sCAAgBtC,MAAAA;AAC5C,QAAM2B,YAAY,IAAIY,gCAAUH,kBAAkBC,iBAAiB;IAAEG,UAAUf,UAAUe;EAAS,CAAA;AAClG,QAAMb,UAAUc,MAAK;AACrBtD,cAAYS,IAAIC,UAAU,MAAM8B,UAAUe,KAAI,CAAA;AAC9C,SAAOf;AACT;AAEA,IAAMD,iBAAiB,OACrBvC,aACAa,QACAoC,kBACAf,YAAAA;AAEA,QAAMsB,SAAS,IAAIC,gCAAU5C,QAAQoC,kBAAkB;IACrDS,SAASC,iBAAAA,QAAKC,KAAKC,WAAW,YAAA;IAC9B,GAAG3B;EACL,CAAA;AACA,QAAMsB,OAAOF,MAAK;AAClBtD,cAAYS,IAAIC,UAAU,MAAM8C,OAAOD,KAAI,CAAA;AAC3C,SAAOC;AACT;;AEvFO,IAAMM,iBAAiB,OAAOnB,OAAcoB,QAAAA;AACjD,QAAMC,WACJ,MAAMrB,MAAMsB,GAAGC,MAAMC,mBAAOC,OAAO9C,uCAAiB,CAAC+C,MAAuBA,EAAEC,aAAaP,GAAAA,CAAAA,EAAMQ,IAAG,GACpGC,QAAQ,CAAA;AACVC,kCAAUT,QAAQU,KAAKC,SAAS,WAAA,QAAA;;;;;;;;;AAChC,OAAKC,MAAM,oBAAoBZ,QAAQU,KAAK5C,IAAI,EAAE;AACpD;AAEO,IAAM+C,eAAe,OAAOC,MAAaC,UAAAA;AAC9C,QAAM,CAAC,EAAEC,YAAYC,eAAc,CAAE,IAAI,MAAMtE,QAAQC,QAAIsE,kCAAkB;IAAEJ;IAAMC,OAAOA,MAAMI;EAAO,CAAA,CAAA;AACzG,MAAIF,gBAAgBG,UAAUC,2BAAWC,MAAMC,SAAS;AACtD,UAAM,IAAIC,MAAM,YAAYP,gBAAgBG,KAAAA,UAAeC,2BAAWC,MAAMC,OAAO,GAAG;EACxF;AACF;ACnBO,IAAME,uBAAyC;EACpDC,WAAW;IACT;MACE3B,KAAK;MACL4B,OAAO;MACPC,SAAS;IACX;;AAEJ;",
|
|
6
|
+
"names": ["TestType", "TypedObject", "typename", "version", "title", "S", "string", "functionsPort", "createInitializedClients", "testBuilder", "count", "config", "clients", "range", "map", "Client", "services", "createLocalClientServices", "ctx", "onDispose", "Promise", "all", "client", "destroy", "index", "initialize", "halo", "createIdentity", "displayName", "addSchema", "FunctionDef", "FunctionTrigger", "createFunctionRuntime", "pluginInitializer", "Config", "runtime", "agent", "plugins", "id", "port", "plugin", "close", "startFunctionsHost", "options", "functionRuntime", "functionsRegistry", "FunctionRegistry", "devServer", "startDevServer", "scheduler", "startScheduler", "waitHasActiveTriggers", "space", "waitForCondition", "condition", "triggers", "getActiveTriggers", "length", "functionRegistry", "triggerRegistry", "TriggerRegistry", "Scheduler", "endpoint", "start", "stop", "server", "DevServer", "baseDir", "path", "join", "__dirname", "triggerWebhook", "uri", "trigger", "db", "query", "Filter", "schema", "t", "function", "run", "objects", "invariant", "spec", "type", "fetch", "inviteMember", "host", "guest", "invitation", "hostInvitation", "performInvitation", "spaces", "state", "Invitation", "State", "SUCCESS", "Error", "testFunctionManifest", "functions", "route", "handler"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../../src/testing/setup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../../src/testing/setup.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAKxD,OAAO,EAAa,KAAK,gBAAgB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAMzE,MAAM,MAAM,0BAA0B,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CAAC;AAIrG,eAAO,MAAM,wBAAwB,gBAAuB,WAAW,UAAS,MAAM,WAAe,MAAM,sBAW1G,CAAC;AAEF,eAAO,MAAM,qBAAqB,gBACnB,WAAW,qBACL,0BAA0B,KAC5C,QAAQ,MAAM,CAahB,CAAC;AAEF,eAAO,MAAM,kBAAkB,gBAChB,WAAW,qBACL,0BAA0B,YACnC,gBAAgB;;;mCASa,KAAK;EAI7C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/functions",
|
|
3
|
-
"version": "0.5.5-main.
|
|
3
|
+
"version": "0.5.5-main.7ae47fc",
|
|
4
4
|
"description": "Functions API and runtime.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -49,23 +49,23 @@
|
|
|
49
49
|
"express": "^4.19.2",
|
|
50
50
|
"get-port-please": "^3.1.1",
|
|
51
51
|
"ws": "^8.14.2",
|
|
52
|
-
"@
|
|
53
|
-
"@dxos/client": "0.5.5-main.
|
|
54
|
-
"@dxos/context": "0.5.5-main.
|
|
55
|
-
"@
|
|
56
|
-
"@dxos/echo-db": "0.5.5-main.
|
|
57
|
-
"@dxos/echo-schema": "0.5.5-main.
|
|
58
|
-
"@dxos/invariant": "0.5.5-main.
|
|
59
|
-
"@dxos/keys": "0.5.5-main.
|
|
60
|
-
"@dxos/log": "0.5.5-main.
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/util": "0.5.5-main.
|
|
52
|
+
"@dxos/async": "0.5.5-main.7ae47fc",
|
|
53
|
+
"@dxos/client": "0.5.5-main.7ae47fc",
|
|
54
|
+
"@dxos/context": "0.5.5-main.7ae47fc",
|
|
55
|
+
"@braneframe/types": "0.5.5-main.7ae47fc",
|
|
56
|
+
"@dxos/echo-db": "0.5.5-main.7ae47fc",
|
|
57
|
+
"@dxos/echo-schema": "0.5.5-main.7ae47fc",
|
|
58
|
+
"@dxos/invariant": "0.5.5-main.7ae47fc",
|
|
59
|
+
"@dxos/keys": "0.5.5-main.7ae47fc",
|
|
60
|
+
"@dxos/log": "0.5.5-main.7ae47fc",
|
|
61
|
+
"@dxos/protocols": "0.5.5-main.7ae47fc",
|
|
62
|
+
"@dxos/node-std": "0.5.5-main.7ae47fc",
|
|
63
|
+
"@dxos/util": "0.5.5-main.7ae47fc"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@types/express": "^4.17.17",
|
|
67
67
|
"@types/ws": "^7.4.0",
|
|
68
|
-
"@dxos/agent": "0.5.5-main.
|
|
68
|
+
"@dxos/agent": "0.5.5-main.7ae47fc"
|
|
69
69
|
},
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { expect } from 'chai';
|
|
6
|
-
import { getRandomPort } from 'get-port-please';
|
|
7
6
|
import path from 'path';
|
|
8
7
|
|
|
9
8
|
import { sleep, waitForCondition } from '@dxos/async';
|
|
@@ -17,6 +16,7 @@ import { createFunctionRuntime, testFunctionManifest } from '../testing';
|
|
|
17
16
|
import { initFunctionsPlugin } from '../testing/plugin-init';
|
|
18
17
|
|
|
19
18
|
describe('dev server', () => {
|
|
19
|
+
let port = 7201;
|
|
20
20
|
let client: Client;
|
|
21
21
|
let testBuilder: TestBuilder;
|
|
22
22
|
before(async () => {
|
|
@@ -67,7 +67,7 @@ describe('dev server', () => {
|
|
|
67
67
|
const registry = new FunctionRegistry(client);
|
|
68
68
|
const server = new DevServer(client, registry, {
|
|
69
69
|
baseDir: path.join(__dirname, '../testing'),
|
|
70
|
-
port:
|
|
70
|
+
port: port++,
|
|
71
71
|
});
|
|
72
72
|
const space = await client.spaces.create();
|
|
73
73
|
// TODO(burdon): Doesn't shut down cleanly.
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { expect } from 'chai';
|
|
6
|
-
import { getRandomPort } from 'get-port-please';
|
|
7
6
|
import WebSocket from 'ws';
|
|
8
7
|
|
|
9
8
|
import { Trigger } from '@dxos/async';
|
|
@@ -109,7 +108,6 @@ describe('scheduler', () => {
|
|
|
109
108
|
});
|
|
110
109
|
|
|
111
110
|
test('websocket', async () => {
|
|
112
|
-
const port = await getRandomPort('127.0.0.1');
|
|
113
111
|
const manifest: FunctionManifest = {
|
|
114
112
|
functions: [
|
|
115
113
|
{
|
|
@@ -125,7 +123,7 @@ describe('scheduler', () => {
|
|
|
125
123
|
spec: {
|
|
126
124
|
type: 'websocket',
|
|
127
125
|
// url: 'https://hub.dxos.network/api/mailbox/test',
|
|
128
|
-
url:
|
|
126
|
+
url: 'http://localhost:8081',
|
|
129
127
|
init: {
|
|
130
128
|
type: 'sync',
|
|
131
129
|
},
|
|
@@ -143,7 +141,7 @@ describe('scheduler', () => {
|
|
|
143
141
|
|
|
144
142
|
// Test server.
|
|
145
143
|
setTimeout(() => {
|
|
146
|
-
const wss = new WebSocket.Server({ port });
|
|
144
|
+
const wss = new WebSocket.Server({ port: 8081 });
|
|
147
145
|
wss.on('connection', (ws: WebSocket) => {
|
|
148
146
|
ws.on('message', (data) => {
|
|
149
147
|
const info = JSON.parse(new TextDecoder().decode(data as ArrayBuffer));
|
package/src/testing/setup.ts
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { getRandomPort } from 'get-port-please';
|
|
6
5
|
import path from 'node:path';
|
|
7
6
|
|
|
8
7
|
import { waitForCondition } from '@dxos/async';
|
|
@@ -17,6 +16,8 @@ import { DevServer, type DevServerOptions, Scheduler } from '../runtime';
|
|
|
17
16
|
import { TriggerRegistry } from '../trigger';
|
|
18
17
|
import { FunctionDef, FunctionTrigger } from '../types';
|
|
19
18
|
|
|
19
|
+
let functionsPort = 8081;
|
|
20
|
+
|
|
20
21
|
export type FunctionsPluginInitializer = (client: Client) => Promise<{ close: () => Promise<void> }>;
|
|
21
22
|
|
|
22
23
|
// TODO(burdon): Extend/wrap TestBuilder.
|
|
@@ -38,11 +39,10 @@ export const createFunctionRuntime = async (
|
|
|
38
39
|
testBuilder: TestBuilder,
|
|
39
40
|
pluginInitializer: FunctionsPluginInitializer,
|
|
40
41
|
): Promise<Client> => {
|
|
41
|
-
const functionsPort = await getRandomPort('127.0.0.1');
|
|
42
42
|
const config = new Config({
|
|
43
43
|
runtime: {
|
|
44
44
|
agent: {
|
|
45
|
-
plugins: [{ id: 'dxos.org/agent/plugin/functions', config: { port: functionsPort } }],
|
|
45
|
+
plugins: [{ id: 'dxos.org/agent/plugin/functions', config: { port: functionsPort++ } }],
|
|
46
46
|
},
|
|
47
47
|
},
|
|
48
48
|
});
|
|
@@ -92,7 +92,6 @@ const startDevServer = async (
|
|
|
92
92
|
) => {
|
|
93
93
|
const server = new DevServer(client, functionRegistry, {
|
|
94
94
|
baseDir: path.join(__dirname, '../testing'),
|
|
95
|
-
port: await getRandomPort('127.0.0.1'),
|
|
96
95
|
...options,
|
|
97
96
|
});
|
|
98
97
|
await server.start();
|