@dxos/functions 0.6.5 → 0.6.6-staging.23d123d
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.
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { S } from '@dxos/echo-schema';
|
|
1
2
|
declare const TestType_base: import("@dxos/echo-schema").AbstractTypedObject<{
|
|
2
3
|
title: string;
|
|
3
4
|
} & {
|
|
4
5
|
id: string;
|
|
5
|
-
}
|
|
6
|
+
}, S.Struct.Encoded<{
|
|
7
|
+
title: typeof S.String;
|
|
8
|
+
}>>;
|
|
6
9
|
export declare class TestType extends TestType_base {
|
|
7
10
|
}
|
|
8
11
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/testing/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/testing/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAe,MAAM,mBAAmB,CAAC;;;;;;;;AAEnD,qBAAa,QAAS,SAAQ,aAE5B;CAAG"}
|
|
@@ -43,7 +43,12 @@ declare const FunctionDef_base: import("@dxos/echo-schema").AbstractTypedObject<
|
|
|
43
43
|
route: string;
|
|
44
44
|
} & {
|
|
45
45
|
id: string;
|
|
46
|
-
}
|
|
46
|
+
}, S.Struct.Encoded<{
|
|
47
|
+
uri: typeof S.String;
|
|
48
|
+
description: S.optional<typeof S.String>;
|
|
49
|
+
route: typeof S.String;
|
|
50
|
+
handler: typeof S.String;
|
|
51
|
+
}>>;
|
|
47
52
|
/**
|
|
48
53
|
* Function definition.
|
|
49
54
|
*/
|
|
@@ -83,7 +88,33 @@ declare const FunctionTrigger_base: import("@dxos/echo-schema").AbstractTypedObj
|
|
|
83
88
|
};
|
|
84
89
|
} & {
|
|
85
90
|
id: string;
|
|
86
|
-
}
|
|
91
|
+
}, S.Struct.Encoded<{
|
|
92
|
+
enabled: S.optional<typeof S.Boolean>;
|
|
93
|
+
function: typeof S.String;
|
|
94
|
+
meta: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
|
|
95
|
+
spec: S.Union<[S.mutable<S.Struct<{
|
|
96
|
+
type: S.Literal<["timer"]>;
|
|
97
|
+
cron: typeof S.String;
|
|
98
|
+
}>>, S.mutable<S.Struct<{
|
|
99
|
+
type: S.Literal<["webhook"]>;
|
|
100
|
+
method: typeof S.String;
|
|
101
|
+
port: S.optional<typeof S.Number>;
|
|
102
|
+
}>>, S.mutable<S.Struct<{
|
|
103
|
+
type: S.Literal<["websocket"]>;
|
|
104
|
+
url: typeof S.String;
|
|
105
|
+
init: S.optional<S.Record$<typeof S.String, typeof S.Any>>;
|
|
106
|
+
}>>, S.mutable<S.Struct<{
|
|
107
|
+
type: S.Literal<["subscription"]>;
|
|
108
|
+
filter: S.Array$<S.Struct<{
|
|
109
|
+
type: typeof S.String;
|
|
110
|
+
props: S.optional<S.Record$<typeof S.String, typeof S.Any>>;
|
|
111
|
+
}>>;
|
|
112
|
+
options: S.optional<S.Struct<{
|
|
113
|
+
deep: S.optional<typeof S.Boolean>;
|
|
114
|
+
delay: S.optional<typeof S.Number>;
|
|
115
|
+
}>>;
|
|
116
|
+
}>>]>;
|
|
117
|
+
}>>;
|
|
87
118
|
/**
|
|
88
119
|
* Function trigger.
|
|
89
120
|
*/
|
|
@@ -105,19 +136,12 @@ export declare const FunctionManifestSchema: S.Struct<{
|
|
|
105
136
|
readonly source: string;
|
|
106
137
|
}[];
|
|
107
138
|
} | undefined;
|
|
108
|
-
}, {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
"@meta"?: {
|
|
115
|
-
readonly keys: {
|
|
116
|
-
readonly id: string;
|
|
117
|
-
readonly source: string;
|
|
118
|
-
}[];
|
|
119
|
-
} | undefined;
|
|
120
|
-
}, never>>>>;
|
|
139
|
+
}, S.Struct.Encoded<{
|
|
140
|
+
uri: typeof S.String;
|
|
141
|
+
description: S.optional<typeof S.String>;
|
|
142
|
+
route: typeof S.String;
|
|
143
|
+
handler: typeof S.String;
|
|
144
|
+
}>, never>>>>;
|
|
121
145
|
triggers: S.optional<S.mutable<S.Array$<S.Schema<{
|
|
122
146
|
function: string;
|
|
123
147
|
enabled?: boolean | undefined;
|
|
@@ -157,46 +181,33 @@ export declare const FunctionManifestSchema: S.Struct<{
|
|
|
157
181
|
readonly source: string;
|
|
158
182
|
}[];
|
|
159
183
|
} | undefined;
|
|
160
|
-
}, {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
meta
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
url: string;
|
|
188
|
-
init?: {
|
|
189
|
-
readonly [x: string]: any;
|
|
190
|
-
} | undefined;
|
|
191
|
-
};
|
|
192
|
-
} & {
|
|
193
|
-
"@meta"?: {
|
|
194
|
-
readonly keys: {
|
|
195
|
-
readonly id: string;
|
|
196
|
-
readonly source: string;
|
|
197
|
-
}[];
|
|
198
|
-
} | undefined;
|
|
199
|
-
}, never>>>>;
|
|
184
|
+
}, S.Struct.Encoded<{
|
|
185
|
+
enabled: S.optional<typeof S.Boolean>;
|
|
186
|
+
function: typeof S.String;
|
|
187
|
+
meta: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.Any>>>;
|
|
188
|
+
spec: S.Union<[S.mutable<S.Struct<{
|
|
189
|
+
type: S.Literal<["timer"]>;
|
|
190
|
+
cron: typeof S.String;
|
|
191
|
+
}>>, S.mutable<S.Struct<{
|
|
192
|
+
type: S.Literal<["webhook"]>;
|
|
193
|
+
method: typeof S.String;
|
|
194
|
+
port: S.optional<typeof S.Number>;
|
|
195
|
+
}>>, S.mutable<S.Struct<{
|
|
196
|
+
type: S.Literal<["websocket"]>;
|
|
197
|
+
url: typeof S.String;
|
|
198
|
+
init: S.optional<S.Record$<typeof S.String, typeof S.Any>>;
|
|
199
|
+
}>>, S.mutable<S.Struct<{
|
|
200
|
+
type: S.Literal<["subscription"]>;
|
|
201
|
+
filter: S.Array$<S.Struct<{
|
|
202
|
+
type: typeof S.String;
|
|
203
|
+
props: S.optional<S.Record$<typeof S.String, typeof S.Any>>;
|
|
204
|
+
}>>;
|
|
205
|
+
options: S.optional<S.Struct<{
|
|
206
|
+
deep: S.optional<typeof S.Boolean>;
|
|
207
|
+
delay: S.optional<typeof S.Number>;
|
|
208
|
+
}>>;
|
|
209
|
+
}>>]>;
|
|
210
|
+
}>, never>>>>;
|
|
200
211
|
}>;
|
|
201
212
|
export type FunctionManifest = S.Schema.Type<typeof FunctionManifestSchema>;
|
|
202
213
|
export declare const FUNCTION_SCHEMA: (typeof FunctionDef | typeof FunctionTrigger)[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAa,CAAC,EAAe,MAAM,mBAAmB,CAAC;AAE9D;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAAG,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;AAErF,QAAA,MAAM,yBAAyB;;;;;;;;;;GAmB9B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAElF,QAAA,MAAM,kBAAkB;;;GAKvB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,kBAAkB,CAAC,CAA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;;;;;;;;AAEjG;;GAEG;AACH,qBAAa,WAAY,SAAQ,gBAQ/B;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEL;;GAEG;AACH,qBAAa,eAAgB,SAAQ,oBASnC;CAAG;AAEL;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAG5E,eAAO,MAAM,eAAe,iDAAiC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/functions",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.6-staging.23d123d",
|
|
4
4
|
"description": "Functions API and runtime.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -52,24 +52,24 @@
|
|
|
52
52
|
"express": "^4.19.2",
|
|
53
53
|
"get-port-please": "^3.1.1",
|
|
54
54
|
"ws": "^8.14.2",
|
|
55
|
-
"@braneframe/types": "0.6.
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/echo-
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
55
|
+
"@braneframe/types": "0.6.6-staging.23d123d",
|
|
56
|
+
"@dxos/context": "0.6.6-staging.23d123d",
|
|
57
|
+
"@dxos/client": "0.6.6-staging.23d123d",
|
|
58
|
+
"@dxos/async": "0.6.6-staging.23d123d",
|
|
59
|
+
"@dxos/echo-protocol": "0.6.6-staging.23d123d",
|
|
60
|
+
"@dxos/echo-db": "0.6.6-staging.23d123d",
|
|
61
|
+
"@dxos/invariant": "0.6.6-staging.23d123d",
|
|
62
|
+
"@dxos/echo-schema": "0.6.6-staging.23d123d",
|
|
63
|
+
"@dxos/keys": "0.6.6-staging.23d123d",
|
|
64
|
+
"@dxos/log": "0.6.6-staging.23d123d",
|
|
65
|
+
"@dxos/node-std": "0.6.6-staging.23d123d",
|
|
66
|
+
"@dxos/protocols": "0.6.6-staging.23d123d",
|
|
67
|
+
"@dxos/util": "0.6.6-staging.23d123d"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@types/express": "^4.17.17",
|
|
71
71
|
"@types/ws": "^7.4.0",
|
|
72
|
-
"@dxos/agent": "0.6.
|
|
72
|
+
"@dxos/agent": "0.6.6-staging.23d123d"
|
|
73
73
|
},
|
|
74
74
|
"publishConfig": {
|
|
75
75
|
"access": "public"
|
|
@@ -159,10 +159,11 @@ describe('trigger registry', () => {
|
|
|
159
159
|
});
|
|
160
160
|
|
|
161
161
|
space.db.add(create(TestType, { title: '1' }));
|
|
162
|
-
await sleep(
|
|
162
|
+
await sleep(110);
|
|
163
163
|
expect(count).to.eq(1);
|
|
164
164
|
|
|
165
165
|
space.db.remove(echoTrigger);
|
|
166
|
+
await sleep(110);
|
|
166
167
|
space.db.add(create(TestType, { title: '2' }));
|
|
167
168
|
await sleep(20);
|
|
168
169
|
expect(count).to.eq(1);
|