@dxos/functions 0.8.1-main.a06ad20 → 0.8.1-main.ba2dec9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{chunk-TMUL6AZC.mjs → chunk-M7ZGVWUZ.mjs} +27 -25
- package/dist/lib/browser/chunk-M7ZGVWUZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-XK3NINVF.mjs → chunk-RTBBW6RI.mjs} +38 -2
- package/dist/lib/{node-esm/chunk-QRMVAODA.mjs.map → browser/chunk-RTBBW6RI.mjs.map} +4 -4
- package/dist/lib/browser/{chunk-YJEIETRB.mjs → chunk-UMJKVIP4.mjs} +4 -38
- package/dist/lib/browser/chunk-UMJKVIP4.mjs.map +7 -0
- package/dist/lib/browser/edge/index.mjs +1 -9
- package/dist/lib/browser/index.mjs +8 -8
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +2 -2
- package/dist/lib/browser/types/index.mjs +11 -3
- package/dist/lib/node/{chunk-BGDVH6JU.cjs → chunk-AOKUMNKK.cjs} +40 -38
- package/dist/lib/node/chunk-AOKUMNKK.cjs.map +7 -0
- package/dist/lib/node/{chunk-3J6FVYUV.cjs → chunk-GX3ZLNHY.cjs} +44 -6
- package/dist/lib/node/{chunk-3J6FVYUV.cjs.map → chunk-GX3ZLNHY.cjs.map} +4 -4
- package/dist/lib/node/{chunk-MZMHE4DC.cjs → chunk-UHTKCFWT.cjs} +7 -45
- package/dist/lib/node/chunk-UHTKCFWT.cjs.map +7 -0
- package/dist/lib/node/edge/index.cjs +4 -12
- package/dist/lib/node/edge/index.cjs.map +2 -2
- package/dist/lib/node/index.cjs +28 -28
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +7 -7
- package/dist/lib/node/types/index.cjs +24 -16
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/{chunk-V3VOPFP3.mjs → chunk-BYS52HOC.mjs} +27 -25
- package/dist/lib/node-esm/chunk-BYS52HOC.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-T2KBXTMR.mjs → chunk-JDOIALGL.mjs} +4 -38
- package/dist/lib/node-esm/chunk-JDOIALGL.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-QRMVAODA.mjs → chunk-NALEEAQL.mjs} +38 -2
- package/dist/lib/{browser/chunk-XK3NINVF.mjs.map → node-esm/chunk-NALEEAQL.mjs.map} +4 -4
- package/dist/lib/node-esm/edge/index.mjs +1 -9
- package/dist/lib/node-esm/index.mjs +8 -8
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +2 -2
- package/dist/lib/node-esm/types/index.mjs +11 -3
- package/dist/types/src/edge/functions.d.ts +0 -9
- package/dist/types/src/edge/functions.d.ts.map +1 -1
- package/dist/types/src/trigger/type/timer-trigger.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +1 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/url.d.ts +11 -0
- package/dist/types/src/types/url.d.ts.map +1 -0
- package/package.json +19 -18
- package/src/edge/functions.ts +0 -42
- package/src/trigger/type/timer-trigger.ts +21 -18
- package/src/types/index.ts +1 -0
- package/src/types/url.ts +47 -0
- package/dist/lib/browser/chunk-TMUL6AZC.mjs.map +0 -7
- package/dist/lib/browser/chunk-YJEIETRB.mjs.map +0 -7
- package/dist/lib/node/chunk-BGDVH6JU.cjs.map +0 -7
- package/dist/lib/node/chunk-MZMHE4DC.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-T2KBXTMR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-V3VOPFP3.mjs.map +0 -7
|
@@ -16,28 +16,22 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
21
|
-
FUNCTIONS_PRESET_META_KEY: () => FUNCTIONS_PRESET_META_KEY,
|
|
22
|
-
getInvocationUrl: () => getInvocationUrl,
|
|
23
|
-
getUserFunctionUrlInMetadata: () => getUserFunctionUrlInMetadata,
|
|
19
|
+
var chunk_UHTKCFWT_exports = {};
|
|
20
|
+
__export(chunk_UHTKCFWT_exports, {
|
|
24
21
|
incrementSemverPatch: () => incrementSemverPatch,
|
|
25
22
|
publicKeyToDid: () => publicKeyToDid,
|
|
26
|
-
setUserFunctionUrlInMetadata: () => setUserFunctionUrlInMetadata,
|
|
27
23
|
uploadWorkerFunction: () => uploadWorkerFunction
|
|
28
24
|
});
|
|
29
|
-
module.exports = __toCommonJS(
|
|
25
|
+
module.exports = __toCommonJS(chunk_UHTKCFWT_exports);
|
|
30
26
|
var import_edge_client = require("@dxos/edge-client");
|
|
31
27
|
var import_invariant = require("@dxos/invariant");
|
|
32
28
|
var import_log = require("@dxos/log");
|
|
33
29
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/functions/src/edge/functions.ts";
|
|
34
|
-
var FUNCTIONS_META_KEY = "dxos.org/service/function";
|
|
35
|
-
var FUNCTIONS_PRESET_META_KEY = "dxos.org/service/function-preset";
|
|
36
30
|
var uploadWorkerFunction = async ({ client, name, version, source, spaceId, functionId }) => {
|
|
37
31
|
const edgeUrl = client.config.values.runtime?.services?.edge?.url;
|
|
38
32
|
(0, import_invariant.invariant)(edgeUrl, "Edge is not configured.", {
|
|
39
33
|
F: __dxlog_file,
|
|
40
|
-
L:
|
|
34
|
+
L: 32,
|
|
41
35
|
S: void 0,
|
|
42
36
|
A: [
|
|
43
37
|
"edgeUrl",
|
|
@@ -63,40 +57,12 @@ var uploadWorkerFunction = async ({ client, name, version, source, spaceId, func
|
|
|
63
57
|
response
|
|
64
58
|
}, {
|
|
65
59
|
F: __dxlog_file,
|
|
66
|
-
L:
|
|
60
|
+
L: 38,
|
|
67
61
|
S: void 0,
|
|
68
62
|
C: (f, a) => f(...a)
|
|
69
63
|
});
|
|
70
64
|
return response;
|
|
71
65
|
};
|
|
72
|
-
var getUserFunctionUrlInMetadata = (meta) => {
|
|
73
|
-
return meta.keys.find((key) => key.source === FUNCTIONS_META_KEY)?.id;
|
|
74
|
-
};
|
|
75
|
-
var setUserFunctionUrlInMetadata = (meta, functionUrl) => {
|
|
76
|
-
const key = meta.keys.find((key2) => key2.source === FUNCTIONS_META_KEY);
|
|
77
|
-
if (key) {
|
|
78
|
-
if (key.id !== functionUrl) {
|
|
79
|
-
throw new Error("Metadata mismatch");
|
|
80
|
-
}
|
|
81
|
-
} else {
|
|
82
|
-
meta.keys.push({
|
|
83
|
-
source: FUNCTIONS_META_KEY,
|
|
84
|
-
id: functionUrl
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
var getInvocationUrl = (functionUrl, edgeUrl, options = {}) => {
|
|
89
|
-
const baseUrl = new URL("functions/", edgeUrl);
|
|
90
|
-
const relativeUrl = functionUrl.replace(/^\//, "");
|
|
91
|
-
const url = new URL(`./${relativeUrl}`, baseUrl.toString());
|
|
92
|
-
options.spaceId && url.searchParams.set("spaceId", options.spaceId);
|
|
93
|
-
options.subjectId && url.searchParams.set("subjectId", options.subjectId);
|
|
94
|
-
url.protocol = isSecure(url.protocol) ? "https" : "http";
|
|
95
|
-
return url.toString();
|
|
96
|
-
};
|
|
97
|
-
var isSecure = (protocol) => {
|
|
98
|
-
return protocol === "https:" || protocol === "wss:";
|
|
99
|
-
};
|
|
100
66
|
var createEdgeIdentity = (client) => {
|
|
101
67
|
const identity = client.halo.identity.get();
|
|
102
68
|
const device = client.halo.device;
|
|
@@ -125,7 +91,7 @@ var incrementSemverPatch = (version) => {
|
|
|
125
91
|
const patchNum = Number(patch);
|
|
126
92
|
(0, import_invariant.invariant)(!Number.isNaN(patchNum), "Unexpected function version format.", {
|
|
127
93
|
F: __dxlog_file,
|
|
128
|
-
L:
|
|
94
|
+
L: 72,
|
|
129
95
|
S: void 0,
|
|
130
96
|
A: [
|
|
131
97
|
"!Number.isNaN(patchNum)",
|
|
@@ -143,12 +109,8 @@ var publicKeyToDid = (key) => {
|
|
|
143
109
|
};
|
|
144
110
|
// Annotate the CommonJS export names for ESM import in node:
|
|
145
111
|
0 && (module.exports = {
|
|
146
|
-
FUNCTIONS_PRESET_META_KEY,
|
|
147
|
-
getInvocationUrl,
|
|
148
|
-
getUserFunctionUrlInMetadata,
|
|
149
112
|
incrementSemverPatch,
|
|
150
113
|
publicKeyToDid,
|
|
151
|
-
setUserFunctionUrlInMetadata,
|
|
152
114
|
uploadWorkerFunction
|
|
153
115
|
});
|
|
154
|
-
//# sourceMappingURL=chunk-
|
|
116
|
+
//# sourceMappingURL=chunk-UHTKCFWT.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/edge/functions.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type DID } from 'iso-did/types';\n\nimport { type Client } from '@dxos/client';\nimport { EdgeHttpClient, type EdgeIdentity } from '@dxos/edge-client';\nimport { invariant } from '@dxos/invariant';\nimport type { PublicKey, SpaceId } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { type UploadFunctionResponseBody } from '@dxos/protocols';\n\nexport type UploadWorkerArgs = {\n client: Client;\n name?: string;\n source: string;\n version: string;\n functionId?: string;\n spaceId: SpaceId;\n};\n\nexport const uploadWorkerFunction = async ({\n client,\n name,\n version,\n source,\n spaceId,\n functionId,\n}: UploadWorkerArgs): Promise<UploadFunctionResponseBody> => {\n const edgeUrl = client.config.values.runtime?.services?.edge?.url;\n invariant(edgeUrl, 'Edge is not configured.');\n const edgeClient = new EdgeHttpClient(edgeUrl);\n const edgeIdentity = createEdgeIdentity(client);\n edgeClient.setIdentity(edgeIdentity);\n const response = await edgeClient.uploadFunction({ spaceId, functionId }, { name, version, script: source });\n\n log('Uploaded', {\n functionId,\n source,\n name,\n identityKey: edgeIdentity.identityKey,\n response,\n });\n\n return response;\n};\n\nconst createEdgeIdentity = (client: Client): EdgeIdentity => {\n const identity = client.halo.identity.get();\n const device = client.halo.device;\n if (!identity || !device) {\n throw new Error('Identity not available');\n }\n return {\n identityKey: identity.identityKey.toHex(),\n peerKey: device.deviceKey.toHex(),\n presentCredentials: async ({ challenge }) => {\n const identityService = client.services.services.IdentityService!;\n const authCredential = await identityService.createAuthCredential();\n return identityService.signPresentation({\n presentation: { credentials: [authCredential] },\n nonce: challenge,\n });\n },\n };\n};\n\nexport const incrementSemverPatch = (version: string): string => {\n const [major, minor, patch] = version.split('.');\n const patchNum = Number(patch);\n invariant(!Number.isNaN(patchNum), 'Unexpected function version format.');\n return [major, minor, String(patchNum + 1)].join('.');\n};\n\nexport const publicKeyToDid = (key: PublicKey): DID => {\n return `did:key:${key.toHex()}`;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAOA,yBAAkD;AAClD,uBAA0B;AAE1B,iBAAoB;;AAYb,IAAMA,uBAAuB,OAAO,EACzCC,QACAC,MACAC,SACAC,QACAC,SACAC,WAAU,MACO;AACjB,QAAMC,UAAUN,OAAOO,OAAOC,OAAOC,SAASC,UAAUC,MAAMC;AAC9DC,kCAAUP,SAAS,2BAAA;;;;;;;;;AACnB,QAAMQ,aAAa,IAAIC,kCAAeT,OAAAA;AACtC,QAAMU,eAAeC,mBAAmBjB,MAAAA;AACxCc,aAAWI,YAAYF,YAAAA;AACvB,QAAMG,WAAW,MAAML,WAAWM,eAAe;IAAEhB;IAASC;EAAW,GAAG;IAAEJ;IAAMC;IAASmB,QAAQlB;EAAO,CAAA;AAE1GmB,sBAAI,YAAY;IACdjB;IACAF;IACAF;IACAsB,aAAaP,aAAaO;IAC1BJ;EACF,GAAA;;;;;;AAEA,SAAOA;AACT;AAEA,IAAMF,qBAAqB,CAACjB,WAAAA;AAC1B,QAAMwB,WAAWxB,OAAOyB,KAAKD,SAASE,IAAG;AACzC,QAAMC,SAAS3B,OAAOyB,KAAKE;AAC3B,MAAI,CAACH,YAAY,CAACG,QAAQ;AACxB,UAAM,IAAIC,MAAM,wBAAA;EAClB;AACA,SAAO;IACLL,aAAaC,SAASD,YAAYM,MAAK;IACvCC,SAASH,OAAOI,UAAUF,MAAK;IAC/BG,oBAAoB,OAAO,EAAEC,UAAS,MAAE;AACtC,YAAMC,kBAAkBlC,OAAOU,SAASA,SAASyB;AACjD,YAAMC,iBAAiB,MAAMF,gBAAgBG,qBAAoB;AACjE,aAAOH,gBAAgBI,iBAAiB;QACtCC,cAAc;UAAEC,aAAa;YAACJ;;QAAgB;QAC9CK,OAAOR;MACT,CAAA;IACF;EACF;AACF;AAEO,IAAMS,uBAAuB,CAACxC,YAAAA;AACnC,QAAM,CAACyC,OAAOC,OAAOC,KAAAA,IAAS3C,QAAQ4C,MAAM,GAAA;AAC5C,QAAMC,WAAWC,OAAOH,KAAAA;AACxBhC,kCAAU,CAACmC,OAAOC,MAAMF,QAAAA,GAAW,uCAAA;;;;;;;;;AACnC,SAAO;IAACJ;IAAOC;IAAOM,OAAOH,WAAW,CAAA;IAAII,KAAK,GAAA;AACnD;AAEO,IAAMC,iBAAiB,CAACC,QAAAA;AAC7B,SAAO,WAAWA,IAAIxB,MAAK,CAAA;AAC7B;",
|
|
6
|
+
"names": ["uploadWorkerFunction", "client", "name", "version", "source", "spaceId", "functionId", "edgeUrl", "config", "values", "runtime", "services", "edge", "url", "invariant", "edgeClient", "EdgeHttpClient", "edgeIdentity", "createEdgeIdentity", "setIdentity", "response", "uploadFunction", "script", "log", "identityKey", "identity", "halo", "get", "device", "Error", "toHex", "peerKey", "deviceKey", "presentCredentials", "challenge", "identityService", "IdentityService", "authCredential", "createAuthCredential", "signPresentation", "presentation", "credentials", "nonce", "incrementSemverPatch", "major", "minor", "patch", "split", "patchNum", "Number", "isNaN", "String", "join", "publicKeyToDid", "key"]
|
|
7
|
+
}
|
|
@@ -18,25 +18,17 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var edge_exports = {};
|
|
20
20
|
__export(edge_exports, {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
incrementSemverPatch: () => import_chunk_MZMHE4DC.incrementSemverPatch,
|
|
25
|
-
publicKeyToDid: () => import_chunk_MZMHE4DC.publicKeyToDid,
|
|
26
|
-
setUserFunctionUrlInMetadata: () => import_chunk_MZMHE4DC.setUserFunctionUrlInMetadata,
|
|
27
|
-
uploadWorkerFunction: () => import_chunk_MZMHE4DC.uploadWorkerFunction
|
|
21
|
+
incrementSemverPatch: () => import_chunk_UHTKCFWT.incrementSemverPatch,
|
|
22
|
+
publicKeyToDid: () => import_chunk_UHTKCFWT.publicKeyToDid,
|
|
23
|
+
uploadWorkerFunction: () => import_chunk_UHTKCFWT.uploadWorkerFunction
|
|
28
24
|
});
|
|
29
25
|
module.exports = __toCommonJS(edge_exports);
|
|
30
|
-
var
|
|
26
|
+
var import_chunk_UHTKCFWT = require("../chunk-UHTKCFWT.cjs");
|
|
31
27
|
var import_chunk_JEQ2X3Z6 = require("../chunk-JEQ2X3Z6.cjs");
|
|
32
28
|
// Annotate the CommonJS export names for ESM import in node:
|
|
33
29
|
0 && (module.exports = {
|
|
34
|
-
FUNCTIONS_PRESET_META_KEY,
|
|
35
|
-
getInvocationUrl,
|
|
36
|
-
getUserFunctionUrlInMetadata,
|
|
37
30
|
incrementSemverPatch,
|
|
38
31
|
publicKeyToDid,
|
|
39
|
-
setUserFunctionUrlInMetadata,
|
|
40
32
|
uploadWorkerFunction
|
|
41
33
|
});
|
|
42
34
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.cjs"],
|
|
4
|
-
"sourcesContent": ["import {\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA
|
|
4
|
+
"sourcesContent": ["import {\n incrementSemverPatch,\n publicKeyToDid,\n uploadWorkerFunction\n} from \"../chunk-UHTKCFWT.cjs\";\nimport \"../chunk-JEQ2X3Z6.cjs\";\nexport {\n incrementSemverPatch,\n publicKeyToDid,\n uploadWorkerFunction\n};\n//# sourceMappingURL=index.cjs.map\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAIO;AACP,4BAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/lib/node/index.cjs
CHANGED
|
@@ -18,38 +18,38 @@ 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
|
-
FUNCTIONS_PRESET_META_KEY: () =>
|
|
22
|
-
FUNCTION_TYPES: () =>
|
|
23
|
-
FunctionDef: () =>
|
|
24
|
-
FunctionManifestSchema: () =>
|
|
25
|
-
FunctionRegistry: () =>
|
|
26
|
-
FunctionTrigger: () =>
|
|
27
|
-
FunctionTriggerSchema: () =>
|
|
28
|
-
FunctionType: () =>
|
|
29
|
-
InvocationOutcome: () =>
|
|
30
|
-
InvocationTraceEvent: () =>
|
|
31
|
-
ScriptType: () =>
|
|
32
|
-
TraceEvent: () =>
|
|
33
|
-
TraceEventException: () =>
|
|
34
|
-
TraceEventLog: () =>
|
|
35
|
-
TriggerKind: () =>
|
|
36
|
-
TriggerRegistry: () =>
|
|
37
|
-
TriggerSchema: () =>
|
|
38
|
-
createSubscriptionTrigger: () =>
|
|
39
|
-
createTimerTrigger: () =>
|
|
21
|
+
FUNCTIONS_PRESET_META_KEY: () => import_chunk_GX3ZLNHY.FUNCTIONS_PRESET_META_KEY,
|
|
22
|
+
FUNCTION_TYPES: () => import_chunk_GX3ZLNHY.FUNCTION_TYPES,
|
|
23
|
+
FunctionDef: () => import_chunk_GX3ZLNHY.FunctionDef,
|
|
24
|
+
FunctionManifestSchema: () => import_chunk_GX3ZLNHY.FunctionManifestSchema,
|
|
25
|
+
FunctionRegistry: () => import_chunk_AOKUMNKK.FunctionRegistry,
|
|
26
|
+
FunctionTrigger: () => import_chunk_GX3ZLNHY.FunctionTrigger,
|
|
27
|
+
FunctionTriggerSchema: () => import_chunk_GX3ZLNHY.FunctionTriggerSchema,
|
|
28
|
+
FunctionType: () => import_chunk_GX3ZLNHY.FunctionType,
|
|
29
|
+
InvocationOutcome: () => import_chunk_GX3ZLNHY.InvocationOutcome,
|
|
30
|
+
InvocationTraceEvent: () => import_chunk_GX3ZLNHY.InvocationTraceEvent,
|
|
31
|
+
ScriptType: () => import_chunk_GX3ZLNHY.ScriptType,
|
|
32
|
+
TraceEvent: () => import_chunk_GX3ZLNHY.TraceEvent,
|
|
33
|
+
TraceEventException: () => import_chunk_GX3ZLNHY.TraceEventException,
|
|
34
|
+
TraceEventLog: () => import_chunk_GX3ZLNHY.TraceEventLog,
|
|
35
|
+
TriggerKind: () => import_chunk_GX3ZLNHY.TriggerKind,
|
|
36
|
+
TriggerRegistry: () => import_chunk_AOKUMNKK.TriggerRegistry,
|
|
37
|
+
TriggerSchema: () => import_chunk_GX3ZLNHY.TriggerSchema,
|
|
38
|
+
createSubscriptionTrigger: () => import_chunk_AOKUMNKK.createSubscriptionTrigger,
|
|
39
|
+
createTimerTrigger: () => import_chunk_AOKUMNKK.createTimerTrigger,
|
|
40
40
|
defineFunction: () => defineFunction,
|
|
41
|
-
getInvocationUrl: () =>
|
|
42
|
-
getUserFunctionUrlInMetadata: () =>
|
|
43
|
-
incrementSemverPatch: () =>
|
|
44
|
-
publicKeyToDid: () =>
|
|
45
|
-
setUserFunctionUrlInMetadata: () =>
|
|
41
|
+
getInvocationUrl: () => import_chunk_GX3ZLNHY.getInvocationUrl,
|
|
42
|
+
getUserFunctionUrlInMetadata: () => import_chunk_GX3ZLNHY.getUserFunctionUrlInMetadata,
|
|
43
|
+
incrementSemverPatch: () => import_chunk_UHTKCFWT.incrementSemverPatch,
|
|
44
|
+
publicKeyToDid: () => import_chunk_UHTKCFWT.publicKeyToDid,
|
|
45
|
+
setUserFunctionUrlInMetadata: () => import_chunk_GX3ZLNHY.setUserFunctionUrlInMetadata,
|
|
46
46
|
subscriptionHandler: () => subscriptionHandler,
|
|
47
|
-
uploadWorkerFunction: () =>
|
|
47
|
+
uploadWorkerFunction: () => import_chunk_UHTKCFWT.uploadWorkerFunction
|
|
48
48
|
});
|
|
49
49
|
module.exports = __toCommonJS(node_exports);
|
|
50
|
-
var
|
|
51
|
-
var
|
|
52
|
-
var
|
|
50
|
+
var import_chunk_UHTKCFWT = require("./chunk-UHTKCFWT.cjs");
|
|
51
|
+
var import_chunk_AOKUMNKK = require("./chunk-AOKUMNKK.cjs");
|
|
52
|
+
var import_chunk_GX3ZLNHY = require("./chunk-GX3ZLNHY.cjs");
|
|
53
53
|
var import_chunk_JEQ2X3Z6 = require("./chunk-JEQ2X3Z6.cjs");
|
|
54
54
|
var import_effect = require("effect");
|
|
55
55
|
var import_client = require("@dxos/client");
|
package/dist/lib/node/meta.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/core/functions/src/bundler/bundler.ts":{"bytes":30383,"imports":[{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/bundler/index.ts":{"bytes":502,"imports":[{"path":"packages/core/functions/src/bundler/bundler.ts","kind":"import-statement","original":"./bundler"}],"format":"esm"},"packages/core/functions/src/edge/functions.ts":{"bytes":13907,"imports":[{"path":"@dxos/edge-client","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/edge/index.ts":{"bytes":501,"imports":[{"path":"packages/core/functions/src/edge/functions.ts","kind":"import-statement","original":"./functions"}],"format":"esm"},"packages/core/functions/src/types/schema.ts":{"bytes":4417,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/types/types.ts":{"bytes":16526,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/types/trace.ts":{"bytes":6233,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/core/functions/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/core/functions/src/types/index.ts":{"bytes":661,"imports":[{"path":"packages/core/functions/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/core/functions/src/types/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/functions/src/types/trace.ts","kind":"import-statement","original":"./trace"}],"format":"esm"},"packages/core/functions/src/function/function-registry.ts":{"bytes":13004,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/functions/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/function/index.ts":{"bytes":529,"imports":[{"path":"packages/core/functions/src/function/function-registry.ts","kind":"import-statement","original":"./function-registry"}],"format":"esm"},"packages/core/functions/src/handler.ts":{"bytes":14006,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/subscription-trigger.ts":{"bytes":10314,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/timer-trigger.ts":{"bytes":4173,"imports":[{"path":"cron","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/index.ts":{"bytes":751,"imports":[{"path":"packages/core/functions/src/trigger/type/subscription-trigger.ts","kind":"import-statement","original":"./subscription-trigger"},{"path":"packages/core/functions/src/trigger/type/timer-trigger.ts","kind":"import-statement","original":"./timer-trigger"}],"format":"esm"},"packages/core/functions/src/trigger/trigger-registry.ts":{"bytes":28465,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/functions/src/trigger/type/index.ts","kind":"import-statement","original":"./type"},{"path":"packages/core/functions/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/trigger/index.ts":{"bytes":603,"imports":[{"path":"packages/core/functions/src/trigger/trigger-registry.ts","kind":"import-statement","original":"./trigger-registry"},{"path":"packages/core/functions/src/trigger/type/index.ts","kind":"import-statement","original":"./type"}],"format":"esm"},"packages/core/functions/src/index.ts":{"bytes":920,"imports":[{"path":"packages/core/functions/src/edge/index.ts","kind":"import-statement","original":"./edge"},{"path":"packages/core/functions/src/function/index.ts","kind":"import-statement","original":"./function"},{"path":"packages/core/functions/src/handler.ts","kind":"import-statement","original":"./handler"},{"path":"packages/core/functions/src/trigger/index.ts","kind":"import-statement","original":"./trigger"},{"path":"packages/core/functions/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/core/functions/src/testing/types.ts":{"bytes":1131,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/dev-server.ts":{"bytes":28958,"imports":[{"path":"express","kind":"import-statement","external":true},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/scheduler.ts":{"bytes":21200,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-protocol","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/index.ts":{"bytes":598,"imports":[{"path":"packages/core/functions/src/runtime/dev-server.ts","kind":"import-statement","original":"./dev-server"},{"path":"packages/core/functions/src/runtime/scheduler.ts","kind":"import-statement","original":"./scheduler"}],"format":"esm"},"packages/core/functions/src/testing/setup.ts":{"bytes":12707,"imports":[{"path":"get-port-please","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/functions/src/testing/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/functions/src/function/index.ts","kind":"import-statement","original":"../function"},{"path":"packages/core/functions/src/runtime/index.ts","kind":"import-statement","original":"../runtime"},{"path":"packages/core/functions/src/trigger/index.ts","kind":"import-statement","original":"../trigger"},{"path":"packages/core/functions/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/testing/util.ts":{"bytes":4310,"imports":[{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"packages/core/functions/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/testing/manifest.ts":{"bytes":1139,"imports":[],"format":"esm"},"packages/core/functions/src/testing/index.ts":{"bytes":749,"imports":[{"path":"packages/core/functions/src/testing/setup.ts","kind":"import-statement","original":"./setup"},{"path":"packages/core/functions/src/testing/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/functions/src/testing/util.ts","kind":"import-statement","original":"./util"},{"path":"packages/core/functions/src/testing/manifest.ts","kind":"import-statement","original":"./manifest"}],"format":"esm"}},"outputs":{"packages/core/functions/dist/lib/node/bundler/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14436},"packages/core/functions/dist/lib/node/bundler/index.cjs":{"imports":[{"path":"packages/core/functions/dist/lib/node/chunk-JEQ2X3Z6.cjs","kind":"import-statement"},{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["Bundler","initializeBundler"],"entryPoint":"packages/core/functions/src/bundler/index.ts","inputs":{"packages/core/functions/src/bundler/bundler.ts":{"bytesInOutput":7125},"packages/core/functions/src/bundler/index.ts":{"bytesInOutput":0}},"bytes":7286},"packages/core/functions/dist/lib/node/edge/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/node/edge/index.cjs":{"imports":[{"path":"packages/core/functions/dist/lib/node/chunk-MZMHE4DC.cjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node/chunk-JEQ2X3Z6.cjs","kind":"import-statement"}],"exports":["FUNCTIONS_PRESET_META_KEY","getInvocationUrl","getUserFunctionUrlInMetadata","incrementSemverPatch","publicKeyToDid","setUserFunctionUrlInMetadata","uploadWorkerFunction"],"entryPoint":"packages/core/functions/src/edge/index.ts","inputs":{},"bytes":476},"packages/core/functions/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7874},"packages/core/functions/dist/lib/node/index.cjs":{"imports":[{"path":"packages/core/functions/dist/lib/node/chunk-MZMHE4DC.cjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node/chunk-BGDVH6JU.cjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node/chunk-3J6FVYUV.cjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node/chunk-JEQ2X3Z6.cjs","kind":"import-statement"},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["FUNCTIONS_PRESET_META_KEY","FUNCTION_TYPES","FunctionDef","FunctionManifestSchema","FunctionRegistry","FunctionTrigger","FunctionTriggerSchema","FunctionType","InvocationOutcome","InvocationTraceEvent","ScriptType","TraceEvent","TraceEventException","TraceEventLog","TriggerKind","TriggerRegistry","TriggerSchema","createSubscriptionTrigger","createTimerTrigger","defineFunction","getInvocationUrl","getUserFunctionUrlInMetadata","incrementSemverPatch","publicKeyToDid","setUserFunctionUrlInMetadata","subscriptionHandler","uploadWorkerFunction"],"entryPoint":"packages/core/functions/src/index.ts","inputs":{"packages/core/functions/src/index.ts":{"bytesInOutput":0},"packages/core/functions/src/handler.ts":{"bytesInOutput":2076}},"bytes":3420},"packages/core/functions/dist/lib/node/chunk-MZMHE4DC.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7183},"packages/core/functions/dist/lib/node/chunk-MZMHE4DC.cjs":{"imports":[{"path":"@dxos/edge-client","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["FUNCTIONS_PRESET_META_KEY","getInvocationUrl","getUserFunctionUrlInMetadata","incrementSemverPatch","publicKeyToDid","setUserFunctionUrlInMetadata","uploadWorkerFunction"],"inputs":{"packages/core/functions/src/edge/functions.ts":{"bytesInOutput":3390},"packages/core/functions/src/edge/index.ts":{"bytesInOutput":0}},"bytes":3674},"packages/core/functions/dist/lib/node/testing/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":32289},"packages/core/functions/dist/lib/node/testing/index.cjs":{"imports":[{"path":"packages/core/functions/dist/lib/node/chunk-BGDVH6JU.cjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node/chunk-3J6FVYUV.cjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node/chunk-JEQ2X3Z6.cjs","kind":"import-statement"},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"express","kind":"import-statement","external":true},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-protocol","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true}],"exports":["TestType","createFunctionRuntime","createInitializedClients","inviteMember","startFunctionsHost","testFunctionManifest","triggerWebhook"],"entryPoint":"packages/core/functions/src/testing/index.ts","inputs":{"packages/core/functions/src/testing/setup.ts":{"bytesInOutput":2775},"packages/core/functions/src/testing/types.ts":{"bytesInOutput":182},"packages/core/functions/src/runtime/dev-server.ts":{"bytesInOutput":7860},"packages/core/functions/src/runtime/index.ts":{"bytesInOutput":0},"packages/core/functions/src/runtime/scheduler.ts":{"bytesInOutput":5364},"packages/core/functions/src/testing/index.ts":{"bytesInOutput":0},"packages/core/functions/src/testing/util.ts":{"bytesInOutput":1067},"packages/core/functions/src/testing/manifest.ts":{"bytesInOutput":146}},"bytes":18145},"packages/core/functions/dist/lib/node/chunk-BGDVH6JU.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":26826},"packages/core/functions/dist/lib/node/chunk-BGDVH6JU.cjs":{"imports":[{"path":"packages/core/functions/dist/lib/node/chunk-3J6FVYUV.cjs","kind":"import-statement"},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"cron","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["FunctionRegistry","TriggerRegistry","createSubscriptionTrigger","createTimerTrigger"],"inputs":{"packages/core/functions/src/function/function-registry.ts":{"bytesInOutput":3046},"packages/core/functions/src/function/index.ts":{"bytesInOutput":0},"packages/core/functions/src/trigger/type/subscription-trigger.ts":{"bytesInOutput":2007},"packages/core/functions/src/trigger/type/timer-trigger.ts":{"bytesInOutput":898},"packages/core/functions/src/trigger/trigger-registry.ts":{"bytesInOutput":7538},"packages/core/functions/src/trigger/type/index.ts":{"bytesInOutput":0},"packages/core/functions/src/trigger/index.ts":{"bytesInOutput":0}},"bytes":13961},"packages/core/functions/dist/lib/node/types/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/node/types/index.cjs":{"imports":[{"path":"packages/core/functions/dist/lib/node/chunk-3J6FVYUV.cjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node/chunk-JEQ2X3Z6.cjs","kind":"import-statement"}],"exports":["FUNCTION_TYPES","FunctionDef","FunctionManifestSchema","FunctionTrigger","FunctionTriggerSchema","FunctionType","InvocationOutcome","InvocationTraceEvent","ScriptType","TraceEvent","TraceEventException","TraceEventLog","TriggerKind","TriggerSchema"],"entryPoint":"packages/core/functions/src/types/index.ts","inputs":{},"bytes":646},"packages/core/functions/dist/lib/node/chunk-3J6FVYUV.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":13917},"packages/core/functions/dist/lib/node/chunk-3J6FVYUV.cjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["FUNCTION_TYPES","FunctionDef","FunctionManifestSchema","FunctionTrigger","FunctionTriggerSchema","FunctionType","InvocationOutcome","InvocationTraceEvent","ScriptType","TraceEvent","TraceEventException","TraceEventLog","TriggerKind","TriggerSchema"],"inputs":{"packages/core/functions/src/types/schema.ts":{"bytesInOutput":1010},"packages/core/functions/src/types/index.ts":{"bytesInOutput":0},"packages/core/functions/src/types/types.ts":{"bytesInOutput":3644},"packages/core/functions/src/types/trace.ts":{"bytesInOutput":1485}},"bytes":6600},"packages/core/functions/dist/lib/node/chunk-JEQ2X3Z6.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/node/chunk-JEQ2X3Z6.cjs":{"imports":[],"exports":["__require"],"inputs":{},"bytes":434}}}
|
|
1
|
+
{"inputs":{"packages/core/functions/src/bundler/bundler.ts":{"bytes":30383,"imports":[{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/bundler/index.ts":{"bytes":502,"imports":[{"path":"packages/core/functions/src/bundler/bundler.ts","kind":"import-statement","original":"./bundler"}],"format":"esm"},"packages/core/functions/src/edge/functions.ts":{"bytes":8798,"imports":[{"path":"@dxos/edge-client","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/edge/index.ts":{"bytes":501,"imports":[{"path":"packages/core/functions/src/edge/functions.ts","kind":"import-statement","original":"./functions"}],"format":"esm"},"packages/core/functions/src/types/schema.ts":{"bytes":4417,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/types/types.ts":{"bytes":16526,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/types/trace.ts":{"bytes":6233,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"packages/core/functions/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/core/functions/src/types/url.ts":{"bytes":5599,"imports":[],"format":"esm"},"packages/core/functions/src/types/index.ts":{"bytes":740,"imports":[{"path":"packages/core/functions/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/core/functions/src/types/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/functions/src/types/trace.ts","kind":"import-statement","original":"./trace"},{"path":"packages/core/functions/src/types/url.ts","kind":"import-statement","original":"./url"}],"format":"esm"},"packages/core/functions/src/function/function-registry.ts":{"bytes":13004,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/functions/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/function/index.ts":{"bytes":529,"imports":[{"path":"packages/core/functions/src/function/function-registry.ts","kind":"import-statement","original":"./function-registry"}],"format":"esm"},"packages/core/functions/src/handler.ts":{"bytes":14006,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/subscription-trigger.ts":{"bytes":10314,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/timer-trigger.ts":{"bytes":4673,"imports":[{"path":"cron-schedule","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/trigger/type/index.ts":{"bytes":751,"imports":[{"path":"packages/core/functions/src/trigger/type/subscription-trigger.ts","kind":"import-statement","original":"./subscription-trigger"},{"path":"packages/core/functions/src/trigger/type/timer-trigger.ts","kind":"import-statement","original":"./timer-trigger"}],"format":"esm"},"packages/core/functions/src/trigger/trigger-registry.ts":{"bytes":28465,"imports":[{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/functions/src/trigger/type/index.ts","kind":"import-statement","original":"./type"},{"path":"packages/core/functions/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/trigger/index.ts":{"bytes":603,"imports":[{"path":"packages/core/functions/src/trigger/trigger-registry.ts","kind":"import-statement","original":"./trigger-registry"},{"path":"packages/core/functions/src/trigger/type/index.ts","kind":"import-statement","original":"./type"}],"format":"esm"},"packages/core/functions/src/index.ts":{"bytes":920,"imports":[{"path":"packages/core/functions/src/edge/index.ts","kind":"import-statement","original":"./edge"},{"path":"packages/core/functions/src/function/index.ts","kind":"import-statement","original":"./function"},{"path":"packages/core/functions/src/handler.ts","kind":"import-statement","original":"./handler"},{"path":"packages/core/functions/src/trigger/index.ts","kind":"import-statement","original":"./trigger"},{"path":"packages/core/functions/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/core/functions/src/testing/types.ts":{"bytes":1131,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/dev-server.ts":{"bytes":28958,"imports":[{"path":"express","kind":"import-statement","external":true},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/scheduler.ts":{"bytes":21200,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-protocol","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"packages/core/functions/src/runtime/index.ts":{"bytes":598,"imports":[{"path":"packages/core/functions/src/runtime/dev-server.ts","kind":"import-statement","original":"./dev-server"},{"path":"packages/core/functions/src/runtime/scheduler.ts","kind":"import-statement","original":"./scheduler"}],"format":"esm"},"packages/core/functions/src/testing/setup.ts":{"bytes":12707,"imports":[{"path":"get-port-please","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/core/functions/src/testing/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/functions/src/function/index.ts","kind":"import-statement","original":"../function"},{"path":"packages/core/functions/src/runtime/index.ts","kind":"import-statement","original":"../runtime"},{"path":"packages/core/functions/src/trigger/index.ts","kind":"import-statement","original":"../trigger"},{"path":"packages/core/functions/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/testing/util.ts":{"bytes":4310,"imports":[{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"packages/core/functions/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/core/functions/src/testing/manifest.ts":{"bytes":1139,"imports":[],"format":"esm"},"packages/core/functions/src/testing/index.ts":{"bytes":749,"imports":[{"path":"packages/core/functions/src/testing/setup.ts","kind":"import-statement","original":"./setup"},{"path":"packages/core/functions/src/testing/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/core/functions/src/testing/util.ts","kind":"import-statement","original":"./util"},{"path":"packages/core/functions/src/testing/manifest.ts","kind":"import-statement","original":"./manifest"}],"format":"esm"}},"outputs":{"packages/core/functions/dist/lib/node/bundler/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":14436},"packages/core/functions/dist/lib/node/bundler/index.cjs":{"imports":[{"path":"packages/core/functions/dist/lib/node/chunk-JEQ2X3Z6.cjs","kind":"import-statement"},{"path":"esbuild-wasm","kind":"import-statement","external":true},{"path":"@dxos/crypto","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["Bundler","initializeBundler"],"entryPoint":"packages/core/functions/src/bundler/index.ts","inputs":{"packages/core/functions/src/bundler/bundler.ts":{"bytesInOutput":7125},"packages/core/functions/src/bundler/index.ts":{"bytesInOutput":0}},"bytes":7286},"packages/core/functions/dist/lib/node/edge/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/node/edge/index.cjs":{"imports":[{"path":"packages/core/functions/dist/lib/node/chunk-UHTKCFWT.cjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node/chunk-JEQ2X3Z6.cjs","kind":"import-statement"}],"exports":["incrementSemverPatch","publicKeyToDid","uploadWorkerFunction"],"entryPoint":"packages/core/functions/src/edge/index.ts","inputs":{},"bytes":250},"packages/core/functions/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7874},"packages/core/functions/dist/lib/node/index.cjs":{"imports":[{"path":"packages/core/functions/dist/lib/node/chunk-UHTKCFWT.cjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node/chunk-AOKUMNKK.cjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node/chunk-GX3ZLNHY.cjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node/chunk-JEQ2X3Z6.cjs","kind":"import-statement"},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["FUNCTIONS_PRESET_META_KEY","FUNCTION_TYPES","FunctionDef","FunctionManifestSchema","FunctionRegistry","FunctionTrigger","FunctionTriggerSchema","FunctionType","InvocationOutcome","InvocationTraceEvent","ScriptType","TraceEvent","TraceEventException","TraceEventLog","TriggerKind","TriggerRegistry","TriggerSchema","createSubscriptionTrigger","createTimerTrigger","defineFunction","getInvocationUrl","getUserFunctionUrlInMetadata","incrementSemverPatch","publicKeyToDid","setUserFunctionUrlInMetadata","subscriptionHandler","uploadWorkerFunction"],"entryPoint":"packages/core/functions/src/index.ts","inputs":{"packages/core/functions/src/index.ts":{"bytesInOutput":0},"packages/core/functions/src/handler.ts":{"bytesInOutput":2076}},"bytes":3420},"packages/core/functions/dist/lib/node/chunk-UHTKCFWT.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4470},"packages/core/functions/dist/lib/node/chunk-UHTKCFWT.cjs":{"imports":[{"path":"@dxos/edge-client","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"exports":["incrementSemverPatch","publicKeyToDid","uploadWorkerFunction"],"inputs":{"packages/core/functions/src/edge/functions.ts":{"bytesInOutput":2251},"packages/core/functions/src/edge/index.ts":{"bytesInOutput":0}},"bytes":2422},"packages/core/functions/dist/lib/node/testing/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":32289},"packages/core/functions/dist/lib/node/testing/index.cjs":{"imports":[{"path":"packages/core/functions/dist/lib/node/chunk-AOKUMNKK.cjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node/chunk-GX3ZLNHY.cjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node/chunk-JEQ2X3Z6.cjs","kind":"import-statement"},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"express","kind":"import-statement","external":true},{"path":"get-port-please","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-protocol","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/client/testing","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true}],"exports":["TestType","createFunctionRuntime","createInitializedClients","inviteMember","startFunctionsHost","testFunctionManifest","triggerWebhook"],"entryPoint":"packages/core/functions/src/testing/index.ts","inputs":{"packages/core/functions/src/testing/setup.ts":{"bytesInOutput":2775},"packages/core/functions/src/testing/types.ts":{"bytesInOutput":182},"packages/core/functions/src/runtime/dev-server.ts":{"bytesInOutput":7860},"packages/core/functions/src/runtime/index.ts":{"bytesInOutput":0},"packages/core/functions/src/runtime/scheduler.ts":{"bytesInOutput":5364},"packages/core/functions/src/testing/index.ts":{"bytesInOutput":0},"packages/core/functions/src/testing/util.ts":{"bytesInOutput":1067},"packages/core/functions/src/testing/manifest.ts":{"bytesInOutput":146}},"bytes":18145},"packages/core/functions/dist/lib/node/chunk-AOKUMNKK.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":27169},"packages/core/functions/dist/lib/node/chunk-AOKUMNKK.cjs":{"imports":[{"path":"packages/core/functions/dist/lib/node/chunk-GX3ZLNHY.cjs","kind":"import-statement"},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-db","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"cron-schedule","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/client/echo","kind":"import-statement","external":true},{"path":"@dxos/context","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/keys","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["FunctionRegistry","TriggerRegistry","createSubscriptionTrigger","createTimerTrigger"],"inputs":{"packages/core/functions/src/function/function-registry.ts":{"bytesInOutput":3046},"packages/core/functions/src/function/index.ts":{"bytesInOutput":0},"packages/core/functions/src/trigger/type/subscription-trigger.ts":{"bytesInOutput":2007},"packages/core/functions/src/trigger/type/timer-trigger.ts":{"bytesInOutput":1086},"packages/core/functions/src/trigger/trigger-registry.ts":{"bytesInOutput":7538},"packages/core/functions/src/trigger/type/index.ts":{"bytesInOutput":0},"packages/core/functions/src/trigger/index.ts":{"bytesInOutput":0}},"bytes":14149},"packages/core/functions/dist/lib/node/types/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/node/types/index.cjs":{"imports":[{"path":"packages/core/functions/dist/lib/node/chunk-GX3ZLNHY.cjs","kind":"import-statement"},{"path":"packages/core/functions/dist/lib/node/chunk-JEQ2X3Z6.cjs","kind":"import-statement"}],"exports":["FUNCTIONS_PRESET_META_KEY","FUNCTION_TYPES","FunctionDef","FunctionManifestSchema","FunctionTrigger","FunctionTriggerSchema","FunctionType","InvocationOutcome","InvocationTraceEvent","ScriptType","TraceEvent","TraceEventException","TraceEventLog","TriggerKind","TriggerSchema","getInvocationUrl","getUserFunctionUrlInMetadata","setUserFunctionUrlInMetadata"],"entryPoint":"packages/core/functions/src/types/index.ts","inputs":{},"bytes":872},"packages/core/functions/dist/lib/node/chunk-GX3ZLNHY.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":16776},"packages/core/functions/dist/lib/node/chunk-GX3ZLNHY.cjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"exports":["FUNCTIONS_PRESET_META_KEY","FUNCTION_TYPES","FunctionDef","FunctionManifestSchema","FunctionTrigger","FunctionTriggerSchema","FunctionType","InvocationOutcome","InvocationTraceEvent","ScriptType","TraceEvent","TraceEventException","TraceEventLog","TriggerKind","TriggerSchema","getInvocationUrl","getUserFunctionUrlInMetadata","setUserFunctionUrlInMetadata"],"inputs":{"packages/core/functions/src/types/schema.ts":{"bytesInOutput":1010},"packages/core/functions/src/types/index.ts":{"bytesInOutput":0},"packages/core/functions/src/types/types.ts":{"bytesInOutput":3644},"packages/core/functions/src/types/trace.ts":{"bytesInOutput":1485},"packages/core/functions/src/types/url.ts":{"bytesInOutput":1138}},"bytes":7896},"packages/core/functions/dist/lib/node/chunk-JEQ2X3Z6.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/core/functions/dist/lib/node/chunk-JEQ2X3Z6.cjs":{"imports":[],"exports":["__require"],"inputs":{},"bytes":434}}}
|
|
@@ -37,8 +37,8 @@ __export(testing_exports, {
|
|
|
37
37
|
triggerWebhook: () => triggerWebhook
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(testing_exports);
|
|
40
|
-
var
|
|
41
|
-
var
|
|
40
|
+
var import_chunk_AOKUMNKK = require("../chunk-AOKUMNKK.cjs");
|
|
41
|
+
var import_chunk_GX3ZLNHY = require("../chunk-GX3ZLNHY.cjs");
|
|
42
42
|
var import_chunk_JEQ2X3Z6 = require("../chunk-JEQ2X3Z6.cjs");
|
|
43
43
|
var import_get_port_please = require("get-port-please");
|
|
44
44
|
var import_node_path = __toESM(require("node:path"));
|
|
@@ -572,8 +572,8 @@ var createInitializedClients = async (testBuilder, count = 1, config) => {
|
|
|
572
572
|
config,
|
|
573
573
|
services: testBuilder.createLocalClientServices(),
|
|
574
574
|
types: [
|
|
575
|
-
|
|
576
|
-
|
|
575
|
+
import_chunk_GX3ZLNHY.FunctionDef,
|
|
576
|
+
import_chunk_GX3ZLNHY.FunctionTrigger,
|
|
577
577
|
TestType
|
|
578
578
|
]
|
|
579
579
|
}));
|
|
@@ -610,7 +610,7 @@ var createFunctionRuntime = async (testBuilder, pluginInitializer) => {
|
|
|
610
610
|
};
|
|
611
611
|
var startFunctionsHost = async (testBuilder, pluginInitializer, options) => {
|
|
612
612
|
const functionRuntime = await createFunctionRuntime(testBuilder, pluginInitializer);
|
|
613
|
-
const functionsRegistry = new
|
|
613
|
+
const functionsRegistry = new import_chunk_AOKUMNKK.FunctionRegistry(functionRuntime);
|
|
614
614
|
const devServer = await startDevServer(testBuilder, functionRuntime, functionsRegistry, options);
|
|
615
615
|
const scheduler = await startScheduler(testBuilder, functionRuntime, devServer, functionsRegistry);
|
|
616
616
|
return {
|
|
@@ -624,7 +624,7 @@ var startFunctionsHost = async (testBuilder, pluginInitializer, options) => {
|
|
|
624
624
|
};
|
|
625
625
|
};
|
|
626
626
|
var startScheduler = async (testBuilder, client, devServer, functionRegistry) => {
|
|
627
|
-
const triggerRegistry = new
|
|
627
|
+
const triggerRegistry = new import_chunk_AOKUMNKK.TriggerRegistry(client);
|
|
628
628
|
const scheduler = new Scheduler(functionRegistry, triggerRegistry, {
|
|
629
629
|
endpoint: devServer.endpoint
|
|
630
630
|
});
|
|
@@ -644,7 +644,7 @@ var startDevServer = async (testBuilder, client, functionRegistry, options) => {
|
|
|
644
644
|
};
|
|
645
645
|
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/core/functions/src/testing/util.ts";
|
|
646
646
|
var triggerWebhook = async (space, uri) => {
|
|
647
|
-
const trigger = (await space.db.query(import_echo2.Filter.schema(
|
|
647
|
+
const trigger = (await space.db.query(import_echo2.Filter.schema(import_chunk_GX3ZLNHY.FunctionTrigger, (trigger2) => trigger2.function === uri)).run()).objects[0];
|
|
648
648
|
(0, import_invariant2.invariant)(trigger.spec?.type === "webhook", void 0, {
|
|
649
649
|
F: __dxlog_file3,
|
|
650
650
|
L: 17,
|
|
@@ -18,26 +18,31 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var types_exports = {};
|
|
20
20
|
__export(types_exports, {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
FUNCTIONS_PRESET_META_KEY: () => import_chunk_GX3ZLNHY.FUNCTIONS_PRESET_META_KEY,
|
|
22
|
+
FUNCTION_TYPES: () => import_chunk_GX3ZLNHY.FUNCTION_TYPES,
|
|
23
|
+
FunctionDef: () => import_chunk_GX3ZLNHY.FunctionDef,
|
|
24
|
+
FunctionManifestSchema: () => import_chunk_GX3ZLNHY.FunctionManifestSchema,
|
|
25
|
+
FunctionTrigger: () => import_chunk_GX3ZLNHY.FunctionTrigger,
|
|
26
|
+
FunctionTriggerSchema: () => import_chunk_GX3ZLNHY.FunctionTriggerSchema,
|
|
27
|
+
FunctionType: () => import_chunk_GX3ZLNHY.FunctionType,
|
|
28
|
+
InvocationOutcome: () => import_chunk_GX3ZLNHY.InvocationOutcome,
|
|
29
|
+
InvocationTraceEvent: () => import_chunk_GX3ZLNHY.InvocationTraceEvent,
|
|
30
|
+
ScriptType: () => import_chunk_GX3ZLNHY.ScriptType,
|
|
31
|
+
TraceEvent: () => import_chunk_GX3ZLNHY.TraceEvent,
|
|
32
|
+
TraceEventException: () => import_chunk_GX3ZLNHY.TraceEventException,
|
|
33
|
+
TraceEventLog: () => import_chunk_GX3ZLNHY.TraceEventLog,
|
|
34
|
+
TriggerKind: () => import_chunk_GX3ZLNHY.TriggerKind,
|
|
35
|
+
TriggerSchema: () => import_chunk_GX3ZLNHY.TriggerSchema,
|
|
36
|
+
getInvocationUrl: () => import_chunk_GX3ZLNHY.getInvocationUrl,
|
|
37
|
+
getUserFunctionUrlInMetadata: () => import_chunk_GX3ZLNHY.getUserFunctionUrlInMetadata,
|
|
38
|
+
setUserFunctionUrlInMetadata: () => import_chunk_GX3ZLNHY.setUserFunctionUrlInMetadata
|
|
35
39
|
});
|
|
36
40
|
module.exports = __toCommonJS(types_exports);
|
|
37
|
-
var
|
|
41
|
+
var import_chunk_GX3ZLNHY = require("../chunk-GX3ZLNHY.cjs");
|
|
38
42
|
var import_chunk_JEQ2X3Z6 = require("../chunk-JEQ2X3Z6.cjs");
|
|
39
43
|
// Annotate the CommonJS export names for ESM import in node:
|
|
40
44
|
0 && (module.exports = {
|
|
45
|
+
FUNCTIONS_PRESET_META_KEY,
|
|
41
46
|
FUNCTION_TYPES,
|
|
42
47
|
FunctionDef,
|
|
43
48
|
FunctionManifestSchema,
|
|
@@ -51,6 +56,9 @@ var import_chunk_JEQ2X3Z6 = require("../chunk-JEQ2X3Z6.cjs");
|
|
|
51
56
|
TraceEventException,
|
|
52
57
|
TraceEventLog,
|
|
53
58
|
TriggerKind,
|
|
54
|
-
TriggerSchema
|
|
59
|
+
TriggerSchema,
|
|
60
|
+
getInvocationUrl,
|
|
61
|
+
getUserFunctionUrlInMetadata,
|
|
62
|
+
setUserFunctionUrlInMetadata
|
|
55
63
|
});
|
|
56
64
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.cjs"],
|
|
4
|
-
"sourcesContent": ["import {\n FUNCTION_TYPES,\n FunctionDef,\n FunctionManifestSchema,\n FunctionTrigger,\n FunctionTriggerSchema,\n FunctionType,\n InvocationOutcome,\n InvocationTraceEvent,\n ScriptType,\n TraceEvent,\n TraceEventException,\n TraceEventLog,\n TriggerKind,\n TriggerSchema\n} from \"../chunk-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
4
|
+
"sourcesContent": ["import {\n FUNCTIONS_PRESET_META_KEY,\n FUNCTION_TYPES,\n FunctionDef,\n FunctionManifestSchema,\n FunctionTrigger,\n FunctionTriggerSchema,\n FunctionType,\n InvocationOutcome,\n InvocationTraceEvent,\n ScriptType,\n TraceEvent,\n TraceEventException,\n TraceEventLog,\n TriggerKind,\n TriggerSchema,\n getInvocationUrl,\n getUserFunctionUrlInMetadata,\n setUserFunctionUrlInMetadata\n} from \"../chunk-GX3ZLNHY.cjs\";\nimport \"../chunk-JEQ2X3Z6.cjs\";\nexport {\n FUNCTIONS_PRESET_META_KEY,\n FUNCTION_TYPES,\n FunctionDef,\n FunctionManifestSchema,\n FunctionTrigger,\n FunctionTriggerSchema,\n FunctionType,\n InvocationOutcome,\n InvocationTraceEvent,\n ScriptType,\n TraceEvent,\n TraceEventException,\n TraceEventLog,\n TriggerKind,\n TriggerSchema,\n getInvocationUrl,\n getUserFunctionUrlInMetadata,\n setUserFunctionUrlInMetadata\n};\n//# sourceMappingURL=index.cjs.map\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAmBO;AACP,4BAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,7 +2,7 @@ import { createRequire } from 'node:module';const require = createRequire(import
|
|
|
2
2
|
import {
|
|
3
3
|
FunctionDef,
|
|
4
4
|
FunctionTrigger
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-NALEEAQL.mjs";
|
|
6
6
|
|
|
7
7
|
// packages/core/functions/src/function/function-registry.ts
|
|
8
8
|
import { Event } from "@dxos/async";
|
|
@@ -182,7 +182,7 @@ var createSubscriptionTrigger = async (ctx, space, spec, callback) => {
|
|
|
182
182
|
};
|
|
183
183
|
|
|
184
184
|
// packages/core/functions/src/trigger/type/timer-trigger.ts
|
|
185
|
-
import {
|
|
185
|
+
import { parseCronExpression } from "cron-schedule";
|
|
186
186
|
import { DeferredTask } from "@dxos/async";
|
|
187
187
|
import { log as log3 } from "@dxos/log";
|
|
188
188
|
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/core/functions/src/trigger/type/timer-trigger.ts";
|
|
@@ -192,29 +192,31 @@ var createTimerTrigger = async (ctx, space, spec, callback) => {
|
|
|
192
192
|
});
|
|
193
193
|
let last = 0;
|
|
194
194
|
let run = 0;
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
const delta = last ? now - last : 0;
|
|
201
|
-
last = now;
|
|
202
|
-
run++;
|
|
203
|
-
log3.info("tick", {
|
|
204
|
-
space: space.key.truncate(),
|
|
205
|
-
count: run,
|
|
206
|
-
delta
|
|
207
|
-
}, {
|
|
208
|
-
F: __dxlog_file3,
|
|
209
|
-
L: 38,
|
|
210
|
-
S: void 0,
|
|
211
|
-
C: (f, a) => f(...a)
|
|
212
|
-
});
|
|
213
|
-
task.schedule();
|
|
195
|
+
const schedule = parseCronExpression(spec.cron);
|
|
196
|
+
const getRunTimeout = () => Date.now() - schedule.getNextDate().getTime();
|
|
197
|
+
const runCron = () => {
|
|
198
|
+
if (ctx.disposed) {
|
|
199
|
+
return;
|
|
214
200
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
201
|
+
const now = Date.now();
|
|
202
|
+
const delta = last ? now - last : 0;
|
|
203
|
+
last = now;
|
|
204
|
+
run++;
|
|
205
|
+
log3.info("tick", {
|
|
206
|
+
space: space.key.truncate(),
|
|
207
|
+
count: run,
|
|
208
|
+
delta
|
|
209
|
+
}, {
|
|
210
|
+
F: __dxlog_file3,
|
|
211
|
+
L: 39,
|
|
212
|
+
S: void 0,
|
|
213
|
+
C: (f, a) => f(...a)
|
|
214
|
+
});
|
|
215
|
+
task.schedule();
|
|
216
|
+
timeout = setTimeout(runCron, getRunTimeout());
|
|
217
|
+
};
|
|
218
|
+
let timeout = setTimeout(runCron, getRunTimeout());
|
|
219
|
+
ctx.onDispose(() => clearTimeout(timeout));
|
|
218
220
|
};
|
|
219
221
|
|
|
220
222
|
// packages/core/functions/src/trigger/trigger-registry.ts
|
|
@@ -477,4 +479,4 @@ export {
|
|
|
477
479
|
createTimerTrigger,
|
|
478
480
|
TriggerRegistry
|
|
479
481
|
};
|
|
480
|
-
//# sourceMappingURL=chunk-
|
|
482
|
+
//# sourceMappingURL=chunk-BYS52HOC.mjs.map
|