@kinotic-ai/kinotic-cli 1.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.
Files changed (82) hide show
  1. package/README.md +594 -0
  2. package/bin/dev.cmd +3 -0
  3. package/bin/dev.js +6 -0
  4. package/bin/run.cmd +3 -0
  5. package/bin/run.js +6 -0
  6. package/dist/commands/generate.d.ts +11 -0
  7. package/dist/commands/generate.js +36 -0
  8. package/dist/commands/initialize.d.ts +12 -0
  9. package/dist/commands/initialize.js +102 -0
  10. package/dist/commands/synchronize.d.ts +17 -0
  11. package/dist/commands/synchronize.js +154 -0
  12. package/dist/index.d.ts +1 -0
  13. package/dist/index.js +1 -0
  14. package/dist/internal/CodeGenerationService.d.ts +24 -0
  15. package/dist/internal/CodeGenerationService.js +256 -0
  16. package/dist/internal/Logger.d.ts +27 -0
  17. package/dist/internal/Logger.js +35 -0
  18. package/dist/internal/ProjectMigrationService.d.ts +28 -0
  19. package/dist/internal/ProjectMigrationService.js +99 -0
  20. package/dist/internal/Utils.d.ts +66 -0
  21. package/dist/internal/Utils.js +349 -0
  22. package/dist/internal/converter/ConverterConstants.d.ts +3 -0
  23. package/dist/internal/converter/ConverterConstants.js +4 -0
  24. package/dist/internal/converter/DefaultConversionContext.d.ts +29 -0
  25. package/dist/internal/converter/DefaultConversionContext.js +112 -0
  26. package/dist/internal/converter/IConversionContext.d.ts +64 -0
  27. package/dist/internal/converter/IConversionContext.js +11 -0
  28. package/dist/internal/converter/IConverterStrategy.d.ts +35 -0
  29. package/dist/internal/converter/IConverterStrategy.js +1 -0
  30. package/dist/internal/converter/ITypeConverter.d.ts +28 -0
  31. package/dist/internal/converter/ITypeConverter.js +1 -0
  32. package/dist/internal/converter/SpecificTypesConverter.d.ts +12 -0
  33. package/dist/internal/converter/SpecificTypesConverter.js +24 -0
  34. package/dist/internal/converter/codegen/ArrayC3TypeToStatementMapper.d.ts +9 -0
  35. package/dist/internal/converter/codegen/ArrayC3TypeToStatementMapper.js +46 -0
  36. package/dist/internal/converter/codegen/ObjectC3TypeToStatementMapper.d.ts +13 -0
  37. package/dist/internal/converter/codegen/ObjectC3TypeToStatementMapper.js +67 -0
  38. package/dist/internal/converter/codegen/PrimitiveC3TypeToStatementMapper.d.ts +9 -0
  39. package/dist/internal/converter/codegen/PrimitiveC3TypeToStatementMapper.js +24 -0
  40. package/dist/internal/converter/codegen/StatementMapper.d.ts +40 -0
  41. package/dist/internal/converter/codegen/StatementMapper.js +132 -0
  42. package/dist/internal/converter/codegen/StatementMapperConversionState.d.ts +9 -0
  43. package/dist/internal/converter/codegen/StatementMapperConversionState.js +17 -0
  44. package/dist/internal/converter/codegen/StatementMapperConverterStrategy.d.ts +16 -0
  45. package/dist/internal/converter/codegen/StatementMapperConverterStrategy.js +30 -0
  46. package/dist/internal/converter/codegen/UnionC3TypeToStatementMapper.d.ts +9 -0
  47. package/dist/internal/converter/codegen/UnionC3TypeToStatementMapper.js +46 -0
  48. package/dist/internal/converter/common/BaseConversionState.d.ts +9 -0
  49. package/dist/internal/converter/common/BaseConversionState.js +13 -0
  50. package/dist/internal/converter/typescript/ArrayToC3Type.d.ts +9 -0
  51. package/dist/internal/converter/typescript/ArrayToC3Type.js +17 -0
  52. package/dist/internal/converter/typescript/ConverterUtils.d.ts +4 -0
  53. package/dist/internal/converter/typescript/ConverterUtils.js +261 -0
  54. package/dist/internal/converter/typescript/EnumToC3Type.d.ts +12 -0
  55. package/dist/internal/converter/typescript/EnumToC3Type.js +26 -0
  56. package/dist/internal/converter/typescript/ObjectLikeToC3Type.d.ts +15 -0
  57. package/dist/internal/converter/typescript/ObjectLikeToC3Type.js +111 -0
  58. package/dist/internal/converter/typescript/PrimitiveToC3Type.d.ts +10 -0
  59. package/dist/internal/converter/typescript/PrimitiveToC3Type.js +33 -0
  60. package/dist/internal/converter/typescript/QueryOptionsToC3Type.d.ts +9 -0
  61. package/dist/internal/converter/typescript/QueryOptionsToC3Type.js +9 -0
  62. package/dist/internal/converter/typescript/TenantSelectionToC3Type.d.ts +9 -0
  63. package/dist/internal/converter/typescript/TenantSelectionToC3Type.js +9 -0
  64. package/dist/internal/converter/typescript/TypescriptConversionState.d.ts +24 -0
  65. package/dist/internal/converter/typescript/TypescriptConversionState.js +26 -0
  66. package/dist/internal/converter/typescript/TypescriptConverterStrategy.d.ts +16 -0
  67. package/dist/internal/converter/typescript/TypescriptConverterStrategy.js +44 -0
  68. package/dist/internal/converter/typescript/UnionToC3Type.d.ts +15 -0
  69. package/dist/internal/converter/typescript/UnionToC3Type.js +184 -0
  70. package/dist/internal/state/Environment.d.ts +13 -0
  71. package/dist/internal/state/Environment.js +65 -0
  72. package/dist/internal/state/IStateManager.d.ts +19 -0
  73. package/dist/internal/state/IStateManager.js +41 -0
  74. package/dist/internal/state/KinoticProjectConfigUtil.d.ts +9 -0
  75. package/dist/internal/state/KinoticProjectConfigUtil.js +153 -0
  76. package/dist/templates/AdminEntityService.liquid +14 -0
  77. package/dist/templates/BaseAdminEntityService.liquid +19 -0
  78. package/dist/templates/BaseEntityService.liquid +48 -0
  79. package/dist/templates/EntityService.liquid +14 -0
  80. package/dist/templates/KinoticProjectConfig.ts.liquid +10 -0
  81. package/oclif.manifest.json +161 -0
  82. package/package.json +97 -0
