@dxos/functions 0.5.3-main.61bbff4 → 0.5.3-main.64035f0

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 (73) hide show
  1. package/dist/lib/browser/index.mjs +424 -642
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node/index.cjs +421 -627
  5. package/dist/lib/node/index.cjs.map +4 -4
  6. package/dist/lib/node/meta.json +1 -1
  7. package/dist/types/src/index.d.ts +0 -2
  8. package/dist/types/src/index.d.ts.map +1 -1
  9. package/dist/types/src/runtime/dev-server.d.ts +10 -7
  10. package/dist/types/src/runtime/dev-server.d.ts.map +1 -1
  11. package/dist/types/src/runtime/scheduler.d.ts +59 -10
  12. package/dist/types/src/runtime/scheduler.d.ts.map +1 -1
  13. package/dist/types/src/testing/test/handler.d.ts +0 -1
  14. package/dist/types/src/testing/test/handler.d.ts.map +1 -1
  15. package/dist/types/src/types.d.ts +112 -118
  16. package/dist/types/src/types.d.ts.map +1 -1
  17. package/package.json +13 -16
  18. package/schema/functions.json +107 -121
  19. package/src/index.ts +0 -2
  20. package/src/runtime/dev-server.test.ts +35 -15
  21. package/src/runtime/dev-server.ts +18 -36
  22. package/src/runtime/scheduler.test.ts +75 -54
  23. package/src/runtime/scheduler.ts +298 -58
  24. package/src/testing/test/handler.ts +2 -8
  25. package/src/types.ts +42 -56
  26. package/dist/types/src/registry/function-registry.d.ts +0 -24
  27. package/dist/types/src/registry/function-registry.d.ts.map +0 -1
  28. package/dist/types/src/registry/function-registry.test.d.ts +0 -2
  29. package/dist/types/src/registry/function-registry.test.d.ts.map +0 -1
  30. package/dist/types/src/registry/index.d.ts +0 -2
  31. package/dist/types/src/registry/index.d.ts.map +0 -1
  32. package/dist/types/src/testing/functions-integration.test.d.ts +0 -2
  33. package/dist/types/src/testing/functions-integration.test.d.ts.map +0 -1
  34. package/dist/types/src/testing/index.d.ts +0 -4
  35. package/dist/types/src/testing/index.d.ts.map +0 -1
  36. package/dist/types/src/testing/setup.d.ts +0 -5
  37. package/dist/types/src/testing/setup.d.ts.map +0 -1
  38. package/dist/types/src/testing/types.d.ts +0 -9
  39. package/dist/types/src/testing/types.d.ts.map +0 -1
  40. package/dist/types/src/testing/util.d.ts +0 -3
  41. package/dist/types/src/testing/util.d.ts.map +0 -1
  42. package/dist/types/src/trigger/index.d.ts +0 -2
  43. package/dist/types/src/trigger/index.d.ts.map +0 -1
  44. package/dist/types/src/trigger/trigger-registry.d.ts +0 -40
  45. package/dist/types/src/trigger/trigger-registry.d.ts.map +0 -1
  46. package/dist/types/src/trigger/trigger-registry.test.d.ts +0 -2
  47. package/dist/types/src/trigger/trigger-registry.test.d.ts.map +0 -1
  48. package/dist/types/src/trigger/type/index.d.ts +0 -5
  49. package/dist/types/src/trigger/type/index.d.ts.map +0 -1
  50. package/dist/types/src/trigger/type/subscription-trigger.d.ts +0 -4
  51. package/dist/types/src/trigger/type/subscription-trigger.d.ts.map +0 -1
  52. package/dist/types/src/trigger/type/timer-trigger.d.ts +0 -4
  53. package/dist/types/src/trigger/type/timer-trigger.d.ts.map +0 -1
  54. package/dist/types/src/trigger/type/webhook-trigger.d.ts +0 -4
  55. package/dist/types/src/trigger/type/webhook-trigger.d.ts.map +0 -1
  56. package/dist/types/src/trigger/type/websocket-trigger.d.ts +0 -13
  57. package/dist/types/src/trigger/type/websocket-trigger.d.ts.map +0 -1
  58. package/src/registry/function-registry.test.ts +0 -105
  59. package/src/registry/function-registry.ts +0 -84
  60. package/src/registry/index.ts +0 -5
  61. package/src/testing/functions-integration.test.ts +0 -99
  62. package/src/testing/index.ts +0 -7
  63. package/src/testing/setup.ts +0 -45
  64. package/src/testing/types.ts +0 -9
  65. package/src/testing/util.ts +0 -16
  66. package/src/trigger/index.ts +0 -5
  67. package/src/trigger/trigger-registry.test.ts +0 -229
  68. package/src/trigger/trigger-registry.ts +0 -176
  69. package/src/trigger/type/index.ts +0 -8
  70. package/src/trigger/type/subscription-trigger.ts +0 -73
  71. package/src/trigger/type/timer-trigger.ts +0 -44
  72. package/src/trigger/type/webhook-trigger.ts +0 -47
  73. package/src/trigger/type/websocket-trigger.ts +0 -91
