attlaz-client 1.56.0 → 1.58.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/dist/Model/Infrastructure/RunnerPool.d.ts +9 -0
- package/dist/Model/Infrastructure/RunnerPool.js +39 -10
- package/dist/Model/InfrastructureStatus/StorageStatus.d.ts +1 -1
- package/dist/Model/Storage/StorageInformation.d.ts +1 -1
- package/dist/Model/Storage/StorageInformation.js +1 -0
- package/dist/Service/ConfigurationEndpoint.d.ts +11 -0
- package/dist/Service/ConfigurationEndpoint.js +13 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
|
@@ -9,6 +9,15 @@ export declare class RunnerPool {
|
|
|
9
9
|
configuration: RunnerPoolConfiguration;
|
|
10
10
|
state: State;
|
|
11
11
|
static parse(raw: any): RunnerPool;
|
|
12
|
+
/**
|
|
13
|
+
* Coerce a raw wire value into a ResolvedValue<T> envelope. Accepts `{value, source}`
|
|
14
|
+
* as-is; falls back to `{value: defaultValue, source: null}` when the input is null,
|
|
15
|
+
* undefined, or missing the envelope shape, and appends the field name to `missing`
|
|
16
|
+
* so the caller can log a single batched warning. The `value` itself isn't type-
|
|
17
|
+
* validated — if T is `string | null` and the server sends a number, that's a
|
|
18
|
+
* server-side bug, not something this layer can fix.
|
|
19
|
+
*/
|
|
20
|
+
private static parseResolved;
|
|
12
21
|
}
|
|
13
22
|
export type QueueSpecificationType = 'flow_run';
|
|
14
23
|
export type ConfigurationSource = 'RunnerPool' | 'ProjectEnvironment' | 'Workspace' | 'Zone';
|
|
@@ -30,19 +30,48 @@ export class RunnerPool {
|
|
|
30
30
|
queueSpecification.queueIdentifier = raw.queue_identifier;
|
|
31
31
|
queueSpecification.deploymentIdentifier = raw.deployment_identifier;
|
|
32
32
|
queueSpecification.type = raw.type;
|
|
33
|
+
// Per-field defensive parsing. Each entry falls back to a default ResolvedValue
|
|
34
|
+
// if the server didn't send it or sent a malformed shape — keeps the UI alive
|
|
35
|
+
// when wire contracts drift (e.g. the API auto-strips `_id` so `image_id` arrives
|
|
36
|
+
// as `image`; we hit that 2026-05-17). Missing/malformed fields are collected and
|
|
37
|
+
// logged together as a single console.warn so server-side regressions stay visible.
|
|
38
|
+
const config = raw.configuration ?? {};
|
|
39
|
+
const missing = [];
|
|
40
|
+
if (raw.configuration === undefined || raw.configuration === null) {
|
|
41
|
+
missing.push('(entire configuration object)');
|
|
42
|
+
}
|
|
33
43
|
queueSpecification.configuration = {
|
|
34
|
-
enabled:
|
|
35
|
-
minRunners:
|
|
36
|
-
maxRunners:
|
|
37
|
-
cpuLimit:
|
|
38
|
-
memoryLimit:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
enabled: RunnerPool.parseResolved(config.enabled, false, 'enabled', missing),
|
|
45
|
+
minRunners: RunnerPool.parseResolved(config.min_runners, 0, 'min_runners', missing),
|
|
46
|
+
maxRunners: RunnerPool.parseResolved(config.max_runners, 0, 'max_runners', missing),
|
|
47
|
+
cpuLimit: RunnerPool.parseResolved(config.cpu_limit, null, 'cpu_limit', missing),
|
|
48
|
+
memoryLimit: RunnerPool.parseResolved(config.memory_limit, null, 'memory_limit', missing),
|
|
49
|
+
// API strips `_id` suffix from snake_case keys, so `image_id` → `image` on the wire.
|
|
50
|
+
imageId: RunnerPool.parseResolved(config.image, null, 'image', missing),
|
|
51
|
+
runnerEndpoint: RunnerPool.parseResolved(config.runner_endpoint, null, 'runner_endpoint', missing),
|
|
52
|
+
runnerTokenId: RunnerPool.parseResolved(config.runner_token, null, 'runner_token', missing),
|
|
53
|
+
codeEndpoint: RunnerPool.parseResolved(config.code_endpoint, null, 'code_endpoint', missing),
|
|
54
|
+
codeTokenId: RunnerPool.parseResolved(config.code_token, null, 'code_token', missing),
|
|
44
55
|
};
|
|
56
|
+
if (missing.length > 0) {
|
|
57
|
+
console.warn('RunnerPool.parse: pool "' + queueSpecification.id + '" has missing or malformed configuration fields', { fields: missing });
|
|
58
|
+
}
|
|
45
59
|
queueSpecification.state = State.fromString(raw.state);
|
|
46
60
|
return queueSpecification;
|
|
47
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Coerce a raw wire value into a ResolvedValue<T> envelope. Accepts `{value, source}`
|
|
64
|
+
* as-is; falls back to `{value: defaultValue, source: null}` when the input is null,
|
|
65
|
+
* undefined, or missing the envelope shape, and appends the field name to `missing`
|
|
66
|
+
* so the caller can log a single batched warning. The `value` itself isn't type-
|
|
67
|
+
* validated — if T is `string | null` and the server sends a number, that's a
|
|
68
|
+
* server-side bug, not something this layer can fix.
|
|
69
|
+
*/
|
|
70
|
+
static parseResolved(raw, defaultValue, fieldName, missing) {
|
|
71
|
+
if (raw !== null && typeof raw === 'object' && 'value' in raw && 'source' in raw) {
|
|
72
|
+
return raw;
|
|
73
|
+
}
|
|
74
|
+
missing.push(fieldName);
|
|
75
|
+
return { value: defaultValue, source: null };
|
|
76
|
+
}
|
|
48
77
|
}
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
import { Configuration } from '../Model/Configuration/Configuration.js';
|
|
2
2
|
import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
|
|
3
3
|
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
4
|
+
import { ObjectResult } from '../Model/Result/ObjectResult.js';
|
|
4
5
|
import { Endpoint } from './Endpoint.js';
|
|
5
6
|
export declare class ConfigurationEndpoint extends Endpoint {
|
|
6
7
|
getByPath(scopeId: string, path: string): Promise<Configuration | null>;
|
|
7
8
|
getByPathQuery(scopeId: string, pathQuery: string, pagination: CursorPagination): Promise<CollectionResult<Configuration>>;
|
|
8
9
|
save(scopeId: string, path: string, value: unknown): Promise<CollectionResult<Configuration>>;
|
|
10
|
+
/**
|
|
11
|
+
* Remove a configuration row so resolution falls back to the parent scope.
|
|
12
|
+
* Use this for the "Clear field" / "Inherit from parent" UX action.
|
|
13
|
+
*
|
|
14
|
+
* Distinct from `save(scopeId, path, null)` which keeps an explicit "no value"
|
|
15
|
+
* override at this scope (e.g. for limit fields meaning "no limit").
|
|
16
|
+
*/
|
|
17
|
+
delete(scopeId: string, path: string): Promise<ObjectResult<{
|
|
18
|
+
removed: boolean;
|
|
19
|
+
}>>;
|
|
9
20
|
}
|
|
@@ -37,4 +37,17 @@ export class ConfigurationEndpoint extends Endpoint {
|
|
|
37
37
|
const result = await this.requestCollection(qs, Configuration.parse, { value: value }, 'POST');
|
|
38
38
|
return result;
|
|
39
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Remove a configuration row so resolution falls back to the parent scope.
|
|
42
|
+
* Use this for the "Clear field" / "Inherit from parent" UX action.
|
|
43
|
+
*
|
|
44
|
+
* Distinct from `save(scopeId, path, null)` which keeps an explicit "no value"
|
|
45
|
+
* override at this scope (e.g. for limit fields meaning "no limit").
|
|
46
|
+
*/
|
|
47
|
+
async delete(scopeId, path) {
|
|
48
|
+
const qs = new QueryString('/configurations/' + scopeId);
|
|
49
|
+
qs.set('path', path);
|
|
50
|
+
const result = await this.requestObject(qs, null, (raw) => raw, 'DELETE');
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
40
53
|
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.58.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "1.
|
|
1
|
+
export const VERSION = "1.58.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "attlaz-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.58.0",
|
|
4
4
|
"description": "Javascript Client to access Attlaz API",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@typescript-eslint/eslint-plugin": "^8.1.0",
|
|
55
55
|
"@typescript-eslint/parser": "^8.1.0",
|
|
56
56
|
"eslint": "^9.39.4",
|
|
57
|
-
"eslint-config-attlaz-base": "^1.
|
|
57
|
+
"eslint-config-attlaz-base": "^1.7.1",
|
|
58
58
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
59
59
|
"eslint-plugin-import": "^2.32.0",
|
|
60
60
|
"eslint-plugin-jsdoc": "^62.9.0",
|