@kapeta/local-cluster-service 0.33.3 → 0.33.5

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.33.5](https://github.com/kapetacom/local-cluster-service/compare/v0.33.4...v0.33.5) (2024-01-06)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Include query params in forwarded requests ([#113](https://github.com/kapetacom/local-cluster-service/issues/113)) ([6ccd067](https://github.com/kapetacom/local-cluster-service/commit/6ccd067de787de0c3d9ec21d0e8289778798d00e))
7
+
8
+ ## [0.33.4](https://github.com/kapetacom/local-cluster-service/compare/v0.33.3...v0.33.4) (2024-01-04)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Update fallback for SHOW_PIXEL_GRID ([22058c7](https://github.com/kapetacom/local-cluster-service/commit/22058c7ad02c1cf5bd4c21b8860dd696b21107b1))
14
+
1
15
  ## [0.33.3](https://github.com/kapetacom/local-cluster-service/compare/v0.33.2...v0.33.3) (2024-01-02)
2
16
 
3
17
 
@@ -103,7 +103,7 @@ class FilesystemManager {
103
103
  storageService_1.storageService.put('app', RELEASE_CHANNEL, channel);
104
104
  }
105
105
  getShowPixelGrid() {
106
- return storageService_1.storageService.get('app', SHOW_PIXEL_GRID, false);
106
+ return storageService_1.storageService.get('app', SHOW_PIXEL_GRID, true);
107
107
  }
108
108
  setShowPixelGrid(show) {
109
109
  storageService_1.storageService.put('app', SHOW_PIXEL_GRID, show);
@@ -376,6 +376,11 @@ class InstanceManager {
376
376
  // Not an operator
377
377
  return Promise.resolve();
378
378
  }
379
+ // Check if the operator has a local definition, if not we skip it since we can't start it
380
+ if (!asset.definition.spec.local) {
381
+ console.log('Skipping operator since it as no local definition: %s', consumer.kind);
382
+ return Promise.resolve();
383
+ }
379
384
  console.log('Ensuring resource: %s in %s', consumerUri.id, systemId);
380
385
  return operatorManager_1.operatorManager.ensureResource(systemId, consumerUri.fullName, consumerUri.version);
381
386
  });
