@kapeta/local-cluster-service 0.22.1 → 0.23.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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [0.23.0](https://github.com/kapetacom/local-cluster-service/compare/v0.22.2...v0.23.0) (2023-10-24)
2
+
3
+
4
+ ### Features
5
+
6
+ * Make it possible to wait for installation to complete from the UI ([#88](https://github.com/kapetacom/local-cluster-service/issues/88)) ([f34c807](https://github.com/kapetacom/local-cluster-service/commit/f34c807d260264e85d770dc1575d0458feae2bae))
7
+
8
+ ## [0.22.2](https://github.com/kapetacom/local-cluster-service/compare/v0.22.1...v0.22.2) (2023-10-22)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Use quick chat as sample instead ([#87](https://github.com/kapetacom/local-cluster-service/issues/87)) ([de7e2ff](https://github.com/kapetacom/local-cluster-service/commit/de7e2ff9371cc89ca6cbe76bf46d99f802c816ff))
14
+
1
15
  ## [0.22.1](https://github.com/kapetacom/local-cluster-service/compare/v0.22.0...v0.22.1) (2023-10-21)
2
16
 
3
17
 
@@ -26,7 +26,7 @@ declare class AssetManager {
26
26
  updateAsset(ref: string, yaml: BlockDefinition, sourceOfChange?: SourceOfChange): Promise<void>;
27
27
  importFile(filePath: string): Promise<EnrichedAsset[]>;
28
28
  unregisterAsset(ref: string): Promise<void>;
29
- installAsset(ref: string): Promise<import("./taskManager").Task<void>[] | undefined>;
29
+ installAsset(ref: string, wait?: boolean): Promise<import("./taskManager").Task<void>[] | undefined>;
30
30
  private maybeGenerateCode;
31
31
  }
32
32
  export declare const assetManager: AssetManager;
@@ -175,17 +175,17 @@ class AssetManager {
175
175
  definitionsManager_1.definitionsManager.clearCache();
176
176
  await nodejs_registry_utils_1.Actions.uninstall(new progressListener_1.ProgressListener(), [asset.ref]);
177
177
  }
178
- async installAsset(ref) {
178
+ async installAsset(ref, wait = false) {
179
179
  const asset = await this.getAsset(ref, true, false);
180
180
  if (asset) {
181
181
  throw new Error('Asset already installed: ' + ref);
182
182
  }
183
183
  const uri = (0, nodejs_utils_1.parseKapetaUri)(ref);
184
- console.log('Installing %s', ref);
184
+ console.log('Installing %s (sync: %s)', ref, wait);
185
185
  const key = toKey(ref);
186
186
  cacheManager_1.cacheManager.remove(key);
187
187
  definitionsManager_1.definitionsManager.clearCache();
188
- return await repositoryManager_1.repositoryManager.ensureAsset(uri.handle, uri.name, uri.version, false);
188
+ return await repositoryManager_1.repositoryManager.ensureAsset(uri.handle, uri.name, uri.version, wait);
189
189
  }
190
190
  async maybeGenerateCode(ref, ymlPath, block) {
191
191
  ref = (0, nodejs_utils_1.normalizeKapetaUri)(ref);
@@ -127,7 +127,7 @@ router.put('/install', async (req, res) => {
127
127
  return;
128
128
  }
129
129
  try {
130
- const tasks = await assetManager_1.assetManager.installAsset(req.query.ref);
130
+ const tasks = await assetManager_1.assetManager.installAsset(req.query.ref, !!req.query.wait);
131
131
  const taskIds = tasks?.map((t) => t.id) ?? [];
132
132
  res.status(200).send(taskIds);
133
133
  }
@@ -1,5 +1,5 @@
1
1
  import { DefinitionInfo } from '@kapeta/local-cluster-config';
2
- export declare const SAMPLE_PLAN_NAME = "kapeta/sample-nodejs-plan";
2
+ export declare const SAMPLE_PLAN_NAME = "kapeta/sample-java-chat-plan";
3
3
  declare class DefinitionsManager {
4
4
  private resolveDefinitionsAndSamples;
5
5
  private applyFilters;
@@ -13,7 +13,7 @@ const yaml_1 = __importDefault(require("yaml"));
13
13
  const nodejs_registry_utils_1 = require("@kapeta/nodejs-registry-utils");
14
14
  const progressListener_1 = require("./progressListener");
15
15
  const path_1 = __importDefault(require("path"));
16
- exports.SAMPLE_PLAN_NAME = 'kapeta/sample-nodejs-plan';
16
+ exports.SAMPLE_PLAN_NAME = 'kapeta/sample-java-chat-plan';
17
17
  function getRenamed(definition, targetHandle) {
18
18
  const originalUri = (0, nodejs_utils_1.parseKapetaUri)(definition.definition.metadata.name);
19
19
  return `${targetHandle}/${originalUri.name}`;
@@ -26,7 +26,7 @@ declare class AssetManager {
26
26
  updateAsset(ref: string, yaml: BlockDefinition, sourceOfChange?: SourceOfChange): Promise<void>;
27
27
  importFile(filePath: string): Promise<EnrichedAsset[]>;
28
28
  unregisterAsset(ref: string): Promise<void>;
29
- installAsset(ref: string): Promise<import("./taskManager").Task<void>[] | undefined>;
29
+ installAsset(ref: string, wait?: boolean): Promise<import("./taskManager").Task<void>[] | undefined>;
30
30
  private maybeGenerateCode;
31
31
  }
32
32
  export declare const assetManager: AssetManager;
@@ -175,17 +175,17 @@ class AssetManager {
175
175
  definitionsManager_1.definitionsManager.clearCache();
176
176
  await nodejs_registry_utils_1.Actions.uninstall(new progressListener_1.ProgressListener(), [asset.ref]);
177
177
  }
178
- async installAsset(ref) {
178
+ async installAsset(ref, wait = false) {
179
179
  const asset = await this.getAsset(ref, true, false);
180
180
  if (asset) {
181
181
  throw new Error('Asset already installed: ' + ref);
182
182
  }
183
183
  const uri = (0, nodejs_utils_1.parseKapetaUri)(ref);
184
- console.log('Installing %s', ref);
184
+ console.log('Installing %s (sync: %s)', ref, wait);
185
185
  const key = toKey(ref);
186
186
  cacheManager_1.cacheManager.remove(key);
187
187
  definitionsManager_1.definitionsManager.clearCache();
188
- return await repositoryManager_1.repositoryManager.ensureAsset(uri.handle, uri.name, uri.version, false);
188
+ return await repositoryManager_1.repositoryManager.ensureAsset(uri.handle, uri.name, uri.version, wait);
189
189
  }
190
190
  async maybeGenerateCode(ref, ymlPath, block) {
191
191
  ref = (0, nodejs_utils_1.normalizeKapetaUri)(ref);
@@ -127,7 +127,7 @@ router.put('/install', async (req, res) => {
127
127
  return;
128
128
  }
129
129
  try {
130
- const tasks = await assetManager_1.assetManager.installAsset(req.query.ref);
130
+ const tasks = await assetManager_1.assetManager.installAsset(req.query.ref, !!req.query.wait);
131
131
  const taskIds = tasks?.map((t) => t.id) ?? [];
132
132
  res.status(200).send(taskIds);
133
133
  }
@@ -1,5 +1,5 @@
1
1
  import { DefinitionInfo } from '@kapeta/local-cluster-config';
2
- export declare const SAMPLE_PLAN_NAME = "kapeta/sample-nodejs-plan";
2
+ export declare const SAMPLE_PLAN_NAME = "kapeta/sample-java-chat-plan";
3
3
  declare class DefinitionsManager {
4
4
  private resolveDefinitionsAndSamples;
5
5
  private applyFilters;
@@ -13,7 +13,7 @@ const yaml_1 = __importDefault(require("yaml"));
13
13
  const nodejs_registry_utils_1 = require("@kapeta/nodejs-registry-utils");
14
14
  const progressListener_1 = require("./progressListener");
15
15
  const path_1 = __importDefault(require("path"));
16
- exports.SAMPLE_PLAN_NAME = 'kapeta/sample-nodejs-plan';
16
+ exports.SAMPLE_PLAN_NAME = 'kapeta/sample-java-chat-plan';
17
17
  function getRenamed(definition, targetHandle) {
18
18
  const originalUri = (0, nodejs_utils_1.parseKapetaUri)(definition.definition.metadata.name);
19
19
  return `${targetHandle}/${originalUri.name}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kapeta/local-cluster-service",
3
- "version": "0.22.1",
3
+ "version": "0.23.0",
4
4
  "description": "Manages configuration, ports and service discovery for locally running Kapeta systems",
5
5
  "type": "commonjs",
6
6
  "exports": {
@@ -239,18 +239,18 @@ class AssetManager {
239
239
  await Actions.uninstall(new ProgressListener(), [asset.ref]);
240
240
  }
241
241
 
242
- async installAsset(ref: string) {
242
+ async installAsset(ref: string, wait: boolean = false) {
243
243
  const asset = await this.getAsset(ref, true, false);
244
244
  if (asset) {
245
245
  throw new Error('Asset already installed: ' + ref);
246
246
  }
247
247
  const uri = parseKapetaUri(ref);
248
- console.log('Installing %s', ref);
248
+ console.log('Installing %s (sync: %s)', ref, wait);
249
249
  const key = toKey(ref);
250
250
  cacheManager.remove(key);
251
251
  definitionsManager.clearCache();
252
252
 
253
- return await repositoryManager.ensureAsset(uri.handle, uri.name, uri.version, false);
253
+ return await repositoryManager.ensureAsset(uri.handle, uri.name, uri.version, wait);
254
254
  }
255
255
 
256
256
  private async maybeGenerateCode(ref: string, ymlPath: string, block: BlockDefinition) {
@@ -143,7 +143,7 @@ router.put('/install', async (req: Request, res: Response) => {
143
143
  }
144
144
 
145
145
  try {
146
- const tasks = await assetManager.installAsset(req.query.ref as string);
146
+ const tasks = await assetManager.installAsset(req.query.ref as string, !!req.query.wait);
147
147
  const taskIds = tasks?.map((t) => t.id) ?? [];
148
148
  res.status(200).send(taskIds);
149
149
  } catch (err: any) {
@@ -9,7 +9,7 @@ import { Actions } from '@kapeta/nodejs-registry-utils';
9
9
  import { ProgressListener } from './progressListener';
10
10
  import Path from 'path';
11
11
 
12
- export const SAMPLE_PLAN_NAME = 'kapeta/sample-nodejs-plan';
12
+ export const SAMPLE_PLAN_NAME = 'kapeta/sample-java-chat-plan';
13
13
 
14
14
  function getRenamed(definition: DefinitionInfo, targetHandle: string) {
15
15
  const originalUri = parseKapetaUri(definition.definition.metadata.name);