@xemahq/llm-gateway-api-client 0.1.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.
Files changed (115) hide show
  1. package/dist/custom-fetch.d.ts +43 -0
  2. package/dist/custom-fetch.js +146 -0
  3. package/dist/endpoints/admin-pricing/admin-pricing.d.ts +23 -0
  4. package/dist/endpoints/admin-pricing/admin-pricing.js +67 -0
  5. package/dist/endpoints/audit/audit.d.ts +53 -0
  6. package/dist/endpoints/audit/audit.js +225 -0
  7. package/dist/endpoints/health/health.d.ts +23 -0
  8. package/dist/endpoints/health/health.js +46 -0
  9. package/dist/endpoints/llm-proxy/llm-proxy.d.ts +20 -0
  10. package/dist/endpoints/llm-proxy/llm-proxy.js +67 -0
  11. package/dist/endpoints/usage-analytics/usage-analytics.d.ts +23 -0
  12. package/dist/endpoints/usage-analytics/usage-analytics.js +103 -0
  13. package/dist/index.d.ts +7 -0
  14. package/dist/index.js +29 -0
  15. package/dist/models/auditControllerClearSessionsParams.d.ts +13 -0
  16. package/dist/models/auditControllerClearSessionsParams.js +9 -0
  17. package/dist/models/auditControllerCompleteByProjectParams.d.ts +13 -0
  18. package/dist/models/auditControllerCompleteByProjectParams.js +9 -0
  19. package/dist/models/auditControllerExportPdfParams.d.ts +38 -0
  20. package/dist/models/auditControllerExportPdfParams.js +2 -0
  21. package/dist/models/auditControllerExportPdfStatus.d.ts +13 -0
  22. package/dist/models/auditControllerExportPdfStatus.js +15 -0
  23. package/dist/models/auditControllerListEntriesParams.d.ts +17 -0
  24. package/dist/models/auditControllerListEntriesParams.js +9 -0
  25. package/dist/models/auditControllerListSessionsParams.d.ts +38 -0
  26. package/dist/models/auditControllerListSessionsParams.js +2 -0
  27. package/dist/models/auditControllerListSessionsStatus.d.ts +13 -0
  28. package/dist/models/auditControllerListSessionsStatus.js +15 -0
  29. package/dist/models/auditEntryDetailDto.d.ts +72 -0
  30. package/dist/models/auditEntryDetailDto.js +2 -0
  31. package/dist/models/auditEntryDetailDtoMetadata.d.ts +13 -0
  32. package/dist/models/auditEntryDetailDtoMetadata.js +9 -0
  33. package/dist/models/auditEntryDetailDtoRequestBody.d.ts +13 -0
  34. package/dist/models/auditEntryDetailDtoRequestBody.js +9 -0
  35. package/dist/models/auditEntryDetailDtoRequestType.d.ts +18 -0
  36. package/dist/models/auditEntryDetailDtoRequestType.js +17 -0
  37. package/dist/models/auditEntryDetailDtoResponseBody.d.ts +13 -0
  38. package/dist/models/auditEntryDetailDtoResponseBody.js +9 -0
  39. package/dist/models/auditEntryDetailDtoStatus.d.ts +16 -0
  40. package/dist/models/auditEntryDetailDtoStatus.js +15 -0
  41. package/dist/models/auditEntryDetailDtoStreamingPhase.d.ts +17 -0
  42. package/dist/models/auditEntryDetailDtoStreamingPhase.js +15 -0
  43. package/dist/models/auditEntryDetailDtoToolCalls.d.ts +13 -0
  44. package/dist/models/auditEntryDetailDtoToolCalls.js +9 -0
  45. package/dist/models/auditEntryDetailDtoUsageSource.d.ts +18 -0
  46. package/dist/models/auditEntryDetailDtoUsageSource.js +17 -0
  47. package/dist/models/auditEntryDetailResponseDto.d.ts +12 -0
  48. package/dist/models/auditEntryDetailResponseDto.js +2 -0
  49. package/dist/models/auditEntryDto.d.ts +63 -0
  50. package/dist/models/auditEntryDto.js +2 -0
  51. package/dist/models/auditEntryDtoMetadata.d.ts +13 -0
  52. package/dist/models/auditEntryDtoMetadata.js +9 -0
  53. package/dist/models/auditEntryDtoRequestType.d.ts +18 -0
  54. package/dist/models/auditEntryDtoRequestType.js +17 -0
  55. package/dist/models/auditEntryDtoStatus.d.ts +16 -0
  56. package/dist/models/auditEntryDtoStatus.js +15 -0
  57. package/dist/models/auditEntryDtoStreamingPhase.d.ts +17 -0
  58. package/dist/models/auditEntryDtoStreamingPhase.js +15 -0
  59. package/dist/models/auditEntryDtoUsageSource.d.ts +18 -0
  60. package/dist/models/auditEntryDtoUsageSource.js +17 -0
  61. package/dist/models/auditEntryListResponseDto.d.ts +15 -0
  62. package/dist/models/auditEntryListResponseDto.js +2 -0
  63. package/dist/models/auditSessionDto.d.ts +58 -0
  64. package/dist/models/auditSessionDto.js +2 -0
  65. package/dist/models/auditSessionDtoMetadata.d.ts +13 -0
  66. package/dist/models/auditSessionDtoMetadata.js +9 -0
  67. package/dist/models/auditSessionDtoProviderTier.d.ts +15 -0
  68. package/dist/models/auditSessionDtoProviderTier.js +14 -0
  69. package/dist/models/auditSessionDtoStatus.d.ts +16 -0
  70. package/dist/models/auditSessionDtoStatus.js +15 -0
  71. package/dist/models/auditSessionListResponseDto.d.ts +15 -0
  72. package/dist/models/auditSessionListResponseDto.js +2 -0
  73. package/dist/models/auditSessionResponseDto.d.ts +12 -0
  74. package/dist/models/auditSessionResponseDto.js +2 -0
  75. package/dist/models/auditStatusDataDto.d.ts +13 -0
  76. package/dist/models/auditStatusDataDto.js +9 -0
  77. package/dist/models/auditStatusResponseDto.d.ts +12 -0
  78. package/dist/models/auditStatusResponseDto.js +2 -0
  79. package/dist/models/completedCountDto.d.ts +11 -0
  80. package/dist/models/completedCountDto.js +9 -0
  81. package/dist/models/completedCountResponseDto.d.ts +12 -0
  82. package/dist/models/completedCountResponseDto.js +2 -0
  83. package/dist/models/createPricingDto.d.ts +21 -0
  84. package/dist/models/createPricingDto.js +2 -0
  85. package/dist/models/createPricingDtoSource.d.ts +13 -0
  86. package/dist/models/createPricingDtoSource.js +15 -0
  87. package/dist/models/healthControllerReady200.d.ts +18 -0
  88. package/dist/models/healthControllerReady200.js +2 -0
  89. package/dist/models/healthControllerReady200Details.d.ts +13 -0
  90. package/dist/models/healthControllerReady200Details.js +9 -0
  91. package/dist/models/healthControllerReady200Error.d.ts +16 -0
  92. package/dist/models/healthControllerReady200Error.js +9 -0
  93. package/dist/models/healthControllerReady200Info.d.ts +16 -0
  94. package/dist/models/healthControllerReady200Info.js +9 -0
  95. package/dist/models/healthControllerReady503.d.ts +18 -0
  96. package/dist/models/healthControllerReady503.js +2 -0
  97. package/dist/models/healthControllerReady503Details.d.ts +13 -0
  98. package/dist/models/healthControllerReady503Details.js +9 -0
  99. package/dist/models/healthControllerReady503Error.d.ts +16 -0
  100. package/dist/models/healthControllerReady503Error.js +9 -0
  101. package/dist/models/healthControllerReady503Info.d.ts +16 -0
  102. package/dist/models/healthControllerReady503Info.js +9 -0
  103. package/dist/models/index.d.ts +56 -0
  104. package/dist/models/index.js +72 -0
  105. package/dist/models/paginationMetaDto.d.ts +17 -0
  106. package/dist/models/paginationMetaDto.js +9 -0
  107. package/dist/models/pricingControllerListPricingParams.d.ts +19 -0
  108. package/dist/models/pricingControllerListPricingParams.js +9 -0
  109. package/dist/models/usageAnalyticsControllerGetByProjectParams.d.ts +11 -0
  110. package/dist/models/usageAnalyticsControllerGetByProjectParams.js +9 -0
  111. package/dist/models/usageAnalyticsControllerGetRecentParams.d.ts +11 -0
  112. package/dist/models/usageAnalyticsControllerGetRecentParams.js +9 -0
  113. package/dist/models/usageAnalyticsControllerGetSummaryParams.d.ts +11 -0
  114. package/dist/models/usageAnalyticsControllerGetSummaryParams.js +9 -0
  115. package/package.json +20 -0
