@dxos/compute 0.8.4-main.9be5663bfe → 0.8.4-main.abd8ff62ef
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/README.md +36 -1
- package/dist/lib/neutral/StorageService.mjs +22 -0
- package/dist/lib/neutral/StorageService.mjs.map +7 -0
- package/dist/lib/neutral/chunk-4N4JAXCP.mjs +17 -0
- package/dist/lib/neutral/chunk-4N4JAXCP.mjs.map +7 -0
- package/dist/lib/neutral/chunk-DDEBBRCI.mjs +62 -0
- package/dist/lib/neutral/chunk-DDEBBRCI.mjs.map +7 -0
- package/dist/lib/neutral/chunk-FEABF5XY.mjs +25 -0
- package/dist/lib/neutral/chunk-FEABF5XY.mjs.map +7 -0
- package/dist/lib/neutral/chunk-H6EHIVDN.mjs +21 -0
- package/dist/lib/neutral/chunk-H6EHIVDN.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/neutral/chunk-N462A6NO.mjs +138 -0
- package/dist/lib/neutral/chunk-N462A6NO.mjs.map +7 -0
- package/dist/lib/neutral/chunk-QPCDM7MF.mjs +179 -0
- package/dist/lib/neutral/chunk-QPCDM7MF.mjs.map +7 -0
- package/dist/lib/neutral/chunk-S24LL2D5.mjs +52 -0
- package/dist/lib/neutral/chunk-S24LL2D5.mjs.map +7 -0
- package/dist/lib/neutral/fib-HDHBZHPE.mjs +10 -0
- package/dist/lib/neutral/fib-HDHBZHPE.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +1030 -51
- package/dist/lib/neutral/index.mjs.map +4 -4
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/reply-XSQMXAPX.mjs +10 -0
- package/dist/lib/neutral/reply-XSQMXAPX.mjs.map +7 -0
- package/dist/lib/neutral/sleep-WHTJQ56P.mjs +10 -0
- package/dist/lib/neutral/sleep-WHTJQ56P.mjs.map +7 -0
- package/dist/lib/neutral/testing/index.mjs +27 -193
- package/dist/lib/neutral/testing/index.mjs.map +4 -4
- package/dist/types/src/Blueprint.d.ts +148 -0
- package/dist/types/src/Blueprint.d.ts.map +1 -0
- package/dist/types/src/Credential.d.ts +27 -0
- package/dist/types/src/Credential.d.ts.map +1 -0
- package/dist/types/src/Operation.d.ts +303 -0
- package/dist/types/src/Operation.d.ts.map +1 -0
- package/dist/types/src/OperationHandlerSet.d.ts +60 -0
- package/dist/types/src/OperationHandlerSet.d.ts.map +1 -0
- package/dist/types/src/OperationRegistry.d.ts +23 -0
- package/dist/types/src/OperationRegistry.d.ts.map +1 -0
- package/dist/types/src/Process.d.ts +247 -0
- package/dist/types/src/Process.d.ts.map +1 -0
- package/dist/types/src/Routine.d.ts +61 -0
- package/dist/types/src/Routine.d.ts.map +1 -0
- package/dist/types/src/Script.d.ts +22 -0
- package/dist/types/src/Script.d.ts.map +1 -0
- package/dist/types/src/ServiceResolver.d.ts +74 -0
- package/dist/types/src/ServiceResolver.d.ts.map +1 -0
- package/dist/types/src/StorageService.d.ts +58 -0
- package/dist/types/src/StorageService.d.ts.map +1 -0
- package/dist/types/src/Template.d.ts +56 -0
- package/dist/types/src/Template.d.ts.map +1 -0
- package/dist/types/src/Trace.d.ts +174 -0
- package/dist/types/src/Trace.d.ts.map +1 -0
- package/dist/types/src/Trigger.d.ts +150 -0
- package/dist/types/src/Trigger.d.ts.map +1 -0
- package/dist/types/src/TriggerEvent.d.ts +75 -0
- package/dist/types/src/TriggerEvent.d.ts.map +1 -0
- package/dist/types/src/errors.d.ts +239 -0
- package/dist/types/src/errors.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +15 -5
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/testing/definitions.d.ts +11 -0
- package/dist/types/src/testing/definitions.d.ts.map +1 -0
- package/dist/types/src/testing/fib.d.ts +8 -0
- package/dist/types/src/testing/fib.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +6 -4
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/reply.d.ts +4 -0
- package/dist/types/src/testing/reply.d.ts.map +1 -0
- package/dist/types/src/testing/sleep.d.ts +6 -0
- package/dist/types/src/testing/sleep.d.ts.map +1 -0
- package/dist/types/src/umbrella.test.d.ts +2 -0
- package/dist/types/src/umbrella.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +20 -34
- package/src/Blueprint.ts +221 -0
- package/src/Credential.ts +51 -0
- package/src/Operation.ts +513 -0
- package/src/OperationHandlerSet.ts +132 -0
- package/src/OperationRegistry.ts +48 -0
- package/src/Process.ts +490 -0
- package/src/Routine.ts +84 -0
- package/src/Script.ts +38 -0
- package/src/ServiceResolver.ts +174 -0
- package/src/StorageService.ts +99 -0
- package/src/Template.ts +105 -0
- package/src/Trace.ts +231 -0
- package/src/Trigger.ts +207 -0
- package/src/TriggerEvent.ts +62 -0
- package/src/errors.ts +50 -0
- package/src/index.ts +16 -6
- package/src/testing/definitions.ts +49 -0
- package/src/testing/fib.ts +22 -0
- package/src/testing/index.ts +13 -5
- package/src/testing/reply.ts +18 -0
- package/src/testing/sleep.ts +16 -0
- package/src/umbrella.test.ts +51 -0
- package/dist/lib/neutral/chunk-36MMQLBR.mjs +0 -3104
- package/dist/lib/neutral/chunk-36MMQLBR.mjs.map +0 -7
- package/dist/types/src/compute-graph-registry.d.ts +0 -37
- package/dist/types/src/compute-graph-registry.d.ts.map +0 -1
- package/dist/types/src/compute-graph-registry.test.d.ts +0 -2
- package/dist/types/src/compute-graph-registry.test.d.ts.map +0 -1
- package/dist/types/src/compute-graph.d.ts +0 -67
- package/dist/types/src/compute-graph.d.ts.map +0 -1
- package/dist/types/src/compute-graph.test.d.ts +0 -2
- package/dist/types/src/compute-graph.test.d.ts.map +0 -1
- package/dist/types/src/compute-node.d.ts +0 -24
- package/dist/types/src/compute-node.d.ts.map +0 -1
- package/dist/types/src/functions/async-function.d.ts +0 -68
- package/dist/types/src/functions/async-function.d.ts.map +0 -1
- package/dist/types/src/functions/edge-function.d.ts +0 -20
- package/dist/types/src/functions/edge-function.d.ts.map +0 -1
- package/dist/types/src/functions/function-defs.d.ts +0 -11
- package/dist/types/src/functions/function-defs.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts +0 -4
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/dist/types/src/hyperformula.test.d.ts +0 -2
- package/dist/types/src/hyperformula.test.d.ts.map +0 -1
- package/dist/types/src/testing/test-builder.d.ts +0 -15
- package/dist/types/src/testing/test-builder.d.ts.map +0 -1
- package/dist/types/src/testing/test-plugin.d.ts +0 -35
- package/dist/types/src/testing/test-plugin.d.ts.map +0 -1
- package/dist/types/src/testing/test-runtime.d.ts +0 -10
- package/dist/types/src/testing/test-runtime.d.ts.map +0 -1
- package/dist/types/src/testing/util.d.ts +0 -2
- package/dist/types/src/testing/util.d.ts.map +0 -1
- package/dist/types/src/types/hyperformula.d.ts +0 -8
- package/dist/types/src/types/hyperformula.d.ts.map +0 -1
- package/dist/types/src/types/index.d.ts +0 -3
- package/dist/types/src/types/index.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -20
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/dist/types/src/types/types.test.d.ts +0 -2
- package/dist/types/src/types/types.test.d.ts.map +0 -1
- package/dist/types/src/util.d.ts +0 -2
- package/dist/types/src/util.d.ts.map +0 -1
- package/src/compute-graph-registry.test.ts +0 -167
- package/src/compute-graph-registry.ts +0 -97
- package/src/compute-graph.test.ts +0 -139
- package/src/compute-graph.ts +0 -266
- package/src/compute-node.ts +0 -59
- package/src/functions/async-function.ts +0 -184
- package/src/functions/edge-function.ts +0 -113
- package/src/functions/function-defs.ts +0 -2427
- package/src/functions/index.ts +0 -7
- package/src/hyperformula.test.ts +0 -14
- package/src/testing/test-builder.ts +0 -59
- package/src/testing/test-plugin.ts +0 -98
- package/src/testing/test-runtime.ts +0 -36
- package/src/testing/util.ts +0 -9
- package/src/types/hyperformula.ts +0 -19
- package/src/types/index.ts +0 -6
- package/src/types/types.test.ts +0 -91
- package/src/types/types.ts +0 -80
- package/src/util.ts +0 -8
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import * as Context from 'effect/Context';
|
|
2
|
+
import * as Effect from 'effect/Effect';
|
|
3
|
+
import * as Layer from 'effect/Layer';
|
|
4
|
+
import * as Schema from 'effect/Schema';
|
|
5
|
+
import { Type } from '@dxos/echo';
|
|
6
|
+
/**
|
|
7
|
+
* Writes ephemeral or persistent events to the trace.
|
|
8
|
+
* Exposed to processes and operations to record events to the trace.
|
|
9
|
+
*/
|
|
10
|
+
export interface TraceWriter {
|
|
11
|
+
write<T>(eventType: EventType<T>, payload: NoInfer<T>): void;
|
|
12
|
+
}
|
|
13
|
+
declare const TraceService_base: Context.TagClass<TraceService, "@dxos/functions/TraceService", TraceWriter>;
|
|
14
|
+
/**
|
|
15
|
+
* Service that writes events to the trace.
|
|
16
|
+
* Exposed to processes and operations to record events to the trace.
|
|
17
|
+
*/
|
|
18
|
+
export declare class TraceService extends TraceService_base {
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Writes an event to the trace.
|
|
22
|
+
*/
|
|
23
|
+
export declare function write<T>(eventType: EventType<T>, payload: NoInfer<T>): Effect.Effect<void, never, TraceService>;
|
|
24
|
+
/**
|
|
25
|
+
* Defines an event type for the trace.
|
|
26
|
+
*/
|
|
27
|
+
export interface EventType<T> {
|
|
28
|
+
readonly key: string;
|
|
29
|
+
readonly schema: Schema.Schema<T, any>;
|
|
30
|
+
readonly isEphemeral: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare const EventType: <T>(key: string, opts: {
|
|
33
|
+
schema: Schema.Schema<T, any>;
|
|
34
|
+
isEphemeral: boolean;
|
|
35
|
+
}) => EventType<T>;
|
|
36
|
+
/**
|
|
37
|
+
* Extracts the payload type from an event type.
|
|
38
|
+
*/
|
|
39
|
+
export type PayloadType<E extends EventType<any>> = E extends EventType<infer T> ? T : never;
|
|
40
|
+
export declare const Event: Schema.Struct<{
|
|
41
|
+
timestamp: typeof Schema.Number;
|
|
42
|
+
type: typeof Schema.String;
|
|
43
|
+
data: typeof Schema.Unknown;
|
|
44
|
+
}>;
|
|
45
|
+
export interface Event extends Schema.Schema.Type<typeof Event> {
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Checks if an event is of a given type.
|
|
49
|
+
*/
|
|
50
|
+
export declare const isOfType: <T, E extends Event>(eventType: EventType<T>, event: E) => event is E & {
|
|
51
|
+
data: T;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Metadata on the context of a trace message.
|
|
55
|
+
*/
|
|
56
|
+
export declare const Meta: Schema.Struct<{
|
|
57
|
+
pid: Schema.optional<typeof Schema.String>;
|
|
58
|
+
parentPid: Schema.optional<typeof Schema.String>;
|
|
59
|
+
processName: Schema.optional<typeof Schema.String>;
|
|
60
|
+
/**
|
|
61
|
+
* ID of the conversation feed object if present.
|
|
62
|
+
*/
|
|
63
|
+
conversationId: Schema.optional<import("@dxos/keys").ObjectIdClass>;
|
|
64
|
+
/**
|
|
65
|
+
* ID of the trigger object if invocation resulted from a trigger.
|
|
66
|
+
*/
|
|
67
|
+
triggerId: Schema.optional<import("@dxos/keys").ObjectIdClass>;
|
|
68
|
+
/**
|
|
69
|
+
* ID of the tool call that created the current process.
|
|
70
|
+
*/
|
|
71
|
+
toolCallId: Schema.optional<typeof Schema.String>;
|
|
72
|
+
}>;
|
|
73
|
+
export interface Meta extends Schema.Schema.Type<typeof Meta> {
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Envelope for a set of events.
|
|
77
|
+
*/
|
|
78
|
+
export declare const MessageData: Schema.Struct<{
|
|
79
|
+
meta: Schema.Struct<{
|
|
80
|
+
pid: Schema.optional<typeof Schema.String>;
|
|
81
|
+
parentPid: Schema.optional<typeof Schema.String>;
|
|
82
|
+
processName: Schema.optional<typeof Schema.String>;
|
|
83
|
+
/**
|
|
84
|
+
* ID of the conversation feed object if present.
|
|
85
|
+
*/
|
|
86
|
+
conversationId: Schema.optional<import("@dxos/keys").ObjectIdClass>;
|
|
87
|
+
/**
|
|
88
|
+
* ID of the trigger object if invocation resulted from a trigger.
|
|
89
|
+
*/
|
|
90
|
+
triggerId: Schema.optional<import("@dxos/keys").ObjectIdClass>;
|
|
91
|
+
/**
|
|
92
|
+
* ID of the tool call that created the current process.
|
|
93
|
+
*/
|
|
94
|
+
toolCallId: Schema.optional<typeof Schema.String>;
|
|
95
|
+
}>;
|
|
96
|
+
isEphemeral: typeof Schema.Boolean;
|
|
97
|
+
events: Schema.Array$<Schema.Struct<{
|
|
98
|
+
timestamp: typeof Schema.Number;
|
|
99
|
+
type: typeof Schema.String;
|
|
100
|
+
data: typeof Schema.Unknown;
|
|
101
|
+
}>>;
|
|
102
|
+
}>;
|
|
103
|
+
export interface MessageData extends Schema.Schema.Type<typeof MessageData> {
|
|
104
|
+
}
|
|
105
|
+
export declare const Message: Type.Obj<{
|
|
106
|
+
readonly meta: {
|
|
107
|
+
readonly pid?: string | undefined;
|
|
108
|
+
readonly parentPid?: string | undefined;
|
|
109
|
+
readonly processName?: string | undefined;
|
|
110
|
+
readonly conversationId?: string | undefined;
|
|
111
|
+
readonly triggerId?: string | undefined;
|
|
112
|
+
readonly toolCallId?: string | undefined;
|
|
113
|
+
};
|
|
114
|
+
readonly isEphemeral: boolean;
|
|
115
|
+
readonly events: readonly {
|
|
116
|
+
readonly timestamp: number;
|
|
117
|
+
readonly type: string;
|
|
118
|
+
readonly data: unknown;
|
|
119
|
+
}[];
|
|
120
|
+
}, Schema.Struct.Fields>;
|
|
121
|
+
export interface Message extends Schema.Schema.Type<typeof Message> {
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Sink for complete trace messages.
|
|
125
|
+
*/
|
|
126
|
+
export interface Sink {
|
|
127
|
+
write(message: Message): void;
|
|
128
|
+
}
|
|
129
|
+
declare const TraceSink_base: Context.TagClass<TraceSink, "@dxos/functions/TraceSink", Sink>;
|
|
130
|
+
/**
|
|
131
|
+
* Sink for complete trace messages.
|
|
132
|
+
* The Process Manager forwards trace messages to it.
|
|
133
|
+
*/
|
|
134
|
+
export declare class TraceSink extends TraceSink_base {
|
|
135
|
+
}
|
|
136
|
+
export declare const noopWriter: TraceWriter;
|
|
137
|
+
export declare const writerLayerNoop: Layer.Layer<TraceService>;
|
|
138
|
+
export declare const layerNoop: Layer.Layer<TraceSink>;
|
|
139
|
+
export declare const layerConsole: Layer.Layer<TraceSink>;
|
|
140
|
+
export declare const testTraceService: (opts?: {
|
|
141
|
+
meta?: Meta;
|
|
142
|
+
}) => Layer.Layer<TraceService, never, TraceSink>;
|
|
143
|
+
/**
|
|
144
|
+
* Outcome of an operation invocation.
|
|
145
|
+
*/
|
|
146
|
+
export type OperationOutcome = 'success' | 'failure';
|
|
147
|
+
/**
|
|
148
|
+
* Operation invocation started.
|
|
149
|
+
*/
|
|
150
|
+
export declare const OperationStart: EventType<{
|
|
151
|
+
readonly key: string;
|
|
152
|
+
readonly name?: string | undefined;
|
|
153
|
+
}>;
|
|
154
|
+
/**
|
|
155
|
+
* Operation invocation ended.
|
|
156
|
+
*/
|
|
157
|
+
export declare const OperationEnd: EventType<{
|
|
158
|
+
readonly key: string;
|
|
159
|
+
readonly name?: string | undefined;
|
|
160
|
+
readonly outcome: "failure" | "success";
|
|
161
|
+
readonly error?: string | undefined;
|
|
162
|
+
}>;
|
|
163
|
+
/**
|
|
164
|
+
* Human-readable status update emitted by an agent or operation.
|
|
165
|
+
*/
|
|
166
|
+
export declare const StatusUpdate: EventType<{
|
|
167
|
+
readonly message: string;
|
|
168
|
+
}>;
|
|
169
|
+
/**
|
|
170
|
+
* Emit the current human-readable execution status to the trace.
|
|
171
|
+
*/
|
|
172
|
+
export declare const emitStatus: (message: string) => Effect.Effect<void, never, TraceService>;
|
|
173
|
+
export {};
|
|
174
|
+
//# sourceMapping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A2C,CAAC;AAElG,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS,CAE3C,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS,CAI9C,CAAC;AAEH,eAAO,MAAM,gBAAgB,UAAU;IAAE,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,KAAQ,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,EAAE,SAAS,CAiBrG,CAAC;AAMJ;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,SAAS,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,cAAc;;;EAQzB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;EAYvB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY;;EAMvB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,YAAY,CACnD,CAAC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
import { Feed, Obj, QueryAST, Type, type Query } from '@dxos/echo';
|
|
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 const Kinds: readonly ['email', 'queue', 'subscription', 'timer', 'webhook'];
|
|
9
|
+
export type Kind = (typeof Kinds)[number];
|
|
10
|
+
export declare const EmailSpec: Schema.Struct<{
|
|
11
|
+
kind: Schema.Literal<["email"]>;
|
|
12
|
+
}>;
|
|
13
|
+
export type EmailSpec = Schema.Schema.Type<typeof EmailSpec>;
|
|
14
|
+
/**
|
|
15
|
+
* Construct an Email trigger spec.
|
|
16
|
+
*/
|
|
17
|
+
export declare const specEmail: () => EmailSpec;
|
|
18
|
+
export declare const QueueSpec: Schema.Struct<{
|
|
19
|
+
kind: Schema.Literal<["queue"]>;
|
|
20
|
+
queue: Schema.refine<string, typeof Schema.NonEmptyString>;
|
|
21
|
+
}>;
|
|
22
|
+
export type QueueSpec = Schema.Schema.Type<typeof QueueSpec>;
|
|
23
|
+
/**
|
|
24
|
+
* Construct a Queue trigger spec from a queue DXN string.
|
|
25
|
+
*/
|
|
26
|
+
export declare const specQueue: (queueDxn: string) => QueueSpec;
|
|
27
|
+
/**
|
|
28
|
+
* Construct a Queue trigger spec from a Feed object.
|
|
29
|
+
*/
|
|
30
|
+
export declare const specFeed: (feed: Feed.Feed) => QueueSpec;
|
|
31
|
+
/**
|
|
32
|
+
* Subscription.
|
|
33
|
+
*/
|
|
34
|
+
export declare const SubscriptionSpec: Schema.Struct<{
|
|
35
|
+
kind: Schema.Literal<["subscription"]>;
|
|
36
|
+
query: Schema.Struct<{
|
|
37
|
+
raw: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
38
|
+
ast: Schema.Schema<QueryAST.QueryFilterClause | QueryAST.QueryFromClause | QueryAST.QueryHierarchyTraversalClause | QueryAST.QueryIncomingReferencesClause | QueryAST.QueryLimitClause | QueryAST.QueryOptionsClause | QueryAST.QueryOrderClause | QueryAST.QueryReferenceTraversalClause | QueryAST.QueryRelationClause | QueryAST.QueryRelationTraversalClause | QueryAST.QuerySelectClause | QueryAST.QuerySetDifferenceClause | QueryAST.QueryUnionClause, QueryAST.QueryFilterClause | QueryAST.QueryFromClause | QueryAST.QueryHierarchyTraversalClause | QueryAST.QueryIncomingReferencesClause | QueryAST.QueryLimitClause | QueryAST.QueryOptionsClause | QueryAST.QueryOrderClause | QueryAST.QueryReferenceTraversalClause | QueryAST.QueryRelationClause | QueryAST.QueryRelationTraversalClause | QueryAST.QuerySelectClause | QueryAST.QuerySetDifferenceClause | QueryAST.QueryUnionClause, never>;
|
|
39
|
+
}>;
|
|
40
|
+
options: Schema.optional<Schema.Struct<{
|
|
41
|
+
deep: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
42
|
+
delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
43
|
+
}>>;
|
|
44
|
+
}>;
|
|
45
|
+
export type SubscriptionSpec = Schema.Schema.Type<typeof SubscriptionSpec>;
|
|
46
|
+
/**
|
|
47
|
+
* Construct a Subscription trigger spec from a Query object.
|
|
48
|
+
*/
|
|
49
|
+
export declare const specSubscription: (query: Query.Query<any>, options?: {
|
|
50
|
+
deep?: boolean;
|
|
51
|
+
delay?: number;
|
|
52
|
+
}) => SubscriptionSpec;
|
|
53
|
+
/**
|
|
54
|
+
* Cron timer.
|
|
55
|
+
*/
|
|
56
|
+
export declare const TimerSpec: Schema.Struct<{
|
|
57
|
+
kind: Schema.Literal<["timer"]>;
|
|
58
|
+
cron: Schema.SchemaClass<string, string, never>;
|
|
59
|
+
}>;
|
|
60
|
+
export type TimerSpec = Schema.Schema.Type<typeof TimerSpec>;
|
|
61
|
+
/**
|
|
62
|
+
* Construct a Timer trigger spec from a cron string.
|
|
63
|
+
*/
|
|
64
|
+
export declare const specTimer: (cron: string) => TimerSpec;
|
|
65
|
+
/**
|
|
66
|
+
* Webhook.
|
|
67
|
+
*/
|
|
68
|
+
export declare const WebhookSpec: Schema.Struct<{
|
|
69
|
+
kind: Schema.Literal<["webhook"]>;
|
|
70
|
+
method: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
71
|
+
port: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
72
|
+
}>;
|
|
73
|
+
export type WebhookSpec = Schema.Schema.Type<typeof WebhookSpec>;
|
|
74
|
+
/**
|
|
75
|
+
* Construct a Webhook trigger spec from a method and port.
|
|
76
|
+
*/
|
|
77
|
+
export declare const specWebhook: (opts?: {
|
|
78
|
+
method?: string;
|
|
79
|
+
port?: number;
|
|
80
|
+
}) => WebhookSpec;
|
|
81
|
+
/**
|
|
82
|
+
* Trigger schema.
|
|
83
|
+
*/
|
|
84
|
+
export declare const Spec: Schema.Union<[Schema.Struct<{
|
|
85
|
+
kind: Schema.Literal<["email"]>;
|
|
86
|
+
}>, Schema.Struct<{
|
|
87
|
+
kind: Schema.Literal<["queue"]>;
|
|
88
|
+
queue: Schema.refine<string, typeof Schema.NonEmptyString>;
|
|
89
|
+
}>, Schema.Struct<{
|
|
90
|
+
kind: Schema.Literal<["subscription"]>;
|
|
91
|
+
query: Schema.Struct<{
|
|
92
|
+
raw: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
93
|
+
ast: Schema.Schema<QueryAST.QueryFilterClause | QueryAST.QueryFromClause | QueryAST.QueryHierarchyTraversalClause | QueryAST.QueryIncomingReferencesClause | QueryAST.QueryLimitClause | QueryAST.QueryOptionsClause | QueryAST.QueryOrderClause | QueryAST.QueryReferenceTraversalClause | QueryAST.QueryRelationClause | QueryAST.QueryRelationTraversalClause | QueryAST.QuerySelectClause | QueryAST.QuerySetDifferenceClause | QueryAST.QueryUnionClause, QueryAST.QueryFilterClause | QueryAST.QueryFromClause | QueryAST.QueryHierarchyTraversalClause | QueryAST.QueryIncomingReferencesClause | QueryAST.QueryLimitClause | QueryAST.QueryOptionsClause | QueryAST.QueryOrderClause | QueryAST.QueryReferenceTraversalClause | QueryAST.QueryRelationClause | QueryAST.QueryRelationTraversalClause | QueryAST.QuerySelectClause | QueryAST.QuerySetDifferenceClause | QueryAST.QueryUnionClause, never>;
|
|
94
|
+
}>;
|
|
95
|
+
options: Schema.optional<Schema.Struct<{
|
|
96
|
+
deep: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
97
|
+
delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
98
|
+
}>>;
|
|
99
|
+
}>, Schema.Struct<{
|
|
100
|
+
kind: Schema.Literal<["timer"]>;
|
|
101
|
+
cron: Schema.SchemaClass<string, string, never>;
|
|
102
|
+
}>, Schema.Struct<{
|
|
103
|
+
kind: Schema.Literal<["webhook"]>;
|
|
104
|
+
method: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
105
|
+
port: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
106
|
+
}>]>;
|
|
107
|
+
export type Spec = Schema.Schema.Type<typeof Spec>;
|
|
108
|
+
/**
|
|
109
|
+
* Function trigger.
|
|
110
|
+
* Function is invoked with the `payload` passed as input data.
|
|
111
|
+
* The event that triggers the function is available in the function context.
|
|
112
|
+
*/
|
|
113
|
+
declare const TriggerSchema: Type.Obj<{
|
|
114
|
+
readonly function?: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown> | undefined;
|
|
115
|
+
readonly inputNodeId?: string | undefined;
|
|
116
|
+
readonly enabled?: boolean | undefined;
|
|
117
|
+
readonly spec?: {
|
|
118
|
+
readonly kind: "email";
|
|
119
|
+
} | {
|
|
120
|
+
readonly kind: "queue";
|
|
121
|
+
readonly queue: string;
|
|
122
|
+
} | {
|
|
123
|
+
readonly kind: "subscription";
|
|
124
|
+
readonly query: {
|
|
125
|
+
readonly raw?: string | undefined;
|
|
126
|
+
readonly ast: QueryAST.QueryFilterClause | QueryAST.QueryFromClause | QueryAST.QueryHierarchyTraversalClause | QueryAST.QueryIncomingReferencesClause | QueryAST.QueryLimitClause | QueryAST.QueryOptionsClause | QueryAST.QueryOrderClause | QueryAST.QueryReferenceTraversalClause | QueryAST.QueryRelationClause | QueryAST.QueryRelationTraversalClause | QueryAST.QuerySelectClause | QueryAST.QuerySetDifferenceClause | QueryAST.QueryUnionClause;
|
|
127
|
+
};
|
|
128
|
+
readonly options?: {
|
|
129
|
+
readonly deep?: boolean | undefined;
|
|
130
|
+
readonly delay?: number | undefined;
|
|
131
|
+
} | undefined;
|
|
132
|
+
} | {
|
|
133
|
+
readonly kind: "timer";
|
|
134
|
+
readonly cron: string;
|
|
135
|
+
} | {
|
|
136
|
+
readonly kind: "webhook";
|
|
137
|
+
readonly method?: string | undefined;
|
|
138
|
+
readonly port?: number | undefined;
|
|
139
|
+
} | undefined;
|
|
140
|
+
readonly concurrency?: number | undefined;
|
|
141
|
+
readonly input?: {
|
|
142
|
+
readonly [x: string]: any;
|
|
143
|
+
} | undefined;
|
|
144
|
+
}, Schema.Struct.Fields>;
|
|
145
|
+
export interface Trigger extends Schema.Schema.Type<typeof TriggerSchema> {
|
|
146
|
+
}
|
|
147
|
+
export declare const Trigger: Type.Obj<Trigger>;
|
|
148
|
+
export declare const make: (props: Obj.MakeProps<typeof Trigger>) => Obj.OfShape<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Trigger>;
|
|
149
|
+
export {};
|
|
150
|
+
//# sourceMappingURL=Trigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Trigger.d.ts","sourceRoot":"","sources":["../../../src/Trigger.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAc,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAO,IAAI,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAKpF;;;;GAIG;AACH,eAAO,MAAM,KAAK,YAAI,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,SAAS,CAAU,CAAC;AACrF,MAAM,MAAM,IAAI,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC;AAI1C,eAAO,MAAM,SAAS;;EAEpB,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,SAAS,QAAO,SAAgC,CAAC;AAI9D,eAAO,MAAM,SAAS;;;EAKpB,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SA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;;;wBAgDlB,CAAC;AAEF,MAAM,WAAW,OAAQ,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,aAAa,CAAC;CAAG;AAC5E,eAAO,MAAM,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAwB,CAAC;AAE/D,eAAO,MAAM,IAAI,UAAW,GAAG,CAAC,SAAS,CAAC,OAAO,OAAO,CAAC,+GAA6B,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
import { Obj, Ref } from '@dxos/echo';
|
|
3
|
+
export declare const EmailEvent: Schema.Struct<{
|
|
4
|
+
from: typeof Schema.String;
|
|
5
|
+
to: typeof Schema.String;
|
|
6
|
+
subject: typeof Schema.String;
|
|
7
|
+
created: typeof Schema.String;
|
|
8
|
+
body: typeof Schema.String;
|
|
9
|
+
}>;
|
|
10
|
+
export type EmailEvent = Schema.Schema.Type<typeof EmailEvent>;
|
|
11
|
+
export declare const QueueEvent: Schema.Struct<{
|
|
12
|
+
queue: Schema.refine<string, typeof Schema.NonEmptyString>;
|
|
13
|
+
item: typeof Schema.Any;
|
|
14
|
+
cursor: typeof Schema.String;
|
|
15
|
+
}>;
|
|
16
|
+
export type QueueEvent = Schema.Schema.Type<typeof QueueEvent>;
|
|
17
|
+
export declare const SubscriptionEvent: Schema.Struct<{
|
|
18
|
+
/**
|
|
19
|
+
* Type of the mutation.
|
|
20
|
+
*/
|
|
21
|
+
type: typeof Schema.String;
|
|
22
|
+
/**
|
|
23
|
+
* Reference to the object that was changed or created.
|
|
24
|
+
*/
|
|
25
|
+
subject: Ref.RefSchema<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>;
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated
|
|
28
|
+
*/
|
|
29
|
+
changedObjectId: Schema.optional<typeof Schema.String>;
|
|
30
|
+
}>;
|
|
31
|
+
export type SubscriptionEvent = Schema.Schema.Type<typeof SubscriptionEvent>;
|
|
32
|
+
export declare const TimerEvent: Schema.Struct<{
|
|
33
|
+
tick: typeof Schema.Number;
|
|
34
|
+
}>;
|
|
35
|
+
export type TimerEvent = Schema.Schema.Type<typeof TimerEvent>;
|
|
36
|
+
export declare const WebhookEvent: Schema.Struct<{
|
|
37
|
+
url: typeof Schema.String;
|
|
38
|
+
method: Schema.Literal<["GET", "POST"]>;
|
|
39
|
+
headers: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
40
|
+
bodyText: typeof Schema.String;
|
|
41
|
+
}>;
|
|
42
|
+
export type WebhookEvent = Schema.Schema.Type<typeof WebhookEvent>;
|
|
43
|
+
export declare const TriggerEvent: Schema.Union<[Schema.Struct<{
|
|
44
|
+
from: typeof Schema.String;
|
|
45
|
+
to: typeof Schema.String;
|
|
46
|
+
subject: typeof Schema.String;
|
|
47
|
+
created: typeof Schema.String;
|
|
48
|
+
body: typeof Schema.String;
|
|
49
|
+
}>, Schema.Struct<{
|
|
50
|
+
queue: Schema.refine<string, typeof Schema.NonEmptyString>;
|
|
51
|
+
item: typeof Schema.Any;
|
|
52
|
+
cursor: typeof Schema.String;
|
|
53
|
+
}>, Schema.Struct<{
|
|
54
|
+
/**
|
|
55
|
+
* Type of the mutation.
|
|
56
|
+
*/
|
|
57
|
+
type: typeof Schema.String;
|
|
58
|
+
/**
|
|
59
|
+
* Reference to the object that was changed or created.
|
|
60
|
+
*/
|
|
61
|
+
subject: Ref.RefSchema<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>;
|
|
62
|
+
/**
|
|
63
|
+
* @deprecated
|
|
64
|
+
*/
|
|
65
|
+
changedObjectId: Schema.optional<typeof Schema.String>;
|
|
66
|
+
}>, Schema.Struct<{
|
|
67
|
+
tick: typeof Schema.Number;
|
|
68
|
+
}>, Schema.Struct<{
|
|
69
|
+
url: typeof Schema.String;
|
|
70
|
+
method: Schema.Literal<["GET", "POST"]>;
|
|
71
|
+
headers: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
72
|
+
bodyText: typeof Schema.String;
|
|
73
|
+
}>]>;
|
|
74
|
+
export type TriggerEvent = Schema.Schema.Type<typeof TriggerEvent>;
|
|
75
|
+
//# sourceMappingURL=TriggerEvent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TriggerEvent.d.ts","sourceRoot":"","sources":["../../../src/TriggerEvent.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAO,GAAG,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAQ3C,eAAO,MAAM,UAAU;;;;;;EAMrB,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;AAE/D,eAAO,MAAM,UAAU;;;;EAIrB,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;AAE/D,eAAO,MAAM,iBAAiB;IAC5B;;OAEG;;IAIH;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE7E,eAAO,MAAM,UAAU;;EAAyC,CAAC;AACjE,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;AAE/D,eAAO,MAAM,YAAY;;;;;EAKvB,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,YAAY,CAAC,CAAC;AAEnE,eAAO,MAAM,YAAY;;;;;;;;;;;IA7BvB;;OAEG;;IAIH;;OAEG;;IAGH;;OAEG;;;;;;;;;IAgBwG,CAAC;AAC9G,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { BaseError, type BaseErrorOptions } from '@dxos/errors';
|
|
2
|
+
declare const InvokerNotInitializedError_base: {
|
|
3
|
+
new (options?: BaseErrorOptions): {
|
|
4
|
+
cause?: unknown;
|
|
5
|
+
stack?: string;
|
|
6
|
+
name: "InvokerNotInitializedError";
|
|
7
|
+
context: Record<string, unknown>;
|
|
8
|
+
readonly message: string;
|
|
9
|
+
readonly _tag: "InvokerNotInitializedError";
|
|
10
|
+
};
|
|
11
|
+
isError(error: unknown): error is Error;
|
|
12
|
+
name: "InvokerNotInitializedError";
|
|
13
|
+
is(error: unknown): error is BaseError;
|
|
14
|
+
wrap(options?: Omit<BaseErrorOptions, 'cause'> & {
|
|
15
|
+
ifTypeDiffers?: boolean;
|
|
16
|
+
}): (error: unknown) => {
|
|
17
|
+
cause?: unknown;
|
|
18
|
+
stack?: string;
|
|
19
|
+
name: "InvokerNotInitializedError";
|
|
20
|
+
context: Record<string, unknown>;
|
|
21
|
+
readonly message: string;
|
|
22
|
+
readonly _tag: "InvokerNotInitializedError";
|
|
23
|
+
};
|
|
24
|
+
extend<Name extends string = string>(name: Name, message?: string): any;
|
|
25
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
26
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
27
|
+
stackTraceLimit: number;
|
|
28
|
+
};
|
|
29
|
+
export declare class InvokerNotInitializedError extends InvokerNotInitializedError_base {
|
|
30
|
+
constructor();
|
|
31
|
+
}
|
|
32
|
+
declare const NoHandlerError_base: {
|
|
33
|
+
new (options?: BaseErrorOptions): {
|
|
34
|
+
cause?: unknown;
|
|
35
|
+
stack?: string;
|
|
36
|
+
name: "NoHandlerError";
|
|
37
|
+
context: Record<string, unknown>;
|
|
38
|
+
readonly message: string;
|
|
39
|
+
readonly _tag: "NoHandlerError";
|
|
40
|
+
};
|
|
41
|
+
isError(error: unknown): error is Error;
|
|
42
|
+
name: "NoHandlerError";
|
|
43
|
+
is(error: unknown): error is BaseError;
|
|
44
|
+
wrap(options?: Omit<BaseErrorOptions, 'cause'> & {
|
|
45
|
+
ifTypeDiffers?: boolean;
|
|
46
|
+
}): (error: unknown) => {
|
|
47
|
+
cause?: unknown;
|
|
48
|
+
stack?: string;
|
|
49
|
+
name: "NoHandlerError";
|
|
50
|
+
context: Record<string, unknown>;
|
|
51
|
+
readonly message: string;
|
|
52
|
+
readonly _tag: "NoHandlerError";
|
|
53
|
+
};
|
|
54
|
+
extend<Name extends string = string>(name: Name, message?: string): any;
|
|
55
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
56
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
57
|
+
stackTraceLimit: number;
|
|
58
|
+
};
|
|
59
|
+
export declare class NoHandlerError extends NoHandlerError_base {
|
|
60
|
+
constructor(operationKey: string);
|
|
61
|
+
}
|
|
62
|
+
declare const ServiceNotAvailableError_base: {
|
|
63
|
+
new (options?: BaseErrorOptions): {
|
|
64
|
+
cause?: unknown;
|
|
65
|
+
stack?: string;
|
|
66
|
+
name: "ServiceNotAvailable";
|
|
67
|
+
context: Record<string, unknown>;
|
|
68
|
+
readonly message: string;
|
|
69
|
+
readonly _tag: "ServiceNotAvailable";
|
|
70
|
+
};
|
|
71
|
+
isError(error: unknown): error is Error;
|
|
72
|
+
name: "ServiceNotAvailable";
|
|
73
|
+
is(error: unknown): error is BaseError;
|
|
74
|
+
wrap(options?: Omit<BaseErrorOptions, 'cause'> & {
|
|
75
|
+
ifTypeDiffers?: boolean;
|
|
76
|
+
}): (error: unknown) => {
|
|
77
|
+
cause?: unknown;
|
|
78
|
+
stack?: string;
|
|
79
|
+
name: "ServiceNotAvailable";
|
|
80
|
+
context: Record<string, unknown>;
|
|
81
|
+
readonly message: string;
|
|
82
|
+
readonly _tag: "ServiceNotAvailable";
|
|
83
|
+
};
|
|
84
|
+
extend<Name extends string = string>(name: Name, message?: string): any;
|
|
85
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
86
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
87
|
+
stackTraceLimit: number;
|
|
88
|
+
};
|
|
89
|
+
export declare class ServiceNotAvailableError extends ServiceNotAvailableError_base {
|
|
90
|
+
constructor(service: string, options?: Omit<BaseErrorOptions, 'context'>);
|
|
91
|
+
}
|
|
92
|
+
declare const FunctionNotFoundError_base: {
|
|
93
|
+
new (options?: BaseErrorOptions): {
|
|
94
|
+
cause?: unknown;
|
|
95
|
+
stack?: string;
|
|
96
|
+
name: "FunctionNotFound";
|
|
97
|
+
context: Record<string, unknown>;
|
|
98
|
+
readonly message: string;
|
|
99
|
+
readonly _tag: "FunctionNotFound";
|
|
100
|
+
};
|
|
101
|
+
isError(error: unknown): error is Error;
|
|
102
|
+
name: "FunctionNotFound";
|
|
103
|
+
is(error: unknown): error is BaseError;
|
|
104
|
+
wrap(options?: Omit<BaseErrorOptions, 'cause'> & {
|
|
105
|
+
ifTypeDiffers?: boolean;
|
|
106
|
+
}): (error: unknown) => {
|
|
107
|
+
cause?: unknown;
|
|
108
|
+
stack?: string;
|
|
109
|
+
name: "FunctionNotFound";
|
|
110
|
+
context: Record<string, unknown>;
|
|
111
|
+
readonly message: string;
|
|
112
|
+
readonly _tag: "FunctionNotFound";
|
|
113
|
+
};
|
|
114
|
+
extend<Name extends string = string>(name: Name, message?: string): any;
|
|
115
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
116
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
117
|
+
stackTraceLimit: number;
|
|
118
|
+
};
|
|
119
|
+
export declare class FunctionNotFoundError extends FunctionNotFoundError_base {
|
|
120
|
+
constructor(functionKey: string, options?: Omit<BaseErrorOptions, 'context'>);
|
|
121
|
+
}
|
|
122
|
+
declare const FunctionError_base: {
|
|
123
|
+
new (options?: BaseErrorOptions): {
|
|
124
|
+
cause?: unknown;
|
|
125
|
+
stack?: string;
|
|
126
|
+
name: "FunctionError";
|
|
127
|
+
context: Record<string, unknown>;
|
|
128
|
+
readonly message: string;
|
|
129
|
+
readonly _tag: "FunctionError";
|
|
130
|
+
};
|
|
131
|
+
isError(error: unknown): error is Error;
|
|
132
|
+
name: "FunctionError";
|
|
133
|
+
is(error: unknown): error is BaseError;
|
|
134
|
+
wrap(options?: Omit<BaseErrorOptions, 'cause'> & {
|
|
135
|
+
ifTypeDiffers?: boolean;
|
|
136
|
+
}): (error: unknown) => {
|
|
137
|
+
cause?: unknown;
|
|
138
|
+
stack?: string;
|
|
139
|
+
name: "FunctionError";
|
|
140
|
+
context: Record<string, unknown>;
|
|
141
|
+
readonly message: string;
|
|
142
|
+
readonly _tag: "FunctionError";
|
|
143
|
+
};
|
|
144
|
+
extend<Name extends string = string>(name: Name, message?: string): any;
|
|
145
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
146
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
147
|
+
stackTraceLimit: number;
|
|
148
|
+
};
|
|
149
|
+
export declare class FunctionError extends FunctionError_base {
|
|
150
|
+
}
|
|
151
|
+
declare const InvalidOperationInputError_base: {
|
|
152
|
+
new (options?: BaseErrorOptions): {
|
|
153
|
+
cause?: unknown;
|
|
154
|
+
stack?: string;
|
|
155
|
+
name: "InvalidOperationInput";
|
|
156
|
+
context: Record<string, unknown>;
|
|
157
|
+
readonly message: string;
|
|
158
|
+
readonly _tag: "InvalidOperationInput";
|
|
159
|
+
};
|
|
160
|
+
isError(error: unknown): error is Error;
|
|
161
|
+
name: "InvalidOperationInput";
|
|
162
|
+
is(error: unknown): error is BaseError;
|
|
163
|
+
wrap(options?: Omit<BaseErrorOptions, 'cause'> & {
|
|
164
|
+
ifTypeDiffers?: boolean;
|
|
165
|
+
}): (error: unknown) => {
|
|
166
|
+
cause?: unknown;
|
|
167
|
+
stack?: string;
|
|
168
|
+
name: "InvalidOperationInput";
|
|
169
|
+
context: Record<string, unknown>;
|
|
170
|
+
readonly message: string;
|
|
171
|
+
readonly _tag: "InvalidOperationInput";
|
|
172
|
+
};
|
|
173
|
+
extend<Name extends string = string>(name: Name, message?: string): any;
|
|
174
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
175
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
176
|
+
stackTraceLimit: number;
|
|
177
|
+
};
|
|
178
|
+
export declare class InvalidOperationInputError extends InvalidOperationInputError_base {
|
|
179
|
+
}
|
|
180
|
+
declare const InvalidOperationOutputError_base: {
|
|
181
|
+
new (options?: BaseErrorOptions): {
|
|
182
|
+
cause?: unknown;
|
|
183
|
+
stack?: string;
|
|
184
|
+
name: "InvalidOperationOutput";
|
|
185
|
+
context: Record<string, unknown>;
|
|
186
|
+
readonly message: string;
|
|
187
|
+
readonly _tag: "InvalidOperationOutput";
|
|
188
|
+
};
|
|
189
|
+
isError(error: unknown): error is Error;
|
|
190
|
+
name: "InvalidOperationOutput";
|
|
191
|
+
is(error: unknown): error is BaseError;
|
|
192
|
+
wrap(options?: Omit<BaseErrorOptions, 'cause'> & {
|
|
193
|
+
ifTypeDiffers?: boolean;
|
|
194
|
+
}): (error: unknown) => {
|
|
195
|
+
cause?: unknown;
|
|
196
|
+
stack?: string;
|
|
197
|
+
name: "InvalidOperationOutput";
|
|
198
|
+
context: Record<string, unknown>;
|
|
199
|
+
readonly message: string;
|
|
200
|
+
readonly _tag: "InvalidOperationOutput";
|
|
201
|
+
};
|
|
202
|
+
extend<Name extends string = string>(name: Name, message?: string): any;
|
|
203
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
204
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
205
|
+
stackTraceLimit: number;
|
|
206
|
+
};
|
|
207
|
+
export declare class InvalidOperationOutputError extends InvalidOperationOutputError_base {
|
|
208
|
+
}
|
|
209
|
+
declare const TriggerStateNotFoundError_base: {
|
|
210
|
+
new (options?: BaseErrorOptions): {
|
|
211
|
+
cause?: unknown;
|
|
212
|
+
stack?: string;
|
|
213
|
+
name: "TriggerStateNotFound";
|
|
214
|
+
context: Record<string, unknown>;
|
|
215
|
+
readonly message: string;
|
|
216
|
+
readonly _tag: "TriggerStateNotFound";
|
|
217
|
+
};
|
|
218
|
+
isError(error: unknown): error is Error;
|
|
219
|
+
name: "TriggerStateNotFound";
|
|
220
|
+
is(error: unknown): error is BaseError;
|
|
221
|
+
wrap(options?: Omit<BaseErrorOptions, 'cause'> & {
|
|
222
|
+
ifTypeDiffers?: boolean;
|
|
223
|
+
}): (error: unknown) => {
|
|
224
|
+
cause?: unknown;
|
|
225
|
+
stack?: string;
|
|
226
|
+
name: "TriggerStateNotFound";
|
|
227
|
+
context: Record<string, unknown>;
|
|
228
|
+
readonly message: string;
|
|
229
|
+
readonly _tag: "TriggerStateNotFound";
|
|
230
|
+
};
|
|
231
|
+
extend<Name extends string = string>(name: Name, message?: string): any;
|
|
232
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
233
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
234
|
+
stackTraceLimit: number;
|
|
235
|
+
};
|
|
236
|
+
export declare class TriggerStateNotFoundError extends TriggerStateNotFoundError_base {
|
|
237
|
+
}
|
|
238
|
+
export {};
|
|
239
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/errors.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIhE,qBAAa,0BAA2B,SAAQ,+BAG/C;IACC,cAEC;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED,qBAAa,cAAe,SAAQ,mBAAsE;IACxG,YAAY,YAAY,EAAE,MAAM,EAE/B;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAID,qBAAa,wBAAyB,SAAQ,6BAAgE;IAC5G,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,EAEvE;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED,qBAAa,qBAAsB,SAAQ,0BAA0D;IACnG,YAAY,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,EAE3E;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED,qBAAa,aAAc,SAAQ,kBAA8D;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEpG,qBAAa,0BAA2B,SAAQ,+BAG/C;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEJ,qBAAa,2BAA4B,SAAQ,gCAGhD;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEJ,qBAAa,yBAA0B,SAAQ,8BAAmE;CAAG"}
|