@dxos/functions 0.8.4-main.406dc2a → 0.8.4-main.548089c
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/index.mjs +598 -1190
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +598 -1190
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/errors.d.ts +16 -32
- package/dist/types/src/errors.d.ts.map +1 -1
- package/dist/types/src/example/fib.d.ts.map +1 -0
- package/dist/types/src/example/forex-effect.d.ts +3 -0
- package/dist/types/src/example/forex-effect.d.ts.map +1 -0
- package/dist/types/src/example/index.d.ts +12 -0
- package/dist/types/src/example/index.d.ts.map +1 -0
- package/dist/types/src/example/reply.d.ts.map +1 -0
- package/dist/types/src/example/sleep.d.ts.map +1 -0
- package/dist/types/src/handler.d.ts +28 -55
- package/dist/types/src/handler.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -6
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/services/credentials.d.ts +1 -1
- package/dist/types/src/services/credentials.d.ts.map +1 -1
- package/dist/types/src/services/event-logger.d.ts +16 -4
- package/dist/types/src/services/event-logger.d.ts.map +1 -1
- package/dist/types/src/services/function-invocation-service.d.ts +2 -19
- package/dist/types/src/services/function-invocation-service.d.ts.map +1 -1
- package/dist/types/src/services/index.d.ts +3 -4
- package/dist/types/src/services/index.d.ts.map +1 -1
- package/dist/types/src/services/tracing.d.ts +4 -9
- package/dist/types/src/services/tracing.d.ts.map +1 -1
- package/dist/types/src/types/Function.d.ts +52 -0
- package/dist/types/src/types/Function.d.ts.map +1 -0
- package/dist/types/src/types/Script.d.ts +28 -0
- package/dist/types/src/types/Script.d.ts.map +1 -0
- package/dist/types/src/{types.d.ts → types/Trigger.d.ts} +47 -138
- package/dist/types/src/types/Trigger.d.ts.map +1 -0
- package/dist/types/src/types/TriggerEvent.d.ts +44 -0
- package/dist/types/src/types/TriggerEvent.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +5 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/url.d.ts +0 -9
- package/dist/types/src/url.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -59
- package/src/example/forex-effect.ts +40 -0
- package/src/example/index.ts +13 -0
- package/src/handler.ts +45 -69
- package/src/index.ts +2 -6
- package/src/services/credentials.ts +3 -4
- package/src/services/event-logger.ts +8 -2
- package/src/services/function-invocation-service.ts +6 -70
- package/src/services/index.ts +4 -4
- package/src/services/tracing.ts +7 -42
- package/src/{schema.ts → types/Function.ts} +11 -26
- package/src/types/Script.ts +33 -0
- package/src/types/Trigger.ts +139 -0
- package/src/types/TriggerEvent.ts +62 -0
- package/src/types/index.ts +8 -0
- package/src/url.ts +0 -24
- package/dist/lib/browser/bundler/index.mjs +0 -269
- package/dist/lib/browser/bundler/index.mjs.map +0 -7
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +0 -10
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +0 -7
- package/dist/lib/browser/chunk-LKYT2SAL.mjs +0 -665
- package/dist/lib/browser/chunk-LKYT2SAL.mjs.map +0 -7
- package/dist/lib/browser/edge/index.mjs +0 -83
- package/dist/lib/browser/edge/index.mjs.map +0 -7
- package/dist/lib/browser/testing/index.mjs +0 -131
- package/dist/lib/browser/testing/index.mjs.map +0 -7
- package/dist/lib/node-esm/bundler/index.mjs +0 -270
- package/dist/lib/node-esm/bundler/index.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NAQIKLZB.mjs +0 -667
- package/dist/lib/node-esm/chunk-NAQIKLZB.mjs.map +0 -7
- package/dist/lib/node-esm/edge/index.mjs +0 -84
- package/dist/lib/node-esm/edge/index.mjs.map +0 -7
- package/dist/lib/node-esm/testing/index.mjs +0 -132
- package/dist/lib/node-esm/testing/index.mjs.map +0 -7
- package/dist/types/src/bundler/bundler.d.ts +0 -49
- 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 -17
- 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/examples/fib.d.ts.map +0 -1
- package/dist/types/src/examples/index.d.ts +0 -4
- package/dist/types/src/examples/index.d.ts.map +0 -1
- package/dist/types/src/examples/reply.d.ts.map +0 -1
- package/dist/types/src/examples/sleep.d.ts.map +0 -1
- package/dist/types/src/executor/executor.d.ts +0 -14
- 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/schema.d.ts +0 -43
- package/dist/types/src/schema.d.ts.map +0 -1
- package/dist/types/src/services/database.d.ts +0 -67
- package/dist/types/src/services/database.d.ts.map +0 -1
- package/dist/types/src/services/function-invocation-service.test.d.ts +0 -2
- package/dist/types/src/services/function-invocation-service.test.d.ts.map +0 -1
- package/dist/types/src/services/local-function-execution.d.ts +0 -34
- package/dist/types/src/services/local-function-execution.d.ts.map +0 -1
- package/dist/types/src/services/remote-function-execution-service.d.ts +0 -22
- package/dist/types/src/services/remote-function-execution-service.d.ts.map +0 -1
- package/dist/types/src/services/service-container.d.ts +0 -57
- package/dist/types/src/services/service-container.d.ts.map +0 -1
- package/dist/types/src/services/service-registry.d.ts +0 -31
- package/dist/types/src/services/service-registry.d.ts.map +0 -1
- package/dist/types/src/services/service-registry.test.d.ts +0 -2
- package/dist/types/src/services/service-registry.test.d.ts.map +0 -1
- package/dist/types/src/testing/index.d.ts +0 -3
- package/dist/types/src/testing/index.d.ts.map +0 -1
- package/dist/types/src/testing/layer.d.ts +0 -18
- package/dist/types/src/testing/layer.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/persist-database.test.d.ts +0 -2
- package/dist/types/src/testing/persist-database.test.d.ts.map +0 -1
- package/dist/types/src/testing/services.d.ts +0 -59
- package/dist/types/src/testing/services.d.ts.map +0 -1
- package/dist/types/src/trace.d.ts +0 -122
- 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/triggers/index.d.ts +0 -4
- package/dist/types/src/triggers/index.d.ts.map +0 -1
- package/dist/types/src/triggers/input-builder.d.ts +0 -3
- package/dist/types/src/triggers/input-builder.d.ts.map +0 -1
- package/dist/types/src/triggers/invocation-tracer.d.ts +0 -37
- package/dist/types/src/triggers/invocation-tracer.d.ts.map +0 -1
- package/dist/types/src/triggers/trigger-dispatcher.d.ts +0 -78
- package/dist/types/src/triggers/trigger-dispatcher.d.ts.map +0 -1
- package/dist/types/src/triggers/trigger-dispatcher.test.d.ts +0 -2
- package/dist/types/src/triggers/trigger-dispatcher.test.d.ts.map +0 -1
- package/dist/types/src/triggers/trigger-state-store.d.ts +0 -28
- package/dist/types/src/triggers/trigger-state-store.d.ts.map +0 -1
- package/dist/types/src/types.d.ts.map +0 -1
- package/src/bundler/bundler.test.ts +0 -58
- package/src/bundler/bundler.ts +0 -295
- package/src/bundler/index.ts +0 -5
- package/src/edge/functions.ts +0 -67
- package/src/edge/index.ts +0 -9
- package/src/examples/index.ts +0 -7
- package/src/executor/executor.ts +0 -58
- package/src/executor/index.ts +0 -5
- package/src/services/database.ts +0 -175
- package/src/services/function-invocation-service.test.ts +0 -81
- package/src/services/local-function-execution.ts +0 -153
- package/src/services/remote-function-execution-service.ts +0 -63
- package/src/services/service-container.ts +0 -115
- package/src/services/service-registry.test.ts +0 -45
- package/src/services/service-registry.ts +0 -63
- package/src/testing/index.ts +0 -6
- package/src/testing/layer.ts +0 -114
- package/src/testing/logger.ts +0 -17
- package/src/testing/persist-database.test.ts +0 -87
- package/src/testing/services.ts +0 -115
- package/src/trace.ts +0 -178
- package/src/translations.ts +0 -20
- package/src/triggers/index.ts +0 -7
- package/src/triggers/input-builder.ts +0 -35
- package/src/triggers/invocation-tracer.ts +0 -101
- package/src/triggers/trigger-dispatcher.test.ts +0 -665
- package/src/triggers/trigger-dispatcher.ts +0 -533
- package/src/triggers/trigger-state-store.ts +0 -61
- package/src/types.ts +0 -218
- /package/dist/types/src/{examples → example}/fib.d.ts +0 -0
- /package/dist/types/src/{examples → example}/reply.d.ts +0 -0
- /package/dist/types/src/{examples → example}/sleep.d.ts +0 -0
- /package/src/{examples → example}/fib.ts +0 -0
- /package/src/{examples → example}/reply.ts +0 -0
- /package/src/{examples → example}/sleep.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function-invocation-service.d.ts","sourceRoot":"","sources":["../../../../src/services/function-invocation-service.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"function-invocation-service.d.ts","sourceRoot":"","sources":["../../../../src/services/function-invocation-service.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;;mBAK3D,CAAC,EAAE,CAAC,eAAe,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,kBAAkB,CAAC;;AAHtH,qBAAa,yBAA0B,SAAQ,8BAK5C;IACD,MAAM,CAAC,cAAc,GAAI,CAAC,EAAE,CAAC,EAC3B,aAAa,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,EACrC,OAAO,CAAC,KACP,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,yBAAyB,GAAG,kBAAkB,CAAC,CACyC;CACpH"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
export { DatabaseService } from '@dxos/echo-db';
|
|
1
2
|
export * from './credentials';
|
|
2
|
-
export
|
|
3
|
+
export { ConfiguredCredentialsService, type ServiceCredential } from './credentials';
|
|
3
4
|
export * from './event-logger';
|
|
5
|
+
export { createEventLogger, createDefectLogger } from './event-logger';
|
|
4
6
|
export * from './function-invocation-service';
|
|
5
|
-
export * from './local-function-execution';
|
|
6
7
|
export * from './queues';
|
|
7
|
-
export * from './service-container';
|
|
8
8
|
export * from './tracing';
|
|
9
|
-
export * from './remote-function-execution-service';
|
|
10
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,4BAA4B,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACrF,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACvE,cAAc,+BAA+B,CAAC;AAC9C,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
|
|
@@ -4,8 +4,7 @@ import * as Layer from 'effect/Layer';
|
|
|
4
4
|
import { AgentStatus } from '@dxos/ai';
|
|
5
5
|
import { Obj } from '@dxos/echo';
|
|
6
6
|
import type { ObjectId } from '@dxos/echo/internal';
|
|
7
|
-
import
|
|
8
|
-
import { DataType } from '@dxos/schema';
|
|
7
|
+
import { Message } from '@dxos/types';
|
|
9
8
|
declare const TracingService_base: Context.TagClass<TracingService, "@dxos/functions/TracingService", {
|
|
10
9
|
/**
|
|
11
10
|
* Gets the parent message ID.
|
|
@@ -23,20 +22,16 @@ declare const TracingService_base: Context.TagClass<TracingService, "@dxos/funct
|
|
|
23
22
|
*/
|
|
24
23
|
export declare class TracingService extends TracingService_base {
|
|
25
24
|
static noop: Context.Tag.Service<TracingService>;
|
|
26
|
-
static layerNoop: Layer.Layer<TracingService
|
|
27
|
-
static console: Context.Tag.Service<TracingService>;
|
|
28
|
-
static layerConsole: Layer.Layer<TracingService, never, never>;
|
|
29
|
-
static layerLogInfo: () => Layer.Layer<TracingService, never, never>;
|
|
25
|
+
static layerNoop: Layer.Layer<TracingService>;
|
|
30
26
|
/**
|
|
31
27
|
* Creates a TracingService layer that emits events to the parent tracing service.
|
|
32
28
|
*/
|
|
33
29
|
static layerSubframe: (mapContext: (currentContext: TracingService.TraceContext) => TracingService.TraceContext) => Layer.Layer<TracingService, never, TracingService>;
|
|
34
|
-
static layerQueue: (queue: Queue) => Layer.Layer<TracingService, never, never>;
|
|
35
30
|
/**
|
|
36
31
|
* Emit the current human-readable execution status.
|
|
37
32
|
*/
|
|
38
33
|
static emitStatus: (data: Omit<Obj.MakeProps<typeof AgentStatus>, 'created'>) => Effect.Effect<void, never, TracingService>;
|
|
39
|
-
static emitConverationMessage: (data: Obj.MakeProps<typeof
|
|
34
|
+
static emitConverationMessage: (data: Obj.MakeProps<typeof Message.Message>) => Effect.Effect<void, never, TracingService>;
|
|
40
35
|
}
|
|
41
36
|
export declare namespace TracingService {
|
|
42
37
|
interface TraceContext {
|
|
@@ -52,7 +47,7 @@ export declare namespace TracingService {
|
|
|
52
47
|
}
|
|
53
48
|
}
|
|
54
49
|
/**
|
|
55
|
-
* Goes into {@link
|
|
50
|
+
* Goes into {@link Message['properties']}
|
|
56
51
|
*/
|
|
57
52
|
export declare const MESSAGE_PROPERTY_TOOL_CALL_ID: "toolCallId";
|
|
58
53
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../../../src/services/tracing.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,
|
|
1
|
+
{"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../../../src/services/tracing.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;;IASlC;;OAEG;qBACc,MAAM,cAAc,CAAC,YAAY;IAElD;;;OAGG;WACI,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,KAAK,IAAI;;AAhBnC;;;GAGG;AACH,qBAAa,cAAe,SAAQ,mBAcjC;IACD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,CAG9C;IAEF,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAsD;IACnG;;OAEG;IACH,MAAM,CAAC,aAAa,GAAI,YAAY,CAAC,cAAc,EAAE,cAAc,CAAC,YAAY,KAAK,cAAc,CAAC,YAAY,wDAW5G;IAEJ;;OAEG;IACH,MAAM,CAAC,UAAU,EAAE,CACjB,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,WAAW,CAAC,EAAE,SAAS,CAAC,KACrD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,CAU5C;IAEH,MAAM,CAAC,sBAAsB,EAAE,CAC7B,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,OAAO,CAAC,OAAO,CAAC,KACxC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,CAY5C;CACJ;AAED,yBAAiB,cAAc,CAAC;IAC9B,UAAiB,YAAY;QAC3B;;WAEG;QACH,aAAa,CAAC,EAAE,QAAQ,CAAC;QAEzB;;WAEG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB;CACF;AAED;;GAEG;AACH,eAAO,MAAM,6BAA6B,EAAG,YAAqB,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
import { Obj, Type } from '@dxos/echo';
|
|
3
|
+
import { Ref } from '@dxos/echo/internal';
|
|
4
|
+
/**
|
|
5
|
+
* Function deployment.
|
|
6
|
+
*/
|
|
7
|
+
export declare const Function: Type.obj<Schema.Struct<{
|
|
8
|
+
/**
|
|
9
|
+
* Global registry ID.
|
|
10
|
+
* NOTE: The `key` property refers to the original registry entry.
|
|
11
|
+
*/
|
|
12
|
+
key: Schema.optional<typeof Schema.String>;
|
|
13
|
+
name: typeof Schema.NonEmptyString;
|
|
14
|
+
version: typeof Schema.String;
|
|
15
|
+
description: Schema.optional<typeof Schema.String>;
|
|
16
|
+
/**
|
|
17
|
+
* ISO date string of the last deployment.
|
|
18
|
+
*/
|
|
19
|
+
updated: Schema.optional<typeof Schema.String>;
|
|
20
|
+
source: Schema.optional<import("@dxos/echo/internal").Ref$<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
21
|
+
description?: string | undefined;
|
|
22
|
+
source: Ref<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
23
|
+
content: string;
|
|
24
|
+
}>;
|
|
25
|
+
name?: string | undefined;
|
|
26
|
+
changed?: boolean | undefined;
|
|
27
|
+
}>>;
|
|
28
|
+
inputSchema: Schema.optional<Schema.Schema<Type.JsonSchema, Type.JsonSchema, never>>;
|
|
29
|
+
outputSchema: Schema.optional<Schema.Schema<Type.JsonSchema, Type.JsonSchema, never>>;
|
|
30
|
+
binding: Schema.optional<typeof Schema.String>;
|
|
31
|
+
}>>;
|
|
32
|
+
export interface Function extends Schema.Schema.Type<typeof Function> {
|
|
33
|
+
}
|
|
34
|
+
export declare const make: (props: Obj.MakeProps<typeof Function>) => import("@dxos/live-object").Live<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
35
|
+
description?: string | undefined;
|
|
36
|
+
version: string;
|
|
37
|
+
source?: Ref<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
38
|
+
description?: string | undefined;
|
|
39
|
+
source: Ref<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
40
|
+
content: string;
|
|
41
|
+
}>;
|
|
42
|
+
name?: string | undefined;
|
|
43
|
+
changed?: boolean | undefined;
|
|
44
|
+
}> | undefined;
|
|
45
|
+
name: string;
|
|
46
|
+
key?: string | undefined;
|
|
47
|
+
updated?: string | undefined;
|
|
48
|
+
inputSchema?: Type.JsonSchema | undefined;
|
|
49
|
+
outputSchema?: Type.JsonSchema | undefined;
|
|
50
|
+
binding?: string | undefined;
|
|
51
|
+
}>;
|
|
52
|
+
//# sourceMappingURL=Function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Function.d.ts","sourceRoot":"","sources":["../../../../src/types/Function.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAmC,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAI3E;;GAEG;AACH,eAAO,MAAM,QAAQ;IACnB;;;OAGG;;;;;IAcH;;OAEG;;;;;;;;;;;;;GAkBJ,CAAC;AACF,MAAM,WAAW,QAAS,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC;CAAG;AAExE,eAAO,MAAM,IAAI,GAAI,OAAO,GAAG,CAAC,SAAS,CAAC,OAAO,QAAQ,CAAC;;;;;;;;;;;;;;;;;EAA8B,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
import { Obj, Type } from '@dxos/echo';
|
|
3
|
+
/**
|
|
4
|
+
* Source script.
|
|
5
|
+
*/
|
|
6
|
+
export declare const Script: Type.obj<Schema.Struct<{
|
|
7
|
+
name: Schema.optional<typeof Schema.String>;
|
|
8
|
+
description: Schema.optional<typeof Schema.String>;
|
|
9
|
+
changed: Schema.optional<typeof Schema.Boolean>;
|
|
10
|
+
source: Type.ref<Type.obj<Schema.Struct<{
|
|
11
|
+
content: typeof Schema.String;
|
|
12
|
+
}>>>;
|
|
13
|
+
}>>;
|
|
14
|
+
export interface Script extends Schema.Schema.Type<typeof Script> {
|
|
15
|
+
}
|
|
16
|
+
type Props = Omit<Obj.MakeProps<typeof Script>, 'source'> & {
|
|
17
|
+
source?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare const make: ({ source, ...props }?: Props) => import("@dxos/live-object").Live<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
20
|
+
description?: string | undefined;
|
|
21
|
+
source: import("@dxos/echo/internal").Ref<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
22
|
+
content: string;
|
|
23
|
+
}>;
|
|
24
|
+
name?: string | undefined;
|
|
25
|
+
changed?: boolean | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=Script.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Script.d.ts","sourceRoot":"","sources":["../../../../src/types/Script.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,GAAG,EAAO,IAAI,EAAE,MAAM,YAAY,CAAC;AAI5C;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;GAalB,CAAC;AACF,MAAM,WAAW,MAAO,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,MAAM,CAAC;CAAG;AAEpE,KAAK,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,MAAM,CAAC,EAAE,QAAQ,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhF,eAAO,MAAM,IAAI,GAAI,uBAA2B,KAAU;;;;;;;EACW,CAAC"}
|
|
@@ -1,43 +1,26 @@
|
|
|
1
1
|
import * as Schema from 'effect/Schema';
|
|
2
|
-
import { QueryAST, Type } from '@dxos/echo';
|
|
2
|
+
import { Obj, QueryAST, Type } from '@dxos/echo';
|
|
3
3
|
import { Expando, Ref } from '@dxos/echo/internal';
|
|
4
4
|
/**
|
|
5
5
|
* Type discriminator for TriggerType.
|
|
6
6
|
* Every spec has a type field of type TriggerKind that we can use to understand which type we're working with.
|
|
7
7
|
* https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions
|
|
8
8
|
*/
|
|
9
|
-
export declare const
|
|
10
|
-
export type
|
|
11
|
-
|
|
12
|
-
* Cron timer.
|
|
13
|
-
*/
|
|
14
|
-
declare const TimerTriggerSchema: Schema.mutable<Schema.Struct<{
|
|
15
|
-
kind: Schema.Literal<["timer"]>;
|
|
16
|
-
cron: Schema.SchemaClass<string, string, never>;
|
|
17
|
-
}>>;
|
|
18
|
-
export type TimerTrigger = Schema.Schema.Type<typeof TimerTriggerSchema>;
|
|
19
|
-
declare const EmailTriggerSchema: Schema.mutable<Schema.Struct<{
|
|
9
|
+
export declare const Kinds: readonly ["email", "queue", "subscription", "timer", "webhook"];
|
|
10
|
+
export type Kind = (typeof Kinds)[number];
|
|
11
|
+
export declare const EmailSpec: Schema.mutable<Schema.Struct<{
|
|
20
12
|
kind: Schema.Literal<["email"]>;
|
|
21
13
|
}>>;
|
|
22
|
-
export type
|
|
23
|
-
declare const
|
|
14
|
+
export type EmailSpec = Schema.Schema.Type<typeof EmailSpec>;
|
|
15
|
+
export declare const QueueSpec: Schema.mutable<Schema.Struct<{
|
|
24
16
|
kind: Schema.Literal<["queue"]>;
|
|
25
17
|
queue: Schema.refine<string, typeof Schema.NonEmptyString>;
|
|
26
18
|
}>>;
|
|
27
|
-
export type
|
|
28
|
-
/**
|
|
29
|
-
* Webhook.
|
|
30
|
-
*/
|
|
31
|
-
declare const WebhookTriggerSchema: Schema.mutable<Schema.Struct<{
|
|
32
|
-
kind: Schema.Literal<["webhook"]>;
|
|
33
|
-
method: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
34
|
-
port: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
35
|
-
}>>;
|
|
36
|
-
export type WebhookTrigger = Schema.Schema.Type<typeof WebhookTriggerSchema>;
|
|
19
|
+
export type QueueSpec = Schema.Schema.Type<typeof QueueSpec>;
|
|
37
20
|
/**
|
|
38
21
|
* Subscription.
|
|
39
22
|
*/
|
|
40
|
-
declare const
|
|
23
|
+
export declare const SubscriptionSpec: Schema.mutable<Schema.Struct<{
|
|
41
24
|
kind: Schema.Literal<["subscription"]>;
|
|
42
25
|
query: Schema.mutable<Schema.Struct<{
|
|
43
26
|
raw: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
@@ -48,17 +31,32 @@ declare const SubscriptionTriggerSchema: Schema.mutable<Schema.Struct<{
|
|
|
48
31
|
delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
49
32
|
}>>;
|
|
50
33
|
}>>;
|
|
51
|
-
export type
|
|
34
|
+
export type SubscriptionSpec = Schema.Schema.Type<typeof SubscriptionSpec>;
|
|
52
35
|
/**
|
|
53
|
-
*
|
|
36
|
+
* Cron timer.
|
|
54
37
|
*/
|
|
55
|
-
export declare const
|
|
38
|
+
export declare const TimerSpec: Schema.mutable<Schema.Struct<{
|
|
56
39
|
kind: Schema.Literal<["timer"]>;
|
|
57
40
|
cron: Schema.SchemaClass<string, string, never>;
|
|
58
|
-
}
|
|
41
|
+
}>>;
|
|
42
|
+
export type TimerSpec = Schema.Schema.Type<typeof TimerSpec>;
|
|
43
|
+
/**
|
|
44
|
+
* Webhook.
|
|
45
|
+
*/
|
|
46
|
+
export declare const WebhookSpec: Schema.mutable<Schema.Struct<{
|
|
59
47
|
kind: Schema.Literal<["webhook"]>;
|
|
60
48
|
method: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
61
49
|
port: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
50
|
+
}>>;
|
|
51
|
+
export type WebhookSpec = Schema.Schema.Type<typeof WebhookSpec>;
|
|
52
|
+
/**
|
|
53
|
+
* Trigger schema.
|
|
54
|
+
*/
|
|
55
|
+
export declare const Spec: Schema.Union<[Schema.mutable<Schema.Struct<{
|
|
56
|
+
kind: Schema.Literal<["email"]>;
|
|
57
|
+
}>>, Schema.mutable<Schema.Struct<{
|
|
58
|
+
kind: Schema.Literal<["queue"]>;
|
|
59
|
+
queue: Schema.refine<string, typeof Schema.NonEmptyString>;
|
|
62
60
|
}>>, Schema.mutable<Schema.Struct<{
|
|
63
61
|
kind: Schema.Literal<["subscription"]>;
|
|
64
62
|
query: Schema.mutable<Schema.Struct<{
|
|
@@ -70,59 +68,20 @@ export declare const TriggerSchema: Schema.Union<[Schema.mutable<Schema.Struct<{
|
|
|
70
68
|
delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
71
69
|
}>>;
|
|
72
70
|
}>>, Schema.mutable<Schema.Struct<{
|
|
73
|
-
kind: Schema.Literal<["
|
|
71
|
+
kind: Schema.Literal<["timer"]>;
|
|
72
|
+
cron: Schema.SchemaClass<string, string, never>;
|
|
74
73
|
}>>, Schema.mutable<Schema.Struct<{
|
|
75
|
-
kind: Schema.Literal<["
|
|
76
|
-
|
|
74
|
+
kind: Schema.Literal<["webhook"]>;
|
|
75
|
+
method: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
76
|
+
port: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
77
77
|
}>>]>;
|
|
78
|
-
export type
|
|
79
|
-
export type EventType = EmailTriggerOutput | WebhookTriggerOutput | QueueTriggerOutput | SubscriptionTriggerOutput | TimerTriggerOutput;
|
|
80
|
-
export declare const EmailTriggerOutput: Schema.mutable<Schema.Struct<{
|
|
81
|
-
from: typeof Schema.String;
|
|
82
|
-
to: typeof Schema.String;
|
|
83
|
-
subject: typeof Schema.String;
|
|
84
|
-
created: typeof Schema.String;
|
|
85
|
-
body: typeof Schema.String;
|
|
86
|
-
}>>;
|
|
87
|
-
export type EmailTriggerOutput = Schema.Schema.Type<typeof EmailTriggerOutput>;
|
|
88
|
-
export declare const WebhookTriggerOutput: Schema.mutable<Schema.Struct<{
|
|
89
|
-
url: typeof Schema.String;
|
|
90
|
-
method: Schema.Literal<["GET", "POST"]>;
|
|
91
|
-
headers: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
92
|
-
bodyText: typeof Schema.String;
|
|
93
|
-
}>>;
|
|
94
|
-
export type WebhookTriggerOutput = Schema.Schema.Type<typeof WebhookTriggerOutput>;
|
|
95
|
-
export declare const QueueTriggerOutput: Schema.mutable<Schema.Struct<{
|
|
96
|
-
queue: Schema.refine<string, typeof Schema.NonEmptyString>;
|
|
97
|
-
item: typeof Schema.Any;
|
|
98
|
-
cursor: typeof Schema.String;
|
|
99
|
-
}>>;
|
|
100
|
-
export type QueueTriggerOutput = Schema.Schema.Type<typeof QueueTriggerOutput>;
|
|
101
|
-
export declare const SubscriptionTriggerOutput: Schema.mutable<Schema.Struct<{
|
|
102
|
-
/**
|
|
103
|
-
* Type of the mutation.
|
|
104
|
-
*/
|
|
105
|
-
type: typeof Schema.String;
|
|
106
|
-
/**
|
|
107
|
-
* Reference to the object that was changed or created.
|
|
108
|
-
*/
|
|
109
|
-
subject: Type.ref<Type.obj<Schema.Struct<{}>>>;
|
|
110
|
-
/**
|
|
111
|
-
* @deprecated
|
|
112
|
-
*/
|
|
113
|
-
changedObjectId: Schema.optional<typeof Schema.String>;
|
|
114
|
-
}>>;
|
|
115
|
-
export type SubscriptionTriggerOutput = Schema.Schema.Type<typeof SubscriptionTriggerOutput>;
|
|
116
|
-
export declare const TimerTriggerOutput: Schema.mutable<Schema.Struct<{
|
|
117
|
-
tick: typeof Schema.Number;
|
|
118
|
-
}>>;
|
|
119
|
-
export type TimerTriggerOutput = Schema.Schema.Type<typeof TimerTriggerOutput>;
|
|
78
|
+
export type Spec = Schema.Schema.Type<typeof Spec>;
|
|
120
79
|
/**
|
|
121
80
|
* Function trigger.
|
|
122
81
|
* Function is invoked with the `payload` passed as input data.
|
|
123
82
|
* The event that triggers the function is available in the function context.
|
|
124
83
|
*/
|
|
125
|
-
declare const
|
|
84
|
+
declare const Trigger_: Type.obj<Schema.Struct<{
|
|
126
85
|
/**
|
|
127
86
|
* Function or workflow to invoke.
|
|
128
87
|
*/
|
|
@@ -135,12 +94,10 @@ declare const FunctionTrigger_: Type.obj<Schema.Struct<{
|
|
|
135
94
|
inputNodeId: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
136
95
|
enabled: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
137
96
|
spec: Schema.optional<Schema.Union<[Schema.mutable<Schema.Struct<{
|
|
138
|
-
kind: Schema.Literal<["
|
|
139
|
-
cron: Schema.SchemaClass<string, string, never>;
|
|
97
|
+
kind: Schema.Literal<["email"]>;
|
|
140
98
|
}>>, Schema.mutable<Schema.Struct<{
|
|
141
|
-
kind: Schema.Literal<["
|
|
142
|
-
|
|
143
|
-
port: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
99
|
+
kind: Schema.Literal<["queue"]>;
|
|
100
|
+
queue: Schema.refine<string, typeof Schema.NonEmptyString>;
|
|
144
101
|
}>>, Schema.mutable<Schema.Struct<{
|
|
145
102
|
kind: Schema.Literal<["subscription"]>;
|
|
146
103
|
query: Schema.mutable<Schema.Struct<{
|
|
@@ -152,10 +109,12 @@ declare const FunctionTrigger_: Type.obj<Schema.Struct<{
|
|
|
152
109
|
delay: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
153
110
|
}>>;
|
|
154
111
|
}>>, Schema.mutable<Schema.Struct<{
|
|
155
|
-
kind: Schema.Literal<["
|
|
112
|
+
kind: Schema.Literal<["timer"]>;
|
|
113
|
+
cron: Schema.SchemaClass<string, string, never>;
|
|
156
114
|
}>>, Schema.mutable<Schema.Struct<{
|
|
157
|
-
kind: Schema.Literal<["
|
|
158
|
-
|
|
115
|
+
kind: Schema.Literal<["webhook"]>;
|
|
116
|
+
method: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
117
|
+
port: Schema.optional<Schema.SchemaClass<number, number, never>>;
|
|
159
118
|
}>>]>>;
|
|
160
119
|
/**
|
|
161
120
|
* Passed as the input data to the function.
|
|
@@ -170,61 +129,11 @@ declare const FunctionTrigger_: Type.obj<Schema.Struct<{
|
|
|
170
129
|
*/
|
|
171
130
|
input: Schema.optional<Schema.mutable<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
|
|
172
131
|
}>>;
|
|
173
|
-
export interface
|
|
132
|
+
export interface Trigger extends Schema.Schema.Type<typeof Trigger_> {
|
|
174
133
|
}
|
|
175
|
-
export interface
|
|
134
|
+
export interface TriggerEncoded extends Schema.Schema.Encoded<typeof Trigger_> {
|
|
176
135
|
}
|
|
177
|
-
export declare const
|
|
178
|
-
|
|
179
|
-
* Function manifest file.
|
|
180
|
-
*/
|
|
181
|
-
export declare const FunctionManifestSchema: Schema.Struct<{
|
|
182
|
-
functions: Schema.optional<Schema.mutable<Schema.Array$<Schema.Schema<import("@dxos/echo/internal").ExcludeId<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
183
|
-
name: string;
|
|
184
|
-
description?: string | undefined;
|
|
185
|
-
source?: Ref<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
186
|
-
name?: string | undefined;
|
|
187
|
-
description?: string | undefined;
|
|
188
|
-
changed?: boolean | undefined;
|
|
189
|
-
source: Ref<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
190
|
-
content: string;
|
|
191
|
-
}>;
|
|
192
|
-
}> | undefined;
|
|
193
|
-
version: string;
|
|
194
|
-
key?: string | undefined;
|
|
195
|
-
inputSchema?: Type.JsonSchema | undefined;
|
|
196
|
-
outputSchema?: Type.JsonSchema | undefined;
|
|
197
|
-
binding?: string | undefined;
|
|
198
|
-
}> & import("@dxos/echo/internal").WithMeta, {
|
|
199
|
-
id: string;
|
|
200
|
-
name: string;
|
|
201
|
-
version: string;
|
|
202
|
-
description?: string | undefined;
|
|
203
|
-
source?: import("@dxos/echo-protocol").EncodedReference | undefined;
|
|
204
|
-
key?: string | undefined;
|
|
205
|
-
inputSchema?: Type.JsonSchema | undefined;
|
|
206
|
-
outputSchema?: Type.JsonSchema | undefined;
|
|
207
|
-
binding?: string | undefined;
|
|
208
|
-
}, never>>>>;
|
|
209
|
-
triggers: Schema.optional<Schema.mutable<Schema.Array$<Schema.Schema<import("@dxos/echo/internal").ExcludeId<FunctionTrigger> & import("@dxos/echo/internal").WithMeta, FunctionTriggerEncoded, never>>>>;
|
|
210
|
-
}>;
|
|
211
|
-
export type FunctionManifest = Schema.Schema.Type<typeof FunctionManifestSchema>;
|
|
212
|
-
export declare const FUNCTION_TYPES: (Type.obj<Schema.Struct<{
|
|
213
|
-
key: Schema.optional<typeof Schema.String>;
|
|
214
|
-
name: typeof Schema.NonEmptyString;
|
|
215
|
-
version: typeof Schema.String;
|
|
216
|
-
description: Schema.optional<typeof Schema.String>;
|
|
217
|
-
source: Schema.optional<import("@dxos/echo/internal").Ref$<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
218
|
-
name?: string | undefined;
|
|
219
|
-
description?: string | undefined;
|
|
220
|
-
changed?: boolean | undefined;
|
|
221
|
-
source: Ref<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
222
|
-
content: string;
|
|
223
|
-
}>;
|
|
224
|
-
}>>;
|
|
225
|
-
inputSchema: Schema.optional<Schema.Schema<Type.JsonSchema, Type.JsonSchema, never>>;
|
|
226
|
-
outputSchema: Schema.optional<Schema.Schema<Type.JsonSchema, Type.JsonSchema, never>>;
|
|
227
|
-
binding: Schema.optional<typeof Schema.String>;
|
|
228
|
-
}>> | Schema.Schema<FunctionTrigger, FunctionTriggerEncoded, never>)[];
|
|
136
|
+
export declare const Trigger: Schema.Schema<Trigger, TriggerEncoded>;
|
|
137
|
+
export declare const make: (props: Obj.MakeProps<typeof Trigger>) => import("@dxos/live-object").Live<Trigger>;
|
|
229
138
|
export {};
|
|
230
|
-
//# sourceMappingURL=
|
|
139
|
+
//# sourceMappingURL=Trigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Trigger.d.ts","sourceRoot":"","sources":["../../../../src/types/Trigger.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,EAAuB,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAGxE;;;;GAIG;AACH,eAAO,MAAM,KAAK,iEAAkE,CAAC;AACrF,MAAM,MAAM,IAAI,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC;AAI1C,eAAO,MAAM,SAAS;;GAEC,CAAC;AACxB,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC,CAAC;AAE7D,eAAO,MAAM,SAAS;;;GAKC,CAAC;AACxB,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;GAcN,CAAC;AACxB,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE3E;;GAEG;AACH,eAAO,MAAM,SAAS;;;GAMC,CAAC;AACxB,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,WAAW;;;;GAaD,CAAC;AACxB,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,WAAW,CAAC,CAAC;AAEjE;;GAEG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;KAEf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnD;;;;GAIG;AACH,QAAA,MAAM,QAAQ;IACZ;;OAEG;;IAIH;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;;;;;IAOH;;;;;;;;;;OAUG;;GAOJ,CAAC;AACF,MAAM,WAAW,OAAQ,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC;CAAG;AACvE,MAAM,WAAW,cAAe,SAAQ,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,QAAQ,CAAC;CAAG;AACjF,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,cAAc,CAAY,CAAC;AAExE,eAAO,MAAM,IAAI,GAAI,OAAO,GAAG,CAAC,SAAS,CAAC,OAAO,OAAO,CAAC,8CAA6B,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as Schema from 'effect/Schema';
|
|
2
|
+
import { Type } from '@dxos/echo';
|
|
3
|
+
export type TriggerEvent = EmailEvent | QueueEvent | SubscriptionEvent | TimerEvent | WebhookEvent;
|
|
4
|
+
export declare const EmailEvent: Schema.mutable<Schema.Struct<{
|
|
5
|
+
from: typeof Schema.String;
|
|
6
|
+
to: typeof Schema.String;
|
|
7
|
+
subject: typeof Schema.String;
|
|
8
|
+
created: typeof Schema.String;
|
|
9
|
+
body: typeof Schema.String;
|
|
10
|
+
}>>;
|
|
11
|
+
export type EmailEvent = Schema.Schema.Type<typeof EmailEvent>;
|
|
12
|
+
export declare const QueueEvent: Schema.mutable<Schema.Struct<{
|
|
13
|
+
queue: Schema.refine<string, typeof Schema.NonEmptyString>;
|
|
14
|
+
item: typeof Schema.Any;
|
|
15
|
+
cursor: typeof Schema.String;
|
|
16
|
+
}>>;
|
|
17
|
+
export type QueueEvent = Schema.Schema.Type<typeof QueueEvent>;
|
|
18
|
+
export declare const SubscriptionEvent: Schema.mutable<Schema.Struct<{
|
|
19
|
+
/**
|
|
20
|
+
* Type of the mutation.
|
|
21
|
+
*/
|
|
22
|
+
type: typeof Schema.String;
|
|
23
|
+
/**
|
|
24
|
+
* Reference to the object that was changed or created.
|
|
25
|
+
*/
|
|
26
|
+
subject: Type.ref<Type.obj<Schema.Struct<{}>>>;
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated
|
|
29
|
+
*/
|
|
30
|
+
changedObjectId: Schema.optional<typeof Schema.String>;
|
|
31
|
+
}>>;
|
|
32
|
+
export type SubscriptionEvent = Schema.Schema.Type<typeof SubscriptionEvent>;
|
|
33
|
+
export declare const TimerEvent: Schema.mutable<Schema.Struct<{
|
|
34
|
+
tick: typeof Schema.Number;
|
|
35
|
+
}>>;
|
|
36
|
+
export type TimerEvent = Schema.Schema.Type<typeof TimerEvent>;
|
|
37
|
+
export declare const WebhookEvent: Schema.mutable<Schema.Struct<{
|
|
38
|
+
url: typeof Schema.String;
|
|
39
|
+
method: Schema.Literal<["GET", "POST"]>;
|
|
40
|
+
headers: Schema.Record$<typeof Schema.String, typeof Schema.String>;
|
|
41
|
+
bodyText: typeof Schema.String;
|
|
42
|
+
}>>;
|
|
43
|
+
export type WebhookEvent = Schema.Schema.Type<typeof WebhookEvent>;
|
|
44
|
+
//# sourceMappingURL=TriggerEvent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TriggerEvent.d.ts","sourceRoot":"","sources":["../../../../src/types/TriggerEvent.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAY,IAAI,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,UAAU,GAAG,iBAAiB,GAAG,UAAU,GAAG,YAAY,CAAC;AAGnG,eAAO,MAAM,UAAU;;;;;;GAQtB,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;AAE/D,eAAO,MAAM,UAAU;;;;GAMtB,CAAC;AACF,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;;GAEkB,CAAC;AACxB,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE7E,eAAO,MAAM,UAAU;;GAAyD,CAAC;AACjF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;AAE/D,eAAO,MAAM,YAAY;;;;;GAOxB,CAAC;AACF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC"}
|
package/dist/types/src/url.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type ObjectMeta } from '@dxos/echo/internal';
|
|
2
|
-
import { type SpaceId } from '@dxos/keys';
|
|
3
2
|
export declare const FUNCTIONS_META_KEY = "dxos.org/service/function";
|
|
4
3
|
export declare const FUNCTIONS_PRESET_META_KEY = "dxos.org/service/function-preset";
|
|
5
4
|
/**
|
|
@@ -10,12 +9,4 @@ export declare const getUserFunctionIdInMetadata: (meta: ObjectMeta) => string |
|
|
|
10
9
|
* NOTE: functionId is backend ID, not ECHO object id.
|
|
11
10
|
*/
|
|
12
11
|
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;
|
|
17
|
-
export type InvocationOptions = {
|
|
18
|
-
spaceId?: SpaceId;
|
|
19
|
-
subjectId?: string;
|
|
20
|
-
};
|
|
21
12
|
//# sourceMappingURL=url.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/url.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/url.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAE9D,eAAO,MAAM,yBAAyB,qCAAqC,CAAC;AAE5E;;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"}
|