Skip to content

Commit 2e641c6

Browse files
committed
typescript 1.0.2
1 parent a9c74e7 commit 2e641c6

File tree

9 files changed

+50
-29
lines changed

9 files changed

+50
-29
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.1",
3+
"version": "1.0.2",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/Openmesh-Network/xnode-manager-sdk.git"

ts/package/src/file/handlers.ts

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,59 +17,51 @@ export function scope() {
1717
}
1818

1919
export type read_file_input = Sessioned<{
20-
path: { container: rust.String };
20+
path: { scope: rust.String };
2121
query: ReadFile;
2222
}>;
2323
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.container}`);
27+
return SessionGet(input, scope(), (path) => `/read_file/${path.scope}`);
2828
}
2929

3030
export type write_file_input = Sessioned<{
31-
path: { container: rust.String };
31+
path: { scope: rust.String };
3232
data: WriteFile;
3333
}>;
3434
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.container}`);
38+
return SessionPost(input, scope(), (path) => `/write_file/${path.scope}`);
3939
}
4040

4141
export type remove_file_input = Sessioned<{
42-
path: { container: rust.String };
42+
path: { scope: rust.String };
4343
data: RemoveFile;
4444
}>;
4545
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(
50-
input,
51-
scope(),
52-
(path) => `/remove_file/${path.container}`
53-
);
49+
return SessionPost(input, scope(), (path) => `/remove_file/${path.scope}`);
5450
}
5551

5652
export type read_directory_input = Sessioned<{
57-
path: { container: rust.String };
53+
path: { scope: rust.String };
5854
query: ReadDirectory;
5955
}>;
6056
export type read_directory_output = Directory;
6157
export async function read_directory(
6258
input: read_directory_input
6359
): Promise<read_directory_output> {
64-
return SessionGet(
65-
input,
66-
scope(),
67-
(path) => `/read_directory/${path.container}`
68-
);
60+
return SessionGet(input, scope(), (path) => `/read_directory/${path.scope}`);
6961
}
7062

7163
export type create_directory_input = Sessioned<{
72-
path: { container: rust.String };
64+
path: { scope: rust.String };
7365
data: CreateDirectory;
7466
}>;
7567
export type create_directory_output = void;
@@ -79,12 +71,12 @@ export async function create_directory(
7971
return SessionPost(
8072
input,
8173
scope(),
82-
(path) => `/create_directory/${path.container}`
74+
(path) => `/create_directory/${path.scope}`
8375
);
8476
}
8577

8678
export type remove_directory_input = Sessioned<{
87-
path: { container: rust.String };
79+
path: { scope: rust.String };
8880
data: RemoveDirectory;
8981
}>;
9082
export type remove_directory_output = void;
@@ -94,6 +86,6 @@ export async function remove_directory(
9486
return SessionPost(
9587
input,
9688
scope(),
97-
(path) => `/remove_directory/${path.container}`
89+
(path) => `/remove_directory/${path.scope}`
9890
);
9991
}

ts/package/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export * as auth from "./auth/index.js";
22
export * as config from "./config/index.js";
33
export * as file from "./file/index.js";
4+
export * as info from "./info/index.js";
45
export * as os from "./os/index.js";
56
export * as process from "./process/index.js";
67
export * as request from "./request/index.js";

ts/package/src/info/handlers.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import * as rust from "../utils/rust-types.js";
2+
3+
import type { Flake } from "./models.js";
4+
import { SessionGet, type Sessioned } from "../utils/session.js";
5+
6+
export function scope() {
7+
return "/info";
8+
}
9+
10+
export type flake_input = Sessioned<{ query: { flake: rust.String } }>;
11+
export type flake_output = Flake;
12+
export async function flake(input: flake_input): Promise<flake_output> {
13+
return SessionGet(input, scope(), "/flake");
14+
}

ts/package/src/info/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from "./handlers.js";
2+
export * from "./models.js";

ts/package/src/info/models.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import * as rust from "../utils/rust-types.js";
2+
3+
export interface Flake {
4+
last_modified: rust.u64;
5+
revision: rust.String;
6+
}

ts/package/src/os/handlers.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,9 @@ export type set_output = RequestIdResponse;
1717
export async function set(input: set_input): Promise<set_output> {
1818
return SessionPost(input, scope(), "/set");
1919
}
20+
21+
export type reboot_input = Sessioned<{}>;
22+
export type reboot_output = RequestIdResponse;
23+
export async function reboot(input: reboot_input): Promise<reboot_output> {
24+
return SessionPost(input, scope(), "/reboot");
25+
}

ts/package/src/process/handlers.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,34 @@ export function scope() {
88
return "/process";
99
}
1010

11-
export type list_input = Sessioned<{ path: { container: rust.String } }>;
11+
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.container}`);
14+
return SessionGet(input, scope(), (path) => `/list/${path.scope}`);
1515
}
1616

1717
export type logs_input = Sessioned<{
18-
path: { container: rust.String; process: rust.String };
18+
path: { scope: rust.String; process: rust.String };
1919
query: LogQuery;
2020
}>;
2121
export type logs_output = Log[];
2222
export async function logs(input: logs_input): Promise<logs_output> {
2323
return SessionGet(
2424
input,
2525
scope(),
26-
(path) => `/logs/${path.container}/${path.process}`
26+
(path) => `/logs/${path.scope}/${path.process}`
2727
);
2828
}
2929

3030
export type execute_input = Sessioned<{
31-
path: { container: rust.String; process: rust.String };
31+
path: { scope: rust.String; process: rust.String };
3232
data: ProcessCommand;
3333
}>;
3434
export type execute_output = RequestIdResponse;
3535
export async function execute(input: execute_input): Promise<execute_output> {
3636
return SessionPost(
3737
input,
3838
scope(),
39-
(path) => `/execute/${path.container}/${path.process}`
39+
(path) => `/execute/${path.scope}/${path.process}`
4040
);
4141
}

0 commit comments

Comments
 (0)