diff --git a/cli/src/apiToken.ts b/cli/src/apiToken.ts index bdc7863..a953c29 100644 --- a/cli/src/apiToken.ts +++ b/cli/src/apiToken.ts @@ -4,10 +4,10 @@ const list = callServer("api-token/", "GET", undefined); const create = callServer("api-token/", "POST", { action: "create" }); export const apiTokenCommands = { - create, - list, + create: () => create, + list: () => list, delete: (tokenId: string) => callServer("api-token/", "POST", { action: "delete", tokenId }), - get: (secret: string) => + get: () => (secret: string) => list(secret).then((tokens: string[]) => tokens[0] || create(secret)), };