Skip to content

Commit 8cef378

Browse files
committed
typescript 1.0.5
1 parent 34c89af commit 8cef378

File tree

7 files changed

+128
-126
lines changed

7 files changed

+128
-126
lines changed

ts/package/package-lock.json

Lines changed: 94 additions & 94 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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openmesh-network/xnode-manager-sdk",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/Openmesh-Network/xnode-manager-sdk.git"
@@ -25,12 +25,12 @@
2525
}
2626
},
2727
"devDependencies": {
28-
"@types/node": "^24.0.3",
28+
"@types/node": "^24.0.4",
2929
"@typescript-eslint/parser": "^8.35.0",
3030
"eslint": "^9.29.0",
3131
"eslint-config-prettier": "^10.1.5",
32-
"prettier": "^3.6.0",
33-
"rollup": "^4.44.0",
32+
"prettier": "^3.6.1",
33+
"rollup": "^4.44.1",
3434
"rollup-plugin-dts": "^6.2.1"
3535
}
3636
}

ts/package/src/config/handlers.ts

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,37 @@ export async function containers(
1616
return SessionGet(input, scope(), "/containers");
1717
}
1818

19-
export type container_input = Sessioned<{
19+
export type get_input = Sessioned<{
2020
path: { container: rust.String };
2121
}>;
22-
export type container_output = ContainerConfiguration;
23-
export async function container(
24-
input: container_input
25-
): Promise<container_output> {
26-
return SessionGet(input, scope(), (path) => `/container/${path.container}`);
22+
export type get_output = ContainerConfiguration;
23+
export async function get(input: get_input): Promise<get_output> {
24+
return SessionGet(
25+
input,
26+
scope(),
27+
(path) => `/container/${path.container}/get`
28+
);
2729
}
2830

29-
export type change_input = Sessioned<{
31+
export type set_input = Sessioned<{
3032
path: { container: rust.String };
3133
data: ContainerChange;
3234
}>;
33-
export type change_output = RequestIdResponse;
34-
export async function change(input: change_input): Promise<change_output> {
35+
export type set_output = RequestIdResponse;
36+
export async function set(input: set_input): Promise<set_output> {
3537
return SessionPost(
3638
input,
3739
scope(),
38-
(path) => `/container/${path.container}/change`
40+
(path) => `/container/${path.container}/set`
3941
);
4042
}
4143

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> {
44+
export type remove_input = Sessioned<{ path: { container: rust.String } }>;
45+
export type remove_output = RequestIdResponse;
46+
export async function remove(input: remove_input): Promise<remove_output> {
4547
return SessionPost(
4648
input,
4749
scope(),
48-
(path) => `/container/${path.container}/delete`
50+
(path) => `/container/${path.container}/remove`
4951
);
5052
}

ts/package/src/file/handlers.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export type read_file_output = File;
2424
export async function read_file(
2525
input: read_file_input
2626
): Promise<read_file_output> {
27-
return SessionGet(input, scope(), (path) => `/read_file/${path.scope}`);
27+
return SessionGet(input, scope(), (path) => `/${path.scope}/read_file`);
2828
}
2929

3030
export type write_file_input = Sessioned<{
@@ -35,7 +35,7 @@ export type write_file_output = void;
3535
export async function write_file(
3636
input: write_file_input
3737
): Promise<write_file_output> {
38-
return SessionPost(input, scope(), (path) => `/write_file/${path.scope}`);
38+
return SessionPost(input, scope(), (path) => `/${path.scope}/write_file`);
3939
}
4040

4141
export type remove_file_input = Sessioned<{
@@ -46,7 +46,7 @@ export type remove_file_output = void;
4646
export async function remove_file(
4747
input: remove_file_input
4848
): Promise<remove_file_output> {
49-
return SessionPost(input, scope(), (path) => `/remove_file/${path.scope}`);
49+
return SessionPost(input, scope(), (path) => `/${path.scope}/remove_file`);
5050
}
5151

5252
export type read_directory_input = Sessioned<{
@@ -57,7 +57,7 @@ export type read_directory_output = Directory;
5757
export async function read_directory(
5858
input: read_directory_input
5959
): Promise<read_directory_output> {
60-
return SessionGet(input, scope(), (path) => `/read_directory/${path.scope}`);
60+
return SessionGet(input, scope(), (path) => `/${path.scope}/read_directory`);
6161
}
6262

6363
export type create_directory_input = Sessioned<{
@@ -71,7 +71,7 @@ export async function create_directory(
7171
return SessionPost(
7272
input,
7373
scope(),
74-
(path) => `/create_directory/${path.scope}`
74+
(path) => `/${path.scope}/create_directory`
7575
);
7676
}
7777

@@ -86,6 +86,6 @@ export async function remove_directory(
8686
return SessionPost(
8787
input,
8888
scope(),
89-
(path) => `/remove_directory/${path.scope}`
89+
(path) => `/${path.scope}/remove_directory`
9090
);
9191
}

ts/package/src/process/handlers.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function scope() {
1111
export type list_input = Sessioned<{ path: { scope: rust.String } }>;
1212
export type list_output = Process[];
1313
export async function list(input: list_input): Promise<list_output> {
14-
return SessionGet(input, scope(), (path) => `/list/${path.scope}`);
14+
return SessionGet(input, scope(), (path) => `/${path.scope}/list`);
1515
}
1616

1717
export type logs_input = Sessioned<{
@@ -23,7 +23,7 @@ export async function logs(input: logs_input): Promise<logs_output> {
2323
return SessionGet(
2424
input,
2525
scope(),
26-
(path) => `/logs/${path.scope}/${path.process}`
26+
(path) => `/${path.scope}/${path.process}/logs`
2727
);
2828
}
2929

@@ -36,6 +36,6 @@ export async function execute(input: execute_input): Promise<execute_output> {
3636
return SessionPost(
3737
input,
3838
scope(),
39-
(path) => `/execute/${path.scope}/${path.process}`
39+
(path) => `/${path.scope}/${path.process}/execute`
4040
);
4141
}

ts/package/src/request/handlers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export async function request_info(
1717
return SessionGet<request_info_output, request_info_input["path"]>(
1818
input,
1919
scope(),
20-
(path) => `/info/${path.request_id}`
20+
(path) => `/${path.request_id}/info`
2121
).then((data) => {
2222
return { ...data, commands: data.commands.sort() };
2323
});
@@ -33,6 +33,6 @@ export async function command_info(
3333
return SessionGet(
3434
input,
3535
scope(),
36-
(path) => `/info/${path.request_id}/${path.command}`
36+
(path) => `/${path.request_id}/command/${path.command}/info`
3737
);
3838
}

ts/package/src/usage/handlers.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ export function scope() {
88
export type cpu_input = Sessioned<{}>;
99
export type cpu_output = CpuUsage[];
1010
export async function cpu(input: cpu_input): Promise<cpu_output> {
11-
return SessionGet(input, scope(), "/cpu");
11+
return SessionGet(input, scope(), "/host/cpu");
1212
}
1313

1414
export type memory_input = Sessioned<{}>;
1515
export type memory_output = MemoryUsage;
1616
export async function memory(input: memory_input): Promise<memory_output> {
17-
return SessionGet(input, scope(), "/memory");
17+
return SessionGet(input, scope(), "/host/memory");
1818
}
1919

2020
export type disk_input = Sessioned<{}>;
2121
export type disk_output = DiskUsage[];
2222
export async function disk(input: disk_input): Promise<disk_output> {
23-
return SessionGet<disk_output>(input, scope(), "/disk").then((data) =>
23+
return SessionGet<disk_output>(input, scope(), "/host/disk").then((data) =>
2424
data.filter((d) => d.mount_point.startsWith("/mnt"))
2525
);
2626
}

0 commit comments

Comments
 (0)