@botpress/runtime 1.0.1
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/_types/actions.d.ts +3 -0
- package/dist/_types/actions.d.ts.map +1 -0
- package/dist/_types/events.d.ts +5 -0
- package/dist/_types/events.d.ts.map +1 -0
- package/dist/_types/integration-actions.d.ts +3 -0
- package/dist/_types/integration-actions.d.ts.map +1 -0
- package/dist/_types/state.d.ts +4 -0
- package/dist/_types/state.d.ts.map +1 -0
- package/dist/_types/tables.d.ts +3 -0
- package/dist/_types/tables.d.ts.map +1 -0
- package/dist/_types/triggers.d.ts +3 -0
- package/dist/_types/triggers.d.ts.map +1 -0
- package/dist/_types/workflows.d.ts +12 -0
- package/dist/_types/workflows.d.ts.map +1 -0
- package/dist/constants.d.ts +58 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/consts.d.ts +8 -0
- package/dist/consts.d.ts.map +1 -0
- package/dist/debugging/node-inspector.d.ts +5 -0
- package/dist/debugging/node-inspector.d.ts.map +1 -0
- package/dist/define-config.d.ts +70 -0
- package/dist/define-config.d.ts.map +1 -0
- package/dist/definition.d.ts +10 -0
- package/dist/definition.d.ts.map +1 -0
- package/dist/definition.js +88 -0
- package/dist/definition.js.map +7 -0
- package/dist/environment.d.ts +60 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/errors.d.ts +36 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/globals.d.ts +21 -0
- package/dist/globals.d.ts.map +1 -0
- package/dist/internal.d.ts +15 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +46573 -0
- package/dist/internal.js.map +7 -0
- package/dist/library.d.ts +16 -0
- package/dist/library.d.ts.map +1 -0
- package/dist/library.js +45943 -0
- package/dist/library.js.map +7 -0
- package/dist/primitives/action.d.ts +37 -0
- package/dist/primitives/action.d.ts.map +1 -0
- package/dist/primitives/asset.d.ts +28 -0
- package/dist/primitives/asset.d.ts.map +1 -0
- package/dist/primitives/conversation.d.ts +104 -0
- package/dist/primitives/conversation.d.ts.map +1 -0
- package/dist/primitives/data-sources/index.d.ts +7 -0
- package/dist/primitives/data-sources/index.d.ts.map +1 -0
- package/dist/primitives/data-sources/source-base.d.ts +251 -0
- package/dist/primitives/data-sources/source-base.d.ts.map +1 -0
- package/dist/primitives/data-sources/source-directory.d.ts +119 -0
- package/dist/primitives/data-sources/source-directory.d.ts.map +1 -0
- package/dist/primitives/data-sources/source-table.d.ts +135 -0
- package/dist/primitives/data-sources/source-table.d.ts.map +1 -0
- package/dist/primitives/data-sources/source-website.d.ts +226 -0
- package/dist/primitives/data-sources/source-website.d.ts.map +1 -0
- package/dist/primitives/definition.d.ts +68 -0
- package/dist/primitives/definition.d.ts.map +1 -0
- package/dist/primitives/index.d.ts +149 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/knowledge.d.ts +36 -0
- package/dist/primitives/knowledge.d.ts.map +1 -0
- package/dist/primitives/table.d.ts +153 -0
- package/dist/primitives/table.d.ts.map +1 -0
- package/dist/primitives/trigger.d.ts +26 -0
- package/dist/primitives/trigger.d.ts.map +1 -0
- package/dist/primitives/workflow-instance.d.ts +80 -0
- package/dist/primitives/workflow-instance.d.ts.map +1 -0
- package/dist/primitives/workflow-step.d.ts +184 -0
- package/dist/primitives/workflow-step.d.ts.map +1 -0
- package/dist/primitives/workflow-utils.d.ts +36 -0
- package/dist/primitives/workflow-utils.d.ts.map +1 -0
- package/dist/primitives/workflow.d.ts +86 -0
- package/dist/primitives/workflow.d.ts.map +1 -0
- package/dist/runtime/actions.d.ts +6 -0
- package/dist/runtime/actions.d.ts.map +1 -0
- package/dist/runtime/adk.d.ts +54 -0
- package/dist/runtime/adk.d.ts.map +1 -0
- package/dist/runtime/agent-registry.d.ts +33 -0
- package/dist/runtime/agent-registry.d.ts.map +1 -0
- package/dist/runtime/assets.d.ts +48 -0
- package/dist/runtime/assets.d.ts.map +1 -0
- package/dist/runtime/autonomous.d.ts +86 -0
- package/dist/runtime/autonomous.d.ts.map +1 -0
- package/dist/runtime/chat/chat.d.ts +42 -0
- package/dist/runtime/chat/chat.d.ts.map +1 -0
- package/dist/runtime/chat/citations.d.ts +9 -0
- package/dist/runtime/chat/citations.d.ts.map +1 -0
- package/dist/runtime/chat/html.d.ts +2 -0
- package/dist/runtime/chat/html.d.ts.map +1 -0
- package/dist/runtime/chat/index.d.ts +5 -0
- package/dist/runtime/chat/index.d.ts.map +1 -0
- package/dist/runtime/chat/messages.d.ts +35 -0
- package/dist/runtime/chat/messages.d.ts.map +1 -0
- package/dist/runtime/chat/transcript.d.ts +75 -0
- package/dist/runtime/chat/transcript.d.ts.map +1 -0
- package/dist/runtime/chat/truncate-object.d.ts +12 -0
- package/dist/runtime/chat/truncate-object.d.ts.map +1 -0
- package/dist/runtime/chat/truncate-transcript.d.ts +6 -0
- package/dist/runtime/chat/truncate-transcript.d.ts.map +1 -0
- package/dist/runtime/config.d.ts +19 -0
- package/dist/runtime/config.d.ts.map +1 -0
- package/dist/runtime/context/cognitive.d.ts +7 -0
- package/dist/runtime/context/cognitive.d.ts.map +1 -0
- package/dist/runtime/context/context.d.ts +59 -0
- package/dist/runtime/context/context.d.ts.map +1 -0
- package/dist/runtime/context/handlers.d.ts +14 -0
- package/dist/runtime/context/handlers.d.ts.map +1 -0
- package/dist/runtime/context/http.d.ts +38 -0
- package/dist/runtime/context/http.d.ts.map +1 -0
- package/dist/runtime/context/inspector-handler.d.ts +59 -0
- package/dist/runtime/context/inspector-handler.d.ts.map +1 -0
- package/dist/runtime/context/promises.d.ts +36 -0
- package/dist/runtime/context/promises.d.ts.map +1 -0
- package/dist/runtime/events.d.ts +89 -0
- package/dist/runtime/events.d.ts.map +1 -0
- package/dist/runtime/handlers/conversation.d.ts +3 -0
- package/dist/runtime/handlers/conversation.d.ts.map +1 -0
- package/dist/runtime/handlers/event.d.ts +3 -0
- package/dist/runtime/handlers/event.d.ts.map +1 -0
- package/dist/runtime/handlers/index.d.ts +11 -0
- package/dist/runtime/handlers/index.d.ts.map +1 -0
- package/dist/runtime/handlers/trigger.d.ts +3 -0
- package/dist/runtime/handlers/trigger.d.ts.map +1 -0
- package/dist/runtime/handlers/workflow.d.ts +3 -0
- package/dist/runtime/handlers/workflow.d.ts.map +1 -0
- package/dist/runtime/heavy-imports.d.ts +10 -0
- package/dist/runtime/heavy-imports.d.ts.map +1 -0
- package/dist/runtime/index.d.ts +13 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/interfaces.d.ts +16 -0
- package/dist/runtime/interfaces.d.ts.map +1 -0
- package/dist/runtime/singletons.d.ts +21 -0
- package/dist/runtime/singletons.d.ts.map +1 -0
- package/dist/runtime/state.d.ts +8 -0
- package/dist/runtime/state.d.ts.map +1 -0
- package/dist/runtime/tracked-state-schema.d.ts +36 -0
- package/dist/runtime/tracked-state-schema.d.ts.map +1 -0
- package/dist/runtime/tracked-state.d.ts +57 -0
- package/dist/runtime/tracked-state.d.ts.map +1 -0
- package/dist/runtime/workflows/index.d.ts +7 -0
- package/dist/runtime/workflows/index.d.ts.map +1 -0
- package/dist/runtime/workflows/knowledge-indexing.d.ts +109 -0
- package/dist/runtime/workflows/knowledge-indexing.d.ts.map +1 -0
- package/dist/runtime.d.ts +22 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +47545 -0
- package/dist/runtime.js.map +7 -0
- package/dist/telemetry/context-manager.d.ts +16 -0
- package/dist/telemetry/context-manager.d.ts.map +1 -0
- package/dist/telemetry/file-exporter.d.ts +11 -0
- package/dist/telemetry/file-exporter.d.ts.map +1 -0
- package/dist/telemetry/instrument-http.d.ts +4 -0
- package/dist/telemetry/instrument-http.d.ts.map +1 -0
- package/dist/telemetry/live-file-processor.d.ts +13 -0
- package/dist/telemetry/live-file-processor.d.ts.map +1 -0
- package/dist/telemetry/span-helpers.d.ts +30 -0
- package/dist/telemetry/span-helpers.d.ts.map +1 -0
- package/dist/telemetry/spans/factory.d.ts +44 -0
- package/dist/telemetry/spans/factory.d.ts.map +1 -0
- package/dist/telemetry/spans/index.d.ts +1009 -0
- package/dist/telemetry/spans/index.d.ts.map +1 -0
- package/dist/telemetry/spans/well-known-attributes.d.ts +78 -0
- package/dist/telemetry/spans/well-known-attributes.d.ts.map +1 -0
- package/dist/telemetry/structured-logging.d.ts +34 -0
- package/dist/telemetry/structured-logging.d.ts.map +1 -0
- package/dist/telemetry/tracing.d.ts +6 -0
- package/dist/telemetry/tracing.d.ts.map +1 -0
- package/dist/telemetry/utils.d.ts +3 -0
- package/dist/telemetry/utils.d.ts.map +1 -0
- package/dist/types.d.ts +17 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/ui.d.ts +10 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +749 -0
- package/dist/ui.js.map +7 -0
- package/dist/utilities/abort-signal.d.ts +41 -0
- package/dist/utilities/abort-signal.d.ts.map +1 -0
- package/dist/utilities/events.d.ts +10 -0
- package/dist/utilities/events.d.ts.map +1 -0
- package/dist/utilities/promises.d.ts +3 -0
- package/dist/utilities/promises.d.ts.map +1 -0
- package/dist/utilities/size.d.ts +12 -0
- package/dist/utilities/size.d.ts.map +1 -0
- package/dist/utilities/strings.d.ts +18 -0
- package/dist/utilities/strings.d.ts.map +1 -0
- package/dist/utilities/trigger-tags.d.ts +31 -0
- package/dist/utilities/trigger-tags.d.ts.map +1 -0
- package/dist/utilities/types.d.ts +2 -0
- package/dist/utilities/types.d.ts.map +1 -0
- package/dist/workers/dev_worker.d.ts +6 -0
- package/dist/workers/dev_worker.d.ts.map +1 -0
- package/dist/workers/index.d.ts +5 -0
- package/dist/workers/index.d.ts.map +1 -0
- package/dist/workers/parent_worker.d.ts +5 -0
- package/dist/workers/parent_worker.d.ts.map +1 -0
- package/dist/workers/worker_pool.d.ts +109 -0
- package/dist/workers/worker_pool.d.ts.map +1 -0
- package/package.json +109 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from "@botpress/sdk";
|
|
2
|
+
import { BotHandlers } from "@botpress/sdk/dist/bot";
|
|
3
|
+
import { ZuiType } from "../types";
|
|
4
|
+
import { Definitions } from "./definition";
|
|
5
|
+
import { Defined } from "../utilities/types";
|
|
6
|
+
type ActionHandler = Defined<BotHandlers<any>["actionHandlers"][string]>;
|
|
7
|
+
type ActionHandlerInput = ActionHandler extends (input: infer I) => Promise<any> ? I : never;
|
|
8
|
+
export declare namespace Typings {
|
|
9
|
+
type Props<TInput extends ZuiType = ZuiType, TOutput extends ZuiType = ZuiType> = {
|
|
10
|
+
name: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
attributes?: Record<string, string>;
|
|
14
|
+
input: TInput;
|
|
15
|
+
output: TOutput;
|
|
16
|
+
cached?: boolean;
|
|
17
|
+
handler: (input: z.infer<TInput>) => Promise<z.infer<TOutput>>;
|
|
18
|
+
};
|
|
19
|
+
const Primitive: "action";
|
|
20
|
+
}
|
|
21
|
+
export declare class BaseAction<TInput extends ZuiType, TOutput extends ZuiType> implements Definitions.Primitive {
|
|
22
|
+
readonly name: string;
|
|
23
|
+
readonly title?: string;
|
|
24
|
+
readonly description?: string;
|
|
25
|
+
readonly attributes?: Record<string, string>;
|
|
26
|
+
readonly input: TInput;
|
|
27
|
+
readonly output: TOutput;
|
|
28
|
+
readonly cached: boolean;
|
|
29
|
+
readonly handler: (input: z.infer<TInput>) => Promise<z.infer<TOutput>>;
|
|
30
|
+
constructor(props: Typings.Props<TInput, TOutput>);
|
|
31
|
+
/**
|
|
32
|
+
* Execute the action with input validation and output validation
|
|
33
|
+
*/
|
|
34
|
+
execute({ input, }: ActionHandlerInput): Promise<z.infer<TOutput>>;
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../src/primitives/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,CAAC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AgB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrC,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpD,SAAgB,KAAK,EAAE,MAAM,CAAC;IAC9B,SAAgB,MAAM,EAAE,OAAO,CAAC;IAChC,SAAgB,MAAM,EAAE,OAAO,CAAC;IAChC,SAAgB,OAAO,EAAE,CACvB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,KACnB,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;gBAEnB,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC;IAqDjD;;OAEG;IACU,OAAO,CAAC,EACnB,KAAK,GACN,EAAE,kBAAkB,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;CAIlD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asset type representing a file asset with metadata
|
|
3
|
+
*/
|
|
4
|
+
export interface Asset {
|
|
5
|
+
url: string;
|
|
6
|
+
path: string;
|
|
7
|
+
size: number;
|
|
8
|
+
name: string;
|
|
9
|
+
mime: string;
|
|
10
|
+
createdAt: string;
|
|
11
|
+
updatedAt: string;
|
|
12
|
+
fileId: string;
|
|
13
|
+
hash: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Type for the global assets object
|
|
17
|
+
*/
|
|
18
|
+
export interface AssetsGlobal {
|
|
19
|
+
get<T extends string>(path: T): Asset;
|
|
20
|
+
list(): Asset[];
|
|
21
|
+
getSyncStatus(): {
|
|
22
|
+
synced: boolean;
|
|
23
|
+
neverSynced: string[];
|
|
24
|
+
stale: string[];
|
|
25
|
+
upToDate: string[];
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=asset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../../src/primitives/asset.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC;IACtC,IAAI,IAAI,KAAK,EAAE,CAAC;IAChB,aAAa,IAAI;QACf,MAAM,EAAE,OAAO,CAAC;QAChB,WAAW,EAAE,MAAM,EAAE,CAAC;QACtB,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;CACH"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { Event as _Event, Message as _Message } from "@botpress/client";
|
|
2
|
+
import { z } from "@botpress/sdk";
|
|
3
|
+
import { ZuiType } from "../types";
|
|
4
|
+
import { Definitions } from "./definition";
|
|
5
|
+
import { Autonomous } from "../runtime";
|
|
6
|
+
import { BaseWorkflowInstance } from "./workflow-instance";
|
|
7
|
+
import { WorkflowDefinitions } from "../_types/workflows";
|
|
8
|
+
type TriggerEvent = any;
|
|
9
|
+
type WorkflowRequest = {
|
|
10
|
+
[WfName in keyof WorkflowDefinitions & string]: keyof WorkflowDefinitions[WfName]["requests"] extends never ? never : {
|
|
11
|
+
[ReqName in keyof WorkflowDefinitions[WfName]["requests"] & string]: {
|
|
12
|
+
type: `${WfName}:${ReqName}`;
|
|
13
|
+
workflow: BaseWorkflowInstance<WfName>;
|
|
14
|
+
step: string;
|
|
15
|
+
};
|
|
16
|
+
}[keyof WorkflowDefinitions[WfName]["requests"] & string];
|
|
17
|
+
}[keyof WorkflowDefinitions & string];
|
|
18
|
+
export declare namespace Typings {
|
|
19
|
+
type Message<Integrations extends IIntegrations, TChannel extends Channels<Integrations> = Channels<Integrations>> = {
|
|
20
|
+
[K in keyof ChannelMessages<Integrations, TChannel>]: {
|
|
21
|
+
type: K;
|
|
22
|
+
payload: ChannelMessages<Integrations, TChannel>[K];
|
|
23
|
+
tags: ChannelMessageTags<Integrations, TChannel>;
|
|
24
|
+
} & Omit<_Message, "type" | "payload" | "tags">;
|
|
25
|
+
}[keyof ChannelMessages<Integrations, TChannel>];
|
|
26
|
+
type Event<Integrations extends IIntegrations, TChannel extends Channels<Integrations> = Channels<Integrations>> = {
|
|
27
|
+
[K in keyof ChannelEvents<Integrations, TChannel>]: {
|
|
28
|
+
type: K;
|
|
29
|
+
payload: ChannelEvents<Integrations, TChannel>[K];
|
|
30
|
+
} & Omit<_Event, "type" | "payload">;
|
|
31
|
+
}[keyof ChannelEvents<Integrations, TChannel>];
|
|
32
|
+
type HandlerProps<Integrations extends IIntegrations, TChannel extends Channels<Integrations> = Channels<Integrations>, State extends ZuiType = ZuiType> = ({
|
|
33
|
+
type: "message";
|
|
34
|
+
message: Message<Integrations, TChannel>;
|
|
35
|
+
event?: never;
|
|
36
|
+
workflow?: never;
|
|
37
|
+
request?: never;
|
|
38
|
+
} | {
|
|
39
|
+
type: "event";
|
|
40
|
+
event: Event<Integrations, TChannel>;
|
|
41
|
+
message?: never;
|
|
42
|
+
workflow?: never;
|
|
43
|
+
request?: never;
|
|
44
|
+
} | {
|
|
45
|
+
type: "workflow_request";
|
|
46
|
+
event?: never;
|
|
47
|
+
message?: never;
|
|
48
|
+
workflow?: never;
|
|
49
|
+
request: WorkflowRequest;
|
|
50
|
+
}) & {
|
|
51
|
+
execute: Autonomous.ExecuteFn;
|
|
52
|
+
};
|
|
53
|
+
type Handler<Integrations extends IIntegrations, TChannel extends Channels<Integrations> = Channels<Integrations>, State extends ZuiType = ZuiType> = (this: BaseConversation<Integrations, TChannel, State>, props: HandlerProps<Integrations, TChannel, State>) => Promise<void> | void;
|
|
54
|
+
type StartFromTrigger<Integrations extends IIntegrations, TChannel extends Channels<Integrations> = Channels<Integrations>, State extends ZuiType = ZuiType> = (event: any) => Promise<string | false> | string | false;
|
|
55
|
+
type Props<Integrations extends IIntegrations, TChannel extends Channels<Integrations> = Channels<Integrations>, State extends ZuiType = ZuiType> = {
|
|
56
|
+
channel: TChannel;
|
|
57
|
+
handler: Handler<Integrations, TChannel, State>;
|
|
58
|
+
state?: State;
|
|
59
|
+
startFromTrigger?: StartFromTrigger<Integrations, TChannel, State>;
|
|
60
|
+
};
|
|
61
|
+
const Primitive: "conversation";
|
|
62
|
+
}
|
|
63
|
+
export declare class BaseConversation<Integrations extends IIntegrations, TChannel extends Channels<Integrations> = Channels<Integrations>, State extends ZuiType = ZuiType> implements Definitions.Primitive {
|
|
64
|
+
#private;
|
|
65
|
+
readonly integration: GetIntegration<Integrations, TChannel>;
|
|
66
|
+
readonly channel: TChannel;
|
|
67
|
+
constructor(props: Typings.Props<Integrations, TChannel, State>);
|
|
68
|
+
set state(state: z.infer<State> | undefined);
|
|
69
|
+
get state(): z.infer<State> | undefined;
|
|
70
|
+
get id(): string;
|
|
71
|
+
get tags(): ChannelTags<Integrations, TChannel>;
|
|
72
|
+
[ConversationHandler](): Promise<void>;
|
|
73
|
+
subscribeToTrigger(triggerName: TriggerEvent["name"], key?: string): Promise<void>;
|
|
74
|
+
unsubscribeFromTrigger(triggerName: TriggerEvent["name"], key?: string): Promise<void>;
|
|
75
|
+
startTyping(): Promise<void>;
|
|
76
|
+
stopTyping(): Promise<void>;
|
|
77
|
+
send<M extends keyof ChannelMessages<Integrations, TChannel>>(message: {
|
|
78
|
+
type: M;
|
|
79
|
+
payload: ChannelMessages<Integrations, TChannel>[M];
|
|
80
|
+
}): Promise<void>;
|
|
81
|
+
}
|
|
82
|
+
type IIntegrations<Integrations = any, Channels = any, Events = any> = {
|
|
83
|
+
[K in keyof Integrations as string]: {
|
|
84
|
+
channels: Integrations[K] extends {
|
|
85
|
+
channels: Channels;
|
|
86
|
+
} ? Integrations[K]["channels"] : never;
|
|
87
|
+
events: Integrations[K] extends {
|
|
88
|
+
events: Events;
|
|
89
|
+
} ? Integrations[K]["events"] : never;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
type Channels<Integrations extends IIntegrations> = {
|
|
93
|
+
[K in keyof Integrations]: K extends string ? {
|
|
94
|
+
[C in keyof Integrations[K]["channels"]]: C extends string ? `${K}.${C}` : never;
|
|
95
|
+
}[keyof Integrations[K]["channels"]] : never;
|
|
96
|
+
}[keyof Integrations];
|
|
97
|
+
type GetIntegrationAndChannel<Integrations extends IIntegrations, T extends Channels<Integrations>> = T extends `${infer I}.${infer C}` ? I extends keyof Integrations ? C extends keyof Integrations[I]["channels"] ? Integrations[I]["channels"][C] : never : never : never;
|
|
98
|
+
type GetIntegration<Integrations extends IIntegrations, T extends Channels<Integrations>> = T extends `${infer I}.${string}` ? I extends keyof Integrations ? I : never : never;
|
|
99
|
+
type ChannelTags<Integrations extends IIntegrations, T extends Channels<Integrations>> = GetIntegrationAndChannel<Integrations, T>["conversation"]["tags"];
|
|
100
|
+
type ChannelMessages<Integrations extends IIntegrations, T extends Channels<Integrations>> = GetIntegrationAndChannel<Integrations, T>["messages"];
|
|
101
|
+
type ChannelMessageTags<Integrations extends IIntegrations, T extends Channels<Integrations>> = GetIntegrationAndChannel<Integrations, T>["message"]["tags"];
|
|
102
|
+
type ChannelEvents<Integrations extends IIntegrations, T extends Channels<Integrations>> = Integrations[GetIntegration<Integrations, T>]["events"];
|
|
103
|
+
export {};
|
|
104
|
+
//# sourceMappingURL=conversation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../src/primitives/conversation.ts"],"names":[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C,SAAS,GAAG,MAAM,CAAC,IAAI,MAAM,EAAE,GAChC,CAAC,SAAS,MAAM,YAAY,GAC1B,CAAC,GACD,KAAK,GACP,KAAK,CAAC;AAEV,KAAK,WAAW,CACd,YAAY,SAAS,aAAa,EAClC,CAAC,SAAS,QAAQ,CAAC,YAAY,CAAC,IAC9B,wBAAwB,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,KAAK,eAAe,CAClB,YAAY,SAAS,aAAa,EAClC,CAAC,SAAS,QAAQ,CAAC,YAAY,CAAC,IAC9B,wBAAwB,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;AAE1D,KAAK,kBAAkB,CACrB,YAAY,SAAS,aAAa,EAClC,CAAC,SAAS,QAAQ,CAAC,YAAY,CAAC,IAC9B,wBAAwB,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjE,KAAK,aAAa,CAChB,YAAY,SAAS,aAAa,EAClC,CAAC,SAAS,QAAQ,CAAC,YAAY,CAAC,IAC9B,YAAY,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createSyncWorkflow } from "./source-base";
|
|
2
|
+
import { TableSource } from "./source-table";
|
|
3
|
+
import { WebsiteSource } from "./source-website";
|
|
4
|
+
import { DirectorySource } from "./source-directory";
|
|
5
|
+
export type DataSource = TableSource | WebsiteSource | DirectorySource;
|
|
6
|
+
export { TableSource, WebsiteSource, DirectorySource, createSyncWorkflow };
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primitives/data-sources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,eAAe,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { ZuiType } from "llmz/dist/types";
|
|
2
|
+
import { BaseWorkflow, Typings } from "../workflow";
|
|
3
|
+
import { z } from "@botpress/sdk";
|
|
4
|
+
export type Item = z.infer<typeof Item>;
|
|
5
|
+
declare const Item: import("@bpinternal/zui").ZodObject<{
|
|
6
|
+
file: import("@bpinternal/zui").ZodString;
|
|
7
|
+
name: import("@bpinternal/zui").ZodString;
|
|
8
|
+
hash: import("@bpinternal/zui").ZodString;
|
|
9
|
+
size: import("@bpinternal/zui").ZodNumber;
|
|
10
|
+
}, "strip", {
|
|
11
|
+
name: string;
|
|
12
|
+
size: number;
|
|
13
|
+
hash: string;
|
|
14
|
+
file: string;
|
|
15
|
+
}, {
|
|
16
|
+
name: string;
|
|
17
|
+
size: number;
|
|
18
|
+
hash: string;
|
|
19
|
+
file: string;
|
|
20
|
+
}>;
|
|
21
|
+
export type SyncInput = z.infer<typeof SyncInput>;
|
|
22
|
+
export declare const SyncInput: import("@bpinternal/zui").ZodObject<{
|
|
23
|
+
sourceId: import("@bpinternal/zui").ZodString;
|
|
24
|
+
kbName: import("@bpinternal/zui").ZodString;
|
|
25
|
+
force: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodBoolean>>;
|
|
26
|
+
}, "strip", {
|
|
27
|
+
kbName: string;
|
|
28
|
+
sourceId: string;
|
|
29
|
+
force: boolean;
|
|
30
|
+
}, {
|
|
31
|
+
kbName: string;
|
|
32
|
+
sourceId: string;
|
|
33
|
+
force?: boolean | undefined;
|
|
34
|
+
}>;
|
|
35
|
+
export type SyncOutput = z.infer<typeof SyncOutput>;
|
|
36
|
+
export declare const SyncOutput: import("@bpinternal/zui").ZodObject<{
|
|
37
|
+
processed: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodNumber>;
|
|
38
|
+
added: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
39
|
+
file: import("@bpinternal/zui").ZodString;
|
|
40
|
+
name: import("@bpinternal/zui").ZodString;
|
|
41
|
+
hash: import("@bpinternal/zui").ZodString;
|
|
42
|
+
size: import("@bpinternal/zui").ZodNumber;
|
|
43
|
+
}, "strip", {
|
|
44
|
+
name: string;
|
|
45
|
+
size: number;
|
|
46
|
+
hash: string;
|
|
47
|
+
file: string;
|
|
48
|
+
}, {
|
|
49
|
+
name: string;
|
|
50
|
+
size: number;
|
|
51
|
+
hash: string;
|
|
52
|
+
file: string;
|
|
53
|
+
}>, "many">>;
|
|
54
|
+
updated: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
55
|
+
file: import("@bpinternal/zui").ZodString;
|
|
56
|
+
name: import("@bpinternal/zui").ZodString;
|
|
57
|
+
hash: import("@bpinternal/zui").ZodString;
|
|
58
|
+
size: import("@bpinternal/zui").ZodNumber;
|
|
59
|
+
}, "strip", {
|
|
60
|
+
name: string;
|
|
61
|
+
size: number;
|
|
62
|
+
hash: string;
|
|
63
|
+
file: string;
|
|
64
|
+
}, {
|
|
65
|
+
name: string;
|
|
66
|
+
size: number;
|
|
67
|
+
hash: string;
|
|
68
|
+
file: string;
|
|
69
|
+
}>, "many">>;
|
|
70
|
+
deleted: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
71
|
+
file: import("@bpinternal/zui").ZodString;
|
|
72
|
+
name: import("@bpinternal/zui").ZodString;
|
|
73
|
+
hash: import("@bpinternal/zui").ZodString;
|
|
74
|
+
size: import("@bpinternal/zui").ZodNumber;
|
|
75
|
+
}, "strip", {
|
|
76
|
+
name: string;
|
|
77
|
+
size: number;
|
|
78
|
+
hash: string;
|
|
79
|
+
file: string;
|
|
80
|
+
}, {
|
|
81
|
+
name: string;
|
|
82
|
+
size: number;
|
|
83
|
+
hash: string;
|
|
84
|
+
file: string;
|
|
85
|
+
}>, "many">>;
|
|
86
|
+
errors: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodString, "many">>;
|
|
87
|
+
}, "strip", {
|
|
88
|
+
processed: number;
|
|
89
|
+
added: {
|
|
90
|
+
name: string;
|
|
91
|
+
size: number;
|
|
92
|
+
hash: string;
|
|
93
|
+
file: string;
|
|
94
|
+
}[];
|
|
95
|
+
updated: {
|
|
96
|
+
name: string;
|
|
97
|
+
size: number;
|
|
98
|
+
hash: string;
|
|
99
|
+
file: string;
|
|
100
|
+
}[];
|
|
101
|
+
deleted: {
|
|
102
|
+
name: string;
|
|
103
|
+
size: number;
|
|
104
|
+
hash: string;
|
|
105
|
+
file: string;
|
|
106
|
+
}[];
|
|
107
|
+
errors: string[];
|
|
108
|
+
}, {
|
|
109
|
+
processed?: number | undefined;
|
|
110
|
+
added?: {
|
|
111
|
+
name: string;
|
|
112
|
+
size: number;
|
|
113
|
+
hash: string;
|
|
114
|
+
file: string;
|
|
115
|
+
}[] | undefined;
|
|
116
|
+
updated?: {
|
|
117
|
+
name: string;
|
|
118
|
+
size: number;
|
|
119
|
+
hash: string;
|
|
120
|
+
file: string;
|
|
121
|
+
}[] | undefined;
|
|
122
|
+
deleted?: {
|
|
123
|
+
name: string;
|
|
124
|
+
size: number;
|
|
125
|
+
hash: string;
|
|
126
|
+
file: string;
|
|
127
|
+
}[] | undefined;
|
|
128
|
+
errors?: string[] | undefined;
|
|
129
|
+
}>;
|
|
130
|
+
export declare const createSyncWorkflow: <TState extends ZuiType = ZuiType>(props: {
|
|
131
|
+
type: string;
|
|
132
|
+
state: TState;
|
|
133
|
+
handler: (props: Typings.HandlerProps<typeof SyncInput, typeof SyncOutput, TState>) => Promise<z.infer<typeof SyncOutput>>;
|
|
134
|
+
}) => BaseWorkflow<`data_source_sync_${string}`, import("@bpinternal/zui").ZodObject<{
|
|
135
|
+
sourceId: import("@bpinternal/zui").ZodString;
|
|
136
|
+
kbName: import("@bpinternal/zui").ZodString;
|
|
137
|
+
force: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodBoolean>>;
|
|
138
|
+
}, "strip", {
|
|
139
|
+
kbName: string;
|
|
140
|
+
sourceId: string;
|
|
141
|
+
force: boolean;
|
|
142
|
+
}, {
|
|
143
|
+
kbName: string;
|
|
144
|
+
sourceId: string;
|
|
145
|
+
force?: boolean | undefined;
|
|
146
|
+
}>, import("@bpinternal/zui").ZodObject<{
|
|
147
|
+
processed: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodNumber>;
|
|
148
|
+
added: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
149
|
+
file: import("@bpinternal/zui").ZodString;
|
|
150
|
+
name: import("@bpinternal/zui").ZodString;
|
|
151
|
+
hash: import("@bpinternal/zui").ZodString;
|
|
152
|
+
size: import("@bpinternal/zui").ZodNumber;
|
|
153
|
+
}, "strip", {
|
|
154
|
+
name: string;
|
|
155
|
+
size: number;
|
|
156
|
+
hash: string;
|
|
157
|
+
file: string;
|
|
158
|
+
}, {
|
|
159
|
+
name: string;
|
|
160
|
+
size: number;
|
|
161
|
+
hash: string;
|
|
162
|
+
file: string;
|
|
163
|
+
}>, "many">>;
|
|
164
|
+
updated: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
165
|
+
file: import("@bpinternal/zui").ZodString;
|
|
166
|
+
name: import("@bpinternal/zui").ZodString;
|
|
167
|
+
hash: import("@bpinternal/zui").ZodString;
|
|
168
|
+
size: import("@bpinternal/zui").ZodNumber;
|
|
169
|
+
}, "strip", {
|
|
170
|
+
name: string;
|
|
171
|
+
size: number;
|
|
172
|
+
hash: string;
|
|
173
|
+
file: string;
|
|
174
|
+
}, {
|
|
175
|
+
name: string;
|
|
176
|
+
size: number;
|
|
177
|
+
hash: string;
|
|
178
|
+
file: string;
|
|
179
|
+
}>, "many">>;
|
|
180
|
+
deleted: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
181
|
+
file: import("@bpinternal/zui").ZodString;
|
|
182
|
+
name: import("@bpinternal/zui").ZodString;
|
|
183
|
+
hash: import("@bpinternal/zui").ZodString;
|
|
184
|
+
size: import("@bpinternal/zui").ZodNumber;
|
|
185
|
+
}, "strip", {
|
|
186
|
+
name: string;
|
|
187
|
+
size: number;
|
|
188
|
+
hash: string;
|
|
189
|
+
file: string;
|
|
190
|
+
}, {
|
|
191
|
+
name: string;
|
|
192
|
+
size: number;
|
|
193
|
+
hash: string;
|
|
194
|
+
file: string;
|
|
195
|
+
}>, "many">>;
|
|
196
|
+
errors: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodString, "many">>;
|
|
197
|
+
}, "strip", {
|
|
198
|
+
processed: number;
|
|
199
|
+
added: {
|
|
200
|
+
name: string;
|
|
201
|
+
size: number;
|
|
202
|
+
hash: string;
|
|
203
|
+
file: string;
|
|
204
|
+
}[];
|
|
205
|
+
updated: {
|
|
206
|
+
name: string;
|
|
207
|
+
size: number;
|
|
208
|
+
hash: string;
|
|
209
|
+
file: string;
|
|
210
|
+
}[];
|
|
211
|
+
deleted: {
|
|
212
|
+
name: string;
|
|
213
|
+
size: number;
|
|
214
|
+
hash: string;
|
|
215
|
+
file: string;
|
|
216
|
+
}[];
|
|
217
|
+
errors: string[];
|
|
218
|
+
}, {
|
|
219
|
+
processed?: number | undefined;
|
|
220
|
+
added?: {
|
|
221
|
+
name: string;
|
|
222
|
+
size: number;
|
|
223
|
+
hash: string;
|
|
224
|
+
file: string;
|
|
225
|
+
}[] | undefined;
|
|
226
|
+
updated?: {
|
|
227
|
+
name: string;
|
|
228
|
+
size: number;
|
|
229
|
+
hash: string;
|
|
230
|
+
file: string;
|
|
231
|
+
}[] | undefined;
|
|
232
|
+
deleted?: {
|
|
233
|
+
name: string;
|
|
234
|
+
size: number;
|
|
235
|
+
hash: string;
|
|
236
|
+
file: string;
|
|
237
|
+
}[] | undefined;
|
|
238
|
+
errors?: string[] | undefined;
|
|
239
|
+
}>, TState, Record<string, import("../../types").ZuiType>>;
|
|
240
|
+
export declare abstract class DataSource {
|
|
241
|
+
readonly id: string;
|
|
242
|
+
readonly type: string;
|
|
243
|
+
/**
|
|
244
|
+
* The workflow that handles synchronization for this data source
|
|
245
|
+
* Each data source type provides its own sync workflow implementation
|
|
246
|
+
*/
|
|
247
|
+
abstract readonly syncWorkflow: BaseWorkflow<any>;
|
|
248
|
+
constructor(id: string, type: string);
|
|
249
|
+
}
|
|
250
|
+
export {};
|
|
251
|
+
//# sourceMappingURL=source-base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-base.d.ts","sourceRoot":"","sources":["../../../src/primitives/data-sources/source-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAGlC,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AACxC,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;EAKR,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAClD,eAAO,MAAM,SAAS;;;;;;;;;;;;EAQpB,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AACpD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMrB,CAAC;AAEH,eAAO,MAAM,kBAAkB,GAAI,MAAM,SAAS,OAAO,GAAG,OAAO,EAAE,OAAO;IAC1E,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CACP,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,OAAO,SAAS,EAAE,OAAO,UAAU,EAAE,MAAM,CAAC,KACrE,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC;CAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0DA8BG,CAAC;AAEL,8BAAsB,UAAU;IAC9B,SAAgB,EAAE,EAAE,MAAM,CAAC;IAC3B,SAAgB,IAAI,EAAE,MAAM,CAAC;IAE7B;;;OAGG;IACH,kBAAyB,YAAY,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;gBAE7C,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAIrC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { DataSource } from "./source-base";
|
|
2
|
+
type DirectorySourceOptions = {
|
|
3
|
+
id?: string;
|
|
4
|
+
filter?: (filePath: string) => boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare class DirectorySource extends DataSource {
|
|
7
|
+
private directoryPath;
|
|
8
|
+
private filterFn;
|
|
9
|
+
private constructor();
|
|
10
|
+
get syncWorkflow(): import("../workflow").BaseWorkflow<`data_source_sync_${string}`, import("@bpinternal/zui").ZodObject<{
|
|
11
|
+
sourceId: import("@bpinternal/zui").ZodString;
|
|
12
|
+
kbName: import("@bpinternal/zui").ZodString;
|
|
13
|
+
force: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodBoolean>>;
|
|
14
|
+
}, "strip", {
|
|
15
|
+
kbName: string;
|
|
16
|
+
sourceId: string;
|
|
17
|
+
force: boolean;
|
|
18
|
+
}, {
|
|
19
|
+
kbName: string;
|
|
20
|
+
sourceId: string;
|
|
21
|
+
force?: boolean | undefined;
|
|
22
|
+
}>, import("@bpinternal/zui").ZodObject<{
|
|
23
|
+
processed: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodNumber>;
|
|
24
|
+
added: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
25
|
+
file: import("@bpinternal/zui").ZodString;
|
|
26
|
+
name: import("@bpinternal/zui").ZodString;
|
|
27
|
+
hash: import("@bpinternal/zui").ZodString;
|
|
28
|
+
size: import("@bpinternal/zui").ZodNumber;
|
|
29
|
+
}, "strip", {
|
|
30
|
+
name: string;
|
|
31
|
+
size: number;
|
|
32
|
+
hash: string;
|
|
33
|
+
file: string;
|
|
34
|
+
}, {
|
|
35
|
+
name: string;
|
|
36
|
+
size: number;
|
|
37
|
+
hash: string;
|
|
38
|
+
file: string;
|
|
39
|
+
}>, "many">>;
|
|
40
|
+
updated: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
41
|
+
file: import("@bpinternal/zui").ZodString;
|
|
42
|
+
name: import("@bpinternal/zui").ZodString;
|
|
43
|
+
hash: import("@bpinternal/zui").ZodString;
|
|
44
|
+
size: import("@bpinternal/zui").ZodNumber;
|
|
45
|
+
}, "strip", {
|
|
46
|
+
name: string;
|
|
47
|
+
size: number;
|
|
48
|
+
hash: string;
|
|
49
|
+
file: string;
|
|
50
|
+
}, {
|
|
51
|
+
name: string;
|
|
52
|
+
size: number;
|
|
53
|
+
hash: string;
|
|
54
|
+
file: string;
|
|
55
|
+
}>, "many">>;
|
|
56
|
+
deleted: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
57
|
+
file: import("@bpinternal/zui").ZodString;
|
|
58
|
+
name: import("@bpinternal/zui").ZodString;
|
|
59
|
+
hash: import("@bpinternal/zui").ZodString;
|
|
60
|
+
size: import("@bpinternal/zui").ZodNumber;
|
|
61
|
+
}, "strip", {
|
|
62
|
+
name: string;
|
|
63
|
+
size: number;
|
|
64
|
+
hash: string;
|
|
65
|
+
file: string;
|
|
66
|
+
}, {
|
|
67
|
+
name: string;
|
|
68
|
+
size: number;
|
|
69
|
+
hash: string;
|
|
70
|
+
file: string;
|
|
71
|
+
}>, "many">>;
|
|
72
|
+
errors: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodString, "many">>;
|
|
73
|
+
}, "strip", {
|
|
74
|
+
processed: number;
|
|
75
|
+
added: {
|
|
76
|
+
name: string;
|
|
77
|
+
size: number;
|
|
78
|
+
hash: string;
|
|
79
|
+
file: string;
|
|
80
|
+
}[];
|
|
81
|
+
updated: {
|
|
82
|
+
name: string;
|
|
83
|
+
size: number;
|
|
84
|
+
hash: string;
|
|
85
|
+
file: string;
|
|
86
|
+
}[];
|
|
87
|
+
deleted: {
|
|
88
|
+
name: string;
|
|
89
|
+
size: number;
|
|
90
|
+
hash: string;
|
|
91
|
+
file: string;
|
|
92
|
+
}[];
|
|
93
|
+
errors: string[];
|
|
94
|
+
}, {
|
|
95
|
+
processed?: number | undefined;
|
|
96
|
+
added?: {
|
|
97
|
+
name: string;
|
|
98
|
+
size: number;
|
|
99
|
+
hash: string;
|
|
100
|
+
file: string;
|
|
101
|
+
}[] | undefined;
|
|
102
|
+
updated?: {
|
|
103
|
+
name: string;
|
|
104
|
+
size: number;
|
|
105
|
+
hash: string;
|
|
106
|
+
file: string;
|
|
107
|
+
}[] | undefined;
|
|
108
|
+
deleted?: {
|
|
109
|
+
name: string;
|
|
110
|
+
size: number;
|
|
111
|
+
hash: string;
|
|
112
|
+
file: string;
|
|
113
|
+
}[] | undefined;
|
|
114
|
+
errors?: string[] | undefined;
|
|
115
|
+
}>, import("@bpinternal/zui").ZodObject<{}, "strip", {}, {}>, Record<string, import("../../types").ZuiType>>;
|
|
116
|
+
static fromPath(directoryPath: string, options?: DirectorySourceOptions): DirectorySource;
|
|
117
|
+
}
|
|
118
|
+
export {};
|
|
119
|
+
//# sourceMappingURL=source-directory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-directory.d.ts","sourceRoot":"","sources":["../../../src/primitives/data-sources/source-directory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAA4B,MAAM,eAAe,CAAC;AAIrE,KAAK,sBAAsB,GAAG;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;CACxC,CAAC;AAgBF,qBAAa,eAAgB,SAAQ,UAAU;IAC7C,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAA8C;IAE9D,OAAO;IAUP,IAAW,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iHA8LtB;IAED,MAAM,CAAC,QAAQ,CACb,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,sBAA2B,GACnC,eAAe;CAInB"}
|