wrangler 2.17.0 → 2.19.0

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.
@@ -60,7 +60,7 @@ describe("User", () => {
60
60
  expect(counter).toBe(1);
61
61
  expect(std.out).toMatchInlineSnapshot(`
62
62
  "Attempting to login via OAuth...
63
- Opening a link in your default browser: https://dash.cloudflare.com/oauth2/auth?response_type=code&client_id=54d11594-84e4-41aa-b438-e81b8fa78ee7&redirect_uri=http%3A%2F%2Flocalhost%3A8976%2Foauth%2Fcallback&scope=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20d1%3Awrite%20pages%3Awrite%20zone%3Aread%20ssl_certs%3Awrite%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256
63
+ Opening a link in your default browser: https://dash.cloudflare.com/oauth2/auth?response_type=code&client_id=54d11594-84e4-41aa-b438-e81b8fa78ee7&redirect_uri=http%3A%2F%2Flocalhost%3A8976%2Foauth%2Fcallback&scope=account%3Aread%20user%3Aread%20workers%3Awrite%20workers_kv%3Awrite%20workers_routes%3Awrite%20workers_scripts%3Awrite%20workers_tail%3Aread%20d1%3Awrite%20pages%3Awrite%20zone%3Aread%20ssl_certs%3Awrite%20constellation%3Awrite%20offline_access&state=MOCK_STATE_PARAM&code_challenge=MOCK_CODE_CHALLENGE&code_challenge_method=S256
64
64
  Successfully logged in."
65
65
  `);
66
66
  expect(readAuthConfigFile()).toEqual<UserAuthConfig>({
@@ -0,0 +1,51 @@
1
+ import { fetchResult } from "../cfetch";
2
+ import { withConfig } from "../config";
3
+ import { logger } from "../logger";
4
+ import { requireAuth } from "../user";
5
+ import { takeName } from "./options";
6
+ import { constellationBetaWarning } from "./utils";
7
+ import type {
8
+ CommonYargsArgv,
9
+ StrictYargsOptionsToInterface,
10
+ } from "../yargs-types";
11
+ import type { Project } from "./types";
12
+
13
+ export function options(yargs: CommonYargsArgv) {
14
+ return takeName(yargs)
15
+ .positional("runtime", {
16
+ describe: "The name of the runtime to use",
17
+ type: "string",
18
+ demandOption: true,
19
+ })
20
+ .epilogue(constellationBetaWarning);
21
+ }
22
+
23
+ type HandlerOptions = StrictYargsOptionsToInterface<typeof options>;
24
+ export const handler = withConfig<HandlerOptions>(
25
+ async ({ name, runtime, config }): Promise<void> => {
26
+ const accountId = await requireAuth(config);
27
+
28
+ logger.log(constellationBetaWarning);
29
+
30
+ let proj: Project;
31
+ try {
32
+ proj = await fetchResult(`/accounts/${accountId}/constellation/project`, {
33
+ method: "POST",
34
+ headers: {
35
+ "Content-Type": "application/json",
36
+ },
37
+ body: JSON.stringify({
38
+ name,
39
+ runtime,
40
+ }),
41
+ });
42
+ } catch (e) {
43
+ if ((e as { code: number }).code === 7409) {
44
+ throw new Error("A project with that name already exists");
45
+ }
46
+ throw e;
47
+ }
48
+
49
+ logger.log(`✅ Successfully created Project "${proj.name}"!`);
50
+ }
51
+ );
@@ -0,0 +1,51 @@
1
+ import { fetchResult } from "../cfetch";
2
+ import { withConfig } from "../config";
3
+ import { confirm } from "../dialogs";
4
+ import { logger } from "../logger";
5
+ import { requireAuth } from "../user";
6
+ import { takeName } from "./options";
7
+ import { constellationBetaWarning, getProjectByName } from "./utils";
8
+ import type {
9
+ CommonYargsArgv,
10
+ StrictYargsOptionsToInterface,
11
+ } from "../yargs-types";
12
+
13
+ export function options(yargs: CommonYargsArgv) {
14
+ return takeName(yargs)
15
+ .option("force", {
16
+ describe: "Skip confirmation",
17
+ type: "boolean",
18
+ alias: "f",
19
+ default: false,
20
+ })
21
+ .epilogue(constellationBetaWarning);
22
+ }
23
+ type HandlerOptions = StrictYargsOptionsToInterface<typeof options>;
24
+ export const handler = withConfig<HandlerOptions>(
25
+ async ({ name, force, config }): Promise<void> => {
26
+ const accountId = await requireAuth(config);
27
+ logger.log(constellationBetaWarning);
28
+
29
+ const proj = await getProjectByName(config, accountId, name);
30
+
31
+ logger.log(`About to delete Project '${name}' (${proj.id}).`);
32
+ if (!force) {
33
+ const response = await confirm(`Ok to proceed?`);
34
+ if (!response) {
35
+ logger.log(`Not deleting.`);
36
+ return;
37
+ }
38
+
39
+ logger.log("Deleting...");
40
+ }
41
+
42
+ await fetchResult(
43
+ `/accounts/${accountId}/constellation/project/${proj.id}`,
44
+ {
45
+ method: "DELETE",
46
+ }
47
+ );
48
+
49
+ logger.log(`Deleted '${name}' successfully.`);
50
+ }
51
+ );
@@ -0,0 +1,68 @@
1
+ import { fetchResult } from "../cfetch";
2
+ import { withConfig } from "../config";
3
+ import { confirm } from "../dialogs";
4
+ import { logger } from "../logger";
5
+ import { requireAuth } from "../user";
6
+ import { takeName } from "./options";
7
+ import {
8
+ constellationBetaWarning,
9
+ getProjectByName,
10
+ getProjectModelByName,
11
+ } from "./utils";
12
+ import type {
13
+ CommonYargsArgv,
14
+ StrictYargsOptionsToInterface,
15
+ } from "../yargs-types";
16
+ import type { Project, Model } from "./types";
17
+
18
+ export function options(yargs: CommonYargsArgv) {
19
+ return takeName(yargs)
20
+ .positional("modelName", {
21
+ describe: "The name of the uploaded model",
22
+ type: "string",
23
+ demandOption: true,
24
+ })
25
+ .option("force", {
26
+ describe: "Skip confirmation",
27
+ type: "boolean",
28
+ alias: "f",
29
+ default: false,
30
+ })
31
+ .epilogue(constellationBetaWarning);
32
+ }
33
+ type HandlerOptions = StrictYargsOptionsToInterface<typeof options>;
34
+ export const handler = withConfig<HandlerOptions>(
35
+ async ({ name, modelName, force, config }): Promise<void> => {
36
+ const accountId = await requireAuth(config);
37
+ logger.log(constellationBetaWarning);
38
+
39
+ const proj: Project = await getProjectByName(config, accountId, name);
40
+
41
+ const model: Model = await getProjectModelByName(
42
+ config,
43
+ accountId,
44
+ proj,
45
+ modelName
46
+ );
47
+
48
+ logger.log(`About to delete Model '${modelName}' (${model.id}).`);
49
+ if (!force) {
50
+ const response = await confirm(`Ok to proceed?`);
51
+ if (!response) {
52
+ logger.log(`Not deleting.`);
53
+ return;
54
+ }
55
+
56
+ logger.log("Deleting...");
57
+ }
58
+
59
+ await fetchResult(
60
+ `/accounts/${accountId}/constellation/project/${proj.id}/model/${model.id}`,
61
+ {
62
+ method: "DELETE",
63
+ }
64
+ );
65
+
66
+ logger.log(`Deleted '${modelName}' successfully.`);
67
+ }
68
+ );
@@ -0,0 +1,75 @@
1
+ import * as CreateProject from "./createProject";
2
+ import * as DeleteProject from "./deleteProject";
3
+ import * as DeleteProjectModel from "./deleteProjectModel";
4
+ import * as ListCatalog from "./listCatalog";
5
+ import * as ListModel from "./listModel";
6
+ import * as ListProject from "./listProject";
7
+ import * as ListRuntime from "./listRuntime";
8
+ import * as UploadModel from "./uploadModel";
9
+ import type { CommonYargsArgv } from "../yargs-types";
10
+
11
+ export function constellation(yargs: CommonYargsArgv) {
12
+ return yargs
13
+ .command("project", "Manage your projects", (constProjYargs) => {
14
+ return constProjYargs
15
+ .command(
16
+ "list",
17
+ "List your projects",
18
+ ListProject.options,
19
+ ListProject.handler
20
+ )
21
+ .command(
22
+ "create <name> <runtime>",
23
+ "Create project",
24
+ CreateProject.options,
25
+ CreateProject.handler
26
+ )
27
+ .command(
28
+ "delete <name>",
29
+ "Delete project",
30
+ DeleteProject.options,
31
+ DeleteProject.handler
32
+ );
33
+ })
34
+ .command("model", "Manage your models", (constModelYargs) => {
35
+ return constModelYargs
36
+ .command(
37
+ "upload <name> <modelName> <modelFile>",
38
+ "Upload a model for an existing project",
39
+ UploadModel.options,
40
+ UploadModel.handler
41
+ )
42
+ .command(
43
+ "list <name>",
44
+ "List models of a project",
45
+ ListModel.options,
46
+ ListModel.handler
47
+ )
48
+ .command(
49
+ "delete <name> <modelName>",
50
+ "Delete a model of a project",
51
+ DeleteProjectModel.options,
52
+ DeleteProjectModel.handler
53
+ );
54
+ })
55
+ .command(
56
+ "catalog",
57
+ "Check the curated model catalog",
58
+ (constCatalogYargs) => {
59
+ return constCatalogYargs.command(
60
+ "list",
61
+ "List catalog models",
62
+ ListCatalog.options,
63
+ ListCatalog.handler
64
+ );
65
+ }
66
+ )
67
+ .command("runtime", "Check the suported runtimes", (constRuntimeYargs) => {
68
+ return constRuntimeYargs.command(
69
+ "list",
70
+ "List suported runtimes",
71
+ ListRuntime.options,
72
+ ListRuntime.handler
73
+ );
74
+ });
75
+ }
@@ -0,0 +1,35 @@
1
+ import { withConfig } from "../config";
2
+ import { logger } from "../logger";
3
+ import { requireAuth } from "../user";
4
+ import { asJson } from "./options";
5
+ import { constellationBetaWarning, listCatalogEntries } from "./utils";
6
+ import type {
7
+ CommonYargsArgv,
8
+ StrictYargsOptionsToInterface,
9
+ } from "../yargs-types";
10
+
11
+ export function options(yargs: CommonYargsArgv) {
12
+ return asJson(yargs).epilogue(constellationBetaWarning);
13
+ }
14
+
15
+ type HandlerOptions = StrictYargsOptionsToInterface<typeof options>;
16
+ export const handler = withConfig<HandlerOptions>(
17
+ async ({ json, config }): Promise<void> => {
18
+ const accountId = await requireAuth(config);
19
+ const entries = await listCatalogEntries(accountId);
20
+
21
+ if (json) {
22
+ logger.log(JSON.stringify(entries, null, 2));
23
+ } else {
24
+ logger.log(constellationBetaWarning);
25
+ logger.table(
26
+ entries.map((entry) => ({
27
+ project_id: entry.project.id,
28
+ project_name: entry.project.name,
29
+ project_runtime: entry.project.runtime,
30
+ models: entry.models.map((model) => model.name).join(","),
31
+ }))
32
+ );
33
+ }
34
+ }
35
+ );
@@ -0,0 +1,41 @@
1
+ import { withConfig } from "../config";
2
+ import { logger } from "../logger";
3
+ import { requireAuth } from "../user";
4
+ import { takeName } from "./options";
5
+ import {
6
+ constellationBetaWarning,
7
+ getProjectByName,
8
+ listModels,
9
+ } from "./utils";
10
+ import type {
11
+ CommonYargsArgv,
12
+ StrictYargsOptionsToInterface,
13
+ } from "../yargs-types";
14
+ import type { Project } from "./types";
15
+
16
+ export function options(yargs: CommonYargsArgv) {
17
+ return takeName(yargs)
18
+ .option("json", {
19
+ describe: "return output as clean JSON",
20
+ type: "boolean",
21
+ default: false,
22
+ })
23
+ .epilogue(constellationBetaWarning);
24
+ }
25
+
26
+ type HandlerOptions = StrictYargsOptionsToInterface<typeof options>;
27
+ export const handler = withConfig<HandlerOptions>(
28
+ async ({ name, json, config }): Promise<void> => {
29
+ const accountId = await requireAuth(config);
30
+ const proj: Project = await getProjectByName(config, accountId, name);
31
+
32
+ const models = await listModels(accountId, proj);
33
+
34
+ if (json) {
35
+ logger.log(JSON.stringify(models, null, 2));
36
+ } else {
37
+ logger.log(constellationBetaWarning);
38
+ logger.table(models);
39
+ }
40
+ }
41
+ );
@@ -0,0 +1,28 @@
1
+ import { withConfig } from "../config";
2
+ import { logger } from "../logger";
3
+ import { requireAuth } from "../user";
4
+ import { asJson } from "./options";
5
+ import { constellationBetaWarning, listProjects } from "./utils";
6
+ import type {
7
+ CommonYargsArgv,
8
+ StrictYargsOptionsToInterface,
9
+ } from "../yargs-types";
10
+
11
+ export function options(yargs: CommonYargsArgv) {
12
+ return asJson(yargs).epilogue(constellationBetaWarning);
13
+ }
14
+
15
+ type HandlerOptions = StrictYargsOptionsToInterface<typeof options>;
16
+ export const handler = withConfig<HandlerOptions>(
17
+ async ({ json, config }): Promise<void> => {
18
+ const accountId = await requireAuth(config);
19
+ const projs = await listProjects(accountId);
20
+
21
+ if (json) {
22
+ logger.log(JSON.stringify(projs, null, 2));
23
+ } else {
24
+ logger.log(constellationBetaWarning);
25
+ logger.table(projs);
26
+ }
27
+ }
28
+ );
@@ -0,0 +1,28 @@
1
+ import { withConfig } from "../config";
2
+ import { logger } from "../logger";
3
+ import { requireAuth } from "../user";
4
+ import { asJson } from "./options";
5
+ import { constellationBetaWarning, listRuntimes } from "./utils";
6
+ import type {
7
+ CommonYargsArgv,
8
+ StrictYargsOptionsToInterface,
9
+ } from "../yargs-types";
10
+
11
+ export function options(yargs: CommonYargsArgv) {
12
+ return asJson(yargs).epilogue(constellationBetaWarning);
13
+ }
14
+
15
+ type HandlerOptions = StrictYargsOptionsToInterface<typeof options>;
16
+ export const handler = withConfig<HandlerOptions>(
17
+ async ({ json, config }): Promise<void> => {
18
+ const accountId = await requireAuth(config);
19
+ const runtimes = await listRuntimes(accountId);
20
+
21
+ if (json) {
22
+ logger.log(JSON.stringify(runtimes, null, 2));
23
+ } else {
24
+ logger.log(constellationBetaWarning);
25
+ logger.table(runtimes.map((runtime) => ({ name: runtime })));
26
+ }
27
+ }
28
+ );
@@ -0,0 +1,17 @@
1
+ import type { CommonYargsArgv } from "../yargs-types";
2
+
3
+ export function takeName(yargs: CommonYargsArgv) {
4
+ return yargs.positional("name", {
5
+ describe: "The name of the project",
6
+ type: "string",
7
+ demandOption: true,
8
+ });
9
+ }
10
+
11
+ export function asJson(yargs: CommonYargsArgv) {
12
+ return yargs.option("json", {
13
+ describe: "return output as clean JSON",
14
+ type: "boolean",
15
+ default: false,
16
+ });
17
+ }
@@ -0,0 +1,17 @@
1
+ export type Project = {
2
+ id: string;
3
+ name: string;
4
+ runtime: string;
5
+ };
6
+
7
+ export type Model = {
8
+ id: string;
9
+ project_id: string;
10
+ name: string;
11
+ description: string;
12
+ };
13
+
14
+ export type CatalogEntry = {
15
+ project: Project;
16
+ models: Model[];
17
+ };
@@ -0,0 +1,64 @@
1
+ import { readFileSync } from "node:fs";
2
+ import { FormData, File } from "undici";
3
+ import { fetchResult } from "../cfetch";
4
+ import { withConfig } from "../config";
5
+ import { logger } from "../logger";
6
+ import { requireAuth } from "../user";
7
+ import { takeName } from "./options";
8
+ import { constellationBetaWarning, getProjectByName } from "./utils";
9
+ import type {
10
+ CommonYargsArgv,
11
+ StrictYargsOptionsToInterface,
12
+ } from "../yargs-types";
13
+ import type { Model } from "./types";
14
+
15
+ export function options(yargs: CommonYargsArgv) {
16
+ return takeName(yargs)
17
+ .positional("modelName", {
18
+ describe: "The name of the uploaded model",
19
+ type: "string",
20
+ demandOption: true,
21
+ })
22
+ .positional("modelFile", {
23
+ describe: "The name of the local file with the model contents",
24
+ type: "string",
25
+ demandOption: true,
26
+ })
27
+ .epilogue(constellationBetaWarning);
28
+ }
29
+ type HandlerOptions = StrictYargsOptionsToInterface<typeof options>;
30
+ export const handler = withConfig<HandlerOptions>(
31
+ async ({ name, modelName, modelFile, config }): Promise<void> => {
32
+ const accountId = await requireAuth(config);
33
+ logger.log(constellationBetaWarning);
34
+
35
+ const proj = await getProjectByName(config, accountId, name);
36
+
37
+ const formData = new FormData();
38
+ formData.set(
39
+ "file",
40
+ new File([readFileSync(modelFile)], modelFile, {
41
+ type: "application/octet-stream",
42
+ })
43
+ );
44
+ formData.set("name", modelName);
45
+
46
+ let model: Model;
47
+ try {
48
+ model = await fetchResult(
49
+ `/accounts/${accountId}/constellation/project/${proj.id}/model`,
50
+ {
51
+ method: "POST",
52
+ body: formData,
53
+ }
54
+ );
55
+ } catch (e) {
56
+ if ((e as { code: number }).code === 7408) {
57
+ throw new Error("A model with that name already exists");
58
+ }
59
+ throw e;
60
+ }
61
+
62
+ logger.log(`✅ Successfully uploaded Model "${model.name}"!`);
63
+ }
64
+ );
@@ -0,0 +1,90 @@
1
+ import { fetchResult } from "../cfetch";
2
+ import { getEnvironmentVariableFactory } from "../environment-variables/factory";
3
+ import type { Config } from "../config";
4
+ import type { Project, Model, CatalogEntry } from "./types";
5
+
6
+ export const getConstellationWarningFromEnv = getEnvironmentVariableFactory({
7
+ variableName: "NO_CONSTELLATION_WARNING",
8
+ });
9
+
10
+ export const constellationBetaWarning =
11
+ getConstellationWarningFromEnv() !== undefined
12
+ ? ""
13
+ : "--------------------\n🚧 Constellation AI is currently in open alpha and is not recommended for production data and traffic\n🚧 Please report any bugs to https://github.com/cloudflare/workers-sdk/issues/new/choose\n🚧 To give feedback, visit https://discord.gg/cloudflaredev\n--------------------\n";
14
+
15
+ export const getProjectByName = async (
16
+ config: Config,
17
+ accountId: string,
18
+ name: string
19
+ ): Promise<Project> => {
20
+ const allProjects = await listProjects(accountId);
21
+ const matchingProj = allProjects.find((proj) => proj.name === name);
22
+ if (!matchingProj) {
23
+ throw new Error(`Couldn't find Project with name '${name}'`);
24
+ }
25
+ return matchingProj;
26
+ };
27
+
28
+ export const getProjectModelByName = async (
29
+ config: Config,
30
+ accountId: string,
31
+ proj: Project,
32
+ modelName: string
33
+ ): Promise<Model> => {
34
+ const allModels = await listModels(accountId, proj);
35
+ const matchingModel = allModels.find((model) => model.name === modelName);
36
+ if (!matchingModel) {
37
+ throw new Error(`Couldn't find Model with name '${modelName}'`);
38
+ }
39
+ return matchingModel;
40
+ };
41
+
42
+ export async function constellationList<ResponseType>(
43
+ accountId: string,
44
+ partialUrl: string
45
+ ): Promise<Array<ResponseType>> {
46
+ const pageSize = 50;
47
+ let page = 1;
48
+ const results = [];
49
+ while (results.length % pageSize === 0) {
50
+ const json: Array<ResponseType> = await fetchResult(
51
+ `/accounts/${accountId}/constellation/${partialUrl}`,
52
+ {},
53
+ new URLSearchParams({
54
+ per_page: pageSize.toString(),
55
+ page: page.toString(),
56
+ })
57
+ );
58
+ page++;
59
+ results.push(...json);
60
+ if (json.length < pageSize) {
61
+ break;
62
+ }
63
+ }
64
+ return results;
65
+ }
66
+
67
+ export const listCatalogEntries = async (
68
+ accountId: string
69
+ ): Promise<Array<CatalogEntry>> => {
70
+ return await constellationList(accountId, "catalog");
71
+ };
72
+
73
+ export const listModels = async (
74
+ accountId: string,
75
+ proj: Project
76
+ ): Promise<Array<Model>> => {
77
+ return constellationList(accountId, `project/${proj.id}/model`);
78
+ };
79
+
80
+ export const listProjects = async (
81
+ accountId: string
82
+ ): Promise<Array<Project>> => {
83
+ return await constellationList(accountId, "project");
84
+ };
85
+
86
+ export const listRuntimes = async (
87
+ accountId: string
88
+ ): Promise<Array<string>> => {
89
+ return await constellationList(accountId, "runtime");
90
+ };
@@ -14,7 +14,8 @@ type VariableNames =
14
14
  | "WRANGLER_AUTH_URL"
15
15
  | "WRANGLER_TOKEN_URL"
16
16
  | "WRANGLER_REVOKE_URL"
17
- | "WRANGLER_CF_AUTHORIZATION_TOKEN";
17
+ | "WRANGLER_CF_AUTHORIZATION_TOKEN"
18
+ | "NO_CONSTELLATION_WARNING";
18
19
 
19
20
  type DeprecatedNames =
20
21
  | "CF_ACCOUNT_ID"
package/src/index.ts CHANGED
@@ -7,6 +7,7 @@ import makeCLI from "yargs";
7
7
  import { version as wranglerVersion } from "../package.json";
8
8
  import { isBuildFailure } from "./bundle";
9
9
  import { loadDotEnv, readConfig } from "./config";
10
+ import { constellation } from "./constellation";
10
11
  import { d1 } from "./d1";
11
12
  import { deleteHandler, deleteOptions } from "./delete";
12
13
  import {
@@ -431,6 +432,15 @@ export function createCLIParser(argv: string[]) {
431
432
  return d1(d1Yargs.command(subHelp));
432
433
  });
433
434
 
435
+ // ai
436
+ wrangler.command(
437
+ "constellation",
438
+ "🤖 Interact with Constellation AI models",
439
+ (aiYargs) => {
440
+ return constellation(aiYargs.command(subHelp));
441
+ }
442
+ );
443
+
434
444
  // pubsub
435
445
  wrangler.command(
436
446
  "pubsub",
package/src/kv/helpers.ts CHANGED
@@ -8,7 +8,7 @@ import type { Config } from "../config";
8
8
  const API_MAX = 10000;
9
9
  // The const below are halved from the API's true capacity to help avoid
10
10
  // hammering it with large requests.
11
- const BATCH_KEY_MAX = API_MAX / 2;
11
+ export const BATCH_KEY_MAX = API_MAX / 2;
12
12
 
13
13
  type KvArgs = {
14
14
  binding?: string;
@@ -256,7 +256,7 @@ export async function deleteKVKeyValue(
256
256
  /**
257
257
  * Formatter for converting e.g. 5328 --> 5,328
258
258
  */
259
- const formatNumber = new Intl.NumberFormat("en-US", {
259
+ export const formatNumber = new Intl.NumberFormat("en-US", {
260
260
  notation: "standard",
261
261
  }).format;
262
262
 
@@ -279,7 +279,8 @@ export async function putKVBulkKeyValue(
279
279
  accountId: string,
280
280
  namespaceId: string,
281
281
  keyValues: KeyValue[],
282
- quiet = false
282
+ quiet = false,
283
+ abortSignal?: AbortSignal
283
284
  ) {
284
285
  for (let index = 0; index < keyValues.length; index += BATCH_KEY_MAX) {
285
286
  if (!quiet && keyValues.length > BATCH_KEY_MAX) {
@@ -292,7 +293,9 @@ export async function putKVBulkKeyValue(
292
293
  method: "PUT",
293
294
  body: JSON.stringify(keyValues.slice(index, index + BATCH_KEY_MAX)),
294
295
  headers: { "Content-Type": "application/json" },
295
- }
296
+ },
297
+ undefined,
298
+ abortSignal
296
299
  );
297
300
  }
298
301
 
package/src/logger.ts CHANGED
@@ -61,7 +61,11 @@ export class Logger {
61
61
  const keys: Keys[] =
62
62
  data.length === 0 ? [] : (Object.keys(data[0]) as Keys[]);
63
63
  const t = new CLITable({
64
- head: keys.map((k) => chalk.bold.blue(k)),
64
+ head: keys,
65
+ style: {
66
+ head: chalk.level ? ["blue"] : [],
67
+ border: chalk.level ? ["gray"] : [],
68
+ },
65
69
  });
66
70
  t.push(...data.map((row) => keys.map((k) => row[k])));
67
71
  return this.doLog("log", [t.toString()]);