@vercel/board 0.42.0 → 0.43.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.
@@ -1,2 +1,2 @@
1
- import { t as local } from "./local-CWLPYoiY.mjs";
1
+ import { t as local } from "./local-0TVbQkzW.mjs";
2
2
  export { local };
@@ -1,2 +1,2 @@
1
- import { a as OptionName, c as globalOptions, d as options, f as usage, i as CliOption, l as groups, n as CliCommand, o as commands, r as CliExample, s as filters, t as CliArgument, u as option } from "./commands-CrEVjASe.mjs";
1
+ import { a as OptionName, c as globalOptions, d as options, f as usage, i as CliOption, l as groups, n as CliCommand, o as commands, r as CliExample, s as filters, t as CliArgument, u as option } from "./commands-BlM-ckFS.mjs";
2
2
  export { CliArgument, CliCommand, CliExample, CliOption, OptionName, commands, filters, globalOptions, groups, option, options, usage };
@@ -1,2 +1,2 @@
1
- import { a as option, i as groups, n as filters, o as options, r as globalOptions, s as usage, t as commands } from "./commands-QRD0U9AQ.mjs";
1
+ import { a as option, i as groups, n as filters, o as options, r as globalOptions, s as usage, t as commands } from "./commands-C4fR0md0.mjs";
2
2
  export { commands, filters, globalOptions, groups, option, options, usage };
@@ -51,17 +51,6 @@ export declare function failureLines(failure: Failure): string[];
51
51
  export declare function commandWord(argv: string[]): string | undefined;
52
52
  //#endregion
53
53
  //#region src/cli/embedded.d.ts
54
- /**
55
- * The inspector's page as this version of board's npm package has it, for an app that bundles
56
- * board's CLI and so has no file of board's beside it: `path` in `name@version`'s tarball, and its
57
- * SHA-256 (hex) to check what it fetched against. The build sets `sha256`; from source, it's null.
58
- */
59
- export declare const INSPECTOR_PAGE: {
60
- name: '@vercel/board';
61
- version: string;
62
- path: 'dist/inspect/app.js';
63
- sha256: string | null;
64
- };
65
54
  /**
66
55
  * Board's CLI as `appName` names it in help, usage, and errors (`vercel board`). With no board
67
56
  * URL anywhere, it talks to the team's board in Vercel's API: `VERCEL_ORG_ID`'s, the nearest linked
@@ -75,10 +64,6 @@ export declare const INSPECTOR_PAGE: {
75
64
  * (`--scope` still wins): board asks for each only when a request needs it, so help, a typo, or
76
65
  * misuse never refreshes a login or looks a team up. With `fetch`, board's requests to Vercel's API
77
66
  * with that login go through the app's own, which adds its credentials (a DPoP proof, say).
78
- *
79
- * `inspectorPage` is the inspector's page, which `inspect` asks for when it runs: the one
80
- * `INSPECTOR_PAGE` names, as the app fetched it and checked it against its `sha256`. Without one,
81
- * `inspect` reads it beside board's files, which an app that bundles board's CLI has none of.
82
67
  */
