@burdenoff/be-sdk 2026.623.1 → 2026.624.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/dist/{chunk-Z2423JIB.js → chunk-DZK5UGDA.js} +3 -3
- package/dist/{chunk-Z2423JIB.js.map → chunk-DZK5UGDA.js.map} +1 -1
- package/dist/{chunk-PHKK7725.js → chunk-UCLDHOZC.js} +100 -3
- package/dist/chunk-UCLDHOZC.js.map +1 -0
- package/dist/graph/index.js +3 -3
- package/dist/index-DgWLSDv2.d.ts +302 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -16
- package/dist/platform/index.d.ts +1 -1
- package/dist/platform/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-PHKK7725.js.map +0 -1
- package/dist/index-BQ1yJn1K.d.ts +0 -222
package/dist/index.js
CHANGED
|
@@ -10,22 +10,19 @@ export { RBACModule, createRBACDirective, createRBACDirectiveForLayer, createRBA
|
|
|
10
10
|
export { instrumentation_exports as Instrumentation } from './chunk-ACYGOENW.js';
|
|
11
11
|
import './chunk-REF7PANB.js';
|
|
12
12
|
export { middleware_exports as Middleware } from './chunk-2HANKZZM.js';
|
|
13
|
-
export { observability_exports as Observability } from './chunk-5LXDPGDH.js';
|
|
14
13
|
import { TenantNotificationsModule, NotificationsModule } from './chunk-IUL5TEKE.js';
|
|
15
14
|
export { tenant_notifications_exports as Notifications, NotificationsModule } from './chunk-IUL5TEKE.js';
|
|
16
|
-
export {
|
|
15
|
+
export { observability_exports as Observability } from './chunk-5LXDPGDH.js';
|
|
16
|
+
export { platform_exports as Platform } from './chunk-UCLDHOZC.js';
|
|
17
|
+
import { DatabaseModule } from './chunk-4OQRBSHM.js';
|
|
18
|
+
export { DatabaseModule } from './chunk-4OQRBSHM.js';
|
|
17
19
|
export { export_exports as Export } from './chunk-UJI2S556.js';
|
|
18
20
|
export { feature_flags_exports as FeatureFlags } from './chunk-YEA4BZOL.js';
|
|
19
|
-
import { GraphModule } from './chunk-Z2423JIB.js';
|
|
20
|
-
export { graph_exports as Graph, GraphModule } from './chunk-Z2423JIB.js';
|
|
21
|
-
import './chunk-5CESUKWC.js';
|
|
22
|
-
import { EventsModule } from './chunk-H3AXO5SY.js';
|
|
23
|
-
export { event_queue_exports as EventQueue, EventsModule } from './chunk-H3AXO5SY.js';
|
|
24
|
-
import './chunk-OHEPNJ2X.js';
|
|
25
|
-
import { QueueType, EventQueueFactory } from './chunk-MQCVQCFA.js';
|
|
26
21
|
export { graphql_exports as GraphQL } from './chunk-X4NELQLV.js';
|
|
27
22
|
import './chunk-QLVKMWFA.js';
|
|
28
|
-
import './chunk-
|
|
23
|
+
import { GraphModule } from './chunk-DZK5UGDA.js';
|
|
24
|
+
export { graph_exports as Graph, GraphModule } from './chunk-DZK5UGDA.js';
|
|
25
|
+
import './chunk-5CESUKWC.js';
|
|
29
26
|
export { i18n_exports as I18n, createTranslator, getLanguage, getLocale, hasI18n, t } from './chunk-ULFFX3YE.js';
|
|
30
27
|
export { init_exports as Init } from './chunk-F5BPKP75.js';
|
|
31
28
|
import { GatewayClient, GatewayError, GatewayErrorType } from './chunk-OWUVYM2S.js';
|
|
@@ -35,20 +32,23 @@ export { layer_exports as Layer } from './chunk-UIMPJNWC.js';
|
|
|
35
32
|
import './chunk-VFCMR5GX.js';
|
|
36
33
|
import { ContextManager } from './chunk-DXX6C6X6.js';
|
|
37
34
|
export { ContextManager } from './chunk-DXX6C6X6.js';
|
|
38
|
-
import { AuthModule } from './chunk-SS4XWRYR.js';
|
|
39
|
-
export { AuthModule } from './chunk-SS4XWRYR.js';
|
|
40
|
-
export { utils_exports as Utils } from './chunk-B7I4TABG.js';
|
|
41
35
|
export { cache_exports as Cache } from './chunk-UYE4IEPT.js';
|
|
42
36
|
export { captcha_exports as Captcha, isCaptchaEnabled, verifyCaptcha, verifyCaptchaIfEnabled } from './chunk-YMZEUTD2.js';
|
|
43
37
|
export { createInternalClient, createInternalClientForTenant, createInternalClientForWorkspaces } from './chunk-VI4VSNTI.js';
|
|
44
|
-
import {
|
|
45
|
-
export {
|
|
38
|
+
import { AuthModule } from './chunk-SS4XWRYR.js';
|
|
39
|
+
export { AuthModule } from './chunk-SS4XWRYR.js';
|
|
40
|
+
export { utils_exports as Utils } from './chunk-B7I4TABG.js';
|
|
46
41
|
import { APIError, NetworkError, TimeoutError, ValidationError } from './chunk-EZ4PKRUK.js';
|
|
47
42
|
export { DEFAULT_CIRCUIT_BREAKER_CONFIG, DEFAULT_GATEWAY_RETRY_CONFIG, DEFAULT_GATEWAY_ROUTING, DEFAULT_LAYER_RESOURCES, DEFAULT_LAYER_STREAMS } from './chunk-YFOHAHZE.js';
|
|
43
|
+
export { dataloader_exports as DataLoader } from './chunk-NUB5GQTU.js';
|
|
44
|
+
import { EventsModule } from './chunk-H3AXO5SY.js';
|
|
45
|
+
export { event_queue_exports as EventQueue, EventsModule } from './chunk-H3AXO5SY.js';
|
|
46
|
+
import './chunk-OHEPNJ2X.js';
|
|
47
|
+
import { QueueType, EventQueueFactory } from './chunk-MQCVQCFA.js';
|
|
48
|
+
import './chunk-MHNA7IS7.js';
|
|
48
49
|
import { logger } from './chunk-CBZNP6RF.js';
|
|
49
50
|
export { logger_exports as Logger } from './chunk-CBZNP6RF.js';
|
|
50
51
|
export { crypto_exports as Crypto } from './chunk-SBS4S2PJ.js';
|
|
51
|
-
export { dataloader_exports as DataLoader } from './chunk-NUB5GQTU.js';
|
|
52
52
|
import { __name } from './chunk-XE4OXN2W.js';
|
|
53
53
|
import { GraphQLClient } from 'graphql-request';
|
|
54
54
|
|
package/dist/platform/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { B as BreakerConfig, C as CacheVersionRedis,
|
|
1
|
+
export { B as BreakerConfig, a as BuildConnectionOptions, C as CacheVersionRedis, b as CircuitBreakerOpenError, c as ClampLimitOptions, d as ConnectionEdge, e as ConnectionResult, f as CursorPaginationInput, g as CursorPayload, h as CursorPayloadValue, D as DEFAULT_GRAPHQL_PAGE_LIMIT, j as DataLoaderLike, k as DropOldOptions, E as EnsureMonthlyOptions, H as HttpClientConfig, l as HttpClientInit, L as LLMProviderAdapter, m as LLMRequest, n as LLMResponse, o as LLMRouter, p as LLMRouterOptions, q as LeaderLockOptions, r as LeaderLockRedis, s as LeaderLockResult, t as LoaderBuilder, u as LoaderMap, M as MAX_GRAPHQL_PAGE_LIMIT, N as NormalizedCursorPagination, v as NormalizedOffsetPagination, O as OffsetPageResult, w as OffsetPaginationInput, P as PageInfo, x as PaginateInput, y as PaginateResult, z as PrismaModelLike, A as PrismaRawClient, R as RateLimitInput, F as RateLimitRedis, G as RateLimitResult, I as ReferenceObject, J as RetryConfig, _ as __resetHttpClientBreakers, K as buildCacheKey, Q as buildConnection, S as buildLoaders, T as buildOffsetPage, U as clampGraphqlLimit, V as clampLimit, W as clampOffset, X as createHttpClient, Y as decodeCursor, Z as dropOldPartitions, $ as encodeCursor, a0 as ensureMonthlyPartitions, a1 as getNamespaceVersion, a2 as httpClient, a3 as invalidateNamespace, a4 as monthlyPartitionName, a5 as normalizeCursorPagination, a6 as normalizeOffsetPagination, a7 as paginate, a8 as rateLimitIncr, a9 as resolveReferenceLoader, aa as withLeaderLock } from '../index-DgWLSDv2.js';
|
package/dist/platform/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CircuitBreakerOpenError, LLMRouter, __resetHttpClientBreakers, buildCacheKey, buildLoaders, clampLimit, createHttpClient, dropOldPartitions, ensureMonthlyPartitions, getNamespaceVersion, httpClient, invalidateNamespace, monthlyPartitionName, paginate, rateLimitIncr, resolveReferenceLoader, withLeaderLock } from '../chunk-
|
|
1
|
+
export { CircuitBreakerOpenError, DEFAULT_GRAPHQL_PAGE_LIMIT, LLMRouter, MAX_GRAPHQL_PAGE_LIMIT, __resetHttpClientBreakers, buildCacheKey, buildConnection, buildLoaders, buildOffsetPage, clampGraphqlLimit, clampLimit, clampOffset, createHttpClient, decodeCursor, dropOldPartitions, encodeCursor, ensureMonthlyPartitions, getNamespaceVersion, httpClient, invalidateNamespace, monthlyPartitionName, normalizeCursorPagination, normalizeOffsetPagination, paginate, rateLimitIncr, resolveReferenceLoader, withLeaderLock } from '../chunk-UCLDHOZC.js';
|
|
2
2
|
import '../chunk-CBZNP6RF.js';
|
|
3
3
|
import '../chunk-XE4OXN2W.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/be-sdk",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.624.1",
|
|
4
4
|
"description": "Backend SDK for Burdenoff products providing unified access to notifications, RBAC, activity tracking, usage monitoring, and more",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/platform/index.ts","../src/platform/httpClient.ts","../src/platform/leaderLock.ts","../src/platform/rateLimit.ts","../src/platform/paginator.ts","../src/platform/dataLoaderFactory.ts","../src/platform/cacheInvalidation.ts","../src/platform/pgPartition.ts","../src/platform/llmClient.ts"],"names":["breakers","Map","hostOf","url","URL","host","getBreaker","b","get","failures","openedAt","state","set","defaultRetryOn","status","jitter","delay","Math","floor","random","sleep","ms","Promise","r","setTimeout","CircuitBreakerOpenError","Error","name","__resetHttpClientBreakers","clear","executeOnce","init","timeoutMs","signal","AbortSignal","timeout","fetch","httpClient","config","fullUrl","baseUrl","test","replace","breaker","breakerThreshold","threshold","cooldownMs","Date","now","logger","info","attempts","retry","initialDelay","initialDelayMs","maxDelay","maxDelayMs","retryOn","defaultTimeoutMs","headers","defaultHeaders","lastErr","attempt","response","warn","min","err","error","String","createHttpClient","RELEASE_LUA","RENEW_LUA","generateToken","toString","slice","process","pid","withLeaderLock","redis","fn","options","key","token","ttlMs","renewMs","max","ttlSeconds","ceil","acquired","stopped","renewTimer","setInterval","eval","catch","unref","result","clearInterval","rateLimitIncr","input","fullKey","count","incr","pexpire","windowMs","ttl","pttl","resetAt","remaining","limit","allowed","clampLimit","opts","def","defaultLimit","maxLimit","minLimit","Number","isNaN","paginate","model","take","undefined","items","findMany","skip","cursor","id","where","orderBy","hasMore","length","trimmed","nextCursor","buildLoaders","ctx","builder","resolveReferenceLoader","loaderName","keyField","reference","loader","loaders","load","VERSION_PREFIX","getNamespaceVersion","namespace","v","n","parseInt","isFinite","buildCacheKey","parts","ver","join","invalidateNamespace","pad2","monthlyPartitionName","table","year","month","ensureMonthlyPartitions","prisma","created","cur","UTC","from","getUTCFullYear","getUTCMonth","end","to","y","m","next","partition","lower","upper","$executeRawUnsafe","push","setUTCMonth","dropOldPartitions","rows","$queryRawUnsafe","dropped","cutoffYear","beforeDate","cutoffMonth","row","partitionRe","exec","partition_name","mo","DEFAULTS","maxAttempts","maxOutputTokensCap","LLMRouter","adapters","register","adapter","resolveChain","envChain","env","trim","split","map","s","filter","Boolean","Array","keys","complete","req","cappedReq","maxTokens","chain","providerName","ctrl","AbortController","t","abort","provider","clearTimeout"],"mappings":";;;;AAAA,IAAA,gBAAA,GAAA;;;;;;;;;;;;;;;;;;;;;;ACgDA,IAAMA,QAAAA,uBAAeC,GAAAA,EAAAA;AAErB,SAASC,OAAOC,GAAAA,EAAW;AACzB,EAAA,IAAI;AACF,IAAA,OAAO,IAAIC,GAAAA,CAAID,GAAAA,CAAAA,CAAKE,IAAAA;EACtB,CAAA,CAAA,MAAQ;AACN,IAAA,OAAOF,GAAAA;AACT,EAAA;AACF;AANSD,MAAAA,CAAAA,MAAAA,EAAAA,QAAAA,CAAAA;AAQT,SAASI,WAAWD,IAAAA,EAAY;AAC9B,EAAA,IAAIE,CAAAA,GAAIP,QAAAA,CAASQ,GAAAA,CAAIH,IAAAA,CAAAA;AACrB,EAAA,IAAI,CAACE,CAAAA,EAAG;AACNA,IAAAA,CAAAA,GAAI;MAAEE,QAAAA,EAAU,CAAA;MAAGC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AAAA,CAAAA,CAAAA;AACrB,QAAA;MACF,CAAA,SAAA;AACE4M,QAAAA,YAAAA,CAAaH,CAAAA,CAAAA;AACf,MAAA;AACF,IAAA;AACA,IAAA,MAAM5J,OAAAA,YAAmBnC,QAAQmC,OAAAA,GAAU,IAAInC,MAAM,CAAA,oBAAA,EAAuB,IAAA,CAAKqF,IAAAA,CAAKiF,WAAW,CAAA,SAAA,CAAW,CAAA;AAC9G,EAAA;AACF","file":"chunk-PHKK7725.js","sourcesContent":["/**\n * @burdenoff/be-sdk/platform\n *\n * Reusable platform primitives consumed fleet-wide by Burdenoff svcs.\n */\nexport { httpClient, createHttpClient, CircuitBreakerOpenError, __resetHttpClientBreakers } from './httpClient.js';\nexport type { HttpClientConfig, HttpClientInit, RetryConfig, BreakerConfig } from './httpClient.js';\n\nexport { withLeaderLock } from './leaderLock.js';\nexport type { LeaderLockRedis, LeaderLockOptions, LeaderLockResult } from './leaderLock.js';\n\nexport { rateLimitIncr } from './rateLimit.js';\nexport type { RateLimitRedis, RateLimitInput, RateLimitResult } from './rateLimit.js';\n\nexport { clampLimit, paginate } from './paginator.js';\nexport type { ClampLimitOptions, PaginateInput, PaginateResult, PrismaModelLike } from './paginator.js';\n\nexport { buildLoaders, resolveReferenceLoader } from './dataLoaderFactory.js';\nexport type { DataLoaderLike, LoaderMap, LoaderBuilder, ReferenceObject } from './dataLoaderFactory.js';\n\nexport { buildCacheKey, getNamespaceVersion, invalidateNamespace } from './cacheInvalidation.js';\nexport type { CacheVersionRedis } from './cacheInvalidation.js';\n\nexport { monthlyPartitionName, ensureMonthlyPartitions, dropOldPartitions } from './pgPartition.js';\nexport type { PrismaRawClient, EnsureMonthlyOptions, DropOldOptions } from './pgPartition.js';\n\nexport { LLMRouter } from './llmClient.js';\nexport type { LLMRequest, LLMResponse, LLMProviderAdapter, LLMRouterOptions } from './llmClient.js';\n","/**\n * httpClient — hardened wrapper around global `fetch` with:\n * - per-request AbortSignal.timeout (default 5s)\n * - retries (default 3) with exponential backoff + full jitter\n * - per-host circuit breaker (opens at 5 consecutive 5xx, half-open after 30s)\n * - structured logging via existing be-sdk logger\n *\n * No required upstream dependency — we use the runtime `fetch` so the same\n * code path works on Bun and Node 20+. Consumers may pass an undici Agent\n * via `init.dispatcher` if they need keep-alive pooling; we forward unknown\n * init fields through.\n */\n\nimport { logger } from '../logger/index.js';\n\nexport interface RetryConfig {\n /** Total attempts including the first (default 3) */\n attempts?: number;\n /** Initial backoff in ms (default 100) */\n initialDelayMs?: number;\n /** Maximum backoff in ms (default 2000) */\n maxDelayMs?: number;\n /** Status codes that trigger a retry (default 408, 425, 429, 5xx) */\n retryOn?: (status: number) => boolean;\n}\n\nexport interface BreakerConfig {\n /** Consecutive 5xx failures to open breaker (default 5) */\n threshold?: number;\n /** Time in ms before HALF_OPEN trial (default 30000) */\n cooldownMs?: number;\n}\n\nexport interface HttpClientConfig {\n baseUrl?: string;\n defaultTimeoutMs?: number;\n retry?: RetryConfig;\n breaker?: BreakerConfig;\n /** Default headers merged into every request */\n defaultHeaders?: Record<string, string>;\n}\n\ninterface BreakerState {\n failures: number;\n openedAt: number | null;\n state: 'CLOSED' | 'OPEN' | 'HALF_OPEN';\n}\n\nconst breakers = new Map<string, BreakerState>();\n\nfunction hostOf(url: string): string {\n try {\n return new URL(url).host;\n } catch {\n return url;\n }\n}\n\nfunction getBreaker(host: string): BreakerState {\n let b = breakers.get(host);\n if (!b) {\n b = { failures: 0, openedAt: null, state: 'CLOSED' };\n breakers.set(host, b);\n }\n return b;\n}\n\nfunction defaultRetryOn(status: number): boolean {\n return status === 408 || status === 425 || status === 429 || (status >= 500 && status <= 599);\n}\n\nfunction jitter(delay: number): number {\n return Math.floor(Math.random() * delay);\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((r) => setTimeout(r, ms));\n}\n\nexport class CircuitBreakerOpenError extends Error {\n constructor(host: string) {\n super(`circuit breaker OPEN for host=${host}`);\n this.name = 'CircuitBreakerOpenError';\n }\n}\n\nexport interface HttpClientInit extends RequestInit {\n timeoutMs?: number;\n retry?: RetryConfig;\n}\n\n/**\n * Reset all breaker state (test helper).\n */\nexport function __resetHttpClientBreakers(): void {\n breakers.clear();\n}\n\nasync function executeOnce(url: string, init: HttpClientInit, timeoutMs: number): Promise<Response> {\n const signal = init.signal ?? AbortSignal.timeout(timeoutMs);\n return fetch(url, { ...init, signal });\n}\n\nexport async function httpClient(\n url: string,\n init: HttpClientInit = {},\n config: HttpClientConfig = {}\n): Promise<Response> {\n const fullUrl =\n config.baseUrl && !/^https?:\\/\\//i.test(url)\n ? `${config.baseUrl.replace(/\\/$/, '')}/${url.replace(/^\\//, '')}`\n : url;\n const host = hostOf(fullUrl);\n const breaker = getBreaker(host);\n const breakerThreshold = config.breaker?.threshold ?? 5;\n const cooldownMs = config.breaker?.cooldownMs ?? 30_000;\n\n if (breaker.state === 'OPEN') {\n if (breaker.openedAt && Date.now() - breaker.openedAt >= cooldownMs) {\n breaker.state = 'HALF_OPEN';\n logger.info('httpClient.breaker.halfOpen', { host });\n } else {\n throw new CircuitBreakerOpenError(host);\n }\n }\n\n const attempts = init.retry?.attempts ?? config.retry?.attempts ?? 3;\n const initialDelay = init.retry?.initialDelayMs ?? config.retry?.initialDelayMs ?? 100;\n const maxDelay = init.retry?.maxDelayMs ?? config.retry?.maxDelayMs ?? 2_000;\n const retryOn = init.retry?.retryOn ?? config.retry?.retryOn ?? defaultRetryOn;\n const timeoutMs = init.timeoutMs ?? config.defaultTimeoutMs ?? 5_000;\n\n const headers = { ...(config.defaultHeaders ?? {}), ...((init.headers as Record<string, string> | undefined) ?? {}) };\n\n let lastErr: unknown;\n for (let attempt = 1; attempt <= attempts; attempt++) {\n try {\n const response = await executeOnce(fullUrl, { ...init, headers }, timeoutMs);\n if (response.status >= 500) {\n breaker.failures += 1;\n if (breaker.failures >= breakerThreshold) {\n breaker.state = 'OPEN';\n breaker.openedAt = Date.now();\n logger.warn('httpClient.breaker.open', { host, failures: breaker.failures });\n }\n if (attempt < attempts && retryOn(response.status)) {\n const delay = Math.min(initialDelay * 2 ** (attempt - 1), maxDelay);\n await sleep(jitter(delay));\n continue;\n }\n return response;\n }\n // success path\n breaker.failures = 0;\n if (breaker.state === 'HALF_OPEN') {\n breaker.state = 'CLOSED';\n breaker.openedAt = null;\n logger.info('httpClient.breaker.closed', { host });\n }\n if (attempt < attempts && retryOn(response.status)) {\n const delay = Math.min(initialDelay * 2 ** (attempt - 1), maxDelay);\n await sleep(jitter(delay));\n continue;\n }\n return response;\n } catch (err) {\n lastErr = err;\n breaker.failures += 1;\n if (breaker.failures >= breakerThreshold) {\n breaker.state = 'OPEN';\n breaker.openedAt = Date.now();\n logger.warn('httpClient.breaker.open', { host, failures: breaker.failures });\n }\n if (attempt >= attempts) break;\n const delay = Math.min(initialDelay * 2 ** (attempt - 1), maxDelay);\n await sleep(jitter(delay));\n }\n }\n\n logger.error('httpClient.exhausted', { url: fullUrl, attempts, host });\n throw lastErr instanceof Error ? lastErr : new Error(`httpClient failed: ${String(lastErr)}`);\n}\n\nexport function createHttpClient(\n config: HttpClientConfig = {}\n): (url: string, init?: HttpClientInit) => Promise<Response> {\n return (url: string, init: HttpClientInit = {}) => httpClient(url, init, config);\n}\n","/**\n * withLeaderLock — Redis-based leader election.\n *\n * Acquires `SET NX EX` on `besdk:leader:{name}`. If acquired, runs fn() and\n * auto-renews the lease every `renewMs` (default ttlMs/3). On exit (success\n * or throw) the holder DELs the key only if it still owns it (token check\n * via a Redis LUA script — Redis-side, NOT JS eval).\n * If the lock cannot be acquired, fn() is NOT called and the function\n * resolves with `{ acquired: false }`.\n *\n * Redis client is duck-typed (ioredis-compatible) so consumers can pass\n * either ioredis or the be-sdk cache provider's underlying client.\n */\n\nimport { logger } from '../logger/index.js';\n\nexport interface LeaderLockRedis {\n /** ioredis: set(key, val, 'EX', seconds, 'NX') -> 'OK' | null */\n set(key: string, value: string, ex: 'EX', seconds: number, nx: 'NX'): Promise<'OK' | null>;\n /** Redis LUA EVAL for compare-and-delete / compare-and-renew (server-side script) */\n eval(script: string, numKeys: number, ...args: string[]): Promise<unknown>;\n}\n\nexport interface LeaderLockOptions {\n ttlMs: number;\n renewMs?: number;\n}\n\nexport interface LeaderLockResult<T> {\n acquired: boolean;\n result?: T;\n}\n\nconst RELEASE_LUA = `\nif redis.call(\"get\", KEYS[1]) == ARGV[1] then\n return redis.call(\"del\", KEYS[1])\nelse\n return 0\nend\n`;\n\nconst RENEW_LUA = `\nif redis.call(\"get\", KEYS[1]) == ARGV[1] then\n return redis.call(\"pexpire\", KEYS[1], ARGV[2])\nelse\n return 0\nend\n`;\n\nfunction generateToken(): string {\n return `${Date.now()}-${Math.random().toString(36).slice(2)}-${process.pid}`;\n}\n\nexport async function withLeaderLock<T>(\n redis: LeaderLockRedis,\n name: string,\n fn: () => Promise<T>,\n options: LeaderLockOptions\n): Promise<LeaderLockResult<T>> {\n const key = `besdk:leader:${name}`;\n const token = generateToken();\n const ttlMs = options.ttlMs;\n const renewMs = options.renewMs ?? Math.max(1_000, Math.floor(ttlMs / 3));\n const ttlSeconds = Math.max(1, Math.ceil(ttlMs / 1000));\n\n const acquired = await redis.set(key, token, 'EX', ttlSeconds, 'NX');\n if (acquired !== 'OK') {\n return { acquired: false };\n }\n\n logger.info('leaderLock.acquired', { name, token, ttlMs });\n\n let stopped = false;\n const renewTimer = setInterval(() => {\n if (stopped) return;\n redis.eval(RENEW_LUA, 1, key, token, String(ttlMs)).catch((err: unknown) => {\n logger.warn('leaderLock.renew.failed', { name, err: String(err) });\n });\n }, renewMs);\n // Don't keep the process alive just for this timer.\n if (typeof (renewTimer as unknown as { unref?: () => void }).unref === 'function') {\n (renewTimer as unknown as { unref: () => void }).unref();\n }\n\n try {\n const result = await fn();\n return { acquired: true, result };\n } finally {\n stopped = true;\n clearInterval(renewTimer);\n try {\n await redis.eval(RELEASE_LUA, 1, key, token);\n logger.info('leaderLock.released', { name, token });\n } catch (err) {\n logger.warn('leaderLock.release.failed', { name, err: String(err) });\n }\n }\n}\n","/**\n * rateLimitIncr — atomic INCR-based rate limit using EXPIRE NX.\n *\n * Strategy:\n * 1. INCR key\n * 2. If returned value === 1 (i.e. first increment), EXPIRE key with windowMs\n * 3. Compute remaining + resetAt\n *\n * This is two round-trips in the worst case. A future Lua/EVALSHA variant\n * can collapse it into a single round-trip; the public API is stable.\n *\n * Returns `allowed=false` if `count > limit`. The key is `besdk:rl:{key}`.\n */\n\nexport interface RateLimitRedis {\n incr(key: string): Promise<number>;\n pexpire(key: string, ms: number): Promise<number | 'OK'>;\n pttl(key: string): Promise<number>;\n}\n\nexport interface RateLimitInput {\n key: string;\n limit: number;\n windowMs: number;\n}\n\nexport interface RateLimitResult {\n allowed: boolean;\n count: number;\n remaining: number;\n resetAt: number;\n}\n\nexport async function rateLimitIncr(redis: RateLimitRedis, input: RateLimitInput): Promise<RateLimitResult> {\n const fullKey = `besdk:rl:${input.key}`;\n const count = await redis.incr(fullKey);\n if (count === 1) {\n await redis.pexpire(fullKey, input.windowMs);\n }\n let ttl = -1;\n try {\n ttl = await redis.pttl(fullKey);\n } catch {\n ttl = input.windowMs;\n }\n const resetAt = Date.now() + (ttl > 0 ? ttl : input.windowMs);\n const remaining = Math.max(0, input.limit - count);\n return {\n allowed: count <= input.limit,\n count,\n remaining,\n resetAt,\n };\n}\n","/**\n * Paginator — Relay-style cursor pagination + safe limit clamping.\n *\n * Use `clampLimit` at resolver entry to enforce sane defaults/maxes.\n * Use `paginate` to translate a Relay-style { first, after } into a\n * Prisma-ready { take, skip, cursor } and return a connection-shaped\n * result.\n */\n\nexport interface ClampLimitOptions {\n defaultLimit?: number;\n maxLimit?: number;\n minLimit?: number;\n}\n\nexport function clampLimit(input: number | undefined | null, opts: ClampLimitOptions = {}): number {\n const def = opts.defaultLimit ?? 50;\n const max = opts.maxLimit ?? 200;\n const min = opts.minLimit ?? 1;\n if (input == null || Number.isNaN(input)) return def;\n return Math.min(Math.max(Math.floor(input), min), max);\n}\n\nexport interface PaginateInput<TWhere, TOrderBy> {\n take?: number | null;\n cursor?: string | null;\n where?: TWhere;\n orderBy?: TOrderBy;\n}\n\nexport interface PaginateResult<TItem> {\n items: TItem[];\n hasMore: boolean;\n nextCursor: string | null;\n}\n\nexport interface PrismaModelLike<TItem, TWhere, TOrderBy> {\n findMany(args: {\n take?: number;\n skip?: number;\n cursor?: { id: string };\n where?: TWhere;\n orderBy?: TOrderBy;\n }): Promise<TItem[]>;\n}\n\nexport async function paginate<TItem extends { id: string }, TWhere = unknown, TOrderBy = unknown>(\n model: PrismaModelLike<TItem, TWhere, TOrderBy>,\n input: PaginateInput<TWhere, TOrderBy>,\n opts: ClampLimitOptions = {}\n): Promise<PaginateResult<TItem>> {\n const take = clampLimit(input.take ?? undefined, opts);\n // fetch +1 to detect hasMore\n const items = await model.findMany({\n take: take + 1,\n skip: input.cursor ? 1 : 0,\n cursor: input.cursor ? { id: input.cursor } : undefined,\n where: input.where,\n orderBy: input.orderBy,\n });\n const hasMore = items.length > take;\n const trimmed = hasMore ? items.slice(0, take) : items;\n const nextCursor = hasMore && trimmed.length > 0 ? (trimmed[trimmed.length - 1] as { id: string }).id : null;\n return { items: trimmed, hasMore, nextCursor };\n}\n","/**\n * DataLoaderFactory — per-request DataLoader collection.\n *\n * Each GraphQL request creates a fresh loader set scoped to its context\n * (db, workspaceId, requestId). Loaders are addressed by name and reused\n * within the request to coalesce N+1 fan-outs into a single batched query.\n *\n * Also ships `resolveReferenceLoader` — a convenience for Apollo Federation\n * `__resolveReference` resolvers so entity hydration stays N+1-free.\n *\n * This module is intentionally framework-agnostic; consumers may pair it\n * with the existing `SimpleDataLoader` in `src/dataloader/index.ts` or the\n * upstream `dataloader` npm package.\n */\n\nexport interface DataLoaderLike<K, V> {\n load(key: K): Promise<V>;\n loadMany(keys: readonly K[]): Promise<(V | Error)[]>;\n clear(key: K): this;\n clearAll(): this;\n prime(key: K, value: V): this;\n}\n\nexport type LoaderMap = Record<string, DataLoaderLike<unknown, unknown>>;\n\nexport type LoaderBuilder<Ctx, M extends LoaderMap> = (ctx: Ctx) => M;\n\n/**\n * Build a fresh loader collection from a context.\n *\n * @example\n * const loaders = buildLoaders(ctx, (c) => ({\n * userById: createSimpleLoader(async ids => c.db.user.findMany({ where: { id: { in: [...ids] } } }), u => u.id),\n * tagById: createSimpleLoader(...),\n * }));\n * await loaders.userById.load('user-123');\n */\nexport function buildLoaders<Ctx, M extends LoaderMap>(ctx: Ctx, builder: LoaderBuilder<Ctx, M>): M {\n return builder(ctx);\n}\n\n/**\n * `__resolveReference` helper for Apollo Federation.\n *\n * Given a context that contains a `loaders` map, returns a resolver\n * function bound to a specific loader name. Field references shaped as\n * `{ id: string }` (or `{ __keyField: string }`) are forwarded to\n * `loader.load(...)`.\n */\nexport interface ReferenceObject {\n id?: string;\n [key: string]: unknown;\n}\n\nexport function resolveReferenceLoader<T, Ctx extends { loaders: LoaderMap }>(\n loaderName: string,\n keyField: string = 'id'\n): (reference: ReferenceObject, ctx: Ctx) => Promise<T | null> {\n return async (reference, ctx) => {\n const loader = ctx.loaders[loaderName] as DataLoaderLike<string, T> | undefined;\n if (!loader) {\n throw new Error(`resolveReferenceLoader: loader \"${loaderName}\" not found on ctx.loaders`);\n }\n const key = reference[keyField];\n if (typeof key !== 'string') {\n return null;\n }\n return loader.load(key);\n };\n}\n","/**\n * Versioned-key cache invalidation helper.\n *\n * Pattern:\n * - Store `v:{namespace}` integer in Redis\n * - Compose keys as `${namespace}:v${ver}:${rest}`\n * - Invalidate via INCR `v:{namespace}` — no KEYS / SCAN required\n *\n * Use this instead of cacheClearPattern() for Azure Managed Redis (O(N)\n * blocking on KEYS is unsafe in prod).\n */\n\nexport interface CacheVersionRedis {\n get(key: string): Promise<string | null>;\n incr(key: string): Promise<number>;\n}\n\nconst VERSION_PREFIX = 'besdk:cv:';\n\nexport async function getNamespaceVersion(redis: CacheVersionRedis, namespace: string): Promise<number> {\n const v = await redis.get(`${VERSION_PREFIX}${namespace}`);\n if (!v) return 1;\n const n = Number.parseInt(v, 10);\n return Number.isFinite(n) && n > 0 ? n : 1;\n}\n\nexport async function buildCacheKey(redis: CacheVersionRedis, namespace: string, ...parts: string[]): Promise<string> {\n const ver = await getNamespaceVersion(redis, namespace);\n return `${namespace}:v${ver}:${parts.join(':')}`;\n}\n\nexport async function invalidateNamespace(redis: CacheVersionRedis, namespace: string): Promise<number> {\n return redis.incr(`${VERSION_PREFIX}${namespace}`);\n}\n","/**\n * PG declarative partition + retention DSL.\n *\n * Helpers:\n * - ensureMonthlyPartitions(prisma, { table, from, to })\n * - dropOldPartitions(prisma, { table, beforeDate })\n *\n * Used by retention jobs / migrations to keep append-only tables\n * (ActivityLog, Message, TrackingEvent, ApplicationUsage, AuditLog)\n * bounded. Caller is responsible for ensuring the parent table is\n * already declared as PARTITION BY RANGE (created_at).\n */\n\nexport interface PrismaRawClient {\n $executeRawUnsafe(query: string, ...values: unknown[]): Promise<unknown>;\n $queryRawUnsafe<T = unknown>(query: string, ...values: unknown[]): Promise<T>;\n}\n\nfunction pad2(n: number): string {\n return n < 10 ? `0${n}` : `${n}`;\n}\n\nexport function monthlyPartitionName(table: string, year: number, month: number): string {\n return `${table}_y${year}m${pad2(month)}`;\n}\n\nexport interface EnsureMonthlyOptions {\n table: string;\n from: Date;\n to: Date;\n}\n\nexport async function ensureMonthlyPartitions(prisma: PrismaRawClient, opts: EnsureMonthlyOptions): Promise<string[]> {\n const created: string[] = [];\n const cur = new Date(Date.UTC(opts.from.getUTCFullYear(), opts.from.getUTCMonth(), 1));\n const end = new Date(Date.UTC(opts.to.getUTCFullYear(), opts.to.getUTCMonth(), 1));\n while (cur <= end) {\n const y = cur.getUTCFullYear();\n const m = cur.getUTCMonth() + 1;\n const next = new Date(Date.UTC(y, m, 1));\n const partition = monthlyPartitionName(opts.table, y, m);\n const lower = `${y}-${pad2(m)}-01`;\n const upper = `${next.getUTCFullYear()}-${pad2(next.getUTCMonth() + 1)}-01`;\n await prisma.$executeRawUnsafe(\n `CREATE TABLE IF NOT EXISTS \"${partition}\" PARTITION OF \"${opts.table}\" FOR VALUES FROM ('${lower}') TO ('${upper}');`\n );\n created.push(partition);\n cur.setUTCMonth(cur.getUTCMonth() + 1);\n }\n return created;\n}\n\nexport interface DropOldOptions {\n table: string;\n beforeDate: Date;\n}\n\ninterface PartitionRow {\n partition_name: string;\n}\n\nexport async function dropOldPartitions(prisma: PrismaRawClient, opts: DropOldOptions): Promise<string[]> {\n // Find inherited tables of the parent, parse year/month from suffix, drop ones before threshold.\n const rows = await prisma.$queryRawUnsafe<PartitionRow[]>(\n `SELECT child.relname AS partition_name\n FROM pg_inherits\n JOIN pg_class parent ON pg_inherits.inhparent = parent.oid\n JOIN pg_class child ON pg_inherits.inhrelid = child.oid\n WHERE parent.relname = $1`,\n opts.table\n );\n const dropped: string[] = [];\n const cutoffYear = opts.beforeDate.getUTCFullYear();\n const cutoffMonth = opts.beforeDate.getUTCMonth() + 1;\n for (const row of rows) {\n const partitionRe = /_y(\\d{4})m(\\d{2})$/;\n const m = partitionRe.exec(row.partition_name);\n if (!m) continue;\n const y = Number(m[1]);\n const mo = Number(m[2]);\n if (y < cutoffYear || (y === cutoffYear && mo < cutoffMonth)) {\n await prisma.$executeRawUnsafe(`DROP TABLE IF EXISTS \"${row.partition_name}\";`);\n dropped.push(row.partition_name);\n }\n }\n return dropped;\n}\n","/**\n * Multi-provider LLM wrapper with timeout, retries, jitter, provider\n * fallback chain, token cap, and streaming passthrough.\n *\n * No hard dependency on a specific SDK — consumers register adapters.\n * Provider chain order is controlled by env `LLM_PROVIDER_CHAIN`\n * (comma-separated, e.g. `anthropic,openai,openrouter`).\n *\n * The wrapper is intentionally minimal — callers should construct it\n * once at boot, register adapters, and inject the singleton.\n */\n\nimport { logger } from '../logger/index.js';\n\nexport interface LLMRequest {\n model?: string;\n messages: Array<{ role: 'system' | 'user' | 'assistant'; content: string }>;\n maxTokens?: number;\n temperature?: number;\n stream?: boolean;\n /** Override timeout for this request. */\n timeoutMs?: number;\n}\n\nexport interface LLMResponse {\n provider: string;\n content: string;\n inputTokens?: number;\n outputTokens?: number;\n raw?: unknown;\n}\n\nexport interface LLMProviderAdapter {\n name: string;\n complete(req: LLMRequest, signal: AbortSignal): Promise<LLMResponse>;\n}\n\nexport interface LLMRouterOptions {\n /** Default per-attempt timeout (ms). */\n timeoutMs?: number;\n /** Max attempts across providers. */\n maxAttempts?: number;\n /** Initial backoff (ms). */\n initialDelayMs?: number;\n /** Hard cap on output tokens regardless of caller request. */\n maxOutputTokensCap?: number;\n}\n\nconst DEFAULTS: Required<LLMRouterOptions> = {\n timeoutMs: 30_000,\n maxAttempts: 3,\n initialDelayMs: 500,\n maxOutputTokensCap: 4096,\n};\n\nfunction jitter(n: number): number {\n return Math.floor(Math.random() * n);\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((r) => setTimeout(r, ms));\n}\n\nexport class LLMRouter {\n private readonly adapters: Map<string, LLMProviderAdapter> = new Map();\n private readonly opts: Required<LLMRouterOptions>;\n\n constructor(opts: LLMRouterOptions = {}) {\n this.opts = { ...DEFAULTS, ...opts };\n }\n\n register(adapter: LLMProviderAdapter): void {\n this.adapters.set(adapter.name, adapter);\n }\n\n private resolveChain(): string[] {\n const envChain = process.env['LLM_PROVIDER_CHAIN']?.trim();\n if (envChain) {\n return envChain\n .split(',')\n .map((s) => s.trim())\n .filter(Boolean);\n }\n return Array.from(this.adapters.keys());\n }\n\n async complete(req: LLMRequest): Promise<LLMResponse> {\n const cappedReq: LLMRequest = {\n ...req,\n maxTokens: Math.min(req.maxTokens ?? this.opts.maxOutputTokensCap, this.opts.maxOutputTokensCap),\n };\n const chain = this.resolveChain();\n if (chain.length === 0) {\n throw new Error('LLMRouter: no providers registered');\n }\n\n let lastErr: unknown = null;\n for (let attempt = 0; attempt < this.opts.maxAttempts; attempt++) {\n const providerName = chain[attempt % chain.length];\n const adapter = providerName ? this.adapters.get(providerName) : undefined;\n if (!adapter) {\n logger.warn('llmRouter.provider.notRegistered', { providerName });\n continue;\n }\n const timeoutMs = req.timeoutMs ?? this.opts.timeoutMs;\n const ctrl = new AbortController();\n const t = setTimeout(() => ctrl.abort(), timeoutMs);\n try {\n const response = await adapter.complete(cappedReq, ctrl.signal);\n return response;\n } catch (err) {\n lastErr = err;\n logger.warn('llmRouter.attempt.failed', { provider: adapter.name, attempt, err: String(err) });\n if (attempt < this.opts.maxAttempts - 1) {\n const delay = this.opts.initialDelayMs * 2 ** attempt;\n await sleep(jitter(delay));\n }\n } finally {\n clearTimeout(t);\n }\n }\n throw lastErr instanceof Error ? lastErr : new Error(`LLMRouter exhausted ${this.opts.maxAttempts} attempts`);\n }\n}\n"]}
|
package/dist/index-BQ1yJn1K.d.ts
DELETED
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
interface RetryConfig {
|
|
2
|
-
attempts?: number;
|
|
3
|
-
initialDelayMs?: number;
|
|
4
|
-
maxDelayMs?: number;
|
|
5
|
-
retryOn?: (status: number) => boolean;
|
|
6
|
-
}
|
|
7
|
-
interface BreakerConfig {
|
|
8
|
-
threshold?: number;
|
|
9
|
-
cooldownMs?: number;
|
|
10
|
-
}
|
|
11
|
-
interface HttpClientConfig {
|
|
12
|
-
baseUrl?: string;
|
|
13
|
-
defaultTimeoutMs?: number;
|
|
14
|
-
retry?: RetryConfig;
|
|
15
|
-
breaker?: BreakerConfig;
|
|
16
|
-
defaultHeaders?: Record<string, string>;
|
|
17
|
-
}
|
|
18
|
-
declare class CircuitBreakerOpenError extends Error {
|
|
19
|
-
constructor(host: string);
|
|
20
|
-
}
|
|
21
|
-
interface HttpClientInit extends RequestInit {
|
|
22
|
-
timeoutMs?: number;
|
|
23
|
-
retry?: RetryConfig;
|
|
24
|
-
}
|
|
25
|
-
declare function __resetHttpClientBreakers(): void;
|
|
26
|
-
declare function httpClient(url: string, init?: HttpClientInit, config?: HttpClientConfig): Promise<Response>;
|
|
27
|
-
declare function createHttpClient(config?: HttpClientConfig): (url: string, init?: HttpClientInit) => Promise<Response>;
|
|
28
|
-
|
|
29
|
-
interface LeaderLockRedis {
|
|
30
|
-
set(key: string, value: string, ex: 'EX', seconds: number, nx: 'NX'): Promise<'OK' | null>;
|
|
31
|
-
eval(script: string, numKeys: number, ...args: string[]): Promise<unknown>;
|
|
32
|
-
}
|
|
33
|
-
interface LeaderLockOptions {
|
|
34
|
-
ttlMs: number;
|
|
35
|
-
renewMs?: number;
|
|
36
|
-
}
|
|
37
|
-
interface LeaderLockResult<T> {
|
|
38
|
-
acquired: boolean;
|
|
39
|
-
result?: T;
|
|
40
|
-
}
|
|
41
|
-
declare function withLeaderLock<T>(redis: LeaderLockRedis, name: string, fn: () => Promise<T>, options: LeaderLockOptions): Promise<LeaderLockResult<T>>;
|
|
42
|
-
|
|
43
|
-
interface RateLimitRedis {
|
|
44
|
-
incr(key: string): Promise<number>;
|
|
45
|
-
pexpire(key: string, ms: number): Promise<number | 'OK'>;
|
|
46
|
-
pttl(key: string): Promise<number>;
|
|
47
|
-
}
|
|
48
|
-
interface RateLimitInput {
|
|
49
|
-
key: string;
|
|
50
|
-
limit: number;
|
|
51
|
-
windowMs: number;
|
|
52
|
-
}
|
|
53
|
-
interface RateLimitResult {
|
|
54
|
-
allowed: boolean;
|
|
55
|
-
count: number;
|
|
56
|
-
remaining: number;
|
|
57
|
-
resetAt: number;
|
|
58
|
-
}
|
|
59
|
-
declare function rateLimitIncr(redis: RateLimitRedis, input: RateLimitInput): Promise<RateLimitResult>;
|
|
60
|
-
|
|
61
|
-
interface ClampLimitOptions {
|
|
62
|
-
defaultLimit?: number;
|
|
63
|
-
maxLimit?: number;
|
|
64
|
-
minLimit?: number;
|
|
65
|
-
}
|
|
66
|
-
declare function clampLimit(input: number | undefined | null, opts?: ClampLimitOptions): number;
|
|
67
|
-
interface PaginateInput<TWhere, TOrderBy> {
|
|
68
|
-
take?: number | null;
|
|
69
|
-
cursor?: string | null;
|
|
70
|
-
where?: TWhere;
|
|
71
|
-
orderBy?: TOrderBy;
|
|
72
|
-
}
|
|
73
|
-
interface PaginateResult<TItem> {
|
|
74
|
-
items: TItem[];
|
|
75
|
-
hasMore: boolean;
|
|
76
|
-
nextCursor: string | null;
|
|
77
|
-
}
|
|
78
|
-
interface PrismaModelLike<TItem, TWhere, TOrderBy> {
|
|
79
|
-
findMany(args: {
|
|
80
|
-
take?: number;
|
|
81
|
-
skip?: number;
|
|
82
|
-
cursor?: {
|
|
83
|
-
id: string;
|
|
84
|
-
};
|
|
85
|
-
where?: TWhere;
|
|
86
|
-
orderBy?: TOrderBy;
|
|
87
|
-
}): Promise<TItem[]>;
|
|
88
|
-
}
|
|
89
|
-
declare function paginate<TItem extends {
|
|
90
|
-
id: string;
|
|
91
|
-
}, TWhere = unknown, TOrderBy = unknown>(model: PrismaModelLike<TItem, TWhere, TOrderBy>, input: PaginateInput<TWhere, TOrderBy>, opts?: ClampLimitOptions): Promise<PaginateResult<TItem>>;
|
|
92
|
-
|
|
93
|
-
interface DataLoaderLike<K, V> {
|
|
94
|
-
load(key: K): Promise<V>;
|
|
95
|
-
loadMany(keys: readonly K[]): Promise<(V | Error)[]>;
|
|
96
|
-
clear(key: K): this;
|
|
97
|
-
clearAll(): this;
|
|
98
|
-
prime(key: K, value: V): this;
|
|
99
|
-
}
|
|
100
|
-
type LoaderMap = Record<string, DataLoaderLike<unknown, unknown>>;
|
|
101
|
-
type LoaderBuilder<Ctx, M extends LoaderMap> = (ctx: Ctx) => M;
|
|
102
|
-
declare function buildLoaders<Ctx, M extends LoaderMap>(ctx: Ctx, builder: LoaderBuilder<Ctx, M>): M;
|
|
103
|
-
interface ReferenceObject {
|
|
104
|
-
id?: string;
|
|
105
|
-
[key: string]: unknown;
|
|
106
|
-
}
|
|
107
|
-
declare function resolveReferenceLoader<T, Ctx extends {
|
|
108
|
-
loaders: LoaderMap;
|
|
109
|
-
}>(loaderName: string, keyField?: string): (reference: ReferenceObject, ctx: Ctx) => Promise<T | null>;
|
|
110
|
-
|
|
111
|
-
interface CacheVersionRedis {
|
|
112
|
-
get(key: string): Promise<string | null>;
|
|
113
|
-
incr(key: string): Promise<number>;
|
|
114
|
-
}
|
|
115
|
-
declare function getNamespaceVersion(redis: CacheVersionRedis, namespace: string): Promise<number>;
|
|
116
|
-
declare function buildCacheKey(redis: CacheVersionRedis, namespace: string, ...parts: string[]): Promise<string>;
|
|
117
|
-
declare function invalidateNamespace(redis: CacheVersionRedis, namespace: string): Promise<number>;
|
|
118
|
-
|
|
119
|
-
interface PrismaRawClient {
|
|
120
|
-
$executeRawUnsafe(query: string, ...values: unknown[]): Promise<unknown>;
|
|
121
|
-
$queryRawUnsafe<T = unknown>(query: string, ...values: unknown[]): Promise<T>;
|
|
122
|
-
}
|
|
123
|
-
declare function monthlyPartitionName(table: string, year: number, month: number): string;
|
|
124
|
-
interface EnsureMonthlyOptions {
|
|
125
|
-
table: string;
|
|
126
|
-
from: Date;
|
|
127
|
-
to: Date;
|
|
128
|
-
}
|
|
129
|
-
declare function ensureMonthlyPartitions(prisma: PrismaRawClient, opts: EnsureMonthlyOptions): Promise<string[]>;
|
|
130
|
-
interface DropOldOptions {
|
|
131
|
-
table: string;
|
|
132
|
-
beforeDate: Date;
|
|
133
|
-
}
|
|
134
|
-
declare function dropOldPartitions(prisma: PrismaRawClient, opts: DropOldOptions): Promise<string[]>;
|
|
135
|
-
|
|
136
|
-
interface LLMRequest {
|
|
137
|
-
model?: string;
|
|
138
|
-
messages: Array<{
|
|
139
|
-
role: 'system' | 'user' | 'assistant';
|
|
140
|
-
content: string;
|
|
141
|
-
}>;
|
|
142
|
-
maxTokens?: number;
|
|
143
|
-
temperature?: number;
|
|
144
|
-
stream?: boolean;
|
|
145
|
-
timeoutMs?: number;
|
|
146
|
-
}
|
|
147
|
-
interface LLMResponse {
|
|
148
|
-
provider: string;
|
|
149
|
-
content: string;
|
|
150
|
-
inputTokens?: number;
|
|
151
|
-
outputTokens?: number;
|
|
152
|
-
raw?: unknown;
|
|
153
|
-
}
|
|
154
|
-
interface LLMProviderAdapter {
|
|
155
|
-
name: string;
|
|
156
|
-
complete(req: LLMRequest, signal: AbortSignal): Promise<LLMResponse>;
|
|
157
|
-
}
|
|
158
|
-
interface LLMRouterOptions {
|
|
159
|
-
timeoutMs?: number;
|
|
160
|
-
maxAttempts?: number;
|
|
161
|
-
initialDelayMs?: number;
|
|
162
|
-
maxOutputTokensCap?: number;
|
|
163
|
-
}
|
|
164
|
-
declare class LLMRouter {
|
|
165
|
-
private readonly adapters;
|
|
166
|
-
private readonly opts;
|
|
167
|
-
constructor(opts?: LLMRouterOptions);
|
|
168
|
-
register(adapter: LLMProviderAdapter): void;
|
|
169
|
-
private resolveChain;
|
|
170
|
-
complete(req: LLMRequest): Promise<LLMResponse>;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
type index_BreakerConfig = BreakerConfig;
|
|
174
|
-
type index_CacheVersionRedis = CacheVersionRedis;
|
|
175
|
-
type index_CircuitBreakerOpenError = CircuitBreakerOpenError;
|
|
176
|
-
declare const index_CircuitBreakerOpenError: typeof CircuitBreakerOpenError;
|
|
177
|
-
type index_ClampLimitOptions = ClampLimitOptions;
|
|
178
|
-
type index_DataLoaderLike<K, V> = DataLoaderLike<K, V>;
|
|
179
|
-
type index_DropOldOptions = DropOldOptions;
|
|
180
|
-
type index_EnsureMonthlyOptions = EnsureMonthlyOptions;
|
|
181
|
-
type index_HttpClientConfig = HttpClientConfig;
|
|
182
|
-
type index_HttpClientInit = HttpClientInit;
|
|
183
|
-
type index_LLMProviderAdapter = LLMProviderAdapter;
|
|
184
|
-
type index_LLMRequest = LLMRequest;
|
|
185
|
-
type index_LLMResponse = LLMResponse;
|
|
186
|
-
type index_LLMRouter = LLMRouter;
|
|
187
|
-
declare const index_LLMRouter: typeof LLMRouter;
|
|
188
|
-
type index_LLMRouterOptions = LLMRouterOptions;
|
|
189
|
-
type index_LeaderLockOptions = LeaderLockOptions;
|
|
190
|
-
type index_LeaderLockRedis = LeaderLockRedis;
|
|
191
|
-
type index_LeaderLockResult<T> = LeaderLockResult<T>;
|
|
192
|
-
type index_LoaderBuilder<Ctx, M extends LoaderMap> = LoaderBuilder<Ctx, M>;
|
|
193
|
-
type index_LoaderMap = LoaderMap;
|
|
194
|
-
type index_PaginateInput<TWhere, TOrderBy> = PaginateInput<TWhere, TOrderBy>;
|
|
195
|
-
type index_PaginateResult<TItem> = PaginateResult<TItem>;
|
|
196
|
-
type index_PrismaModelLike<TItem, TWhere, TOrderBy> = PrismaModelLike<TItem, TWhere, TOrderBy>;
|
|
197
|
-
type index_PrismaRawClient = PrismaRawClient;
|
|
198
|
-
type index_RateLimitInput = RateLimitInput;
|
|
199
|
-
type index_RateLimitRedis = RateLimitRedis;
|
|
200
|
-
type index_RateLimitResult = RateLimitResult;
|
|
201
|
-
type index_ReferenceObject = ReferenceObject;
|
|
202
|
-
type index_RetryConfig = RetryConfig;
|
|
203
|
-
declare const index___resetHttpClientBreakers: typeof __resetHttpClientBreakers;
|
|
204
|
-
declare const index_buildCacheKey: typeof buildCacheKey;
|
|
205
|
-
declare const index_buildLoaders: typeof buildLoaders;
|
|
206
|
-
declare const index_clampLimit: typeof clampLimit;
|
|
207
|
-
declare const index_createHttpClient: typeof createHttpClient;
|
|
208
|
-
declare const index_dropOldPartitions: typeof dropOldPartitions;
|
|
209
|
-
declare const index_ensureMonthlyPartitions: typeof ensureMonthlyPartitions;
|
|
210
|
-
declare const index_getNamespaceVersion: typeof getNamespaceVersion;
|
|
211
|
-
declare const index_httpClient: typeof httpClient;
|
|
212
|
-
declare const index_invalidateNamespace: typeof invalidateNamespace;
|
|
213
|
-
declare const index_monthlyPartitionName: typeof monthlyPartitionName;
|
|
214
|
-
declare const index_paginate: typeof paginate;
|
|
215
|
-
declare const index_rateLimitIncr: typeof rateLimitIncr;
|
|
216
|
-
declare const index_resolveReferenceLoader: typeof resolveReferenceLoader;
|
|
217
|
-
declare const index_withLeaderLock: typeof withLeaderLock;
|
|
218
|
-
declare namespace index {
|
|
219
|
-
export { type index_BreakerConfig as BreakerConfig, type index_CacheVersionRedis as CacheVersionRedis, index_CircuitBreakerOpenError as CircuitBreakerOpenError, type index_ClampLimitOptions as ClampLimitOptions, type index_DataLoaderLike as DataLoaderLike, type index_DropOldOptions as DropOldOptions, type index_EnsureMonthlyOptions as EnsureMonthlyOptions, type index_HttpClientConfig as HttpClientConfig, type index_HttpClientInit as HttpClientInit, type index_LLMProviderAdapter as LLMProviderAdapter, type index_LLMRequest as LLMRequest, type index_LLMResponse as LLMResponse, index_LLMRouter as LLMRouter, type index_LLMRouterOptions as LLMRouterOptions, type index_LeaderLockOptions as LeaderLockOptions, type index_LeaderLockRedis as LeaderLockRedis, type index_LeaderLockResult as LeaderLockResult, type index_LoaderBuilder as LoaderBuilder, type index_LoaderMap as LoaderMap, type index_PaginateInput as PaginateInput, type index_PaginateResult as PaginateResult, type index_PrismaModelLike as PrismaModelLike, type index_PrismaRawClient as PrismaRawClient, type index_RateLimitInput as RateLimitInput, type index_RateLimitRedis as RateLimitRedis, type index_RateLimitResult as RateLimitResult, type index_ReferenceObject as ReferenceObject, type index_RetryConfig as RetryConfig, index___resetHttpClientBreakers as __resetHttpClientBreakers, index_buildCacheKey as buildCacheKey, index_buildLoaders as buildLoaders, index_clampLimit as clampLimit, index_createHttpClient as createHttpClient, index_dropOldPartitions as dropOldPartitions, index_ensureMonthlyPartitions as ensureMonthlyPartitions, index_getNamespaceVersion as getNamespaceVersion, index_httpClient as httpClient, index_invalidateNamespace as invalidateNamespace, index_monthlyPartitionName as monthlyPartitionName, index_paginate as paginate, index_rateLimitIncr as rateLimitIncr, index_resolveReferenceLoader as resolveReferenceLoader, index_withLeaderLock as withLeaderLock };
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
export { ensureMonthlyPartitions as A, type BreakerConfig as B, type CacheVersionRedis as C, type DataLoaderLike as D, type EnsureMonthlyOptions as E, getNamespaceVersion as F, httpClient as G, type HttpClientConfig as H, invalidateNamespace as I, monthlyPartitionName as J, paginate as K, type LLMProviderAdapter as L, rateLimitIncr as M, resolveReferenceLoader as N, withLeaderLock as O, type PaginateInput as P, type RateLimitInput as R, __resetHttpClientBreakers as _, CircuitBreakerOpenError as a, type ClampLimitOptions as b, type DropOldOptions as c, type HttpClientInit as d, type LLMRequest as e, type LLMResponse as f, LLMRouter as g, type LLMRouterOptions as h, index as i, type LeaderLockOptions as j, type LeaderLockRedis as k, type LeaderLockResult as l, type LoaderBuilder as m, type LoaderMap as n, type PaginateResult as o, type PrismaModelLike as p, type PrismaRawClient as q, type RateLimitRedis as r, type RateLimitResult as s, type ReferenceObject as t, type RetryConfig as u, buildCacheKey as v, buildLoaders as w, clampLimit as x, createHttpClient as y, dropOldPartitions as z };
|