@dxos/functions 0.8.1-staging.391c573 → 0.8.1-staging.97aedb1
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/{chunk-M7ZGVWUZ.mjs → chunk-HI7YZO2K.mjs} +2 -2
- package/dist/lib/browser/{chunk-UMJKVIP4.mjs → chunk-LT4LR4VU.mjs} +11 -33
- package/dist/lib/browser/chunk-LT4LR4VU.mjs.map +7 -0
- package/dist/lib/browser/{chunk-RTBBW6RI.mjs → chunk-RVSG6WTL.mjs} +119 -18
- package/dist/lib/browser/chunk-RVSG6WTL.mjs.map +7 -0
- package/dist/lib/browser/edge/index.mjs +1 -1
- package/dist/lib/browser/index.mjs +11 -5
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +2 -2
- package/dist/lib/browser/types/index.mjs +9 -3
- package/dist/lib/node/{chunk-GX3ZLNHY.cjs → chunk-DSUGRAAL.cjs} +124 -20
- package/dist/lib/node/chunk-DSUGRAAL.cjs.map +7 -0
- package/dist/lib/node/{chunk-UHTKCFWT.cjs → chunk-NXZNXVT3.cjs} +15 -37
- package/dist/lib/node/chunk-NXZNXVT3.cjs.map +7 -0
- package/dist/lib/node/{chunk-AOKUMNKK.cjs → chunk-RXMCVAMJ.cjs} +15 -15
- package/dist/lib/node/edge/index.cjs +4 -4
- package/dist/lib/node/edge/index.cjs.map +1 -1
- package/dist/lib/node/index.cjs +35 -29
- package/dist/lib/node/index.cjs.map +2 -2
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +7 -7
- package/dist/lib/node/types/index.cjs +26 -20
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/{chunk-NALEEAQL.mjs → chunk-HBD2FZXO.mjs} +119 -18
- package/dist/lib/node-esm/chunk-HBD2FZXO.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-JDOIALGL.mjs → chunk-O2SXVYU5.mjs} +11 -33
- package/dist/lib/node-esm/chunk-O2SXVYU5.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-BYS52HOC.mjs → chunk-SQSJO5HI.mjs} +2 -2
- package/dist/lib/node-esm/edge/index.mjs +1 -1
- package/dist/lib/node-esm/index.mjs +11 -5
- package/dist/lib/node-esm/index.mjs.map +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +2 -2
- package/dist/lib/node-esm/types/index.mjs +9 -3
- package/dist/types/src/edge/functions.d.ts +3 -3
- package/dist/types/src/edge/functions.d.ts.map +1 -1
- package/dist/types/src/handler.d.ts +1 -1
- package/dist/types/src/handler.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +20 -26
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/types/trace.d.ts +102 -96
- package/dist/types/src/types/trace.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/package.json +18 -18
- package/src/edge/functions.ts +12 -29
- package/src/handler.ts +2 -2
- package/src/runtime/scheduler.test.ts +2 -1
- package/src/types/schema.ts +7 -7
- package/src/types/trace.ts +120 -8
- package/src/types/types.ts +2 -1
- package/dist/lib/browser/chunk-RTBBW6RI.mjs.map +0 -7
- package/dist/lib/browser/chunk-UMJKVIP4.mjs.map +0 -7
- package/dist/lib/node/chunk-GX3ZLNHY.cjs.map +0 -7
- package/dist/lib/node/chunk-UHTKCFWT.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-JDOIALGL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NALEEAQL.mjs.map +0 -7
- /package/dist/lib/browser/{chunk-M7ZGVWUZ.mjs.map → chunk-HI7YZO2K.mjs.map} +0 -0
- /package/dist/lib/node/{chunk-AOKUMNKK.cjs.map → chunk-RXMCVAMJ.cjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-BYS52HOC.mjs.map → chunk-SQSJO5HI.mjs.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/core/functions/src/bundler/bundler.ts":{"bytes":30383,"imports":[{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/bundler/index.ts":{"bytes":502,"imports":[{"path":"packages/core/functions/src/bundler/bundler.ts","kind":"import-statement","original":"./bundler"}],"format":"esm"},"packages/core/functions/src/edge/functions.ts":{"bytes":8798,"imports":[{"path":"@dxos/edge-client","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/edge/index.ts":{"bytes":501,"imports":[{"path":"packages/core/functions/src/edge/functions.ts","kind":"import-statement","original":"./functions"}],"format":"esm"},"packages/core/functions/src/types/schema.ts":{"bytes":4417,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/types/types.ts":{"bytes":16526,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/types/trace.ts":{"bytes":6233,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/core/functions/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/core/functions/src/types/url.ts":{"bytes":5599,"imports":[],"format":"esm"},"packages/core/functions/src/types/index.ts":{"bytes":740,"imports":[{"path":"packages/core/functions/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/core/functions/src/types/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/functions/src/types/trace.ts","kind":"import-statement","original":"./trace"},{"path":"packages/core/functions/src/types/url.ts","kind":"import-statement","original":"./url"}],"format":"esm"},"packages/core/functions/src/function/function-registry.ts":{"bytes":13004,"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/index.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":14006,"imports":[{"path":"effect","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/trigger/type/subscription-trigger.ts":{"bytes":10314,"imports":[{"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":4673,"imports":[{"path":"cron-schedule","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":751,"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"}],"format":"esm"},"packages/core/functions/src/trigger/trigger-registry.ts":{"bytes":28465,"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/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/trigger/index.ts":{"bytes":603,"imports":[{"path":"packages/core/functions/src/trigger/trigger-registry.ts","kind":"import-statement","original":"./trigger-registry"},{"path":"packages/core/functions/src/trigger/type/index.ts","kind":"import-statement","original":"./type"}],"format":"esm"},"packages/core/functions/src/index.ts":{"bytes":920,"imports":[{"path":"packages/core/functions/src/edge/index.ts","kind":"import-statement","original":"./edge"},{"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/trigger/index.ts","kind":"import-statement","original":"./trigger"},{"path":"packages/core/functions/src/types/index.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/runtime/dev-server.ts":{"bytes":28958,"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":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/scheduler.ts":{"bytes":21200,"imports":[{"path":"@dxos/node-std/path","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-protocol","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/testing/setup.ts":{"bytes":12707,"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/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/testing/util.ts":{"bytes":4310,"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/index.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/browser/bundler/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14437},"packages/core/functions/dist/lib/browser/bundler/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-XRCXIG74.mjs","kind":"import-statement"},{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["Bundler","initializeBundler"],"entryPoint":"packages/core/functions/src/bundler/index.ts","inputs":{"packages/core/functions/src/bundler/bundler.ts":{"bytesInOutput":7125},"packages/core/functions/src/bundler/index.ts":{"bytesInOutput":0}},"bytes":7319},"packages/core/functions/dist/lib/browser/edge/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/browser/edge/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-UMJKVIP4.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/browser/chunk-XRCXIG74.mjs","kind":"import-statement"}],"exports":["incrementSemverPatch","publicKeyToDid","uploadWorkerFunction"],"entryPoint":"packages/core/functions/src/edge/index.ts","inputs":{},"bytes":283},"packages/core/functions/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7875},"packages/core/functions/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-UMJKVIP4.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/browser/chunk-M7ZGVWUZ.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/browser/chunk-RTBBW6RI.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/browser/chunk-XRCXIG74.mjs","kind":"import-statement"},{"path":"effect","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":["FUNCTIONS_PRESET_META_KEY","FUNCTION_TYPES","FunctionDef","FunctionManifestSchema","FunctionRegistry","FunctionTrigger","FunctionTriggerSchema","FunctionType","InvocationOutcome","InvocationTraceEvent","ScriptType","TraceEvent","TraceEventException","TraceEventLog","TriggerKind","TriggerRegistry","TriggerSchema","createSubscriptionTrigger","createTimerTrigger","defineFunction","getInvocationUrl","getUserFunctionUrlInMetadata","incrementSemverPatch","publicKeyToDid","setUserFunctionUrlInMetadata","subscriptionHandler","uploadWorkerFunction"],"entryPoint":"packages/core/functions/src/index.ts","inputs":{"packages/core/functions/src/index.ts":{"bytesInOutput":0},"packages/core/functions/src/handler.ts":{"bytesInOutput":2076}},"bytes":3453},"packages/core/functions/dist/lib/browser/chunk-UMJKVIP4.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4472},"packages/core/functions/dist/lib/browser/chunk-UMJKVIP4.mjs":{"imports":[{"path":"@dxos/edge-client","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["incrementSemverPatch","publicKeyToDid","uploadWorkerFunction"],"inputs":{"packages/core/functions/src/edge/functions.ts":{"bytesInOutput":2251},"packages/core/functions/src/edge/index.ts":{"bytesInOutput":0}},"bytes":2456},"packages/core/functions/dist/lib/browser/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":32290},"packages/core/functions/dist/lib/browser/testing/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-M7ZGVWUZ.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/browser/chunk-RTBBW6RI.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/browser/chunk-XRCXIG74.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":"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/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-protocol","kind":"import-statement","external":true},{"path":"@dxos/log","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":2785},"packages/core/functions/src/testing/types.ts":{"bytesInOutput":182},"packages/core/functions/src/runtime/dev-server.ts":{"bytesInOutput":7870},"packages/core/functions/src/runtime/index.ts":{"bytesInOutput":0},"packages/core/functions/src/runtime/scheduler.ts":{"bytesInOutput":5374},"packages/core/functions/src/testing/index.ts":{"bytesInOutput":0},"packages/core/functions/src/testing/util.ts":{"bytesInOutput":1067},"packages/core/functions/src/testing/manifest.ts":{"bytesInOutput":146}},"bytes":18208},"packages/core/functions/dist/lib/browser/chunk-M7ZGVWUZ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":27170},"packages/core/functions/dist/lib/browser/chunk-M7ZGVWUZ.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-RTBBW6RI.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":"@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-schedule","kind":"import-statement","external":true},{"path":"@dxos/async","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}],"exports":["FunctionRegistry","TriggerRegistry","createSubscriptionTrigger","createTimerTrigger"],"inputs":{"packages/core/functions/src/function/function-registry.ts":{"bytesInOutput":3046},"packages/core/functions/src/function/index.ts":{"bytesInOutput":0},"packages/core/functions/src/trigger/type/subscription-trigger.ts":{"bytesInOutput":2007},"packages/core/functions/src/trigger/type/timer-trigger.ts":{"bytesInOutput":1086},"packages/core/functions/src/trigger/trigger-registry.ts":{"bytesInOutput":7538},"packages/core/functions/src/trigger/type/index.ts":{"bytesInOutput":0},"packages/core/functions/src/trigger/index.ts":{"bytesInOutput":0}},"bytes":14182},"packages/core/functions/dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/browser/types/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-RTBBW6RI.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/browser/chunk-XRCXIG74.mjs","kind":"import-statement"}],"exports":["FUNCTIONS_PRESET_META_KEY","FUNCTION_TYPES","FunctionDef","FunctionManifestSchema","FunctionTrigger","FunctionTriggerSchema","FunctionType","InvocationOutcome","InvocationTraceEvent","ScriptType","TraceEvent","TraceEventException","TraceEventLog","TriggerKind","TriggerSchema","getInvocationUrl","getUserFunctionUrlInMetadata","setUserFunctionUrlInMetadata"],"entryPoint":"packages/core/functions/src/types/index.ts","inputs":{},"bytes":905},"packages/core/functions/dist/lib/browser/chunk-RTBBW6RI.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":16778},"packages/core/functions/dist/lib/browser/chunk-RTBBW6RI.mjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["FUNCTIONS_PRESET_META_KEY","FUNCTION_TYPES","FunctionDef","FunctionManifestSchema","FunctionTrigger","FunctionTriggerSchema","FunctionType","InvocationOutcome","InvocationTraceEvent","ScriptType","TraceEvent","TraceEventException","TraceEventLog","TriggerKind","TriggerSchema","getInvocationUrl","getUserFunctionUrlInMetadata","setUserFunctionUrlInMetadata"],"inputs":{"packages/core/functions/src/types/schema.ts":{"bytesInOutput":1010},"packages/core/functions/src/types/index.ts":{"bytesInOutput":0},"packages/core/functions/src/types/types.ts":{"bytesInOutput":3644},"packages/core/functions/src/types/trace.ts":{"bytesInOutput":1485},"packages/core/functions/src/types/url.ts":{"bytesInOutput":1138}},"bytes":7930},"packages/core/functions/dist/lib/browser/chunk-XRCXIG74.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/browser/chunk-XRCXIG74.mjs":{"imports":[],"exports":["__require"],"inputs":{},"bytes":467}}}
|
|
1
|
+
{"inputs":{"packages/core/functions/src/bundler/bundler.ts":{"bytes":30383,"imports":[{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/bundler/index.ts":{"bytes":502,"imports":[{"path":"packages/core/functions/src/bundler/bundler.ts","kind":"import-statement","original":"./bundler"}],"format":"esm"},"packages/core/functions/src/edge/functions.ts":{"bytes":6587,"imports":[{"path":"@dxos/client/edge","kind":"import-statement","external":true},{"path":"@dxos/edge-client","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/edge/index.ts":{"bytes":501,"imports":[{"path":"packages/core/functions/src/edge/functions.ts","kind":"import-statement","original":"./functions"}],"format":"esm"},"packages/core/functions/src/types/schema.ts":{"bytes":4797,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/types/types.ts":{"bytes":16679,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/types/trace.ts":{"bytes":16307,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"packages/core/functions/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/core/functions/src/types/url.ts":{"bytes":5599,"imports":[],"format":"esm"},"packages/core/functions/src/types/index.ts":{"bytes":740,"imports":[{"path":"packages/core/functions/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/core/functions/src/types/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/functions/src/types/trace.ts","kind":"import-statement","original":"./trace"},{"path":"packages/core/functions/src/types/url.ts","kind":"import-statement","original":"./url"}],"format":"esm"},"packages/core/functions/src/function/function-registry.ts":{"bytes":13004,"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/index.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":14030,"imports":[{"path":"effect","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/trigger/type/subscription-trigger.ts":{"bytes":10314,"imports":[{"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":4673,"imports":[{"path":"cron-schedule","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":751,"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"}],"format":"esm"},"packages/core/functions/src/trigger/trigger-registry.ts":{"bytes":28465,"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/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/trigger/index.ts":{"bytes":603,"imports":[{"path":"packages/core/functions/src/trigger/trigger-registry.ts","kind":"import-statement","original":"./trigger-registry"},{"path":"packages/core/functions/src/trigger/type/index.ts","kind":"import-statement","original":"./type"}],"format":"esm"},"packages/core/functions/src/index.ts":{"bytes":920,"imports":[{"path":"packages/core/functions/src/edge/index.ts","kind":"import-statement","original":"./edge"},{"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/trigger/index.ts","kind":"import-statement","original":"./trigger"},{"path":"packages/core/functions/src/types/index.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/runtime/dev-server.ts":{"bytes":28958,"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":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/scheduler.ts":{"bytes":21200,"imports":[{"path":"@dxos/node-std/path","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-protocol","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/testing/setup.ts":{"bytes":12707,"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/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/testing/util.ts":{"bytes":4310,"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/index.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/browser/bundler/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14437},"packages/core/functions/dist/lib/browser/bundler/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-XRCXIG74.mjs","kind":"import-statement"},{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["Bundler","initializeBundler"],"entryPoint":"packages/core/functions/src/bundler/index.ts","inputs":{"packages/core/functions/src/bundler/bundler.ts":{"bytesInOutput":7125},"packages/core/functions/src/bundler/index.ts":{"bytesInOutput":0}},"bytes":7319},"packages/core/functions/dist/lib/browser/edge/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/browser/edge/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-LT4LR4VU.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/browser/chunk-XRCXIG74.mjs","kind":"import-statement"}],"exports":["incrementSemverPatch","publicKeyToDid","uploadWorkerFunction"],"entryPoint":"packages/core/functions/src/edge/index.ts","inputs":{},"bytes":283},"packages/core/functions/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7894},"packages/core/functions/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-LT4LR4VU.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/browser/chunk-HI7YZO2K.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/browser/chunk-RVSG6WTL.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/browser/chunk-XRCXIG74.mjs","kind":"import-statement"},{"path":"effect","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":["FUNCTIONS_PRESET_META_KEY","FUNCTION_TYPES","FunctionDef","FunctionManifestSchema","FunctionRegistry","FunctionTrigger","FunctionTriggerSchema","FunctionType","InvocationOutcome","InvocationTraceEndEvent","InvocationTraceEventType","InvocationTraceStartEvent","ScriptType","TraceEvent","TraceEventException","TraceEventLog","TriggerKind","TriggerRegistry","TriggerSchema","createInvocationSpans","createSubscriptionTrigger","createTimerTrigger","defineFunction","getInvocationUrl","getUserFunctionUrlInMetadata","incrementSemverPatch","publicKeyToDid","setUserFunctionUrlInMetadata","subscriptionHandler","uploadWorkerFunction"],"entryPoint":"packages/core/functions/src/index.ts","inputs":{"packages/core/functions/src/index.ts":{"bytesInOutput":0},"packages/core/functions/src/handler.ts":{"bytesInOutput":2076}},"bytes":3623},"packages/core/functions/dist/lib/browser/chunk-LT4LR4VU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3277},"packages/core/functions/dist/lib/browser/chunk-LT4LR4VU.mjs":{"imports":[{"path":"@dxos/client/edge","kind":"import-statement","external":true},{"path":"@dxos/edge-client","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["incrementSemverPatch","publicKeyToDid","uploadWorkerFunction"],"inputs":{"packages/core/functions/src/edge/functions.ts":{"bytesInOutput":1654},"packages/core/functions/src/edge/index.ts":{"bytesInOutput":0}},"bytes":1859},"packages/core/functions/dist/lib/browser/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":32290},"packages/core/functions/dist/lib/browser/testing/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-HI7YZO2K.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/browser/chunk-RVSG6WTL.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/browser/chunk-XRCXIG74.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":"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/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-protocol","kind":"import-statement","external":true},{"path":"@dxos/log","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":2785},"packages/core/functions/src/testing/types.ts":{"bytesInOutput":182},"packages/core/functions/src/runtime/dev-server.ts":{"bytesInOutput":7870},"packages/core/functions/src/runtime/index.ts":{"bytesInOutput":0},"packages/core/functions/src/runtime/scheduler.ts":{"bytesInOutput":5374},"packages/core/functions/src/testing/index.ts":{"bytesInOutput":0},"packages/core/functions/src/testing/util.ts":{"bytesInOutput":1067},"packages/core/functions/src/testing/manifest.ts":{"bytesInOutput":146}},"bytes":18208},"packages/core/functions/dist/lib/browser/chunk-HI7YZO2K.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":27170},"packages/core/functions/dist/lib/browser/chunk-HI7YZO2K.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-RVSG6WTL.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":"@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-schedule","kind":"import-statement","external":true},{"path":"@dxos/async","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}],"exports":["FunctionRegistry","TriggerRegistry","createSubscriptionTrigger","createTimerTrigger"],"inputs":{"packages/core/functions/src/function/function-registry.ts":{"bytesInOutput":3046},"packages/core/functions/src/function/index.ts":{"bytesInOutput":0},"packages/core/functions/src/trigger/type/subscription-trigger.ts":{"bytesInOutput":2007},"packages/core/functions/src/trigger/type/timer-trigger.ts":{"bytesInOutput":1086},"packages/core/functions/src/trigger/trigger-registry.ts":{"bytesInOutput":7538},"packages/core/functions/src/trigger/type/index.ts":{"bytesInOutput":0},"packages/core/functions/src/trigger/index.ts":{"bytesInOutput":0}},"bytes":14182},"packages/core/functions/dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/browser/types/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-RVSG6WTL.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/browser/chunk-XRCXIG74.mjs","kind":"import-statement"}],"exports":["FUNCTIONS_PRESET_META_KEY","FUNCTION_TYPES","FunctionDef","FunctionManifestSchema","FunctionTrigger","FunctionTriggerSchema","FunctionType","InvocationOutcome","InvocationTraceEndEvent","InvocationTraceEventType","InvocationTraceStartEvent","ScriptType","TraceEvent","TraceEventException","TraceEventLog","TriggerKind","TriggerSchema","createInvocationSpans","getInvocationUrl","getUserFunctionUrlInMetadata","setUserFunctionUrlInMetadata"],"entryPoint":"packages/core/functions/src/types/index.ts","inputs":{},"bytes":1075},"packages/core/functions/dist/lib/browser/chunk-RVSG6WTL.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":22238},"packages/core/functions/dist/lib/browser/chunk-RVSG6WTL.mjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["FUNCTIONS_PRESET_META_KEY","FUNCTION_TYPES","FunctionDef","FunctionManifestSchema","FunctionTrigger","FunctionTriggerSchema","FunctionType","InvocationOutcome","InvocationTraceEndEvent","InvocationTraceEventType","InvocationTraceStartEvent","ScriptType","TraceEvent","TraceEventException","TraceEventLog","TriggerKind","TriggerSchema","createInvocationSpans","getInvocationUrl","getUserFunctionUrlInMetadata","setUserFunctionUrlInMetadata"],"inputs":{"packages/core/functions/src/types/schema.ts":{"bytesInOutput":1084},"packages/core/functions/src/types/index.ts":{"bytesInOutput":0},"packages/core/functions/src/types/types.ts":{"bytesInOutput":3699},"packages/core/functions/src/types/trace.ts":{"bytesInOutput":4133},"packages/core/functions/src/types/url.ts":{"bytesInOutput":1138}},"bytes":10792},"packages/core/functions/dist/lib/browser/chunk-XRCXIG74.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/browser/chunk-XRCXIG74.mjs":{"imports":[],"exports":["__require"],"inputs":{},"bytes":467}}}
|
|
@@ -2,11 +2,11 @@ import "@dxos/node-std/globals";
|
|
|
2
2
|
import {
|
|
3
3
|
FunctionRegistry,
|
|
4
4
|
TriggerRegistry
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-HI7YZO2K.mjs";
|
|
6
6
|
import {
|
|
7
7
|
FunctionDef,
|
|
8
8
|
FunctionTrigger
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-RVSG6WTL.mjs";
|
|
10
10
|
import {
|
|
11
11
|
__require
|
|
12
12
|
} from "../chunk-XRCXIG74.mjs";
|
|
@@ -8,17 +8,20 @@ import {
|
|
|
8
8
|
FunctionTriggerSchema,
|
|
9
9
|
FunctionType,
|
|
10
10
|
InvocationOutcome,
|
|
11
|
-
|
|
11
|
+
InvocationTraceEndEvent,
|
|
12
|
+
InvocationTraceEventType,
|
|
13
|
+
InvocationTraceStartEvent,
|
|
12
14
|
ScriptType,
|
|
13
15
|
TraceEvent,
|
|
14
16
|
TraceEventException,
|
|
15
17
|
TraceEventLog,
|
|
16
18
|
TriggerKind,
|
|
17
19
|
TriggerSchema,
|
|
20
|
+
createInvocationSpans,
|
|
18
21
|
getInvocationUrl,
|
|
19
22
|
getUserFunctionUrlInMetadata,
|
|
20
23
|
setUserFunctionUrlInMetadata
|
|
21
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-RVSG6WTL.mjs";
|
|
22
25
|
import "../chunk-XRCXIG74.mjs";
|
|
23
26
|
export {
|
|
24
27
|
FUNCTIONS_PRESET_META_KEY,
|
|
@@ -29,13 +32,16 @@ export {
|
|
|
29
32
|
FunctionTriggerSchema,
|
|
30
33
|
FunctionType,
|
|
31
34
|
InvocationOutcome,
|
|
32
|
-
|
|
35
|
+
InvocationTraceEndEvent,
|
|
36
|
+
InvocationTraceEventType,
|
|
37
|
+
InvocationTraceStartEvent,
|
|
33
38
|
ScriptType,
|
|
34
39
|
TraceEvent,
|
|
35
40
|
TraceEventException,
|
|
36
41
|
TraceEventLog,
|
|
37
42
|
TriggerKind,
|
|
38
43
|
TriggerSchema,
|
|
44
|
+
createInvocationSpans,
|
|
39
45
|
getInvocationUrl,
|
|
40
46
|
getUserFunctionUrlInMetadata,
|
|
41
47
|
setUserFunctionUrlInMetadata
|
|
@@ -16,8 +16,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_DSUGRAAL_exports = {};
|
|
20
|
+
__export(chunk_DSUGRAAL_exports, {
|
|
21
21
|
FUNCTIONS_PRESET_META_KEY: () => FUNCTIONS_PRESET_META_KEY,
|
|
22
22
|
FUNCTION_TYPES: () => FUNCTION_TYPES,
|
|
23
23
|
FunctionDef: () => FunctionDef,
|
|
@@ -26,34 +26,39 @@ __export(chunk_GX3ZLNHY_exports, {
|
|
|
26
26
|
FunctionTriggerSchema: () => FunctionTriggerSchema,
|
|
27
27
|
FunctionType: () => FunctionType,
|
|
28
28
|
InvocationOutcome: () => InvocationOutcome,
|
|
29
|
-
|
|
29
|
+
InvocationTraceEndEvent: () => InvocationTraceEndEvent,
|
|
30
|
+
InvocationTraceEventType: () => InvocationTraceEventType,
|
|
31
|
+
InvocationTraceStartEvent: () => InvocationTraceStartEvent,
|
|
30
32
|
ScriptType: () => ScriptType,
|
|
31
33
|
TraceEvent: () => TraceEvent,
|
|
32
34
|
TraceEventException: () => TraceEventException,
|
|
33
35
|
TraceEventLog: () => TraceEventLog,
|
|
34
36
|
TriggerKind: () => TriggerKind,
|
|
35
37
|
TriggerSchema: () => TriggerSchema,
|
|
38
|
+
createInvocationSpans: () => createInvocationSpans,
|
|
36
39
|
getInvocationUrl: () => getInvocationUrl,
|
|
37
40
|
getUserFunctionUrlInMetadata: () => getUserFunctionUrlInMetadata,
|
|
38
41
|
setUserFunctionUrlInMetadata: () => setUserFunctionUrlInMetadata
|
|
39
42
|
});
|
|
40
|
-
module.exports = __toCommonJS(
|
|
43
|
+
module.exports = __toCommonJS(chunk_DSUGRAAL_exports);
|
|
41
44
|
var import_echo_schema = require("@dxos/echo-schema");
|
|
42
45
|
var import_schema = require("@dxos/schema");
|
|
43
46
|
var import_echo_schema2 = require("@dxos/echo-schema");
|
|
44
47
|
var import_echo_schema3 = require("@dxos/echo-schema");
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
version: "0.1.0"
|
|
48
|
-
})({
|
|
48
|
+
var import_log = require("@dxos/log");
|
|
49
|
+
var ScriptType = import_echo_schema.S.Struct({
|
|
49
50
|
name: import_echo_schema.S.optional(import_echo_schema.S.String),
|
|
50
51
|
description: import_echo_schema.S.optional(import_echo_schema.S.String),
|
|
51
52
|
// TODO(burdon): Change to hash of deployed content.
|
|
52
53
|
// Whether source has changed since last deploy.
|
|
53
54
|
changed: import_echo_schema.S.optional(import_echo_schema.S.Boolean),
|
|
54
55
|
source: (0, import_echo_schema.Ref)(import_schema.TextType)
|
|
55
|
-
})
|
|
56
|
-
|
|
56
|
+
}).annotations({
|
|
57
|
+
[import_echo_schema.LabelAnnotationId]: "name"
|
|
58
|
+
}).pipe((0, import_echo_schema.EchoObject)({
|
|
59
|
+
typename: "dxos.org/type/Script",
|
|
60
|
+
version: "0.1.0"
|
|
61
|
+
}));
|
|
57
62
|
var FunctionType = class extends (0, import_echo_schema.TypedObject)({
|
|
58
63
|
typename: "dxos.org/type/Function",
|
|
59
64
|
version: "0.1.0"
|
|
@@ -153,7 +158,8 @@ var FunctionTriggerSchema = import_echo_schema2.S.Struct({
|
|
|
153
158
|
})),
|
|
154
159
|
// TODO(burdon): Flatten entire schema.
|
|
155
160
|
spec: import_echo_schema2.S.optional(TriggerSchema),
|
|
156
|
-
// TODO(burdon): Get
|
|
161
|
+
// TODO(burdon): Get schema as partial from function.
|
|
162
|
+
// TODO(wittjosiah): Rename to payload.
|
|
157
163
|
// The `meta` property is merged into the event data passed to the function.
|
|
158
164
|
meta: import_echo_schema2.S.optional(import_echo_schema2.S.mutable(import_echo_schema2.S.Record({
|
|
159
165
|
key: import_echo_schema2.S.String,
|
|
@@ -183,26 +189,47 @@ var FUNCTION_TYPES = [
|
|
|
183
189
|
FunctionDef,
|
|
184
190
|
FunctionTrigger
|
|
185
191
|
];
|
|
192
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/functions/src/types/trace.ts";
|
|
186
193
|
var InvocationOutcome;
|
|
187
194
|
(function(InvocationOutcome2) {
|
|
188
195
|
InvocationOutcome2["SUCCESS"] = "success";
|
|
189
196
|
InvocationOutcome2["FAILURE"] = "failure";
|
|
197
|
+
InvocationOutcome2["PENDING"] = "pending";
|
|
190
198
|
})(InvocationOutcome || (InvocationOutcome = {}));
|
|
199
|
+
var InvocationTraceEventType;
|
|
200
|
+
(function(InvocationTraceEventType2) {
|
|
201
|
+
InvocationTraceEventType2["START"] = "start";
|
|
202
|
+
InvocationTraceEventType2["END"] = "end";
|
|
203
|
+
})(InvocationTraceEventType || (InvocationTraceEventType = {}));
|
|
191
204
|
var TraceEventException = import_echo_schema3.S.Struct({
|
|
192
205
|
timestampMs: import_echo_schema3.S.Number,
|
|
193
206
|
message: import_echo_schema3.S.String,
|
|
194
207
|
name: import_echo_schema3.S.String,
|
|
195
208
|
stack: import_echo_schema3.S.optional(import_echo_schema3.S.String)
|
|
196
209
|
});
|
|
197
|
-
var
|
|
210
|
+
var InvocationTraceStartEvent = import_echo_schema3.S.Struct({
|
|
211
|
+
/**
|
|
212
|
+
* Queue message id.
|
|
213
|
+
*/
|
|
198
214
|
id: import_echo_schema3.ObjectId,
|
|
215
|
+
type: import_echo_schema3.S.Literal("start"),
|
|
216
|
+
/**
|
|
217
|
+
* Invocation id, the same for invocation start and end events.
|
|
218
|
+
*/
|
|
219
|
+
invocationId: import_echo_schema3.ObjectId,
|
|
220
|
+
/**
|
|
221
|
+
* Event generation time.
|
|
222
|
+
*/
|
|
199
223
|
timestampMs: import_echo_schema3.S.Number,
|
|
200
|
-
|
|
224
|
+
/**
|
|
225
|
+
* Data passed to function / workflow as an argument.
|
|
226
|
+
*/
|
|
227
|
+
// TODO(burdon): Input schema?
|
|
201
228
|
input: import_echo_schema3.S.Object,
|
|
202
|
-
durationMs: import_echo_schema3.S.Number,
|
|
203
229
|
/**
|
|
204
230
|
* Queue DXN for function/workflow invocation events.
|
|
205
231
|
*/
|
|
232
|
+
// TODO(burdon): Need reference type for queue. vs. string?
|
|
206
233
|
invocationTraceQueue: (0, import_echo_schema3.Ref)(import_echo_schema3.Expando),
|
|
207
234
|
/**
|
|
208
235
|
* DXN of the invoked function/workflow.
|
|
@@ -211,12 +238,32 @@ var InvocationTraceEvent = import_echo_schema3.S.Struct({
|
|
|
211
238
|
/**
|
|
212
239
|
* Present for automatic invocations.
|
|
213
240
|
*/
|
|
214
|
-
trigger: import_echo_schema3.S.optional((0, import_echo_schema3.Ref)(FunctionTrigger))
|
|
241
|
+
trigger: import_echo_schema3.S.optional((0, import_echo_schema3.Ref)(FunctionTrigger))
|
|
242
|
+
}).pipe((0, import_echo_schema3.EchoObject)({
|
|
243
|
+
typename: "dxos.org/type/InvocationTraceStart",
|
|
244
|
+
version: "0.1.0"
|
|
245
|
+
}));
|
|
246
|
+
var InvocationTraceEndEvent = import_echo_schema3.S.Struct({
|
|
215
247
|
/**
|
|
216
|
-
*
|
|
248
|
+
* Trace event id.
|
|
217
249
|
*/
|
|
250
|
+
id: import_echo_schema3.ObjectId,
|
|
251
|
+
type: import_echo_schema3.S.Literal("end"),
|
|
252
|
+
/**
|
|
253
|
+
* Invocation id, will be the same for invocation start and end.
|
|
254
|
+
*/
|
|
255
|
+
invocationId: import_echo_schema3.ObjectId,
|
|
256
|
+
/**
|
|
257
|
+
* Event generation time.
|
|
258
|
+
*/
|
|
259
|
+
// TODO(burdon): Remove ms suffix.
|
|
260
|
+
timestampMs: import_echo_schema3.S.Number,
|
|
261
|
+
outcome: import_echo_schema3.S.Enums(InvocationOutcome),
|
|
218
262
|
exception: import_echo_schema3.S.optional(TraceEventException)
|
|
219
|
-
}).pipe((0, import_echo_schema3.EchoObject)(
|
|
263
|
+
}).pipe((0, import_echo_schema3.EchoObject)({
|
|
264
|
+
typename: "dxos.org/type/InvocationTraceEnd",
|
|
265
|
+
version: "0.1.0"
|
|
266
|
+
}));
|
|
220
267
|
var TraceEventLog = import_echo_schema3.S.Struct({
|
|
221
268
|
timestampMs: import_echo_schema3.S.Number,
|
|
222
269
|
level: import_echo_schema3.S.String,
|
|
@@ -225,6 +272,7 @@ var TraceEventLog = import_echo_schema3.S.Struct({
|
|
|
225
272
|
});
|
|
226
273
|
var TraceEvent = import_echo_schema3.S.Struct({
|
|
227
274
|
id: import_echo_schema3.ObjectId,
|
|
275
|
+
// TODO(burdon): Need enum/numeric result (not string).
|
|
228
276
|
outcome: import_echo_schema3.S.String,
|
|
229
277
|
truncated: import_echo_schema3.S.Boolean,
|
|
230
278
|
/**
|
|
@@ -233,7 +281,60 @@ var TraceEvent = import_echo_schema3.S.Struct({
|
|
|
233
281
|
ingestionTimestampMs: import_echo_schema3.S.Number,
|
|
234
282
|
logs: import_echo_schema3.S.Array(TraceEventLog),
|
|
235
283
|
exceptions: import_echo_schema3.S.Array(TraceEventException)
|
|
236
|
-
}).pipe((0, import_echo_schema3.EchoObject)(
|
|
284
|
+
}).pipe((0, import_echo_schema3.EchoObject)({
|
|
285
|
+
typename: "dxos.org/type/TraceEvent",
|
|
286
|
+
version: "0.1.0"
|
|
287
|
+
}));
|
|
288
|
+
var createInvocationSpans = (items) => {
|
|
289
|
+
if (!items) {
|
|
290
|
+
return [];
|
|
291
|
+
}
|
|
292
|
+
const eventsByInvocationId = /* @__PURE__ */ new Map();
|
|
293
|
+
for (const event of items) {
|
|
294
|
+
if (!("invocationId" in event)) {
|
|
295
|
+
continue;
|
|
296
|
+
}
|
|
297
|
+
const invocationId = event.invocationId;
|
|
298
|
+
const entry = eventsByInvocationId.get(invocationId) || {
|
|
299
|
+
start: void 0,
|
|
300
|
+
end: void 0
|
|
301
|
+
};
|
|
302
|
+
if (event.type === "start") {
|
|
303
|
+
entry.start = event;
|
|
304
|
+
} else if (event.type === "end") {
|
|
305
|
+
entry.end = event;
|
|
306
|
+
}
|
|
307
|
+
eventsByInvocationId.set(invocationId, entry);
|
|
308
|
+
}
|
|
309
|
+
const now = Date.now();
|
|
310
|
+
const result = [];
|
|
311
|
+
for (const [invocationId, { start, end }] of eventsByInvocationId.entries()) {
|
|
312
|
+
if (!start) {
|
|
313
|
+
import_log.log.warn("found end event without matching start", {
|
|
314
|
+
invocationId
|
|
315
|
+
}, {
|
|
316
|
+
F: __dxlog_file,
|
|
317
|
+
L: 158,
|
|
318
|
+
S: void 0,
|
|
319
|
+
C: (f, a) => f(...a)
|
|
320
|
+
});
|
|
321
|
+
continue;
|
|
322
|
+
}
|
|
323
|
+
const isInProgress = end === void 0;
|
|
324
|
+
result.push({
|
|
325
|
+
id: invocationId,
|
|
326
|
+
timestampMs: start.timestampMs,
|
|
327
|
+
durationMs: isInProgress ? now - start.timestampMs : end.timestampMs - start.timestampMs,
|
|
328
|
+
outcome: end?.outcome ?? "pending",
|
|
329
|
+
exception: end?.exception,
|
|
330
|
+
input: start.input,
|
|
331
|
+
invocationTraceQueue: start.invocationTraceQueue,
|
|
332
|
+
invocationTarget: start.invocationTarget,
|
|
333
|
+
trigger: start.trigger
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
return result;
|
|
337
|
+
};
|
|
237
338
|
var FUNCTIONS_META_KEY = "dxos.org/service/function";
|
|
238
339
|
var FUNCTIONS_PRESET_META_KEY = "dxos.org/service/function-preset";
|
|
239
340
|
var isSecure = (protocol) => {
|
|
@@ -274,15 +375,18 @@ var getInvocationUrl = (functionUrl, edgeUrl, options = {}) => {
|
|
|
274
375
|
FunctionTriggerSchema,
|
|
275
376
|
FunctionType,
|
|
276
377
|
InvocationOutcome,
|
|
277
|
-
|
|
378
|
+
InvocationTraceEndEvent,
|
|
379
|
+
InvocationTraceEventType,
|
|
380
|
+
InvocationTraceStartEvent,
|
|
278
381
|
ScriptType,
|
|
279
382
|
TraceEvent,
|
|
280
383
|
TraceEventException,
|
|
281
384
|
TraceEventLog,
|
|
282
385
|
TriggerKind,
|
|
283
386
|
TriggerSchema,
|
|
387
|
+
createInvocationSpans,
|
|
284
388
|
getInvocationUrl,
|
|
285
389
|
getUserFunctionUrlInMetadata,
|
|
286
390
|
setUserFunctionUrlInMetadata
|
|
287
391
|
});
|
|
288
|
-
//# sourceMappingURL=chunk-
|
|
392
|
+
//# sourceMappingURL=chunk-DSUGRAAL.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/schema.ts", "../../../src/types/types.ts", "../../../src/types/trace.ts", "../../../src/types/url.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { EchoObject, JsonSchemaType, LabelAnnotationId, Ref, S, TypedObject } from '@dxos/echo-schema';\nimport { TextType } from '@dxos/schema';\n\n/**\n * Source script.\n */\nexport const ScriptType = S.Struct({\n name: S.optional(S.String),\n description: S.optional(S.String),\n // TODO(burdon): Change to hash of deployed content.\n // Whether source has changed since last deploy.\n changed: S.optional(S.Boolean),\n source: Ref(TextType),\n})\n .annotations({ [LabelAnnotationId]: 'name' })\n .pipe(EchoObject({ typename: 'dxos.org/type/Script', version: '0.1.0' }));\n\nexport type ScriptType = S.Schema.Type<typeof ScriptType>;\n\n/**\n * Function deployment.\n */\nexport class FunctionType extends TypedObject({\n typename: 'dxos.org/type/Function',\n version: '0.1.0',\n})({\n // TODO(burdon): Rename to id/uri?\n name: S.NonEmptyString,\n version: S.String,\n\n description: S.optional(S.String),\n\n // Reference to a source script if it exists within ECHO.\n // TODO(burdon): Don't ref ScriptType directly (core).\n source: S.optional(Ref(ScriptType)),\n\n inputSchema: S.optional(JsonSchemaType),\n outputSchema: S.optional(JsonSchemaType),\n\n // Local binding to a function name.\n binding: S.optional(S.String),\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { AST, OptionsAnnotationId, RawObject, S, TypedObject, DXN } from '@dxos/echo-schema';\n\n/**\n * Type discriminator for TriggerType.\n * Every spec has a type field of type TriggerKind that we can use to understand which type we're working with.\n * https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions\n */\nexport enum TriggerKind {\n Timer = 'timer',\n Webhook = 'webhook',\n Subscription = 'subscription',\n Email = 'email',\n Queue = 'queue',\n}\n\n// TODO(burdon): Rename prop kind.\nconst typeLiteralAnnotations = { [AST.TitleAnnotationId]: 'Type' };\n\n/**\n * Cron timer.\n */\nconst TimerTriggerSchema = S.Struct({\n type: S.Literal(TriggerKind.Timer).annotations(typeLiteralAnnotations),\n cron: S.String.annotations({\n [AST.TitleAnnotationId]: 'Cron',\n [AST.ExamplesAnnotationId]: ['0 0 * * *'],\n }),\n}).pipe(S.mutable);\n\nexport type TimerTrigger = S.Schema.Type<typeof TimerTriggerSchema>;\n\nconst EmailTriggerSchema = S.Struct({\n type: S.Literal(TriggerKind.Email).annotations(typeLiteralAnnotations),\n}).pipe(S.mutable);\n\nexport type EmailTrigger = S.Schema.Type<typeof EmailTriggerSchema>;\n\nconst QueueTriggerSchema = S.Struct({\n type: S.Literal(TriggerKind.Queue).annotations(typeLiteralAnnotations),\n queue: DXN,\n}).pipe(S.mutable);\n\nexport type QueueTrigger = S.Schema.Type<typeof QueueTriggerSchema>;\n\n/**\n * Webhook.\n */\nconst WebhookTriggerSchema = S.Struct({\n type: S.Literal(TriggerKind.Webhook).annotations(typeLiteralAnnotations),\n method: S.optional(\n S.String.annotations({\n [AST.TitleAnnotationId]: 'Method',\n [OptionsAnnotationId]: ['GET', 'POST'],\n }),\n ),\n port: S.optional(\n S.Number.annotations({\n [AST.TitleAnnotationId]: 'Port',\n }),\n ),\n}).pipe(S.mutable);\n\nexport type WebhookTrigger = S.Schema.Type<typeof WebhookTriggerSchema>;\n\n// TODO(burdon): Use ECHO definition (from https://github.com/dxos/dxos/pull/8233).\nconst QuerySchema = S.Struct({\n type: S.optional(S.String.annotations({ [AST.TitleAnnotationId]: 'Type' })),\n props: S.optional(S.Record({ key: S.String, value: S.Any })),\n}).annotations({ [AST.TitleAnnotationId]: 'Query' });\n\n/**\n * Subscription.\n */\nconst SubscriptionTriggerSchema = S.Struct({\n type: S.Literal(TriggerKind.Subscription).annotations(typeLiteralAnnotations),\n // TODO(burdon): Define query DSL (from ECHO). Reconcile with Table.Query.\n filter: QuerySchema,\n options: S.optional(\n S.Struct({\n // Watch changes to object (not just creation).\n deep: S.optional(S.Boolean.annotations({ [AST.TitleAnnotationId]: 'Nested' })),\n // Debounce changes (delay in ms).\n delay: S.optional(S.Number.annotations({ [AST.TitleAnnotationId]: 'Delay' })),\n }).annotations({ [AST.TitleAnnotationId]: 'Options' }),\n ),\n}).pipe(S.mutable);\n\nexport type SubscriptionTrigger = S.Schema.Type<typeof SubscriptionTriggerSchema>;\n\n/**\n * Trigger schema (discriminated union).\n */\nexport const TriggerSchema = S.Union(\n TimerTriggerSchema,\n WebhookTriggerSchema,\n SubscriptionTriggerSchema,\n EmailTriggerSchema,\n QueueTriggerSchema,\n).annotations({\n [AST.TitleAnnotationId]: 'Trigger',\n});\n\nexport type TriggerType = S.Schema.Type<typeof TriggerSchema>;\n\n/**\n * Function trigger.\n */\nexport const FunctionTriggerSchema = S.Struct({\n // TODO(burdon): What type does this reference.\n // TODO(wittjosiah): This should probably be a Ref?\n function: S.optional(S.String.annotations({ [AST.TitleAnnotationId]: 'Function' })),\n\n enabled: S.optional(S.Boolean.annotations({ [AST.TitleAnnotationId]: 'Enabled' })),\n\n // TODO(burdon): Flatten entire schema.\n spec: S.optional(TriggerSchema),\n\n // TODO(burdon): Get schema as partial from function.\n // TODO(wittjosiah): Rename to payload.\n // The `meta` property is merged into the event data passed to the function.\n meta: S.optional(S.mutable(S.Record({ key: S.String, value: S.Any }))),\n});\n\nexport type FunctionTriggerType = S.Schema.Type<typeof FunctionTriggerSchema>;\n\n/**\n * Function trigger.\n */\nexport class FunctionTrigger extends TypedObject({\n typename: 'dxos.org/type/FunctionTrigger',\n version: '0.1.0',\n})(FunctionTriggerSchema.fields) {}\n\n/**\n * Function definition.\n * @deprecated (Use dxos.org/type/Function)\n */\n// TODO(burdon): Reconcile with FunctionType.\nexport class FunctionDef extends TypedObject({\n typename: 'dxos.org/type/FunctionDef',\n version: '0.1.0',\n})({\n uri: S.String,\n description: S.optional(S.String),\n route: S.String,\n handler: S.String,\n}) {}\n\n/**\n * Function manifest file.\n */\nexport const FunctionManifestSchema = S.Struct({\n functions: S.optional(S.mutable(S.Array(RawObject(FunctionDef)))),\n triggers: S.optional(S.mutable(S.Array(RawObject(FunctionTrigger)))),\n});\n\nexport type FunctionManifest = S.Schema.Type<typeof FunctionManifestSchema>;\n\nexport const FUNCTION_TYPES = [FunctionDef, FunctionTrigger];\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { EchoObject, Expando, ObjectId, Ref, S } from '@dxos/echo-schema';\nimport { log } from '@dxos/log';\n\nimport { FunctionTrigger, type FunctionTriggerType } from './types';\n\nexport enum InvocationOutcome {\n SUCCESS = 'success',\n FAILURE = 'failure',\n PENDING = 'pending',\n}\n\n// TODO(burdon): Convert to extensible discriminated union of EDGE events.\nexport enum InvocationTraceEventType {\n START = 'start',\n END = 'end',\n}\n\nexport const TraceEventException = S.Struct({\n timestampMs: S.Number,\n message: S.String,\n name: S.String,\n stack: S.optional(S.String),\n});\nexport type TraceEventException = S.Schema.Type<typeof TraceEventException>;\n\nexport const InvocationTraceStartEvent = S.Struct({\n /**\n * Queue message id.\n */\n id: ObjectId,\n type: S.Literal(InvocationTraceEventType.START),\n /**\n * Invocation id, the same for invocation start and end events.\n */\n invocationId: ObjectId,\n /**\n * Event generation time.\n */\n timestampMs: S.Number,\n /**\n * Data passed to function / workflow as an argument.\n */\n // TODO(burdon): Input schema?\n input: S.Object,\n /**\n * Queue DXN for function/workflow invocation events.\n */\n // TODO(burdon): Need reference type for queue. vs. string?\n invocationTraceQueue: Ref(Expando),\n /**\n * DXN of the invoked function/workflow.\n */\n invocationTarget: Ref(Expando),\n /**\n * Present for automatic invocations.\n */\n trigger: S.optional(Ref(FunctionTrigger)),\n}).pipe(EchoObject({ typename: 'dxos.org/type/InvocationTraceStart', version: '0.1.0' }));\n\nexport type InvocationTraceStartEvent = S.Schema.Type<typeof InvocationTraceStartEvent>;\n\nexport const InvocationTraceEndEvent = S.Struct({\n /**\n * Trace event id.\n */\n id: ObjectId,\n type: S.Literal(InvocationTraceEventType.END),\n /**\n * Invocation id, will be the same for invocation start and end.\n */\n invocationId: ObjectId,\n /**\n * Event generation time.\n */\n // TODO(burdon): Remove ms suffix.\n timestampMs: S.Number,\n outcome: S.Enums(InvocationOutcome),\n exception: S.optional(TraceEventException),\n}).pipe(EchoObject({ typename: 'dxos.org/type/InvocationTraceEnd', version: '0.1.0' }));\n\nexport type InvocationTraceEndEvent = S.Schema.Type<typeof InvocationTraceEndEvent>;\n\nexport type InvocationTraceEvent = InvocationTraceStartEvent | InvocationTraceEndEvent;\n\nexport const TraceEventLog = S.Struct({\n timestampMs: S.Number,\n level: S.String,\n message: S.String,\n context: S.optional(S.Object),\n});\n\nexport const TraceEvent = S.Struct({\n id: ObjectId,\n // TODO(burdon): Need enum/numeric result (not string).\n outcome: S.String,\n truncated: S.Boolean,\n /**\n * Time when the event was persisted.\n */\n ingestionTimestampMs: S.Number,\n logs: S.Array(TraceEventLog),\n exceptions: S.Array(TraceEventException),\n}).pipe(EchoObject({ typename: 'dxos.org/type/TraceEvent', version: '0.1.0' }));\n\nexport type TraceEvent = S.Schema.Type<typeof TraceEvent>;\n\n/**\n * Deprecated InvocationTrace event format.\n * @deprecated\n */\n// TODO(burdon): Remove.\nexport type InvocationSpan = {\n id: string;\n timestampMs: number;\n outcome: InvocationOutcome;\n input: object;\n durationMs: number;\n invocationTraceQueue: Ref<Expando>;\n invocationTarget: Ref<Expando>;\n trigger?: Ref<FunctionTriggerType>;\n exception?: TraceEventException;\n};\n\nexport const createInvocationSpans = (items?: InvocationTraceEvent[]): InvocationSpan[] => {\n if (!items) {\n return [];\n }\n\n const eventsByInvocationId = new Map<string, { start?: InvocationTraceStartEvent; end?: InvocationTraceEndEvent }>();\n for (const event of items) {\n if (!('invocationId' in event)) {\n // Skip legacy format entries.\n continue;\n }\n\n const invocationId = event.invocationId;\n const entry = eventsByInvocationId.get(invocationId) || { start: undefined, end: undefined };\n if (event.type === InvocationTraceEventType.START) {\n entry.start = event as InvocationTraceStartEvent;\n } else if (event.type === InvocationTraceEventType.END) {\n entry.end = event as InvocationTraceEndEvent;\n }\n\n eventsByInvocationId.set(invocationId, entry);\n }\n\n const now = Date.now();\n const result: InvocationSpan[] = [];\n\n // Create spans for each invocation\n for (const [invocationId, { start, end }] of eventsByInvocationId.entries()) {\n if (!start) {\n // No start event, can't create a meaningful span\n log.warn('found end event without matching start', { invocationId });\n continue;\n }\n\n const isInProgress = end === undefined;\n\n result.push({\n id: invocationId,\n timestampMs: start.timestampMs,\n durationMs: isInProgress ? now - start.timestampMs : end!.timestampMs - start.timestampMs,\n outcome: end?.outcome ?? InvocationOutcome.PENDING,\n exception: end?.exception,\n input: start.input,\n invocationTraceQueue: start.invocationTraceQueue,\n invocationTarget: start.invocationTarget,\n trigger: start.trigger,\n });\n }\n\n return result;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ObjectMeta } from '@dxos/echo-schema';\nimport { type SpaceId } from '@dxos/keys';\n\n// TODO: use URL scheme for source?\nconst FUNCTIONS_META_KEY = 'dxos.org/service/function';\n\nexport const FUNCTIONS_PRESET_META_KEY = 'dxos.org/service/function-preset';\n\nconst isSecure = (protocol: string) => {\n return protocol === 'https:' || protocol === 'wss:';\n};\n\nexport const getUserFunctionUrlInMetadata = (meta: ObjectMeta) => {\n return meta.keys.find((key) => key.source === FUNCTIONS_META_KEY)?.id;\n};\n\nexport const setUserFunctionUrlInMetadata = (meta: ObjectMeta, functionUrl: string) => {\n const key = meta.keys.find((key) => key.source === FUNCTIONS_META_KEY);\n if (key) {\n if (key.id !== functionUrl) {\n throw new Error('Metadata mismatch');\n }\n } else {\n meta.keys.push({ source: FUNCTIONS_META_KEY, id: functionUrl });\n }\n};\n\nexport const getInvocationUrl = (functionUrl: string, edgeUrl: string, options: InvocationOptions = {}) => {\n const baseUrl = new URL('functions/', edgeUrl);\n\n // Leading slashes cause the URL to be treated as an absolute path.\n const relativeUrl = functionUrl.replace(/^\\//, '');\n const url = new URL(`./${relativeUrl}`, baseUrl.toString());\n options.spaceId && url.searchParams.set('spaceId', options.spaceId);\n options.subjectId && url.searchParams.set('subjectId', options.subjectId);\n url.protocol = isSecure(url.protocol) ? 'https' : 'http';\n return url.toString();\n};\n\nexport type InvocationOptions = {\n spaceId?: SpaceId;\n subjectId?: string;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,yBAAmF;AACnF,oBAAyB;ACDzB,IAAAA,sBAAyE;ACAzE,IAAAA,sBAAsD;AACtD,iBAAoB;AFKb,IAAMC,aAAaC,qBAAEC,OAAO;EACjCC,MAAMF,qBAAEG,SAASH,qBAAEI,MAAM;EACzBC,aAAaL,qBAAEG,SAASH,qBAAEI,MAAM;;;EAGhCE,SAASN,qBAAEG,SAASH,qBAAEO,OAAO;EAC7BC,YAAQC,wBAAIC,sBAAAA;AACd,CAAA,EACGC,YAAY;EAAE,CAACC,oCAAAA,GAAoB;AAAO,CAAA,EAC1CC,SAAKC,+BAAW;EAAEC,UAAU;EAAwBC,SAAS;AAAQ,CAAA,CAAA;AAOjE,IAAMC,eAAN,kBAA2BC,gCAAY;EAC5CH,UAAU;EACVC,SAAS;AACX,CAAA,EAAG;;EAEDd,MAAMF,qBAAEmB;EACRH,SAAShB,qBAAEI;EAEXC,aAAaL,qBAAEG,SAASH,qBAAEI,MAAM;;;EAIhCI,QAAQR,qBAAEG,aAASM,wBA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aAAa7B,IAAI,WAAW5D,QAAQwF,OAAO;AAClExF,UAAQ0F,aAAaJ,IAAIG,aAAa7B,IAAI,aAAa5D,QAAQ0F,SAAS;AACxEJ,MAAIb,WAAWD,SAASc,IAAIb,QAAQ,IAAI,UAAU;AAClD,SAAOa,IAAIC,SAAQ;AACrB;",
|
|
6
|
+
"names": ["import_echo_schema", "ScriptType", "S", "Struct", "name", "optional", "String", "description", "changed", "Boolean", "source", "Ref", "TextType", "annotations", "LabelAnnotationId", "pipe", "EchoObject", "typename", "version", "FunctionType", "TypedObject", "NonEmptyString", "inputSchema", "JsonSchemaType", "outputSchema", "binding", "TriggerKind", "typeLiteralAnnotations", "AST", "TitleAnnotationId", "TimerTriggerSchema", "type", "Literal", "cron", "ExamplesAnnotationId", "mutable", "EmailTriggerSchema", "QueueTriggerSchema", "queue", "DXN", "WebhookTriggerSchema", "method", "OptionsAnnotationId", "port", "Number", "QuerySchema", "props", "Record", "key", "value", "Any", "SubscriptionTriggerSchema", "filter", "options", "deep", "delay", "TriggerSchema", "Union", "FunctionTriggerSchema", "function", "enabled", "spec", "meta", "FunctionTrigger", "fields", "FunctionDef", "uri", "route", "handler", "FunctionManifestSchema", "functions", "Array", "RawObject", "triggers", "FUNCTION_TYPES", "InvocationOutcome", "InvocationTraceEventType", "TraceEventException", "timestampMs", "message", "stack", "InvocationTraceStartEvent", "id", "ObjectId", "invocationId", "input", "Object", "invocationTraceQueue", "Expando", "invocationTarget", "trigger", "InvocationTraceEndEvent", "outcome", "Enums", "exception", "TraceEventLog", "level", "context", "TraceEvent", "truncated", "ingestionTimestampMs", "logs", "exceptions", "createInvocationSpans", "items", "eventsByInvocationId", "Map", "event", "entry", "get", "start", "undefined", "end", "set", "now", "Date", "result", "entries", "log", "warn", "isInProgress", "push", "durationMs", "FUNCTIONS_META_KEY", "FUNCTIONS_PRESET_META_KEY", "isSecure", "protocol", "getUserFunctionUrlInMetadata", "keys", "find", "setUserFunctionUrlInMetadata", "functionUrl", "Error", "getInvocationUrl", "edgeUrl", "baseUrl", "URL", "relativeUrl", "replace", "url", "toString", "spaceId", "searchParams", "subjectId"]
|
|
7
|
+
}
|
|
@@ -16,22 +16,23 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_NXZNXVT3_exports = {};
|
|
20
|
+
__export(chunk_NXZNXVT3_exports, {
|
|
21
21
|
incrementSemverPatch: () => incrementSemverPatch,
|
|
22
22
|
publicKeyToDid: () => publicKeyToDid,
|
|
23
23
|
uploadWorkerFunction: () => uploadWorkerFunction
|
|
24
24
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
25
|
+
module.exports = __toCommonJS(chunk_NXZNXVT3_exports);
|
|
26
|
+
var import_edge = require("@dxos/client/edge");
|
|
26
27
|
var import_edge_client = require("@dxos/edge-client");
|
|
27
28
|
var import_invariant = require("@dxos/invariant");
|
|
28
29
|
var import_log = require("@dxos/log");
|
|
29
30
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/functions/src/edge/functions.ts";
|
|
30
|
-
var uploadWorkerFunction = async ({ client,
|
|
31
|
+
var uploadWorkerFunction = async ({ client, spaceId, version, source, name, functionId }) => {
|
|
31
32
|
const edgeUrl = client.config.values.runtime?.services?.edge?.url;
|
|
32
33
|
(0, import_invariant.invariant)(edgeUrl, "Edge is not configured.", {
|
|
33
34
|
F: __dxlog_file,
|
|
34
|
-
L:
|
|
35
|
+
L: 33,
|
|
35
36
|
S: void 0,
|
|
36
37
|
A: [
|
|
37
38
|
"edgeUrl",
|
|
@@ -39,7 +40,7 @@ var uploadWorkerFunction = async ({ client, name, version, source, spaceId, func
|
|
|
39
40
|
]
|
|
40
41
|
});
|
|
41
42
|
const edgeClient = new import_edge_client.EdgeHttpClient(edgeUrl);
|
|
42
|
-
const edgeIdentity = createEdgeIdentity(client);
|
|
43
|
+
const edgeIdentity = (0, import_edge.createEdgeIdentity)(client);
|
|
43
44
|
edgeClient.setIdentity(edgeIdentity);
|
|
44
45
|
const response = await edgeClient.uploadFunction({
|
|
45
46
|
spaceId,
|
|
@@ -49,53 +50,30 @@ var uploadWorkerFunction = async ({ client, name, version, source, spaceId, func
|
|
|
49
50
|
version,
|
|
50
51
|
script: source
|
|
51
52
|
});
|
|
52
|
-
|
|
53
|
+
import_log.log.info("Uploaded", {
|
|
54
|
+
identityKey: edgeIdentity.identityKey,
|
|
53
55
|
functionId,
|
|
54
|
-
source,
|
|
55
56
|
name,
|
|
56
|
-
|
|
57
|
+
source: source.length,
|
|
57
58
|
response
|
|
58
59
|
}, {
|
|
59
60
|
F: __dxlog_file,
|
|
60
|
-
L:
|
|
61
|
+
L: 40,
|
|
61
62
|
S: void 0,
|
|
62
63
|
C: (f, a) => f(...a)
|
|
63
64
|
});
|
|
64
65
|
return response;
|
|
65
66
|
};
|
|
66
|
-
var createEdgeIdentity = (client) => {
|
|
67
|
-
const identity = client.halo.identity.get();
|
|
68
|
-
const device = client.halo.device;
|
|
69
|
-
if (!identity || !device) {
|
|
70
|
-
throw new Error("Identity not available");
|
|
71
|
-
}
|
|
72
|
-
return {
|
|
73
|
-
identityKey: identity.identityKey.toHex(),
|
|
74
|
-
peerKey: device.deviceKey.toHex(),
|
|
75
|
-
presentCredentials: async ({ challenge }) => {
|
|
76
|
-
const identityService = client.services.services.IdentityService;
|
|
77
|
-
const authCredential = await identityService.createAuthCredential();
|
|
78
|
-
return identityService.signPresentation({
|
|
79
|
-
presentation: {
|
|
80
|
-
credentials: [
|
|
81
|
-
authCredential
|
|
82
|
-
]
|
|
83
|
-
},
|
|
84
|
-
nonce: challenge
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
67
|
var incrementSemverPatch = (version) => {
|
|
90
68
|
const [major, minor, patch] = version.split(".");
|
|
91
69
|
const patchNum = Number(patch);
|
|
92
|
-
(0, import_invariant.invariant)(!Number.isNaN(patchNum),
|
|
70
|
+
(0, import_invariant.invariant)(!Number.isNaN(patchNum), `Unexpected function version format: ${version}`, {
|
|
93
71
|
F: __dxlog_file,
|
|
94
|
-
L:
|
|
72
|
+
L: 54,
|
|
95
73
|
S: void 0,
|
|
96
74
|
A: [
|
|
97
75
|
"!Number.isNaN(patchNum)",
|
|
98
|
-
"
|
|
76
|
+
"`Unexpected function version format: ${version}`"
|
|
99
77
|
]
|
|
100
78
|
});
|
|
101
79
|
return [
|
|
@@ -113,4 +91,4 @@ var publicKeyToDid = (key) => {
|
|
|
113
91
|
publicKeyToDid,
|
|
114
92
|
uploadWorkerFunction
|
|
115
93
|
});
|
|
116
|
-
//# sourceMappingURL=chunk-
|
|
94
|
+
//# sourceMappingURL=chunk-NXZNXVT3.cjs.map
|