83
68
  export declare function createApp(options: {
84
69
  appName: string;
@@ -89,7 +74,6 @@ export declare function createApp(options: {
89
74
  login?: () => Promise<string>;
90
75
  team?: () => Promise<string | null>;
91
76
  fetch?: typeof globalThis.fetch;
92
- inspectorPage?: () => Promise<string>;
93
77
  }): {
94
78
  run(args: string[]): Promise<number>;
95
79
  };
@@ -1,20 +1,7 @@
1
- import { h as VERSION } from "./origin-DAyYeDuW.mjs";
2
- import { r as stoppedBy } from "./exports-BfNXPHN_.mjs";
3
- import { a as commandLine, c as failureLines, i as mainWith, l as formatFailure, n as commandWord, o as exitCode, r as main, s as failureDocument, t as Failed } from "./main-aVEEoc60.mjs";
4
- import { t as PAGE_SHA256 } from "./digest-CKC0Rmy1.mjs";
1
+ import { r as stoppedBy } from "./exports-S2AJNE_O.mjs";
2
+ import { a as commandLine, c as failureLines, i as mainWith, l as formatFailure, n as commandWord, o as exitCode, r as main, s as failureDocument, t as Failed } from "./main-CM0_uZ7w.mjs";
5
3
  //#region src/cli/embedded.ts
6
4
  /**
7
- * The inspector's page as this version of board's npm package has it, for an app that bundles
8
- * board's CLI and so has no file of board's beside it: `path` in `name@version`'s tarball, and its
9
- * SHA-256 (hex) to check what it fetched against. The build sets `sha256`; from source, it's null.
10
- */
11
- const INSPECTOR_PAGE = {
12
- name: "@vercel/board",
13
- version: VERSION,
14
- path: "dist/inspect/app.js",
15
- sha256: PAGE_SHA256
16
- };
17
- /**
18
5
  * Board's CLI as `appName` names it in help, usage, and errors (`vercel board`). With no board
19
6
  * URL anywhere, it talks to the team's board in Vercel's API: `VERCEL_ORG_ID`'s, the nearest linked
20
7
  * project's team's (`.vercel`), your login's, or `--scope`'s. `run` takes what follows the name, and answers the exit code:
@@ -27,13 +14,9 @@ const INSPECTOR_PAGE = {
27
14
  * (`--scope` still wins): board asks for each only when a request needs it, so help, a typo, or
28
15
  * misuse never refreshes a login or looks a team up. With `fetch`, board's requests to Vercel's API
29
16
  * with that login go through the app's own, which adds its credentials (a DPoP proof, say).
30
- *
31
- * `inspectorPage` is the inspector's page, which `inspect` asks for when it runs: the one
32
- * `INSPECTOR_PAGE` names, as the app fetched it and checked it against its `sha256`. Without one,
33
- * `inspect` reads it beside board's files, which an app that bundles board's CLI has none of.
34
17
  */
35
18
  function createApp(options) {
36
- const { appName, onError, onWarning, login, team, fetch, inspectorPage } = options;
19
+ const { appName, onError, onWarning, login, team, fetch } = options;
37
20
  return { run: (args) => main(args, {
38
21
  name: appName,
39
22
  commands: {},
@@ -42,8 +25,7 @@ function createApp(options) {
42
25
  ...onWarning ? { onWarning } : {},
43
26
  ...login ? { login } : {},
44
27
  ...team ? { team } : {},
45
- ...fetch ? { fetch } : {},
46
- ...inspectorPage ? { inspectorPage } : {}
28
+ ...fetch ? { fetch } : {}
47
29
  }) };
48
30
  }
49
31
  const lacking = (what, option) => async () => {
@@ -108,4 +90,4 @@ function vb(board, argv, options = {}) {
108
90
  return result;
109
91
  }
110
92
  //#endregion
111
- export { INSPECTOR_PAGE, commandLine, commandWord, createApp, failureLines, vb };
93
+ export { commandLine, commandWord, createApp, failureLines, vb };
package/dist/cli.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { a as option } from "./commands-QRD0U9AQ.mjs";
3
- import { f as projectDir } from "./server-Bcpkt6TS.mjs";
4
- import { r as main } from "./main-aVEEoc60.mjs";
5
- import { n as stopped, r as startInspector } from "./inspect-CniRRiJ2.mjs";
2
+ import { a as option } from "./commands-C4fR0md0.mjs";
3
+ import { f as projectDir } from "./server-CD7qe_Pl.mjs";
4
+ import { r as main } from "./main-CM0_uZ7w.mjs";
5
+ import { n as stopped, r as startInspector } from "./inspect-ByIt7CxV.mjs";
6
6
  import { appendFile, readFile } from "node:fs/promises";
7
7
  import { join } from "node:path";
8
8
  //#region src/cli/local.ts
@@ -16,50 +16,68 @@ async function ignoreLog(root) {
16
16
  if (!ignore.split(/\r?\n/).some((line) => /^\/?\.board\/?$/.test(line))) await appendFile(path, `${ignore && !ignore.endsWith("\n") ? "\n" : ""}.board/\n`);
17
17
  }
18
18
  /** The commands only the standalone `board` has, in the order its help lists them. */
19
- const local = { serve: {
20
- spec: {
21
- name: "serve",
22
- description: "run a board on this machine (127.0.0.1:4100, no sync) and open the inspector: other commands reach it with --url or BOARD_URL. Its log lives in .board/, and you're local:user:<your OS user>",
23
- arguments: [],
24
- options: [
25
- option("port", "the port to listen on (default: 4100)"),
26
- option("dir"),
27
- option("no-inspect"),
28
- option("no-open")
29
- ],
30
- examples: [{
31
- name: "run a board here, and open it",
32
- value: "serve"
33
- }]
19
+ const local = {
20
+ inspect: {
21
+ spec: {
22
+ name: "inspect",
23
+ description: "the board in your browser, as you: read, post, react (local only)",
24
+ arguments: [],
25
+ options: [option("port", "the port to listen on (default: a free one)"), option("no-open")],
26
+ examples: [{
27
+ name: "open the board in your browser",
28
+ value: "inspect"
29
+ }]
30
+ },
31
+ async run(args, context) {
32
+ if (args.length > 0) throw context.usage("inspect takes no arguments: pass its port with --port.");
33
+ return (await import("./inspect-BjDlPHjE.mjs")).inspect(context);
34
+ }
34
35
  },
35
- async run(args, { flags, out, usage, portFlag, connection, openBrowser }) {
36
- if (args.length > 0) throw usage("serve takes no arguments: pass its port with --port, and its directory with --dir.");
37
- const port = portFlag();
38
- const root = projectDir();
39
- const { serveLocal } = await import("./serve-BnBqi0sw.mjs");
40
- const local = await serveLocal({
41
- dir: flags.dir ?? join(root, ".board"),
42
- ...port !== void 0 ? { port } : {}
43
- });
44
- let inspector = null;
45
- try {
46
- if (!flags.dir) await ignoreLog(root);
47
- out(`serving a local board at ${local.url} as ${local.principal}, its log in ${local.dir} (Ctrl-C to stop)`);
48
- out(`reach it with --url ${local.url}, or BOARD_URL=${local.url}`);
49
- if (!flags["no-inspect"]) {
50
- const { board } = connection(local.url, { token: local.token });
51
- inspector = await startInspector({ client: board.as(null) });
52
- out(`inspector at ${inspector.url}`);
53
- if (!flags["no-open"]) openBrowser(inspector.url);
36
+ serve: {
37
+ spec: {
38
+ name: "serve",
39
+ description: "run a board on this machine (127.0.0.1:4100, no sync) and open the inspector: other commands reach it with --url or BOARD_URL. Its log lives in .board/, and you're local:user:<your OS user>",
40
+ arguments: [],
41
+ options: [
42
+ option("port", "the port to listen on (default: 4100)"),
43
+ option("dir"),
44
+ option("no-inspect"),
45
+ option("no-open")
46
+ ],
47
+ examples: [{
48
+ name: "run a board here, and open it",
49
+ value: "serve"
50
+ }]
51
+ },
52
+ async run(args, { flags, out, usage, portFlag, connection, openBrowser }) {
53
+ if (args.length > 0) throw usage("serve takes no arguments: pass its port with --port, and its directory with --dir.");
54
+ const port = portFlag();
55
+ const root = projectDir();
56
+ const { serveLocal } = await import("./serve-p_KKFTWm.mjs");
57
+ const local = await serveLocal({
58
+ dir: flags.dir ?? join(root, ".board"),
59
+ ...port !== void 0 ? { port } : {}
60
+ });
61
+ let inspector = null;
62
+ try {
63
+ if (!flags.dir) await ignoreLog(root);
64
+ out(`serving a local board at ${local.url} as ${local.principal}, its log in ${local.dir} (Ctrl-C to stop)`);
65
+ out(`reach it with --url ${local.url}, or BOARD_URL=${local.url}`);
66
+ if (!flags["no-inspect"]) {
67
+ const { board } = connection(local.url, { token: local.token });
68
+ inspector = await startInspector({ client: board.as(null) });
69
+ out(`inspector at ${inspector.url}`);
70
+ if (!flags["no-open"]) openBrowser(inspector.url);
71
+ }
72
+ await stopped();
73
+ } finally {
74
+ await inspector?.close();
75
+ await local.close();
54
76
  }
55
- await stopped();
56
- } finally {
57
- await inspector?.close();
58
- await local.close();
77
+ return 0;
59
78
  }
60
- return 0;
61
79
  }
62
- } };
80
+ };
63
81
  //#endregion
64
82
  //#region src/cli/bin.ts
65
83
  main(process.argv.slice(2), {
@@ -288,7 +288,7 @@ declare const options: {
288
288
  readonly app: {
289
289
  readonly type: 'string';
290
290
  readonly multiple: true;
291
- readonly value: 'slug|id';
291
+ readonly value: 'app';
292
292
  readonly description: 'an app installed on the team';
293
293
  };
294
294
  readonly 'all-apps': {
@@ -365,7 +365,7 @@ declare const options: {
365
365
  readonly 'add-app': {
366
366
  readonly type: 'string';
367
367
  readonly multiple: true;
368
- readonly value: 'slug|id';
368
+ readonly value: 'app';
369
369
  readonly description: 'add an app';
370
370
  };
371
371
  readonly 'add-all-apps': {
@@ -411,7 +411,7 @@ declare const options: {
411
411
  readonly 'remove-app': {
412
412
  readonly type: 'string';
413
413
  readonly multiple: true;
414
- readonly value: 'slug|id';
414
+ readonly value: 'app';
415
415
  readonly description: 'remove an app';
416
416
  };
417
417
  readonly 'remove-all-apps': {
@@ -238,7 +238,7 @@ const options = {
238
238
  app: {
239
239
  type: "string",
240
240
  multiple: true,
241
- value: "slug|id",
241
+ value: "app",
242
242
  description: "an app installed on the team"
243
243
  },
244
244
  "all-apps": {
@@ -315,7 +315,7 @@ const options = {
315
315
  "add-app": {
316
316
  type: "string",
317
317
  multiple: true,
318
- value: "slug|id",
318
+ value: "app",
319
319
  description: "add an app"
320
320
  },
321
321
  "add-all-apps": {
@@ -361,7 +361,7 @@ const options = {
361
361
  "remove-app": {
362
362
  type: "string",
363
363
  multiple: true,
364
- value: "slug|id",
364
+ value: "app",
365
365
  description: "remove an app"
366
366
  },
367
367
  "remove-all-apps": {
@@ -1177,17 +1177,6 @@ const commands = [
1177
1177
  value: "wait --re 812 --after 815 --timeout 10m"
1178
1178
  }]
1179
1179
  },
1180
- {
1181
- group: "live",
1182
- name: "inspect",
1183
- description: "the board in your browser, as you: read, post, react (local only)",
1184
- arguments: [],
1185
- options: [option("port", "the port to listen on (default: a free one)"), option("no-open")],
1186
- examples: [{
1187
- name: "open the board in your browser",
1188
- value: "inspect"
1189
- }]
1190
- },
1191
1180
  {
1192
1181
  group: "live",
1193
1182
  name: "help",
@@ -1,7 +1,7 @@
1
1
  import { _ as IMPORT_BYTES_MAX, a as forbidden, b as mediaType, c as toErrorResponse, d as createBoardClient, f as duration, h as ATTACHMENT_BYTES_MAX, l as unauthorized, n as RejectedError, o as json, p as formatProfileHeader, r as badRequest, s as notFound, t as HttpError, u as BoardError, v as fileName } from "./errors-DUzpDSrJ.mjs";
2
2
  import { h as RemoteWatcherId } from "./schemas-DAzSsgWk.mjs";
3
3
  import { f as schemaId, n as blocksIn, r as findBlocks } from "./blocks-CVoBC7ur.mjs";
4
- import { A as MessagesQuery, B as SyncBody, C as InboxAckBody, D as LabelBody, E as InboxQuery, F as ScheduleBody, G as ThreadsQuery, H as SyncFindQuery, I as SchedulesQuery, J as UploadStartBody, K as TypingBody, L as SchemaBody, M as ReactBody, N as Ref, O as LinkedQuery, P as RegisterBody, R as SourceJoinBody, S as GrantBody, T as InboxPushBody, U as SyncImportBody, V as SyncCopiesQuery, W as SyncReceiptBody, Y as routes, _ as CreateChannelBody, a as compileWatcher, b as EventsQuery, c as METHODS, d as queryObject, f as readCapped, g as AckBody, h as VERSION, i as runMatch, j as PostBody, k as MatchesQuery, l as createRouter, m as SYNC, n as syncTarget, p as readJson, q as UpdateGrantBody, r as canonicalWatchers, t as SYNC_ACTOR, u as openapi, v as DeleteBody, w as InboxNextQuery, x as ExplainQuery, y as EditBody, z as SourceReadQuery } from "./origin-DAyYeDuW.mjs";
4
+ import { A as MessagesQuery, B as SyncBody, C as InboxAckBody, D as LabelBody, E as InboxQuery, F as ScheduleBody, G as ThreadsQuery, H as SyncFindQuery, I as SchedulesQuery, J as UploadStartBody, K as TypingBody, L as SchemaBody, M as ReactBody, N as Ref, O as LinkedQuery, P as RegisterBody, R as SourceJoinBody, S as GrantBody, T as InboxPushBody, U as SyncImportBody, V as SyncCopiesQuery, W as SyncReceiptBody, Y as routes, _ as CreateChannelBody, a as compileWatcher, b as EventsQuery, c as METHODS, d as queryObject, f as readCapped, g as AckBody, h as VERSION, i as runMatch, j as PostBody, k as MatchesQuery, l as createRouter, m as SYNC, n as syncTarget, p as readJson, q as UpdateGrantBody, r as canonicalWatchers, t as SYNC_ACTOR, u as openapi, v as DeleteBody, w as InboxNextQuery, x as ExplainQuery, y as EditBody, z as SourceReadQuery } from "./origin-DoRR9yql.mjs";
5
5
  import { _ as sha256, a as waitUntil, c as platformProfile, d as userIdOf, m as derivedId, o as actorParts, r as runMiddleware, s as importedHandle, t as DroppedError, u as underPrincipal } from "./middleware-0DUFrav-.mjs";
6
6
  import { a as canText, c as compileAccess, d as parsePattern, n as InvalidCan, r as PERMISSIONS, t as FULL_ACCESS, u as parseCan } from "./access-BgBiaCyx.mjs";
7
7
  import { C as explainGrants, b as verifiesTokens, d as grantIssuers, f as hostPrincipal, i as VERCEL_ISSUER, l as createAuthority, t as DEFAULT_CAN$1, u as fromTokens, y as verifiedIssuers } from "./auth-Ft4AJptx.mjs";
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { f as duration, t as HttpError, u as BoardError } from "./errors-DUzpDSrJ.mjs";
2
2
  import { t as block } from "./blocks-CVoBC7ur.mjs";
3
3
  import { t as DroppedError } from "./middleware-0DUFrav-.mjs";
4
- import { i as createVercel, t as createBoard } from "./exports-BfNXPHN_.mjs";
4
+ import { i as createVercel, t as createBoard } from "./exports-S2AJNE_O.mjs";
5
5
  //#region src/backend-vercel/index.default.ts
6
6
  /**
7
7
  * Your team's board, in Vercel's API. Outside Node there's no environment to find credentials or
@@ -1,5 +1,5 @@
1
1
  import { f as duration, t as HttpError, u as BoardError } from "./errors-DUzpDSrJ.mjs";
2
2
  import { t as block } from "./blocks-CVoBC7ur.mjs";
3
3
  import { t as DroppedError } from "./middleware-0DUFrav-.mjs";
4
- import { t as board } from "./server-Bcpkt6TS.mjs";
4
+ import { t as board } from "./server-CD7qe_Pl.mjs";
5
5
  export { BoardError, DroppedError, HttpError, block, board, duration };