@adobe/spacecat-shared-utils 1.51.1 → 1.52.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 +7 -0
- package/package.json +1 -1
- package/src/index.d.ts +3 -0
- package/src/llmo-config.js +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-utils-v1.52.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.51.1...@adobe/spacecat-shared-utils-v1.52.0) (2025-09-29)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* llmo config types and version ([#990](https://github.com/adobe/spacecat-shared/issues/990)) ([2dfe331](https://github.com/adobe/spacecat-shared/commit/2dfe33156754f044b6e9ff18d32e13baabaa47f1))
|
|
7
|
+
|
|
1
8
|
# [@adobe/spacecat-shared-utils-v1.51.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.51.0...@adobe/spacecat-shared-utils-v1.51.1) (2025-09-25)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -262,3 +262,6 @@ export function tracingFetch(url: string | Request, options?: RequestOptions): P
|
|
|
262
262
|
export const SPACECAT_USER_AGENT: string;
|
|
263
263
|
|
|
264
264
|
export function retrievePageAuthentication(site: object, context: object): Promise<string>;
|
|
265
|
+
|
|
266
|
+
export * as llmoConfig from './llmo-config.js';
|
|
267
|
+
export * as schemas from './schemas.js';
|
package/src/llmo-config.js
CHANGED
|
@@ -60,8 +60,8 @@ export function defaultConfig() {
|
|
|
60
60
|
* @param {string} [options.version] Optional version ID of the configuration to read.
|
|
61
61
|
* Defaults to the latest version.
|
|
62
62
|
* @param {string} [options.s3Bucket] Optional S3 bucket name.
|
|
63
|
-
* @returns {Promise<{config: LLMOConfig, exists: boolean}>} The configuration
|
|
64
|
-
* a flag indicating if it existed.
|
|
63
|
+
* @returns {Promise<{config: LLMOConfig, exists: boolean, version?: string}>} The configuration,
|
|
64
|
+
* a flag indicating if it existed, and the version ID if it exists.
|
|
65
65
|
* @throws {Error} If reading the configuration fails for reasons other than it not existing.
|
|
66
66
|
*/
|
|
67
67
|
export async function readConfig(sideId, s3Client, options) {
|
|
@@ -79,7 +79,7 @@ export async function readConfig(sideId, s3Client, options) {
|
|
|
79
79
|
} catch (e) {
|
|
80
80
|
if (e.name === 'NoSuchKey' || e.name === 'NotFound') {
|
|
81
81
|
// Config does not exist yet. Return empty config.
|
|
82
|
-
return { config: defaultConfig(), exists: false };
|
|
82
|
+
return { config: defaultConfig(), exists: false, version: undefined };
|
|
83
83
|
}
|
|
84
84
|
throw e;
|
|
85
85
|
}
|
|
@@ -90,7 +90,7 @@ export async function readConfig(sideId, s3Client, options) {
|
|
|
90
90
|
}
|
|
91
91
|
const text = await body.transformToString();
|
|
92
92
|
const config = llmoConfig.parse(JSON.parse(text));
|
|
93
|
-
return { config, exists: true };
|
|
93
|
+
return { config, exists: true, version: res.VersionId || undefined };
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
/**
|