@botpress/sdk 1.6.2 → 2.0.0
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/.turbo/turbo-build.log +3 -3
- package/dist/bot/client/index.d.ts +1 -0
- package/dist/bot/client/types.d.ts +2 -0
- package/dist/bot/definition.d.ts +31 -8
- package/dist/bot/implementation.d.ts +561 -150
- package/dist/bot/merge-bots.d.ts +2 -0
- package/dist/bot/server/types.d.ts +174 -84
- package/dist/bot/types/generic.d.ts +11 -1
- package/dist/fixtures.d.ts +31 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/integration/definition/generic.d.ts +7 -7
- package/dist/integration/definition/index.d.ts +8 -8
- package/dist/integration/definition/types.d.ts +2 -2
- package/dist/interface/definition.d.ts +12 -12
- package/dist/interface/types/generic.d.ts +34 -0
- package/dist/interface/types/generic.test.d.ts +1 -0
- package/dist/package.d.ts +29 -11
- package/dist/plugin/definition.d.ts +50 -0
- package/dist/plugin/implementation.d.ts +900 -0
- package/dist/plugin/index.d.ts +3 -0
- package/dist/plugin/server/types.d.ts +1 -0
- package/dist/plugin/server/types.test.d.ts +1 -0
- package/dist/plugin/types/generic.d.ts +30 -0
- package/dist/plugin/types/generic.test.d.ts +1 -0
- package/dist/schema.d.ts +3 -3
- package/dist/utils/array-utils.d.ts +1 -1
- package/dist/utils/record-utils.d.ts +1 -0
- package/dist/zui.d.ts +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../bot/server/types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BaseIntegration, DefaultIntegration, InputBaseIntegration } from '../../integration/types/generic';
|
|
2
|
+
import { BaseInterface, InputBaseInterface, DefaultInterface } from '../../interface/types/generic';
|
|
3
|
+
import * as utils from '../../utils/type-utils';
|
|
4
|
+
export type BaseAction = {
|
|
5
|
+
input: any;
|
|
6
|
+
output: any;
|
|
7
|
+
};
|
|
8
|
+
export type BasePlugin = {
|
|
9
|
+
configuration: any;
|
|
10
|
+
integrations: Record<string, BaseIntegration>;
|
|
11
|
+
interfaces: Record<string, BaseInterface>;
|
|
12
|
+
events: Record<string, any>;
|
|
13
|
+
states: Record<string, any>;
|
|
14
|
+
actions: Record<string, BaseAction>;
|
|
15
|
+
unknownDefinitions: true;
|
|
16
|
+
};
|
|
17
|
+
export type InputBasePlugin = utils.DeepPartial<BasePlugin>;
|
|
18
|
+
export type DefaultPlugin<B extends utils.DeepPartial<BasePlugin>> = {
|
|
19
|
+
configuration: utils.Default<B['configuration'], BasePlugin['configuration']>;
|
|
20
|
+
events: utils.Default<B['events'], BasePlugin['events']>;
|
|
21
|
+
states: utils.Default<B['states'], BasePlugin['states']>;
|
|
22
|
+
actions: utils.Default<B['actions'], BasePlugin['actions']>;
|
|
23
|
+
unknownDefinitions: utils.Default<B['unknownDefinitions'], BasePlugin['unknownDefinitions']>;
|
|
24
|
+
integrations: undefined extends B['integrations'] ? BasePlugin['integrations'] : {
|
|
25
|
+
[K in keyof B['integrations']]: DefaultIntegration<utils.Cast<B['integrations'][K], InputBaseIntegration>>;
|
|
26
|
+
};
|
|
27
|
+
interfaces: undefined extends B['interfaces'] ? BasePlugin['interfaces'] : {
|
|
28
|
+
[K in keyof B['interfaces']]: DefaultInterface<utils.Cast<B['interfaces'][K], InputBaseInterface>>;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/schema.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from './zui';
|
|
2
2
|
type SchemaOptions<T> = {
|
|
3
3
|
title: string;
|
|
4
4
|
examples: T[];
|
|
5
5
|
};
|
|
6
6
|
type IsEmptyObject<T> = keyof T extends never ? true : false;
|
|
7
|
-
type UiDefinition<TSchema extends z.
|
|
7
|
+
type UiDefinition<TSchema extends z.ZuiObjectSchema = z.ZuiObjectSchema> = IsEmptyObject<z.infer<TSchema>> extends true ? Record<string, never> : {
|
|
8
8
|
[K in keyof z.infer<TSchema>]: Partial<SchemaOptions<z.infer<TSchema>[K]>>;
|
|
9
9
|
};
|
|
10
|
-
export type SchemaDefinition<TSchema extends z.
|
|
10
|
+
export type SchemaDefinition<TSchema extends z.ZuiObjectSchema = z.ZuiObjectSchema> = {
|
|
11
11
|
schema: TSchema;
|
|
12
12
|
/**
|
|
13
13
|
* @deprecated
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const safePush: <T>(arr: T[] | undefined,
|
|
1
|
+
export declare const safePush: <T>(arr: T[] | undefined, ...values: T[]) => T[];
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export declare const pairs: <K extends string, V>(obj: Record<K, V>) => [K, V][];
|
|
2
|
+
export declare const values: <K extends string, V>(obj: Record<K, V>) => V[];
|
|
2
3
|
export declare const mapValues: <K extends string, V, R>(obj: Record<K, V>, fn: (value: V, key: K) => R) => Record<K, R>;
|
package/dist/zui.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from '@bpinternal/zui';
|
|
2
2
|
export * from '@bpinternal/zui';
|
|
3
3
|
export type GenericZuiSchema<A extends Record<string, z.ZodTypeAny> = Record<string, z.ZodTypeAny>, R extends z.ZodTypeAny = z.ZodTypeAny> = (typeArguments: A) => R;
|
|
4
|
+
export type ZuiObjectSchema = z.ZodObject | z.ZodRecord;
|
|
4
5
|
export default z;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botpress/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Botpress SDK",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"author": "",
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@botpress/client": "0.36.
|
|
17
|
+
"@botpress/client": "0.36.1",
|
|
18
18
|
"@bpinternal/zui": "0.12.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|