@metabase/client 0.0.0-stage → 0.1.1
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 +28 -0
- package/LICENSE +661 -0
- package/README.md +490 -2
- package/dist/api-key-DJeN1-7G.d.ts +46 -0
- 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-BxBzr5Uj.d.ts +1392 -0
- package/dist/card-DN0sLkCG.d.ts +33 -0
- package/dist/client-DdXLlH1B.d.ts +3380 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.js +99 -0
- package/dist/collection-DGnTvD6R.d.ts +294 -0
- package/dist/collection-fFahL-ub.d.ts +53 -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-CM7RmNeE.d.ts +38 -0
- package/dist/dashboard-DtLXVgtf.d.ts +978 -0
- package/dist/data-action-CkXVrOUH.d.ts +97 -0
- package/dist/data-app-CqP5_fpB.d.ts +76 -0
- package/dist/database-B0JNZjDN.d.ts +27 -0
- package/dist/database-BxqDmfcj.d.ts +997 -0
- package/dist/dataset-BBNGPVec.d.ts +4144 -0
- package/dist/dataset-BUirJ1rO.d.ts +23 -0
- package/dist/dependency-CzpXmeu7.d.ts +299 -0
- package/dist/dependency-arB8Cr2H.d.ts +879 -0
- package/dist/document-tLd6pYWe.d.ts +115 -0
- package/dist/domain/api-key.d.ts +2 -0
- package/dist/domain/api-key.js +31 -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 +211 -0
- package/dist/domain/data-action.d.ts +2 -0
- package/dist/domain/data-action.js +91 -0
- package/dist/domain/data-app.d.ts +2 -0
- package/dist/domain/data-app.js +52 -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 +168 -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 +274 -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 +89 -0
- package/dist/domain/measure.d.ts +2 -0
- package/dist/domain/measure.js +43 -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 +143 -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 +140 -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 +90 -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 +46 -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 +187 -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 +115 -0
- package/dist/domain/transform-python.d.ts +2 -0
- package/dist/domain/transform-python.js +51 -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 +304 -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-CH6NPWd-.d.ts +143 -0
- package/dist/embedding-oU3gqfgX.d.ts +10 -0
- package/dist/erd-BdeFEeSy.d.ts +842 -0
- package/dist/erd-CbV7xvAc.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-SMSfJhB6.d.ts +295 -0
- package/dist/field-D1Pfk-0S.d.ts +50 -0
- package/dist/field-p9Rme2zB.d.ts +2549 -0
- package/dist/git-sync-BTf1aYHr.d.ts +205 -0
- package/dist/git-sync-C99SVdJ9.d.ts +258 -0
- package/dist/glossary-CHK3elPj.d.ts +35 -0
- package/dist/glossary-DFvnz-E5.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 +62 -0
- package/dist/index.js +64 -0
- package/dist/input-gate-registry-Dai7SfXb.js +14 -0
- package/dist/input-gates-DwKoTJVQ.d.ts +28 -0
- package/dist/json-BksZpXDC.d.ts +19 -0
- package/dist/json-pointer.d.ts +5 -0
- package/dist/json-pointer.js +10 -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-B9pEq7qP.d.ts +230 -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-CgH14YQZ.d.ts +44 -0
- package/dist/measure-lPz8qnwz.d.ts +108 -0
- package/dist/metric-DcYloqOQ.d.ts +2655 -0
- package/dist/moderation-review-B4RUTZ6_.d.ts +56 -0
- package/dist/network-error-5g4U1iul.js +62 -0
- package/dist/notification-Cp5GJErS.d.ts +22 -0
- package/dist/notification-D1MThyKE.d.ts +443 -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-COuL0Gzl.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-0LG3K6qO.d.ts +598 -0
- package/dist/pulse-BzKmz3Yn.d.ts +18 -0
- package/dist/query-Xsin530u.d.ts +23 -0
- package/dist/refusal-B9aeHMc9.js +130 -0
- package/dist/replacement-BGyggp-G.d.ts +2467 -0
- package/dist/replacement-CVebCuNp.d.ts +128 -0
- package/dist/requirement-check-glU7wqhQ.d.ts +17 -0
- package/dist/requirements-Dx_ZVzl7.d.ts +227 -0
- package/dist/resources/api-key.d.ts +11 -0
- package/dist/resources/api-key.js +35 -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 +134 -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 +221 -0
- package/dist/resources/data-action.d.ts +60 -0
- package/dist/resources/data-action.js +79 -0
- package/dist/resources/data-app.d.ts +112 -0
- package/dist/resources/data-app.js +75 -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 +156 -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 +99 -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 +76 -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 +46 -0
- package/dist/resources/search.d.ts +2 -0
- package/dist/resources/search.js +78 -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 +274 -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 +59 -0
- package/dist/resources/transform-python.js +57 -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 +227 -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-Dyl-8p7d.d.ts +106 -0
- package/dist/search-Cm5IxKss.d.ts +92 -0
- package/dist/search-Cten2h0I.d.ts +26 -0
- package/dist/segment-CbAgVO-5.d.ts +47 -0
- package/dist/segment-DQLX6r1E.d.ts +16 -0
- package/dist/session-properties-COtlxAcK.d.ts +15 -0
- package/dist/setting-DXuQGXGF.d.ts +25 -0
- package/dist/setup-JqcJ2unJ.d.ts +26 -0
- package/dist/signal.d.ts +8 -0
- package/dist/signal.js +25 -0
- package/dist/snippet-C_Ilx7tR.d.ts +41 -0
- package/dist/snippet-Djn0rL21.d.ts +16 -0
- package/dist/table-CDZbLNow.d.ts +176 -0
- package/dist/table-Od6uvDVW.d.ts +3234 -0
- package/dist/tag-qzjGGci8.d.ts +48 -0
- package/dist/timeline-BK45hy-h.d.ts +218 -0
- package/dist/timeline-BTs6fuRp.d.ts +21 -0
- package/dist/transform-C5thnJwW.d.ts +559 -0
- package/dist/transform-WASQAXeA.d.ts +652 -0
- package/dist/transform-dag-run-BgZwv1yx.d.ts +49 -0
- package/dist/transform-inspector-CMCh8WKV.d.ts +374 -0
- package/dist/transform-job-D8jTQtdX.d.ts +98 -0
- package/dist/transform-job-DmTwKxhc.d.ts +237 -0
- package/dist/transform-python-DtL3xxMj.d.ts +101 -0
- package/dist/transform-tag-C6j5EUkX.d.ts +25 -0
- package/dist/transform-test-CR_i54IV.d.ts +412 -0
- package/dist/transform-test-CeMzDpUC.d.ts +346 -0
- package/dist/transport-BsXqRujn.d.ts +476 -0
- package/dist/transport-HP7cyo9N.js +397 -0
- package/dist/upload-B5YjVkSW.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-Sqqv7rqh.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 +171 -0
- package/dist/version/input-gates.d.ts +2 -0
- package/dist/version/input-gates.js +13 -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 +229 -0
- package/dist/version/tag.d.ts +2 -0
- package/dist/version/tag.js +52 -0
- package/package.json +66 -4
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { t as gateInput } from "../input-gate-registry-Dai7SfXb.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/domain/field.ts
|
|
4
|
+
const FieldVisibilityType = z.enum([
|
|
5
|
+
"details-only",
|
|
6
|
+
"hidden",
|
|
7
|
+
"normal",
|
|
8
|
+
"retired",
|
|
9
|
+
"sensitive"
|
|
10
|
+
]);
|
|
11
|
+
const FieldValuesType = z.enum([
|
|
12
|
+
"list",
|
|
13
|
+
"search",
|
|
14
|
+
"none",
|
|
15
|
+
"auto-list"
|
|
16
|
+
]);
|
|
17
|
+
const SEMANTIC_TYPES_WITH_BASE = [
|
|
18
|
+
"type/AvatarURL",
|
|
19
|
+
"type/Birthdate",
|
|
20
|
+
"type/CancelationDate",
|
|
21
|
+
"type/CancelationTime",
|
|
22
|
+
"type/CancelationTimestamp",
|
|
23
|
+
"type/City",
|
|
24
|
+
"type/Comment",
|
|
25
|
+
"type/Coordinate",
|
|
26
|
+
"type/Cost",
|
|
27
|
+
"type/Country",
|
|
28
|
+
"type/CreationDate",
|
|
29
|
+
"type/CreationTime",
|
|
30
|
+
"type/CreationTimestamp",
|
|
31
|
+
"type/Currency",
|
|
32
|
+
"type/DeletionDate",
|
|
33
|
+
"type/DeletionTime",
|
|
34
|
+
"type/DeletionTimestamp",
|
|
35
|
+
"type/Description",
|
|
36
|
+
"type/Discount",
|
|
37
|
+
"type/Duration",
|
|
38
|
+
"type/Email",
|
|
39
|
+
"type/GrossMargin",
|
|
40
|
+
"type/ImageURL",
|
|
41
|
+
"type/Income",
|
|
42
|
+
"type/JoinDate",
|
|
43
|
+
"type/JoinTime",
|
|
44
|
+
"type/JoinTimestamp",
|
|
45
|
+
"type/Latitude",
|
|
46
|
+
"type/Longitude",
|
|
47
|
+
"type/Name",
|
|
48
|
+
"type/Percentage",
|
|
49
|
+
"type/Price",
|
|
50
|
+
"type/Quantity",
|
|
51
|
+
"type/Score",
|
|
52
|
+
"type/SerializedJSON",
|
|
53
|
+
"type/Share",
|
|
54
|
+
"type/State",
|
|
55
|
+
"type/Title",
|
|
56
|
+
"type/URL",
|
|
57
|
+
"type/UpdatedDate",
|
|
58
|
+
"type/UpdatedTime",
|
|
59
|
+
"type/UpdatedTimestamp",
|
|
60
|
+
"type/ZipCode"
|
|
61
|
+
];
|
|
62
|
+
const FieldBaseType = z.enum([
|
|
63
|
+
"type/*",
|
|
64
|
+
"type/field-values-unsupported",
|
|
65
|
+
"type/fingerprint-unsupported",
|
|
66
|
+
"type/Large",
|
|
67
|
+
"type/Number",
|
|
68
|
+
"type/Integer",
|
|
69
|
+
"type/BigInteger",
|
|
70
|
+
"type/Float",
|
|
71
|
+
"type/Double",
|
|
72
|
+
"type/Decimal",
|
|
73
|
+
"type/Text",
|
|
74
|
+
"type/UUID",
|
|
75
|
+
"type/OracleCLOB",
|
|
76
|
+
"type/Temporal",
|
|
77
|
+
"type/HasDate",
|
|
78
|
+
"type/HasTime",
|
|
79
|
+
"type/Date",
|
|
80
|
+
"type/Time",
|
|
81
|
+
"type/TimeWithTZ",
|
|
82
|
+
"type/TimeWithLocalTZ",
|
|
83
|
+
"type/TimeWithZoneOffset",
|
|
84
|
+
"type/DateTime",
|
|
85
|
+
"type/DateTimeWithTZ",
|
|
86
|
+
"type/DateTimeWithLocalTZ",
|
|
87
|
+
"type/DateTimeWithZoneOffset",
|
|
88
|
+
"type/DateTimeWithZoneID",
|
|
89
|
+
"type/Instant",
|
|
90
|
+
"type/Interval",
|
|
91
|
+
"type/Boolean",
|
|
92
|
+
"type/DruidHyperUnique",
|
|
93
|
+
"type/SnowflakeVariant",
|
|
94
|
+
"type/TextLike",
|
|
95
|
+
"type/MongoBSONID",
|
|
96
|
+
"type/MongoBinData",
|
|
97
|
+
"type/MySQLEnum",
|
|
98
|
+
"type/PostgresEnum",
|
|
99
|
+
"type/PostgresBitString",
|
|
100
|
+
"type/IPAddress",
|
|
101
|
+
"type/Collection",
|
|
102
|
+
"type/Dictionary",
|
|
103
|
+
"type/Array",
|
|
104
|
+
"type/Structured",
|
|
105
|
+
"type/JSON",
|
|
106
|
+
"type/DruidJSON",
|
|
107
|
+
"type/XML",
|
|
108
|
+
...SEMANTIC_TYPES_WITH_BASE
|
|
109
|
+
]);
|
|
110
|
+
const FieldSemanticType = z.enum([
|
|
111
|
+
"Semantic/*",
|
|
112
|
+
"Relation/*",
|
|
113
|
+
...SEMANTIC_TYPES_WITH_BASE,
|
|
114
|
+
"type/Location",
|
|
115
|
+
"type/Address",
|
|
116
|
+
"type/IPAddress",
|
|
117
|
+
"type/Category",
|
|
118
|
+
"type/Enum",
|
|
119
|
+
"type/Product",
|
|
120
|
+
"type/Company",
|
|
121
|
+
"type/Subscription",
|
|
122
|
+
"type/Source",
|
|
123
|
+
"type/CreationTemporal",
|
|
124
|
+
"type/JoinTemporal",
|
|
125
|
+
"type/CancelationTemporal",
|
|
126
|
+
"type/DeletionTemporal",
|
|
127
|
+
"type/UpdatedTemporal",
|
|
128
|
+
"type/Structured",
|
|
129
|
+
"type/JSON",
|
|
130
|
+
"type/DruidJSON",
|
|
131
|
+
"type/XML",
|
|
132
|
+
"type/User",
|
|
133
|
+
"type/Author",
|
|
134
|
+
"type/Owner",
|
|
135
|
+
"type/FK",
|
|
136
|
+
"type/PK"
|
|
137
|
+
]);
|
|
138
|
+
const FieldDataSensitivity = z.enum([
|
|
139
|
+
"SEC_KEY",
|
|
140
|
+
"SYS_TELEMETRY",
|
|
141
|
+
"PHI",
|
|
142
|
+
"BIO_GEN",
|
|
143
|
+
"PCI_FIN",
|
|
144
|
+
"SENS_PERS",
|
|
145
|
+
"PII",
|
|
146
|
+
"CORP_IP",
|
|
147
|
+
"BIZ_CONF",
|
|
148
|
+
"PUBLIC"
|
|
149
|
+
]);
|
|
150
|
+
const FieldCoercionStrategy = z.enum([
|
|
151
|
+
"Coercion/String->Temporal",
|
|
152
|
+
"Coercion/ISO8601->Temporal",
|
|
153
|
+
"Coercion/ISO8601->DateTime",
|
|
154
|
+
"Coercion/ISO8601->Time",
|
|
155
|
+
"Coercion/ISO8601->Date",
|
|
156
|
+
"Coercion/YYYYMMDDHHMMSSString->Temporal",
|
|
157
|
+
"Coercion/Bytes->Temporal",
|
|
158
|
+
"Coercion/YYYYMMDDHHMMSSBytes->Temporal",
|
|
159
|
+
"Coercion/ISO8601Bytes->Temporal",
|
|
160
|
+
"Coercion/Number->Temporal",
|
|
161
|
+
"Coercion/UNIXTime->Temporal",
|
|
162
|
+
"Coercion/UNIXSeconds->DateTime",
|
|
163
|
+
"Coercion/UNIXMilliSeconds->DateTime",
|
|
164
|
+
"Coercion/UNIXMicroSeconds->DateTime",
|
|
165
|
+
"Coercion/UNIXNanoSeconds->DateTime",
|
|
166
|
+
"Coercion/Temporal->Temporal",
|
|
167
|
+
"Coercion/DateTime->Date",
|
|
168
|
+
"Coercion/String->Number",
|
|
169
|
+
"Coercion/String->Float",
|
|
170
|
+
"Coercion/String->Integer",
|
|
171
|
+
"Coercion/Float->Integer"
|
|
172
|
+
]);
|
|
173
|
+
const Field = z.object({
|
|
174
|
+
id: z.number().int(),
|
|
175
|
+
table_id: z.number().int(),
|
|
176
|
+
name: z.string(),
|
|
177
|
+
display_name: z.string(),
|
|
178
|
+
description: z.string().nullable(),
|
|
179
|
+
database_type: z.string().nullable().optional(),
|
|
180
|
+
base_type: FieldBaseType,
|
|
181
|
+
effective_type: FieldBaseType.nullable(),
|
|
182
|
+
coercion_strategy: FieldCoercionStrategy.nullable(),
|
|
183
|
+
semantic_type: FieldSemanticType.nullable(),
|
|
184
|
+
fk_target_field_id: z.number().int().nullable(),
|
|
185
|
+
database_is_pk: z.boolean().nullable(),
|
|
186
|
+
parent_id: z.number().int().nullable(),
|
|
187
|
+
nfc_path: z.array(z.string()).nullable(),
|
|
188
|
+
has_field_values: FieldValuesType.nullable().optional(),
|
|
189
|
+
visibility_type: FieldVisibilityType.nullable().optional(),
|
|
190
|
+
active: z.boolean().optional(),
|
|
191
|
+
position: z.number().int().optional()
|
|
192
|
+
}).loose();
|
|
193
|
+
const FieldCompact = Field.pick({
|
|
194
|
+
id: true,
|
|
195
|
+
name: true,
|
|
196
|
+
display_name: true,
|
|
197
|
+
description: true,
|
|
198
|
+
table_id: true,
|
|
199
|
+
base_type: true,
|
|
200
|
+
semantic_type: true,
|
|
201
|
+
fk_target_field_id: true
|
|
202
|
+
}).strip();
|
|
203
|
+
const FieldWithTarget = Field.extend({ target: Field.nullable() });
|
|
204
|
+
const FieldWithDataSensitivity = Field.extend({ data_sensitivity: FieldDataSensitivity.nullable() });
|
|
205
|
+
const FieldDetail = z.union([FieldWithDataSensitivity, Field]);
|
|
206
|
+
/** The shape `GET` and `PUT /api/field/{id}` answer on a server with `features`. */
|
|
207
|
+
function fieldDetailSchema(features) {
|
|
208
|
+
return features.fieldDataSensitivity ? FieldWithDataSensitivity : Field;
|
|
209
|
+
}
|
|
210
|
+
/** Whether `field` came from a server that labels data sensitivity. */
|
|
211
|
+
function hasDataSensitivity(field) {
|
|
212
|
+
return "data_sensitivity" in field && FieldWithDataSensitivity.shape.data_sensitivity.safeParse(field.data_sensitivity).success;
|
|
213
|
+
}
|
|
214
|
+
const FieldWithDataSensitivityCompact = FieldCompact.extend({ data_sensitivity: FieldDataSensitivity.nullable() }).strip();
|
|
215
|
+
const NonBlankNullable = z.string().min(1).nullable();
|
|
216
|
+
const DATA_SENSITIVITY_GATE = {
|
|
217
|
+
feature: "fieldDataSensitivity",
|
|
218
|
+
effect: "needs",
|
|
219
|
+
when: { kind: "present" }
|
|
220
|
+
};
|
|
221
|
+
const FieldUpdateInput = z.object({
|
|
222
|
+
display_name: NonBlankNullable.optional(),
|
|
223
|
+
description: NonBlankNullable.optional(),
|
|
224
|
+
caveats: NonBlankNullable.optional(),
|
|
225
|
+
points_of_interest: NonBlankNullable.optional(),
|
|
226
|
+
semantic_type: FieldSemanticType.nullable().optional(),
|
|
227
|
+
coercion_strategy: FieldCoercionStrategy.nullable().optional(),
|
|
228
|
+
data_sensitivity: gateInput(FieldDataSensitivity.nullable().optional(), DATA_SENSITIVITY_GATE),
|
|
229
|
+
fk_target_field_id: z.number().int().positive().nullable().optional(),
|
|
230
|
+
visibility_type: FieldVisibilityType.nullable().optional(),
|
|
231
|
+
has_field_values: FieldValuesType.nullable().optional(),
|
|
232
|
+
settings: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
233
|
+
nfc_path: z.array(z.string().min(1)).nullable().optional(),
|
|
234
|
+
json_unfolding: z.boolean().nullable().optional()
|
|
235
|
+
}).loose();
|
|
236
|
+
const FieldValues = z.object({
|
|
237
|
+
values: z.array(z.array(z.unknown())),
|
|
238
|
+
field_id: z.number().int().optional(),
|
|
239
|
+
has_more_values: z.boolean().optional(),
|
|
240
|
+
has_field_values: FieldValuesType.optional()
|
|
241
|
+
}).loose();
|
|
242
|
+
const FieldValuesCompact = FieldValues.pick({
|
|
243
|
+
values: true,
|
|
244
|
+
field_id: true,
|
|
245
|
+
has_more_values: true
|
|
246
|
+
}).strip();
|
|
247
|
+
const FieldSearchMatches = z.array(z.union([z.tuple([z.unknown()]), z.tuple([z.unknown(), z.unknown()])]));
|
|
248
|
+
const FieldRemappedPair = z.tuple([z.unknown(), z.unknown()]);
|
|
249
|
+
const FieldRemappedSingle = z.tuple([z.unknown()]).transform(([value]) => [value, value]);
|
|
250
|
+
const FieldRemappedValue = z.union([FieldRemappedPair, FieldRemappedSingle]);
|
|
251
|
+
const FieldRemappedRowWireV59 = z.array(z.unknown()).min(1);
|
|
252
|
+
function firstTwoCells(row) {
|
|
253
|
+
const [value, second] = row;
|
|
254
|
+
return row.length === 1 ? [value, value] : [value, second];
|
|
255
|
+
}
|
|
256
|
+
function valueTwice(row) {
|
|
257
|
+
const [value] = row;
|
|
258
|
+
return [value, value];
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* The row `GET /api/field/{id}/remapping/{remapped-id}` answers on a server with `features`, read as
|
|
262
|
+
* `FieldRemappedValue`. `sameField` says the two ids name one field.
|
|
263
|
+
*/
|
|
264
|
+
function fieldRemappedValueSchema(features, sameField) {
|
|
265
|
+
if (!features.fieldRemappingAppendsDisplayColumns) return FieldRemappedValue;
|
|
266
|
+
return FieldRemappedRowWireV59.transform(sameField ? valueTwice : firstTwoCells);
|
|
267
|
+
}
|
|
268
|
+
const FieldSummary = z.object({
|
|
269
|
+
field_id: z.number().int(),
|
|
270
|
+
count: z.number().int(),
|
|
271
|
+
distincts: z.number().int()
|
|
272
|
+
});
|
|
273
|
+
//#endregion
|
|
274
|
+
export { DATA_SENSITIVITY_GATE, Field, FieldBaseType, FieldCoercionStrategy, FieldCompact, FieldDataSensitivity, FieldDetail, FieldRemappedValue, FieldSearchMatches, FieldSemanticType, FieldSummary, FieldUpdateInput, FieldValues, FieldValuesCompact, FieldWithDataSensitivity, FieldWithDataSensitivityCompact, FieldWithTarget, fieldDetailSchema, fieldRemappedValueSchema, hasDataSensitivity };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { _ as SyncTaskType, a as SyncExportPreflight, b as isSyncTaskTerminal, c as SyncForcePushCasualties, d as SyncRemoteChanges, f as SyncSettingsUpdateResult, g as SyncTaskStatus, h as SyncTaskCompact, i as SyncDirtyItemCompact, l as SyncImportResult, m as SyncTask, n as SyncBranchCreated, o as SyncExportPreflightCompact, p as SyncStashResult, r as SyncDirtyItem, s as SyncExportResult, t as RemoteSyncState, u as SyncMergeSummary, v as SyncType, y as isSyncTaskFailed } from "../git-sync-C99SVdJ9.js";
|
|
2
|
+
export { RemoteSyncState, SyncBranchCreated, SyncDirtyItem, SyncDirtyItemCompact, SyncExportPreflight, SyncExportPreflightCompact, SyncExportResult, SyncForcePushCasualties, SyncImportResult, SyncMergeSummary, SyncRemoteChanges, SyncSettingsUpdateResult, SyncStashResult, SyncTask, SyncTaskCompact, SyncTaskStatus, SyncTaskType, SyncType, isSyncTaskFailed, isSyncTaskTerminal };
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/domain/git-sync.ts
|
|
3
|
+
const SyncTaskStatus = z.enum([
|
|
4
|
+
"running",
|
|
5
|
+
"successful",
|
|
6
|
+
"errored",
|
|
7
|
+
"cancelled",
|
|
8
|
+
"timed-out",
|
|
9
|
+
"conflict"
|
|
10
|
+
]);
|
|
11
|
+
const SyncTaskType = z.enum(["import", "export"]);
|
|
12
|
+
/**
|
|
13
|
+
* The direction an instance syncs in: `read-only` follows the remote branch and refuses local edits
|
|
14
|
+
* to synced content; `read-write` also exports its own changes.
|
|
15
|
+
*/
|
|
16
|
+
const SyncType = z.enum(["read-only", "read-write"]);
|
|
17
|
+
/**
|
|
18
|
+
* Whether a remote is configured, the direction the instance syncs in, and the branch it tracks,
|
|
19
|
+
* `null` when none is set. The sync type is a `SyncType` when an admin sets it; a server that reads
|
|
20
|
+
* `MB_REMOTE_SYNC_TYPE` (60 and later) does not check that value, so it is the string the server
|
|
21
|
+
* holds.
|
|
22
|
+
*/
|
|
23
|
+
const RemoteSyncState = z.object({
|
|
24
|
+
configured: z.boolean(),
|
|
25
|
+
sync_type: z.string(),
|
|
26
|
+
branch: z.string().nullable()
|
|
27
|
+
});
|
|
28
|
+
const TERMINAL_STATUSES = /* @__PURE__ */ new Set([
|
|
29
|
+
"successful",
|
|
30
|
+
"errored",
|
|
31
|
+
"cancelled",
|
|
32
|
+
"timed-out",
|
|
33
|
+
"conflict"
|
|
34
|
+
]);
|
|
35
|
+
const FAILED_STATUSES = /* @__PURE__ */ new Set([
|
|
36
|
+
"errored",
|
|
37
|
+
"timed-out",
|
|
38
|
+
"conflict"
|
|
39
|
+
]);
|
|
40
|
+
/** Whether the server will report any further progress for a task in this status. */
|
|
41
|
+
function isSyncTaskTerminal(status) {
|
|
42
|
+
return TERMINAL_STATUSES.has(status);
|
|
43
|
+
}
|
|
44
|
+
/** Whether a terminal status means the sync did not carry out what it was asked to. */
|
|
45
|
+
function isSyncTaskFailed(status) {
|
|
46
|
+
return FAILED_STATUSES.has(status);
|
|
47
|
+
}
|
|
48
|
+
const SyncTask = z.object({
|
|
49
|
+
id: z.number().int().positive(),
|
|
50
|
+
sync_task_type: SyncTaskType,
|
|
51
|
+
status: SyncTaskStatus,
|
|
52
|
+
progress: z.number().min(0).max(1).nullable(),
|
|
53
|
+
started_at: z.string(),
|
|
54
|
+
ended_at: z.string().nullable().optional(),
|
|
55
|
+
last_progress_report_at: z.string().nullable().optional(),
|
|
56
|
+
version: z.string().nullable().optional(),
|
|
57
|
+
initiated_by: z.number().int().positive().nullable().optional(),
|
|
58
|
+
cancelled: z.boolean().nullable().optional(),
|
|
59
|
+
error_message: z.string().nullable().optional(),
|
|
60
|
+
conflicts: z.array(z.string()).nullable().optional()
|
|
61
|
+
}).loose();
|
|
62
|
+
const SyncTaskCompact = SyncTask.pick({
|
|
63
|
+
id: true,
|
|
64
|
+
sync_task_type: true,
|
|
65
|
+
status: true,
|
|
66
|
+
progress: true,
|
|
67
|
+
version: true,
|
|
68
|
+
error_message: true,
|
|
69
|
+
conflicts: true
|
|
70
|
+
}).strip();
|
|
71
|
+
const SyncDirtyItem = z.object({
|
|
72
|
+
id: z.number().int(),
|
|
73
|
+
name: z.string().nullable(),
|
|
74
|
+
model: z.string(),
|
|
75
|
+
sync_status: z.string(),
|
|
76
|
+
collection_id: z.number().int().positive().nullable().optional(),
|
|
77
|
+
description: z.string().nullable().optional(),
|
|
78
|
+
display: z.string().nullable().optional(),
|
|
79
|
+
query_type: z.string().nullable().optional(),
|
|
80
|
+
table_id: z.number().int().positive().nullable().optional(),
|
|
81
|
+
table_name: z.string().nullable().optional()
|
|
82
|
+
}).loose();
|
|
83
|
+
const SyncDirtyItemCompact = SyncDirtyItem.pick({
|
|
84
|
+
id: true,
|
|
85
|
+
name: true,
|
|
86
|
+
model: true,
|
|
87
|
+
sync_status: true,
|
|
88
|
+
collection_id: true
|
|
89
|
+
}).strip();
|
|
90
|
+
const SyncRemoteChanges = z.object({
|
|
91
|
+
has_changes: z.boolean(),
|
|
92
|
+
remote_version: z.string().nullable(),
|
|
93
|
+
local_version: z.string().nullable(),
|
|
94
|
+
cached: z.boolean()
|
|
95
|
+
});
|
|
96
|
+
const SyncMergeSummary = z.object({
|
|
97
|
+
added: z.number().int(),
|
|
98
|
+
updated: z.number().int(),
|
|
99
|
+
removed: z.number().int()
|
|
100
|
+
});
|
|
101
|
+
const SyncForcePushCasualties = z.object({
|
|
102
|
+
deleted: z.array(z.string()),
|
|
103
|
+
overwritten: z.array(z.string())
|
|
104
|
+
});
|
|
105
|
+
const SyncExportPreflight = z.object({
|
|
106
|
+
has_changes: z.boolean(),
|
|
107
|
+
clean: z.boolean(),
|
|
108
|
+
conflicts: z.array(z.string()),
|
|
109
|
+
summary: SyncMergeSummary,
|
|
110
|
+
force_push_casualties: SyncForcePushCasualties,
|
|
111
|
+
reason: z.literal("history-rewritten").nullable()
|
|
112
|
+
}).loose();
|
|
113
|
+
const SyncExportPreflightCompact = SyncExportPreflight.pick({
|
|
114
|
+
has_changes: true,
|
|
115
|
+
clean: true,
|
|
116
|
+
conflicts: true,
|
|
117
|
+
summary: true,
|
|
118
|
+
force_push_casualties: true,
|
|
119
|
+
reason: true
|
|
120
|
+
}).strip();
|
|
121
|
+
const SyncBranchCreated = z.object({
|
|
122
|
+
status: z.literal("success"),
|
|
123
|
+
message: z.string()
|
|
124
|
+
});
|
|
125
|
+
const SyncSettingsUpdateResult = z.object({
|
|
126
|
+
success: z.boolean(),
|
|
127
|
+
task_id: z.number().int().positive().optional()
|
|
128
|
+
});
|
|
129
|
+
const SyncImportResult = z.object({
|
|
130
|
+
message: z.string().nullable(),
|
|
131
|
+
task_id: z.number().int().positive().nullable(),
|
|
132
|
+
final: SyncTask.nullable().optional()
|
|
133
|
+
});
|
|
134
|
+
const SyncExportResult = z.object({
|
|
135
|
+
message: z.string(),
|
|
136
|
+
task_id: z.number().int().positive(),
|
|
137
|
+
branch: z.string().nullable(),
|
|
138
|
+
final: SyncTask.nullable().optional()
|
|
139
|
+
});
|
|
140
|
+
const SyncStashResult = z.object({
|
|
141
|
+
status: z.literal("success"),
|
|
142
|
+
message: z.string(),
|
|
143
|
+
task_id: z.number().int().positive(),
|
|
144
|
+
final: SyncTask.nullable().optional()
|
|
145
|
+
});
|
|
146
|
+
//#endregion
|
|
147
|
+
export { RemoteSyncState, SyncBranchCreated, SyncDirtyItem, SyncDirtyItemCompact, SyncExportPreflight, SyncExportPreflightCompact, SyncExportResult, SyncForcePushCasualties, SyncImportResult, SyncMergeSummary, SyncRemoteChanges, SyncSettingsUpdateResult, SyncStashResult, SyncTask, SyncTaskCompact, SyncTaskStatus, SyncTaskType, SyncType, isSyncTaskFailed, isSyncTaskTerminal };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { NonBlankText } from "./text.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/domain/glossary.ts
|
|
4
|
+
const GlossaryCreator = z.object({
|
|
5
|
+
id: z.number().int(),
|
|
6
|
+
email: z.string(),
|
|
7
|
+
first_name: z.string().nullable(),
|
|
8
|
+
last_name: z.string().nullable()
|
|
9
|
+
}).loose();
|
|
10
|
+
const Glossary = z.object({
|
|
11
|
+
id: z.number().int(),
|
|
12
|
+
term: z.string(),
|
|
13
|
+
definition: z.string(),
|
|
14
|
+
creator_id: z.number().int(),
|
|
15
|
+
creator: GlossaryCreator,
|
|
16
|
+
created_at: z.string(),
|
|
17
|
+
updated_at: z.string()
|
|
18
|
+
}).loose();
|
|
19
|
+
const GlossaryCompact = Glossary.pick({
|
|
20
|
+
id: true,
|
|
21
|
+
term: true,
|
|
22
|
+
definition: true
|
|
23
|
+
}).strip();
|
|
24
|
+
const GlossaryCreateInput = z.object({
|
|
25
|
+
term: NonBlankText,
|
|
26
|
+
definition: NonBlankText
|
|
27
|
+
}).strict();
|
|
28
|
+
const GlossaryUpdateInput = GlossaryCreateInput;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { Glossary, GlossaryCompact, GlossaryCreateInput, GlossaryUpdateInput };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as LibraryListing, c as PUBLISH_TARGET_COLLECTION_GATE, i as LibraryCompact, l as libraryWireSchema, n as LibraryChild, o as LibraryPublishTablesInput, r as LibraryCollectionInfo, s as LibraryWire, t as Library, u as toLibrary } from "../library-B9pEq7qP.js";
|
|
2
|
+
export { Library, LibraryChild, LibraryCollectionInfo, LibraryCompact, LibraryListing, LibraryPublishTablesInput, LibraryWire, PUBLISH_TARGET_COLLECTION_GATE, libraryWireSchema, toLibrary };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { t as gateInput } from "../input-gate-registry-Dai7SfXb.js";
|
|
2
|
+
import { TableSelectors } from "./table.js";
|
|
3
|
+
import { Collection, CollectionId, CollectionType } from "./collection.js";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
//#region src/domain/library.ts
|
|
6
|
+
const LibraryChildWireV59 = z.object({
|
|
7
|
+
id: CollectionId,
|
|
8
|
+
name: z.string(),
|
|
9
|
+
description: z.string().nullable()
|
|
10
|
+
});
|
|
11
|
+
const LibraryChildWireV62 = LibraryChildWireV59.extend({ type: CollectionType.nullable() });
|
|
12
|
+
const LibraryChild = LibraryChildWireV62.extend({ is_remote_synced: z.boolean().nullable() });
|
|
13
|
+
const Library = Collection.extend({ effective_children: z.array(LibraryChild) }).loose();
|
|
14
|
+
const LibraryCompact = Library.pick({
|
|
15
|
+
id: true,
|
|
16
|
+
name: true,
|
|
17
|
+
type: true,
|
|
18
|
+
effective_children: true
|
|
19
|
+
}).strip();
|
|
20
|
+
const LibraryCollectionInfo = Collection.pick({
|
|
21
|
+
id: true,
|
|
22
|
+
type: true,
|
|
23
|
+
is_remote_synced: true
|
|
24
|
+
}).strip();
|
|
25
|
+
const PUBLISH_TARGET_COLLECTION_GATE = {
|
|
26
|
+
feature: "tablePublishTargetCollection",
|
|
27
|
+
effect: "needs",
|
|
28
|
+
when: { kind: "present" }
|
|
29
|
+
};
|
|
30
|
+
const LibraryPublishTablesInput = TableSelectors.extend({ collection_id: gateInput(z.number().int().positive(), PUBLISH_TARGET_COLLECTION_GATE) }).strict();
|
|
31
|
+
const LibraryWireV59 = Collection.extend({ effective_children: z.array(LibraryChildWireV59) }).loose();
|
|
32
|
+
const LibraryWireV62 = Collection.extend({ effective_children: z.array(LibraryChildWireV62) }).loose();
|
|
33
|
+
const AbsentLibrary = z.object({ data: z.null() });
|
|
34
|
+
/**
|
|
35
|
+
* The shape `GET /api/ee/library/` answers on a server with `features`: the Library as sent,
|
|
36
|
+
* awaiting `toLibrary`, or `null` on an instance that has none.
|
|
37
|
+
*/
|
|
38
|
+
function libraryWireSchema(features) {
|
|
39
|
+
return presentOrAbsent(features.libraryChildrenCarryType ? LibraryWireV62.transform((root) => ({
|
|
40
|
+
childrenCarryType: true,
|
|
41
|
+
root
|
|
42
|
+
})) : LibraryWireV59.transform((root) => ({
|
|
43
|
+
childrenCarryType: false,
|
|
44
|
+
root
|
|
45
|
+
})));
|
|
46
|
+
}
|
|
47
|
+
function presentOrAbsent(present) {
|
|
48
|
+
return z.unknown().transform((value, ctx) => {
|
|
49
|
+
if (AbsentLibrary.safeParse(value).success) return null;
|
|
50
|
+
const parsed = present.safeParse(value);
|
|
51
|
+
if (parsed.success) return parsed.data;
|
|
52
|
+
for (const issue of parsed.error.issues) ctx.addIssue({ ...issue });
|
|
53
|
+
return z.NEVER;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/** `wire` read as `Library`, with what its children's projection omitted taken from `listing`. */
|
|
57
|
+
function toLibrary(wire, listing) {
|
|
58
|
+
if (wire.childrenCarryType) {
|
|
59
|
+
const effective_children = wire.root.effective_children.map((child) => ({
|
|
60
|
+
...child,
|
|
61
|
+
is_remote_synced: listedSyncFlag(child.id, listing)
|
|
62
|
+
}));
|
|
63
|
+
return {
|
|
64
|
+
...wire.root,
|
|
65
|
+
effective_children
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
const effective_children = wire.root.effective_children.map((child) => ({
|
|
69
|
+
...child,
|
|
70
|
+
type: listedType(child.id, listing),
|
|
71
|
+
is_remote_synced: listedSyncFlag(child.id, listing)
|
|
72
|
+
}));
|
|
73
|
+
return {
|
|
74
|
+
...wire.root,
|
|
75
|
+
effective_children
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function listed(id, listing) {
|
|
79
|
+
if (typeof id !== "number") return null;
|
|
80
|
+
return listing.get(id) ?? null;
|
|
81
|
+
}
|
|
82
|
+
function listedType(id, listing) {
|
|
83
|
+
return listed(id, listing)?.type ?? null;
|
|
84
|
+
}
|
|
85
|
+
function listedSyncFlag(id, listing) {
|
|
86
|
+
return listed(id, listing)?.is_remote_synced ?? null;
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
export { Library, LibraryChild, LibraryCollectionInfo, LibraryCompact, LibraryPublishTablesInput, PUBLISH_TARGET_COLLECTION_GATE, libraryWireSchema, toLibrary };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { t as gateInput } from "../input-gate-registry-Dai7SfXb.js";
|
|
2
|
+
import { TABLE_FROM_DEFINITION_GATE } from "./table.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region src/domain/measure.ts
|
|
5
|
+
const Measure = z.object({
|
|
6
|
+
id: z.number().int(),
|
|
7
|
+
name: z.string(),
|
|
8
|
+
description: z.string().nullable(),
|
|
9
|
+
archived: z.boolean(),
|
|
10
|
+
table_id: z.number().int(),
|
|
11
|
+
definition: z.unknown(),
|
|
12
|
+
creator_id: z.number().int(),
|
|
13
|
+
entity_id: z.string().nullable(),
|
|
14
|
+
dimensions: z.array(z.unknown()).nullish(),
|
|
15
|
+
dimension_mappings: z.array(z.unknown()).nullish(),
|
|
16
|
+
definition_description: z.string().nullable().optional(),
|
|
17
|
+
result_column_name: z.string().nullable().optional(),
|
|
18
|
+
created_at: z.string(),
|
|
19
|
+
updated_at: z.string()
|
|
20
|
+
}).loose();
|
|
21
|
+
const MeasureCompact = Measure.pick({
|
|
22
|
+
id: true,
|
|
23
|
+
name: true,
|
|
24
|
+
description: true,
|
|
25
|
+
archived: true,
|
|
26
|
+
table_id: true
|
|
27
|
+
}).strip();
|
|
28
|
+
const MeasureDefinition = z.record(z.string(), z.unknown()).describe("MBQL query holding exactly one aggregation");
|
|
29
|
+
const MeasureCreateInput = z.object({
|
|
30
|
+
name: z.string().min(1),
|
|
31
|
+
table_id: gateInput(z.number().int().positive(), TABLE_FROM_DEFINITION_GATE),
|
|
32
|
+
definition: MeasureDefinition,
|
|
33
|
+
description: z.string().nullable().optional()
|
|
34
|
+
}).loose();
|
|
35
|
+
const MeasureUpdateInput = z.object({
|
|
36
|
+
name: z.string().min(1).nullable().optional(),
|
|
37
|
+
definition: MeasureDefinition.nullable().optional(),
|
|
38
|
+
revision_message: z.string().min(1),
|
|
39
|
+
archived: z.boolean().nullable().optional(),
|
|
40
|
+
description: z.string().nullable().optional()
|
|
41
|
+
}).loose();
|
|
42
|
+
//#endregion
|
|
43
|
+
export { Measure, MeasureCompact, MeasureCreateInput, MeasureUpdateInput };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { C as MetricProjection, S as MetricMathOperator, _ as MetricInstanceFilter, a as MetricBreakoutValues, b as MetricMappingTarget, c as MetricDimensionCompact, d as MetricDimensionRef, f as MetricDimensionRefOptions, g as MetricFilterClause, h as MetricFilterArgument, i as MetricBreakoutColumn, l as MetricDimensionGroup, m as MetricDimensionStatus, n as MetricAddableGroup, o as MetricDefinition, p as MetricDimensionSource, r as MetricBinning, s as MetricDimension, t as MetricAddableDimension, u as MetricDimensionListing, v as MetricLeafRef, x as MetricMathExpression, y as MetricLeafType } from "../metric-DcYloqOQ.js";
|
|
2
|
+
export { MetricAddableDimension, MetricAddableGroup, MetricBinning, MetricBreakoutColumn, MetricBreakoutValues, MetricDefinition, MetricDimension, MetricDimensionCompact, MetricDimensionGroup, MetricDimensionListing, MetricDimensionRef, MetricDimensionRefOptions, MetricDimensionSource, MetricDimensionStatus, MetricFilterArgument, MetricFilterClause, MetricInstanceFilter, MetricLeafRef, MetricLeafType, MetricMappingTarget, MetricMathExpression, MetricMathOperator, MetricProjection };
|