@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,137 @@
|
|
|
1
|
+
import { NonBlankText } from "./text.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/domain/collection.ts
|
|
4
|
+
const CollectionId = z.union([z.number().int(), z.string()]);
|
|
5
|
+
const CollectionAuthorityLevel = z.enum(["official"]);
|
|
6
|
+
const CollectionType = z.enum([
|
|
7
|
+
"instance-analytics",
|
|
8
|
+
"trash",
|
|
9
|
+
"library",
|
|
10
|
+
"library-data",
|
|
11
|
+
"library-metrics",
|
|
12
|
+
"library-dashboards",
|
|
13
|
+
"tenant-specific-root-collection"
|
|
14
|
+
]);
|
|
15
|
+
const CollectionNamespace = z.enum([
|
|
16
|
+
"transforms",
|
|
17
|
+
"snippets",
|
|
18
|
+
"analytics",
|
|
19
|
+
"shared-tenant-collection",
|
|
20
|
+
"tenant-specific",
|
|
21
|
+
"data-apps",
|
|
22
|
+
"data-actions"
|
|
23
|
+
]);
|
|
24
|
+
const CollectionListFilter = z.enum([
|
|
25
|
+
"all",
|
|
26
|
+
"archived",
|
|
27
|
+
"personal"
|
|
28
|
+
]);
|
|
29
|
+
const COLLECTION_ITEM_FILTER_MODELS = [
|
|
30
|
+
"card",
|
|
31
|
+
"dataset",
|
|
32
|
+
"metric",
|
|
33
|
+
"dashboard",
|
|
34
|
+
"snippet",
|
|
35
|
+
"collection",
|
|
36
|
+
"document",
|
|
37
|
+
"exploration",
|
|
38
|
+
"table",
|
|
39
|
+
"transform",
|
|
40
|
+
"measure",
|
|
41
|
+
"pulse",
|
|
42
|
+
"timeline",
|
|
43
|
+
"no_models"
|
|
44
|
+
];
|
|
45
|
+
const CollectionItemFilterModel = z.enum(COLLECTION_ITEM_FILTER_MODELS);
|
|
46
|
+
const COLLECTION_ITEM_MODELS = [
|
|
47
|
+
...COLLECTION_ITEM_FILTER_MODELS,
|
|
48
|
+
"indexed-entity",
|
|
49
|
+
"action"
|
|
50
|
+
];
|
|
51
|
+
const CollectionItemModel = z.enum(COLLECTION_ITEM_MODELS);
|
|
52
|
+
const COLLECTION_PINNED_STATES = [
|
|
53
|
+
"all",
|
|
54
|
+
"is_pinned",
|
|
55
|
+
"is_not_pinned"
|
|
56
|
+
];
|
|
57
|
+
const CollectionPinnedState = z.enum(COLLECTION_PINNED_STATES);
|
|
58
|
+
const Collection = z.object({
|
|
59
|
+
id: CollectionId,
|
|
60
|
+
name: z.string(),
|
|
61
|
+
description: z.string().nullable().optional(),
|
|
62
|
+
archived: z.boolean().optional(),
|
|
63
|
+
location: z.string().nullable().optional(),
|
|
64
|
+
parent_id: CollectionId.nullable().optional(),
|
|
65
|
+
personal_owner_id: z.number().int().nullable().optional(),
|
|
66
|
+
is_personal: z.boolean().optional(),
|
|
67
|
+
authority_level: CollectionAuthorityLevel.nullable().optional(),
|
|
68
|
+
type: CollectionType.nullable().optional(),
|
|
69
|
+
namespace: CollectionNamespace.nullable().optional(),
|
|
70
|
+
entity_id: z.string().nullable().optional(),
|
|
71
|
+
slug: z.string().optional(),
|
|
72
|
+
can_write: z.boolean().optional(),
|
|
73
|
+
is_remote_synced: z.boolean().nullable().optional()
|
|
74
|
+
}).loose();
|
|
75
|
+
const CollectionCompact = Collection.pick({
|
|
76
|
+
id: true,
|
|
77
|
+
name: true,
|
|
78
|
+
description: true,
|
|
79
|
+
archived: true,
|
|
80
|
+
location: true,
|
|
81
|
+
parent_id: true,
|
|
82
|
+
type: true,
|
|
83
|
+
namespace: true,
|
|
84
|
+
authority_level: true,
|
|
85
|
+
is_personal: true,
|
|
86
|
+
is_remote_synced: true
|
|
87
|
+
}).strip();
|
|
88
|
+
const CollectionItem = z.object({
|
|
89
|
+
id: z.number().int(),
|
|
90
|
+
model: CollectionItemModel,
|
|
91
|
+
name: z.string(),
|
|
92
|
+
description: z.string().nullable().optional(),
|
|
93
|
+
archived: z.boolean().nullable(),
|
|
94
|
+
collection_id: CollectionId.nullable().optional(),
|
|
95
|
+
collection_position: z.number().int().nullable().optional(),
|
|
96
|
+
display: z.string().nullable().optional(),
|
|
97
|
+
location: z.string().nullable().optional(),
|
|
98
|
+
entity_id: z.string().nullable().optional(),
|
|
99
|
+
database_id: z.number().int().nullable().optional(),
|
|
100
|
+
dashboard_id: z.number().int().nullable().optional()
|
|
101
|
+
}).loose();
|
|
102
|
+
const CollectionItemCompact = CollectionItem.pick({
|
|
103
|
+
id: true,
|
|
104
|
+
model: true,
|
|
105
|
+
name: true,
|
|
106
|
+
description: true,
|
|
107
|
+
archived: true,
|
|
108
|
+
collection_id: true
|
|
109
|
+
}).strip();
|
|
110
|
+
const CollectionTreeNode = z.object({
|
|
111
|
+
id: CollectionId,
|
|
112
|
+
name: z.string(),
|
|
113
|
+
description: z.string().nullable().optional(),
|
|
114
|
+
archived: z.boolean().optional(),
|
|
115
|
+
location: z.string().nullable().optional(),
|
|
116
|
+
type: CollectionType.nullable().optional(),
|
|
117
|
+
authority_level: CollectionAuthorityLevel.nullable().optional(),
|
|
118
|
+
here: z.array(CollectionItemModel).optional(),
|
|
119
|
+
below: z.array(CollectionItemModel).optional()
|
|
120
|
+
}).loose().extend({ children: z.lazy(() => z.array(CollectionTreeNode)) });
|
|
121
|
+
const CollectionCreateInput = z.object({
|
|
122
|
+
name: z.string().min(1),
|
|
123
|
+
description: z.string().min(1).nullable().optional(),
|
|
124
|
+
parent_id: z.number().int().positive().nullable().optional(),
|
|
125
|
+
namespace: CollectionNamespace.nullable().optional(),
|
|
126
|
+
authority_level: CollectionAuthorityLevel.nullable().optional()
|
|
127
|
+
}).loose();
|
|
128
|
+
const CollectionUpdateFields = z.object({
|
|
129
|
+
name: NonBlankText.optional(),
|
|
130
|
+
description: NonBlankText.nullable().optional(),
|
|
131
|
+
parent_id: z.number().int().positive().nullable().optional(),
|
|
132
|
+
authority_level: CollectionAuthorityLevel.nullable().optional(),
|
|
133
|
+
archived: z.boolean().optional()
|
|
134
|
+
}).strict();
|
|
135
|
+
const CollectionUpdateInput = CollectionUpdateFields.refine((patch) => Object.keys(patch).length > 0, `the patch is empty: give at least one of ${Object.keys(CollectionUpdateFields.shape).join(", ")}`);
|
|
136
|
+
//#endregion
|
|
137
|
+
export { COLLECTION_ITEM_FILTER_MODELS, COLLECTION_ITEM_MODELS, COLLECTION_PINNED_STATES, Collection, CollectionAuthorityLevel, CollectionCompact, CollectionCreateInput, CollectionId, CollectionItem, CollectionItemCompact, CollectionItemFilterModel, CollectionItemModel, CollectionListFilter, CollectionNamespace, CollectionPinnedState, CollectionTreeNode, CollectionType, CollectionUpdateInput };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { _ as DashcardPatchInput, a as DashboardCopyInput, b as UnreadableCard, c as DashboardListFilter, d as DashboardTabCompact, f as DashboardUncopiedCard, g as DashcardDetail, h as DashcardCompact, i as DashboardCopyCompact, l as DashboardParameterConstraints, m as Dashcard, n as DashboardCompact, o as DashboardCreateInput, p as DashboardUpdateInput, r as DashboardCopy, s as DashboardDetail, t as Dashboard, u as DashboardTab, v as DashcardVirtualCard, y as DashcardVisualizationSettings } from "../dashboard-z9i1VUZC.js";
|
|
2
|
+
export { Dashboard, DashboardCompact, DashboardCopy, DashboardCopyCompact, DashboardCopyInput, DashboardCreateInput, DashboardDetail, DashboardListFilter, DashboardParameterConstraints, DashboardTab, DashboardTabCompact, DashboardUncopiedCard, DashboardUpdateInput, Dashcard, DashcardCompact, DashcardDetail, DashcardPatchInput, DashcardVirtualCard, DashcardVisualizationSettings, UnreadableCard };
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { EmbeddingParams } from "./embedding.js";
|
|
2
|
+
import { Parameter, ParameterMapping } from "./parameter.js";
|
|
3
|
+
import { Card } from "./card.js";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
//#region src/domain/dashboard.ts
|
|
6
|
+
const DashboardWidth = z.enum(["fixed", "full"]);
|
|
7
|
+
const DashboardListFilter = z.enum([
|
|
8
|
+
"all",
|
|
9
|
+
"mine",
|
|
10
|
+
"archived"
|
|
11
|
+
]);
|
|
12
|
+
const Dashcard = z.object({
|
|
13
|
+
id: z.number().int(),
|
|
14
|
+
dashboard_id: z.number().int(),
|
|
15
|
+
card_id: z.number().int().nullable(),
|
|
16
|
+
dashboard_tab_id: z.number().int().nullable(),
|
|
17
|
+
row: z.number().int(),
|
|
18
|
+
col: z.number().int(),
|
|
19
|
+
size_x: z.number().int(),
|
|
20
|
+
size_y: z.number().int(),
|
|
21
|
+
entity_id: z.string().nullable(),
|
|
22
|
+
visualization_settings: z.unknown(),
|
|
23
|
+
parameter_mappings: z.array(ParameterMapping).nullable(),
|
|
24
|
+
inline_parameters: z.array(z.string()).nullable()
|
|
25
|
+
}).loose();
|
|
26
|
+
const DashcardCompact = Dashcard.pick({
|
|
27
|
+
id: true,
|
|
28
|
+
dashboard_id: true,
|
|
29
|
+
card_id: true,
|
|
30
|
+
dashboard_tab_id: true,
|
|
31
|
+
row: true,
|
|
32
|
+
col: true,
|
|
33
|
+
size_x: true,
|
|
34
|
+
size_y: true,
|
|
35
|
+
parameter_mappings: true
|
|
36
|
+
}).strip();
|
|
37
|
+
/**
|
|
38
|
+
* What a dashcard that is not a chart of a card shows. `display` names it: `text`, `heading`,
|
|
39
|
+
* `link`, `iframe`, `placeholder`, or `action` for an action button. The server stores the
|
|
40
|
+
* settings without checking them, so `display` is an open string another client may leave out.
|
|
41
|
+
*/
|
|
42
|
+
const DashcardVirtualCard = z.object({ display: z.string().optional() }).loose();
|
|
43
|
+
/**
|
|
44
|
+
* A dashcard's visualization settings. Every key is free-form except the two that say what a
|
|
45
|
+
* dashcard is when it is not a chart: `virtual_card`, and `text`, the Markdown a text or heading
|
|
46
|
+
* dashcard shows.
|
|
47
|
+
*/
|
|
48
|
+
const DashcardVisualizationSettings = z.object({
|
|
49
|
+
virtual_card: DashcardVirtualCard.nullable().optional(),
|
|
50
|
+
text: z.string().nullable().optional()
|
|
51
|
+
}).loose();
|
|
52
|
+
/**
|
|
53
|
+
* A card the caller cannot read. The server cuts it down to its `id` before answering, so a
|
|
54
|
+
* dashboard the caller can read still lists it; a readable card always carries its `name`, which is
|
|
55
|
+
* what tells the two apart.
|
|
56
|
+
*/
|
|
57
|
+
const UnreadableCard = z.object({
|
|
58
|
+
id: z.number().int(),
|
|
59
|
+
name: z.never().optional()
|
|
60
|
+
}).loose();
|
|
61
|
+
/**
|
|
62
|
+
* A dashcard as a dashboard read or write returns it, with its card whole in `card`. An action
|
|
63
|
+
* button bound to a model carries the model there and the action in `action_id`. A dashcard bound to
|
|
64
|
+
* no card (a text, heading, link, iframe or placeholder dashcard, or an action button bound to no
|
|
65
|
+
* model, which `visualization_settings.virtual_card` names) has `card_id` and `card` both `null`.
|
|
66
|
+
*/
|
|
67
|
+
const DashcardDetail = Dashcard.extend({
|
|
68
|
+
action_id: z.number().int().nullable(),
|
|
69
|
+
visualization_settings: DashcardVisualizationSettings,
|
|
70
|
+
card: z.union([Card, UnreadableCard]).nullable()
|
|
71
|
+
});
|
|
72
|
+
const DashboardTab = z.object({
|
|
73
|
+
id: z.number().int(),
|
|
74
|
+
dashboard_id: z.number().int(),
|
|
75
|
+
name: z.string(),
|
|
76
|
+
position: z.number().int().optional(),
|
|
77
|
+
entity_id: z.string().nullable().optional()
|
|
78
|
+
}).loose();
|
|
79
|
+
const DashboardTabCompact = DashboardTab.pick({
|
|
80
|
+
id: true,
|
|
81
|
+
dashboard_id: true,
|
|
82
|
+
name: true,
|
|
83
|
+
position: true
|
|
84
|
+
}).strip();
|
|
85
|
+
const Dashboard = z.object({
|
|
86
|
+
id: z.number().int(),
|
|
87
|
+
name: z.string(),
|
|
88
|
+
description: z.string().nullable(),
|
|
89
|
+
archived: z.boolean(),
|
|
90
|
+
collection_id: z.number().int().nullable(),
|
|
91
|
+
creator_id: z.number().int(),
|
|
92
|
+
entity_id: z.string().nullable(),
|
|
93
|
+
width: DashboardWidth,
|
|
94
|
+
auto_apply_filters: z.boolean(),
|
|
95
|
+
enable_embedding: z.boolean(),
|
|
96
|
+
public_uuid: z.string().nullable(),
|
|
97
|
+
cache_ttl: z.number().int().nullable(),
|
|
98
|
+
collection_position: z.number().int().nullable(),
|
|
99
|
+
parameters: z.array(Parameter).nullable(),
|
|
100
|
+
dashcards: z.array(Dashcard).optional(),
|
|
101
|
+
tabs: z.array(DashboardTab).optional()
|
|
102
|
+
}).loose();
|
|
103
|
+
const DashboardDetail = Dashboard.extend({
|
|
104
|
+
parameters: z.array(Parameter),
|
|
105
|
+
dashcards: z.array(DashcardDetail),
|
|
106
|
+
tabs: z.array(DashboardTab)
|
|
107
|
+
});
|
|
108
|
+
const DashboardCompact = Dashboard.pick({
|
|
109
|
+
id: true,
|
|
110
|
+
name: true,
|
|
111
|
+
description: true,
|
|
112
|
+
archived: true,
|
|
113
|
+
collection_id: true
|
|
114
|
+
}).strip().extend({
|
|
115
|
+
dashcards: z.array(DashcardCompact).optional(),
|
|
116
|
+
tabs: z.array(DashboardTabCompact).optional()
|
|
117
|
+
});
|
|
118
|
+
const DashcardWrite = z.object({
|
|
119
|
+
id: z.number().int().describe("existing dashcard id; negative to create a new dashcard"),
|
|
120
|
+
card_id: z.number().int().positive().nullable().describe("card the dashcard renders; null for a virtual (text, heading, link) or action dashcard"),
|
|
121
|
+
size_x: z.number().int().positive(),
|
|
122
|
+
size_y: z.number().int().positive(),
|
|
123
|
+
row: z.number().int().nonnegative(),
|
|
124
|
+
col: z.number().int().nonnegative(),
|
|
125
|
+
parameter_mappings: z.array(ParameterMapping).nullable().optional(),
|
|
126
|
+
inline_parameters: z.array(z.string().min(1)).nullable().optional(),
|
|
127
|
+
series: z.array(z.record(z.string(), z.unknown())).nullable().optional()
|
|
128
|
+
}).loose();
|
|
129
|
+
const DashboardTabWrite = z.object({
|
|
130
|
+
id: z.number().int().describe("existing tab id; negative to create a new tab"),
|
|
131
|
+
name: z.string().min(1)
|
|
132
|
+
}).loose();
|
|
133
|
+
const DashboardCreateInput = z.object({
|
|
134
|
+
name: z.string().min(1),
|
|
135
|
+
description: z.string().nullable().optional(),
|
|
136
|
+
parameters: z.array(Parameter).nullable().optional(),
|
|
137
|
+
cache_ttl: z.number().int().positive().nullable().optional(),
|
|
138
|
+
collection_id: z.number().int().positive().nullable().optional(),
|
|
139
|
+
collection_position: z.number().int().positive().nullable().optional(),
|
|
140
|
+
dashcards: z.array(DashcardWrite).optional(),
|
|
141
|
+
tabs: z.array(DashboardTabWrite).optional()
|
|
142
|
+
}).loose();
|
|
143
|
+
const DashboardUpdateInput = z.object({
|
|
144
|
+
name: z.string().min(1).nullable().optional(),
|
|
145
|
+
description: z.string().nullable().optional(),
|
|
146
|
+
caveats: z.string().nullable().optional(),
|
|
147
|
+
points_of_interest: z.string().nullable().optional(),
|
|
148
|
+
show_in_getting_started: z.boolean().nullable().optional(),
|
|
149
|
+
archived: z.boolean().nullable().optional(),
|
|
150
|
+
position: z.number().int().positive().nullable().optional(),
|
|
151
|
+
width: DashboardWidth.optional(),
|
|
152
|
+
enable_embedding: z.boolean().nullable().optional(),
|
|
153
|
+
embedding_type: z.string().nullable().optional(),
|
|
154
|
+
embedding_params: EmbeddingParams.nullable().optional(),
|
|
155
|
+
parameters: z.array(Parameter).nullable().optional(),
|
|
156
|
+
cache_ttl: z.number().int().positive().nullable().optional(),
|
|
157
|
+
collection_id: z.number().int().positive().nullable().optional(),
|
|
158
|
+
collection_position: z.number().int().positive().nullable().optional(),
|
|
159
|
+
dashcards: z.array(DashcardWrite).nullable().optional(),
|
|
160
|
+
tabs: z.array(DashboardTabWrite).nullable().optional()
|
|
161
|
+
}).loose();
|
|
162
|
+
const DashcardPatchInput = z.object({
|
|
163
|
+
row: z.number().int().nonnegative().optional(),
|
|
164
|
+
col: z.number().int().nonnegative().optional(),
|
|
165
|
+
size_x: z.number().int().positive().optional(),
|
|
166
|
+
size_y: z.number().int().positive().optional(),
|
|
167
|
+
dashboard_tab_id: z.number().int().nullable().optional(),
|
|
168
|
+
parameter_mappings: z.array(ParameterMapping).nullable().optional(),
|
|
169
|
+
inline_parameters: z.array(z.string().min(1)).nullable().optional(),
|
|
170
|
+
visualization_settings: z.unknown().optional(),
|
|
171
|
+
series: z.array(z.record(z.string(), z.unknown())).nullable().optional()
|
|
172
|
+
}).strict().refine((value) => Object.keys(value).length > 0, { message: "patch must contain at least one field" });
|
|
173
|
+
const DashboardCopyInput = z.object({
|
|
174
|
+
name: z.string().min(1).nullable().optional(),
|
|
175
|
+
description: z.string().nullable().optional(),
|
|
176
|
+
collection_id: z.number().int().positive().nullable().optional(),
|
|
177
|
+
collection_position: z.number().int().positive().nullable().optional(),
|
|
178
|
+
is_deep_copy: z.boolean().nullable().optional()
|
|
179
|
+
}).strict();
|
|
180
|
+
const DashboardUncopiedCard = z.object({ id: z.number().int() }).loose();
|
|
181
|
+
const DashboardCopy = Dashboard.extend({ uncopied: z.array(DashboardUncopiedCard).optional() });
|
|
182
|
+
const DashboardCopyCompact = DashboardCompact.extend({ uncopied: z.array(DashboardUncopiedCard.pick({ id: true }).strip()).optional() });
|
|
183
|
+
const ParameterConstraintValue = z.union([
|
|
184
|
+
z.string(),
|
|
185
|
+
z.number(),
|
|
186
|
+
z.boolean()
|
|
187
|
+
]);
|
|
188
|
+
/**
|
|
189
|
+
* Values of other parameters on a dashboard, by parameter id, that narrow the values a linked
|
|
190
|
+
* parameter offers. An array sets several values for one parameter.
|
|
191
|
+
*/
|
|
192
|
+
const DashboardParameterConstraints = z.record(z.string().min(1), z.union([ParameterConstraintValue, z.array(ParameterConstraintValue)]));
|
|
193
|
+
//#endregion
|
|
194
|
+
export { Dashboard, DashboardCompact, DashboardCopy, DashboardCopyCompact, DashboardCopyInput, DashboardCreateInput, DashboardDetail, DashboardListFilter, DashboardParameterConstraints, DashboardTab, DashboardTabCompact, DashboardUncopiedCard, DashboardUpdateInput, Dashcard, DashcardCompact, DashcardDetail, DashcardPatchInput, DashcardVirtualCard, DashcardVisualizationSettings, UnreadableCard };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as DataActionExecuteResult, c as dataActionSchema, i as DataActionExecuteInput, n as DataActionCompact, o as DataActionParameter, r as DataActionCreateInput, s as DataActionUpdateInput, t as DataAction } from "../data-action-rS27f2Ji.js";
|
|
2
|
+
export { DataAction, DataActionCompact, DataActionCreateInput, DataActionExecuteInput, DataActionExecuteResult, DataActionParameter, DataActionUpdateInput, dataActionSchema };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { DatasetQuery } from "./query.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/domain/data-action.ts
|
|
4
|
+
const DataActionParameter = z.object({
|
|
5
|
+
id: z.string(),
|
|
6
|
+
type: z.string(),
|
|
7
|
+
name: z.string().optional(),
|
|
8
|
+
slug: z.string().optional(),
|
|
9
|
+
target: z.unknown().optional(),
|
|
10
|
+
required: z.boolean().optional()
|
|
11
|
+
}).loose();
|
|
12
|
+
const DataActionBase = z.object({
|
|
13
|
+
id: z.number().int(),
|
|
14
|
+
name: z.string(),
|
|
15
|
+
description: z.string().nullable(),
|
|
16
|
+
type: z.string(),
|
|
17
|
+
model_id: z.number().int().nullable(),
|
|
18
|
+
database_id: z.number().int().nullable().optional(),
|
|
19
|
+
dataset_query: z.unknown().optional(),
|
|
20
|
+
parameters: z.array(DataActionParameter).nullable(),
|
|
21
|
+
visualization_settings: z.unknown(),
|
|
22
|
+
archived: z.boolean(),
|
|
23
|
+
public_uuid: z.string().nullable(),
|
|
24
|
+
entity_id: z.string().nullable(),
|
|
25
|
+
creator_id: z.number().int(),
|
|
26
|
+
created_at: z.string(),
|
|
27
|
+
updated_at: z.string()
|
|
28
|
+
}).loose();
|
|
29
|
+
const DataAction = DataActionBase.extend({ collection_id: z.number().int().nullable() });
|
|
30
|
+
function withoutCollection(wire) {
|
|
31
|
+
return {
|
|
32
|
+
...wire,
|
|
33
|
+
collection_id: null
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/** The shape every data action endpoint answers on a server with `features`, read as `DataAction`. */
|
|
37
|
+
function dataActionSchema(features) {
|
|
38
|
+
return features.dataActionCollections ? DataAction : DataActionBase.transform(withoutCollection);
|
|
39
|
+
}
|
|
40
|
+
const DataActionCompact = DataAction.pick({
|
|
41
|
+
id: true,
|
|
42
|
+
name: true,
|
|
43
|
+
type: true,
|
|
44
|
+
collection_id: true,
|
|
45
|
+
database_id: true,
|
|
46
|
+
archived: true
|
|
47
|
+
}).strip();
|
|
48
|
+
const DataActionParameterInput = z.object({
|
|
49
|
+
id: z.string().min(1),
|
|
50
|
+
type: z.string().min(1),
|
|
51
|
+
name: z.string().optional(),
|
|
52
|
+
slug: z.string().optional(),
|
|
53
|
+
target: z.unknown(),
|
|
54
|
+
required: z.boolean().optional()
|
|
55
|
+
}).loose();
|
|
56
|
+
const DataActionCreateInput = z.object({
|
|
57
|
+
name: z.string().min(1),
|
|
58
|
+
type: z.literal("query"),
|
|
59
|
+
database_id: z.number().int().positive(),
|
|
60
|
+
dataset_query: DatasetQuery,
|
|
61
|
+
parameters: z.array(DataActionParameterInput).optional(),
|
|
62
|
+
collection_id: z.number().int().positive().nullable().optional(),
|
|
63
|
+
description: z.string().nullable().optional(),
|
|
64
|
+
visualization_settings: z.unknown().optional()
|
|
65
|
+
}).strict();
|
|
66
|
+
const DataActionUpdateInput = z.object({
|
|
67
|
+
name: z.string().min(1).optional(),
|
|
68
|
+
database_id: z.number().int().positive().optional(),
|
|
69
|
+
dataset_query: DatasetQuery.optional(),
|
|
70
|
+
parameters: z.array(DataActionParameterInput).optional(),
|
|
71
|
+
collection_id: z.number().int().positive().nullable().optional(),
|
|
72
|
+
description: z.string().nullable().optional(),
|
|
73
|
+
visualization_settings: z.unknown().optional(),
|
|
74
|
+
archived: z.boolean().optional()
|
|
75
|
+
}).strict();
|
|
76
|
+
const DataActionParameterValue = z.union([
|
|
77
|
+
z.string(),
|
|
78
|
+
z.number(),
|
|
79
|
+
z.boolean(),
|
|
80
|
+
z.null()
|
|
81
|
+
]);
|
|
82
|
+
const DataActionExecuteInput = z.object({ parameters: z.record(z.string(), DataActionParameterValue) }).strict();
|
|
83
|
+
const DataActionExecuteResult = z.object({ "rows-affected": z.number().int() }).loose();
|
|
84
|
+
//#endregion
|
|
85
|
+
export { DataAction, DataActionCompact, DataActionCreateInput, DataActionExecuteInput, DataActionExecuteResult, DataActionParameter, DataActionUpdateInput, dataActionSchema };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as DatabaseSettings, c as DatabaseVirtualTable, d as DatabaseWithSettingsCompact, i as DatabaseListInclude, l as DatabaseVirtualTableCompact, n as DatabaseCompact, o as DatabaseSyncResult, r as DatabaseGetInclude, s as DatabaseUpdateInput, t as Database, u as DatabaseWithSettings } from "../database-BLUMlywE.js";
|
|
2
|
+
export { Database, DatabaseCompact, DatabaseGetInclude, DatabaseListInclude, DatabaseSettings, DatabaseSyncResult, DatabaseUpdateInput, DatabaseVirtualTable, DatabaseVirtualTableCompact, DatabaseWithSettings, DatabaseWithSettingsCompact };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { CardType } from "./card.js";
|
|
2
|
+
import { Table, TableCompact } from "./table.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region src/domain/database.ts
|
|
5
|
+
const DatabaseVirtualTable = z.object({
|
|
6
|
+
id: z.string(),
|
|
7
|
+
db_id: z.number().int(),
|
|
8
|
+
display_name: z.string(),
|
|
9
|
+
schema: z.string(),
|
|
10
|
+
description: z.string().nullable(),
|
|
11
|
+
type: CardType,
|
|
12
|
+
moderated_status: z.string().nullable(),
|
|
13
|
+
entity_id: z.string().nullable()
|
|
14
|
+
}).loose();
|
|
15
|
+
const DatabaseVirtualTableCompact = DatabaseVirtualTable.pick({
|
|
16
|
+
id: true,
|
|
17
|
+
db_id: true,
|
|
18
|
+
display_name: true,
|
|
19
|
+
schema: true,
|
|
20
|
+
description: true,
|
|
21
|
+
type: true
|
|
22
|
+
}).strip();
|
|
23
|
+
const Database = z.object({
|
|
24
|
+
id: z.number().int(),
|
|
25
|
+
name: z.string(),
|
|
26
|
+
engine: z.string().optional(),
|
|
27
|
+
is_saved_questions: z.boolean().optional(),
|
|
28
|
+
is_sample: z.boolean().optional(),
|
|
29
|
+
is_audit: z.boolean().optional(),
|
|
30
|
+
initial_sync_status: z.string().nullable().optional(),
|
|
31
|
+
tables: z.array(z.union([Table, DatabaseVirtualTable])).optional()
|
|
32
|
+
}).loose();
|
|
33
|
+
const DatabaseCompact = Database.pick({
|
|
34
|
+
id: true,
|
|
35
|
+
name: true,
|
|
36
|
+
engine: true,
|
|
37
|
+
is_saved_questions: true
|
|
38
|
+
}).strip().extend({ tables: z.array(z.union([TableCompact, DatabaseVirtualTableCompact])).optional() });
|
|
39
|
+
const DatabaseListInclude = z.enum(["tables"]);
|
|
40
|
+
const DatabaseGetInclude = z.enum(["tables", "tables.fields"]);
|
|
41
|
+
const DATA_ACTIONS_SETTING = "database-enable-actions";
|
|
42
|
+
const DatabaseSettings = z.object({ [DATA_ACTIONS_SETTING]: z.boolean().optional() }).loose();
|
|
43
|
+
const DatabaseWithSettings = Database.extend({ settings: DatabaseSettings.nullable() });
|
|
44
|
+
const DatabaseWithSettingsCompact = DatabaseWithSettings.pick({
|
|
45
|
+
id: true,
|
|
46
|
+
name: true,
|
|
47
|
+
engine: true
|
|
48
|
+
}).strip().extend({ settings: DatabaseSettings.pick({ [DATA_ACTIONS_SETTING]: true }).strip().nullable() });
|
|
49
|
+
const DatabaseUpdateInput = z.object({ settings: z.object({ [DATA_ACTIONS_SETTING]: z.boolean() }).strict() }).strict();
|
|
50
|
+
const DatabaseSyncResult = z.object({
|
|
51
|
+
id: z.number().int(),
|
|
52
|
+
status: z.literal("ok"),
|
|
53
|
+
initial_sync_status: z.string().nullable().optional()
|
|
54
|
+
});
|
|
55
|
+
//#endregion
|
|
56
|
+
export { Database, DatabaseCompact, DatabaseGetInclude, DatabaseListInclude, DatabaseSettings, DatabaseSyncResult, DatabaseUpdateInput, DatabaseVirtualTable, DatabaseVirtualTableCompact, DatabaseWithSettings, DatabaseWithSettingsCompact };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as QueryMetadataTable, c as VirtualTable, i as QueryMetadataCompact, l as VirtualTableCompact, n as CompiledQueryCompact, o as VirtualField, r as QueryMetadata, s as VirtualFieldCompact, t as CompiledQuery } from "../dataset-C6lX1-cr.js";
|
|
2
|
+
export { CompiledQuery, CompiledQueryCompact, QueryMetadata, QueryMetadataCompact, QueryMetadataTable, VirtualField, VirtualFieldCompact, VirtualTable, VirtualTableCompact };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Field, FieldBaseType, FieldCompact, FieldSemanticType } from "./field.js";
|
|
2
|
+
import { TableQueryMetadata, TableQueryMetadataCompact } from "./table.js";
|
|
3
|
+
import { Database, DatabaseCompact, DatabaseVirtualTable, DatabaseVirtualTableCompact } from "./database.js";
|
|
4
|
+
import { Snippet, SnippetCompact } from "./snippet.js";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
//#region src/domain/dataset.ts
|
|
7
|
+
const CompiledQuery = z.object({
|
|
8
|
+
query: z.union([z.string(), z.array(z.unknown())]),
|
|
9
|
+
params: z.array(z.unknown()).nullable().optional(),
|
|
10
|
+
collection: z.string().nullable().optional()
|
|
11
|
+
}).loose();
|
|
12
|
+
const CompiledQueryCompact = CompiledQuery.pick({
|
|
13
|
+
query: true,
|
|
14
|
+
params: true,
|
|
15
|
+
collection: true
|
|
16
|
+
}).strip();
|
|
17
|
+
const FieldRef = z.tuple([
|
|
18
|
+
z.literal("field"),
|
|
19
|
+
z.string(),
|
|
20
|
+
z.object({ "base-type": FieldBaseType }).loose()
|
|
21
|
+
]);
|
|
22
|
+
const VirtualField = z.object({
|
|
23
|
+
id: z.union([z.number().int(), FieldRef]),
|
|
24
|
+
table_id: z.string(),
|
|
25
|
+
name: z.string(),
|
|
26
|
+
display_name: z.string(),
|
|
27
|
+
base_type: FieldBaseType,
|
|
28
|
+
semantic_type: FieldSemanticType.nullable(),
|
|
29
|
+
fk_target_field_id: z.number().int().nullable().optional()
|
|
30
|
+
}).loose();
|
|
31
|
+
const VirtualFieldCompact = VirtualField.pick({
|
|
32
|
+
id: true,
|
|
33
|
+
table_id: true,
|
|
34
|
+
name: true,
|
|
35
|
+
display_name: true,
|
|
36
|
+
base_type: true,
|
|
37
|
+
semantic_type: true,
|
|
38
|
+
fk_target_field_id: true
|
|
39
|
+
}).strip();
|
|
40
|
+
const VirtualTable = DatabaseVirtualTable.extend({ fields: z.array(VirtualField) });
|
|
41
|
+
const VirtualTableCompact = DatabaseVirtualTableCompact.extend({ fields: z.array(VirtualFieldCompact) });
|
|
42
|
+
const QueryMetadataTable = TableQueryMetadata.omit({ db: true });
|
|
43
|
+
const QueryMetadata = z.object({
|
|
44
|
+
databases: z.array(Database),
|
|
45
|
+
tables: z.array(z.union([QueryMetadataTable, VirtualTable])),
|
|
46
|
+
fields: z.array(Field),
|
|
47
|
+
snippets: z.array(Snippet)
|
|
48
|
+
}).loose();
|
|
49
|
+
const QueryMetadataCompact = z.object({
|
|
50
|
+
databases: z.array(DatabaseCompact),
|
|
51
|
+
tables: z.array(z.union([TableQueryMetadataCompact, VirtualTableCompact])),
|
|
52
|
+
fields: z.array(FieldCompact),
|
|
53
|
+
snippets: z.array(SnippetCompact)
|
|
54
|
+
});
|
|
55
|
+
//#endregion
|
|
56
|
+
export { CompiledQuery, CompiledQueryCompact, QueryMetadata, QueryMetadataCompact, QueryMetadataTable, VirtualField, VirtualFieldCompact, VirtualTable, VirtualTableCompact };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { _ as DependentsSortColumn, a as DependencyEntityCompact, c as DependencyFindingError, d as DependencyGraphCompact, f as DependencyItemsSortColumn, g as DependencyUsageType, h as DependencyType, i as DependencyEntity, l as DependencyFindingErrorType, m as DependencyNodeCompact, n as BreakingSourceCompact, o as DependencyEntityData, p as DependencyNode, r as DependencyEdge, s as DependencyErrorSourceType, t as BreakingSource, u as DependencyGraph } from "../dependency-D8Qs5Xdx.js";
|
|
2
|
+
export { BreakingSource, BreakingSourceCompact, DependencyEdge, DependencyEntity, DependencyEntityCompact, DependencyEntityData, DependencyErrorSourceType, DependencyFindingError, DependencyFindingErrorType, DependencyGraph, DependencyGraphCompact, DependencyItemsSortColumn, DependencyNode, DependencyNodeCompact, DependencyType, DependencyUsageType, DependentsSortColumn };
|