@kapeta/local-cluster-service 0.70.9 → 0.70.11

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.70.11](https://github.com/kapetacom/local-cluster-service/compare/v0.70.10...v0.70.11) (2024-09-12)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * CORE-3456 make the prompt shorter ([8292ccf](https://github.com/kapetacom/local-cluster-service/commit/8292ccf59213c2db606d23b573bea90e7e870ef3))
7
+
8
+ ## [0.70.10](https://github.com/kapetacom/local-cluster-service/compare/v0.70.9...v0.70.10) (2024-09-12)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Bug in argument ordering ([#248](https://github.com/kapetacom/local-cluster-service/issues/248)) ([a092a4c](https://github.com/kapetacom/local-cluster-service/commit/a092a4cdd727631943b3d81a552e55e68ca44c88))
14
+
1
15
  ## [0.70.9](https://github.com/kapetacom/local-cluster-service/compare/v0.70.8...v0.70.9) (2024-09-12)
2
16
 
3
17
 
@@ -78,7 +78,7 @@ class PageQueue extends node_events_1.EventEmitter {
78
78
  //console.log('Ignoring duplicate prompt', initialPrompt.path);
79
79
  return true;
80
80
  }
81
- if ((0, page_utils_1.hasPageOnDisk)(this.systemId, 'GET', path)) {
81
+ if ((0, page_utils_1.hasPageOnDisk)(this.systemId, path, 'GET')) {
82
82
  //console.log('Ignoring prompt with existing page', initialPrompt.path);
83
83
  return true;
84
84
  }
@@ -241,8 +241,7 @@ class PageQueue extends node_events_1.EventEmitter {
241
241
  return;
242
242
  }
243
243
  this.images.set(prompt.url, prompt.description);
244
- const prefix = this.getPrefix();
245
- const result = await stormClient_1.stormClient.createImage(prefix + `Create an image for the url "${prompt.url}" with this description: ${prompt.description}`.trim());
244
+ const result = await stormClient_1.stormClient.createImage(`Create an image for the url "${prompt.url}" with this description: ${prompt.description}`.trim());
246
245
  //console.log('Adding image prompt', prompt);
247
246
  result.on('data', (event) => {
248
247
  if (event.type === 'IMAGE') {
@@ -17,7 +17,7 @@ export declare function writeAssetToDisk(systemId: string, event: StormEventFile
17
17
  export declare function writeImageToDisk(systemId: string, event: StormImage, prompt: ImagePrompt): Promise<{
18
18
  path: string;
19
19
  }>;
20
- export declare function hasPageOnDisk(systemId: string, method: string, path: string): boolean;
20
+ export declare function hasPageOnDisk(systemId: string, path: string, method: string): boolean;
21
21
  export declare function getSystemBaseDir(systemId: string): string;
22
22
  export declare function getSystemBaseImplDir(systemId: string): string;
23
23
  export declare function resolveReadPath(systemId: string, path: string, method: string): string | null;
@@ -54,8 +54,9 @@ async function writeImageToDisk(systemId, event, prompt) {
54
54
  };
55
55
  }
56
56
  exports.writeImageToDisk = writeImageToDisk;
57
- function hasPageOnDisk(systemId, method, path) {
58
- const fullPath = resolveReadPath(systemId, method, path);
57
+ function hasPageOnDisk(systemId, path, method) {
58
+ const fullPath = resolveReadPath(systemId, path, method);
59
+ console.log('Checking for page on disk:', fullPath);
59
60
  return !!fullPath && fs_extra_1.default.existsSync(fullPath);
60
61
  }
61
62
  exports.hasPageOnDisk = hasPageOnDisk;
@@ -78,7 +78,7 @@ class PageQueue extends node_events_1.EventEmitter {
78
78
  //console.log('Ignoring duplicate prompt', initialPrompt.path);
79
79
  return true;
80
80
  }
81
- if ((0, page_utils_1.hasPageOnDisk)(this.systemId, 'GET', path)) {
81
+ if ((0, page_utils_1.hasPageOnDisk)(this.systemId, path, 'GET')) {
82
82
  //console.log('Ignoring prompt with existing page', initialPrompt.path);
83
83
  return true;
84
84
  }
@@ -241,8 +241,7 @@ class PageQueue extends node_events_1.EventEmitter {
241
241
  return;
242
242
  }
243
243
  this.images.set(prompt.url, prompt.description);
244
- const prefix = this.getPrefix();
245
- const result = await stormClient_1.stormClient.createImage(prefix + `Create an image for the url "${prompt.url}" with this description: ${prompt.description}`.trim());
244
+ const result = await stormClient_1.stormClient.createImage(`Create an image for the url "${prompt.url}" with this description: ${prompt.description}`.trim());
246
245
  //console.log('Adding image prompt', prompt);
247
246
  result.on('data', (event) => {
248
247
  if (event.type === 'IMAGE') {
@@ -17,7 +17,7 @@ export declare function writeAssetToDisk(systemId: string, event: StormEventFile
17
17
  export declare function writeImageToDisk(systemId: string, event: StormImage, prompt: ImagePrompt): Promise<{
18
18
  path: string;
19
19
  }>;
20
- export declare function hasPageOnDisk(systemId: string, method: string, path: string): boolean;
20
+ export declare function hasPageOnDisk(systemId: string, path: string, method: string): boolean;
21
21
  export declare function getSystemBaseDir(systemId: string): string;
22
22
  export declare function getSystemBaseImplDir(systemId: string): string;
23
23
  export declare function resolveReadPath(systemId: string, path: string, method: string): string | null;
@@ -54,8 +54,9 @@ async function writeImageToDisk(systemId, event, prompt) {
54
54
  };
55
55
  }
56
56
  exports.writeImageToDisk = writeImageToDisk;
57
- function hasPageOnDisk(systemId, method, path) {
58
- const fullPath = resolveReadPath(systemId, method, path);
57
+ function hasPageOnDisk(systemId, path, method) {
58
+ const fullPath = resolveReadPath(systemId, path, method);
59
+ console.log('Checking for page on disk:', fullPath);
59
60
  return !!fullPath && fs_extra_1.default.existsSync(fullPath);
60
61
  }
61
62
  exports.hasPageOnDisk = hasPageOnDisk;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kapeta/local-cluster-service",
3
- "version": "0.70.9",
3
+ "version": "0.70.11",
4
4
  "description": "Manages configuration, ports and service discovery for locally running Kapeta systems",
5
5
  "type": "commonjs",
6
6
  "exports": {
@@ -81,7 +81,7 @@ export class PageQueue extends EventEmitter {
81
81
  return true;
82
82
  }
83
83
 
84
- if (hasPageOnDisk(this.systemId, 'GET', path)) {
84
+ if (hasPageOnDisk(this.systemId, path, 'GET')) {
85
85
  //console.log('Ignoring prompt with existing page', initialPrompt.path);
86
86
  return true;
87
87
  }
@@ -266,9 +266,8 @@ export class PageQueue extends EventEmitter {
266
266
  }
267
267
 
268
268
  this.images.set(prompt.url, prompt.description);
269
- const prefix = this.getPrefix();
270
269
  const result = await stormClient.createImage(
271
- prefix + `Create an image for the url "${prompt.url}" with this description: ${prompt.description}`.trim()
270
+ `Create an image for the url "${prompt.url}" with this description: ${prompt.description}`.trim()
272
271
  );
273
272
 
274
273
  //console.log('Adding image prompt', prompt);
@@ -69,8 +69,9 @@ export async function writeImageToDisk(systemId: string, event: StormImage, prom
69
69
  };
70
70
  }
71
71
 
72
- export function hasPageOnDisk(systemId: string, method: string, path: string) {
73
- const fullPath = resolveReadPath(systemId, method, path);
72
+ export function hasPageOnDisk(systemId: string, path: string, method: string) {
73
+ const fullPath = resolveReadPath(systemId, path, method);
74
+ console.log('Checking for page on disk:', fullPath);
74
75
  return !!fullPath && FS.existsSync(fullPath);
75
76
  }
76
77