@dxos/functions 0.6.14-staging.e15392e → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/lib/browser/{chunk-TNNXVSUN.mjs → chunk-7QJNOQ6N.mjs} +25 -24
  2. package/dist/lib/browser/chunk-7QJNOQ6N.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-2O2MAZE4.mjs → chunk-L7H5DE53.mjs} +2 -2
  4. package/dist/lib/browser/index.mjs +2 -2
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/testing/index.mjs +2 -2
  7. package/dist/lib/browser/types.mjs +1 -1
  8. package/dist/lib/node/{chunk-SCSHB4MF.cjs → chunk-3KJEM5VR.cjs} +15 -15
  9. package/dist/lib/node/{chunk-O44VB3FE.cjs → chunk-TNG3Z74V.cjs} +28 -27
  10. package/dist/lib/node/chunk-TNG3Z74V.cjs.map +7 -0
  11. package/dist/lib/node/index.cjs +12 -12
  12. package/dist/lib/node/meta.json +1 -1
  13. package/dist/lib/node/testing/index.cjs +10 -10
  14. package/dist/lib/node/types.cjs +5 -5
  15. package/dist/lib/node/types.cjs.map +1 -1
  16. package/dist/lib/node-esm/{chunk-AM7SW4YW.mjs → chunk-DMTGUST2.mjs} +2 -2
  17. package/dist/lib/node-esm/{chunk-TJ4S5QZ3.mjs → chunk-SLC6ICH2.mjs} +25 -24
  18. package/dist/lib/node-esm/chunk-SLC6ICH2.mjs.map +7 -0
  19. package/dist/lib/node-esm/index.mjs +2 -2
  20. package/dist/lib/node-esm/meta.json +1 -1
  21. package/dist/lib/node-esm/testing/index.mjs +2 -2
  22. package/dist/lib/node-esm/types.mjs +1 -1
  23. package/dist/types/src/types.d.ts +36 -36
  24. package/dist/types/src/types.d.ts.map +1 -1
  25. package/package.json +14 -14
  26. package/src/types.ts +36 -44
  27. package/dist/lib/browser/chunk-TNNXVSUN.mjs.map +0 -7
  28. package/dist/lib/node/chunk-O44VB3FE.cjs.map +0 -7
  29. package/dist/lib/node-esm/chunk-TJ4S5QZ3.mjs.map +0 -7
  30. /package/dist/lib/browser/{chunk-2O2MAZE4.mjs.map → chunk-L7H5DE53.mjs.map} +0 -0
  31. /package/dist/lib/node/{chunk-SCSHB4MF.cjs.map → chunk-3KJEM5VR.cjs.map} +0 -0
  32. /package/dist/lib/node-esm/{chunk-AM7SW4YW.mjs.map → chunk-DMTGUST2.mjs.map} +0 -0
@@ -8,41 +8,42 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
8
8
 
9
9
  // packages/core/functions/src/types.ts
10
10
  import { RawObject, S, TypedObject } from "@dxos/echo-schema";
11
- var SubscriptionTriggerSchema = S.mutable(S.Struct({
12
- type: S.Literal("subscription"),
13
- // TODO(burdon): Define query DSL (from ECHO).
14
- filter: S.Array(S.Struct({
15
- type: S.String,
16
- props: S.optional(S.Record({
17
- key: S.String,
18
- value: S.Any
19
- }))
20
- })),
21
- options: S.optional(S.Struct({
22
- // Watch changes to object (not just creation).
23
- deep: S.optional(S.Boolean),
24
- // Debounce changes (delay in ms).
25
- delay: S.optional(S.Number)
26
- }))
27
- }));
28
- var TimerTriggerSchema = S.mutable(S.Struct({
11
+ var TimerTriggerSchema = S.Struct({
29
12
  type: S.Literal("timer"),
30
13
  cron: S.String
31
- }));
32
- var WebhookTriggerSchema = S.mutable(S.Struct({
14
+ }).pipe(S.mutable);
15
+ var WebhookTriggerSchema = S.Struct({
33
16
  type: S.Literal("webhook"),
34
17
  method: S.String,
35
18
  // Assigned port.
36
19
  port: S.optional(S.Number)
37
- }));
38
- var WebsocketTriggerSchema = S.mutable(S.Struct({
20
+ }).pipe(S.mutable);
21
+ var WebsocketTriggerSchema = S.Struct({
39
22
  type: S.Literal("websocket"),
40
23
  url: S.String,
41
24
  init: S.optional(S.Record({
42
25
  key: S.String,
43
26
  value: S.Any
44
27
  }))
45
- }));
28
+ }).pipe(S.mutable);
29
+ var QuerySchema = S.Struct({
30
+ type: S.String,
31
+ props: S.optional(S.Record({
32
+ key: S.String,
33
+ value: S.Any
34
+ }))
35
+ });
36
+ var SubscriptionTriggerSchema = S.Struct({
37
+ type: S.Literal("subscription"),
38
+ // TODO(burdon): Define query DSL (from ECHO). Reconcile with Table.Query.
39
+ filter: S.Array(QuerySchema),
40
+ options: S.optional(S.Struct({
41
+ // Watch changes to object (not just creation).
42
+ deep: S.optional(S.Boolean),
43
+ // Debounce changes (delay in ms).
44
+ delay: S.optional(S.Number)
45
+ }))
46
+ }).pipe(S.mutable);
46
47
  var TriggerSpecSchema = S.Union(TimerTriggerSchema, WebhookTriggerSchema, WebsocketTriggerSchema, SubscriptionTriggerSchema);
