@dxos/functions 0.8.4-main.5acf9ea → 0.8.4-main.5ea62a8
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 +54 -38
- package/dist/lib/browser/bundler/index.mjs.map +3 -3
- package/dist/lib/browser/chunk-7NQ77AIQ.mjs +618 -0
- package/dist/lib/browser/chunk-7NQ77AIQ.mjs.map +7 -0
- package/dist/lib/browser/edge/index.mjs +20 -8
- package/dist/lib/browser/edge/index.mjs.map +3 -3
- package/dist/lib/browser/index.mjs +141 -77
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +68 -5
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/bundler/index.mjs +54 -38
- package/dist/lib/node-esm/bundler/index.mjs.map +3 -3
- package/dist/lib/node-esm/chunk-KCGC6QQT.mjs +620 -0
- package/dist/lib/node-esm/chunk-KCGC6QQT.mjs.map +7 -0
- package/dist/lib/node-esm/edge/index.mjs +20 -8
- package/dist/lib/node-esm/edge/index.mjs.map +3 -3
- package/dist/lib/node-esm/index.mjs +141 -77
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +68 -5
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/types/src/bundler/bundler.d.ts +11 -12
- package/dist/types/src/bundler/bundler.d.ts.map +1 -1
- package/dist/types/src/edge/functions.d.ts +3 -2
- package/dist/types/src/edge/functions.d.ts.map +1 -1
- package/dist/types/src/errors.d.ts +10 -8
- package/dist/types/src/errors.d.ts.map +1 -1
- package/dist/types/src/examples/fib.d.ts +7 -0
- package/dist/types/src/examples/fib.d.ts.map +1 -0
- package/dist/types/src/examples/reply.d.ts +3 -0
- package/dist/types/src/examples/reply.d.ts.map +1 -0
- package/dist/types/src/examples/sleep.d.ts +5 -0
- package/dist/types/src/examples/sleep.d.ts.map +1 -0
- package/dist/types/src/executor/executor.d.ts +4 -1
- package/dist/types/src/executor/executor.d.ts.map +1 -1
- package/dist/types/src/handler.d.ts +10 -7
- package/dist/types/src/handler.d.ts.map +1 -1
- package/dist/types/src/schema.d.ts +7 -2
- package/dist/types/src/schema.d.ts.map +1 -1
- package/dist/types/src/services/credentials.d.ts +15 -3
- package/dist/types/src/services/credentials.d.ts.map +1 -1
- package/dist/types/src/services/database.d.ts +74 -6
- package/dist/types/src/services/database.d.ts.map +1 -1
- package/dist/types/src/services/event-logger.d.ts +1 -1
- package/dist/types/src/services/event-logger.d.ts.map +1 -1
- package/dist/types/src/services/local-function-execution.d.ts +2 -1
- package/dist/types/src/services/local-function-execution.d.ts.map +1 -1
- package/dist/types/src/services/queues.d.ts +18 -5
- package/dist/types/src/services/queues.d.ts.map +1 -1
- package/dist/types/src/services/remote-function-execution-service.d.ts.map +1 -1
- package/dist/types/src/services/service-container.d.ts +1 -1
- package/dist/types/src/services/service-container.d.ts.map +1 -1
- package/dist/types/src/services/service-registry.d.ts.map +1 -1
- package/dist/types/src/services/tracing.d.ts +33 -3
- package/dist/types/src/services/tracing.d.ts.map +1 -1
- package/dist/types/src/testing/layer.d.ts +6 -2
- package/dist/types/src/testing/layer.d.ts.map +1 -1
- package/dist/types/src/testing/logger.d.ts.map +1 -1
- package/dist/types/src/testing/persist-database.test.d.ts +2 -0
- package/dist/types/src/testing/persist-database.test.d.ts.map +1 -0
- package/dist/types/src/testing/services.d.ts +1 -1
- package/dist/types/src/testing/services.d.ts.map +1 -1
- package/dist/types/src/trace.d.ts +34 -8
- package/dist/types/src/trace.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +141 -224
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/url.d.ts +10 -6
- package/dist/types/src/url.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +40 -39
- package/src/bundler/bundler.test.ts +8 -9
- package/src/bundler/bundler.ts +32 -33
- package/src/edge/functions.ts +8 -5
- package/src/examples/fib.ts +30 -0
- package/src/examples/reply.ts +18 -0
- package/src/examples/sleep.ts +22 -0
- package/src/executor/executor.ts +9 -9
- package/src/handler.ts +12 -10
- package/src/schema.ts +11 -0
- package/src/services/credentials.ts +78 -5
- package/src/services/database.ts +114 -18
- package/src/services/event-logger.ts +2 -2
- package/src/services/local-function-execution.ts +20 -13
- package/src/services/queues.ts +29 -10
- package/src/services/remote-function-execution-service.ts +2 -22
- package/src/services/service-container.ts +4 -3
- package/src/services/service-registry.ts +1 -1
- package/src/services/tracing.ts +95 -5
- package/src/testing/layer.ts +69 -3
- package/src/testing/logger.ts +1 -1
- package/src/testing/persist-database.test.ts +87 -0
- package/src/testing/services.ts +2 -1
- package/src/trace.ts +5 -7
- package/src/types.ts +17 -25
- package/src/url.ts +13 -10
- package/dist/lib/browser/chunk-6PTFLPCO.mjs +0 -462
- package/dist/lib/browser/chunk-6PTFLPCO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NYJ2TSXO.mjs +0 -464
- package/dist/lib/node-esm/chunk-NYJ2TSXO.mjs.map +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../../src/testing/services.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAGhE,OAAO,
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../../../src/testing/services.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAGhE,OAAO,EACL,KAAK,kBAAkB,EAEvB,KAAK,kBAAkB,EAGvB,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,aAAa,CAAC;AAKrB,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI;KACpB,CAAC,IAAI,MAAM,CAAC,GAAG;SAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KAAE,GAAG;SAAG,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK;KAAE;CAC5E,CAAC,MAAM,CAAC,CAAC,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEvE,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,EAAE,CAAC,EAAE,GAAG,CAAC;IAET;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC;QAClB;;WAEG;QACH,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAC;QAE/B;;WAEG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;KACnD,CAAC,CAAC;IAEH;;OAEG;IACH,EAAE,CAAC,EAAE,YAAY,CAAC;IAElB;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd;;OAEG;IACH,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,MAAM,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;KAClD,CAAC;IAEF;;OAEG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IAEtB,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;KAC/C,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,4DAQhC,kBAAuB,KAAG,gBAW5B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Schema } from 'effect';
|
|
2
|
-
import {
|
|
2
|
+
import { type Ref, Type } from '@dxos/echo';
|
|
3
3
|
import { Queue } from '@dxos/echo-db';
|
|
4
|
-
import { FunctionTrigger
|
|
4
|
+
import { FunctionTrigger } from './types';
|
|
5
5
|
export declare enum InvocationOutcome {
|
|
6
6
|
SUCCESS = "success",
|
|
7
7
|
FAILURE = "failure",
|
|
@@ -50,7 +50,35 @@ export declare const InvocationTraceStartEvent: Type.obj<Schema.Struct<{
|
|
|
50
50
|
/**
|
|
51
51
|
* Present for automatic invocations.
|
|
52
52
|
*/
|
|
53
|
-
trigger: Schema.optional<Type.ref<
|
|
53
|
+
trigger: Schema.optional<Type.ref<Type.obj<Schema.Struct<{
|
|
54
|
+
function: Schema.optional<Schema.SchemaClass<import("@dxos/echo-schema").Ref<import("@dxos/echo-schema").Expando>, import("@dxos/echo-protocol").EncodedReference, never>>;
|
|
55
|
+
inputNodeId: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
56
|
+
enabled: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
57
|
+
spec: Schema.optional<Schema.Union<[Schema.mutable<Schema.Struct<{
|
|
58
|
+
kind: Schema.Literal<["timer"]>;
|
|
59
|
+
cron: Schema.SchemaClass<string, string, never>;
|
|
60
|
+
}>>, Schema.mutable<Schema.Struct<{
|
|
61
|
+
kind: Schema.Literal<["webhook"]>;
|
|
62
|
+
method: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
63
|
+
port: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
64
|
+
}>>, Schema.mutable<Schema.Struct<{
|
|
65
|
+
kind: Schema.Literal<["subscription"]>;
|
|
66
|
+
filter: Schema.Struct<{
|
|
67
|
+
type: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
68
|
+
props: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
|
|
69
|
+
}>;
|
|
70
|
+
options: Schema.optional<Schema.Struct<{
|
|
71
|
+
deep: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
72
|
+
delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
73
|
+
}>>;
|
|
74
|
+
}>>, Schema.mutable<Schema.Struct<{
|
|
75
|
+
kind: Schema.Literal<["email"]>;
|
|
76
|
+
}>>, Schema.mutable<Schema.Struct<{
|
|
77
|
+
kind: Schema.Literal<["queue"]>;
|
|
78
|
+
queue: Schema.refine<string, typeof Schema.NonEmptyString>;
|
|
79
|
+
}>>]>>;
|
|
80
|
+
input: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
|
|
81
|
+
}>>>>;
|
|
54
82
|
}>>;
|
|
55
83
|
export type InvocationTraceStartEvent = Schema.Schema.Type<typeof InvocationTraceStartEvent>;
|
|
56
84
|
export declare const InvocationTraceEndEvent: Type.obj<Schema.Struct<{
|
|
@@ -87,10 +115,8 @@ export declare const TraceEvent: Type.obj<Schema.Struct<{
|
|
|
87
115
|
id: import("@dxos/keys").ObjectIdClass;
|
|
88
116
|
outcome: typeof Schema.String;
|
|
89
117
|
truncated: typeof Schema.Boolean;
|
|
90
|
-
/**
|
|
91
|
-
|
|
92
|
-
*/
|
|
93
|
-
ingestionTimestampMs: typeof Schema.Number;
|
|
118
|
+
/** Time when the event was persisted. */
|
|
119
|
+
ingestionTimestamp: typeof Schema.Number;
|
|
94
120
|
logs: Schema.Array$<Schema.Struct<{
|
|
95
121
|
timestampMs: typeof Schema.Number;
|
|
96
122
|
level: typeof Schema.String;
|
|
@@ -117,7 +143,7 @@ export type InvocationSpan = {
|
|
|
117
143
|
durationMs: number;
|
|
118
144
|
invocationTraceQueue: Ref.Ref<Queue>;
|
|
119
145
|
invocationTarget: Ref.Ref<Type.Expando>;
|
|
120
|
-
trigger?: Ref.Ref<
|
|
146
|
+
trigger?: Ref.Ref<FunctionTrigger>;
|
|
121
147
|
exception?: TraceEventException;
|
|
122
148
|
};
|
|
123
149
|
export declare const createInvocationSpans: (items?: InvocationTraceEvent[]) => InvocationSpan[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../../src/trace.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../../src/trace.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,KAAK,GAAG,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAItC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAGD,oBAAY,wBAAwB;IAClC,KAAK,UAAU;IACf,GAAG,QAAQ;CACZ;AAED,eAAO,MAAM,mBAAmB;;;;;EAK9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEjF,eAAO,MAAM,yBAAyB;IACpC;;OAEG;;;IAGH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAGH;;OAEG;;IAEH;;OAEG;;;;;IAEH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAEkF,CAAC;AAExF,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE7F,eAAO,MAAM,uBAAuB;IAClC;;OAEG;;;IAGH;;OAEG;;IAEH;;OAEG;;;;;;;;;GAKgF,CAAC;AAEtF,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEzF,MAAM,MAAM,oBAAoB,GAAG,yBAAyB,GAAG,uBAAuB,CAAC;AAEvF,eAAO,MAAM,aAAa;;;;;EAKxB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;IAKrB,yCAAyC;;;;;;;;;;;;;;GAIkC,CAAC;AAE9E,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB,EAAE,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACrC,gBAAgB,EAAE,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxC,OAAO,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACnC,SAAS,CAAC,EAAE,mBAAmB,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,QAAQ,oBAAoB,EAAE,KAAG,cAAc,EAkDpF,CAAC"}
|
|
@@ -1,31 +1,27 @@
|
|
|
1
1
|
import { Schema } from 'effect';
|
|
2
|
+
import { Type } from '@dxos/echo';
|
|
2
3
|
import { Expando, Ref } from '@dxos/echo-schema';
|
|
3
4
|
/**
|
|
4
5
|
* Type discriminator for TriggerType.
|
|
5
6
|
* Every spec has a type field of type TriggerKind that we can use to understand which type we're working with.
|
|
6
7
|
* https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions
|
|
7
8
|
*/
|
|
8
|
-
export declare
|
|
9
|
-
|
|
10
|
-
Webhook = "webhook",
|
|
11
|
-
Subscription = "subscription",
|
|
12
|
-
Email = "email",
|
|
13
|
-
Queue = "queue"
|
|
14
|
-
}
|
|
9
|
+
export declare const TriggerKinds: readonly ["timer", "webhook", "subscription", "email", "queue"];
|
|
10
|
+
export type TriggerKind = (typeof TriggerKinds)[number];
|
|
15
11
|
/**
|
|
16
12
|
* Cron timer.
|
|
17
13
|
*/
|
|
18
14
|
declare const TimerTriggerSchema: Schema.mutable<Schema.Struct<{
|
|
19
|
-
kind: Schema.Literal<[
|
|
15
|
+
kind: Schema.Literal<["timer"]>;
|
|
20
16
|
cron: Schema.SchemaClass<string, string, never>;
|
|
21
17
|
}>>;
|
|
22
18
|
export type TimerTrigger = Schema.Schema.Type<typeof TimerTriggerSchema>;
|
|
23
19
|
declare const EmailTriggerSchema: Schema.mutable<Schema.Struct<{
|
|
24
|
-
kind: Schema.Literal<[
|
|
20
|
+
kind: Schema.Literal<["email"]>;
|
|
25
21
|
}>>;
|
|
26
22
|
export type EmailTrigger = Schema.Schema.Type<typeof EmailTriggerSchema>;
|
|
27
23
|
declare const QueueTriggerSchema: Schema.mutable<Schema.Struct<{
|
|
28
|
-
kind: Schema.Literal<[
|
|
24
|
+
kind: Schema.Literal<["queue"]>;
|
|
29
25
|
queue: Schema.refine<string, typeof Schema.NonEmptyString>;
|
|
30
26
|
}>>;
|
|
31
27
|
export type QueueTrigger = Schema.Schema.Type<typeof QueueTriggerSchema>;
|
|
@@ -33,7 +29,7 @@ export type QueueTrigger = Schema.Schema.Type<typeof QueueTriggerSchema>;
|
|
|
33
29
|
* Webhook.
|
|
34
30
|
*/
|
|
35
31
|
declare const WebhookTriggerSchema: Schema.mutable<Schema.Struct<{
|
|
36
|
-
kind: Schema.Literal<[
|
|
32
|
+
kind: Schema.Literal<["webhook"]>;
|
|
37
33
|
method: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
38
34
|
port: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
39
35
|
}>>;
|
|
@@ -42,7 +38,7 @@ export type WebhookTrigger = Schema.Schema.Type<typeof WebhookTriggerSchema>;
|
|
|
42
38
|
* Subscription.
|
|
43
39
|
*/
|
|
44
40
|
declare const SubscriptionTriggerSchema: Schema.mutable<Schema.Struct<{
|
|
45
|
-
kind: Schema.Literal<[
|
|
41
|
+
kind: Schema.Literal<["subscription"]>;
|
|
46
42
|
filter: Schema.Struct<{
|
|
47
43
|
type: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
48
44
|
props: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
|
|
@@ -57,14 +53,14 @@ export type SubscriptionTrigger = Schema.Schema.Type<typeof SubscriptionTriggerS
|
|
|
57
53
|
* Trigger schema (discriminated union).
|
|
58
54
|
*/
|
|
59
55
|
export declare const TriggerSchema: Schema.Union<[Schema.mutable<Schema.Struct<{
|
|
60
|
-
kind: Schema.Literal<[
|
|
56
|
+
kind: Schema.Literal<["timer"]>;
|
|
61
57
|
cron: Schema.SchemaClass<string, string, never>;
|
|
62
58
|
}>>, Schema.mutable<Schema.Struct<{
|
|
63
|
-
kind: Schema.Literal<[
|
|
59
|
+
kind: Schema.Literal<["webhook"]>;
|
|
64
60
|
method: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
65
61
|
port: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
66
62
|
}>>, Schema.mutable<Schema.Struct<{
|
|
67
|
-
kind: Schema.Literal<[
|
|
63
|
+
kind: Schema.Literal<["subscription"]>;
|
|
68
64
|
filter: Schema.Struct<{
|
|
69
65
|
type: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
70
66
|
props: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
|
|
@@ -74,9 +70,9 @@ export declare const TriggerSchema: Schema.Union<[Schema.mutable<Schema.Struct<{
|
|
|
74
70
|
delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
75
71
|
}>>;
|
|
76
72
|
}>>, Schema.mutable<Schema.Struct<{
|
|
77
|
-
kind: Schema.Literal<[
|
|
73
|
+
kind: Schema.Literal<["email"]>;
|
|
78
74
|
}>>, Schema.mutable<Schema.Struct<{
|
|
79
|
-
kind: Schema.Literal<[
|
|
75
|
+
kind: Schema.Literal<["queue"]>;
|
|
80
76
|
queue: Schema.refine<string, typeof Schema.NonEmptyString>;
|
|
81
77
|
}>>]>;
|
|
82
78
|
export type TriggerType = Schema.Schema.Type<typeof TriggerSchema>;
|
|
@@ -116,7 +112,7 @@ export type TimerTriggerOutput = Schema.Schema.Type<typeof TimerTriggerOutput>;
|
|
|
116
112
|
* Function is invoked with the `payload` passed as input data.
|
|
117
113
|
* The event that triggers the function is available in the function context.
|
|
118
114
|
*/
|
|
119
|
-
export declare const
|
|
115
|
+
export declare const FunctionTrigger: Type.obj<Schema.Struct<{
|
|
120
116
|
/**
|
|
121
117
|
* Function or workflow to invoke.
|
|
122
118
|
*/
|
|
@@ -129,14 +125,14 @@ export declare const FunctionTriggerSchema: Schema.Struct<{
|
|
|
129
125
|
inputNodeId: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
130
126
|
enabled: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
131
127
|
spec: Schema.optional<Schema.Union<[Schema.mutable<Schema.Struct<{
|
|
132
|
-
kind: Schema.Literal<[
|
|
128
|
+
kind: Schema.Literal<["timer"]>;
|
|
133
129
|
cron: Schema.SchemaClass<string, string, never>;
|
|
134
130
|
}>>, Schema.mutable<Schema.Struct<{
|
|
135
|
-
kind: Schema.Literal<[
|
|
131
|
+
kind: Schema.Literal<["webhook"]>;
|
|
136
132
|
method: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
137
133
|
port: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
138
134
|
}>>, Schema.mutable<Schema.Struct<{
|
|
139
|
-
kind: Schema.Literal<[
|
|
135
|
+
kind: Schema.Literal<["subscription"]>;
|
|
140
136
|
filter: Schema.Struct<{
|
|
141
137
|
type: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
142
138
|
props: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
|
|
@@ -146,9 +142,9 @@ export declare const FunctionTriggerSchema: Schema.Struct<{
|
|
|
146
142
|
delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
147
143
|
}>>;
|
|
148
144
|
}>>, Schema.mutable<Schema.Struct<{
|
|
149
|
-
kind: Schema.Literal<[
|
|
145
|
+
kind: Schema.Literal<["email"]>;
|
|
150
146
|
}>>, Schema.mutable<Schema.Struct<{
|
|
151
|
-
kind: Schema.Literal<[
|
|
147
|
+
kind: Schema.Literal<["queue"]>;
|
|
152
148
|
queue: Schema.refine<string, typeof Schema.NonEmptyString>;
|
|
153
149
|
}>>]>>;
|
|
154
150
|
/**
|
|
@@ -163,56 +159,124 @@ export declare const FunctionTriggerSchema: Schema.Struct<{
|
|
|
163
159
|
* }
|
|
164
160
|
*/
|
|
165
161
|
input: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
|
|
162
|
+
}>>;
|
|
163
|
+
export type FunctionTrigger = Schema.Schema.Type<typeof FunctionTrigger>;
|
|
164
|
+
/**
|
|
165
|
+
* Function manifest file.
|
|
166
|
+
*/
|
|
167
|
+
export declare const FunctionManifestSchema: Schema.Struct<{
|
|
168
|
+
functions: Schema.optional<Schema.mutable<Schema.Array$<Schema.Schema<import("@dxos/echo-schema").ExcludeId<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
169
|
+
description?: string | undefined;
|
|
170
|
+
version: string;
|
|
171
|
+
source?: Ref<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
172
|
+
description?: string | undefined;
|
|
173
|
+
source: Ref<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
174
|
+
content: string;
|
|
175
|
+
}>;
|
|
176
|
+
name?: string | undefined;
|
|
177
|
+
changed?: boolean | undefined;
|
|
178
|
+
}> | undefined;
|
|
179
|
+
name: string;
|
|
180
|
+
key?: string | undefined;
|
|
181
|
+
inputSchema?: Type.JsonSchema | undefined;
|
|
182
|
+
outputSchema?: Type.JsonSchema | undefined;
|
|
183
|
+
binding?: string | undefined;
|
|
184
|
+
}> & import("@dxos/echo-schema").WithMeta, {
|
|
185
|
+
id: string;
|
|
186
|
+
version: string;
|
|
187
|
+
name: string;
|
|
188
|
+
description?: string | undefined;
|
|
189
|
+
source?: import("@dxos/echo-protocol").EncodedReference | undefined;
|
|
190
|
+
key?: string | undefined;
|
|
191
|
+
inputSchema?: Type.JsonSchema | undefined;
|
|
192
|
+
outputSchema?: Type.JsonSchema | undefined;
|
|
193
|
+
binding?: string | undefined;
|
|
194
|
+
}, never>>>>;
|
|
195
|
+
triggers: Schema.optional<Schema.mutable<Schema.Array$<Schema.Schema<import("@dxos/echo-schema").ExcludeId<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
196
|
+
function?: Ref<Expando> | undefined;
|
|
197
|
+
input?: {
|
|
198
|
+
[x: string]: any;
|
|
199
|
+
} | undefined;
|
|
200
|
+
inputNodeId?: string | undefined;
|
|
201
|
+
enabled?: boolean | undefined;
|
|
202
|
+
spec?: {
|
|
203
|
+
kind: "timer";
|
|
204
|
+
cron: string;
|
|
205
|
+
} | {
|
|
206
|
+
kind: "email";
|
|
207
|
+
} | {
|
|
208
|
+
kind: "queue";
|
|
209
|
+
queue: string;
|
|
210
|
+
} | {
|
|
211
|
+
kind: "webhook";
|
|
212
|
+
method?: string | undefined;
|
|
213
|
+
port?: number | undefined;
|
|
214
|
+
} | {
|
|
215
|
+
filter: {
|
|
216
|
+
readonly type?: string | undefined;
|
|
217
|
+
readonly props?: {
|
|
218
|
+
readonly [x: string]: any;
|
|
219
|
+
} | undefined;
|
|
220
|
+
};
|
|
221
|
+
kind: "subscription";
|
|
222
|
+
options?: {
|
|
223
|
+
readonly deep?: boolean | undefined;
|
|
224
|
+
readonly delay?: number | undefined;
|
|
225
|
+
} | undefined;
|
|
226
|
+
} | undefined;
|
|
227
|
+
}> & import("@dxos/echo-schema").WithMeta, {
|
|
228
|
+
id: string;
|
|
229
|
+
function?: import("@dxos/echo-protocol").EncodedReference | undefined;
|
|
230
|
+
input?: {
|
|
231
|
+
[x: string]: any;
|
|
232
|
+
} | undefined;
|
|
233
|
+
inputNodeId?: string | undefined;
|
|
234
|
+
enabled?: boolean | undefined;
|
|
235
|
+
spec?: {
|
|
236
|
+
kind: "timer";
|
|
237
|
+
cron: string;
|
|
238
|
+
} | {
|
|
239
|
+
kind: "email";
|
|
240
|
+
} | {
|
|
241
|
+
kind: "queue";
|
|
242
|
+
queue: string;
|
|
243
|
+
} | {
|
|
244
|
+
kind: "webhook";
|
|
245
|
+
method?: string | undefined;
|
|
246
|
+
port?: number | undefined;
|
|
247
|
+
} | {
|
|
248
|
+
filter: {
|
|
249
|
+
readonly type?: string | undefined;
|
|
250
|
+
readonly props?: {
|
|
251
|
+
readonly [x: string]: any;
|
|
252
|
+
} | undefined;
|
|
253
|
+
};
|
|
254
|
+
kind: "subscription";
|
|
255
|
+
options?: {
|
|
256
|
+
readonly deep?: boolean | undefined;
|
|
257
|
+
readonly delay?: number | undefined;
|
|
258
|
+
} | undefined;
|
|
259
|
+
} | undefined;
|
|
260
|
+
}, never>>>>;
|
|
166
261
|
}>;
|
|
167
|
-
export type
|
|
168
|
-
declare const
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
*/
|
|
178
|
-
inputNodeId: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
179
|
-
enabled: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
180
|
-
spec: Schema.optional<Schema.Union<[Schema.mutable<Schema.Struct<{
|
|
181
|
-
kind: Schema.Literal<[TriggerKind.Timer]>;
|
|
182
|
-
cron: Schema.SchemaClass<string, string, never>;
|
|
183
|
-
}>>, Schema.mutable<Schema.Struct<{
|
|
184
|
-
kind: Schema.Literal<[TriggerKind.Webhook]>;
|
|
185
|
-
method: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
186
|
-
port: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
187
|
-
}>>, Schema.mutable<Schema.Struct<{
|
|
188
|
-
kind: Schema.Literal<[TriggerKind.Subscription]>;
|
|
189
|
-
filter: Schema.Struct<{
|
|
190
|
-
type: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
191
|
-
props: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
|
|
262
|
+
export type FunctionManifest = Schema.Schema.Type<typeof FunctionManifestSchema>;
|
|
263
|
+
export declare const FUNCTION_TYPES: (Type.obj<Schema.Struct<{
|
|
264
|
+
key: Schema.optional<typeof Schema.String>;
|
|
265
|
+
name: typeof Schema.NonEmptyString;
|
|
266
|
+
version: typeof Schema.String;
|
|
267
|
+
description: Schema.optional<typeof Schema.String>;
|
|
268
|
+
source: Schema.optional<import("@dxos/echo-schema").Ref$<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
269
|
+
description?: string | undefined;
|
|
270
|
+
source: Ref<Type.OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
271
|
+
content: string;
|
|
192
272
|
}>;
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
kind: Schema.Literal<[TriggerKind.Queue]>;
|
|
201
|
-
queue: Schema.refine<string, typeof Schema.NonEmptyString>;
|
|
202
|
-
}>>]>>;
|
|
203
|
-
/**
|
|
204
|
-
* Passed as the input data to the function.
|
|
205
|
-
* Must match the function's input schema.
|
|
206
|
-
*
|
|
207
|
-
* @example
|
|
208
|
-
* {
|
|
209
|
-
* item: '{{$.trigger.event}}',
|
|
210
|
-
* instructions: 'Summarize and perform entity-extraction'
|
|
211
|
-
* mailbox: { '/': 'dxn:echo:AAA:ZZZ' }
|
|
212
|
-
* }
|
|
213
|
-
*/
|
|
214
|
-
input: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
|
|
215
|
-
}>, import("@dxos/echo-schema").TypedObjectOptions>, Schema.Struct.Encoded<Readonly<{
|
|
273
|
+
name?: string | undefined;
|
|
274
|
+
changed?: boolean | undefined;
|
|
275
|
+
}>>;
|
|
276
|
+
inputSchema: Schema.optional<Schema.Schema<Type.JsonSchema, Type.JsonSchema, never>>;
|
|
277
|
+
outputSchema: Schema.optional<Schema.Schema<Type.JsonSchema, Type.JsonSchema, never>>;
|
|
278
|
+
binding: Schema.optional<typeof Schema.String>;
|
|
279
|
+
}>> | Type.obj<Schema.Struct<{
|
|
216
280
|
/**
|
|
217
281
|
* Function or workflow to invoke.
|
|
218
282
|
*/
|
|
@@ -225,14 +289,14 @@ declare const FunctionTrigger_base: import("@dxos/echo-schema").TypedObjectProto
|
|
|
225
289
|
inputNodeId: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
226
290
|
enabled: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
227
291
|
spec: Schema.optional<Schema.Union<[Schema.mutable<Schema.Struct<{
|
|
228
|
-
kind: Schema.Literal<[
|
|
292
|
+
kind: Schema.Literal<["timer"]>;
|
|
229
293
|
cron: Schema.SchemaClass<string, string, never>;
|
|
230
294
|
}>>, Schema.mutable<Schema.Struct<{
|
|
231
|
-
kind: Schema.Literal<[
|
|
295
|
+
kind: Schema.Literal<["webhook"]>;
|
|
232
296
|
method: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
233
297
|
port: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
234
298
|
}>>, Schema.mutable<Schema.Struct<{
|
|
235
|
-
kind: Schema.Literal<[
|
|
299
|
+
kind: Schema.Literal<["subscription"]>;
|
|
236
300
|
filter: Schema.Struct<{
|
|
237
301
|
type: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
238
302
|
props: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
|
|
@@ -242,9 +306,9 @@ declare const FunctionTrigger_base: import("@dxos/echo-schema").TypedObjectProto
|
|
|
242
306
|
delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
243
307
|
}>>;
|
|
244
308
|
}>>, Schema.mutable<Schema.Struct<{
|
|
245
|
-
kind: Schema.Literal<[
|
|
309
|
+
kind: Schema.Literal<["email"]>;
|
|
246
310
|
}>>, Schema.mutable<Schema.Struct<{
|
|
247
|
-
kind: Schema.Literal<[
|
|
311
|
+
kind: Schema.Literal<["queue"]>;
|
|
248
312
|
queue: Schema.refine<string, typeof Schema.NonEmptyString>;
|
|
249
313
|
}>>]>>;
|
|
250
314
|
/**
|
|
@@ -259,153 +323,6 @@ declare const FunctionTrigger_base: import("@dxos/echo-schema").TypedObjectProto
|
|
|
259
323
|
* }
|
|
260
324
|
*/
|
|
261
325
|
input: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* Function trigger.
|
|
265
|
-
*/
|
|
266
|
-
export declare class FunctionTrigger extends FunctionTrigger_base {
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* Function manifest file.
|
|
270
|
-
*/
|
|
271
|
-
export declare const FunctionManifestSchema: Schema.Struct<{
|
|
272
|
-
functions: Schema.optional<Schema.mutable<Schema.Array$<Schema.Schema<import("@dxos/echo-schema").ExcludeId<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
273
|
-
description?: string | undefined;
|
|
274
|
-
version: string;
|
|
275
|
-
name: string;
|
|
276
|
-
inputSchema?: import("@dxos/echo-schema").JsonSchemaType | undefined;
|
|
277
|
-
outputSchema?: import("@dxos/echo-schema").JsonSchemaType | undefined;
|
|
278
|
-
source?: Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
279
|
-
description?: string | undefined;
|
|
280
|
-
name?: string | undefined;
|
|
281
|
-
changed?: boolean | undefined;
|
|
282
|
-
source: Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
283
|
-
content: string;
|
|
284
|
-
}>;
|
|
285
|
-
}> | undefined;
|
|
286
|
-
binding?: string | undefined;
|
|
287
|
-
}> & import("@dxos/echo-schema").WithMeta, {
|
|
288
|
-
id: string;
|
|
289
|
-
version: string;
|
|
290
|
-
name: string;
|
|
291
|
-
description?: string | undefined;
|
|
292
|
-
inputSchema?: import("@dxos/echo-schema").JsonSchemaType | undefined;
|
|
293
|
-
outputSchema?: import("@dxos/echo-schema").JsonSchemaType | undefined;
|
|
294
|
-
source?: import("@dxos/echo-protocol").EncodedReference | undefined;
|
|
295
|
-
binding?: string | undefined;
|
|
296
|
-
}, never>>>>;
|
|
297
|
-
triggers: Schema.optional<Schema.mutable<Schema.Array$<Schema.Schema<import("@dxos/echo-schema").ExcludeId<import("@dxos/echo-schema").TypedObjectFields<Readonly<{
|
|
298
|
-
/**
|
|
299
|
-
* Function or workflow to invoke.
|
|
300
|
-
*/
|
|
301
|
-
function: Schema.optional<Schema.SchemaClass<Ref<Expando>, import("@dxos/echo-protocol").EncodedReference, never>>;
|
|
302
|
-
/**
|
|
303
|
-
* Only used for workflowSchema.
|
|
304
|
-
* Specifies the input node in the circuit.
|
|
305
|
-
* @deprecated Remove and enforce a single input node in all compute graphSchema.
|
|
306
|
-
*/
|
|
307
|
-
inputNodeId: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
308
|
-
enabled: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
309
|
-
spec: Schema.optional<Schema.Union<[Schema.mutable<Schema.Struct<{
|
|
310
|
-
kind: Schema.Literal<[TriggerKind.Timer]>;
|
|
311
|
-
cron: Schema.SchemaClass<string, string, never>;
|
|
312
|
-
}>>, Schema.mutable<Schema.Struct<{
|
|
313
|
-
kind: Schema.Literal<[TriggerKind.Webhook]>;
|
|
314
|
-
method: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
315
|
-
port: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
316
|
-
}>>, Schema.mutable<Schema.Struct<{
|
|
317
|
-
kind: Schema.Literal<[TriggerKind.Subscription]>;
|
|
318
|
-
filter: Schema.Struct<{
|
|
319
|
-
type: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
320
|
-
props: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
|
|
321
|
-
}>;
|
|
322
|
-
options: Schema.optional<Schema.Struct<{
|
|
323
|
-
deep: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
324
|
-
delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
325
|
-
}>>;
|
|
326
|
-
}>>, Schema.mutable<Schema.Struct<{
|
|
327
|
-
kind: Schema.Literal<[TriggerKind.Email]>;
|
|
328
|
-
}>>, Schema.mutable<Schema.Struct<{
|
|
329
|
-
kind: Schema.Literal<[TriggerKind.Queue]>;
|
|
330
|
-
queue: Schema.refine<string, typeof Schema.NonEmptyString>;
|
|
331
|
-
}>>]>>;
|
|
332
|
-
/**
|
|
333
|
-
* Passed as the input data to the function.
|
|
334
|
-
* Must match the function's input schema.
|
|
335
|
-
*
|
|
336
|
-
* @example
|
|
337
|
-
* {
|
|
338
|
-
* item: '{{$.trigger.event}}',
|
|
339
|
-
* instructions: 'Summarize and perform entity-extraction'
|
|
340
|
-
* mailbox: { '/': 'dxn:echo:AAA:ZZZ' }
|
|
341
|
-
* }
|
|
342
|
-
*/
|
|
343
|
-
input: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
|
|
344
|
-
}>, import("@dxos/echo-schema").TypedObjectOptions>> & import("@dxos/echo-schema").WithMeta, Schema.Struct.Encoded<Readonly<{
|
|
345
|
-
/**
|
|
346
|
-
* Function or workflow to invoke.
|
|
347
|
-
*/
|
|
348
|
-
function: Schema.optional<Schema.SchemaClass<Ref<Expando>, import("@dxos/echo-protocol").EncodedReference, never>>;
|
|
349
|
-
/**
|
|
350
|
-
* Only used for workflowSchema.
|
|
351
|
-
* Specifies the input node in the circuit.
|
|
352
|
-
* @deprecated Remove and enforce a single input node in all compute graphSchema.
|
|
353
|
-
*/
|
|
354
|
-
inputNodeId: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
355
|
-
enabled: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
356
|
-
spec: Schema.optional<Schema.Union<[Schema.mutable<Schema.Struct<{
|
|
357
|
-
kind: Schema.Literal<[TriggerKind.Timer]>;
|
|
358
|
-
cron: Schema.SchemaClass<string, string, never>;
|
|
359
|
-
}>>, Schema.mutable<Schema.Struct<{
|
|
360
|
-
kind: Schema.Literal<[TriggerKind.Webhook]>;
|
|
361
|
-
method: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
362
|
-
port: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
363
|
-
}>>, Schema.mutable<Schema.Struct<{
|
|
364
|
-
kind: Schema.Literal<[TriggerKind.Subscription]>;
|
|
365
|
-
filter: Schema.Struct<{
|
|
366
|
-
type: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
367
|
-
props: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
|
|
368
|
-
}>;
|
|
369
|
-
options: Schema.optional<Schema.Struct<{
|
|
370
|
-
deep: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
371
|
-
delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
372
|
-
}>>;
|
|
373
|
-
}>>, Schema.mutable<Schema.Struct<{
|
|
374
|
-
kind: Schema.Literal<[TriggerKind.Email]>;
|
|
375
|
-
}>>, Schema.mutable<Schema.Struct<{
|
|
376
|
-
kind: Schema.Literal<[TriggerKind.Queue]>;
|
|
377
|
-
queue: Schema.refine<string, typeof Schema.NonEmptyString>;
|
|
378
|
-
}>>]>>;
|
|
379
|
-
/**
|
|
380
|
-
* Passed as the input data to the function.
|
|
381
|
-
* Must match the function's input schema.
|
|
382
|
-
*
|
|
383
|
-
* @example
|
|
384
|
-
* {
|
|
385
|
-
* item: '{{$.trigger.event}}',
|
|
386
|
-
* instructions: 'Summarize and perform entity-extraction'
|
|
387
|
-
* mailbox: { '/': 'dxn:echo:AAA:ZZZ' }
|
|
388
|
-
* }
|
|
389
|
-
*/
|
|
390
|
-
input: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
|
|
391
|
-
}>>, never>>>>;
|
|
392
|
-
}>;
|
|
393
|
-
export type FunctionManifest = Schema.Schema.Type<typeof FunctionManifestSchema>;
|
|
394
|
-
export declare const FUNCTION_TYPES: (import("@dxos/echo/Type").obj<Schema.Struct<{
|
|
395
|
-
name: typeof Schema.NonEmptyString;
|
|
396
|
-
version: typeof Schema.String;
|
|
397
|
-
description: Schema.optional<typeof Schema.String>;
|
|
398
|
-
source: Schema.optional<import("@dxos/echo-schema").Ref$<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
399
|
-
description?: string | undefined;
|
|
400
|
-
name?: string | undefined;
|
|
401
|
-
changed?: boolean | undefined;
|
|
402
|
-
source: Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
403
|
-
content: string;
|
|
404
|
-
}>;
|
|
405
|
-
}>>;
|
|
406
|
-
inputSchema: Schema.optional<Schema.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
|
|
407
|
-
outputSchema: Schema.optional<Schema.Schema<import("@dxos/echo-schema").JsonSchemaType, import("@dxos/echo-schema").JsonSchemaType, never>>;
|
|
408
|
-
binding: Schema.optional<typeof Schema.String>;
|
|
409
|
-
}>> | typeof FunctionTrigger)[];
|
|
326
|
+
}>>)[];
|
|
410
327
|
export {};
|
|
411
328
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAa,MAAM,QAAQ,CAAC;AAE3C,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"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"}
|
package/dist/types/src/url.d.ts
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { type ObjectMeta } from '@dxos/echo-schema';
|
|
2
2
|
import { type SpaceId } from '@dxos/keys';
|
|
3
|
+
export declare const FUNCTIONS_META_KEY = "dxos.org/service/function";
|
|
3
4
|
export declare const FUNCTIONS_PRESET_META_KEY = "dxos.org/service/function-preset";
|
|
4
|
-
export declare const getUserFunctionUrlInMetadata: (meta: ObjectMeta) => string | undefined;
|
|
5
|
-
export declare const setUserFunctionUrlInMetadata: (meta: ObjectMeta, functionUrl: string) => void;
|
|
6
5
|
/**
|
|
7
6
|
* NOTE: functionId is backend ID, not ECHO object id.
|
|
8
7
|
*/
|
|
9
|
-
export declare const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
export declare const getUserFunctionIdInMetadata: (meta: ObjectMeta) => string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* NOTE: functionId is backend ID, not ECHO object id.
|
|
11
|
+
*/
|
|
12
|
+
export declare const setUserFunctionIdInMetadata: (meta: ObjectMeta, functionId: string) => void;
|
|
13
|
+
/**
|
|
14
|
+
* NOTE: functionId is backend ID, not ECHO object id.
|
|
15
|
+
*/
|
|
16
|
+
export declare const getInvocationUrl: (functionId: string, edgeUrl: string, options?: InvocationOptions) => string;
|
|
13
17
|
export type InvocationOptions = {
|
|
14
18
|
spaceId?: SpaceId;
|
|
15
19
|
subjectId?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/url.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/url.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAG1C,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAE9D,eAAO,MAAM,yBAAyB,qCAAqC,CAAC;AAM5E;;GAEG;AACH,eAAO,MAAM,2BAA2B,GAAI,MAAM,UAAU,uBAE3D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B,GAAI,MAAM,UAAU,EAAE,YAAY,MAAM,SAS/E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,YAAY,MAAM,EAAE,SAAS,MAAM,EAAE,UAAS,iBAAsB,WASpG,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
|