Skip to content

Commit c0a659f

Browse files
committed
typescript 1.0.3
1 parent cf48572 commit c0a659f

File tree

4 files changed

+26
-20
lines changed

4 files changed

+26
-20
lines changed

ts/package/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ts/package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openmesh-network/xnode-manager-sdk",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/Openmesh-Network/xnode-manager-sdk.git"

ts/package/src/config/handlers.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as rust from "../utils/rust-types.js";
22

33
import type { RequestIdResponse } from "../request/models.js";
44
import { SessionGet, SessionPost, type Sessioned } from "../utils/session.js";
5-
import type { ContainerConfiguration, ConfigurationAction } from "./models.js";
5+
import type { ContainerChange, ContainerConfiguration } from "./models.js";
66

77
export function scope() {
88
return "/config";
@@ -27,9 +27,24 @@ export async function container(
2727
}
2828

2929
export type change_input = Sessioned<{
30-
data: rust.Vec<ConfigurationAction>;
30+
path: { container: rust.String };
31+
data: ContainerChange;
3132
}>;
3233
export type change_output = RequestIdResponse;
3334
export async function change(input: change_input): Promise<change_output> {
34-
return SessionPost(input, scope(), "/change");
35+
return SessionPost(
36+
input,
37+
scope(),
38+
(path) => `/container/${path.container}/change`
39+
);
40+
}
41+
42+
export type delete_input = Sessioned<{ path: { container: rust.String } }>;
43+
export type delete_output = RequestIdResponse;
44+
export async function delete_(input: delete_input): Promise<delete_output> {
45+
return SessionPost(
46+
input,
47+
scope(),
48+
(path) => `/container/${path.container}/delete`
49+
);
3550
}

ts/package/src/config/models.ts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as rust from "../utils/rust-types.js";
22

33
export interface ContainerConfiguration {
44
flake: rust.String;
5-
flake_lock: rust.String;
5+
flake_lock: rust.Option<rust.String>;
66
network: rust.Option<rust.String>;
77
}
88

@@ -11,16 +11,7 @@ export interface ContainerSettings {
1111
network: rust.Option<rust.String>;
1212
}
1313

14-
export type ConfigurationAction =
15-
| {
16-
Set: {
17-
container: rust.String;
18-
settings: ContainerSettings;
19-
update_inputs: rust.Option<rust.Vec<rust.String>>;
20-
};
21-
}
22-
| {
23-
Remove: {
24-
container: rust.String;
25-
};
26-
};
14+
export interface ContainerChange {
15+
settings: ContainerSettings;
16+
update_inputs: rust.Option<rust.Vec<rust.String>>;
17+
}

0 commit comments

Comments
 (0)