@@ -1,13 +1,21 @@
1
- import { S } from '@dxos/echo-schema';
2
- /**
3
- * Type discriminator for TriggerSpec.
4
- * Every spec has a type field of type FunctionTriggerType that we can use to understand which
5
- * type we're working with.
6
- * https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions
7
- */
8
- export type FunctionTriggerType = 'subscription' | 'timer' | 'webhook' | 'websocket';
1
+ import * as S from '@effect/schema/Schema';
2
+ declare const TimerTriggerSchema: S.struct<{
3
+ cron: S.$string;
4
+ }>;
5
+ declare const WebhookTriggerSchema: S.mutable<S.struct<{
6
+ method: S.$string;
7
+ port: S.PropertySignature<"?:", number | undefined, never, "?:", number | undefined, never>;
8
+ }>>;
9
+ declare const WebsocketTriggerSchema: S.struct<{
10
+ url: S.$string;
11
+ init: S.PropertySignature<"?:", {
12
+ readonly [x: string]: any;
13
+ } | undefined, never, "?:", {
14
+ readonly [x: string]: any;
15
+ } | undefined, never>;
16
+ }>;
9
17
  declare const SubscriptionTriggerSchema: S.struct<{
10
- type: S.literal<["subscription"]>;
18
+ spaceKey: S.PropertySignature<"?:", string | undefined, never, "?:", string | undefined, never>;
11
19
  filter: S.array<S.struct<{
12
20
  type: S.$string;
13
21
  props: S.PropertySignature<"?:", {
@@ -24,164 +32,150 @@ declare const SubscriptionTriggerSchema: S.struct<{
24
32
  readonly delay?: number | undefined;
25
33
  } | undefined, never>;
26
34
  }>;
27
- export type SubscriptionTrigger = S.Schema.Type<typeof SubscriptionTriggerSchema>;
28
- declare const TimerTriggerSchema: S.struct<{
29
- type: S.literal<["timer"]>;
30
- cron: S.$string;
31
- }>;
32
- export type TimerTrigger = S.Schema.Type<typeof TimerTriggerSchema>;
33
- declare const WebhookTriggerSchema: S.mutable<S.struct<{
34
- type: S.literal<["webhook"]>;
35
- method: S.$string;
36
- port: S.PropertySignature<"?:", number | undefined, never, "?:", number | undefined, never>;
37
- }>>;
38
- export type WebhookTrigger = S.Schema.Type<typeof WebhookTriggerSchema>;
39
- declare const WebsocketTriggerSchema: S.struct<{
40
- type: S.literal<["websocket"]>;
41
- url: S.$string;
42
- init: S.PropertySignature<"?:", {
35
+ declare const FunctionTriggerSchema: S.struct<{
36
+ function: S.$string;
37
+ meta: S.PropertySignature<"?:", {
43
38
  readonly [x: string]: any;
44
39
  } | undefined, never, "?:", {
45
40
  readonly [x: string]: any;
46
41
  } | undefined, never>;
47
- }>;
48
- export type WebsocketTrigger = S.Schema.Type<typeof WebsocketTriggerSchema>;
49
- export type TriggerSpec = TimerTrigger | WebhookTrigger | WebsocketTrigger | SubscriptionTrigger;
50
- declare const FunctionDef_base: import("@dxos/echo-schema").EchoSchemaClass<{
51
- handler: string;
52
- uri: string;
53
- description?: string | undefined;
54
- route: string;
55
- } & {
56
- id: string;
57
- }>;
58
- /**
59
- * Function definition.
60
- */
61
- export declare class FunctionDef extends FunctionDef_base {
62
- }
63
- declare const FunctionTrigger_base: import("@dxos/echo-schema").EchoSchemaClass<{
64
- function: string;
65
- meta?: {
66
- readonly [x: string]: any;
67
- } | undefined;
68
- spec: {
42
+ timer: S.PropertySignature<"?:", {
43
+ readonly cron: string;
44
+ } | undefined, never, "?:", {
45
+ readonly cron: string;
46
+ } | undefined, never>;
47
+ webhook: S.PropertySignature<"?:", {
48
+ port?: number | undefined;
49
+ method: string;
50
+ } | undefined, never, "?:", {
51
+ method: string;
52
+ port?: number | undefined;
53
+ } | undefined, never>;
54
+ websocket: S.PropertySignature<"?:", {
55
+ readonly url: string;
56
+ readonly init?: {
57
+ readonly [x: string]: any;
58
+ } | undefined;
59
+ } | undefined, never, "?:", {
60
+ readonly url: string;
61
+ readonly init?: {
62
+ readonly [x: string]: any;
63
+ } | undefined;
64
+ } | undefined, never>;
65
+ subscription: S.PropertySignature<"?:", {
69
66
  readonly filter: readonly {
70
67
  readonly type: string;
71
68
  readonly props?: {
72
69
  readonly [x: string]: any;
73
70
  } | undefined;
74
71
  }[];
75
- readonly type: "subscription";
72
+ readonly spaceKey?: string | undefined;
76
73
  readonly options?: {
77
74
  readonly deep?: boolean | undefined;
78
75
  readonly delay?: number | undefined;
79
76
  } | undefined;
80
- } | {
81
- readonly type: "timer";
82
- readonly cron: string;
83
- } | {
84
- port?: number | undefined;
85
- type: "webhook";
86
- method: string;
87
- } | {
88
- readonly type: "websocket";
89
- readonly url: string;
90
- readonly init?: {
91
- readonly [x: string]: any;
77
+ } | undefined, never, "?:", {
78
+ readonly filter: readonly {
79
+ readonly type: string;
80
+ readonly props?: {
81
+ readonly [x: string]: any;
82
+ } | undefined;
83
+ }[];
84
+ readonly spaceKey?: string | undefined;
85
+ readonly options?: {
86
+ readonly deep?: boolean | undefined;
87
+ readonly delay?: number | undefined;
92
88
  } | undefined;
93
- };
94
- } & {
95
- id: string;
89
+ } | undefined, never>;
90
+ }>;
91
+ export type FunctionTrigger = S.Schema.Type<typeof FunctionTriggerSchema>;
92
+ export type TimerTrigger = S.Schema.Type<typeof TimerTriggerSchema>;
93
+ export type WebhookTrigger = S.Schema.Type<typeof WebhookTriggerSchema>;
94
+ export type WebsocketTrigger = S.Schema.Type<typeof WebsocketTriggerSchema>;
95
+ export type SubscriptionTrigger = S.Schema.Type<typeof SubscriptionTriggerSchema>;
96
+ /**
97
+ * Function definition.
98
+ */
99
+ declare const FunctionDefSchema: S.struct<{
100
+ id: S.$string;
101
+ description: S.PropertySignature<"?:", string | undefined, never, "?:", string | undefined, never>;
102
+ path: S.$string;
103
+ handler: S.$string;
96
104
  }>;
97
- export declare class FunctionTrigger extends FunctionTrigger_base {
98
- }
105
+ export type FunctionDef = S.Schema.Type<typeof FunctionDefSchema>;
99
106
  /**
100
107
  * Function manifest file.
101
108
  */
102
109
  export declare const FunctionManifestSchema: S.struct<{
103
- functions: S.PropertySignature<"?:", Omit<{
104
- handler: string;
105
- uri: string;
106
- description?: string | undefined;
107
- route: string;
108
- } & {
109
- id: string;
110
- }, "id">[] | undefined, never, "?:", Omit<{
111
- handler: string;
112
- uri: string;
113
- description?: string | undefined;
114
- route: string;
115
- } & {
116
- id: string;
117
- }, "id">[] | undefined, never>;
118
- triggers: S.PropertySignature<"?:", Omit<{
119
- function: string;
120
- meta?: {
110
+ functions: S.mutable<S.array<S.struct<{
111
+ id: S.$string;
112
+ description: S.PropertySignature<"?:", string | undefined, never, "?:", string | undefined, never>;
113
+ path: S.$string;
114
+ handler: S.$string;
115
+ }>>>;
116
+ triggers: S.PropertySignature<"?:", {
117
+ readonly function: string;
118
+ readonly meta?: {
121
119
  readonly [x: string]: any;
122
120
  } | undefined;
123
- spec: {
121
+ readonly timer?: {
122
+ readonly cron: string;
123
+ } | undefined;
124
+ readonly webhook?: {
125
+ port?: number | undefined;
126
+ method: string;
127
+ } | undefined;
128
+ readonly websocket?: {
129
+ readonly url: string;
130
+ readonly init?: {
131
+ readonly [x: string]: any;
132
+ } | undefined;
133
+ } | undefined;
134
+ readonly subscription?: {
124
135
  readonly filter: readonly {
125
136
  readonly type: string;
126
137
  readonly props?: {
127
138
  readonly [x: string]: any;
128
139
  } | undefined;
129
140
  }[];
130
- readonly type: "subscription";
141
+ readonly spaceKey?: string | undefined;
131
142
  readonly options?: {
132
143
  readonly deep?: boolean | undefined;
133
144
  readonly delay?: number | undefined;
134
145
  } | undefined;
135
- } | {
136
- readonly type: "timer";
146
+ } | undefined;
147
+ }[] | undefined, never, "?:", {
148
+ readonly function: string;
149
+ readonly meta?: {
150
+ readonly [x: string]: any;
151
+ } | undefined;
152
+ readonly timer?: {
137
153
  readonly cron: string;
138
- } | {
139
- port?: number | undefined;
140
- type: "webhook";
154
+ } | undefined;
155
+ readonly webhook?: {
141
156
  method: string;
142
- } | {
143
- readonly type: "websocket";
157
+ port?: number | undefined;
158
+ } | undefined;
159
+ readonly websocket?: {
144
160
  readonly url: string;
145
161
  readonly init?: {
146
162
  readonly [x: string]: any;
147
163
  } | undefined;
148
- };
149
- } & {
150
- id: string;
151
- }, "id">[] | undefined, never, "?:", Omit<{
152
- function: string;
153
- meta?: {
154
- readonly [x: string]: any;
155
164
  } | undefined;
156
- spec: {
165
+ readonly subscription?: {
157
166
  readonly filter: readonly {
158
167
  readonly type: string;
159
168
  readonly props?: {
160
169
  readonly [x: string]: any;
161
170
  } | undefined;
162
171
  }[];
163
- readonly type: "subscription";
172
+ readonly spaceKey?: string | undefined;
164
173
  readonly options?: {
165
174
  readonly deep?: boolean | undefined;
166
175
  readonly delay?: number | undefined;
167
176
  } | undefined;
168
- } | {
169
- readonly type: "timer";
170
- readonly cron: string;
171
- } | {
172
- port?: number | undefined;
173
- type: "webhook";
174
- method: string;
175
- } | {
176
- readonly type: "websocket";
177
- readonly url: string;
178
- readonly init?: {
179
- readonly [x: string]: any;
180
- } | undefined;
181
- };
182
- } & {
183
- id: string;
184
- }, "id">[] | undefined, never>;
177
+ } | undefined;
178
+ }[] | undefined, never>;
185
179
  }>;
186
180
  export type FunctionManifest = S.Schema.Type<typeof FunctionManifestSchema>;
187
181
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAO,CAAC,EAAe,MAAM,mBAAmB,CAAC;AAKxD;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAAG,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;AAErF,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;EAiB7B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAElF,QAAA,MAAM,kBAAkB;;;EAGtB,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,QAAA,MAAM,oBAAoB;;;;GAOzB,CAAC;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,QAAA,MAAM,sBAAsB;;;;;;;;EAI1B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAQ5E,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,cAAc,GAAG,gBAAgB,GAAG,mBAAmB,CAAC;;;;;;;;;AAEjG;;GAEG;AACH,qBAAa,WAAY,SAAQ,gBAS/B;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEL,qBAAa,eAAgB,SAAQ,oBAQnC;CAAG;AAEL;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,uBAAuB,CAAC;AAE3C,QAAA,MAAM,kBAAkB;;EAEtB,CAAC;AAEH,QAAA,MAAM,oBAAoB;;;GAMzB,CAAC;AAEF,QAAA,MAAM,sBAAsB;;;;;;;EAG1B,CAAC;AAEH,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;EAiB7B,CAAC;AAEH,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWzB,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACpE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACxE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAC5E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAElF;;GAEG;AAEH,QAAA,MAAM,iBAAiB;;;;;EAQrB,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/functions",
3
- "version": "0.5.3-main.61bbff4",
3
+ "version": "0.5.3-main.64035f0",
4
4
  "description": "Functions SDK and runtime.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -20,35 +20,32 @@
20
20
  "src"
21
21
  ],
22
22
  "dependencies": {
23
+ "@effect/schema": "^0.64.20",
23
24
  "@preact/signals-core": "^1.6.0",
24
25
  "cron": "^3.1.6",
25
26
  "effect": "^2.4.19",
26
27
  "express": "^4.19.2",
27
28
  "get-port-please": "^3.1.1",
28
29
  "ws": "^8.14.2",
29
- "@braneframe/types": "0.5.3-main.61bbff4",
30
- "@dxos/async": "0.5.3-main.61bbff4",
31
- "@dxos/client": "0.5.3-main.61bbff4",
32
- "@dxos/context": "0.5.3-main.61bbff4",
33
- "@dxos/echo-db": "0.5.3-main.61bbff4",
34
- "@dxos/invariant": "0.5.3-main.61bbff4",
35
- "@dxos/echo-schema": "0.5.3-main.61bbff4",
36
- "@dxos/keys": "0.5.3-main.61bbff4",
37
- "@dxos/log": "0.5.3-main.61bbff4",
38
- "@dxos/protocols": "0.5.3-main.61bbff4",
39
- "@dxos/node-std": "0.5.3-main.61bbff4",
40
- "@dxos/util": "0.5.3-main.61bbff4"
30
+ "@braneframe/types": "0.5.3-main.64035f0",
31
+ "@dxos/async": "0.5.3-main.64035f0",
32
+ "@dxos/client": "0.5.3-main.64035f0",
33
+ "@dxos/context": "0.5.3-main.64035f0",
34
+ "@dxos/invariant": "0.5.3-main.64035f0",
35
+ "@dxos/log": "0.5.3-main.64035f0",
36
+ "@dxos/echo-schema": "0.5.3-main.64035f0",
37
+ "@dxos/util": "0.5.3-main.64035f0",
38
+ "@dxos/node-std": "0.5.3-main.64035f0"
41
39
  },
42
40
  "devDependencies": {
43
41
  "@types/express": "^4.17.17",
44
42
  "@types/ws": "^7.4.0",
45
- "@dxos/agent": "0.5.3-main.61bbff4"
43
+ "@dxos/agent": "0.5.3-main.64035f0"
46
44
  },
47
45
  "publishConfig": {
48
46
  "access": "public"
49
47
  },
50
48
  "scripts": {
51
- "gen-schema": "ts-node ./tools/schema.ts",
52
- "prebuild": "pnpm gen-schema"
49
+ "gen-schema": "ts-node ./tools/schema.ts"
53
50
  }
54
51
  }
@@ -1,24 +1,26 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "type": "object",
4
- "required": [],
4
+ "required": [
5
+ "functions"
6
+ ],
5
7
  "properties": {
6
8
  "functions": {
7
9
  "type": "array",
8
10
  "items": {
9
11
  "type": "object",
10
12
  "required": [
11
- "uri",
12
- "route",
13
+ "id",
14
+ "path",
13
15
  "handler"
14
16
  ],
15
17
  "properties": {
16
- "uri": {
18
+ "id": {
17
19
  "type": "string",
18
20
  "description": "a string",
19
21
  "title": "string"
20
22
  },
21
- "route": {
23
+ "path": {
22
24
  "type": "string",
23
25
  "description": "a string",
24
26
  "title": "string"
@@ -42,8 +44,7 @@
42
44
  "items": {
43
45
  "type": "object",
44
46
  "required": [
45
- "function",
46
- "spec"
47
+ "function"
47
48
  ],
48
49
  "properties": {
49
50
  "function": {
@@ -60,133 +61,118 @@
60
61
  "title": "any"
61
62
  }
62
63
  },
63
- "spec": {
64
- "anyOf": [
65
- {
64
+ "timer": {
65
+ "type": "object",
66
+ "required": [
67
+ "cron"
68
+ ],
69
+ "properties": {
70
+ "cron": {
71
+ "type": "string",
72
+ "description": "a string",
73
+ "title": "string"
74
+ }
75
+ },
76
+ "additionalProperties": false
77
+ },
78
+ "webhook": {
79
+ "type": "object",
80
+ "required": [
81
+ "method"
82
+ ],
83
+ "properties": {
84
+ "method": {
85
+ "type": "string",
86
+ "description": "a string",
87
+ "title": "string"
88
+ },
89
+ "port": {
90
+ "type": "number",
91
+ "description": "a number",
92
+ "title": "number"
93
+ }
94
+ },
95
+ "additionalProperties": false
96
+ },
97
+ "websocket": {
98
+ "type": "object",
99
+ "required": [
100
+ "url"
101
+ ],
102
+ "properties": {
103
+ "url": {
104
+ "type": "string",
105
+ "description": "a string",
106
+ "title": "string"
107
+ },
108
+ "init": {
66
109
  "type": "object",
67
- "required": [
68
- "type",
69
- "cron"
70
- ],
71
- "properties": {
72
- "type": {
73
- "const": "timer"
110
+ "required": [],
111
+ "properties": {},
112
+ "additionalProperties": {
113
+ "$id": "/schemas/any",
114
+ "title": "any"
115
+ }
116
+ }
117
+ },
118
+ "additionalProperties": false
119
+ },
120
+ "subscription": {
121
+ "type": "object",
122
+ "required": [
123
+ "filter"
124
+ ],
125
+ "properties": {
126
+ "spaceKey": {
127
+ "type": "string",
128
+ "description": "a string",
129
+ "title": "string"
130
+ },
131
+ "filter": {
132
+ "type": "array",
133
+ "items": {
134
+ "type": "object",
135
+ "required": [
136
+ "type"
137
+ ],
138
+ "properties": {
139
+ "type": {
140
+ "type": "string",
141
+ "description": "a string",
142
+ "title": "string"
143
+ },
144
+ "props": {
145
+ "type": "object",
146
+ "required": [],
147
+ "properties": {},
148
+ "additionalProperties": {
149
+ "$id": "/schemas/any",
150
+ "title": "any"
151
+ }
152
+ }
74
153
  },
75
- "cron": {
76
- "type": "string",
77
- "description": "a string",
78
- "title": "string"
79
- }
80
- },
81
- "additionalProperties": false
154
+ "additionalProperties": false
155
+ }
82
156
  },
83
- {
157
+ "options": {
84
158
  "type": "object",
85
- "required": [
86
- "type",
87
- "method"
88
- ],
159
+ "required": [],
89
160
  "properties": {
90
- "type": {
91
- "const": "webhook"
92
- },
93
- "method": {
94
- "type": "string",
95
- "description": "a string",
96
- "title": "string"
161
+ "deep": {
162
+ "type": "boolean",
163
+ "description": "a boolean",
164
+ "title": "boolean"
97
165
  },
98
- "port": {
166
+ "delay": {
99
167
  "type": "number",
100
168
  "description": "a number",
101
169
  "title": "number"
102
170
  }
103
171
  },
104
172
  "additionalProperties": false
105
- },
106
- {
107
- "type": "object",
108
- "required": [
109
- "type",
110
- "url"
111
- ],
112
- "properties": {
113
- "type": {
114
- "const": "websocket"
115
- },
116
- "url": {
117
- "type": "string",
118
- "description": "a string",
119
- "title": "string"
120
- },
121
- "init": {
122
- "type": "object",
123
- "required": [],
124
- "properties": {},
125
- "additionalProperties": {
126
- "$id": "/schemas/any",
127
- "title": "any"
128
- }
129
- }
130
- },
131
- "additionalProperties": false
132
- },
133
- {
134
- "type": "object",
135
- "required": [
136
- "type",
137
- "filter"
138
- ],
139
- "properties": {
140
- "type": {
141
- "const": "subscription"
142
- },
143
- "filter": {
144
- "type": "array",
145
- "items": {
146
- "type": "object",
147
- "required": [
148
- "type"
149
- ],
150
- "properties": {
151
- "type": {
152
- "type": "string",
153
- "description": "a string",
154
- "title": "string"
155
- },
156
- "props": {
157
- "type": "object",
158
- "required": [],
159
- "properties": {},
160
- "additionalProperties": {
161
- "$id": "/schemas/any",
162
- "title": "any"
163
- }
164
- }
165
- },
166
- "additionalProperties": false
167
- }
168
- },
169
- "options": {
170
- "type": "object",
171
- "required": [],
172
- "properties": {
173
- "deep": {
174
- "type": "boolean",
175
- "description": "a boolean",
176
- "title": "boolean"
177
- },
178
- "delay": {
179
- "type": "number",
180
- "description": "a number",
181
- "title": "number"
182
- }
183
- },
184
- "additionalProperties": false
185
- }
186
- },
187
- "additionalProperties": false
188
173
  }
189
- ]
174
+ },
175
+ "additionalProperties": false
190
176
  }
191
177
  },
192
178
  "additionalProperties": false
package/src/index.ts CHANGED
@@ -3,7 +3,5 @@
3
3
  //
4
4
 
5
5
  export * from './handler';
6
- export * from './registry';
7
6
  export * from './runtime';
8
- export * from './trigger';
9
7
  export * from './types';