passport-bridge 0.56.0 → 0.57.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.
Files changed (54) hide show
  1. package/dist/cliHookDecide.js +3 -1
  2. package/dist/connectorKit/engine.generated.js +7 -0
  3. package/dist/connectorKit/githubDecide.generated.d.ts +6 -0
  4. package/dist/connectorKit/githubDecide.generated.js +26 -7
  5. package/dist/connectorKit/manifest.generated.d.ts +3 -0
  6. package/dist/connectorKit/manifests/cloudflareApiOverlay.generated.d.ts +22 -0
  7. package/dist/connectorKit/manifests/cloudflareApiOverlay.generated.js +50 -0
  8. package/dist/connectorKit/manifests/cloudflareCli.generated.d.ts +3 -0
  9. package/dist/connectorKit/manifests/cloudflareCli.generated.js +27 -6
  10. package/dist/connectorKit/manifests/cloudflareCommands.generated.d.ts +17 -0
  11. package/dist/connectorKit/manifests/cloudflareCommands.generated.js +353 -0
  12. package/dist/connectorKit/manifests/githubCapture.generated.js +3 -2
  13. package/dist/connectorKit/manifests/githubHooks.generated.js +3 -1
  14. package/dist/connectorKit/manifests/githubReads.generated.d.ts +4 -0
  15. package/dist/connectorKit/manifests/githubReads.generated.js +36 -2
  16. package/dist/connectorKit/manifests/kubernetesCli.generated.d.ts +6 -0
  17. package/dist/connectorKit/manifests/kubernetesCli.generated.js +18 -4
  18. package/dist/connectorKit/manifests/railwayCapture.generated.js +14 -1
  19. package/dist/connectorKit/manifests/railwayCommands.generated.js +9 -1
  20. package/dist/connectorKit/manifests/railwayGraphql.generated.d.ts +40 -0
  21. package/dist/connectorKit/manifests/railwayGraphql.generated.js +409 -0
  22. package/dist/connectorKit/manifests/railwayHooks.generated.d.ts +10 -1
  23. package/dist/connectorKit/manifests/railwayHooks.generated.js +89 -34
  24. package/dist/connectorKit/manifests/sentryCli.generated.js +3 -0
  25. package/dist/connectorKit/manifests/supabaseApi.generated.js +6 -0
  26. package/dist/connectorKit/manifests/supabaseCapture.generated.js +4 -0
  27. package/dist/connectorKit/manifests/terraform.generated.d.ts +16 -4
  28. package/dist/connectorKit/manifests/terraform.generated.js +85 -104
  29. package/dist/connectorKit/manifests/terraformCatalog.generated.d.ts +15 -0
  30. package/dist/connectorKit/manifests/terraformCatalog.generated.js +36 -0
  31. package/dist/connectorKit/manifests/terraformCommands.generated.d.ts +2 -0
  32. package/dist/connectorKit/manifests/terraformCommands.generated.js +109 -0
  33. package/dist/connectorKit/sources/cloudflare/api-overlay.generated.d.ts +3793 -0
  34. package/dist/connectorKit/sources/cloudflare/api-overlay.generated.js +2 -0
  35. package/dist/connectorKit/sources/cloudflare/cli-tree.generated.d.ts +56 -0
  36. package/dist/connectorKit/sources/cloudflare/cli-tree.generated.js +2 -0
  37. package/dist/connectorKit/sources/sentry/cli-commands.generated.d.ts +2 -0
  38. package/dist/connectorKit/sources/sentry/cli-commands.generated.js +1 -1
  39. package/dist/connectorKit/sources/supabase/api-operations.generated.js +1 -1
  40. package/dist/connectorKit/sources/terraform/cli-tree.generated.d.ts +32 -0
  41. package/dist/connectorKit/sources/terraform/cli-tree.generated.js +2 -0
  42. package/dist/controlPlaneCloudflare.d.ts +8 -3
  43. package/dist/controlPlaneCloudflare.js +17 -7
  44. package/dist/controlPlaneGuard.js +5 -3
  45. package/dist/controlPlaneNpmCommands.generated.d.ts +3 -0
  46. package/dist/controlPlaneNpmCommands.generated.js +17 -2
  47. package/dist/controlPlaneRailwayGuard.d.ts +20 -5
  48. package/dist/controlPlaneRailwayGuard.js +109 -12
  49. package/dist/pluginPin.d.ts +1 -1
  50. package/dist/pluginPin.js +1 -1
  51. package/dist/version.d.ts +1 -1
  52. package/dist/version.js +1 -1
  53. package/npm-shrinkwrap.json +2 -2
  54. package/package.json +1 -1