47
48
  var FunctionDef = class extends TypedObject({
48
49
  typename: "dxos.org/type/FunctionDef",
@@ -87,4 +88,4 @@ export {
87
88
  FunctionManifestSchema,
88
89
  FUNCTION_SCHEMA
89
90
  };
90
- //# sourceMappingURL=chunk-TNNXVSUN.mjs.map
91
+ //# sourceMappingURL=chunk-7QJNOQ6N.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { RawObject, S, TypedObject } from '@dxos/echo-schema';\n\n/**\n * Type discriminator for TriggerSpec.\n * Every spec has a type field of type FunctionTriggerType that we can use to understand which\n * type we're working with.\n * https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions\n */\nexport type FunctionTriggerType = 'subscription' | 'timer' | 'webhook' | 'websocket';\n\nconst TimerTriggerSchema = S.Struct({\n type: S.Literal('timer'),\n cron: S.String,\n}).pipe(S.mutable);\n\nexport type TimerTrigger = S.Schema.Type<typeof TimerTriggerSchema>;\n\nconst WebhookTriggerSchema = S.Struct({\n type: S.Literal('webhook'),\n method: S.String,\n // Assigned port.\n port: S.optional(S.Number),\n}).pipe(S.mutable);\n\nexport type WebhookTrigger = S.Schema.Type<typeof WebhookTriggerSchema>;\n\nconst WebsocketTriggerSchema = S.Struct({\n type: S.Literal('websocket'),\n url: S.String,\n init: S.optional(S.Record({ key: S.String, value: S.Any })),\n}).pipe(S.mutable);\n\nexport type WebsocketTrigger = S.Schema.Type<typeof WebsocketTriggerSchema>;\n\nconst QuerySchema = S.Struct({\n type: S.String,\n props: S.optional(S.Record({ key: S.String, value: S.Any })),\n});\n\nconst SubscriptionTriggerSchema = S.Struct({\n type: S.Literal('subscription'),\n // TODO(burdon): Define query DSL (from ECHO). Reconcile with Table.Query.\n filter: S.Array(QuerySchema),\n options: S.optional(\n S.Struct({\n // Watch changes to object (not just creation).\n deep: S.optional(S.Boolean),\n // Debounce changes (delay in ms).\n delay: S.optional(S.Number),\n }),\n ),\n}).pipe(S.mutable);\n\nexport type SubscriptionTrigger = S.Schema.Type<typeof SubscriptionTriggerSchema>;\n\nconst TriggerSpecSchema = S.Union(\n TimerTriggerSchema,\n WebhookTriggerSchema,\n WebsocketTriggerSchema,\n SubscriptionTriggerSchema,\n);\n\nexport type TriggerSpec = TimerTrigger | WebhookTrigger | WebsocketTrigger | SubscriptionTrigger;\n\n/**\n * Function definition.\n */\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 trigger.\n */\nexport class FunctionTrigger extends TypedObject({\n typename: 'dxos.org/type/FunctionTrigger',\n version: '0.1.0',\n})({\n name: S.optional(S.String),\n enabled: S.optional(S.Boolean),\n function: S.String.pipe(S.annotations({ description: 'Function URI.' })),\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 spec: TriggerSpecSchema,\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\n// TODO(burdon): Standards?\nexport const FUNCTION_SCHEMA = [FunctionDef, FunctionTrigger];\n"],
5
+ "mappings": ";;;;;;;;;AAIA,SAASA,WAAWC,GAAGC,mBAAmB;AAU1C,IAAMC,qBAAqBC,EAAEC,OAAO;EAClCC,MAAMF,EAAEG,QAAQ,OAAA;EAChBC,MAAMJ,EAAEK;AACV,CAAA,EAAGC,KAAKN,EAAEO,OAAO;AAIjB,IAAMC,uBAAuBR,EAAEC,OAAO;EACpCC,MAAMF,EAAEG,QAAQ,SAAA;EAChBM,QAAQT,EAAEK;;EAEVK,MAAMV,EAAEW,SAASX,EAAEY,MAAM;AAC3B,CAAA,EAAGN,KAAKN,EAAEO,OAAO;AAIjB,IAAMM,yBAAyBb,EAAEC,OAAO;EACtCC,MAAMF,EAAEG,QAAQ,WAAA;EAChBW,KAAKd,EAAEK;EACPU,MAAMf,EAAEW,SAASX,EAAEgB,OAAO;IAAEC,KAAKjB,EAAEK;IAAQa,OAAOlB,EAAEmB;EAAI,CAAA,CAAA;AAC1D,CAAA,EAAGb,KAAKN,EAAEO,OAAO;AAIjB,IAAMa,cAAcpB,EAAEC,OAAO;EAC3BC,MAAMF,EAAEK;EACRgB,OAAOrB,EAAEW,SAASX,EAAEgB,OAAO;IAAEC,KAAKjB,EAAEK;IAAQa,OAAOlB,EAAEmB;EAAI,CAAA,CAAA;AAC3D,CAAA;AAEA,IAAMG,4BAA4BtB,EAAEC,OAAO;EACzCC,MAAMF,EAAEG,QAAQ,cAAA;;EAEhBoB,QAAQvB,EAAEwB,MAAMJ,WAAAA;EAChBK,SAASzB,EAAEW,SACTX,EAAEC,OAAO;;IAEPyB,MAAM1B,EAAEW,SAASX,EAAE2B,OAAO;;IAE1BC,OAAO5B,EAAEW,SAASX,EAAEY,MAAM;EAC5B,CAAA,CAAA;AAEJ,CAAA,EAAGN,KAAKN,EAAEO,OAAO;AAIjB,IAAMsB,oBAAoB7B,EAAE8B,MAC1B/B,oBACAS,sBACAK,wBACAS,yBAAAA;AAQK,IAAMS,cAAN,cAA0BC,YAAY;EAC3CC,UAAU;EACVC,SAAS;AACX,CAAA,EAAG;EACDC,KAAKnC,EAAEK;EACP+B,aAAapC,EAAEW,SAASX,EAAEK,MAAM;EAChCgC,OAAOrC,EAAEK;EACTiC,SAAStC,EAAEK;AACb,CAAA,EAAA;AAAI;AAKG,IAAMkC,kBAAN,cAA8BP,YAAY;EAC/CC,UAAU;EACVC,SAAS;AACX,CAAA,EAAG;EACDM,MAAMxC,EAAEW,SAASX,EAAEK,MAAM;EACzBoC,SAASzC,EAAEW,SAASX,EAAE2B,OAAO;EAC7Be,UAAU1C,EAAEK,OAAOC,KAAKN,EAAE2C,YAAY;IAAEP,aAAa;EAAgB,CAAA,CAAA;;EAErEQ,MAAM5C,EAAEW,SAASX,EAAEO,QAAQP,EAAEgB,OAAO;IAAEC,KAAKjB,EAAEK;IAAQa,OAAOlB,EAAEmB;EAAI,CAAA,CAAA,CAAA;EAClE0B,MAAMhB;AACR,CAAA,EAAA;AAAI;AAKG,IAAMiB,yBAAyB9C,EAAEC,OAAO;EAC7C8C,WAAW/C,EAAEW,SAASX,EAAEO,QAAQP,EAAEwB,MAAMwB,UAAUjB,WAAAA,CAAAA,CAAAA,CAAAA;EAClDkB,UAAUjD,EAAEW,SAASX,EAAEO,QAAQP,EAAEwB,MAAMwB,UAAUT,eAAAA,CAAAA,CAAAA,CAAAA;AACnD,CAAA;AAKO,IAAMW,kBAAkB;EAACnB;EAAaQ;;",
6
+ "names": ["RawObject", "S", "TypedObject", "TimerTriggerSchema", "S", "Struct", "type", "Literal", "cron", "String", "pipe", "mutable", "WebhookTriggerSchema", "method", "port", "optional", "Number", "WebsocketTriggerSchema", "url", "init", "Record", "key", "value", "Any", "QuerySchema", "props", "SubscriptionTriggerSchema", "filter", "Array", "options", "deep", "Boolean", "delay", "TriggerSpecSchema", "Union", "FunctionDef", "TypedObject", "typename", "version", "uri", "description", "route", "handler", "FunctionTrigger", "name", "enabled", "function", "annotations", "meta", "spec", "FunctionManifestSchema", "functions", "RawObject", "triggers", "FUNCTION_SCHEMA"]
7
+ }
@@ -2,7 +2,7 @@ import "@dxos/node-std/globals";
2
2
  import {
3
3
  FunctionDef,
4
4
  FunctionTrigger
5
- } from "./chunk-TNNXVSUN.mjs";
5
+ } from "./chunk-7QJNOQ6N.mjs";
6
6
 
