@foxnose/sdk 0.8.0 → 0.9.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/README.md +98 -0
- package/dist/index.cjs +1173 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +693 -4
- package/dist/index.d.ts +693 -4
- package/dist/index.js +1160 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { KeyObject } from 'node:crypto';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Immutable view of the outbound request used when applying auth.
|
|
3
5
|
*/
|
|
@@ -12,6 +14,12 @@ interface RequestData {
|
|
|
12
14
|
*/
|
|
13
15
|
interface AuthStrategy {
|
|
14
16
|
buildHeaders(request: RequestData): Record<string, string>;
|
|
17
|
+
/**
|
|
18
|
+
* Optional. Called on a `401`: `true` sends the request once more with headers
|
|
19
|
+
* built again. `failedAuthorization` is the `Authorization` header the refused
|
|
20
|
+
* request carried.
|
|
21
|
+
*/
|
|
22
|
+
refreshAfterUnauthorized?(status: number, headers: Headers, failedAuthorization: string | undefined): boolean;
|
|
15
23
|
}
|
|
16
24
|
/**
|
|
17
25
|
* Provides access tokens for JWT auth.
|
|
@@ -79,6 +87,147 @@ declare class SimpleKeyAuth implements AuthStrategy {
|
|
|
79
87
|
buildHeaders(_request: RequestData): Record<string, string>;
|
|
80
88
|
}
|
|
81
89
|
|
|
90
|
+
/**
|
|
91
|
+
* Tenant tokens: sign `fxt_` tokens for one end user and keep them fresh.
|
|
92
|
+
*
|
|
93
|
+
* Your backend holds the private key of a tenant signing key and signs one token per
|
|
94
|
+
* end user and session. FoxNose stores only the public key. A token reaches only the
|
|
95
|
+
* records under the owner records it names (its anchors) and the shared collections its
|
|
96
|
+
* signing key allows, and reads, creates, updates and uploads there as far as the
|
|
97
|
+
* signing key's actions allow.
|
|
98
|
+
*
|
|
99
|
+
* @module
|
|
100
|
+
*/
|
|
101
|
+
|
|
102
|
+
declare const TENANT_TOKEN_PREFIX = "fxt_";
|
|
103
|
+
/** A P-256 key pair made locally for a tenant signing key. */
|
|
104
|
+
interface TenantSigningKeyPair {
|
|
105
|
+
/** Base64 PKCS#8 DER. Not enumerable, so it stays out of `JSON.stringify` and logs. */
|
|
106
|
+
readonly privateKey: string;
|
|
107
|
+
/** Base64 SPKI DER: register it with `createTenantSigningKey({ public_key })`. */
|
|
108
|
+
readonly publicKey: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Make a P-256 key pair for a tenant signing key. Register `publicKey` and keep
|
|
112
|
+
* `privateKey` on your backend: it never has to leave it.
|
|
113
|
+
*/
|
|
114
|
+
declare function generateTenantSigningKey(): TenantSigningKeyPair;
|
|
115
|
+
/** An anchor: an owner record, by collection key (not alias) and record key. */
|
|
116
|
+
type TenantTokenAnchor = readonly [collection: string, record: string] | {
|
|
117
|
+
readonly collection: string;
|
|
118
|
+
readonly record: string;
|
|
119
|
+
};
|
|
120
|
+
interface SignTenantTokenOptions {
|
|
121
|
+
/** The signing key id, `tsk_` and 12 characters. */
|
|
122
|
+
kid: string;
|
|
123
|
+
/** Key of the environment; the token's `aud` is `flux:<environmentKey>`. */
|
|
124
|
+
environmentKey: string;
|
|
125
|
+
/** Your id for the end user, 1 to 128 printable characters. */
|
|
126
|
+
sub: string;
|
|
127
|
+
/** The owner records the token reads under, 1 to 10. */
|
|
128
|
+
anchors: readonly TenantTokenAnchor[];
|
|
129
|
+
/** Lifetime in seconds, 1 to 86400 and at most the key's `max_ttl_seconds`. @default 900 */
|
|
130
|
+
ttl?: number;
|
|
131
|
+
/** Narrows the key's `apis`, such as `{ support: ['read'] }`. */
|
|
132
|
+
apis?: Record<string, readonly string[]>;
|
|
133
|
+
/** Narrows the key's `collections` (claim `col`). */
|
|
134
|
+
collections?: readonly string[];
|
|
135
|
+
/** Narrows the key's `shared_read` (claim `shr`). */
|
|
136
|
+
sharedRead?: readonly string[];
|
|
137
|
+
/** Not valid before this time, in seconds since the epoch (claim `nbf`). */
|
|
138
|
+
notBefore?: number;
|
|
139
|
+
/** A unique id for the token, 16 to 64 characters of `A-Z a-z 0-9 - _`. Random by default. */
|
|
140
|
+
jti?: string;
|
|
141
|
+
/** Issue time in seconds since the epoch. The current time by default. */
|
|
142
|
+
now?: number;
|
|
143
|
+
}
|
|
144
|
+
/** A private key: base64 PKCS#8 DER, PEM, DER bytes, or a `KeyObject`. */
|
|
145
|
+
type TenantPrivateKey = string | Uint8Array | KeyObject;
|
|
146
|
+
/**
|
|
147
|
+
* Sign a tenant token for one end user.
|
|
148
|
+
*
|
|
149
|
+
* The checks here are the ones every token must pass. The signing key's own limits
|
|
150
|
+
* (`max_ttl_seconds`, `max_anchors`, its owner collections and ceilings) are checked
|
|
151
|
+
* by Flux, which answers a token that fails them with `401`.
|
|
152
|
+
*
|
|
153
|
+
* @returns The token, `fxt_` followed by a compact JWS (ES256, 64-byte `R || S`
|
|
154
|
+
* signature). Send it as `Authorization: Bearer <token>`.
|
|
155
|
+
* @throws Error An option breaks a rule every token must follow. The message never
|
|
156
|
+
* contains the key.
|
|
157
|
+
*/
|
|
158
|
+
declare function signTenantToken(privateKey: TenantPrivateKey, options: SignTenantTokenOptions): string;
|
|
159
|
+
/** The `error` parameters of the `Bearer` challenges in a `WWW-Authenticate` header. */
|
|
160
|
+
declare function bearerErrors(wwwAuthenticate: string): string[];
|
|
161
|
+
/** Whether a response refuses a Bearer token as `invalid_token`. */
|
|
162
|
+
declare function isInvalidTokenChallenge(status: number, wwwAuthenticate: string | null | undefined): boolean;
|
|
163
|
+
interface TenantTokenSourceOptions {
|
|
164
|
+
/** Seconds before `exp` at which a new token is minted. @default 60 */
|
|
165
|
+
refreshBefore?: number;
|
|
166
|
+
/** Returns the current time in milliseconds; for tests. @default Date.now */
|
|
167
|
+
clock?: () => number;
|
|
168
|
+
}
|
|
169
|
+
declare const INSPECT: unique symbol;
|
|
170
|
+
declare class TenantTokenSource {
|
|
171
|
+
private readonly mint;
|
|
172
|
+
private readonly refreshBefore;
|
|
173
|
+
private readonly clock;
|
|
174
|
+
constructor(mint: () => string | Promise<string>, options?: TenantTokenSourceOptions);
|
|
175
|
+
toJSON(): {
|
|
176
|
+
refreshBefore: number;
|
|
177
|
+
};
|
|
178
|
+
[INSPECT](): string;
|
|
179
|
+
private fresh;
|
|
180
|
+
private accept;
|
|
181
|
+
/** The current token, minted again when close to expiry. `mint` must be synchronous. */
|
|
182
|
+
tokenSync(): string;
|
|
183
|
+
/** The current token, minted again when close to expiry. Concurrent callers share one mint. */
|
|
184
|
+
token(): Promise<string>;
|
|
185
|
+
/**
|
|
186
|
+
* Mint a new token on the next request. With `token`, only if the cached token is
|
|
187
|
+
* still that one, so a refusal of an older token leaves a newer one in place.
|
|
188
|
+
*/
|
|
189
|
+
invalidate(token?: string): void;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Sends a tenant token with {@link FluxClient}, and mints a new one before it expires.
|
|
193
|
+
*
|
|
194
|
+
* A `401` whose `WWW-Authenticate` carries a `Bearer` challenge with
|
|
195
|
+
* `error="invalid_token"` makes it mint a new token and send the request once more.
|
|
196
|
+
* Flux checks a token before it processes the request, so a refused write was not
|
|
197
|
+
* applied and is sent again too. `mint` must be synchronous here, as
|
|
198
|
+
* {@link signTenantToken} is; for an asynchronous mint use {@link tenantTokenFetch}.
|
|
199
|
+
*
|
|
200
|
+
* One instance serves one end user; see {@link TenantTokenSource}.
|
|
201
|
+
*/
|
|
202
|
+
declare class TenantTokenAuth implements AuthStrategy {
|
|
203
|
+
readonly source: TenantTokenSource;
|
|
204
|
+
constructor(mint: (() => string) | TenantTokenSource, options?: TenantTokenSourceOptions);
|
|
205
|
+
buildHeaders(_request: RequestData): Record<string, string>;
|
|
206
|
+
refreshAfterUnauthorized(status: number, headers: Headers, failedAuthorization: string | undefined): boolean;
|
|
207
|
+
toJSON(): {
|
|
208
|
+
refreshBefore: number;
|
|
209
|
+
};
|
|
210
|
+
[INSPECT](): string;
|
|
211
|
+
}
|
|
212
|
+
interface TenantTokenFetchOptions extends TenantTokenSourceOptions {
|
|
213
|
+
/** The fetch to wrap. @default globalThis.fetch */
|
|
214
|
+
fetch?: typeof fetch;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* A `fetch` that sends a tenant token, for HTTP clients that take a `fetch`, such as
|
|
218
|
+
* `new StreamableHTTPClientTransport(url, { fetch: tenantTokenFetch(mint) })` of the
|
|
219
|
+
* MCP TypeScript SDK.
|
|
220
|
+
*
|
|
221
|
+
* It mints a new token before expiry (concurrent requests share one mint), and on a
|
|
222
|
+
* `401` with `error="invalid_token"` mints again and sends the request once more when
|
|
223
|
+
* its body can be sent again: no body, a string, `URLSearchParams`, `Blob`,
|
|
224
|
+
* `FormData` or bytes. A stream body, a `Request` with a body, and an aborted request
|
|
225
|
+
* are sent once. The caller's `Request` and `init` are not changed.
|
|
226
|
+
*
|
|
227
|
+
* One instance serves one end user; see {@link TenantTokenSource}.
|
|
228
|
+
*/
|
|
229
|
+
declare function tenantTokenFetch(mint: (() => string | Promise<string>) | TenantTokenSource, options?: TenantTokenFetchOptions): typeof fetch;
|
|
230
|
+
|
|
82
231
|
/**
|
|
83
232
|
* Controls HTTP retry behavior for idempotent requests.
|
|
84
233
|
*/
|
|
@@ -93,8 +242,8 @@ interface RetryConfig {
|
|
|
93
242
|
methods: readonly string[];
|
|
94
243
|
}
|
|
95
244
|
declare const DEFAULT_RETRY_CONFIG: Readonly<RetryConfig>;
|
|
96
|
-
declare const SDK_VERSION = "0.
|
|
97
|
-
declare const DEFAULT_USER_AGENT = "foxnose-sdk-js/0.
|
|
245
|
+
declare const SDK_VERSION = "0.9.0";
|
|
246
|
+
declare const DEFAULT_USER_AGENT = "foxnose-sdk-js/0.9.0";
|
|
98
247
|
/**
|
|
99
248
|
* General transport-level configuration shared by all clients.
|
|
100
249
|
*/
|
|
@@ -376,6 +525,11 @@ declare class HttpTransport {
|
|
|
376
525
|
private computeDelay;
|
|
377
526
|
private maybeDecodeResponse;
|
|
378
527
|
private sendWithRetries;
|
|
528
|
+
/** Send one built request; the `Authorization` it carried is kept for the 401 hook. */
|
|
529
|
+
private send;
|
|
530
|
+
private readonly sentAuthorization;
|
|
531
|
+
/** Whether the auth strategy wants a `401` sent once more with new credentials. */
|
|
532
|
+
private refreshAuthAfter;
|
|
379
533
|
private handleTransportError;
|
|
380
534
|
private raiseAPIError;
|
|
381
535
|
private sleep;
|
|
@@ -759,6 +913,8 @@ interface APIInfo {
|
|
|
759
913
|
* Covers public read traffic only — writes still require a key.
|
|
760
914
|
*/
|
|
761
915
|
cors_origins?: string[];
|
|
916
|
+
/** `metadata` (records carry `_sys.trust`) or `off`. */
|
|
917
|
+
trust_delivery?: string | null;
|
|
762
918
|
created_at: string;
|
|
763
919
|
path?: string | null;
|
|
764
920
|
}
|
|
@@ -1574,6 +1730,346 @@ interface WebhookEventListParams {
|
|
|
1574
1730
|
limit?: number;
|
|
1575
1731
|
offset?: number;
|
|
1576
1732
|
}
|
|
1733
|
+
/**
|
|
1734
|
+
* A tenant signing key: the public key your backend signs tenant tokens with.
|
|
1735
|
+
* `status` is `active`, `revoked` or `parent_deleted`. Every field except
|
|
1736
|
+
* `description`, `limits` and `not_before` is fixed at creation.
|
|
1737
|
+
*/
|
|
1738
|
+
interface TenantSigningKey {
|
|
1739
|
+
kid: string;
|
|
1740
|
+
status: string;
|
|
1741
|
+
parent_key: string;
|
|
1742
|
+
public_key: string;
|
|
1743
|
+
anchor_collections: string[];
|
|
1744
|
+
collections: string[];
|
|
1745
|
+
shared_read: string[];
|
|
1746
|
+
apis: Record<string, string[]>;
|
|
1747
|
+
max_ttl_seconds: number;
|
|
1748
|
+
max_anchors: number;
|
|
1749
|
+
limits: Record<string, number | null> | null;
|
|
1750
|
+
not_before: string | null;
|
|
1751
|
+
revocation_generation: number;
|
|
1752
|
+
description: string;
|
|
1753
|
+
created_at: string;
|
|
1754
|
+
revoked_at: string | null;
|
|
1755
|
+
revoked_by: string | null;
|
|
1756
|
+
last_used_at: string | null;
|
|
1757
|
+
oauth: null;
|
|
1758
|
+
oauth_state: string;
|
|
1759
|
+
[key: string]: unknown;
|
|
1760
|
+
}
|
|
1761
|
+
type TenantSigningKeyList = PaginatedResponse<TenantSigningKey>;
|
|
1762
|
+
/**
|
|
1763
|
+
* The answer to creating a signing key. `private_key` (base64 PKCS#8 DER) is set only
|
|
1764
|
+
* when FoxNose generated the pair, only in this answer, and is not enumerable: read it
|
|
1765
|
+
* as `created.private_key`; it stays out of `JSON.stringify` and logs.
|
|
1766
|
+
*/
|
|
1767
|
+
interface TenantSigningKeyCreated extends TenantSigningKey {
|
|
1768
|
+
private_key?: string | null;
|
|
1769
|
+
}
|
|
1770
|
+
/** The body of {@link ManagementClient.createTenantSigningKey}. Send exactly one of `public_key` and `generate`. */
|
|
1771
|
+
interface TenantSigningKeyCreateRequest {
|
|
1772
|
+
parent_key: FluxAPIKeyRef;
|
|
1773
|
+
anchor_collections: CollectionRef[];
|
|
1774
|
+
apis: Record<string, string[]>;
|
|
1775
|
+
public_key?: string;
|
|
1776
|
+
generate?: boolean;
|
|
1777
|
+
collections?: CollectionRef[];
|
|
1778
|
+
shared_read?: CollectionRef[];
|
|
1779
|
+
max_ttl_seconds?: number;
|
|
1780
|
+
max_anchors?: number;
|
|
1781
|
+
limits?: {
|
|
1782
|
+
rpm_per_subject?: number | null;
|
|
1783
|
+
uploads_per_subject_per_hour?: number | null;
|
|
1784
|
+
};
|
|
1785
|
+
description?: string;
|
|
1786
|
+
}
|
|
1787
|
+
/** The body of {@link ManagementClient.updateTenantSigningKey}. Send at least one field. */
|
|
1788
|
+
interface TenantSigningKeyUpdateRequest {
|
|
1789
|
+
description?: string;
|
|
1790
|
+
/** `null` clears the per-key limits. */
|
|
1791
|
+
limits?: {
|
|
1792
|
+
rpm_per_subject?: number | null;
|
|
1793
|
+
uploads_per_subject_per_hour?: number | null;
|
|
1794
|
+
} | null;
|
|
1795
|
+
/** `'now'` (60 seconds from now), a `Date`, or an ISO 8601 time with an offset. */
|
|
1796
|
+
not_before?: 'now' | Date | string;
|
|
1797
|
+
}
|
|
1798
|
+
/** A revocation entry. The `jti` or `sub` itself is not stored, only its hash. */
|
|
1799
|
+
interface TenantTokenRevocation {
|
|
1800
|
+
kind: 'jti' | 'sub' | string;
|
|
1801
|
+
value_hash: string;
|
|
1802
|
+
before?: string | null;
|
|
1803
|
+
created_at?: string | null;
|
|
1804
|
+
expires_at?: string | null;
|
|
1805
|
+
revocation_generation?: number | null;
|
|
1806
|
+
[key: string]: unknown;
|
|
1807
|
+
}
|
|
1808
|
+
/** Rate limits for tenant tokens. `null` means the default. */
|
|
1809
|
+
interface TenantLimitValues {
|
|
1810
|
+
/** Requests per minute for one end user (`sub`). */
|
|
1811
|
+
rpm_per_subject: number | null;
|
|
1812
|
+
/** Requests per minute for one owner record, across every token that names it. */
|
|
1813
|
+
rpm_per_anchor: number | null;
|
|
1814
|
+
/** Upload starts per hour for one end user (`sub`). */
|
|
1815
|
+
uploads_per_subject_per_hour: number | null;
|
|
1816
|
+
}
|
|
1817
|
+
interface TenantLimits extends TenantLimitValues {
|
|
1818
|
+
defaults?: TenantLimitValues;
|
|
1819
|
+
ceilings?: TenantLimitValues;
|
|
1820
|
+
[key: string]: unknown;
|
|
1821
|
+
}
|
|
1822
|
+
/** A tainted field of a record or revision. `cause` is `writer`, `declared` or `schema`. */
|
|
1823
|
+
interface GuardrailsUntrustedField {
|
|
1824
|
+
path: string;
|
|
1825
|
+
field_label?: string | null;
|
|
1826
|
+
writer_type?: string | null;
|
|
1827
|
+
cause?: string | null;
|
|
1828
|
+
reviewed?: boolean | null;
|
|
1829
|
+
principal_key?: string | null;
|
|
1830
|
+
[key: string]: unknown;
|
|
1831
|
+
}
|
|
1832
|
+
/** A record's trust summary (`ResourceSummary.guardrails`). */
|
|
1833
|
+
interface ResourceGuardrailsSummary {
|
|
1834
|
+
untrusted: boolean;
|
|
1835
|
+
needs_review: boolean;
|
|
1836
|
+
verdict: string | null;
|
|
1837
|
+
held: boolean;
|
|
1838
|
+
untrusted_fields: GuardrailsUntrustedField[];
|
|
1839
|
+
[key: string]: unknown;
|
|
1840
|
+
}
|
|
1841
|
+
/** A revision's trust summary (`RevisionSummary.guardrails`). */
|
|
1842
|
+
interface RevisionGuardrailsSummary {
|
|
1843
|
+
untrusted: boolean;
|
|
1844
|
+
needs_review: boolean;
|
|
1845
|
+
tainted_paths: string[];
|
|
1846
|
+
state: string | null;
|
|
1847
|
+
review_state: string | null;
|
|
1848
|
+
verdict: string | null;
|
|
1849
|
+
reason: string | null;
|
|
1850
|
+
reasons: string[];
|
|
1851
|
+
held: boolean;
|
|
1852
|
+
untrusted_fields: GuardrailsUntrustedField[];
|
|
1853
|
+
[key: string]: unknown;
|
|
1854
|
+
}
|
|
1855
|
+
/**
|
|
1856
|
+
* A record's `guardrails` as a typed summary, or `null` when it has none.
|
|
1857
|
+
* The field itself stays a plain object.
|
|
1858
|
+
* @throws TypeError The summary does not have the documented shape.
|
|
1859
|
+
*/
|
|
1860
|
+
declare function getResourceGuardrailsSummary(resource: Pick<ResourceSummary, 'guardrails'>): ResourceGuardrailsSummary | null;
|
|
1861
|
+
/**
|
|
1862
|
+
* A revision's `guardrails` as a typed summary, or `null` when it has none.
|
|
1863
|
+
* @throws TypeError The summary does not have the documented shape.
|
|
1864
|
+
*/
|
|
1865
|
+
declare function getRevisionGuardrailsSummary(revision: Pick<RevisionSummary, 'guardrails'>): RevisionGuardrailsSummary | null;
|
|
1866
|
+
/** The guardrails policy body keys the API accepts. */
|
|
1867
|
+
declare const GUARDRAILS_POLICY_FIELDS: readonly ["mode", "overrides", "trusted_keys", "acknowledge_agent_trust", "link_allowlist", "hold", "suspicious_action", "screen", "max_screened_chars"];
|
|
1868
|
+
/**
|
|
1869
|
+
* A guardrails policy to send. Only the fields that are set are sent: a `mode` left
|
|
1870
|
+
* out keeps the collection's mode. `hold`, `suspicious_action`, `screen` and
|
|
1871
|
+
* `max_screened_chars` belong to `screened` mode.
|
|
1872
|
+
*/
|
|
1873
|
+
interface GuardrailsPolicyBody {
|
|
1874
|
+
mode?: 'off' | 'provenance' | 'screened';
|
|
1875
|
+
overrides?: Record<string, string>;
|
|
1876
|
+
trusted_keys?: string[];
|
|
1877
|
+
acknowledge_agent_trust?: boolean;
|
|
1878
|
+
link_allowlist?: string[];
|
|
1879
|
+
hold?: boolean;
|
|
1880
|
+
suspicious_action?: string;
|
|
1881
|
+
screen?: string;
|
|
1882
|
+
max_screened_chars?: number;
|
|
1883
|
+
}
|
|
1884
|
+
/** A Flux API that delivers the collection with trust metadata. */
|
|
1885
|
+
interface GuardrailsDeliveredBy {
|
|
1886
|
+
api_key: string;
|
|
1887
|
+
name?: string | null;
|
|
1888
|
+
trust_delivery?: string | null;
|
|
1889
|
+
}
|
|
1890
|
+
/** A collection's live guardrails policy. `version` is `null` without a policy. */
|
|
1891
|
+
interface GuardrailsPolicy {
|
|
1892
|
+
version: number | null;
|
|
1893
|
+
body: GuardrailsPolicyBody & Record<string, unknown>;
|
|
1894
|
+
config_hash: string | null;
|
|
1895
|
+
created_at: string | null;
|
|
1896
|
+
delivered_by: GuardrailsDeliveredBy[];
|
|
1897
|
+
[key: string]: unknown;
|
|
1898
|
+
}
|
|
1899
|
+
/** A guardrails finding, with its words from the catalog. */
|
|
1900
|
+
interface GuardrailsFinding {
|
|
1901
|
+
kind: string;
|
|
1902
|
+
sub_kind?: string | null;
|
|
1903
|
+
/** `held` for a `screen_unavailable` finding. */
|
|
1904
|
+
severity?: string | null;
|
|
1905
|
+
path?: string | null;
|
|
1906
|
+
detector?: string | null;
|
|
1907
|
+
detector_version?: string | null;
|
|
1908
|
+
detail?: Record<string, unknown> | null;
|
|
1909
|
+
policy_version?: number | null;
|
|
1910
|
+
created_at?: string | null;
|
|
1911
|
+
title?: string | null;
|
|
1912
|
+
field_label?: string | null;
|
|
1913
|
+
summary?: string | null;
|
|
1914
|
+
[key: string]: unknown;
|
|
1915
|
+
}
|
|
1916
|
+
/** One reason a revision is or was held. */
|
|
1917
|
+
interface GuardrailsWhy {
|
|
1918
|
+
code: string;
|
|
1919
|
+
text: string;
|
|
1920
|
+
}
|
|
1921
|
+
interface GuardrailsWriter {
|
|
1922
|
+
writer_type?: string | null;
|
|
1923
|
+
surface?: string | null;
|
|
1924
|
+
principal_key?: string | null;
|
|
1925
|
+
[key: string]: unknown;
|
|
1926
|
+
}
|
|
1927
|
+
interface GuardrailsTaintedField {
|
|
1928
|
+
path: string;
|
|
1929
|
+
field_label?: string | null;
|
|
1930
|
+
writer_type?: string | null;
|
|
1931
|
+
revision_number?: number | null;
|
|
1932
|
+
carried?: boolean | null;
|
|
1933
|
+
cause?: string | null;
|
|
1934
|
+
[key: string]: unknown;
|
|
1935
|
+
}
|
|
1936
|
+
/** The named fields of a held revision, without an index signature. */
|
|
1937
|
+
interface HeldRevisionFields {
|
|
1938
|
+
resource_key: string;
|
|
1939
|
+
revision_key: string;
|
|
1940
|
+
number?: number | null;
|
|
1941
|
+
state?: string | null;
|
|
1942
|
+
review_state?: string | null;
|
|
1943
|
+
verdict?: string | null;
|
|
1944
|
+
reasons: string[];
|
|
1945
|
+
reviewed_by?: string | null;
|
|
1946
|
+
reviewed_at?: string | null;
|
|
1947
|
+
review_reason?: string | null;
|
|
1948
|
+
release_policy?: string | null;
|
|
1949
|
+
created_at?: string | null;
|
|
1950
|
+
writer?: GuardrailsWriter | null;
|
|
1951
|
+
tainted: GuardrailsTaintedField[];
|
|
1952
|
+
findings: GuardrailsFinding[];
|
|
1953
|
+
why: GuardrailsWhy[];
|
|
1954
|
+
}
|
|
1955
|
+
/**
|
|
1956
|
+
* A retained held revision. `state` is `pending`, `failed` or `done`; `review_state`
|
|
1957
|
+
* is `none`, `superseded`, `blocked` or `rejected`.
|
|
1958
|
+
*/
|
|
1959
|
+
interface HeldRevision extends HeldRevisionFields {
|
|
1960
|
+
[key: string]: unknown;
|
|
1961
|
+
}
|
|
1962
|
+
type HeldRevisionList = PaginatedResponse<HeldRevision>;
|
|
1963
|
+
/** `needs_review`, `screening`, `blocked`, `rejected` or `superseded`. */
|
|
1964
|
+
type HeldRevisionStatus = 'needs_review' | 'screening' | 'blocked' | 'rejected' | 'superseded';
|
|
1965
|
+
/** The answer to releasing or rejecting a held revision. */
|
|
1966
|
+
interface HeldRevisionDecision {
|
|
1967
|
+
revision_key: string;
|
|
1968
|
+
published: boolean;
|
|
1969
|
+
review_state?: string | null;
|
|
1970
|
+
verdict?: string | null;
|
|
1971
|
+
reasons?: string[] | null;
|
|
1972
|
+
screened?: boolean | null;
|
|
1973
|
+
[key: string]: unknown;
|
|
1974
|
+
}
|
|
1975
|
+
/** A held revision for a batch call: a pair, or an object with both keys. */
|
|
1976
|
+
type HeldRevisionRef = readonly [resource: ResourceRef, revision: RevisionRef] | {
|
|
1977
|
+
resource_key: string;
|
|
1978
|
+
revision_key: string;
|
|
1979
|
+
};
|
|
1980
|
+
interface GuardrailsBatchItemResult {
|
|
1981
|
+
resource_key: string;
|
|
1982
|
+
revision_key: string;
|
|
1983
|
+
/** `rejected`, `queued` or `error`. */
|
|
1984
|
+
outcome: string;
|
|
1985
|
+
code?: string | null;
|
|
1986
|
+
}
|
|
1987
|
+
/** Every item's outcome, in request order. */
|
|
1988
|
+
interface GuardrailsBatchResult {
|
|
1989
|
+
results: GuardrailsBatchItemResult[];
|
|
1990
|
+
}
|
|
1991
|
+
interface GuardrailsUsage {
|
|
1992
|
+
backlog: {
|
|
1993
|
+
candidates: number;
|
|
1994
|
+
max_candidates?: number;
|
|
1995
|
+
bytes: number;
|
|
1996
|
+
max_bytes?: number;
|
|
1997
|
+
};
|
|
1998
|
+
screening_budget: {
|
|
1999
|
+
available: boolean;
|
|
2000
|
+
hour_ends_at?: string | null;
|
|
2001
|
+
principals: Array<{
|
|
2002
|
+
principal_key: string | null;
|
|
2003
|
+
writer_type?: string | null;
|
|
2004
|
+
trusted?: boolean | null;
|
|
2005
|
+
used_chars: number;
|
|
2006
|
+
limit?: number | null;
|
|
2007
|
+
variants: Array<Record<string, unknown>>;
|
|
2008
|
+
}>;
|
|
2009
|
+
principals_total?: number;
|
|
2010
|
+
};
|
|
2011
|
+
[key: string]: unknown;
|
|
2012
|
+
}
|
|
2013
|
+
/**
|
|
2014
|
+
* An entry of the environment's review queue. With `kind=held` it is a held revision
|
|
2015
|
+
* plus `collection`, `collection_name` and `name`; with `kind=needs_review` it is a
|
|
2016
|
+
* record with `guardrails`, `current_revision` and `current_revision_published_at`.
|
|
2017
|
+
*/
|
|
2018
|
+
interface GuardrailsReviewItem extends Partial<Omit<HeldRevisionFields, 'resource_key'>> {
|
|
2019
|
+
collection: string;
|
|
2020
|
+
collection_name?: string | null;
|
|
2021
|
+
resource_key: string;
|
|
2022
|
+
name?: string | null;
|
|
2023
|
+
guardrails?: ResourceGuardrailsSummary | null;
|
|
2024
|
+
current_revision?: string | null;
|
|
2025
|
+
current_revision_published_at?: string | null;
|
|
2026
|
+
created_at?: string | null;
|
|
2027
|
+
[key: string]: unknown;
|
|
2028
|
+
}
|
|
2029
|
+
type GuardrailsReviewQueue = PaginatedResponse<GuardrailsReviewItem>;
|
|
2030
|
+
/** The team view of a revision's guardrails. */
|
|
2031
|
+
interface RevisionGuardrails {
|
|
2032
|
+
review: {
|
|
2033
|
+
state: string | null;
|
|
2034
|
+
review_state: string | null;
|
|
2035
|
+
verdict: string | null;
|
|
2036
|
+
reviewed_by: string | null;
|
|
2037
|
+
reviewed_at: string | null;
|
|
2038
|
+
reason: string | null;
|
|
2039
|
+
release_policy: string | null;
|
|
2040
|
+
} | null;
|
|
2041
|
+
provenance: Record<string, unknown> | null;
|
|
2042
|
+
findings: GuardrailsFinding[];
|
|
2043
|
+
why: GuardrailsWhy[];
|
|
2044
|
+
untrusted_fields: GuardrailsUntrustedField[];
|
|
2045
|
+
needs_review: boolean;
|
|
2046
|
+
[key: string]: unknown;
|
|
2047
|
+
}
|
|
2048
|
+
/** The revision created by marking a record as reviewed. */
|
|
2049
|
+
interface MarkReviewedResult {
|
|
2050
|
+
revision_key: string;
|
|
2051
|
+
number: number;
|
|
2052
|
+
tainted_paths: string[];
|
|
2053
|
+
}
|
|
2054
|
+
/** The wording the API uses for findings, states and writers. */
|
|
2055
|
+
interface GuardrailsCatalog {
|
|
2056
|
+
kinds: Record<string, {
|
|
2057
|
+
title: string;
|
|
2058
|
+
description: string;
|
|
2059
|
+
}>;
|
|
2060
|
+
unicode_classes?: Record<string, unknown>;
|
|
2061
|
+
severities?: Record<string, unknown>;
|
|
2062
|
+
writers?: Record<string, unknown>;
|
|
2063
|
+
trust?: Record<string, unknown>;
|
|
2064
|
+
provenance?: Record<string, unknown>;
|
|
2065
|
+
verdicts?: Record<string, unknown>;
|
|
2066
|
+
review_states?: Record<string, unknown>;
|
|
2067
|
+
screening_states?: Record<string, unknown>;
|
|
2068
|
+
held?: string;
|
|
2069
|
+
causes?: Record<string, string>;
|
|
2070
|
+
default_cause?: string;
|
|
2071
|
+
[key: string]: unknown;
|
|
2072
|
+
}
|
|
1577
2073
|
|
|
1578
2074
|
interface ManagementClientOptions {
|
|
1579
2075
|
baseUrl?: string;
|
|
@@ -2018,6 +2514,95 @@ declare class ManagementClient {
|
|
|
2018
2514
|
* `404 environment_not_found`.
|
|
2019
2515
|
*/
|
|
2020
2516
|
getMyPermissions(): Promise<MyPermissions>;
|
|
2517
|
+
/**
|
|
2518
|
+
* List the environment's tenant signing keys, revoked ones included, oldest first.
|
|
2519
|
+
* Keys the caller cannot read are left out. `params` carries `limit` and `offset`.
|
|
2520
|
+
*/
|
|
2521
|
+
listTenantSigningKeys(options?: {
|
|
2522
|
+
parentKey?: FluxAPIKeyRef;
|
|
2523
|
+
params?: Record<string, any>;
|
|
2524
|
+
}): Promise<TenantSigningKeyList>;
|
|
2525
|
+
/**
|
|
2526
|
+
* Register a tenant signing key, or have FoxNose generate the key pair.
|
|
2527
|
+
*
|
|
2528
|
+
* Send exactly one of `public_key` and `generate: true`. With `generate` the answer
|
|
2529
|
+
* carries `private_key` once (not enumerable; it is not stored). To keep the private
|
|
2530
|
+
* key on your side only, make the pair with {@link generateTenantSigningKey} and send
|
|
2531
|
+
* its `publicKey`. Never retried automatically.
|
|
2532
|
+
*/
|
|
2533
|
+
createTenantSigningKey(request: TenantSigningKeyCreateRequest): Promise<TenantSigningKeyCreated>;
|
|
2534
|
+
/** Read one tenant signing key. */
|
|
2535
|
+
getTenantSigningKey(kid: string): Promise<TenantSigningKey>;
|
|
2536
|
+
/**
|
|
2537
|
+
* Change a signing key's label, per-key limits or cutoff for older tokens.
|
|
2538
|
+
*
|
|
2539
|
+
* `not_before: 'now'` means 60 seconds from now; an explicit time must be at least
|
|
2540
|
+
* that far ahead. Tokens with `iat` before it are refused. It only moves forward.
|
|
2541
|
+
*/
|
|
2542
|
+
updateTenantSigningKey(kid: string, changes: TenantSigningKeyUpdateRequest): Promise<TenantSigningKey>;
|
|
2543
|
+
/** Revoke a signing key. Repeating the call also succeeds. */
|
|
2544
|
+
deleteTenantSigningKey(kid: string): Promise<void>;
|
|
2545
|
+
/**
|
|
2546
|
+
* Refuse one token (`jti`) or one end user's tokens (`sub`, those with `iat` at or
|
|
2547
|
+
* before `before`, 60 seconds from now by default). Send exactly one of `jti` and
|
|
2548
|
+
* `sub`. Neither value is stored, only its hash. Never retried automatically.
|
|
2549
|
+
*/
|
|
2550
|
+
addTenantTokenRevocation(kid: string, entry: {
|
|
2551
|
+
jti?: string;
|
|
2552
|
+
sub?: string;
|
|
2553
|
+
before?: Date | string;
|
|
2554
|
+
}): Promise<TenantTokenRevocation>;
|
|
2555
|
+
/** Read the environment's tenant-token rate limits, with defaults and ceilings. */
|
|
2556
|
+
getTenantLimits(): Promise<TenantLimits>;
|
|
2557
|
+
/** Replace the environment's tenant-token rate limits. A field left out returns to its default. */
|
|
2558
|
+
updateTenantLimits(limits: Partial<TenantLimitValues>): Promise<TenantLimits>;
|
|
2559
|
+
/** Read a collection's guardrails policy. Without one, mode is `off` and `version` is `null`. */
|
|
2560
|
+
getGuardrailsPolicy(collectionKey: CollectionRef): Promise<GuardrailsPolicy>;
|
|
2561
|
+
/**
|
|
2562
|
+
* Replace a collection's guardrails policy with a new version. Only the fields that
|
|
2563
|
+
* are set are sent; a `mode` left out keeps the collection's mode. An unknown field
|
|
2564
|
+
* throws before anything is sent.
|
|
2565
|
+
*/
|
|
2566
|
+
updateGuardrailsPolicy(collectionKey: CollectionRef, payload: GuardrailsPolicyBody): Promise<GuardrailsPolicy>;
|
|
2567
|
+
/** List a collection's retained held revisions, newest first. `params` carries `limit` (at most 200) and `offset`. */
|
|
2568
|
+
listHeldRevisions(collectionKey: CollectionRef, options?: {
|
|
2569
|
+
status?: HeldRevisionStatus;
|
|
2570
|
+
params?: Record<string, any>;
|
|
2571
|
+
}): Promise<HeldRevisionList>;
|
|
2572
|
+
/** Publish a held revision; it is re-evaluated under the live policy first. Never retried automatically. */
|
|
2573
|
+
releaseHeldRevision(collectionKey: CollectionRef, resourceKey: ResourceRef, revisionKey: RevisionRef): Promise<HeldRevisionDecision>;
|
|
2574
|
+
/** Reject a held revision; it is never published. `reason` is at most 500 characters. */
|
|
2575
|
+
rejectHeldRevision(collectionKey: CollectionRef, resourceKey: ResourceRef, revisionKey: RevisionRef, options?: {
|
|
2576
|
+
reason?: string;
|
|
2577
|
+
}): Promise<HeldRevisionDecision>;
|
|
2578
|
+
/** Reject up to 50 held revisions. Each item succeeds or fails on its own. */
|
|
2579
|
+
rejectHeldRevisions(collectionKey: CollectionRef, items: readonly HeldRevisionRef[], options?: {
|
|
2580
|
+
reason?: string;
|
|
2581
|
+
}): Promise<GuardrailsBatchResult>;
|
|
2582
|
+
/** Screen up to 50 held revisions again; each is published only if `clean`. */
|
|
2583
|
+
rescreenHeldRevisions(collectionKey: CollectionRef, items: readonly HeldRevisionRef[]): Promise<GuardrailsBatchResult>;
|
|
2584
|
+
/** Read a collection's review backlog and this hour's screening budget. */
|
|
2585
|
+
getGuardrailsUsage(collectionKey: CollectionRef): Promise<GuardrailsUsage>;
|
|
2586
|
+
/**
|
|
2587
|
+
* List what the environment holds for a person to review, newest first. `kind` is
|
|
2588
|
+
* `held` (the default) or `needs_review`; `status` applies to `held` only.
|
|
2589
|
+
* `params` carries `limit` (at most 100) and `offset`.
|
|
2590
|
+
*/
|
|
2591
|
+
listGuardrailsReviewQueue(options?: {
|
|
2592
|
+
kind?: 'held' | 'needs_review';
|
|
2593
|
+
collection?: CollectionRef;
|
|
2594
|
+
status?: HeldRevisionStatus;
|
|
2595
|
+
params?: Record<string, any>;
|
|
2596
|
+
}): Promise<GuardrailsReviewQueue>;
|
|
2597
|
+
/** Read the team view of a revision: provenance, findings and review state. */
|
|
2598
|
+
getRevisionGuardrails(collectionKey: CollectionRef, resourceKey: ResourceRef, revisionKey: RevisionRef): Promise<RevisionGuardrails>;
|
|
2599
|
+
/**
|
|
2600
|
+
* Vouch for a record's published content: a revision with the same data is created
|
|
2601
|
+
* and published, with the caller as its origin. Never retried automatically.
|
|
2602
|
+
*/
|
|
2603
|
+
markResourceReviewed(collectionKey: CollectionRef, resourceKey: ResourceRef): Promise<MarkReviewedResult>;
|
|
2604
|
+
/** Read the wording the API uses for findings, states and writers. */
|
|
2605
|
+
getGuardrailsCatalog(): Promise<GuardrailsCatalog>;
|
|
2021
2606
|
/**
|
|
2022
2607
|
* List the environment's webhook endpoints, newest first. Each item carries
|
|
2023
2608
|
* `stats_24h`; secrets are never included. `params` carries `status` (`active`,
|
|
@@ -2296,6 +2881,15 @@ interface BoostedSearchOptions {
|
|
|
2296
2881
|
*
|
|
2297
2882
|
* All methods are async and return parsed JSON responses.
|
|
2298
2883
|
*/
|
|
2884
|
+
/**
|
|
2885
|
+
* Declares untrusted content for a collection's guardrails, next to `data` on a write:
|
|
2886
|
+
* top-level fields to mark untrusted, and an optional `source` label
|
|
2887
|
+
* (`[a-z0-9_-]{1,32}`).
|
|
2888
|
+
*/
|
|
2889
|
+
interface WriteProvenance {
|
|
2890
|
+
untrusted_fields: string[];
|
|
2891
|
+
source?: string;
|
|
2892
|
+
}
|
|
2299
2893
|
declare class FluxClient {
|
|
2300
2894
|
readonly apiPrefix: string;
|
|
2301
2895
|
private readonly transport;
|
|
@@ -2322,9 +2916,13 @@ declare class FluxClient {
|
|
|
2322
2916
|
*
|
|
2323
2917
|
* Writes are never retried automatically: a failed write's outcome is
|
|
2324
2918
|
* unknown, so re-read with a GET before retrying.
|
|
2919
|
+
*
|
|
2920
|
+
* `options.provenance` declares untrusted fields for the collection's guardrails,
|
|
2921
|
+
* such as `{ untrusted_fields: ['body'], source: 'support-inbox' }`.
|
|
2325
2922
|
*/
|
|
2326
2923
|
createResource<T = any>(folderPath: string, data: Record<string, any>, options?: {
|
|
2327
2924
|
key?: string;
|
|
2925
|
+
provenance?: WriteProvenance;
|
|
2328
2926
|
}): Promise<T>;
|
|
2329
2927
|
/**
|
|
2330
2928
|
* Replace a resource's document and publish a new revision. This is a
|
|
@@ -2337,7 +2935,9 @@ declare class FluxClient {
|
|
|
2337
2935
|
* raises {@link CollectionNotWritableError}. Like {@link createResource}, it
|
|
2338
2936
|
* is never retried automatically.
|
|
2339
2937
|
*/
|
|
2340
|
-
updateResource<T = any>(folderPath: string, resourceKey: string, data: Record<string, any
|
|
2938
|
+
updateResource<T = any>(folderPath: string, resourceKey: string, data: Record<string, any>, options?: {
|
|
2939
|
+
provenance?: WriteProvenance;
|
|
2940
|
+
}): Promise<T>;
|
|
2341
2941
|
/**
|
|
2342
2942
|
* Get a grant for one upload to a files collection.
|
|
2343
2943
|
*
|
|
@@ -2381,4 +2981,93 @@ declare class FluxClient {
|
|
|
2381
2981
|
close(): void;
|
|
2382
2982
|
}
|
|
2383
2983
|
|
|
2384
|
-
|
|
2984
|
+
/** A record carries trust metadata that cannot be read. Treat it as untrusted. */
|
|
2985
|
+
declare class MalformedTrustMetadataError extends Error {
|
|
2986
|
+
constructor(message: string);
|
|
2987
|
+
}
|
|
2988
|
+
/** The guardrails trust object of a record (`_sys.trust`). */
|
|
2989
|
+
interface RecordTrust {
|
|
2990
|
+
version: number;
|
|
2991
|
+
source: string;
|
|
2992
|
+
provenance: string;
|
|
2993
|
+
screened: boolean;
|
|
2994
|
+
/** Set on a revision that was screened: `clean` or `suspicious`. */
|
|
2995
|
+
verdict?: string | null;
|
|
2996
|
+
reasons?: string[] | null;
|
|
2997
|
+
path_format: string;
|
|
2998
|
+
/** JSON Pointers relative to the record's `data`. */
|
|
2999
|
+
tainted_paths: string[];
|
|
3000
|
+
writers: Record<string, string>;
|
|
3001
|
+
sources: Record<string, string>;
|
|
3002
|
+
[key: string]: unknown;
|
|
3003
|
+
}
|
|
3004
|
+
/** A region withheld from a page's text and painted over in its image. */
|
|
3005
|
+
interface FileRegion {
|
|
3006
|
+
/** Counts from 1. */
|
|
3007
|
+
page: number;
|
|
3008
|
+
reason: string;
|
|
3009
|
+
/** `[x0, y0, x1, y1]`, fractions of the page width and height (`x0 <= x1`, `y0 <= y1`). */
|
|
3010
|
+
boxes: number[][];
|
|
3011
|
+
[key: string]: unknown;
|
|
3012
|
+
}
|
|
3013
|
+
/** Delivered text that is flagged as unreliable. */
|
|
3014
|
+
interface FileContentFlag extends FileRegion {
|
|
3015
|
+
/** `line`, `page` or `region`. */
|
|
3016
|
+
scope: string | null;
|
|
3017
|
+
/** Zero-based. */
|
|
3018
|
+
lines: number[];
|
|
3019
|
+
}
|
|
3020
|
+
/**
|
|
3021
|
+
* The trust object of a files record (`data.trust`). Everything file-derived is
|
|
3022
|
+
* untrusted. Every field is always sent; a missing one makes the object malformed.
|
|
3023
|
+
*/
|
|
3024
|
+
interface FileContentTrust {
|
|
3025
|
+
version: number;
|
|
3026
|
+
source: string;
|
|
3027
|
+
/** The `uuid` of the file block. */
|
|
3028
|
+
upload: string;
|
|
3029
|
+
verdict: string;
|
|
3030
|
+
reasons: string[];
|
|
3031
|
+
processing: string;
|
|
3032
|
+
redacted: FileRegion[];
|
|
3033
|
+
unreliable: FileContentFlag[];
|
|
3034
|
+
/** Dotted paths of the record, such as `content` and `file.original_filename`. */
|
|
3035
|
+
tainted_paths: string[];
|
|
3036
|
+
[key: string]: unknown;
|
|
3037
|
+
}
|
|
3038
|
+
/** Whether this SDK knows a record trust object's version, source, provenance, path format and verdict. */
|
|
3039
|
+
declare function isRecognizedRecordTrust(trust: RecordTrust): boolean;
|
|
3040
|
+
/** Whether this SDK knows a files trust object's version, source, verdict and processing. */
|
|
3041
|
+
declare function isRecognizedFileTrust(trust: FileContentTrust): boolean;
|
|
3042
|
+
/**
|
|
3043
|
+
* Read a record's guardrails trust object (`_sys.trust`).
|
|
3044
|
+
* @returns `null` when the record carries none.
|
|
3045
|
+
* @throws MalformedTrustMetadataError `_sys.trust` is present but cannot be read.
|
|
3046
|
+
*/
|
|
3047
|
+
declare function getRecordTrust(record: unknown): RecordTrust | null;
|
|
3048
|
+
/**
|
|
3049
|
+
* Read the trust object of a files record (`data.trust`).
|
|
3050
|
+
*
|
|
3051
|
+
* A files record is one whose `data.trust` has source `end_user_upload`, or whose
|
|
3052
|
+
* `data` holds its file block: `file` with `processing`, an object under
|
|
3053
|
+
* another key with `uuid`, `processing` and `tainted_paths`, or an object with
|
|
3054
|
+
* `processing` whose `uuid` is `data.trust.upload`. `upload` names the `uuid` of the
|
|
3055
|
+
* file block, which a files record always has, and `processing` is `agent_ready`
|
|
3056
|
+
* exactly when the block's is.
|
|
3057
|
+
* @returns `null` when the record is not a files record.
|
|
3058
|
+
* @throws MalformedTrustMetadataError The record is a files record and its `trust`
|
|
3059
|
+
* is missing or cannot be read.
|
|
3060
|
+
*/
|
|
3061
|
+
declare function getFileTrust(record: unknown): FileContentTrust | null;
|
|
3062
|
+
/**
|
|
3063
|
+
* The record's top-level `data` fields that hold untrusted values, sorted.
|
|
3064
|
+
*
|
|
3065
|
+
* The union of what `_sys.trust` and a files record's `data.trust` list. When either
|
|
3066
|
+
* is present but not recognized, every `data` field is returned (and none of the
|
|
3067
|
+
* paths it lists, which are not read).
|
|
3068
|
+
*
|
|
3069
|
+
* @throws MalformedTrustMetadataError Trust metadata is present but cannot be read.
|
|
3070
|
+
*/
|
|
3071
|
+
declare function getUntrustedFields(record: unknown): string[];
|
|
3072
|
+
|
|
3073
|
+
export { type APICollectionList, type APICollectionSummary, type APIFolderList, type APIFolderSummary, type APIInfo, type APIList, type APIRef, AnonymousAuth, type ApiFolderOptions, type ApiFolderRouteDescriptionOptions, type AuthStrategy, type BatchItemError, type BatchUpsertItem, type BatchUpsertResult, type BoostedSearchOptions, type CollectionList, CollectionNotWritableError, type CollectionRef, type CollectionSummary, type ComponentList, type ComponentRef, type ComponentSummary, type ComponentSyncConflictDetail, type ContentTypeAccess, ContentValidationFailedError, type CurrentUsage, DEFAULT_RETRY_CONFIG, DEFAULT_USER_AGENT, type EnvironmentAccess, type EnvironmentList, type EnvironmentRef, type EnvironmentSummary, ExternalIdConflictError, type FieldList, type FieldSummary, type FileActiveContent, type FileAnalysis, type FileCheck, type FileContentFlag, type FileContentTrust, type FileCopyAvailability, type FileDownload, type FileDownloadOptions, type FileEvidencePart, type FileFinding, type FileFindingGroup, type FileFindingsSummary, type FileInfo, type FileKind, type FileOrigin, type FileOriginActor, type FileOriginLink, type FilePageDetail, type FilePageFinding, type FilePagePii, type FilePageRedaction, type FilePageTable, type FileRecordOwner, type FileRecordView, type FileRegion, type FileReviewItem, type FileReviewQueue, type FileSummary, type FileTextEvidence, type FileTombstone, type FileTombstoneList, type FileTrust, type FilesPolicy, type FilesPolicyBody, FilesQuotaExceededError, FilesQuotaUnavailableError, type FlatRoute, type FlatRouteSummary, type FluxAPIKeyBearerToken, type FluxAPIKeyList, type FluxAPIKeyRef, type FluxAPIKeySummary, FluxClient, type FluxClientOptions, type FluxRoleList, type FluxRoleRef, type FluxRoleSummary, type FolderList, type FolderRef, type FolderSummary, FoxnoseAPIError, FoxnoseAuthError, type FoxnoseConfig, FoxnoseError, FoxnoseTransportError, GUARDRAILS_POLICY_FIELDS, type GuardrailsBatchItemResult, type GuardrailsBatchResult, type GuardrailsCatalog, type GuardrailsDeliveredBy, type GuardrailsFinding, type GuardrailsPolicy, type GuardrailsPolicyBody, type GuardrailsReviewItem, type GuardrailsReviewQueue, type GuardrailsTaintedField, type GuardrailsUntrustedField, type GuardrailsUsage, type GuardrailsWhy, type GuardrailsWriter, type HeldRevision, type HeldRevisionDecision, type HeldRevisionList, type HeldRevisionRef, type HeldRevisionStatus, HttpTransport, type HybridConfig, type HybridSearchOptions, JWTAuth, type LocaleList, type LocaleSummary, MalformedTrustMetadataError, type ManagementAPIKeyList, type ManagementAPIKeyRef, type ManagementAPIKeySummary, ManagementClient, type ManagementClientOptions, type ManagementRoleList, type ManagementRoleRef, type ManagementRoleSummary, type MarkReviewedResult, type MyPermissions, type NestedFieldMeta, type OrgRef, type OrganizationList, type OrganizationOwner, type OrganizationPlanStatus, type OrganizationSummary, type OrganizationUsage, type PaginatedResponse, type PlanDetails, PlanExhaustedError, PlanLimitExceededError, type PlanLimits, type ProjectList, type ProjectRef, type ProjectSummary, RateLimitExceededError, type RecordTrust, type RegionInfo, type RequestData, type ResourceGuardrailsSummary, type ResourceList, type ResourceRef, type ResourceSummary, type RetryConfig, type RevisionGuardrails, type RevisionGuardrailsSummary, type RevisionList, type RevisionRef, type RevisionSummary, type RolePermission, type RolePermissionObject, SDK_VERSION, type SchemaVersionList, type SchemaVersionRef, type SchemaVersionSummary, SearchMode, type SearchRequest, SecureKeyAuth, type SignTenantTokenOptions, SimpleKeyAuth, SpendCapExceededError, StaticTokenProvider, type StorageUsage, type SyncComponentResponse, type SyncComponentSkippedItem, TENANT_TOKEN_PREFIX, type TenantLimitValues, type TenantLimits, type TenantPrivateKey, type TenantSigningKey, type TenantSigningKeyCreateRequest, type TenantSigningKeyCreated, type TenantSigningKeyList, type TenantSigningKeyPair, type TenantSigningKeyUpdateRequest, type TenantTokenAnchor, TenantTokenAuth, type TenantTokenFetchOptions, type TenantTokenRevocation, TenantTokenSource, type TenantTokenSourceOptions, type TokenProvider, type UnitsUsage, type UploadFileProgress, type UploadFileStatus, type UploadLink, type UploadLinkCreateRequest, type UploadLinkCreated, type UploadLinkCreator, type UploadLinkFile, type UploadLinkList, type UploadLinkSession, type UploadSignature, type UploadStatus, UpstreamError, type UsageBreakdown, type UsageMetric, type UserReference, SDK_VERSION as VERSION, type VectorBoostConfig, type VectorFieldSearch, type VectorFieldSearchOptions, type VectorSearch, type VectorSearchOptions, type WebhookAttempt, type WebhookAttemptList, type WebhookDelivery, type WebhookDeliveryCounts, type WebhookDeliveryEvent, type WebhookEndpoint, type WebhookEndpointCreateRequest, type WebhookEndpointCreated, type WebhookEndpointDelivery, type WebhookEndpointDeliveryList, WebhookEndpointLimitExceededError, type WebhookEndpointList, WebhookEndpointNotActiveError, WebhookEndpointNotFoundError, WebhookEndpointNotSubscribedError, type WebhookEndpointRef, type WebhookEndpointStatus, type WebhookEndpointUpdateRequest, type WebhookEvent, type WebhookEventDetail, type WebhookEventList, type WebhookEventListParams, WebhookEventNotFoundError, type WebhookEventType, type WebhookEventTypeList, type WebhookPayloadMode, type WebhookRecovery, type WebhookRedelivery, type WebhookRedeliveryResult, type WebhookSecret, type WebhookSecretRotation, type WebhookSkippedEndpoint, type WebhookStats24h, type WebhookTestEvent, type WriteProvenance, bearerErrors, buildSearchBody, createConfig, generateTenantSigningKey, getFileTrust, getRecordTrust, getResourceGuardrailsSummary, getRevisionGuardrailsSummary, getUntrustedFields, isInvalidTokenChallenge, isRecognizedFileTrust, isRecognizedRecordTrust, nestedFieldMeta, parseFindingEvidence, resolveKey, signTenantToken, tenantTokenFetch };
|