update cli code

This commit is contained in:
Ruben Fiszel
2024-04-27 18:54:04 +02:00
parent aec3148f71
commit d4af1153e9
8 changed files with 14 additions and 19 deletions
-4
View File
@@ -102,16 +102,12 @@ async function push(opts: GlobalOptions, filePath: string) {
const workspace = await resolveWorkspace(opts);
await requireLogin(opts);
<<<<<<< Updated upstream
await pushApp(
workspace.workspaceId,
filePath,
undefined,
parseFromFile(filePath)
);
=======
await pushApp(workspace.workspaceId, filePath, parseFromFile(filePath));
>>>>>>> Stashed changes
console.log(colors.bold.underline.green("App pushed"));
}
+1 -2
View File
@@ -1,6 +1,5 @@
// windmill
export { setClient } from "npm:windmill-client@1.304.2";
export * from "npm:windmill-client@1.304.2";
export * from "npm:windmill-client@1.319.1";
// cliffy
export { Command } from "https://deno.land/x/cliffy@v1.0.0-rc.4/command/mod.ts";
+4 -5
View File
@@ -17,16 +17,16 @@ async function pull(opts: GlobalOptions) {
const userInfo = await requireLogin(opts);
const uid = await SettingService.getGlobal({
const uid = (await SettingService.getGlobal({
key: "uid",
});
})) as string;
const hubBaseUrl =
(await SettingService.getGlobal({
key: "hubBaseUrl",
})) ?? "https://hub.windmill.dev";
const headers = {
const headers: Record<string, string> = {
Accept: "application/json",
"X-email": userInfo.email,
};
@@ -99,8 +99,7 @@ async function pull(opts: GlobalOptions) {
workspace.workspaceId,
x.name + ".resource-type.json",
undefined,
x,
true
x
);
}
}
+2 -1
View File
@@ -16,7 +16,8 @@ export async function downloadZip(
includeSettings?: boolean,
defaultTs?: "bun" | "deno"
): Promise<JSZip | undefined> {
const requestHeaders: HeadersInit = new Headers();
const requestHeaders: HeadersInit & { set(x: string, y: string): void } =
new Headers();
requestHeaders.set("Authorization", "Bearer " + workspace.token);
requestHeaders.set("Content-Type", "application/octet-stream");
+2 -2
View File
@@ -1,8 +1,8 @@
// deno-lint-ignore-file no-explicit-any
import { colors, Command } from "./deps.ts";
import { colors, Command, log } from "./deps.ts";
import { GlobalOptions } from "./types.ts";
async function stub(_opts: GlobalOptions, _dir?: string) {
function stub(_opts: GlobalOptions, _dir?: string) {
log.info(
colors.red.underline(
'Push is deprecated. Use "sync push --raw" instead. See <TODO_LINK_HERE> for more information.'
+2 -2
View File
@@ -183,7 +183,7 @@ export async function handleFile(
requestBody: {
content,
description: typed?.description ?? "",
language: language as NewScript.language,
language: language,
path: remotePath.replaceAll("\\", "/"),
summary: typed?.summary ?? "",
kind: typed?.kind,
@@ -213,7 +213,7 @@ export async function handleFile(
requestBody: {
content,
description: typed?.description ?? "",
language: language as NewScript.language,
language: language,
path: remotePath.replaceAll("\\", "/"),
summary: typed?.summary ?? "",
kind: typed?.kind,
+1 -1
View File
@@ -129,7 +129,7 @@ function ZipFSElement(zip: JSZip, useYaml: boolean): DynFSElement {
const seen_names = new Set<string>();
function assignPath(
summary: string | undefined,
language: RawScript.language
language: RawScript["language"]
): string {
let name;
+2 -2
View File
@@ -242,9 +242,9 @@ export async function add(
)
);
const automateUsernameCreation: boolean =
(await SettingService.getGlobal({
((await SettingService.getGlobal({
key: "automate_username_creation",
})) ?? false;
})) as any) ?? false;
await WorkspaceService.createWorkspace({
requestBody: {
id: workspaceId,