@meshagent/meshagent-ts-auth 0.42.0 → 0.42.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 +8 -0
- package/dist/browser/ma-auth.global.js +50 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [0.42.2]
|
|
2
|
+
- Added `ContainerExitStatus`, `RoomContainerStats`, and published build image metadata to the TypeScript container client models.
|
|
3
|
+
- Added `waitForExitStatus` while keeping `waitForExit` as the exit-code convenience wrapper.
|
|
4
|
+
- Container list parsing now preserves image IDs, runtime stats, and exit-status metadata from API responses.
|
|
5
|
+
|
|
6
|
+
## [0.42.1]
|
|
7
|
+
- Stability
|
|
8
|
+
|
|
1
9
|
## [0.42.0]
|
|
2
10
|
- Added project lookup by key.
|
|
3
11
|
- Container and room APIs now return structured `containerPort`/`hostPort` entries instead of integer port lists, which is a breaking response-shape change.
|
|
@@ -16069,14 +16069,27 @@ ${err.toString()}`);
|
|
|
16069
16069
|
force: params.force ?? false
|
|
16070
16070
|
});
|
|
16071
16071
|
}
|
|
16072
|
-
async
|
|
16072
|
+
async waitForExitStatus(params) {
|
|
16073
16073
|
const output = await this.invoke("wait_for_exit", {
|
|
16074
16074
|
container_id: params.containerId
|
|
16075
16075
|
});
|
|
16076
16076
|
if (!(output instanceof response_1.JsonContent) || !isRecord(output.json)) {
|
|
16077
16077
|
throw this.unexpectedResponseError("wait_for_exit");
|
|
16078
16078
|
}
|
|
16079
|
-
|
|
16079
|
+
const exitCode = readIntegerField(output.json, "exit_code", "wait_for_exit");
|
|
16080
|
+
const reason = output.json["reason"];
|
|
16081
|
+
const message2 = output.json["message"];
|
|
16082
|
+
const oomKilled = output.json["oom_killed"];
|
|
16083
|
+
return {
|
|
16084
|
+
exitCode,
|
|
16085
|
+
reason: typeof reason === "string" ? reason : void 0,
|
|
16086
|
+
message: typeof message2 === "string" ? message2 : void 0,
|
|
16087
|
+
oomKilled: typeof oomKilled === "boolean" ? oomKilled : void 0
|
|
16088
|
+
};
|
|
16089
|
+
}
|
|
16090
|
+
async waitForExit(params) {
|
|
16091
|
+
const status = await this.waitForExitStatus(params);
|
|
16092
|
+
return status.exitCode;
|
|
16080
16093
|
}
|
|
16081
16094
|
async deleteContainer(params) {
|
|
16082
16095
|
await this.invoke("delete_container", {
|
|
@@ -16328,8 +16341,11 @@ ${err.toString()}`);
|
|
|
16328
16341
|
throw this.unexpectedResponseError("list");
|
|
16329
16342
|
}
|
|
16330
16343
|
const nameRaw = entry["name"];
|
|
16344
|
+
const imageIdRaw = entry["image_id"];
|
|
16331
16345
|
const portsRaw = entry["ports"];
|
|
16332
16346
|
const serviceIdRaw = entry["service_id"];
|
|
16347
|
+
const statsRaw = entry["stats"];
|
|
16348
|
+
const exitStatusRaw = entry["exit_status"];
|
|
16333
16349
|
if (!Array.isArray(portsRaw) || !portsRaw.every((port) => {
|
|
16334
16350
|
if (!isRecord(port)) {
|
|
16335
16351
|
return false;
|
|
@@ -16342,9 +16358,38 @@ ${err.toString()}`);
|
|
|
16342
16358
|
containerPort: port["container_port"],
|
|
16343
16359
|
hostPort: port["host_port"]
|
|
16344
16360
|
}));
|
|
16361
|
+
let stats;
|
|
16362
|
+
if (isRecord(statsRaw)) {
|
|
16363
|
+
const cpuUsageNanoCores = statsRaw["cpu_usage_nano_cores"];
|
|
16364
|
+
const memoryUsageBytes = statsRaw["memory_usage_bytes"];
|
|
16365
|
+
const memoryWorkingSetBytes = statsRaw["memory_working_set_bytes"];
|
|
16366
|
+
const timestampNs = statsRaw["timestamp_ns"];
|
|
16367
|
+
stats = {
|
|
16368
|
+
cpuUsageNanoCores: typeof cpuUsageNanoCores === "number" ? cpuUsageNanoCores : void 0,
|
|
16369
|
+
memoryUsageBytes: typeof memoryUsageBytes === "number" ? memoryUsageBytes : void 0,
|
|
16370
|
+
memoryWorkingSetBytes: typeof memoryWorkingSetBytes === "number" ? memoryWorkingSetBytes : void 0,
|
|
16371
|
+
timestampNs: typeof timestampNs === "number" ? timestampNs : void 0
|
|
16372
|
+
};
|
|
16373
|
+
}
|
|
16374
|
+
let exitStatus;
|
|
16375
|
+
if (isRecord(exitStatusRaw)) {
|
|
16376
|
+
const exitCode = exitStatusRaw["exit_code"];
|
|
16377
|
+
if (typeof exitCode === "number" && Number.isInteger(exitCode)) {
|
|
16378
|
+
const reason = exitStatusRaw["reason"];
|
|
16379
|
+
const message2 = exitStatusRaw["message"];
|
|
16380
|
+
const oomKilled = exitStatusRaw["oom_killed"];
|
|
16381
|
+
exitStatus = {
|
|
16382
|
+
exitCode,
|
|
16383
|
+
reason: typeof reason === "string" ? reason : void 0,
|
|
16384
|
+
message: typeof message2 === "string" ? message2 : void 0,
|
|
16385
|
+
oomKilled: typeof oomKilled === "boolean" ? oomKilled : void 0
|
|
16386
|
+
};
|
|
16387
|
+
}
|
|
16388
|
+
}
|
|
16345
16389
|
items.push({
|
|
16346
16390
|
id,
|
|
16347
16391
|
image,
|
|
16392
|
+
imageId: typeof imageIdRaw === "string" ? imageIdRaw : void 0,
|
|
16348
16393
|
name: typeof nameRaw === "string" ? nameRaw : void 0,
|
|
16349
16394
|
ports,
|
|
16350
16395
|
startedBy: {
|
|
@@ -16353,7 +16398,9 @@ ${err.toString()}`);
|
|
|
16353
16398
|
},
|
|
16354
16399
|
state,
|
|
16355
16400
|
private: privateFlag,
|
|
16356
|
-
serviceId: typeof serviceIdRaw === "string" ? serviceIdRaw : void 0
|
|
16401
|
+
serviceId: typeof serviceIdRaw === "string" ? serviceIdRaw : void 0,
|
|
16402
|
+
stats,
|
|
16403
|
+
exitStatus
|
|
16357
16404
|
});
|
|
16358
16405
|
}
|
|
16359
16406
|
return items;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meshagent/meshagent-ts-auth",
|
|
3
|
-
"version": "0.42.
|
|
3
|
+
"version": "0.42.2",
|
|
4
4
|
"description": "Meshagent Typescript Auth",
|
|
5
5
|
"homepage": "https://github.com/meshagent/meshagent-ts-auth",
|
|
6
6
|
"scripts": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"CHANGELOG.md"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@meshagent/meshagent": "^0.42.
|
|
42
|
+
"@meshagent/meshagent": "^0.42.2",
|
|
43
43
|
"typescript": "^5.8.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|