@foxnose/sdk 0.5.1 → 0.6.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 +88 -0
- package/dist/index.cjs +126 -127
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +168 -4
- package/dist/index.d.ts +168 -4
- package/dist/index.js +126 -127
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -93,8 +93,8 @@ interface RetryConfig {
|
|
|
93
93
|
methods: readonly string[];
|
|
94
94
|
}
|
|
95
95
|
declare const DEFAULT_RETRY_CONFIG: Readonly<RetryConfig>;
|
|
96
|
-
declare const SDK_VERSION = "0.
|
|
97
|
-
declare const DEFAULT_USER_AGENT = "foxnose-sdk-js/0.
|
|
96
|
+
declare const SDK_VERSION = "0.6.1";
|
|
97
|
+
declare const DEFAULT_USER_AGENT = "foxnose-sdk-js/0.6.1";
|
|
98
98
|
/**
|
|
99
99
|
* General transport-level configuration shared by all clients.
|
|
100
100
|
*/
|
|
@@ -229,6 +229,12 @@ declare class ExternalIdConflictError extends FoxnoseAPIError {
|
|
|
229
229
|
}
|
|
230
230
|
/**
|
|
231
231
|
* Raised on HTTP 422 when submitted `data` fails the collection's schema.
|
|
232
|
+
*
|
|
233
|
+
* Two server error codes mean this, and both map here:
|
|
234
|
+
* `content_validation_failed` and `data_validation_error`. The latter is what
|
|
235
|
+
* a Flux resource write returns, so leaving it unmapped meant the most common
|
|
236
|
+
* way to hit a schema violation raised a bare {@link FoxnoseAPIError}, and
|
|
237
|
+
* `instanceof ContentValidationFailedError` never matched it.
|
|
232
238
|
*/
|
|
233
239
|
declare class ContentValidationFailedError extends FoxnoseAPIError {
|
|
234
240
|
/** Individual validation problems; each includes a `json_path`. */
|
|
@@ -544,8 +550,35 @@ interface FluxAPIKeySummary {
|
|
|
544
550
|
role?: string | null;
|
|
545
551
|
environment: string;
|
|
546
552
|
created_at: string;
|
|
553
|
+
/**
|
|
554
|
+
* First 12 characters of the key's bearer token (e.g. `fxk_A7fQ2mXe`), or
|
|
555
|
+
* null when none is issued. Enough to recognise a token in a config file or
|
|
556
|
+
* a log; never enough to use one — the token itself is returned only by
|
|
557
|
+
* {@link ManagementClient.issueFluxApiKeyBearerToken}, once.
|
|
558
|
+
*/
|
|
559
|
+
bearer_token_prefix?: string | null;
|
|
560
|
+
/** When the current bearer token was issued, or null. */
|
|
561
|
+
bearer_token_issued_at?: string | null;
|
|
547
562
|
}
|
|
548
563
|
type FluxAPIKeyList = PaginatedResponse<FluxAPIKeySummary>;
|
|
564
|
+
/**
|
|
565
|
+
* The one-time response from issuing or re-issuing a Flux key's bearer token.
|
|
566
|
+
*
|
|
567
|
+
* A bearer token is an opaque credential bound to a Flux API key, for hosted
|
|
568
|
+
* MCP connectors that can only send `Authorization: Bearer <token>` and cannot
|
|
569
|
+
* choose a scheme. It identifies the key and nothing more: role, grants and
|
|
570
|
+
* per-collection permissions are the key's own.
|
|
571
|
+
*/
|
|
572
|
+
interface FluxAPIKeyBearerToken {
|
|
573
|
+
/**
|
|
574
|
+
* The credential, e.g. `fxk_A7fQ2mXe...`. RETURNED ONLY HERE, ONLY ONCE —
|
|
575
|
+
* the service stores a hash, so a lost token is re-issued, not recovered.
|
|
576
|
+
*/
|
|
577
|
+
bearer_token: string;
|
|
578
|
+
/** First 12 characters, also present on every subsequent key read. */
|
|
579
|
+
bearer_token_prefix: string;
|
|
580
|
+
bearer_token_issued_at: string;
|
|
581
|
+
}
|
|
549
582
|
interface ManagementRoleSummary {
|
|
550
583
|
key: string;
|
|
551
584
|
name: string;
|
|
@@ -595,6 +628,49 @@ interface APIInfo {
|
|
|
595
628
|
path?: string | null;
|
|
596
629
|
}
|
|
597
630
|
type APIList = PaginatedResponse<APIInfo>;
|
|
631
|
+
/**
|
|
632
|
+
* One entry in `flat_routes[]` on a collection's connection to an API — a
|
|
633
|
+
* read-only address for a strict-reference collection that omits some
|
|
634
|
+
* number of ancestor keys from the path. `level 0` is fully flat and drops
|
|
635
|
+
* every ancestor key; `level >= 1` keeps the root-most `retained_ancestors`.
|
|
636
|
+
*
|
|
637
|
+
* `omitted_ancestors` and `retained_ancestors` are ancestor UUIDs, not the
|
|
638
|
+
* short collection keys used elsewhere (e.g. `folder`) — do not treat them
|
|
639
|
+
* as interchangeable.
|
|
640
|
+
*
|
|
641
|
+
* `read_methods` is typed as sent by the server, which currently mirrors
|
|
642
|
+
* the connection's `allowed_methods` verbatim rather than filtering by what
|
|
643
|
+
* is actually available at this level (docs and server disagree on both
|
|
644
|
+
* Get Resource at level 0 and Search at any level). Do not "correct" it.
|
|
645
|
+
*/
|
|
646
|
+
interface FlatRoute {
|
|
647
|
+
level: number;
|
|
648
|
+
path: string;
|
|
649
|
+
omitted_ancestors: string[];
|
|
650
|
+
retained_ancestors: string[];
|
|
651
|
+
enabled: boolean;
|
|
652
|
+
read_methods: string[];
|
|
653
|
+
available: boolean;
|
|
654
|
+
unavailable_reason: string | null;
|
|
655
|
+
published_generation: number;
|
|
656
|
+
router_generation: number;
|
|
657
|
+
}
|
|
658
|
+
/**
|
|
659
|
+
* The singular `flat_route` on a connection. Undocumented: it appears to
|
|
660
|
+
* mirror whichever entry of `flat_routes` is enabled, but unlike a
|
|
661
|
+
* {@link FlatRoute} it carries no `level` or `retained_ancestors`. Type it
|
|
662
|
+
* for forward compatibility; build no behavior on it.
|
|
663
|
+
*/
|
|
664
|
+
interface FlatRouteSummary {
|
|
665
|
+
path: string;
|
|
666
|
+
omitted_ancestors: string[];
|
|
667
|
+
enabled: boolean;
|
|
668
|
+
read_methods: string[];
|
|
669
|
+
available: boolean;
|
|
670
|
+
unavailable_reason: string | null;
|
|
671
|
+
published_generation: number;
|
|
672
|
+
router_generation: number;
|
|
673
|
+
}
|
|
598
674
|
interface APIFolderSummary {
|
|
599
675
|
folder: string;
|
|
600
676
|
api?: string | null;
|
|
@@ -605,6 +681,29 @@ interface APIFolderSummary {
|
|
|
605
681
|
description_search?: string | null;
|
|
606
682
|
description_schema?: string | null;
|
|
607
683
|
created_at?: string | null;
|
|
684
|
+
/**
|
|
685
|
+
* Ancestor levels (0 = fully flat) exposed as cross-parent read addresses
|
|
686
|
+
* for this connection. Sent together with `unscoped_ancestors` — a level
|
|
687
|
+
* with no corresponding ancestor is rejected by the server. Present on
|
|
688
|
+
* every connection observed (`[]` when unused), not nullable.
|
|
689
|
+
*/
|
|
690
|
+
unscoped_levels: number[];
|
|
691
|
+
/**
|
|
692
|
+
* Ancestor UUIDs (not collection keys) left unscoped at the corresponding
|
|
693
|
+
* `unscoped_levels`. Present on every connection observed (`[]` when
|
|
694
|
+
* unused), not nullable.
|
|
695
|
+
*/
|
|
696
|
+
unscoped_ancestors: string[];
|
|
697
|
+
/**
|
|
698
|
+
* Present in the response but documented nowhere; semantics unconfirmed.
|
|
699
|
+
* Typed so it is no longer silently dropped. Do not build request-side
|
|
700
|
+
* behavior on it.
|
|
701
|
+
*/
|
|
702
|
+
expose_owner: boolean;
|
|
703
|
+
/** Undocumented; see {@link FlatRouteSummary}. Observed `null`, not just absent. */
|
|
704
|
+
flat_route?: FlatRouteSummary | null;
|
|
705
|
+
/** Observed `null` (not `[]`) on a connection with no key-bearing ancestor. */
|
|
706
|
+
flat_routes?: FlatRoute[] | null;
|
|
608
707
|
}
|
|
609
708
|
type APIFolderList = PaginatedResponse<APIFolderSummary>;
|
|
610
709
|
/** @public Alias of {@link APIFolderSummary}. */
|
|
@@ -748,6 +847,18 @@ interface ApiFolderRouteDescriptionOptions {
|
|
|
748
847
|
}
|
|
749
848
|
interface ApiFolderOptions extends ApiFolderRouteDescriptionOptions {
|
|
750
849
|
allowedMethods?: string[];
|
|
850
|
+
/**
|
|
851
|
+
* Ancestor levels (0 = fully flat) to expose as cross-parent read
|
|
852
|
+
* addresses. Wire field `unscoped_levels`. Must be sent together with
|
|
853
|
+
* `unscopedAncestors` — the server rejects a level with no corresponding
|
|
854
|
+
* ancestor; not enforced client-side.
|
|
855
|
+
*/
|
|
856
|
+
unscopedLevels?: number[];
|
|
857
|
+
/**
|
|
858
|
+
* Ancestor UUIDs (not collection keys) to leave unscoped at the
|
|
859
|
+
* corresponding `unscopedLevels`. Wire field `unscoped_ancestors`.
|
|
860
|
+
*/
|
|
861
|
+
unscopedAncestors?: string[];
|
|
751
862
|
}
|
|
752
863
|
/**
|
|
753
864
|
* Client for the FoxNose Management API.
|
|
@@ -790,11 +901,48 @@ declare class ManagementClient {
|
|
|
790
901
|
getFluxApiKey(key: FluxAPIKeyRef): Promise<FluxAPIKeySummary>;
|
|
791
902
|
updateFluxApiKey(key: FluxAPIKeyRef, payload: Record<string, any>): Promise<FluxAPIKeySummary>;
|
|
792
903
|
deleteFluxApiKey(key: FluxAPIKeyRef): Promise<void>;
|
|
904
|
+
/**
|
|
905
|
+
* Issue a bearer token for a Flux API key, or replace the existing one.
|
|
906
|
+
*
|
|
907
|
+
* A bearer token exists for clients that accept a single token value and send
|
|
908
|
+
* it as `Authorization: Bearer <token>` with no way to choose the scheme —
|
|
909
|
+
* hosted MCP connectors, notably the Claude API's `mcp_servers`. Those clients
|
|
910
|
+
* cannot send `Simple` or `Secure` at all.
|
|
911
|
+
*
|
|
912
|
+
* THE PLAINTEXT IS RETURNED ONLY HERE, AND ONLY ONCE. The service stores a
|
|
913
|
+
* hash, exactly as it does for `secret_key`, so a lost token is re-issued
|
|
914
|
+
* rather than recovered. Subsequent key reads expose only
|
|
915
|
+
* `bearer_token_prefix`.
|
|
916
|
+
*
|
|
917
|
+
* The key itself is untouched: `public_key`, `secret_key`, `role` and grants
|
|
918
|
+
* all survive, so `Simple` and `Secure` integrations keep working across a
|
|
919
|
+
* re-issue. That is what makes this the way to cut off a connector without
|
|
920
|
+
* recreating a key and reconfiguring everything that uses it.
|
|
921
|
+
*
|
|
922
|
+
* There is at most one token per key; calling this again replaces it.
|
|
923
|
+
*/
|
|
924
|
+
issueFluxApiKeyBearerToken(key: FluxAPIKeyRef): Promise<FluxAPIKeyBearerToken>;
|
|
925
|
+
/**
|
|
926
|
+
* Revoke a Flux API key's bearer token. The key and its role keep working.
|
|
927
|
+
*
|
|
928
|
+
* Idempotent: succeeds whether or not a token was issued.
|
|
929
|
+
*/
|
|
930
|
+
revokeFluxApiKeyBearerToken(key: FluxAPIKeyRef): Promise<void>;
|
|
793
931
|
listApis(params?: Record<string, any>): Promise<APIList>;
|
|
794
932
|
createApi(payload: Record<string, any>): Promise<APIInfo>;
|
|
795
933
|
getApi(apiKey: APIRef): Promise<APIInfo>;
|
|
796
934
|
updateApi(apiKey: APIRef, payload: Record<string, any>): Promise<APIInfo>;
|
|
797
935
|
deleteApi(apiKey: APIRef): Promise<void>;
|
|
936
|
+
/**
|
|
937
|
+
* Build the request body shared by all four API-collection-association
|
|
938
|
+
* writers: {@link addApiCollection}, {@link updateApiCollection}, and
|
|
939
|
+
* their deprecated `*ApiFolder*` twins. All four accept {@link
|
|
940
|
+
* ApiFolderOptions}, so this is the one place that maps its camelCase
|
|
941
|
+
* fields to wire snake_case — adding a field here, rather than to each
|
|
942
|
+
* method separately, is what keeps the deprecated twins from silently
|
|
943
|
+
* swallowing a field the type says they accept.
|
|
944
|
+
*/
|
|
945
|
+
private buildApiFolderPayload;
|
|
798
946
|
listApiCollections(apiKey: APIRef, params?: Record<string, any>): Promise<APICollectionList>;
|
|
799
947
|
addApiCollection(apiKey: APIRef, collectionKey: CollectionRef, options?: ApiFolderOptions): Promise<APICollectionSummary>;
|
|
800
948
|
getApiCollection(apiKey: APIRef, collectionKey: CollectionRef): Promise<APICollectionSummary>;
|
|
@@ -1031,6 +1179,14 @@ interface VectorSearchOptions {
|
|
|
1031
1179
|
similarity_threshold?: number;
|
|
1032
1180
|
limit?: number;
|
|
1033
1181
|
offset?: number;
|
|
1182
|
+
/**
|
|
1183
|
+
* Query-string parameters for the underlying `search()` call (e.g.
|
|
1184
|
+
* `{ truncate_text: 200 }`). Named `queryParams`, not `params`: this
|
|
1185
|
+
* options object also carries an index signature that funnels unknown
|
|
1186
|
+
* keys into the JSON body, and an explicit `params` field would silently
|
|
1187
|
+
* reroute an existing `params` body extra to the query string.
|
|
1188
|
+
*/
|
|
1189
|
+
queryParams?: Record<string, any>;
|
|
1034
1190
|
[extra: string]: any;
|
|
1035
1191
|
}
|
|
1036
1192
|
interface VectorFieldSearchOptions {
|
|
@@ -1040,6 +1196,8 @@ interface VectorFieldSearchOptions {
|
|
|
1040
1196
|
similarity_threshold?: number;
|
|
1041
1197
|
limit?: number;
|
|
1042
1198
|
offset?: number;
|
|
1199
|
+
/** See {@link VectorSearchOptions.queryParams}. */
|
|
1200
|
+
queryParams?: Record<string, any>;
|
|
1043
1201
|
[extra: string]: any;
|
|
1044
1202
|
}
|
|
1045
1203
|
interface HybridSearchOptions {
|
|
@@ -1053,6 +1211,8 @@ interface HybridSearchOptions {
|
|
|
1053
1211
|
rerank_results?: boolean;
|
|
1054
1212
|
limit?: number;
|
|
1055
1213
|
offset?: number;
|
|
1214
|
+
/** See {@link VectorSearchOptions.queryParams}. */
|
|
1215
|
+
queryParams?: Record<string, any>;
|
|
1056
1216
|
[extra: string]: any;
|
|
1057
1217
|
}
|
|
1058
1218
|
interface BoostedSearchOptions {
|
|
@@ -1067,6 +1227,8 @@ interface BoostedSearchOptions {
|
|
|
1067
1227
|
max_boost_results?: number;
|
|
1068
1228
|
limit?: number;
|
|
1069
1229
|
offset?: number;
|
|
1230
|
+
/** See {@link VectorSearchOptions.queryParams}. */
|
|
1231
|
+
queryParams?: Record<string, any>;
|
|
1070
1232
|
[extra: string]: any;
|
|
1071
1233
|
}
|
|
1072
1234
|
/**
|
|
@@ -1081,7 +1243,9 @@ declare class FluxClient {
|
|
|
1081
1243
|
private buildPath;
|
|
1082
1244
|
listResources<T = any>(folderPath: string, params?: Record<string, any>): Promise<T>;
|
|
1083
1245
|
getResource<T = any>(folderPath: string, resourceKey: string, params?: Record<string, any>): Promise<T>;
|
|
1084
|
-
search<T = any>(folderPath: string, body: Record<string, any
|
|
1246
|
+
search<T = any>(folderPath: string, body: Record<string, any>, options?: {
|
|
1247
|
+
params?: Record<string, any>;
|
|
1248
|
+
}): Promise<T>;
|
|
1085
1249
|
/**
|
|
1086
1250
|
* Create a resource in a collection and publish it immediately.
|
|
1087
1251
|
*
|
|
@@ -1186,4 +1350,4 @@ interface SearchRequest {
|
|
|
1186
1350
|
*/
|
|
1187
1351
|
declare function buildSearchBody(req: SearchRequest): Record<string, any>;
|
|
1188
1352
|
|
|
1189
|
-
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, ContentValidationFailedError, type CurrentUsage, DEFAULT_RETRY_CONFIG, DEFAULT_USER_AGENT, type EnvironmentList, type EnvironmentRef, type EnvironmentSummary, ExternalIdConflictError, type FieldList, type FieldSummary, 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, HttpTransport, type HybridConfig, type HybridSearchOptions, JWTAuth, type LocaleList, type LocaleSummary, type ManagementAPIKeyList, type ManagementAPIKeyRef, type ManagementAPIKeySummary, ManagementClient, type ManagementClientOptions, type ManagementRoleList, type ManagementRoleRef, type ManagementRoleSummary, 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 RegionInfo, type RequestData, type ResourceList, type ResourceRef, type ResourceSummary, type RetryConfig, type RevisionList, type RevisionRef, type RevisionSummary, type RolePermission, type RolePermissionObject, SDK_VERSION, type SchemaVersionList, type SchemaVersionRef, type SchemaVersionSummary, SearchMode, type SearchRequest, SecureKeyAuth, SimpleKeyAuth, SpendCapExceededError, StaticTokenProvider, type StorageUsage, type SyncComponentResponse, type SyncComponentSkippedItem, type TokenProvider, type UnitsUsage, UpstreamError, type UsageBreakdown, type UsageMetric, type UserReference, SDK_VERSION as VERSION, type VectorBoostConfig, type VectorFieldSearch, type VectorFieldSearchOptions, type VectorSearch, type VectorSearchOptions, buildSearchBody, createConfig, nestedFieldMeta, resolveKey };
|
|
1353
|
+
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, ContentValidationFailedError, type CurrentUsage, DEFAULT_RETRY_CONFIG, DEFAULT_USER_AGENT, type EnvironmentList, type EnvironmentRef, type EnvironmentSummary, ExternalIdConflictError, type FieldList, type FieldSummary, 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, HttpTransport, type HybridConfig, type HybridSearchOptions, JWTAuth, type LocaleList, type LocaleSummary, type ManagementAPIKeyList, type ManagementAPIKeyRef, type ManagementAPIKeySummary, ManagementClient, type ManagementClientOptions, type ManagementRoleList, type ManagementRoleRef, type ManagementRoleSummary, 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 RegionInfo, type RequestData, type ResourceList, type ResourceRef, type ResourceSummary, type RetryConfig, type RevisionList, type RevisionRef, type RevisionSummary, type RolePermission, type RolePermissionObject, SDK_VERSION, type SchemaVersionList, type SchemaVersionRef, type SchemaVersionSummary, SearchMode, type SearchRequest, SecureKeyAuth, SimpleKeyAuth, SpendCapExceededError, StaticTokenProvider, type StorageUsage, type SyncComponentResponse, type SyncComponentSkippedItem, type TokenProvider, type UnitsUsage, UpstreamError, type UsageBreakdown, type UsageMetric, type UserReference, SDK_VERSION as VERSION, type VectorBoostConfig, type VectorFieldSearch, type VectorFieldSearchOptions, type VectorSearch, type VectorSearchOptions, buildSearchBody, createConfig, nestedFieldMeta, resolveKey };
|
package/dist/index.d.ts
CHANGED
|
@@ -93,8 +93,8 @@ interface RetryConfig {
|
|
|
93
93
|
methods: readonly string[];
|
|
94
94
|
}
|
|
95
95
|
declare const DEFAULT_RETRY_CONFIG: Readonly<RetryConfig>;
|
|
96
|
-
declare const SDK_VERSION = "0.
|
|
97
|
-
declare const DEFAULT_USER_AGENT = "foxnose-sdk-js/0.
|
|
96
|
+
declare const SDK_VERSION = "0.6.1";
|
|
97
|
+
declare const DEFAULT_USER_AGENT = "foxnose-sdk-js/0.6.1";
|
|
98
98
|
/**
|
|
99
99
|
* General transport-level configuration shared by all clients.
|
|
100
100
|
*/
|
|
@@ -229,6 +229,12 @@ declare class ExternalIdConflictError extends FoxnoseAPIError {
|
|
|
229
229
|
}
|
|
230
230
|
/**
|
|
231
231
|
* Raised on HTTP 422 when submitted `data` fails the collection's schema.
|
|
232
|
+
*
|
|
233
|
+
* Two server error codes mean this, and both map here:
|
|
234
|
+
* `content_validation_failed` and `data_validation_error`. The latter is what
|
|
235
|
+
* a Flux resource write returns, so leaving it unmapped meant the most common
|
|
236
|
+
* way to hit a schema violation raised a bare {@link FoxnoseAPIError}, and
|
|
237
|
+
* `instanceof ContentValidationFailedError` never matched it.
|
|
232
238
|
*/
|
|
233
239
|
declare class ContentValidationFailedError extends FoxnoseAPIError {
|
|
234
240
|
/** Individual validation problems; each includes a `json_path`. */
|
|
@@ -544,8 +550,35 @@ interface FluxAPIKeySummary {
|
|
|
544
550
|
role?: string | null;
|
|
545
551
|
environment: string;
|
|
546
552
|
created_at: string;
|
|
553
|
+
/**
|
|
554
|
+
* First 12 characters of the key's bearer token (e.g. `fxk_A7fQ2mXe`), or
|
|
555
|
+
* null when none is issued. Enough to recognise a token in a config file or
|
|
556
|
+
* a log; never enough to use one — the token itself is returned only by
|
|
557
|
+
* {@link ManagementClient.issueFluxApiKeyBearerToken}, once.
|
|
558
|
+
*/
|
|
559
|
+
bearer_token_prefix?: string | null;
|
|
560
|
+
/** When the current bearer token was issued, or null. */
|
|
561
|
+
bearer_token_issued_at?: string | null;
|
|
547
562
|
}
|
|
548
563
|
type FluxAPIKeyList = PaginatedResponse<FluxAPIKeySummary>;
|
|
564
|
+
/**
|
|
565
|
+
* The one-time response from issuing or re-issuing a Flux key's bearer token.
|
|
566
|
+
*
|
|
567
|
+
* A bearer token is an opaque credential bound to a Flux API key, for hosted
|
|
568
|
+
* MCP connectors that can only send `Authorization: Bearer <token>` and cannot
|
|
569
|
+
* choose a scheme. It identifies the key and nothing more: role, grants and
|
|
570
|
+
* per-collection permissions are the key's own.
|
|
571
|
+
*/
|
|
572
|
+
interface FluxAPIKeyBearerToken {
|
|
573
|
+
/**
|
|
574
|
+
* The credential, e.g. `fxk_A7fQ2mXe...`. RETURNED ONLY HERE, ONLY ONCE —
|
|
575
|
+
* the service stores a hash, so a lost token is re-issued, not recovered.
|
|
576
|
+
*/
|
|
577
|
+
bearer_token: string;
|
|
578
|
+
/** First 12 characters, also present on every subsequent key read. */
|
|
579
|
+
bearer_token_prefix: string;
|
|
580
|
+
bearer_token_issued_at: string;
|
|
581
|
+
}
|
|
549
582
|
interface ManagementRoleSummary {
|
|
550
583
|
key: string;
|
|
551
584
|
name: string;
|
|
@@ -595,6 +628,49 @@ interface APIInfo {
|
|
|
595
628
|
path?: string | null;
|
|
596
629
|
}
|
|
597
630
|
type APIList = PaginatedResponse<APIInfo>;
|
|
631
|
+
/**
|
|
632
|
+
* One entry in `flat_routes[]` on a collection's connection to an API — a
|
|
633
|
+
* read-only address for a strict-reference collection that omits some
|
|
634
|
+
* number of ancestor keys from the path. `level 0` is fully flat and drops
|
|
635
|
+
* every ancestor key; `level >= 1` keeps the root-most `retained_ancestors`.
|
|
636
|
+
*
|
|
637
|
+
* `omitted_ancestors` and `retained_ancestors` are ancestor UUIDs, not the
|
|
638
|
+
* short collection keys used elsewhere (e.g. `folder`) — do not treat them
|
|
639
|
+
* as interchangeable.
|
|
640
|
+
*
|
|
641
|
+
* `read_methods` is typed as sent by the server, which currently mirrors
|
|
642
|
+
* the connection's `allowed_methods` verbatim rather than filtering by what
|
|
643
|
+
* is actually available at this level (docs and server disagree on both
|
|
644
|
+
* Get Resource at level 0 and Search at any level). Do not "correct" it.
|
|
645
|
+
*/
|
|
646
|
+
interface FlatRoute {
|
|
647
|
+
level: number;
|
|
648
|
+
path: string;
|
|
649
|
+
omitted_ancestors: string[];
|
|
650
|
+
retained_ancestors: string[];
|
|
651
|
+
enabled: boolean;
|
|
652
|
+
read_methods: string[];
|
|
653
|
+
available: boolean;
|
|
654
|
+
unavailable_reason: string | null;
|
|
655
|
+
published_generation: number;
|
|
656
|
+
router_generation: number;
|
|
657
|
+
}
|
|
658
|
+
/**
|
|
659
|
+
* The singular `flat_route` on a connection. Undocumented: it appears to
|
|
660
|
+
* mirror whichever entry of `flat_routes` is enabled, but unlike a
|
|
661
|
+
* {@link FlatRoute} it carries no `level` or `retained_ancestors`. Type it
|
|
662
|
+
* for forward compatibility; build no behavior on it.
|
|
663
|
+
*/
|
|
664
|
+
interface FlatRouteSummary {
|
|
665
|
+
path: string;
|
|
666
|
+
omitted_ancestors: string[];
|
|
667
|
+
enabled: boolean;
|
|
668
|
+
read_methods: string[];
|
|
669
|
+
available: boolean;
|
|
670
|
+
unavailable_reason: string | null;
|
|
671
|
+
published_generation: number;
|
|
672
|
+
router_generation: number;
|
|
673
|
+
}
|
|
598
674
|
interface APIFolderSummary {
|
|
599
675
|
folder: string;
|
|
600
676
|
api?: string | null;
|
|
@@ -605,6 +681,29 @@ interface APIFolderSummary {
|
|
|
605
681
|
description_search?: string | null;
|
|
606
682
|
description_schema?: string | null;
|
|
607
683
|
created_at?: string | null;
|
|
684
|
+
/**
|
|
685
|
+
* Ancestor levels (0 = fully flat) exposed as cross-parent read addresses
|
|
686
|
+
* for this connection. Sent together with `unscoped_ancestors` — a level
|
|
687
|
+
* with no corresponding ancestor is rejected by the server. Present on
|
|
688
|
+
* every connection observed (`[]` when unused), not nullable.
|
|
689
|
+
*/
|
|
690
|
+
unscoped_levels: number[];
|
|
691
|
+
/**
|
|
692
|
+
* Ancestor UUIDs (not collection keys) left unscoped at the corresponding
|
|
693
|
+
* `unscoped_levels`. Present on every connection observed (`[]` when
|
|
694
|
+
* unused), not nullable.
|
|
695
|
+
*/
|
|
696
|
+
unscoped_ancestors: string[];
|
|
697
|
+
/**
|
|
698
|
+
* Present in the response but documented nowhere; semantics unconfirmed.
|
|
699
|
+
* Typed so it is no longer silently dropped. Do not build request-side
|
|
700
|
+
* behavior on it.
|
|
701
|
+
*/
|
|
702
|
+
expose_owner: boolean;
|
|
703
|
+
/** Undocumented; see {@link FlatRouteSummary}. Observed `null`, not just absent. */
|
|
704
|
+
flat_route?: FlatRouteSummary | null;
|
|
705
|
+
/** Observed `null` (not `[]`) on a connection with no key-bearing ancestor. */
|
|
706
|
+
flat_routes?: FlatRoute[] | null;
|
|
608
707
|
}
|
|
609
708
|
type APIFolderList = PaginatedResponse<APIFolderSummary>;
|
|
610
709
|
/** @public Alias of {@link APIFolderSummary}. */
|
|
@@ -748,6 +847,18 @@ interface ApiFolderRouteDescriptionOptions {
|
|
|
748
847
|
}
|
|
749
848
|
interface ApiFolderOptions extends ApiFolderRouteDescriptionOptions {
|
|
750
849
|
allowedMethods?: string[];
|
|
850
|
+
/**
|
|
851
|
+
* Ancestor levels (0 = fully flat) to expose as cross-parent read
|
|
852
|
+
* addresses. Wire field `unscoped_levels`. Must be sent together with
|
|
853
|
+
* `unscopedAncestors` — the server rejects a level with no corresponding
|
|
854
|
+
* ancestor; not enforced client-side.
|
|
855
|
+
*/
|
|
856
|
+
unscopedLevels?: number[];
|
|
857
|
+
/**
|
|
858
|
+
* Ancestor UUIDs (not collection keys) to leave unscoped at the
|
|
859
|
+
* corresponding `unscopedLevels`. Wire field `unscoped_ancestors`.
|
|
860
|
+
*/
|
|
861
|
+
unscopedAncestors?: string[];
|
|
751
862
|
}
|
|
752
863
|
/**
|
|
753
864
|
* Client for the FoxNose Management API.
|
|
@@ -790,11 +901,48 @@ declare class ManagementClient {
|
|
|
790
901
|
getFluxApiKey(key: FluxAPIKeyRef): Promise<FluxAPIKeySummary>;
|
|
791
902
|
updateFluxApiKey(key: FluxAPIKeyRef, payload: Record<string, any>): Promise<FluxAPIKeySummary>;
|
|
792
903
|
deleteFluxApiKey(key: FluxAPIKeyRef): Promise<void>;
|
|
904
|
+
/**
|
|
905
|
+
* Issue a bearer token for a Flux API key, or replace the existing one.
|
|
906
|
+
*
|
|
907
|
+
* A bearer token exists for clients that accept a single token value and send
|
|
908
|
+
* it as `Authorization: Bearer <token>` with no way to choose the scheme —
|
|
909
|
+
* hosted MCP connectors, notably the Claude API's `mcp_servers`. Those clients
|
|
910
|
+
* cannot send `Simple` or `Secure` at all.
|
|
911
|
+
*
|
|
912
|
+
* THE PLAINTEXT IS RETURNED ONLY HERE, AND ONLY ONCE. The service stores a
|
|
913
|
+
* hash, exactly as it does for `secret_key`, so a lost token is re-issued
|
|
914
|
+
* rather than recovered. Subsequent key reads expose only
|
|
915
|
+
* `bearer_token_prefix`.
|
|
916
|
+
*
|
|
917
|
+
* The key itself is untouched: `public_key`, `secret_key`, `role` and grants
|
|
918
|
+
* all survive, so `Simple` and `Secure` integrations keep working across a
|
|
919
|
+
* re-issue. That is what makes this the way to cut off a connector without
|
|
920
|
+
* recreating a key and reconfiguring everything that uses it.
|
|
921
|
+
*
|
|
922
|
+
* There is at most one token per key; calling this again replaces it.
|
|
923
|
+
*/
|
|
924
|
+
issueFluxApiKeyBearerToken(key: FluxAPIKeyRef): Promise<FluxAPIKeyBearerToken>;
|
|
925
|
+
/**
|
|
926
|
+
* Revoke a Flux API key's bearer token. The key and its role keep working.
|
|
927
|
+
*
|
|
928
|
+
* Idempotent: succeeds whether or not a token was issued.
|
|
929
|
+
*/
|
|
930
|
+
revokeFluxApiKeyBearerToken(key: FluxAPIKeyRef): Promise<void>;
|
|
793
931
|
listApis(params?: Record<string, any>): Promise<APIList>;
|
|
794
932
|
createApi(payload: Record<string, any>): Promise<APIInfo>;
|
|
795
933
|
getApi(apiKey: APIRef): Promise<APIInfo>;
|
|
796
934
|
updateApi(apiKey: APIRef, payload: Record<string, any>): Promise<APIInfo>;
|
|
797
935
|
deleteApi(apiKey: APIRef): Promise<void>;
|
|
936
|
+
/**
|
|
937
|
+
* Build the request body shared by all four API-collection-association
|
|
938
|
+
* writers: {@link addApiCollection}, {@link updateApiCollection}, and
|
|
939
|
+
* their deprecated `*ApiFolder*` twins. All four accept {@link
|
|
940
|
+
* ApiFolderOptions}, so this is the one place that maps its camelCase
|
|
941
|
+
* fields to wire snake_case — adding a field here, rather than to each
|
|
942
|
+
* method separately, is what keeps the deprecated twins from silently
|
|
943
|
+
* swallowing a field the type says they accept.
|
|
944
|
+
*/
|
|
945
|
+
private buildApiFolderPayload;
|
|
798
946
|
listApiCollections(apiKey: APIRef, params?: Record<string, any>): Promise<APICollectionList>;
|
|
799
947
|
addApiCollection(apiKey: APIRef, collectionKey: CollectionRef, options?: ApiFolderOptions): Promise<APICollectionSummary>;
|
|
800
948
|
getApiCollection(apiKey: APIRef, collectionKey: CollectionRef): Promise<APICollectionSummary>;
|
|
@@ -1031,6 +1179,14 @@ interface VectorSearchOptions {
|
|
|
1031
1179
|
similarity_threshold?: number;
|
|
1032
1180
|
limit?: number;
|
|
1033
1181
|
offset?: number;
|
|
1182
|
+
/**
|
|
1183
|
+
* Query-string parameters for the underlying `search()` call (e.g.
|
|
1184
|
+
* `{ truncate_text: 200 }`). Named `queryParams`, not `params`: this
|
|
1185
|
+
* options object also carries an index signature that funnels unknown
|
|
1186
|
+
* keys into the JSON body, and an explicit `params` field would silently
|
|
1187
|
+
* reroute an existing `params` body extra to the query string.
|
|
1188
|
+
*/
|
|
1189
|
+
queryParams?: Record<string, any>;
|
|
1034
1190
|
[extra: string]: any;
|
|
1035
1191
|
}
|
|
1036
1192
|
interface VectorFieldSearchOptions {
|
|
@@ -1040,6 +1196,8 @@ interface VectorFieldSearchOptions {
|
|
|
1040
1196
|
similarity_threshold?: number;
|
|
1041
1197
|
limit?: number;
|
|
1042
1198
|
offset?: number;
|
|
1199
|
+
/** See {@link VectorSearchOptions.queryParams}. */
|
|
1200
|
+
queryParams?: Record<string, any>;
|
|
1043
1201
|
[extra: string]: any;
|
|
1044
1202
|
}
|
|
1045
1203
|
interface HybridSearchOptions {
|
|
@@ -1053,6 +1211,8 @@ interface HybridSearchOptions {
|
|
|
1053
1211
|
rerank_results?: boolean;
|
|
1054
1212
|
limit?: number;
|
|
1055
1213
|
offset?: number;
|
|
1214
|
+
/** See {@link VectorSearchOptions.queryParams}. */
|
|
1215
|
+
queryParams?: Record<string, any>;
|
|
1056
1216
|
[extra: string]: any;
|
|
1057
1217
|
}
|
|
1058
1218
|
interface BoostedSearchOptions {
|
|
@@ -1067,6 +1227,8 @@ interface BoostedSearchOptions {
|
|
|
1067
1227
|
max_boost_results?: number;
|
|
1068
1228
|
limit?: number;
|
|
1069
1229
|
offset?: number;
|
|
1230
|
+
/** See {@link VectorSearchOptions.queryParams}. */
|
|
1231
|
+
queryParams?: Record<string, any>;
|
|
1070
1232
|
[extra: string]: any;
|
|
1071
1233
|
}
|
|
1072
1234
|
/**
|
|
@@ -1081,7 +1243,9 @@ declare class FluxClient {
|
|
|
1081
1243
|
private buildPath;
|
|
1082
1244
|
listResources<T = any>(folderPath: string, params?: Record<string, any>): Promise<T>;
|
|
1083
1245
|
getResource<T = any>(folderPath: string, resourceKey: string, params?: Record<string, any>): Promise<T>;
|
|
1084
|
-
search<T = any>(folderPath: string, body: Record<string, any
|
|
1246
|
+
search<T = any>(folderPath: string, body: Record<string, any>, options?: {
|
|
1247
|
+
params?: Record<string, any>;
|
|
1248
|
+
}): Promise<T>;
|
|
1085
1249
|
/**
|
|
1086
1250
|
* Create a resource in a collection and publish it immediately.
|
|
1087
1251
|
*
|
|
@@ -1186,4 +1350,4 @@ interface SearchRequest {
|
|
|
1186
1350
|
*/
|
|
1187
1351
|
declare function buildSearchBody(req: SearchRequest): Record<string, any>;
|
|
1188
1352
|
|
|
1189
|
-
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, ContentValidationFailedError, type CurrentUsage, DEFAULT_RETRY_CONFIG, DEFAULT_USER_AGENT, type EnvironmentList, type EnvironmentRef, type EnvironmentSummary, ExternalIdConflictError, type FieldList, type FieldSummary, 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, HttpTransport, type HybridConfig, type HybridSearchOptions, JWTAuth, type LocaleList, type LocaleSummary, type ManagementAPIKeyList, type ManagementAPIKeyRef, type ManagementAPIKeySummary, ManagementClient, type ManagementClientOptions, type ManagementRoleList, type ManagementRoleRef, type ManagementRoleSummary, 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 RegionInfo, type RequestData, type ResourceList, type ResourceRef, type ResourceSummary, type RetryConfig, type RevisionList, type RevisionRef, type RevisionSummary, type RolePermission, type RolePermissionObject, SDK_VERSION, type SchemaVersionList, type SchemaVersionRef, type SchemaVersionSummary, SearchMode, type SearchRequest, SecureKeyAuth, SimpleKeyAuth, SpendCapExceededError, StaticTokenProvider, type StorageUsage, type SyncComponentResponse, type SyncComponentSkippedItem, type TokenProvider, type UnitsUsage, UpstreamError, type UsageBreakdown, type UsageMetric, type UserReference, SDK_VERSION as VERSION, type VectorBoostConfig, type VectorFieldSearch, type VectorFieldSearchOptions, type VectorSearch, type VectorSearchOptions, buildSearchBody, createConfig, nestedFieldMeta, resolveKey };
|
|
1353
|
+
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, ContentValidationFailedError, type CurrentUsage, DEFAULT_RETRY_CONFIG, DEFAULT_USER_AGENT, type EnvironmentList, type EnvironmentRef, type EnvironmentSummary, ExternalIdConflictError, type FieldList, type FieldSummary, 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, HttpTransport, type HybridConfig, type HybridSearchOptions, JWTAuth, type LocaleList, type LocaleSummary, type ManagementAPIKeyList, type ManagementAPIKeyRef, type ManagementAPIKeySummary, ManagementClient, type ManagementClientOptions, type ManagementRoleList, type ManagementRoleRef, type ManagementRoleSummary, 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 RegionInfo, type RequestData, type ResourceList, type ResourceRef, type ResourceSummary, type RetryConfig, type RevisionList, type RevisionRef, type RevisionSummary, type RolePermission, type RolePermissionObject, SDK_VERSION, type SchemaVersionList, type SchemaVersionRef, type SchemaVersionSummary, SearchMode, type SearchRequest, SecureKeyAuth, SimpleKeyAuth, SpendCapExceededError, StaticTokenProvider, type StorageUsage, type SyncComponentResponse, type SyncComponentSkippedItem, type TokenProvider, type UnitsUsage, UpstreamError, type UsageBreakdown, type UsageMetric, type UserReference, SDK_VERSION as VERSION, type VectorBoostConfig, type VectorFieldSearch, type VectorFieldSearchOptions, type VectorSearch, type VectorSearchOptions, buildSearchBody, createConfig, nestedFieldMeta, resolveKey };
|