@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,97 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/domain/timeline.ts
|
|
3
|
+
const TimelineIcon = z.enum([
|
|
4
|
+
"star",
|
|
5
|
+
"cake",
|
|
6
|
+
"mail",
|
|
7
|
+
"mail_at",
|
|
8
|
+
"warning",
|
|
9
|
+
"bell",
|
|
10
|
+
"cloud",
|
|
11
|
+
"info",
|
|
12
|
+
"note",
|
|
13
|
+
"event"
|
|
14
|
+
]);
|
|
15
|
+
const TimelineEvent = z.object({
|
|
16
|
+
id: z.number().int(),
|
|
17
|
+
name: z.string(),
|
|
18
|
+
description: z.string().nullable(),
|
|
19
|
+
timestamp: z.string(),
|
|
20
|
+
timezone: z.string(),
|
|
21
|
+
time_matters: z.boolean(),
|
|
22
|
+
icon: TimelineIcon,
|
|
23
|
+
timeline_id: z.number().int(),
|
|
24
|
+
archived: z.boolean(),
|
|
25
|
+
creator_id: z.number().int(),
|
|
26
|
+
created_at: z.string(),
|
|
27
|
+
updated_at: z.string()
|
|
28
|
+
}).loose();
|
|
29
|
+
const TimelineEventCompact = TimelineEvent.pick({
|
|
30
|
+
id: true,
|
|
31
|
+
name: true,
|
|
32
|
+
description: true,
|
|
33
|
+
timestamp: true,
|
|
34
|
+
icon: true,
|
|
35
|
+
timeline_id: true,
|
|
36
|
+
archived: true
|
|
37
|
+
}).strip();
|
|
38
|
+
const Timeline = z.object({
|
|
39
|
+
id: z.number().int(),
|
|
40
|
+
name: z.string(),
|
|
41
|
+
description: z.string().nullable(),
|
|
42
|
+
icon: TimelineIcon,
|
|
43
|
+
collection_id: z.number().int().nullable(),
|
|
44
|
+
archived: z.boolean(),
|
|
45
|
+
default: z.boolean(),
|
|
46
|
+
creator_id: z.number().int(),
|
|
47
|
+
entity_id: z.string(),
|
|
48
|
+
created_at: z.string(),
|
|
49
|
+
updated_at: z.string(),
|
|
50
|
+
events: z.array(TimelineEvent).optional()
|
|
51
|
+
}).loose();
|
|
52
|
+
const TimelineCompact = Timeline.pick({
|
|
53
|
+
id: true,
|
|
54
|
+
name: true,
|
|
55
|
+
description: true,
|
|
56
|
+
icon: true,
|
|
57
|
+
collection_id: true,
|
|
58
|
+
default: true,
|
|
59
|
+
archived: true
|
|
60
|
+
}).strip();
|
|
61
|
+
const TimelineCreateInput = z.object({
|
|
62
|
+
name: z.string().min(1),
|
|
63
|
+
description: z.string().nullable().optional(),
|
|
64
|
+
icon: TimelineIcon.nullable().optional(),
|
|
65
|
+
collection_id: z.number().int().positive().nullable().optional(),
|
|
66
|
+
default: z.boolean().nullable().optional()
|
|
67
|
+
}).loose();
|
|
68
|
+
const TimelineUpdateInput = z.object({
|
|
69
|
+
name: z.string().min(1).nullable().optional(),
|
|
70
|
+
description: z.string().nullable().optional(),
|
|
71
|
+
icon: TimelineIcon.nullable().optional(),
|
|
72
|
+
collection_id: z.number().int().positive().nullable().optional(),
|
|
73
|
+
default: z.boolean().nullable().optional(),
|
|
74
|
+
archived: z.boolean().nullable().optional()
|
|
75
|
+
}).loose();
|
|
76
|
+
const TimelineEventCreateInput = z.object({
|
|
77
|
+
name: z.string().min(1),
|
|
78
|
+
timestamp: z.string().min(1),
|
|
79
|
+
timezone: z.string().min(1),
|
|
80
|
+
time_matters: z.boolean(),
|
|
81
|
+
timeline_id: z.number().int().positive(),
|
|
82
|
+
description: z.string().nullable().optional(),
|
|
83
|
+
icon: TimelineIcon.nullable().optional(),
|
|
84
|
+
archived: z.boolean().nullable().optional()
|
|
85
|
+
}).loose();
|
|
86
|
+
const TimelineEventUpdateInput = z.object({
|
|
87
|
+
name: z.string().min(1).nullable().optional(),
|
|
88
|
+
description: z.string().nullable().optional(),
|
|
89
|
+
timestamp: z.string().min(1).nullable().optional(),
|
|
90
|
+
timezone: z.string().min(1).nullable().optional(),
|
|
91
|
+
time_matters: z.boolean().nullable().optional(),
|
|
92
|
+
icon: TimelineIcon.nullable().optional(),
|
|
93
|
+
timeline_id: z.number().int().positive().nullable().optional(),
|
|
94
|
+
archived: z.boolean().nullable().optional()
|
|
95
|
+
}).loose();
|
|
96
|
+
//#endregion
|
|
97
|
+
export { Timeline, TimelineCompact, TimelineCreateInput, TimelineEvent, TimelineEventCompact, TimelineEventCreateInput, TimelineEventUpdateInput, TimelineIcon, TimelineUpdateInput };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TransformRun } from "./transform.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/domain/transform-dag-run.ts
|
|
4
|
+
const TransformMemberRun = TransformRun.extend({
|
|
5
|
+
job_run_id: z.number().int().nullable(),
|
|
6
|
+
dag_run_id: z.number().int().nullable()
|
|
7
|
+
});
|
|
8
|
+
const TransformMemberRunCompact = TransformMemberRun.pick({
|
|
9
|
+
id: true,
|
|
10
|
+
transform_id: true,
|
|
11
|
+
dag_run_id: true,
|
|
12
|
+
status: true,
|
|
13
|
+
run_method: true,
|
|
14
|
+
start_time: true,
|
|
15
|
+
end_time: true,
|
|
16
|
+
message: true
|
|
17
|
+
}).strip();
|
|
18
|
+
//#endregion
|
|
19
|
+
export { TransformMemberRun, TransformMemberRunCompact };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as LensCardDisplay, c as LensDrillTrigger, d as LensSection, f as TransformInspection, h as TransformLensQueryInput, i as LensCard, l as LensMetadata, m as TransformLens, n as InspectorTable, o as LensCardMetadata, p as TransformInspectionStatus, r as LensAlertTrigger, s as LensComplexityLevel, t as InspectorField, u as LensParams } from "../transform-inspector-CMCh8WKV.js";
|
|
2
|
+
export { InspectorField, InspectorTable, LensAlertTrigger, LensCard, LensCardDisplay, LensCardMetadata, LensComplexityLevel, LensDrillTrigger, LensMetadata, LensParams, LensSection, TransformInspection, TransformInspectionStatus, TransformLens, TransformLensQueryInput };
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { DatasetQuery } from "./query.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/domain/transform-inspector.ts
|
|
4
|
+
const InspectorFieldStats = z.object({
|
|
5
|
+
distinct_count: z.number().int().optional(),
|
|
6
|
+
nil_percent: z.number().optional(),
|
|
7
|
+
min: z.number().optional(),
|
|
8
|
+
max: z.number().optional(),
|
|
9
|
+
avg: z.number().optional(),
|
|
10
|
+
q1: z.number().optional(),
|
|
11
|
+
q3: z.number().optional(),
|
|
12
|
+
earliest: z.string().optional(),
|
|
13
|
+
latest: z.string().optional()
|
|
14
|
+
}).loose();
|
|
15
|
+
const InspectorField = z.object({
|
|
16
|
+
id: z.number().int(),
|
|
17
|
+
name: z.string(),
|
|
18
|
+
display_name: z.string().nullable().optional(),
|
|
19
|
+
base_type: z.string(),
|
|
20
|
+
semantic_type: z.string().nullable().optional(),
|
|
21
|
+
stats: InspectorFieldStats.nullable().optional()
|
|
22
|
+
}).loose();
|
|
23
|
+
const InspectorTable = z.object({
|
|
24
|
+
table_id: z.number().int(),
|
|
25
|
+
table_name: z.string(),
|
|
26
|
+
schema: z.string().nullable().optional(),
|
|
27
|
+
db_id: z.number().int(),
|
|
28
|
+
column_count: z.number().int(),
|
|
29
|
+
fields: z.array(InspectorField)
|
|
30
|
+
}).loose();
|
|
31
|
+
const LensComplexityLevel = z.enum([
|
|
32
|
+
"fast",
|
|
33
|
+
"slow",
|
|
34
|
+
"very-slow"
|
|
35
|
+
]);
|
|
36
|
+
const LensComplexity = z.object({
|
|
37
|
+
level: LensComplexityLevel,
|
|
38
|
+
score: z.number().int().optional()
|
|
39
|
+
}).loose();
|
|
40
|
+
const LensMetadata = z.object({
|
|
41
|
+
id: z.string(),
|
|
42
|
+
display_name: z.string(),
|
|
43
|
+
description: z.string().nullable().optional(),
|
|
44
|
+
complexity: LensComplexity.optional()
|
|
45
|
+
}).loose();
|
|
46
|
+
const TransformInspectionStatus = z.enum(["not-run", "ready"]);
|
|
47
|
+
const TransformInspection = z.object({
|
|
48
|
+
name: z.string(),
|
|
49
|
+
description: z.string().nullable().optional(),
|
|
50
|
+
status: TransformInspectionStatus,
|
|
51
|
+
sources: z.array(InspectorTable),
|
|
52
|
+
target: InspectorTable.nullable().optional(),
|
|
53
|
+
visited_fields: z.object({ all: z.array(z.number().int()).optional() }).loose().nullable().optional(),
|
|
54
|
+
available_lenses: z.array(LensMetadata)
|
|
55
|
+
}).loose();
|
|
56
|
+
const LensCardDisplay = z.enum([
|
|
57
|
+
"bar",
|
|
58
|
+
"row",
|
|
59
|
+
"line",
|
|
60
|
+
"area",
|
|
61
|
+
"pie",
|
|
62
|
+
"scalar",
|
|
63
|
+
"gauge",
|
|
64
|
+
"progress",
|
|
65
|
+
"table",
|
|
66
|
+
"hidden"
|
|
67
|
+
]);
|
|
68
|
+
const LensJoinMetadata = z.object({
|
|
69
|
+
join_step: z.number().int().optional(),
|
|
70
|
+
join_alias: z.string().optional(),
|
|
71
|
+
join_strategy: z.string().optional()
|
|
72
|
+
}).loose();
|
|
73
|
+
const LensCardMetadata = LensJoinMetadata.extend({
|
|
74
|
+
dedup_key: z.array(z.unknown()).optional(),
|
|
75
|
+
depends_on_cards: z.array(z.string()).optional(),
|
|
76
|
+
group_id: z.string().optional(),
|
|
77
|
+
group_role: z.enum(["input", "output"]).optional(),
|
|
78
|
+
group_order: z.number().int().optional(),
|
|
79
|
+
card_type: z.string().optional()
|
|
80
|
+
});
|
|
81
|
+
const LensCard = z.object({
|
|
82
|
+
id: z.string(),
|
|
83
|
+
section_id: z.string().nullable().optional(),
|
|
84
|
+
title: z.string(),
|
|
85
|
+
display: LensCardDisplay,
|
|
86
|
+
dataset_query: DatasetQuery,
|
|
87
|
+
metadata: LensCardMetadata.optional()
|
|
88
|
+
}).loose();
|
|
89
|
+
const LensSection = z.object({
|
|
90
|
+
id: z.string(),
|
|
91
|
+
title: z.string(),
|
|
92
|
+
description: z.string().nullable().optional(),
|
|
93
|
+
layout: z.enum(["flat", "comparison"]).optional()
|
|
94
|
+
}).loose();
|
|
95
|
+
const LensHighlight = z.object({
|
|
96
|
+
label: z.string(),
|
|
97
|
+
value: z.unknown().optional(),
|
|
98
|
+
card_id: z.string().optional()
|
|
99
|
+
}).loose();
|
|
100
|
+
const LensSummary = z.object({
|
|
101
|
+
text: z.string().nullable().optional(),
|
|
102
|
+
highlights: z.array(LensHighlight).optional(),
|
|
103
|
+
alerts: z.array(z.object({}).loose()).optional()
|
|
104
|
+
}).loose();
|
|
105
|
+
const LensTriggerCondition = z.object({ name: z.string() }).loose();
|
|
106
|
+
const LensAlertTrigger = z.object({
|
|
107
|
+
id: z.string(),
|
|
108
|
+
condition: LensTriggerCondition,
|
|
109
|
+
severity: z.enum([
|
|
110
|
+
"info",
|
|
111
|
+
"warning",
|
|
112
|
+
"error"
|
|
113
|
+
]),
|
|
114
|
+
message: z.string(),
|
|
115
|
+
metadata: LensJoinMetadata.optional()
|
|
116
|
+
}).loose();
|
|
117
|
+
/** The parameters a drill lens takes; `join_step` scopes a join lens to one join. */
|
|
118
|
+
const LensParams = z.object({ join_step: z.number().int().optional() });
|
|
119
|
+
const LensDrillTrigger = z.object({
|
|
120
|
+
lens_id: z.string(),
|
|
121
|
+
condition: LensTriggerCondition,
|
|
122
|
+
params: LensParams.loose().optional(),
|
|
123
|
+
reason: z.string().optional(),
|
|
124
|
+
metadata: LensJoinMetadata.optional()
|
|
125
|
+
}).loose();
|
|
126
|
+
const TransformLens = z.object({
|
|
127
|
+
id: z.string(),
|
|
128
|
+
display_name: z.string(),
|
|
129
|
+
complexity: LensComplexity.optional(),
|
|
130
|
+
summary: LensSummary.optional(),
|
|
131
|
+
sections: z.array(LensSection),
|
|
132
|
+
cards: z.array(LensCard),
|
|
133
|
+
drill_lenses: z.array(LensMetadata).optional(),
|
|
134
|
+
alert_triggers: z.array(LensAlertTrigger).optional(),
|
|
135
|
+
drill_lens_triggers: z.array(LensDrillTrigger).optional()
|
|
136
|
+
}).loose();
|
|
137
|
+
const TransformLensQueryInput = z.object({
|
|
138
|
+
query: DatasetQuery,
|
|
139
|
+
lens_params: LensParams.nullable().optional()
|
|
140
|
+
}).strict();
|
|
141
|
+
//#endregion
|
|
142
|
+
export { InspectorField, InspectorTable, LensAlertTrigger, LensCard, LensCardDisplay, LensCardMetadata, LensComplexityLevel, LensDrillTrigger, LensMetadata, LensParams, LensSection, TransformInspection, TransformInspectionStatus, TransformLens, TransformLensQueryInput };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as TransformJobCreateInput, c as transformJobRunResultSchema, i as TransformJobCompact, l as transformJobSchema, n as TransformJob, o as TransformJobRunResult, r as TransformJobActiveResult, s as TransformJobUpdateInput, t as TRANSFORM_JOB_ACTIVE_GATE } from "../transform-job-D8jTQtdX.js";
|
|
2
|
+
export { TRANSFORM_JOB_ACTIVE_GATE, TransformJob, TransformJobActiveResult, TransformJobCompact, TransformJobCreateInput, TransformJobRunResult, TransformJobUpdateInput, transformJobRunResultSchema, transformJobSchema };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { t as gateInput } from "../input-gate-registry-Dai7SfXb.js";
|
|
2
|
+
import { CronUiDisplayType } from "./cron.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region src/domain/transform-job.ts
|
|
5
|
+
const JobRunStatus = z.enum([
|
|
6
|
+
"started",
|
|
7
|
+
"succeeded",
|
|
8
|
+
"failed",
|
|
9
|
+
"timeout",
|
|
10
|
+
"canceled"
|
|
11
|
+
]);
|
|
12
|
+
const JobRunMethod = z.enum(["manual", "cron"]);
|
|
13
|
+
const JobLastRun = z.object({
|
|
14
|
+
id: z.number().int(),
|
|
15
|
+
job_id: z.number().int(),
|
|
16
|
+
run_method: JobRunMethod,
|
|
17
|
+
status: JobRunStatus,
|
|
18
|
+
start_time: z.string(),
|
|
19
|
+
end_time: z.string().nullable().optional(),
|
|
20
|
+
message: z.string().nullable(),
|
|
21
|
+
created_at: z.string(),
|
|
22
|
+
updated_at: z.string()
|
|
23
|
+
}).loose();
|
|
24
|
+
const JobNextRun = z.object({ start_time: z.string() }).loose();
|
|
25
|
+
const TransformJobBase = z.object({
|
|
26
|
+
id: z.number().int(),
|
|
27
|
+
name: z.string(),
|
|
28
|
+
description: z.string().nullable(),
|
|
29
|
+
schedule: z.string(),
|
|
30
|
+
ui_display_type: CronUiDisplayType,
|
|
31
|
+
entity_id: z.string().nullable(),
|
|
32
|
+
created_at: z.string(),
|
|
33
|
+
updated_at: z.string(),
|
|
34
|
+
built_in_type: z.string().nullable().optional(),
|
|
35
|
+
tag_ids: z.array(z.number().int()).optional(),
|
|
36
|
+
last_run: JobLastRun.nullable().optional(),
|
|
37
|
+
next_run: JobNextRun.nullable().optional()
|
|
38
|
+
}).loose();
|
|
39
|
+
const TransformJob = TransformJobBase.extend({ active: z.boolean().nullable() });
|
|
40
|
+
function alwaysActive(wire) {
|
|
41
|
+
return {
|
|
42
|
+
...wire,
|
|
43
|
+
active: null
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/** The shape every transform-job endpoint answers on a server with `features`, read as `TransformJob`. */
|
|
47
|
+
function transformJobSchema(features) {
|
|
48
|
+
return features.transformJobActivation ? TransformJob : TransformJobBase.transform(alwaysActive);
|
|
49
|
+
}
|
|
50
|
+
const TransformJobCompact = TransformJob.pick({
|
|
51
|
+
id: true,
|
|
52
|
+
name: true,
|
|
53
|
+
description: true,
|
|
54
|
+
schedule: true,
|
|
55
|
+
ui_display_type: true,
|
|
56
|
+
active: true,
|
|
57
|
+
built_in_type: true
|
|
58
|
+
}).strip();
|
|
59
|
+
const TransformJobCreateInput = z.object({
|
|
60
|
+
name: z.string().min(1),
|
|
61
|
+
description: z.string().min(1).nullable().optional(),
|
|
62
|
+
schedule: z.string().min(1),
|
|
63
|
+
ui_display_type: CronUiDisplayType.optional(),
|
|
64
|
+
tag_ids: z.array(z.number().int().positive()).optional()
|
|
65
|
+
}).loose();
|
|
66
|
+
const TRANSFORM_JOB_ACTIVE_GATE = {
|
|
67
|
+
feature: "transformJobActivation",
|
|
68
|
+
effect: "needs",
|
|
69
|
+
when: { kind: "present" }
|
|
70
|
+
};
|
|
71
|
+
const TransformJobUpdateInput = z.object({
|
|
72
|
+
name: z.string().min(1).optional(),
|
|
73
|
+
description: z.string().min(1).nullable().optional(),
|
|
74
|
+
schedule: z.string().min(1).optional(),
|
|
75
|
+
ui_display_type: CronUiDisplayType.optional(),
|
|
76
|
+
active: gateInput(z.boolean().optional(), TRANSFORM_JOB_ACTIVE_GATE),
|
|
77
|
+
tag_ids: z.array(z.number().int().positive()).optional()
|
|
78
|
+
}).loose();
|
|
79
|
+
const TransformJobRunResult = z.object({
|
|
80
|
+
message: z.string(),
|
|
81
|
+
started: z.boolean().nullable(),
|
|
82
|
+
run_id: z.number().int().positive().nullable()
|
|
83
|
+
});
|
|
84
|
+
const TransformJobRunWireV59 = z.object({
|
|
85
|
+
message: z.string(),
|
|
86
|
+
job_run_id: z.string()
|
|
87
|
+
});
|
|
88
|
+
const TransformJobRunWireV64 = z.object({
|
|
89
|
+
message: z.string(),
|
|
90
|
+
job_run_id: z.number().int().positive().nullable()
|
|
91
|
+
});
|
|
92
|
+
function fromStubRunId(wire) {
|
|
93
|
+
return {
|
|
94
|
+
message: wire.message,
|
|
95
|
+
started: null,
|
|
96
|
+
run_id: null
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
function fromNumericRunId(wire) {
|
|
100
|
+
return {
|
|
101
|
+
message: wire.message,
|
|
102
|
+
started: wire.job_run_id !== null,
|
|
103
|
+
run_id: wire.job_run_id
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
/** The shape `POST /api/transform-job/{id}/run` answers on a server with `features`, read as `TransformJobRunResult`. */
|
|
107
|
+
function transformJobRunResultSchema(features) {
|
|
108
|
+
return features.transformJobRunIdIsNumeric ? TransformJobRunWireV64.transform(fromNumericRunId) : TransformJobRunWireV59.transform(fromStubRunId);
|
|
109
|
+
}
|
|
110
|
+
const TransformJobActiveResult = z.object({
|
|
111
|
+
updated: z.number().int(),
|
|
112
|
+
failed: z.number().int()
|
|
113
|
+
});
|
|
114
|
+
//#endregion
|
|
115
|
+
export { TRANSFORM_JOB_ACTIVE_GATE, TransformJob, TransformJobActiveResult, TransformJobCompact, TransformJobCreateInput, TransformJobRunResult, TransformJobUpdateInput, transformJobRunResultSchema, transformJobSchema };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as PythonTestRunOutput, i as PythonTestRunInput, n as PythonLibraryUpdateInput, o as PythonTestRunResult, r as PythonTestRunError, s as pythonTestRunBody, t as PythonLibrary } from "../transform-python-DtL3xxMj.js";
|
|
2
|
+
export { PythonLibrary, PythonLibraryUpdateInput, PythonTestRunError, PythonTestRunInput, PythonTestRunOutput, PythonTestRunResult, pythonTestRunBody };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { TransformSourceTableEntryInput, keyedByAlias } from "./transform.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/domain/transform-python.ts
|
|
4
|
+
const PythonLibrary = z.object({
|
|
5
|
+
path: z.string(),
|
|
6
|
+
source: z.string().nullable(),
|
|
7
|
+
created_at: z.string(),
|
|
8
|
+
updated_at: z.string()
|
|
9
|
+
}).loose();
|
|
10
|
+
const PythonLibraryUpdateInput = z.object({ source: z.string() }).strict();
|
|
11
|
+
const TEST_RUN_ROW_LIMIT = {
|
|
12
|
+
min: 2,
|
|
13
|
+
max: 100
|
|
14
|
+
};
|
|
15
|
+
const TestRunRowLimit = z.number().int().min(TEST_RUN_ROW_LIMIT.min).max(TEST_RUN_ROW_LIMIT.max);
|
|
16
|
+
const PythonTestRunInput = z.object({
|
|
17
|
+
code: z.string(),
|
|
18
|
+
source_tables: z.array(TransformSourceTableEntryInput).min(1),
|
|
19
|
+
output_row_limit: TestRunRowLimit.optional(),
|
|
20
|
+
per_input_row_limit: TestRunRowLimit.optional()
|
|
21
|
+
}).strict();
|
|
22
|
+
function toTestRunTableValue(entry) {
|
|
23
|
+
const { alias: _alias, ...reference } = entry;
|
|
24
|
+
return typeof entry.table_id === "number" ? entry.table_id : reference;
|
|
25
|
+
}
|
|
26
|
+
/** A test run body as a server with `features` reads it. */
|
|
27
|
+
function pythonTestRunBody(params, features) {
|
|
28
|
+
if (features.transformSourceTablesAsList) return params;
|
|
29
|
+
return {
|
|
30
|
+
...params,
|
|
31
|
+
source_tables: keyedByAlias(params.source_tables, toTestRunTableValue)
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
const PythonTestRunOutput = z.object({
|
|
35
|
+
cols: z.array(z.object({ name: z.string() }).loose()),
|
|
36
|
+
rows: z.array(z.unknown())
|
|
37
|
+
});
|
|
38
|
+
const PythonTestRunError = z.object({ message: z.string() }).loose();
|
|
39
|
+
const PythonTestRunSucceeded = z.object({
|
|
40
|
+
outcome: z.literal("succeeded"),
|
|
41
|
+
logs: z.string(),
|
|
42
|
+
output: PythonTestRunOutput
|
|
43
|
+
});
|
|
44
|
+
const PythonTestRunFailed = z.object({
|
|
45
|
+
outcome: z.literal("failed"),
|
|
46
|
+
logs: z.string(),
|
|
47
|
+
error: PythonTestRunError
|
|
48
|
+
});
|
|
49
|
+
const PythonTestRunResult = z.discriminatedUnion("outcome", [PythonTestRunSucceeded, PythonTestRunFailed]);
|
|
50
|
+
//#endregion
|
|
51
|
+
export { PythonLibrary, PythonLibraryUpdateInput, PythonTestRunError, PythonTestRunInput, PythonTestRunOutput, PythonTestRunResult, pythonTestRunBody };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/domain/transform-tag.ts
|
|
3
|
+
const TransformTag = z.object({
|
|
4
|
+
id: z.number().int(),
|
|
5
|
+
name: z.string(),
|
|
6
|
+
entity_id: z.string().nullable(),
|
|
7
|
+
built_in_type: z.string().nullable()
|
|
8
|
+
}).loose();
|
|
9
|
+
const TransformTagCompact = TransformTag.pick({
|
|
10
|
+
id: true,
|
|
11
|
+
name: true,
|
|
12
|
+
built_in_type: true
|
|
13
|
+
}).strip();
|
|
14
|
+
const TransformTagCreateInput = z.object({ name: z.string().min(1) }).loose();
|
|
15
|
+
const TransformTagUpdateInput = TransformTagCreateInput;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { TransformTag, TransformTagCompact, TransformTagCreateInput, TransformTagUpdateInput };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as TransformTestExpectation, c as TransformTestRefusalCode, d as TransformTestRunResult, f as TransformTestTable, i as TransformTestCreateInput, l as TransformTestResultColumn, m as isTransformTestRefusalCode, n as TransformTestColumn, o as TransformTestExpectationResult, p as TransformTestUpdateInput, r as TransformTestCompact, s as TransformTestInput, t as TransformTest, u as TransformTestRow } from "../transform-test-CeMzDpUC.js";
|
|
2
|
+
export { TransformTest, TransformTestColumn, TransformTestCompact, TransformTestCreateInput, TransformTestExpectation, TransformTestExpectationResult, TransformTestInput, TransformTestRefusalCode, TransformTestResultColumn, TransformTestRow, TransformTestRunResult, TransformTestTable, TransformTestUpdateInput, isTransformTestRefusalCode };
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/domain/transform-test.ts
|
|
3
|
+
const TransformTestTable = z.object({
|
|
4
|
+
schema: z.string().min(1).nullable().optional(),
|
|
5
|
+
name: z.string().min(1)
|
|
6
|
+
}).loose();
|
|
7
|
+
const TransformTestColumn = z.object({
|
|
8
|
+
name: z.string().min(1),
|
|
9
|
+
cast_type: z.string().min(1)
|
|
10
|
+
}).loose();
|
|
11
|
+
const TransformTestCell = z.union([
|
|
12
|
+
z.boolean(),
|
|
13
|
+
z.number(),
|
|
14
|
+
z.string(),
|
|
15
|
+
z.null()
|
|
16
|
+
]);
|
|
17
|
+
const TransformTestRow = z.record(z.string(), TransformTestCell);
|
|
18
|
+
const TransformTestSqlInput = z.object({
|
|
19
|
+
table: TransformTestTable,
|
|
20
|
+
format: z.literal("sql"),
|
|
21
|
+
sql: z.string().min(1)
|
|
22
|
+
}).loose();
|
|
23
|
+
const TransformTestRowsInput = z.object({
|
|
24
|
+
table: TransformTestTable,
|
|
25
|
+
format: z.literal("rows"),
|
|
26
|
+
columns: z.array(TransformTestColumn).min(1),
|
|
27
|
+
rows: z.array(TransformTestRow)
|
|
28
|
+
}).loose();
|
|
29
|
+
const TransformTestInput = z.discriminatedUnion("format", [TransformTestSqlInput, TransformTestRowsInput]);
|
|
30
|
+
const TransformTestEqualsSqlExpectation = z.object({
|
|
31
|
+
type: z.literal("equals"),
|
|
32
|
+
name: z.string().min(1),
|
|
33
|
+
format: z.literal("sql"),
|
|
34
|
+
sql: z.string().min(1)
|
|
35
|
+
}).loose();
|
|
36
|
+
const TransformTestEqualsRowsExpectation = z.object({
|
|
37
|
+
type: z.literal("equals"),
|
|
38
|
+
name: z.string().min(1),
|
|
39
|
+
format: z.literal("rows"),
|
|
40
|
+
columns: z.array(TransformTestColumn).min(1),
|
|
41
|
+
rows: z.array(TransformTestRow)
|
|
42
|
+
}).loose();
|
|
43
|
+
const TransformTestEqualsExpectation = z.discriminatedUnion("format", [TransformTestEqualsSqlExpectation, TransformTestEqualsRowsExpectation]);
|
|
44
|
+
const TransformTestEmptyExpectation = z.object({
|
|
45
|
+
type: z.literal("empty"),
|
|
46
|
+
name: z.string().min(1),
|
|
47
|
+
sql: z.string().min(1)
|
|
48
|
+
}).loose();
|
|
49
|
+
const TransformTestExpectation = z.discriminatedUnion("type", [TransformTestEqualsExpectation, TransformTestEmptyExpectation]);
|
|
50
|
+
const TransformTest = z.object({
|
|
51
|
+
id: z.number().int(),
|
|
52
|
+
entity_id: z.string(),
|
|
53
|
+
transform_id: z.number().int(),
|
|
54
|
+
creator_id: z.number().int(),
|
|
55
|
+
name: z.string(),
|
|
56
|
+
description: z.string().nullable(),
|
|
57
|
+
inputs: z.array(TransformTestInput),
|
|
58
|
+
expectations: z.array(TransformTestExpectation),
|
|
59
|
+
created_at: z.string(),
|
|
60
|
+
updated_at: z.string()
|
|
61
|
+
}).loose();
|
|
62
|
+
const TransformTestCompact = TransformTest.pick({
|
|
63
|
+
id: true,
|
|
64
|
+
transform_id: true,
|
|
65
|
+
name: true,
|
|
66
|
+
description: true
|
|
67
|
+
}).strip();
|
|
68
|
+
/**
|
|
69
|
+
* The server closes this map, so an unrecognized key is a 400 there. Refusing it here names the key
|
|
70
|
+
* instead: a body cloned from `get` has to shed `id`, `entity_id`, `creator_id`, `created_at` and
|
|
71
|
+
* `updated_at` before it can be sent back.
|
|
72
|
+
*/
|
|
73
|
+
const TransformTestCreateInput = z.object({
|
|
74
|
+
transform_id: z.number().int().positive(),
|
|
75
|
+
name: z.string().min(1),
|
|
76
|
+
description: z.string().nullable().optional(),
|
|
77
|
+
inputs: z.array(TransformTestInput),
|
|
78
|
+
expectations: z.array(TransformTestExpectation)
|
|
79
|
+
}).strict();
|
|
80
|
+
/** Closed for the same reason as [[TransformTestCreateInput]]; every field is optional. */
|
|
81
|
+
const TransformTestUpdateInput = z.object({
|
|
82
|
+
transform_id: z.number().int().positive().optional(),
|
|
83
|
+
name: z.string().min(1).optional(),
|
|
84
|
+
description: z.string().nullable().optional(),
|
|
85
|
+
inputs: z.array(TransformTestInput).optional(),
|
|
86
|
+
expectations: z.array(TransformTestExpectation).optional()
|
|
87
|
+
}).strict();
|
|
88
|
+
const TransformTestResultColumn = z.object({
|
|
89
|
+
name: z.string(),
|
|
90
|
+
database_type: z.string()
|
|
91
|
+
}).loose();
|
|
92
|
+
const TransformTestExpectationError = z.object({
|
|
93
|
+
type: z.string(),
|
|
94
|
+
message: z.string()
|
|
95
|
+
}).loose();
|
|
96
|
+
const TransformTestCellMismatch = z.object({
|
|
97
|
+
column: z.string(),
|
|
98
|
+
expected: TransformTestCell,
|
|
99
|
+
actual: TransformTestCell
|
|
100
|
+
}).loose();
|
|
101
|
+
const TransformTestRowCounts = z.object({
|
|
102
|
+
actual: z.number().int(),
|
|
103
|
+
expected: z.number().int()
|
|
104
|
+
}).loose();
|
|
105
|
+
const TransformTestEqualsFindings = z.object({
|
|
106
|
+
name: z.string(),
|
|
107
|
+
type: z.literal("equals"),
|
|
108
|
+
status: z.enum(["passed", "failed"]),
|
|
109
|
+
columns: z.array(TransformTestResultColumn),
|
|
110
|
+
"row-counts": TransformTestRowCounts,
|
|
111
|
+
"extra-rows": z.array(TransformTestRow),
|
|
112
|
+
"missing-rows": z.array(TransformTestRow),
|
|
113
|
+
"cell-mismatches": z.array(TransformTestCellMismatch),
|
|
114
|
+
truncated: z.number().int()
|
|
115
|
+
}).loose();
|
|
116
|
+
const TransformTestEqualsError = z.object({
|
|
117
|
+
name: z.string(),
|
|
118
|
+
type: z.literal("equals"),
|
|
119
|
+
status: z.literal("error"),
|
|
120
|
+
error: TransformTestExpectationError
|
|
121
|
+
}).loose();
|
|
122
|
+
const TransformTestEqualsResult = z.discriminatedUnion("status", [TransformTestEqualsFindings, TransformTestEqualsError]);
|
|
123
|
+
const TransformTestEmptyPassed = z.object({
|
|
124
|
+
name: z.string(),
|
|
125
|
+
type: z.literal("empty"),
|
|
126
|
+
status: z.literal("passed")
|
|
127
|
+
}).loose();
|
|
128
|
+
const TransformTestEmptyFailed = z.object({
|
|
129
|
+
name: z.string(),
|
|
130
|
+
type: z.literal("empty"),
|
|
131
|
+
status: z.literal("failed"),
|
|
132
|
+
columns: z.array(TransformTestResultColumn),
|
|
133
|
+
sample: z.array(TransformTestRow),
|
|
134
|
+
truncated: z.number().int()
|
|
135
|
+
}).loose();
|
|
136
|
+
const TransformTestEmptyError = z.object({
|
|
137
|
+
name: z.string(),
|
|
138
|
+
type: z.literal("empty"),
|
|
139
|
+
status: z.literal("error"),
|
|
140
|
+
error: TransformTestExpectationError
|
|
141
|
+
}).loose();
|
|
142
|
+
const TransformTestEmptyResult = z.discriminatedUnion("status", [
|
|
143
|
+
TransformTestEmptyPassed,
|
|
144
|
+
TransformTestEmptyFailed,
|
|
145
|
+
TransformTestEmptyError
|
|
146
|
+
]);
|
|
147
|
+
const TransformTestExpectationResult = z.discriminatedUnion("type", [TransformTestEqualsResult, TransformTestEmptyResult]);
|
|
148
|
+
const TransformTestRunResult = z.object({
|
|
149
|
+
status: z.enum([
|
|
150
|
+
"passed",
|
|
151
|
+
"failed",
|
|
152
|
+
"error"
|
|
153
|
+
]),
|
|
154
|
+
expectations: z.array(TransformTestExpectationResult),
|
|
155
|
+
tables: z.record(z.string(), z.string())
|
|
156
|
+
}).loose();
|
|
157
|
+
const TransformTestRefusalCode = z.enum([
|
|
158
|
+
"transform-test.unknown-column",
|
|
159
|
+
"transform-test.ambiguous-column",
|
|
160
|
+
"transform-test.missing-inputs",
|
|
161
|
+
"transform-test.unused-inputs",
|
|
162
|
+
"transform-test.duplicate-input-table",
|
|
163
|
+
"transform-test.unparseable-source",
|
|
164
|
+
"transform-test.unremapped-reference",
|
|
165
|
+
"transform-test.unsupported-transform",
|
|
166
|
+
"transform-test.unsupported-driver",
|
|
167
|
+
"transform-test.transform-failed",
|
|
168
|
+
"transform-test.setup-failed",
|
|
169
|
+
"transform-test.expectation-failed",
|
|
170
|
+
"transform-test.unsupported-format"
|
|
171
|
+
]);
|
|
172
|
+
function isTransformTestRefusalCode(value) {
|
|
173
|
+
return TransformTestRefusalCode.safeParse(value).success;
|
|
174
|
+
}
|
|
175
|
+
//#endregion
|
|
176
|
+
export { TransformTest, TransformTestColumn, TransformTestCompact, TransformTestCreateInput, TransformTestExpectation, TransformTestExpectationResult, TransformTestInput, TransformTestRefusalCode, TransformTestResultColumn, TransformTestRow, TransformTestRunResult, TransformTestTable, TransformTestUpdateInput, isTransformTestRefusalCode };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { C as transformDetailSchema, S as keyedByAlias, T as transformSourceBody, _ as TransformSourceTableEntryInput, a as TransformDagRunResult, b as isTransformRunFailed, c as TransformRunCompact, d as TransformRunStatus, f as TransformRunSummary, g as TransformSourceTableEntry, h as TransformRunSummaryType, i as TransformDagDirection, l as TransformRunMethod, m as TransformRunSummarySortColumn, n as TransformCompact, o as TransformDagTransform, p as TransformRunSummaryCompact, r as TransformCreateInput, s as TransformRun, t as Transform, u as TransformRunResult, v as TransformTarget, w as transformRowSchema, x as isTransformRunTerminal, y as TransformUpdateInput } from "../transform-C5thnJwW.js";
|
|
2
|
+
export { Transform, TransformCompact, TransformCreateInput, TransformDagDirection, TransformDagRunResult, TransformDagTransform, TransformRun, TransformRunCompact, TransformRunMethod, TransformRunResult, TransformRunStatus, TransformRunSummary, TransformRunSummaryCompact, TransformRunSummarySortColumn, TransformRunSummaryType, TransformSourceTableEntry, TransformSourceTableEntryInput, TransformTarget, TransformUpdateInput, isTransformRunFailed, isTransformRunTerminal, keyedByAlias, transformDetailSchema, transformRowSchema, transformSourceBody };
|