@dxos/functions 0.7.5-labs.f5080a1 → 0.7.5-labs.ff2ff30
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/bundler/index.mjs +239 -0
- package/dist/lib/browser/bundler/index.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FTGUA7ZJ.mjs → chunk-JNWHUD6Z.mjs} +2 -2
- package/dist/lib/browser/{chunk-R4ERZ4GX.mjs → chunk-PI2DP37S.mjs} +10 -3
- package/dist/lib/browser/chunk-PI2DP37S.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +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 +1 -1
- package/dist/lib/node/bundler/index.cjs +261 -0
- package/dist/lib/node/bundler/index.cjs.map +7 -0
- package/dist/lib/node/{chunk-NC6L7H5C.cjs → chunk-2ASAZ4AS.cjs} +15 -15
- package/dist/lib/node/{chunk-4WNFTPH7.cjs → chunk-PGFJYL6Q.cjs} +12 -5
- package/dist/lib/node/chunk-PGFJYL6Q.cjs.map +7 -0
- package/dist/lib/node/index.cjs +15 -15
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +7 -7
- package/dist/lib/node/types/index.cjs +10 -10
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/bundler/index.mjs +239 -0
- package/dist/lib/node-esm/bundler/index.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-UOQLFLOW.mjs → chunk-IOAKDIT3.mjs} +10 -3
- package/dist/lib/node-esm/chunk-IOAKDIT3.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-FK2RGYVS.mjs → chunk-LNBGGB6Z.mjs} +2 -2
- package/dist/lib/node-esm/index.mjs +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 +1 -1
- package/dist/types/src/bundler/bundler.d.ts +51 -0
- package/dist/types/src/bundler/bundler.d.ts.map +1 -0
- package/dist/types/src/bundler/bundler.test.d.ts +2 -0
- package/dist/types/src/bundler/bundler.test.d.ts.map +1 -0
- package/dist/types/src/bundler/index.d.ts +2 -0
- package/dist/types/src/bundler/index.d.ts.map +1 -0
- package/dist/types/src/types/schema.d.ts +2 -0
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +25 -1
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/package.json +30 -17
- package/src/bundler/bundler.test.ts +59 -0
- package/src/bundler/bundler.ts +264 -0
- package/src/bundler/index.ts +5 -0
- package/src/types/schema.ts +1 -0
- package/src/types/types.ts +10 -1
- package/dist/lib/browser/chunk-R4ERZ4GX.mjs.map +0 -7
- package/dist/lib/node/chunk-4WNFTPH7.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-UOQLFLOW.mjs.map +0 -7
- /package/dist/lib/browser/{chunk-FTGUA7ZJ.mjs.map → chunk-JNWHUD6Z.mjs.map} +0 -0
- /package/dist/lib/node/{chunk-NC6L7H5C.cjs.map → chunk-2ASAZ4AS.cjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-FK2RGYVS.mjs.map → chunk-LNBGGB6Z.mjs.map} +0 -0
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
TriggerRegistry,
|
|
14
14
|
createSubscriptionTrigger,
|
|
15
15
|
createTimerTrigger
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-LNBGGB6Z.mjs";
|
|
17
17
|
import {
|
|
18
18
|
FUNCTION_TYPES,
|
|
19
19
|
FunctionDef,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
ScriptType,
|
|
25
25
|
TriggerKind,
|
|
26
26
|
TriggerSchema
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-IOAKDIT3.mjs";
|
|
28
28
|
import "./chunk-DHGBFXSZ.mjs";
|
|
29
29
|
|
|
30
30
|
// packages/core/functions/src/handler.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/core/functions/src/edge/functions.ts":{"bytes":13907,"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":4347,"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":15589,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/types/index.ts":{"bytes":580,"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"}],"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":10710,"imports":[{"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":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/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":"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":21200,"imports":[{"path":"node: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":"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/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/node-esm/edge/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/node-esm/edge/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/node-esm/chunk-T2KBXTMR.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node-esm/chunk-DHGBFXSZ.mjs","kind":"import-statement"}],"exports":["FUNCTIONS_PRESET_META_KEY","getInvocationUrl","getUserFunctionUrlInMetadata","incrementSemverPatch","publicKeyToDid","setUserFunctionUrlInMetadata","uploadWorkerFunction"],"entryPoint":"packages/core/functions/src/edge/index.ts","inputs":{},"bytes":568},"packages/core/functions/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5839},"packages/core/functions/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/node-esm/chunk-T2KBXTMR.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node-esm/chunk-FK2RGYVS.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node-esm/chunk-UOQLFLOW.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node-esm/chunk-DHGBFXSZ.mjs","kind":"import-statement"},{"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","ScriptType","TriggerKind","TriggerRegistry","TriggerSchema","createSubscriptionTrigger","createTimerTrigger","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":1624}},"bytes":2844},"packages/core/functions/dist/lib/node-esm/chunk-T2KBXTMR.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7185},"packages/core/functions/dist/lib/node-esm/chunk-T2KBXTMR.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":["FUNCTIONS_PRESET_META_KEY","getInvocationUrl","getUserFunctionUrlInMetadata","incrementSemverPatch","publicKeyToDid","setUserFunctionUrlInMetadata","uploadWorkerFunction"],"inputs":{"packages/core/functions/src/edge/functions.ts":{"bytesInOutput":3390},"packages/core/functions/src/edge/index.ts":{"bytesInOutput":0}},"bytes":3767},"packages/core/functions/dist/lib/node-esm/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":32290},"packages/core/functions/dist/lib/node-esm/testing/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/node-esm/chunk-FK2RGYVS.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node-esm/chunk-UOQLFLOW.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node-esm/chunk-DHGBFXSZ.mjs","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":"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/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":2775},"packages/core/functions/src/testing/types.ts":{"bytesInOutput":182},"packages/core/functions/src/runtime/dev-server.ts":{"bytesInOutput":7860},"packages/core/functions/src/runtime/index.ts":{"bytesInOutput":0},"packages/core/functions/src/runtime/scheduler.ts":{"bytesInOutput":5364},"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":18237},"packages/core/functions/dist/lib/node-esm/chunk-FK2RGYVS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":26827},"packages/core/functions/dist/lib/node-esm/chunk-FK2RGYVS.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/node-esm/chunk-UOQLFLOW.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","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":898},"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":14053},"packages/core/functions/dist/lib/node-esm/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/node-esm/types/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/node-esm/chunk-UOQLFLOW.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node-esm/chunk-DHGBFXSZ.mjs","kind":"import-statement"}],"exports":["FUNCTION_TYPES","FunctionDef","FunctionManifestSchema","FunctionTrigger","FunctionTriggerSchema","FunctionType","ScriptType","TriggerKind","TriggerSchema"],"entryPoint":"packages/core/functions/src/types/index.ts","inputs":{},"bytes":540},"packages/core/functions/dist/lib/node-esm/chunk-UOQLFLOW.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10175},"packages/core/functions/dist/lib/node-esm/chunk-UOQLFLOW.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}],"exports":["FUNCTION_TYPES","FunctionDef","FunctionManifestSchema","FunctionTrigger","FunctionTriggerSchema","FunctionType","ScriptType","TriggerKind","TriggerSchema"],"inputs":{"packages/core/functions/src/types/schema.ts":{"bytesInOutput":1000},"packages/core/functions/src/types/index.ts":{"bytesInOutput":0},"packages/core/functions/src/types/types.ts":{"bytesInOutput":3409}},"bytes":4817},"packages/core/functions/dist/lib/node-esm/chunk-DHGBFXSZ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/node-esm/chunk-DHGBFXSZ.mjs":{"imports":[],"exports":["__require"],"inputs":{},"bytes":526}}}
|
|
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":13907,"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":4517,"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":16405,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/types/index.ts":{"bytes":580,"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"}],"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":10710,"imports":[{"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":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/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":"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":21200,"imports":[{"path":"node: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":"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/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/node-esm/bundler/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14437},"packages/core/functions/dist/lib/node-esm/bundler/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/node-esm/chunk-DHGBFXSZ.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":7378},"packages/core/functions/dist/lib/node-esm/edge/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/node-esm/edge/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/node-esm/chunk-T2KBXTMR.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node-esm/chunk-DHGBFXSZ.mjs","kind":"import-statement"}],"exports":["FUNCTIONS_PRESET_META_KEY","getInvocationUrl","getUserFunctionUrlInMetadata","incrementSemverPatch","publicKeyToDid","setUserFunctionUrlInMetadata","uploadWorkerFunction"],"entryPoint":"packages/core/functions/src/edge/index.ts","inputs":{},"bytes":568},"packages/core/functions/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5839},"packages/core/functions/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/node-esm/chunk-T2KBXTMR.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node-esm/chunk-LNBGGB6Z.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node-esm/chunk-IOAKDIT3.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node-esm/chunk-DHGBFXSZ.mjs","kind":"import-statement"},{"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","ScriptType","TriggerKind","TriggerRegistry","TriggerSchema","createSubscriptionTrigger","createTimerTrigger","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":1624}},"bytes":2844},"packages/core/functions/dist/lib/node-esm/chunk-T2KBXTMR.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7185},"packages/core/functions/dist/lib/node-esm/chunk-T2KBXTMR.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":["FUNCTIONS_PRESET_META_KEY","getInvocationUrl","getUserFunctionUrlInMetadata","incrementSemverPatch","publicKeyToDid","setUserFunctionUrlInMetadata","uploadWorkerFunction"],"inputs":{"packages/core/functions/src/edge/functions.ts":{"bytesInOutput":3390},"packages/core/functions/src/edge/index.ts":{"bytesInOutput":0}},"bytes":3767},"packages/core/functions/dist/lib/node-esm/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":32290},"packages/core/functions/dist/lib/node-esm/testing/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/node-esm/chunk-LNBGGB6Z.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node-esm/chunk-IOAKDIT3.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node-esm/chunk-DHGBFXSZ.mjs","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":"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/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":2775},"packages/core/functions/src/testing/types.ts":{"bytesInOutput":182},"packages/core/functions/src/runtime/dev-server.ts":{"bytesInOutput":7860},"packages/core/functions/src/runtime/index.ts":{"bytesInOutput":0},"packages/core/functions/src/runtime/scheduler.ts":{"bytesInOutput":5364},"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":18237},"packages/core/functions/dist/lib/node-esm/chunk-LNBGGB6Z.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":26827},"packages/core/functions/dist/lib/node-esm/chunk-LNBGGB6Z.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/node-esm/chunk-IOAKDIT3.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","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":898},"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":14053},"packages/core/functions/dist/lib/node-esm/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/node-esm/types/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/node-esm/chunk-IOAKDIT3.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node-esm/chunk-DHGBFXSZ.mjs","kind":"import-statement"}],"exports":["FUNCTION_TYPES","FunctionDef","FunctionManifestSchema","FunctionTrigger","FunctionTriggerSchema","FunctionType","ScriptType","TriggerKind","TriggerSchema"],"entryPoint":"packages/core/functions/src/types/index.ts","inputs":{},"bytes":540},"packages/core/functions/dist/lib/node-esm/chunk-IOAKDIT3.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10753},"packages/core/functions/dist/lib/node-esm/chunk-IOAKDIT3.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}],"exports":["FUNCTION_TYPES","FunctionDef","FunctionManifestSchema","FunctionTrigger","FunctionTriggerSchema","FunctionType","ScriptType","TriggerKind","TriggerSchema"],"inputs":{"packages/core/functions/src/types/schema.ts":{"bytesInOutput":1044},"packages/core/functions/src/types/index.ts":{"bytesInOutput":0},"packages/core/functions/src/types/types.ts":{"bytesInOutput":3607}},"bytes":5059},"packages/core/functions/dist/lib/node-esm/chunk-DHGBFXSZ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/node-esm/chunk-DHGBFXSZ.mjs":{"imports":[],"exports":["__require"],"inputs":{},"bytes":526}}}
|
|
@@ -2,11 +2,11 @@ import { createRequire } from 'node:module';const require = createRequire(import
|
|
|
2
2
|
import {
|
|
3
3
|
FunctionRegistry,
|
|
4
4
|
TriggerRegistry
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-LNBGGB6Z.mjs";
|
|
6
6
|
import {
|
|
7
7
|
FunctionDef,
|
|
8
8
|
FunctionTrigger
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-IOAKDIT3.mjs";
|
|
10
10
|
import {
|
|
11
11
|
__require
|
|
12
12
|
} from "../chunk-DHGBFXSZ.mjs";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type BuildOptions } from 'esbuild';
|
|
2
|
+
import { type BuildResult } from 'esbuild-wasm';
|
|
3
|
+
export type Import = {
|
|
4
|
+
moduleUrl: string;
|
|
5
|
+
defaultImport: boolean;
|
|
6
|
+
namedImports: string[];
|
|
7
|
+
};
|
|
8
|
+
export type BundleOptions = {
|
|
9
|
+
/**
|
|
10
|
+
* Path to the source file on the local file system.
|
|
11
|
+
* If provided, the path will be used instead of the `source` code.
|
|
12
|
+
*/
|
|
13
|
+
path?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Source code to bundle.
|
|
16
|
+
* Required if `path` is not provided.
|
|
17
|
+
*/
|
|
18
|
+
source?: string;
|
|
19
|
+
};
|
|
20
|
+
export type BundleResult = {
|
|
21
|
+
timestamp: number;
|
|
22
|
+
sourceHash?: Buffer;
|
|
23
|
+
imports?: Import[];
|
|
24
|
+
bundle?: string;
|
|
25
|
+
error?: any;
|
|
26
|
+
};
|
|
27
|
+
export type BundlerOptions = {
|
|
28
|
+
platform: BuildOptions['platform'];
|
|
29
|
+
sandboxedModules: string[];
|
|
30
|
+
remoteModules: Record<string, string>;
|
|
31
|
+
};
|
|
32
|
+
export declare const initializeBundler: (options: {
|
|
33
|
+
wasmUrl: string;
|
|
34
|
+
}) => Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* ESBuild bundler.
|
|
37
|
+
*/
|
|
38
|
+
export declare class Bundler {
|
|
39
|
+
private readonly _options;
|
|
40
|
+
constructor(_options: BundlerOptions);
|
|
41
|
+
bundle({ path, source }: BundleOptions): Promise<BundleResult>;
|
|
42
|
+
analyzeImports(result: BuildResult): Import[];
|
|
43
|
+
analyzeSourceFileImports(code: string): {
|
|
44
|
+
defaultImportName: string;
|
|
45
|
+
namedImports: string[];
|
|
46
|
+
wildcardImportName: string;
|
|
47
|
+
moduleIdentifier: string;
|
|
48
|
+
quotes: string;
|
|
49
|
+
}[];
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=bundler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../../../../src/bundler/bundler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAqB,KAAK,WAAW,EAAe,MAAM,cAAc,CAAC;AAMhF,MAAM,MAAM,MAAM,GAAG;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,GAAG,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IACnC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC,CAAC;AAGF,eAAO,MAAM,iBAAiB,YAAmB;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,kBAInE,CAAC;AAEF;;GAEG;AACH,qBAAa,OAAO;IACN,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,cAAc;IAE/C,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAwFpE,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,EAAE;IA2B7C,wBAAwB,CAAC,IAAI,EAAE,MAAM;;;;;;;CAatC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundler.test.d.ts","sourceRoot":"","sources":["../../../../src/bundler/bundler.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bundler/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC"}
|
|
@@ -32,6 +32,7 @@ declare const FunctionType_base: import("@dxos/echo-schema").TypedObjectPrototyp
|
|
|
32
32
|
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>;
|
|
33
33
|
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>;
|
|
34
34
|
inputSchema: S.optional<S.Schema<JsonSchemaType, JsonSchemaType, never>>;
|
|
35
|
+
outputSchema: S.optional<S.Schema<JsonSchemaType, JsonSchemaType, never>>;
|
|
35
36
|
binding: S.optional<typeof S.String>;
|
|
36
37
|
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>, S.Struct.Encoded<{
|
|
37
38
|
name: typeof S.NonEmptyString;
|
|
@@ -46,6 +47,7 @@ declare const FunctionType_base: import("@dxos/echo-schema").TypedObjectPrototyp
|
|
|
46
47
|
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>;
|
|
47
48
|
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>>>;
|
|
48
49
|
inputSchema: S.optional<S.Schema<JsonSchemaType, JsonSchemaType, never>>;
|
|
50
|
+
outputSchema: S.optional<S.Schema<JsonSchemaType, JsonSchemaType, never>>;
|
|
49
51
|
binding: S.optional<typeof S.String>;
|
|
50
52
|
}>>;
|
|
51
53
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/types/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAO,CAAC,EAAe,MAAM,mBAAmB,CAAC;;;;;;wBAOnE,EAAG,MAAM;;;;;;;wBAAT,EAAG,MAAM;;;AAJd;;GAEG;AACH,qBAAa,UAAW,SAAQ,eAW9B;CAAG;;;;;;;;;;4BAVA,EAAG,MAAM
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/types/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAO,CAAC,EAAe,MAAM,mBAAmB,CAAC;;;;;;wBAOnE,EAAG,MAAM;;;;;;;wBAAT,EAAG,MAAM;;;AAJd;;GAEG;AACH,qBAAa,UAAW,SAAQ,eAW9B;CAAG;;;;;;;;;;4BAVA,EAAG,MAAM;;;;;;;;;;;;;;;4BAAT,EAAG,MAAM;;;;;;;AAYd;;GAEG;AAEH,qBAAa,YAAa,SAAQ,iBAmBhC;CAAG"}
|
|
@@ -8,7 +8,8 @@ export declare enum TriggerKind {
|
|
|
8
8
|
Timer = "timer",
|
|
9
9
|
Webhook = "webhook",
|
|
10
10
|
Subscription = "subscription",
|
|
11
|
-
Email = "email"
|
|
11
|
+
Email = "email",
|
|
12
|
+
Queue = "queue"
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* Cron timer.
|
|
@@ -22,6 +23,11 @@ declare const EmailTriggerSchema: S.mutable<S.Struct<{
|
|
|
22
23
|
type: S.Literal<[TriggerKind.Email]>;
|
|
23
24
|
}>>;
|
|
24
25
|
export type EmailTrigger = S.Schema.Type<typeof EmailTriggerSchema>;
|
|
26
|
+
declare const QueueTriggerSchema: S.mutable<S.Struct<{
|
|
27
|
+
type: S.Literal<[TriggerKind.Queue]>;
|
|
28
|
+
queue: S.refine<string, S.Schema<string, string, never>>;
|
|
29
|
+
}>>;
|
|
30
|
+
export type QueueTrigger = S.Schema.Type<typeof QueueTriggerSchema>;
|
|
25
31
|
/**
|
|
26
32
|
* Webhook.
|
|
27
33
|
*/
|
|
@@ -68,6 +74,9 @@ export declare const TriggerSchema: S.Union<[S.mutable<S.Struct<{
|
|
|
68
74
|
}>>;
|
|
69
75
|
}>>, S.mutable<S.Struct<{
|
|
70
76
|
type: S.Literal<[TriggerKind.Email]>;
|
|
77
|
+
}>>, S.mutable<S.Struct<{
|
|
78
|
+
type: S.Literal<[TriggerKind.Queue]>;
|
|
79
|
+
queue: S.refine<string, S.Schema<string, string, never>>;
|
|
71
80
|
}>>]>;
|
|
72
81
|
export type TriggerType = S.Schema.Type<typeof TriggerSchema>;
|
|
73
82
|
/**
|
|
@@ -95,6 +104,9 @@ export declare const FunctionTriggerSchema: S.Struct<{
|
|
|
95
104
|
}>>;
|
|
96
105
|
}>>, S.mutable<S.Struct<{
|
|
97
106
|
type: S.Literal<[TriggerKind.Email]>;
|
|
107
|
+
}>>, S.mutable<S.Struct<{
|
|
108
|
+
type: S.Literal<[TriggerKind.Queue]>;
|
|
109
|
+
queue: S.refine<string, S.Schema<string, string, never>>;
|
|
98
110
|
}>>]>>;
|
|
99
111
|
meta: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
|
|
100
112
|
}>;
|
|
@@ -121,6 +133,9 @@ declare const FunctionTrigger_base: import("@dxos/echo-schema").TypedObjectProto
|
|
|
121
133
|
}>>;
|
|
122
134
|
}>>, S.mutable<S.Struct<{
|
|
123
135
|
type: S.Literal<[TriggerKind.Email]>;
|
|
136
|
+
}>>, S.mutable<S.Struct<{
|
|
137
|
+
type: S.Literal<[TriggerKind.Queue]>;
|
|
138
|
+
queue: S.refine<string, S.Schema<string, string, never>>;
|
|
124
139
|
}>>]>>;
|
|
125
140
|
readonly meta: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
|
|
126
141
|
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>, S.Struct.Encoded<{
|
|
@@ -145,6 +160,9 @@ declare const FunctionTrigger_base: import("@dxos/echo-schema").TypedObjectProto
|
|
|
145
160
|
}>>;
|
|
146
161
|
}>>, S.mutable<S.Struct<{
|
|
147
162
|
type: S.Literal<[TriggerKind.Email]>;
|
|
163
|
+
}>>, S.mutable<S.Struct<{
|
|
164
|
+
type: S.Literal<[TriggerKind.Queue]>;
|
|
165
|
+
queue: S.refine<string, S.Schema<string, string, never>>;
|
|
148
166
|
}>>]>>;
|
|
149
167
|
readonly meta: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
|
|
150
168
|
}>>;
|
|
@@ -207,6 +225,9 @@ export declare const FunctionManifestSchema: S.Struct<{
|
|
|
207
225
|
}>>;
|
|
208
226
|
}>>, S.mutable<S.Struct<{
|
|
209
227
|
type: S.Literal<[TriggerKind.Email]>;
|
|
228
|
+
}>>, S.mutable<S.Struct<{
|
|
229
|
+
type: S.Literal<[TriggerKind.Queue]>;
|
|
230
|
+
queue: S.refine<string, S.Schema<string, string, never>>;
|
|
210
231
|
}>>]>>;
|
|
211
232
|
readonly meta: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
|
|
212
233
|
}, import("packages/core/echo/echo-schema/dist/types/src/object/common").TypedObjectOptions>> & import("@dxos/echo-schema").WithMeta, S.Struct.Encoded<{
|
|
@@ -231,6 +252,9 @@ export declare const FunctionManifestSchema: S.Struct<{
|
|
|
231
252
|
}>>;
|
|
232
253
|
}>>, S.mutable<S.Struct<{
|
|
233
254
|
type: S.Literal<[TriggerKind.Email]>;
|
|
255
|
+
}>>, S.mutable<S.Struct<{
|
|
256
|
+
type: S.Literal<[TriggerKind.Queue]>;
|
|
257
|
+
queue: S.refine<string, S.Schema<string, string, never>>;
|
|
234
258
|
}>>]>>;
|
|
235
259
|
readonly meta: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
|
|
236
260
|
}>, never>>>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAuC,CAAC,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAuC,CAAC,EAAoB,MAAM,mBAAmB,CAAC;AAE7F;;;;GAIG;AACH,oBAAY,WAAW;IACrB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,YAAY,iBAAiB;IAC7B,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAKD;;GAEG;AACH,QAAA,MAAM,kBAAkB;;;GAMN,CAAC;AAEnB,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,QAAA,MAAM,kBAAkB;;GAEN,CAAC;AAEnB,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,QAAA,MAAM,kBAAkB;;;GAGN,CAAC;AAEnB,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE;;GAEG;AACH,QAAA,MAAM,oBAAoB;;;;GAaR,CAAC;AAEnB,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAQxE;;GAEG;AACH,QAAA,MAAM,yBAAyB;;;;;;;;;;GAYb,CAAC;AAEnB,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAElF;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;KASxB,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,aAAa,CAAC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYhC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,qBAAqB,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE9E;;GAEG;AACH,qBAAa,eAAgB,SAAQ,oBAGL;CAAG;;;;;;;;;;;;AAEnC;;;GAGG;AAEH,qBAAa,WAAY,SAAQ,gBAQ/B;CAAG;AAEL;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E,eAAO,MAAM,cAAc,iDAAiC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/functions",
|
|
3
|
-
"version": "0.7.5-labs.
|
|
3
|
+
"version": "0.7.5-labs.ff2ff30",
|
|
4
4
|
"description": "Functions API and runtime.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -13,6 +13,11 @@
|
|
|
13
13
|
"browser": "./dist/lib/browser/index.mjs",
|
|
14
14
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
15
15
|
},
|
|
16
|
+
"./bundler": {
|
|
17
|
+
"types": "./dist/types/src/bundler/index.d.ts",
|
|
18
|
+
"browser": "./dist/lib/browser/bundler/index.mjs",
|
|
19
|
+
"node": "./dist/lib/node-esm/bundler/index.mjs"
|
|
20
|
+
},
|
|
16
21
|
"./edge": {
|
|
17
22
|
"types": "./dist/types/src/edge/index.d.ts",
|
|
18
23
|
"browser": "./dist/lib/browser/edge/index.mjs",
|
|
@@ -32,6 +37,12 @@
|
|
|
32
37
|
"types": "dist/types/src/index.d.ts",
|
|
33
38
|
"typesVersions": {
|
|
34
39
|
"*": {
|
|
40
|
+
"bundler": [
|
|
41
|
+
"dist/types/src/bundler/index.d.ts"
|
|
42
|
+
],
|
|
43
|
+
"edge": [
|
|
44
|
+
"dist/types/src/edge/index.d.ts"
|
|
45
|
+
],
|
|
35
46
|
"testing": [
|
|
36
47
|
"dist/types/src/testing/index.d.ts"
|
|
37
48
|
],
|
|
@@ -50,30 +61,32 @@
|
|
|
50
61
|
"@preact/signals-core": "^1.6.0",
|
|
51
62
|
"cron": "^3.1.6",
|
|
52
63
|
"effect": "^3.12.3",
|
|
64
|
+
"esbuild-wasm": "0.16.14",
|
|
53
65
|
"express": "^4.19.2",
|
|
54
66
|
"get-port-please": "^3.1.1",
|
|
55
67
|
"iso-did": "^1.6.0",
|
|
56
68
|
"ws": "^8.14.2",
|
|
57
|
-
"@dxos/async": "0.7.5-labs.
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/echo-
|
|
63
|
-
"@dxos/edge-client": "0.7.5-labs.
|
|
64
|
-
"@dxos/keys": "0.7.5-labs.
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/live-object": "0.7.5-labs.
|
|
67
|
-
"@dxos/log": "0.7.5-labs.
|
|
68
|
-
"@dxos/node-std": "0.7.5-labs.
|
|
69
|
-
"@dxos/protocols": "0.7.5-labs.
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/
|
|
69
|
+
"@dxos/async": "0.7.5-labs.ff2ff30",
|
|
70
|
+
"@dxos/context": "0.7.5-labs.ff2ff30",
|
|
71
|
+
"@dxos/client": "0.7.5-labs.ff2ff30",
|
|
72
|
+
"@dxos/echo-db": "0.7.5-labs.ff2ff30",
|
|
73
|
+
"@dxos/crypto": "0.7.5-labs.ff2ff30",
|
|
74
|
+
"@dxos/echo-protocol": "0.7.5-labs.ff2ff30",
|
|
75
|
+
"@dxos/edge-client": "0.7.5-labs.ff2ff30",
|
|
76
|
+
"@dxos/keys": "0.7.5-labs.ff2ff30",
|
|
77
|
+
"@dxos/echo-schema": "0.7.5-labs.ff2ff30",
|
|
78
|
+
"@dxos/live-object": "0.7.5-labs.ff2ff30",
|
|
79
|
+
"@dxos/log": "0.7.5-labs.ff2ff30",
|
|
80
|
+
"@dxos/node-std": "0.7.5-labs.ff2ff30",
|
|
81
|
+
"@dxos/protocols": "0.7.5-labs.ff2ff30",
|
|
82
|
+
"@dxos/invariant": "0.7.5-labs.ff2ff30",
|
|
83
|
+
"@dxos/schema": "0.7.5-labs.ff2ff30",
|
|
84
|
+
"@dxos/util": "0.7.5-labs.ff2ff30"
|
|
72
85
|
},
|
|
73
86
|
"devDependencies": {
|
|
74
87
|
"@types/express": "^4.17.17",
|
|
75
88
|
"@types/ws": "^7.4.0",
|
|
76
|
-
"@dxos/agent": "0.7.5-labs.
|
|
89
|
+
"@dxos/agent": "0.7.5-labs.ff2ff30"
|
|
77
90
|
},
|
|
78
91
|
"publishConfig": {
|
|
79
92
|
"access": "public"
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
import wasmUrl from 'esbuild-wasm/esbuild.wasm?url';
|
|
7
|
+
import { beforeAll, describe, expect, test } from 'vitest';
|
|
8
|
+
|
|
9
|
+
import { isNode } from '@dxos/util';
|
|
10
|
+
|
|
11
|
+
import { Bundler, initializeBundler } from './bundler';
|
|
12
|
+
|
|
13
|
+
describe('Bundler', () => {
|
|
14
|
+
beforeAll(async () => {
|
|
15
|
+
if (!isNode()) {
|
|
16
|
+
await initializeBundler({ wasmUrl });
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test('Basic', async () => {
|
|
21
|
+
const bundler = new Bundler({ platform: 'node', sandboxedModules: [], remoteModules: {} });
|
|
22
|
+
const result = await bundler.bundle({ source: 'const x = 100' }); // TODO(burdon): Test import.
|
|
23
|
+
expect(result.bundle).to.exist;
|
|
24
|
+
expect(result.error).to.not.exist;
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test('Import', async () => {
|
|
28
|
+
const bundler = new Bundler({ platform: 'node', sandboxedModules: [], remoteModules: {} });
|
|
29
|
+
const result = await bundler.bundle({
|
|
30
|
+
source: `
|
|
31
|
+
import { Filter } from './runtime.js';
|
|
32
|
+
|
|
33
|
+
const query = Filter.typename('dxos.org/type/Example');
|
|
34
|
+
`,
|
|
35
|
+
});
|
|
36
|
+
expect(result.bundle).to.exist;
|
|
37
|
+
expect(result.error).to.not.exist;
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// TODO(dmaretskyi): Flaky on CI: https://cloud.nx.app/runs/Hjcifa8Ccq/task/plugin-script%3Atest
|
|
41
|
+
test.skip('HTTPS Import', async () => {
|
|
42
|
+
const bundler = new Bundler({ platform: 'node', sandboxedModules: [], remoteModules: {} });
|
|
43
|
+
const result = await bundler.bundle({
|
|
44
|
+
source: `
|
|
45
|
+
import { invariant } from 'https://esm.sh/@dxos/invariant';
|
|
46
|
+
invariant(true);
|
|
47
|
+
`,
|
|
48
|
+
});
|
|
49
|
+
expect(result.bundle).to.exist;
|
|
50
|
+
expect(result.error).to.not.exist;
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test('Error', async () => {
|
|
54
|
+
const bundler = new Bundler({ platform: 'node', sandboxedModules: [], remoteModules: {} });
|
|
55
|
+
const result = await bundler.bundle({ source: "import missing from './module'; missing();" });
|
|
56
|
+
expect(result.bundle).to.not.exist;
|
|
57
|
+
expect(result.error).to.exist;
|
|
58
|
+
});
|
|
59
|
+
});
|