@metabase/client 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/LICENSE +661 -0
- package/README.md +488 -2
- package/dist/auth/credential.d.ts +2 -0
- package/dist/auth/credential.js +61 -0
- package/dist/auth/oauth-login.d.ts +2 -0
- package/dist/auth/oauth-login.js +2 -0
- package/dist/auth/oauth-session.d.ts +2 -0
- package/dist/auth/oauth-session.js +31 -0
- package/dist/card-B6merEUN.d.ts +1392 -0
- package/dist/card-BZx4NSr-.d.ts +33 -0
- package/dist/client-DNRvXFRm.d.ts +3276 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.js +95 -0
- package/dist/collection-Bib61WiV.d.ts +294 -0
- package/dist/collection-CqtGPi4W.d.ts +39 -0
- package/dist/content-translation-zfUkE_OG.d.ts +8 -0
- package/dist/credential-6aOEGqMH.d.ts +30 -0
- package/dist/cron-DThzerR6.d.ts +9 -0
- package/dist/csv-upload--K35QedP.d.ts +8 -0
- package/dist/dashboard-XTe46250.d.ts +38 -0
- package/dist/dashboard-z9i1VUZC.d.ts +970 -0
- package/dist/data-action-rS27f2Ji.d.ts +95 -0
- package/dist/database-BLUMlywE.d.ts +997 -0
- package/dist/database-DqTespfa.d.ts +27 -0
- package/dist/dataset-C6lX1-cr.d.ts +4144 -0
- package/dist/dataset-Cj3XuKLe.d.ts +23 -0
- package/dist/dependency-D8Qs5Xdx.d.ts +827 -0
- package/dist/dependency-fN5_7a22.d.ts +299 -0
- package/dist/document-oZNDbDfx.d.ts +115 -0
- package/dist/domain/card.d.ts +2 -0
- package/dist/domain/card.js +140 -0
- package/dist/domain/collection.d.ts +2 -0
- package/dist/domain/collection.js +137 -0
- package/dist/domain/content-translation.d.ts +2 -0
- package/dist/domain/content-translation.js +5 -0
- package/dist/domain/cron.d.ts +2 -0
- package/dist/domain/cron.js +5 -0
- package/dist/domain/dashboard.d.ts +2 -0
- package/dist/domain/dashboard.js +194 -0
- package/dist/domain/data-action.d.ts +2 -0
- package/dist/domain/data-action.js +85 -0
- package/dist/domain/database.d.ts +2 -0
- package/dist/domain/database.js +56 -0
- package/dist/domain/dataset.d.ts +2 -0
- package/dist/domain/dataset.js +56 -0
- package/dist/domain/dependency.d.ts +2 -0
- package/dist/domain/dependency.js +165 -0
- package/dist/domain/document.d.ts +2 -0
- package/dist/domain/document.js +94 -0
- package/dist/domain/eid-translation.d.ts +2 -0
- package/dist/domain/eid-translation.js +36 -0
- package/dist/domain/embedding.d.ts +2 -0
- package/dist/domain/embedding.js +9 -0
- package/dist/domain/erd.d.ts +2 -0
- package/dist/domain/erd.js +45 -0
- package/dist/domain/field.d.ts +2 -0
- package/dist/domain/field.js +268 -0
- package/dist/domain/git-sync.d.ts +2 -0
- package/dist/domain/git-sync.js +147 -0
- package/dist/domain/glossary.d.ts +2 -0
- package/dist/domain/glossary.js +30 -0
- package/dist/domain/library.d.ts +2 -0
- package/dist/domain/library.js +83 -0
- package/dist/domain/measure.d.ts +2 -0
- package/dist/domain/measure.js +41 -0
- package/dist/domain/metric.d.ts +2 -0
- package/dist/domain/metric.js +139 -0
- package/dist/domain/moderation-review.d.ts +2 -0
- package/dist/domain/moderation-review.js +31 -0
- package/dist/domain/notification.d.ts +2 -0
- package/dist/domain/notification.js +138 -0
- package/dist/domain/parameter.d.ts +2 -0
- package/dist/domain/parameter.js +109 -0
- package/dist/domain/permission.d.ts +2 -0
- package/dist/domain/permission.js +36 -0
- package/dist/domain/pulse.d.ts +2 -0
- package/dist/domain/pulse.js +133 -0
- package/dist/domain/query.d.ts +2 -0
- package/dist/domain/query.js +13 -0
- package/dist/domain/replacement.d.ts +2 -0
- package/dist/domain/replacement.js +93 -0
- package/dist/domain/revision.d.ts +2 -0
- package/dist/domain/revision.js +63 -0
- package/dist/domain/search.d.ts +2 -0
- package/dist/domain/search.js +63 -0
- package/dist/domain/segment.d.ts +2 -0
- package/dist/domain/segment.js +44 -0
- package/dist/domain/session-properties.d.ts +2 -0
- package/dist/domain/session-properties.js +14 -0
- package/dist/domain/setting.d.ts +2 -0
- package/dist/domain/setting.js +22 -0
- package/dist/domain/setup.d.ts +2 -0
- package/dist/domain/setup.js +21 -0
- package/dist/domain/snippet.d.ts +2 -0
- package/dist/domain/snippet.js +38 -0
- package/dist/domain/table.d.ts +2 -0
- package/dist/domain/table.js +156 -0
- package/dist/domain/text.d.ts +5 -0
- package/dist/domain/text.js +6 -0
- package/dist/domain/timeline.d.ts +2 -0
- package/dist/domain/timeline.js +97 -0
- package/dist/domain/transform-dag-run.d.ts +2 -0
- package/dist/domain/transform-dag-run.js +19 -0
- package/dist/domain/transform-inspector.d.ts +2 -0
- package/dist/domain/transform-inspector.js +142 -0
- package/dist/domain/transform-job.d.ts +2 -0
- package/dist/domain/transform-job.js +109 -0
- package/dist/domain/transform-python.d.ts +2 -0
- package/dist/domain/transform-python.js +39 -0
- package/dist/domain/transform-tag.d.ts +2 -0
- package/dist/domain/transform-tag.js +17 -0
- package/dist/domain/transform-test.d.ts +2 -0
- package/dist/domain/transform-test.js +176 -0
- package/dist/domain/transform.d.ts +2 -0
- package/dist/domain/transform.js +235 -0
- package/dist/domain/upload.d.ts +2 -0
- package/dist/domain/upload.js +13 -0
- package/dist/domain/user.d.ts +2 -0
- package/dist/domain/user.js +16 -0
- package/dist/eid-translation-nuhr8St2.d.ts +143 -0
- package/dist/embedding-Cz3RUJYf.d.ts +10 -0
- package/dist/erd-BdeFEeSy.d.ts +842 -0
- package/dist/erd-BujD227Y.d.ts +51 -0
- package/dist/errors-DdMlaXqq.js +330 -0
- package/dist/errors.d.ts +2 -0
- package/dist/errors.js +189 -0
- package/dist/features-CnFkUCj2.d.ts +261 -0
- package/dist/field-BCRO19mk.d.ts +2547 -0
- package/dist/field-Bqn10Fq_.d.ts +50 -0
- package/dist/git-sync-DNXrNVCW.d.ts +258 -0
- package/dist/git-sync-gAMKsZgN.d.ts +205 -0
- package/dist/glossary-CHK3elPj.d.ts +35 -0
- package/dist/glossary-CqFlzW33.d.ts +15 -0
- package/dist/http/errors.d.ts +2 -0
- package/dist/http/errors.js +2 -0
- package/dist/http/oauth.d.ts +2 -0
- package/dist/http/oauth.js +201 -0
- package/dist/http/retry.d.ts +19 -0
- package/dist/http/retry.js +33 -0
- package/dist/http/transport.d.ts +2 -0
- package/dist/http/transport.js +2 -0
- package/dist/index.d.ts +60 -0
- package/dist/index.js +62 -0
- package/dist/json-CZvjc3--.d.ts +19 -0
- package/dist/json-pointer.d.ts +4 -0
- package/dist/json-pointer.js +7 -0
- package/dist/json.d.ts +2 -0
- package/dist/json.js +44 -0
- package/dist/known-range-DTOBgTEC.d.ts +7 -0
- package/dist/library-Cx9h_RkU.d.ts +228 -0
- package/dist/list-BT_bBm9Z.d.ts +7 -0
- package/dist/list.d.ts +2 -0
- package/dist/list.js +1 -0
- package/dist/measure-CuMqPbQX.d.ts +108 -0
- package/dist/measure-KuXdjZYJ.d.ts +44 -0
- package/dist/metric-yvehaVCS.d.ts +2655 -0
- package/dist/moderation-review-B4RUTZ6_.d.ts +56 -0
- package/dist/network-error-5g4U1iul.js +62 -0
- package/dist/notification-BT2TDAd_.d.ts +379 -0
- package/dist/notification-BiegPoSD.d.ts +22 -0
- package/dist/oauth-C4ordeoJ.d.ts +59 -0
- package/dist/oauth-login-CJsT_3EE.d.ts +19 -0
- package/dist/oauth-login-D734Jvbq.js +179 -0
- package/dist/oauth-session-BlIlcd8Q.d.ts +6 -0
- package/dist/paginate-DZWvWvbm.d.ts +24 -0
- package/dist/paginate.d.ts +2 -0
- package/dist/paginate.js +49 -0
- package/dist/parameter-ak-J-IOj.d.ts +190 -0
- package/dist/permission-BnCQw5Kp.d.ts +149 -0
- package/dist/poll-CIwnee7h.d.ts +15 -0
- package/dist/poll.d.ts +2 -0
- package/dist/poll.js +47 -0
- package/dist/predicates.d.ts +10 -0
- package/dist/predicates.js +18 -0
- package/dist/pulse-CMc1Rwdj.d.ts +596 -0
- package/dist/pulse-dylocLd9.d.ts +18 -0
- package/dist/query-Xsin530u.d.ts +23 -0
- package/dist/refusal-B9aeHMc9.js +130 -0
- package/dist/replacement-CyvtbxGg.d.ts +2467 -0
- package/dist/replacement-S9U3gApY.d.ts +128 -0
- package/dist/requirement-check-CIA5IHC1.d.ts +17 -0
- package/dist/requirements-C0txASN8.d.ts +217 -0
- package/dist/resources/card.d.ts +2 -0
- package/dist/resources/card.js +103 -0
- package/dist/resources/collection.d.ts +2 -0
- package/dist/resources/collection.js +110 -0
- package/dist/resources/content-translation.d.ts +11 -0
- package/dist/resources/content-translation.js +27 -0
- package/dist/resources/csv-upload.d.ts +2 -0
- package/dist/resources/csv-upload.js +9 -0
- package/dist/resources/dashboard.d.ts +2 -0
- package/dist/resources/dashboard.js +218 -0
- package/dist/resources/data-action.d.ts +105 -0
- package/dist/resources/data-action.js +79 -0
- package/dist/resources/database.d.ts +2 -0
- package/dist/resources/database.js +103 -0
- package/dist/resources/dataset.d.ts +2 -0
- package/dist/resources/dataset.js +81 -0
- package/dist/resources/dependency.d.ts +2 -0
- package/dist/resources/dependency.js +150 -0
- package/dist/resources/document.d.ts +55 -0
- package/dist/resources/document.js +60 -0
- package/dist/resources/eid-translation.d.ts +8 -0
- package/dist/resources/eid-translation.js +19 -0
- package/dist/resources/erd.d.ts +2 -0
- package/dist/resources/erd.js +26 -0
- package/dist/resources/field.d.ts +2 -0
- package/dist/resources/field.js +98 -0
- package/dist/resources/git-sync.d.ts +2 -0
- package/dist/resources/git-sync.js +362 -0
- package/dist/resources/glossary.d.ts +2 -0
- package/dist/resources/glossary.js +51 -0
- package/dist/resources/library.d.ts +85 -0
- package/dist/resources/library.js +90 -0
- package/dist/resources/measure.d.ts +2 -0
- package/dist/resources/measure.js +57 -0
- package/dist/resources/metric.d.ts +2 -0
- package/dist/resources/metric.js +50 -0
- package/dist/resources/moderation-review.d.ts +23 -0
- package/dist/resources/moderation-review.js +24 -0
- package/dist/resources/notification.d.ts +2 -0
- package/dist/resources/notification.js +93 -0
- package/dist/resources/optional-parsed.d.ts +7 -0
- package/dist/resources/optional-parsed.js +14 -0
- package/dist/resources/permission.d.ts +10 -0
- package/dist/resources/permission.js +31 -0
- package/dist/resources/pivot-export.d.ts +10 -0
- package/dist/resources/pivot-export.js +16 -0
- package/dist/resources/pulse.d.ts +2 -0
- package/dist/resources/pulse.js +75 -0
- package/dist/resources/replacement.d.ts +2 -0
- package/dist/resources/replacement.js +82 -0
- package/dist/resources/request-body.d.ts +9 -0
- package/dist/resources/request-body.js +13 -0
- package/dist/resources/revision.d.ts +70 -0
- package/dist/resources/revision.js +51 -0
- package/dist/resources/search.d.ts +2 -0
- package/dist/resources/search.js +57 -0
- package/dist/resources/segment.d.ts +2 -0
- package/dist/resources/segment.js +55 -0
- package/dist/resources/setting.d.ts +11 -0
- package/dist/resources/setting.js +43 -0
- package/dist/resources/setup.d.ts +8 -0
- package/dist/resources/setup.js +18 -0
- package/dist/resources/snippet.d.ts +2 -0
- package/dist/resources/snippet.js +52 -0
- package/dist/resources/table.d.ts +2 -0
- package/dist/resources/table.js +275 -0
- package/dist/resources/timeline-event.d.ts +12 -0
- package/dist/resources/timeline-event.js +51 -0
- package/dist/resources/timeline.d.ts +2 -0
- package/dist/resources/timeline.js +82 -0
- package/dist/resources/transform-dag-run.d.ts +22 -0
- package/dist/resources/transform-dag-run.js +32 -0
- package/dist/resources/transform-inspector.d.ts +214 -0
- package/dist/resources/transform-inspector.js +47 -0
- package/dist/resources/transform-job.d.ts +2 -0
- package/dist/resources/transform-job.js +90 -0
- package/dist/resources/transform-python.d.ts +52 -0
- package/dist/resources/transform-python.js +56 -0
- package/dist/resources/transform-tag.d.ts +35 -0
- package/dist/resources/transform-tag.js +47 -0
- package/dist/resources/transform-test.d.ts +2 -0
- package/dist/resources/transform-test.js +75 -0
- package/dist/resources/transform.d.ts +2 -0
- package/dist/resources/transform.js +217 -0
- package/dist/resources/upload.d.ts +2 -0
- package/dist/resources/upload.js +48 -0
- package/dist/resources/user.d.ts +8 -0
- package/dist/resources/user.js +11 -0
- package/dist/revision-CQBPhohA.d.ts +104 -0
- package/dist/search-BxJipLN6.d.ts +26 -0
- package/dist/search-NZR6iRBs.d.ts +92 -0
- package/dist/segment-D2i34X9l.d.ts +16 -0
- package/dist/segment-pj3wklGe.d.ts +47 -0
- package/dist/session-properties-COtlxAcK.d.ts +15 -0
- package/dist/setting-DXuQGXGF.d.ts +25 -0
- package/dist/setup-Ez_U7GmM.d.ts +26 -0
- package/dist/signal.d.ts +8 -0
- package/dist/signal.js +25 -0
- package/dist/snippet-RnnWa4TL.d.ts +16 -0
- package/dist/snippet-hEV429Pv.d.ts +41 -0
- package/dist/table-B3-UaPHa.d.ts +3229 -0
- package/dist/table-B_lfuaHc.d.ts +176 -0
- package/dist/tag-qzjGGci8.d.ts +48 -0
- package/dist/timeline-C2IEcRlP.d.ts +21 -0
- package/dist/timeline-folD3mQ_.d.ts +218 -0
- package/dist/transform-CDurgE1D.d.ts +443 -0
- package/dist/transform-CXOT5kFe.d.ts +638 -0
- package/dist/transform-dag-run-BgZwv1yx.d.ts +49 -0
- package/dist/transform-inspector-BUYBt6--.d.ts +374 -0
- package/dist/transform-job-29P6BULe.d.ts +237 -0
- package/dist/transform-job-CTJImaOd.d.ts +96 -0
- package/dist/transform-python-DdDnW6yK.d.ts +56 -0
- package/dist/transform-tag-DVUIZTEM.d.ts +25 -0
- package/dist/transform-test-A-CJYT6B.d.ts +412 -0
- package/dist/transform-test-BwuyrHpT.d.ts +346 -0
- package/dist/transport-E0ZaPNWJ.d.ts +462 -0
- package/dist/transport-HP7cyo9N.js +397 -0
- package/dist/upload-B7PG3ePk.d.ts +12 -0
- package/dist/upload-UPfZFdbH.d.ts +22 -0
- package/dist/url-CI0pxHOc.d.ts +7 -0
- package/dist/url.d.ts +2 -0
- package/dist/url.js +34 -0
- package/dist/user-2r0OBoO6.d.ts +18 -0
- package/dist/version/capability-error.d.ts +2 -0
- package/dist/version/capability-error.js +42 -0
- package/dist/version/features.d.ts +2 -0
- package/dist/version/features.js +143 -0
- package/dist/version/known-range.d.ts +2 -0
- package/dist/version/known-range.js +7 -0
- package/dist/version/probe.d.ts +2 -0
- package/dist/version/probe.js +30 -0
- package/dist/version/profile.d.ts +2 -0
- package/dist/version/profile.js +64 -0
- package/dist/version/requirement-check.d.ts +2 -0
- package/dist/version/requirement-check.js +62 -0
- package/dist/version/requirements.d.ts +2 -0
- package/dist/version/requirements.js +219 -0
- package/dist/version/tag.d.ts +2 -0
- package/dist/version/tag.js +52 -0
- package/package.json +65 -4
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { TimeoutError } from "../errors.js";
|
|
2
|
+
import { paginatePages } from "../paginate.js";
|
|
3
|
+
import { t as explainer } from "../refusal-B9aeHMc9.js";
|
|
4
|
+
import { pollUntil } from "../poll.js";
|
|
5
|
+
import { TransformDagRunResult, TransformDagTransform, TransformRun, TransformRunSummary, isTransformRunFailed, isTransformRunTerminal, transformDetailSchema, transformRowSchema } from "../domain/transform.js";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
//#region src/resources/transform.ts
|
|
8
|
+
function transformListSchema(features) {
|
|
9
|
+
return z.array(transformRowSchema(features));
|
|
10
|
+
}
|
|
11
|
+
const TransformRunKickoff = z.object({
|
|
12
|
+
message: z.string(),
|
|
13
|
+
run_id: z.number().int().positive().nullable()
|
|
14
|
+
});
|
|
15
|
+
const TransformDagTransformList = z.array(TransformDagTransform);
|
|
16
|
+
function transformResource(transport) {
|
|
17
|
+
const { explain, explainWalk } = explainer(transport, "transform");
|
|
18
|
+
async function requestTransformList(path, opts) {
|
|
19
|
+
const { features } = await transport.server(opts);
|
|
20
|
+
return {
|
|
21
|
+
data: await transport.requestParsed(transformListSchema(features), path, opts),
|
|
22
|
+
total: null
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
async function requestTransform(path, opts) {
|
|
26
|
+
const { features } = await transport.server(opts);
|
|
27
|
+
return transport.requestParsed(transformRowSchema(features), path, opts);
|
|
28
|
+
}
|
|
29
|
+
/** List every transform the caller can see. */
|
|
30
|
+
async function list(options = {}) {
|
|
31
|
+
return requestTransformList("/api/transform", { ...options });
|
|
32
|
+
}
|
|
33
|
+
/** Get one transform by id. */
|
|
34
|
+
async function get(id, options = {}) {
|
|
35
|
+
const { features } = await transport.server(options);
|
|
36
|
+
return transport.requestParsed(transformDetailSchema(features), `/api/transform/${id}`, { ...options });
|
|
37
|
+
}
|
|
38
|
+
/** Create a transform — a query plus the warehouse table it writes — from a full body. */
|
|
39
|
+
async function create(params, options = {}) {
|
|
40
|
+
return requestTransform("/api/transform", {
|
|
41
|
+
...options,
|
|
42
|
+
method: "POST",
|
|
43
|
+
body: params
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/** Update a transform by id, patching only the fields the body carries. */
|
|
47
|
+
async function update(id, params, options = {}) {
|
|
48
|
+
return requestTransform(`/api/transform/${id}`, {
|
|
49
|
+
...options,
|
|
50
|
+
method: "PUT",
|
|
51
|
+
body: params
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/** Delete a transform by id, leaving any table it already materialized in place. */
|
|
55
|
+
async function remove(id, options = {}) {
|
|
56
|
+
await transport.requestRaw(`/api/transform/${id}`, {
|
|
57
|
+
...options,
|
|
58
|
+
method: "DELETE",
|
|
59
|
+
expectContentType: "binary"
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/** Drop a transform's materialized output table, keeping the transform definition. */
|
|
63
|
+
async function deleteTable(id, options = {}) {
|
|
64
|
+
await transport.requestRaw(`/api/transform/${id}/table`, {
|
|
65
|
+
...options,
|
|
66
|
+
method: "DELETE",
|
|
67
|
+
expectContentType: "binary"
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/** List the upstream transforms a transform depends on. */
|
|
71
|
+
async function dependencies(id, options = {}) {
|
|
72
|
+
return requestTransformList(`/api/transform/${id}/dependencies`, { ...options });
|
|
73
|
+
}
|
|
74
|
+
/** Request cancellation of a transform's current run. */
|
|
75
|
+
async function cancel(id, options = {}) {
|
|
76
|
+
await transport.requestRaw(`/api/transform/${id}/cancel`, {
|
|
77
|
+
...options,
|
|
78
|
+
method: "POST",
|
|
79
|
+
expectContentType: "binary"
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/** Get one transform run by run id — not by the id of the transform that produced it. */
|
|
83
|
+
async function getRun(runId, options = {}) {
|
|
84
|
+
return transport.requestParsed(TransformRun, `/api/transform/run/${runId}`, { ...options });
|
|
85
|
+
}
|
|
86
|
+
/** Walk the run history, newest first, optionally narrowed to a single transform. */
|
|
87
|
+
async function* runPages(params = {}, options = {}) {
|
|
88
|
+
yield* paginatePages(transport, "/api/transform/run", TransformRun, {
|
|
89
|
+
query: { "transform-ids": params["transform-ids"] },
|
|
90
|
+
...options.offset !== void 0 && { offset: options.offset },
|
|
91
|
+
...options.max !== void 0 && { max: options.max },
|
|
92
|
+
...options.pageSize !== void 0 && { pageSize: options.pageSize },
|
|
93
|
+
...options.signal !== void 0 && { signal: options.signal }
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Walk the unified run history, newest first by default: every row is a root run — a job run, a
|
|
98
|
+
* DAG reprocess run, or a standalone transform run — and never a member run of a job or DAG.
|
|
99
|
+
*/
|
|
100
|
+
async function* runSummaryPages(params = {}, options = {}) {
|
|
101
|
+
yield* paginatePages(transport, "/api/transform/runs", TransformRunSummary, {
|
|
102
|
+
query: {
|
|
103
|
+
types: params.types,
|
|
104
|
+
statuses: params.statuses,
|
|
105
|
+
"run-methods": params["run-methods"],
|
|
106
|
+
"start-time": params["start-time"],
|
|
107
|
+
"end-time": params["end-time"],
|
|
108
|
+
"transform-ids": params["transform-ids"],
|
|
109
|
+
"sort-column": params["sort-column"],
|
|
110
|
+
"sort-direction": params["sort-direction"]
|
|
111
|
+
},
|
|
112
|
+
...options.offset !== void 0 && { offset: options.offset },
|
|
113
|
+
...options.max !== void 0 && { max: options.max },
|
|
114
|
+
...options.pageSize !== void 0 && { pageSize: options.pageSize },
|
|
115
|
+
...options.signal !== void 0 && { signal: options.signal }
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Reset the stored checkpoint of an incremental transform, so its next run reprocesses the whole
|
|
120
|
+
* source rather than the rows past the last checkpoint.
|
|
121
|
+
*/
|
|
122
|
+
async function resetCheckpoint(id, options = {}) {
|
|
123
|
+
await transport.requestRaw(`/api/transform/${id}/reset-checkpoint`, {
|
|
124
|
+
...options,
|
|
125
|
+
method: "POST",
|
|
126
|
+
expectContentType: "binary"
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Start a DAG reprocess run seeded at a transform: the transform plus, by `direction`, every
|
|
131
|
+
* transform it transitively depends on or every transform that transitively depends on it. The
|
|
132
|
+
* server answers at once with the run's id, or null when it ran nothing because a DAG run for
|
|
133
|
+
* this transform is already in progress or the closure is empty. Progress is read off
|
|
134
|
+
* `runSummaryPages` with `types: ["dag"]`, and the member runs off `transformDagRun.transformRuns`.
|
|
135
|
+
*/
|
|
136
|
+
async function runDag(id, params, options = {}) {
|
|
137
|
+
return transport.requestParsed(TransformDagRunResult, `/api/transform/${id}/run-dag`, {
|
|
138
|
+
...options,
|
|
139
|
+
method: "POST",
|
|
140
|
+
body: { direction: params.direction }
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
/** Preview the transforms a DAG reprocess seeded at a transform would run, in execution order. */
|
|
144
|
+
async function dagTransforms(id, params, options = {}) {
|
|
145
|
+
return {
|
|
146
|
+
data: await transport.requestParsed(TransformDagTransformList, `/api/transform/${id}/dag-transforms`, {
|
|
147
|
+
...options,
|
|
148
|
+
query: { direction: params.direction }
|
|
149
|
+
}),
|
|
150
|
+
total: null
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Start a run of a transform by id. The server queues the run and answers at once; `wait` polls
|
|
155
|
+
* it to a terminal status, and `syncTarget` follows that with the output table's registration.
|
|
156
|
+
* A server that answers no run id started nothing, and there is then nothing to poll.
|
|
157
|
+
*/
|
|
158
|
+
async function run(id, params = {}, options = {}) {
|
|
159
|
+
const kickoff = await transport.requestParsed(TransformRunKickoff, `/api/transform/${id}/run`, {
|
|
160
|
+
...options,
|
|
161
|
+
method: "POST"
|
|
162
|
+
});
|
|
163
|
+
const schedule = params.syncTarget === true ? params.wait ?? {} : params.wait;
|
|
164
|
+
if (schedule === void 0 || kickoff.run_id === null) return {
|
|
165
|
+
message: kickoff.message,
|
|
166
|
+
run_id: kickoff.run_id,
|
|
167
|
+
final: null
|
|
168
|
+
};
|
|
169
|
+
const runId = kickoff.run_id;
|
|
170
|
+
const final = await pollUntil(async (signal) => getRun(runId, {
|
|
171
|
+
...options,
|
|
172
|
+
signal
|
|
173
|
+
}), (candidate) => isTransformRunTerminal(candidate.status), schedule);
|
|
174
|
+
if (params.syncTarget !== true) return {
|
|
175
|
+
message: kickoff.message,
|
|
176
|
+
run_id: runId,
|
|
177
|
+
final
|
|
178
|
+
};
|
|
179
|
+
const targetTableId = isTransformRunFailed(final.status) ? null : await awaitTargetTableId(id, schedule, options);
|
|
180
|
+
return {
|
|
181
|
+
message: kickoff.message,
|
|
182
|
+
run_id: runId,
|
|
183
|
+
final,
|
|
184
|
+
target_table_id: targetTableId
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
async function awaitTargetTableId(id, wait, options) {
|
|
188
|
+
try {
|
|
189
|
+
return (await pollUntil(async (signal) => get(id, {
|
|
190
|
+
...options,
|
|
191
|
+
signal
|
|
192
|
+
}), (transform) => transform.target_table_id !== null, wait)).target_table_id;
|
|
193
|
+
} catch (error) {
|
|
194
|
+
if (error instanceof TimeoutError) return null;
|
|
195
|
+
throw error;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return {
|
|
199
|
+
list: explain("list", list),
|
|
200
|
+
get: explain("get", get),
|
|
201
|
+
create: explain("create", create),
|
|
202
|
+
update: explain("update", update),
|
|
203
|
+
delete: explain("delete", remove),
|
|
204
|
+
deleteTable: explain("deleteTable", deleteTable),
|
|
205
|
+
dependencies: explain("dependencies", dependencies),
|
|
206
|
+
cancel: explain("cancel", cancel),
|
|
207
|
+
getRun: explain("getRun", getRun),
|
|
208
|
+
runPages: explainWalk("runPages", runPages),
|
|
209
|
+
runSummaryPages: explainWalk("runSummaryPages", runSummaryPages),
|
|
210
|
+
resetCheckpoint: explain("resetCheckpoint", resetCheckpoint),
|
|
211
|
+
runDag: explain("runDag", runDag),
|
|
212
|
+
dagTransforms: explain("dagTransforms", dagTransforms),
|
|
213
|
+
run: explain("run", run)
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
//#endregion
|
|
217
|
+
export { transformResource };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ResponseShapeError } from "../errors.js";
|
|
2
|
+
import { buildCsvFormData } from "./csv-upload.js";
|
|
3
|
+
import { UploadResult } from "../domain/upload.js";
|
|
4
|
+
//#region src/resources/upload.ts
|
|
5
|
+
const UPLOAD_TABLE_ID_HEADER = "metabase-table-id";
|
|
6
|
+
function uploadResource(transport) {
|
|
7
|
+
/**
|
|
8
|
+
* Create a table and model populated with the values from the attached CSV. Returns the model ID
|
|
9
|
+
* if successful.
|
|
10
|
+
*
|
|
11
|
+
* The file may be at most 50 MB; larger uploads are rejected with a 413 response.
|
|
12
|
+
*/
|
|
13
|
+
async function createFromCsv(file, params, options = {}) {
|
|
14
|
+
const form = buildCsvFormData(file);
|
|
15
|
+
form.append("collection_id", params.collection_id);
|
|
16
|
+
const response = await transport.requestRaw("/api/upload/csv", {
|
|
17
|
+
...options,
|
|
18
|
+
method: "POST",
|
|
19
|
+
body: form,
|
|
20
|
+
expectContentType: "binary"
|
|
21
|
+
});
|
|
22
|
+
return parseCreateUploadResult(await response.text(), response.headers);
|
|
23
|
+
}
|
|
24
|
+
return { createFromCsv };
|
|
25
|
+
}
|
|
26
|
+
function parseCreateUploadResult(bodyText, headers) {
|
|
27
|
+
return UploadResult.parse({
|
|
28
|
+
model_id: parseResponseInteger(bodyText, "response body"),
|
|
29
|
+
table_id: parseResponseInteger(headers.get(UPLOAD_TABLE_ID_HEADER), `${UPLOAD_TABLE_ID_HEADER} header`)
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function parseResponseInteger(value, source) {
|
|
33
|
+
const trimmed = value?.trim() ?? "";
|
|
34
|
+
if (trimmed === "") throw new ResponseShapeError(`upload succeeded but the ${source} was empty`, {
|
|
35
|
+
kind: "decoded",
|
|
36
|
+
source,
|
|
37
|
+
value
|
|
38
|
+
});
|
|
39
|
+
const parsed = Number(trimmed);
|
|
40
|
+
if (!Number.isInteger(parsed)) throw new ResponseShapeError(`upload succeeded but the ${source} was not an integer: ${JSON.stringify(trimmed)}`, {
|
|
41
|
+
kind: "decoded",
|
|
42
|
+
source,
|
|
43
|
+
value
|
|
44
|
+
});
|
|
45
|
+
return parsed;
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { uploadResource };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { f as RequestOptions, h as Transport } from "../transport-E0ZaPNWJ.js";
|
|
2
|
+
import { t as CurrentUser } from "../user-2r0OBoO6.js";
|
|
3
|
+
//#region src/resources/user.d.ts
|
|
4
|
+
declare function userResource(transport: Transport): {
|
|
5
|
+
current: (options?: RequestOptions) => Promise<CurrentUser>;
|
|
6
|
+
};
|
|
7
|
+
//#endregion
|
|
8
|
+
export { userResource };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CurrentUser } from "../domain/user.js";
|
|
2
|
+
//#region src/resources/user.ts
|
|
3
|
+
function userResource(transport) {
|
|
4
|
+
/** Get the user the request's credentials authenticate as. */
|
|
5
|
+
async function current(options = {}) {
|
|
6
|
+
return transport.requestParsed(CurrentUser, "/api/user/current", { ...options });
|
|
7
|
+
}
|
|
8
|
+
return { current };
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { userResource };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/domain/revision.d.ts
|
|
3
|
+
declare const RevisionEntity: z.ZodEnum<{
|
|
4
|
+
card: "card";
|
|
5
|
+
dashboard: "dashboard";
|
|
6
|
+
document: "document";
|
|
7
|
+
measure: "measure";
|
|
8
|
+
segment: "segment";
|
|
9
|
+
transform: "transform";
|
|
10
|
+
"transform-test": "transform-test";
|
|
11
|
+
}>;
|
|
12
|
+
type RevisionEntity = z.infer<typeof RevisionEntity>;
|
|
13
|
+
declare const Revision: z.ZodObject<{
|
|
14
|
+
id: z.ZodNumber;
|
|
15
|
+
timestamp: z.ZodString;
|
|
16
|
+
is_creation: z.ZodBoolean;
|
|
17
|
+
is_reversion: z.ZodBoolean;
|
|
18
|
+
most_recent: z.ZodBoolean;
|
|
19
|
+
diff: z.ZodNullable<z.ZodObject<{}, z.core.$loose>>;
|
|
20
|
+
description: z.ZodString;
|
|
21
|
+
has_multiple_changes: z.ZodBoolean;
|
|
22
|
+
user: z.ZodObject<{
|
|
23
|
+
id: z.ZodNumber;
|
|
24
|
+
first_name: z.ZodNullable<z.ZodString>;
|
|
25
|
+
last_name: z.ZodNullable<z.ZodString>;
|
|
26
|
+
common_name: z.ZodString;
|
|
27
|
+
}, z.core.$loose>;
|
|
28
|
+
}, z.core.$loose>;
|
|
29
|
+
type Revision = z.infer<typeof Revision>;
|
|
30
|
+
declare const RevisionCompact: z.ZodObject<{
|
|
31
|
+
user: z.ZodObject<{
|
|
32
|
+
id: z.ZodNumber;
|
|
33
|
+
first_name: z.ZodNullable<z.ZodString>;
|
|
34
|
+
last_name: z.ZodNullable<z.ZodString>;
|
|
35
|
+
common_name: z.ZodString;
|
|
36
|
+
}, z.core.$loose>;
|
|
37
|
+
id: z.ZodNumber;
|
|
38
|
+
description: z.ZodString;
|
|
39
|
+
timestamp: z.ZodString;
|
|
40
|
+
is_creation: z.ZodBoolean;
|
|
41
|
+
is_reversion: z.ZodBoolean;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
type RevisionCompact = z.infer<typeof RevisionCompact>;
|
|
44
|
+
declare const RevisionRow: z.ZodObject<{
|
|
45
|
+
id: z.ZodNumber;
|
|
46
|
+
model: z.ZodString;
|
|
47
|
+
model_id: z.ZodNumber;
|
|
48
|
+
user_id: z.ZodNumber;
|
|
49
|
+
object: z.ZodObject<{}, z.core.$loose>;
|
|
50
|
+
timestamp: z.ZodString;
|
|
51
|
+
is_creation: z.ZodBoolean;
|
|
52
|
+
is_reversion: z.ZodBoolean;
|
|
53
|
+
most_recent: z.ZodBoolean;
|
|
54
|
+
}, z.core.$loose>;
|
|
55
|
+
type RevisionRow = z.infer<typeof RevisionRow>;
|
|
56
|
+
declare const RevisionRevertInput: z.ZodObject<{
|
|
57
|
+
entity: z.ZodEnum<{
|
|
58
|
+
card: "card";
|
|
59
|
+
dashboard: "dashboard";
|
|
60
|
+
document: "document";
|
|
61
|
+
measure: "measure";
|
|
62
|
+
segment: "segment";
|
|
63
|
+
transform: "transform";
|
|
64
|
+
"transform-test": "transform-test";
|
|
65
|
+
}>;
|
|
66
|
+
id: z.ZodNumber;
|
|
67
|
+
revision_id: z.ZodNumber;
|
|
68
|
+
}, z.core.$strict>;
|
|
69
|
+
type RevisionRevertInput = z.infer<typeof RevisionRevertInput>;
|
|
70
|
+
declare const RevisionRevert: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
71
|
+
outcome: z.ZodLiteral<"reverted">;
|
|
72
|
+
revision: z.ZodObject<{
|
|
73
|
+
id: z.ZodNumber;
|
|
74
|
+
timestamp: z.ZodString;
|
|
75
|
+
is_creation: z.ZodBoolean;
|
|
76
|
+
is_reversion: z.ZodBoolean;
|
|
77
|
+
most_recent: z.ZodBoolean;
|
|
78
|
+
diff: z.ZodNullable<z.ZodObject<{}, z.core.$loose>>;
|
|
79
|
+
description: z.ZodString;
|
|
80
|
+
has_multiple_changes: z.ZodBoolean;
|
|
81
|
+
user: z.ZodObject<{
|
|
82
|
+
id: z.ZodNumber;
|
|
83
|
+
first_name: z.ZodNullable<z.ZodString>;
|
|
84
|
+
last_name: z.ZodNullable<z.ZodString>;
|
|
85
|
+
common_name: z.ZodString;
|
|
86
|
+
}, z.core.$loose>;
|
|
87
|
+
}, z.core.$loose>;
|
|
88
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
89
|
+
outcome: z.ZodLiteral<"unchanged">;
|
|
90
|
+
revision: z.ZodObject<{
|
|
91
|
+
id: z.ZodNumber;
|
|
92
|
+
model: z.ZodString;
|
|
93
|
+
model_id: z.ZodNumber;
|
|
94
|
+
user_id: z.ZodNumber;
|
|
95
|
+
object: z.ZodObject<{}, z.core.$loose>;
|
|
96
|
+
timestamp: z.ZodString;
|
|
97
|
+
is_creation: z.ZodBoolean;
|
|
98
|
+
is_reversion: z.ZodBoolean;
|
|
99
|
+
most_recent: z.ZodBoolean;
|
|
100
|
+
}, z.core.$loose>;
|
|
101
|
+
}, z.core.$strip>], "outcome">;
|
|
102
|
+
type RevisionRevert = z.infer<typeof RevisionRevert>;
|
|
103
|
+
//#endregion
|
|
104
|
+
export { RevisionRevertInput as a, RevisionRevert as i, RevisionCompact as n, RevisionRow as o, RevisionEntity as r, Revision as t };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { f as RequestOptions, h as Transport } from "./transport-E0ZaPNWJ.js";
|
|
2
|
+
import { n as SearchModel, r as SearchResult } from "./search-NZR6iRBs.js";
|
|
3
|
+
//#region src/resources/search.d.ts
|
|
4
|
+
interface SearchPage {
|
|
5
|
+
data: SearchResult[];
|
|
6
|
+
total: number;
|
|
7
|
+
}
|
|
8
|
+
interface SearchParams {
|
|
9
|
+
q?: string | undefined;
|
|
10
|
+
models?: ReadonlyArray<SearchModel> | undefined;
|
|
11
|
+
archived?: boolean | undefined;
|
|
12
|
+
limit?: number | undefined;
|
|
13
|
+
offset?: number | undefined;
|
|
14
|
+
table_db_id?: number | undefined;
|
|
15
|
+
verified?: boolean | undefined;
|
|
16
|
+
collection?: number | undefined;
|
|
17
|
+
created_by?: ReadonlyArray<number> | undefined;
|
|
18
|
+
search_native_query?: boolean | undefined;
|
|
19
|
+
include_metadata?: boolean | undefined;
|
|
20
|
+
include_dashboard_questions?: boolean | undefined;
|
|
21
|
+
}
|
|
22
|
+
declare function searchResource(transport: Transport): {
|
|
23
|
+
query: (params?: SearchParams | undefined, options?: RequestOptions | undefined) => Promise<SearchPage>;
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { SearchParams as n, searchResource as r, SearchPage as t };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/domain/search.d.ts
|
|
3
|
+
declare const SEARCH_MODELS: readonly ["card", "dataset", "metric", "dashboard", "collection", "database", "table", "segment", "measure", "document", "exploration", "action", "transform", "indexed-entity"];
|
|
4
|
+
declare const SearchModel: z.ZodEnum<{
|
|
5
|
+
card: "card";
|
|
6
|
+
collection: "collection";
|
|
7
|
+
dashboard: "dashboard";
|
|
8
|
+
database: "database";
|
|
9
|
+
dataset: "dataset";
|
|
10
|
+
document: "document";
|
|
11
|
+
metric: "metric";
|
|
12
|
+
measure: "measure";
|
|
13
|
+
segment: "segment";
|
|
14
|
+
table: "table";
|
|
15
|
+
transform: "transform";
|
|
16
|
+
exploration: "exploration";
|
|
17
|
+
"indexed-entity": "indexed-entity";
|
|
18
|
+
action: "action";
|
|
19
|
+
}>;
|
|
20
|
+
type SearchModel = z.infer<typeof SearchModel>;
|
|
21
|
+
declare const SearchResult: z.ZodObject<{
|
|
22
|
+
id: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
23
|
+
name: z.ZodString;
|
|
24
|
+
model: z.ZodEnum<{
|
|
25
|
+
card: "card";
|
|
26
|
+
collection: "collection";
|
|
27
|
+
dashboard: "dashboard";
|
|
28
|
+
database: "database";
|
|
29
|
+
dataset: "dataset";
|
|
30
|
+
document: "document";
|
|
31
|
+
metric: "metric";
|
|
32
|
+
measure: "measure";
|
|
33
|
+
segment: "segment";
|
|
34
|
+
table: "table";
|
|
35
|
+
transform: "transform";
|
|
36
|
+
exploration: "exploration";
|
|
37
|
+
"indexed-entity": "indexed-entity";
|
|
38
|
+
action: "action";
|
|
39
|
+
}>;
|
|
40
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
41
|
+
archived: z.ZodNullable<z.ZodBoolean>;
|
|
42
|
+
collection: z.ZodNullable<z.ZodObject<{
|
|
43
|
+
id: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodNull]>;
|
|
44
|
+
name: z.ZodNullable<z.ZodString>;
|
|
45
|
+
authority_level: z.ZodNullable<z.ZodString>;
|
|
46
|
+
type: z.ZodNullable<z.ZodString>;
|
|
47
|
+
}, z.core.$loose>>;
|
|
48
|
+
result_metadata: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodUnknown>>>;
|
|
49
|
+
database_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
50
|
+
database_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
51
|
+
table_schema: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
52
|
+
table_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
53
|
+
moderated_status: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
54
|
+
verified: "verified";
|
|
55
|
+
}>>>;
|
|
56
|
+
dashboard: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
57
|
+
id: z.ZodNumber;
|
|
58
|
+
name: z.ZodString;
|
|
59
|
+
}, z.core.$loose>>>;
|
|
60
|
+
}, z.core.$loose>;
|
|
61
|
+
type SearchResult = z.infer<typeof SearchResult>;
|
|
62
|
+
declare const SearchResultCompact: z.ZodObject<{
|
|
63
|
+
name: z.ZodString;
|
|
64
|
+
id: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
65
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
66
|
+
model: z.ZodEnum<{
|
|
67
|
+
card: "card";
|
|
68
|
+
collection: "collection";
|
|
69
|
+
dashboard: "dashboard";
|
|
70
|
+
database: "database";
|
|
71
|
+
dataset: "dataset";
|
|
72
|
+
document: "document";
|
|
73
|
+
metric: "metric";
|
|
74
|
+
measure: "measure";
|
|
75
|
+
segment: "segment";
|
|
76
|
+
table: "table";
|
|
77
|
+
transform: "transform";
|
|
78
|
+
exploration: "exploration";
|
|
79
|
+
"indexed-entity": "indexed-entity";
|
|
80
|
+
action: "action";
|
|
81
|
+
}>;
|
|
82
|
+
table_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
83
|
+
database_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
84
|
+
table_schema: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
85
|
+
dashboard: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
86
|
+
name: z.ZodString;
|
|
87
|
+
id: z.ZodNumber;
|
|
88
|
+
}, z.core.$strip>>>;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
type SearchResultCompact = z.infer<typeof SearchResultCompact>;
|
|
91
|
+
//#endregion
|
|
92
|
+
export { SearchResultCompact as i, SearchModel as n, SearchResult as r, SEARCH_MODELS as t };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { f as RequestOptions, h as Transport } from "./transport-E0ZaPNWJ.js";
|
|
2
|
+
import { t as ListResult } from "./list-BT_bBm9Z.js";
|
|
3
|
+
import { i as SegmentUpdateInput, r as SegmentCreateInput, t as Segment } from "./segment-pj3wklGe.js";
|
|
4
|
+
//#region src/resources/segment.d.ts
|
|
5
|
+
interface SegmentArchiveParams {
|
|
6
|
+
revision_message: string;
|
|
7
|
+
}
|
|
8
|
+
declare function segmentResource(transport: Transport): {
|
|
9
|
+
list: (options?: RequestOptions) => Promise<ListResult<Segment>>;
|
|
10
|
+
get: (id: number, options?: RequestOptions) => Promise<Segment>;
|
|
11
|
+
create: (params: SegmentCreateInput, options?: RequestOptions) => Promise<Segment>;
|
|
12
|
+
update: (id: number, params: SegmentUpdateInput, options?: RequestOptions) => Promise<Segment>;
|
|
13
|
+
archive: (id: number, params: SegmentArchiveParams, options?: RequestOptions) => Promise<Segment>;
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { segmentResource as n, SegmentArchiveParams as t };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/domain/segment.d.ts
|
|
3
|
+
declare const Segment: z.ZodObject<{
|
|
4
|
+
id: z.ZodNumber;
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
description: z.ZodNullable<z.ZodString>;
|
|
7
|
+
archived: z.ZodBoolean;
|
|
8
|
+
table_id: z.ZodNumber;
|
|
9
|
+
definition: z.ZodUnknown;
|
|
10
|
+
creator_id: z.ZodNumber;
|
|
11
|
+
entity_id: z.ZodNullable<z.ZodString>;
|
|
12
|
+
show_in_getting_started: z.ZodNullable<z.ZodBoolean>;
|
|
13
|
+
caveats: z.ZodNullable<z.ZodString>;
|
|
14
|
+
points_of_interest: z.ZodNullable<z.ZodString>;
|
|
15
|
+
definition_description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
16
|
+
created_at: z.ZodString;
|
|
17
|
+
updated_at: z.ZodString;
|
|
18
|
+
}, z.core.$loose>;
|
|
19
|
+
type Segment = z.infer<typeof Segment>;
|
|
20
|
+
declare const SegmentCompact: z.ZodObject<{
|
|
21
|
+
name: z.ZodString;
|
|
22
|
+
id: z.ZodNumber;
|
|
23
|
+
description: z.ZodNullable<z.ZodString>;
|
|
24
|
+
archived: z.ZodBoolean;
|
|
25
|
+
table_id: z.ZodNumber;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
type SegmentCompact = z.infer<typeof SegmentCompact>;
|
|
28
|
+
declare const SegmentCreateInput: z.ZodObject<{
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
table_id: z.ZodNumber;
|
|
31
|
+
definition: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
32
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
33
|
+
}, z.core.$loose>;
|
|
34
|
+
type SegmentCreateInput = z.infer<typeof SegmentCreateInput>;
|
|
35
|
+
declare const SegmentUpdateInput: z.ZodObject<{
|
|
36
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
|
+
definition: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
38
|
+
revision_message: z.ZodString;
|
|
39
|
+
archived: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
40
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
41
|
+
caveats: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
42
|
+
points_of_interest: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
43
|
+
show_in_getting_started: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
44
|
+
}, z.core.$loose>;
|
|
45
|
+
type SegmentUpdateInput = z.infer<typeof SegmentUpdateInput>;
|
|
46
|
+
//#endregion
|
|
47
|
+
export { SegmentUpdateInput as i, SegmentCompact as n, SegmentCreateInput as r, Segment as t };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/domain/session-properties.d.ts
|
|
3
|
+
declare const TokenFeatures: z.ZodRecord<z.ZodString, z.ZodBoolean>;
|
|
4
|
+
type TokenFeatures = z.infer<typeof TokenFeatures>;
|
|
5
|
+
declare const SessionProperties: z.ZodObject<{
|
|
6
|
+
version: z.ZodObject<{
|
|
7
|
+
tag: z.ZodString;
|
|
8
|
+
date: z.ZodOptional<z.ZodString>;
|
|
9
|
+
hash: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, z.core.$loose>;
|
|
11
|
+
"token-features": z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
12
|
+
}, z.core.$loose>;
|
|
13
|
+
type SessionProperties = z.infer<typeof SessionProperties>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { TokenFeatures as n, SessionProperties as t };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/domain/setting.d.ts
|
|
3
|
+
declare const Setting: z.ZodObject<{
|
|
4
|
+
key: z.ZodString;
|
|
5
|
+
value: z.ZodUnknown;
|
|
6
|
+
is_env_setting: z.ZodBoolean;
|
|
7
|
+
env_name: z.ZodString;
|
|
8
|
+
description: z.ZodString;
|
|
9
|
+
default: z.ZodUnknown;
|
|
10
|
+
}, z.core.$loose>;
|
|
11
|
+
type Setting = z.infer<typeof Setting>;
|
|
12
|
+
declare const SettingCompact: z.ZodObject<{
|
|
13
|
+
value: z.ZodUnknown;
|
|
14
|
+
key: z.ZodString;
|
|
15
|
+
is_env_setting: z.ZodBoolean;
|
|
16
|
+
env_name: z.ZodString;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
type SettingCompact = z.infer<typeof SettingCompact>;
|
|
19
|
+
declare const SettingValue: z.ZodObject<{
|
|
20
|
+
key: z.ZodString;
|
|
21
|
+
value: z.ZodUnknown;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
type SettingValue = z.infer<typeof SettingValue>;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { SettingCompact as n, SettingValue as r, Setting as t };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/domain/setup.d.ts
|
|
3
|
+
declare const SetupInput: z.ZodObject<{
|
|
4
|
+
token: z.ZodString;
|
|
5
|
+
user: z.ZodObject<{
|
|
6
|
+
first_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7
|
+
last_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8
|
+
email: z.ZodEmail;
|
|
9
|
+
password: z.ZodString;
|
|
10
|
+
}, z.core.$loose>;
|
|
11
|
+
prefs: z.ZodObject<{
|
|
12
|
+
site_name: z.ZodString;
|
|
13
|
+
site_locale: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
14
|
+
}, z.core.$loose>;
|
|
15
|
+
}, z.core.$loose>;
|
|
16
|
+
type SetupInput = z.infer<typeof SetupInput>;
|
|
17
|
+
declare const SetupResult: z.ZodObject<{
|
|
18
|
+
id: z.ZodString;
|
|
19
|
+
}, z.core.$loose>;
|
|
20
|
+
type SetupResult = z.infer<typeof SetupResult>;
|
|
21
|
+
declare const SetupResultCompact: z.ZodObject<{
|
|
22
|
+
id: z.ZodString;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
type SetupResultCompact = z.infer<typeof SetupResultCompact>;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { SetupResult as n, SetupResultCompact as r, SetupInput as t };
|
package/dist/signal.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { X as MetabaseError } from "./transport-E0ZaPNWJ.js";
|
|
2
|
+
//#region src/signal.d.ts
|
|
3
|
+
declare function combineAborts(...signals: Array<AbortSignal | undefined>): AbortSignal;
|
|
4
|
+
declare function throwIfAborted(...signals: Array<AbortSignal | undefined>): void;
|
|
5
|
+
declare function abortReason(signal: AbortSignal): MetabaseError;
|
|
6
|
+
declare function untilAborted<T>(promise: Promise<T>, signal: AbortSignal | undefined): Promise<T>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { abortReason, combineAborts, throwIfAborted, untilAborted };
|