@botpress/sdk 0.0.5 → 0.0.7

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/build.ts ADDED
@@ -0,0 +1,16 @@
1
+ import esbuild from 'esbuild'
2
+
3
+ import { dependencies } from './package.json'
4
+
5
+ const external = Object.keys(dependencies)
6
+
7
+ void esbuild.build({
8
+ entryPoints: ['./src/index.ts'],
9
+ bundle: true,
10
+ platform: 'node',
11
+ minify: true,
12
+ sourcemap: true,
13
+ outfile: './dist/index.js',
14
+ format: 'cjs',
15
+ external,
16
+ })
@@ -18,7 +18,7 @@ export type BotDefinitionStateType = 'conversation' | 'user' | 'bot';
18
18
  export type BotDefinitionState = {
19
19
  type: BotDefinitionStateType;
20
20
  schema: Record<string, any>;
21
- expiry: number;
21
+ expiry?: number;
22
22
  };
23
23
  export type IntegrationInstance = {
24
24
  enabled: boolean;
@@ -27,16 +27,35 @@ export type IntegrationInstance = {
27
27
  [key: string]: any;
28
28
  };
29
29
  };
30
+ export type BotDefinitionRecurringEvent = {
31
+ type: string;
32
+ payload: Record<string, any>;
33
+ schedule: {
34
+ cron: string;
35
+ };
36
+ };
37
+ export type BotDefinitionEvent = {
38
+ schema: Record<string, any>;
39
+ };
40
+ export type BotDefinitionConfiguration = {
41
+ schema: Record<string, any>;
42
+ };
30
43
  export type BotDefinition = {
31
44
  tags?: BotDefinitionTags;
32
45
  states?: Record<string, BotDefinitionState>;
33
46
  integrations?: IntegrationInstance[];
47
+ configuration?: BotDefinitionConfiguration;
48
+ events?: Record<string, BotDefinitionEvent>;
49
+ recurringEvents?: Record<string, BotDefinitionRecurringEvent>;
34
50
  };
35
51
  export declare class Bot {
36
52
  private _state;
37
53
  readonly tags?: BotDefinitionTags;
38
54
  readonly states?: Record<string, BotDefinitionState>;
39
55
  readonly integrations?: IntegrationInstance[];
56
+ readonly configuration?: BotDefinitionConfiguration;
57
+ readonly events?: Record<string, BotDefinitionEvent>;
58
+ readonly recurringEvents?: Record<string, BotDefinitionRecurringEvent>;
40
59
  constructor(def?: BotDefinition);
41
60
  register: (_handler: RegisterHandler) => void;
42
61
  unregister: (_handler: UnregisterHandler) => void;
package/dist/index.d.ts CHANGED
@@ -5,5 +5,7 @@ export declare const clients: {
5
5
  IntegrationClient: typeof IntegrationClient;
6
6
  BotClient: typeof BotClient;
7
7
  };
8
+ export * from './const';
9
+ export * from './serve';
8
10
  export { IntegrationDefinition, IntegrationDefinitionProps, IntegrationImplementation as Integration, IntegrationImplementationProps as IntegrationProps, IntegrationContext, IntegrationOperation, AckFunction, } from './integration';
9
11
  export { Bot, BotContext, BotOperation, IntegrationInstance } from './bot';