@botpress/cli 4.17.14 → 4.17.15

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.
Files changed (185) hide show
  1. package/.turbo/turbo-build.log +16 -12
  2. package/bin.js +1 -1
  3. package/dist/api/bot-body.d.ts +5 -0
  4. package/dist/api/client.d.ts +50 -0
  5. package/dist/api/index.d.ts +6 -0
  6. package/dist/api/integration-body.d.ts +5 -0
  7. package/dist/api/interface-body.d.ts +7 -0
  8. package/dist/api/paging.d.ts +9 -0
  9. package/dist/api/plugin-body.d.ts +5 -0
  10. package/dist/api/retry.d.ts +2 -0
  11. package/dist/api/types.d.ts +62 -0
  12. package/dist/chat/index.d.ts +25 -0
  13. package/dist/cli.d.ts +1 -0
  14. package/dist/cli.js +51 -0
  15. package/dist/cli.js.map +7 -0
  16. package/dist/code-generation/bot-implementation/bot-implementation.d.ts +8 -0
  17. package/dist/code-generation/bot-implementation/bot-plugins/index.d.ts +7 -0
  18. package/dist/code-generation/bot-implementation/bot-plugins/plugin-module.d.ts +13 -0
  19. package/dist/code-generation/bot-implementation/bot-typings/actions-module.d.ts +21 -0
  20. package/dist/code-generation/bot-implementation/bot-typings/events-module.d.ts +10 -0
  21. package/dist/code-generation/bot-implementation/bot-typings/index.d.ts +7 -0
  22. package/dist/code-generation/bot-implementation/bot-typings/states-module.d.ts +17 -0
  23. package/dist/code-generation/bot-implementation/bot-typings/tables-module.d.ts +10 -0
  24. package/dist/code-generation/bot-implementation/bot-typings/workflows-module.d.ts +27 -0
  25. package/dist/code-generation/bot-implementation/index.d.ts +3 -0
  26. package/dist/code-generation/consts.d.ts +5 -0
  27. package/dist/code-generation/generators.d.ts +10 -0
  28. package/dist/code-generation/index.d.ts +8 -0
  29. package/dist/code-generation/integration-implementation/index.d.ts +3 -0
  30. package/dist/code-generation/integration-implementation/integration-implementation.d.ts +7 -0
  31. package/dist/code-generation/integration-implementation/integration-secret.d.ts +8 -0
  32. package/dist/code-generation/integration-implementation/integration-typings/actions-module.d.ts +21 -0
  33. package/dist/code-generation/integration-implementation/integration-typings/channels-module.d.ts +5 -0
  34. package/dist/code-generation/integration-implementation/integration-typings/configuration-module.d.ts +7 -0
  35. package/dist/code-generation/integration-implementation/integration-typings/configurations-module.d.ts +10 -0
  36. package/dist/code-generation/integration-implementation/integration-typings/entities-module.d.ts +10 -0
  37. package/dist/code-generation/integration-implementation/integration-typings/events-module.d.ts +10 -0
  38. package/dist/code-generation/integration-implementation/integration-typings/index.d.ts +8 -0
  39. package/dist/code-generation/integration-implementation/integration-typings/states-module.d.ts +17 -0
  40. package/dist/code-generation/integration-package/index.d.ts +2 -0
  41. package/dist/code-generation/integration-package/integration-package-definition/actions-module.d.ts +21 -0
  42. package/dist/code-generation/integration-package/integration-package-definition/channels-module.d.ts +5 -0
  43. package/dist/code-generation/integration-package/integration-package-definition/configuration-module.d.ts +7 -0
  44. package/dist/code-generation/integration-package/integration-package-definition/configurations-module.d.ts +10 -0
  45. package/dist/code-generation/integration-package/integration-package-definition/entities-module.d.ts +10 -0
  46. package/dist/code-generation/integration-package/integration-package-definition/events-module.d.ts +10 -0
  47. package/dist/code-generation/integration-package/integration-package-definition/index.d.ts +8 -0
  48. package/dist/code-generation/integration-package/integration-package-definition/interfaces-module.d.ts +10 -0
  49. package/dist/code-generation/integration-package/integration-package-definition/states-module.d.ts +10 -0
  50. package/dist/code-generation/integration-package/integration-package-definition/typings.d.ts +10 -0
  51. package/dist/code-generation/interface-implementation/index.d.ts +4 -0
  52. package/dist/code-generation/interface-implementation/integration-typings/actions-module.d.ts +21 -0
  53. package/dist/code-generation/interface-implementation/integration-typings/channels-module.d.ts +5 -0
  54. package/dist/code-generation/interface-implementation/integration-typings/entities-module.d.ts +10 -0
  55. package/dist/code-generation/interface-implementation/integration-typings/events-module.d.ts +10 -0
  56. package/dist/code-generation/interface-implementation/integration-typings/index.d.ts +8 -0
  57. package/dist/code-generation/interface-package/index.d.ts +2 -0
  58. package/dist/code-generation/interface-package/interface-package-definition/actions-module.d.ts +21 -0
  59. package/dist/code-generation/interface-package/interface-package-definition/channels-module.d.ts +5 -0
  60. package/dist/code-generation/interface-package/interface-package-definition/entities-module.d.ts +10 -0
  61. package/dist/code-generation/interface-package/interface-package-definition/events-module.d.ts +10 -0
  62. package/dist/code-generation/interface-package/interface-package-definition/index.d.ts +8 -0
  63. package/dist/code-generation/interface-package/interface-package-definition/typings.d.ts +7 -0
  64. package/dist/code-generation/module.d.ts +49 -0
  65. package/dist/code-generation/plugin-implementation/index.d.ts +3 -0
  66. package/dist/code-generation/plugin-implementation/plugin-implementation.d.ts +7 -0
  67. package/dist/code-generation/plugin-implementation/plugin-typings/actions-module.d.ts +21 -0
  68. package/dist/code-generation/plugin-implementation/plugin-typings/configuration-module.d.ts +7 -0
  69. package/dist/code-generation/plugin-implementation/plugin-typings/events-module.d.ts +10 -0
  70. package/dist/code-generation/plugin-implementation/plugin-typings/index.d.ts +8 -0
  71. package/dist/code-generation/plugin-implementation/plugin-typings/states-module.d.ts +17 -0
  72. package/dist/code-generation/plugin-implementation/plugin-typings/tables-module.d.ts +10 -0
  73. package/dist/code-generation/plugin-implementation/plugin-typings/workflows-module.d.ts +27 -0
  74. package/dist/code-generation/plugin-package/index.d.ts +2 -0
  75. package/dist/code-generation/plugin-package/plugin-package-definition/actions-module.d.ts +21 -0
  76. package/dist/code-generation/plugin-package/plugin-package-definition/configuration-module.d.ts +7 -0
  77. package/dist/code-generation/plugin-package/plugin-package-definition/events-module.d.ts +10 -0
  78. package/dist/code-generation/plugin-package/plugin-package-definition/index.d.ts +8 -0
  79. package/dist/code-generation/plugin-package/plugin-package-definition/interfaces-module.d.ts +7 -0
  80. package/dist/code-generation/plugin-package/plugin-package-definition/recurring-events-module.d.ts +5 -0
  81. package/dist/code-generation/plugin-package/plugin-package-definition/states-module.d.ts +10 -0
  82. package/dist/code-generation/plugin-package/plugin-package-definition/typings.d.ts +7 -0
  83. package/dist/code-generation/strings.d.ts +4 -0
  84. package/dist/code-generation/typings.d.ts +162 -0
  85. package/dist/code-generation/typings.test.d.ts +1 -0
  86. package/dist/command-definitions.d.ts +1480 -0
  87. package/dist/command-implementations/add-command.d.ts +15 -0
  88. package/dist/command-implementations/base-command.d.ts +13 -0
  89. package/dist/command-implementations/bot-commands.d.ts +20 -0
  90. package/dist/command-implementations/build-command.d.ts +9 -0
  91. package/dist/command-implementations/bundle-command.d.ts +10 -0
  92. package/dist/command-implementations/chat-command.d.ts +13 -0
  93. package/dist/command-implementations/deploy-command.d.ts +18 -0
  94. package/dist/command-implementations/dev-command.d.ts +21 -0
  95. package/dist/command-implementations/gen-command.d.ts +11 -0
  96. package/dist/command-implementations/global-command.d.ts +57 -0
  97. package/dist/command-implementations/index.d.ts +1534 -0
  98. package/dist/command-implementations/init-command.d.ts +17 -0
  99. package/dist/command-implementations/integration-commands.d.ts +15 -0
  100. package/dist/command-implementations/interface-commands.d.ts +14 -0
  101. package/dist/command-implementations/lint-command.d.ts +15 -0
  102. package/dist/command-implementations/login-command.d.ts +6 -0
  103. package/dist/command-implementations/logout-command.d.ts +6 -0
  104. package/dist/command-implementations/plugin-commands.d.ts +14 -0
  105. package/dist/command-implementations/profile-commands.d.ts +14 -0
  106. package/dist/command-implementations/project-command.d.ts +67 -0
  107. package/dist/command-implementations/read-command.d.ts +10 -0
  108. package/dist/command-implementations/serve-command.d.ts +6 -0
  109. package/dist/command-tree.d.ts +39 -0
  110. package/dist/config.d.ts +1441 -0
  111. package/dist/consts.d.ts +41 -0
  112. package/dist/errors.d.ts +56 -0
  113. package/dist/index.d.ts +1524 -0
  114. package/dist/index.js +50 -25
  115. package/dist/index.js.map +3 -3
  116. package/dist/init.d.ts +1 -0
  117. package/dist/linter/base-linter.d.ts +21 -0
  118. package/dist/linter/base-linter.test.d.ts +1 -0
  119. package/dist/linter/bot-linter.d.ts +5 -0
  120. package/dist/linter/integration-linter.d.ts +7 -0
  121. package/dist/linter/interface-linter.d.ts +5 -0
  122. package/dist/linter/ruleset-tests/bot.ruleset.test.d.ts +1 -0
  123. package/dist/linter/ruleset-tests/common.d.ts +9 -0
  124. package/dist/linter/ruleset-tests/integration.ruleset.test.d.ts +1 -0
  125. package/dist/linter/ruleset-tests/interface.ruleset.test.d.ts +1 -0
  126. package/dist/linter/rulesets/bot.ruleset.d.ts +165 -0
  127. package/dist/linter/rulesets/integration.ruleset.d.ts +390 -0
  128. package/dist/linter/rulesets/interface.ruleset.d.ts +141 -0
  129. package/dist/linter/spectral-functions.d.ts +11 -0
  130. package/dist/logger/base-logger.d.ts +43 -0
  131. package/dist/logger/index.d.ts +22 -0
  132. package/dist/logger/logger.test.d.ts +1 -0
  133. package/dist/package-ref.d.ts +22 -0
  134. package/dist/package-ref.test.d.ts +1 -0
  135. package/dist/project-templates.d.ts +42 -0
  136. package/dist/register-yargs.d.ts +4 -0
  137. package/dist/root.d.ts +7 -0
  138. package/dist/sdk/index.d.ts +2 -0
  139. package/dist/sdk/validate-bot.d.ts +2 -0
  140. package/dist/sdk/validate-bot.test.d.ts +1 -0
  141. package/dist/sdk/validate-integration.d.ts +2 -0
  142. package/dist/tables/index.d.ts +1 -0
  143. package/dist/tables/schemas.d.ts +1259 -0
  144. package/dist/tables/tables-publisher.d.ts +22 -0
  145. package/dist/typings.d.ts +27 -0
  146. package/dist/utils/attribute-utils.d.ts +10 -0
  147. package/dist/utils/cache-utils.d.ts +14 -0
  148. package/dist/utils/case-utils.d.ts +14 -0
  149. package/dist/utils/case-utils.test.d.ts +1 -0
  150. package/dist/utils/concurrency-utils.d.ts +1 -0
  151. package/dist/utils/concurrency-utils.test.d.ts +1 -0
  152. package/dist/utils/esbuild-utils.d.ts +29 -0
  153. package/dist/utils/event-emitter.d.ts +7 -0
  154. package/dist/utils/file-watcher.d.ts +17 -0
  155. package/dist/utils/guard-utils.d.ts +4 -0
  156. package/dist/utils/id-utils.d.ts +2 -0
  157. package/dist/utils/index.d.ts +22 -0
  158. package/dist/utils/object-utils.d.ts +1 -0
  159. package/dist/utils/path-utils.d.ts +28 -0
  160. package/dist/utils/path-utils.test.d.ts +1 -0
  161. package/dist/utils/pkgjson-utils.d.ts +17 -0
  162. package/dist/utils/promise-utils.d.ts +2 -0
  163. package/dist/utils/promise-utils.test.d.ts +1 -0
  164. package/dist/utils/prompt-utils.d.ts +33 -0
  165. package/dist/utils/record-utils.d.ts +8 -0
  166. package/dist/utils/record-utils.test.d.ts +1 -0
  167. package/dist/utils/require-utils.d.ts +2 -0
  168. package/dist/utils/require-utils.test.d.ts +1 -0
  169. package/dist/utils/schema-utils.d.ts +13 -0
  170. package/dist/utils/schema-utils.test.d.ts +1 -0
  171. package/dist/utils/semver-utils.d.ts +8 -0
  172. package/dist/utils/string-utils.d.ts +2 -0
  173. package/dist/utils/template-utils.d.ts +1 -0
  174. package/dist/utils/tunnel-utils.d.ts +49 -0
  175. package/dist/utils/type-utils.d.ts +19 -0
  176. package/dist/utils/url-utils.d.ts +19 -0
  177. package/dist/worker/child-entrypoint.d.ts +1 -0
  178. package/dist/worker/child-wrapper.d.ts +18 -0
  179. package/dist/worker/config.d.ts +28 -0
  180. package/dist/worker/index.d.ts +2 -0
  181. package/dist/worker/is-child.d.ts +14 -0
  182. package/dist/worker/worker-state.d.ts +30 -0
  183. package/dist/worker/worker.d.ts +20 -0
  184. package/package.json +6 -4
  185. package/tsconfig.build.json +14 -0