@@ -400,7 +400,9 @@ async function foundOffline(context, missed) {
400
400
  }
401
401
  if (missed.cloudflare) {
402
402
  const where = { cwd: context.cwd ?? null, env: context.env ?? process.env };
403
- found.push(...(await import("./controlPlaneCloudflare.js")).cloudflareFound(context.command, where));
403
+ const cloudflare = await import("./controlPlaneCloudflare.js");
404
+ const api = await cloudflare.cloudflareApiManifest(context.command);
405
+ found.push(...cloudflare.cloudflareFound(context.command, where, api));
404
406
  }
405
407
  if (missed.npm) {
406
408
  const where = { cwd: context.cwd ?? null, env: context.env ?? process.env, home: homedir() };
@@ -341,6 +341,8 @@ export function explain(m, request, context = {}, hooks = {}) {
341
341
  return { found: [], via: "none" };
342
342
  if (!n.op && !n.problem)
343
343
  return { found: [], via: "read" }; // the program alone, `--help`, `--version`
344
+ if (n.iface === "api" && docsRead(m, n.op))
345
+ return { found: [], via: "read" };
344
346
  const infoOnly = (m.capture.cli.infoFlags ?? []).some((flag) => n.params[flag] === true);
345
347
  if (n.iface === "cli" && infoOnly && !n.problem)
346
348
  return { found: [], via: "read" };
@@ -349,6 +351,11 @@ export function explain(m, request, context = {}, hooks = {}) {
349
351
  const shell = (request.interface === "cli" && request.problem !== undefined) || n.problem === RUNNER_FOLDER;
350
352
  return decideRequest(m, n, context, hooks, {}, shell);
351
353
  }
354
+ /** A GET or HEAD of a path that only serves the vendor's own documentation (`api.docs`). */
355
+ function docsRead(m, op) {
356
+ const [method, path] = op.split(" ");
357
+ return (method === "GET" || method === "HEAD") && (m.capture.api.docs ?? []).includes(path ?? "");
358
+ }
352
359
  /** `normalizeCli`'s problem for a package runner whose folder the guard can't name (`launchers.ts`). */
353
360
  const RUNNER_FOLDER = "a package runner's folder the guard cannot name";
354
361
  function decideRequest(m, n, context, hooks, override, shell = false) {
@@ -27,6 +27,12 @@ export type GithubCliArgs = {
27
27
  };
28
28
  /** Whether a command line is `git push` (git's own options before it don't count). */
29
29
  export declare function isGitPush(argv: readonly string[]): boolean;
30
+ /**
31
+ * `git send-pack <url> <ref>…` (push's plumbing, same options and positions) as the push it is, so the push path
32
+ * names each ref it moves. With no ref, send-pack pushes every branch both sides have: read as `--all`, a superset.
33
+ * Any other line is returned as it is.
34
+ */
35
+ export declare function gitPushArgv(argv: readonly string[]): readonly string[];
30
36
  /**
31
37
  * Every ref a `git push` moves, one classification each, worst first, with the worst case for what it can't name;
32
38
  * null when it isn't a push to GitHub (or is a dry run).
@@ -162,23 +162,42 @@ export function classifyGithub(request, context) {
162
162
  }
163
163
  const programOf = (word) => (word ?? "").replace(/^.*\//, "").replace(/\.exe$/i, "");
164
164
  const GIT_GLOBAL_VALUES = new Set(["-C", "-c", "--git-dir", "--work-tree", "--namespace"]);
165
- /** Whether a command line is `git push` (git's own options before it don't count). */
166
- export function isGitPush(argv) {
167
- if (programOf(argv[0]) !== "git")
168
- return false;
165
+ /** Where git's subcommand sits (git's own options before it don't count). */
166
+ function gitSubcommandAt(argv) {
169
167
  let index = 1;
170
168
  while ((argv[index] ?? "").startsWith("-"))
171
169
  index += GIT_GLOBAL_VALUES.has(argv[index]) ? 2 : 1;
172
- return argv[index] === "push";
170
+ return index;
171
+ }
172
+ /** Whether a command line is `git push` (git's own options before it don't count). */
173
+ export function isGitPush(argv) {
174
+ return programOf(argv[0]) === "git" && argv[gitSubcommandAt(argv)] === "push";
175
+ }
176
+ /**
177
+ * `git send-pack <url> <ref>…` (push's plumbing, same options and positions) as the push it is, so the push path
178
+ * names each ref it moves. With no ref, send-pack pushes every branch both sides have: read as `--all`, a superset.
179
+ * Any other line is returned as it is.
180
+ */
181
+ export function gitPushArgv(argv) {
182
+ if (programOf(argv[0]) !== "git")
183
+ return argv;
184
+ const at = gitSubcommandAt(argv);
185
+ if (argv[at] !== "send-pack")
186
+ return argv;
187
+ const rest = argv.slice(at + 1);
188
+ const refs = rest.filter((word) => !word.startsWith("-")).length > 1;
189
+ const every = rest.some((word) => word === "--all" || word === "--mirror" || word === "--stdin");
190
+ return [...argv.slice(0, at), "push", ...(refs || every ? [] : ["--all"]), ...rest];
173
191
  }
174
192
  /**
175
193
  * Every ref a `git push` moves, one classification each, worst first, with the worst case for what it can't name;
176
194
  * null when it isn't a push to GitHub (or is a dry run).
177
195
  */
178
196
  export function classifyGitPushRefs(args, context) {
179
- if (!isGitPush(args.argv))
197
+ const argv = [...gitPushArgv(args.argv)];
198
+ if (!isGitPush(argv))
180
199
  return null;
181
- const found = classifyGithubAll({ interface: "cli", ...args }, context);
200
+ const found = classifyGithubAll({ interface: "cli", ...args, argv }, context);
182
201
  return found.length ? found : null;
183
202
  }
184
203
  /** The worst a push to branches it doesn't name can do: force-push and delete, on the repository. */
@@ -213,6 +213,9 @@ export type CaptureSpec = {
213
213
  rules: readonly CaptureRule[];
214
214
  reads: Readonly<Record<string, ReadEvidence>>;
215
215
  unknown?: UnknownOp;
216
+ /** Paths outside the operation surface that only serve the vendor's own documentation (its OpenAPI document): a
217
+ * GET or HEAD of one reads no account data, so it is a read. Not operations, so not in the pinned sources. */
218
+ docs?: readonly string[];
216
219
  /** Query keys that name what a call acts on (Vercel's teamId); no other query key can set a node param. */
217
220
  query?: readonly string[];
218
221
  /** Query keys the vendor documents as repeatable (Sentry's bulk `?id=1&id=2`): their values are a list. Any
@@ -0,0 +1,22 @@
1
+ import type { CaptureRule, Manifest } from "../manifest.generated.js";
2
+ /**
3
+ * Cloudflare's whole API v4, named (docs/design/zero-unknowns.md, decision 3): every operation of the pinned schema
4
+ * the hand rules in `cloudflareApi.ts` don't name, from the generated overlay (`sources/cloudflare/api-overlay.json`,
5
+ * drafted and reviewed in `cloudflareApiDraft.ts`). A read is a read; anything else is Cloudflare's "Other change"
6
+ * with Cloudflare's own summary, placed on the node its path names, and the server's call-effects table
7
+ * (`cloudflareOverlayEffects.ts`) gives it its effects.
8
+ *
9
+ * Large (about 3,800 routes), so it is its own manifest: the guard loads it only for a line that calls Cloudflare's
10
+ * API, never for `wrangler`, and the web app never imports it.
11
+ */
12
+ /** `0` is a read; otherwise Cloudflare's summary and the reviewed effects (`effectSpec.ts`). */
13
+ export type ApiOverlayItem = 0 | readonly [summary: string, effects: string];
14
+ export declare const CLOUDFLARE_API_OVERLAY_ITEMS: Readonly<Record<string, ApiOverlayItem>>;
15
+ export declare function cloudflareApiPlace(path: string): string;
16
+ /** The overlay's capture rules and reads. */
17
+ export declare function cloudflareApiOverlayCapture(items?: Readonly<Record<string, ApiOverlayItem>>): {
18
+ rules: CaptureRule[];
19
+ reads: Record<string, string>;
20
+ };
21
+ /** Cloudflare's manifest with every API operation named: the hand rules first (they win), then the overlay. */
22
+ export declare const CLOUDFLARE_WITH_API: Manifest;
@@ -0,0 +1,50 @@
1
+ // Generated by scripts/generate-control-plane-classifier.mjs. Do not edit.
2
+ import OVERLAY from "../sources/cloudflare/api-overlay.generated.js";
3
+ import { CLOUDFLARE } from "./cloudflare.generated.js";
4
+ export const CLOUDFLARE_API_OVERLAY_ITEMS = OVERLAY.items;
5
+ const OTHER = "cloudflare.account.change";
6
+ const V = "/client/v4";
7
+ /** The node a route names, most specific first (each by the path param the manifest reads it from); else the
8
+ * platform. */
9
+ const PLACES = [
10
+ [/^\/client\/v4\/accounts\/\{account_id\}\/workers\/scripts\/\{script_name\}(\/|$)/, "worker"],
11
+ [/^\/client\/v4\/accounts\/\{account_id\}\/pages\/projects\/\{project_name\}(\/|$)/, "pages_project"],
12
+ [/^\/client\/v4\/accounts\/\{account_id\}\/r2\/buckets\/\{bucket_name\}(\/|$)/, "bucket"],
13
+ [/^\/client\/v4\/accounts\/\{account_id\}\/storage\/kv\/namespaces\/\{namespace_id\}(\/|$)/, "kv_namespace"],
14
+ [/^\/client\/v4\/accounts\/\{account_id\}\/d1\/database\/\{database_id\}(\/|$)/, "d1_database"],
15
+ [/^\/client\/v4\/accounts\/\{account_id\}\/queues\/\{queue_id\}(\/|$)/, "queue"],
16
+ [/^\/client\/v4\/zones\/\{zone_id\}(\/|$)/, "zone"],
17
+ [/^\/client\/v4\/accounts\/\{account_id\}(\/|$)/, "account"]
18
+ ];
19
+ export function cloudflareApiPlace(path) {
20
+ return PLACES.find(([pattern]) => pattern.test(path))?.[1] ?? "platform";
21
+ }
22
+ /** The overlay's capture rules and reads. */
23
+ export function cloudflareApiOverlayCapture(items = CLOUDFLARE_API_OVERLAY_ITEMS) {
24
+ const rules = [];
25
+ const reads = {};
26
+ for (const [op, item] of Object.entries(items)) {
27
+ if (item === 0) {
28
+ reads[op] = "A read in Cloudflare's API";
29
+ continue;
30
+ }
31
+ const path = op.slice(op.indexOf(" ") + 1);
32
+ rules.push({
33
+ match: op,
34
+ action: OTHER,
35
+ on: cloudflareApiPlace(path.startsWith(V) ? path : V + path),
36
+ summary: item[0]
37
+ });
38
+ }
39
+ return { rules, reads };
40
+ }
41
+ const overlay = cloudflareApiOverlayCapture();
42
+ const api = CLOUDFLARE.capture.api;
43
+ /** Cloudflare's manifest with every API operation named: the hand rules first (they win), then the overlay. */
44
+ export const CLOUDFLARE_WITH_API = {
45
+ ...CLOUDFLARE,
46
+ capture: {
47
+ ...CLOUDFLARE.capture,
48
+ api: { ...api, rules: [...api.rules, ...overlay.rules], reads: { ...overlay.reads, ...api.reads } }
49
+ }
50
+ };
@@ -1,2 +1,5 @@
1
1
  import type { CliSpec } from "../manifest.generated.js";
2
+ import { type CliTree } from "../cliTree.generated.js";
3
+ /** Wrangler 4.169.0's whole command tree (docs/design/zero-unknowns.md): flags, aliases and usage lines. */
4
+ export declare const CLOUDFLARE_TREE: CliTree;
2
5
  export declare const CLOUDFLARE_CLI: CliSpec;
@@ -1,5 +1,8 @@
1
1
  // Generated by scripts/generate-control-plane-classifier.mjs. Do not edit.
2
2
  import CLI from "../sources/cloudflare/cli-flags.generated.js";
3
+ import TREE from "../sources/cloudflare/cli-tree.generated.js";
4
+ import { mergeAliases, mergeFlags, treeGroups, treeTables } from "../cliTree.generated.js";
5
+ import { cloudflareOverlayCapture } from "./cloudflareCommands.generated.js";
3
6
  /**
4
7
  * Wrangler capture (2026-11-21), from Cloudflare's command reference (Wrangler 4.x, `sources/cloudflare/`).
5
8
  *
@@ -325,6 +328,13 @@ const pagesRules = [
325
328
  on: "pages_project",
326
329
  summary: "Create Pages project {project}"
327
330
  },
331
+ {
332
+ match: "pages deployment create",
333
+ args: ["directory"],
334
+ action: "cloudflare.pages.deploy",
335
+ on: "pages_project",
336
+ summary: "Deploy Pages project {project}"
337
+ },
328
338
  {
329
339
  match: "pages project delete",
330
340
  args: ["project"],
@@ -363,10 +373,17 @@ const pagesRules = [
363
373
  ];
364
374
  const R = "Lists or shows; changes nothing";
365
375
  const LOCAL = "Runs on this computer only";
376
+ /** Wrangler 4.169.0's whole command tree (docs/design/zero-unknowns.md): flags, aliases and usage lines. */
377
+ export const CLOUDFLARE_TREE = TREE;
378
+ const tables = treeTables(CLOUDFLARE_TREE);
379
+ const HAND_RULES = [...workerRules, ...storageRules, ...pagesRules];
380
+ /** Every pinned command no hand rule names: the overlay's reads, local commands and "Other change" rules. */
381
+ const OVERLAY = cloudflareOverlayCapture(CLOUDFLARE_TREE, OTHER, new Set(HAND_RULES.map((rule) => rule.match)));
382
+ const HAND_GLOBAL = CLI.global;
366
383
  export const CLOUDFLARE_CLI = {
367
384
  programs: ["wrangler"],
368
385
  framework: "cobra",
369
- aliases: CLI.aliases,
386
+ aliases: mergeAliases(tables.aliases ?? {}, CLI.aliases),
370
387
  contextFlags: ["config", "cwd"],
371
388
  // Documented by Cloudflare: the account a command acts on. Any other CLOUDFLARE_* or WRANGLER_* variable set on the
372
389
  // line fails closed; credentials are never read.
@@ -386,12 +403,18 @@ export const CLOUDFLARE_CLI = {
386
403
  { file: "wrangler.json", format: "json", fields: { name: "script", account_id: "account" } }
387
404
  ],
388
405
  infoFlags: ["help", "version"],
389
- usage: CLI.usage,
390
- flags: { global: CLI.global, commands: CLI.commands },
406
+ usage: { ...tables.usage, ...CLI.usage },
407
+ // The reviewed flags (`cli-flags.json`) win over the tree's where both name one.
408
+ flags: {
409
+ global: [...HAND_GLOBAL, ...tables.flags.global.filter((spec) => !HAND_GLOBAL.some((g) => g.long === spec.long))],
410
+ commands: mergeFlags(tables.flags.commands, CLI.commands)
411
+ },
391
412
  remoteFlags: ["remote"],
392
413
  localFlags: ["local", "dry-run"],
393
- rules: [...workerRules, ...storageRules, ...pagesRules],
414
+ rules: [...HAND_RULES, ...OVERLAY.rules],
394
415
  reads: {
416
+ ...Object.fromEntries(treeGroups(CLOUDFLARE_TREE).map((group) => [group, "Prints its subcommands"])),
417
+ ...OVERLAY.reads,
395
418
  "versions list": R,
396
419
  "versions view": R,
397
420
  "versions secret list": "Lists secret names; never their values",
@@ -406,8 +429,6 @@ export const CLOUDFLARE_CLI = {
406
429
  types: LOCAL,
407
430
  init: LOCAL,
408
431
  docs: "Opens the docs",
409
- "check startup": LOCAL,
410
- build: LOCAL,
411
432
  "kv namespace list": R,
412
433
  "kv key get": R,
413
434
  "kv key list": R,
@@ -0,0 +1,17 @@
1
+ import type { Effect } from "../../controlPlaneActions.generated.js";
2
+ import type { CaptureRule } from "../manifest.generated.js";
3
+ import type { CliTree, CommandEffect } from "../cliTree.generated.js";
4
+ /** The Worker's own commands, and the bucket or queue a command's group names: where an overlay rule
5
+ * lands (first prefix wins; anything else is the platform). */
6
+ export declare const CLOUDFLARE_CLI_PLACES: ReadonlyArray<readonly [prefix: string, place: Pick<CaptureRule, "on" | "args">]>;
7
+ export declare const CLOUDFLARE_COMMANDS: Readonly<Record<string, CommandEffect>>;
8
+ /** Where an overlay command lands, and the positional arguments its place reads. */
9
+ export declare function cloudflarePlace(command: string): Pick<CaptureRule, "on" | "args">;
10
+ /** The capture rules and reads the overlay adds for commands no hand rule names. A command whose tree flags include
11
+ * `--remote` runs against the local simulator until it is given (Wrangler 4's convention). */
12
+ export declare function cloudflareOverlayCapture(tree: CliTree, other: string, ruled: ReadonlySet<string>): {
13
+ rules: CaptureRule[];
14
+ reads: Record<string, string>;
15
+ };
16
+ /** The (action, summary, effects) rows the overlay gives the server's call-effects table. */
17
+ export declare function cloudflareCommandCallEffects(other: string): Array<[string, string, readonly Effect[]]>;