@keboola/api-client 44.0.0 → 45.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/{index-BMiZx-4_.d.cts → index-BKOFRmTB.d.cts} +2 -2
- package/dist/{index-DzGmgUvQ.d.ts → index-Bl2EloC0.d.ts} +12 -6
- package/dist/{index-DZcQUZaO.d.cts → index-CGFGd3tF.d.cts} +12 -6
- package/dist/{index-B72LTF-k.d.ts → index-DtuwWYDR.d.ts} +2 -2
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/{jobStatus-CcNlIy5R.cjs → jobStatus-B0E-MZ9I.cjs} +2 -2
- package/dist/{jobStatus-CcNlIy5R.cjs.map → jobStatus-B0E-MZ9I.cjs.map} +1 -1
- package/dist/{jobStatus-CDp4r5JQ.js → jobStatus-BJdbZ72V.js} +2 -2
- package/dist/{jobStatus-CDp4r5JQ.js.map → jobStatus-BJdbZ72V.js.map} +1 -1
- package/dist/metastore/index.d.cts +1 -1
- package/dist/metastore/index.d.ts +1 -1
- package/dist/metastore/types.d.cts +1 -1
- package/dist/metastore/types.d.ts +1 -1
- package/dist/queryService/index.cjs +1 -1
- package/dist/queryService/index.d.cts +1 -1
- package/dist/queryService/index.d.ts +1 -1
- package/dist/queryService/index.js +1 -1
- package/dist/{queryService-OgdbrBjA.js → queryService-Blfz59Ms.js} +2 -2
- package/dist/{queryService-OgdbrBjA.js.map → queryService-Blfz59Ms.js.map} +1 -1
- package/dist/{queryService-e2ql5eev.cjs → queryService-RlNYw7LG.cjs} +2 -2
- package/dist/{queryService-e2ql5eev.cjs.map → queryService-RlNYw7LG.cjs.map} +1 -1
- package/dist/queue/index.cjs +1 -1
- package/dist/queue/index.d.cts +8 -2
- package/dist/queue/index.d.ts +8 -2
- package/dist/queue/index.js +1 -1
- package/dist/queue/types.d.cts +1 -1
- package/dist/queue/types.d.ts +1 -1
- package/dist/{queue-DGoMbK1X.cjs → queue-BrgRdtOr.cjs} +2 -2
- package/dist/{queue-DGoMbK1X.cjs.map → queue-BrgRdtOr.cjs.map} +1 -1
- package/dist/{queue-BZwZuZZx.js → queue-CNvR-M23.js} +2 -2
- package/dist/{queue-BZwZuZZx.js.map → queue-CNvR-M23.js.map} +1 -1
- package/dist/sdk/configurations/index.d.cts +1 -1
- package/dist/sdk/configurations/index.d.ts +1 -1
- package/dist/sdk/kaiMemory/index.d.cts +1 -1
- package/dist/sdk/kaiMemory/index.d.ts +1 -1
- package/dist/sdk/kaiMemory/types.d.cts +1 -1
- package/dist/sdk/kaiMemory/types.d.ts +1 -1
- package/dist/sdk/queryService/index.cjs +1 -1
- package/dist/sdk/queryService/index.d.cts +1 -1
- package/dist/sdk/queryService/index.d.ts +1 -1
- package/dist/sdk/queryService/index.js +1 -1
- package/dist/sdk/semanticLayer/index.cjs +1 -2
- package/dist/sdk/semanticLayer/index.d.cts +3 -20
- package/dist/sdk/semanticLayer/index.d.ts +3 -20
- package/dist/sdk/semanticLayer/index.js +2 -2
- package/dist/sdk/semanticLayer/types.d.cts +2 -2
- package/dist/sdk/semanticLayer/types.d.ts +2 -2
- package/dist/sdk/storage/index.d.cts +1 -1
- package/dist/sdk/storage/index.d.ts +1 -1
- package/dist/sdk/tag/index.d.cts +2 -2
- package/dist/sdk/tag/index.d.ts +2 -2
- package/dist/sdk/tag/types.d.cts +1 -1
- package/dist/sdk/tag/types.d.ts +1 -1
- package/dist/{semanticLayer-Cz22bIjd.cjs → semanticLayer-7BejcMj_.cjs} +10 -84
- package/dist/semanticLayer-7BejcMj_.cjs.map +1 -0
- package/dist/{semanticLayer-JSE51K68.js → semanticLayer-DvjS_nzo.js} +11 -79
- package/dist/semanticLayer-DvjS_nzo.js.map +1 -0
- package/dist/storage/index.cjs +1 -1
- package/dist/storage/index.d.cts +1 -1
- package/dist/storage/index.d.ts +1 -1
- package/dist/storage/index.js +1 -1
- package/dist/{storage-B4AnXas_.cjs → storage-76Sf_z_H.cjs} +2 -2
- package/dist/{storage-B4AnXas_.cjs.map → storage-76Sf_z_H.cjs.map} +1 -1
- package/dist/{storage-CsdA47AL.js → storage-RkNaOFJ-.js} +2 -2
- package/dist/{storage-CsdA47AL.js.map → storage-RkNaOFJ-.js.map} +1 -1
- package/dist/{types-DwVSj-Da.d.ts → types-9SEE4icc.d.ts} +29 -2
- package/dist/{types-CwZgZqrA.d.ts → types-B-5ya_L5.d.ts} +12 -1
- package/dist/{types-DUMal2E-.d.cts → types-BjR8Yodc.d.cts} +29 -2
- package/dist/{types-CigD_EF5.d.ts → types-CABWhTa9.d.ts} +4 -8
- package/dist/{types-04GTqleJ.d.cts → types-CalDJHCX.d.cts} +3 -3
- package/dist/{types-BgHtMe8s.d.cts → types-Ccd9O6ca.d.cts} +3 -3
- package/dist/{types-QSchmyvO.d.ts → types-DVZpKGBJ.d.ts} +3 -3
- package/dist/{types-DyArI_Jq.d.cts → types-DdsYv2WG.d.cts} +4 -8
- package/dist/{types-CAAgCRmE.d.cts → types-tgU8XvPs.d.cts} +12 -1
- package/dist/{types-CV7jmgtX.d.ts → types-z82gSTx8.d.ts} +3 -3
- package/package.json +1 -1
- package/surface/queue.md +7 -7
- package/dist/semanticLayer-Cz22bIjd.cjs.map +0 -1
- package/dist/semanticLayer-JSE51K68.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jobStatus-CDp4r5JQ.js","names":[],"sources":["../src/utils/async/delay.ts","../src/utils/async/lazy.ts","../src/utils/async/result.ts","../src/utils/async/poll/utils.ts","../src/utils/async/poll/backoff.ts","../src/utils/async/poll/pollLoop.ts","../src/utils/async/poll/poll.ts","../src/domain/jobStatus.ts"],"sourcesContent":["import { createAbortError } from '../createAbortError';\n\nexport const delay = (timeout: number, signal?: AbortSignal) =>\n new Promise<void>((resolve, reject) => {\n if (signal?.aborted) return reject(createAbortError(signal.reason));\n\n const onAbort = () => {\n clearTimeout(timeoutId);\n reject(createAbortError(signal?.reason));\n };\n\n // `once: true` only detaches the listener once the event fires, so the timeout path has to\n // detach it explicitly — a caller reusing one signal across many delays (`poll` does) would\n // otherwise pile up a listener per delay for as long as the signal is alive.\n const timeoutId = setTimeout(() => {\n signal?.removeEventListener('abort', onAbort);\n resolve();\n }, timeout);\n\n signal?.addEventListener('abort', onAbort, { once: true });\n });\n","import type { TaskFn } from './types';\n\n/**\n * Runs `task` once and replays its promise to every later caller.\n *\n * - A rejection is not cached: the next call retries, so a transient failure never sticks.\n * - Callers that joined the failed run reject with its error.\n */\nexport const lazy = <T>(task: TaskFn<T>): (() => Promise<Awaited<T>>) => {\n let value: Promise<Awaited<T>> | null = null;\n\n // async wrapper so a synchronous throw from `task` rejects rather than throws.\n const runTask = async (): Promise<Awaited<T>> => await task();\n\n return () => {\n value ??= runTask().catch((error: unknown) => {\n value = null;\n throw error;\n });\n return value;\n };\n};\n","export type Success<T> = { success: true; data: T };\nexport type Failure<E extends Error> = { success: false; error: E };\nexport type Result<T, E extends Error = Error> = Success<T> | Failure<E>;\n\n// A task that returns a promise is a type error: the wrapper would report success before it\n// settles, and the rejection would go unhandled. Use the `*Async` sibling.\ntype NotPromise<T> = T extends PromiseLike<unknown> ? never : T;\n\nexport const asError = (thrown: unknown) =>\n thrown instanceof Error ? thrown : new Error(String(thrown), { cause: thrown });\n\nconst success = <T>(data: T): Result<T, never> => ({ success: true, data });\nconst failure = <E extends Error>(error: E): Result<never, E> => ({ success: false, error });\nconst isSuccess = <T, E extends Error>(result: Result<T, E>): result is Success<T> =>\n result.success;\nconst isFailure = <T, E extends Error>(result: Result<T, E>): result is Failure<E> =>\n !result.success;\n\nconst map = <T, E extends Error, U>(result: Result<T, E>, fn: (data: T) => U): Result<U, E> =>\n result.success ? success(fn(result.data)) : result;\n\nconst mapError = <T, E extends Error, F extends Error>(\n result: Result<T, E>,\n fn: (error: E) => F,\n): Result<T, F> => (result.success ? result : failure(fn(result.error)));\n\nconst andThen = <T, E extends Error, U, F extends Error>(\n result: Result<T, E>,\n fn: (data: T) => Result<U, F>,\n): Result<U, E | F> => (result.success ? fn(result.data) : result);\n\nconst match = <T, E extends Error, R>(\n result: Result<T, E>,\n onSuccess: (data: T) => R,\n onFailure: (error: E) => R,\n): R => (result.success ? onSuccess(result.data) : onFailure(result.error));\n\n// A side effect on a success; the result itself passes through untouched, same instance.\nconst tap = <T, E extends Error>(result: Result<T, E>, fn: (data: T) => void): Result<T, E> => {\n if (result.success) fn(result.data);\n return result;\n};\n\nconst unwrap = <T, E extends Error>(result: Result<T, E>): T => {\n if (result.success) return result.data;\n throw result.error;\n};\n\nconst unwrapOr = <T, E extends Error, U>(result: Result<T, E>, fallback: U): T | U =>\n result.success ? result.data : fallback;\n\nconst tryCatch = <T>(task: () => NotPromise<T>): Result<T> => {\n try {\n return success(task());\n } catch (thrown) {\n return failure(asError(thrown));\n }\n};\n\nconst tryCatchAsync = async <T>(task: () => T | PromiseLike<T>): Promise<Result<T>> => {\n try {\n return success(await task());\n } catch (thrown) {\n return failure(asError(thrown));\n }\n};\n\nconst fromThrowable =\n <A extends unknown[], R>(fn: (...args: A) => NotPromise<R>) =>\n (...args: A): Result<R> =>\n tryCatch(() => fn(...args));\n\nconst fromThrowableAsync =\n <A extends unknown[], R>(fn: (...args: A) => R | PromiseLike<R>) =>\n (...args: A): Promise<Result<R>> =>\n tryCatchAsync(() => fn(...args));\n\nexport const Result = {\n success,\n failure,\n isSuccess,\n isFailure,\n map,\n mapError,\n andThen,\n match,\n tap,\n unwrap,\n unwrapOr,\n tryCatch,\n tryCatchAsync,\n fromThrowable,\n fromThrowableAsync,\n};\n","/**\n * The longest delay a timer can hold: `setTimeout` takes a 32-bit signed number of milliseconds,\n * about 24.9 days.\n *\n * - Above it the delay wraps: Node warns and fires after 1 ms, so a long wait becomes a busy loop.\n * - It bounds a backoff curve and a poll's timeout alike, since both end up in a timer.\n */\nexport const MAX_TIMER_DELAY = 2 ** 31 - 1;\n\nexport const clamp = (value: number, min: number, max = Infinity) =>\n Math.min(Math.max(value, min), max);\n\nexport const finiteOr = (value: number, fallback: number) =>\n Number.isFinite(value) ? value : fallback;\n\n/** A signal that never aborts, so an input nobody gave costs no branch of its own. */\nexport const neverAborts = () => new AbortController().signal;\n","import { clamp, finiteOr, MAX_TIMER_DELAY } from './utils';\n\nexport type Jitter =\n | 'none' // delay\n | 'full' // [0, delay)\n | 'equal'; // [delay / 2, delay)\n\ntype Backoff =\n | { type: 'constant'; interval: number } // 3000, 3000, 3000, ...\n | { type: 'linear'; initialInterval: number; step: number } // 1000, 2000, 3000, …\n | { type: 'exponential'; initialInterval: number; factor?: number }; // 1000, 2000, 4000, 8000, …\n\ntype RandomFn = () => number;\ntype JitterFn = (delay: number) => number;\ntype BackoffFn = (attempt: number) => number;\n\nexport type BackoffDef = {\n jitter?: Jitter;\n maxInterval?: number;\n random?: RandomFn;\n} & Backoff;\n\nconst MIN_STEP = 500;\nconst MIN_FACTOR = 2;\nconst MIN_INTERVAL = 500;\n\nexport const createBackoff = ({\n jitter = 'none',\n maxInterval: _maxInterval = MAX_TIMER_DELAY,\n random = Math.random,\n ...backoff\n}: BackoffDef): BackoffFn => {\n const backoffFn: BackoffFn = (attempt) => {\n if (backoff.type === 'linear') {\n const interval = clamp(finiteOr(backoff.initialInterval, MIN_INTERVAL), MIN_INTERVAL);\n const step = clamp(finiteOr(backoff.step, MIN_STEP), MIN_STEP);\n\n return interval + step * (attempt - 1);\n }\n if (backoff.type === 'exponential') {\n const interval = clamp(finiteOr(backoff.initialInterval, MIN_INTERVAL), MIN_INTERVAL);\n const factor = clamp(finiteOr(backoff.factor ?? MIN_FACTOR, MIN_FACTOR), MIN_FACTOR);\n\n return interval * factor ** (attempt - 1);\n }\n\n return clamp(finiteOr(backoff.interval, MIN_INTERVAL), MIN_INTERVAL);\n };\n\n const jitterFn: JitterFn = (delay) => {\n if (jitter === 'none') return delay;\n if (jitter === 'full') return delay * random();\n return delay / 2 + (delay / 2) * random(); // equal\n };\n\n const maxInterval = clamp(finiteOr(_maxInterval, MAX_TIMER_DELAY), MIN_INTERVAL, MAX_TIMER_DELAY);\n return (_attempt) => {\n const attempt = clamp(finiteOr(Math.trunc(_attempt), 1), 1);\n const capped = Math.min(backoffFn(attempt), maxInterval);\n // Floored after the jitter, not before: `full` jitter multiplies by a random fraction, so a floor\n // applied to the curve alone leaves sub-millisecond gaps between attempts.\n return clamp(finiteOr(jitterFn(capped), MIN_INTERVAL), MIN_INTERVAL, maxInterval);\n };\n};\n","import { delay } from '../delay';\nimport { Result } from '../result';\n\nimport { type BackoffDef, createBackoff } from './backoff';\nimport { clamp, finiteOr, MAX_TIMER_DELAY, neverAborts } from './utils';\n\ntype Clock = {\n wait: (ms: number, signal?: AbortSignal) => Promise<void>;\n now: () => number;\n};\n\nexport type PollKey = readonly unknown[];\n\nexport type PollContext<K extends PollKey = PollKey> = {\n pollKey: K;\n attempt: number;\n elapsed: number;\n};\n\n/** The context plus the answer it is about: what `until` decides on, and what an ending reports. */\nexport type PollTick<T, K extends PollKey = PollKey> = PollContext<K> & { last: T | null };\n\nexport type PollResultState = 'done' | 'timedOut' | 'exhausted' | 'aborted' | 'errored';\n\nexport type PollResult<T, K extends PollKey = PollKey> = PollTick<T, K> &\n (\n | { state: 'done'; data: T }\n | { state: 'timedOut' | 'exhausted'; error?: Error }\n | { state: 'aborted'; reason?: unknown }\n | { state: 'errored'; error: Error }\n );\n\nexport type PollOptions<T, K extends PollKey = PollKey> = {\n pollKey?: K;\n pollFn: (context: PollContext<K> & { signal: AbortSignal }) => Promise<T>;\n until: (tick: PollTick<T, K> & { data: T }) => boolean;\n signal?: AbortSignal;\n backoff?: BackoffDef;\n isRetryable?: (error: Error) => boolean;\n maxAttempts?: number;\n timeout?: number;\n clock?: Clock;\n};\n\nconst pollResult = {\n done: <T, K extends PollKey>(data: T, context: PollTick<T, K>): PollResult<T, K> => ({\n state: 'done',\n data,\n ...context,\n last: data,\n }),\n errored: <T, K extends PollKey>(error: Error, context: PollTick<T, K>): PollResult<T, K> => ({\n state: 'errored',\n error,\n ...context,\n }),\n exhausted: <T, K extends PollKey>(context: PollTick<T, K>, error?: Error): PollResult<T, K> => ({\n state: 'exhausted',\n error,\n ...context,\n }),\n timedOut: <T, K extends PollKey>(context: PollTick<T, K>, error?: Error): PollResult<T, K> => ({\n state: 'timedOut',\n error,\n ...context,\n }),\n aborted: <T, K extends PollKey>(context: PollTick<T, K>, reason: unknown): PollResult<T, K> => ({\n state: 'aborted',\n reason,\n ...context,\n }),\n};\n\nexport const pollLoop = async <T, K extends PollKey = PollKey>({\n pollKey,\n pollFn: _pollFn,\n until: _until,\n signal: callerSignal = neverAborts(),\n backoff: backoffDef = { type: 'constant', interval: 3000 },\n clock = { wait: (ms, signal) => delay(ms, signal), now: () => performance.now() },\n isRetryable: _isRetryable = () => false,\n maxAttempts: _maxAttempts = Infinity,\n timeout: _timeout = Infinity,\n}: PollOptions<T, K>): Promise<PollResult<T, K>> => {\n // A deadline ends up in a timer, so a finite one is bounded by what a timer can hold. `Infinity`\n // is answered before the clamp: it means no deadline, and clamping would make it the longest one.\n const requested = finiteOr(_timeout, Infinity);\n const timeout = requested === Infinity ? Infinity : clamp(requested, 0, MAX_TIMER_DELAY);\n const maxAttempts = Math.trunc(clamp(finiteOr(_maxAttempts, Infinity), 0));\n\n const timeoutSignal = timeout === Infinity ? neverAborts() : AbortSignal.timeout(timeout);\n const anySignal = AbortSignal.any([callerSignal, timeoutSignal]);\n const anyAborted = Promise.withResolvers<never>();\n\n anySignal.addEventListener('abort', () => anyAborted.reject(anySignal.reason), {\n once: true,\n });\n void anyAborted.promise.catch(() => undefined);\n\n const backoffFn = createBackoff(backoffDef);\n const startedAt = clock.now();\n\n const until = Result.fromThrowable(_until);\n const isRetryable = Result.fromThrowable(_isRetryable);\n // A poll without a key has an empty one, and `K` is opaque in here — the one place the absent\n // case is materialised is the one place it has to be asserted.\n const key = pollKey ?? ([] as unknown as K);\n // Only what the context declares: a request is not handed the tick's `last` as well.\n const pollFn = ({ pollKey: key, attempt: at, elapsed }: PollContext<K>) =>\n Result.tryCatchAsync(() =>\n Promise.race([\n _pollFn({ pollKey: key, attempt: at, elapsed, signal: anySignal }),\n anyAborted.promise,\n ]),\n );\n const sleep = Result.fromThrowableAsync((ms: number) => clock.wait(ms, anySignal));\n\n let attempt = 0;\n // What a retry swallowed: the poll carries it to whichever ending runs out first.\n let last: T | null = null;\n let lastError: Error | undefined;\n const context = (at = clock.now() - startedAt): PollTick<T, K> => ({\n pollKey: key,\n attempt,\n elapsed: at,\n last,\n });\n\n if (attempt >= maxAttempts) return pollResult.exhausted<T, K>(context());\n\n while (true) {\n const before = context();\n if (timeoutSignal.aborted) return pollResult.timedOut(before, lastError);\n if (callerSignal.aborted) return pollResult.aborted(before, callerSignal.reason);\n\n attempt++;\n // The attempt it is, not the one before it — `before` was read to decide whether to make it.\n const poll = await pollFn({ ...before, attempt });\n\n // What the attempt produced, recorded before the tick that reports it: on any ending but `done`\n // these two are the only account of what the poll saw, and reading them one attempt behind is\n // reading the wrong answer.\n if (poll.success) last = poll.data;\n else lastError = poll.error;\n\n const after = context();\n if (timeoutSignal.aborted) return pollResult.timedOut(after, lastError);\n if (callerSignal.aborted) return pollResult.aborted(after, callerSignal.reason);\n\n if (!poll.success) {\n const canRetry = isRetryable(poll.error);\n\n // A predicate that throws cannot ask for a retry. The request's own failure stays the reported\n // one — it is the type a caller's guards expect — and the predicate's rides along as its cause.\n if (!canRetry.success) {\n poll.error.cause ??= canRetry.error;\n return pollResult.errored(poll.error, after);\n }\n if (!canRetry.data) return pollResult.errored(poll.error, after);\n }\n\n if (poll.success) {\n const isDone = until({ ...after, data: poll.data });\n if (!isDone.success) return pollResult.errored(isDone.error, after);\n if (isDone.data) return pollResult.done(poll.data, after);\n }\n\n // exhausted\n if (attempt >= maxAttempts) return pollResult.exhausted(after, lastError);\n\n // sleep\n const backoff = backoffFn(attempt);\n if (after.elapsed + backoff >= timeout) return pollResult.timedOut(after, lastError);\n\n const slept = await sleep(backoff);\n if (!slept.success) {\n const afterSleep = context();\n if (timeoutSignal.aborted) return pollResult.timedOut(afterSleep, lastError);\n if (callerSignal.aborted) return pollResult.aborted(afterSleep, callerSignal.reason);\n\n return pollResult.errored(slept.error, afterSleep);\n }\n }\n};\n","import { createAbortError } from '../../createAbortError';\nimport { createEmitter, createStore } from '../../store';\nimport { lazy } from '../lazy';\n\nimport {\n type PollKey,\n pollLoop,\n type PollOptions,\n type PollResult,\n type PollResultState,\n type PollTick,\n} from './pollLoop';\nimport { neverAborts } from './utils';\n\nexport type PollState = 'idle' | 'polling' | PollResultState;\nexport type PollSnapshot = PollTick<unknown> & { state: PollState };\n\ntype OnFailure<T> = (result: PollResult<T>) => Error | undefined;\n\nexport type PollerStartFn<T> = () => Promise<PollResult<T>>;\nexport type PollerStopFn = (reason?: string) => void;\ntype PollerSubscribeFn = (listener: (snapshot: PollSnapshot) => void) => () => void;\ntype PollerDebugFn = () => PollSnapshot;\ntype PollerUnwrapFn<T> = (onFailure?: OnFailure<T>) => Promise<T>;\nexport type Poller<T> = {\n readonly state: PollState;\n start: PollerStartFn<T>;\n unwrap: PollerUnwrapFn<T>;\n stop: PollerStopFn;\n subscribe: PollerSubscribeFn;\n debug: PollerDebugFn;\n};\n\nexport type PollTask<T> = Promise<PollResult<T>> &\n Pick<Poller<T>, 'unwrap' | 'stop' | 'subscribe' | 'debug'>;\n\nexport type ObservedPoller = Pick<Poller<unknown>, 'stop' | 'subscribe' | 'debug' | 'start'>;\n\nexport const emitter = createEmitter<ObservedPoller>();\n\nexport const failureOf = (result: PollResult<unknown>): Error => {\n if ('error' in result && result.error) return result.error;\n\n if (result.state === 'aborted') {\n if (result.reason instanceof Error) return result.reason;\n\n return createAbortError(\n typeof result.reason === 'string' ? result.reason : 'The poll was stopped.',\n );\n }\n\n return new Error(`The poll ${result.state} after ${result.attempt} attempts.`);\n};\n\nexport const poller = <T, K extends PollKey = PollKey>({\n pollKey,\n signal,\n until,\n ...pollLoopOptions\n}: PollOptions<T, K>): Poller<T> => {\n const callerSignal = signal ?? neverAborts();\n const pollerSignal = new AbortController();\n const anySignal = AbortSignal.any([pollerSignal.signal, callerSignal]);\n\n // snapshoting\n const snapshot = createStore<PollSnapshot>({\n pollKey: pollKey ?? [],\n state: 'idle',\n attempt: 0,\n elapsed: 0,\n last: null,\n });\n const updateSnapshot = (next: Partial<PollSnapshot>) =>\n snapshot.set({ ...snapshot.get(), ...next });\n\n const handleUntil = (context: PollTick<T, K> & { data: T }) => {\n updateSnapshot({ attempt: context.attempt, elapsed: context.elapsed, last: context.data });\n return until(context);\n };\n\n const start: PollerStartFn<T> = lazy(async () => {\n updateSnapshot({ state: 'polling' });\n const result = await pollLoop({\n ...pollLoopOptions,\n pollKey,\n until: handleUntil,\n signal: anySignal,\n });\n // The result knows what a tick cannot: attempts that failed, and the time the ending itself took.\n snapshot.set({\n pollKey: result.pollKey,\n state: result.state,\n attempt: result.attempt,\n elapsed: result.elapsed,\n last: result.last,\n });\n return result;\n });\n\n const stop: PollerStopFn = (reason) => pollerSignal.abort(reason);\n const subscribe: PollerSubscribeFn = (listener) =>\n snapshot.subscribe(() => listener(snapshot.get()));\n const debug: PollerDebugFn = snapshot.get;\n\n const unwrap: PollerUnwrapFn<T> = async (onFailure) => {\n const result = await start();\n if (result.state === 'done') return result.data;\n throw onFailure?.(result) ?? failureOf(result);\n };\n\n const controls = {\n stop,\n subscribe,\n debug,\n start,\n };\n\n emitter.emit(controls);\n\n return {\n get state() {\n return snapshot.get().state;\n },\n unwrap,\n ...controls,\n };\n};\n\nexport const poll = <T, K extends PollKey = PollKey>(options: PollOptions<T, K>): PollTask<T> => {\n const p = poller(options);\n\n return Object.assign(p.start(), {\n unwrap: p.unwrap,\n stop: p.stop,\n subscribe: p.subscribe,\n debug: p.debug,\n });\n};\n","import type { QueryJobStatus } from '../clients/queryService/types';\nimport type { QueueJobStatus } from '../clients/queue/types';\nimport type { StorageJobStatus } from '../clients/storage/jobs/types';\n\n/**\n * One service's statuses split by what the job is doing.\n *\n * - Groups are disjoint and cover the vocabulary; terminal = successful + failed.\n * - The annotation makes a renamed generated status fail the build here.\n */\ntype StatusGroups<Status extends string> = {\n running: readonly Status[];\n successful: readonly Status[];\n failed: readonly Status[];\n};\n\n/** A service's statuses as named constants — `SUCCESS: 'success'`. */\ntype StatusNames<Status extends string> = { [K in Status as Uppercase<K>]: K };\n\n// Mirrors `StorageJobStatus` in `connection`.\nconst STORAGE: StatusGroups<StorageJobStatus> = {\n running: ['waiting', 'processing'],\n successful: ['success'],\n failed: ['error'],\n};\n\n/**\n * Mirrors `PlainJobInterface` in `job-queue-internal-api-php-client`.\n *\n * - `terminating` is running until `terminated`.\n * - `warning` is a success; the backend has no success/failure split.\n */\nconst QUEUE: StatusGroups<QueueJobStatus> = {\n running: ['created', 'waiting', 'processing', 'terminating'],\n successful: ['success', 'warning'],\n failed: ['error', 'cancelled', 'terminated'],\n};\n\n// Mirrors `JobState` in `go-monorepo` (`services/query/internal/repository/models`).\n// `canceled` with one `l`, unlike the other services.\nconst QUERY: StatusGroups<QueryJobStatus> = {\n running: ['created', 'enqueued', 'processing'],\n successful: ['completed'],\n failed: ['failed', 'canceled'],\n};\n\n/**\n * One service's status predicates, sets and named constants.\n *\n * - `isSuccessful` / `isFailed` are `false` while running.\n * - `isKnown` narrows an untyped string.\n * - `named` is asserted: `Object.fromEntries` can't prove the key mapping.\n */\nconst forService = <Status extends string>(groups: StatusGroups<Status>) => {\n const all = [...groups.running, ...groups.successful, ...groups.failed];\n\n const running: ReadonlySet<Status> = new Set(groups.running);\n const successful: ReadonlySet<Status> = new Set(groups.successful);\n const failed: ReadonlySet<Status> = new Set(groups.failed);\n const terminal: ReadonlySet<Status> = new Set([...groups.successful, ...groups.failed]);\n const known: ReadonlySet<string> = new Set<string>(all);\n\n return {\n isRunning: (status: Status) => running.has(status),\n isTerminal: (status: Status) => terminal.has(status),\n isSuccessful: (status: Status) => successful.has(status),\n isFailed: (status: Status) => failed.has(status),\n isKnown: (value: string): value is Status => known.has(value),\n describe: (status: Status) => ({\n isRunning: running.has(status),\n isTerminal: terminal.has(status),\n isSuccessful: successful.has(status),\n isFailed: failed.has(status),\n }),\n statuses: { running, successful, failed, terminal },\n named: Object.fromEntries(\n all.map((status) => [status.toUpperCase(), status]),\n ) as StatusNames<Status>,\n };\n};\n\n/**\n * Job statuses per service, e.g. `jobStatus.queue.isFailed(status)`.\n *\n * - Never merge services: labels overlap but their meaning differs.\n * - `query` covers the query job, not its statements (which have `notExecuted`).\n */\nexport const jobStatus = {\n storage: forService(STORAGE),\n queue: forService(QUEUE),\n query: forService(QUERY),\n};\n"],"mappings":";;;AAEA,MAAa,SAAS,SAAiB,WACrC,IAAI,SAAe,SAAS,WAAW;CACrC,IAAI,QAAQ,SAAS,OAAO,OAAO,iBAAiB,OAAO,MAAM,CAAC;CAElE,MAAM,gBAAgB;EACpB,aAAa,SAAS;EACtB,OAAO,iBAAiB,QAAQ,MAAM,CAAC;CACzC;CAKA,MAAM,YAAY,iBAAiB;EACjC,QAAQ,oBAAoB,SAAS,OAAO;EAC5C,QAAQ;CACV,GAAG,OAAO;CAEV,QAAQ,iBAAiB,SAAS,SAAS,EAAE,MAAM,KAAK,CAAC;AAC3D,CAAC;;;;;;;;;ACZH,MAAa,QAAW,SAAiD;CACvE,IAAI,QAAoC;CAGxC,MAAM,UAAU,YAAiC,MAAM,KAAK;CAE5D,aAAa;EACX,UAAU,QAAQ,CAAC,CAAC,OAAO,UAAmB;GAC5C,QAAQ;GACR,MAAM;EACR,CAAC;EACD,OAAO;CACT;AACF;;;ACbA,MAAa,WAAW,WACtB,kBAAkB,QAAQ,SAAS,IAAI,MAAM,OAAO,MAAM,GAAG,EAAE,OAAO,OAAO,CAAC;AAEhF,MAAM,WAAc,UAA+B;CAAE,SAAS;CAAM;AAAK;AACzE,MAAM,WAA4B,WAAgC;CAAE,SAAS;CAAO;AAAM;AAC1F,MAAM,aAAiC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1C,SAAS;EAAC;EAAW;EAAY;CAAY;CAC7C,YAAY,CAAC,WAAW;CACxB,QAAQ,CAAC,UAAU,UAAU;AAC/B;;;;;;;;AASA,MAAM,cAAqC,WAAiC;CAC1E,MAAM,MAAM;EAAC,GAAG,OAAO;EAAS,GAAG,OAAO;EAAY,GAAG,OAAO;CAAM;CAEtE,MAAM,UAA+B,IAAI,IAAI,OAAO,OAAO;CAC3D,MAAM,aAAkC,IAAI,IAAI,OAAO,UAAU;CACjE,MAAM,SAA8B,IAAI,IAAI,OAAO,MAAM;CACzD,MAAM,2BAAgC,IAAI,IAAI,CAAC,GAAG,OAAO,YAAY,GAAG,OAAO,MAAM,CAAC;CACtF,MAAM,QAA6B,IAAI,IAAY,GAAG;CAEtD,OAAO;EACL,YAAY,WAAmB,QAAQ,IAAI,MAAM;EACjD,aAAa,WAAmB,SAAS,IAAI,MAAM;EACnD,eAAe,WAAmB,WAAW,IAAI,MAAM;EACvD,WAAW,WAAmB,OAAO,IAAI,MAAM;EAC/C,UAAU,UAAmC,MAAM,IAAI,KAAK;EAC5D,WAAW,YAAoB;GAC7B,WAAW,QAAQ,IAAI,MAAM;GAC7B,YAAY,SAAS,IAAI,MAAM;GAC/B,cAAc,WAAW,IAAI,MAAM;GACnC,UAAU,OAAO,IAAI,MAAM;EAC7B;EACA,UAAU;GAAE;GAAS;GAAY;GAAQ;EAAS;EAClD,OAAO,OAAO,YACZ,IAAI,KAAK,WAAW,CAAC,OAAO,YAAY,GAAG,MAAM,CAAC,CACpD;CACF;AACF;;;;;;;AAQA,MAAa,YAAY;CACvB,SAAS,WAAW,OAAO;CAC3B,OAAO,WAAW,KAAK;CACvB,OAAO,WAAW,KAAK;AACzB"}
|
|
1
|
+
{"version":3,"file":"jobStatus-BJdbZ72V.js","names":[],"sources":["../src/utils/async/delay.ts","../src/utils/async/lazy.ts","../src/utils/async/result.ts","../src/utils/async/poll/utils.ts","../src/utils/async/poll/backoff.ts","../src/utils/async/poll/pollLoop.ts","../src/utils/async/poll/poll.ts","../src/domain/jobStatus.ts"],"sourcesContent":["import { createAbortError } from '../createAbortError';\n\nexport const delay = (timeout: number, signal?: AbortSignal) =>\n new Promise<void>((resolve, reject) => {\n if (signal?.aborted) return reject(createAbortError(signal.reason));\n\n const onAbort = () => {\n clearTimeout(timeoutId);\n reject(createAbortError(signal?.reason));\n };\n\n // `once: true` only detaches the listener once the event fires, so the timeout path has to\n // detach it explicitly — a caller reusing one signal across many delays (`poll` does) would\n // otherwise pile up a listener per delay for as long as the signal is alive.\n const timeoutId = setTimeout(() => {\n signal?.removeEventListener('abort', onAbort);\n resolve();\n }, timeout);\n\n signal?.addEventListener('abort', onAbort, { once: true });\n });\n","import type { TaskFn } from './types';\n\n/**\n * Runs `task` once and replays its promise to every later caller.\n *\n * - A rejection is not cached: the next call retries, so a transient failure never sticks.\n * - Callers that joined the failed run reject with its error.\n */\nexport const lazy = <T>(task: TaskFn<T>): (() => Promise<Awaited<T>>) => {\n let value: Promise<Awaited<T>> | null = null;\n\n // async wrapper so a synchronous throw from `task` rejects rather than throws.\n const runTask = async (): Promise<Awaited<T>> => await task();\n\n return () => {\n value ??= runTask().catch((error: unknown) => {\n value = null;\n throw error;\n });\n return value;\n };\n};\n","export type Success<T> = { success: true; data: T };\nexport type Failure<E extends Error> = { success: false; error: E };\nexport type Result<T, E extends Error = Error> = Success<T> | Failure<E>;\n\n// A task that returns a promise is a type error: the wrapper would report success before it\n// settles, and the rejection would go unhandled. Use the `*Async` sibling.\ntype NotPromise<T> = T extends PromiseLike<unknown> ? never : T;\n\nexport const asError = (thrown: unknown) =>\n thrown instanceof Error ? thrown : new Error(String(thrown), { cause: thrown });\n\nconst success = <T>(data: T): Result<T, never> => ({ success: true, data });\nconst failure = <E extends Error>(error: E): Result<never, E> => ({ success: false, error });\nconst isSuccess = <T, E extends Error>(result: Result<T, E>): result is Success<T> =>\n result.success;\nconst isFailure = <T, E extends Error>(result: Result<T, E>): result is Failure<E> =>\n !result.success;\n\nconst map = <T, E extends Error, U>(result: Result<T, E>, fn: (data: T) => U): Result<U, E> =>\n result.success ? success(fn(result.data)) : result;\n\nconst mapError = <T, E extends Error, F extends Error>(\n result: Result<T, E>,\n fn: (error: E) => F,\n): Result<T, F> => (result.success ? result : failure(fn(result.error)));\n\nconst andThen = <T, E extends Error, U, F extends Error>(\n result: Result<T, E>,\n fn: (data: T) => Result<U, F>,\n): Result<U, E | F> => (result.success ? fn(result.data) : result);\n\nconst match = <T, E extends Error, R>(\n result: Result<T, E>,\n onSuccess: (data: T) => R,\n onFailure: (error: E) => R,\n): R => (result.success ? onSuccess(result.data) : onFailure(result.error));\n\n// A side effect on a success; the result itself passes through untouched, same instance.\nconst tap = <T, E extends Error>(result: Result<T, E>, fn: (data: T) => void): Result<T, E> => {\n if (result.success) fn(result.data);\n return result;\n};\n\nconst unwrap = <T, E extends Error>(result: Result<T, E>): T => {\n if (result.success) return result.data;\n throw result.error;\n};\n\nconst unwrapOr = <T, E extends Error, U>(result: Result<T, E>, fallback: U): T | U =>\n result.success ? result.data : fallback;\n\nconst tryCatch = <T>(task: () => NotPromise<T>): Result<T> => {\n try {\n return success(task());\n } catch (thrown) {\n return failure(asError(thrown));\n }\n};\n\nconst tryCatchAsync = async <T>(task: () => T | PromiseLike<T>): Promise<Result<T>> => {\n try {\n return success(await task());\n } catch (thrown) {\n return failure(asError(thrown));\n }\n};\n\nconst fromThrowable =\n <A extends unknown[], R>(fn: (...args: A) => NotPromise<R>) =>\n (...args: A): Result<R> =>\n tryCatch(() => fn(...args));\n\nconst fromThrowableAsync =\n <A extends unknown[], R>(fn: (...args: A) => R | PromiseLike<R>) =>\n (...args: A): Promise<Result<R>> =>\n tryCatchAsync(() => fn(...args));\n\nexport const Result = {\n success,\n failure,\n isSuccess,\n isFailure,\n map,\n mapError,\n andThen,\n match,\n tap,\n unwrap,\n unwrapOr,\n tryCatch,\n tryCatchAsync,\n fromThrowable,\n fromThrowableAsync,\n};\n","/**\n * The longest delay a timer can hold: `setTimeout` takes a 32-bit signed number of milliseconds,\n * about 24.9 days.\n *\n * - Above it the delay wraps: Node warns and fires after 1 ms, so a long wait becomes a busy loop.\n * - It bounds a backoff curve and a poll's timeout alike, since both end up in a timer.\n */\nexport const MAX_TIMER_DELAY = 2 ** 31 - 1;\n\nexport const clamp = (value: number, min: number, max = Infinity) =>\n Math.min(Math.max(value, min), max);\n\nexport const finiteOr = (value: number, fallback: number) =>\n Number.isFinite(value) ? value : fallback;\n\n/** A signal that never aborts, so an input nobody gave costs no branch of its own. */\nexport const neverAborts = () => new AbortController().signal;\n","import { clamp, finiteOr, MAX_TIMER_DELAY } from './utils';\n\nexport type Jitter =\n | 'none' // delay\n | 'full' // [0, delay)\n | 'equal'; // [delay / 2, delay)\n\ntype Backoff =\n | { type: 'constant'; interval: number } // 3000, 3000, 3000, ...\n | { type: 'linear'; initialInterval: number; step: number } // 1000, 2000, 3000, …\n | { type: 'exponential'; initialInterval: number; factor?: number }; // 1000, 2000, 4000, 8000, …\n\ntype RandomFn = () => number;\ntype JitterFn = (delay: number) => number;\ntype BackoffFn = (attempt: number) => number;\n\nexport type BackoffDef = {\n jitter?: Jitter;\n maxInterval?: number;\n random?: RandomFn;\n} & Backoff;\n\nconst MIN_STEP = 500;\nconst MIN_FACTOR = 2;\nconst MIN_INTERVAL = 500;\n\nexport const createBackoff = ({\n jitter = 'none',\n maxInterval: _maxInterval = MAX_TIMER_DELAY,\n random = Math.random,\n ...backoff\n}: BackoffDef): BackoffFn => {\n const backoffFn: BackoffFn = (attempt) => {\n if (backoff.type === 'linear') {\n const interval = clamp(finiteOr(backoff.initialInterval, MIN_INTERVAL), MIN_INTERVAL);\n const step = clamp(finiteOr(backoff.step, MIN_STEP), MIN_STEP);\n\n return interval + step * (attempt - 1);\n }\n if (backoff.type === 'exponential') {\n const interval = clamp(finiteOr(backoff.initialInterval, MIN_INTERVAL), MIN_INTERVAL);\n const factor = clamp(finiteOr(backoff.factor ?? MIN_FACTOR, MIN_FACTOR), MIN_FACTOR);\n\n return interval * factor ** (attempt - 1);\n }\n\n return clamp(finiteOr(backoff.interval, MIN_INTERVAL), MIN_INTERVAL);\n };\n\n const jitterFn: JitterFn = (delay) => {\n if (jitter === 'none') return delay;\n if (jitter === 'full') return delay * random();\n return delay / 2 + (delay / 2) * random(); // equal\n };\n\n const maxInterval = clamp(finiteOr(_maxInterval, MAX_TIMER_DELAY), MIN_INTERVAL, MAX_TIMER_DELAY);\n return (_attempt) => {\n const attempt = clamp(finiteOr(Math.trunc(_attempt), 1), 1);\n const capped = Math.min(backoffFn(attempt), maxInterval);\n // Floored after the jitter, not before: `full` jitter multiplies by a random fraction, so a floor\n // applied to the curve alone leaves sub-millisecond gaps between attempts.\n return clamp(finiteOr(jitterFn(capped), MIN_INTERVAL), MIN_INTERVAL, maxInterval);\n };\n};\n","import { delay } from '../delay';\nimport { Result } from '../result';\n\nimport { type BackoffDef, createBackoff } from './backoff';\nimport { clamp, finiteOr, MAX_TIMER_DELAY, neverAborts } from './utils';\n\ntype Clock = {\n wait: (ms: number, signal?: AbortSignal) => Promise<void>;\n now: () => number;\n};\n\nexport type PollKey = readonly unknown[];\n\nexport type PollContext<K extends PollKey = PollKey> = {\n pollKey: K;\n attempt: number;\n elapsed: number;\n};\n\n/** The context plus the answer it is about: what `until` decides on, and what an ending reports. */\nexport type PollTick<T, K extends PollKey = PollKey> = PollContext<K> & { last: T | null };\n\nexport type PollResultState = 'done' | 'timedOut' | 'exhausted' | 'aborted' | 'errored';\n\nexport type PollResult<T, K extends PollKey = PollKey> = PollTick<T, K> &\n (\n | { state: 'done'; data: T }\n | { state: 'timedOut' | 'exhausted'; error?: Error }\n | { state: 'aborted'; reason?: unknown }\n | { state: 'errored'; error: Error }\n );\n\nexport type PollOptions<T, K extends PollKey = PollKey> = {\n pollKey?: K;\n pollFn: (context: PollContext<K> & { signal: AbortSignal }) => Promise<T>;\n until: (tick: PollTick<T, K> & { data: T }) => boolean;\n signal?: AbortSignal;\n backoff?: BackoffDef;\n isRetryable?: (error: Error) => boolean;\n maxAttempts?: number;\n timeout?: number;\n clock?: Clock;\n};\n\nconst pollResult = {\n done: <T, K extends PollKey>(data: T, context: PollTick<T, K>): PollResult<T, K> => ({\n state: 'done',\n data,\n ...context,\n last: data,\n }),\n errored: <T, K extends PollKey>(error: Error, context: PollTick<T, K>): PollResult<T, K> => ({\n state: 'errored',\n error,\n ...context,\n }),\n exhausted: <T, K extends PollKey>(context: PollTick<T, K>, error?: Error): PollResult<T, K> => ({\n state: 'exhausted',\n error,\n ...context,\n }),\n timedOut: <T, K extends PollKey>(context: PollTick<T, K>, error?: Error): PollResult<T, K> => ({\n state: 'timedOut',\n error,\n ...context,\n }),\n aborted: <T, K extends PollKey>(context: PollTick<T, K>, reason: unknown): PollResult<T, K> => ({\n state: 'aborted',\n reason,\n ...context,\n }),\n};\n\nexport const pollLoop = async <T, K extends PollKey = PollKey>({\n pollKey,\n pollFn: _pollFn,\n until: _until,\n signal: callerSignal = neverAborts(),\n backoff: backoffDef = { type: 'constant', interval: 3000 },\n clock = { wait: (ms, signal) => delay(ms, signal), now: () => performance.now() },\n isRetryable: _isRetryable = () => false,\n maxAttempts: _maxAttempts = Infinity,\n timeout: _timeout = Infinity,\n}: PollOptions<T, K>): Promise<PollResult<T, K>> => {\n // A deadline ends up in a timer, so a finite one is bounded by what a timer can hold. `Infinity`\n // is answered before the clamp: it means no deadline, and clamping would make it the longest one.\n const requested = finiteOr(_timeout, Infinity);\n const timeout = requested === Infinity ? Infinity : clamp(requested, 0, MAX_TIMER_DELAY);\n const maxAttempts = Math.trunc(clamp(finiteOr(_maxAttempts, Infinity), 0));\n\n const timeoutSignal = timeout === Infinity ? neverAborts() : AbortSignal.timeout(timeout);\n const anySignal = AbortSignal.any([callerSignal, timeoutSignal]);\n const anyAborted = Promise.withResolvers<never>();\n\n anySignal.addEventListener('abort', () => anyAborted.reject(anySignal.reason), {\n once: true,\n });\n void anyAborted.promise.catch(() => undefined);\n\n const backoffFn = createBackoff(backoffDef);\n const startedAt = clock.now();\n\n const until = Result.fromThrowable(_until);\n const isRetryable = Result.fromThrowable(_isRetryable);\n // A poll without a key has an empty one, and `K` is opaque in here — the one place the absent\n // case is materialised is the one place it has to be asserted.\n const key = pollKey ?? ([] as unknown as K);\n // Only what the context declares: a request is not handed the tick's `last` as well.\n const pollFn = ({ pollKey: key, attempt: at, elapsed }: PollContext<K>) =>\n Result.tryCatchAsync(() =>\n Promise.race([\n _pollFn({ pollKey: key, attempt: at, elapsed, signal: anySignal }),\n anyAborted.promise,\n ]),\n );\n const sleep = Result.fromThrowableAsync((ms: number) => clock.wait(ms, anySignal));\n\n let attempt = 0;\n // What a retry swallowed: the poll carries it to whichever ending runs out first.\n let last: T | null = null;\n let lastError: Error | undefined;\n const context = (at = clock.now() - startedAt): PollTick<T, K> => ({\n pollKey: key,\n attempt,\n elapsed: at,\n last,\n });\n\n if (attempt >= maxAttempts) return pollResult.exhausted<T, K>(context());\n\n while (true) {\n const before = context();\n if (timeoutSignal.aborted) return pollResult.timedOut(before, lastError);\n if (callerSignal.aborted) return pollResult.aborted(before, callerSignal.reason);\n\n attempt++;\n // The attempt it is, not the one before it — `before` was read to decide whether to make it.\n const poll = await pollFn({ ...before, attempt });\n\n // What the attempt produced, recorded before the tick that reports it: on any ending but `done`\n // these two are the only account of what the poll saw, and reading them one attempt behind is\n // reading the wrong answer.\n if (poll.success) last = poll.data;\n else lastError = poll.error;\n\n const after = context();\n if (timeoutSignal.aborted) return pollResult.timedOut(after, lastError);\n if (callerSignal.aborted) return pollResult.aborted(after, callerSignal.reason);\n\n if (!poll.success) {\n const canRetry = isRetryable(poll.error);\n\n // A predicate that throws cannot ask for a retry. The request's own failure stays the reported\n // one — it is the type a caller's guards expect — and the predicate's rides along as its cause.\n if (!canRetry.success) {\n poll.error.cause ??= canRetry.error;\n return pollResult.errored(poll.error, after);\n }\n if (!canRetry.data) return pollResult.errored(poll.error, after);\n }\n\n if (poll.success) {\n const isDone = until({ ...after, data: poll.data });\n if (!isDone.success) return pollResult.errored(isDone.error, after);\n if (isDone.data) return pollResult.done(poll.data, after);\n }\n\n // exhausted\n if (attempt >= maxAttempts) return pollResult.exhausted(after, lastError);\n\n // sleep\n const backoff = backoffFn(attempt);\n if (after.elapsed + backoff >= timeout) return pollResult.timedOut(after, lastError);\n\n const slept = await sleep(backoff);\n if (!slept.success) {\n const afterSleep = context();\n if (timeoutSignal.aborted) return pollResult.timedOut(afterSleep, lastError);\n if (callerSignal.aborted) return pollResult.aborted(afterSleep, callerSignal.reason);\n\n return pollResult.errored(slept.error, afterSleep);\n }\n }\n};\n","import { createAbortError } from '../../createAbortError';\nimport { createEmitter, createStore } from '../../store';\nimport { lazy } from '../lazy';\n\nimport {\n type PollKey,\n pollLoop,\n type PollOptions,\n type PollResult,\n type PollResultState,\n type PollTick,\n} from './pollLoop';\nimport { neverAborts } from './utils';\n\nexport type PollState = 'idle' | 'polling' | PollResultState;\nexport type PollSnapshot = PollTick<unknown> & { state: PollState };\n\ntype OnFailure<T> = (result: PollResult<T>) => Error | undefined;\n\nexport type PollerStartFn<T> = () => Promise<PollResult<T>>;\nexport type PollerStopFn = (reason?: string) => void;\ntype PollerSubscribeFn = (listener: (snapshot: PollSnapshot) => void) => () => void;\ntype PollerDebugFn = () => PollSnapshot;\ntype PollerUnwrapFn<T> = (onFailure?: OnFailure<T>) => Promise<T>;\nexport type Poller<T> = {\n readonly state: PollState;\n start: PollerStartFn<T>;\n unwrap: PollerUnwrapFn<T>;\n stop: PollerStopFn;\n subscribe: PollerSubscribeFn;\n debug: PollerDebugFn;\n};\n\nexport type PollTask<T> = Promise<PollResult<T>> &\n Pick<Poller<T>, 'unwrap' | 'stop' | 'subscribe' | 'debug'>;\n\nexport type ObservedPoller = Pick<Poller<unknown>, 'stop' | 'subscribe' | 'debug' | 'start'>;\n\nexport const emitter = createEmitter<ObservedPoller>();\n\nexport const failureOf = (result: PollResult<unknown>): Error => {\n if ('error' in result && result.error) return result.error;\n\n if (result.state === 'aborted') {\n if (result.reason instanceof Error) return result.reason;\n\n return createAbortError(\n typeof result.reason === 'string' ? result.reason : 'The poll was stopped.',\n );\n }\n\n return new Error(`The poll ${result.state} after ${result.attempt} attempts.`);\n};\n\nexport const poller = <T, K extends PollKey = PollKey>({\n pollKey,\n signal,\n until,\n ...pollLoopOptions\n}: PollOptions<T, K>): Poller<T> => {\n const callerSignal = signal ?? neverAborts();\n const pollerSignal = new AbortController();\n const anySignal = AbortSignal.any([pollerSignal.signal, callerSignal]);\n\n // snapshoting\n const snapshot = createStore<PollSnapshot>({\n pollKey: pollKey ?? [],\n state: 'idle',\n attempt: 0,\n elapsed: 0,\n last: null,\n });\n const updateSnapshot = (next: Partial<PollSnapshot>) =>\n snapshot.set({ ...snapshot.get(), ...next });\n\n const handleUntil = (context: PollTick<T, K> & { data: T }) => {\n updateSnapshot({ attempt: context.attempt, elapsed: context.elapsed, last: context.data });\n return until(context);\n };\n\n const start: PollerStartFn<T> = lazy(async () => {\n updateSnapshot({ state: 'polling' });\n const result = await pollLoop({\n ...pollLoopOptions,\n pollKey,\n until: handleUntil,\n signal: anySignal,\n });\n // The result knows what a tick cannot: attempts that failed, and the time the ending itself took.\n snapshot.set({\n pollKey: result.pollKey,\n state: result.state,\n attempt: result.attempt,\n elapsed: result.elapsed,\n last: result.last,\n });\n return result;\n });\n\n const stop: PollerStopFn = (reason) => pollerSignal.abort(reason);\n const subscribe: PollerSubscribeFn = (listener) =>\n snapshot.subscribe(() => listener(snapshot.get()));\n const debug: PollerDebugFn = snapshot.get;\n\n const unwrap: PollerUnwrapFn<T> = async (onFailure) => {\n const result = await start();\n if (result.state === 'done') return result.data;\n throw onFailure?.(result) ?? failureOf(result);\n };\n\n const controls = {\n stop,\n subscribe,\n debug,\n start,\n };\n\n emitter.emit(controls);\n\n return {\n get state() {\n return snapshot.get().state;\n },\n unwrap,\n ...controls,\n };\n};\n\nexport const poll = <T, K extends PollKey = PollKey>(options: PollOptions<T, K>): PollTask<T> => {\n const p = poller(options);\n\n return Object.assign(p.start(), {\n unwrap: p.unwrap,\n stop: p.stop,\n subscribe: p.subscribe,\n debug: p.debug,\n });\n};\n","import type { QueryJobStatus } from '../clients/queryService/types';\nimport type { QueueJobStatus } from '../clients/queue/types';\nimport type { StorageJobStatus } from '../clients/storage/jobs/types';\n\n/**\n * One service's statuses split by what the job is doing.\n *\n * - Groups are disjoint and cover the vocabulary; terminal = successful + failed.\n * - The annotation makes a renamed generated status fail the build here.\n */\ntype StatusGroups<Status extends string> = {\n running: readonly Status[];\n successful: readonly Status[];\n failed: readonly Status[];\n};\n\n/** A service's statuses as named constants — `SUCCESS: 'success'`. */\ntype StatusNames<Status extends string> = { [K in Status as Uppercase<K>]: K };\n\n// Mirrors `StorageJobStatus` in `connection`.\nconst STORAGE: StatusGroups<StorageJobStatus> = {\n running: ['waiting', 'processing'],\n successful: ['success'],\n failed: ['error'],\n};\n\n/**\n * Mirrors `PlainJobInterface` in `job-queue-internal-api-php-client`.\n *\n * - `terminating` is running until `terminated`.\n * - The split mirrors the job's `isSuccess`; with a job in hand, read `job.isSuccess` instead.\n */\nconst QUEUE: StatusGroups<QueueJobStatus> = {\n running: ['created', 'waiting', 'processing', 'terminating'],\n successful: ['success', 'warning'],\n failed: ['error', 'cancelled', 'terminated'],\n};\n\n// Mirrors `JobState` in `go-monorepo` (`services/query/internal/repository/models`).\n// `canceled` with one `l`, unlike the other services.\nconst QUERY: StatusGroups<QueryJobStatus> = {\n running: ['created', 'enqueued', 'processing'],\n successful: ['completed'],\n failed: ['failed', 'canceled'],\n};\n\n/**\n * One service's status predicates, sets and named constants.\n *\n * - `isSuccessful` / `isFailed` are `false` while running.\n * - `isKnown` narrows an untyped string.\n * - `named` is asserted: `Object.fromEntries` can't prove the key mapping.\n */\nconst forService = <Status extends string>(groups: StatusGroups<Status>) => {\n const all = [...groups.running, ...groups.successful, ...groups.failed];\n\n const running: ReadonlySet<Status> = new Set(groups.running);\n const successful: ReadonlySet<Status> = new Set(groups.successful);\n const failed: ReadonlySet<Status> = new Set(groups.failed);\n const terminal: ReadonlySet<Status> = new Set([...groups.successful, ...groups.failed]);\n const known: ReadonlySet<string> = new Set<string>(all);\n\n return {\n isRunning: (status: Status) => running.has(status),\n isTerminal: (status: Status) => terminal.has(status),\n isSuccessful: (status: Status) => successful.has(status),\n isFailed: (status: Status) => failed.has(status),\n isKnown: (value: string): value is Status => known.has(value),\n describe: (status: Status) => ({\n isRunning: running.has(status),\n isTerminal: terminal.has(status),\n isSuccessful: successful.has(status),\n isFailed: failed.has(status),\n }),\n statuses: { running, successful, failed, terminal },\n named: Object.fromEntries(\n all.map((status) => [status.toUpperCase(), status]),\n ) as StatusNames<Status>,\n };\n};\n\n/**\n * Job statuses per service, e.g. `jobStatus.queue.isFailed(status)`.\n *\n * - Never merge services: labels overlap but their meaning differs.\n * - `query` covers the query job, not its statements (which have `notExecuted`).\n */\nexport const jobStatus = {\n storage: forService(STORAGE),\n queue: forService(QUEUE),\n query: forService(QUERY),\n};\n"],"mappings":";;;AAEA,MAAa,SAAS,SAAiB,WACrC,IAAI,SAAe,SAAS,WAAW;CACrC,IAAI,QAAQ,SAAS,OAAO,OAAO,iBAAiB,OAAO,MAAM,CAAC;CAElE,MAAM,gBAAgB;EACpB,aAAa,SAAS;EACtB,OAAO,iBAAiB,QAAQ,MAAM,CAAC;CACzC;CAKA,MAAM,YAAY,iBAAiB;EACjC,QAAQ,oBAAoB,SAAS,OAAO;EAC5C,QAAQ;CACV,GAAG,OAAO;CAEV,QAAQ,iBAAiB,SAAS,SAAS,EAAE,MAAM,KAAK,CAAC;AAC3D,CAAC;;;;;;;;;ACZH,MAAa,QAAW,SAAiD;CACvE,IAAI,QAAoC;CAGxC,MAAM,UAAU,YAAiC,MAAM,KAAK;CAE5D,aAAa;EACX,UAAU,QAAQ,CAAC,CAAC,OAAO,UAAmB;GAC5C,QAAQ;GACR,MAAM;EACR,CAAC;EACD,OAAO;CACT;AACF;;;ACbA,MAAa,WAAW,WACtB,k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WAAW,KAAK;AACzB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as createMetastoreClient, t as MetastoreFetchClient } from "../index-
|
|
1
|
+
import { n as createMetastoreClient, t as MetastoreFetchClient } from "../index-BKOFRmTB.cjs";
|
|
2
2
|
export { MetastoreFetchClient, createMetastoreClient };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as createMetastoreClient, t as MetastoreFetchClient } from "../index-
|
|
1
|
+
import { n as createMetastoreClient, t as MetastoreFetchClient } from "../index-DtuwWYDR.js";
|
|
2
2
|
export { MetastoreFetchClient, createMetastoreClient };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as ReplaceMetaObjectPath, C as MetaObjectMeta, D as RawMetaObject, E as MetaStoreObjectResponse, F as UpdateMetaObjectBody, I as UpdateMetaObjectInput, L as UpdateMetaObjectPath, M as ReplaceTargetProjectsInput, N as ReplaceTargetProjectsPath, O as ReplaceMetaObjectBody, P as ScopeElevationRequestPath, S as MetaObject, T as MetaStoreListResponse, _ as GetMetaObjectsQuery, a as CreateMetaObjectPath, b as GetOrganizationMetaObjectsQuery, c as DeleteMetaObjectRevisionPath, d as GetMetaObjectRevisionsInput, f as GetMetaObjectRevisionsPath, g as GetMetaObjectsPath, h as GetMetaObjectsInput, i as CreateMetaObjectInput, j as ReplaceTargetProjectsBody, k as ReplaceMetaObjectInput, l as GetMetaObjectPath, m as GetMetaObjectRevisionsSchemaQuery, n as GetVersionedSchemaPath, o as CreateMetaObjectReturn, p as GetMetaObjectRevisionsQuery, r as CreateMetaObjectBody, s as DeleteMetaObjectPath, t as GetSchemaPath, u as GetMetaObjectRevisionPath, v as GetMetaObjectsSchemaQuery, w as MetaObjectScope, x as GetOrganizationMetaObjectsSchemaQuery, y as GetOrganizationMetaObjectsPath } from "../types-
|
|
1
|
+
import { A as ReplaceMetaObjectPath, C as MetaObjectMeta, D as RawMetaObject, E as MetaStoreObjectResponse, F as UpdateMetaObjectBody, I as UpdateMetaObjectInput, L as UpdateMetaObjectPath, M as ReplaceTargetProjectsInput, N as ReplaceTargetProjectsPath, O as ReplaceMetaObjectBody, P as ScopeElevationRequestPath, S as MetaObject, T as MetaStoreListResponse, _ as GetMetaObjectsQuery, a as CreateMetaObjectPath, b as GetOrganizationMetaObjectsQuery, c as DeleteMetaObjectRevisionPath, d as GetMetaObjectRevisionsInput, f as GetMetaObjectRevisionsPath, g as GetMetaObjectsPath, h as GetMetaObjectsInput, i as CreateMetaObjectInput, j as ReplaceTargetProjectsBody, k as ReplaceMetaObjectInput, l as GetMetaObjectPath, m as GetMetaObjectRevisionsSchemaQuery, n as GetVersionedSchemaPath, o as CreateMetaObjectReturn, p as GetMetaObjectRevisionsQuery, r as CreateMetaObjectBody, s as DeleteMetaObjectPath, t as GetSchemaPath, u as GetMetaObjectRevisionPath, v as GetMetaObjectsSchemaQuery, w as MetaObjectScope, x as GetOrganizationMetaObjectsSchemaQuery, y as GetOrganizationMetaObjectsPath } from "../types-tgU8XvPs.cjs";
|
|
2
2
|
export type { CreateMetaObjectBody, CreateMetaObjectInput, CreateMetaObjectPath, CreateMetaObjectReturn, DeleteMetaObjectPath, DeleteMetaObjectRevisionPath, GetMetaObjectPath, GetMetaObjectRevisionPath, GetMetaObjectRevisionsInput, GetMetaObjectRevisionsPath, GetMetaObjectRevisionsQuery, GetMetaObjectRevisionsSchemaQuery, GetMetaObjectsInput, GetMetaObjectsPath, GetMetaObjectsQuery, GetMetaObjectsSchemaQuery, GetOrganizationMetaObjectsPath, GetOrganizationMetaObjectsQuery, GetOrganizationMetaObjectsSchemaQuery, GetSchemaPath, GetVersionedSchemaPath, MetaObject, MetaObjectMeta, MetaObjectScope, MetaStoreListResponse, MetaStoreObjectResponse, RawMetaObject, ReplaceMetaObjectBody, ReplaceMetaObjectInput, ReplaceMetaObjectPath, ReplaceTargetProjectsBody, ReplaceTargetProjectsInput, ReplaceTargetProjectsPath, ScopeElevationRequestPath, UpdateMetaObjectBody, UpdateMetaObjectInput, UpdateMetaObjectPath };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as ReplaceMetaObjectPath, C as MetaObjectMeta, D as RawMetaObject, E as MetaStoreObjectResponse, F as UpdateMetaObjectBody, I as UpdateMetaObjectInput, L as UpdateMetaObjectPath, M as ReplaceTargetProjectsInput, N as ReplaceTargetProjectsPath, O as ReplaceMetaObjectBody, P as ScopeElevationRequestPath, S as MetaObject, T as MetaStoreListResponse, _ as GetMetaObjectsQuery, a as CreateMetaObjectPath, b as GetOrganizationMetaObjectsQuery, c as DeleteMetaObjectRevisionPath, d as GetMetaObjectRevisionsInput, f as GetMetaObjectRevisionsPath, g as GetMetaObjectsPath, h as GetMetaObjectsInput, i as CreateMetaObjectInput, j as ReplaceTargetProjectsBody, k as ReplaceMetaObjectInput, l as GetMetaObjectPath, m as GetMetaObjectRevisionsSchemaQuery, n as GetVersionedSchemaPath, o as CreateMetaObjectReturn, p as GetMetaObjectRevisionsQuery, r as CreateMetaObjectBody, s as DeleteMetaObjectPath, t as GetSchemaPath, u as GetMetaObjectRevisionPath, v as GetMetaObjectsSchemaQuery, w as MetaObjectScope, x as GetOrganizationMetaObjectsSchemaQuery, y as GetOrganizationMetaObjectsPath } from "../types-
|
|
1
|
+
import { A as ReplaceMetaObjectPath, C as MetaObjectMeta, D as RawMetaObject, E as MetaStoreObjectResponse, F as UpdateMetaObjectBody, I as UpdateMetaObjectInput, L as UpdateMetaObjectPath, M as ReplaceTargetProjectsInput, N as ReplaceTargetProjectsPath, O as ReplaceMetaObjectBody, P as ScopeElevationRequestPath, S as MetaObject, T as MetaStoreListResponse, _ as GetMetaObjectsQuery, a as CreateMetaObjectPath, b as GetOrganizationMetaObjectsQuery, c as DeleteMetaObjectRevisionPath, d as GetMetaObjectRevisionsInput, f as GetMetaObjectRevisionsPath, g as GetMetaObjectsPath, h as GetMetaObjectsInput, i as CreateMetaObjectInput, j as ReplaceTargetProjectsBody, k as ReplaceMetaObjectInput, l as GetMetaObjectPath, m as GetMetaObjectRevisionsSchemaQuery, n as GetVersionedSchemaPath, o as CreateMetaObjectReturn, p as GetMetaObjectRevisionsQuery, r as CreateMetaObjectBody, s as DeleteMetaObjectPath, t as GetSchemaPath, u as GetMetaObjectRevisionPath, v as GetMetaObjectsSchemaQuery, w as MetaObjectScope, x as GetOrganizationMetaObjectsSchemaQuery, y as GetOrganizationMetaObjectsPath } from "../types-B-5ya_L5.js";
|
|
2
2
|
export type { CreateMetaObjectBody, CreateMetaObjectInput, CreateMetaObjectPath, CreateMetaObjectReturn, DeleteMetaObjectPath, DeleteMetaObjectRevisionPath, GetMetaObjectPath, GetMetaObjectRevisionPath, GetMetaObjectRevisionsInput, GetMetaObjectRevisionsPath, GetMetaObjectRevisionsQuery, GetMetaObjectRevisionsSchemaQuery, GetMetaObjectsInput, GetMetaObjectsPath, GetMetaObjectsQuery, GetMetaObjectsSchemaQuery, GetOrganizationMetaObjectsPath, GetOrganizationMetaObjectsQuery, GetOrganizationMetaObjectsSchemaQuery, GetSchemaPath, GetVersionedSchemaPath, MetaObject, MetaObjectMeta, MetaObjectScope, MetaStoreListResponse, MetaStoreObjectResponse, RawMetaObject, ReplaceMetaObjectBody, ReplaceMetaObjectInput, ReplaceMetaObjectPath, ReplaceTargetProjectsBody, ReplaceTargetProjectsInput, ReplaceTargetProjectsPath, ScopeElevationRequestPath, UpdateMetaObjectBody, UpdateMetaObjectInput, UpdateMetaObjectPath };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_queryService = require("../queryService-
|
|
2
|
+
const require_queryService = require("../queryService-RlNYw7LG.cjs");
|
|
3
3
|
exports.createQueryServiceClient = require_queryService.createQueryServiceClient;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createQueryServiceClient } from "../index-
|
|
1
|
+
import { t as createQueryServiceClient } from "../index-CGFGd3tF.cjs";
|
|
2
2
|
export { createQueryServiceClient };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createQueryServiceClient } from "../index-
|
|
1
|
+
import { t as createQueryServiceClient } from "../index-Bl2EloC0.js";
|
|
2
2
|
export { createQueryServiceClient };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createQueryServiceClient } from "../queryService-
|
|
1
|
+
import { t as createQueryServiceClient } from "../queryService-Blfz59Ms.js";
|
|
2
2
|
export { createQueryServiceClient };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as poller, t as jobStatus } from "./jobStatus-
|
|
1
|
+
import { a as poller, t as jobStatus } from "./jobStatus-BJdbZ72V.js";
|
|
2
2
|
import { f as parseContentDispositionHeader, s as HttpHeader } from "./createFetchClient-DITkTV2k.js";
|
|
3
3
|
import { t as createGenericFetchClient } from "./createGenericFetchClient-KqiJhw8G.js";
|
|
4
4
|
import { t as createOpenapiFetchClient } from "./createOpenapiFetchClient-wq8iGLZM.js";
|
|
@@ -111,4 +111,4 @@ const createQueryServiceClient = ({ baseUrl, middlewares, auth }) => {
|
|
|
111
111
|
//#endregion
|
|
112
112
|
export { createQueryServiceClient as t };
|
|
113
113
|
|
|
114
|
-
//# sourceMappingURL=queryService-
|
|
114
|
+
//# sourceMappingURL=queryService-Blfz59Ms.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryService-
|
|
1
|
+
{"version":3,"file":"queryService-Blfz59Ms.js","names":[],"sources":["../src/clients/queryService/poller.ts","../src/clients/queryService/queryServiceClient.ts"],"sourcesContent":["import { jobStatus } from '../../domain/jobStatus';\nimport { poller } from '../../utils/async';\n\nimport type { GetQueryJobPath, JobStatusResponse } from './types';\n\nconst DEFAULT_POLL_INTERVAL = 2000;\n\ntype QueryJobPollOptions = {\n interval?: number;\n maxAttempts?: number;\n timeout?: number;\n signal?: AbortSignal;\n};\n\ntype GetQueryJob = (\n queryJobId: GetQueryJobPath['queryJobId'],\n signal?: AbortSignal,\n) => Promise<JobStatusResponse>;\n\n/**\n * Waits on a query job.\n *\n * - Takes the job rather than its id, so a caller hands over what `createQueryJob` gave it.\n * - The request reads the id off the key rather than out of a closure, which is what makes the key\n * the whole input.\n * - Terminal is the job's own terminal set, not its statements': a `completed` job can still hold a\n * statement that failed, and what that means is the caller's business.\n */\nexport const createJobPoller =\n ({ getQueryJob }: { getQueryJob: GetQueryJob }) =>\n (\n { id }: { id: GetQueryJobPath['queryJobId'] },\n { interval, maxAttempts, timeout, signal }: QueryJobPollOptions = {},\n ) =>\n poller({\n pollKey: ['queryService.job', { queryJobId: id }] as const,\n pollFn: ({ pollKey: [, params], signal: pollSignal }) =>\n getQueryJob(params.queryJobId, pollSignal),\n until: ({ data }) => jobStatus.query.isTerminal(data.status),\n backoff: { type: 'constant', interval: interval ?? DEFAULT_POLL_INTERVAL },\n maxAttempts,\n timeout,\n signal,\n });\n","import {\n createGenericFetchClient,\n createOpenapiFetchClient,\n HttpHeader,\n parseContentDispositionHeader,\n} from '../../fetchClient';\nimport { createAuthHeaders } from '../auth';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport { createJobPoller } from './poller';\nimport type {\n ExportResultsResponse,\n GetExportResultsQuery,\n GetQueriesHistoryQuery,\n GetQueriesPath,\n GetQueryJobPath,\n GetQueryResultsPath,\n GetQueryResutsQuery,\n PostCancelQueryJobPath,\n PostQueryBody,\n PostQueryPath,\n} from './types';\n\nexport const createQueryServiceClient = ({ baseUrl, middlewares, auth }: ClientInitOptions) => {\n const client = createOpenapiFetchClient<paths>({\n baseUrl,\n middlewares,\n headers: createAuthHeaders(auth),\n });\n const genericClient = createGenericFetchClient({ baseUrl, middlewares });\n\n const createQueryJob = async (\n branchId: PostQueryPath['branchId'],\n workspaceId: PostQueryPath['workspaceId'],\n body: PostQueryBody,\n ) => {\n const { data } = await client.post(\n '/api/v1/branches/{branchId}/workspaces/{workspaceId}/queries',\n { path: { branchId, workspaceId }, body },\n );\n\n return data;\n };\n\n const cancelQueryJob = async (queryJobId: PostCancelQueryJobPath['queryJobId']) => {\n const { data } = await client.post('/api/v1/queries/{queryJobId}/cancel', {\n path: { queryJobId },\n body: { reason: 'Cancelled by user' },\n });\n\n return data;\n };\n\n const getQueryJob = async (queryJobId: GetQueryJobPath['queryJobId'], signal?: AbortSignal) => {\n const { data } = await client.get(\n '/api/v1/queries/{queryJobId}',\n { path: { queryJobId } },\n { signal },\n );\n\n return data;\n };\n\n const getQueryResults = async (\n queryJobId: GetQueryResultsPath['queryJobId'],\n statementId: GetQueryResultsPath['statementId'],\n query?: GetQueryResutsQuery,\n ) => {\n const { data } = await client.get('/api/v1/queries/{queryJobId}/{statementId}/results', {\n path: { queryJobId, statementId },\n query,\n });\n\n return data;\n };\n\n const getQueryHistory = async (\n branchId: GetQueriesPath['branchId'],\n workspaceId: GetQueriesPath['workspaceId'],\n query?: GetQueriesHistoryQuery,\n ) => {\n const { data } = await client.get(\n '/api/v1/branches/{branchId}/workspaces/{workspaceId}/queries',\n {\n path: { branchId, workspaceId },\n query,\n },\n );\n\n return data;\n };\n\n const exportResults = async (\n queryJobId: GetQueryResultsPath['queryJobId'],\n statementId: GetQueryResultsPath['statementId'],\n query: GetExportResultsQuery,\n signal?: AbortSignal,\n ): Promise<ExportResultsResponse> => {\n const { data, response } = await client.get(\n '/api/v1/queries/{queryJobId}/{statementId}/export',\n {\n path: { queryJobId, statementId },\n query,\n },\n { signal },\n );\n\n const mimeType = response.headers.get(HttpHeader.CONTENT_TYPE) ?? 'text/csv';\n const contentDisposition = parseContentDispositionHeader(\n response.headers.get(HttpHeader.CONTENT_DISPOSITION),\n );\n\n return {\n mimeType,\n content: data,\n fileName: contentDisposition?.filename ?? 'export.csv',\n };\n };\n\n const healthCheck = async (signal?: AbortSignal) => {\n const { data } = await genericClient.get('/health-check', {}, { signal });\n\n return data;\n };\n\n // Every wait on a query job is the same wait, so it is the client's rather than a caller's.\n const poller = createJobPoller({ getQueryJob });\n\n return {\n healthCheck,\n poller,\n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AAM;IAAE;IAAY;GAAY;GAChC;EACF,CAAC;EAED,OAAO;CACT;CAEA,MAAM,kBAAkB,OACtB,UACA,aACA,UACG;EACH,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,gEACA;GACE,MAAM;IAAE;IAAU;GAAY;GAC9B;EACF,CACF;EAEA,OAAO;CACT;CAEA,MAAM,gBAAgB,OACpB,YACA,aACA,OACA,WACmC;EACnC,MAAM,EAAE,MAAM,aAAa,MAAM,OAAO,IACtC,qDACA;GACE,MAAM;IAAE;IAAY;GAAY;GAChC;EACF,GACA,EAAE,OAAO,CACX;EAOA,OAAO;GACL,UANe,SAAS,QAAQ,IAAI,WAAW,YAAY,KAAK;GAOhE,SAAS;GACT,UAPyB,8BACzB,SAAS,QAAQ,IAAI,WAAW,mBAAmB,CAMxB,CAAC,EAAE,YAAY;EAC5C;CACF;CAEA,MAAM,cAAc,OAAO,WAAyB;EAClD,MAAM,EAAE,SAAS,MAAM,cAAc,IAAI,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC;EAExE,OAAO;CACT;CAKA,OAAO;EACL;EACA,QAJa,gBAAgB,EAAE,YAAY,CAItC;EACL;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_jobStatus = require("./jobStatus-
|
|
1
|
+
const require_jobStatus = require("./jobStatus-B0E-MZ9I.cjs");
|
|
2
2
|
const require_createFetchClient = require("./createFetchClient-ClWD4ua3.cjs");
|
|
3
3
|
const require_createGenericFetchClient = require("./createGenericFetchClient-B81Iezpb.cjs");
|
|
4
4
|
const require_createOpenapiFetchClient = require("./createOpenapiFetchClient-CioTX11-.cjs");
|
|
@@ -116,4 +116,4 @@ Object.defineProperty(exports, "createQueryServiceClient", {
|
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
118
|
|
|
119
|
-
//# sourceMappingURL=queryService-
|
|
119
|
+
//# sourceMappingURL=queryService-RlNYw7LG.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryService-
|
|
1
|
+
{"version":3,"file":"queryService-RlNYw7LG.cjs","names":["poller","jobStatus","createOpenapiFetchClient","createAuthHeaders","createGenericFetchClient","HttpHeader","parseContentDispositionHeader"],"sources":["../src/clients/queryService/poller.ts","../src/clients/queryService/queryServiceClient.ts"],"sourcesContent":["import { jobStatus } from '../../domain/jobStatus';\nimport { poller } from '../../utils/async';\n\nimport type { GetQueryJobPath, JobStatusResponse } from './types';\n\nconst DEFAULT_POLL_INTERVAL = 2000;\n\ntype QueryJobPollOptions = {\n interval?: number;\n maxAttempts?: number;\n timeout?: number;\n signal?: AbortSignal;\n};\n\ntype GetQueryJob = (\n queryJobId: GetQueryJobPath['queryJobId'],\n signal?: AbortSignal,\n) => Promise<JobStatusResponse>;\n\n/**\n * Waits on a query job.\n *\n * - Takes the job rather than its id, so a caller hands over what `createQueryJob` gave it.\n * - The request reads the id off the key rather than out of a closure, which is what makes the key\n * the whole input.\n * - Terminal is the job's own terminal set, not its statements': a `completed` job can still hold a\n * statement that failed, and what that means is the caller's business.\n */\nexport const createJobPoller =\n ({ getQueryJob }: { getQueryJob: GetQueryJob }) =>\n (\n { id }: { id: GetQueryJobPath['queryJobId'] },\n { interval, maxAttempts, timeout, signal }: QueryJobPollOptions = {},\n ) =>\n poller({\n pollKey: ['queryService.job', { queryJobId: id }] as const,\n pollFn: ({ pollKey: [, params], signal: pollSignal }) =>\n getQueryJob(params.queryJobId, pollSignal),\n until: ({ data }) => jobStatus.query.isTerminal(data.status),\n backoff: { type: 'constant', interval: interval ?? DEFAULT_POLL_INTERVAL },\n maxAttempts,\n timeout,\n signal,\n });\n","import {\n createGenericFetchClient,\n createOpenapiFetchClient,\n HttpHeader,\n parseContentDispositionHeader,\n} from '../../fetchClient';\nimport { createAuthHeaders } from '../auth';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport { createJobPoller } from './poller';\nimport type {\n ExportResultsResponse,\n GetExportResultsQuery,\n GetQueriesHistoryQuery,\n GetQueriesPath,\n GetQueryJobPath,\n GetQueryResultsPath,\n GetQueryResutsQuery,\n PostCancelQueryJobPath,\n PostQueryBody,\n PostQueryPath,\n} from './types';\n\nexport const createQueryServiceClient = ({ baseUrl, middlewares, auth }: ClientInitOptions) => {\n const client = createOpenapiFetchClient<paths>({\n baseUrl,\n middlewares,\n headers: createAuthHeaders(auth),\n });\n const genericClient = createGenericFetchClient({ baseUrl, middlewares });\n\n const createQueryJob = async (\n branchId: PostQueryPath['branchId'],\n workspaceId: PostQueryPath['workspaceId'],\n body: PostQueryBody,\n ) => {\n const { data } = await client.post(\n '/api/v1/branches/{branchId}/workspaces/{workspaceId}/queries',\n { path: { branchId, workspaceId }, body },\n );\n\n return data;\n };\n\n const cancelQueryJob = async (queryJobId: PostCancelQueryJobPath['queryJobId']) => {\n const { data } = await client.post('/api/v1/queries/{queryJobId}/cancel', {\n path: { queryJobId },\n body: { reason: 'Cancelled by user' },\n });\n\n return data;\n };\n\n const getQueryJob = async (queryJobId: GetQueryJobPath['queryJobId'], signal?: AbortSignal) => {\n const { data } = await client.get(\n '/api/v1/queries/{queryJobId}',\n { path: { queryJobId } },\n { signal },\n );\n\n return data;\n };\n\n const getQueryResults = async (\n queryJobId: GetQueryResultsPath['queryJobId'],\n statementId: GetQueryResultsPath['statementId'],\n query?: GetQueryResutsQuery,\n ) => {\n const { data } = await client.get('/api/v1/queries/{queryJobId}/{statementId}/results', {\n path: { queryJobId, statementId },\n query,\n });\n\n return data;\n };\n\n const getQueryHistory = async (\n branchId: GetQueriesPath['branchId'],\n workspaceId: GetQueriesPath['workspaceId'],\n query?: GetQueriesHistoryQuery,\n ) => {\n const { data } = await client.get(\n '/api/v1/branches/{branchId}/workspaces/{workspaceId}/queries',\n {\n path: { branchId, workspaceId },\n query,\n },\n );\n\n return data;\n };\n\n const exportResults = async (\n queryJobId: GetQueryResultsPath['queryJobId'],\n statementId: GetQueryResultsPath['statementId'],\n query: GetExportResultsQuery,\n signal?: AbortSignal,\n ): Promise<ExportResultsResponse> => {\n const { data, response } = await client.get(\n '/api/v1/queries/{queryJobId}/{statementId}/export',\n {\n path: { queryJobId, statementId },\n query,\n },\n { signal },\n );\n\n const mimeType = response.headers.get(HttpHeader.CONTENT_TYPE) ?? 'text/csv';\n const contentDisposition = parseContentDispositionHeader(\n response.headers.get(HttpHeader.CONTENT_DISPOSITION),\n );\n\n return {\n mimeType,\n content: data,\n fileName: contentDisposition?.filename ?? 'export.csv',\n };\n };\n\n const healthCheck = async (signal?: AbortSignal) => {\n const { data } = await genericClient.get('/health-check', {}, { signal });\n\n return data;\n };\n\n // Every wait on a query job is the same wait, so it is the client's rather than a caller's.\n const poller = createJobPoller({ getQueryJob });\n\n return {\n healthCheck,\n poller,\n createQueryJob,\n cancelQueryJob,\n getQueryJob,\n getQueryResults,\n getQueryHistory,\n exportResults,\n };\n};\n"],"mappings":";;;;;;AAKA,MAAM,wBAAwB;;;;;;;;;;AAuB9B,MAAa,mBACV,EAAE,mBAED,EAAE,MACF,EAAE,UAAU,aAAa,SAAS,WAAgC,CAAC,MAEnEA,kBAAAA,OAAO;CACL,SAAS,CAAC,oBAAoB,EAAE,YAAY,GAAG,CAAC;CAChD,SAAS,EAAE,SAAS,GAAG,SAAS,QAAQ,iBACtC,YAAY,OAAO,YAAY,UAAU;CAC3C,QAAQ,EAAE,WAAWC,kBAAAA,UAAU,MAAM,WAAW,KAAK,MAAM;CAC3D,SAAS;EAAE,MAAM;EAAY,UAAU,YAAY;CAAsB;CACzE;CACA;CACA;AACF,CAAC;;;ACnBL,MAAa,4BAA4B,EAAE,SAAS,aAAa,WAA8B;CAC7F,MAAM,SAASC,iCAAAA,yBAAgC;EAC7C;EACA;EACA,SAASC,aAAAA,kBAAkB,IAAI;CACjC,CAAC;CACD,MAAM,gBAAgBC,iCAAAA,yBAAyB;EAAE;EAAS;CAAY,CAAC;CAEvE,MAAM,iBAAiB,OACrB,UACA,aACA,SACG;EACH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AAO;EACL;EACA,QAJa,gBAAgB,EAAE,YAAY,CAItC;EACL;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
package/dist/queue/index.cjs
CHANGED
package/dist/queue/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Dt as Poller } from "../index-
|
|
1
|
+
import { Dt as Poller } from "../index-CGFGd3tF.cjs";
|
|
2
2
|
import { n as ClientInitOptions } from "../types-DoZtE9tz.cjs";
|
|
3
|
-
import { a as OrchestrationRerunPlanPath, c as SearchAllJobsQuery, d as SearchJobsQuery, l as SearchGroupedJobsQuery, n as GetQueueJobPath, p as components, r as KillJobPath, t as CreateJobBody } from "../types-
|
|
3
|
+
import { a as OrchestrationRerunPlanPath, c as SearchAllJobsQuery, d as SearchJobsQuery, l as SearchGroupedJobsQuery, n as GetQueueJobPath, p as components, r as KillJobPath, t as CreateJobBody } from "../types-BjR8Yodc.cjs";
|
|
4
4
|
//#region src/clients/queue/queueClient.d.ts
|
|
5
5
|
declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
|
|
6
6
|
healthCheck: (signal?: AbortSignal) => Promise<unknown>;
|
|
@@ -45,6 +45,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
|
|
|
45
45
|
delayedStartTime?: string | null;
|
|
46
46
|
durationSeconds?: number | null;
|
|
47
47
|
isFinished: boolean;
|
|
48
|
+
isSuccess: boolean | null;
|
|
48
49
|
url: string;
|
|
49
50
|
variableValuesId?: string | null;
|
|
50
51
|
variableValuesData?: {
|
|
@@ -108,6 +109,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
|
|
|
108
109
|
delayedStartTime?: string | null;
|
|
109
110
|
durationSeconds?: number | null;
|
|
110
111
|
isFinished: boolean;
|
|
112
|
+
isSuccess: boolean | null;
|
|
111
113
|
url: string;
|
|
112
114
|
variableValuesId?: string | null;
|
|
113
115
|
variableValuesData?: {
|
|
@@ -171,6 +173,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
|
|
|
171
173
|
delayedStartTime?: string | null;
|
|
172
174
|
durationSeconds?: number | null;
|
|
173
175
|
isFinished: boolean;
|
|
176
|
+
isSuccess: boolean | null;
|
|
174
177
|
url: string;
|
|
175
178
|
variableValuesId?: string | null;
|
|
176
179
|
variableValuesData?: {
|
|
@@ -234,6 +237,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
|
|
|
234
237
|
delayedStartTime?: string | null;
|
|
235
238
|
durationSeconds?: number | null;
|
|
236
239
|
isFinished: boolean;
|
|
240
|
+
isSuccess: boolean | null;
|
|
237
241
|
url: string;
|
|
238
242
|
variableValuesId?: string | null;
|
|
239
243
|
variableValuesData?: {
|
|
@@ -297,6 +301,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
|
|
|
297
301
|
delayedStartTime?: string | null;
|
|
298
302
|
durationSeconds?: number | null;
|
|
299
303
|
isFinished: boolean;
|
|
304
|
+
isSuccess: boolean | null;
|
|
300
305
|
url: string;
|
|
301
306
|
variableValuesId?: string | null;
|
|
302
307
|
variableValuesData?: {
|
|
@@ -360,6 +365,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
|
|
|
360
365
|
delayedStartTime?: string | null;
|
|
361
366
|
durationSeconds?: number | null;
|
|
362
367
|
isFinished: boolean;
|
|
368
|
+
isSuccess: boolean | null;
|
|
363
369
|
url: string;
|
|
364
370
|
variableValuesId?: string | null;
|
|
365
371
|
variableValuesData?: {
|
package/dist/queue/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Dt as Poller } from "../index-
|
|
1
|
+
import { Dt as Poller } from "../index-Bl2EloC0.js";
|
|
2
2
|
import { n as ClientInitOptions } from "../types-B2w2TtSA.js";
|
|
3
|
-
import { a as OrchestrationRerunPlanPath, c as SearchAllJobsQuery, d as SearchJobsQuery, l as SearchGroupedJobsQuery, n as GetQueueJobPath, p as components, r as KillJobPath, t as CreateJobBody } from "../types-
|
|
3
|
+
import { a as OrchestrationRerunPlanPath, c as SearchAllJobsQuery, d as SearchJobsQuery, l as SearchGroupedJobsQuery, n as GetQueueJobPath, p as components, r as KillJobPath, t as CreateJobBody } from "../types-9SEE4icc.js";
|
|
4
4
|
//#region src/clients/queue/queueClient.d.ts
|
|
5
5
|
declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
|
|
6
6
|
healthCheck: (signal?: AbortSignal) => Promise<unknown>;
|
|
@@ -45,6 +45,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
|
|
|
45
45
|
delayedStartTime?: string | null;
|
|
46
46
|
durationSeconds?: number | null;
|
|
47
47
|
isFinished: boolean;
|
|
48
|
+
isSuccess: boolean | null;
|
|
48
49
|
url: string;
|
|
49
50
|
variableValuesId?: string | null;
|
|
50
51
|
variableValuesData?: {
|
|
@@ -108,6 +109,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
|
|
|
108
109
|
delayedStartTime?: string | null;
|
|
109
110
|
durationSeconds?: number | null;
|
|
110
111
|
isFinished: boolean;
|
|
112
|
+
isSuccess: boolean | null;
|
|
111
113
|
url: string;
|
|
112
114
|
variableValuesId?: string | null;
|
|
113
115
|
variableValuesData?: {
|
|
@@ -171,6 +173,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
|
|
|
171
173
|
delayedStartTime?: string | null;
|
|
172
174
|
durationSeconds?: number | null;
|
|
173
175
|
isFinished: boolean;
|
|
176
|
+
isSuccess: boolean | null;
|
|
174
177
|
url: string;
|
|
175
178
|
variableValuesId?: string | null;
|
|
176
179
|
variableValuesData?: {
|
|
@@ -234,6 +237,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
|
|
|
234
237
|
delayedStartTime?: string | null;
|
|
235
238
|
durationSeconds?: number | null;
|
|
236
239
|
isFinished: boolean;
|
|
240
|
+
isSuccess: boolean | null;
|
|
237
241
|
url: string;
|
|
238
242
|
variableValuesId?: string | null;
|
|
239
243
|
variableValuesData?: {
|
|
@@ -297,6 +301,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
|
|
|
297
301
|
delayedStartTime?: string | null;
|
|
298
302
|
durationSeconds?: number | null;
|
|
299
303
|
isFinished: boolean;
|
|
304
|
+
isSuccess: boolean | null;
|
|
300
305
|
url: string;
|
|
301
306
|
variableValuesId?: string | null;
|
|
302
307
|
variableValuesData?: {
|
|
@@ -360,6 +365,7 @@ declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOpti
|
|
|
360
365
|
delayedStartTime?: string | null;
|
|
361
366
|
durationSeconds?: number | null;
|
|
362
367
|
isFinished: boolean;
|
|
368
|
+
isSuccess: boolean | null;
|
|
363
369
|
url: string;
|
|
364
370
|
variableValuesId?: string | null;
|
|
365
371
|
variableValuesData?: {
|
package/dist/queue/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createQueueClient } from "../queue-
|
|
1
|
+
import { t as createQueueClient } from "../queue-CNvR-M23.js";
|
|
2
2
|
export { createQueueClient };
|
package/dist/queue/types.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as OrchestrationRerunPlanPath, c as SearchAllJobsQuery, d as SearchJobsQuery, f as SearchJobsResponse, i as OrchestrationRerunPlan, l as SearchGroupedJobsQuery, n as GetQueueJobPath, o as QueueJob, r as KillJobPath, s as QueueJobStatus, t as CreateJobBody, u as SearchGroupedJobsResponse } from "../types-
|
|
1
|
+
import { a as OrchestrationRerunPlanPath, c as SearchAllJobsQuery, d as SearchJobsQuery, f as SearchJobsResponse, i as OrchestrationRerunPlan, l as SearchGroupedJobsQuery, n as GetQueueJobPath, o as QueueJob, r as KillJobPath, s as QueueJobStatus, t as CreateJobBody, u as SearchGroupedJobsResponse } from "../types-BjR8Yodc.cjs";
|
|
2
2
|
export { CreateJobBody, GetQueueJobPath, KillJobPath, OrchestrationRerunPlan, OrchestrationRerunPlanPath, QueueJob, QueueJobStatus, SearchAllJobsQuery, SearchGroupedJobsQuery, SearchGroupedJobsResponse, SearchJobsQuery, SearchJobsResponse };
|
package/dist/queue/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as OrchestrationRerunPlanPath, c as SearchAllJobsQuery, d as SearchJobsQuery, f as SearchJobsResponse, i as OrchestrationRerunPlan, l as SearchGroupedJobsQuery, n as GetQueueJobPath, o as QueueJob, r as KillJobPath, s as QueueJobStatus, t as CreateJobBody, u as SearchGroupedJobsResponse } from "../types-
|
|
1
|
+
import { a as OrchestrationRerunPlanPath, c as SearchAllJobsQuery, d as SearchJobsQuery, f as SearchJobsResponse, i as OrchestrationRerunPlan, l as SearchGroupedJobsQuery, n as GetQueueJobPath, o as QueueJob, r as KillJobPath, s as QueueJobStatus, t as CreateJobBody, u as SearchGroupedJobsResponse } from "../types-9SEE4icc.js";
|
|
2
2
|
export { CreateJobBody, GetQueueJobPath, KillJobPath, OrchestrationRerunPlan, OrchestrationRerunPlanPath, QueueJob, QueueJobStatus, SearchAllJobsQuery, SearchGroupedJobsQuery, SearchGroupedJobsResponse, SearchJobsQuery, SearchJobsResponse };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_collect = require("./collect-B5TCNiT1.cjs");
|
|
2
|
-
const require_jobStatus = require("./jobStatus-
|
|
2
|
+
const require_jobStatus = require("./jobStatus-B0E-MZ9I.cjs");
|
|
3
3
|
const require_createGenericFetchClient = require("./createGenericFetchClient-B81Iezpb.cjs");
|
|
4
4
|
const require_createOpenapiFetchClient = require("./createOpenapiFetchClient-CioTX11-.cjs");
|
|
5
5
|
const require_auth = require("./auth-C9o_0bft.cjs");
|
|
@@ -100,4 +100,4 @@ Object.defineProperty(exports, "createQueueClient", {
|
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
102
|
|
|
103
|
-
//# sourceMappingURL=queue-
|
|
103
|
+
//# sourceMappingURL=queue-BrgRdtOr.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue-
|
|
1
|
+
{"version":3,"file":"queue-BrgRdtOr.cjs","names":["poller","jobStatus","createOpenapiFetchClient","createAuthHeaders","createGenericFetchClient","collect"],"sources":["../src/clients/queue/poller.ts","../src/clients/queue/queueClient.ts"],"sourcesContent":["import { jobStatus } from '../../domain/jobStatus';\nimport { poller } from '../../utils/async';\n\nimport type { GetQueueJobPath, QueueJob } from './types';\n\nconst DEFAULT_POLL_INTERVAL = 2000;\n\ntype QueueJobPollOptions = {\n interval?: number;\n maxAttempts?: number;\n timeout?: number;\n signal?: AbortSignal;\n};\n\ntype GetJob = (jobId: GetQueueJobPath['jobId'], signal?: AbortSignal) => Promise<QueueJob>;\n\n/**\n * Waits on a queue job.\n *\n * - Takes the job, not its id: the component makes the poll legible in dev tools.\n * - `pollFn` reads the id off the key, so the key is the whole input.\n * - A job that ended as `error` is a `done` poll; interpreting it is the caller's job.\n */\nexport const createJobPoller =\n ({ getJob }: { getJob: GetJob }) =>\n (\n { id, component }: { id: GetQueueJobPath['jobId']; component: string },\n { interval, maxAttempts, timeout, signal }: QueueJobPollOptions = {},\n ) =>\n poller({\n pollKey: ['queue.job', { jobId: id, component }] as const,\n pollFn: ({ pollKey: [, params], signal: pollSignal }) => getJob(params.jobId, pollSignal),\n until: ({ data }) => jobStatus.queue.isTerminal(data.status),\n backoff: { type: 'constant', interval: interval ?? DEFAULT_POLL_INTERVAL },\n maxAttempts,\n timeout,\n signal,\n });\n","import { createGenericFetchClient, createOpenapiFetchClient } from '../../fetchClient';\nimport { collect } from '../../utils';\nimport { createAuthHeaders } from '../auth';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport { createJobPoller } from './poller';\nimport type {\n CreateJobBody,\n GetQueueJobPath,\n KillJobPath,\n OrchestrationRerunPlanPath,\n SearchAllJobsQuery,\n SearchGroupedJobsQuery,\n SearchJobsQuery,\n} from './types';\n\nexport const createQueueClient = ({ baseUrl, middlewares, auth }: ClientInitOptions) => {\n const client = createOpenapiFetchClient<paths>({\n baseUrl,\n middlewares,\n headers: createAuthHeaders(auth),\n });\n const genericClient = createGenericFetchClient({ baseUrl, middlewares });\n\n const getJob = async (jobId: GetQueueJobPath['jobId'], signal?: AbortSignal) => {\n const { data } = await client.get(\n '/jobs/{jobId}',\n {\n path: { jobId },\n },\n { signal },\n );\n\n return data;\n };\n\n const searchJobs = async (query?: SearchJobsQuery, signal?: AbortSignal) => {\n const { data } = await client.get(\n '/search/jobs',\n {\n query,\n },\n { signal },\n );\n\n return data;\n };\n\n const searchAllJobs = (query: SearchAllJobsQuery, signal?: AbortSignal) => {\n return collect({\n pageSize: query.limit,\n signal,\n fetchFrom: (offset, pageSize, batchSignal) => {\n return searchJobs({ ...query, limit: pageSize, offset }, batchSignal);\n },\n });\n };\n\n const createJob = async (body: CreateJobBody, signal?: AbortSignal) => {\n const { data } = await client.post('/jobs', { body }, { signal });\n\n return data;\n };\n\n const killJob = async (jobId: KillJobPath['jobId'], signal?: AbortSignal) => {\n const { data } = await client.post(\n '/jobs/{jobId}/kill',\n {\n path: { jobId },\n },\n { signal },\n );\n\n return data;\n };\n\n const searchGroupedJobs = async (query: SearchGroupedJobsQuery, signal?: AbortSignal) => {\n const { data } = await client.get(\n '/search/grouped-jobs',\n {\n query,\n },\n { signal },\n );\n\n return data;\n };\n\n const getOrchestrationRerunPlan = async (\n jobId: OrchestrationRerunPlanPath['jobId'],\n signal?: AbortSignal,\n ) => {\n const { data } = await client.get(\n '/orchestration-rerun-plan/{jobId}',\n {\n path: { jobId },\n },\n { signal },\n );\n\n return data;\n };\n\n const healthCheck = async (signal?: AbortSignal) => {\n const { data } = await genericClient.get('/health-check', {}, { signal });\n\n return data;\n };\n\n // Every wait on a queue job is the same wait, so it is the client's rather than a caller's.\n const poller = createJobPoller({ getJob });\n\n return {\n healthCheck,\n poller,\n getJob,\n searchJobs,\n searchAllJobs,\n createJob,\n killJob,\n searchGroupedJobs,\n getOrchestrationRerunPlan,\n };\n};\n"],"mappings":";;;;;;AAKA,MAAM,wBAAwB;;;;;;;;AAkB9B,MAAa,mBACV,EAAE,cAED,EAAE,IAAI,aACN,EAAE,UAAU,aAAa,SAAS,WAAgC,CAAC,MAEnEA,kBAAAA,OAAO;CACL,SAAS,CAAC,aAAa;EAAE,OAAO;EAAI;CAAU,CAAC;CAC/C,SAAS,EAAE,SAAS,GAAG,SAAS,QAAQ,iBAAiB,OAAO,OAAO,OAAO,UAAU;CACxF,QAAQ,EAAE,WAAWC,kBAAAA,UAAU,MAAM,WAAW,KAAK,MAAM;CAC3D,SAAS;EAAE,MAAM;EAAY,UAAU,YAAY;CAAsB;CACzE;CACA;CACA;AACF,CAAC;;;ACpBL,MAAa,qBAAqB,EAAE,SAAS,aAAa,WAA8B;CACtF,MAAM,SAASC,iCAAAA,yBAAgC;EAC7C;EACA;EACA,SAASC,aAAAA,kBAAkB,IAAI;CACjC,CAAC;CACD,MAAM,gBAAgBC,iCAAAA,yBAAyB;EAAE;EAAS;CAAY,CAAC;CAEvE,MAAM,SAAS,OAAO,OAAiC,WAAyB;EAC9E,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,iBACA,EACE,MAAM,EAAE,MAAM,EAChB,GACA,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,aAAa,OAAO,OAAyB,WAAyB;EAC1E,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,gBACA,EACE,MACF,GACA,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,iBAAiB,OAA2B,WAAyB;EACzE,OAAOC,gBAAAA,QAAQ;GACb,UAAU,MAAM;GAChB;GACA,YAAY,QAAQ,UAAU,gBAAgB;IAC5C,OAAO,WAAW;KAAE,GAAG;KAAO,OAAO;KAAU;IAAO,GAAG,WAAW;GACtE;EACF,CAAC;CACH;CAEA,MAAM,YAAY,OAAO,MAAqB,WAAyB;EACrE,MAAM,EAAE,SAAS,MAAM,OAAO,KAAK,SAAS,EAAE,KAAK,GAAG,EAAE,OAAO,CAAC;EAEhE,OAAO;CACT;CAEA,MAAM,UAAU,OAAO,OAA6B,WAAyB;EAC3E,MAAM,EAAE,SAAS,MAAM,OAAO,KAC5B,sBACA,EACE,MAAM,EAAE,MAAM,EAChB,GACA,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,oBAAoB,OAAO,OAA+B,WAAyB;EACvF,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,wBACA,EACE,MACF,GACA,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,4BAA4B,OAChC,OACA,WACG;EACH,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,qCACA,EACE,MAAM,EAAE,MAAM,EAChB,GACA,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,cAAc,OAAO,WAAyB;EAClD,MAAM,EAAE,SAAS,MAAM,cAAc,IAAI,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC;EAExE,OAAO;CACT;CAKA,OAAO;EACL;EACA,QAJa,gBAAgB,EAAE,OAAO,CAIjC;EACL;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as collect } from "./collect-97WhfEpt.js";
|
|
2
|
-
import { a as poller, t as jobStatus } from "./jobStatus-
|
|
2
|
+
import { a as poller, t as jobStatus } from "./jobStatus-BJdbZ72V.js";
|
|
3
3
|
import { t as createGenericFetchClient } from "./createGenericFetchClient-KqiJhw8G.js";
|
|
4
4
|
import { t as createOpenapiFetchClient } from "./createOpenapiFetchClient-wq8iGLZM.js";
|
|
5
5
|
import { t as createAuthHeaders } from "./auth-C6cHWIWx.js";
|
|
@@ -95,4 +95,4 @@ const createQueueClient = ({ baseUrl, middlewares, auth }) => {
|
|
|
95
95
|
//#endregion
|
|
96
96
|
export { createQueueClient as t };
|
|
97
97
|
|
|
98
|
-
//# sourceMappingURL=queue-
|
|
98
|
+
//# sourceMappingURL=queue-CNvR-M23.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue-
|
|
1
|
+
{"version":3,"file":"queue-CNvR-M23.js","names":[],"sources":["../src/clients/queue/poller.ts","../src/clients/queue/queueClient.ts"],"sourcesContent":["import { jobStatus } from '../../domain/jobStatus';\nimport { poller } from '../../utils/async';\n\nimport type { GetQueueJobPath, QueueJob } from './types';\n\nconst DEFAULT_POLL_INTERVAL = 2000;\n\ntype QueueJobPollOptions = {\n interval?: number;\n maxAttempts?: number;\n timeout?: number;\n signal?: AbortSignal;\n};\n\ntype GetJob = (jobId: GetQueueJobPath['jobId'], signal?: AbortSignal) => Promise<QueueJob>;\n\n/**\n * Waits on a queue job.\n *\n * - Takes the job, not its id: the component makes the poll legible in dev tools.\n * - `pollFn` reads the id off the key, so the key is the whole input.\n * - A job that ended as `error` is a `done` poll; interpreting it is the caller's job.\n */\nexport const createJobPoller =\n ({ getJob }: { getJob: GetJob }) =>\n (\n { id, component }: { id: GetQueueJobPath['jobId']; component: string },\n { interval, maxAttempts, timeout, signal }: QueueJobPollOptions = {},\n ) =>\n poller({\n pollKey: ['queue.job', { jobId: id, component }] as const,\n pollFn: ({ pollKey: [, params], signal: pollSignal }) => getJob(params.jobId, pollSignal),\n until: ({ data }) => jobStatus.queue.isTerminal(data.status),\n backoff: { type: 'constant', interval: interval ?? DEFAULT_POLL_INTERVAL },\n maxAttempts,\n timeout,\n signal,\n });\n","import { createGenericFetchClient, createOpenapiFetchClient } from '../../fetchClient';\nimport { collect } from '../../utils';\nimport { createAuthHeaders } from '../auth';\nimport type { ClientInitOptions } from '../types';\n\nimport type { paths } from './__generated__/schema';\nimport { createJobPoller } from './poller';\nimport type {\n CreateJobBody,\n GetQueueJobPath,\n KillJobPath,\n OrchestrationRerunPlanPath,\n SearchAllJobsQuery,\n SearchGroupedJobsQuery,\n SearchJobsQuery,\n} from './types';\n\nexport const createQueueClient = ({ baseUrl, middlewares, auth }: ClientInitOptions) => {\n const client = createOpenapiFetchClient<paths>({\n baseUrl,\n middlewares,\n headers: createAuthHeaders(auth),\n });\n const genericClient = createGenericFetchClient({ baseUrl, middlewares });\n\n const getJob = async (jobId: GetQueueJobPath['jobId'], signal?: AbortSignal) => {\n const { data } = await client.get(\n '/jobs/{jobId}',\n {\n path: { jobId },\n },\n { signal },\n );\n\n return data;\n };\n\n const searchJobs = async (query?: SearchJobsQuery, signal?: AbortSignal) => {\n const { data } = await client.get(\n '/search/jobs',\n {\n query,\n },\n { signal },\n );\n\n return data;\n };\n\n const searchAllJobs = (query: SearchAllJobsQuery, signal?: AbortSignal) => {\n return collect({\n pageSize: query.limit,\n signal,\n fetchFrom: (offset, pageSize, batchSignal) => {\n return searchJobs({ ...query, limit: pageSize, offset }, batchSignal);\n },\n });\n };\n\n const createJob = async (body: CreateJobBody, signal?: AbortSignal) => {\n const { data } = await client.post('/jobs', { body }, { signal });\n\n return data;\n };\n\n const killJob = async (jobId: KillJobPath['jobId'], signal?: AbortSignal) => {\n const { data } = await client.post(\n '/jobs/{jobId}/kill',\n {\n path: { jobId },\n },\n { signal },\n );\n\n return data;\n };\n\n const searchGroupedJobs = async (query: SearchGroupedJobsQuery, signal?: AbortSignal) => {\n const { data } = await client.get(\n '/search/grouped-jobs',\n {\n query,\n },\n { signal },\n );\n\n return data;\n };\n\n const getOrchestrationRerunPlan = async (\n jobId: OrchestrationRerunPlanPath['jobId'],\n signal?: AbortSignal,\n ) => {\n const { data } = await client.get(\n '/orchestration-rerun-plan/{jobId}',\n {\n path: { jobId },\n },\n { signal },\n );\n\n return data;\n };\n\n const healthCheck = async (signal?: AbortSignal) => {\n const { data } = await genericClient.get('/health-check', {}, { signal });\n\n return data;\n };\n\n // Every wait on a queue job is the same wait, so it is the client's rather than a caller's.\n const poller = createJobPoller({ getJob });\n\n return {\n healthCheck,\n poller,\n getJob,\n searchJobs,\n searchAllJobs,\n createJob,\n killJob,\n searchGroupedJobs,\n getOrchestrationRerunPlan,\n };\n};\n"],"mappings":";;;;;;AAKA,MAAM,wBAAwB;;;;;;;;AAkB9B,MAAa,mBACV,EAAE,cAED,EAAE,IAAI,aACN,EAAE,UAAU,aAAa,SAAS,WAAgC,CAAC,MAEnE,OAAO;CACL,SAAS,CAAC,aAAa;EAAE,OAAO;EAAI;CAAU,CAAC;CAC/C,SAAS,EAAE,SAAS,GAAG,SAAS,QAAQ,iBAAiB,OAAO,OAAO,OAAO,UAAU;CACxF,QAAQ,EAAE,WAAW,UAAU,MAAM,WAAW,KAAK,MAAM;CAC3D,SAAS;EAAE,MAAM;EAAY,UAAU,YAAY;CAAsB;CACzE;CACA;CACA;AACF,CAAC;;;ACpBL,MAAa,qBAAqB,EAAE,SAAS,aAAa,WAA8B;CACtF,MAAM,SAAS,yBAAgC;EAC7C;EACA;EACA,SAAS,kBAAkB,IAAI;CACjC,CAAC;CACD,MAAM,gBAAgB,yBAAyB;EAAE;EAAS;CAAY,CAAC;CAEvE,MAAM,SAAS,OAAO,OAAiC,WAAyB;EAC9E,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,iBACA,EACE,MAAM,EAAE,MAAM,EAChB,GACA,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,aAAa,OAAO,OAAyB,WAAyB;EAC1E,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,gBACA,EACE,MACF,GACA,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,iBAAiB,OAA2B,WAAyB;EACzE,OAAO,QAAQ;GACb,UAAU,MAAM;GAChB;GACA,YAAY,QAAQ,UAAU,gBAAgB;IAC5C,OAAO,WAAW;KAAE,GAAG;KAAO,OAAO;KAAU;IAAO,GAAG,WAAW;GACtE;EACF,CAAC;CACH;CAEA,MAAM,YAAY,OAAO,MAAqB,WAAyB;EACrE,MAAM,EAAE,SAAS,MAAM,OAAO,KAAK,SAAS,EAAE,KAAK,GAAG,EAAE,OAAO,CAAC;EAEhE,OAAO;CACT;CAEA,MAAM,UAAU,OAAO,OAA6B,WAAyB;EAC3E,MAAM,EAAE,SAAS,MAAM,OAAO,KAC5B,sBACA,EACE,MAAM,EAAE,MAAM,EAChB,GACA,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,oBAAoB,OAAO,OAA+B,WAAyB;EACvF,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,wBACA,EACE,MACF,GACA,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,4BAA4B,OAChC,OACA,WACG;EACH,MAAM,EAAE,SAAS,MAAM,OAAO,IAC5B,qCACA,EACE,MAAM,EAAE,MAAM,EAChB,GACA,EAAE,OAAO,CACX;EAEA,OAAO;CACT;CAEA,MAAM,cAAc,OAAO,WAAyB;EAClD,MAAM,EAAE,SAAS,MAAM,cAAc,IAAI,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC;EAExE,OAAO;CACT;CAKA,OAAO;EACL;EACA,QAJa,gBAAgB,EAAE,OAAO,CAIjC;EACL;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as createStorageClient, L as RegisteredComponentId, R as registry, tn as createDefaultBranch } from "../../index-
|
|
1
|
+
import { H as createStorageClient, L as RegisteredComponentId, R as registry, tn as createDefaultBranch } from "../../index-CGFGd3tF.cjs";
|
|
2
2
|
import { Mn as UpdateConfigurationInput, dn as CreateConfigurationInput, en as BaseComponentConfig, ln as ConfigurationPath } from "../../types-CLHaZv9f.cjs";
|
|
3
3
|
import { t as createEncryptionClient } from "../../index-DkCXaYsn.cjs";
|
|
4
4
|
import { t as Project } from "../../project-B8wtlstY.cjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as createStorageClient, L as RegisteredComponentId, R as registry, tn as createDefaultBranch } from "../../index-
|
|
1
|
+
import { H as createStorageClient, L as RegisteredComponentId, R as registry, tn as createDefaultBranch } from "../../index-Bl2EloC0.js";
|
|
2
2
|
import { Mn as UpdateConfigurationInput, dn as CreateConfigurationInput, en as BaseComponentConfig, ln as ConfigurationPath } from "../../types-D8pGSkRe.js";
|
|
3
3
|
import { t as createEncryptionClient } from "../../index-Bf8dr2KQ.js";
|
|
4
4
|
import { t as Project } from "../../project-BCc3mpAy.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as KaiMemoryStatus, c as KAI_MEMORY_STATUSES, o as MetastoreClient, r as KaiMemoryItem, s as UpdateKaiMemoryMeta, t as CreateKaiMemoryMeta } from "../../types-
|
|
1
|
+
import { a as KaiMemoryStatus, c as KAI_MEMORY_STATUSES, o as MetastoreClient, r as KaiMemoryItem, s as UpdateKaiMemoryMeta, t as CreateKaiMemoryMeta } from "../../types-CalDJHCX.cjs";
|
|
2
2
|
//#region src/sdks/kaiMemory/kaiMemorySdk.d.ts
|
|
3
3
|
/** The metastore object type this SDK addresses — see `SEMANTIC_OBJECT_TYPE` for the convention. */
|
|
4
4
|
declare const KAI_MEMORY_OBJECT_TYPE = "kai-memory";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as KaiMemoryStatus, c as KAI_MEMORY_STATUSES, o as MetastoreClient, r as KaiMemoryItem, s as UpdateKaiMemoryMeta, t as CreateKaiMemoryMeta } from "../../types-
|
|
1
|
+
import { a as KaiMemoryStatus, c as KAI_MEMORY_STATUSES, o as MetastoreClient, r as KaiMemoryItem, s as UpdateKaiMemoryMeta, t as CreateKaiMemoryMeta } from "../../types-z82gSTx8.js";
|
|
2
2
|
//#region src/sdks/kaiMemory/kaiMemorySdk.d.ts
|
|
3
3
|
/** The metastore object type this SDK addresses — see `SEMANTIC_OBJECT_TYPE` for the convention. */
|
|
4
4
|
declare const KAI_MEMORY_OBJECT_TYPE = "kai-memory";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as KaiMemoryStatus, i as KaiMemoryMeta, n as KaiMemoryData, o as MetastoreClient, r as KaiMemoryItem, s as UpdateKaiMemoryMeta, t as CreateKaiMemoryMeta } from "../../types-
|
|
1
|
+
import { a as KaiMemoryStatus, i as KaiMemoryMeta, n as KaiMemoryData, o as MetastoreClient, r as KaiMemoryItem, s as UpdateKaiMemoryMeta, t as CreateKaiMemoryMeta } from "../../types-CalDJHCX.cjs";
|
|
2
2
|
export { CreateKaiMemoryMeta, KaiMemoryData, KaiMemoryItem, KaiMemoryMeta, KaiMemoryStatus, MetastoreClient, UpdateKaiMemoryMeta };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as KaiMemoryStatus, i as KaiMemoryMeta, n as KaiMemoryData, o as MetastoreClient, r as KaiMemoryItem, s as UpdateKaiMemoryMeta, t as CreateKaiMemoryMeta } from "../../types-
|
|
1
|
+
import { a as KaiMemoryStatus, i as KaiMemoryMeta, n as KaiMemoryData, o as MetastoreClient, r as KaiMemoryItem, s as UpdateKaiMemoryMeta, t as CreateKaiMemoryMeta } from "../../types-z82gSTx8.js";
|
|
2
2
|
export { CreateKaiMemoryMeta, KaiMemoryData, KaiMemoryItem, KaiMemoryMeta, KaiMemoryStatus, MetastoreClient, UpdateKaiMemoryMeta };
|