@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @keboola/api-client
|
|
2
2
|
|
|
3
|
+
## 45.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- `semanticLayer.deleteModel` sends one `DELETE`; the metastore deletes the model's child objects in the same transaction
|
|
8
|
+
- `SemanticLayerCascadeDeleteError` and the `SemanticModelChildDeleteFailure` type are gone: a model delete either deletes everything or nothing.
|
|
9
|
+
- A `409` `ApiError` means another object holds a `restrict` reference to the model; nothing was deleted.
|
|
10
|
+
- A `404` `ApiError` means the model does not exist or was already deleted.
|
|
11
|
+
- `deleteModel` no longer lists the children first, so it no longer throws `SemanticLayerUnreadableChildrenError`. `listModelChildren` still does.
|
|
12
|
+
- The regenerated metastore schema declares the `409` on `DELETE /repository/{objectType}/{UUID}`.
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- A queue job says whether it succeeded.
|
|
17
|
+
- `QueueJob` gains `isSuccess: boolean | null` — `null` while `isFinished` is `false`, `true` for `success` and `warning`, `false` for `error`, `cancelled` and `terminated`.
|
|
18
|
+
- With a job in hand, read `job.isSuccess`; `jobStatus.queue` stays for callers holding only a status.
|
|
19
|
+
|
|
3
20
|
## 44.0.0
|
|
4
21
|
|
|
5
22
|
### Major Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as createOpenapiFetchClient } from "./index-BVhHt5lx.cjs";
|
|
2
2
|
import { n as ClientInitOptions } from "./types-DoZtE9tz.cjs";
|
|
3
|
-
import { E as MetaStoreObjectResponse, I as UpdateMetaObjectInput, M as ReplaceTargetProjectsInput, P as ScopeElevationRequestPath, R as components, T as MetaStoreListResponse, c as DeleteMetaObjectRevisionPath, d as GetMetaObjectRevisionsInput, h as GetMetaObjectsInput, i as CreateMetaObjectInput, k as ReplaceMetaObjectInput, l as GetMetaObjectPath, n as GetVersionedSchemaPath, s as DeleteMetaObjectPath, t as GetSchemaPath, u as GetMetaObjectRevisionPath, y as GetOrganizationMetaObjectsPath, z as paths } from "./types-
|
|
3
|
+
import { E as MetaStoreObjectResponse, I as UpdateMetaObjectInput, M as ReplaceTargetProjectsInput, P as ScopeElevationRequestPath, R as components, T as MetaStoreListResponse, c as DeleteMetaObjectRevisionPath, d as GetMetaObjectRevisionsInput, h as GetMetaObjectsInput, i as CreateMetaObjectInput, k as ReplaceMetaObjectInput, l as GetMetaObjectPath, n as GetVersionedSchemaPath, s as DeleteMetaObjectPath, t as GetSchemaPath, u as GetMetaObjectRevisionPath, y as GetOrganizationMetaObjectsPath, z as paths } from "./types-tgU8XvPs.cjs";
|
|
4
4
|
//#region src/clients/metastore/metastoreClient.d.ts
|
|
5
5
|
type MetastoreFetchClient = ReturnType<typeof createOpenapiFetchClient<paths>>;
|
|
6
6
|
declare const createMetastoreClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
|
|
@@ -31,4 +31,4 @@ declare const createMetastoreClient: ({ baseUrl, middlewares, auth }: ClientInit
|
|
|
31
31
|
};
|
|
32
32
|
//#endregion
|
|
33
33
|
export { createMetastoreClient as n, MetastoreFetchClient as t };
|
|
34
|
-
//# sourceMappingURL=index-
|
|
34
|
+
//# sourceMappingURL=index-BKOFRmTB.d.cts.map
|
|
@@ -17,7 +17,7 @@ import { n as WriteTableInput, t as UploadFileInput } from "./types-DicSaNwq.js"
|
|
|
17
17
|
import { c as GetChatPath$1, d as PrepareChatRequest, f as UsageResponse$1, i as ChatRequest$1, l as GetHistoryQuery$1, n as ArtifactListResponse, o as GetArtifactPath, p as VoteRequest$1, r as ArtifactResponse, s as GetArtifactsQuery, t as ApprovalBody, u as GetVotesQuery$1 } from "./types-AYX7VtS6.js";
|
|
18
18
|
import { a as UserMemory, i as UserAgentSettings$1, n as SpendCapMember, r as SpendCapsView, t as AgentSettings$1 } from "./index-R-w0Zncz.js";
|
|
19
19
|
import { a as createManagementClient } from "./index-CA6QxbhZ.js";
|
|
20
|
-
import { E as MetaStoreObjectResponse, I as UpdateMetaObjectInput, M as ReplaceTargetProjectsInput, P as ScopeElevationRequestPath, R as components$5, S as MetaObject, T as MetaStoreListResponse, c as DeleteMetaObjectRevisionPath, d as GetMetaObjectRevisionsInput, h as GetMetaObjectsInput, i as CreateMetaObjectInput, k as ReplaceMetaObjectInput, l as GetMetaObjectPath, n as GetVersionedSchemaPath, s as DeleteMetaObjectPath, t as GetSchemaPath, u as GetMetaObjectRevisionPath, y as GetOrganizationMetaObjectsPath } from "./types-
|
|
20
|
+
import { E as MetaStoreObjectResponse, I as UpdateMetaObjectInput, M as ReplaceTargetProjectsInput, P as ScopeElevationRequestPath, R as components$5, S as MetaObject, T as MetaStoreListResponse, c as DeleteMetaObjectRevisionPath, d as GetMetaObjectRevisionsInput, h as GetMetaObjectsInput, i as CreateMetaObjectInput, k as ReplaceMetaObjectInput, l as GetMetaObjectPath, n as GetVersionedSchemaPath, s as DeleteMetaObjectPath, t as GetSchemaPath, u as GetMetaObjectRevisionPath, y as GetOrganizationMetaObjectsPath } from "./types-B-5ya_L5.js";
|
|
21
21
|
import { a as SubscriptionId, n as ListSubscriptionsQuery, s as components$6, t as CreateSubscriptionBody } from "./types-D3wcs4tp.js";
|
|
22
22
|
import { a as CredentialInput, r as CreateCredentialInput, s as GetCredentialsInput } from "./types-gcAb6olM.js";
|
|
23
23
|
import { h as components$7, m as TablesLineageResponse, n as GetTablesLineageQuery, t as GetProjectsLineageQuery } from "./types-CAp1VexS.js";
|
|
@@ -26,12 +26,12 @@ import { n as Listener, t as Emitter } from "./emitter-dLF1Fyfg.js";
|
|
|
26
26
|
import { t as Project$1 } from "./project-BCc3mpAy.js";
|
|
27
27
|
import { r as createStorageTable } from "./index-P1vR966i.js";
|
|
28
28
|
import { n as KeboolaObjectId } from "./index-BfqkgPGI.js";
|
|
29
|
-
import { a as TagWithBindings, i as TagData, o as UpdateMetaObjectMetaDataInput, t as CreateMetaObjectMetaDataInput } from "./types-
|
|
30
|
-
import {
|
|
31
|
-
import { a as KaiMemoryStatus, r as KaiMemoryItem, s as UpdateKaiMemoryMeta, t as CreateKaiMemoryMeta } from "./types-
|
|
29
|
+
import { a as TagWithBindings, i as TagData, o as UpdateMetaObjectMetaDataInput, t as CreateMetaObjectMetaDataInput } from "./types-DVZpKGBJ.js";
|
|
30
|
+
import { D as UpdateSemanticObjectMeta, _ as SemanticObject, a as SemanticChildObjectType, b as SemanticObjectType, g as SemanticModelData, h as SemanticModelChildRef, i as SemanticChildObjectDataMap, m as SemanticMetricData, o as SemanticConstraintData, p as SemanticGlossaryData, t as CreateSemanticObjectMeta, u as SemanticDatasetData, x as SemanticRelationshipData } from "./types-CABWhTa9.js";
|
|
31
|
+
import { a as KaiMemoryStatus, r as KaiMemoryItem, s as UpdateKaiMemoryMeta, t as CreateKaiMemoryMeta } from "./types-z82gSTx8.js";
|
|
32
32
|
import { a as GetVariablesQuery, i as GetVariablesByBranchId, n as CreateVariableBody, o as VariableWithHash, r as DeleteVariablePath } from "./types-BBUZ9EHs.js";
|
|
33
33
|
import { s as EncryptionCtx } from "./index-CWPi7lBF.js";
|
|
34
|
-
import { a as OrchestrationRerunPlanPath, c as SearchAllJobsQuery, d as SearchJobsQuery, l as SearchGroupedJobsQuery, n as GetQueueJobPath, p as components$9, r as KillJobPath, t as CreateJobBody } from "./types-
|
|
34
|
+
import { a as OrchestrationRerunPlanPath, c as SearchAllJobsQuery, d as SearchJobsQuery, l as SearchGroupedJobsQuery, n as GetQueueJobPath, p as components$9, r as KillJobPath, t as CreateJobBody } from "./types-9SEE4icc.js";
|
|
35
35
|
import { a as SchedulePath, n as ConfigurationPath$1, r as GetSchedulesQuery, t as ActivateScheduleBody } from "./types-DaMmgW-O.js";
|
|
36
36
|
import { C as UpdateSinkSettingsRequestBody, E as components$10, S as UpdateSinkRequestBody, T as UpdateSourceSettingsRequestBody, d as SinkStatisticsFilesQuery, n as CreateSourceRequestBody, o as PaginationQuery, r as DeleteSourceQuery, t as CreateSinkRequestBody, w as UpdateSourceRequestBody, x as TestSourceQuery } from "./types-CoJVrRAD.js";
|
|
37
37
|
import { B as GoogleAnalyticsGetProfilesPropertiesInput, Et as FlowMigrationInput, F as GoogleDriveCreateFileInput, Ft as FacebookGetAccountsInput, Gt as DbtActionInput, H as GoogleAnalyticsGetPropertiesMetadataInput, Ht as GetEmailAttachmentsEmailInput, T as TestLookerCredentialsInput, X as GetBranchesInput, Z as GetEntrypointsInput, bn as SyncActionContext, d as OneDriveCreateWorksheetInput, dt as GenericExtractorInferMappingInput, en as GetConfigurationMigrationStatusInput, gt as GenericExtractorTestRequestInput, hn as ApifyObjectsInput, ht as GenericExtractorPerformFunctionInput, in as CommonActionInput, j as GoogleSheetsTableActionInput, m as OneDriveSearchFilesInput, p as OneDriveGetWorksheetsInput, pt as GenericExtractorLoadFromCurlInput, s as SnowflakeDwhManagerUserActionInput, u as OneDriveCreateWorkbookInput, un as CodePatternGenerateInput, yn as SyncActionBody } from "./types-BaSlU0uo.js";
|
|
@@ -15685,6 +15685,7 @@ declare const createProjectClients: ({ baseUrl, getStorageToken, onStorageTokenR
|
|
|
15685
15685
|
delayedStartTime?: string | null;
|
|
15686
15686
|
durationSeconds?: number | null;
|
|
15687
15687
|
isFinished: boolean;
|
|
15688
|
+
isSuccess: boolean | null;
|
|
15688
15689
|
url: string;
|
|
15689
15690
|
variableValuesId?: string | null;
|
|
15690
15691
|
variableValuesData?: {
|
|
@@ -15748,6 +15749,7 @@ declare const createProjectClients: ({ baseUrl, getStorageToken, onStorageTokenR
|
|
|
15748
15749
|
delayedStartTime?: string | null;
|
|
15749
15750
|
durationSeconds?: number | null;
|
|
15750
15751
|
isFinished: boolean;
|
|
15752
|
+
isSuccess: boolean | null;
|
|
15751
15753
|
url: string;
|
|
15752
15754
|
variableValuesId?: string | null;
|
|
15753
15755
|
variableValuesData?: {
|
|
@@ -15811,6 +15813,7 @@ declare const createProjectClients: ({ baseUrl, getStorageToken, onStorageTokenR
|
|
|
15811
15813
|
delayedStartTime?: string | null;
|
|
15812
15814
|
durationSeconds?: number | null;
|
|
15813
15815
|
isFinished: boolean;
|
|
15816
|
+
isSuccess: boolean | null;
|
|
15814
15817
|
url: string;
|
|
15815
15818
|
variableValuesId?: string | null;
|
|
15816
15819
|
variableValuesData?: {
|
|
@@ -15874,6 +15877,7 @@ declare const createProjectClients: ({ baseUrl, getStorageToken, onStorageTokenR
|
|
|
15874
15877
|
delayedStartTime?: string | null;
|
|
15875
15878
|
durationSeconds?: number | null;
|
|
15876
15879
|
isFinished: boolean;
|
|
15880
|
+
isSuccess: boolean | null;
|
|
15877
15881
|
url: string;
|
|
15878
15882
|
variableValuesId?: string | null;
|
|
15879
15883
|
variableValuesData?: {
|
|
@@ -15937,6 +15941,7 @@ declare const createProjectClients: ({ baseUrl, getStorageToken, onStorageTokenR
|
|
|
15937
15941
|
delayedStartTime?: string | null;
|
|
15938
15942
|
durationSeconds?: number | null;
|
|
15939
15943
|
isFinished: boolean;
|
|
15944
|
+
isSuccess: boolean | null;
|
|
15940
15945
|
url: string;
|
|
15941
15946
|
variableValuesId?: string | null;
|
|
15942
15947
|
variableValuesData?: {
|
|
@@ -16000,6 +16005,7 @@ declare const createProjectClients: ({ baseUrl, getStorageToken, onStorageTokenR
|
|
|
16000
16005
|
delayedStartTime?: string | null;
|
|
16001
16006
|
durationSeconds?: number | null;
|
|
16002
16007
|
isFinished: boolean;
|
|
16008
|
+
isSuccess: boolean | null;
|
|
16003
16009
|
url: string;
|
|
16004
16010
|
variableValuesId?: string | null;
|
|
16005
16011
|
variableValuesData?: {
|
|
@@ -18057,4 +18063,4 @@ declare const createQueryServiceClient: ({ baseUrl, middlewares, auth }: ClientI
|
|
|
18057
18063
|
};
|
|
18058
18064
|
//#endregion
|
|
18059
18065
|
export { StorageAdapter as $, ClientContext as $t, SESSION_STORAGE_KEY as A, emitter as At, toBackendSubscribers as B, delay as Bt, LoggingOptions as C, ObservedPoller as Ct, BearerSession as D, Poller as Dt, createLoggingMiddleware as E, PollTask as Et, KeboolaApi as F, PollKey as Ft, CredentialMode as G, collect as Gt, createStorageClient as H, ConcurrentOptions as Ht, ProjectClients as I, PollOptions as It, Project as J, ensure as Jt, FetchStatus as K, coalesce as Kt, RegisteredComponentId as L, PollResult as Lt, createKeboola as M, poll as Mt, KeboolaOptions as N, poller as Nt, LegacySession as O, PollerStartFn as Ot, LegacyKeboolaOptions as P, PollContext as Pt, createPersistor as Q, isKeboolaError as Qt, registry as R, PollTick as Rt, Logger as S, createPollRegistry as St, ResponseLog as T, PollState as Tt, Auth as U, concurrent as Ut, StorageOpenApiFetchClient as V, dedupe as Vt, BearerCredential as W, CollectOptions as Wt, State$1 as X, KeboolaError as Xt, Stack as Y, assert as Yt, Persistor as Z, KeboolaErrorType as Zt, createUiVersionMiddleware as _, Success as _t, parseCurrentDevBranchIdFromUrl as a, QueryJobTimeoutError as an, isEmptyDeep as at, Log as b, PollEntry as bt, FQID_TYPES as c, QueryJobError as cn, createDerivedAsyncStore as ct, parseFQID as d, ReadableStore as dt, isStorageTokenMutatingRequest as en, createLocalStorage as et, parse as f, Store as ft, KeboolaHttpHeader as g, Result as gt, jobStatus as h, Failure as ht, createQueryServiceSdk as i, ServiceUnavailableError as in, deepMerge as it, createLegacyKeboola as j, failureOf as jt, RestoreStatus as k, PollerStopFn as kt, ParsedFQID as l, isQueryJobError as ln, createDerivedStore as lt, createStorageSdk as m, generateUUID as mt, ExecuteQueryOptions as n, SyncActionError as nn, createNullStorage as nt, parseDevBranchId as o, isQueryJobTimeoutError as on, isPlainObject as ot, tableIdParser as p, createStore as pt, Location as q, TaskFn as qt, WaitForJobOptions as r, isSyncActionError as rn, createSessionStorage as rt, prefixTagsWithDevBranchId as s, readableReason as sn, AsyncState as st, createQueryServiceClient as t, createDefaultBranch as tn, createMemoryStorage as tt, constructFQID as u, UserError as un, shallowEqual as ut, RetryOptions as v, asError as vt, RequestLog as w, PollSnapshot as wt, LogLevel as x, PollRegistry as xt, createRetryMiddleware as y, series as yt, fromBackendSubscribers as z, lazy as zt };
|
|
18060
|
-
//# sourceMappingURL=index-
|
|
18066
|
+
//# sourceMappingURL=index-Bl2EloC0.d.ts.map
|
|
@@ -17,7 +17,7 @@ import { n as WriteTableInput, t as UploadFileInput } from "./types-BPy5Ozee.cjs
|
|
|
17
17
|
import { c as GetChatPath$1, d as PrepareChatRequest, f as UsageResponse$1, i as ChatRequest$1, l as GetHistoryQuery$1, n as ArtifactListResponse, o as GetArtifactPath, p as VoteRequest$1, r as ArtifactResponse, s as GetArtifactsQuery, t as ApprovalBody, u as GetVotesQuery$1 } from "./types-CBPKpLTf.cjs";
|
|
18
18
|
import { a as UserMemory, i as UserAgentSettings$1, n as SpendCapMember, r as SpendCapsView, t as AgentSettings$1 } from "./index-04pgr-EO.cjs";
|
|
19
19
|
import { a as createManagementClient } from "./index-DkvrbR2i.cjs";
|
|
20
|
-
import { E as MetaStoreObjectResponse, I as UpdateMetaObjectInput, M as ReplaceTargetProjectsInput, P as ScopeElevationRequestPath, R as components$5, S as MetaObject, T as MetaStoreListResponse, c as DeleteMetaObjectRevisionPath, d as GetMetaObjectRevisionsInput, h as GetMetaObjectsInput, i as CreateMetaObjectInput, k as ReplaceMetaObjectInput, l as GetMetaObjectPath, n as GetVersionedSchemaPath, s as DeleteMetaObjectPath, t as GetSchemaPath, u as GetMetaObjectRevisionPath, y as GetOrganizationMetaObjectsPath } from "./types-
|
|
20
|
+
import { E as MetaStoreObjectResponse, I as UpdateMetaObjectInput, M as ReplaceTargetProjectsInput, P as ScopeElevationRequestPath, R as components$5, S as MetaObject, T as MetaStoreListResponse, c as DeleteMetaObjectRevisionPath, d as GetMetaObjectRevisionsInput, h as GetMetaObjectsInput, i as CreateMetaObjectInput, k as ReplaceMetaObjectInput, l as GetMetaObjectPath, n as GetVersionedSchemaPath, s as DeleteMetaObjectPath, t as GetSchemaPath, u as GetMetaObjectRevisionPath, y as GetOrganizationMetaObjectsPath } from "./types-tgU8XvPs.cjs";
|
|
21
21
|
import { a as SubscriptionId, n as ListSubscriptionsQuery, s as components$6, t as CreateSubscriptionBody } from "./types-Dd31Lw4S.cjs";
|
|
22
22
|
import { a as CredentialInput, r as CreateCredentialInput, s as GetCredentialsInput } from "./types-BhOUS9j1.cjs";
|
|
23
23
|
import { h as components$7, m as TablesLineageResponse, n as GetTablesLineageQuery, t as GetProjectsLineageQuery } from "./types-c_bsDkV6.cjs";
|
|
@@ -26,12 +26,12 @@ import { n as Listener, t as Emitter } from "./emitter-dLF1Fyfg.cjs";
|
|
|
26
26
|
import { t as Project$1 } from "./project-B8wtlstY.cjs";
|
|
27
27
|
import { r as createStorageTable } from "./index-P1vR966i.cjs";
|
|
28
28
|
import { n as KeboolaObjectId } from "./index-BfqkgPGI.cjs";
|
|
29
|
-
import { a as TagWithBindings, i as TagData, o as UpdateMetaObjectMetaDataInput, t as CreateMetaObjectMetaDataInput } from "./types-
|
|
30
|
-
import {
|
|
31
|
-
import { a as KaiMemoryStatus, r as KaiMemoryItem, s as UpdateKaiMemoryMeta, t as CreateKaiMemoryMeta } from "./types-
|
|
29
|
+
import { a as TagWithBindings, i as TagData, o as UpdateMetaObjectMetaDataInput, t as CreateMetaObjectMetaDataInput } from "./types-Ccd9O6ca.cjs";
|
|
30
|
+
import { D as UpdateSemanticObjectMeta, _ as SemanticObject, a as SemanticChildObjectType, b as SemanticObjectType, g as SemanticModelData, h as SemanticModelChildRef, i as SemanticChildObjectDataMap, m as SemanticMetricData, o as SemanticConstraintData, p as SemanticGlossaryData, t as CreateSemanticObjectMeta, u as SemanticDatasetData, x as SemanticRelationshipData } from "./types-DdsYv2WG.cjs";
|
|
31
|
+
import { a as KaiMemoryStatus, r as KaiMemoryItem, s as UpdateKaiMemoryMeta, t as CreateKaiMemoryMeta } from "./types-CalDJHCX.cjs";
|
|
32
32
|
import { a as GetVariablesQuery, i as GetVariablesByBranchId, n as CreateVariableBody, o as VariableWithHash, r as DeleteVariablePath } from "./types-D9axmt5o.cjs";
|
|
33
33
|
import { s as EncryptionCtx } from "./index-Dd40ojPr.cjs";
|
|
34
|
-
import { a as OrchestrationRerunPlanPath, c as SearchAllJobsQuery, d as SearchJobsQuery, l as SearchGroupedJobsQuery, n as GetQueueJobPath, p as components$9, r as KillJobPath, t as CreateJobBody } from "./types-
|
|
34
|
+
import { a as OrchestrationRerunPlanPath, c as SearchAllJobsQuery, d as SearchJobsQuery, l as SearchGroupedJobsQuery, n as GetQueueJobPath, p as components$9, r as KillJobPath, t as CreateJobBody } from "./types-BjR8Yodc.cjs";
|
|
35
35
|
import { a as SchedulePath, n as ConfigurationPath$1, r as GetSchedulesQuery, t as ActivateScheduleBody } from "./types-CgBzm1YR.cjs";
|
|
36
36
|
import { C as UpdateSinkSettingsRequestBody, E as components$10, S as UpdateSinkRequestBody, T as UpdateSourceSettingsRequestBody, d as SinkStatisticsFilesQuery, n as CreateSourceRequestBody, o as PaginationQuery, r as DeleteSourceQuery, t as CreateSinkRequestBody, w as UpdateSourceRequestBody, x as TestSourceQuery } from "./types-DrvKfXXd.cjs";
|
|
37
37
|
import { B as GoogleAnalyticsGetProfilesPropertiesInput, Et as FlowMigrationInput, F as GoogleDriveCreateFileInput, Ft as FacebookGetAccountsInput, Gt as DbtActionInput, H as GoogleAnalyticsGetPropertiesMetadataInput, Ht as GetEmailAttachmentsEmailInput, T as TestLookerCredentialsInput, X as GetBranchesInput, Z as GetEntrypointsInput, bn as SyncActionContext, d as OneDriveCreateWorksheetInput, dt as GenericExtractorInferMappingInput, en as GetConfigurationMigrationStatusInput, gt as GenericExtractorTestRequestInput, hn as ApifyObjectsInput, ht as GenericExtractorPerformFunctionInput, in as CommonActionInput, j as GoogleSheetsTableActionInput, m as OneDriveSearchFilesInput, p as OneDriveGetWorksheetsInput, pt as GenericExtractorLoadFromCurlInput, s as SnowflakeDwhManagerUserActionInput, u as OneDriveCreateWorkbookInput, un as CodePatternGenerateInput, yn as SyncActionBody } from "./types-CcYxlqtB.cjs";
|
|
@@ -15685,6 +15685,7 @@ declare const createProjectClients: ({ baseUrl, getStorageToken, onStorageTokenR
|
|
|
15685
15685
|
delayedStartTime?: string | null;
|
|
15686
15686
|
durationSeconds?: number | null;
|
|
15687
15687
|
isFinished: boolean;
|
|
15688
|
+
isSuccess: boolean | null;
|
|
15688
15689
|
url: string;
|
|
15689
15690
|
variableValuesId?: string | null;
|
|
15690
15691
|
variableValuesData?: {
|
|
@@ -15748,6 +15749,7 @@ declare const createProjectClients: ({ baseUrl, getStorageToken, onStorageTokenR
|
|
|
15748
15749
|
delayedStartTime?: string | null;
|
|
15749
15750
|
durationSeconds?: number | null;
|
|
15750
15751
|
isFinished: boolean;
|
|
15752
|
+
isSuccess: boolean | null;
|
|
15751
15753
|
url: string;
|
|
15752
15754
|
variableValuesId?: string | null;
|
|
15753
15755
|
variableValuesData?: {
|
|
@@ -15811,6 +15813,7 @@ declare const createProjectClients: ({ baseUrl, getStorageToken, onStorageTokenR
|
|
|
15811
15813
|
delayedStartTime?: string | null;
|
|
15812
15814
|
durationSeconds?: number | null;
|
|
15813
15815
|
isFinished: boolean;
|
|
15816
|
+
isSuccess: boolean | null;
|
|
15814
15817
|
url: string;
|
|
15815
15818
|
variableValuesId?: string | null;
|
|
15816
15819
|
variableValuesData?: {
|
|
@@ -15874,6 +15877,7 @@ declare const createProjectClients: ({ baseUrl, getStorageToken, onStorageTokenR
|
|
|
15874
15877
|
delayedStartTime?: string | null;
|
|
15875
15878
|
durationSeconds?: number | null;
|
|
15876
15879
|
isFinished: boolean;
|
|
15880
|
+
isSuccess: boolean | null;
|
|
15877
15881
|
url: string;
|
|
15878
15882
|
variableValuesId?: string | null;
|
|
15879
15883
|
variableValuesData?: {
|
|
@@ -15937,6 +15941,7 @@ declare const createProjectClients: ({ baseUrl, getStorageToken, onStorageTokenR
|
|
|
15937
15941
|
delayedStartTime?: string | null;
|
|
15938
15942
|
durationSeconds?: number | null;
|
|
15939
15943
|
isFinished: boolean;
|
|
15944
|
+
isSuccess: boolean | null;
|
|
15940
15945
|
url: string;
|
|
15941
15946
|
variableValuesId?: string | null;
|
|
15942
15947
|
variableValuesData?: {
|
|
@@ -16000,6 +16005,7 @@ declare const createProjectClients: ({ baseUrl, getStorageToken, onStorageTokenR
|
|
|
16000
16005
|
delayedStartTime?: string | null;
|
|
16001
16006
|
durationSeconds?: number | null;
|
|
16002
16007
|
isFinished: boolean;
|
|
16008
|
+
isSuccess: boolean | null;
|
|
16003
16009
|
url: string;
|
|
16004
16010
|
variableValuesId?: string | null;
|
|
16005
16011
|
variableValuesData?: {
|
|
@@ -18057,4 +18063,4 @@ declare const createQueryServiceClient: ({ baseUrl, middlewares, auth }: ClientI
|
|
|
18057
18063
|
};
|
|
18058
18064
|
//#endregion
|
|
18059
18065
|
export { StorageAdapter as $, ClientContext as $t, SESSION_STORAGE_KEY as A, emitter as At, toBackendSubscribers as B, delay as Bt, LoggingOptions as C, ObservedPoller as Ct, BearerSession as D, Poller as Dt, createLoggingMiddleware as E, PollTask as Et, KeboolaApi as F, PollKey as Ft, CredentialMode as G, collect as Gt, createStorageClient as H, ConcurrentOptions as Ht, ProjectClients as I, PollOptions as It, Project as J, ensure as Jt, FetchStatus as K, coalesce as Kt, RegisteredComponentId as L, PollResult as Lt, createKeboola as M, poll as Mt, KeboolaOptions as N, poller as Nt, LegacySession as O, PollerStartFn as Ot, LegacyKeboolaOptions as P, PollContext as Pt, createPersistor as Q, isKeboolaError as Qt, registry as R, PollTick as Rt, Logger as S, createPollRegistry as St, ResponseLog as T, PollState as Tt, Auth as U, concurrent as Ut, StorageOpenApiFetchClient as V, dedupe as Vt, BearerCredential as W, CollectOptions as Wt, State$1 as X, KeboolaError as Xt, Stack as Y, assert as Yt, Persistor as Z, KeboolaErrorType as Zt, createUiVersionMiddleware as _, Success as _t, parseCurrentDevBranchIdFromUrl as a, QueryJobTimeoutError as an, isEmptyDeep as at, Log as b, PollEntry as bt, FQID_TYPES as c, QueryJobError as cn, createDerivedAsyncStore as ct, parseFQID as d, ReadableStore as dt, isStorageTokenMutatingRequest as en, createLocalStorage as et, parse as f, Store as ft, KeboolaHttpHeader as g, Result as gt, jobStatus as h, Failure as ht, createQueryServiceSdk as i, ServiceUnavailableError as in, deepMerge as it, createLegacyKeboola as j, failureOf as jt, RestoreStatus as k, PollerStopFn as kt, ParsedFQID as l, isQueryJobError as ln, createDerivedStore as lt, createStorageSdk as m, generateUUID as mt, ExecuteQueryOptions as n, SyncActionError as nn, createNullStorage as nt, parseDevBranchId as o, isQueryJobTimeoutError as on, isPlainObject as ot, tableIdParser as p, createStore as pt, Location as q, TaskFn as qt, WaitForJobOptions as r, isSyncActionError as rn, createSessionStorage as rt, prefixTagsWithDevBranchId as s, readableReason as sn, AsyncState as st, createQueryServiceClient as t, createDefaultBranch as tn, createMemoryStorage as tt, constructFQID as u, UserError as un, shallowEqual as ut, RetryOptions as v, asError as vt, RequestLog as w, PollSnapshot as wt, LogLevel as x, PollRegistry as xt, createRetryMiddleware as y, series as yt, fromBackendSubscribers as z, lazy as zt };
|
|
18060
|
-
//# sourceMappingURL=index-
|
|
18066
|
+
//# sourceMappingURL=index-CGFGd3tF.d.cts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as createOpenapiFetchClient } from "./index-BgR5zcjJ.js";
|
|
2
2
|
import { n as ClientInitOptions } from "./types-B2w2TtSA.js";
|
|
3
|
-
import { E as MetaStoreObjectResponse, I as UpdateMetaObjectInput, M as ReplaceTargetProjectsInput, P as ScopeElevationRequestPath, R as components, T as MetaStoreListResponse, c as DeleteMetaObjectRevisionPath, d as GetMetaObjectRevisionsInput, h as GetMetaObjectsInput, i as CreateMetaObjectInput, k as ReplaceMetaObjectInput, l as GetMetaObjectPath, n as GetVersionedSchemaPath, s as DeleteMetaObjectPath, t as GetSchemaPath, u as GetMetaObjectRevisionPath, y as GetOrganizationMetaObjectsPath, z as paths } from "./types-
|
|
3
|
+
import { E as MetaStoreObjectResponse, I as UpdateMetaObjectInput, M as ReplaceTargetProjectsInput, P as ScopeElevationRequestPath, R as components, T as MetaStoreListResponse, c as DeleteMetaObjectRevisionPath, d as GetMetaObjectRevisionsInput, h as GetMetaObjectsInput, i as CreateMetaObjectInput, k as ReplaceMetaObjectInput, l as GetMetaObjectPath, n as GetVersionedSchemaPath, s as DeleteMetaObjectPath, t as GetSchemaPath, u as GetMetaObjectRevisionPath, y as GetOrganizationMetaObjectsPath, z as paths } from "./types-B-5ya_L5.js";
|
|
4
4
|
//#region src/clients/metastore/metastoreClient.d.ts
|
|
5
5
|
type MetastoreFetchClient = ReturnType<typeof createOpenapiFetchClient<paths>>;
|
|
6
6
|
declare const createMetastoreClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
|
|
@@ -31,4 +31,4 @@ declare const createMetastoreClient: ({ baseUrl, middlewares, auth }: ClientInit
|
|
|
31
31
|
};
|
|
32
32
|
//#endregion
|
|
33
33
|
export { createMetastoreClient as n, MetastoreFetchClient as t };
|
|
34
|
-
//# sourceMappingURL=index-
|
|
34
|
+
//# sourceMappingURL=index-DtuwWYDR.d.ts.map
|
package/dist/index.cjs
CHANGED
|
@@ -4,9 +4,9 @@ const require_project = require("./project-BvFi19K_.cjs");
|
|
|
4
4
|
const require_collect = require("./collect-B5TCNiT1.cjs");
|
|
5
5
|
const require_concurrent = require("./concurrent-CdVfR1N5.cjs");
|
|
6
6
|
const require_dedupe = require("./dedupe-OSnnst2u.cjs");
|
|
7
|
-
const require_jobStatus = require("./jobStatus-
|
|
7
|
+
const require_jobStatus = require("./jobStatus-B0E-MZ9I.cjs");
|
|
8
8
|
const require_store = require("./store-xS-Cu_VS.cjs");
|
|
9
|
-
const require_storage = require("./storage-
|
|
9
|
+
const require_storage = require("./storage-76Sf_z_H.cjs");
|
|
10
10
|
const require_tag = require("./tag-DHS_soa7.cjs");
|
|
11
11
|
const require_generateUUID = require("./generateUUID-C6qKBPIv.cjs");
|
|
12
12
|
const require_isPlainObject = require("./isPlainObject-BB3iy87C.cjs");
|
|
@@ -25,7 +25,7 @@ const require_management = require("./management-C5lf9nsU.cjs");
|
|
|
25
25
|
const require_constants = require("./constants-BDGRQqij.cjs");
|
|
26
26
|
const require_storageTable = require("./storageTable-BNOR2FCh.cjs");
|
|
27
27
|
const require_kaiMemory = require("./kaiMemory-Cf81ghNd.cjs");
|
|
28
|
-
const require_semanticLayer = require("./semanticLayer-
|
|
28
|
+
const require_semanticLayer = require("./semanticLayer-7BejcMj_.cjs");
|
|
29
29
|
const require_sdk_storage_index = require("./sdk/storage/index.cjs");
|
|
30
30
|
const require_sdk_vault_index = require("./sdk/vault/index.cjs");
|
|
31
31
|
const require_ai_index = require("./ai/index.cjs");
|
|
@@ -41,8 +41,8 @@ const require_metastore = require("./metastore-YPHUK3jJ.cjs");
|
|
|
41
41
|
const require_notifications_index = require("./notifications/index.cjs");
|
|
42
42
|
const require_oauth = require("./oauth-DyUwTqHJ.cjs");
|
|
43
43
|
const require_omnisearch_index = require("./omnisearch/index.cjs");
|
|
44
|
-
const require_queryService = require("./queryService-
|
|
45
|
-
const require_queue = require("./queue-
|
|
44
|
+
const require_queryService = require("./queryService-RlNYw7LG.cjs");
|
|
45
|
+
const require_queue = require("./queue-BrgRdtOr.cjs");
|
|
46
46
|
const require_scheduler_index = require("./scheduler/index.cjs");
|
|
47
47
|
const require_stream_index = require("./stream/index.cjs");
|
|
48
48
|
const require_syncActions = require("./syncActions-DlNPhZY4.cjs");
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as ApiError, C as HtmlResponseError, O as MiddlewareFn, S as ManagementClientAuthError, _ as isTimeoutError, b as isValidationError, d as HttpContentType, f as HttpHeader, g as isFetchClientError, h as isApiError, m as isAbortError, p as FetchClientError, u as createGenericFetchClient, v as ValidationError, w as isHtmlResponseError, x as parseOrThrow, y as formatValidationIssues } from "./index-BVhHt5lx.cjs";
|
|
2
|
-
import { $ as StorageAdapter, $t as ClientContext, A as SESSION_STORAGE_KEY, At as emitter, Bt as delay, C as LoggingOptions, Ct as ObservedPoller, D as BearerSession, Dt as Poller, E as createLoggingMiddleware, Et as PollTask, F as KeboolaApi, Ft as PollKey, G as CredentialMode, Gt as collect, Ht as ConcurrentOptions, I as ProjectClients, It as PollOptions, J as Project, Jt as ensure, K as FetchStatus, Kt as coalesce, Lt as PollResult, M as createKeboola, Mt as poll, N as KeboolaOptions, Nt as poller, O as LegacySession, Ot as PollerStartFn, P as LegacyKeboolaOptions, Pt as PollContext, Q as createPersistor, Qt as isKeboolaError, Rt as PollTick, S as Logger, St as createPollRegistry, T as ResponseLog, Tt as PollState, U as Auth, Ut as concurrent, Vt as dedupe, W as BearerCredential, Wt as CollectOptions, X as State, Xt as KeboolaError, Y as Stack, Yt as assert, Z as Persistor, Zt as KeboolaErrorType, _ as createUiVersionMiddleware, _t as Success, an as QueryJobTimeoutError, at as isEmptyDeep, b as Log, bt as PollEntry, cn as QueryJobError, ct as createDerivedAsyncStore, dt as ReadableStore, en as isStorageTokenMutatingRequest, et as createLocalStorage, ft as Store, g as KeboolaHttpHeader, gt as Result, h as jobStatus, ht as Failure, i as createQueryServiceSdk, in as ServiceUnavailableError, it as deepMerge, j as createLegacyKeboola, jt as failureOf, k as RestoreStatus, kt as PollerStopFn, ln as isQueryJobError, lt as createDerivedStore, m as createStorageSdk, mt as generateUUID, nn as SyncActionError, nt as createNullStorage, on as isQueryJobTimeoutError, ot as isPlainObject, pt as createStore, q as Location, qt as TaskFn, rn as isSyncActionError, rt as createSessionStorage, sn as readableReason, st as AsyncState, tt as createMemoryStorage, un as UserError, ut as shallowEqual, v as RetryOptions, vt as asError, w as RequestLog, wt as PollSnapshot, x as LogLevel, xt as PollRegistry, y as createRetryMiddleware, yt as series, zt as lazy } from "./index-
|
|
2
|
+
import { $ as StorageAdapter, $t as ClientContext, A as SESSION_STORAGE_KEY, At as emitter, Bt as delay, C as LoggingOptions, Ct as ObservedPoller, D as BearerSession, Dt as Poller, E as createLoggingMiddleware, Et as PollTask, F as KeboolaApi, Ft as PollKey, G as CredentialMode, Gt as collect, Ht as ConcurrentOptions, I as ProjectClients, It as PollOptions, J as Project, Jt as ensure, K as FetchStatus, Kt as coalesce, Lt as PollResult, M as createKeboola, Mt as poll, N as KeboolaOptions, Nt as poller, O as LegacySession, Ot as PollerStartFn, P as LegacyKeboolaOptions, Pt as PollContext, Q as createPersistor, Qt as isKeboolaError, Rt as PollTick, S as Logger, St as createPollRegistry, T as ResponseLog, Tt as PollState, U as Auth, Ut as concurrent, Vt as dedupe, W as BearerCredential, Wt as CollectOptions, X as State, Xt as KeboolaError, Y as Stack, Yt as assert, Z as Persistor, Zt as KeboolaErrorType, _ as createUiVersionMiddleware, _t as Success, an as QueryJobTimeoutError, at as isEmptyDeep, b as Log, bt as PollEntry, cn as QueryJobError, ct as createDerivedAsyncStore, dt as ReadableStore, en as isStorageTokenMutatingRequest, et as createLocalStorage, ft as Store, g as KeboolaHttpHeader, gt as Result, h as jobStatus, ht as Failure, i as createQueryServiceSdk, in as ServiceUnavailableError, it as deepMerge, j as createLegacyKeboola, jt as failureOf, k as RestoreStatus, kt as PollerStopFn, ln as isQueryJobError, lt as createDerivedStore, m as createStorageSdk, mt as generateUUID, nn as SyncActionError, nt as createNullStorage, on as isQueryJobTimeoutError, ot as isPlainObject, pt as createStore, q as Location, qt as TaskFn, rn as isSyncActionError, rt as createSessionStorage, sn as readableReason, st as AsyncState, tt as createMemoryStorage, un as UserError, ut as shallowEqual, v as RetryOptions, vt as asError, w as RequestLog, wt as PollSnapshot, x as LogLevel, xt as PollRegistry, y as createRetryMiddleware, yt as series, zt as lazy } from "./index-CGFGd3tF.cjs";
|
|
3
3
|
import { r as AuthStrategy, t as BaseClientOptions } from "./types-DoZtE9tz.cjs";
|
|
4
4
|
import { n as parseLogLines } from "./appLogs-C9YlJ2g8.cjs";
|
|
5
5
|
import { t as isManagementClientAuthError } from "./index-DkvrbR2i.cjs";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as ApiError, C as HtmlResponseError, O as MiddlewareFn, S as ManagementClientAuthError, _ as isTimeoutError, b as isValidationError, d as HttpContentType, f as HttpHeader, g as isFetchClientError, h as isApiError, m as isAbortError, p as FetchClientError, u as createGenericFetchClient, v as ValidationError, w as isHtmlResponseError, x as parseOrThrow, y as formatValidationIssues } from "./index-BgR5zcjJ.js";
|
|
2
|
-
import { $ as StorageAdapter, $t as ClientContext, A as SESSION_STORAGE_KEY, At as emitter, Bt as delay, C as LoggingOptions, Ct as ObservedPoller, D as BearerSession, Dt as Poller, E as createLoggingMiddleware, Et as PollTask, F as KeboolaApi, Ft as PollKey, G as CredentialMode, Gt as collect, Ht as ConcurrentOptions, I as ProjectClients, It as PollOptions, J as Project, Jt as ensure, K as FetchStatus, Kt as coalesce, Lt as PollResult, M as createKeboola, Mt as poll, N as KeboolaOptions, Nt as poller, O as LegacySession, Ot as PollerStartFn, P as LegacyKeboolaOptions, Pt as PollContext, Q as createPersistor, Qt as isKeboolaError, Rt as PollTick, S as Logger, St as createPollRegistry, T as ResponseLog, Tt as PollState, U as Auth, Ut as concurrent, Vt as dedupe, W as BearerCredential, Wt as CollectOptions, X as State, Xt as KeboolaError, Y as Stack, Yt as assert, Z as Persistor, Zt as KeboolaErrorType, _ as createUiVersionMiddleware, _t as Success, an as QueryJobTimeoutError, at as isEmptyDeep, b as Log, bt as PollEntry, cn as QueryJobError, ct as createDerivedAsyncStore, dt as ReadableStore, en as isStorageTokenMutatingRequest, et as createLocalStorage, ft as Store, g as KeboolaHttpHeader, gt as Result, h as jobStatus, ht as Failure, i as createQueryServiceSdk, in as ServiceUnavailableError, it as deepMerge, j as createLegacyKeboola, jt as failureOf, k as RestoreStatus, kt as PollerStopFn, ln as isQueryJobError, lt as createDerivedStore, m as createStorageSdk, mt as generateUUID, nn as SyncActionError, nt as createNullStorage, on as isQueryJobTimeoutError, ot as isPlainObject, pt as createStore, q as Location, qt as TaskFn, rn as isSyncActionError, rt as createSessionStorage, sn as readableReason, st as AsyncState, tt as createMemoryStorage, un as UserError, ut as shallowEqual, v as RetryOptions, vt as asError, w as RequestLog, wt as PollSnapshot, x as LogLevel, xt as PollRegistry, y as createRetryMiddleware, yt as series, zt as lazy } from "./index-
|
|
2
|
+
import { $ as StorageAdapter, $t as ClientContext, A as SESSION_STORAGE_KEY, At as emitter, Bt as delay, C as LoggingOptions, Ct as ObservedPoller, D as BearerSession, Dt as Poller, E as createLoggingMiddleware, Et as PollTask, F as KeboolaApi, Ft as PollKey, G as CredentialMode, Gt as collect, Ht as ConcurrentOptions, I as ProjectClients, It as PollOptions, J as Project, Jt as ensure, K as FetchStatus, Kt as coalesce, Lt as PollResult, M as createKeboola, Mt as poll, N as KeboolaOptions, Nt as poller, O as LegacySession, Ot as PollerStartFn, P as LegacyKeboolaOptions, Pt as PollContext, Q as createPersistor, Qt as isKeboolaError, Rt as PollTick, S as Logger, St as createPollRegistry, T as ResponseLog, Tt as PollState, U as Auth, Ut as concurrent, Vt as dedupe, W as BearerCredential, Wt as CollectOptions, X as State, Xt as KeboolaError, Y as Stack, Yt as assert, Z as Persistor, Zt as KeboolaErrorType, _ as createUiVersionMiddleware, _t as Success, an as QueryJobTimeoutError, at as isEmptyDeep, b as Log, bt as PollEntry, cn as QueryJobError, ct as createDerivedAsyncStore, dt as ReadableStore, en as isStorageTokenMutatingRequest, et as createLocalStorage, ft as Store, g as KeboolaHttpHeader, gt as Result, h as jobStatus, ht as Failure, i as createQueryServiceSdk, in as ServiceUnavailableError, it as deepMerge, j as createLegacyKeboola, jt as failureOf, k as RestoreStatus, kt as PollerStopFn, ln as isQueryJobError, lt as createDerivedStore, m as createStorageSdk, mt as generateUUID, nn as SyncActionError, nt as createNullStorage, on as isQueryJobTimeoutError, ot as isPlainObject, pt as createStore, q as Location, qt as TaskFn, rn as isSyncActionError, rt as createSessionStorage, sn as readableReason, st as AsyncState, tt as createMemoryStorage, un as UserError, ut as shallowEqual, v as RetryOptions, vt as asError, w as RequestLog, wt as PollSnapshot, x as LogLevel, xt as PollRegistry, y as createRetryMiddleware, yt as series, zt as lazy } from "./index-Bl2EloC0.js";
|
|
3
3
|
import { r as AuthStrategy, t as BaseClientOptions } from "./types-B2w2TtSA.js";
|
|
4
4
|
import { n as parseLogLines } from "./appLogs-BS6ViVGR.js";
|
|
5
5
|
import { t as isManagementClientAuthError } from "./index-CA6QxbhZ.js";
|
package/dist/index.js
CHANGED
|
@@ -2,9 +2,9 @@ import { t as createProject } from "./project-DWwZv66D.js";
|
|
|
2
2
|
import { t as collect } from "./collect-97WhfEpt.js";
|
|
3
3
|
import { t as concurrent } from "./concurrent-BacWxPwi.js";
|
|
4
4
|
import { t as dedupe } from "./dedupe-Cky1gSUu.js";
|
|
5
|
-
import { a as poller, c as Result, d as delay, i as poll, l as asError, n as emitter, o as clamp, r as failureOf, s as finiteOr, t as jobStatus, u as lazy } from "./jobStatus-
|
|
5
|
+
import { a as poller, c as Result, d as delay, i as poll, l as asError, n as emitter, o as clamp, r as failureOf, s as finiteOr, t as jobStatus, u as lazy } from "./jobStatus-BJdbZ72V.js";
|
|
6
6
|
import { n as createEmitter, t as createStore } from "./store-C9FQCHGe.js";
|
|
7
|
-
import { a as readableReason, i as ServiceUnavailableError, o as series, t as createStorageClient } from "./storage-
|
|
7
|
+
import { a as readableReason, i as ServiceUnavailableError, o as series, t as createStorageClient } from "./storage-RkNaOFJ-.js";
|
|
8
8
|
import { n as keboolaUID, t as createTagSdk } from "./tag-hh-1nhNr.js";
|
|
9
9
|
import { t as generateUUID } from "./generateUUID-Dr8l-aoc.js";
|
|
10
10
|
import { t as isPlainObject } from "./isPlainObject-LYW-03uB.js";
|
|
@@ -23,7 +23,7 @@ import { n as isManagementClientAuthError, t as createManagementClient } from ".
|
|
|
23
23
|
import { s as ProjectFeature } from "./constants-Cifrqsls.js";
|
|
24
24
|
import { t as createStorageTable } from "./storageTable-BldTNyEk.js";
|
|
25
25
|
import { i as createKaiMemorySdk } from "./kaiMemory-DaOh0zVn.js";
|
|
26
|
-
import {
|
|
26
|
+
import { i as createSemanticLayerSdk } from "./semanticLayer-DvjS_nzo.js";
|
|
27
27
|
import { createStorageSdk } from "./sdk/storage/index.js";
|
|
28
28
|
import { createVaultSdk } from "./sdk/vault/index.js";
|
|
29
29
|
import { createAiClient } from "./ai/index.js";
|
|
@@ -39,8 +39,8 @@ import { t as createMetastoreClient } from "./metastore-D0C6uaPX.js";
|
|
|
39
39
|
import { createNotificationsClient } from "./notifications/index.js";
|
|
40
40
|
import { t as createOauthClient } from "./oauth-Ck_Fe14o.js";
|
|
41
41
|
import { createOmnisearchClient } from "./omnisearch/index.js";
|
|
42
|
-
import { t as createQueryServiceClient } from "./queryService-
|
|
43
|
-
import { t as createQueueClient } from "./queue-
|
|
42
|
+
import { t as createQueryServiceClient } from "./queryService-Blfz59Ms.js";
|
|
43
|
+
import { t as createQueueClient } from "./queue-CNvR-M23.js";
|
|
44
44
|
import { createSchedulerClient } from "./scheduler/index.js";
|
|
45
45
|
import { createStreamClient } from "./stream/index.js";
|
|
46
46
|
import { t as createSyncActionsClient } from "./syncActions-BvFUa9xV.js";
|
|
@@ -331,7 +331,7 @@ const STORAGE = {
|
|
|
331
331
|
* Mirrors `PlainJobInterface` in `job-queue-internal-api-php-client`.
|
|
332
332
|
*
|
|
333
333
|
* - `terminating` is running until `terminated`.
|
|
334
|
-
* - `
|
|
334
|
+
* - The split mirrors the job's `isSuccess`; with a job in hand, read `job.isSuccess` instead.
|
|
335
335
|
*/
|
|
336
336
|
const QUEUE = {
|
|
337
337
|
running: [
|
|
@@ -474,4 +474,4 @@ Object.defineProperty(exports, "poller", {
|
|
|
474
474
|
}
|
|
475
475
|
});
|
|
476
476
|
|
|
477
|
-
//# sourceMappingURL=jobStatus-
|
|
477
|
+
//# sourceMappingURL=jobStatus-B0E-MZ9I.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jobStatus-CcNlIy5R.cjs","names":["createAbortError","createEmitter","createAbortError","createStore"],"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,OAAOA,yBAAAA,iBAAiB,OAAO,MAAM,CAAC;CAElE,MAAM,gBAAgB;EACpB,aAAa,SAAS;EACtB,OAAOA,yBAAAA,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,WACrC,OAAO;AACT,MAAM,aAAiC,WACrC,CAAC,OAAO;AAEV,MAAM,OAA8B,QAA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,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-B0E-MZ9I.cjs","names":["createAbortError","createEmitter","createAbortError","createStore"],"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,OAAOA,yBAAAA,iBAAiB,OAAO,MAAM,CAAC;CAElE,MAAM,gBAAgB;EACpB,aAAa,SAAS;EACtB,OAAOA,yBAAAA,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,WACt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OAAO,WAAW,KAAK;CACvB,OAAO,WAAW,KAAK;AACzB"}
|
|
@@ -331,7 +331,7 @@ const STORAGE = {
|
|
|
331
331
|
* Mirrors `PlainJobInterface` in `job-queue-internal-api-php-client`.
|
|
332
332
|
*
|
|
333
333
|
* - `terminating` is running until `terminated`.
|
|
334
|
-
* - `
|
|
334
|
+
* - The split mirrors the job's `isSuccess`; with a job in hand, read `job.isSuccess` instead.
|
|
335
335
|
*/
|
|
336
336
|
const QUEUE = {
|
|
337
337
|
running: [
|
|
@@ -409,4 +409,4 @@ const jobStatus = {
|
|
|
409
409
|
//#endregion
|
|
410
410
|
export { poller as a, Result as c, delay as d, poll as i, asError as l, emitter as n, clamp as o, failureOf as r, finiteOr as s, jobStatus as t, lazy as u };
|
|
411
411
|
|
|
412
|
-
//# sourceMappingURL=jobStatus-
|
|
412
|
+
//# sourceMappingURL=jobStatus-BJdbZ72V.js.map
|