@kinotic-ai/kinotic-cli 2.1.1 → 2.2.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/README.md +5 -5
- package/dist/commands/initialize.js +1 -1
- package/dist/commands/synchronize.js +7 -7
- package/dist/internal/EntityCodeGenerationService.d.ts +1 -1
- package/dist/internal/EntityCodeGenerationService.js +1 -0
- package/dist/internal/state/KinoticProjectConfigUtil.d.ts +1 -1
- package/dist/templates/KinoticProjectConfig.ts.liquid +1 -1
- package/dist/templates/entity/AdminRepository.liquid +2 -2
- package/dist/templates/entity/BaseAdminRepository.liquid +1 -1
- package/dist/templates/entity/BaseRepository.liquid +1 -1
- package/dist/templates/spawns/project/.config/kinotic.config.ts.liquid +3 -2
- package/oclif.manifest.json +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ $ npm install -g @kinotic-ai/kinotic-cli
|
|
|
12
12
|
$ kinotic COMMAND
|
|
13
13
|
running command...
|
|
14
14
|
$ kinotic (--version)
|
|
15
|
-
@kinotic-ai/kinotic-cli/2.
|
|
15
|
+
@kinotic-ai/kinotic-cli/2.2.0 darwin-arm64 node-v22.13.1
|
|
16
16
|
$ kinotic --help [COMMAND]
|
|
17
17
|
USAGE
|
|
18
18
|
$ kinotic COMMAND
|
|
@@ -91,7 +91,7 @@ EXAMPLES
|
|
|
91
91
|
$ kinotic create project MyProjectName
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
-
_See code: [src/commands/create/project.ts](https://github.com/kinotic-ai/kinotic/blob/v2.
|
|
94
|
+
_See code: [src/commands/create/project.ts](https://github.com/kinotic-ai/kinotic/blob/v2.2.0/src/commands/create/project.ts)_
|
|
95
95
|
|
|
96
96
|
## `kinotic gen`
|
|
97
97
|
|
|
@@ -149,7 +149,7 @@ EXAMPLES
|
|
|
149
149
|
$ kinotic gen --force
|
|
150
150
|
```
|
|
151
151
|
|
|
152
|
-
_See code: [src/commands/generate.ts](https://github.com/kinotic-ai/kinotic/blob/v2.
|
|
152
|
+
_See code: [src/commands/generate.ts](https://github.com/kinotic-ai/kinotic/blob/v2.2.0/src/commands/generate.ts)_
|
|
153
153
|
|
|
154
154
|
## `kinotic help [COMMAND]`
|
|
155
155
|
|
|
@@ -231,7 +231,7 @@ EXAMPLES
|
|
|
231
231
|
$ kinotic init -a my.app -e path/to/entities -r path/to/repository --mirror
|
|
232
232
|
```
|
|
233
233
|
|
|
234
|
-
_See code: [src/commands/initialize.ts](https://github.com/kinotic-ai/kinotic/blob/v2.
|
|
234
|
+
_See code: [src/commands/initialize.ts](https://github.com/kinotic-ai/kinotic/blob/v2.2.0/src/commands/initialize.ts)_
|
|
235
235
|
|
|
236
236
|
## `kinotic plugins`
|
|
237
237
|
|
|
@@ -587,7 +587,7 @@ EXAMPLES
|
|
|
587
587
|
$ kinotic sync -p -v -s http://localhost:9090
|
|
588
588
|
```
|
|
589
589
|
|
|
590
|
-
_See code: [src/commands/synchronize.ts](https://github.com/kinotic-ai/kinotic/blob/v2.
|
|
590
|
+
_See code: [src/commands/synchronize.ts](https://github.com/kinotic-ai/kinotic/blob/v2.2.0/src/commands/synchronize.ts)_
|
|
591
591
|
|
|
592
592
|
## `kinotic update [CHANNEL]`
|
|
593
593
|
|
|
@@ -4,7 +4,7 @@ import path from 'path';
|
|
|
4
4
|
import chalk from 'chalk';
|
|
5
5
|
import { input } from '@inquirer/prompts';
|
|
6
6
|
import { isKinoticProject, saveKinoticProjectConfig } from '../internal/state/KinoticProjectConfigUtil.js';
|
|
7
|
-
import { KinoticProjectConfig } from '@kinotic-ai/
|
|
7
|
+
import { KinoticProjectConfig } from '@kinotic-ai/os-api';
|
|
8
8
|
/**
|
|
9
9
|
* Validates the application name according to server requirements:
|
|
10
10
|
* - First character must be a letter
|
|
@@ -62,10 +62,10 @@ export class Synchronize extends Command {
|
|
|
62
62
|
// This will evict the named query execution plan cache
|
|
63
63
|
// We want to make sure the GraphQL schema is updated after both these are updated and the EntityDefinition below
|
|
64
64
|
if (!flags.dryRun && namedQueries.length > 0) {
|
|
65
|
-
await this.synchronizeNamedQueries(project.id, entityInfo.entity, namedQueries);
|
|
65
|
+
await this.synchronizeNamedQueries(kinoticProjectConfig.organization, project.id, entityInfo.entity, namedQueries);
|
|
66
66
|
}
|
|
67
67
|
if (!flags.dryRun) {
|
|
68
|
-
await this.synchronizeEntity(project.id, entityInfo.entity, flags.publish, flags.verbose);
|
|
68
|
+
await this.synchronizeEntity(kinoticProjectConfig.organization, project.id, entityInfo.entity, flags.publish, flags.verbose);
|
|
69
69
|
}
|
|
70
70
|
}, flags.force);
|
|
71
71
|
// Apply migrations after entity synchronization
|
|
@@ -104,11 +104,11 @@ export class Synchronize extends Command {
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
async synchronizeEntity(projectId, entitySchema, publish, verbose) {
|
|
107
|
+
async synchronizeEntity(organizationId, projectId, entitySchema, publish, verbose) {
|
|
108
108
|
const entityDefinitionService = Kinotic.entityDefinitions;
|
|
109
109
|
const application = entitySchema.namespace;
|
|
110
110
|
const name = entitySchema.name;
|
|
111
|
-
const entityDefinitionId = (application + '.' + name).toLowerCase();
|
|
111
|
+
const entityDefinitionId = (organizationId + '.' + application + '.' + name).toLowerCase();
|
|
112
112
|
this.log(`Synchronizing Entity: ${application}.${name}`);
|
|
113
113
|
try {
|
|
114
114
|
let entityDefinition = await entityDefinitionService.findById(entityDefinitionId);
|
|
@@ -122,7 +122,7 @@ export class Synchronize extends Command {
|
|
|
122
122
|
entityDefinition = await entityDefinitionService.save(entityDefinition);
|
|
123
123
|
}
|
|
124
124
|
else {
|
|
125
|
-
entityDefinition = new EntityDefinition(application, projectId, name, entitySchema);
|
|
125
|
+
entityDefinition = new EntityDefinition(organizationId, application, projectId, name, entitySchema);
|
|
126
126
|
this.logVerbose(`Creating Entity: ${application}.${name}`, verbose);
|
|
127
127
|
entityDefinition = await entityDefinitionService.create(entityDefinition);
|
|
128
128
|
}
|
|
@@ -137,11 +137,11 @@ export class Synchronize extends Command {
|
|
|
137
137
|
this.log(chalk.red('Error') + ` Synchronizing Entity: ${entityDefinitionId}, Exception: ${message}`);
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
async synchronizeNamedQueries(projectId, entitySchema, namedQueries) {
|
|
140
|
+
async synchronizeNamedQueries(organizationId, projectId, entitySchema, namedQueries) {
|
|
141
141
|
const namedQueriesService = Kinotic.namedQueriesDefinitions;
|
|
142
142
|
const application = entitySchema.namespace;
|
|
143
143
|
const entityDefinitionName = entitySchema.name;
|
|
144
|
-
const id = (application + '.' + entityDefinitionName).toLowerCase();
|
|
144
|
+
const id = (organizationId + '.' + application + '.' + entityDefinitionName).toLowerCase();
|
|
145
145
|
this.log(`Synchronizing Named Queries for Entity: ${application}.${entityDefinitionName}`);
|
|
146
146
|
try {
|
|
147
147
|
const namedQueriesDefinition = new NamedQueriesDefinition(id, application, projectId, entityDefinitionName, namedQueries);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { KinoticProjectConfig } from '@kinotic-ai/
|
|
1
|
+
import { KinoticProjectConfig } from '@kinotic-ai/os-api';
|
|
2
2
|
import { Logger } from './Logger.js';
|
|
3
3
|
import { EntityInfo, GeneratedServiceInfo } from './Utils.js';
|
|
4
4
|
export type GeneratedEntityProcessor = (entityInfo: EntityInfo, serviceInfo: GeneratedServiceInfo[]) => Promise<void>;
|
|
@@ -152,6 +152,7 @@ export class EntityCodeGenerationService {
|
|
|
152
152
|
const baseReadStream = await this.engine.renderFileToNodeStream(`Base${adminPrefix}Repository`, {
|
|
153
153
|
entityName,
|
|
154
154
|
entityNamespace,
|
|
155
|
+
organizationId: projectConfig.organization,
|
|
155
156
|
defaultExport,
|
|
156
157
|
entityImportPath,
|
|
157
158
|
validationLogic,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { KinoticProjectConfig } from '@kinotic-ai/
|
|
1
|
+
import type { KinoticProjectConfig } from '@kinotic-ai/os-api';
|
|
2
2
|
/**
|
|
3
3
|
* Saves a KinoticProjectConfig to the .config directory using the appropriate Liquid template.
|
|
4
4
|
* @param config The config object to save
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type IAdminEntitiesRepository } from '@kinotic-ai/persistence'
|
|
2
2
|
import { Base{{ entityName }}AdminRepository } from './generated/Base{{ entityName }}AdminRepository{{ fileExtensionForImports }}'
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -7,7 +7,7 @@ import { Base{{ entityName }}AdminRepository } from './generated/Base{{ entityNa
|
|
|
7
7
|
*/
|
|
8
8
|
export class {{ entityName }}AdminRepository extends Base{{ entityName }}AdminRepository {
|
|
9
9
|
|
|
10
|
-
constructor(adminEntitiesService?:
|
|
10
|
+
constructor(adminEntitiesService?: IAdminEntitiesRepository) {
|
|
11
11
|
super(adminEntitiesService)
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -13,7 +13,7 @@ import { {{ entityName }} } from '{{ entityImportPath }}'
|
|
|
13
13
|
export class Base{{ entityName }}AdminRepository extends AdminEntityRepository<{{ entityName }}> {
|
|
14
14
|
|
|
15
15
|
constructor(adminEntitiesService?: IAdminEntitiesRepository) {
|
|
16
|
-
super('{{ entityNamespace }}', '{{ entityName }}', adminEntitiesService)
|
|
16
|
+
super('{{ organizationId }}', '{{ entityNamespace }}', '{{ entityName }}', adminEntitiesService)
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
}
|
|
@@ -15,7 +15,7 @@ export class Base{{ entityName }}Repository extends EntityRepository<{{ entityNa
|
|
|
15
15
|
private readonly shouldValidate: boolean
|
|
16
16
|
|
|
17
17
|
constructor(shouldValidate: boolean = true, entitiesRepository?: IEntitiesRepository) {
|
|
18
|
-
super('{{ entityNamespace }}', '{{ entityName }}', entitiesRepository)
|
|
18
|
+
super('{{ organizationId }}', '{{ entityNamespace }}', '{{ entityName }}', entitiesRepository)
|
|
19
19
|
this.shouldValidate = shouldValidate
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { KinoticProjectConfig } from '@kinotic-ai/
|
|
1
|
+
import type { KinoticProjectConfig } from '@kinotic-ai/os-api'
|
|
2
2
|
|
|
3
3
|
const config: KinoticProjectConfig = {
|
|
4
|
-
|
|
4
|
+
organization: "{{ organization }}",
|
|
5
|
+
application: "{{ application }}",
|
|
5
6
|
entitiesPaths: [
|
|
6
7
|
{
|
|
7
8
|
path: "packages/domain/model",
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kinotic-ai/kinotic-cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Kinotic CLI provides the ability to build, deploy, and manage Kinotic applications that run on the Kinotic OS.",
|
|
5
5
|
"author": "Kinotic Developers",
|
|
6
6
|
"bin": {
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"@inquirer/prompts": "^8.3.2",
|
|
22
22
|
"@kinotic-ai/core": "^1.1.1",
|
|
23
23
|
"@kinotic-ai/idl": "^1.0.9",
|
|
24
|
-
"@kinotic-ai/os-api": "^1.0
|
|
25
|
-
"@kinotic-ai/persistence": "^1.
|
|
24
|
+
"@kinotic-ai/os-api": "^1.1.0",
|
|
25
|
+
"@kinotic-ai/persistence": "^1.2.0",
|
|
26
26
|
"@oclif/core": "^4.9.0",
|
|
27
27
|
"@oclif/plugin-autocomplete": "^3.2.41",
|
|
28
28
|
"@oclif/plugin-help": "^6",
|