@every-app/sdk 0.2.0 → 0.3.0-rc.1
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/README.md +608 -2
- package/dist/cloudflare/index.d.ts +22 -0
- package/dist/cloudflare/index.d.ts.map +1 -0
- package/dist/cloudflare/index.js +21 -0
- package/dist/cloudflare/sentinel.d.ts +69 -0
- package/dist/cloudflare/sentinel.d.ts.map +1 -0
- package/dist/cloudflare/sentinel.js +50 -0
- package/dist/cloudflare/worker.d.ts +511 -0
- package/dist/cloudflare/worker.d.ts.map +1 -0
- package/dist/cloudflare/worker.js +738 -0
- package/dist/dev/index.d.ts +8 -0
- package/dist/dev/index.d.ts.map +1 -0
- package/dist/dev/index.js +7 -0
- package/dist/dev/keypair.d.ts +24 -0
- package/dist/dev/keypair.d.ts.map +1 -0
- package/dist/dev/keypair.js +60 -0
- package/dist/internal/aiProviders.d.ts +67 -0
- package/dist/internal/aiProviders.d.ts.map +1 -0
- package/dist/internal/aiProviders.js +220 -0
- package/dist/internal/appSettings.d.ts +237 -0
- package/dist/internal/appSettings.d.ts.map +1 -0
- package/dist/internal/appSettings.js +374 -0
- package/dist/internal/capabilities.d.ts +1344 -0
- package/dist/internal/capabilities.d.ts.map +1 -0
- package/dist/internal/capabilities.js +1521 -0
- package/dist/internal/devProviders.d.ts +49 -0
- package/dist/internal/devProviders.d.ts.map +1 -0
- package/dist/internal/devProviders.js +62 -0
- package/dist/internal/email.d.ts +280 -0
- package/dist/internal/email.d.ts.map +1 -0
- package/dist/internal/email.js +613 -0
- package/dist/internal/events.d.ts +182 -0
- package/dist/internal/events.d.ts.map +1 -0
- package/dist/internal/events.js +324 -0
- package/dist/internal/gatewaySettings.d.ts +82 -0
- package/dist/internal/gatewaySettings.d.ts.map +1 -0
- package/dist/internal/gatewaySettings.js +209 -0
- package/dist/internal/identity.d.ts +18 -3
- package/dist/internal/identity.d.ts.map +1 -1
- package/dist/internal/identity.js +53 -14
- package/dist/internal/index.d.ts +17 -1
- package/dist/internal/index.d.ts.map +1 -1
- package/dist/internal/index.js +17 -1
- package/dist/internal/members.d.ts +35 -0
- package/dist/internal/members.d.ts.map +1 -0
- package/dist/internal/members.js +7 -0
- package/dist/internal/oauthClient.d.ts +63 -0
- package/dist/internal/oauthClient.d.ts.map +1 -0
- package/dist/internal/oauthClient.js +194 -0
- package/dist/internal/oauthScopes.d.ts +117 -0
- package/dist/internal/oauthScopes.d.ts.map +1 -0
- package/dist/internal/oauthScopes.js +416 -0
- package/dist/internal/organizationName.d.ts +18 -0
- package/dist/internal/organizationName.d.ts.map +1 -0
- package/dist/internal/organizationName.js +24 -0
- package/dist/internal/protocol.d.ts +86 -2
- package/dist/internal/protocol.d.ts.map +1 -1
- package/dist/internal/protocol.js +112 -1
- package/dist/internal/providerApps.d.ts +75 -0
- package/dist/internal/providerApps.d.ts.map +1 -0
- package/dist/internal/providerApps.js +59 -0
- package/dist/internal/providerRegistry.d.ts +147 -0
- package/dist/internal/providerRegistry.d.ts.map +1 -0
- package/dist/internal/providerRegistry.js +262 -0
- package/dist/internal/providerSpec.d.ts +55 -0
- package/dist/internal/providerSpec.d.ts.map +1 -0
- package/dist/internal/providerSpec.js +746 -0
- package/dist/internal/remoteMcp.d.ts +188 -0
- package/dist/internal/remoteMcp.d.ts.map +1 -0
- package/dist/internal/remoteMcp.js +543 -0
- package/dist/internal/tools.d.ts +115 -0
- package/dist/internal/tools.d.ts.map +1 -0
- package/dist/internal/tools.js +80 -0
- package/dist/server/attribution.d.ts +39 -0
- package/dist/server/attribution.d.ts.map +1 -0
- package/dist/server/attribution.js +67 -0
- package/dist/server/authorizeUrl.d.ts +43 -0
- package/dist/server/authorizeUrl.d.ts.map +1 -0
- package/dist/server/authorizeUrl.js +110 -0
- package/dist/server/emit.d.ts +63 -0
- package/dist/server/emit.d.ts.map +1 -0
- package/dist/server/emit.js +101 -0
- package/dist/server/everyApp.d.ts +38 -12
- package/dist/server/everyApp.d.ts.map +1 -1
- package/dist/server/everyApp.js +92 -28
- package/dist/server/gatewayFetch.d.ts +24 -8
- package/dist/server/gatewayFetch.d.ts.map +1 -1
- package/dist/server/gatewayFetch.js +81 -36
- package/dist/server/index.d.ts +10 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +8 -1
- package/dist/server/integrationFetch.d.ts +131 -0
- package/dist/server/integrationFetch.d.ts.map +1 -0
- package/dist/server/integrationFetch.js +526 -0
- package/dist/server/listMembers.d.ts +32 -0
- package/dist/server/listMembers.d.ts.map +1 -0
- package/dist/server/listMembers.js +74 -0
- package/dist/server/nodeServer.d.ts +48 -0
- package/dist/server/nodeServer.d.ts.map +1 -0
- package/dist/server/nodeServer.js +45 -0
- package/dist/server/sendEmail.d.ts +39 -0
- package/dist/server/sendEmail.d.ts.map +1 -0
- package/dist/server/sendEmail.js +114 -0
- package/dist/server/tools.d.ts +184 -0
- package/dist/server/tools.d.ts.map +1 -0
- package/dist/server/tools.js +347 -0
- package/dist/server/toolsEndpoint.d.ts +32 -0
- package/dist/server/toolsEndpoint.d.ts.map +1 -0
- package/dist/server/toolsEndpoint.js +231 -0
- package/package.json +30 -17
- package/dist/server/mcp.d.ts +0 -66
- package/dist/server/mcp.d.ts.map +0 -1
- package/dist/server/mcp.js +0 -147
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The provider registry: the built-in catalog (./capabilities.ts) and the
|
|
3
|
+
* providers one gateway registered as rows (`everyapp provider add`,
|
|
4
|
+
* `everyapp_provider_add`), resolved as one lookup
|
|
5
|
+
* (docs/design/2026-10-provider-registry.md). The catalog comes first and
|
|
6
|
+
* a row can never shadow it. Every row is parsed and checked again each
|
|
7
|
+
* time a registry is built, so a row written by hand into D1, or one that
|
|
8
|
+
* stopped passing the rules when a later catalog took its name, is left
|
|
9
|
+
* out and named in `rejected` rather than served.
|
|
10
|
+
*
|
|
11
|
+
* The rules a row must pass (the register's `registry.*` invariants):
|
|
12
|
+
*
|
|
13
|
+
* - `registry.builtin-precedence`: not a catalog id, and never `everyapp`;
|
|
14
|
+
* - `registry.row-secret-is-its-own`: each Gateway setting it names starts
|
|
15
|
+
* with its own id (`STRIPE_` for `stripe`) and is nobody else's: no
|
|
16
|
+
* install-owned, dev-only or reserved name, no settable Gateway setting
|
|
17
|
+
* (the catalog's keys and clients included), no other row's;
|
|
18
|
+
* - `registry.row-hosts-public-https`: each host is a public DNS name (not
|
|
19
|
+
* an IP literal, localhost, or a `.local`, `.internal` or `.arpa` name)
|
|
20
|
+
* and not one the gateway serves itself (`refuseHost`, which knows the
|
|
21
|
+
* gateway's own host and `APP_BASE_DOMAIN`).
|
|
22
|
+
*/
|
|
23
|
+
import { CAPABILITIES, CAPABILITY_IDS, capabilitySettings, } from "./capabilities.js";
|
|
24
|
+
import { isDevOnlyGatewaySetting, isInstallOwnedGatewaySetting, isReservedAppSecretName, isSettableGatewaySetting, } from "./gatewaySettings.js";
|
|
25
|
+
import { describeSpecProblems, parseProviderSpec, PROVIDER_ID, } from "./providerSpec.js";
|
|
26
|
+
/**
|
|
27
|
+
* The part of a row a key is set for: its hosts, its host setting and its
|
|
28
|
+
* auth, as one canonical string (sorted keys, sorted hosts), so that
|
|
29
|
+
* replacing a row's hosts or auth changes the key and the value it held
|
|
30
|
+
* is no longer read until the operator sets it again.
|
|
31
|
+
*/
|
|
32
|
+
export function providerBindingKey(capability) {
|
|
33
|
+
const auth = Object.fromEntries(Object.entries(capability.auth)
|
|
34
|
+
.sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))
|
|
35
|
+
.map(([field, value]) => [
|
|
36
|
+
field,
|
|
37
|
+
typeof value === "object" && value !== null
|
|
38
|
+
? Object.fromEntries(Object.entries(value).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0))
|
|
39
|
+
: value,
|
|
40
|
+
]));
|
|
41
|
+
return JSON.stringify({
|
|
42
|
+
auth,
|
|
43
|
+
hostSetting: capability.hostSetting ?? null,
|
|
44
|
+
hosts: [...capability.hosts].sort(),
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/** The reserved app id no provider may take. */
|
|
48
|
+
const RESERVED_IDS = new Set(["everyapp"]);
|
|
49
|
+
const IPV4 = /^\d{1,3}(\.\d{1,3}){3}$/;
|
|
50
|
+
const LOCAL_SUFFIXES = [".localhost", ".local", ".internal", ".arpa"];
|
|
51
|
+
/** The prefix a provider's own Gateway settings carry: `stripe` → `STRIPE_`, `tiktok-business` → `TIKTOK_BUSINESS_`. */
|
|
52
|
+
export function providerSettingPrefix(id) {
|
|
53
|
+
return `${id.toUpperCase().replace(/-/g, "_")}_`;
|
|
54
|
+
}
|
|
55
|
+
/** Why `host` can't be a row's, by the pure rules alone; null when it can. */
|
|
56
|
+
export function publicHostProblem(host) {
|
|
57
|
+
if (IPV4.test(host))
|
|
58
|
+
return `${host} is an IP address, not a host name`;
|
|
59
|
+
if (host === "localhost" ||
|
|
60
|
+
LOCAL_SUFFIXES.some((suffix) => host.endsWith(suffix))) {
|
|
61
|
+
return `${host} is not a public host`;
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
/** A bare lowercase host from a host or a URL; null when neither. */
|
|
66
|
+
function bareHost(value) {
|
|
67
|
+
const text = value?.trim().toLowerCase().replace(/\.$/, "");
|
|
68
|
+
if (!text)
|
|
69
|
+
return null;
|
|
70
|
+
if (!text.includes("/"))
|
|
71
|
+
return text;
|
|
72
|
+
try {
|
|
73
|
+
return new URL(text).hostname.toLowerCase();
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Why a row can't send its key to `host` on this gateway: the gateway's
|
|
81
|
+
* own host, an app host under its base domain, or a host under its
|
|
82
|
+
* third-party domain. Null when none applies. The gateway applies it on
|
|
83
|
+
* every read (`refusedGatewayHost`, with its env) and the CLI at `provider
|
|
84
|
+
* add` (with the install's gateway host and base domain), in the same words.
|
|
85
|
+
*/
|
|
86
|
+
export function gatewayHostRefusal(host, hosts) {
|
|
87
|
+
const own = bareHost(hosts.gatewayHost);
|
|
88
|
+
if (own && host === own)
|
|
89
|
+
return `${host} is this gateway's own host`;
|
|
90
|
+
const base = bareHost(hosts.appBaseDomain);
|
|
91
|
+
if (base && (host === base || host.endsWith(`.${base}`))) {
|
|
92
|
+
return `${host} is under this gateway's app domain ${base}`;
|
|
93
|
+
}
|
|
94
|
+
const third = bareHost(hosts.thirdPartyDomain);
|
|
95
|
+
if (third && (host === third || host.endsWith(`.${third}`))) {
|
|
96
|
+
return `${host} is under this gateway's third-party domain ${third}`;
|
|
97
|
+
}
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Why a setting name can't be a row's: a name the Gateway, the catalog or
|
|
102
|
+
* another provider already reads, or one outside the row's own prefix.
|
|
103
|
+
* Null when the row may hold it.
|
|
104
|
+
*/
|
|
105
|
+
export function rowSecretProblem(id, name, taken) {
|
|
106
|
+
const prefix = providerSettingPrefix(id);
|
|
107
|
+
if (!name.startsWith(prefix)) {
|
|
108
|
+
return `${name} doesn't start with ${prefix}: a provider's settings carry its own id`;
|
|
109
|
+
}
|
|
110
|
+
if (isInstallOwnedGatewaySetting(name)) {
|
|
111
|
+
return `${name} is one of the Gateway's own keys`;
|
|
112
|
+
}
|
|
113
|
+
if (isDevOnlyGatewaySetting(name)) {
|
|
114
|
+
return `${name} is a local-development setting`;
|
|
115
|
+
}
|
|
116
|
+
if (isReservedAppSecretName(name)) {
|
|
117
|
+
return `${name} is a name everyapp sets itself`;
|
|
118
|
+
}
|
|
119
|
+
if (isSettableGatewaySetting(name)) {
|
|
120
|
+
return `${name} is a Gateway setting another provider or the Gateway reads`;
|
|
121
|
+
}
|
|
122
|
+
if (taken(name)) {
|
|
123
|
+
return `${name} is another registered provider's`;
|
|
124
|
+
}
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Check one parsed row against the catalog and the other rows. Pure: the
|
|
129
|
+
* CLI runs it before writing D1, the MCP tool before writing, and the
|
|
130
|
+
* gateway again on every read.
|
|
131
|
+
*/
|
|
132
|
+
export function checkProviderRow(id, capability, context) {
|
|
133
|
+
if (RESERVED_IDS.has(id) || CAPABILITY_IDS.includes(id)) {
|
|
134
|
+
return {
|
|
135
|
+
id,
|
|
136
|
+
code: "PROVIDER_BUILTIN",
|
|
137
|
+
message: `${id} is a built-in provider; a registered one can't take its id`,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
for (const name of capabilitySettings(capability)) {
|
|
141
|
+
const problem = rowSecretProblem(id, name, (each) => context.rowSettings.has(each));
|
|
142
|
+
if (problem) {
|
|
143
|
+
return { id, code: "PROVIDER_SECRET_TAKEN", message: problem };
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
for (const host of capability.hosts) {
|
|
147
|
+
const problem = publicHostProblem(host) ?? context.refuseHost?.(host);
|
|
148
|
+
if (problem) {
|
|
149
|
+
return { id, code: "PROVIDER_HOST_REFUSED", message: problem };
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
/** A row's spec parsed and checked: the capability, or the refusal. */
|
|
155
|
+
export function resolveProviderRow(row, context) {
|
|
156
|
+
let spec = row.spec;
|
|
157
|
+
if (typeof spec === "string") {
|
|
158
|
+
try {
|
|
159
|
+
spec = JSON.parse(spec);
|
|
160
|
+
}
|
|
161
|
+
catch {
|
|
162
|
+
return {
|
|
163
|
+
ok: false,
|
|
164
|
+
refusal: {
|
|
165
|
+
id: row.id,
|
|
166
|
+
code: "PROVIDER_SPEC_INVALID",
|
|
167
|
+
message: "the stored spec isn't JSON",
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
const parsed = parseProviderSpec(spec);
|
|
173
|
+
if (!parsed.ok) {
|
|
174
|
+
return {
|
|
175
|
+
ok: false,
|
|
176
|
+
refusal: {
|
|
177
|
+
id: row.id,
|
|
178
|
+
code: "PROVIDER_SPEC_INVALID",
|
|
179
|
+
message: describeSpecProblems(parsed.problems),
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
if (parsed.id !== row.id || !PROVIDER_ID.test(row.id)) {
|
|
184
|
+
return {
|
|
185
|
+
ok: false,
|
|
186
|
+
refusal: {
|
|
187
|
+
id: row.id,
|
|
188
|
+
code: "PROVIDER_SPEC_INVALID",
|
|
189
|
+
message: `the row is ${row.id} but its spec says ${parsed.id}`,
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
const refusal = checkProviderRow(parsed.id, parsed.capability, context);
|
|
194
|
+
return refusal
|
|
195
|
+
? { ok: false, refusal }
|
|
196
|
+
: { ok: true, capability: parsed.capability };
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* The catalog and `rows` as one registry. Rows are taken in order; a row
|
|
200
|
+
* whose settings another earlier row holds is the one refused.
|
|
201
|
+
*/
|
|
202
|
+
export function providerRegistry(rows = [], options = {}) {
|
|
203
|
+
const catalog = new Map(CAPABILITY_IDS.map((id) => [id, CAPABILITIES[id]]));
|
|
204
|
+
const accepted = new Map();
|
|
205
|
+
const rejected = [];
|
|
206
|
+
const rowSettings = new Set();
|
|
207
|
+
for (const row of rows) {
|
|
208
|
+
if (accepted.has(row.id)) {
|
|
209
|
+
rejected.push({
|
|
210
|
+
id: row.id,
|
|
211
|
+
code: "PROVIDER_SPEC_INVALID",
|
|
212
|
+
message: "listed twice",
|
|
213
|
+
});
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
const resolved = resolveProviderRow(row, {
|
|
217
|
+
rowSettings,
|
|
218
|
+
...(options.refuseHost ? { refuseHost: options.refuseHost } : {}),
|
|
219
|
+
});
|
|
220
|
+
if (!resolved.ok) {
|
|
221
|
+
rejected.push(resolved.refusal);
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
accepted.set(row.id, {
|
|
225
|
+
id: row.id,
|
|
226
|
+
capability: resolved.capability,
|
|
227
|
+
bound: row.boundTo === providerBindingKey(resolved.capability),
|
|
228
|
+
addedBy: row.addedBy ?? null,
|
|
229
|
+
addedAt: row.addedAt ?? null,
|
|
230
|
+
});
|
|
231
|
+
for (const name of capabilitySettings(resolved.capability)) {
|
|
232
|
+
rowSettings.add(name);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
const all = new Map([
|
|
236
|
+
...catalog,
|
|
237
|
+
...[...accepted.values()].map((row) => [row.id, row.capability]),
|
|
238
|
+
]);
|
|
239
|
+
let names;
|
|
240
|
+
let unbound;
|
|
241
|
+
return {
|
|
242
|
+
get: (id) => all.get(id),
|
|
243
|
+
ids: () => [...all.keys()],
|
|
244
|
+
entries: () => [...all.entries()],
|
|
245
|
+
sourceOf: (id) => catalog.has(id) ? "catalog" : accepted.has(id) ? "row" : undefined,
|
|
246
|
+
settingNames: () => {
|
|
247
|
+
names ??= new Set([...all.values()].flatMap((capability) => capabilitySettings(capability)));
|
|
248
|
+
return names;
|
|
249
|
+
},
|
|
250
|
+
bound: (id) => catalog.has(id) || (accepted.get(id)?.bound ?? false),
|
|
251
|
+
unboundSettings: () => {
|
|
252
|
+
unbound ??= new Set([...accepted.values()]
|
|
253
|
+
.filter((row) => !row.bound)
|
|
254
|
+
.flatMap((row) => capabilitySettings(row.capability)));
|
|
255
|
+
return unbound;
|
|
256
|
+
},
|
|
257
|
+
rows: () => [...accepted.values()],
|
|
258
|
+
rejected,
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
/** The catalog alone, as a registry: what every surface reads without a gateway's rows. */
|
|
262
|
+
export const BUILTIN_PROVIDERS = providerRegistry();
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A provider spec: the shape `everyapp provider add` takes as JSON (and
|
|
3
|
+
* `everyapp_provider_add` as a tool argument), and the shape every
|
|
4
|
+
* built-in catalog entry has in TypeScript (./capabilities.ts), so a
|
|
5
|
+
* catalog entry is nothing a row couldn't be. `parseProviderSpec` turns
|
|
6
|
+
* JSON into an {@link ApiKeyCapability} or names every problem; nothing
|
|
7
|
+
* here reads a value: a spec names Gateway settings, never holds one.
|
|
8
|
+
*
|
|
9
|
+
* This slice parses API-key providers (`auth.kind` bearer, header, query
|
|
10
|
+
* or basic). An AI provider or an OAuth client is a catalog entry only;
|
|
11
|
+
* the parser says so rather than guessing.
|
|
12
|
+
*
|
|
13
|
+
* The rules that make a row safe on a particular gateway (its secret names
|
|
14
|
+
* are its own, its hosts are public, it shadows no catalog entry) are the
|
|
15
|
+
* registry's (./providerRegistry.ts), run after this parse.
|
|
16
|
+
*/
|
|
17
|
+
import { type ApiKeyCapability } from "./capabilities.js";
|
|
18
|
+
/** A provider id: lowercase, a letter first, 2 to 40 characters. */
|
|
19
|
+
export declare const PROVIDER_ID: RegExp;
|
|
20
|
+
/** A Gateway setting name a provider may hold: upper case, 3 to 64 characters. */
|
|
21
|
+
export declare const PROVIDER_SECRET_NAME: RegExp;
|
|
22
|
+
/** A bare lowercase host with at least one dot: labels of letters, digits and hyphens. */
|
|
23
|
+
export declare const PROVIDER_HOST: RegExp;
|
|
24
|
+
export interface ProviderSpecProblem {
|
|
25
|
+
/** Dotted: `auth.secret`, `hosts.1`, or `(root)`. */
|
|
26
|
+
path: string;
|
|
27
|
+
message: string;
|
|
28
|
+
}
|
|
29
|
+
export type ParsedProviderSpec = {
|
|
30
|
+
ok: true;
|
|
31
|
+
id: string;
|
|
32
|
+
capability: ApiKeyCapability;
|
|
33
|
+
} | {
|
|
34
|
+
ok: false;
|
|
35
|
+
problems: ProviderSpecProblem[];
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Parse a provider spec. Every problem is reported, with its path, so a
|
|
39
|
+
* person fixes the file once. On success the id and the catalog-shaped
|
|
40
|
+
* capability, defaults filled in (`access` read, `readMethods` GET and
|
|
41
|
+
* HEAD, no account-wide paths).
|
|
42
|
+
*/
|
|
43
|
+
export declare function parseProviderSpec(input: unknown): ParsedProviderSpec;
|
|
44
|
+
/** The problems as one line: `auth.secret: must name a Gateway setting; hosts.0: …`. */
|
|
45
|
+
export declare function describeSpecProblems(problems: readonly ProviderSpecProblem[]): string;
|
|
46
|
+
/**
|
|
47
|
+
* The spec of an API-key capability as JSON (`provider show`, the
|
|
48
|
+
* catalog's round trip): the entry's fields in the spec's names, with the
|
|
49
|
+
* defaults the parser fills in spelled out, so `parseProviderSpec` of it
|
|
50
|
+
* gives the entry back.
|
|
51
|
+
*/
|
|
52
|
+
export declare function providerSpecOf(id: string, capability: ApiKeyCapability): Record<string, unknown>;
|
|
53
|
+
/** The methods an app with `access: "write"` may use on `capability` besides its read methods. */
|
|
54
|
+
export declare function writeMethodsOf(capability: ApiKeyCapability): readonly string[];
|
|
55
|
+
//# sourceMappingURL=providerSpec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providerSpec.d.ts","sourceRoot":"","sources":["../../src/internal/providerSpec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAIL,KAAK,gBAAgB,EAMtB,MAAM,mBAAmB,CAAC;AAE3B,oEAAoE;AACpE,eAAO,MAAM,WAAW,QAA2B,CAAC;AACpD,kFAAkF;AAClF,eAAO,MAAM,oBAAoB,QAA2B,CAAC;AAC7D,0FAA0F;AAC1F,eAAO,MAAM,aAAa,QACoD,CAAC;AA0D/E,MAAM,WAAW,mBAAmB;IAClC,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,kBAAkB,GAC1B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,gBAAgB,CAAA;CAAE,GACtD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,mBAAmB,EAAE,CAAA;CAAE,CAAC;AA+fnD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,kBAAkB,CAqKpE;AAED,wFAAwF;AACxF,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,GACvC,MAAM,CAIR;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,gBAAgB,GAC3B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAwCzB;AAED,kGAAkG;AAClG,wBAAgB,cAAc,CAC5B,UAAU,EAAE,gBAAgB,GAC3B,SAAS,MAAM,EAAE,CAEnB"}
|