@@ -76,6 +76,9 @@ function proxyRestRequest(req, res, opts) {
76
76
  if (!providerPath.startsWith('/')) {
77
77
  providerPath = '/' + providerPath;
78
78
  }
79
+ if (!lodash_1.default.isEmpty(req.query)) {
80
+ providerPath += '?' + new URLSearchParams(req.query).toString();
81
+ }
79
82
  const requestHeaders = lodash_1.default.clone(req.headers);
80
83
  delete requestHeaders['content-length'];
81
84
  delete requestHeaders['content-encoding'];
@@ -25,6 +25,9 @@ function proxyHttpRequest(req, res, opts) {
25
25
  if (opts.consumerPath.startsWith(sourceBasePath)) {
26
26
  path = path.replace(sourceBasePath, targetBasePath);
27
27
  }
28
+ if (!lodash_1.default.isEmpty(req.query)) {
29
+ path += '?' + new URLSearchParams(req.query).toString();
30
+ }
28
31
  console.log('Proxy request to provider: %s => %s%s [http]', opts.consumerPath, opts.address, path);
29
32
  const reqOpts = {
30
33
  method: req.method,
@@ -103,7 +103,7 @@ class FilesystemManager {
103
103
  storageService_1.storageService.put('app', RELEASE_CHANNEL, channel);
104
104
  }
105
105
  getShowPixelGrid() {
106
- return storageService_1.storageService.get('app', SHOW_PIXEL_GRID, false);
106
+ return storageService_1.storageService.get('app', SHOW_PIXEL_GRID, true);
107
107
  }
108
108
  setShowPixelGrid(show) {
109
109
  storageService_1.storageService.put('app', SHOW_PIXEL_GRID, show);
@@ -376,6 +376,11 @@ class InstanceManager {
376
376
  // Not an operator
377
377
  return Promise.resolve();
378
378
  }
379
+ // Check if the operator has a local definition, if not we skip it since we can't start it
380
+ if (!asset.definition.spec.local) {
381
+ console.log('Skipping operator since it as no local definition: %s', consumer.kind);
382
+ return Promise.resolve();
383
+ }
379
384
  console.log('Ensuring resource: %s in %s', consumerUri.id, systemId);
380
385
  return operatorManager_1.operatorManager.ensureResource(systemId, consumerUri.fullName, consumerUri.version);
381
386
  });
@@ -76,6 +76,9 @@ function proxyRestRequest(req, res, opts) {
76
76
  if (!providerPath.startsWith('/')) {
77
77
  providerPath = '/' + providerPath;
78
78
  }
79
+ if (!lodash_1.default.isEmpty(req.query)) {
80
+ providerPath += '?' + new URLSearchParams(req.query).toString();
81
+ }
79
82
  const requestHeaders = lodash_1.default.clone(req.headers);
80
83
  delete requestHeaders['content-length'];
81
84
  delete requestHeaders['content-encoding'];
@@ -25,6 +25,9 @@ function proxyHttpRequest(req, res, opts) {
25
25
  if (opts.consumerPath.startsWith(sourceBasePath)) {
26
26
  path = path.replace(sourceBasePath, targetBasePath);
27
27
  }
28
+ if (!lodash_1.default.isEmpty(req.query)) {
29
+ path += '?' + new URLSearchParams(req.query).toString();
30
+ }
28
31
  console.log('Proxy request to provider: %s => %s%s [http]', opts.consumerPath, opts.address, path);
29
32
  const reqOpts = {
30
33
  method: req.method,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kapeta/local-cluster-service",
3
- "version": "0.33.3",
3
+ "version": "0.33.5",
4
4
  "description": "Manages configuration, ports and service discovery for locally running Kapeta systems",
5
5
  "type": "commonjs",
6
6
  "exports": {
@@ -114,7 +114,7 @@ class FilesystemManager {
114
114
  }
115
115
 
116
116
  getShowPixelGrid() {
117
- return storageService.get<boolean>('app', SHOW_PIXEL_GRID, false);
117
+ return storageService.get<boolean>('app', SHOW_PIXEL_GRID, true);
118
118
  }
119
119
 
120
120
  setShowPixelGrid(show: boolean) {
@@ -480,7 +480,11 @@ export class InstanceManager {
480
480
  // Not an operator
481
481
  return Promise.resolve();
482
482
  }
483
-
483
+ // Check if the operator has a local definition, if not we skip it since we can't start it
484
+ if(!asset.definition.spec.local) {
485
+ console.log('Skipping operator since it as no local definition: %s', consumer.kind)
486
+ return Promise.resolve();
487
+ }
484
488
  console.log('Ensuring resource: %s in %s', consumerUri.id, systemId);
485
489
  return operatorManager.ensureResource(systemId, consumerUri.fullName, consumerUri.version);
486
490
  });
@@ -104,6 +104,10 @@ export function proxyRestRequest(req: StringBodyRequest, res: Response, opts: Pr
104
104
  providerPath = '/' + providerPath;
105
105
  }
106
106
 
107
+ if (!_.isEmpty(req.query)) {
108
+ providerPath += '?' + new URLSearchParams(req.query as any).toString();
109
+ }
110
+
107
111
  const requestHeaders = _.clone(req.headers);
108
112
 
109
113
  delete requestHeaders['content-length'];
@@ -27,6 +27,10 @@ export function proxyHttpRequest(req: StringBodyRequest, res: Response, opts: Pr
27
27
  path = path.replace(sourceBasePath, targetBasePath);
28
28
  }
29
29
 
30
+ if (!_.isEmpty(req.query)) {
31
+ path += '?' + new URLSearchParams(req.query as any).toString();
32
+ }
33
+
30
34
  console.log('Proxy request to provider: %s => %s%s [http]', opts.consumerPath, opts.address, path);
31
35
 
32
36
  const reqOpts: SimpleRequest = {