@xemahq/search-api-client 0.1.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/LICENSE +1 -0
- package/dist/custom-fetch.d.ts +52 -0
- package/dist/custom-fetch.js +152 -0
- package/dist/endpoints/admin/admin.d.ts +28 -0
- package/dist/endpoints/admin/admin.js +98 -0
- package/dist/endpoints/health/health.d.ts +20 -0
- package/dist/endpoints/health/health.js +67 -0
- package/dist/endpoints/mcp/mcp.d.ts +6 -0
- package/dist/endpoints/mcp/mcp.js +44 -0
- package/dist/endpoints/search/search.d.ts +18 -0
- package/dist/endpoints/search/search.js +70 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +28 -0
- package/dist/models/adminControllerGetTraceStatsParams.d.ts +13 -0
- package/dist/models/adminControllerGetTraceStatsParams.js +9 -0
- package/dist/models/adminControllerGetTracesParams.d.ts +21 -0
- package/dist/models/adminControllerGetTracesParams.js +9 -0
- package/dist/models/errorDetailsDto.d.ts +12 -0
- package/dist/models/errorDetailsDto.js +2 -0
- package/dist/models/errorDetailsDtoDetails.d.ts +13 -0
- package/dist/models/errorDetailsDtoDetails.js +9 -0
- package/dist/models/errorPayloadDto.d.ts +13 -0
- package/dist/models/errorPayloadDto.js +2 -0
- package/dist/models/errorResponseDto.d.ts +11 -0
- package/dist/models/errorResponseDto.js +2 -0
- package/dist/models/facetBucket.d.ts +13 -0
- package/dist/models/facetBucket.js +2 -0
- package/dist/models/facetBucketSubFacets.d.ts +10 -0
- package/dist/models/facetBucketSubFacets.js +9 -0
- package/dist/models/facetResponse.d.ts +14 -0
- package/dist/models/facetResponse.js +2 -0
- package/dist/models/facetResponseDataEnvelope.d.ts +11 -0
- package/dist/models/facetResponseDataEnvelope.js +2 -0
- package/dist/models/index.d.ts +36 -0
- package/dist/models/index.js +53 -0
- package/dist/models/modeStatsDto.d.ts +16 -0
- package/dist/models/modeStatsDto.js +2 -0
- package/dist/models/modeStatsDtoMode.d.ts +16 -0
- package/dist/models/modeStatsDtoMode.js +15 -0
- package/dist/models/reindexJobResponseDto.d.ts +28 -0
- package/dist/models/reindexJobResponseDto.js +2 -0
- package/dist/models/reindexJobResponseDtoCompletedAt.d.ts +13 -0
- package/dist/models/reindexJobResponseDtoCompletedAt.js +9 -0
- package/dist/models/reindexJobResponseDtoDataEnvelope.d.ts +11 -0
- package/dist/models/reindexJobResponseDtoDataEnvelope.js +2 -0
- package/dist/models/reindexJobResponseDtoError.d.ts +13 -0
- package/dist/models/reindexJobResponseDtoError.js +9 -0
- package/dist/models/reindexJobResponseDtoStatus.d.ts +17 -0
- package/dist/models/reindexJobResponseDtoStatus.js +16 -0
- package/dist/models/reindexTriggerResponseDto.d.ts +15 -0
- package/dist/models/reindexTriggerResponseDto.js +9 -0
- package/dist/models/reindexTriggerResponseDtoDataEnvelope.d.ts +11 -0
- package/dist/models/reindexTriggerResponseDtoDataEnvelope.js +2 -0
- package/dist/models/searchControllerFacetsParams.d.ts +17 -0
- package/dist/models/searchControllerFacetsParams.js +9 -0
- package/dist/models/searchControllerSearchParams.d.ts +50 -0
- package/dist/models/searchControllerSearchParams.js +2 -0
- package/dist/models/searchControllerSearchSearchMode.d.ts +13 -0
- package/dist/models/searchControllerSearchSearchMode.js +15 -0
- package/dist/models/searchHitDto.d.ts +29 -0
- package/dist/models/searchHitDto.js +2 -0
- package/dist/models/searchHitDtoDocType.d.ts +17 -0
- package/dist/models/searchHitDtoDocType.js +16 -0
- package/dist/models/searchHitDtoHighlights.d.ts +13 -0
- package/dist/models/searchHitDtoHighlights.js +9 -0
- package/dist/models/searchResultDto.d.ts +14 -0
- package/dist/models/searchResultDto.js +2 -0
- package/dist/models/searchResultDtoDataEnvelope.d.ts +11 -0
- package/dist/models/searchResultDtoDataEnvelope.js +2 -0
- package/dist/models/searchStatsResponseDto.d.ts +22 -0
- package/dist/models/searchStatsResponseDto.js +2 -0
- package/dist/models/searchStatsResponseDtoDataEnvelope.d.ts +11 -0
- package/dist/models/searchStatsResponseDtoDataEnvelope.js +2 -0
- package/dist/models/searchTraceResponseDto.d.ts +37 -0
- package/dist/models/searchTraceResponseDto.js +2 -0
- package/dist/models/searchTraceResponseDtoCallerService.d.ts +13 -0
- package/dist/models/searchTraceResponseDtoCallerService.js +9 -0
- package/dist/models/searchTraceResponseDtoEmbeddingMs.d.ts +13 -0
- package/dist/models/searchTraceResponseDtoEmbeddingMs.js +9 -0
- package/dist/models/searchTraceResponseDtoSearchMode.d.ts +16 -0
- package/dist/models/searchTraceResponseDtoSearchMode.js +15 -0
- package/dist/models/searchTraceResponseDtoTopScore.d.ts +13 -0
- package/dist/models/searchTraceResponseDtoTopScore.js +9 -0
- package/dist/models/tracesListResponseDto.d.ts +14 -0
- package/dist/models/tracesListResponseDto.js +2 -0
- package/dist/models/tracesListResponseDtoDataEnvelope.d.ts +11 -0
- package/dist/models/tracesListResponseDtoDataEnvelope.js +2 -0
- package/package.json +18 -0
package/LICENSE
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Copyright (c) 2026 Xema. All rights reserved.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configurable fetch wrapper for Orval-generated clients.
|
|
3
|
+
*
|
|
4
|
+
* Consumers must call `configureClient()` before using any endpoint function.
|
|
5
|
+
* The baseUrl is prepended to the relative paths generated by Orval.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Automatic bearer-token injection via `getAuthToken` callback
|
|
9
|
+
* - Per-request header injection via `getHeaders` callback
|
|
10
|
+
* - Automatic 401 handling via `onUnauthorized` callback (single retry)
|
|
11
|
+
* - Exponential-backoff retry for transient failures (429, 502, 503, 504)
|
|
12
|
+
* - Typed `ClientError` for non-2xx responses
|
|
13
|
+
* - Per-call header overrides (take precedence over global headers)
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* configureClient({
|
|
17
|
+
* baseUrl: 'http://governance-api:3400',
|
|
18
|
+
* getAuthToken: () => identityBootstrapService.getAccessToken(),
|
|
19
|
+
* getHeaders: () => ({ 'X-Org-Id': orgId, 'X-Correlation-Id': crypto.randomUUID() }),
|
|
20
|
+
* });
|
|
21
|
+
*/
|
|
22
|
+
export interface ClientConfig {
|
|
23
|
+
/**
|
|
24
|
+
* Static base URL (e.g. 'http://localhost:3140') — no trailing slash.
|
|
25
|
+
* Mutually exclusive with `baseUrlResolver`; exactly one MUST be set.
|
|
26
|
+
*/
|
|
27
|
+
baseUrl?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Per-request base-URL resolver. When set, the peer URL is resolved from
|
|
30
|
+
* the service registry on EVERY request (boot-order-safe). Wired by
|
|
31
|
+
* `configureOrvalClientResolved` from `@xemahq/platform-common`.
|
|
32
|
+
*/
|
|
33
|
+
baseUrlResolver?: () => string | Promise<string>;
|
|
34
|
+
/** Optional async callback to get an auth token. Auto-sets Authorization header on every request. */
|
|
35
|
+
getAuthToken?: () => Promise<string>;
|
|
36
|
+
/** Optional callback returning headers to inject on every request. Per-call headers take precedence. */
|
|
37
|
+
getHeaders?: () => Record<string, string> | Promise<Record<string, string>>;
|
|
38
|
+
/** Optional callback invoked on 401 before a single retry (e.g. force-refresh auth token). */
|
|
39
|
+
onUnauthorized?: () => Promise<void>;
|
|
40
|
+
/** Maximum retry attempts for transient failures (default: 3). Set to 0 to disable retries. */
|
|
41
|
+
maxRetries?: number;
|
|
42
|
+
}
|
|
43
|
+
export declare class ClientError extends Error {
|
|
44
|
+
readonly status: number;
|
|
45
|
+
readonly url: string;
|
|
46
|
+
readonly body: unknown;
|
|
47
|
+
constructor(status: number, url: string, body: unknown);
|
|
48
|
+
}
|
|
49
|
+
export declare function configureClient(config: ClientConfig): void;
|
|
50
|
+
export declare function getClientConfig(): ClientConfig;
|
|
51
|
+
export declare const customFetch: <T>(url: string, options: RequestInit) => Promise<T>;
|
|
52
|
+
export default customFetch;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Configurable fetch wrapper for Orval-generated clients.
|
|
4
|
+
*
|
|
5
|
+
* Consumers must call `configureClient()` before using any endpoint function.
|
|
6
|
+
* The baseUrl is prepended to the relative paths generated by Orval.
|
|
7
|
+
*
|
|
8
|
+
* Features:
|
|
9
|
+
* - Automatic bearer-token injection via `getAuthToken` callback
|
|
10
|
+
* - Per-request header injection via `getHeaders` callback
|
|
11
|
+
* - Automatic 401 handling via `onUnauthorized` callback (single retry)
|
|
12
|
+
* - Exponential-backoff retry for transient failures (429, 502, 503, 504)
|
|
13
|
+
* - Typed `ClientError` for non-2xx responses
|
|
14
|
+
* - Per-call header overrides (take precedence over global headers)
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* configureClient({
|
|
18
|
+
* baseUrl: 'http://governance-api:3400',
|
|
19
|
+
* getAuthToken: () => identityBootstrapService.getAccessToken(),
|
|
20
|
+
* getHeaders: () => ({ 'X-Org-Id': orgId, 'X-Correlation-Id': crypto.randomUUID() }),
|
|
21
|
+
* });
|
|
22
|
+
*/
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.customFetch = exports.ClientError = void 0;
|
|
25
|
+
exports.configureClient = configureClient;
|
|
26
|
+
exports.getClientConfig = getClientConfig;
|
|
27
|
+
class ClientError extends Error {
|
|
28
|
+
status;
|
|
29
|
+
url;
|
|
30
|
+
body;
|
|
31
|
+
constructor(status, url, body) {
|
|
32
|
+
super(`HTTP ${status} from ${url}`);
|
|
33
|
+
this.status = status;
|
|
34
|
+
this.url = url;
|
|
35
|
+
this.body = body;
|
|
36
|
+
this.name = 'ClientError';
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.ClientError = ClientError;
|
|
40
|
+
let clientConfig = null;
|
|
41
|
+
function configureClient(config) {
|
|
42
|
+
clientConfig = config;
|
|
43
|
+
}
|
|
44
|
+
function getClientConfig() {
|
|
45
|
+
if (!clientConfig) {
|
|
46
|
+
throw new Error('Client not configured. Call configureClient({ baseUrl }) before using endpoint functions.');
|
|
47
|
+
}
|
|
48
|
+
return clientConfig;
|
|
49
|
+
}
|
|
50
|
+
const RETRYABLE_STATUSES = [429, 502, 503, 504];
|
|
51
|
+
async function buildHeaders(config, callerHeaders) {
|
|
52
|
+
const headers = new Headers(callerHeaders);
|
|
53
|
+
// Global headers from config (caller-provided headers take precedence)
|
|
54
|
+
if (config.getHeaders) {
|
|
55
|
+
const globalHeaders = await Promise.resolve(config.getHeaders());
|
|
56
|
+
for (const [key, value] of Object.entries(globalHeaders)) {
|
|
57
|
+
if (!headers.has(key)) {
|
|
58
|
+
headers.set(key, value);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// Auth token (caller or global headers take precedence)
|
|
63
|
+
if (config.getAuthToken && !headers.has('Authorization')) {
|
|
64
|
+
const token = await config.getAuthToken();
|
|
65
|
+
headers.set('Authorization', `Bearer ${token}`);
|
|
66
|
+
}
|
|
67
|
+
return headers;
|
|
68
|
+
}
|
|
69
|
+
const customFetch = async (url, options) => {
|
|
70
|
+
const config = getClientConfig();
|
|
71
|
+
const base = config.baseUrlResolver
|
|
72
|
+
? await config.baseUrlResolver()
|
|
73
|
+
: config.baseUrl;
|
|
74
|
+
if (base === undefined) {
|
|
75
|
+
throw new Error('Client not configured: set baseUrl or baseUrlResolver via configureClient().');
|
|
76
|
+
}
|
|
77
|
+
const fullUrl = `${base}${url}`;
|
|
78
|
+
const maxRetries = config.maxRetries ?? 3;
|
|
79
|
+
const headers = await buildHeaders(config, options.headers);
|
|
80
|
+
const requestInit = { ...options, headers };
|
|
81
|
+
let delay = 1000;
|
|
82
|
+
let lastError;
|
|
83
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
84
|
+
try {
|
|
85
|
+
const response = await fetch(fullUrl, requestInit);
|
|
86
|
+
// 401 — invoke onUnauthorized and retry once (outside the transient retry loop)
|
|
87
|
+
if (response.status === 401 && config.onUnauthorized && attempt === 0) {
|
|
88
|
+
await config.onUnauthorized();
|
|
89
|
+
const refreshedHeaders = await buildHeaders(config, options.headers);
|
|
90
|
+
const retryResponse = await fetch(fullUrl, { ...options, headers: refreshedHeaders });
|
|
91
|
+
const retryBody = await parseBody(retryResponse);
|
|
92
|
+
if (retryResponse.status >= 400) {
|
|
93
|
+
throw new ClientError(retryResponse.status, fullUrl, retryBody);
|
|
94
|
+
}
|
|
95
|
+
return retryBody;
|
|
96
|
+
}
|
|
97
|
+
// Non-retryable status — return or throw
|
|
98
|
+
if (!RETRYABLE_STATUSES.includes(response.status) || attempt >= maxRetries) {
|
|
99
|
+
const body = await parseBody(response);
|
|
100
|
+
if (response.status >= 400) {
|
|
101
|
+
throw new ClientError(response.status, fullUrl, body);
|
|
102
|
+
}
|
|
103
|
+
return body;
|
|
104
|
+
}
|
|
105
|
+
// Retryable — wait and retry
|
|
106
|
+
const retryAfter = parseRetryAfter(response.headers.get('Retry-After'));
|
|
107
|
+
const waitMs = retryAfter ?? addJitter(delay);
|
|
108
|
+
await sleep(waitMs);
|
|
109
|
+
delay = Math.min(delay * 2, 30_000);
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
if (error instanceof ClientError)
|
|
113
|
+
throw error; // Don't retry client errors
|
|
114
|
+
lastError = error instanceof Error ? error : new Error(String(error));
|
|
115
|
+
if (attempt >= maxRetries)
|
|
116
|
+
throw lastError;
|
|
117
|
+
const waitMs = addJitter(delay);
|
|
118
|
+
await sleep(waitMs);
|
|
119
|
+
delay = Math.min(delay * 2, 30_000);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
throw lastError ?? new Error(`All retries exhausted for ${fullUrl}`);
|
|
123
|
+
};
|
|
124
|
+
exports.customFetch = customFetch;
|
|
125
|
+
async function parseBody(response) {
|
|
126
|
+
const contentType = response.headers.get('content-type');
|
|
127
|
+
if (contentType?.includes('application/json')) {
|
|
128
|
+
return response.json();
|
|
129
|
+
}
|
|
130
|
+
if (response.status === 204) {
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|
|
133
|
+
return response.text();
|
|
134
|
+
}
|
|
135
|
+
function parseRetryAfter(value) {
|
|
136
|
+
if (!value)
|
|
137
|
+
return undefined;
|
|
138
|
+
const seconds = Number(value);
|
|
139
|
+
if (!isNaN(seconds) && seconds >= 0)
|
|
140
|
+
return seconds * 1000;
|
|
141
|
+
const date = new Date(value);
|
|
142
|
+
if (!isNaN(date.getTime()))
|
|
143
|
+
return Math.max(0, date.getTime() - Date.now());
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
function addJitter(delay) {
|
|
147
|
+
return delay + (Math.random() * 2 - 1) * delay * 0.25;
|
|
148
|
+
}
|
|
149
|
+
function sleep(ms) {
|
|
150
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
151
|
+
}
|
|
152
|
+
exports.default = exports.customFetch;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v8.6.2 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Search API
|
|
5
|
+
* Full-text search service — indexes content via event-hub, provides search and MCP tools
|
|
6
|
+
* OpenAPI spec version: 0.1.0
|
|
7
|
+
*/
|
|
8
|
+
import type { AdminControllerGetTraceStatsParams, AdminControllerGetTracesParams, ReindexJobResponseDtoDataEnvelope, ReindexTriggerResponseDtoDataEnvelope, SearchStatsResponseDtoDataEnvelope, TracesListResponseDtoDataEnvelope } from '../../models';
|
|
9
|
+
/**
|
|
10
|
+
* @summary Trigger full reindex for the authenticated organization
|
|
11
|
+
*/
|
|
12
|
+
export declare const getAdminControllerTriggerReindexUrl: () => string;
|
|
13
|
+
export declare const adminControllerTriggerReindex: (options?: RequestInit) => Promise<ReindexTriggerResponseDtoDataEnvelope>;
|
|
14
|
+
/**
|
|
15
|
+
* @summary Check reindex job progress
|
|
16
|
+
*/
|
|
17
|
+
export declare const getAdminControllerGetReindexStatusUrl: (jobId: string) => string;
|
|
18
|
+
export declare const adminControllerGetReindexStatus: (jobId: string, options?: RequestInit) => Promise<ReindexJobResponseDtoDataEnvelope>;
|
|
19
|
+
/**
|
|
20
|
+
* @summary List search traces for the authenticated organization
|
|
21
|
+
*/
|
|
22
|
+
export declare const getAdminControllerGetTracesUrl: (params?: AdminControllerGetTracesParams) => string;
|
|
23
|
+
export declare const adminControllerGetTraces: (params?: AdminControllerGetTracesParams, options?: RequestInit) => Promise<TracesListResponseDtoDataEnvelope>;
|
|
24
|
+
/**
|
|
25
|
+
* @summary Get search performance statistics
|
|
26
|
+
*/
|
|
27
|
+
export declare const getAdminControllerGetTraceStatsUrl: (params?: AdminControllerGetTraceStatsParams) => string;
|
|
28
|
+
export declare const adminControllerGetTraceStats: (params?: AdminControllerGetTraceStatsParams, options?: RequestInit) => Promise<SearchStatsResponseDtoDataEnvelope>;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.adminControllerGetTraceStats = exports.getAdminControllerGetTraceStatsUrl = exports.adminControllerGetTraces = exports.getAdminControllerGetTracesUrl = exports.adminControllerGetReindexStatus = exports.getAdminControllerGetReindexStatusUrl = exports.adminControllerTriggerReindex = exports.getAdminControllerTriggerReindexUrl = void 0;
|
|
4
|
+
const custom_fetch_1 = require("../../custom-fetch");
|
|
5
|
+
/**
|
|
6
|
+
* @summary Trigger full reindex for the authenticated organization
|
|
7
|
+
*/
|
|
8
|
+
const getAdminControllerTriggerReindexUrl = () => {
|
|
9
|
+
return `/admin/reindex`;
|
|
10
|
+
};
|
|
11
|
+
exports.getAdminControllerTriggerReindexUrl = getAdminControllerTriggerReindexUrl;
|
|
12
|
+
const adminControllerTriggerReindex = async (options) => {
|
|
13
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getAdminControllerTriggerReindexUrl)(), {
|
|
14
|
+
...options,
|
|
15
|
+
method: 'POST'
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
exports.adminControllerTriggerReindex = adminControllerTriggerReindex;
|
|
19
|
+
/**
|
|
20
|
+
* @summary Check reindex job progress
|
|
21
|
+
*/
|
|
22
|
+
const getAdminControllerGetReindexStatusUrl = (jobId) => {
|
|
23
|
+
return `/admin/reindex/${jobId}`;
|
|
24
|
+
};
|
|
25
|
+
exports.getAdminControllerGetReindexStatusUrl = getAdminControllerGetReindexStatusUrl;
|
|
26
|
+
const adminControllerGetReindexStatus = async (jobId, options) => {
|
|
27
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getAdminControllerGetReindexStatusUrl)(jobId), {
|
|
28
|
+
...options,
|
|
29
|
+
method: 'GET'
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
exports.adminControllerGetReindexStatus = adminControllerGetReindexStatus;
|
|
33
|
+
/**
|
|
34
|
+
* @summary List search traces for the authenticated organization
|
|
35
|
+
*/
|
|
36
|
+
const getAdminControllerGetTracesUrl = (params) => {
|
|
37
|
+
const normalizedParams = new URLSearchParams();
|
|
38
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
39
|
+
if (value === undefined)
|
|
40
|
+
return;
|
|
41
|
+
if (value === null) {
|
|
42
|
+
normalizedParams.append(key, 'null');
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (Array.isArray(value)) {
|
|
46
|
+
for (const item of value) {
|
|
47
|
+
if (item === undefined || item === null)
|
|
48
|
+
continue;
|
|
49
|
+
normalizedParams.append(key, item.toString());
|
|
50
|
+
}
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
normalizedParams.append(key, value.toString());
|
|
54
|
+
});
|
|
55
|
+
const stringifiedParams = normalizedParams.toString();
|
|
56
|
+
return stringifiedParams.length > 0 ? `/admin/traces?${stringifiedParams}` : `/admin/traces`;
|
|
57
|
+
};
|
|
58
|
+
exports.getAdminControllerGetTracesUrl = getAdminControllerGetTracesUrl;
|
|
59
|
+
const adminControllerGetTraces = async (params, options) => {
|
|
60
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getAdminControllerGetTracesUrl)(params), {
|
|
61
|
+
...options,
|
|
62
|
+
method: 'GET'
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
exports.adminControllerGetTraces = adminControllerGetTraces;
|
|
66
|
+
/**
|
|
67
|
+
* @summary Get search performance statistics
|
|
68
|
+
*/
|
|
69
|
+
const getAdminControllerGetTraceStatsUrl = (params) => {
|
|
70
|
+
const normalizedParams = new URLSearchParams();
|
|
71
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
72
|
+
if (value === undefined)
|
|
73
|
+
return;
|
|
74
|
+
if (value === null) {
|
|
75
|
+
normalizedParams.append(key, 'null');
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (Array.isArray(value)) {
|
|
79
|
+
for (const item of value) {
|
|
80
|
+
if (item === undefined || item === null)
|
|
81
|
+
continue;
|
|
82
|
+
normalizedParams.append(key, item.toString());
|
|
83
|
+
}
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
normalizedParams.append(key, value.toString());
|
|
87
|
+
});
|
|
88
|
+
const stringifiedParams = normalizedParams.toString();
|
|
89
|
+
return stringifiedParams.length > 0 ? `/admin/traces/stats?${stringifiedParams}` : `/admin/traces/stats`;
|
|
90
|
+
};
|
|
91
|
+
exports.getAdminControllerGetTraceStatsUrl = getAdminControllerGetTraceStatsUrl;
|
|
92
|
+
const adminControllerGetTraceStats = async (params, options) => {
|
|
93
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getAdminControllerGetTraceStatsUrl)(params), {
|
|
94
|
+
...options,
|
|
95
|
+
method: 'GET'
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
exports.adminControllerGetTraceStats = adminControllerGetTraceStats;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @summary Health check
|
|
3
|
+
*/
|
|
4
|
+
export declare const getHealthControllerCheckUrl: () => string;
|
|
5
|
+
export declare const healthControllerCheck: (options?: RequestInit) => Promise<void>;
|
|
6
|
+
/**
|
|
7
|
+
* @summary Liveness probe
|
|
8
|
+
*/
|
|
9
|
+
export declare const getHealthControllerLiveUrl: () => string;
|
|
10
|
+
export declare const healthControllerLive: (options?: RequestInit) => Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* @summary Readiness probe — checks database and OpenSearch connectivity
|
|
13
|
+
*/
|
|
14
|
+
export declare const getHealthControllerReadyUrl: () => string;
|
|
15
|
+
export declare const healthControllerReady: (options?: RequestInit) => Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* @summary Embedding admission counters
|
|
18
|
+
*/
|
|
19
|
+
export declare const getHealthControllerGetEmbeddingMetricsUrl: () => string;
|
|
20
|
+
export declare const healthControllerGetEmbeddingMetrics: (options?: RequestInit) => Promise<void>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.healthControllerGetEmbeddingMetrics = exports.getHealthControllerGetEmbeddingMetricsUrl = exports.healthControllerReady = exports.getHealthControllerReadyUrl = exports.healthControllerLive = exports.getHealthControllerLiveUrl = exports.healthControllerCheck = exports.getHealthControllerCheckUrl = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Generated by orval v8.6.2 🍺
|
|
6
|
+
* Do not edit manually.
|
|
7
|
+
* Search API
|
|
8
|
+
* Full-text search service — indexes content via event-hub, provides search and MCP tools
|
|
9
|
+
* OpenAPI spec version: 0.1.0
|
|
10
|
+
*/
|
|
11
|
+
const custom_fetch_1 = require("../../custom-fetch");
|
|
12
|
+
/**
|
|
13
|
+
* @summary Health check
|
|
14
|
+
*/
|
|
15
|
+
const getHealthControllerCheckUrl = () => {
|
|
16
|
+
return `/health`;
|
|
17
|
+
};
|
|
18
|
+
exports.getHealthControllerCheckUrl = getHealthControllerCheckUrl;
|
|
19
|
+
const healthControllerCheck = async (options) => {
|
|
20
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getHealthControllerCheckUrl)(), {
|
|
21
|
+
...options,
|
|
22
|
+
method: 'GET'
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
exports.healthControllerCheck = healthControllerCheck;
|
|
26
|
+
/**
|
|
27
|
+
* @summary Liveness probe
|
|
28
|
+
*/
|
|
29
|
+
const getHealthControllerLiveUrl = () => {
|
|
30
|
+
return `/health/live`;
|
|
31
|
+
};
|
|
32
|
+
exports.getHealthControllerLiveUrl = getHealthControllerLiveUrl;
|
|
33
|
+
const healthControllerLive = async (options) => {
|
|
34
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getHealthControllerLiveUrl)(), {
|
|
35
|
+
...options,
|
|
36
|
+
method: 'GET'
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
exports.healthControllerLive = healthControllerLive;
|
|
40
|
+
/**
|
|
41
|
+
* @summary Readiness probe — checks database and OpenSearch connectivity
|
|
42
|
+
*/
|
|
43
|
+
const getHealthControllerReadyUrl = () => {
|
|
44
|
+
return `/health/ready`;
|
|
45
|
+
};
|
|
46
|
+
exports.getHealthControllerReadyUrl = getHealthControllerReadyUrl;
|
|
47
|
+
const healthControllerReady = async (options) => {
|
|
48
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getHealthControllerReadyUrl)(), {
|
|
49
|
+
...options,
|
|
50
|
+
method: 'GET'
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
exports.healthControllerReady = healthControllerReady;
|
|
54
|
+
/**
|
|
55
|
+
* @summary Embedding admission counters
|
|
56
|
+
*/
|
|
57
|
+
const getHealthControllerGetEmbeddingMetricsUrl = () => {
|
|
58
|
+
return `/health/embedding-metrics`;
|
|
59
|
+
};
|
|
60
|
+
exports.getHealthControllerGetEmbeddingMetricsUrl = getHealthControllerGetEmbeddingMetricsUrl;
|
|
61
|
+
const healthControllerGetEmbeddingMetrics = async (options) => {
|
|
62
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getHealthControllerGetEmbeddingMetricsUrl)(), {
|
|
63
|
+
...options,
|
|
64
|
+
method: 'GET'
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
exports.healthControllerGetEmbeddingMetrics = healthControllerGetEmbeddingMetrics;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const getMcpControllerHandlePostUrl: () => string;
|
|
2
|
+
export declare const mcpControllerHandlePost: (options?: RequestInit) => Promise<void>;
|
|
3
|
+
export declare const getMcpControllerHandleGetUrl: () => string;
|
|
4
|
+
export declare const mcpControllerHandleGet: (options?: RequestInit) => Promise<void>;
|
|
5
|
+
export declare const getMcpControllerHandleDeleteUrl: () => string;
|
|
6
|
+
export declare const mcpControllerHandleDelete: (options?: RequestInit) => Promise<void>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mcpControllerHandleDelete = exports.getMcpControllerHandleDeleteUrl = exports.mcpControllerHandleGet = exports.getMcpControllerHandleGetUrl = exports.mcpControllerHandlePost = exports.getMcpControllerHandlePostUrl = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Generated by orval v8.6.2 🍺
|
|
6
|
+
* Do not edit manually.
|
|
7
|
+
* Search API
|
|
8
|
+
* Full-text search service — indexes content via event-hub, provides search and MCP tools
|
|
9
|
+
* OpenAPI spec version: 0.1.0
|
|
10
|
+
*/
|
|
11
|
+
const custom_fetch_1 = require("../../custom-fetch");
|
|
12
|
+
const getMcpControllerHandlePostUrl = () => {
|
|
13
|
+
return `/mcp`;
|
|
14
|
+
};
|
|
15
|
+
exports.getMcpControllerHandlePostUrl = getMcpControllerHandlePostUrl;
|
|
16
|
+
const mcpControllerHandlePost = async (options) => {
|
|
17
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getMcpControllerHandlePostUrl)(), {
|
|
18
|
+
...options,
|
|
19
|
+
method: 'POST'
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
exports.mcpControllerHandlePost = mcpControllerHandlePost;
|
|
23
|
+
const getMcpControllerHandleGetUrl = () => {
|
|
24
|
+
return `/mcp`;
|
|
25
|
+
};
|
|
26
|
+
exports.getMcpControllerHandleGetUrl = getMcpControllerHandleGetUrl;
|
|
27
|
+
const mcpControllerHandleGet = async (options) => {
|
|
28
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getMcpControllerHandleGetUrl)(), {
|
|
29
|
+
...options,
|
|
30
|
+
method: 'GET'
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
exports.mcpControllerHandleGet = mcpControllerHandleGet;
|
|
34
|
+
const getMcpControllerHandleDeleteUrl = () => {
|
|
35
|
+
return `/mcp`;
|
|
36
|
+
};
|
|
37
|
+
exports.getMcpControllerHandleDeleteUrl = getMcpControllerHandleDeleteUrl;
|
|
38
|
+
const mcpControllerHandleDelete = async (options) => {
|
|
39
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getMcpControllerHandleDeleteUrl)(), {
|
|
40
|
+
...options,
|
|
41
|
+
method: 'DELETE'
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
exports.mcpControllerHandleDelete = mcpControllerHandleDelete;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v8.6.2 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Search API
|
|
5
|
+
* Full-text search service — indexes content via event-hub, provides search and MCP tools
|
|
6
|
+
* OpenAPI spec version: 0.1.0
|
|
7
|
+
*/
|
|
8
|
+
import type { FacetResponseDataEnvelope, SearchControllerFacetsParams, SearchControllerSearchParams, SearchResultDtoDataEnvelope } from '../../models';
|
|
9
|
+
/**
|
|
10
|
+
* @summary Search documents across the project
|
|
11
|
+
*/
|
|
12
|
+
export declare const getSearchControllerSearchUrl: (params: SearchControllerSearchParams) => string;
|
|
13
|
+
export declare const searchControllerSearch: (params: SearchControllerSearchParams, options?: RequestInit) => Promise<SearchResultDtoDataEnvelope>;
|
|
14
|
+
/**
|
|
15
|
+
* @summary Get faceted aggregations without document results
|
|
16
|
+
*/
|
|
17
|
+
export declare const getSearchControllerFacetsUrl: (params?: SearchControllerFacetsParams) => string;
|
|
18
|
+
export declare const searchControllerFacets: (params?: SearchControllerFacetsParams, options?: RequestInit) => Promise<FacetResponseDataEnvelope>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.searchControllerFacets = exports.getSearchControllerFacetsUrl = exports.searchControllerSearch = exports.getSearchControllerSearchUrl = void 0;
|
|
4
|
+
const custom_fetch_1 = require("../../custom-fetch");
|
|
5
|
+
/**
|
|
6
|
+
* @summary Search documents across the project
|
|
7
|
+
*/
|
|
8
|
+
const getSearchControllerSearchUrl = (params) => {
|
|
9
|
+
const normalizedParams = new URLSearchParams();
|
|
10
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
11
|
+
if (value === undefined)
|
|
12
|
+
return;
|
|
13
|
+
if (value === null) {
|
|
14
|
+
normalizedParams.append(key, 'null');
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (Array.isArray(value)) {
|
|
18
|
+
for (const item of value) {
|
|
19
|
+
if (item === undefined || item === null)
|
|
20
|
+
continue;
|
|
21
|
+
normalizedParams.append(key, item.toString());
|
|
22
|
+
}
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
normalizedParams.append(key, value.toString());
|
|
26
|
+
});
|
|
27
|
+
const stringifiedParams = normalizedParams.toString();
|
|
28
|
+
return stringifiedParams.length > 0 ? `/search?${stringifiedParams}` : `/search`;
|
|
29
|
+
};
|
|
30
|
+
exports.getSearchControllerSearchUrl = getSearchControllerSearchUrl;
|
|
31
|
+
const searchControllerSearch = async (params, options) => {
|
|
32
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getSearchControllerSearchUrl)(params), {
|
|
33
|
+
...options,
|
|
34
|
+
method: 'GET'
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
exports.searchControllerSearch = searchControllerSearch;
|
|
38
|
+
/**
|
|
39
|
+
* @summary Get faceted aggregations without document results
|
|
40
|
+
*/
|
|
41
|
+
const getSearchControllerFacetsUrl = (params) => {
|
|
42
|
+
const normalizedParams = new URLSearchParams();
|
|
43
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
44
|
+
if (value === undefined)
|
|
45
|
+
return;
|
|
46
|
+
if (value === null) {
|
|
47
|
+
normalizedParams.append(key, 'null');
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (Array.isArray(value)) {
|
|
51
|
+
for (const item of value) {
|
|
52
|
+
if (item === undefined || item === null)
|
|
53
|
+
continue;
|
|
54
|
+
normalizedParams.append(key, item.toString());
|
|
55
|
+
}
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
normalizedParams.append(key, value.toString());
|
|
59
|
+
});
|
|
60
|
+
const stringifiedParams = normalizedParams.toString();
|
|
61
|
+
return stringifiedParams.length > 0 ? `/search/facets?${stringifiedParams}` : `/search/facets`;
|
|
62
|
+
};
|
|
63
|
+
exports.getSearchControllerFacetsUrl = getSearchControllerFacetsUrl;
|
|
64
|
+
const searchControllerFacets = async (params, options) => {
|
|
65
|
+
return (0, custom_fetch_1.customFetch)((0, exports.getSearchControllerFacetsUrl)(params), {
|
|
66
|
+
...options,
|
|
67
|
+
method: 'GET'
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
exports.searchControllerFacets = searchControllerFacets;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { configureClient, getClientConfig, ClientError, customFetch, type ClientConfig } from './custom-fetch';
|
|
2
|
+
export * from './models';
|
|
3
|
+
export * from './endpoints/admin/admin';
|
|
4
|
+
export * from './endpoints/health/health';
|
|
5
|
+
export * from './endpoints/mcp/mcp';
|
|
6
|
+
export * from './endpoints/search/search';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.customFetch = exports.ClientError = exports.getClientConfig = exports.configureClient = void 0;
|
|
18
|
+
// Auto-generated by scripts/build-client-index.js — do not edit manually.
|
|
19
|
+
var custom_fetch_1 = require("./custom-fetch");
|
|
20
|
+
Object.defineProperty(exports, "configureClient", { enumerable: true, get: function () { return custom_fetch_1.configureClient; } });
|
|
21
|
+
Object.defineProperty(exports, "getClientConfig", { enumerable: true, get: function () { return custom_fetch_1.getClientConfig; } });
|
|
22
|
+
Object.defineProperty(exports, "ClientError", { enumerable: true, get: function () { return custom_fetch_1.ClientError; } });
|
|
23
|
+
Object.defineProperty(exports, "customFetch", { enumerable: true, get: function () { return custom_fetch_1.customFetch; } });
|
|
24
|
+
__exportStar(require("./models"), exports);
|
|
25
|
+
__exportStar(require("./endpoints/admin/admin"), exports);
|
|
26
|
+
__exportStar(require("./endpoints/health/health"), exports);
|
|
27
|
+
__exportStar(require("./endpoints/mcp/mcp"), exports);
|
|
28
|
+
__exportStar(require("./endpoints/search/search"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v8.6.2 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Search API
|
|
5
|
+
* Full-text search service — indexes content via event-hub, provides search and MCP tools
|
|
6
|
+
* OpenAPI spec version: 0.1.0
|
|
7
|
+
*/
|
|
8
|
+
export type AdminControllerGetTraceStatsParams = {
|
|
9
|
+
/**
|
|
10
|
+
* Calculate stats for the last N days
|
|
11
|
+
*/
|
|
12
|
+
sinceDays?: number;
|
|
13
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generated by orval v8.6.2 🍺
|
|
4
|
+
* Do not edit manually.
|
|
5
|
+
* Search API
|
|
6
|
+
* Full-text search service — indexes content via event-hub, provides search and MCP tools
|
|
7
|
+
* OpenAPI spec version: 0.1.0
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v8.6.2 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Search API
|
|
5
|
+
* Full-text search service — indexes content via event-hub, provides search and MCP tools
|
|
6
|
+
* OpenAPI spec version: 0.1.0
|
|
7
|
+
*/
|
|
8
|
+
export type AdminControllerGetTracesParams = {
|
|
9
|
+
/**
|
|
10
|
+
* Maximum number of traces to return
|
|
11
|
+
*/
|
|
12
|
+
limit?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Offset for pagination
|
|
15
|
+
*/
|
|
16
|
+
offset?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Show traces from the last N days
|
|
19
|
+
*/
|
|
20
|
+
sinceDays?: number;
|
|
21
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Generated by orval v8.6.2 🍺
|
|
4
|
+
* Do not edit manually.
|
|
5
|
+
* Search API
|
|
6
|
+
* Full-text search service — indexes content via event-hub, provides search and MCP tools
|
|
7
|
+
* OpenAPI spec version: 0.1.0
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|