@@ -0,0 +1,14 @@
1
+ import { type IEntitiesService } from '@kinotic-ai/persistence'
2
+ import { Base{{ entityName }}EntityService } from './generated/Base{{ entityName }}EntityService{{ fileExtensionForImports }}'
3
+
4
+ /**
5
+ * Service for interacting with {{ entityName }} entities
6
+ * This class was generated by the Kinotic CLI
7
+ */
8
+ export class {{ entityName }}EntityService extends Base{{ entityName }}EntityService {
9
+
10
+ constructor(entitiesService?: IEntitiesService) {
11
+ super({{ validate }}, entitiesService)
12
+ }
13
+
14
+ }
@@ -0,0 +1,10 @@
1
+ {% comment %}
2
+ Liquid template for rendering a KinoticProjectConfig as TypeScript code.
3
+ Usage: Render with context { config, typeName }
4
+ {% endcomment %}
5
+
6
+ import type KinoticProjectConfig from '@kinotic-ai/core'
7
+
8
+ const config: KinoticProjectConfig = {% render_value config %}
9
+
10
+ export default config
@@ -0,0 +1,161 @@
1
+ {
2
+ "commands": {
3
+ "generate": {
4
+ "aliases": [
5
+ "gen"
6
+ ],
7
+ "args": {},
8
+ "description": "This will generate all Entity Service classes.",
9
+ "examples": [
10
+ "$ kinotic generate",
11
+ "$ kinotic gen",
12
+ "$ kinotic gen -v"
13
+ ],
14
+ "flags": {
15
+ "verbose": {
16
+ "char": "v",
17
+ "description": "Enable verbose logging",
18
+ "name": "verbose",
19
+ "allowNo": false,
20
+ "type": "boolean"
21
+ }
22
+ },
23
+ "hasDynamicHelp": false,
24
+ "hiddenAliases": [],
25
+ "id": "generate",
26
+ "pluginAlias": "@kinotic-ai/kinotic-cli",
27
+ "pluginName": "@kinotic-ai/kinotic-cli",
28
+ "pluginType": "core",
29
+ "strict": true,
30
+ "enableJsonFlag": false,
31
+ "isESM": true,
32
+ "relativePath": [
33
+ "dist",
34
+ "commands",
35
+ "generate.js"
36
+ ]
37
+ },
38
+ "initialize": {
39
+ "aliases": [
40
+ "init"
41
+ ],
42
+ "args": {},
43
+ "description": "This will initialize a new Kinotic Project for use with the Kinotic CLI.",
44
+ "examples": [
45
+ "$ kinotic initialize --application my.app --entities path/to/entities --generated path/to/services",
46
+ "$ kinotic init --application my.app --entities path/to/entities --generated path/to/services",
47
+ "$ kinotic init -a my.app -e path/to/entities -g path/to/services"
48
+ ],
49
+ "flags": {
50
+ "application": {
51
+ "char": "a",
52
+ "description": "The name of the application you want to use",
53
+ "name": "application",
54
+ "required": false,
55
+ "hasDynamicHelp": false,
56
+ "multiple": false,
57
+ "type": "option"
58
+ },
59
+ "entities": {
60
+ "char": "e",
61
+ "description": "Path to the directory containing the Entity definitions",
62
+ "name": "entities",
63
+ "required": false,
64
+ "hasDynamicHelp": false,
65
+ "multiple": false,
66
+ "type": "option"
67
+ },
68
+ "generated": {
69
+ "char": "g",
70
+ "description": "Path to the directory to write generated Services",
71
+ "name": "generated",
72
+ "required": false,
73
+ "hasDynamicHelp": false,
74
+ "multiple": false,
75
+ "type": "option"
76
+ }
77
+ },
78
+ "hasDynamicHelp": false,
79
+ "hiddenAliases": [],
80
+ "id": "initialize",
81
+ "pluginAlias": "@kinotic-ai/kinotic-cli",
82
+ "pluginName": "@kinotic-ai/kinotic-cli",
83
+ "pluginType": "core",
84
+ "strict": true,
85
+ "enableJsonFlag": false,
86
+ "isESM": true,
87
+ "relativePath": [
88
+ "dist",
89
+ "commands",
90
+ "initialize.js"
91
+ ]
92
+ },
93
+ "synchronize": {
94
+ "aliases": [
95
+ "sync"
96
+ ],
97
+ "args": {},
98
+ "description": "Synchronize the local Entity definitions with the Kinotic Server",
99
+ "examples": [
100
+ "$ kinotic synchronize",
101
+ "$ kinotic sync",
102
+ "$ kinotic synchronize --server http://localhost:9090 --publish --verbose",
103
+ "$ kinotic sync -p -v -s http://localhost:9090"
104
+ ],
105
+ "flags": {
106
+ "server": {
107
+ "char": "s",
108
+ "description": "The Kinotic server to connect to",
109
+ "name": "server",
110
+ "hasDynamicHelp": false,
111
+ "multiple": false,
112
+ "type": "option"
113
+ },
114
+ "publish": {
115
+ "char": "p",
116
+ "description": "Publish each Entity after save/update",
117
+ "name": "publish",
118
+ "allowNo": false,
119
+ "type": "boolean"
120
+ },
121
+ "verbose": {
122
+ "char": "v",
123
+ "description": "Enable verbose logging",
124
+ "name": "verbose",
125
+ "allowNo": false,
126
+ "type": "boolean"
127
+ },
128
+ "authHeaderFile": {
129
+ "char": "f",
130
+ "description": "JSON File containing authentication headers",
131
+ "name": "authHeaderFile",
132
+ "required": false,
133
+ "hasDynamicHelp": false,
134
+ "multiple": false,
135
+ "type": "option"
136
+ },
137
+ "dryRun": {
138
+ "description": "Dry run enables verbose logging and does not save any changes to the server",
139
+ "name": "dryRun",
140
+ "allowNo": false,
141
+ "type": "boolean"
142
+ }
143
+ },
144
+ "hasDynamicHelp": false,
145
+ "hiddenAliases": [],
146
+ "id": "synchronize",
147
+ "pluginAlias": "@kinotic-ai/kinotic-cli",
148
+ "pluginName": "@kinotic-ai/kinotic-cli",
149
+ "pluginType": "core",
150
+ "strict": true,
151
+ "enableJsonFlag": false,
152
+ "isESM": true,
153
+ "relativePath": [
154
+ "dist",
155
+ "commands",
156
+ "synchronize.js"
157
+ ]
158
+ }
159
+ },
160
+ "version": "1.0.0"
161
+ }
package/package.json ADDED
@@ -0,0 +1,97 @@
1
+ {
2
+ "name": "@kinotic-ai/kinotic-cli",
3
+ "version": "1.0.0",
4
+ "description": "Kinotic CLI provides the ability to interact with the Kinotic Server",
5
+ "author": "Kinotic Developers",
6
+ "bin": {
7
+ "kinotic": "./bin/run.js"
8
+ },
9
+ "homepage": "https://kinotic-ai",
10
+ "repository": "https://github.com/kinotic-ai/kinotic",
11
+ "license": "Elastic License 2.0\"",
12
+ "main": "dist/index.js",
13
+ "type": "module",
14
+ "files": [
15
+ "/bin",
16
+ "/dist",
17
+ "/npm-shrinkwrap.json",
18
+ "/oclif.manifest.json"
19
+ ],
20
+ "dependencies": {
21
+ "@inquirer/prompts": "^8.3.2",
22
+ "@kinotic-ai/core": "^1.0.6",
23
+ "@kinotic-ai/idl": "^1.0.6",
24
+ "@kinotic-ai/os-api": "^1.0.6",
25
+ "@kinotic-ai/persistence": "^1.0.6",
26
+ "@oclif/core": "^4.9.0",
27
+ "@oclif/plugin-autocomplete": "^3.2.41",
28
+ "@oclif/plugin-help": "^6",
29
+ "@oclif/plugin-not-found": "^3.2.75",
30
+ "@oclif/plugin-plugins": "^5.4.58",
31
+ "@oclif/plugin-update": "^4.7.23",
32
+ "@oclif/plugin-warn-if-update-available": "^3.1.55",
33
+ "c12": "^3.3.3",
34
+ "chalk": "^5.6.2",
35
+ "glob": "^13.0.6",
36
+ "graphql": "^16.13.1",
37
+ "liquidjs": "^10.25.0",
38
+ "open": "^11.0.0",
39
+ "p-timeout": "^7.0.1",
40
+ "radash": "^12.1.1",
41
+ "reflect-metadata": "^0.2.2",
42
+ "terminal-link": "^5.0.0",
43
+ "ts-morph": "^27.0.2",
44
+ "uuid": "^13.0.0",
45
+ "ws": "^8.19.0",
46
+ "yaml": "^2.8.2"
47
+ },
48
+ "devDependencies": {
49
+ "@oclif/test": "^4.1.16",
50
+ "@types/chai": "^5",
51
+ "@types/inquirer": "^9.0.9",
52
+ "@types/mocha": "^10.0.10",
53
+ "@types/node": "^25.5.0",
54
+ "@types/uuid": "^11.0.0",
55
+ "@types/ws": "^8.18.1",
56
+ "chai": "^6",
57
+ "eslint": "^10",
58
+ "eslint-config-oclif": "^6",
59
+ "eslint-config-prettier": "^10",
60
+ "mocha": "^11",
61
+ "oclif": "^4.22.92",
62
+ "shx": "^0.4.0",
63
+ "tslib": "^2.8.1",
64
+ "tsx": "^4.21.0",
65
+ "typescript": "^5.9.3"
66
+ },
67
+ "oclif": {
68
+ "bin": "kinotic",
69
+ "dirname": "kinotic",
70
+ "commands": "./dist/commands",
71
+ "plugins": [
72
+ "@oclif/plugin-help",
73
+ "@oclif/plugin-plugins",
74
+ "@oclif/plugin-update",
75
+ "@oclif/plugin-not-found",
76
+ "@oclif/plugin-warn-if-update-available",
77
+ "@oclif/plugin-autocomplete"
78
+ ],
79
+ "topicSeparator": " ",
80
+ "topics": {}
81
+ },
82
+ "engines": {
83
+ "node": ">=18.0.0"
84
+ },
85
+ "keywords": [
86
+ "oclif"
87
+ ],
88
+ "types": "dist/index.d.ts",
89
+ "scripts": {
90
+ "build": "shx rm -rf dist && tsc -b && pnpm run copy-files",
91
+ "lint": "eslint . --ext .ts --config .eslintrc",
92
+ "posttest": "pnpm lint",
93
+ "test": "mocha --forbid-only \"test/**/*.test.ts\"",
94
+ "version": "oclif readme && git add README.md",
95
+ "copy-files": "cp -r ./src/templates/ ./dist/templates/"
96
+ }
97
+ }