@dxos/functions 0.8.1 → 0.8.2-main.2f9c567
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/bundler/index.mjs +0 -3
- package/dist/lib/browser/bundler/index.mjs.map +1 -1
- package/dist/lib/browser/edge/index.mjs +63 -7
- package/dist/lib/browser/edge/index.mjs.map +4 -4
- package/dist/lib/browser/index.mjs +368 -98
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/bundler/index.cjs +0 -1
- package/dist/lib/node/bundler/index.cjs.map +1 -1
- package/dist/lib/node/edge/index.cjs +65 -5
- package/dist/lib/node/edge/index.cjs.map +4 -4
- package/dist/lib/node/index.cjs +383 -93
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/bundler/index.mjs +0 -1
- package/dist/lib/node-esm/bundler/index.mjs.map +1 -1
- package/dist/lib/node-esm/edge/index.mjs +64 -6
- package/dist/lib/node-esm/edge/index.mjs.map +4 -4
- package/dist/lib/node-esm/index.mjs +368 -96
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/edge/index.d.ts.map +1 -1
- package/dist/types/src/handler.d.ts +15 -63
- package/dist/types/src/handler.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +3 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/schema.d.ts +57 -0
- package/dist/types/src/schema.d.ts.map +1 -0
- package/dist/types/src/trace.d.ts +148 -0
- package/dist/types/src/trace.d.ts.map +1 -0
- package/dist/types/src/{types/types.d.ts → types.d.ts} +191 -49
- package/dist/types/src/types.d.ts.map +1 -0
- package/dist/types/src/{types/url.d.ts → url.d.ts} +6 -0
- package/dist/types/src/url.d.ts.map +1 -0
- package/package.json +20 -35
- package/src/edge/index.ts +4 -0
- package/src/handler.ts +17 -120
- package/src/index.ts +4 -5
- package/src/schema.ts +53 -0
- package/src/{types/trace.ts → trace.ts} +33 -31
- package/src/translations.ts +1 -1
- package/src/types.ts +214 -0
- package/src/{types/url.ts → url.ts} +5 -0
- package/dist/lib/browser/chunk-HI7YZO2K.mjs +0 -482
- package/dist/lib/browser/chunk-HI7YZO2K.mjs.map +0 -7
- package/dist/lib/browser/chunk-LT4LR4VU.mjs +0 -72
- package/dist/lib/browser/chunk-LT4LR4VU.mjs.map +0 -7
- package/dist/lib/browser/chunk-RVSG6WTL.mjs +0 -358
- package/dist/lib/browser/chunk-RVSG6WTL.mjs.map +0 -7
- package/dist/lib/browser/chunk-XRCXIG74.mjs +0 -12
- package/dist/lib/browser/chunk-XRCXIG74.mjs.map +0 -7
- package/dist/lib/browser/testing/index.mjs +0 -670
- package/dist/lib/browser/testing/index.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -49
- package/dist/lib/browser/types/index.mjs.map +0 -7
- package/dist/lib/node/chunk-DSUGRAAL.cjs +0 -392
- package/dist/lib/node/chunk-DSUGRAAL.cjs.map +0 -7
- package/dist/lib/node/chunk-JEQ2X3Z6.cjs +0 -34
- package/dist/lib/node/chunk-JEQ2X3Z6.cjs.map +0 -7
- package/dist/lib/node/chunk-NXZNXVT3.cjs +0 -94
- package/dist/lib/node/chunk-NXZNXVT3.cjs.map +0 -7
- package/dist/lib/node/chunk-RXMCVAMJ.cjs +0 -496
- package/dist/lib/node/chunk-RXMCVAMJ.cjs.map +0 -7
- package/dist/lib/node/testing/index.cjs +0 -687
- package/dist/lib/node/testing/index.cjs.map +0 -7
- package/dist/lib/node/types/index.cjs +0 -70
- package/dist/lib/node/types/index.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-DHGBFXSZ.mjs +0 -12
- package/dist/lib/node-esm/chunk-DHGBFXSZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HBD2FZXO.mjs +0 -358
- package/dist/lib/node-esm/chunk-HBD2FZXO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-O2SXVYU5.mjs +0 -72
- package/dist/lib/node-esm/chunk-O2SXVYU5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SQSJO5HI.mjs +0 -482
- package/dist/lib/node-esm/chunk-SQSJO5HI.mjs.map +0 -7
- package/dist/lib/node-esm/testing/index.mjs +0 -670
- package/dist/lib/node-esm/testing/index.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -49
- package/dist/lib/node-esm/types/index.mjs.map +0 -7
- package/dist/types/src/browser/index.d.ts +0 -2
- package/dist/types/src/browser/index.d.ts.map +0 -1
- package/dist/types/src/function/function-registry.d.ts +0 -25
- package/dist/types/src/function/function-registry.d.ts.map +0 -1
- package/dist/types/src/function/function-registry.test.d.ts +0 -2
- package/dist/types/src/function/function-registry.test.d.ts.map +0 -1
- package/dist/types/src/function/index.d.ts +0 -2
- package/dist/types/src/function/index.d.ts.map +0 -1
- package/dist/types/src/runtime/dev-server.d.ts +0 -52
- package/dist/types/src/runtime/dev-server.d.ts.map +0 -1
- package/dist/types/src/runtime/dev-server.test.d.ts +0 -2
- package/dist/types/src/runtime/dev-server.test.d.ts.map +0 -1
- package/dist/types/src/runtime/index.d.ts +0 -3
- package/dist/types/src/runtime/index.d.ts.map +0 -1
- package/dist/types/src/runtime/scheduler.d.ts +0 -34
- package/dist/types/src/runtime/scheduler.d.ts.map +0 -1
- package/dist/types/src/runtime/scheduler.test.d.ts +0 -2
- package/dist/types/src/runtime/scheduler.test.d.ts.map +0 -1
- package/dist/types/src/testing/functions-integration.test.d.ts +0 -2
- package/dist/types/src/testing/functions-integration.test.d.ts.map +0 -1
- package/dist/types/src/testing/index.d.ts +0 -5
- package/dist/types/src/testing/index.d.ts.map +0 -1
- package/dist/types/src/testing/manifest.d.ts +0 -3
- package/dist/types/src/testing/manifest.d.ts.map +0 -1
- package/dist/types/src/testing/plugin-init.d.ts +0 -6
- package/dist/types/src/testing/plugin-init.d.ts.map +0 -1
- package/dist/types/src/testing/setup.d.ts +0 -15
- package/dist/types/src/testing/setup.d.ts.map +0 -1
- package/dist/types/src/testing/test/handler.d.ts +0 -4
- package/dist/types/src/testing/test/handler.d.ts.map +0 -1
- package/dist/types/src/testing/test/index.d.ts +0 -3
- package/dist/types/src/testing/test/index.d.ts.map +0 -1
- package/dist/types/src/testing/types.d.ts +0 -10
- package/dist/types/src/testing/types.d.ts.map +0 -1
- package/dist/types/src/testing/util.d.ts +0 -5
- package/dist/types/src/testing/util.d.ts.map +0 -1
- package/dist/types/src/trigger/index.d.ts +0 -3
- package/dist/types/src/trigger/index.d.ts.map +0 -1
- package/dist/types/src/trigger/trigger-registry.d.ts +0 -38
- package/dist/types/src/trigger/trigger-registry.d.ts.map +0 -1
- package/dist/types/src/trigger/trigger-registry.test.d.ts +0 -2
- package/dist/types/src/trigger/trigger-registry.test.d.ts.map +0 -1
- package/dist/types/src/trigger/type/index.d.ts +0 -3
- package/dist/types/src/trigger/type/index.d.ts.map +0 -1
- package/dist/types/src/trigger/type/subscription-trigger.d.ts +0 -4
- package/dist/types/src/trigger/type/subscription-trigger.d.ts.map +0 -1
- package/dist/types/src/trigger/type/timer-trigger.d.ts +0 -4
- package/dist/types/src/trigger/type/timer-trigger.d.ts.map +0 -1
- package/dist/types/src/trigger/type/webhook-trigger.d.ts +0 -4
- package/dist/types/src/trigger/type/webhook-trigger.d.ts.map +0 -1
- package/dist/types/src/types/index.d.ts +0 -5
- package/dist/types/src/types/index.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -53
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/dist/types/src/types/trace.d.ts +0 -146
- package/dist/types/src/types/trace.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/dist/types/src/types/url.d.ts.map +0 -1
- package/dist/types/tools/schema.d.ts +0 -2
- package/dist/types/tools/schema.d.ts.map +0 -1
- package/schema/functions.json +0 -211
- package/src/browser/index.ts +0 -5
- package/src/function/function-registry.test.ts +0 -118
- package/src/function/function-registry.ts +0 -104
- package/src/function/index.ts +0 -5
- package/src/runtime/dev-server.test.ts +0 -79
- package/src/runtime/dev-server.ts +0 -240
- package/src/runtime/index.ts +0 -6
- package/src/runtime/scheduler.test.ts +0 -152
- package/src/runtime/scheduler.ts +0 -170
- package/src/testing/functions-integration.test.ts +0 -65
- package/src/testing/index.ts +0 -8
- package/src/testing/manifest.ts +0 -15
- package/src/testing/plugin-init.ts +0 -20
- package/src/testing/setup.ts +0 -109
- package/src/testing/test/handler.ts +0 -15
- package/src/testing/test/index.ts +0 -7
- package/src/testing/types.ts +0 -9
- package/src/testing/util.ts +0 -26
- package/src/trigger/index.ts +0 -6
- package/src/trigger/trigger-registry.test.ts +0 -278
- package/src/trigger/trigger-registry.ts +0 -218
- package/src/trigger/type/index.ts +0 -7
- package/src/trigger/type/subscription-trigger.ts +0 -84
- package/src/trigger/type/timer-trigger.ts +0 -48
- package/src/trigger/type/webhook-trigger.ts +0 -48
- package/src/types/index.ts +0 -8
- package/src/types/schema.ts +0 -46
- package/src/types/types.ts +0 -163
|
@@ -1,358 +0,0 @@
|
|
|
1
|
-
import "@dxos/node-std/globals";
|
|
2
|
-
|
|
3
|
-
// packages/core/functions/src/types/schema.ts
|
|
4
|
-
import { EchoObject, JsonSchemaType, LabelAnnotationId, Ref, S, TypedObject } from "@dxos/echo-schema";
|
|
5
|
-
import { TextType } from "@dxos/schema";
|
|
6
|
-
var ScriptType = S.Struct({
|
|
7
|
-
name: S.optional(S.String),
|
|
8
|
-
description: S.optional(S.String),
|
|
9
|
-
// TODO(burdon): Change to hash of deployed content.
|
|
10
|
-
// Whether source has changed since last deploy.
|
|
11
|
-
changed: S.optional(S.Boolean),
|
|
12
|
-
source: Ref(TextType)
|
|
13
|
-
}).annotations({
|
|
14
|
-
[LabelAnnotationId]: "name"
|
|
15
|
-
}).pipe(EchoObject({
|
|
16
|
-
typename: "dxos.org/type/Script",
|
|
17
|
-
version: "0.1.0"
|
|
18
|
-
}));
|
|
19
|
-
var FunctionType = class extends TypedObject({
|
|
20
|
-
typename: "dxos.org/type/Function",
|
|
21
|
-
version: "0.1.0"
|
|
22
|
-
})({
|
|
23
|
-
// TODO(burdon): Rename to id/uri?
|
|
24
|
-
name: S.NonEmptyString,
|
|
25
|
-
version: S.String,
|
|
26
|
-
description: S.optional(S.String),
|
|
27
|
-
// Reference to a source script if it exists within ECHO.
|
|
28
|
-
// TODO(burdon): Don't ref ScriptType directly (core).
|
|
29
|
-
source: S.optional(Ref(ScriptType)),
|
|
30
|
-
inputSchema: S.optional(JsonSchemaType),
|
|
31
|
-
outputSchema: S.optional(JsonSchemaType),
|
|
32
|
-
// Local binding to a function name.
|
|
33
|
-
binding: S.optional(S.String)
|
|
34
|
-
}) {
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
// packages/core/functions/src/types/types.ts
|
|
38
|
-
import { AST, OptionsAnnotationId, RawObject, S as S2, TypedObject as TypedObject2, DXN } from "@dxos/echo-schema";
|
|
39
|
-
var TriggerKind;
|
|
40
|
-
(function(TriggerKind2) {
|
|
41
|
-
TriggerKind2["Timer"] = "timer";
|
|
42
|
-
TriggerKind2["Webhook"] = "webhook";
|
|
43
|
-
TriggerKind2["Subscription"] = "subscription";
|
|
44
|
-
TriggerKind2["Email"] = "email";
|
|
45
|
-
TriggerKind2["Queue"] = "queue";
|
|
46
|
-
})(TriggerKind || (TriggerKind = {}));
|
|
47
|
-
var typeLiteralAnnotations = {
|
|
48
|
-
[AST.TitleAnnotationId]: "Type"
|
|
49
|
-
};
|
|
50
|
-
var TimerTriggerSchema = S2.Struct({
|
|
51
|
-
type: S2.Literal("timer").annotations(typeLiteralAnnotations),
|
|
52
|
-
cron: S2.String.annotations({
|
|
53
|
-
[AST.TitleAnnotationId]: "Cron",
|
|
54
|
-
[AST.ExamplesAnnotationId]: [
|
|
55
|
-
"0 0 * * *"
|
|
56
|
-
]
|
|
57
|
-
})
|
|
58
|
-
}).pipe(S2.mutable);
|
|
59
|
-
var EmailTriggerSchema = S2.Struct({
|
|
60
|
-
type: S2.Literal("email").annotations(typeLiteralAnnotations)
|
|
61
|
-
}).pipe(S2.mutable);
|
|
62
|
-
var QueueTriggerSchema = S2.Struct({
|
|
63
|
-
type: S2.Literal("queue").annotations(typeLiteralAnnotations),
|
|
64
|
-
queue: DXN
|
|
65
|
-
}).pipe(S2.mutable);
|
|
66
|
-
var WebhookTriggerSchema = S2.Struct({
|
|
67
|
-
type: S2.Literal("webhook").annotations(typeLiteralAnnotations),
|
|
68
|
-
method: S2.optional(S2.String.annotations({
|
|
69
|
-
[AST.TitleAnnotationId]: "Method",
|
|
70
|
-
[OptionsAnnotationId]: [
|
|
71
|
-
"GET",
|
|
72
|
-
"POST"
|
|
73
|
-
]
|
|
74
|
-
})),
|
|
75
|
-
port: S2.optional(S2.Number.annotations({
|
|
76
|
-
[AST.TitleAnnotationId]: "Port"
|
|
77
|
-
}))
|
|
78
|
-
}).pipe(S2.mutable);
|
|
79
|
-
var QuerySchema = S2.Struct({
|
|
80
|
-
type: S2.optional(S2.String.annotations({
|
|
81
|
-
[AST.TitleAnnotationId]: "Type"
|
|
82
|
-
})),
|
|
83
|
-
props: S2.optional(S2.Record({
|
|
84
|
-
key: S2.String,
|
|
85
|
-
value: S2.Any
|
|
86
|
-
}))
|
|
87
|
-
}).annotations({
|
|
88
|
-
[AST.TitleAnnotationId]: "Query"
|
|
89
|
-
});
|
|
90
|
-
var SubscriptionTriggerSchema = S2.Struct({
|
|
91
|
-
type: S2.Literal("subscription").annotations(typeLiteralAnnotations),
|
|
92
|
-
// TODO(burdon): Define query DSL (from ECHO). Reconcile with Table.Query.
|
|
93
|
-
filter: QuerySchema,
|
|
94
|
-
options: S2.optional(S2.Struct({
|
|
95
|
-
// Watch changes to object (not just creation).
|
|
96
|
-
deep: S2.optional(S2.Boolean.annotations({
|
|
97
|
-
[AST.TitleAnnotationId]: "Nested"
|
|
98
|
-
})),
|
|
99
|
-
// Debounce changes (delay in ms).
|
|
100
|
-
delay: S2.optional(S2.Number.annotations({
|
|
101
|
-
[AST.TitleAnnotationId]: "Delay"
|
|
102
|
-
}))
|
|
103
|
-
}).annotations({
|
|
104
|
-
[AST.TitleAnnotationId]: "Options"
|
|
105
|
-
}))
|
|
106
|
-
}).pipe(S2.mutable);
|
|
107
|
-
var TriggerSchema = S2.Union(TimerTriggerSchema, WebhookTriggerSchema, SubscriptionTriggerSchema, EmailTriggerSchema, QueueTriggerSchema).annotations({
|
|
108
|
-
[AST.TitleAnnotationId]: "Trigger"
|
|
109
|
-
});
|
|
110
|
-
var FunctionTriggerSchema = S2.Struct({
|
|
111
|
-
// TODO(burdon): What type does this reference.
|
|
112
|
-
// TODO(wittjosiah): This should probably be a Ref?
|
|
113
|
-
function: S2.optional(S2.String.annotations({
|
|
114
|
-
[AST.TitleAnnotationId]: "Function"
|
|
115
|
-
})),
|
|
116
|
-
enabled: S2.optional(S2.Boolean.annotations({
|
|
117
|
-
[AST.TitleAnnotationId]: "Enabled"
|
|
118
|
-
})),
|
|
119
|
-
// TODO(burdon): Flatten entire schema.
|
|
120
|
-
spec: S2.optional(TriggerSchema),
|
|
121
|
-
// TODO(burdon): Get schema as partial from function.
|
|
122
|
-
// TODO(wittjosiah): Rename to payload.
|
|
123
|
-
// The `meta` property is merged into the event data passed to the function.
|
|
124
|
-
meta: S2.optional(S2.mutable(S2.Record({
|
|
125
|
-
key: S2.String,
|
|
126
|
-
value: S2.Any
|
|
127
|
-
})))
|
|
128
|
-
});
|
|
129
|
-
var FunctionTrigger = class extends TypedObject2({
|
|
130
|
-
typename: "dxos.org/type/FunctionTrigger",
|
|
131
|
-
version: "0.1.0"
|
|
132
|
-
})(FunctionTriggerSchema.fields) {
|
|
133
|
-
};
|
|
134
|
-
var FunctionDef = class extends TypedObject2({
|
|
135
|
-
typename: "dxos.org/type/FunctionDef",
|
|
136
|
-
version: "0.1.0"
|
|
137
|
-
})({
|
|
138
|
-
uri: S2.String,
|
|
139
|
-
description: S2.optional(S2.String),
|
|
140
|
-
route: S2.String,
|
|
141
|
-
handler: S2.String
|
|
142
|
-
}) {
|
|
143
|
-
};
|
|
144
|
-
var FunctionManifestSchema = S2.Struct({
|
|
145
|
-
functions: S2.optional(S2.mutable(S2.Array(RawObject(FunctionDef)))),
|
|
146
|
-
triggers: S2.optional(S2.mutable(S2.Array(RawObject(FunctionTrigger))))
|
|
147
|
-
});
|
|
148
|
-
var FUNCTION_TYPES = [
|
|
149
|
-
FunctionDef,
|
|
150
|
-
FunctionTrigger
|
|
151
|
-
];
|
|
152
|
-
|
|
153
|
-
// packages/core/functions/src/types/trace.ts
|
|
154
|
-
import { EchoObject as EchoObject2, Expando, ObjectId, Ref as Ref2, S as S3 } from "@dxos/echo-schema";
|
|
155
|
-
import { log } from "@dxos/log";
|
|
156
|
-
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/core/functions/src/types/trace.ts";
|
|
157
|
-
var InvocationOutcome;
|
|
158
|
-
(function(InvocationOutcome2) {
|
|
159
|
-
InvocationOutcome2["SUCCESS"] = "success";
|
|
160
|
-
InvocationOutcome2["FAILURE"] = "failure";
|
|
161
|
-
InvocationOutcome2["PENDING"] = "pending";
|
|
162
|
-
})(InvocationOutcome || (InvocationOutcome = {}));
|
|
163
|
-
var InvocationTraceEventType;
|
|
164
|
-
(function(InvocationTraceEventType2) {
|
|
165
|
-
InvocationTraceEventType2["START"] = "start";
|
|
166
|
-
InvocationTraceEventType2["END"] = "end";
|
|
167
|
-
})(InvocationTraceEventType || (InvocationTraceEventType = {}));
|
|
168
|
-
var TraceEventException = S3.Struct({
|
|
169
|
-
timestampMs: S3.Number,
|
|
170
|
-
message: S3.String,
|
|
171
|
-
name: S3.String,
|
|
172
|
-
stack: S3.optional(S3.String)
|
|
173
|
-
});
|
|
174
|
-
var InvocationTraceStartEvent = S3.Struct({
|
|
175
|
-
/**
|
|
176
|
-
* Queue message id.
|
|
177
|
-
*/
|
|
178
|
-
id: ObjectId,
|
|
179
|
-
type: S3.Literal("start"),
|
|
180
|
-
/**
|
|
181
|
-
* Invocation id, the same for invocation start and end events.
|
|
182
|
-
*/
|
|
183
|
-
invocationId: ObjectId,
|
|
184
|
-
/**
|
|
185
|
-
* Event generation time.
|
|
186
|
-
*/
|
|
187
|
-
timestampMs: S3.Number,
|
|
188
|
-
/**
|
|
189
|
-
* Data passed to function / workflow as an argument.
|
|
190
|
-
*/
|
|
191
|
-
// TODO(burdon): Input schema?
|
|
192
|
-
input: S3.Object,
|
|
193
|
-
/**
|
|
194
|
-
* Queue DXN for function/workflow invocation events.
|
|
195
|
-
*/
|
|
196
|
-
// TODO(burdon): Need reference type for queue. vs. string?
|
|
197
|
-
invocationTraceQueue: Ref2(Expando),
|
|
198
|
-
/**
|
|
199
|
-
* DXN of the invoked function/workflow.
|
|
200
|
-
*/
|
|
201
|
-
invocationTarget: Ref2(Expando),
|
|
202
|
-
/**
|
|
203
|
-
* Present for automatic invocations.
|
|
204
|
-
*/
|
|
205
|
-
trigger: S3.optional(Ref2(FunctionTrigger))
|
|
206
|
-
}).pipe(EchoObject2({
|
|
207
|
-
typename: "dxos.org/type/InvocationTraceStart",
|
|
208
|
-
version: "0.1.0"
|
|
209
|
-
}));
|
|
210
|
-
var InvocationTraceEndEvent = S3.Struct({
|
|
211
|
-
/**
|
|
212
|
-
* Trace event id.
|
|
213
|
-
*/
|
|
214
|
-
id: ObjectId,
|
|
215
|
-
type: S3.Literal("end"),
|
|
216
|
-
/**
|
|
217
|
-
* Invocation id, will be the same for invocation start and end.
|
|
218
|
-
*/
|
|
219
|
-
invocationId: ObjectId,
|
|
220
|
-
/**
|
|
221
|
-
* Event generation time.
|
|
222
|
-
*/
|
|
223
|
-
// TODO(burdon): Remove ms suffix.
|
|
224
|
-
timestampMs: S3.Number,
|
|
225
|
-
outcome: S3.Enums(InvocationOutcome),
|
|
226
|
-
exception: S3.optional(TraceEventException)
|
|
227
|
-
}).pipe(EchoObject2({
|
|
228
|
-
typename: "dxos.org/type/InvocationTraceEnd",
|
|
229
|
-
version: "0.1.0"
|
|
230
|
-
}));
|
|
231
|
-
var TraceEventLog = S3.Struct({
|
|
232
|
-
timestampMs: S3.Number,
|
|
233
|
-
level: S3.String,
|
|
234
|
-
message: S3.String,
|
|
235
|
-
context: S3.optional(S3.Object)
|
|
236
|
-
});
|
|
237
|
-
var TraceEvent = S3.Struct({
|
|
238
|
-
id: ObjectId,
|
|
239
|
-
// TODO(burdon): Need enum/numeric result (not string).
|
|
240
|
-
outcome: S3.String,
|
|
241
|
-
truncated: S3.Boolean,
|
|
242
|
-
/**
|
|
243
|
-
* Time when the event was persisted.
|
|
244
|
-
*/
|
|
245
|
-
ingestionTimestampMs: S3.Number,
|
|
246
|
-
logs: S3.Array(TraceEventLog),
|
|
247
|
-
exceptions: S3.Array(TraceEventException)
|
|
248
|
-
}).pipe(EchoObject2({
|
|
249
|
-
typename: "dxos.org/type/TraceEvent",
|
|
250
|
-
version: "0.1.0"
|
|
251
|
-
}));
|
|
252
|
-
var createInvocationSpans = (items) => {
|
|
253
|
-
if (!items) {
|
|
254
|
-
return [];
|
|
255
|
-
}
|
|
256
|
-
const eventsByInvocationId = /* @__PURE__ */ new Map();
|
|
257
|
-
for (const event of items) {
|
|
258
|
-
if (!("invocationId" in event)) {
|
|
259
|
-
continue;
|
|
260
|
-
}
|
|
261
|
-
const invocationId = event.invocationId;
|
|
262
|
-
const entry = eventsByInvocationId.get(invocationId) || {
|
|
263
|
-
start: void 0,
|
|
264
|
-
end: void 0
|
|
265
|
-
};
|
|
266
|
-
if (event.type === "start") {
|
|
267
|
-
entry.start = event;
|
|
268
|
-
} else if (event.type === "end") {
|
|
269
|
-
entry.end = event;
|
|
270
|
-
}
|
|
271
|
-
eventsByInvocationId.set(invocationId, entry);
|
|
272
|
-
}
|
|
273
|
-
const now = Date.now();
|
|
274
|
-
const result = [];
|
|
275
|
-
for (const [invocationId, { start, end }] of eventsByInvocationId.entries()) {
|
|
276
|
-
if (!start) {
|
|
277
|
-
log.warn("found end event without matching start", {
|
|
278
|
-
invocationId
|
|
279
|
-
}, {
|
|
280
|
-
F: __dxlog_file,
|
|
281
|
-
L: 158,
|
|
282
|
-
S: void 0,
|
|
283
|
-
C: (f, a) => f(...a)
|
|
284
|
-
});
|
|
285
|
-
continue;
|
|
286
|
-
}
|
|
287
|
-
const isInProgress = end === void 0;
|
|
288
|
-
result.push({
|
|
289
|
-
id: invocationId,
|
|
290
|
-
timestampMs: start.timestampMs,
|
|
291
|
-
durationMs: isInProgress ? now - start.timestampMs : end.timestampMs - start.timestampMs,
|
|
292
|
-
outcome: end?.outcome ?? "pending",
|
|
293
|
-
exception: end?.exception,
|
|
294
|
-
input: start.input,
|
|
295
|
-
invocationTraceQueue: start.invocationTraceQueue,
|
|
296
|
-
invocationTarget: start.invocationTarget,
|
|
297
|
-
trigger: start.trigger
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
|
-
return result;
|
|
301
|
-
};
|
|
302
|
-
|
|
303
|
-
// packages/core/functions/src/types/url.ts
|
|
304
|
-
var FUNCTIONS_META_KEY = "dxos.org/service/function";
|
|
305
|
-
var FUNCTIONS_PRESET_META_KEY = "dxos.org/service/function-preset";
|
|
306
|
-
var isSecure = (protocol) => {
|
|
307
|
-
return protocol === "https:" || protocol === "wss:";
|
|
308
|
-
};
|
|
309
|
-
var getUserFunctionUrlInMetadata = (meta) => {
|
|
310
|
-
return meta.keys.find((key) => key.source === FUNCTIONS_META_KEY)?.id;
|
|
311
|
-
};
|
|
312
|
-
var setUserFunctionUrlInMetadata = (meta, functionUrl) => {
|
|
313
|
-
const key = meta.keys.find((key2) => key2.source === FUNCTIONS_META_KEY);
|
|
314
|
-
if (key) {
|
|
315
|
-
if (key.id !== functionUrl) {
|
|
316
|
-
throw new Error("Metadata mismatch");
|
|
317
|
-
}
|
|
318
|
-
} else {
|
|
319
|
-
meta.keys.push({
|
|
320
|
-
source: FUNCTIONS_META_KEY,
|
|
321
|
-
id: functionUrl
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
};
|
|
325
|
-
var getInvocationUrl = (functionUrl, edgeUrl, options = {}) => {
|
|
326
|
-
const baseUrl = new URL("functions/", edgeUrl);
|
|
327
|
-
const relativeUrl = functionUrl.replace(/^\//, "");
|
|
328
|
-
const url = new URL(`./${relativeUrl}`, baseUrl.toString());
|
|
329
|
-
options.spaceId && url.searchParams.set("spaceId", options.spaceId);
|
|
330
|
-
options.subjectId && url.searchParams.set("subjectId", options.subjectId);
|
|
331
|
-
url.protocol = isSecure(url.protocol) ? "https" : "http";
|
|
332
|
-
return url.toString();
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
export {
|
|
336
|
-
ScriptType,
|
|
337
|
-
FunctionType,
|
|
338
|
-
TriggerKind,
|
|
339
|
-
TriggerSchema,
|
|
340
|
-
FunctionTriggerSchema,
|
|
341
|
-
FunctionTrigger,
|
|
342
|
-
FunctionDef,
|
|
343
|
-
FunctionManifestSchema,
|
|
344
|
-
FUNCTION_TYPES,
|
|
345
|
-
InvocationOutcome,
|
|
346
|
-
InvocationTraceEventType,
|
|
347
|
-
TraceEventException,
|
|
348
|
-
InvocationTraceStartEvent,
|
|
349
|
-
InvocationTraceEndEvent,
|
|
350
|
-
TraceEventLog,
|
|
351
|
-
TraceEvent,
|
|
352
|
-
createInvocationSpans,
|
|
353
|
-
FUNCTIONS_PRESET_META_KEY,
|
|
354
|
-
getUserFunctionUrlInMetadata,
|
|
355
|
-
setUserFunctionUrlInMetadata,
|
|
356
|
-
getInvocationUrl
|
|
357
|
-
};
|
|
358
|
-
//# sourceMappingURL=chunk-RVSG6WTL.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/schema.ts", "../../../src/types/types.ts", "../../../src/types/trace.ts", "../../../src/types/url.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { EchoObject, JsonSchemaType, LabelAnnotationId, Ref, S, TypedObject } from '@dxos/echo-schema';\nimport { TextType } from '@dxos/schema';\n\n/**\n * Source script.\n */\nexport const ScriptType = S.Struct({\n name: S.optional(S.String),\n description: S.optional(S.String),\n // TODO(burdon): Change to hash of deployed content.\n // Whether source has changed since last deploy.\n changed: S.optional(S.Boolean),\n source: Ref(TextType),\n})\n .annotations({ [LabelAnnotationId]: 'name' })\n .pipe(EchoObject({ typename: 'dxos.org/type/Script', version: '0.1.0' }));\n\nexport type ScriptType = S.Schema.Type<typeof ScriptType>;\n\n/**\n * Function deployment.\n */\nexport class FunctionType extends TypedObject({\n typename: 'dxos.org/type/Function',\n version: '0.1.0',\n})({\n // TODO(burdon): Rename to id/uri?\n name: S.NonEmptyString,\n version: S.String,\n\n description: S.optional(S.String),\n\n // Reference to a source script if it exists within ECHO.\n // TODO(burdon): Don't ref ScriptType directly (core).\n source: S.optional(Ref(ScriptType)),\n\n inputSchema: S.optional(JsonSchemaType),\n outputSchema: S.optional(JsonSchemaType),\n\n // Local binding to a function name.\n binding: S.optional(S.String),\n}) {}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { AST, OptionsAnnotationId, RawObject, S, TypedObject, DXN } from '@dxos/echo-schema';\n\n/**\n * Type discriminator for TriggerType.\n * Every spec has a type field of type TriggerKind that we can use to understand which type we're working with.\n * https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions\n */\nexport enum TriggerKind {\n Timer = 'timer',\n Webhook = 'webhook',\n Subscription = 'subscription',\n Email = 'email',\n Queue = 'queue',\n}\n\n// TODO(burdon): Rename prop kind.\nconst typeLiteralAnnotations = { [AST.TitleAnnotationId]: 'Type' };\n\n/**\n * Cron timer.\n */\nconst TimerTriggerSchema = S.Struct({\n type: S.Literal(TriggerKind.Timer).annotations(typeLiteralAnnotations),\n cron: S.String.annotations({\n [AST.TitleAnnotationId]: 'Cron',\n [AST.ExamplesAnnotationId]: ['0 0 * * *'],\n }),\n}).pipe(S.mutable);\n\nexport type TimerTrigger = S.Schema.Type<typeof TimerTriggerSchema>;\n\nconst EmailTriggerSchema = S.Struct({\n type: S.Literal(TriggerKind.Email).annotations(typeLiteralAnnotations),\n}).pipe(S.mutable);\n\nexport type EmailTrigger = S.Schema.Type<typeof EmailTriggerSchema>;\n\nconst QueueTriggerSchema = S.Struct({\n type: S.Literal(TriggerKind.Queue).annotations(typeLiteralAnnotations),\n queue: DXN,\n}).pipe(S.mutable);\n\nexport type QueueTrigger = S.Schema.Type<typeof QueueTriggerSchema>;\n\n/**\n * Webhook.\n */\nconst WebhookTriggerSchema = S.Struct({\n type: S.Literal(TriggerKind.Webhook).annotations(typeLiteralAnnotations),\n method: S.optional(\n S.String.annotations({\n [AST.TitleAnnotationId]: 'Method',\n [OptionsAnnotationId]: ['GET', 'POST'],\n }),\n ),\n port: S.optional(\n S.Number.annotations({\n [AST.TitleAnnotationId]: 'Port',\n }),\n ),\n}).pipe(S.mutable);\n\nexport type WebhookTrigger = S.Schema.Type<typeof WebhookTriggerSchema>;\n\n// TODO(burdon): Use ECHO definition (from https://github.com/dxos/dxos/pull/8233).\nconst QuerySchema = S.Struct({\n type: S.optional(S.String.annotations({ [AST.TitleAnnotationId]: 'Type' })),\n props: S.optional(S.Record({ key: S.String, value: S.Any })),\n}).annotations({ [AST.TitleAnnotationId]: 'Query' });\n\n/**\n * Subscription.\n */\nconst SubscriptionTriggerSchema = S.Struct({\n type: S.Literal(TriggerKind.Subscription).annotations(typeLiteralAnnotations),\n // TODO(burdon): Define query DSL (from ECHO). Reconcile with Table.Query.\n filter: QuerySchema,\n options: S.optional(\n S.Struct({\n // Watch changes to object (not just creation).\n deep: S.optional(S.Boolean.annotations({ [AST.TitleAnnotationId]: 'Nested' })),\n // Debounce changes (delay in ms).\n delay: S.optional(S.Number.annotations({ [AST.TitleAnnotationId]: 'Delay' })),\n }).annotations({ [AST.TitleAnnotationId]: 'Options' }),\n ),\n}).pipe(S.mutable);\n\nexport type SubscriptionTrigger = S.Schema.Type<typeof SubscriptionTriggerSchema>;\n\n/**\n * Trigger schema (discriminated union).\n */\nexport const TriggerSchema = S.Union(\n TimerTriggerSchema,\n WebhookTriggerSchema,\n SubscriptionTriggerSchema,\n EmailTriggerSchema,\n QueueTriggerSchema,\n).annotations({\n [AST.TitleAnnotationId]: 'Trigger',\n});\n\nexport type TriggerType = S.Schema.Type<typeof TriggerSchema>;\n\n/**\n * Function trigger.\n */\nexport const FunctionTriggerSchema = S.Struct({\n // TODO(burdon): What type does this reference.\n // TODO(wittjosiah): This should probably be a Ref?\n function: S.optional(S.String.annotations({ [AST.TitleAnnotationId]: 'Function' })),\n\n enabled: S.optional(S.Boolean.annotations({ [AST.TitleAnnotationId]: 'Enabled' })),\n\n // TODO(burdon): Flatten entire schema.\n spec: S.optional(TriggerSchema),\n\n // TODO(burdon): Get schema as partial from function.\n // TODO(wittjosiah): Rename to payload.\n // The `meta` property is merged into the event data passed to the function.\n meta: S.optional(S.mutable(S.Record({ key: S.String, value: S.Any }))),\n});\n\nexport type FunctionTriggerType = S.Schema.Type<typeof FunctionTriggerSchema>;\n\n/**\n * Function trigger.\n */\nexport class FunctionTrigger extends TypedObject({\n typename: 'dxos.org/type/FunctionTrigger',\n version: '0.1.0',\n})(FunctionTriggerSchema.fields) {}\n\n/**\n * Function definition.\n * @deprecated (Use dxos.org/type/Function)\n */\n// TODO(burdon): Reconcile with FunctionType.\nexport class FunctionDef extends TypedObject({\n typename: 'dxos.org/type/FunctionDef',\n version: '0.1.0',\n})({\n uri: S.String,\n description: S.optional(S.String),\n route: S.String,\n handler: S.String,\n}) {}\n\n/**\n * Function manifest file.\n */\nexport const FunctionManifestSchema = S.Struct({\n functions: S.optional(S.mutable(S.Array(RawObject(FunctionDef)))),\n triggers: S.optional(S.mutable(S.Array(RawObject(FunctionTrigger)))),\n});\n\nexport type FunctionManifest = S.Schema.Type<typeof FunctionManifestSchema>;\n\nexport const FUNCTION_TYPES = [FunctionDef, FunctionTrigger];\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { EchoObject, Expando, ObjectId, Ref, S } from '@dxos/echo-schema';\nimport { log } from '@dxos/log';\n\nimport { FunctionTrigger, type FunctionTriggerType } from './types';\n\nexport enum InvocationOutcome {\n SUCCESS = 'success',\n FAILURE = 'failure',\n PENDING = 'pending',\n}\n\n// TODO(burdon): Convert to extensible discriminated union of EDGE events.\nexport enum InvocationTraceEventType {\n START = 'start',\n END = 'end',\n}\n\nexport const TraceEventException = S.Struct({\n timestampMs: S.Number,\n message: S.String,\n name: S.String,\n stack: S.optional(S.String),\n});\nexport type TraceEventException = S.Schema.Type<typeof TraceEventException>;\n\nexport const InvocationTraceStartEvent = S.Struct({\n /**\n * Queue message id.\n */\n id: ObjectId,\n type: S.Literal(InvocationTraceEventType.START),\n /**\n * Invocation id, the same for invocation start and end events.\n */\n invocationId: ObjectId,\n /**\n * Event generation time.\n */\n timestampMs: S.Number,\n /**\n * Data passed to function / workflow as an argument.\n */\n // TODO(burdon): Input schema?\n input: S.Object,\n /**\n * Queue DXN for function/workflow invocation events.\n */\n // TODO(burdon): Need reference type for queue. vs. string?\n invocationTraceQueue: Ref(Expando),\n /**\n * DXN of the invoked function/workflow.\n */\n invocationTarget: Ref(Expando),\n /**\n * Present for automatic invocations.\n */\n trigger: S.optional(Ref(FunctionTrigger)),\n}).pipe(EchoObject({ typename: 'dxos.org/type/InvocationTraceStart', version: '0.1.0' }));\n\nexport type InvocationTraceStartEvent = S.Schema.Type<typeof InvocationTraceStartEvent>;\n\nexport const InvocationTraceEndEvent = S.Struct({\n /**\n * Trace event id.\n */\n id: ObjectId,\n type: S.Literal(InvocationTraceEventType.END),\n /**\n * Invocation id, will be the same for invocation start and end.\n */\n invocationId: ObjectId,\n /**\n * Event generation time.\n */\n // TODO(burdon): Remove ms suffix.\n timestampMs: S.Number,\n outcome: S.Enums(InvocationOutcome),\n exception: S.optional(TraceEventException),\n}).pipe(EchoObject({ typename: 'dxos.org/type/InvocationTraceEnd', version: '0.1.0' }));\n\nexport type InvocationTraceEndEvent = S.Schema.Type<typeof InvocationTraceEndEvent>;\n\nexport type InvocationTraceEvent = InvocationTraceStartEvent | InvocationTraceEndEvent;\n\nexport const TraceEventLog = S.Struct({\n timestampMs: S.Number,\n level: S.String,\n message: S.String,\n context: S.optional(S.Object),\n});\n\nexport const TraceEvent = S.Struct({\n id: ObjectId,\n // TODO(burdon): Need enum/numeric result (not string).\n outcome: S.String,\n truncated: S.Boolean,\n /**\n * Time when the event was persisted.\n */\n ingestionTimestampMs: S.Number,\n logs: S.Array(TraceEventLog),\n exceptions: S.Array(TraceEventException),\n}).pipe(EchoObject({ typename: 'dxos.org/type/TraceEvent', version: '0.1.0' }));\n\nexport type TraceEvent = S.Schema.Type<typeof TraceEvent>;\n\n/**\n * Deprecated InvocationTrace event format.\n * @deprecated\n */\n// TODO(burdon): Remove.\nexport type InvocationSpan = {\n id: string;\n timestampMs: number;\n outcome: InvocationOutcome;\n input: object;\n durationMs: number;\n invocationTraceQueue: Ref<Expando>;\n invocationTarget: Ref<Expando>;\n trigger?: Ref<FunctionTriggerType>;\n exception?: TraceEventException;\n};\n\nexport const createInvocationSpans = (items?: InvocationTraceEvent[]): InvocationSpan[] => {\n if (!items) {\n return [];\n }\n\n const eventsByInvocationId = new Map<string, { start?: InvocationTraceStartEvent; end?: InvocationTraceEndEvent }>();\n for (const event of items) {\n if (!('invocationId' in event)) {\n // Skip legacy format entries.\n continue;\n }\n\n const invocationId = event.invocationId;\n const entry = eventsByInvocationId.get(invocationId) || { start: undefined, end: undefined };\n if (event.type === InvocationTraceEventType.START) {\n entry.start = event as InvocationTraceStartEvent;\n } else if (event.type === InvocationTraceEventType.END) {\n entry.end = event as InvocationTraceEndEvent;\n }\n\n eventsByInvocationId.set(invocationId, entry);\n }\n\n const now = Date.now();\n const result: InvocationSpan[] = [];\n\n // Create spans for each invocation\n for (const [invocationId, { start, end }] of eventsByInvocationId.entries()) {\n if (!start) {\n // No start event, can't create a meaningful span\n log.warn('found end event without matching start', { invocationId });\n continue;\n }\n\n const isInProgress = end === undefined;\n\n result.push({\n id: invocationId,\n timestampMs: start.timestampMs,\n durationMs: isInProgress ? now - start.timestampMs : end!.timestampMs - start.timestampMs,\n outcome: end?.outcome ?? InvocationOutcome.PENDING,\n exception: end?.exception,\n input: start.input,\n invocationTraceQueue: start.invocationTraceQueue,\n invocationTarget: start.invocationTarget,\n trigger: start.trigger,\n });\n }\n\n return result;\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ObjectMeta } from '@dxos/echo-schema';\nimport { type SpaceId } from '@dxos/keys';\n\n// TODO: use URL scheme for source?\nconst FUNCTIONS_META_KEY = 'dxos.org/service/function';\n\nexport const FUNCTIONS_PRESET_META_KEY = 'dxos.org/service/function-preset';\n\nconst isSecure = (protocol: string) => {\n return protocol === 'https:' || protocol === 'wss:';\n};\n\nexport const getUserFunctionUrlInMetadata = (meta: ObjectMeta) => {\n return meta.keys.find((key) => key.source === FUNCTIONS_META_KEY)?.id;\n};\n\nexport const setUserFunctionUrlInMetadata = (meta: ObjectMeta, functionUrl: string) => {\n const key = meta.keys.find((key) => key.source === FUNCTIONS_META_KEY);\n if (key) {\n if (key.id !== functionUrl) {\n throw new Error('Metadata mismatch');\n }\n } else {\n meta.keys.push({ source: FUNCTIONS_META_KEY, id: functionUrl });\n }\n};\n\nexport const getInvocationUrl = (functionUrl: string, edgeUrl: string, options: InvocationOptions = {}) => {\n const baseUrl = new URL('functions/', edgeUrl);\n\n // Leading slashes cause the URL to be treated as an absolute path.\n const relativeUrl = functionUrl.replace(/^\\//, '');\n const url = new URL(`./${relativeUrl}`, baseUrl.toString());\n options.spaceId && url.searchParams.set('spaceId', options.spaceId);\n options.subjectId && url.searchParams.set('subjectId', options.subjectId);\n url.protocol = isSecure(url.protocol) ? 'https' : 'http';\n return url.toString();\n};\n\nexport type InvocationOptions = {\n spaceId?: SpaceId;\n subjectId?: string;\n};\n"],
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,YAAYC,gBAAgBC,mBAA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,SAAQ;AACrB;",
|
|
6
|
-
"names": ["EchoObject", "JsonSchemaType", "LabelAnnotationId", "Ref", "S", "TypedObject", "TextType", "ScriptType", "S", "Struct", "name", "optional", "String", "description", "changed", "Boolean", "source", "Ref", "TextType", "annotations", "LabelAnnotationId", "pipe", "EchoObject", "typename", "version", "FunctionType", "TypedObject", "NonEmptyString", "inputSchema", "JsonSchemaType", "outputSchema", "binding", "AST", "OptionsAnnotationId", "RawObject", "S", "TypedObject", "DXN", "TriggerKind", "typeLiteralAnnotations", "AST", "TitleAnnotationId", "TimerTriggerSchema", "S", "Struct", "type", "Literal", "annotations", "cron", "String", "ExamplesAnnotationId", "pipe", "mutable", "EmailTriggerSchema", "QueueTriggerSchema", "queue", "DXN", "WebhookTriggerSchema", "method", "optional", "OptionsAnnotationId", "port", "Number", "QuerySchema", "props", "Record", "key", "value", "Any", "SubscriptionTriggerSchema", "filter", "options", "deep", "Boolean", "delay", "TriggerSchema", "Union", "FunctionTriggerSchema", "function", "enabled", "spec", "meta", "FunctionTrigger", "TypedObject", "typename", "version", "fields", "FunctionDef", "uri", "description", "route", "handler", "FunctionManifestSchema", "functions", "Array", "RawObject", "triggers", "FUNCTION_TYPES", "EchoObject", "Expando", "ObjectId", "Ref", "S", "log", "InvocationOutcome", "InvocationTraceEventType", "TraceEventException", "S", "Struct", "timestampMs", "Number", "message", "String", "name", "stack", "optional", "InvocationTraceStartEvent", "id", "ObjectId", "type", "Literal", "invocationId", "input", "Object", "invocationTraceQueue", "Ref", "Expando", "invocationTarget", "trigger", "FunctionTrigger", "pipe", "EchoObject", "typename", "version", "InvocationTraceEndEvent", "outcome", "Enums", "exception", "TraceEventLog", "level", "context", "TraceEvent", "truncated", "Boolean", "ingestionTimestampMs", "logs", "Array", "exceptions", "createInvocationSpans", "items", "eventsByInvocationId", "Map", "event", "entry", "get", "start", "undefined", "end", "set", "now", "Date", "result", "entries", "log", "warn", "isInProgress", "push", "durationMs", "FUNCTIONS_META_KEY", "FUNCTIONS_PRESET_META_KEY", "isSecure", "protocol", "getUserFunctionUrlInMetadata", "meta", "keys", "find", "key", "source", "id", "setUserFunctionUrlInMetadata", "functionUrl", "Error", "push", "getInvocationUrl", "edgeUrl", "options", "baseUrl", "URL", "relativeUrl", "replace", "url", "toString", "spaceId", "searchParams", "set", "subjectId"]
|
|
7
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import "@dxos/node-std/globals";
|
|
2
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
3
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
4
|
-
}) : x)(function(x) {
|
|
5
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
6
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
export {
|
|
10
|
-
__require
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=chunk-XRCXIG74.mjs.map
|