@@ -0,0 +1,17 @@
1
+ import type commandDefinitions from '../command-definitions';
2
+ import { GlobalCommand } from './global-command';
3
+ export type InitCommandDefinition = typeof commandDefinitions.init;
4
+ export declare class InitCommand extends GlobalCommand<InitCommandDefinition> {
5
+ run(): Promise<void>;
6
+ private _promptWorkspaceHandle;
7
+ private _promptProjectType;
8
+ private _initPlugin;
9
+ private _getOrPromptForTemplate;
10
+ private _promptForTemplate;
11
+ private _getFullNameAndShortName;
12
+ private _initBot;
13
+ private _initIntegration;
14
+ private _getName;
15
+ private _copy;
16
+ private _checkIfDestinationCanBeUsed;
17
+ }
@@ -0,0 +1,15 @@
1
+ import type commandDefinitions from '../command-definitions';
2
+ import { GlobalCommand } from './global-command';
3
+ export type GetIntegrationCommandDefinition = typeof commandDefinitions.integrations.subcommands.get;
4
+ export declare class GetIntegrationCommand extends GlobalCommand<GetIntegrationCommandDefinition> {
5
+ run(): Promise<void>;
6
+ }
7
+ export type ListIntegrationsCommandDefinition = typeof commandDefinitions.integrations.subcommands.list;
8
+ export declare class ListIntegrationsCommand extends GlobalCommand<ListIntegrationsCommandDefinition> {
9
+ run(): Promise<void>;
10
+ }
11
+ export type DeleteIntegrationCommandDefinition = typeof commandDefinitions.integrations.subcommands.delete;
12
+ export declare class DeleteIntegrationCommand extends GlobalCommand<DeleteIntegrationCommandDefinition> {
13
+ run(): Promise<void>;
14
+ private _findIntegration;
15
+ }
@@ -0,0 +1,14 @@
1
+ import type commandDefinitions from '../command-definitions';
2
+ import { GlobalCommand } from './global-command';
3
+ export type GetInterfaceCommandDefinition = typeof commandDefinitions.interfaces.subcommands.get;
4
+ export declare class GetInterfaceCommand extends GlobalCommand<GetInterfaceCommandDefinition> {
5
+ run(): Promise<void>;
6
+ }
7
+ export type ListInterfacesCommandDefinition = typeof commandDefinitions.interfaces.subcommands.list;
8
+ export declare class ListInterfacesCommand extends GlobalCommand<ListInterfacesCommandDefinition> {
9
+ run(): Promise<void>;
10
+ }
11
+ export type DeleteInterfaceCommandDefinition = typeof commandDefinitions.interfaces.subcommands.delete;
12
+ export declare class DeleteInterfaceCommand extends GlobalCommand<DeleteInterfaceCommandDefinition> {
13
+ run(): Promise<void>;
14
+ }
@@ -0,0 +1,15 @@
1
+ import type commandDefinitions from '../command-definitions';
2
+ import { ProjectCommand } from './project-command';
3
+ export type LintCommandDefinition = typeof commandDefinitions.lint;
4
+ export declare class LintCommand extends ProjectCommand<LintCommandDefinition> {
5
+ run(): Promise<void>;
6
+ private _runLintForInterface;
7
+ private _runLintForBot;
8
+ private _stripAutoGeneratedContentFromBot;
9
+ private _runLintForIntegration;
10
+ private _stripAutoGeneratedContentFromIntegration;
11
+ private _getAutoGeneratedContentOfIntegration;
12
+ private _dereferenceActionDefinition;
13
+ private _dereferenceEventDefinition;
14
+ private _replaceRef;
15
+ }
@@ -0,0 +1,6 @@
1
+ import type commandDefinitions from '../command-definitions';
2
+ import { GlobalCommand } from './global-command';
3
+ export type LoginCommandDefinition = typeof commandDefinitions.login;
4
+ export declare class LoginCommand extends GlobalCommand<LoginCommandDefinition> {
5
+ run(): Promise<void>;
6
+ }
@@ -0,0 +1,6 @@
1
+ import type commandDefinitions from '../command-definitions';
2
+ import { GlobalCommand } from './global-command';
3
+ export type LogoutCommandDefinition = typeof commandDefinitions.logout;
4
+ export declare class LogoutCommand extends GlobalCommand<LogoutCommandDefinition> {
5
+ run(): Promise<void>;
6
+ }
@@ -0,0 +1,14 @@
1
+ import type commandDefinitions from '../command-definitions';
2
+ import { GlobalCommand } from './global-command';
3
+ export type GetPluginCommandDefinition = typeof commandDefinitions.plugins.subcommands.get;
4
+ export declare class GetPluginCommand extends GlobalCommand<GetPluginCommandDefinition> {
5
+ run(): Promise<void>;
6
+ }
7
+ export type ListPluginsCommandDefinition = typeof commandDefinitions.plugins.subcommands.list;
8
+ export declare class ListPluginsCommand extends GlobalCommand<ListPluginsCommandDefinition> {
9
+ run(): Promise<void>;
10
+ }
11
+ export type DeletePluginCommandDefinition = typeof commandDefinitions.plugins.subcommands.delete;
12
+ export declare class DeletePluginCommand extends GlobalCommand<DeletePluginCommandDefinition> {
13
+ run(): Promise<void>;
14
+ }
@@ -0,0 +1,14 @@
1
+ import type commandDefinitions from '../command-definitions';
2
+ import { GlobalCommand } from './global-command';
3
+ export type ActiveProfileCommandDefinition = typeof commandDefinitions.profiles.subcommands.active;
4
+ export declare class ActiveProfileCommand extends GlobalCommand<ActiveProfileCommandDefinition> {
5
+ run(): Promise<void>;
6
+ }
7
+ export type ListProfilesCommandDefinition = typeof commandDefinitions.profiles.subcommands.list;
8
+ export declare class ListProfilesCommand extends GlobalCommand<ListProfilesCommandDefinition> {
9
+ run(): Promise<void>;
10
+ }
11
+ export type UseProfileCommandDefinition = typeof commandDefinitions.profiles.subcommands.use;
12
+ export declare class UseProfileCommand extends GlobalCommand<UseProfileCommandDefinition> {
13
+ run(): Promise<void>;
14
+ }
@@ -0,0 +1,67 @@
1
+ import type * as client from '@botpress/client';
2
+ import type * as sdk from '@botpress/sdk';
3
+ import type { YargsConfig } from '@bpinternal/yargs-extra';
4
+ import * as apiUtils from '../api';
5
+ import * as config from '../config';
6
+ import * as consts from '../consts';
7
+ import type { CommandArgv, CommandDefinition } from '../typings';
8
+ import * as utils from '../utils';
9
+ import { GlobalCommand } from './global-command';
10
+ export type ProjectCommandDefinition = CommandDefinition<typeof config.schemas.project>;
11
+ export type ProjectCache = {
12
+ botId: string;
13
+ devId: string;
14
+ tunnelId: string;
15
+ };
16
+ type ConfigurableProjectPaths = {
17
+ workDir: string;
18
+ };
19
+ type ConstantProjectPaths = typeof consts.fromWorkDir;
20
+ type AllProjectPaths = ConfigurableProjectPaths & ConstantProjectPaths;
21
+ type LintIgnoredConfig = {
22
+ bpLintDisabled?: boolean;
23
+ };
24
+ export type ProjectType = ProjectDefinition['type'];
25
+ export type ProjectDefinition = LintIgnoredConfig & ({
26
+ type: 'integration';
27
+ definition: sdk.IntegrationDefinition;
28
+ } | {
29
+ type: 'interface';
30
+ definition: sdk.InterfaceDefinition;
31
+ } | {
32
+ type: 'bot';
33
+ definition: sdk.BotDefinition;
34
+ } | {
35
+ type: 'plugin';
36
+ definition: sdk.PluginDefinition;
37
+ });
38
+ type UpdatedBot = client.Bot;
39
+ declare class ProjectPaths extends utils.path.PathStore<keyof AllProjectPaths> {
40
+ constructor(argv: CommandArgv<ProjectCommandDefinition>);
41
+ }
42
+ export declare abstract class ProjectCommand<C extends ProjectCommandDefinition> extends GlobalCommand<C> {
43
+ protected bootstrap(): Promise<void>;
44
+ protected get projectPaths(): ProjectPaths;
45
+ protected get projectCache(): utils.cache.FSKeyValueCache<ProjectCache>;
46
+ protected readProjectDefinitionFromFS(): Promise<ProjectDefinition>;
47
+ private _readIntegrationDefinitionFromFS;
48
+ private _readInterfaceDefinitionFromFS;
49
+ private _readBotDefinitionFromFS;
50
+ private _readPluginDefinitionFromFS;
51
+ private _isBpLintDisabled;
52
+ protected displayWebhookUrls(bot: client.Bot): void;
53
+ protected promptSecrets(integrationDef: sdk.IntegrationDefinition, argv: YargsConfig<typeof config.schemas.secrets>, opts?: {
54
+ formatEnv?: boolean;
55
+ knownSecrets?: string[];
56
+ }): Promise<Record<string, string | null>>;
57
+ protected prepareCreateIntegrationBody(integrationDef: sdk.IntegrationDefinition): Promise<apiUtils.CreateIntegrationRequestBody>;
58
+ protected prepareBotDependencies(botDef: sdk.BotDefinition, api: apiUtils.ApiClient): Promise<Partial<apiUtils.UpdateBotRequestBody>>;
59
+ protected prepareIntegrationDependencies(integrationDef: sdk.IntegrationDefinition, api: apiUtils.ApiClient): Promise<Partial<apiUtils.CreateIntegrationRequestBody>>;
60
+ protected preparePluginDependencies(pluginDef: sdk.PluginDefinition, api: apiUtils.ApiClient): Promise<Partial<apiUtils.CreatePluginRequestBody>>;
61
+ private _fetchDependencies;
62
+ protected readProjectFile: (filePath: string | undefined, encoding?: BufferEncoding) => Promise<string | undefined>;
63
+ private _parseArgvSecrets;
64
+ private _notifyUpdateSdk;
65
+ protected validateIntegrationRegistration(updatedBot: UpdatedBot, onFailCallback: (failedIntegrations: UpdatedBot['integrations']) => void): void;
66
+ }
67
+ export {};
@@ -0,0 +1,10 @@
1
+ import commandDefinitions from '../command-definitions';
2
+ import { ProjectCommand } from './project-command';
3
+ export type ReadCommandDefinition = typeof commandDefinitions.read;
4
+ export declare class ReadCommand extends ProjectCommand<ReadCommandDefinition> {
5
+ run(): Promise<void>;
6
+ private _parseIntegration;
7
+ private _parseInterface;
8
+ private _parseBot;
9
+ private _parsePlugin;
10
+ }
@@ -0,0 +1,6 @@
1
+ import type commandDefinitions from '../command-definitions';
2
+ import { ProjectCommand } from './project-command';
3
+ export type ServeCommandDefinition = typeof commandDefinitions.serve;
4
+ export declare class ServeCommand extends ProjectCommand<ServeCommandDefinition> {
5
+ run(): Promise<void>;
6
+ }
@@ -0,0 +1,39 @@
1
+ import type * as typings from './typings';
2
+ export type DefinitionSubTree = {
3
+ description: string;
4
+ subcommands: DefinitionTree;
5
+ };
6
+ export type DefinitionTree = {
7
+ [key: string]: DefinitionTreeNode;
8
+ };
9
+ export type DefinitionTreeNode = typings.CommandDefinition | DefinitionSubTree;
10
+ export type ImplementationSubTree<D extends DefinitionSubTree = DefinitionSubTree> = {
11
+ subcommands: ImplementationTree<D['subcommands']>;
12
+ };
13
+ export type ImplementationTreeNode<N extends DefinitionTreeNode = DefinitionTreeNode> = N extends typings.CommandDefinition ? typings.CommandImplementation<N> : N extends DefinitionSubTree ? ImplementationSubTree<N> : never;
14
+ export type ImplementationTree<D extends DefinitionTree = DefinitionTree> = {
15
+ [K in keyof D]: ImplementationTreeNode<D[K]>;
16
+ };
17
+ export type CommandSubTree<D extends DefinitionSubTree = DefinitionSubTree> = {
18
+ description: string;
19
+ subcommands: CommandTree<D['subcommands']>;
20
+ };
21
+ export type CommandTreeNode<N extends DefinitionTreeNode = DefinitionTreeNode> = N extends typings.CommandDefinition ? typings.CommandLeaf<N> : N extends DefinitionSubTree ? CommandSubTree<N> : never;
22
+ export type CommandTree<D extends DefinitionTree = DefinitionTree> = {
23
+ [K in keyof D]: CommandTreeNode<D[K]>;
24
+ };
25
+ export declare const guards: {
26
+ definition: {
27
+ isDef: (x: DefinitionTreeNode) => x is typings.CommandDefinition;
28
+ isSubTree: (x: DefinitionTreeNode) => x is DefinitionSubTree;
29
+ };
30
+ implementation: {
31
+ isImpl: (x: ImplementationTreeNode) => x is typings.CommandImplementation;
32
+ isSubTree: (x: ImplementationTreeNode) => x is ImplementationSubTree;
33
+ };
34
+ command: {
35
+ isLeaf: (x: CommandTreeNode) => x is typings.CommandLeaf;
36
+ isSubTree: (x: CommandTreeNode) => x is CommandSubTree;
37
+ };
38
+ };
39
+ export declare const zipTree: <T extends DefinitionTree>(defTree: T, implTree: ImplementationTree<T>) => CommandTree<T>;