passport-bridge 0.48.2 → 0.50.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.
- package/dist/cliHook.js +13 -0
- package/dist/cliHookAfter.js +10 -1
- package/dist/cliHookDecide.d.ts +9 -3
- package/dist/cliHookDecide.js +185 -28
- package/dist/cliHookDeliver.d.ts +2 -2
- package/dist/cliHookDeliver.js +8 -4
- package/dist/cliHookSessionState.d.ts +4 -1
- package/dist/cliHookSessionState.js +1 -1
- package/dist/connectorKit/callEffects.generated.d.ts +36 -0
- package/dist/connectorKit/callEffects.generated.js +73 -0
- package/dist/connectorKit/cli.generated.js +5 -2
- package/dist/connectorKit/engine.generated.d.ts +1 -1
- package/dist/connectorKit/engine.generated.js +32 -13
- package/dist/connectorKit/githubIds.generated.d.ts +1 -1
- package/dist/connectorKit/githubIds.generated.js +3 -2
- package/dist/connectorKit/manifest.generated.d.ts +34 -14
- package/dist/connectorKit/manifests/cloudflare.generated.d.ts +2 -0
- package/dist/connectorKit/manifests/cloudflare.generated.js +186 -0
- package/dist/connectorKit/manifests/cloudflareApi.generated.d.ts +4 -0
- package/dist/connectorKit/manifests/cloudflareApi.generated.js +207 -0
- package/dist/connectorKit/manifests/cloudflareCatalog.generated.d.ts +18 -0
- package/dist/connectorKit/manifests/cloudflareCatalog.generated.js +83 -0
- package/dist/connectorKit/manifests/cloudflareCli.generated.d.ts +2 -0
- package/dist/connectorKit/manifests/cloudflareCli.generated.js +441 -0
- package/dist/connectorKit/manifests/githubCapture.generated.js +19 -1
- package/dist/connectorKit/manifests/githubReads.generated.js +0 -3
- package/dist/connectorKit/manifests/kubernetes.generated.d.ts +76 -0
- package/dist/connectorKit/manifests/kubernetes.generated.js +210 -0
- package/dist/connectorKit/manifests/kubernetesArgs.generated.d.ts +21 -0
- package/dist/connectorKit/manifests/kubernetesArgs.generated.js +82 -0
- package/dist/connectorKit/manifests/kubernetesCli.generated.d.ts +30 -0
- package/dist/connectorKit/manifests/kubernetesCli.generated.js +530 -0
- package/dist/connectorKit/manifests/kubernetesEffects.generated.d.ts +15 -0
- package/dist/connectorKit/manifests/kubernetesEffects.generated.js +111 -0
- package/dist/connectorKit/manifests/kubernetesObjects.generated.d.ts +24 -0
- package/dist/connectorKit/manifests/kubernetesObjects.generated.js +154 -0
- package/dist/connectorKit/manifests/railwayHooks.generated.js +11 -5
- package/dist/connectorKit/manifests/sentry.generated.d.ts +6 -0
- package/dist/connectorKit/manifests/sentry.generated.js +27 -0
- package/dist/connectorKit/manifests/sentryApi.generated.d.ts +6 -0
- package/dist/connectorKit/manifests/sentryApi.generated.js +282 -0
- package/dist/connectorKit/manifests/sentryCapture.generated.d.ts +2 -0
- package/dist/connectorKit/manifests/sentryCapture.generated.js +165 -0
- package/dist/connectorKit/manifests/sentryCatalog.generated.d.ts +5 -0
- package/dist/connectorKit/manifests/sentryCatalog.generated.js +70 -0
- package/dist/connectorKit/manifests/sentryCli.generated.d.ts +2 -0
- package/dist/connectorKit/manifests/sentryCli.generated.js +230 -0
- package/dist/connectorKit/manifests/sentryIssues.generated.d.ts +20 -0
- package/dist/connectorKit/manifests/sentryIssues.generated.js +204 -0
- package/dist/connectorKit/manifests/supabase.generated.js +3 -2
- package/dist/connectorKit/manifests/supabaseApi.generated.js +52 -52
- package/dist/connectorKit/manifests/supabaseCapture.generated.js +22 -21
- package/dist/connectorKit/manifests/supabaseCatalog.generated.d.ts +2 -2
- package/dist/connectorKit/manifests/supabaseCatalog.generated.js +8 -7
- package/dist/connectorKit/manifests/supabaseCli.generated.js +32 -32
- package/dist/connectorKit/manifests/supabaseProbes.generated.js +29 -29
- package/dist/connectorKit/manifests/terraform.generated.d.ts +5 -0
- package/dist/connectorKit/manifests/terraform.generated.js +214 -0
- package/dist/connectorKit/manifests/terraformLink.generated.d.ts +30 -0
- package/dist/connectorKit/manifests/terraformLink.generated.js +73 -0
- package/dist/connectorKit/manifests/terraformPlan.generated.d.ts +48 -0
- package/dist/connectorKit/manifests/terraformPlan.generated.js +192 -0
- package/dist/connectorKit/params.generated.js +2 -0
- package/dist/connectorKit/shell.generated.d.ts +5 -1
- package/dist/connectorKit/shell.generated.js +121 -20
- package/dist/connectorKit/sources/cloudflare/api-operations.generated.d.ts +37 -0
- package/dist/connectorKit/sources/cloudflare/api-operations.generated.js +2 -0
- package/dist/connectorKit/sources/cloudflare/cli-flags.generated.d.ts +617 -0
- package/dist/connectorKit/sources/cloudflare/cli-flags.generated.js +2 -0
- package/dist/connectorKit/sources/cloudflare/mcp-tools.generated.d.ts +16 -0
- package/dist/connectorKit/sources/cloudflare/mcp-tools.generated.js +2 -0
- package/dist/connectorKit/sources/sentry/api-operations.generated.d.ts +121 -0
- package/dist/connectorKit/sources/sentry/api-operations.generated.js +2 -0
- package/dist/connectorKit/sources/sentry/cli-commands.generated.d.ts +530 -0
- package/dist/connectorKit/sources/sentry/cli-commands.generated.js +2 -0
- package/dist/connectorKit/sources/sentry/mcp-tools.generated.d.ts +32 -0
- package/dist/connectorKit/sources/sentry/mcp-tools.generated.js +2 -0
- package/dist/connectorKit/template.generated.d.ts +8 -4
- package/dist/connectorKit/template.generated.js +19 -6
- package/dist/controlPlane.generated.d.ts +11 -2
- package/dist/controlPlaneActions.generated.d.ts +52 -12
- package/dist/controlPlaneActions.generated.js +40 -11
- package/dist/controlPlaneAnswer.d.ts +35 -0
- package/dist/controlPlaneAnswer.js +23 -0
- package/dist/controlPlaneCli.d.ts +1 -1
- package/dist/controlPlaneCloudflare.d.ts +70 -0
- package/dist/controlPlaneCloudflare.js +188 -0
- package/dist/controlPlaneGuard.d.ts +6 -31
- package/dist/controlPlaneGuard.js +17 -24
- package/dist/controlPlaneKubernetes.d.ts +72 -0
- package/dist/controlPlaneKubernetes.js +260 -0
- package/dist/controlPlaneModel.generated.d.ts +6 -0
- package/dist/controlPlaneNpm.generated.d.ts +83 -0
- package/dist/controlPlaneNpm.generated.js +307 -0
- package/dist/controlPlaneNpmCommands.generated.d.ts +35 -0
- package/dist/controlPlaneNpmCommands.generated.js +567 -0
- package/dist/controlPlaneNpmGuard.d.ts +44 -0
- package/dist/controlPlaneNpmGuard.js +210 -0
- package/dist/controlPlaneOffline.d.ts +1 -1
- package/dist/controlPlaneRailway.generated.js +2 -2
- package/dist/controlPlaneRailwayCli.generated.js +13 -2
- package/dist/controlPlaneRailwayGuard.d.ts +1 -1
- package/dist/controlPlaneRailwayGuard.js +1 -1
- package/dist/controlPlaneRailwayModel.generated.d.ts +5 -0
- package/dist/controlPlaneRailwayModel.generated.js +15 -1
- package/dist/controlPlaneSentry.d.ts +68 -0
- package/dist/controlPlaneSentry.js +205 -0
- package/dist/controlPlaneSupabase.d.ts +1 -1
- package/dist/controlPlaneSupabase.js +1 -1
- package/dist/controlPlaneTerraform.d.ts +86 -0
- package/dist/controlPlaneTerraform.js +273 -0
- package/dist/controlPlaneUnnamed.generated.d.ts +41 -2
- package/dist/controlPlaneUnnamed.generated.js +148 -2
- package/dist/cpCli.d.ts +1 -1
- package/dist/cpCli.js +1 -1
- package/dist/gitPush.d.ts +8 -3
- package/dist/gitPush.js +37 -12
- package/dist/githubMergeHold.d.ts +42 -0
- package/dist/githubMergeHold.js +134 -0
- package/dist/githubMergeIds.d.ts +18 -0
- package/dist/githubMergeIds.js +51 -0
- package/dist/pluginPin.d.ts +1 -1
- package/dist/pluginPin.js +1 -1
- package/dist/terraformPlans.d.ts +45 -0
- package/dist/terraformPlans.js +96 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
* or SQL the parser shows only reads returns null.
|
|
18
18
|
*/
|
|
19
19
|
import { nodeId } from "../controlPlane.generated.js";
|
|
20
|
-
import { unnamedApi, unnamedCli } from "../controlPlaneUnnamed.generated.js";
|
|
20
|
+
import { knowsCommandWords, unnamedApi, unnamedCli, unnamedMcp, unnamedSummary } from "../controlPlaneUnnamed.generated.js";
|
|
21
21
|
import { knownOps, normalizeCli } from "./cli.generated.js";
|
|
22
22
|
import { MANIFEST_SCHEMA } from "./manifest.generated.js";
|
|
23
23
|
import { canonical, holds } from "./params.generated.js";
|
|
24
24
|
import { classifySql, SQL_LABEL } from "./sql.generated.js";
|
|
25
|
-
import { fill,
|
|
26
|
-
export { at, fill, parseTemplate, placeholders, render, safeName } from "./template.generated.js";
|
|
25
|
+
import { fill, render, safeName, valuePlaceholders } from "./template.generated.js";
|
|
26
|
+
export { at, fill, parseTemplate, placeholders, render, safeName, valuePlaceholders } from "./template.generated.js";
|
|
27
27
|
/* ------------------------------------------------------------------ */
|
|
28
28
|
/* Normalize */
|
|
29
29
|
/* ------------------------------------------------------------------ */
|
|
@@ -85,12 +85,19 @@ function normalizeApi(m, method, url, body) {
|
|
|
85
85
|
const path = parsed.pathname.replace(/\/{2,}/g, "/").replace(/(.)\/+$/, "$1");
|
|
86
86
|
const verb = method.toUpperCase();
|
|
87
87
|
const query = {};
|
|
88
|
+
const lists = new Set(m.capture.api.lists ?? []);
|
|
88
89
|
let duplicate = false;
|
|
89
90
|
parsed.searchParams.forEach((value, key) => {
|
|
91
|
+
const held = query[key];
|
|
92
|
+
// A key the vendor documents as repeatable (Sentry's `?id=1&id=2`) is a list.
|
|
93
|
+
if (lists.has(key))
|
|
94
|
+
query[key] = typeof held === "string" ? [held, value] : Array.isArray(held) ? [...held, value] : value;
|
|
90
95
|
// The same key twice with different values: servers disagree on which wins, so neither can be trusted.
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
96
|
+
else {
|
|
97
|
+
if (held !== undefined && held !== value)
|
|
98
|
+
duplicate = true;
|
|
99
|
+
query[key] = value;
|
|
100
|
+
}
|
|
94
101
|
});
|
|
95
102
|
const { routes, byLength } = routesOf(m);
|
|
96
103
|
const match = (route, whole) => {
|
|
@@ -147,7 +154,7 @@ function normalizeApi(m, method, url, body) {
|
|
|
147
154
|
.split("/")
|
|
148
155
|
.filter(Boolean)
|
|
149
156
|
.slice(known ? known.split("/").filter(Boolean).length : 0);
|
|
150
|
-
const route = `${known ?? ""}/${rest.map((part) => (/^[a-z][a-z_-]{0,40}$/.test(part) ? part : "…")).join("/")}`;
|
|
157
|
+
const route = `${(known ?? "").replace(/\/+$/, "")}/${rest.map((part) => (/^[a-z][a-z_-]{0,40}$/.test(part) ? part : "…")).join("/")}`;
|
|
151
158
|
return {
|
|
152
159
|
iface: "api",
|
|
153
160
|
op: `${verb} ${path}`,
|
|
@@ -281,7 +288,7 @@ function listWhereOne(m, part, params, each) {
|
|
|
281
288
|
...(part.summaryElse ?? [])
|
|
282
289
|
].filter((t) => typeof t === "string");
|
|
283
290
|
return templates
|
|
284
|
-
.flatMap(
|
|
291
|
+
.flatMap(valuePlaceholders)
|
|
285
292
|
.some((name) => name !== each && Array.isArray(params[name]) && params[name].length > 1);
|
|
286
293
|
}
|
|
287
294
|
function buildSql(m, part, p, at, out) {
|
|
@@ -296,10 +303,11 @@ function buildSql(m, part, p, at, out) {
|
|
|
296
303
|
if (seen.has(`${actionKey} ${finding.category} ${finding.table ?? ""}`))
|
|
297
304
|
continue;
|
|
298
305
|
seen.add(`${actionKey} ${finding.category} ${finding.table ?? ""}`);
|
|
299
|
-
const label = actionKey === m.capture.unclassified
|
|
306
|
+
const label = actionKey === m.capture.unclassified || actionKey === m.capture.other
|
|
300
307
|
? SQL_LABEL[finding.category]
|
|
301
308
|
: m.actions.find((a) => a.key === actionKey).label;
|
|
302
|
-
const
|
|
309
|
+
const table = m.capture.sqlDialect === "sqlite" ? finding.table?.replace(/^public\./, "") : finding.table;
|
|
310
|
+
const t = table ? { type: "table", key: table, name: table } : undefined;
|
|
303
311
|
const where = part.summary ? summaryOf(part, part.summary, p) : "";
|
|
304
312
|
out.push({
|
|
305
313
|
nodeId: at.nodeId,
|
|
@@ -342,21 +350,27 @@ function summaryOf(part, summary, p) {
|
|
|
342
350
|
return fill(all, p) ?? render(all[all.length - 1], p);
|
|
343
351
|
}
|
|
344
352
|
/** What an unnamed request hit, coarse (`controlPlaneUnnamed.ts`): an API call's method and path template, a command
|
|
345
|
-
* line's program and the words the CLI itself uses, up to the first it doesn't
|
|
353
|
+
* line's program and the words the CLI itself uses, up to the first it doesn't, an MCP tool's name. */
|
|
346
354
|
function unnamedOf(m, n, ops) {
|
|
355
|
+
if (n.iface === "mcp")
|
|
356
|
+
return unnamedMcp(n.op);
|
|
347
357
|
if (n.iface === "api") {
|
|
348
358
|
const [method, path] = n.op.split(" ");
|
|
349
359
|
return unnamedApi(m.platform, method, path ?? "");
|
|
350
360
|
}
|
|
351
361
|
if (n.iface !== "cli")
|
|
352
362
|
return undefined;
|
|
363
|
+
const program = m.capture.cli.programs[0] ?? m.platform;
|
|
364
|
+
// A CLI whose own words Passport knows keeps them even where the manifest names no command (`wrangler containers`).
|
|
365
|
+
if (knowsCommandWords(program))
|
|
366
|
+
return unnamedCli([program, ...n.op.split(" ")]);
|
|
353
367
|
const words = [];
|
|
354
368
|
for (const [i, part] of n.op.split(" ").entries()) {
|
|
355
369
|
if (!ops.some((op) => op.split(" ")[i] === part))
|
|
356
370
|
break;
|
|
357
371
|
words.push(part);
|
|
358
372
|
}
|
|
359
|
-
return unnamedCli([
|
|
373
|
+
return unnamedCli([program, ...words]);
|
|
360
374
|
}
|
|
361
375
|
/** What a request that fails closed becomes: the Unclassified Action, on the most specific node it names. */
|
|
362
376
|
function unclassified(m, n, params, context, hooks, problem = n.problem) {
|
|
@@ -380,7 +394,12 @@ function unclassified(m, n, params, context, hooks, problem = n.problem) {
|
|
|
380
394
|
? nodeId(m.platform, m.types.find((t) => t.type === action.appliesTo)?.service ?? m.services[0].key)
|
|
381
395
|
: at.nodeId,
|
|
382
396
|
actionKey: m.capture.unclassified,
|
|
383
|
-
summary: `${
|
|
397
|
+
summary: `${m.capture.unnamedSummary === "words"
|
|
398
|
+
? unnamedSummary(m.label, unnamed, {
|
|
399
|
+
program: m.capture.cli.programs[0] ?? m.platform,
|
|
400
|
+
...(n.iface === "mcp" ? { tool: safeName(n.op) ?? "…" } : {})
|
|
401
|
+
})
|
|
402
|
+
: `${action.label}: ${what}`}${problem ? ` (${safeName(problem) ?? "invalid flags"})` : ""}`,
|
|
384
403
|
nodes: at.unresolved ? [] : at.chain,
|
|
385
404
|
...(unnamed ? { unnamed } : {})
|
|
386
405
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** GitHub node ids, branch matching, and the builders the webhook mapping writes summaries with (`manifests/githubEvents.ts`). Requests are classified by the kit (`githubDecide.ts`). */
|
|
2
2
|
import type { Effect } from "../controlPlaneActions.generated.js";
|
|
3
|
-
import type
|
|
3
|
+
import { type UnnamedHit } from "../controlPlaneUnnamed.generated.js";
|
|
4
4
|
export declare const lower: (value: string) => string;
|
|
5
5
|
export declare const githubNodeIds: {
|
|
6
6
|
platform: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Generated by scripts/generate-control-plane-classifier.mjs. Do not edit.
|
|
2
2
|
/** GitHub node ids, branch matching, and the builders the webhook mapping writes summaries with (`manifests/githubEvents.ts`). Requests are classified by the kit (`githubDecide.ts`). */
|
|
3
3
|
import { nodeId } from "../controlPlane.generated.js";
|
|
4
|
+
import { unnamedSummary } from "../controlPlaneUnnamed.generated.js";
|
|
4
5
|
/* ------------------------------------------------------------------ */
|
|
5
6
|
/* Node ids */
|
|
6
7
|
/* ------------------------------------------------------------------ */
|
|
@@ -132,12 +133,12 @@ export const unclassifiedGh = (r, unnamed) => ({
|
|
|
132
133
|
? {
|
|
133
134
|
nodeId: repoNode(r.owner, r.repo),
|
|
134
135
|
actionKey: "github.unclassified",
|
|
135
|
-
summary:
|
|
136
|
+
summary: unnamedSummary("GitHub", undefined, { program: "gh", where: slug(r) })
|
|
136
137
|
}
|
|
137
138
|
: {
|
|
138
139
|
nodeId: githubNodeIds.repos,
|
|
139
140
|
actionKey: "github.unclassified",
|
|
140
|
-
summary: "
|
|
141
|
+
summary: unnamedSummary("GitHub", undefined, { program: "gh" })
|
|
141
142
|
}),
|
|
142
143
|
...(unnamed ? { unnamed } : {})
|
|
143
144
|
});
|
|
@@ -39,13 +39,16 @@ export type NodeSpec = {
|
|
|
39
39
|
} | "service";
|
|
40
40
|
};
|
|
41
41
|
/** Param conditions: true = present and truthy, false = absent or falsy, a string or list = equals one of,
|
|
42
|
-
* { match } = a string value matching the regex, { present } = the field is sent at all (even as null)
|
|
42
|
+
* { match } = a string value matching the regex, { present } = the field is sent at all (even as null),
|
|
43
|
+
* { many } = the param holds several values (a bulk call's list of ids) or not.
|
|
43
44
|
* Under the name "*": { keys } = the body (API) or arguments (MCP) send a top-level field whose name matches
|
|
44
45
|
* the regex (Supabase's auth config: a provider field among 200 settings). */
|
|
45
46
|
export type When = Readonly<Record<string, boolean | string | readonly string[] | {
|
|
46
47
|
match: string;
|
|
47
48
|
} | {
|
|
48
49
|
present: boolean;
|
|
50
|
+
} | {
|
|
51
|
+
many: boolean;
|
|
49
52
|
} | {
|
|
50
53
|
keys: string;
|
|
51
54
|
}>>;
|
|
@@ -115,12 +118,26 @@ export type FlagSpec = {
|
|
|
115
118
|
* or "none": not decided at all, for a platform whose lists don't yet cover its vendor's sources (GitHub's `gh`
|
|
116
119
|
* commands and REST routes until its generated catalog). A known one with a bad flag or field still fails closed. */
|
|
117
120
|
export type UnknownOp = "unclassified" | "none";
|
|
121
|
+
/** A folder's link file. "text": the file is the value of `param`. "json": `fields` maps the file's top-level keys to
|
|
122
|
+
* params ("jsonc" also allows comments and trailing commas). "toml": the same, from the file's top-level `key = "value"`
|
|
123
|
+
* lines before its first table (Wrangler's `name`, `account_id`). "ini": `fields` maps "section.key" to params (Sentry's
|
|
124
|
+
* `.sentryclirc`, `[defaults] org = acme`). */
|
|
125
|
+
export type LinkSpec = {
|
|
126
|
+
file: string;
|
|
127
|
+
format: "text";
|
|
128
|
+
param: string;
|
|
129
|
+
} | {
|
|
130
|
+
file: string;
|
|
131
|
+
format: "json" | "jsonc" | "toml" | "ini";
|
|
132
|
+
fields: Readonly<Record<string, string>>;
|
|
133
|
+
};
|
|
118
134
|
export type CliSpec = {
|
|
119
135
|
programs: readonly string[];
|
|
120
136
|
unknown?: UnknownOp;
|
|
121
137
|
/** How the CLI parses flags. cobra: booleans take =1/t/T/true/TRUE/True or =0/f/F/false/FALSE/False.
|
|
122
|
-
* arg (Vercel's parser): a boolean takes no value at all; `--flag=x` on a boolean is an error.
|
|
123
|
-
|
|
138
|
+
* arg (Vercel's parser): a boolean takes no value at all; `--flag=x` on a boolean is an error.
|
|
139
|
+
* go (Go's flag package, Terraform): one dash or two, no grouped letters; booleans take =true or =false. */
|
|
140
|
+
framework: "cobra" | "arg" | "go";
|
|
124
141
|
/** Other spellings of commands ("env rm" → "env remove", "ls" → "list"), from the vendor's spec. */
|
|
125
142
|
aliases?: Readonly<Record<string, string>>;
|
|
126
143
|
/** What the program does with no command, or with a first word that isn't one (`vercel` deploys). */
|
|
@@ -134,17 +151,9 @@ export type CliSpec = {
|
|
|
134
151
|
envPrefixes?: readonly string[];
|
|
135
152
|
/** Variables with those prefixes that never change the target (a token). Their values are never read. */
|
|
136
153
|
envIgnore?: readonly string[];
|
|
137
|
-
/** Where a folder's link lives, relative to the folder; the guard looks in the folder and its parents.
|
|
138
|
-
*
|
|
139
|
-
link?:
|
|
140
|
-
file: string;
|
|
141
|
-
format: "text";
|
|
142
|
-
param: string;
|
|
143
|
-
} | {
|
|
144
|
-
file: string;
|
|
145
|
-
format: "json";
|
|
146
|
-
fields: Readonly<Record<string, string>>;
|
|
147
|
-
};
|
|
154
|
+
/** Where a folder's link lives, relative to the folder; the guard looks in the folder and its parents. Several:
|
|
155
|
+
* the first that a folder has wins (`wrangler.toml`, then `wrangler.json`). */
|
|
156
|
+
link?: LinkSpec | readonly LinkSpec[];
|
|
148
157
|
/** Commands that change the link (`link`, `unlink`): later commands in the same line have no link. */
|
|
149
158
|
linkCommands?: readonly string[];
|
|
150
159
|
/** Flags that only print (help, version): the command doesn't run. */
|
|
@@ -198,6 +207,9 @@ export type CaptureSpec = {
|
|
|
198
207
|
unknown?: UnknownOp;
|
|
199
208
|
/** Query keys that name what a call acts on (Vercel's teamId); no other query key can set a node param. */
|
|
200
209
|
query?: readonly string[];
|
|
210
|
+
/** Query keys the vendor documents as repeatable (Sentry's bulk `?id=1&id=2`): their values are a list. Any
|
|
211
|
+
* other key given twice with two values fails closed. */
|
|
212
|
+
lists?: readonly string[];
|
|
201
213
|
};
|
|
202
214
|
/** What each MCP tool and API route declares it takes, generated from the vendor's own schemas
|
|
203
215
|
* (`sourcegen.ts`), never written by hand. When an operation has one, a param is read only from a field
|
|
@@ -206,10 +218,18 @@ export type CaptureSpec = {
|
|
|
206
218
|
mcp?: Readonly<Record<string, OpInputs>>;
|
|
207
219
|
api?: Readonly<Record<string, OpInputs>>;
|
|
208
220
|
};
|
|
221
|
+
/** "words": an action Passport can't name says so in `unnamedSummary`'s shape ("Run a wrangler command Passport can't
|
|
222
|
+
* name: containers delete"), as GitHub's do; absent: "<Unclassified action's label>: <op>" (older manifests). */
|
|
223
|
+
unnamedSummary?: "words";
|
|
224
|
+
/** "sqlite" (D1): the parser is Postgres's, so a table it names "public.x" is just "x". */
|
|
225
|
+
sqlDialect?: "postgres" | "sqlite";
|
|
209
226
|
/** SQL categories (sql.ts) → Action keys; a category not listed is a read. */
|
|
210
227
|
sql: Readonly<Partial<Record<SqlCategory, string>>>;
|
|
211
228
|
/** What anything unnamed becomes: an Action of kind Unclassified (2026-11-17), never assumed to be a Delete. */
|
|
212
229
|
unclassified: string;
|
|
230
|
+
/** The catch-all write ("Other change"): SQL mapped to it keeps its category's words ("Empty a table"), as
|
|
231
|
+
* Unclassified does; its effects come call by call from those words (the action model, 2026-11-20). */
|
|
232
|
+
other?: string;
|
|
213
233
|
};
|
|
214
234
|
export type SqlCategory = "drop_database" | "drop_schema" | "drop_table" | "truncate" | "delete_all" | "rls_off" | "grant" | "ddl" | "write" | "export" | "opaque"
|
|
215
235
|
/** Drops what holds data or what data depends on: a column, a view, a type, an extension, a function. */
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
// Generated by scripts/generate-control-plane-classifier.mjs. Do not edit.
|
|
2
|
+
import { MANIFEST_SCHEMA } from "../manifest.generated.js";
|
|
3
|
+
import { inputsOf } from "../sourcegen.generated.js";
|
|
4
|
+
import API from "../sources/cloudflare/api-operations.generated.js";
|
|
5
|
+
import MCP from "../sources/cloudflare/mcp-tools.generated.js";
|
|
6
|
+
import { CLOUDFLARE_API_POST_READS, CLOUDFLARE_API_RULES } from "./cloudflareApi.generated.js";
|
|
7
|
+
import { CLOUDFLARE_ACTIONS, CLOUDFLARE_NODES, CLOUDFLARE_SERVICES, CLOUDFLARE_TYPES } from "./cloudflareCatalog.generated.js";
|
|
8
|
+
import { CLOUDFLARE_CLI } from "./cloudflareCli.generated.js";
|
|
9
|
+
/**
|
|
10
|
+
* Cloudflare at Level 1 (2026-11-21): what an agent asks Cloudflare to do through Wrangler, the API v4 (a `curl` line
|
|
11
|
+
* or `passport exec`) and Cloudflare's MCP servers, named from Cloudflare's own references. No App setup yet, so no
|
|
12
|
+
* feed: Cloudflare's own dashboard and other tools are outside activity Passport doesn't see.
|
|
13
|
+
*/
|
|
14
|
+
const OTHER = "cloudflare.account.change";
|
|
15
|
+
/** Every GET the sources list is a read, as are the POSTs that only read. */
|
|
16
|
+
const apiReads = {
|
|
17
|
+
...Object.fromEntries(API.items.filter((op) => op.method === "GET").map((op) => [`GET ${op.path}`, "get"])),
|
|
18
|
+
...CLOUDFLARE_API_POST_READS
|
|
19
|
+
};
|
|
20
|
+
export const CLOUDFLARE = {
|
|
21
|
+
schema: MANIFEST_SCHEMA,
|
|
22
|
+
platform: "cloudflare",
|
|
23
|
+
label: "Cloudflare",
|
|
24
|
+
version: 1,
|
|
25
|
+
plans: ["free", "pro", "business", "enterprise"],
|
|
26
|
+
identity: "member",
|
|
27
|
+
services: CLOUDFLARE_SERVICES,
|
|
28
|
+
types: CLOUDFLARE_TYPES,
|
|
29
|
+
nodes: CLOUDFLARE_NODES,
|
|
30
|
+
actions: CLOUDFLARE_ACTIONS,
|
|
31
|
+
capture: {
|
|
32
|
+
params: {
|
|
33
|
+
script: { cli: ["name", "@linked.script"], mcp: ["scriptName"], api: ["script_name"] },
|
|
34
|
+
env: { cli: ["env"] },
|
|
35
|
+
account: { cli: ["@linked.account"], api: ["account_id"] },
|
|
36
|
+
zone: { cli: ["zone-id"], mcp: ["zone"], api: ["zone_id"] },
|
|
37
|
+
record: { api: ["dns_record_id"] },
|
|
38
|
+
recordName: { api: ["name"] },
|
|
39
|
+
name: { mcp: ["name"], api: ["name"] },
|
|
40
|
+
title: { mcp: ["title"], api: ["title"] },
|
|
41
|
+
namespace: { cli: ["namespace-id"], mcp: ["namespace_id"], api: ["namespace_id"] },
|
|
42
|
+
binding: { cli: ["binding"] },
|
|
43
|
+
bucket: { mcp: ["name"], api: ["bucket_name"] },
|
|
44
|
+
database: { mcp: ["name"] },
|
|
45
|
+
databaseId: { mcp: ["database_id"], api: ["database_id"] },
|
|
46
|
+
query: { cli: ["command"], mcp: ["sql"], api: ["sql"] },
|
|
47
|
+
file: { cli: ["file"] },
|
|
48
|
+
project: { cli: ["project-name"], api: ["project_name"] },
|
|
49
|
+
queue: { api: ["queue_id"] },
|
|
50
|
+
queueName: { api: ["queue_name"] },
|
|
51
|
+
secret: { api: ["secret_name", "name"] },
|
|
52
|
+
setting: { api: ["setting_id"] },
|
|
53
|
+
phase: { api: ["ruleset_phase"] },
|
|
54
|
+
token: { api: ["token_id"] },
|
|
55
|
+
status: { api: ["status"] },
|
|
56
|
+
routeScript: { api: ["script"] },
|
|
57
|
+
mode: { api: ["mode"] },
|
|
58
|
+
enabled: { api: ["enabled"] },
|
|
59
|
+
paused: { api: ["paused"] },
|
|
60
|
+
purge_everything: { api: ["purge_everything"] },
|
|
61
|
+
hyperdrive: { mcp: ["hyperdrive_id"] }
|
|
62
|
+
},
|
|
63
|
+
split: [
|
|
64
|
+
// `r2 object <bucket>/<key>`: the bucket names the node; the key is the target (two segments kept).
|
|
65
|
+
{ from: "objectPath", cases: [{ match: "^([^/]+)/(.+)$", as: ["bucket", "object"] }] }
|
|
66
|
+
],
|
|
67
|
+
cli: CLOUDFLARE_CLI,
|
|
68
|
+
mcp: {
|
|
69
|
+
prefixes: [
|
|
70
|
+
"mcp__cloudflare-bindings__",
|
|
71
|
+
"mcp__cloudflare-observability__",
|
|
72
|
+
"mcp__cloudflare-dns-analytics__",
|
|
73
|
+
"mcp__cloudflare-api__",
|
|
74
|
+
"mcp__cloudflare__",
|
|
75
|
+
"cloudflare__",
|
|
76
|
+
"cloudflare.",
|
|
77
|
+
"cloudflare_"
|
|
78
|
+
],
|
|
79
|
+
rules: [
|
|
80
|
+
{ match: "kv_namespace_create", action: OTHER, on: "platform", summary: "Create KV namespace {title}" },
|
|
81
|
+
{
|
|
82
|
+
match: "kv_namespace_delete",
|
|
83
|
+
action: "cloudflare.kv.delete",
|
|
84
|
+
on: "kv_namespace",
|
|
85
|
+
summary: "Delete KV namespace {namespace}"
|
|
86
|
+
},
|
|
87
|
+
{ match: "kv_namespace_update", action: OTHER, on: "kv_namespace", summary: "Rename KV namespace {namespace}" },
|
|
88
|
+
{ match: "r2_bucket_create", action: OTHER, on: "bucket", summary: "Create R2 bucket {bucket}" },
|
|
89
|
+
{
|
|
90
|
+
match: "r2_bucket_delete",
|
|
91
|
+
action: "cloudflare.r2.delete",
|
|
92
|
+
on: "bucket",
|
|
93
|
+
summary: "Delete R2 bucket {bucket}"
|
|
94
|
+
},
|
|
95
|
+
{ match: "d1_database_create", action: OTHER, on: "d1_database", summary: "Create D1 database {database}" },
|
|
96
|
+
{
|
|
97
|
+
match: "d1_database_delete",
|
|
98
|
+
action: "cloudflare.d1.delete",
|
|
99
|
+
on: "d1_database",
|
|
100
|
+
summary: "Delete D1 database {databaseId}"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
match: "d1_database_query",
|
|
104
|
+
action: "sql:query",
|
|
105
|
+
on: "d1_database",
|
|
106
|
+
summary: "Run SQL on D1 database {databaseId}"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
match: "hyperdrive_config_edit",
|
|
110
|
+
action: OTHER,
|
|
111
|
+
on: "platform",
|
|
112
|
+
summary: "Change Hyperdrive config {hyperdrive}"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
match: "hyperdrive_config_delete",
|
|
116
|
+
action: OTHER,
|
|
117
|
+
on: "platform",
|
|
118
|
+
summary: "Delete Hyperdrive config {hyperdrive}"
|
|
119
|
+
},
|
|
120
|
+
// Code that runs against Cloudflare's API: Passport can't read what it does.
|
|
121
|
+
{
|
|
122
|
+
match: "execute",
|
|
123
|
+
action: "cloudflare.unclassified",
|
|
124
|
+
on: "platform",
|
|
125
|
+
summary: "Use a Cloudflare tool Passport can't name: execute"
|
|
126
|
+
}
|
|
127
|
+
],
|
|
128
|
+
reads: {
|
|
129
|
+
accounts_list: "Lists accounts; changes nothing",
|
|
130
|
+
set_active_account: "Picks the account later calls use; changes nothing on Cloudflare",
|
|
131
|
+
kv_namespaces_list: "Lists namespaces; changes nothing",
|
|
132
|
+
kv_namespace_get: "Shows a namespace",
|
|
133
|
+
workers_list: "Lists Workers; changes nothing",
|
|
134
|
+
workers_get_worker: "Shows a Worker",
|
|
135
|
+
workers_get_worker_code: "Shows a Worker's code",
|
|
136
|
+
r2_buckets_list: "Lists buckets; changes nothing",
|
|
137
|
+
r2_bucket_get: "Shows a bucket",
|
|
138
|
+
d1_databases_list: "Lists databases; changes nothing",
|
|
139
|
+
d1_database_get: "Shows a database",
|
|
140
|
+
hyperdrive_configs_list: "Lists configs; changes nothing",
|
|
141
|
+
hyperdrive_config_get: "Shows a config",
|
|
142
|
+
search_cloudflare_documentation: "Searches the docs",
|
|
143
|
+
migrate_pages_to_workers_guide: "Returns a guide",
|
|
144
|
+
query_worker_observability: "Queries Worker logs",
|
|
145
|
+
observability_keys: "Lists log keys",
|
|
146
|
+
observability_values: "Lists log values",
|
|
147
|
+
dns_report: "Reports DNS analytics",
|
|
148
|
+
show_your_zone_dns_settings: "Shows DNS settings",
|
|
149
|
+
search: "Searches Cloudflare's API spec; calls nothing"
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
api: {
|
|
153
|
+
base: "https://api.cloudflare.com",
|
|
154
|
+
rules: CLOUDFLARE_API_RULES,
|
|
155
|
+
reads: apiReads
|
|
156
|
+
},
|
|
157
|
+
inputs: inputsOf(API.items, MCP.items),
|
|
158
|
+
// D1 is SQLite: what each statement does, in its own words, recorded as "Run SQL on a D1 database" (`other` keeps
|
|
159
|
+
// the words); SQL Passport can't read (always, on this computer) may be destructive.
|
|
160
|
+
unnamedSummary: "words",
|
|
161
|
+
sqlDialect: "sqlite",
|
|
162
|
+
sql: {
|
|
163
|
+
drop_database: "cloudflare.d1.write",
|
|
164
|
+
drop_schema: "cloudflare.d1.write",
|
|
165
|
+
drop_table: "cloudflare.d1.write",
|
|
166
|
+
truncate: "cloudflare.d1.write",
|
|
167
|
+
delete_all: "cloudflare.d1.write",
|
|
168
|
+
drop_object: "cloudflare.d1.write",
|
|
169
|
+
rls_off: "cloudflare.d1.write",
|
|
170
|
+
grant: "cloudflare.d1.write",
|
|
171
|
+
ddl: "cloudflare.d1.write",
|
|
172
|
+
write: "cloudflare.d1.write",
|
|
173
|
+
export: "cloudflare.d1.write",
|
|
174
|
+
code: "cloudflare.d1.write",
|
|
175
|
+
policy: "cloudflare.d1.write",
|
|
176
|
+
protected: "cloudflare.d1.write",
|
|
177
|
+
bucket_public: "cloudflare.d1.write",
|
|
178
|
+
auth_provider: "cloudflare.d1.write",
|
|
179
|
+
opaque: "cloudflare.d1.write"
|
|
180
|
+
},
|
|
181
|
+
unclassified: "cloudflare.unclassified",
|
|
182
|
+
other: "cloudflare.d1.write"
|
|
183
|
+
},
|
|
184
|
+
probes: [],
|
|
185
|
+
logs: []
|
|
186
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CaptureRule } from "../manifest.generated.js";
|
|
2
|
+
export declare const CLOUDFLARE_API_RULES: readonly CaptureRule[];
|
|
3
|
+
/** POST routes that only read (a tail, a bulk read, an export to the caller). */
|
|
4
|
+
export declare const CLOUDFLARE_API_POST_READS: Readonly<Record<string, string>>;
|