@keboola/api-client 50.0.0 → 51.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/API-SURFACE.md +2 -1
- package/CHANGELOG.md +10 -0
- package/dist/apps/index.d.cts +10 -1
- package/dist/apps/index.d.ts +10 -1
- package/dist/apps/types.d.cts +1 -1
- package/dist/apps/types.d.ts +1 -1
- package/dist/encryption/index.d.cts +1 -1
- package/dist/encryption/index.d.ts +1 -1
- package/dist/encryption/types.d.cts +1 -1
- package/dist/encryption/types.d.ts +1 -1
- package/dist/{index-Xpu7qIZk.d.ts → index-BfAcp7O2.d.ts} +2 -2
- package/dist/{index-C9iNazAc.d.ts → index-BsT_cBJd.d.ts} +19 -5
- package/dist/{index-DXoN8VwV.d.cts → index-C1ndNdrN.d.cts} +2 -2
- package/dist/{index-CN0--VsY.d.ts → index-Day1Yr5s.d.ts} +5 -2
- package/dist/{index-CTMnmISl.d.cts → index-qJ2IjXIM.d.cts} +19 -5
- package/dist/{index-CCcdySOC.d.cts → index-xhzuWloV.d.cts} +5 -2
- package/dist/index.cjs +6 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/kaiAgent/index.cjs +1 -1
- package/dist/kaiAgent/index.d.cts +1 -1
- package/dist/kaiAgent/index.d.ts +1 -1
- package/dist/kaiAgent/index.js +1 -1
- package/dist/kaiAgent/types.d.cts +1 -1
- package/dist/kaiAgent/types.d.ts +1 -1
- package/dist/{kaiAgent-gaA7dqki.cjs → kaiAgent-CDhg0MAw.cjs} +11 -1
- package/dist/kaiAgent-CDhg0MAw.cjs.map +1 -0
- package/dist/{kaiAgent-D2TiMDjW.js → kaiAgent-CYU1Uda8.js} +11 -1
- package/dist/kaiAgent-CYU1Uda8.js.map +1 -0
- package/dist/queryService/index.d.cts +1 -1
- package/dist/queryService/index.d.ts +1 -1
- package/dist/queryService/types.d.cts +1 -1
- package/dist/queryService/types.d.ts +1 -1
- package/dist/queue/index.d.cts +1 -1
- package/dist/queue/index.d.ts +1 -1
- package/dist/sdk/configurations/index.d.cts +2 -2
- package/dist/sdk/configurations/index.d.ts +2 -2
- package/dist/sdk/queryService/index.d.cts +1 -1
- package/dist/sdk/queryService/index.d.ts +1 -1
- package/dist/sdk/vault/index.d.cts +1 -1
- package/dist/sdk/vault/index.d.ts +1 -1
- package/dist/storage/index.d.cts +2 -2
- package/dist/storage/index.d.ts +2 -2
- package/dist/storage/types.d.cts +1 -1
- package/dist/storage/types.d.ts +1 -1
- package/dist/{types-Dz9vyloX.d.ts → types-B8k1DqlU.d.ts} +124 -1
- package/dist/{types-BB49alHP.d.cts → types-BrEVh0WE.d.cts} +11 -2
- package/dist/{types-BfB-XXLF.d.ts → types-DKSUG2dZ.d.ts} +11 -2
- package/dist/{types-BCGrKW1K.d.cts → types-PZzNANiS.d.cts} +124 -1
- package/package.json +1 -1
- package/surface/apps.md +7 -7
- package/surface/kaiAgent.md +1 -0
- package/dist/kaiAgent-D2TiMDjW.js.map +0 -1
- package/dist/kaiAgent-gaA7dqki.cjs.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $r as ManagementSessionMintError, C as isValidationError, E as isStorageJobError, Rr as QueueJobError, S as formatValidationIssues, T as StorageJobError, _ as isAbortError, ai as isHtmlResponseError, b as isTimeoutError, di as ApiError, ei as ManagementClientAuthError, g as FetchClientError, h as HttpHeader, ii as HtmlResponseError, li as MiddlewareFn, m as HttpContentType, ni as manageErrorCode, p as createGenericFetchClient, ti as isManageError, v as isApiError, w as parseOrThrow, x as ValidationError, y as isFetchClientError, zr as isQueueJobError } from "./index-D1mduJne.cjs";
|
|
2
|
-
import { $t as Store, A as RetryOptions, At as Stack, B as LegacySession, Bt as StorageAdapter, C as DefaultBranch, Cs as readableReason, Ct as GrantType, D as jobStatus, Dt as KeboolaError, E as createAdminAccount, Es as UserError, Et as State, F as LoggingOptions, Ft as series, G as StackApi, Gt as deepMerge, H as createKeboola, Ht as createMemoryStorage, I as RequestLog, It as queueSeries, Jt as AsyncState, Kt as isEmptyDeep, L as ResponseLog, Lt as Cell, M as Log, Mt as Result, N as LogLevel, Nt as Success, O as KeboolaHttpHeader, Ot as KeboolaErrorType, P as Logger, Pt as asError, Qt as ReadableStore, R as createLoggingMiddleware, Rt as Persistor, Ss as retryAfterSeconds, St as Grant, T as AdminAccount, Ts as isQueryJobError, Tt as Stack$1, U as ProjectApi, Ut as createNullStorage, V as createLegacyKeboola, Vt as createLocalStorage, W as ProjectClients, Wt as createSessionStorage, Xt as createDerivedStore, Yt as createDerivedAsyncStore, Zt as shallowEqual, _t as KeboolaOptions, an as delay, bs as isSyncActionError, bt as Credential, cn as concurrent, dn as collectByCursor, en as createStore, fn as nextCursorOf, gn as TaskFn, gt as SESSION_STORAGE_KEY, hn as coalesce, ht as StackRestore, in as lazy, j as createRetryMiddleware, jt as Failure, k as createUiVersionMiddleware, kt as isKeboolaError, ln as CollectByCursorOptions, mn as collectByOffset, mt as RestoreStatus, nn as ensure, on as dedupe, pn as CollectByOffsetOptions, qt as isPlainObject, rn as assert, sn as ConcurrentOptions, tn as generateUUID, un as CursorPage, vt as LegacyKeboolaOptions, w as createDefaultBranch, ws as QueryJobError, wt as Retained, x as createQueryServiceSdk, xs as ServiceUnavailableError, xt as FetchStatus, ys as SyncActionError, yt as Auth, z as BearerSession, zt as createPersistor } from "./index-
|
|
2
|
+
import { $t as Store, A as RetryOptions, At as Stack, B as LegacySession, Bt as StorageAdapter, C as DefaultBranch, Cs as readableReason, Ct as GrantType, D as jobStatus, Dt as KeboolaError, E as createAdminAccount, Es as UserError, Et as State, F as LoggingOptions, Ft as series, G as StackApi, Gt as deepMerge, H as createKeboola, Ht as createMemoryStorage, I as RequestLog, It as queueSeries, Jt as AsyncState, Kt as isEmptyDeep, L as ResponseLog, Lt as Cell, M as Log, Mt as Result, N as LogLevel, Nt as Success, O as KeboolaHttpHeader, Ot as KeboolaErrorType, P as Logger, Pt as asError, Qt as ReadableStore, R as createLoggingMiddleware, Rt as Persistor, Ss as retryAfterSeconds, St as Grant, T as AdminAccount, Ts as isQueryJobError, Tt as Stack$1, U as ProjectApi, Ut as createNullStorage, V as createLegacyKeboola, Vt as createLocalStorage, W as ProjectClients, Wt as createSessionStorage, Xt as createDerivedStore, Yt as createDerivedAsyncStore, Zt as shallowEqual, _t as KeboolaOptions, an as delay, bs as isSyncActionError, bt as Credential, cn as concurrent, dn as collectByCursor, en as createStore, fn as nextCursorOf, gn as TaskFn, gt as SESSION_STORAGE_KEY, hn as coalesce, ht as StackRestore, in as lazy, j as createRetryMiddleware, jt as Failure, k as createUiVersionMiddleware, kt as isKeboolaError, ln as CollectByCursorOptions, mn as collectByOffset, mt as RestoreStatus, nn as ensure, on as dedupe, pn as CollectByOffsetOptions, qt as isPlainObject, rn as assert, sn as ConcurrentOptions, tn as generateUUID, un as CursorPage, vt as LegacyKeboolaOptions, w as createDefaultBranch, ws as QueryJobError, wt as Retained, x as createQueryServiceSdk, xs as ServiceUnavailableError, xt as FetchStatus, ys as SyncActionError, yt as Auth, z as BearerSession, zt as createPersistor } from "./index-qJ2IjXIM.cjs";
|
|
3
3
|
import { r as AuthStrategy, t as BaseClientOptions } from "./types-Dryq2GGE.cjs";
|
|
4
4
|
import { n as parseLogLines } from "./appLogs-CnLNMH7M.cjs";
|
|
5
5
|
import { n as createProject, t as Project } from "./project-UHZGFmmG.cjs";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $r as ManagementSessionMintError, C as isValidationError, E as isStorageJobError, Rr as QueueJobError, S as formatValidationIssues, T as StorageJobError, _ as isAbortError, ai as isHtmlResponseError, b as isTimeoutError, di as ApiError, ei as ManagementClientAuthError, g as FetchClientError, h as HttpHeader, ii as HtmlResponseError, li as MiddlewareFn, m as HttpContentType, ni as manageErrorCode, p as createGenericFetchClient, ti as isManageError, v as isApiError, w as parseOrThrow, x as ValidationError, y as isFetchClientError, zr as isQueueJobError } from "./index-D1mduJne.js";
|
|
2
|
-
import { $t as Store, A as RetryOptions, At as Stack, B as LegacySession, Bt as StorageAdapter, C as DefaultBranch, Cs as readableReason, Ct as GrantType, D as jobStatus, Dt as KeboolaError, E as createAdminAccount, Es as UserError, Et as State, F as LoggingOptions, Ft as series, G as StackApi, Gt as deepMerge, H as createKeboola, Ht as createMemoryStorage, I as RequestLog, It as queueSeries, Jt as AsyncState, Kt as isEmptyDeep, L as ResponseLog, Lt as Cell, M as Log, Mt as Result, N as LogLevel, Nt as Success, O as KeboolaHttpHeader, Ot as KeboolaErrorType, P as Logger, Pt as asError, Qt as ReadableStore, R as createLoggingMiddleware, Rt as Persistor, Ss as retryAfterSeconds, St as Grant, T as AdminAccount, Ts as isQueryJobError, Tt as Stack$1, U as ProjectApi, Ut as createNullStorage, V as createLegacyKeboola, Vt as createLocalStorage, W as ProjectClients, Wt as createSessionStorage, Xt as createDerivedStore, Yt as createDerivedAsyncStore, Zt as shallowEqual, _t as KeboolaOptions, an as delay, bs as isSyncActionError, bt as Credential, cn as concurrent, dn as collectByCursor, en as createStore, fn as nextCursorOf, gn as TaskFn, gt as SESSION_STORAGE_KEY, hn as coalesce, ht as StackRestore, in as lazy, j as createRetryMiddleware, jt as Failure, k as createUiVersionMiddleware, kt as isKeboolaError, ln as CollectByCursorOptions, mn as collectByOffset, mt as RestoreStatus, nn as ensure, on as dedupe, pn as CollectByOffsetOptions, qt as isPlainObject, rn as assert, sn as ConcurrentOptions, tn as generateUUID, un as CursorPage, vt as LegacyKeboolaOptions, w as createDefaultBranch, ws as QueryJobError, wt as Retained, x as createQueryServiceSdk, xs as ServiceUnavailableError, xt as FetchStatus, ys as SyncActionError, yt as Auth, z as BearerSession, zt as createPersistor } from "./index-
|
|
2
|
+
import { $t as Store, A as RetryOptions, At as Stack, B as LegacySession, Bt as StorageAdapter, C as DefaultBranch, Cs as readableReason, Ct as GrantType, D as jobStatus, Dt as KeboolaError, E as createAdminAccount, Es as UserError, Et as State, F as LoggingOptions, Ft as series, G as StackApi, Gt as deepMerge, H as createKeboola, Ht as createMemoryStorage, I as RequestLog, It as queueSeries, Jt as AsyncState, Kt as isEmptyDeep, L as ResponseLog, Lt as Cell, M as Log, Mt as Result, N as LogLevel, Nt as Success, O as KeboolaHttpHeader, Ot as KeboolaErrorType, P as Logger, Pt as asError, Qt as ReadableStore, R as createLoggingMiddleware, Rt as Persistor, Ss as retryAfterSeconds, St as Grant, T as AdminAccount, Ts as isQueryJobError, Tt as Stack$1, U as ProjectApi, Ut as createNullStorage, V as createLegacyKeboola, Vt as createLocalStorage, W as ProjectClients, Wt as createSessionStorage, Xt as createDerivedStore, Yt as createDerivedAsyncStore, Zt as shallowEqual, _t as KeboolaOptions, an as delay, bs as isSyncActionError, bt as Credential, cn as concurrent, dn as collectByCursor, en as createStore, fn as nextCursorOf, gn as TaskFn, gt as SESSION_STORAGE_KEY, hn as coalesce, ht as StackRestore, in as lazy, j as createRetryMiddleware, jt as Failure, k as createUiVersionMiddleware, kt as isKeboolaError, ln as CollectByCursorOptions, mn as collectByOffset, mt as RestoreStatus, nn as ensure, on as dedupe, pn as CollectByOffsetOptions, qt as isPlainObject, rn as assert, sn as ConcurrentOptions, tn as generateUUID, un as CursorPage, vt as LegacyKeboolaOptions, w as createDefaultBranch, ws as QueryJobError, wt as Retained, x as createQueryServiceSdk, xs as ServiceUnavailableError, xt as FetchStatus, ys as SyncActionError, yt as Auth, z as BearerSession, zt as createPersistor } from "./index-BsT_cBJd.js";
|
|
3
3
|
import { r as AuthStrategy, t as BaseClientOptions } from "./types-DUpVIuk7.js";
|
|
4
4
|
import { n as parseLogLines } from "./appLogs-CTvZAihm.js";
|
|
5
5
|
import { n as createProject, t as Project } from "./project-iBm4cIIR.js";
|
package/dist/index.js
CHANGED
|
@@ -33,7 +33,7 @@ import { t as createComponentsMcpClient } from "./componentsMcp-BrB4js6b.js";
|
|
|
33
33
|
import { t as createDataScienceClient } from "./dataScience-CXmkEOAi.js";
|
|
34
34
|
import { createEditorClient } from "./editor/index.js";
|
|
35
35
|
import { createEncryptionClient } from "./encryption/index.js";
|
|
36
|
-
import { t as createKaiAgentClient } from "./kaiAgent-
|
|
36
|
+
import { t as createKaiAgentClient } from "./kaiAgent-CYU1Uda8.js";
|
|
37
37
|
import { t as createMetastoreClient } from "./metastore-CGsgxjng.js";
|
|
38
38
|
import { createNotificationsClient } from "./notifications/index.js";
|
|
39
39
|
import { t as createOauthClient } from "./oauth-ByCdISsV.js";
|
|
@@ -1321,8 +1321,8 @@ const createCredentials = ({ state, persistor, middlewares, refreshThreshold = D
|
|
|
1321
1321
|
await store.persistStack(baseUrl, state.store.get());
|
|
1322
1322
|
onExpired?.(baseUrl);
|
|
1323
1323
|
};
|
|
1324
|
-
const renewIfStale = async (baseUrl) => {
|
|
1325
|
-
const isStale = Result.map(state.auth.requireCredential(baseUrl), ({ issuedAt, expiresIn }) => Date.now() >= issuedAt + expiresIn * 1e3 *
|
|
1324
|
+
const renewIfStale = async (baseUrl, threshold = refreshThreshold) => {
|
|
1325
|
+
const isStale = Result.map(state.auth.requireCredential(baseUrl), ({ issuedAt, expiresIn }) => Date.now() >= issuedAt + expiresIn * 1e3 * threshold);
|
|
1326
1326
|
if (Result.unwrapOr(isStale, false)) await rotate(baseUrl);
|
|
1327
1327
|
};
|
|
1328
1328
|
const middleware = (baseUrl) => createBearerAuthMiddleware({ getAccessToken: async ({ forceRefresh = false } = {}) => {
|
|
@@ -1702,13 +1702,14 @@ const createKeboola = ({ defaultBaseUrl, storage, middlewares, clientServiceUrls
|
|
|
1702
1702
|
/**
|
|
1703
1703
|
* Auth headers for a non-fetch transport (the chat stream), renewed first once near expiry.
|
|
1704
1704
|
*
|
|
1705
|
+
* - `refreshThreshold` renews earlier: the share of the token's lifetime it may have used.
|
|
1705
1706
|
* - No middleware recovers a 401 there.
|
|
1706
1707
|
* - Pinned to the stack active at the call: a stack switch mid-renewal does not re-point it.
|
|
1707
1708
|
* - Throws `NotAuthenticated` if that stack signed out meanwhile.
|
|
1708
1709
|
*/
|
|
1709
|
-
const getAuthHeadersAsync = async (projectId) => {
|
|
1710
|
+
const getAuthHeadersAsync = async (projectId, { refreshThreshold } = {}) => {
|
|
1710
1711
|
const { baseUrl } = onActiveStack(projectId);
|
|
1711
|
-
await credentials.renewIfStale(baseUrl);
|
|
1712
|
+
await credentials.renewIfStale(baseUrl, refreshThreshold);
|
|
1712
1713
|
const credential = Result.unwrap(state.auth.requireCredential(baseUrl));
|
|
1713
1714
|
return {
|
|
1714
1715
|
[HttpHeader.AUTHORIZATION]: `Bearer ${credential.accessToken}`,
|