@dxos/functions 0.8.4-main.f9ba587 → 0.8.4-main.fcfe5033a5
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 +4 -6
- package/dist/lib/neutral/Trace.mjs +42 -0
- package/dist/lib/neutral/Trace.mjs.map +7 -0
- package/dist/lib/neutral/chunk-27Y24OTY.mjs +167 -0
- package/dist/lib/neutral/chunk-27Y24OTY.mjs.map +7 -0
- package/dist/lib/neutral/chunk-IVDUS56O.mjs +49 -0
- package/dist/lib/neutral/chunk-IVDUS56O.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/fib-N45KAC7C.mjs +23 -0
- package/dist/lib/neutral/fib-N45KAC7C.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +1218 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/reply-EUEPKNJF.mjs +19 -0
- package/dist/lib/neutral/reply-EUEPKNJF.mjs.map +7 -0
- package/dist/lib/neutral/sleep-PUK3D4FF.mjs +15 -0
- package/dist/lib/neutral/sleep-PUK3D4FF.mjs.map +7 -0
- package/dist/types/src/Trace.d.ts +174 -0
- package/dist/types/src/Trace.d.ts.map +1 -0
- package/dist/types/src/errors.d.ts +121 -0
- package/dist/types/src/errors.d.ts.map +1 -0
- package/dist/types/src/example/definitions.d.ts +11 -0
- package/dist/types/src/example/definitions.d.ts.map +1 -0
- package/dist/types/src/example/fib.d.ts +8 -0
- 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 +4 -0
- package/dist/types/src/example/index.d.ts.map +1 -0
- package/dist/types/src/example/reply.d.ts +4 -0
- package/dist/types/src/example/reply.d.ts.map +1 -0
- package/dist/types/src/example/sleep.d.ts +6 -0
- package/dist/types/src/example/sleep.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +9 -6
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/process/Process.d.ts +246 -0
- package/dist/types/src/process/Process.d.ts.map +1 -0
- package/dist/types/src/process/ServiceResolver.d.ts +74 -0
- package/dist/types/src/process/ServiceResolver.d.ts.map +1 -0
- package/dist/types/src/process/StorageService.d.ts +58 -0
- package/dist/types/src/process/StorageService.d.ts.map +1 -0
- 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/index.d.ts +2 -0
- package/dist/types/src/protocol/index.d.ts.map +1 -0
- package/dist/types/src/protocol/protocol.d.ts +7 -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 +11 -0
- package/dist/types/src/sdk.d.ts.map +1 -0
- package/dist/types/src/services/credentials.d.ts +23 -3
- package/dist/types/src/services/credentials.d.ts.map +1 -1
- package/dist/types/src/services/event-logger.d.ts +70 -30
- package/dist/types/src/services/event-logger.d.ts.map +1 -1
- package/dist/types/src/services/function-invocation-service.d.ts +16 -0
- package/dist/types/src/services/function-invocation-service.d.ts.map +1 -0
- package/dist/types/src/services/index.d.ts +5 -7
- package/dist/types/src/services/index.d.ts.map +1 -1
- package/dist/types/src/services/queues.d.ts +37 -5
- 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/Script.d.ts +22 -0
- package/dist/types/src/types/Script.d.ts.map +1 -0
- package/dist/types/src/types/Trigger.d.ts +150 -0
- package/dist/types/src/types/Trigger.d.ts.map +1 -0
- package/dist/types/src/types/TriggerEvent.d.ts +75 -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/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 +32 -67
- package/src/Trace.ts +225 -0
- package/src/errors.ts +21 -0
- package/src/example/definitions.ts +49 -0
- package/src/example/fib.ts +23 -0
- package/src/example/forex-effect.ts +40 -0
- package/src/example/index.ts +12 -0
- package/src/example/reply.ts +19 -0
- package/src/example/sleep.ts +17 -0
- package/src/index.ts +9 -8
- package/src/process/Process.ts +487 -0
- package/src/process/ServiceResolver.ts +174 -0
- package/src/process/StorageService.ts +99 -0
- package/src/protocol/functions-ai-http-client.ts +67 -0
- package/src/{executor → protocol}/index.ts +1 -1
- package/src/protocol/protocol.test.ts +58 -0
- package/src/protocol/protocol.ts +273 -0
- package/src/sdk.ts +30 -0
- package/src/services/credentials.ts +108 -4
- package/src/services/event-logger.ts +61 -37
- package/src/services/function-invocation-service.ts +35 -0
- package/src/services/index.ts +5 -7
- package/src/services/queues.ts +58 -9
- package/src/services/tracing.ts +4 -23
- package/src/types/Script.ts +38 -0
- package/src/types/Trigger.ts +207 -0
- package/src/types/TriggerEvent.ts +62 -0
- package/src/types/index.ts +8 -0
- 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/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/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/index.ts +0 -5
- 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
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Operation } from '@dxos/operation';
|
|
2
|
+
import { type FunctionProtocol } from '@dxos/protocols';
|
|
3
|
+
/**
|
|
4
|
+
* Wraps a function handler made with `defineFunction` to a protocol that the functions-runtime expects.
|
|
5
|
+
*/
|
|
6
|
+
export declare const wrapFunctionHandler: (func: Operation.WithHandler<Operation.Definition.Any>) => FunctionProtocol.Func;
|
|
7
|
+
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../../src/protocol/protocol.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAQxD;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,KAAG,gBAAgB,CAAC,IAwE5G,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.test.d.ts","sourceRoot":"","sources":["../../../../src/protocol/protocol.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type AiService } from '@dxos/ai';
|
|
2
|
+
import { type Database, type Feed } from '@dxos/echo';
|
|
3
|
+
import { type Trace } from '@dxos/functions';
|
|
4
|
+
import type { Operation } from '@dxos/operation';
|
|
5
|
+
import { type CredentialsService, type FunctionInvocationService, type QueueService } from './services';
|
|
6
|
+
/**
|
|
7
|
+
* Services that are available to invoked functions.
|
|
8
|
+
* @deprecated
|
|
9
|
+
*/
|
|
10
|
+
export type FunctionServices = AiService.AiService | CredentialsService | Database.Service | QueueService | Feed.FeedService | Trace.TraceService | FunctionInvocationService | Operation.Service;
|
|
11
|
+
//# sourceMappingURL=sdk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/sdk.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,yBAAyB,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAOxG;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GACxB,SAAS,CAAC,SAAS,GACnB,kBAAkB,GAClB,QAAQ,CAAC,OAAO,GAEhB,YAAY,GACZ,IAAI,CAAC,WAAW,GAChB,KAAK,CAAC,YAAY,GAClB,yBAAyB,GACzB,SAAS,CAAC,OAAO,CAAC"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
type
|
|
1
|
+
import * as HttpClient from '@effect/platform/HttpClient';
|
|
2
|
+
import type * as Config from 'effect/Config';
|
|
3
|
+
import * as Context from 'effect/Context';
|
|
4
|
+
import * as Effect from 'effect/Effect';
|
|
5
|
+
import * as Layer from 'effect/Layer';
|
|
6
|
+
import * as Redacted from 'effect/Redacted';
|
|
7
|
+
import { Database } from '@dxos/echo';
|
|
8
|
+
export type CredentialQuery = {
|
|
3
9
|
service?: string;
|
|
4
10
|
};
|
|
5
11
|
export type ServiceCredential = {
|
|
6
12
|
service: string;
|
|
7
13
|
apiKey?: string;
|
|
8
14
|
};
|
|
9
|
-
declare const CredentialsService_base: Context.TagClass<CredentialsService, "CredentialsService", {
|
|
15
|
+
declare const CredentialsService_base: Context.TagClass<CredentialsService, "@dxos/functions/CredentialsService", {
|
|
10
16
|
/**
|
|
11
17
|
* Query all.
|
|
12
18
|
*/
|
|
@@ -18,6 +24,16 @@ declare const CredentialsService_base: Context.TagClass<CredentialsService, "Cre
|
|
|
18
24
|
getCredential: (query: CredentialQuery) => Promise<ServiceCredential>;
|
|
19
25
|
}>;
|
|
20
26
|
export declare class CredentialsService extends CredentialsService_base {
|
|
27
|
+
static getCredential: (query: CredentialQuery) => Effect.Effect<ServiceCredential, never, CredentialsService>;
|
|
28
|
+
static getApiKey: (query: CredentialQuery) => Effect.Effect<Redacted.Redacted<string>, never, CredentialsService>;
|
|
29
|
+
static configuredLayer: (credentials: ServiceCredential[]) => Layer.Layer<CredentialsService, never, never>;
|
|
30
|
+
static layerConfig: (credentials: {
|
|
31
|
+
service: string;
|
|
32
|
+
apiKey: Config.Config<Redacted.Redacted<string>>;
|
|
33
|
+
}[]) => Layer.Layer<CredentialsService, import("effect/ConfigError").ConfigError, never>;
|
|
34
|
+
static layerFromDatabase: ({ caching }?: {
|
|
35
|
+
caching?: boolean;
|
|
36
|
+
}) => Layer.Layer<CredentialsService, never, Database.Service>;
|
|
21
37
|
}
|
|
22
38
|
export declare class ConfiguredCredentialsService implements Context.Tag.Service<CredentialsService> {
|
|
23
39
|
private readonly credentials;
|
|
@@ -26,5 +42,9 @@ export declare class ConfiguredCredentialsService implements Context.Tag.Service
|
|
|
26
42
|
queryCredentials(query: CredentialQuery): Promise<ServiceCredential[]>;
|
|
27
43
|
getCredential(query: CredentialQuery): Promise<ServiceCredential>;
|
|
28
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Maps the request to include the given token in the Authorization header.
|
|
47
|
+
*/
|
|
48
|
+
export declare const withAuthorization: (token: string, kind?: "Bearer" | "Basic") => <E, R>(self: HttpClient.HttpClient.With<E, R>) => HttpClient.HttpClient.With<E, R>;
|
|
29
49
|
export {};
|
|
30
50
|
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../../src/services/credentials.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../../src/services/credentials.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAE1D,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAC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AAQ,CAAC,WAAW;gBAAX,WAAW,GAAE,iBAAiB,EAAO;IAElE,cAAc,CAAC,WAAW,EAAE,iBAAiB,EAAE,GAAG,4BAA4B;IAKxE,gBAAgB,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAItE,aAAa,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAQxE;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,MAAM,EAAE,OAAO,QAAQ,GAAG,OAAO,uFAItE,CAAC"}
|
|
@@ -1,37 +1,77 @@
|
|
|
1
|
-
import
|
|
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';
|
|
2
6
|
import { LogLevel } from '@dxos/log';
|
|
3
|
-
export
|
|
4
|
-
type:
|
|
5
|
-
nodeId:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
7
|
+
export declare const ComputeEventPayload: Schema.Union<[Schema.Struct<{
|
|
8
|
+
type: Schema.Literal<["begin-compute"]>;
|
|
9
|
+
nodeId: typeof Schema.String;
|
|
10
|
+
/**
|
|
11
|
+
* Names of the inputs begin computed.
|
|
12
|
+
*/
|
|
13
|
+
inputs: Schema.Array$<typeof Schema.String>;
|
|
14
|
+
}>, Schema.Struct<{
|
|
15
|
+
type: Schema.Literal<["end-compute"]>;
|
|
16
|
+
nodeId: typeof Schema.String;
|
|
17
|
+
/**
|
|
18
|
+
* Names of the outputs computed.
|
|
19
|
+
*/
|
|
20
|
+
outputs: Schema.Array$<typeof Schema.String>;
|
|
21
|
+
}>, Schema.Struct<{
|
|
22
|
+
type: Schema.Literal<["compute-input"]>;
|
|
23
|
+
nodeId: typeof Schema.String;
|
|
24
|
+
property: typeof Schema.String;
|
|
25
|
+
value: typeof Schema.Any;
|
|
26
|
+
}>, Schema.Struct<{
|
|
27
|
+
type: Schema.Literal<["compute-output"]>;
|
|
28
|
+
nodeId: typeof Schema.String;
|
|
29
|
+
property: typeof Schema.String;
|
|
30
|
+
value: typeof Schema.Any;
|
|
31
|
+
}>, Schema.Struct<{
|
|
32
|
+
type: Schema.Literal<["custom"]>;
|
|
33
|
+
nodeId: typeof Schema.String;
|
|
34
|
+
event: typeof Schema.Any;
|
|
35
|
+
}>]>;
|
|
36
|
+
export type ComputeEventPayload = Schema.Schema.Type<typeof ComputeEventPayload>;
|
|
37
|
+
export declare const ComputeEvent: Type.Obj<{
|
|
38
|
+
readonly payload: {
|
|
39
|
+
readonly type: "begin-compute";
|
|
40
|
+
readonly nodeId: string;
|
|
41
|
+
readonly inputs: readonly string[];
|
|
42
|
+
} | {
|
|
43
|
+
readonly type: "end-compute";
|
|
44
|
+
readonly nodeId: string;
|
|
45
|
+
readonly outputs: readonly string[];
|
|
46
|
+
} | {
|
|
47
|
+
readonly type: "compute-input";
|
|
48
|
+
readonly value: any;
|
|
49
|
+
readonly property: string;
|
|
50
|
+
readonly nodeId: string;
|
|
51
|
+
} | {
|
|
52
|
+
readonly type: "compute-output";
|
|
53
|
+
readonly value: any;
|
|
54
|
+
readonly property: string;
|
|
55
|
+
readonly nodeId: string;
|
|
56
|
+
} | {
|
|
57
|
+
readonly type: "custom";
|
|
58
|
+
readonly nodeId: string;
|
|
59
|
+
readonly event: any;
|
|
60
|
+
};
|
|
61
|
+
}, Schema.Struct.Fields>;
|
|
62
|
+
declare const ComputeEventLogger_base: Context.TagClass<ComputeEventLogger, "@dxos/functions/ComputeEventLogger", {
|
|
63
|
+
readonly log: (event: ComputeEventPayload) => void;
|
|
28
64
|
readonly nodeId: string | undefined;
|
|
29
65
|
}>;
|
|
30
|
-
|
|
31
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Logs event for the compute workflows.
|
|
68
|
+
*/
|
|
69
|
+
export declare class ComputeEventLogger extends ComputeEventLogger_base {
|
|
70
|
+
static noop: Context.Tag.Service<ComputeEventLogger>;
|
|
71
|
+
static layerNoop: Layer.Layer<ComputeEventLogger>;
|
|
32
72
|
}
|
|
33
|
-
export declare const logCustomEvent: (data: any) => Effect.Effect<void, never,
|
|
73
|
+
export declare const logCustomEvent: (data: any) => Effect.Effect<void, never, ComputeEventLogger>;
|
|
34
74
|
export declare const createDefectLogger: <A, E, R>() => ((self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>);
|
|
35
|
-
export declare const createEventLogger: (level: LogLevel, message?: string) => Context.Tag.Service<
|
|
75
|
+
export declare const createEventLogger: (level: LogLevel, message?: string) => Context.Tag.Service<ComputeEventLogger>;
|
|
36
76
|
export {};
|
|
37
77
|
//# sourceMappingURL=event-logger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-logger.d.ts","sourceRoot":"","sources":["../../../../src/services/event-logger.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"event-logger.d.ts","sourceRoot":"","sources":["../../../../src/services/event-logger.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAO,MAAM,WAAW,CAAC;AAE1C,eAAO,MAAM,mBAAmB;;;IAI5B;;OAEG;;;;;IAMH;;OAEG;;;;;;;;;;;;;;;;IAoBN,CAAC;AACF,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEjF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;wBAEyD,CAAC;;kBAOjE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI;qBAAmB,MAAM,GAAG,SAAS;;AAL3F;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,uBAGrC;IACD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAGlD;IAEF,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAA8D;CAChH;AAED,eAAO,MAAM,cAAc,GAAI,MAAM,GAAG,mDAWpC,CAAC;AAEL,eAAO,MAAM,kBAAkB,GAAI,CAAC,EAAE,CAAC,EAAE,CAAC,OAAK,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAMrG,CAAC;AAEJ,eAAO,MAAM,iBAAiB,GAC5B,OAAO,QAAQ,EACf,UAAS,MAAgB,KACxB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAiBxC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as Context from 'effect/Context';
|
|
2
|
+
import * as Effect from 'effect/Effect';
|
|
3
|
+
import * as Layer from 'effect/Layer';
|
|
4
|
+
import { Operation } from '@dxos/operation';
|
|
5
|
+
import type { FunctionNotFoundError } from '../errors';
|
|
6
|
+
declare const FunctionInvocationService_base: Context.TagClass<FunctionInvocationService, "@dxos/functions/FunctionInvocationService", {
|
|
7
|
+
invokeFunction<I, O>(functionDef: Operation.Definition<I, O, any>, input: I): Effect.Effect<O>;
|
|
8
|
+
resolveFunction(key: string): Effect.Effect<Operation.Definition.Any, FunctionNotFoundError>;
|
|
9
|
+
}>;
|
|
10
|
+
export declare class FunctionInvocationService extends FunctionInvocationService_base {
|
|
11
|
+
static layerNotAvailable: Layer.Layer<FunctionInvocationService, never, never>;
|
|
12
|
+
static invokeFunction: <I, O>(functionDef: Operation.Definition<I, O, any>, input: I) => Effect.Effect<O, never, FunctionInvocationService>;
|
|
13
|
+
static resolveFunction: (key: string) => Effect.Effect<Operation.Definition.Any, FunctionNotFoundError, FunctionInvocationService>;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=function-invocation-service.d.ts.map
|
|
@@ -0,0 +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;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;;mBAKpC,CAAC,EAAE,CAAC,eAAe,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;yBAEzE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,qBAAqB,CAAC;;AALhG,qBAAa,yBAA0B,SAAQ,8BAO5C;IACD,MAAM,CAAC,iBAAiB,uDAGrB;IAEH,MAAM,CAAC,cAAc,GAAI,CAAC,EAAE,CAAC,EAC3B,aAAa,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAC5C,OAAO,CAAC,KACP,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,yBAAyB,CAAC,CAC8D;IAEnH,MAAM,CAAC,eAAe,GACpB,KAAK,MAAM,KACV,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,qBAAqB,EAAE,yBAAyB,CAAC,CACS;CACtG"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
export * from './ai';
|
|
2
|
-
export * from './database';
|
|
3
|
-
export * from './queues';
|
|
4
|
-
export * from './service-container';
|
|
5
1
|
export * from './credentials';
|
|
6
|
-
export
|
|
2
|
+
export { ConfiguredCredentialsService, type ServiceCredential } from './credentials';
|
|
7
3
|
export * from './event-logger';
|
|
8
|
-
export
|
|
9
|
-
export * from './
|
|
4
|
+
export { createEventLogger, createDefectLogger } from './event-logger';
|
|
5
|
+
export * from './function-invocation-service';
|
|
6
|
+
export * from './queues';
|
|
7
|
+
export { MESSAGE_PROPERTY_TOOL_CALL_ID } from './tracing';
|
|
10
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/index.ts"],"names":[],"mappings":"AAIA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/index.ts"],"names":[],"mappings":"AAIA,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,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,18 +1,50 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import * as Context from 'effect/Context';
|
|
2
|
+
import * as Effect from 'effect/Effect';
|
|
3
|
+
import * as Layer from 'effect/Layer';
|
|
4
|
+
import { type Entity } from '@dxos/echo';
|
|
5
|
+
import { type Queue, type QueueAPI, type QueueFactory } from '@dxos/echo-db';
|
|
6
|
+
import type { DXN, QueueSubspaceTag } from '@dxos/keys';
|
|
7
|
+
declare const QueueService_base: Context.TagClass<QueueService, "@dxos/functions/QueueService", {
|
|
4
8
|
/**
|
|
5
9
|
* API to access the queues.
|
|
6
10
|
*/
|
|
7
11
|
readonly queues: QueueAPI;
|
|
8
12
|
/**
|
|
9
13
|
* The queue that is used to store the context of the current research.
|
|
14
|
+
* @deprecated Use `ContextQueueService` instead.
|
|
10
15
|
*/
|
|
11
|
-
readonly
|
|
16
|
+
readonly queue: Queue | undefined;
|
|
12
17
|
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Gives access to all queues.
|
|
20
|
+
* @deprecated Use Feed.FeedService instead.
|
|
21
|
+
*/
|
|
13
22
|
export declare class QueueService extends QueueService_base {
|
|
14
23
|
static notAvailable: Layer.Layer<QueueService, never, never>;
|
|
15
|
-
static make: (queues: QueueFactory,
|
|
24
|
+
static make: (queues: QueueFactory, queue?: Queue) => Context.Tag.Service<QueueService>;
|
|
25
|
+
static layer: (queues: QueueFactory, queue?: Queue) => Layer.Layer<QueueService>;
|
|
26
|
+
/**
|
|
27
|
+
* Gets a queue by its DXN.
|
|
28
|
+
*/
|
|
29
|
+
static getQueue: <T extends Entity.Unknown = Entity.Unknown>(dxn: DXN) => Effect.Effect<Queue<T>, never, QueueService>;
|
|
30
|
+
/**
|
|
31
|
+
* Creates a new queue.
|
|
32
|
+
*/
|
|
33
|
+
static createQueue: <T extends Entity.Unknown = Entity.Unknown>(options?: {
|
|
34
|
+
subspaceTag?: QueueSubspaceTag;
|
|
35
|
+
}) => Effect.Effect<Queue<T>, never, QueueService>;
|
|
36
|
+
static append: <T extends Entity.Unknown = Entity.Unknown>(queue: Queue<T>, objects: T[]) => Effect.Effect<void>;
|
|
37
|
+
}
|
|
38
|
+
declare const ContextQueueService_base: Context.TagClass<ContextQueueService, "@dxos/functions/ContextQueueService", {
|
|
39
|
+
readonly queue: Queue;
|
|
40
|
+
}>;
|
|
41
|
+
/**
|
|
42
|
+
* Gives access to a specific queue passed as a context.
|
|
43
|
+
* @deprecated Use Feed.FeedService instead.
|
|
44
|
+
*/
|
|
45
|
+
export declare class ContextQueueService extends ContextQueueService_base {
|
|
46
|
+
static layer: (queue: Queue) => Layer.Layer<ContextQueueService, never, never>;
|
|
16
47
|
}
|
|
48
|
+
export declare const feedServiceFromQueueServiceLayer: Layer.Layer<import("@dxos/echo/Feed").FeedService, never, QueueService>;
|
|
17
49
|
export {};
|
|
18
50
|
//# sourceMappingURL=queues.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queues.d.ts","sourceRoot":"","sources":["../../../../src/services/queues.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"queues.d.ts","sourceRoot":"","sources":["../../../../src/services/queues.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,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAA0B,KAAK,KAAK,EAAE,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AACrG,OAAO,KAAK,EAAE,GAAG,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;;IASpD;;OAEG;qBACc,QAAQ;IAEzB;;;OAGG;oBACa,KAAK,GAAG,SAAS;;AAhBrC;;;GAGG;AACH,qBAAa,YAAa,SAAQ,iBAc/B;IACD,MAAM,CAAC,YAAY,0CAUhB;IAE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;
|
|
9
|
-
}>;
|
|
10
|
-
export declare class TracingService extends TracingService_base {
|
|
11
|
-
static noop: Context.Tag.Service<TracingService>;
|
|
12
|
-
static console: Context.Tag.Service<TracingService>;
|
|
13
|
-
}
|
|
14
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* Goes into {@link Message['properties']}
|
|
3
|
+
*/
|
|
4
|
+
export declare const MESSAGE_PROPERTY_TOOL_CALL_ID: "toolCallId";
|
|
15
5
|
//# sourceMappingURL=tracing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../../../src/services/tracing.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../../../src/services/tracing.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,6BAA6B,EAAG,YAAqB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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<{
|
|
7
|
+
readonly name?: string | undefined;
|
|
8
|
+
readonly description?: string | undefined;
|
|
9
|
+
readonly source: import("@dxos/echo/internal").Ref<import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
10
|
+
readonly name?: string | undefined;
|
|
11
|
+
readonly content: string;
|
|
12
|
+
}>;
|
|
13
|
+
readonly changed?: boolean | undefined;
|
|
14
|
+
}, Schema.Struct.Fields>;
|
|
15
|
+
export interface Script extends Schema.Schema.Type<typeof Script> {
|
|
16
|
+
}
|
|
17
|
+
type Props = Omit<Obj.MakeProps<typeof Script>, 'source'> & {
|
|
18
|
+
source?: string;
|
|
19
|
+
};
|
|
20
|
+
export declare const make: ({ source, ...props }?: Props) => Script;
|
|
21
|
+
export {};
|
|
22
|
+
//# 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,EAAc,GAAG,EAAO,IAAI,EAAE,MAAM,YAAY,CAAC;AAIxD;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;;wBAiBlB,CAAC;AAEF,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,KAAG,MACqB,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.QuerySelectClause | QueryAST.QueryFilterClause | QueryAST.QueryReferenceTraversalClause | QueryAST.QueryIncomingReferencesClause | QueryAST.QueryRelationClause | QueryAST.QueryRelationTraversalClause | QueryAST.QueryHierarchyTraversalClause | QueryAST.QueryUnionClause | QueryAST.QuerySetDifferenceClause | QueryAST.QueryOrderClause | QueryAST.QueryOptionsClause | QueryAST.QueryLimitClause | QueryAST.QueryFromClause, QueryAST.QuerySelectClause | QueryAST.QueryFilterClause | QueryAST.QueryReferenceTraversalClause | QueryAST.QueryIncomingReferencesClause | QueryAST.QueryRelationClause | QueryAST.QueryRelationTraversalClause | QueryAST.QueryHierarchyTraversalClause | QueryAST.QueryUnionClause | QueryAST.QuerySetDifferenceClause | QueryAST.QueryOrderClause | QueryAST.QueryOptionsClause | QueryAST.QueryLimitClause | QueryAST.QueryFromClause, 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.QuerySelectClause | QueryAST.QueryFilterClause | QueryAST.QueryReferenceTraversalClause | QueryAST.QueryIncomingReferencesClause | QueryAST.QueryRelationClause | QueryAST.QueryRelationTraversalClause | QueryAST.QueryHierarchyTraversalClause | QueryAST.QueryUnionClause | QueryAST.QuerySetDifferenceClause | QueryAST.QueryOrderClause | QueryAST.QueryOptionsClause | QueryAST.QueryLimitClause | QueryAST.QueryFromClause, QueryAST.QuerySelectClause | QueryAST.QueryFilterClause | QueryAST.QueryReferenceTraversalClause | QueryAST.QueryIncomingReferencesClause | QueryAST.QueryRelationClause | QueryAST.QueryRelationTraversalClause | QueryAST.QueryHierarchyTraversalClause | QueryAST.QueryUnionClause | QueryAST.QuerySetDifferenceClause | QueryAST.QueryOrderClause | QueryAST.QueryOptionsClause | QueryAST.QueryLimitClause | QueryAST.QueryFromClause, 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 input?: {
|
|
116
|
+
readonly [x: string]: any;
|
|
117
|
+
} | undefined;
|
|
118
|
+
readonly inputNodeId?: string | undefined;
|
|
119
|
+
readonly enabled?: boolean | undefined;
|
|
120
|
+
readonly spec?: {
|
|
121
|
+
readonly kind: "email";
|
|
122
|
+
} | {
|
|
123
|
+
readonly kind: "queue";
|
|
124
|
+
readonly queue: string;
|
|
125
|
+
} | {
|
|
126
|
+
readonly kind: "subscription";
|
|
127
|
+
readonly query: {
|
|
128
|
+
readonly raw?: string | undefined;
|
|
129
|
+
readonly ast: QueryAST.QuerySelectClause | QueryAST.QueryFilterClause | QueryAST.QueryReferenceTraversalClause | QueryAST.QueryIncomingReferencesClause | QueryAST.QueryRelationClause | QueryAST.QueryRelationTraversalClause | QueryAST.QueryHierarchyTraversalClause | QueryAST.QueryUnionClause | QueryAST.QuerySetDifferenceClause | QueryAST.QueryOrderClause | QueryAST.QueryOptionsClause | QueryAST.QueryLimitClause | QueryAST.QueryFromClause;
|
|
130
|
+
};
|
|
131
|
+
readonly options?: {
|
|
132
|
+
readonly deep?: boolean | undefined;
|
|
133
|
+
readonly delay?: number | undefined;
|
|
134
|
+
} | undefined;
|
|
135
|
+
} | {
|
|
136
|
+
readonly kind: "timer";
|
|
137
|
+
readonly cron: string;
|
|
138
|
+
} | {
|
|
139
|
+
readonly kind: "webhook";
|
|
140
|
+
readonly method?: string | undefined;
|
|
141
|
+
readonly port?: number | undefined;
|
|
142
|
+
} | undefined;
|
|
143
|
+
readonly concurrency?: number | 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/types/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,iEAAkE,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,SAAS,CAAC,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,UAAU,MAAM,KAAG,SAG3C,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,QAAQ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,OAAO,aAAa,CAAC;CAAG;AAC5E,eAAO,MAAM,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAwB,CAAC;AAE/D,eAAO,MAAM,IAAI,GAAI,OAAO,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/types/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,CAA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