@kinotic-ai/kinotic-cli 1.0.1 → 1.0.3

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 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/1.0.1 darwin-arm64 node-v22.13.1
15
+ @kinotic-ai/kinotic-cli/1.0.3 darwin-arm64 node-v22.13.1
16
16
  $ kinotic --help [COMMAND]
17
17
  USAGE
18
18
  $ kinotic COMMAND
@@ -122,7 +122,7 @@ EXAMPLES
122
122
  $ kinotic gen -v
123
123
  ```
124
124
 
125
- _See code: [src/commands/generate.ts](https://github.com/kinotic-ai/kinotic/blob/v1.0.1/src/commands/generate.ts)_
125
+ _See code: [src/commands/generate.ts](https://github.com/kinotic-ai/kinotic/blob/v1.0.3/src/commands/generate.ts)_
126
126
 
127
127
  ## `kinotic help [COMMAND]`
128
128
 
@@ -198,7 +198,7 @@ EXAMPLES
198
198
  $ kinotic init -a my.app -e path/to/entities -g path/to/services
199
199
  ```
200
200
 
201
- _See code: [src/commands/initialize.ts](https://github.com/kinotic-ai/kinotic/blob/v1.0.1/src/commands/initialize.ts)_
201
+ _See code: [src/commands/initialize.ts](https://github.com/kinotic-ai/kinotic/blob/v1.0.3/src/commands/initialize.ts)_
202
202
 
203
203
  ## `kinotic plugins`
204
204
 
@@ -552,7 +552,7 @@ EXAMPLES
552
552
  $ kinotic sync -p -v -s http://localhost:9090
553
553
  ```
554
554
 
555
- _See code: [src/commands/synchronize.ts](https://github.com/kinotic-ai/kinotic/blob/v1.0.1/src/commands/synchronize.ts)_
555
+ _See code: [src/commands/synchronize.ts](https://github.com/kinotic-ai/kinotic/blob/v1.0.3/src/commands/synchronize.ts)_
556
556
 
557
557
  ## `kinotic update [CHANNEL]`
558
558
 
@@ -57,9 +57,9 @@ export class Synchronize extends Command {
57
57
  namedQueries.push(...serviceInfo.namedQueries);
58
58
  }
59
59
  // We sync named queries first since currently the backend cache eviction logic is a little dumb
60
- // i.e. The cache eviction for the structure deletes the GraphQL schema
60
+ // i.e. The cache eviction for the EntityDefinition deletes the GraphQL schema
61
61
  // This will evict the named query execution plan cache
62
- // We want to make sure the GraphQL schema is updated after both these are updated and the structure below
62
+ // We want to make sure the GraphQL schema is updated after both these are updated and the EntityDefinition below
63
63
  if (!flags.dryRun && namedQueries.length > 0) {
64
64
  await this.synchronizeNamedQueries(project.id, entityInfo.entity, namedQueries);
65
65
  }
@@ -103,47 +103,47 @@ export class Synchronize extends Command {
103
103
  }
104
104
  }
105
105
  }
106
- async synchronizeEntity(projectId, entity, publish, verbose) {
106
+ async synchronizeEntity(projectId, entitySchema, publish, verbose) {
107
107
  const entityDefinitionService = Kinotic.entityDefinitions;
108
- const application = entity.namespace;
109
- const name = entity.name;
110
- const structureId = (application + '.' + name).toLowerCase();
108
+ const application = entitySchema.namespace;
109
+ const name = entitySchema.name;
110
+ const entityDefinitionId = (application + '.' + name).toLowerCase();
111
111
  this.log(`Synchronizing Entity: ${application}.${name}`);
112
112
  try {
113
- let structure = await entityDefinitionService.findById(structureId);
114
- if (structure) {
115
- if (structure.published) {
113
+ let entityDefinition = await entityDefinitionService.findById(entityDefinitionId);
114
+ if (entityDefinition) {
115
+ if (entityDefinition.published) {
116
116
  this.log(chalk.bold(`Entity ${chalk.blue(application + '.' + name)} is Published. ${chalk.yellow('(Supported Modifications: New Fields. Un-Publish for all other changes.)')}`));
117
117
  }
118
118
  // update existing entity
119
- structure.entityDefinition = entity;
119
+ entityDefinition.schema = entitySchema;
120
120
  this.logVerbose(`Updating Entity: ${application}.${name}`, verbose);
121
- structure = await entityDefinitionService.save(structure);
121
+ entityDefinition = await entityDefinitionService.save(entityDefinition);
122
122
  }
123
123
  else {
124
- structure = new EntityDefinition(application, projectId, name, entity);
124
+ entityDefinition = new EntityDefinition(application, projectId, name, entitySchema);
125
125
  this.logVerbose(`Creating Entity: ${application}.${name}`, verbose);
126
- structure = await entityDefinitionService.create(structure);
126
+ entityDefinition = await entityDefinitionService.create(entityDefinition);
127
127
  }
128
128
  // publish if we need to
129
- if (!structure.published && publish && structure?.id) {
129
+ if (!entityDefinition.published && publish && entityDefinition?.id) {
130
130
  this.logVerbose(`Publishing Entity: ${application}.${name}`, verbose);
131
- await entityDefinitionService.publish(structure.id);
131
+ await entityDefinitionService.publish(entityDefinition.id);
132
132
  }
133
133
  }
134
134
  catch (e) {
135
135
  const message = e?.message || e;
136
- this.log(chalk.red('Error') + ` Synchronizing Entity: ${structureId}, Exception: ${message}`);
136
+ this.log(chalk.red('Error') + ` Synchronizing Entity: ${entityDefinitionId}, Exception: ${message}`);
137
137
  }
138
138
  }
139
- async synchronizeNamedQueries(projectId, entity, namedQueries) {
139
+ async synchronizeNamedQueries(projectId, entitySchema, namedQueries) {
140
140
  const namedQueriesService = Kinotic.namedQueriesDefinitions;
141
- const application = entity.namespace;
142
- const structure = entity.name;
143
- const id = (application + '.' + structure).toLowerCase();
144
- this.log(`Synchronizing Named Queries for Entity: ${application}.${structure}`);
141
+ const application = entitySchema.namespace;
142
+ const entityDefinitionName = entitySchema.name;
143
+ const id = (application + '.' + entityDefinitionName).toLowerCase();
144
+ this.log(`Synchronizing Named Queries for Entity: ${application}.${entityDefinitionName}`);
145
145
  try {
146
- const namedQueriesDefinition = new NamedQueriesDefinition(id, application, projectId, structure, namedQueries);
146
+ const namedQueriesDefinition = new NamedQueriesDefinition(id, application, projectId, entityDefinitionName, namedQueries);
147
147
  await namedQueriesService.save(namedQueriesDefinition);
148
148
  }
149
149
  catch (e) {
@@ -52,7 +52,7 @@ export class CodeGenerationService {
52
52
  const convertedEntities = convertAllEntities(config);
53
53
  if (convertedEntities.length > 0) {
54
54
  for (const entityInfo of convertedEntities) {
55
- this.logger.logVerbose(`Generated Structure Mapping for ${entityInfo.entity.namespace}.${entityInfo.entity.name}`, config.verbose);
55
+ this.logger.logVerbose(`Generated Persistence Mapping for ${entityInfo.entity.namespace}.${entityInfo.entity.name}`, config.verbose);
56
56
  const generatedServices = [];
57
57
  generatedServices.push(await this.generateEntityService(false, entityInfo, projectConfig));
58
58
  if (entityInfo.multiTenantSelectionEnabled) {
@@ -142,7 +142,7 @@ export class CodeGenerationService {
142
142
  const serviceClass = entityServiceSource.getClass(entityServiceName);
143
143
  if (serviceClass) {
144
144
  // Convert all methods that have a @Query decorator to a C3 FunctionDefinition
145
- // These will be used to define the named queries for the structure
145
+ // These will be used to define the named queries for the EntityDefinition
146
146
  for (const method of serviceClass?.getInstanceMethods()) {
147
147
  const queryDecorator = method.getDecorator('Query');
148
148
  if (queryDecorator) {
@@ -157,5 +157,5 @@
157
157
  ]
158
158
  }
159
159
  },
160
- "version": "1.0.1"
160
+ "version": "1.0.3"
161
161
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kinotic-ai/kinotic-cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Kinotic CLI provides the ability to interact with the Kinotic Server",
5
5
  "author": "Kinotic Developers",
6
6
  "bin": {
@@ -19,10 +19,10 @@
19
19
  ],
20
20
  "dependencies": {
21
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",
22
+ "@kinotic-ai/core": "^1.0.9",
23
+ "@kinotic-ai/idl": "^1.0.9",
24
+ "@kinotic-ai/os-api": "^1.0.9",
25
+ "@kinotic-ai/persistence": "^1.0.9",
26
26
  "@oclif/core": "^4.9.0",
27
27
  "@oclif/plugin-autocomplete": "^3.2.41",
28
28
  "@oclif/plugin-help": "^6",