7
7
  // packages/core/functions/src/function/function-registry.ts
8
8
  import { Event } from "@dxos/async";
@@ -601,4 +601,4 @@ export {
601
601
  createWebSocket,
602
602
  TriggerRegistry
603
603
  };
604
- //# sourceMappingURL=chunk-2O2MAZE4.mjs.map
604
+ //# sourceMappingURL=chunk-L7H5DE53.mjs.map
@@ -6,13 +6,13 @@ import {
6
6
  createTimerTrigger,
7
7
  createWebSocket,
8
8
  createWebsocketTrigger
9
- } from "./chunk-2O2MAZE4.mjs";
9
+ } from "./chunk-L7H5DE53.mjs";
10
10
  import {
11
11
  FUNCTION_SCHEMA,
12
12
  FunctionDef,
13
13
  FunctionManifestSchema,
14
14
  FunctionTrigger
15
- } from "./chunk-TNNXVSUN.mjs";
15
+ } from "./chunk-7QJNOQ6N.mjs";
16
16
 
17
17
  // packages/core/functions/src/handler.ts
18
18
  import { PublicKey } from "@dxos/client";
@@ -1 +1 @@
1
- {"inputs":{"packages/core/functions/src/types.ts":{"bytes":10352,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"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.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":10610,"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":10343,"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/websocket-trigger.ts":{"bytes":13341,"imports":[{"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":864,"imports":[{"path":"packages/core/functions/src/trigger/type/subscription-trigger.ts","kind":"import-statement","original":"./subscription-trigger"},{"path":"packages/core/functions/src/trigger/type/timer-trigger.ts","kind":"import-statement","original":"./timer-trigger"},{"path":"packages/core/functions/src/trigger/type/websocket-trigger.ts","kind":"import-statement","original":"./websocket-trigger"}],"format":"esm"},"packages/core/functions/src/trigger/trigger-registry.ts":{"bytes":28453,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/functions/src/trigger/type/index.ts","kind":"import-statement","original":"./type"},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/trigger/index.ts":{"bytes":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":840,"imports":[{"path":"packages/core/functions/src/function/index.ts","kind":"import-statement","original":"./function"},{"path":"packages/core/functions/src/handler.ts","kind":"import-statement","original":"./handler"},{"path":"packages/core/functions/src/trigger/index.ts","kind":"import-statement","original":"./trigger"},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/core/functions/src/testing/types.ts":{"bytes":1131,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/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":21084,"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.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/testing/util.ts":{"bytes":4292,"imports":[{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/testing/manifest.ts":{"bytes":1139,"imports":[],"format":"esm"},"packages/core/functions/src/testing/index.ts":{"bytes":749,"imports":[{"path":"packages/core/functions/src/testing/setup.ts","kind":"import-statement","original":"./setup"},{"path":"packages/core/functions/src/testing/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/functions/src/testing/util.ts","kind":"import-statement","original":"./util"},{"path":"packages/core/functions/src/testing/manifest.ts","kind":"import-statement","original":"./manifest"}],"format":"esm"}},"outputs":{"packages/core/functions/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5751},"packages/core/functions/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-2O2MAZE4.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/browser/chunk-TNNXVSUN.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":["FUNCTION_SCHEMA","FunctionDef","FunctionManifestSchema","FunctionRegistry","FunctionTrigger","TriggerRegistry","createSubscriptionTrigger","createTimerTrigger","createWebSocket","createWebsocketTrigger","subscriptionHandler"],"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":2275},"packages/core/functions/dist/lib/browser/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":32237},"packages/core/functions/dist/lib/browser/testing/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-2O2MAZE4.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/browser/chunk-TNNXVSUN.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":5340},"packages/core/functions/src/testing/index.ts":{"bytesInOutput":0},"packages/core/functions/src/testing/util.ts":{"bytesInOutput":1051},"packages/core/functions/src/testing/manifest.ts":{"bytesInOutput":146}},"bytes":18118},"packages/core/functions/dist/lib/browser/chunk-2O2MAZE4.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":33089},"packages/core/functions/dist/lib/browser/chunk-2O2MAZE4.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-TNNXVSUN.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/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","createWebSocket","createWebsocketTrigger"],"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":2008},"packages/core/functions/src/trigger/type/timer-trigger.ts":{"bytesInOutput":898},"packages/core/functions/src/trigger/type/websocket-trigger.ts":{"bytesInOutput":3491},"packages/core/functions/src/trigger/trigger-registry.ts":{"bytesInOutput":7421},"packages/core/functions/src/trigger/type/index.ts":{"bytesInOutput":0},"packages/core/functions/src/trigger/index.ts":{"bytesInOutput":0}},"bytes":17480},"packages/core/functions/dist/lib/browser/types.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/browser/types.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-TNNXVSUN.mjs","kind":"import-statement"}],"exports":["FUNCTION_SCHEMA","FunctionDef","FunctionManifestSchema","FunctionTrigger"],"entryPoint":"packages/core/functions/src/types.ts","inputs":{},"bytes":276},"packages/core/functions/dist/lib/browser/chunk-TNNXVSUN.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5699},"packages/core/functions/dist/lib/browser/chunk-TNNXVSUN.mjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["FUNCTION_SCHEMA","FunctionDef","FunctionManifestSchema","FunctionTrigger","__require"],"inputs":{"packages/core/functions/src/types.ts":{"bytesInOutput":2005}},"bytes":2592}}}
1
+ {"inputs":{"packages/core/functions/src/types.ts":{"bytes":10493,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"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.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":10610,"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":10343,"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/websocket-trigger.ts":{"bytes":13341,"imports":[{"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":864,"imports":[{"path":"packages/core/functions/src/trigger/type/subscription-trigger.ts","kind":"import-statement","original":"./subscription-trigger"},{"path":"packages/core/functions/src/trigger/type/timer-trigger.ts","kind":"import-statement","original":"./timer-trigger"},{"path":"packages/core/functions/src/trigger/type/websocket-trigger.ts","kind":"import-statement","original":"./websocket-trigger"}],"format":"esm"},"packages/core/functions/src/trigger/trigger-registry.ts":{"bytes":28453,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/functions/src/trigger/type/index.ts","kind":"import-statement","original":"./type"},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/trigger/index.ts":{"bytes":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":840,"imports":[{"path":"packages/core/functions/src/function/index.ts","kind":"import-statement","original":"./function"},{"path":"packages/core/functions/src/handler.ts","kind":"import-statement","original":"./handler"},{"path":"packages/core/functions/src/trigger/index.ts","kind":"import-statement","original":"./trigger"},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/core/functions/src/testing/types.ts":{"bytes":1131,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/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":21084,"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.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/testing/util.ts":{"bytes":4292,"imports":[{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"packages/core/functions/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/testing/manifest.ts":{"bytes":1139,"imports":[],"format":"esm"},"packages/core/functions/src/testing/index.ts":{"bytes":749,"imports":[{"path":"packages/core/functions/src/testing/setup.ts","kind":"import-statement","original":"./setup"},{"path":"packages/core/functions/src/testing/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/functions/src/testing/util.ts","kind":"import-statement","original":"./util"},{"path":"packages/core/functions/src/testing/manifest.ts","kind":"import-statement","original":"./manifest"}],"format":"esm"}},"outputs":{"packages/core/functions/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5751},"packages/core/functions/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-L7H5DE53.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/browser/chunk-7QJNOQ6N.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":["FUNCTION_SCHEMA","FunctionDef","FunctionManifestSchema","FunctionRegistry","FunctionTrigger","TriggerRegistry","createSubscriptionTrigger","createTimerTrigger","createWebSocket","createWebsocketTrigger","subscriptionHandler"],"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":2275},"packages/core/functions/dist/lib/browser/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":32237},"packages/core/functions/dist/lib/browser/testing/index.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-L7H5DE53.mjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/browser/chunk-7QJNOQ6N.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":5340},"packages/core/functions/src/testing/index.ts":{"bytesInOutput":0},"packages/core/functions/src/testing/util.ts":{"bytesInOutput":1051},"packages/core/functions/src/testing/manifest.ts":{"bytesInOutput":146}},"bytes":18118},"packages/core/functions/dist/lib/browser/chunk-L7H5DE53.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":33089},"packages/core/functions/dist/lib/browser/chunk-L7H5DE53.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-7QJNOQ6N.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/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","createWebSocket","createWebsocketTrigger"],"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":2008},"packages/core/functions/src/trigger/type/timer-trigger.ts":{"bytesInOutput":898},"packages/core/functions/src/trigger/type/websocket-trigger.ts":{"bytesInOutput":3491},"packages/core/functions/src/trigger/trigger-registry.ts":{"bytesInOutput":7421},"packages/core/functions/src/trigger/type/index.ts":{"bytesInOutput":0},"packages/core/functions/src/trigger/index.ts":{"bytesInOutput":0}},"bytes":17480},"packages/core/functions/dist/lib/browser/types.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/browser/types.mjs":{"imports":[{"path":"packages/core/functions/dist/lib/browser/chunk-7QJNOQ6N.mjs","kind":"import-statement"}],"exports":["FUNCTION_SCHEMA","FunctionDef","FunctionManifestSchema","FunctionTrigger"],"entryPoint":"packages/core/functions/src/types.ts","inputs":{},"bytes":276},"packages/core/functions/dist/lib/browser/chunk-7QJNOQ6N.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5743},"packages/core/functions/dist/lib/browser/chunk-7QJNOQ6N.mjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["FUNCTION_SCHEMA","FunctionDef","FunctionManifestSchema","FunctionTrigger","__require"],"inputs":{"packages/core/functions/src/types.ts":{"bytesInOutput":2072}},"bytes":2659}}}
@@ -2,12 +2,12 @@ import "@dxos/node-std/globals";
2
2
  import {
3
3
  FunctionRegistry,
4
4
  TriggerRegistry
5
- } from "../chunk-2O2MAZE4.mjs";
5
+ } from "../chunk-L7H5DE53.mjs";
6
6
  import {
7
7
  FunctionDef,
8
8
  FunctionTrigger,
9
9
  __require
10
- } from "../chunk-TNNXVSUN.mjs";
10
+ } from "../chunk-7QJNOQ6N.mjs";
11
11
 
