tauri-kargo-tools 0.3.3 → 0.3.5
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 +6 -1
- package/src/test/index.ts +2 -0
- package/src/test.ts +1 -1
- package/src/types.ts +1 -0
package/package.json
CHANGED
package/src/api.ts
CHANGED
|
@@ -91,6 +91,11 @@ export class TauriKargoClient {
|
|
|
91
91
|
setCurrentDirectory(body: T.CurrentDirReq): Promise<T.CurrentDirResp> {
|
|
92
92
|
return this.postJson<T.CurrentDirResp>("/api/current-directory", body);
|
|
93
93
|
}
|
|
94
|
+
/** POST /api/current-directory */
|
|
95
|
+
async getCurrentDirectory(): Promise<T.CurrentDirResp> {
|
|
96
|
+
const res = await this.req("/api/current-directory", { method: "GET" });
|
|
97
|
+
return this.parseJsonOrThrow<T.CurrentDirResp>(res);
|
|
98
|
+
}
|
|
94
99
|
/**POST /api/directory/create*/
|
|
95
100
|
createDirectory(path: string): Promise<T.CreateDirResp> {
|
|
96
101
|
return this.postJson<T.CreateDirResp>("/api/directory/create", { path: path });
|
|
@@ -99,7 +104,7 @@ export class TauriKargoClient {
|
|
|
99
104
|
typescriptTranspile(src: string): Promise<T.TypeScriptTranspileResponse> {
|
|
100
105
|
return this.postJson<T.TypeScriptTranspileResponse>("/api/typescript/transpile", { src: src });
|
|
101
106
|
}
|
|
102
|
-
|
|
107
|
+
typescriptAst(req: T.ApiTypescriptAstRequest): Promise<T.TypescriptAstResp> {
|
|
103
108
|
return this.postJson<T.TypescriptAstResp>("/api/typescript/ast", req);
|
|
104
109
|
}
|
|
105
110
|
/**
|
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
|
@@ -355,7 +355,7 @@ export async function assertEqualsSnapshot(actual: unknown, name: string, msg?:
|
|
|
355
355
|
try {
|
|
356
356
|
const response = await fetch(`/test/snapshot/${name}.json`)
|
|
357
357
|
if (response.status === 404) {
|
|
358
|
-
const updateSnapshot: UpdateSnapshot = { type: "snapshot", value: actual }
|
|
358
|
+
const updateSnapshot: UpdateSnapshot = { type: "snapshot", value: actual ,name:name}
|
|
359
359
|
if (self) {
|
|
360
360
|
self.postMessage(updateSnapshot)
|
|
361
361
|
return
|