@kapeta/local-cluster-service 0.22.0 → 0.22.2

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.22.2](https://github.com/kapetacom/local-cluster-service/compare/v0.22.1...v0.22.2) (2023-10-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * 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))
7
+
8
+ ## [0.22.1](https://github.com/kapetacom/local-cluster-service/compare/v0.22.0...v0.22.1) (2023-10-21)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Bump kapeta api to fix auth ([#86](https://github.com/kapetacom/local-cluster-service/issues/86)) ([1178afc](https://github.com/kapetacom/local-cluster-service/commit/1178afce54a25cddb52944201097bc28c59b038a))
14
+
1
15
  # [0.22.0](https://github.com/kapetacom/local-cluster-service/compare/v0.21.5...v0.22.0) (2023-10-17)
2
16
 
3
17
 
package/dist/cjs/index.js CHANGED
@@ -141,7 +141,7 @@ exports.default = {
141
141
  throw new Error(`Cluster service already running on: ${clusterHost}:${clusterPort}.`);
142
142
  }
143
143
  await clusterService_1.clusterService.init();
144
- await authManager_1.authManager.listenForChanges();
144
+ authManager_1.authManager.listenForChanges();
145
145
  currentServer = createServer();
146
146
  const port = clusterService_1.clusterService.getClusterServicePort();
147
147
  const host = clusterService_1.clusterService.getClusterServiceHost();
@@ -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}`;
@@ -16,10 +16,6 @@ declare class OperatorManager {
16
16
  _getMountPoint(operatorType: string, mountName: string): string;
17
17
  /**
18
18
  * Get operator definition for resource type
19
- *
20
- * @param {string} resourceType
21
- * @param {string} version
22
- * @return {Operator}
23
19
  */
24
20
  getOperator(resourceType: string, version: string): Promise<Operator>;
25
21
  /**
@@ -45,10 +45,6 @@ class OperatorManager {
45
45
  }
46
46
  /**
47
47
  * Get operator definition for resource type
48
- *
49
- * @param {string} resourceType
50
- * @param {string} version
51
- * @return {Operator}
52
48
  */
53
49
  async getOperator(resourceType, version) {
54
50
  const operators = await definitionsManager_1.definitionsManager.getDefinitions(exports.KIND_OPERATOR);
@@ -84,7 +80,12 @@ class OperatorManager {
84
80
  if (!blockDefinition) {
85
81
  throw new Error(`Unknown block: ${currentInstance.block.ref} in plan ${systemId}`);
86
82
  }
87
- const blockResource = blockDefinition.definition.spec?.consumers?.find((resource) => resource.metadata.name === name);
83
+ const blockResource = blockDefinition.definition.spec?.consumers?.find((resource) => {
84
+ if (resource.metadata.name !== name) {
85
+ return false;
86
+ }
87
+ return (0, nodejs_utils_1.parseKapetaUri)(resource.kind).fullName === resourceType;
88
+ });
88
89
  if (!blockResource) {
89
90
  throw new Error(`Unknown resource: ${name} in block ${currentInstance.block.ref} in plan ${systemId}`);
90
91
  }
package/dist/cjs/start.js CHANGED
@@ -8,6 +8,6 @@ index_1.default
8
8
  .start()
9
9
  .then(({ host, port }) => console.log('Listening on port %s:%s', host, port))
10
10
  .catch((e) => {
11
- console.error('Failed to start local cluster due to an error:\n\t - %s', e.toString());
11
+ console.error('Failed to start local cluster due to an error:\n\t - %s', e);
12
12
  process.exit(1);
13
13
  });
package/dist/esm/index.js CHANGED
@@ -141,7 +141,7 @@ exports.default = {
141
141
  throw new Error(`Cluster service already running on: ${clusterHost}:${clusterPort}.`);
142
142
  }
143
143
  await clusterService_1.clusterService.init();
144
- await authManager_1.authManager.listenForChanges();
144
+ authManager_1.authManager.listenForChanges();
145
145
  currentServer = createServer();
146
146
  const port = clusterService_1.clusterService.getClusterServicePort();
147
147
  const host = clusterService_1.clusterService.getClusterServiceHost();
@@ -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}`;
@@ -16,10 +16,6 @@ declare class OperatorManager {
16
16
  _getMountPoint(operatorType: string, mountName: string): string;
17
17
  /**
18
18
  * Get operator definition for resource type
19
- *
20
- * @param {string} resourceType
21
- * @param {string} version
22
- * @return {Operator}
23
19
  */
24
20
  getOperator(resourceType: string, version: string): Promise<Operator>;
25
21
  /**
@@ -45,10 +45,6 @@ class OperatorManager {
45
45
  }
46
46
  /**
47
47
  * Get operator definition for resource type
48
- *
49
- * @param {string} resourceType
50
- * @param {string} version
51
- * @return {Operator}
52
48
  */
53
49
  async getOperator(resourceType, version) {
54
50
  const operators = await definitionsManager_1.definitionsManager.getDefinitions(exports.KIND_OPERATOR);
@@ -84,7 +80,12 @@ class OperatorManager {
84
80
  if (!blockDefinition) {
85
81
  throw new Error(`Unknown block: ${currentInstance.block.ref} in plan ${systemId}`);
86
82
  }
87
- const blockResource = blockDefinition.definition.spec?.consumers?.find((resource) => resource.metadata.name === name);
83
+ const blockResource = blockDefinition.definition.spec?.consumers?.find((resource) => {
84
+ if (resource.metadata.name !== name) {
85
+ return false;
86
+ }
87
+ return (0, nodejs_utils_1.parseKapetaUri)(resource.kind).fullName === resourceType;
88
+ });
88
89
  if (!blockResource) {
89
90
  throw new Error(`Unknown resource: ${name} in block ${currentInstance.block.ref} in plan ${systemId}`);
90
91
  }
package/dist/esm/start.js CHANGED
@@ -8,6 +8,6 @@ index_1.default
8
8
  .start()
9
9
  .then(({ host, port }) => console.log('Listening on port %s:%s', host, port))
10
10
  .catch((e) => {
11
- console.error('Failed to start local cluster due to an error:\n\t - %s', e.toString());
11
+ console.error('Failed to start local cluster due to an error:\n\t - %s', e);
12
12
  process.exit(1);
13
13
  });
package/index.ts CHANGED
@@ -162,7 +162,8 @@ export default {
162
162
  }
163
163
 
164
164
  await clusterService.init();
165
- await authManager.listenForChanges();
165
+
166
+ authManager.listenForChanges();
166
167
 
167
168
  currentServer = createServer();
168
169
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kapeta/local-cluster-service",
3
- "version": "0.22.0",
3
+ "version": "0.22.2",
4
4
  "description": "Manages configuration, ports and service discovery for locally running Kapeta systems",
5
5
  "type": "commonjs",
6
6
  "exports": {
@@ -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);
@@ -59,10 +59,6 @@ class OperatorManager {
59
59
 
60
60
  /**
61
61
  * Get operator definition for resource type
62
- *
63
- * @param {string} resourceType
64
- * @param {string} version
65
- * @return {Operator}
66
62
  */
67
63
  async getOperator(resourceType: string, version: string) {
68
64
  const operators = await definitionsManager.getDefinitions(KIND_OPERATOR);
@@ -122,9 +118,13 @@ class OperatorManager {
122
118
  throw new Error(`Unknown block: ${currentInstance.block.ref} in plan ${systemId}`);
123
119
  }
124
120
 
125
- const blockResource = blockDefinition.definition.spec?.consumers?.find(
126
- (resource: Resource) => resource.metadata.name === name
127
- );
121
+ const blockResource = blockDefinition.definition.spec?.consumers?.find((resource: Resource) => {
122
+ if (resource.metadata.name !== name) {
123
+ return false;
124
+ }
125
+ return parseKapetaUri(resource.kind).fullName === resourceType;
126
+ });
127
+
128
128
  if (!blockResource) {
129
129
  throw new Error(`Unknown resource: ${name} in block ${currentInstance.block.ref} in plan ${systemId}`);
130
130
  }
package/start.ts CHANGED
@@ -4,6 +4,6 @@ localClusterService
4
4
  .start()
5
5
  .then(({ host, port }) => console.log('Listening on port %s:%s', host, port))
6
6
  .catch((e) => {
7
- console.error('Failed to start local cluster due to an error:\n\t - %s', e.toString());
7
+ console.error('Failed to start local cluster due to an error:\n\t - %s', e);
8
8
  process.exit(1);
9
9
  });