12
12
  // packages/core/functions/src/testing/setup.ts
13
13
  import { getRandomPort } from "get-port-please";
@@ -4,7 +4,7 @@ import {
4
4
  FunctionDef,
5
5
  FunctionManifestSchema,
6
6
  FunctionTrigger
7
- } from "./chunk-TNNXVSUN.mjs";
7
+ } from "./chunk-7QJNOQ6N.mjs";
8
8
  export {
9
9
  FUNCTION_SCHEMA,
10
10
  FunctionDef,
@@ -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 chunk_SCSHB4MF_exports = {};
20
- __export(chunk_SCSHB4MF_exports, {
19
+ var chunk_3KJEM5VR_exports = {};
20
+ __export(chunk_3KJEM5VR_exports, {
21
21
  FunctionRegistry: () => FunctionRegistry,
22
22
  TriggerRegistry: () => TriggerRegistry,
23
23
  createSubscriptionTrigger: () => createSubscriptionTrigger,
@@ -25,8 +25,8 @@ __export(chunk_SCSHB4MF_exports, {
25
25
  createWebSocket: () => createWebSocket,
26
26
  createWebsocketTrigger: () => createWebsocketTrigger
27
27
  });
28
- module.exports = __toCommonJS(chunk_SCSHB4MF_exports);
29
- var import_chunk_O44VB3FE = require("./chunk-O44VB3FE.cjs");
28
+ module.exports = __toCommonJS(chunk_3KJEM5VR_exports);
29
+ var import_chunk_TNG3Z74V = require("./chunk-TNG3Z74V.cjs");
30
30
  var import_async = require("@dxos/async");
31
31
  var import_echo = require("@dxos/client/echo");
32
32
  var import_context = require("@dxos/context");
@@ -89,14 +89,14 @@ var FunctionRegistry = class extends import_context.Resource {
89
89
  if (!functions?.length) {
90
90
  return;
91
91
  }
92
- if (!space.db.graph.schemaRegistry.hasSchema(import_chunk_O44VB3FE.FunctionDef)) {
92
+ if (!space.db.graph.schemaRegistry.hasSchema(import_chunk_TNG3Z74V.FunctionDef)) {
93
93
  space.db.graph.schemaRegistry.addSchema([
94
- import_chunk_O44VB3FE.FunctionDef
94
+ import_chunk_TNG3Z74V.FunctionDef
95
95
  ]);
96
96
  }
97
- const { objects: existing } = await space.db.query(import_echo.Filter.schema(import_chunk_O44VB3FE.FunctionDef)).run();
97
+ const { objects: existing } = await space.db.query(import_echo.Filter.schema(import_chunk_TNG3Z74V.FunctionDef)).run();
98
98
  const { added } = (0, import_util.diff)(existing, functions, (a, b) => a.uri === b.uri);
99
- added.forEach((def) => space.db.add((0, import_echo.create)(import_chunk_O44VB3FE.FunctionDef, def)));
99
+ added.forEach((def) => space.db.add((0, import_echo.create)(import_chunk_TNG3Z74V.FunctionDef, def)));
100
100
  if (added.length > 0) {
101
101
  await space.db.flush({
102
102
  indexes: true,
@@ -122,7 +122,7 @@ var FunctionRegistry = class extends import_context.Resource {
122
122
  if (this._ctx.disposed) {
123
123
  break;
124
124
  }
125
- this._ctx.onDispose(space.db.query(import_echo.Filter.schema(import_chunk_O44VB3FE.FunctionDef)).subscribe(({ objects }) => {
125
+ this._ctx.onDispose(space.db.query(import_echo.Filter.schema(import_chunk_TNG3Z74V.FunctionDef)).subscribe(({ objects }) => {
126
126
  const { added } = (0, import_util.diff)(registered, objects, (a, b) => a.uri === b.uri);
127
127
  if (added.length > 0) {
128
128
  registered.push(...added);
@@ -457,9 +457,9 @@ var TriggerRegistry = class extends import_context2.Resource {
457
457
  if (!manifest.triggers?.length) {
458
458
  return;
459
459
  }
460
- if (!space.db.graph.schemaRegistry.hasSchema(import_chunk_O44VB3FE.FunctionTrigger)) {
460
+ if (!space.db.graph.schemaRegistry.hasSchema(import_chunk_TNG3Z74V.FunctionTrigger)) {
461
461
  space.db.graph.schemaRegistry.addSchema([
462
- import_chunk_O44VB3FE.FunctionTrigger
462
+ import_chunk_TNG3Z74V.FunctionTrigger
463
463
  ]);
464
464
  }
465
465
  const manifestTriggers = manifest.triggers.map((trigger) => {
@@ -473,11 +473,11 @@ var TriggerRegistry = class extends import_context2.Resource {
473
473
  ].join(":"))
474
474
  ];
475
475
  }
476
- return (0, import_echo3.create)(import_chunk_O44VB3FE.FunctionTrigger, trigger, {
476
+ return (0, import_echo3.create)(import_chunk_TNG3Z74V.FunctionTrigger, trigger, {
477
477
  keys
478
478
  });
479
479
  });
480
- const { objects: existing } = await space.db.query(import_echo3.Filter.schema(import_chunk_O44VB3FE.FunctionTrigger)).run();
480
+ const { objects: existing } = await space.db.query(import_echo3.Filter.schema(import_chunk_TNG3Z74V.FunctionTrigger)).run();
481
481
  const { added } = (0, import_util2.diff)(existing, manifestTriggers, import_echo_schema.compareForeignKeys);
482
482
  added.forEach((trigger) => {
483
483
  space.db.add(trigger);
@@ -512,7 +512,7 @@ var TriggerRegistry = class extends import_context2.Resource {
512
512
  if (this._ctx.disposed) {
513
513
  break;
514
514
  }
515
- this._ctx.onDispose(space.db.query(import_echo3.Filter.schema(import_chunk_O44VB3FE.FunctionTrigger)).subscribe(async ({ objects: current }) => {
515
+ this._ctx.onDispose(space.db.query(import_echo3.Filter.schema(import_chunk_TNG3Z74V.FunctionTrigger)).subscribe(async ({ objects: current }) => {
516
516
  import_log5.log.info("update", {
517
517
  space: space.key,
518
518
  registered: registered.length,
@@ -615,4 +615,4 @@ var TriggerRegistry = class extends import_context2.Resource {
615
615
  createWebSocket,
616
616
  createWebsocketTrigger
617
617
  });
618
- //# sourceMappingURL=chunk-SCSHB4MF.cjs.map
618
+ //# sourceMappingURL=chunk-3KJEM5VR.cjs.map
@@ -16,15 +16,15 @@ 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 chunk_O44VB3FE_exports = {};
20
- __export(chunk_O44VB3FE_exports, {
19
+ var chunk_TNG3Z74V_exports = {};
20
+ __export(chunk_TNG3Z74V_exports, {
21
21
  FUNCTION_SCHEMA: () => FUNCTION_SCHEMA,
22
22
  FunctionDef: () => FunctionDef,
23
23
  FunctionManifestSchema: () => FunctionManifestSchema,
24
24
  FunctionTrigger: () => FunctionTrigger,
25
25
  __require: () => __require
26
26
  });
27
- module.exports = __toCommonJS(chunk_O44VB3FE_exports);
27
+ module.exports = __toCommonJS(chunk_TNG3Z74V_exports);
28
28
  var import_echo_schema = require("@dxos/echo-schema");
29
29
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
30
30
  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
@@ -32,41 +32,42 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
32
32
  if (typeof require !== "undefined") return require.apply(this, arguments);
33
33
  throw Error('Dynamic require of "' + x + '" is not supported');
34
34
  });
35
- var SubscriptionTriggerSchema = import_echo_schema.S.mutable(import_echo_schema.S.Struct({
36
- type: import_echo_schema.S.Literal("subscription"),
37
- // TODO(burdon): Define query DSL (from ECHO).
38
- filter: import_echo_schema.S.Array(import_echo_schema.S.Struct({
39
- type: import_echo_schema.S.String,
40
- props: import_echo_schema.S.optional(import_echo_schema.S.Record({
41
- key: import_echo_schema.S.String,
42
- value: import_echo_schema.S.Any
43
- }))
44
- })),
45
- options: import_echo_schema.S.optional(import_echo_schema.S.Struct({
46
- // Watch changes to object (not just creation).
47
- deep: import_echo_schema.S.optional(import_echo_schema.S.Boolean),
48
- // Debounce changes (delay in ms).
49
- delay: import_echo_schema.S.optional(import_echo_schema.S.Number)
50
- }))
51
- }));
52
- var TimerTriggerSchema = import_echo_schema.S.mutable(import_echo_schema.S.Struct({
35
+ var TimerTriggerSchema = import_echo_schema.S.Struct({
53
36
  type: import_echo_schema.S.Literal("timer"),
54
37
  cron: import_echo_schema.S.String
55
- }));
56
- var WebhookTriggerSchema = import_echo_schema.S.mutable(import_echo_schema.S.Struct({
38
+ }).pipe(import_echo_schema.S.mutable);
39
+ var WebhookTriggerSchema = import_echo_schema.S.Struct({
57
40
  type: import_echo_schema.S.Literal("webhook"),
58
41
  method: import_echo_schema.S.String,
59
42
  // Assigned port.
60
43
  port: import_echo_schema.S.optional(import_echo_schema.S.Number)
61
- }));
62
- var WebsocketTriggerSchema = import_echo_schema.S.mutable(import_echo_schema.S.Struct({
44
+ }).pipe(import_echo_schema.S.mutable);
45
+ var WebsocketTriggerSchema = import_echo_schema.S.Struct({
63
46
  type: import_echo_schema.S.Literal("websocket"),
64
47
  url: import_echo_schema.S.String,
65
48
  init: import_echo_schema.S.optional(import_echo_schema.S.Record({
66
49
  key: import_echo_schema.S.String,
67
50
  value: import_echo_schema.S.Any
68
51
  }))
69
- }));
52
+ }).pipe(import_echo_schema.S.mutable);
53
+ var QuerySchema = import_echo_schema.S.Struct({
54
+ type: import_echo_schema.S.String,
55
+ props: import_echo_schema.S.optional(import_echo_schema.S.Record({
56
+ key: import_echo_schema.S.String,
57
+ value: import_echo_schema.S.Any
58
+ }))
59
+ });
60
+ var SubscriptionTriggerSchema = import_echo_schema.S.Struct({
61
+ type: import_echo_schema.S.Literal("subscription"),
62
+ // TODO(burdon): Define query DSL (from ECHO). Reconcile with Table.Query.
63
+ filter: import_echo_schema.S.Array(QuerySchema),
64
+ options: import_echo_schema.S.optional(import_echo_schema.S.Struct({
65
+ // Watch changes to object (not just creation).
66
+ deep: import_echo_schema.S.optional(import_echo_schema.S.Boolean),
67
+ // Debounce changes (delay in ms).
68
+ delay: import_echo_schema.S.optional(import_echo_schema.S.Number)
69
+ }))
70
+ }).pipe(import_echo_schema.S.mutable);
70
71
  var TriggerSpecSchema = import_echo_schema.S.Union(TimerTriggerSchema, WebhookTriggerSchema, WebsocketTriggerSchema, SubscriptionTriggerSchema);
71
72
  var FunctionDef = class extends (0, import_echo_schema.TypedObject)({
72
73
  typename: "dxos.org/type/FunctionDef",
@@ -111,4 +112,4 @@ var FUNCTION_SCHEMA = [
111
112
  FunctionTrigger,
112
113
  __require
113
114
  });
114
- //# sourceMappingURL=chunk-O44VB3FE.cjs.map
115
+ //# sourceMappingURL=chunk-TNG3Z74V.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { RawObject, S, TypedObject } from '@dxos/echo-schema';\n\n/**\n * Type discriminator for TriggerSpec.\n * Every spec has a type field of type FunctionTriggerType that we can use to understand which\n * type we're working with.\n * https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions\n */\nexport type FunctionTriggerType = 'subscription' | 'timer' | 'webhook' | 'websocket';\n\nconst TimerTriggerSchema = S.Struct({\n type: S.Literal('timer'),\n cron: S.String,\n}).pipe(S.mutable);\n\nexport type TimerTrigger = S.Schema.Type<typeof TimerTriggerSchema>;\n\nconst WebhookTriggerSchema = S.Struct({\n type: S.Literal('webhook'),\n method: S.String,\n // Assigned port.\n port: S.optional(S.Number),\n}).pipe(S.mutable);\n\nexport type WebhookTrigger = S.Schema.Type<typeof WebhookTriggerSchema>;\n\nconst WebsocketTriggerSchema = S.Struct({\n type: S.Literal('websocket'),\n url: S.String,\n init: S.optional(S.Record({ key: S.String, value: S.Any })),\n}).pipe(S.mutable);\n\nexport type WebsocketTrigger = S.Schema.Type<typeof WebsocketTriggerSchema>;\n\nconst QuerySchema = S.Struct({\n type: S.String,\n props: S.optional(S.Record({ key: S.String, value: S.Any })),\n});\n\nconst SubscriptionTriggerSchema = S.Struct({\n type: S.Literal('subscription'),\n // TODO(burdon): Define query DSL (from ECHO). Reconcile with Table.Query.\n filter: S.Array(QuerySchema),\n options: S.optional(\n S.Struct({\n // Watch changes to object (not just creation).\n deep: S.optional(S.Boolean),\n // Debounce changes (delay in ms).\n delay: S.optional(S.Number),\n }),\n ),\n}).pipe(S.mutable);\n\nexport type SubscriptionTrigger = S.Schema.Type<typeof SubscriptionTriggerSchema>;\n\nconst TriggerSpecSchema = S.Union(\n TimerTriggerSchema,\n WebhookTriggerSchema,\n WebsocketTriggerSchema,\n SubscriptionTriggerSchema,\n);\n\nexport type TriggerSpec = TimerTrigger | WebhookTrigger | WebsocketTrigger | SubscriptionTrigger;\n\n/**\n * Function definition.\n */\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 trigger.\n */\nexport class FunctionTrigger extends TypedObject({\n typename: 'dxos.org/type/FunctionTrigger',\n version: '0.1.0',\n})({\n name: S.optional(S.String),\n enabled: S.optional(S.Boolean),\n function: S.String.pipe(S.annotations({ description: 'Function URI.' })),\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 spec: TriggerSpecSchema,\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\n// TODO(burdon): Standards?\nexport const FUNCTION_SCHEMA = [FunctionDef, FunctionTrigger];\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,yBAA0C;;;;;;;AAU1C,IAAMA,qBAAqBC,qBAAEC,OAAO;EAClCC,MAAMF,qBAAEG,QAAQ,OAAA;EAChBC,MAAMJ,qBAAEK;AACV,CAAA,EAAGC,KAAKN,qBAAEO,OAAO;AAIjB,IAAMC,uBAAuBR,qBAAEC,OAAO;EACpCC,MAAMF,qBAAEG,QAAQ,SAAA;EAChBM,QAAQT,qBAAEK;;EAEVK,MAAMV,qBAAEW,SAASX,qBAAEY,MAAM;AAC3B,CAAA,EAAGN,KAAKN,qBAAEO,OAAO;AAIjB,IAAMM,yBAAyBb,qBAAEC,OAAO;EACtCC,MAAMF,qBAAEG,QAAQ,WAAA;EAChBW,KAAKd,qBAAEK;EACPU,MAAMf,qBAAEW,SAASX,qBAAEgB,OAAO;IAAEC,KAAKjB,qBAAEK;IAAQa,OAAOlB,qBAAEmB;EAAI,CAAA,CAAA;AAC1D,CAAA,EAAGb,KAAKN,qBAAEO,OAAO;AAIjB,IAAMa,cAAcpB,qBAAEC,OAAO;EAC3BC,MAAMF,qBAAEK;EACRgB,OAAOrB,qBAAEW,SAASX,qBAAEgB,OAAO;IAAEC,KAAKjB,qBAAEK;IAAQa,OAAOlB,qBAAEmB;EAAI,CAAA,CAAA;AAC3D,CAAA;AAEA,IAAMG,4BAA4BtB,qBAAEC,OAAO;EACzCC,MAAMF,qBAAEG,QAAQ,cAAA;;EAEhBoB,QAAQvB,qBAAEwB,MAAMJ,WAAAA;EAChBK,SAASzB,qBAAEW,SACTX,qBAAEC,OAAO;;IAEPyB,MAAM1B,qBAAEW,SAASX,qBAAE2B,OAAO;;IAE1BC,OAAO5B,qBAAEW,SAASX,qBAAEY,MAAM;EAC5B,CAAA,CAAA;AAEJ,CAAA,EAAGN,KAAKN,qBAAEO,OAAO;AAIjB,IAAMsB,oBAAoB7B,qBAAE8B,MAC1B/B,oBACAS,sBACAK,wBACAS,yBAAAA;AAQK,IAAMS,cAAN,kBAA0BC,gCAAY;EAC3CC,UAAU;EACVC,SAAS;AACX,CAAA,EAAG;EACDC,KAAKnC,qBAAEK;EACP+B,aAAapC,qBAAEW,SAASX,qBAAEK,MAAM;EAChCgC,OAAOrC,qBAAEK;EACTiC,SAAStC,qBAAEK;AACb,CAAA,EAAA;AAAI;AAKG,IAAMkC,kBAAN,kBAA8BP,gCAAY;EAC/CC,UAAU;EACVC,SAAS;AACX,CAAA,EAAG;EACDM,MAAMxC,qBAAEW,SAASX,qBAAEK,MAAM;EACzBoC,SAASzC,qBAAEW,SAASX,qBAAE2B,OAAO;EAC7Be,UAAU1C,qBAAEK,OAAOC,KAAKN,qBAAE2C,YAAY;IAAEP,aAAa;EAAgB,CAAA,CAAA;;EAErEQ,MAAM5C,qBAAEW,SAASX,qBAAEO,QAAQP,qBAAEgB,OAAO;IAAEC,KAAKjB,qBAAEK;IAAQa,OAAOlB,qBAAEmB;EAAI,CAAA,CAAA,CAAA;EAClE0B,MAAMhB;AACR,CAAA,EAAA;AAAI;AAKG,IAAMiB,yBAAyB9C,qBAAEC,OAAO;EAC7C8C,WAAW/C,qBAAEW,SAASX,qBAAEO,QAAQP,qBAAEwB,UAAMwB,8BAAUjB,WAAAA,CAAAA,CAAAA,CAAAA;EAClDkB,UAAUjD,qBAAEW,SAASX,qBAAEO,QAAQP,qBAAEwB,UAAMwB,8BAAUT,eAAAA,CAAAA,CAAAA,CAAAA;AACnD,CAAA;AAKO,IAAMW,kBAAkB;EAACnB;EAAaQ;;",
6
+ "names": ["TimerTriggerSchema", "S", "Struct", "type", "Literal", "cron", "String", "pipe", "mutable", "WebhookTriggerSchema", "method", "port", "optional", "Number", "WebsocketTriggerSchema", "url", "init", "Record", "key", "value", "Any", "QuerySchema", "props", "SubscriptionTriggerSchema", "filter", "Array", "options", "deep", "Boolean", "delay", "TriggerSpecSchema", "Union", "FunctionDef", "TypedObject", "typename", "version", "uri", "description", "route", "handler", "FunctionTrigger", "name", "enabled", "function", "annotations", "meta", "spec", "FunctionManifestSchema", "functions", "RawObject", "triggers", "FUNCTION_SCHEMA"]
7
+ }
@@ -18,21 +18,21 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var node_exports = {};
20
20
  __export(node_exports, {
21
- FUNCTION_SCHEMA: () => import_chunk_O44VB3FE.FUNCTION_SCHEMA,
22
- FunctionDef: () => import_chunk_O44VB3FE.FunctionDef,
23
- FunctionManifestSchema: () => import_chunk_O44VB3FE.FunctionManifestSchema,
24
- FunctionRegistry: () => import_chunk_SCSHB4MF.FunctionRegistry,
25
- FunctionTrigger: () => import_chunk_O44VB3FE.FunctionTrigger,
26
- TriggerRegistry: () => import_chunk_SCSHB4MF.TriggerRegistry,
27
- createSubscriptionTrigger: () => import_chunk_SCSHB4MF.createSubscriptionTrigger,
28
- createTimerTrigger: () => import_chunk_SCSHB4MF.createTimerTrigger,
29
- createWebSocket: () => import_chunk_SCSHB4MF.createWebSocket,
30
- createWebsocketTrigger: () => import_chunk_SCSHB4MF.createWebsocketTrigger,
21
+ FUNCTION_SCHEMA: () => import_chunk_TNG3Z74V.FUNCTION_SCHEMA,
22
+ FunctionDef: () => import_chunk_TNG3Z74V.FunctionDef,
23
+ FunctionManifestSchema: () => import_chunk_TNG3Z74V.FunctionManifestSchema,
24
+ FunctionRegistry: () => import_chunk_3KJEM5VR.FunctionRegistry,
25
+ FunctionTrigger: () => import_chunk_TNG3Z74V.FunctionTrigger,
26
+ TriggerRegistry: () => import_chunk_3KJEM5VR.TriggerRegistry,
27
+ createSubscriptionTrigger: () => import_chunk_3KJEM5VR.createSubscriptionTrigger,
28
+ createTimerTrigger: () => import_chunk_3KJEM5VR.createTimerTrigger,
29
+ createWebSocket: () => import_chunk_3KJEM5VR.createWebSocket,
30
+ createWebsocketTrigger: () => import_chunk_3KJEM5VR.createWebsocketTrigger,
31
31
  subscriptionHandler: () => subscriptionHandler
32
32
  });
33
33
  module.exports = __toCommonJS(node_exports);
34
- var import_chunk_SCSHB4MF = require("./chunk-SCSHB4MF.cjs");
35
- var import_chunk_O44VB3FE = require("./chunk-O44VB3FE.cjs");
34
+ var import_chunk_3KJEM5VR = require("./chunk-3KJEM5VR.cjs");
35
+ var import_chunk_TNG3Z74V = require("./chunk-TNG3Z74V.cjs");
36
36
  var import_client = require("@dxos/client");
37
37
  var import_log = require("@dxos/log");
38
38
  var import_util = require("@dxos/util");