@kumori/kdsl 0.0.14 → 0.0.16
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/build/deployment_spec.d.ts +2586 -0
- package/dist/build/deployment_spec.js +293 -0
- package/dist/build/deployment_spec.js.map +1 -0
- package/dist/build/helpers/builtin.d.ts +17 -0
- package/dist/build/helpers/builtin.js +80 -0
- package/dist/build/helpers/builtin.js.map +1 -0
- package/dist/build/helpers/component.d.ts +17 -0
- package/dist/build/helpers/component.js +212 -0
- package/dist/build/helpers/component.js.map +1 -0
- package/dist/build/helpers/connector.d.ts +13 -0
- package/dist/build/helpers/connector.js +189 -0
- package/dist/build/helpers/connector.js.map +1 -0
- package/dist/build/helpers/deployment.d.ts +326 -0
- package/dist/build/helpers/deployment.js +85 -0
- package/dist/build/helpers/deployment.js.map +1 -0
- package/dist/build/helpers/resource.d.ts +97 -0
- package/dist/build/helpers/resource.js +54 -0
- package/dist/build/helpers/resource.js.map +1 -0
- package/dist/build/helpers/service.d.ts +27 -0
- package/dist/build/helpers/service.js +196 -0
- package/dist/build/helpers/service.js.map +1 -0
- package/dist/build/helpers/utils.d.ts +30 -0
- package/dist/build/helpers/utils.js +77 -0
- package/dist/build/helpers/utils.js.map +1 -0
- package/dist/build/main.d.ts +17 -0
- package/dist/build/main.js +188 -0
- package/dist/build/main.js.map +1 -0
- package/dist/build/solution.d.ts +20 -0
- package/dist/build/solution.js +71 -0
- package/dist/build/solution.js.map +1 -0
- package/dist/check/main.d.ts +21 -0
- package/dist/check/main.js +99 -0
- package/dist/check/main.js.map +1 -0
- package/dist/clean/main.d.ts +11 -0
- package/dist/clean/main.js +26 -0
- package/dist/clean/main.js.map +1 -0
- package/dist/deployment/gen/deployment-template.kumori +33 -0
- package/dist/deployment/gen/main.d.ts +15 -0
- package/dist/deployment/gen/main.js +158 -0
- package/dist/deployment/gen/main.js.map +1 -0
- package/dist/deployment/gen/types.d.ts +27 -0
- package/dist/deployment/gen/types.js +2 -0
- package/dist/deployment/gen/types.js.map +1 -0
- package/dist/deployment/main.d.ts +8 -0
- package/dist/deployment/main.js +17 -0
- package/dist/deployment/main.js.map +1 -0
- package/dist/help/main.d.ts +13 -0
- package/dist/help/main.js +49 -0
- package/dist/help/main.js.map +1 -0
- package/dist/help/topic/build.d.ts +2 -0
- package/dist/help/topic/build.js +7 -0
- package/dist/help/topic/build.js.map +1 -0
- package/dist/help/topic/mod_dep.d.ts +2 -0
- package/dist/help/topic/mod_dep.js +8 -0
- package/dist/help/topic/mod_dep.js.map +1 -0
- package/dist/help/topic/mod_dl.d.ts +2 -0
- package/dist/help/topic/mod_dl.js +25 -0
- package/dist/help/topic/mod_dl.js.map +1 -0
- package/dist/index/create/main.d.ts +14 -0
- package/dist/index/create/main.js +286 -0
- package/dist/index/create/main.js.map +1 -0
- package/dist/index/main.d.ts +8 -0
- package/dist/index/main.js +17 -0
- package/dist/index/main.js.map +1 -0
- package/dist/lib/build.d.ts +42 -0
- package/dist/lib/build.js +42 -0
- package/dist/lib/build.js.map +1 -0
- package/dist/lib/check.d.ts +41 -0
- package/dist/lib/check.js +45 -0
- package/dist/lib/check.js.map +1 -0
- package/dist/lib/clean.d.ts +31 -0
- package/dist/lib/clean.js +39 -0
- package/dist/lib/clean.js.map +1 -0
- package/dist/lib/deployment.d.ts +35 -0
- package/dist/lib/deployment.js +31 -0
- package/dist/lib/deployment.js.map +1 -0
- package/dist/lib/index-cmd.d.ts +54 -0
- package/dist/lib/index-cmd.js +60 -0
- package/dist/lib/index-cmd.js.map +1 -0
- package/dist/lib/index.d.ts +58 -0
- package/dist/lib/index.js +54 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/io/lib.kumori +5 -0
- package/dist/lib/kumori/builtin/httpinbound.h.kumori +27 -0
- package/dist/lib/kumori/builtin/tcpinbound.h.kumori +25 -0
- package/dist/lib/kumori/builtin.kumori +18 -0
- package/dist/lib/kumori/component.kumori +120 -0
- package/dist/lib/kumori/deployment.kumori +16 -0
- package/dist/lib/kumori/resource.kumori +25 -0
- package/dist/lib/kumori/service.kumori +49 -0
- package/dist/lib/kumori/shared.kumori +11 -0
- package/dist/lib/kumori/sized.kumori +25 -0
- package/dist/lib/logger.d.ts +10 -0
- package/dist/lib/logger.js +23 -0
- package/dist/lib/logger.js.map +1 -0
- package/dist/lib/mod.d.ts +156 -0
- package/dist/lib/mod.js +144 -0
- package/dist/lib/mod.js.map +1 -0
- package/dist/lib/registry.d.ts +61 -0
- package/dist/lib/registry.js +67 -0
- package/dist/lib/registry.js.map +1 -0
- package/dist/lib/sized.kumori +8 -0
- package/dist/lib/std.kumori +8 -0
- package/dist/lib/strconv/lib.kumori +11 -0
- package/dist/lib/types.d.ts +26 -0
- package/dist/lib/types.js +2 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +37 -0
- package/dist/main.js.map +1 -0
- package/dist/mod/checksum/main.d.ts +11 -0
- package/dist/mod/checksum/main.js +33 -0
- package/dist/mod/checksum/main.js.map +1 -0
- package/dist/mod/dependency/main.d.ts +19 -0
- package/dist/mod/dependency/main.js +163 -0
- package/dist/mod/dependency/main.js.map +1 -0
- package/dist/mod/download/functions.d.ts +53 -0
- package/dist/mod/download/functions.js +235 -0
- package/dist/mod/download/functions.js.map +1 -0
- package/dist/mod/download/main.d.ts +26 -0
- package/dist/mod/download/main.js +99 -0
- package/dist/mod/download/main.js.map +1 -0
- package/dist/mod/init/main.d.ts +13 -0
- package/dist/mod/init/main.js +66 -0
- package/dist/mod/init/main.js.map +1 -0
- package/dist/mod/jsonschema/gen/main.d.ts +11 -0
- package/dist/mod/jsonschema/gen/main.js +288 -0
- package/dist/mod/jsonschema/gen/main.js.map +1 -0
- package/dist/mod/jsonschema/get/kdslschema.d.ts +28 -0
- package/dist/mod/jsonschema/get/kdslschema.js +3 -0
- package/dist/mod/jsonschema/get/kdslschema.js.map +1 -0
- package/dist/mod/jsonschema/get/main.d.ts +76 -0
- package/dist/mod/jsonschema/get/main.js +346 -0
- package/dist/mod/jsonschema/get/main.js.map +1 -0
- package/dist/mod/jsonschema/main.d.ts +8 -0
- package/dist/mod/jsonschema/main.js +20 -0
- package/dist/mod/jsonschema/main.js.map +1 -0
- package/dist/mod/main.d.ts +8 -0
- package/dist/mod/main.js +27 -0
- package/dist/mod/main.js.map +1 -0
- package/dist/mod/update/main.d.ts +17 -0
- package/dist/mod/update/main.js +68 -0
- package/dist/mod/update/main.js.map +1 -0
- package/dist/registry/add.d.ts +15 -0
- package/dist/registry/add.js +58 -0
- package/dist/registry/add.js.map +1 -0
- package/dist/registry/list.d.ts +15 -0
- package/dist/registry/list.js +29 -0
- package/dist/registry/list.js.map +1 -0
- package/dist/registry/main.d.ts +8 -0
- package/dist/registry/main.js +21 -0
- package/dist/registry/main.js.map +1 -0
- package/dist/registry/remove.d.ts +15 -0
- package/dist/registry/remove.js +34 -0
- package/dist/registry/remove.js.map +1 -0
- package/dist/util/err-format.d.ts +2 -0
- package/dist/util/err-format.js +10 -0
- package/dist/util/err-format.js.map +1 -0
- package/dist/util/err-handler.d.ts +3 -0
- package/dist/util/err-handler.js +11 -0
- package/dist/util/err-handler.js.map +1 -0
- package/dist/util.d.ts +2 -0
- package/dist/util.js +2 -0
- package/dist/util.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +5 -0
- package/dist/version.js.map +1 -0
- package/out/deployment/gen/deployment-template.kumori +33 -0
- package/out/deployment-template.kumori +33 -0
- package/out/main.cjs +378 -209
- package/package.json +67 -17
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment.js","sourceRoot":"","sources":["../../src/lib/deployment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAgBzD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAA6B;IAE7B,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IACrC,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,IAAI,wBAAwB,CAAA;IAC3D,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,IAAI,GAAG,CAAA;IACtD,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAA;IAE7B,OAAO,MAAM,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,CAAC,CAAA;AAC7D,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { LibraryOptions, LibraryResult } from "./types.js";
|
|
2
|
+
export interface IndexCreateOptions extends LibraryOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Path to the module to generate the index entry for.
|
|
5
|
+
* Can be either a relative or absolute path.
|
|
6
|
+
* Defaults to current directory.
|
|
7
|
+
*/
|
|
8
|
+
module?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Path to the index file to append the new entry to.
|
|
11
|
+
* Can be either a relative or absolute path.
|
|
12
|
+
* If not provided, the entry will be returned instead of written.
|
|
13
|
+
*/
|
|
14
|
+
indexFile?: string;
|
|
15
|
+
/**
|
|
16
|
+
* If true and parameters are missing, prompt interactively using @inquirer/prompts.
|
|
17
|
+
* If false and parameters are missing, return error.
|
|
18
|
+
* Defaults to false (non-interactive).
|
|
19
|
+
*
|
|
20
|
+
* NOTE: Interactive mode requires a TTY environment.
|
|
21
|
+
*/
|
|
22
|
+
interactive?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Create an index file entry for a Kumori module.
|
|
26
|
+
*
|
|
27
|
+
* This command generates a new index file entry for the current module or a specified
|
|
28
|
+
* module. The entry includes module metadata, artifacts, and JSON schemas.
|
|
29
|
+
*
|
|
30
|
+
* In non-interactive mode, you can provide all necessary parameters via options.
|
|
31
|
+
* In interactive mode (interactive: true), missing parameters will be prompted.
|
|
32
|
+
*
|
|
33
|
+
* @param options - Index create options
|
|
34
|
+
* @returns Result with index entry object on success, or string[] of errors
|
|
35
|
+
*
|
|
36
|
+
* @example Non-interactive usage (programmatic)
|
|
37
|
+
* ```typescript
|
|
38
|
+
* const result = await indexCreate({
|
|
39
|
+
* services,
|
|
40
|
+
* module: './my-module',
|
|
41
|
+
* indexFile: './index.json',
|
|
42
|
+
* interactive: false
|
|
43
|
+
* })
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @example Interactive usage (CLI-like)
|
|
47
|
+
* ```typescript
|
|
48
|
+
* const result = await indexCreate({
|
|
49
|
+
* services,
|
|
50
|
+
* interactive: true // Will prompt for missing info
|
|
51
|
+
* })
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare function indexCreate(options: IndexCreateOptions): Promise<LibraryResult<void>>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { getLogger } from "./logger.js";
|
|
2
|
+
import { Ok, Err } from "@kumori/kdsl-lsp/util/result.js";
|
|
3
|
+
/**
|
|
4
|
+
* Create an index file entry for a Kumori module.
|
|
5
|
+
*
|
|
6
|
+
* This command generates a new index file entry for the current module or a specified
|
|
7
|
+
* module. The entry includes module metadata, artifacts, and JSON schemas.
|
|
8
|
+
*
|
|
9
|
+
* In non-interactive mode, you can provide all necessary parameters via options.
|
|
10
|
+
* In interactive mode (interactive: true), missing parameters will be prompted.
|
|
11
|
+
*
|
|
12
|
+
* @param options - Index create options
|
|
13
|
+
* @returns Result with index entry object on success, or string[] of errors
|
|
14
|
+
*
|
|
15
|
+
* @example Non-interactive usage (programmatic)
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const result = await indexCreate({
|
|
18
|
+
* services,
|
|
19
|
+
* module: './my-module',
|
|
20
|
+
* indexFile: './index.json',
|
|
21
|
+
* interactive: false
|
|
22
|
+
* })
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @example Interactive usage (CLI-like)
|
|
26
|
+
* ```typescript
|
|
27
|
+
* const result = await indexCreate({
|
|
28
|
+
* services,
|
|
29
|
+
* interactive: true // Will prompt for missing info
|
|
30
|
+
* })
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export async function indexCreate(options) {
|
|
34
|
+
const log = getLogger(options.logger);
|
|
35
|
+
// For now, we'll use the existing implementation from the CLI
|
|
36
|
+
// This command is heavily interactive, so we'll delegate to the CLI action
|
|
37
|
+
if (!options.interactive) {
|
|
38
|
+
return Err([
|
|
39
|
+
"Index create command requires interactive mode. " +
|
|
40
|
+
"Set interactive: true to use this command programmatically with prompts, " +
|
|
41
|
+
"or use the CLI directly: kdsl index create",
|
|
42
|
+
]);
|
|
43
|
+
}
|
|
44
|
+
// Import the action and run it
|
|
45
|
+
try {
|
|
46
|
+
const { Action } = await import("../index/create/main.js");
|
|
47
|
+
const action = Action(log);
|
|
48
|
+
// The Action function takes (options, command) but we cast to bypass type checking
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
50
|
+
await action({
|
|
51
|
+
module: options.module ?? undefined,
|
|
52
|
+
index: options.indexFile ?? undefined,
|
|
53
|
+
});
|
|
54
|
+
return Ok(undefined);
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
return Err([String(err)]);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=index-cmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-cmd.js","sourceRoot":"","sources":["../../src/lib/index-cmd.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAA;AA2BzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,OAA2B;IAE3B,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAErC,8DAA8D;IAC9D,2EAA2E;IAC3E,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QACzB,OAAO,GAAG,CAAC;YACT,kDAAkD;gBAChD,2EAA2E;gBAC3E,4CAA4C;SAC/C,CAAC,CAAA;IACJ,CAAC;IAED,+BAA+B;IAC/B,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAA;QAC1D,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;QAE1B,mFAAmF;QACnF,8DAA8D;QAC9D,MAAO,MAAc,CAAC;YACpB,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,SAAS;YACnC,KAAK,EAAE,OAAO,CAAC,SAAS,IAAI,SAAS;SACtC,CAAC,CAAA;QAEF,OAAO,EAAE,CAAO,SAAS,CAAC,CAAA;IAC5B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IAC3B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @kumori/kdsl - Kumori DSL Library
|
|
3
|
+
*
|
|
4
|
+
* Programmatic access to Kumori DSL commands.
|
|
5
|
+
* For CLI usage, use the `kdsl` command instead.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { createKumoriServices } from '@kumori/kdsl-lsp/language/kumori.js'
|
|
10
|
+
* import { NodeFileSystem } from 'langium/node'
|
|
11
|
+
* import { build, check, moduleInit } from '@kumori/kdsl'
|
|
12
|
+
*
|
|
13
|
+
* const services = createKumoriServices(NodeFileSystem).Kumori
|
|
14
|
+
*
|
|
15
|
+
* // Build a package
|
|
16
|
+
* const buildResult = await build({
|
|
17
|
+
* services,
|
|
18
|
+
* package: 'my-package',
|
|
19
|
+
* directory: '.'
|
|
20
|
+
* })
|
|
21
|
+
*
|
|
22
|
+
* if (buildResult.ok) {
|
|
23
|
+
* console.log('Build succeeded!')
|
|
24
|
+
* } else {
|
|
25
|
+
* console.error('Build failed:', buildResult.err)
|
|
26
|
+
* }
|
|
27
|
+
*
|
|
28
|
+
* // Check a module
|
|
29
|
+
* const checkResult = await check({
|
|
30
|
+
* services,
|
|
31
|
+
* directory: './my-module'
|
|
32
|
+
* })
|
|
33
|
+
*
|
|
34
|
+
* // Initialize a new module
|
|
35
|
+
* const initResult = await moduleInit({
|
|
36
|
+
* name: 'kumori.systems/my-module',
|
|
37
|
+
* version: '1.0.0'
|
|
38
|
+
* })
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export { build } from "./build.js";
|
|
42
|
+
export type { BuildOptions } from "./build.js";
|
|
43
|
+
export { generateDeployment } from "./deployment.js";
|
|
44
|
+
export type { DeploymentGenOptions } from "./deployment.js";
|
|
45
|
+
export { check } from "./check.js";
|
|
46
|
+
export type { CheckOptions } from "./check.js";
|
|
47
|
+
export { clean } from "./clean.js";
|
|
48
|
+
export type { CleanOptions } from "./clean.js";
|
|
49
|
+
export { createKumoriServices } from "@kumori/kdsl-lsp/language/kumori.js";
|
|
50
|
+
export type {} from "@kumori/kdsl-lsp/language/kumori.js";
|
|
51
|
+
export { moduleInit, moduleDependency, moduleDownload, moduleUpdate, moduleChecksum, moduleSchemaGet, } from "./mod.js";
|
|
52
|
+
export type { ModuleInitOptions, ModuleDependencyOptions, ModuleDownloadOptions, ModuleUpdateOptions, ModuleChecksumOptions, ModuleSchemaGetOptions, } from "./mod.js";
|
|
53
|
+
export { registryAdd, registryList, registryRemove } from "./registry.js";
|
|
54
|
+
export type { RegistryAddOptions, RegistryListOptions, RegistryRemoveOptions, } from "./registry.js";
|
|
55
|
+
export { indexCreate } from "./index-cmd.js";
|
|
56
|
+
export type { IndexCreateOptions } from "./index-cmd.js";
|
|
57
|
+
export type { LibraryOptions, LibraryResult } from "./types.js";
|
|
58
|
+
export { createSilentLogger, getLogger } from "./logger.js";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @kumori/kdsl - Kumori DSL Library
|
|
3
|
+
*
|
|
4
|
+
* Programmatic access to Kumori DSL commands.
|
|
5
|
+
* For CLI usage, use the `kdsl` command instead.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { createKumoriServices } from '@kumori/kdsl-lsp/language/kumori.js'
|
|
10
|
+
* import { NodeFileSystem } from 'langium/node'
|
|
11
|
+
* import { build, check, moduleInit } from '@kumori/kdsl'
|
|
12
|
+
*
|
|
13
|
+
* const services = createKumoriServices(NodeFileSystem).Kumori
|
|
14
|
+
*
|
|
15
|
+
* // Build a package
|
|
16
|
+
* const buildResult = await build({
|
|
17
|
+
* services,
|
|
18
|
+
* package: 'my-package',
|
|
19
|
+
* directory: '.'
|
|
20
|
+
* })
|
|
21
|
+
*
|
|
22
|
+
* if (buildResult.ok) {
|
|
23
|
+
* console.log('Build succeeded!')
|
|
24
|
+
* } else {
|
|
25
|
+
* console.error('Build failed:', buildResult.err)
|
|
26
|
+
* }
|
|
27
|
+
*
|
|
28
|
+
* // Check a module
|
|
29
|
+
* const checkResult = await check({
|
|
30
|
+
* services,
|
|
31
|
+
* directory: './my-module'
|
|
32
|
+
* })
|
|
33
|
+
*
|
|
34
|
+
* // Initialize a new module
|
|
35
|
+
* const initResult = await moduleInit({
|
|
36
|
+
* name: 'kumori.systems/my-module',
|
|
37
|
+
* version: '1.0.0'
|
|
38
|
+
* })
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
// Core command exports
|
|
42
|
+
export { build } from "./build.js";
|
|
43
|
+
export { generateDeployment } from "./deployment.js";
|
|
44
|
+
export { check } from "./check.js";
|
|
45
|
+
export { clean } from "./clean.js";
|
|
46
|
+
export { createKumoriServices } from "@kumori/kdsl-lsp/language/kumori.js";
|
|
47
|
+
// Module command exports
|
|
48
|
+
export { moduleInit, moduleDependency, moduleDownload, moduleUpdate, moduleChecksum, moduleSchemaGet, } from "./mod.js";
|
|
49
|
+
// Registry command exports
|
|
50
|
+
export { registryAdd, registryList, registryRemove } from "./registry.js";
|
|
51
|
+
// Index command exports
|
|
52
|
+
export { indexCreate } from "./index-cmd.js";
|
|
53
|
+
export { createSilentLogger, getLogger } from "./logger.js";
|
|
54
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,uBAAuB;AACvB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEpD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAG1E,yBAAyB;AACzB,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,cAAc,EACd,eAAe,GAChB,MAAM,UAAU,CAAA;AAUjB,2BAA2B;AAC3B,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAOzE,wBAAwB;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAK5C,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
package builtin
|
|
2
|
+
|
|
3
|
+
import "kumori"
|
|
4
|
+
|
|
5
|
+
builtin HTTPInbound {
|
|
6
|
+
id {
|
|
7
|
+
name "inbound"
|
|
8
|
+
kind "service"
|
|
9
|
+
domain "kumori.systems"
|
|
10
|
+
module "builtins/inbound"
|
|
11
|
+
version "1.3.0"
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
srv {
|
|
15
|
+
client { inbound "http" }
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
config {
|
|
19
|
+
type "https"
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
resource {
|
|
23
|
+
servercert: kumori.Certificate
|
|
24
|
+
serverdomain: kumori.Domain
|
|
25
|
+
clientcertca?: kumori.CA
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
package builtin
|
|
2
|
+
|
|
3
|
+
import "kumori"
|
|
4
|
+
|
|
5
|
+
builtin TCPInbound {
|
|
6
|
+
id {
|
|
7
|
+
name "inbound"
|
|
8
|
+
kind "service"
|
|
9
|
+
domain "kumori.systems"
|
|
10
|
+
module "builtins/inbound"
|
|
11
|
+
version "1.3.0"
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
srv {
|
|
15
|
+
client { inbound "tcp" }
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
config {
|
|
19
|
+
type "tcp"
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
resource {
|
|
23
|
+
port: kumori.Port
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
package kumori
|
|
2
|
+
|
|
3
|
+
library
|
|
4
|
+
|
|
5
|
+
alias builtin struct {
|
|
6
|
+
id Ref
|
|
7
|
+
srv Links
|
|
8
|
+
config struct open[]
|
|
9
|
+
resource struct open[Resource]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
alias Ref struct {
|
|
13
|
+
name string
|
|
14
|
+
kind "service" | "component"
|
|
15
|
+
domain string
|
|
16
|
+
module string
|
|
17
|
+
version string
|
|
18
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
package kumori
|
|
2
|
+
|
|
3
|
+
library
|
|
4
|
+
|
|
5
|
+
alias ComponentInterface struct {
|
|
6
|
+
srv? Links
|
|
7
|
+
config? struct open[]
|
|
8
|
+
resource? struct open[Resource]
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
alias component struct {
|
|
12
|
+
srv? Links
|
|
13
|
+
config? struct open[]
|
|
14
|
+
resource? struct open[Resource]
|
|
15
|
+
|
|
16
|
+
code? struct open[Code]
|
|
17
|
+
init? []struct {
|
|
18
|
+
cmd? []string
|
|
19
|
+
image Image
|
|
20
|
+
entrypoint? []string
|
|
21
|
+
|
|
22
|
+
size struct {
|
|
23
|
+
memory RAMSized
|
|
24
|
+
cpu CPUSized
|
|
25
|
+
mincpu? CPUSized
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
env? struct open[Env]
|
|
29
|
+
fs? struct open[File]
|
|
30
|
+
}
|
|
31
|
+
size struct {
|
|
32
|
+
bandwidth BandwidthSized
|
|
33
|
+
minbandwidth? BandwidthSized
|
|
34
|
+
mincpu CPUSized
|
|
35
|
+
}
|
|
36
|
+
probe? struct open[Probes]
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
alias Code struct {
|
|
40
|
+
cmd? []string
|
|
41
|
+
image Image
|
|
42
|
+
entrypoint? []string
|
|
43
|
+
|
|
44
|
+
size struct {
|
|
45
|
+
memory RAMSized
|
|
46
|
+
cpu CPUSized
|
|
47
|
+
mincpu? CPUSized
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
env? struct open[Env]
|
|
51
|
+
fs? struct open[File]
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
alias Image string | struct { hub: struct { name: string, secret?: string }, tag: string }
|
|
55
|
+
|
|
56
|
+
alias File string | FSMap | struct { volume: string }
|
|
57
|
+
alias FSMap FSData | FSSecret | FSPort | FSDomain | FSCertificate | FSCa
|
|
58
|
+
|
|
59
|
+
alias AllowedFormat "text" | "json" | "yaml" | "flatdict"
|
|
60
|
+
|
|
61
|
+
alias FSData struct { data: string, mode?: number, format?: AllowedFormat }
|
|
62
|
+
alias FSSecret struct { secret: string, mode?: number, format?: AllowedFormat }
|
|
63
|
+
alias FSPort struct { port: string, mode?: number, format?: AllowedFormat }
|
|
64
|
+
alias FSDomain struct { domain: string, mode?: number, format?: AllowedFormat }
|
|
65
|
+
alias FSCertificate struct { certificate: string, mode?: number, format?: AllowedFormat }
|
|
66
|
+
alias FSCa struct { ca: string, mode?: number, format?: AllowedFormat }
|
|
67
|
+
|
|
68
|
+
alias Env string | bool | number | struct { secret: string }
|
|
69
|
+
|
|
70
|
+
alias Probes struct {
|
|
71
|
+
liveness? LivenessProbeAttributes
|
|
72
|
+
readiness? ReadinessProbeAttributes
|
|
73
|
+
pmetrics? PrometheusMetricsProbeAttributes
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
alias LivenessProbeAttributes struct {
|
|
77
|
+
protocol ProbeProtocol
|
|
78
|
+
startupGraceWindow? StartupGraceWindow
|
|
79
|
+
frequency? any
|
|
80
|
+
timeout? number
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
alias ReadinessProbeAttributes struct {
|
|
84
|
+
protocol ProbeProtocol
|
|
85
|
+
frequency? any
|
|
86
|
+
timeout? number
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
alias PrometheusMetricsProbeAttributes struct {
|
|
90
|
+
protocol HTTPOnlyProbeProtocol
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
alias ProbeProtocol struct {
|
|
94
|
+
http? HTTPProbeProtocol
|
|
95
|
+
tcp? TCPProbeProtocol
|
|
96
|
+
exec? ExecProbeProtocol
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
alias HTTPOnlyProbeProtocol struct {
|
|
100
|
+
http HTTPProbeProtocol
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
alias HTTPProbeProtocol struct {
|
|
104
|
+
port number
|
|
105
|
+
path string
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
alias TCPProbeProtocol struct {
|
|
109
|
+
port number
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
alias ExecProbeProtocol struct {
|
|
113
|
+
path string
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
alias StartupGraceWindow struct {
|
|
117
|
+
unit "ms" | "attempt"
|
|
118
|
+
duration number
|
|
119
|
+
probe bool
|
|
120
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
package kumori
|
|
2
|
+
|
|
3
|
+
library
|
|
4
|
+
|
|
5
|
+
alias deployment struct {
|
|
6
|
+
name string
|
|
7
|
+
artifact any
|
|
8
|
+
resilience? number
|
|
9
|
+
|
|
10
|
+
scale? ScaleSpec
|
|
11
|
+
config? struct open[]
|
|
12
|
+
resource? struct open[Resource]
|
|
13
|
+
meta? struct open[]
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
alias ScaleSpec struct open[] | number
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
package kumori
|
|
2
|
+
|
|
3
|
+
library
|
|
4
|
+
|
|
5
|
+
alias Resource Volume | CA | Certificate | Secret | Domain | Port
|
|
6
|
+
|
|
7
|
+
type CA string
|
|
8
|
+
type Certificate string
|
|
9
|
+
type Secret string
|
|
10
|
+
type Domain string
|
|
11
|
+
type Port string
|
|
12
|
+
|
|
13
|
+
alias Volume Registered | InlineVolume | DeprecatedVolume
|
|
14
|
+
alias InlineVolume NonReplicated | Persisted | Volatile
|
|
15
|
+
|
|
16
|
+
type Registered string
|
|
17
|
+
type NonReplicated StorageSized
|
|
18
|
+
type Persisted StorageSized
|
|
19
|
+
type Volatile StorageSized
|
|
20
|
+
|
|
21
|
+
// NOTE: These are here to retain backwards compatibility.
|
|
22
|
+
// **Do not use.** Will be removed in the future.
|
|
23
|
+
alias DeprecatedVolume Ephemeral | Persistent
|
|
24
|
+
type Ephemeral StorageSized
|
|
25
|
+
type Persistent string
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
package kumori
|
|
2
|
+
|
|
3
|
+
library
|
|
4
|
+
|
|
5
|
+
alias ServiceInterface struct {
|
|
6
|
+
srv? Links
|
|
7
|
+
config? struct open[]
|
|
8
|
+
resource? struct open[Resource]
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
alias service struct {
|
|
12
|
+
srv? Links
|
|
13
|
+
config? struct open[]
|
|
14
|
+
resource? struct open[Resource]
|
|
15
|
+
|
|
16
|
+
role? struct open[Role]
|
|
17
|
+
connect? struct open[Connection]
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
alias Role struct {
|
|
21
|
+
artifact any // TODO: service, component or builtin
|
|
22
|
+
config? struct open[]
|
|
23
|
+
resource? struct open[Resource]
|
|
24
|
+
meta? struct open[]
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
alias Connection LoadBalancer | FullConnector
|
|
28
|
+
|
|
29
|
+
type LoadBalancer struct {
|
|
30
|
+
from struct { target string, channel string } | []struct { target string, channel string }
|
|
31
|
+
to struct { target string, channel string } | []struct { target string, channel string }
|
|
32
|
+
|
|
33
|
+
meta? any
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
type FullConnector ReducedFullConnector | CompleteFullConnector
|
|
37
|
+
|
|
38
|
+
alias ReducedFullConnector struct {
|
|
39
|
+
target string
|
|
40
|
+
channel string
|
|
41
|
+
meta? any
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
alias CompleteFullConnector struct {
|
|
45
|
+
from struct { target string, channel string } | []struct { target string, channel string }
|
|
46
|
+
to struct { target string, channel string } | []struct { target string, channel string }
|
|
47
|
+
|
|
48
|
+
meta? any
|
|
49
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
library
|
|
2
|
+
|
|
3
|
+
alias Links struct {
|
|
4
|
+
client? struct open[Client]
|
|
5
|
+
server? struct open[Server]
|
|
6
|
+
duplex? struct open[Server]
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
alias Channel "udp" | "tcp" | "http" | "grpc"
|
|
10
|
+
alias Client Channel
|
|
11
|
+
alias Server Channel | struct { protocol Channel, port number }
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
library
|
|
2
|
+
|
|
3
|
+
alias StorageUnit "k" | "M" | "G" | "T" | "P" | "E" | "Ki" | "Mi" | "Gi" | "Ti" | "Pi" | "Ei"
|
|
4
|
+
alias StorageSized struct {
|
|
5
|
+
size number
|
|
6
|
+
unit StorageUnit
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
alias CPUUnit "m"
|
|
10
|
+
alias CPUSized struct {
|
|
11
|
+
size number
|
|
12
|
+
unit CPUUnit
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
alias RAMUnit "G" | "M" | "Gi" | "Mi"
|
|
16
|
+
alias RAMSized struct {
|
|
17
|
+
size number
|
|
18
|
+
unit RAMUnit
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
alias BandwidthUnit "G" | "M" | "Gi" | "Mi"
|
|
22
|
+
alias BandwidthSized struct {
|
|
23
|
+
size number
|
|
24
|
+
unit BandwidthUnit
|
|
25
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ILogLayer } from "loglayer";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a silent logger that discards all output.
|
|
4
|
+
* Used as default when no logger is provided to library functions.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createSilentLogger(): ILogLayer;
|
|
7
|
+
/**
|
|
8
|
+
* Gets a logger from options or returns silent logger.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getLogger(logger?: ILogLayer): ILogLayer;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { LogLayer } from "loglayer";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a silent logger that discards all output.
|
|
4
|
+
* Used as default when no logger is provided to library functions.
|
|
5
|
+
*/
|
|
6
|
+
export function createSilentLogger() {
|
|
7
|
+
// Create a silent logger using a no-op transport
|
|
8
|
+
const noopTransport = {
|
|
9
|
+
debug: () => { },
|
|
10
|
+
info: () => { },
|
|
11
|
+
warn: () => { },
|
|
12
|
+
error: () => { },
|
|
13
|
+
};
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
|
+
return new LogLayer({ transport: noopTransport });
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Gets a logger from options or returns silent logger.
|
|
19
|
+
*/
|
|
20
|
+
export function getLogger(logger) {
|
|
21
|
+
return logger ?? createSilentLogger();
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/lib/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,QAAQ,EAAE,MAAM,UAAU,CAAA;AAE9C;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,iDAAiD;IACjD,MAAM,aAAa,GAAG;QACpB,KAAK,EAAE,GAAG,EAAE,GAAE,CAAC;QACf,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC;QACd,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC;QACd,KAAK,EAAE,GAAG,EAAE,GAAE,CAAC;KAChB,CAAA;IAED,8DAA8D;IAC9D,OAAO,IAAI,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAoB,EAAE,CAAC,CAAA;AAC1D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,MAAkB;IAC1C,OAAO,MAAM,IAAI,kBAAkB,EAAE,CAAA;AACvC,CAAC"}
|