@dxos/functions 0.8.4-main.84f28bd → 0.8.4-main.8baae0fced
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/LICENSE +102 -5
- package/README.md +5 -7
- package/dist/lib/neutral/index.mjs +602 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/types/src/index.d.ts +3 -6
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/protocol/functions-ai-http-client.d.ts +12 -0
- package/dist/types/src/protocol/functions-ai-http-client.d.ts.map +1 -0
- package/dist/types/src/protocol/functions-ai-http-client.test.d.ts +2 -0
- package/dist/types/src/protocol/functions-ai-http-client.test.d.ts.map +1 -0
- package/dist/types/src/protocol/index.d.ts +2 -0
- package/dist/types/src/protocol/index.d.ts.map +1 -0
- package/dist/types/src/protocol/protocol.d.ts +24 -0
- package/dist/types/src/protocol/protocol.d.ts.map +1 -0
- package/dist/types/src/protocol/protocol.test.d.ts +2 -0
- package/dist/types/src/protocol/protocol.test.d.ts.map +1 -0
- package/dist/types/src/sdk.d.ts +10 -0
- package/dist/types/src/sdk.d.ts.map +1 -0
- package/dist/types/src/services/credentials.d.ts +24 -27
- package/dist/types/src/services/credentials.d.ts.map +1 -1
- package/dist/types/src/services/function-invocation-service.d.ts +18 -0
- package/dist/types/src/services/function-invocation-service.d.ts.map +1 -0
- package/dist/types/src/services/index.d.ts +3 -8
- package/dist/types/src/services/index.d.ts.map +1 -1
- package/dist/types/src/services/queues.d.ts +1 -17
- package/dist/types/src/services/queues.d.ts.map +1 -1
- package/dist/types/src/services/tracing.d.ts +4 -14
- package/dist/types/src/services/tracing.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/types/url.d.ts +13 -0
- package/dist/types/src/types/url.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +29 -69
- package/src/index.ts +3 -8
- package/src/protocol/functions-ai-http-client.test.ts +105 -0
- package/src/protocol/functions-ai-http-client.ts +141 -0
- package/src/{executor → protocol}/index.ts +1 -1
- package/src/protocol/protocol.test.ts +58 -0
- package/src/protocol/protocol.ts +455 -0
- package/src/sdk.ts +31 -0
- package/src/services/credentials.ts +95 -35
- package/src/services/function-invocation-service.ts +36 -0
- package/src/services/index.ts +3 -8
- package/src/services/queues.ts +1 -38
- package/src/services/tracing.ts +4 -23
- package/src/{testing → types}/index.ts +1 -1
- package/src/types/url.ts +32 -0
- package/dist/lib/browser/bundler/index.mjs +0 -247
- package/dist/lib/browser/bundler/index.mjs.map +0 -7
- package/dist/lib/browser/chunk-54U464M4.mjs +0 -360
- package/dist/lib/browser/chunk-54U464M4.mjs.map +0 -7
- package/dist/lib/browser/edge/index.mjs +0 -69
- package/dist/lib/browser/edge/index.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -492
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/testing/index.mjs +0 -79
- package/dist/lib/browser/testing/index.mjs.map +0 -7
- package/dist/lib/node-esm/bundler/index.mjs +0 -249
- package/dist/lib/node-esm/bundler/index.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XDSX35BS.mjs +0 -362
- package/dist/lib/node-esm/chunk-XDSX35BS.mjs.map +0 -7
- package/dist/lib/node-esm/edge/index.mjs +0 -71
- package/dist/lib/node-esm/edge/index.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -493
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/testing/index.mjs +0 -80
- package/dist/lib/node-esm/testing/index.mjs.map +0 -7
- package/dist/types/src/bundler/bundler.d.ts +0 -50
- package/dist/types/src/bundler/bundler.d.ts.map +0 -1
- package/dist/types/src/bundler/bundler.test.d.ts +0 -2
- package/dist/types/src/bundler/bundler.test.d.ts.map +0 -1
- package/dist/types/src/bundler/index.d.ts +0 -2
- package/dist/types/src/bundler/index.d.ts.map +0 -1
- package/dist/types/src/edge/functions.d.ts +0 -16
- package/dist/types/src/edge/functions.d.ts.map +0 -1
- package/dist/types/src/edge/index.d.ts +0 -2
- package/dist/types/src/edge/index.d.ts.map +0 -1
- package/dist/types/src/executor/executor.d.ts +0 -8
- package/dist/types/src/executor/executor.d.ts.map +0 -1
- package/dist/types/src/executor/index.d.ts +0 -2
- package/dist/types/src/executor/index.d.ts.map +0 -1
- package/dist/types/src/handler.d.ts +0 -61
- package/dist/types/src/handler.d.ts.map +0 -1
- package/dist/types/src/schema.d.ts +0 -38
- package/dist/types/src/schema.d.ts.map +0 -1
- package/dist/types/src/services/ai.d.ts +0 -12
- package/dist/types/src/services/ai.d.ts.map +0 -1
- package/dist/types/src/services/database.d.ts +0 -15
- package/dist/types/src/services/database.d.ts.map +0 -1
- package/dist/types/src/services/event-logger.d.ts +0 -37
- package/dist/types/src/services/event-logger.d.ts.map +0 -1
- package/dist/types/src/services/function-call-service.d.ts +0 -16
- package/dist/types/src/services/function-call-service.d.ts.map +0 -1
- package/dist/types/src/services/service-container.d.ts +0 -46
- package/dist/types/src/services/service-container.d.ts.map +0 -1
- package/dist/types/src/services/tool-resolver.d.ts +0 -14
- package/dist/types/src/services/tool-resolver.d.ts.map +0 -1
- package/dist/types/src/testing/index.d.ts +0 -2
- package/dist/types/src/testing/index.d.ts.map +0 -1
- package/dist/types/src/testing/logger.d.ts +0 -5
- package/dist/types/src/testing/logger.d.ts.map +0 -1
- package/dist/types/src/testing/services.d.ts +0 -71
- package/dist/types/src/testing/services.d.ts.map +0 -1
- package/dist/types/src/trace.d.ts +0 -124
- package/dist/types/src/trace.d.ts.map +0 -1
- package/dist/types/src/translations.d.ts +0 -12
- package/dist/types/src/translations.d.ts.map +0 -1
- package/dist/types/src/types.d.ts +0 -411
- package/dist/types/src/types.d.ts.map +0 -1
- package/dist/types/src/url.d.ts +0 -17
- package/dist/types/src/url.d.ts.map +0 -1
- package/src/bundler/bundler.test.ts +0 -59
- package/src/bundler/bundler.ts +0 -292
- package/src/bundler/index.ts +0 -5
- package/src/edge/functions.ts +0 -64
- package/src/edge/index.ts +0 -9
- package/src/executor/executor.ts +0 -54
- package/src/handler.ts +0 -113
- package/src/schema.ts +0 -57
- package/src/services/ai.ts +0 -32
- package/src/services/database.ts +0 -50
- package/src/services/event-logger.ts +0 -87
- package/src/services/function-call-service.ts +0 -64
- package/src/services/service-container.ts +0 -127
- package/src/services/tool-resolver.ts +0 -31
- package/src/testing/logger.ts +0 -16
- package/src/testing/services.ts +0 -174
- package/src/trace.ts +0 -180
- package/src/translations.ts +0 -20
- package/src/types.ts +0 -211
- package/src/url.ts +0 -52
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { Schema } from 'effect';
|
|
2
|
-
import { Type, type Ref } from '@dxos/echo';
|
|
3
|
-
import { Queue } from '@dxos/echo-db';
|
|
4
|
-
import { FunctionTrigger, type FunctionTriggerType } from './types';
|
|
5
|
-
export declare enum InvocationOutcome {
|
|
6
|
-
SUCCESS = "success",
|
|
7
|
-
FAILURE = "failure",
|
|
8
|
-
PENDING = "pending"
|
|
9
|
-
}
|
|
10
|
-
export declare enum InvocationTraceEventType {
|
|
11
|
-
START = "start",
|
|
12
|
-
END = "end"
|
|
13
|
-
}
|
|
14
|
-
export declare const TraceEventException: Schema.Struct<{
|
|
15
|
-
timestampMs: typeof Schema.Number;
|
|
16
|
-
message: typeof Schema.String;
|
|
17
|
-
name: typeof Schema.String;
|
|
18
|
-
stack: Schema.optional<typeof Schema.String>;
|
|
19
|
-
}>;
|
|
20
|
-
export type TraceEventException = Schema.Schema.Type<typeof TraceEventException>;
|
|
21
|
-
export declare const InvocationTraceStartEvent: Type.obj<Schema.Struct<{
|
|
22
|
-
/**
|
|
23
|
-
* Queue message id.
|
|
24
|
-
*/
|
|
25
|
-
id: import("@dxos/keys").ObjectIdClass;
|
|
26
|
-
type: Schema.Literal<[InvocationTraceEventType.START]>;
|
|
27
|
-
/**
|
|
28
|
-
* Invocation id, the same for invocation start and end events.
|
|
29
|
-
*/
|
|
30
|
-
invocationId: import("@dxos/keys").ObjectIdClass;
|
|
31
|
-
/**
|
|
32
|
-
* Event generation time.
|
|
33
|
-
*/
|
|
34
|
-
timestampMs: typeof Schema.Number;
|
|
35
|
-
/**
|
|
36
|
-
* Data passed to function / workflow as an argument.
|
|
37
|
-
*/
|
|
38
|
-
input: typeof Schema.Object;
|
|
39
|
-
/**
|
|
40
|
-
* Queue for function/workflow invocation events.
|
|
41
|
-
*/
|
|
42
|
-
invocationTraceQueue: Type.ref<Schema.Schema<Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, never>>;
|
|
43
|
-
/**
|
|
44
|
-
* DXN of the invoked function/workflow.
|
|
45
|
-
*/
|
|
46
|
-
invocationTarget: Type.ref<Schema.Schema<Type.Expando, {
|
|
47
|
-
[x: string]: any;
|
|
48
|
-
id: string;
|
|
49
|
-
}, never>>;
|
|
50
|
-
/**
|
|
51
|
-
* Present for automatic invocations.
|
|
52
|
-
*/
|
|
53
|
-
trigger: Schema.optional<Type.ref<typeof FunctionTrigger>>;
|
|
54
|
-
}>>;
|
|
55
|
-
export type InvocationTraceStartEvent = Schema.Schema.Type<typeof InvocationTraceStartEvent>;
|
|
56
|
-
export declare const InvocationTraceEndEvent: Type.obj<Schema.Struct<{
|
|
57
|
-
/**
|
|
58
|
-
* Trace event id.
|
|
59
|
-
*/
|
|
60
|
-
id: import("@dxos/keys").ObjectIdClass;
|
|
61
|
-
type: Schema.Literal<[InvocationTraceEventType.END]>;
|
|
62
|
-
/**
|
|
63
|
-
* Invocation id, will be the same for invocation start and end.
|
|
64
|
-
*/
|
|
65
|
-
invocationId: import("@dxos/keys").ObjectIdClass;
|
|
66
|
-
/**
|
|
67
|
-
* Event generation time.
|
|
68
|
-
*/
|
|
69
|
-
timestampMs: typeof Schema.Number;
|
|
70
|
-
outcome: Schema.Enums<typeof InvocationOutcome>;
|
|
71
|
-
exception: Schema.optional<Schema.Struct<{
|
|
72
|
-
timestampMs: typeof Schema.Number;
|
|
73
|
-
message: typeof Schema.String;
|
|
74
|
-
name: typeof Schema.String;
|
|
75
|
-
stack: Schema.optional<typeof Schema.String>;
|
|
76
|
-
}>>;
|
|
77
|
-
}>>;
|
|
78
|
-
export type InvocationTraceEndEvent = Schema.Schema.Type<typeof InvocationTraceEndEvent>;
|
|
79
|
-
export type InvocationTraceEvent = InvocationTraceStartEvent | InvocationTraceEndEvent;
|
|
80
|
-
export declare const TraceEventLog: Schema.Struct<{
|
|
81
|
-
timestampMs: typeof Schema.Number;
|
|
82
|
-
level: typeof Schema.String;
|
|
83
|
-
message: typeof Schema.String;
|
|
84
|
-
context: Schema.optional<typeof Schema.Object>;
|
|
85
|
-
}>;
|
|
86
|
-
export declare const TraceEvent: Type.obj<Schema.Struct<{
|
|
87
|
-
id: import("@dxos/keys").ObjectIdClass;
|
|
88
|
-
outcome: typeof Schema.String;
|
|
89
|
-
truncated: typeof Schema.Boolean;
|
|
90
|
-
/**
|
|
91
|
-
* Time when the event was persisted.
|
|
92
|
-
*/
|
|
93
|
-
ingestionTimestampMs: typeof Schema.Number;
|
|
94
|
-
logs: Schema.Array$<Schema.Struct<{
|
|
95
|
-
timestampMs: typeof Schema.Number;
|
|
96
|
-
level: typeof Schema.String;
|
|
97
|
-
message: typeof Schema.String;
|
|
98
|
-
context: Schema.optional<typeof Schema.Object>;
|
|
99
|
-
}>>;
|
|
100
|
-
exceptions: Schema.Array$<Schema.Struct<{
|
|
101
|
-
timestampMs: typeof Schema.Number;
|
|
102
|
-
message: typeof Schema.String;
|
|
103
|
-
name: typeof Schema.String;
|
|
104
|
-
stack: Schema.optional<typeof Schema.String>;
|
|
105
|
-
}>>;
|
|
106
|
-
}>>;
|
|
107
|
-
export type TraceEvent = Schema.Schema.Type<typeof TraceEvent>;
|
|
108
|
-
/**
|
|
109
|
-
* InvocationTrace event format.
|
|
110
|
-
* This is the combined format of InvocationTraceStartEvent and InvocationTraceEndEvents for UI consumption.
|
|
111
|
-
*/
|
|
112
|
-
export type InvocationSpan = {
|
|
113
|
-
id: string;
|
|
114
|
-
timestampMs: number;
|
|
115
|
-
outcome: InvocationOutcome;
|
|
116
|
-
input: object;
|
|
117
|
-
durationMs: number;
|
|
118
|
-
invocationTraceQueue: Ref.Ref<Queue>;
|
|
119
|
-
invocationTarget: Ref.Ref<Type.Expando>;
|
|
120
|
-
trigger?: Ref.Ref<FunctionTriggerType>;
|
|
121
|
-
exception?: TraceEventException;
|
|
122
|
-
};
|
|
123
|
-
export declare const createInvocationSpans: (items?: InvocationTraceEvent[]) => InvocationSpan[];
|
|
124
|
-
//# sourceMappingURL=trace.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,IAAI,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAItC,OAAO,EAAE,eAAe,EAAE,KAAK,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEpE,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;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ations: [{
|
|
3
|
-
readonly 'en-US': {
|
|
4
|
-
readonly [ScriptType.typename]: {
|
|
5
|
-
readonly 'typename label': "Script";
|
|
6
|
-
readonly 'typename label_zero': "Scripts";
|
|
7
|
-
readonly 'typename label_one': "Script";
|
|
8
|
-
readonly 'typename label_other': "Scripts";
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
}];
|
|
12
|
-
//# sourceMappingURL=translations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,eAAO,MAAM,YAAY;;QAGnB,SAAA,CAAC,UAAU,CAAC,QAAQ,CAAC;;;;;UAKpB;;EAGwB,CAAC"}
|
|
@@ -1,411 +0,0 @@
|
|
|
1
|
-
import { Schema } from 'effect';
|
|
2
|
-
import { Expando, Ref } from '@dxos/echo-schema';
|
|
3
|
-
/**
|
|
4
|
-
* Type discriminator for TriggerType.
|
|
5
|
-
* Every spec has a type field of type TriggerKind that we can use to understand which type we're working with.
|
|
6
|
-
* https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions
|
|
7
|
-
*/
|
|
8
|
-
export declare enum TriggerKind {
|
|
9
|
-
Timer = "timer",
|
|
10
|
-
Webhook = "webhook",
|
|
11
|
-
Subscription = "subscription",
|
|
12
|
-
Email = "email",
|
|
13
|
-
Queue = "queue"
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Cron timer.
|
|
17
|
-
*/
|
|
18
|
-
declare const TimerTriggerSchema: Schema.mutable<Schema.Struct<{
|
|
19
|
-
kind: Schema.Literal<[TriggerKind.Timer]>;
|
|
20
|
-
cron: Schema.SchemaClass<string, string, never>;
|
|
21
|
-
}>>;
|
|
22
|
-
export type TimerTrigger = Schema.Schema.Type<typeof TimerTriggerSchema>;
|
|
23
|
-
declare const EmailTriggerSchema: Schema.mutable<Schema.Struct<{
|
|
24
|
-
kind: Schema.Literal<[TriggerKind.Email]>;
|
|
25
|
-
}>>;
|
|
26
|
-
export type EmailTrigger = Schema.Schema.Type<typeof EmailTriggerSchema>;
|
|
27
|
-
declare const QueueTriggerSchema: Schema.mutable<Schema.Struct<{
|
|
28
|
-
kind: Schema.Literal<[TriggerKind.Queue]>;
|
|
29
|
-
queue: Schema.refine<string, typeof Schema.NonEmptyString>;
|
|
30
|
-
}>>;
|
|
31
|
-
export type QueueTrigger = Schema.Schema.Type<typeof QueueTriggerSchema>;
|
|
32
|
-
/**
|
|
33
|
-
* Webhook.
|
|
34
|
-
*/
|
|
35
|
-
declare const WebhookTriggerSchema: Schema.mutable<Schema.Struct<{
|
|
36
|
-
kind: Schema.Literal<[TriggerKind.Webhook]>;
|
|
37
|
-
method: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
38
|
-
port: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
39
|
-
}>>;
|
|
40
|
-
export type WebhookTrigger = Schema.Schema.Type<typeof WebhookTriggerSchema>;
|
|
41
|
-
/**
|
|
42
|
-
* Subscription.
|
|
43
|
-
*/
|
|
44
|
-
declare const SubscriptionTriggerSchema: Schema.mutable<Schema.Struct<{
|
|
45
|
-
kind: Schema.Literal<[TriggerKind.Subscription]>;
|
|
46
|
-
filter: Schema.Struct<{
|
|
47
|
-
type: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
48
|
-
props: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
|
|
49
|
-
}>;
|
|
50
|
-
options: Schema.optional<Schema.Struct<{
|
|
51
|
-
deep: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
52
|
-
delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
53
|
-
}>>;
|
|
54
|
-
}>>;
|
|
55
|
-
export type SubscriptionTrigger = Schema.Schema.Type<typeof SubscriptionTriggerSchema>;
|
|
56
|
-
/**
|
|
57
|
-
* Trigger schema (discriminated union).
|
|
58
|
-
*/
|
|
59
|
-
export declare const TriggerSchema: Schema.Union<[Schema.mutable<Schema.Struct<{
|
|
60
|
-
kind: Schema.Literal<[TriggerKind.Timer]>;
|
|
61
|
-
cron: Schema.SchemaClass<string, string, never>;
|
|
62
|
-
}>>, Schema.mutable<Schema.Struct<{
|
|
63
|
-
kind: Schema.Literal<[TriggerKind.Webhook]>;
|
|
64
|
-
method: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
65
|
-
port: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
66
|
-
}>>, Schema.mutable<Schema.Struct<{
|
|
67
|
-
kind: Schema.Literal<[TriggerKind.Subscription]>;
|
|
68
|
-
filter: Schema.Struct<{
|
|
69
|
-
type: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
70
|
-
props: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
|
|
71
|
-
}>;
|
|
72
|
-
options: Schema.optional<Schema.Struct<{
|
|
73
|
-
deep: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
74
|
-
delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
75
|
-
}>>;
|
|
76
|
-
}>>, Schema.mutable<Schema.Struct<{
|
|
77
|
-
kind: Schema.Literal<[TriggerKind.Email]>;
|
|
78
|
-
}>>, Schema.mutable<Schema.Struct<{
|
|
79
|
-
kind: Schema.Literal<[TriggerKind.Queue]>;
|
|
80
|
-
queue: Schema.refine<string, typeof Schema.NonEmptyString>;
|
|
81
|
-
}>>]>;
|
|
82
|
-
export type TriggerType = Schema.Schema.Type<typeof TriggerSchema>;
|
|
83
|
-
export type EventType = EmailTriggerOutput | WebhookTriggerOutput | QueueTriggerOutput | SubscriptionTriggerOutput | TimerTriggerOutput;
|
|
84
|
-
export declare const EmailTriggerOutput: Schema.mutable<Schema.Struct<{
|
|
85
|
-
from: typeof Schema.String;
|
|
86
|
-
to: typeof Schema.String;
|
|
87
|
-
subject: typeof Schema.String;
|
|
88
|
-
created: typeof Schema.String;
|
|
89
|
-
body: typeof Schema.String;
|
|
90
|
-
}>>;
|
|
91
|
-
export type EmailTriggerOutput = Schema.Schema.Type<typeof EmailTriggerOutput>;
|
|
92
|
-
export declare const WebhookTriggerOutput: Schema.mutable<Schema.Struct<{
|
|
93
|
-
url: typeof Schema.String;
|
|
94
|
-
method: Schema.Literal<["GET", "POST"]>;
|
|
95
|
-
headers: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
96
|
-
bodyText: typeof Schema.String;
|
|
97
|
-
}>>;
|
|
98
|
-
export type WebhookTriggerOutput = Schema.Schema.Type<typeof WebhookTriggerOutput>;
|
|
99
|
-
export declare const QueueTriggerOutput: Schema.mutable<Schema.Struct<{
|
|
100
|
-
queue: Schema.refine<string, typeof Schema.NonEmptyString>;
|
|
101
|
-
item: typeof Schema.Any;
|
|
102
|
-
cursor: typeof Schema.String;
|
|
103
|
-
}>>;
|
|
104
|
-
export type QueueTriggerOutput = Schema.Schema.Type<typeof QueueTriggerOutput>;
|
|
105
|
-
export declare const SubscriptionTriggerOutput: Schema.mutable<Schema.Struct<{
|
|
106
|
-
type: typeof Schema.String;
|
|
107
|
-
changedObjectId: typeof Schema.String;
|
|
108
|
-
}>>;
|
|
109
|
-
export type SubscriptionTriggerOutput = Schema.Schema.Type<typeof SubscriptionTriggerOutput>;
|
|
110
|
-
export declare const TimerTriggerOutput: Schema.mutable<Schema.Struct<{
|
|
111
|
-
tick: typeof Schema.Number;
|
|
112
|
-
}>>;
|
|
113
|
-
export type TimerTriggerOutput = Schema.Schema.Type<typeof TimerTriggerOutput>;
|
|
114
|
-
/**
|
|
115
|
-
* Function trigger.
|
|
116
|
-
* Function is invoked with the `payload` passed as input data.
|
|
117
|
-
* The event that triggers the function is available in the function context.
|
|
118
|
-
*/
|
|
119
|
-
export declare const FunctionTriggerSchema: Schema.Struct<{
|
|
120
|
-
/**
|
|
121
|
-
* Function or workflow to invoke.
|
|
122
|
-
*/
|
|
123
|
-
function: Schema.optional<Schema.SchemaClass<Ref<Expando>, import("@dxos/echo-protocol").EncodedReference, never>>;
|
|
124
|
-
/**
|
|
125
|
-
* Only used for workflowSchema.
|
|
126
|
-
* Specifies the input node in the circuit.
|
|
127
|
-
* @deprecated Remove and enforce a single input node in all compute graphSchema.
|
|
128
|
-
*/
|
|
129
|
-
inputNodeId: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
130
|
-
enabled: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
131
|
-
spec: Schema.optional<Schema.Union<[Schema.mutable<Schema.Struct<{
|
|
132
|
-
kind: Schema.Literal<[TriggerKind.Timer]>;
|
|
133
|
-
cron: Schema.SchemaClass<string, string, never>;
|
|
134
|
-
}>>, Schema.mutable<Schema.Struct<{
|
|
135
|
-
kind: Schema.Literal<[TriggerKind.Webhook]>;
|
|
136
|
-
method: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
137
|
-
port: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
138
|
-
}>>, Schema.mutable<Schema.Struct<{
|
|
139
|
-
kind: Schema.Literal<[TriggerKind.Subscription]>;
|
|
140
|
-
filter: Schema.Struct<{
|
|
141
|
-
type: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
142
|
-
props: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
|
|
143
|
-
}>;
|
|
144
|
-
options: Schema.optional<Schema.Struct<{
|
|
145
|
-
deep: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
146
|
-
delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
147
|
-
}>>;
|
|
148
|
-
}>>, Schema.mutable<Schema.Struct<{
|
|
149
|
-
kind: Schema.Literal<[TriggerKind.Email]>;
|
|
150
|
-
}>>, Schema.mutable<Schema.Struct<{
|
|
151
|
-
kind: Schema.Literal<[TriggerKind.Queue]>;
|
|
152
|
-
queue: Schema.refine<string, typeof Schema.NonEmptyString>;
|
|
153
|
-
}>>]>>;
|
|
154
|
-
/**
|
|
155
|
-
* Passed as the input data to the function.
|
|
156
|
-
* Must match the function's input schema.
|
|
157
|
-
*
|
|
158
|
-
* @example
|
|
159
|
-
* {
|
|
160
|
-
* item: '{{$.trigger.event}}',
|
|
161
|
-
* instructions: 'Summarize and perform entity-extraction'
|
|
162
|
-
* mailbox: { '/': 'dxn:echo:AAA:ZZZ' }
|
|
163
|
-
* }
|
|
164
|
-
*/
|
|
165
|
-
input: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
|
|
166
|
-
}>;
|
|
167
|
-
export type FunctionTriggerType = Schema.Schema.Type<typeof FunctionTriggerSchema>;
|
|
168
|
-
declare const FunctionTrigger_base: import("@dxos/echo-schema").TypedObjectPrototype<import("@dxos/echo-schema").TypedObjectFields<Readonly<{
|
|
169
|
-
/**
|
|
170
|
-
* Function or workflow to invoke.
|
|
171
|
-
*/
|
|
172
|
-
function: Schema.optional<Schema.SchemaClass<Ref<Expando>, import("@dxos/echo-protocol").EncodedReference, never>>;
|
|
173
|
-
/**
|
|
174
|
-
* Only used for workflowSchema.
|
|
175
|
-
* Specifies the input node in the circuit.
|
|
176
|
-
* @deprecated Remove and enforce a single input node in all compute graphSchema.
|
|
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>>;
|
|
192
|
-
}>;
|
|
193
|
-
options: Schema.optional<Schema.Struct<{
|
|
194
|
-
deep: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
195
|
-
delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
196
|
-
}>>;
|
|
197
|
-
}>>, Schema.mutable<Schema.Struct<{
|
|
198
|
-
kind: Schema.Literal<[TriggerKind.Email]>;
|
|
199
|
-
}>>, Schema.mutable<Schema.Struct<{
|
|
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<{
|
|
216
|
-
/**
|
|
217
|
-
* Function or workflow to invoke.
|
|
218
|
-
*/
|
|
219
|
-
function: Schema.optional<Schema.SchemaClass<Ref<Expando>, import("@dxos/echo-protocol").EncodedReference, never>>;
|
|
220
|
-
/**
|
|
221
|
-
* Only used for workflowSchema.
|
|
222
|
-
* Specifies the input node in the circuit.
|
|
223
|
-
* @deprecated Remove and enforce a single input node in all compute graphSchema.
|
|
224
|
-
*/
|
|
225
|
-
inputNodeId: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
226
|
-
enabled: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
227
|
-
spec: Schema.optional<Schema.Union<[Schema.mutable<Schema.Struct<{
|
|
228
|
-
kind: Schema.Literal<[TriggerKind.Timer]>;
|
|
229
|
-
cron: Schema.SchemaClass<string, string, never>;
|
|
230
|
-
}>>, Schema.mutable<Schema.Struct<{
|
|
231
|
-
kind: Schema.Literal<[TriggerKind.Webhook]>;
|
|
232
|
-
method: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
233
|
-
port: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
234
|
-
}>>, Schema.mutable<Schema.Struct<{
|
|
235
|
-
kind: Schema.Literal<[TriggerKind.Subscription]>;
|
|
236
|
-
filter: Schema.Struct<{
|
|
237
|
-
type: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
238
|
-
props: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
|
|
239
|
-
}>;
|
|
240
|
-
options: Schema.optional<Schema.Struct<{
|
|
241
|
-
deep: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
242
|
-
delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
243
|
-
}>>;
|
|
244
|
-
}>>, Schema.mutable<Schema.Struct<{
|
|
245
|
-
kind: Schema.Literal<[TriggerKind.Email]>;
|
|
246
|
-
}>>, Schema.mutable<Schema.Struct<{
|
|
247
|
-
kind: Schema.Literal<[TriggerKind.Queue]>;
|
|
248
|
-
queue: Schema.refine<string, typeof Schema.NonEmptyString>;
|
|
249
|
-
}>>]>>;
|
|
250
|
-
/**
|
|
251
|
-
* Passed as the input data to the function.
|
|
252
|
-
* Must match the function's input schema.
|
|
253
|
-
*
|
|
254
|
-
* @example
|
|
255
|
-
* {
|
|
256
|
-
* item: '{{$.trigger.event}}',
|
|
257
|
-
* instructions: 'Summarize and perform entity-extraction'
|
|
258
|
-
* mailbox: { '/': 'dxn:echo:AAA:ZZZ' }
|
|
259
|
-
* }
|
|
260
|
-
*/
|
|
261
|
-
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
|
-
name: string;
|
|
274
|
-
description?: string | undefined;
|
|
275
|
-
source?: Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
276
|
-
name?: string | undefined;
|
|
277
|
-
description?: string | undefined;
|
|
278
|
-
changed?: boolean | undefined;
|
|
279
|
-
source: Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo-schema").EntityKind.Object> & {
|
|
280
|
-
content: string;
|
|
281
|
-
}>;
|
|
282
|
-
}> | undefined;
|
|
283
|
-
version: string;
|
|
284
|
-
inputSchema?: import("@dxos/echo-schema").JsonSchemaType | undefined;
|
|
285
|
-
outputSchema?: import("@dxos/echo-schema").JsonSchemaType | undefined;
|
|
286
|
-
binding?: string | undefined;
|
|
287
|
-
}> & import("@dxos/echo-schema").WithMeta, {
|
|
288
|
-
id: string;
|
|
289
|
-
name: string;
|
|
290
|
-
version: string;
|
|
291
|
-
description?: string | undefined;
|
|
292
|
-
source?: import("@dxos/echo-protocol").EncodedReference | undefined;
|
|
293
|
-
inputSchema?: import("@dxos/echo-schema").JsonSchemaType | undefined;
|
|
294
|
-
outputSchema?: import("@dxos/echo-schema").JsonSchemaType | 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
|
-
name?: string | undefined;
|
|
400
|
-
description?: 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)[];
|
|
410
|
-
export {};
|
|
411
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,EAAoC,GAAG,EAAa,MAAM,mBAAmB,CAAC;AAK9F;;;;GAIG;AACH,oBAAY,WAAW;IACrB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,YAAY,iBAAiB;IAC7B,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAID;;GAEG;AACH,QAAA,MAAM,kBAAkB;;;GAMD,CAAC;AACxB,MAAM,MAAM,YAAY,GAAG,MAAM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|
package/dist/types/src/url.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type ObjectMeta } from '@dxos/echo-schema';
|
|
2
|
-
import { type SpaceId } from '@dxos/keys';
|
|
3
|
-
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
|
-
/**
|
|
7
|
-
* NOTE: functionId is backend ID, not ECHO object id.
|
|
8
|
-
*/
|
|
9
|
-
export declare const makeFunctionUrl: (fn: {
|
|
10
|
-
functionId: string;
|
|
11
|
-
}) => string;
|
|
12
|
-
export declare const getInvocationUrl: (functionUrl: string, edgeUrl: string, options?: InvocationOptions) => string;
|
|
13
|
-
export type InvocationOptions = {
|
|
14
|
-
spaceId?: SpaceId;
|
|
15
|
-
subjectId?: string;
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=url.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAK1C,eAAO,MAAM,yBAAyB,qCAAqC,CAAC;AAM5E,eAAO,MAAM,4BAA4B,GAAI,MAAM,UAAU,uBAE5D,CAAC;AAEF,eAAO,MAAM,4BAA4B,GAAI,MAAM,UAAU,EAAE,aAAa,MAAM,SASjF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,IAAI;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,WAAwB,CAAC;AAEnF,eAAO,MAAM,gBAAgB,GAAI,aAAa,MAAM,EAAE,SAAS,MAAM,EAAE,UAAS,iBAAsB,WAUrG,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2022 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
// @ts-ignore
|
|
6
|
-
import wasmUrl from 'esbuild-wasm/esbuild.wasm?url';
|
|
7
|
-
import { beforeAll, describe, expect, test } from 'vitest';
|
|
8
|
-
|
|
9
|
-
import { isNode } from '@dxos/util';
|
|
10
|
-
|
|
11
|
-
import { Bundler, initializeBundler } from './bundler';
|
|
12
|
-
|
|
13
|
-
describe('Bundler', () => {
|
|
14
|
-
beforeAll(async () => {
|
|
15
|
-
if (!isNode()) {
|
|
16
|
-
await initializeBundler({ wasmUrl });
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
test('Basic', async () => {
|
|
21
|
-
const bundler = new Bundler({ platform: 'node', sandboxedModules: [], remoteModules: {} });
|
|
22
|
-
const result = await bundler.bundle({ source: 'const x = 100' }); // TODO(burdon): Test import.
|
|
23
|
-
expect(result.bundle).to.exist;
|
|
24
|
-
expect(result.error).to.not.exist;
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
test('Import', async () => {
|
|
28
|
-
const bundler = new Bundler({ platform: 'node', sandboxedModules: [], remoteModules: {} });
|
|
29
|
-
const result = await bundler.bundle({
|
|
30
|
-
source: `
|
|
31
|
-
import { Filter } from './runtime.js';
|
|
32
|
-
|
|
33
|
-
const query = Filter.typename('dxos.org/type/Example');
|
|
34
|
-
`,
|
|
35
|
-
});
|
|
36
|
-
expect(result.bundle).to.exist;
|
|
37
|
-
expect(result.error).to.not.exist;
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
// TODO(dmaretskyi): Flaky on CI.
|
|
41
|
-
test.skip('HTTPS Import', async () => {
|
|
42
|
-
const bundler = new Bundler({ platform: 'node', sandboxedModules: [], remoteModules: {} });
|
|
43
|
-
const result = await bundler.bundle({
|
|
44
|
-
source: `
|
|
45
|
-
import { invariant } from 'https://esm.sh/@dxos/invariant';
|
|
46
|
-
invariant(true);
|
|
47
|
-
`,
|
|
48
|
-
});
|
|
49
|
-
expect(result.bundle).to.exist;
|
|
50
|
-
expect(result.error).to.not.exist;
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
test('Error', async () => {
|
|
54
|
-
const bundler = new Bundler({ platform: 'node', sandboxedModules: [], remoteModules: {} });
|
|
55
|
-
const result = await bundler.bundle({ source: "import missing from './module'; missing();" });
|
|
56
|
-
expect(result.bundle).to.not.exist;
|
|
57
|
-
expect(result.error).to.exist;
|
|
58
|
-
});
|
|
59
|
-
});
|