@@ -0,0 +1,43 @@
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
+ /** Base URL for the API (e.g. 'http://localhost:3140') — no trailing slash. */
24
+ baseUrl: string;
25
+ /** Optional async callback to get an auth token. Auto-sets Authorization header on every request. */
26
+ getAuthToken?: () => Promise<string>;
27
+ /** Optional callback returning headers to inject on every request. Per-call headers take precedence. */
28
+ getHeaders?: () => Record<string, string> | Promise<Record<string, string>>;
29
+ /** Optional callback invoked on 401 before a single retry (e.g. force-refresh auth token). */
30
+ onUnauthorized?: () => Promise<void>;
31
+ /** Maximum retry attempts for transient failures (default: 3). Set to 0 to disable retries. */
32
+ maxRetries?: number;
33
+ }
34
+ export declare class ClientError extends Error {
35
+ readonly status: number;
36
+ readonly url: string;
37
+ readonly body: unknown;
38
+ constructor(status: number, url: string, body: unknown);
39
+ }
40
+ export declare function configureClient(config: ClientConfig): void;
41
+ export declare function getClientConfig(): ClientConfig;
42
+ export declare const customFetch: <T>(url: string, options: RequestInit) => Promise<T>;
43
+ export default customFetch;
@@ -0,0 +1,146 @@
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 fullUrl = `${config.baseUrl}${url}`;
72
+ const maxRetries = config.maxRetries ?? 3;
73
+ const headers = await buildHeaders(config, options.headers);
74
+ const requestInit = { ...options, headers };
75
+ let delay = 1000;
76
+ let lastError;
77
+ for (let attempt = 0; attempt <= maxRetries; attempt++) {
78
+ try {
79
+ const response = await fetch(fullUrl, requestInit);
80
+ // 401 — invoke onUnauthorized and retry once (outside the transient retry loop)
81
+ if (response.status === 401 && config.onUnauthorized && attempt === 0) {
82
+ await config.onUnauthorized();
83
+ const refreshedHeaders = await buildHeaders(config, options.headers);
84
+ const retryResponse = await fetch(fullUrl, { ...options, headers: refreshedHeaders });
85
+ const retryBody = await parseBody(retryResponse);
86
+ if (retryResponse.status >= 400) {
87
+ throw new ClientError(retryResponse.status, fullUrl, retryBody);
88
+ }
89
+ return retryBody;
90
+ }
91
+ // Non-retryable status — return or throw
92
+ if (!RETRYABLE_STATUSES.includes(response.status) || attempt >= maxRetries) {
93
+ const body = await parseBody(response);
94
+ if (response.status >= 400) {
95
+ throw new ClientError(response.status, fullUrl, body);
96
+ }
97
+ return body;
98
+ }
99
+ // Retryable — wait and retry
100
+ const retryAfter = parseRetryAfter(response.headers.get('Retry-After'));
101
+ const waitMs = retryAfter ?? addJitter(delay);
102
+ await sleep(waitMs);
103
+ delay = Math.min(delay * 2, 30_000);
104
+ }
105
+ catch (error) {
106
+ if (error instanceof ClientError)
107
+ throw error; // Don't retry client errors
108
+ lastError = error instanceof Error ? error : new Error(String(error));
109
+ if (attempt >= maxRetries)
110
+ throw lastError;
111
+ const waitMs = addJitter(delay);
112
+ await sleep(waitMs);
113
+ delay = Math.min(delay * 2, 30_000);
114
+ }
115
+ }
116
+ throw lastError ?? new Error(`All retries exhausted for ${fullUrl}`);
117
+ };
118
+ exports.customFetch = customFetch;
119
+ async function parseBody(response) {
120
+ const contentType = response.headers.get('content-type');
121
+ if (contentType?.includes('application/json')) {
122
+ return response.json();
123
+ }
124
+ if (response.status === 204) {
125
+ return undefined;
126
+ }
127
+ return response.text();
128
+ }
129
+ function parseRetryAfter(value) {
130
+ if (!value)
131
+ return undefined;
132
+ const seconds = Number(value);
133
+ if (!isNaN(seconds) && seconds >= 0)
134
+ return seconds * 1000;
135
+ const date = new Date(value);
136
+ if (!isNaN(date.getTime()))
137
+ return Math.max(0, date.getTime() - Date.now());
138
+ return undefined;
139
+ }
140
+ function addJitter(delay) {
141
+ return delay + (Math.random() * 2 - 1) * delay * 0.25;
142
+ }
143
+ function sleep(ms) {
144
+ return new Promise(resolve => setTimeout(resolve, ms));
145
+ }
146
+ exports.default = exports.customFetch;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Generated by orval v8.6.2 🍺
3
+ * Do not edit manually.
4
+ * LLM Gateway API
5
+ * Unified LLM proxy with provider management, credential resolution, concurrency, and usage tracking
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import type { CreatePricingDto, PricingControllerListPricingParams } from '../../models';
9
+ /**
10
+ * @summary List all model pricing
11
+ */
12
+ export declare const getPricingControllerListPricingUrl: (params?: PricingControllerListPricingParams) => string;
13
+ export declare const pricingControllerListPricing: (params?: PricingControllerListPricingParams, options?: RequestInit) => Promise<void>;
14
+ /**
15
+ * @summary Set model pricing
16
+ */
17
+ export declare const getPricingControllerCreatePricingUrl: () => string;
18
+ export declare const pricingControllerCreatePricing: (createPricingDto: CreatePricingDto, options?: RequestInit) => Promise<void>;
19
+ /**
20
+ * @summary Refresh pricing cache
21
+ */
22
+ export declare const getPricingControllerRefreshCacheUrl: () => string;
23
+ export declare const pricingControllerRefreshCache: (options?: RequestInit) => Promise<void>;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pricingControllerRefreshCache = exports.getPricingControllerRefreshCacheUrl = exports.pricingControllerCreatePricing = exports.getPricingControllerCreatePricingUrl = exports.pricingControllerListPricing = exports.getPricingControllerListPricingUrl = void 0;
4
+ const custom_fetch_1 = require("../../custom-fetch");
5
+ /**
6
+ * @summary List all model pricing
7
+ */
8
+ const getPricingControllerListPricingUrl = (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 ? `/admin/pricing?${stringifiedParams}` : `/admin/pricing`;
29
+ };
30
+ exports.getPricingControllerListPricingUrl = getPricingControllerListPricingUrl;
31
+ const pricingControllerListPricing = async (params, options) => {
32
+ return (0, custom_fetch_1.customFetch)((0, exports.getPricingControllerListPricingUrl)(params), {
33
+ ...options,
34
+ method: 'GET'
35
+ });
36
+ };
37
+ exports.pricingControllerListPricing = pricingControllerListPricing;
38
+ /**
39
+ * @summary Set model pricing
40
+ */
41
+ const getPricingControllerCreatePricingUrl = () => {
42
+ return `/admin/pricing`;
43
+ };
44
+ exports.getPricingControllerCreatePricingUrl = getPricingControllerCreatePricingUrl;
45
+ const pricingControllerCreatePricing = async (createPricingDto, options) => {
46
+ return (0, custom_fetch_1.customFetch)((0, exports.getPricingControllerCreatePricingUrl)(), {
47
+ ...options,
48
+ method: 'POST',
49
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
50
+ body: JSON.stringify(createPricingDto)
51
+ });
52
+ };
53
+ exports.pricingControllerCreatePricing = pricingControllerCreatePricing;
54
+ /**
55
+ * @summary Refresh pricing cache
56
+ */
57
+ const getPricingControllerRefreshCacheUrl = () => {
58
+ return `/admin/pricing/refresh-cache`;
59
+ };
60
+ exports.getPricingControllerRefreshCacheUrl = getPricingControllerRefreshCacheUrl;
61
+ const pricingControllerRefreshCache = async (options) => {
62
+ return (0, custom_fetch_1.customFetch)((0, exports.getPricingControllerRefreshCacheUrl)(), {
63
+ ...options,
64
+ method: 'POST'
65
+ });
66
+ };
67
+ exports.pricingControllerRefreshCache = pricingControllerRefreshCache;
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Generated by orval v8.6.2 🍺
3
+ * Do not edit manually.
4
+ * LLM Gateway API
5
+ * Unified LLM proxy with provider management, credential resolution, concurrency, and usage tracking
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import type { AuditControllerClearSessionsParams, AuditControllerCompleteByProjectParams, AuditControllerExportPdfParams, AuditControllerListEntriesParams, AuditControllerListSessionsParams, AuditEntryDetailResponseDto, AuditEntryListResponseDto, AuditSessionListResponseDto, AuditSessionResponseDto, AuditStatusResponseDto, CompletedCountResponseDto } from '../../models';
9
+ /**
10
+ * @summary Check if audit mode is enabled
11
+ */
12
+ export declare const getAuditControllerGetStatusUrl: () => string;
13
+ export declare const auditControllerGetStatus: (options?: RequestInit) => Promise<AuditStatusResponseDto>;
14
+ /**
15
+ * @summary Export audit sessions as PDF report
16
+ */
17
+ export declare const getAuditControllerExportPdfUrl: (params?: AuditControllerExportPdfParams) => string;
18
+ export declare const auditControllerExportPdf: (params?: AuditControllerExportPdfParams, options?: RequestInit) => Promise<void>;
19
+ /**
20
+ * @summary List audit sessions (paginated)
21
+ */
22
+ export declare const getAuditControllerListSessionsUrl: (params?: AuditControllerListSessionsParams) => string;
23
+ export declare const auditControllerListSessions: (params?: AuditControllerListSessionsParams, options?: RequestInit) => Promise<AuditSessionListResponseDto>;
24
+ /**
25
+ * @summary Delete all audit sessions (optionally by project)
26
+ */
27
+ export declare const getAuditControllerClearSessionsUrl: (params?: AuditControllerClearSessionsParams) => string;
28
+ export declare const auditControllerClearSessions: (params?: AuditControllerClearSessionsParams, options?: RequestInit) => Promise<void>;
29
+ /**
30
+ * @summary Get audit session details
31
+ */
32
+ export declare const getAuditControllerGetSessionUrl: (id: string) => string;
33
+ export declare const auditControllerGetSession: (id: string, options?: RequestInit) => Promise<AuditSessionResponseDto>;
34
+ /**
35
+ * @summary List entries for an audit session (paginated)
36
+ */
37
+ export declare const getAuditControllerListEntriesUrl: (id: string, params?: AuditControllerListEntriesParams) => string;
38
+ export declare const auditControllerListEntries: (id: string, params?: AuditControllerListEntriesParams, options?: RequestInit) => Promise<AuditEntryListResponseDto>;
39
+ /**
40
+ * @summary Get full audit entry details (includes request/response bodies)
41
+ */
42
+ export declare const getAuditControllerGetEntryUrl: (id: string) => string;
43
+ export declare const auditControllerGetEntry: (id: string, options?: RequestInit) => Promise<AuditEntryDetailResponseDto>;
44
+ /**
45
+ * @summary Complete all ACTIVE audit sessions matching the given metadata filter
46
+ */
47
+ export declare const getAuditControllerCompleteByMetadataUrl: () => string;
48
+ export declare const auditControllerCompleteByMetadata: (options?: RequestInit) => Promise<CompletedCountResponseDto>;
49
+ /**
50
+ * @summary Complete all ACTIVE audit sessions for a project (fallback cleanup)
51
+ */
52
+ export declare const getAuditControllerCompleteByProjectUrl: (projectId: string, params?: AuditControllerCompleteByProjectParams) => string;
53
+ export declare const auditControllerCompleteByProject: (projectId: string, params?: AuditControllerCompleteByProjectParams, options?: RequestInit) => Promise<CompletedCountResponseDto>;
@@ -0,0 +1,225 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.auditControllerCompleteByProject = exports.getAuditControllerCompleteByProjectUrl = exports.auditControllerCompleteByMetadata = exports.getAuditControllerCompleteByMetadataUrl = exports.auditControllerGetEntry = exports.getAuditControllerGetEntryUrl = exports.auditControllerListEntries = exports.getAuditControllerListEntriesUrl = exports.auditControllerGetSession = exports.getAuditControllerGetSessionUrl = exports.auditControllerClearSessions = exports.getAuditControllerClearSessionsUrl = exports.auditControllerListSessions = exports.getAuditControllerListSessionsUrl = exports.auditControllerExportPdf = exports.getAuditControllerExportPdfUrl = exports.auditControllerGetStatus = exports.getAuditControllerGetStatusUrl = void 0;
4
+ const custom_fetch_1 = require("../../custom-fetch");
5
+ /**
6
+ * @summary Check if audit mode is enabled
7
+ */
8
+ const getAuditControllerGetStatusUrl = () => {
9
+ return `/audit/status`;
10
+ };
11
+ exports.getAuditControllerGetStatusUrl = getAuditControllerGetStatusUrl;
12
+ const auditControllerGetStatus = async (options) => {
13
+ return (0, custom_fetch_1.customFetch)((0, exports.getAuditControllerGetStatusUrl)(), {
14
+ ...options,
15
+ method: 'GET'
16
+ });
17
+ };
18
+ exports.auditControllerGetStatus = auditControllerGetStatus;
19
+ /**
20
+ * @summary Export audit sessions as PDF report
21
+ */
22
+ const getAuditControllerExportPdfUrl = (params) => {
23
+ const normalizedParams = new URLSearchParams();
24
+ Object.entries(params || {}).forEach(([key, value]) => {
25
+ if (value === undefined)
26
+ return;
27
+ if (value === null) {
28
+ normalizedParams.append(key, 'null');
29
+ return;
30
+ }
31
+ if (Array.isArray(value)) {
32
+ for (const item of value) {
33
+ if (item === undefined || item === null)
34
+ continue;
35
+ normalizedParams.append(key, item.toString());
36
+ }
37
+ return;
38
+ }
39
+ normalizedParams.append(key, value.toString());
40
+ });
41
+ const stringifiedParams = normalizedParams.toString();
42
+ return stringifiedParams.length > 0 ? `/audit/export/pdf?${stringifiedParams}` : `/audit/export/pdf`;
43
+ };
44
+ exports.getAuditControllerExportPdfUrl = getAuditControllerExportPdfUrl;
45
+ const auditControllerExportPdf = async (params, options) => {
46
+ return (0, custom_fetch_1.customFetch)((0, exports.getAuditControllerExportPdfUrl)(params), {
47
+ ...options,
48
+ method: 'GET'
49
+ });
50
+ };
51
+ exports.auditControllerExportPdf = auditControllerExportPdf;
52
+ /**
53
+ * @summary List audit sessions (paginated)
54
+ */
55
+ const getAuditControllerListSessionsUrl = (params) => {
56
+ const normalizedParams = new URLSearchParams();
57
+ Object.entries(params || {}).forEach(([key, value]) => {
58
+ if (value === undefined)
59
+ return;
60
+ if (value === null) {
61
+ normalizedParams.append(key, 'null');
62
+ return;
63
+ }
64
+ if (Array.isArray(value)) {
65
+ for (const item of value) {
66
+ if (item === undefined || item === null)
67
+ continue;
68
+ normalizedParams.append(key, item.toString());
69
+ }
70
+ return;
71
+ }
72
+ normalizedParams.append(key, value.toString());
73
+ });
74
+ const stringifiedParams = normalizedParams.toString();
75
+ return stringifiedParams.length > 0 ? `/audit/sessions?${stringifiedParams}` : `/audit/sessions`;
76
+ };
77
+ exports.getAuditControllerListSessionsUrl = getAuditControllerListSessionsUrl;
78
+ const auditControllerListSessions = async (params, options) => {
79
+ return (0, custom_fetch_1.customFetch)((0, exports.getAuditControllerListSessionsUrl)(params), {
80
+ ...options,
81
+ method: 'GET'
82
+ });
83
+ };
84
+ exports.auditControllerListSessions = auditControllerListSessions;
85
+ /**
86
+ * @summary Delete all audit sessions (optionally by project)
87
+ */
88
+ const getAuditControllerClearSessionsUrl = (params) => {
89
+ const normalizedParams = new URLSearchParams();
90
+ Object.entries(params || {}).forEach(([key, value]) => {
91
+ if (value === undefined)
92
+ return;
93
+ if (value === null) {
94
+ normalizedParams.append(key, 'null');
95
+ return;
96
+ }
97
+ if (Array.isArray(value)) {
98
+ for (const item of value) {
99
+ if (item === undefined || item === null)
100
+ continue;
101
+ normalizedParams.append(key, item.toString());
102
+ }
103
+ return;
104
+ }
105
+ normalizedParams.append(key, value.toString());
106
+ });
107
+ const stringifiedParams = normalizedParams.toString();
108
+ return stringifiedParams.length > 0 ? `/audit/sessions?${stringifiedParams}` : `/audit/sessions`;
109
+ };
110
+ exports.getAuditControllerClearSessionsUrl = getAuditControllerClearSessionsUrl;
111
+ const auditControllerClearSessions = async (params, options) => {
112
+ return (0, custom_fetch_1.customFetch)((0, exports.getAuditControllerClearSessionsUrl)(params), {
113
+ ...options,
114
+ method: 'DELETE'
115
+ });
116
+ };
117
+ exports.auditControllerClearSessions = auditControllerClearSessions;
118
+ /**
119
+ * @summary Get audit session details
120
+ */
121
+ const getAuditControllerGetSessionUrl = (id) => {
122
+ return `/audit/sessions/${id}`;
123
+ };
124
+ exports.getAuditControllerGetSessionUrl = getAuditControllerGetSessionUrl;
125
+ const auditControllerGetSession = async (id, options) => {
126
+ return (0, custom_fetch_1.customFetch)((0, exports.getAuditControllerGetSessionUrl)(id), {
127
+ ...options,
128
+ method: 'GET'
129
+ });
130
+ };
131
+ exports.auditControllerGetSession = auditControllerGetSession;
132
+ /**
133
+ * @summary List entries for an audit session (paginated)
134
+ */
135
+ const getAuditControllerListEntriesUrl = (id, params) => {
136
+ const normalizedParams = new URLSearchParams();
137
+ Object.entries(params || {}).forEach(([key, value]) => {
138
+ if (value === undefined)
139
+ return;
140
+ if (value === null) {
141
+ normalizedParams.append(key, 'null');
142
+ return;
143
+ }
144
+ if (Array.isArray(value)) {
145
+ for (const item of value) {
146
+ if (item === undefined || item === null)
147
+ continue;
148
+ normalizedParams.append(key, item.toString());
149
+ }
150
+ return;
151
+ }
152
+ normalizedParams.append(key, value.toString());
153
+ });
154
+ const stringifiedParams = normalizedParams.toString();
155
+ return stringifiedParams.length > 0 ? `/audit/sessions/${id}/entries?${stringifiedParams}` : `/audit/sessions/${id}/entries`;
156
+ };
157
+ exports.getAuditControllerListEntriesUrl = getAuditControllerListEntriesUrl;
158
+ const auditControllerListEntries = async (id, params, options) => {
159
+ return (0, custom_fetch_1.customFetch)((0, exports.getAuditControllerListEntriesUrl)(id, params), {
160
+ ...options,
161
+ method: 'GET'
162
+ });
163
+ };
164
+ exports.auditControllerListEntries = auditControllerListEntries;
165
+ /**
166
+ * @summary Get full audit entry details (includes request/response bodies)
167
+ */
168
+ const getAuditControllerGetEntryUrl = (id) => {
169
+ return `/audit/entries/${id}`;
170
+ };
171
+ exports.getAuditControllerGetEntryUrl = getAuditControllerGetEntryUrl;
172
+ const auditControllerGetEntry = async (id, options) => {
173
+ return (0, custom_fetch_1.customFetch)((0, exports.getAuditControllerGetEntryUrl)(id), {
174
+ ...options,
175
+ method: 'GET'
176
+ });
177
+ };
178
+ exports.auditControllerGetEntry = auditControllerGetEntry;
179
+ /**
180
+ * @summary Complete all ACTIVE audit sessions matching the given metadata filter
181
+ */
182
+ const getAuditControllerCompleteByMetadataUrl = () => {
183
+ return `/audit/sessions/complete-by-metadata`;
184
+ };
185
+ exports.getAuditControllerCompleteByMetadataUrl = getAuditControllerCompleteByMetadataUrl;
186
+ const auditControllerCompleteByMetadata = async (options) => {
187
+ return (0, custom_fetch_1.customFetch)((0, exports.getAuditControllerCompleteByMetadataUrl)(), {
188
+ ...options,
189
+ method: 'POST'
190
+ });
191
+ };
192
+ exports.auditControllerCompleteByMetadata = auditControllerCompleteByMetadata;
193
+ /**
194
+ * @summary Complete all ACTIVE audit sessions for a project (fallback cleanup)
195
+ */
196
+ const getAuditControllerCompleteByProjectUrl = (projectId, params) => {
197
+ const normalizedParams = new URLSearchParams();
198
+ Object.entries(params || {}).forEach(([key, value]) => {
199
+ if (value === undefined)
200
+ return;
201
+ if (value === null) {
202
+ normalizedParams.append(key, 'null');
203
+ return;
204
+ }
205
+ if (Array.isArray(value)) {
206
+ for (const item of value) {
207
+ if (item === undefined || item === null)
208
+ continue;
209
+ normalizedParams.append(key, item.toString());
210
+ }
211
+ return;
212
+ }
213
+ normalizedParams.append(key, value.toString());
214
+ });
215
+ const stringifiedParams = normalizedParams.toString();
216
+ return stringifiedParams.length > 0 ? `/audit/sessions/complete-by-project/${projectId}?${stringifiedParams}` : `/audit/sessions/complete-by-project/${projectId}`;
217
+ };
218
+ exports.getAuditControllerCompleteByProjectUrl = getAuditControllerCompleteByProjectUrl;
219
+ const auditControllerCompleteByProject = async (projectId, params, options) => {
220
+ return (0, custom_fetch_1.customFetch)((0, exports.getAuditControllerCompleteByProjectUrl)(projectId, params), {
221
+ ...options,
222
+ method: 'POST'
223
+ });
224
+ };
225
+ exports.auditControllerCompleteByProject = auditControllerCompleteByProject;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Generated by orval v8.6.2 🍺
3
+ * Do not edit manually.
4
+ * LLM Gateway API
5
+ * Unified LLM proxy with provider management, credential resolution, concurrency, and usage tracking
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import type { HealthControllerReady200 } from '../../models';
9
+ /**
10
+ * @summary Basic health check (event-hub compatibility)
11
+ */
12
+ export declare const getHealthControllerCheckUrl: () => string;
13
+ export declare const healthControllerCheck: (options?: RequestInit) => Promise<void>;
14
+ /**
15
+ * @summary Liveness probe — is the process running?
16
+ */
17
+ export declare const getHealthControllerLiveUrl: () => string;
18
+ export declare const healthControllerLive: (options?: RequestInit) => Promise<void>;
19
+ /**
20
+ * @summary Readiness probe — is the service ready to accept traffic?
21
+ */
22
+ export declare const getHealthControllerReadyUrl: () => string;
23
+ export declare const healthControllerReady: (options?: RequestInit) => Promise<HealthControllerReady200>;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.healthControllerReady = exports.getHealthControllerReadyUrl = exports.healthControllerLive = exports.getHealthControllerLiveUrl = exports.healthControllerCheck = exports.getHealthControllerCheckUrl = void 0;
4
+ const custom_fetch_1 = require("../../custom-fetch");
5
+ /**
6
+ * @summary Basic health check (event-hub compatibility)
7
+ */
8
+ const getHealthControllerCheckUrl = () => {
9
+ return `/health`;
10
+ };
11
+ exports.getHealthControllerCheckUrl = getHealthControllerCheckUrl;
12
+ const healthControllerCheck = async (options) => {
13
+ return (0, custom_fetch_1.customFetch)((0, exports.getHealthControllerCheckUrl)(), {
14
+ ...options,
15
+ method: 'GET'
16
+ });
17
+ };
18
+ exports.healthControllerCheck = healthControllerCheck;
19
+ /**
20
+ * @summary Liveness probe — is the process running?
21
+ */
22
+ const getHealthControllerLiveUrl = () => {
23
+ return `/health/live`;
24
+ };
25
+ exports.getHealthControllerLiveUrl = getHealthControllerLiveUrl;
26
+ const healthControllerLive = async (options) => {
27
+ return (0, custom_fetch_1.customFetch)((0, exports.getHealthControllerLiveUrl)(), {
28
+ ...options,
29
+ method: 'GET'
30
+ });
31
+ };
32
+ exports.healthControllerLive = healthControllerLive;
33
+ /**
34
+ * @summary Readiness probe — is the service ready to accept traffic?
35
+ */
36
+ const getHealthControllerReadyUrl = () => {
37
+ return `/health/ready`;
38
+ };
39
+ exports.getHealthControllerReadyUrl = getHealthControllerReadyUrl;
40
+ const healthControllerReady = async (options) => {
41
+ return (0, custom_fetch_1.customFetch)((0, exports.getHealthControllerReadyUrl)(), {
42
+ ...options,
43
+ method: 'GET'
44
+ });
45
+ };
46
+ exports.healthControllerReady = healthControllerReady;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @summary Proxy chat completion request to LLM provider
3
+ */
4
+ export declare const getProxyControllerChatCompletionsUrl: () => string;
5
+ export declare const proxyControllerChatCompletions: (options?: RequestInit) => Promise<void>;
6
+ /**
7
+ * @summary Proxy completion request to LLM provider
8
+ */
9
+ export declare const getProxyControllerCompletionsUrl: () => string;
10
+ export declare const proxyControllerCompletions: (options?: RequestInit) => Promise<void>;
11
+ /**
12
+ * @summary Proxy embedding request to LLM provider
13
+ */
14
+ export declare const getProxyControllerEmbeddingsUrl: () => string;
15
+ export declare const proxyControllerEmbeddings: (options?: RequestInit) => Promise<void>;
16
+ /**
17
+ * @summary List available models (from gateway token context)
18
+ */
19
+ export declare const getProxyControllerListModelsUrl: () => string;
20
+ export declare const proxyControllerListModels: (options?: RequestInit) => Promise<void>;