tauri-kargo-tools 0.3.4 → 0.3.7
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/package.json +1 -1
- package/src/api.ts +10 -2
- package/src/test/index.ts +2 -0
- package/src/test.ts +1 -1
- package/src/types.ts +15 -0
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -79,7 +79,10 @@ export class TauriKargoClient {
|
|
|
79
79
|
useConfig(body: T.UseConfigReq): Promise<T.UseConfigResp> {
|
|
80
80
|
return this.postJson<T.UseConfigResp>("/api/useConfig", body);
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
/** POST /api/get-config */
|
|
83
|
+
getAllRunStatus(): Promise<T.AllRunStatusResponse> {
|
|
84
|
+
return this.postJson<T.AllRunStatusResponse>("/api/allRunStatus", {});
|
|
85
|
+
}
|
|
83
86
|
/** POST /api/get-config */
|
|
84
87
|
getConfig(): Promise<T.GetConfigResp> {
|
|
85
88
|
return this.postJson<T.GetConfigResp>("/api/get-config", {});
|
|
@@ -91,6 +94,11 @@ export class TauriKargoClient {
|
|
|
91
94
|
setCurrentDirectory(body: T.CurrentDirReq): Promise<T.CurrentDirResp> {
|
|
92
95
|
return this.postJson<T.CurrentDirResp>("/api/current-directory", body);
|
|
93
96
|
}
|
|
97
|
+
/** POST /api/current-directory */
|
|
98
|
+
async getCurrentDirectory(): Promise<T.CurrentDirResp> {
|
|
99
|
+
const res = await this.req("/api/current-directory", { method: "GET" });
|
|
100
|
+
return this.parseJsonOrThrow<T.CurrentDirResp>(res);
|
|
101
|
+
}
|
|
94
102
|
/**POST /api/directory/create*/
|
|
95
103
|
createDirectory(path: string): Promise<T.CreateDirResp> {
|
|
96
104
|
return this.postJson<T.CreateDirResp>("/api/directory/create", { path: path });
|
|
@@ -99,7 +107,7 @@ export class TauriKargoClient {
|
|
|
99
107
|
typescriptTranspile(src: string): Promise<T.TypeScriptTranspileResponse> {
|
|
100
108
|
return this.postJson<T.TypeScriptTranspileResponse>("/api/typescript/transpile", { src: src });
|
|
101
109
|
}
|
|
102
|
-
|
|
110
|
+
typescriptAst(req: T.ApiTypescriptAstRequest): Promise<T.TypescriptAstResp> {
|
|
103
111
|
return this.postJson<T.TypescriptAstResp>("/api/typescript/ast", req);
|
|
104
112
|
}
|
|
105
113
|
/**
|
package/src/test/index.ts
CHANGED
|
@@ -152,6 +152,8 @@ test.test("Test read file", async () => {
|
|
|
152
152
|
}), false, "pas dans rep")
|
|
153
153
|
}
|
|
154
154
|
const repCreateDir = await client.createDirectory("toto/titi");
|
|
155
|
+
const current = await client.getCurrentDirectory()
|
|
156
|
+
console.log(current)
|
|
155
157
|
rep = await client.explorer({})
|
|
156
158
|
if (rep.type === "directory") {
|
|
157
159
|
test.assertEquals(rep.content.some((e) => e.name === "toto"), true)
|
package/src/test.ts
CHANGED
|
@@ -353,7 +353,7 @@ export function log(...args: (string | number)[]) {
|
|
|
353
353
|
export async function assertEqualsSnapshot(actual: unknown, name: string, msg?: string) {
|
|
354
354
|
let postMessage = true
|
|
355
355
|
try {
|
|
356
|
-
const response = await fetch(`/test/
|
|
356
|
+
const response = await fetch(`/test/snapshots/${name}.json`)
|
|
357
357
|
if (response.status === 404) {
|
|
358
358
|
const updateSnapshot: UpdateSnapshot = { type: "snapshot", value: actual ,name:name}
|
|
359
359
|
if (self) {
|
package/src/types.ts
CHANGED
|
@@ -280,4 +280,19 @@ export type UpdateSnapshot = {
|
|
|
280
280
|
type: "snapshot",
|
|
281
281
|
name:string,
|
|
282
282
|
value: any
|
|
283
|
+
}
|
|
284
|
+
export type AllRunStatusItem = {
|
|
285
|
+
id: number
|
|
286
|
+
pid: number | null
|
|
287
|
+
command: string
|
|
288
|
+
executableName: string
|
|
289
|
+
arguments: string[]
|
|
290
|
+
running: boolean
|
|
291
|
+
status: number | null
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export type AllRunStatusResponse = {
|
|
295
|
+
ok: boolean
|
|
296
|
+
message: string
|
|
297
|
+
items: AllRunStatusItem[]
|
|
283
298
|
}
|