@foxnose/sdk 0.5.1 → 0.6.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 +88 -0
- package/dist/index.cjs +124 -126
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +162 -4
- package/dist/index.d.ts +162 -4
- package/dist/index.js +124 -126
- 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.0";
|
|
97
|
+
declare const DEFAULT_USER_AGENT = "foxnose-sdk-js/0.6.0";
|
|
98
98
|
/**
|
|
99
99
|
* General transport-level configuration shared by all clients.
|
|
100
100
|
*/
|
|
@@ -544,8 +544,35 @@ interface FluxAPIKeySummary {
|
|
|
544
544
|
role?: string | null;
|
|
545
545
|
environment: string;
|
|
546
546
|
created_at: string;
|
|
547
|
+
/**
|
|
548
|
+
* First 12 characters of the key's bearer token (e.g. `fxk_A7fQ2mXe`), or
|
|
549
|
+
* null when none is issued. Enough to recognise a token in a config file or
|
|
550
|
+
* a log; never enough to use one — the token itself is returned only by
|
|
551
|
+
* {@link ManagementClient.issueFluxApiKeyBearerToken}, once.
|
|
552
|
+
*/
|
|
553
|
+
bearer_token_prefix?: string | null;
|
|
554
|
+
/** When the current bearer token was issued, or null. */
|
|
555
|
+
bearer_token_issued_at?: string | null;
|
|
547
556
|
}
|
|
548
557
|
type FluxAPIKeyList = PaginatedResponse<FluxAPIKeySummary>;
|
|
558
|
+
/**
|
|
559
|
+
* The one-time response from issuing or re-issuing a Flux key's bearer token.
|
|
560
|
+
*
|
|
561
|
+
* A bearer token is an opaque credential bound to a Flux API key, for hosted
|
|
562
|
+
* MCP connectors that can only send `Authorization: Bearer <token>` and cannot
|
|
563
|
+
* choose a scheme. It identifies the key and nothing more: role, grants and
|
|
564
|
+
* per-collection permissions are the key's own.
|
|
565
|
+
*/
|
|
566
|
+
interface FluxAPIKeyBearerToken {
|
|
567
|
+
/**
|
|
568
|
+
* The credential, e.g. `fxk_A7fQ2mXe...`. RETURNED ONLY HERE, ONLY ONCE —
|
|
569
|
+
* the service stores a hash, so a lost token is re-issued, not recovered.
|
|
570
|
+
*/
|
|
571
|
+
bearer_token: string;
|
|
572
|
+
/** First 12 characters, also present on every subsequent key read. */
|
|
573
|
+
bearer_token_prefix: string;
|
|
574
|
+
bearer_token_issued_at: string;
|
|
575
|
+
}
|
|
549
576
|
interface ManagementRoleSummary {
|
|
550
577
|
key: string;
|
|
551
578
|
name: string;
|
|
@@ -595,6 +622,49 @@ interface APIInfo {
|
|
|
595
622
|
path?: string | null;
|
|
596
623
|
}
|
|
597
624
|
type APIList = PaginatedResponse<APIInfo>;
|
|
625
|
+
/**
|
|
626
|
+
* One entry in `flat_routes[]` on a collection's connection to an API — a
|
|
627
|
+
* read-only address for a strict-reference collection that omits some
|
|
628
|
+
* number of ancestor keys from the path. `level 0` is fully flat and drops
|
|
629
|
+
* every ancestor key; `level >= 1` keeps the root-most `retained_ancestors`.
|
|
630
|
+
*
|
|
631
|
+
* `omitted_ancestors` and `retained_ancestors` are ancestor UUIDs, not the
|
|
632
|
+
* short collection keys used elsewhere (e.g. `folder`) — do not treat them
|
|
633
|
+
* as interchangeable.
|
|
634
|
+
*
|
|
635
|
+
* `read_methods` is typed as sent by the server, which currently mirrors
|
|
636
|
+
* the connection's `allowed_methods` verbatim rather than filtering by what
|
|
637
|
+
* is actually available at this level (docs and server disagree on both
|
|
638
|
+
* Get Resource at level 0 and Search at any level). Do not "correct" it.
|
|
639
|
+
*/
|
|
640
|
+
interface FlatRoute {
|
|
641
|
+
level: number;
|
|
642
|
+
path: string;
|
|
643
|
+
omitted_ancestors: string[];
|
|
644
|
+
retained_ancestors: string[];
|
|
645
|
+
enabled: boolean;
|
|
646
|
+
read_methods: string[];
|
|
647
|
+
available: boolean;
|
|
648
|
+
unavailable_reason: string | null;
|
|
649
|
+
published_generation: number;
|
|
650
|
+
router_generation: number;
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* The singular `flat_route` on a connection. Undocumented: it appears to
|
|
654
|
+
* mirror whichever entry of `flat_routes` is enabled, but unlike a
|
|
655
|
+
* {@link FlatRoute} it carries no `level` or `retained_ancestors`. Type it
|
|
656
|
+
* for forward compatibility; build no behavior on it.
|
|
657
|
+
*/
|
|
658
|
+
interface FlatRouteSummary {
|
|
659
|
+
path: string;
|
|
660
|
+
omitted_ancestors: string[];
|
|
661
|
+
enabled: boolean;
|
|
662
|
+
read_methods: string[];
|
|
663
|
+
available: boolean;
|
|
664
|
+
unavailable_reason: string | null;
|
|
665
|
+
published_generation: number;
|
|
666
|
+
router_generation: number;
|
|
667
|
+
}
|
|
598
668
|
interface APIFolderSummary {
|
|
599
669
|
folder: string;
|
|
600
670
|
api?: string | null;
|
|
@@ -605,6 +675,29 @@ interface APIFolderSummary {
|
|
|
605
675
|
description_search?: string | null;
|
|
606
676
|
description_schema?: string | null;
|
|
607
677
|
created_at?: string | null;
|
|
678
|
+
/**
|
|
679
|
+
* Ancestor levels (0 = fully flat) exposed as cross-parent read addresses
|
|
680
|
+
* for this connection. Sent together with `unscoped_ancestors` — a level
|
|
681
|
+
* with no corresponding ancestor is rejected by the server. Present on
|
|
682
|
+
* every connection observed (`[]` when unused), not nullable.
|
|
683
|
+
*/
|
|
684
|
+
unscoped_levels: number[];
|
|
685
|
+
/**
|
|
686
|
+
* Ancestor UUIDs (not collection keys) left unscoped at the corresponding
|
|
687
|
+
* `unscoped_levels`. Present on every connection observed (`[]` when
|
|
688
|
+
* unused), not nullable.
|
|
689
|
+
*/
|
|
690
|
+
unscoped_ancestors: string[];
|
|
691
|
+
/**
|
|
692
|
+
* Present in the response but documented nowhere; semantics unconfirmed.
|
|
693
|
+
* Typed so it is no longer silently dropped. Do not build request-side
|
|
694
|
+
* behavior on it.
|
|
695
|
+
*/
|
|
696
|
+
expose_owner: boolean;
|
|
697
|
+
/** Undocumented; see {@link FlatRouteSummary}. Observed `null`, not just absent. */
|
|
698
|
+
flat_route?: FlatRouteSummary | null;
|
|
699
|
+
/** Observed `null` (not `[]`) on a connection with no key-bearing ancestor. */
|
|
700
|
+
flat_routes?: FlatRoute[] | null;
|
|
608
701
|
}
|
|
609
702
|
type APIFolderList = PaginatedResponse<APIFolderSummary>;
|
|
610
703
|
/** @public Alias of {@link APIFolderSummary}. */
|
|
@@ -748,6 +841,18 @@ interface ApiFolderRouteDescriptionOptions {
|
|
|
748
841
|
}
|
|
749
842
|
interface ApiFolderOptions extends ApiFolderRouteDescriptionOptions {
|
|
750
843
|
allowedMethods?: string[];
|
|
844
|
+
/**
|
|
845
|
+
* Ancestor levels (0 = fully flat) to expose as cross-parent read
|
|
846
|
+
* addresses. Wire field `unscoped_levels`. Must be sent together with
|
|
847
|
+
* `unscopedAncestors` — the server rejects a level with no corresponding
|
|
848
|
+
* ancestor; not enforced client-side.
|
|
849
|
+
*/
|
|
850
|
+
unscopedLevels?: number[];
|
|
851
|
+
/**
|
|
852
|
+
* Ancestor UUIDs (not collection keys) to leave unscoped at the
|
|
853
|
+
* corresponding `unscopedLevels`. Wire field `unscoped_ancestors`.
|
|
854
|
+
*/
|
|
855
|
+
unscopedAncestors?: string[];
|
|
751
856
|
}
|
|
752
857
|
/**
|
|
753
858
|
* Client for the FoxNose Management API.
|
|
@@ -790,11 +895,48 @@ declare class ManagementClient {
|
|
|
790
895
|
getFluxApiKey(key: FluxAPIKeyRef): Promise<FluxAPIKeySummary>;
|
|
791
896
|
updateFluxApiKey(key: FluxAPIKeyRef, payload: Record<string, any>): Promise<FluxAPIKeySummary>;
|
|
792
897
|
deleteFluxApiKey(key: FluxAPIKeyRef): Promise<void>;
|
|
898
|
+
/**
|
|
899
|
+
* Issue a bearer token for a Flux API key, or replace the existing one.
|
|
900
|
+
*
|
|
901
|
+
* A bearer token exists for clients that accept a single token value and send
|
|
902
|
+
* it as `Authorization: Bearer <token>` with no way to choose the scheme —
|
|
903
|
+
* hosted MCP connectors, notably the Claude API's `mcp_servers`. Those clients
|
|
904
|
+
* cannot send `Simple` or `Secure` at all.
|
|
905
|
+
*
|
|
906
|
+
* THE PLAINTEXT IS RETURNED ONLY HERE, AND ONLY ONCE. The service stores a
|
|
907
|
+
* hash, exactly as it does for `secret_key`, so a lost token is re-issued
|
|
908
|
+
* rather than recovered. Subsequent key reads expose only
|
|
909
|
+
* `bearer_token_prefix`.
|
|
910
|
+
*
|
|
911
|
+
* The key itself is untouched: `public_key`, `secret_key`, `role` and grants
|
|
912
|
+
* all survive, so `Simple` and `Secure` integrations keep working across a
|
|
913
|
+
* re-issue. That is what makes this the way to cut off a connector without
|
|
914
|
+
* recreating a key and reconfiguring everything that uses it.
|
|
915
|
+
*
|
|
916
|
+
* There is at most one token per key; calling this again replaces it.
|
|
917
|
+
*/
|
|
918
|
+
issueFluxApiKeyBearerToken(key: FluxAPIKeyRef): Promise<FluxAPIKeyBearerToken>;
|
|
919
|
+
/**
|
|
920
|
+
* Revoke a Flux API key's bearer token. The key and its role keep working.
|
|
921
|
+
*
|
|
922
|
+
* Idempotent: succeeds whether or not a token was issued.
|
|
923
|
+
*/
|
|
924
|
+
revokeFluxApiKeyBearerToken(key: FluxAPIKeyRef): Promise<void>;
|
|
793
925
|
listApis(params?: Record<string, any>): Promise<APIList>;
|
|
794
926
|
createApi(payload: Record<string, any>): Promise<APIInfo>;
|
|
795
927
|
getApi(apiKey: APIRef): Promise<APIInfo>;
|
|
796
928
|
updateApi(apiKey: APIRef, payload: Record<string, any>): Promise<APIInfo>;
|
|
797
929
|
deleteApi(apiKey: APIRef): Promise<void>;
|
|
930
|
+
/**
|
|
931
|
+
* Build the request body shared by all four API-collection-association
|
|
932
|
+
* writers: {@link addApiCollection}, {@link updateApiCollection}, and
|
|
933
|
+
* their deprecated `*ApiFolder*` twins. All four accept {@link
|
|
934
|
+
* ApiFolderOptions}, so this is the one place that maps its camelCase
|
|
935
|
+
* fields to wire snake_case — adding a field here, rather than to each
|
|
936
|
+
* method separately, is what keeps the deprecated twins from silently
|
|
937
|
+
* swallowing a field the type says they accept.
|
|
938
|
+
*/
|
|
939
|
+
private buildApiFolderPayload;
|
|
798
940
|
listApiCollections(apiKey: APIRef, params?: Record<string, any>): Promise<APICollectionList>;
|
|
799
941
|
addApiCollection(apiKey: APIRef, collectionKey: CollectionRef, options?: ApiFolderOptions): Promise<APICollectionSummary>;
|
|
800
942
|
getApiCollection(apiKey: APIRef, collectionKey: CollectionRef): Promise<APICollectionSummary>;
|
|
@@ -1031,6 +1173,14 @@ interface VectorSearchOptions {
|
|
|
1031
1173
|
similarity_threshold?: number;
|
|
1032
1174
|
limit?: number;
|
|
1033
1175
|
offset?: number;
|
|
1176
|
+
/**
|
|
1177
|
+
* Query-string parameters for the underlying `search()` call (e.g.
|
|
1178
|
+
* `{ truncate_text: 200 }`). Named `queryParams`, not `params`: this
|
|
1179
|
+
* options object also carries an index signature that funnels unknown
|
|
1180
|
+
* keys into the JSON body, and an explicit `params` field would silently
|
|
1181
|
+
* reroute an existing `params` body extra to the query string.
|
|
1182
|
+
*/
|
|
1183
|
+
queryParams?: Record<string, any>;
|
|
1034
1184
|
[extra: string]: any;
|
|
1035
1185
|
}
|
|
1036
1186
|
interface VectorFieldSearchOptions {
|
|
@@ -1040,6 +1190,8 @@ interface VectorFieldSearchOptions {
|
|
|
1040
1190
|
similarity_threshold?: number;
|
|
1041
1191
|
limit?: number;
|
|
1042
1192
|
offset?: number;
|
|
1193
|
+
/** See {@link VectorSearchOptions.queryParams}. */
|
|
1194
|
+
queryParams?: Record<string, any>;
|
|
1043
1195
|
[extra: string]: any;
|
|
1044
1196
|
}
|
|
1045
1197
|
interface HybridSearchOptions {
|
|
@@ -1053,6 +1205,8 @@ interface HybridSearchOptions {
|
|
|
1053
1205
|
rerank_results?: boolean;
|
|
1054
1206
|
limit?: number;
|
|
1055
1207
|
offset?: number;
|
|
1208
|
+
/** See {@link VectorSearchOptions.queryParams}. */
|
|
1209
|
+
queryParams?: Record<string, any>;
|
|
1056
1210
|
[extra: string]: any;
|
|
1057
1211
|
}
|
|
1058
1212
|
interface BoostedSearchOptions {
|
|
@@ -1067,6 +1221,8 @@ interface BoostedSearchOptions {
|
|
|
1067
1221
|
max_boost_results?: number;
|
|
1068
1222
|
limit?: number;
|
|
1069
1223
|
offset?: number;
|
|
1224
|
+
/** See {@link VectorSearchOptions.queryParams}. */
|
|
1225
|
+
queryParams?: Record<string, any>;
|
|
1070
1226
|
[extra: string]: any;
|
|
1071
1227
|
}
|
|
1072
1228
|
/**
|
|
@@ -1081,7 +1237,9 @@ declare class FluxClient {
|
|
|
1081
1237
|
private buildPath;
|
|
1082
1238
|
listResources<T = any>(folderPath: string, params?: Record<string, any>): Promise<T>;
|
|
1083
1239
|
getResource<T = any>(folderPath: string, resourceKey: string, params?: Record<string, any>): Promise<T>;
|
|
1084
|
-
search<T = any>(folderPath: string, body: Record<string, any
|
|
1240
|
+
search<T = any>(folderPath: string, body: Record<string, any>, options?: {
|
|
1241
|
+
params?: Record<string, any>;
|
|
1242
|
+
}): Promise<T>;
|
|
1085
1243
|
/**
|
|
1086
1244
|
* Create a resource in a collection and publish it immediately.
|
|
1087
1245
|
*
|
|
@@ -1186,4 +1344,4 @@ interface SearchRequest {
|
|
|
1186
1344
|
*/
|
|
1187
1345
|
declare function buildSearchBody(req: SearchRequest): Record<string, any>;
|
|
1188
1346
|
|
|
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 };
|
|
1347
|
+
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.0";
|
|
97
|
+
declare const DEFAULT_USER_AGENT = "foxnose-sdk-js/0.6.0";
|
|
98
98
|
/**
|
|
99
99
|
* General transport-level configuration shared by all clients.
|
|
100
100
|
*/
|
|
@@ -544,8 +544,35 @@ interface FluxAPIKeySummary {
|
|
|
544
544
|
role?: string | null;
|
|
545
545
|
environment: string;
|
|
546
546
|
created_at: string;
|
|
547
|
+
/**
|
|
548
|
+
* First 12 characters of the key's bearer token (e.g. `fxk_A7fQ2mXe`), or
|
|
549
|
+
* null when none is issued. Enough to recognise a token in a config file or
|
|
550
|
+
* a log; never enough to use one — the token itself is returned only by
|
|
551
|
+
* {@link ManagementClient.issueFluxApiKeyBearerToken}, once.
|
|
552
|
+
*/
|
|
553
|
+
bearer_token_prefix?: string | null;
|
|
554
|
+
/** When the current bearer token was issued, or null. */
|
|
555
|
+
bearer_token_issued_at?: string | null;
|
|
547
556
|
}
|
|
548
557
|
type FluxAPIKeyList = PaginatedResponse<FluxAPIKeySummary>;
|
|
558
|
+
/**
|
|
559
|
+
* The one-time response from issuing or re-issuing a Flux key's bearer token.
|
|
560
|
+
*
|
|
561
|
+
* A bearer token is an opaque credential bound to a Flux API key, for hosted
|
|
562
|
+
* MCP connectors that can only send `Authorization: Bearer <token>` and cannot
|
|
563
|
+
* choose a scheme. It identifies the key and nothing more: role, grants and
|
|
564
|
+
* per-collection permissions are the key's own.
|
|
565
|
+
*/
|
|
566
|
+
interface FluxAPIKeyBearerToken {
|
|
567
|
+
/**
|
|
568
|
+
* The credential, e.g. `fxk_A7fQ2mXe...`. RETURNED ONLY HERE, ONLY ONCE —
|
|
569
|
+
* the service stores a hash, so a lost token is re-issued, not recovered.
|
|
570
|
+
*/
|
|
571
|
+
bearer_token: string;
|
|
572
|
+
/** First 12 characters, also present on every subsequent key read. */
|
|
573
|
+
bearer_token_prefix: string;
|
|
574
|
+
bearer_token_issued_at: string;
|
|
575
|
+
}
|
|
549
576
|
interface ManagementRoleSummary {
|
|
550
577
|
key: string;
|
|
551
578
|
name: string;
|
|
@@ -595,6 +622,49 @@ interface APIInfo {
|
|
|
595
622
|
path?: string | null;
|
|
596
623
|
}
|
|
597
624
|
type APIList = PaginatedResponse<APIInfo>;
|
|
625
|
+
/**
|
|
626
|
+
* One entry in `flat_routes[]` on a collection's connection to an API — a
|
|
627
|
+
* read-only address for a strict-reference collection that omits some
|
|
628
|
+
* number of ancestor keys from the path. `level 0` is fully flat and drops
|
|
629
|
+
* every ancestor key; `level >= 1` keeps the root-most `retained_ancestors`.
|
|
630
|
+
*
|
|
631
|
+
* `omitted_ancestors` and `retained_ancestors` are ancestor UUIDs, not the
|
|
632
|
+
* short collection keys used elsewhere (e.g. `folder`) — do not treat them
|
|
633
|
+
* as interchangeable.
|
|
634
|
+
*
|
|
635
|
+
* `read_methods` is typed as sent by the server, which currently mirrors
|
|
636
|
+
* the connection's `allowed_methods` verbatim rather than filtering by what
|
|
637
|
+
* is actually available at this level (docs and server disagree on both
|
|
638
|
+
* Get Resource at level 0 and Search at any level). Do not "correct" it.
|
|
639
|
+
*/
|
|
640
|
+
interface FlatRoute {
|
|
641
|
+
level: number;
|
|
642
|
+
path: string;
|
|
643
|
+
omitted_ancestors: string[];
|
|
644
|
+
retained_ancestors: string[];
|
|
645
|
+
enabled: boolean;
|
|
646
|
+
read_methods: string[];
|
|
647
|
+
available: boolean;
|
|
648
|
+
unavailable_reason: string | null;
|
|
649
|
+
published_generation: number;
|
|
650
|
+
router_generation: number;
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* The singular `flat_route` on a connection. Undocumented: it appears to
|
|
654
|
+
* mirror whichever entry of `flat_routes` is enabled, but unlike a
|
|
655
|
+
* {@link FlatRoute} it carries no `level` or `retained_ancestors`. Type it
|
|
656
|
+
* for forward compatibility; build no behavior on it.
|
|
657
|
+
*/
|
|
658
|
+
interface FlatRouteSummary {
|
|
659
|
+
path: string;
|
|
660
|
+
omitted_ancestors: string[];
|
|
661
|
+
enabled: boolean;
|
|
662
|
+
read_methods: string[];
|
|
663
|
+
available: boolean;
|
|
664
|
+
unavailable_reason: string | null;
|
|
665
|
+
published_generation: number;
|
|
666
|
+
router_generation: number;
|
|
667
|
+
}
|
|
598
668
|
interface APIFolderSummary {
|
|
599
669
|
folder: string;
|
|
600
670
|
api?: string | null;
|
|
@@ -605,6 +675,29 @@ interface APIFolderSummary {
|
|
|
605
675
|
description_search?: string | null;
|
|
606
676
|
description_schema?: string | null;
|
|
607
677
|
created_at?: string | null;
|
|
678
|
+
/**
|
|
679
|
+
* Ancestor levels (0 = fully flat) exposed as cross-parent read addresses
|
|
680
|
+
* for this connection. Sent together with `unscoped_ancestors` — a level
|
|
681
|
+
* with no corresponding ancestor is rejected by the server. Present on
|
|
682
|
+
* every connection observed (`[]` when unused), not nullable.
|
|
683
|
+
*/
|
|
684
|
+
unscoped_levels: number[];
|
|
685
|
+
/**
|
|
686
|
+
* Ancestor UUIDs (not collection keys) left unscoped at the corresponding
|
|
687
|
+
* `unscoped_levels`. Present on every connection observed (`[]` when
|
|
688
|
+
* unused), not nullable.
|
|
689
|
+
*/
|
|
690
|
+
unscoped_ancestors: string[];
|
|
691
|
+
/**
|
|
692
|
+
* Present in the response but documented nowhere; semantics unconfirmed.
|
|
693
|
+
* Typed so it is no longer silently dropped. Do not build request-side
|
|
694
|
+
* behavior on it.
|
|
695
|
+
*/
|
|
696
|
+
expose_owner: boolean;
|
|
697
|
+
/** Undocumented; see {@link FlatRouteSummary}. Observed `null`, not just absent. */
|
|
698
|
+
flat_route?: FlatRouteSummary | null;
|
|
699
|
+
/** Observed `null` (not `[]`) on a connection with no key-bearing ancestor. */
|
|
700
|
+
flat_routes?: FlatRoute[] | null;
|
|
608
701
|
}
|
|
609
702
|
type APIFolderList = PaginatedResponse<APIFolderSummary>;
|
|
610
703
|
/** @public Alias of {@link APIFolderSummary}. */
|
|
@@ -748,6 +841,18 @@ interface ApiFolderRouteDescriptionOptions {
|
|
|
748
841
|
}
|
|
749
842
|
interface ApiFolderOptions extends ApiFolderRouteDescriptionOptions {
|
|
750
843
|
allowedMethods?: string[];
|
|
844
|
+
/**
|
|
845
|
+
* Ancestor levels (0 = fully flat) to expose as cross-parent read
|
|
846
|
+
* addresses. Wire field `unscoped_levels`. Must be sent together with
|
|
847
|
+
* `unscopedAncestors` — the server rejects a level with no corresponding
|
|
848
|
+
* ancestor; not enforced client-side.
|
|
849
|
+
*/
|
|
850
|
+
unscopedLevels?: number[];
|
|
851
|
+
/**
|
|
852
|
+
* Ancestor UUIDs (not collection keys) to leave unscoped at the
|
|
853
|
+
* corresponding `unscopedLevels`. Wire field `unscoped_ancestors`.
|
|
854
|
+
*/
|
|
855
|
+
unscopedAncestors?: string[];
|
|
751
856
|
}
|
|
752
857
|
/**
|
|
753
858
|
* Client for the FoxNose Management API.
|
|
@@ -790,11 +895,48 @@ declare class ManagementClient {
|
|
|
790
895
|
getFluxApiKey(key: FluxAPIKeyRef): Promise<FluxAPIKeySummary>;
|
|
791
896
|
updateFluxApiKey(key: FluxAPIKeyRef, payload: Record<string, any>): Promise<FluxAPIKeySummary>;
|
|
792
897
|
deleteFluxApiKey(key: FluxAPIKeyRef): Promise<void>;
|
|
898
|
+
/**
|
|
899
|
+
* Issue a bearer token for a Flux API key, or replace the existing one.
|
|
900
|
+
*
|
|
901
|
+
* A bearer token exists for clients that accept a single token value and send
|
|
902
|
+
* it as `Authorization: Bearer <token>` with no way to choose the scheme —
|
|
903
|
+
* hosted MCP connectors, notably the Claude API's `mcp_servers`. Those clients
|
|
904
|
+
* cannot send `Simple` or `Secure` at all.
|
|
905
|
+
*
|
|
906
|
+
* THE PLAINTEXT IS RETURNED ONLY HERE, AND ONLY ONCE. The service stores a
|
|
907
|
+
* hash, exactly as it does for `secret_key`, so a lost token is re-issued
|
|
908
|
+
* rather than recovered. Subsequent key reads expose only
|
|
909
|
+
* `bearer_token_prefix`.
|
|
910
|
+
*
|
|
911
|
+
* The key itself is untouched: `public_key`, `secret_key`, `role` and grants
|
|
912
|
+
* all survive, so `Simple` and `Secure` integrations keep working across a
|
|
913
|
+
* re-issue. That is what makes this the way to cut off a connector without
|
|
914
|
+
* recreating a key and reconfiguring everything that uses it.
|
|
915
|
+
*
|
|
916
|
+
* There is at most one token per key; calling this again replaces it.
|
|
917
|
+
*/
|
|
918
|
+
issueFluxApiKeyBearerToken(key: FluxAPIKeyRef): Promise<FluxAPIKeyBearerToken>;
|
|
919
|
+
/**
|
|
920
|
+
* Revoke a Flux API key's bearer token. The key and its role keep working.
|
|
921
|
+
*
|
|
922
|
+
* Idempotent: succeeds whether or not a token was issued.
|
|
923
|
+
*/
|
|
924
|
+
revokeFluxApiKeyBearerToken(key: FluxAPIKeyRef): Promise<void>;
|
|
793
925
|
listApis(params?: Record<string, any>): Promise<APIList>;
|
|
794
926
|
createApi(payload: Record<string, any>): Promise<APIInfo>;
|
|
795
927
|
getApi(apiKey: APIRef): Promise<APIInfo>;
|
|
796
928
|
updateApi(apiKey: APIRef, payload: Record<string, any>): Promise<APIInfo>;
|
|
797
929
|
deleteApi(apiKey: APIRef): Promise<void>;
|
|
930
|
+
/**
|
|
931
|
+
* Build the request body shared by all four API-collection-association
|
|
932
|
+
* writers: {@link addApiCollection}, {@link updateApiCollection}, and
|
|
933
|
+
* their deprecated `*ApiFolder*` twins. All four accept {@link
|
|
934
|
+
* ApiFolderOptions}, so this is the one place that maps its camelCase
|
|
935
|
+
* fields to wire snake_case — adding a field here, rather than to each
|
|
936
|
+
* method separately, is what keeps the deprecated twins from silently
|
|
937
|
+
* swallowing a field the type says they accept.
|
|
938
|
+
*/
|
|
939
|
+
private buildApiFolderPayload;
|
|
798
940
|
listApiCollections(apiKey: APIRef, params?: Record<string, any>): Promise<APICollectionList>;
|
|
799
941
|
addApiCollection(apiKey: APIRef, collectionKey: CollectionRef, options?: ApiFolderOptions): Promise<APICollectionSummary>;
|
|
800
942
|
getApiCollection(apiKey: APIRef, collectionKey: CollectionRef): Promise<APICollectionSummary>;
|
|
@@ -1031,6 +1173,14 @@ interface VectorSearchOptions {
|
|
|
1031
1173
|
similarity_threshold?: number;
|
|
1032
1174
|
limit?: number;
|
|
1033
1175
|
offset?: number;
|
|
1176
|
+
/**
|
|
1177
|
+
* Query-string parameters for the underlying `search()` call (e.g.
|
|
1178
|
+
* `{ truncate_text: 200 }`). Named `queryParams`, not `params`: this
|
|
1179
|
+
* options object also carries an index signature that funnels unknown
|
|
1180
|
+
* keys into the JSON body, and an explicit `params` field would silently
|
|
1181
|
+
* reroute an existing `params` body extra to the query string.
|
|
1182
|
+
*/
|
|
1183
|
+
queryParams?: Record<string, any>;
|
|
1034
1184
|
[extra: string]: any;
|
|
1035
1185
|
}
|
|
1036
1186
|
interface VectorFieldSearchOptions {
|
|
@@ -1040,6 +1190,8 @@ interface VectorFieldSearchOptions {
|
|
|
1040
1190
|
similarity_threshold?: number;
|
|
1041
1191
|
limit?: number;
|
|
1042
1192
|
offset?: number;
|
|
1193
|
+
/** See {@link VectorSearchOptions.queryParams}. */
|
|
1194
|
+
queryParams?: Record<string, any>;
|
|
1043
1195
|
[extra: string]: any;
|
|
1044
1196
|
}
|
|
1045
1197
|
interface HybridSearchOptions {
|
|
@@ -1053,6 +1205,8 @@ interface HybridSearchOptions {
|
|
|
1053
1205
|
rerank_results?: boolean;
|
|
1054
1206
|
limit?: number;
|
|
1055
1207
|
offset?: number;
|
|
1208
|
+
/** See {@link VectorSearchOptions.queryParams}. */
|
|
1209
|
+
queryParams?: Record<string, any>;
|
|
1056
1210
|
[extra: string]: any;
|
|
1057
1211
|
}
|
|
1058
1212
|
interface BoostedSearchOptions {
|
|
@@ -1067,6 +1221,8 @@ interface BoostedSearchOptions {
|
|
|
1067
1221
|
max_boost_results?: number;
|
|
1068
1222
|
limit?: number;
|
|
1069
1223
|
offset?: number;
|
|
1224
|
+
/** See {@link VectorSearchOptions.queryParams}. */
|
|
1225
|
+
queryParams?: Record<string, any>;
|
|
1070
1226
|
[extra: string]: any;
|
|
1071
1227
|
}
|
|
1072
1228
|
/**
|
|
@@ -1081,7 +1237,9 @@ declare class FluxClient {
|
|
|
1081
1237
|
private buildPath;
|
|
1082
1238
|
listResources<T = any>(folderPath: string, params?: Record<string, any>): Promise<T>;
|
|
1083
1239
|
getResource<T = any>(folderPath: string, resourceKey: string, params?: Record<string, any>): Promise<T>;
|
|
1084
|
-
search<T = any>(folderPath: string, body: Record<string, any
|
|
1240
|
+
search<T = any>(folderPath: string, body: Record<string, any>, options?: {
|
|
1241
|
+
params?: Record<string, any>;
|
|
1242
|
+
}): Promise<T>;
|
|
1085
1243
|
/**
|
|
1086
1244
|
* Create a resource in a collection and publish it immediately.
|
|
1087
1245
|
*
|
|
@@ -1186,4 +1344,4 @@ interface SearchRequest {
|
|
|
1186
1344
|
*/
|
|
1187
1345
|
declare function buildSearchBody(req: SearchRequest): Record<string, any>;
|
|
1188
1346
|
|
|
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 };
|
|
1347
|
+
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 };
|