@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,139 @@
|
|
|
1
|
+
import { FieldBaseType, FieldSemanticType } from "./field.js";
|
|
2
|
+
import { TemporalUnit } from "./parameter.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region src/domain/metric.ts
|
|
5
|
+
const ClauseOptions = z.object({}).loose();
|
|
6
|
+
const MetricLeafType = z.enum(["metric", "measure"]);
|
|
7
|
+
const MetricLeafRef = z.tuple([
|
|
8
|
+
MetricLeafType,
|
|
9
|
+
z.object({ "lib/uuid": z.string().min(1) }).strict(),
|
|
10
|
+
z.number().int().positive()
|
|
11
|
+
]);
|
|
12
|
+
const MetricMathOperator = z.enum([
|
|
13
|
+
"+",
|
|
14
|
+
"-",
|
|
15
|
+
"*",
|
|
16
|
+
"/"
|
|
17
|
+
]);
|
|
18
|
+
const MetricMathExpression = z.lazy(() => z.union([
|
|
19
|
+
MetricLeafRef,
|
|
20
|
+
z.number(),
|
|
21
|
+
z.tuple([
|
|
22
|
+
MetricMathOperator,
|
|
23
|
+
ClauseOptions,
|
|
24
|
+
MetricMathExpression,
|
|
25
|
+
MetricMathExpression
|
|
26
|
+
]).rest(MetricMathExpression)
|
|
27
|
+
]));
|
|
28
|
+
const MetricBinning = z.discriminatedUnion("strategy", [
|
|
29
|
+
z.object({ strategy: z.literal("default") }).strict(),
|
|
30
|
+
z.object({
|
|
31
|
+
strategy: z.literal("bin-width"),
|
|
32
|
+
"bin-width": z.number().positive()
|
|
33
|
+
}).strict(),
|
|
34
|
+
z.object({
|
|
35
|
+
strategy: z.literal("num-bins"),
|
|
36
|
+
"num-bins": z.number().int().positive()
|
|
37
|
+
}).strict()
|
|
38
|
+
]);
|
|
39
|
+
const MetricDimensionRefOptions = z.object({
|
|
40
|
+
"lib/uuid": z.string().min(1).optional(),
|
|
41
|
+
"display-name": z.string().min(1).nullable().optional(),
|
|
42
|
+
"effective-type": FieldBaseType.nullable().optional(),
|
|
43
|
+
"semantic-type": FieldSemanticType.nullable().optional(),
|
|
44
|
+
"temporal-unit": TemporalUnit.nullable().optional(),
|
|
45
|
+
binning: MetricBinning.nullable().optional()
|
|
46
|
+
}).strict();
|
|
47
|
+
const MetricDimensionRef = z.tuple([
|
|
48
|
+
z.literal("dimension"),
|
|
49
|
+
MetricDimensionRefOptions,
|
|
50
|
+
z.string().min(1)
|
|
51
|
+
]);
|
|
52
|
+
const MetricFilterArgument = z.lazy(() => z.union([
|
|
53
|
+
MetricDimensionRef,
|
|
54
|
+
MetricFilterClause,
|
|
55
|
+
z.string(),
|
|
56
|
+
z.number(),
|
|
57
|
+
z.boolean(),
|
|
58
|
+
z.null()
|
|
59
|
+
]));
|
|
60
|
+
const MetricFilterClause = z.lazy(() => z.tuple([z.string().min(1), ClauseOptions]).rest(MetricFilterArgument));
|
|
61
|
+
const MetricInstanceFilter = z.object({
|
|
62
|
+
"lib/uuid": z.string().min(1),
|
|
63
|
+
filter: MetricFilterClause
|
|
64
|
+
}).strict();
|
|
65
|
+
const MetricProjection = z.object({
|
|
66
|
+
type: MetricLeafType,
|
|
67
|
+
id: z.number().int().positive(),
|
|
68
|
+
"lib/uuid": z.string().min(1),
|
|
69
|
+
projection: z.array(MetricDimensionRef)
|
|
70
|
+
}).strict();
|
|
71
|
+
const MetricDefinition = z.object({
|
|
72
|
+
expression: MetricMathExpression,
|
|
73
|
+
filters: z.array(MetricInstanceFilter).nullable().optional(),
|
|
74
|
+
projections: z.array(MetricProjection).nullable().optional()
|
|
75
|
+
}).strict();
|
|
76
|
+
const MetricBreakoutColumn = z.object({
|
|
77
|
+
name: z.string().optional(),
|
|
78
|
+
display_name: z.string().optional(),
|
|
79
|
+
base_type: FieldBaseType.optional(),
|
|
80
|
+
effective_type: FieldBaseType.optional(),
|
|
81
|
+
semantic_type: FieldSemanticType.nullable().optional()
|
|
82
|
+
}).loose();
|
|
83
|
+
const MetricBreakoutValues = z.object({
|
|
84
|
+
values: z.array(z.unknown()),
|
|
85
|
+
col: MetricBreakoutColumn
|
|
86
|
+
}).loose();
|
|
87
|
+
const MetricDimensionStatus = z.enum(["status/active", "status/orphaned"]);
|
|
88
|
+
const MetricDimensionSource = z.object({
|
|
89
|
+
type: z.literal("field"),
|
|
90
|
+
"field-id": z.number().int().nullable()
|
|
91
|
+
}).loose();
|
|
92
|
+
const MetricDimensionGroup = z.object({
|
|
93
|
+
id: z.string(),
|
|
94
|
+
type: z.enum(["main", "connection"]),
|
|
95
|
+
display_name: z.string()
|
|
96
|
+
}).loose();
|
|
97
|
+
const MetricDimension = z.object({
|
|
98
|
+
id: z.string(),
|
|
99
|
+
name: z.string().nullable(),
|
|
100
|
+
display_name: z.string().nullable(),
|
|
101
|
+
description: z.string().nullable().optional(),
|
|
102
|
+
effective_type: FieldBaseType.nullable(),
|
|
103
|
+
semantic_type: FieldSemanticType.nullable(),
|
|
104
|
+
has_field_values: z.enum([
|
|
105
|
+
"list",
|
|
106
|
+
"search",
|
|
107
|
+
"none"
|
|
108
|
+
]).optional(),
|
|
109
|
+
status: MetricDimensionStatus.optional(),
|
|
110
|
+
status_message: z.string().optional(),
|
|
111
|
+
sources: z.array(MetricDimensionSource).optional(),
|
|
112
|
+
group: MetricDimensionGroup.optional(),
|
|
113
|
+
dimension_interestingness: z.number().optional(),
|
|
114
|
+
default_temporal_unit: TemporalUnit.optional(),
|
|
115
|
+
default: z.boolean().nullable().optional()
|
|
116
|
+
}).loose();
|
|
117
|
+
const MetricDimensionCompact = MetricDimension.pick({
|
|
118
|
+
id: true,
|
|
119
|
+
name: true,
|
|
120
|
+
display_name: true,
|
|
121
|
+
description: true,
|
|
122
|
+
effective_type: true,
|
|
123
|
+
semantic_type: true,
|
|
124
|
+
status: true,
|
|
125
|
+
group: true,
|
|
126
|
+
default: true
|
|
127
|
+
}).strip();
|
|
128
|
+
const MetricMappingTarget = z.tuple([z.string(), ClauseOptions]).rest(z.unknown());
|
|
129
|
+
const MetricAddableDimension = MetricDimension.extend({ mapping_target: MetricMappingTarget });
|
|
130
|
+
const MetricAddableGroup = z.object({
|
|
131
|
+
group: MetricDimensionGroup.nullable(),
|
|
132
|
+
dimensions: z.array(MetricAddableDimension)
|
|
133
|
+
}).loose();
|
|
134
|
+
const MetricDimensionListing = z.object({
|
|
135
|
+
added: z.array(MetricDimension),
|
|
136
|
+
addable: z.array(MetricAddableGroup)
|
|
137
|
+
}).loose();
|
|
138
|
+
//#endregion
|
|
139
|
+
export { MetricAddableDimension, MetricAddableGroup, MetricBinning, MetricBreakoutColumn, MetricBreakoutValues, MetricDefinition, MetricDimension, MetricDimensionCompact, MetricDimensionGroup, MetricDimensionListing, MetricDimensionRef, MetricDimensionRefOptions, MetricDimensionSource, MetricDimensionStatus, MetricFilterClause, MetricInstanceFilter, MetricLeafRef, MetricLeafType, MetricMappingTarget, MetricMathExpression, MetricMathOperator, MetricProjection };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as ModerationStatus, i as ModerationReviewCreateInput, n as ModerationReview, r as ModerationReviewCompact, t as ModeratedItemType } from "../moderation-review-B4RUTZ6_.js";
|
|
2
|
+
export { ModeratedItemType, ModerationReview, ModerationReviewCompact, ModerationReviewCreateInput, ModerationStatus };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/domain/moderation-review.ts
|
|
3
|
+
const ModeratedItemType = z.enum(["card", "dashboard"]);
|
|
4
|
+
const ModerationStatus = z.enum(["verified"]);
|
|
5
|
+
const ModerationReview = z.object({
|
|
6
|
+
id: z.number().int(),
|
|
7
|
+
moderated_item_id: z.number().int(),
|
|
8
|
+
moderated_item_type: ModeratedItemType,
|
|
9
|
+
moderator_id: z.number().int(),
|
|
10
|
+
status: ModerationStatus.nullable(),
|
|
11
|
+
text: z.string().nullable(),
|
|
12
|
+
most_recent: z.boolean(),
|
|
13
|
+
created_at: z.string(),
|
|
14
|
+
updated_at: z.string()
|
|
15
|
+
}).loose();
|
|
16
|
+
const ModerationReviewCompact = ModerationReview.pick({
|
|
17
|
+
id: true,
|
|
18
|
+
moderated_item_id: true,
|
|
19
|
+
moderated_item_type: true,
|
|
20
|
+
status: true,
|
|
21
|
+
text: true,
|
|
22
|
+
most_recent: true
|
|
23
|
+
}).strip();
|
|
24
|
+
const ModerationReviewCreateInput = z.object({
|
|
25
|
+
moderated_item_id: z.number().int().positive(),
|
|
26
|
+
moderated_item_type: ModeratedItemType,
|
|
27
|
+
status: ModerationStatus.nullable().optional(),
|
|
28
|
+
text: z.string().nullable().optional()
|
|
29
|
+
}).strict();
|
|
30
|
+
//#endregion
|
|
31
|
+
export { ModeratedItemType, ModerationReview, ModerationReviewCompact, ModerationReviewCreateInput, ModerationStatus };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { _ as NotificationSendCondition, a as NotificationCardPayloadCompact, b as NotificationSubscriptionType, c as NotificationCompact, d as NotificationHandlerCompact, f as NotificationPayloadType, g as NotificationRecipientType, h as NotificationRecipientDetails, i as NotificationCardPayload, l as NotificationCreateInput, m as NotificationRecipientCompact, n as CARD_PAYLOAD_TYPE, o as NotificationCardPayloadPatch, p as NotificationRecipient, r as Notification, s as NotificationChannelType, t as AnyNotification, u as NotificationHandler, v as NotificationSubscription, x as NotificationUpdateInput, y as NotificationSubscriptionCompact } from "../notification-D1MThyKE.js";
|
|
2
|
+
export { AnyNotification, CARD_PAYLOAD_TYPE, Notification, NotificationCardPayload, NotificationCardPayloadCompact, NotificationCardPayloadPatch, NotificationChannelType, NotificationCompact, NotificationCreateInput, NotificationHandler, NotificationHandlerCompact, NotificationPayloadType, NotificationRecipient, NotificationRecipientCompact, NotificationRecipientDetails, NotificationRecipientType, NotificationSendCondition, NotificationSubscription, NotificationSubscriptionCompact, NotificationSubscriptionType, NotificationUpdateInput };
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { CronUiDisplayType } from "./cron.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/domain/notification.ts
|
|
4
|
+
const NotificationPayloadType = z.enum([
|
|
5
|
+
"notification/card",
|
|
6
|
+
"notification/dashboard",
|
|
7
|
+
"notification/system-event",
|
|
8
|
+
"notification/testing"
|
|
9
|
+
]);
|
|
10
|
+
const CARD_PAYLOAD_TYPE = "notification/card";
|
|
11
|
+
const NotificationSendCondition = z.enum([
|
|
12
|
+
"has_result",
|
|
13
|
+
"goal_above",
|
|
14
|
+
"goal_below"
|
|
15
|
+
]);
|
|
16
|
+
const NotificationChannelType = z.enum([
|
|
17
|
+
"channel/email",
|
|
18
|
+
"channel/slack",
|
|
19
|
+
"channel/http"
|
|
20
|
+
]);
|
|
21
|
+
const NotificationRecipientType = z.enum([
|
|
22
|
+
"notification-recipient/user",
|
|
23
|
+
"notification-recipient/group",
|
|
24
|
+
"notification-recipient/raw-value",
|
|
25
|
+
"notification-recipient/template"
|
|
26
|
+
]);
|
|
27
|
+
const NotificationSubscriptionType = z.enum(["notification-subscription/cron", "notification-subscription/system-event"]);
|
|
28
|
+
const NotificationRecipientDetails = z.object({
|
|
29
|
+
value: z.string().optional(),
|
|
30
|
+
channel_id: z.string().nullable().optional()
|
|
31
|
+
}).loose();
|
|
32
|
+
const NotificationRecipientDetailsCompact = NotificationRecipientDetails.pick({
|
|
33
|
+
value: true,
|
|
34
|
+
channel_id: true
|
|
35
|
+
}).strip();
|
|
36
|
+
const NotificationRecipient = z.object({
|
|
37
|
+
id: z.number().int().optional(),
|
|
38
|
+
type: NotificationRecipientType,
|
|
39
|
+
user_id: z.number().int().nullable().optional(),
|
|
40
|
+
permissions_group_id: z.number().int().nullable().optional(),
|
|
41
|
+
details: NotificationRecipientDetails.nullable().optional()
|
|
42
|
+
}).loose();
|
|
43
|
+
const NotificationRecipientCompact = NotificationRecipient.pick({
|
|
44
|
+
type: true,
|
|
45
|
+
user_id: true,
|
|
46
|
+
permissions_group_id: true
|
|
47
|
+
}).strip().extend({ details: NotificationRecipientDetailsCompact.nullable().optional() });
|
|
48
|
+
const NotificationHandler = z.object({
|
|
49
|
+
id: z.number().int().optional(),
|
|
50
|
+
channel_type: NotificationChannelType,
|
|
51
|
+
channel_id: z.number().int().nullable().optional(),
|
|
52
|
+
template_id: z.number().int().nullable().optional(),
|
|
53
|
+
active: z.boolean().optional(),
|
|
54
|
+
recipients: z.array(NotificationRecipient).optional()
|
|
55
|
+
}).loose();
|
|
56
|
+
const NotificationHandlerCompact = NotificationHandler.pick({
|
|
57
|
+
channel_type: true,
|
|
58
|
+
channel_id: true
|
|
59
|
+
}).strip().extend({ recipients: z.array(NotificationRecipientCompact).optional() });
|
|
60
|
+
const NotificationSubscription = z.object({
|
|
61
|
+
id: z.number().int().optional(),
|
|
62
|
+
type: NotificationSubscriptionType,
|
|
63
|
+
cron_schedule: z.string().nullable().optional(),
|
|
64
|
+
event_name: z.string().nullable().optional(),
|
|
65
|
+
ui_display_type: CronUiDisplayType.nullable().optional()
|
|
66
|
+
}).loose();
|
|
67
|
+
const NotificationSubscriptionCompact = NotificationSubscription.pick({
|
|
68
|
+
type: true,
|
|
69
|
+
cron_schedule: true
|
|
70
|
+
}).strip();
|
|
71
|
+
const NotificationCardPayload = z.object({
|
|
72
|
+
id: z.number().int().optional(),
|
|
73
|
+
card_id: z.number().int(),
|
|
74
|
+
send_condition: NotificationSendCondition,
|
|
75
|
+
send_once: z.boolean()
|
|
76
|
+
}).loose();
|
|
77
|
+
const NotificationCardPayloadCompact = NotificationCardPayload.pick({
|
|
78
|
+
card_id: true,
|
|
79
|
+
send_condition: true,
|
|
80
|
+
send_once: true
|
|
81
|
+
}).strip();
|
|
82
|
+
const Notification = z.object({
|
|
83
|
+
id: z.number().int(),
|
|
84
|
+
payload_type: NotificationPayloadType,
|
|
85
|
+
payload_id: z.number().int().nullable(),
|
|
86
|
+
payload: NotificationCardPayload.nullable(),
|
|
87
|
+
active: z.boolean(),
|
|
88
|
+
creator_id: z.number().int().nullable(),
|
|
89
|
+
subscriptions: z.array(NotificationSubscription),
|
|
90
|
+
handlers: z.array(NotificationHandler)
|
|
91
|
+
}).loose();
|
|
92
|
+
const NotificationOfOtherType = z.object({
|
|
93
|
+
id: z.number().int(),
|
|
94
|
+
payload_type: NotificationPayloadType.exclude([CARD_PAYLOAD_TYPE])
|
|
95
|
+
}).loose();
|
|
96
|
+
const AnyNotification = z.discriminatedUnion("payload_type", [Notification.extend({ payload_type: z.literal(CARD_PAYLOAD_TYPE) }), NotificationOfOtherType]);
|
|
97
|
+
const NotificationCompact = Notification.pick({
|
|
98
|
+
id: true,
|
|
99
|
+
payload_type: true,
|
|
100
|
+
active: true,
|
|
101
|
+
creator_id: true
|
|
102
|
+
}).strip().extend({
|
|
103
|
+
payload: NotificationCardPayloadCompact.nullable(),
|
|
104
|
+
subscriptions: z.array(NotificationSubscriptionCompact),
|
|
105
|
+
handlers: z.array(NotificationHandlerCompact)
|
|
106
|
+
});
|
|
107
|
+
const NotificationRecipientInput = z.object({
|
|
108
|
+
type: NotificationRecipientType,
|
|
109
|
+
user_id: z.number().int().positive().optional(),
|
|
110
|
+
permissions_group_id: z.number().int().positive().optional(),
|
|
111
|
+
details: NotificationRecipientDetails.optional()
|
|
112
|
+
}).loose();
|
|
113
|
+
const NotificationHandlerInput = z.object({
|
|
114
|
+
channel_type: NotificationChannelType,
|
|
115
|
+
channel_id: z.number().int().positive().nullable().optional(),
|
|
116
|
+
active: z.boolean().optional(),
|
|
117
|
+
recipients: z.array(NotificationRecipientInput).optional()
|
|
118
|
+
}).loose();
|
|
119
|
+
const NotificationSubscriptionInput = z.object({
|
|
120
|
+
type: NotificationSubscriptionType.default("notification-subscription/cron"),
|
|
121
|
+
cron_schedule: z.string().min(1)
|
|
122
|
+
}).loose();
|
|
123
|
+
const NotificationCardPayloadInput = z.object({
|
|
124
|
+
card_id: z.number().int().positive(),
|
|
125
|
+
send_condition: NotificationSendCondition.optional(),
|
|
126
|
+
send_once: z.boolean().optional()
|
|
127
|
+
}).loose();
|
|
128
|
+
const NotificationCreateInput = z.object({
|
|
129
|
+
payload_type: NotificationPayloadType.default(CARD_PAYLOAD_TYPE),
|
|
130
|
+
payload: NotificationCardPayloadInput,
|
|
131
|
+
subscriptions: z.array(NotificationSubscriptionInput).min(1),
|
|
132
|
+
handlers: z.array(NotificationHandlerInput).min(1),
|
|
133
|
+
active: z.boolean().optional()
|
|
134
|
+
}).loose();
|
|
135
|
+
const NotificationCardPayloadPatch = NotificationCardPayloadInput.partial();
|
|
136
|
+
const NotificationUpdateInput = z.object({
|
|
137
|
+
payload: NotificationCardPayloadPatch.optional(),
|
|
138
|
+
subscriptions: z.array(NotificationSubscriptionInput).min(1).optional(),
|
|
139
|
+
handlers: z.array(NotificationHandlerInput).min(1).optional(),
|
|
140
|
+
active: z.boolean().optional()
|
|
141
|
+
}).loose();
|
|
142
|
+
//#endregion
|
|
143
|
+
export { AnyNotification, CARD_PAYLOAD_TYPE, Notification, NotificationCardPayload, NotificationCardPayloadCompact, NotificationCardPayloadPatch, NotificationChannelType, NotificationCompact, NotificationCreateInput, NotificationHandler, NotificationHandlerCompact, NotificationPayloadType, NotificationRecipient, NotificationRecipientCompact, NotificationRecipientDetails, NotificationRecipientType, NotificationSendCondition, NotificationSubscription, NotificationSubscriptionCompact, NotificationSubscriptionType, NotificationUpdateInput };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as ParameterTextTagTarget, c as ParameterValuesCompact, d as ValuesSourceConfig, f as ValuesSourceType, i as ParameterTemplateTagRef, l as TemporalUnit, n as ParameterMapping, o as ParameterType, r as ParameterTarget, s as ParameterValues, t as Parameter, u as ValuesQueryType } from "../parameter-ak-J-IOj.js";
|
|
2
|
+
export { Parameter, ParameterMapping, ParameterTarget, ParameterTemplateTagRef, ParameterTextTagTarget, ParameterType, ParameterValues, ParameterValuesCompact, TemporalUnit, ValuesQueryType, ValuesSourceConfig, ValuesSourceType };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/domain/parameter.ts
|
|
3
|
+
const ParameterType = z.enum([
|
|
4
|
+
"number",
|
|
5
|
+
"text",
|
|
6
|
+
"date",
|
|
7
|
+
"boolean",
|
|
8
|
+
"date/single",
|
|
9
|
+
"id",
|
|
10
|
+
"category",
|
|
11
|
+
"location/city",
|
|
12
|
+
"location/state",
|
|
13
|
+
"location/zip_code",
|
|
14
|
+
"location/country",
|
|
15
|
+
"date/range",
|
|
16
|
+
"date/month-year",
|
|
17
|
+
"date/quarter-year",
|
|
18
|
+
"date/relative",
|
|
19
|
+
"date/all-options",
|
|
20
|
+
"temporal-unit",
|
|
21
|
+
"number/!=",
|
|
22
|
+
"number/<=",
|
|
23
|
+
"number/=",
|
|
24
|
+
"number/>=",
|
|
25
|
+
"number/between",
|
|
26
|
+
"string/!=",
|
|
27
|
+
"string/=",
|
|
28
|
+
"string/contains",
|
|
29
|
+
"string/does-not-contain",
|
|
30
|
+
"string/ends-with",
|
|
31
|
+
"string/starts-with",
|
|
32
|
+
"boolean/="
|
|
33
|
+
]);
|
|
34
|
+
const TemporalUnit = z.enum([
|
|
35
|
+
"millisecond",
|
|
36
|
+
"second",
|
|
37
|
+
"minute",
|
|
38
|
+
"hour",
|
|
39
|
+
"day",
|
|
40
|
+
"week",
|
|
41
|
+
"month",
|
|
42
|
+
"quarter",
|
|
43
|
+
"year",
|
|
44
|
+
"second-of-minute",
|
|
45
|
+
"minute-of-hour",
|
|
46
|
+
"hour-of-day",
|
|
47
|
+
"day-of-week",
|
|
48
|
+
"day-of-month",
|
|
49
|
+
"day-of-year",
|
|
50
|
+
"week-of-year",
|
|
51
|
+
"month-of-year",
|
|
52
|
+
"quarter-of-year",
|
|
53
|
+
"year-of-era",
|
|
54
|
+
"default"
|
|
55
|
+
]);
|
|
56
|
+
const ValuesSourceType = z.enum(["static-list", "card"]);
|
|
57
|
+
const ValuesQueryType = z.enum([
|
|
58
|
+
"list",
|
|
59
|
+
"search",
|
|
60
|
+
"none"
|
|
61
|
+
]);
|
|
62
|
+
const ParameterTemplateTagRef = z.tuple([z.literal("template-tag"), z.union([z.string(), z.object({ id: z.string() }).loose()])]);
|
|
63
|
+
const FieldRefLike = z.tuple([z.string()]).rest(z.unknown());
|
|
64
|
+
const DimensionTarget = z.tuple([z.literal("dimension"), z.union([ParameterTemplateTagRef, FieldRefLike])]).rest(z.unknown());
|
|
65
|
+
const VariableTarget = z.tuple([z.literal("variable"), z.union([ParameterTemplateTagRef, FieldRefLike])]);
|
|
66
|
+
const ParameterTextTagTarget = z.tuple([z.literal("text-tag"), z.string()]);
|
|
67
|
+
const ParameterTarget = z.union([
|
|
68
|
+
DimensionTarget,
|
|
69
|
+
VariableTarget,
|
|
70
|
+
ParameterTextTagTarget,
|
|
71
|
+
z.number().int(),
|
|
72
|
+
FieldRefLike
|
|
73
|
+
]);
|
|
74
|
+
const ValuesSourceConfig = z.object({
|
|
75
|
+
values: z.array(z.unknown()).optional(),
|
|
76
|
+
card_id: z.number().int().optional(),
|
|
77
|
+
value_field: FieldRefLike.optional(),
|
|
78
|
+
label_field: FieldRefLike.optional()
|
|
79
|
+
}).loose();
|
|
80
|
+
const Parameter = z.object({
|
|
81
|
+
id: z.string(),
|
|
82
|
+
type: ParameterType,
|
|
83
|
+
name: z.string().optional(),
|
|
84
|
+
slug: z.string().optional(),
|
|
85
|
+
sectionId: z.string().optional(),
|
|
86
|
+
default: z.unknown().optional(),
|
|
87
|
+
required: z.boolean().nullable().optional(),
|
|
88
|
+
filteringParameters: z.array(z.string()).nullable().optional(),
|
|
89
|
+
target: ParameterTarget.optional(),
|
|
90
|
+
temporal_units: z.array(TemporalUnit).nullable().optional(),
|
|
91
|
+
values_query_type: ValuesQueryType.nullable().optional(),
|
|
92
|
+
values_source_type: ValuesSourceType.nullable().optional(),
|
|
93
|
+
values_source_config: ValuesSourceConfig.nullable().optional()
|
|
94
|
+
}).loose();
|
|
95
|
+
const ParameterMapping = z.object({
|
|
96
|
+
parameter_id: z.string(),
|
|
97
|
+
target: ParameterTarget,
|
|
98
|
+
card_id: z.number().int().nullable().optional()
|
|
99
|
+
}).loose();
|
|
100
|
+
const ParameterValues = z.object({
|
|
101
|
+
values: z.array(z.array(z.unknown())),
|
|
102
|
+
has_more_values: z.boolean()
|
|
103
|
+
}).loose();
|
|
104
|
+
const ParameterValuesCompact = ParameterValues.pick({
|
|
105
|
+
values: true,
|
|
106
|
+
has_more_values: true
|
|
107
|
+
}).strip();
|
|
108
|
+
//#endregion
|
|
109
|
+
export { Parameter, ParameterMapping, ParameterTarget, ParameterTemplateTagRef, ParameterTextTagTarget, ParameterType, ParameterValues, ParameterValuesCompact, TemporalUnit, ValuesQueryType, ValuesSourceConfig, ValuesSourceType };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as PermissionsGraph, i as DownloadPermission, n as DataModelPermission, o as ViewDataPermission, r as DatabasePermissions, s as YesNoPermission, t as CreateQueriesPermission } from "../permission-BnCQw5Kp.js";
|
|
2
|
+
export { CreateQueriesPermission, DataModelPermission, DatabasePermissions, DownloadPermission, PermissionsGraph, ViewDataPermission, YesNoPermission };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/domain/permission.ts
|
|
3
|
+
const ViewDataPermission = z.enum([
|
|
4
|
+
"unrestricted",
|
|
5
|
+
"legacy-no-self-service",
|
|
6
|
+
"blocked",
|
|
7
|
+
"sandboxed",
|
|
8
|
+
"impersonated"
|
|
9
|
+
]);
|
|
10
|
+
const CreateQueriesPermission = z.enum([
|
|
11
|
+
"query-builder-and-native",
|
|
12
|
+
"query-builder",
|
|
13
|
+
"no"
|
|
14
|
+
]);
|
|
15
|
+
const DownloadPermission = z.enum(["full", "limited"]);
|
|
16
|
+
const DataModelPermission = z.literal("all");
|
|
17
|
+
const YesNoPermission = z.enum(["yes", "no"]);
|
|
18
|
+
function granular(value) {
|
|
19
|
+
const perTable = z.record(z.string(), value);
|
|
20
|
+
const perSchema = z.record(z.string(), z.union([value, perTable]));
|
|
21
|
+
return z.union([value, perSchema]);
|
|
22
|
+
}
|
|
23
|
+
const DatabasePermissions = z.object({
|
|
24
|
+
"view-data": granular(ViewDataPermission).optional(),
|
|
25
|
+
"create-queries": granular(CreateQueriesPermission).optional(),
|
|
26
|
+
download: z.object({ schemas: granular(DownloadPermission) }).loose().optional(),
|
|
27
|
+
"data-model": z.object({ schemas: granular(DataModelPermission) }).loose().optional(),
|
|
28
|
+
details: YesNoPermission.optional(),
|
|
29
|
+
transforms: YesNoPermission.optional()
|
|
30
|
+
}).loose();
|
|
31
|
+
const PermissionsGraph = z.object({
|
|
32
|
+
revision: z.number().int().nonnegative(),
|
|
33
|
+
groups: z.record(z.string(), z.record(z.string(), DatabasePermissions))
|
|
34
|
+
}).loose();
|
|
35
|
+
//#endregion
|
|
36
|
+
export { CreateQueriesPermission, DataModelPermission, DatabasePermissions, DownloadPermission, PermissionsGraph, ViewDataPermission, YesNoPermission };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as PulseChannelCompact, c as PulseCompact, d as PulseRecipientCompact, f as PulseScheduleDay, g as SUBSCRIPTION_FILTERS_GATE, h as PulseUpdateInput, i as PulseChannel, l as PulseCreateInput, m as PulseScheduleType, n as PulseCard, o as PulseChannelDetails, p as PulseScheduleFrame, r as PulseCardCompact, s as PulseChannelType, t as Pulse, u as PulseRecipient } from "../pulse-0LG3K6qO.js";
|
|
2
|
+
export { Pulse, PulseCard, PulseCardCompact, PulseChannel, PulseChannelCompact, PulseChannelDetails, PulseChannelType, PulseCompact, PulseCreateInput, PulseRecipient, PulseRecipientCompact, PulseScheduleDay, PulseScheduleFrame, PulseScheduleType, PulseUpdateInput, SUBSCRIPTION_FILTERS_GATE };
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { t as gateInput } from "../input-gate-registry-Dai7SfXb.js";
|
|
2
|
+
import { Parameter } from "./parameter.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region src/domain/pulse.ts
|
|
5
|
+
const PulseChannelType = z.enum([
|
|
6
|
+
"email",
|
|
7
|
+
"slack",
|
|
8
|
+
"http"
|
|
9
|
+
]);
|
|
10
|
+
const PulseScheduleType = z.enum([
|
|
11
|
+
"hourly",
|
|
12
|
+
"daily",
|
|
13
|
+
"weekly",
|
|
14
|
+
"monthly"
|
|
15
|
+
]);
|
|
16
|
+
const PulseScheduleDay = z.enum([
|
|
17
|
+
"mon",
|
|
18
|
+
"tue",
|
|
19
|
+
"wed",
|
|
20
|
+
"thu",
|
|
21
|
+
"fri",
|
|
22
|
+
"sat",
|
|
23
|
+
"sun"
|
|
24
|
+
]);
|
|
25
|
+
const PulseScheduleFrame = z.enum([
|
|
26
|
+
"first",
|
|
27
|
+
"mid",
|
|
28
|
+
"last"
|
|
29
|
+
]);
|
|
30
|
+
const PulseChannelDetails = z.object({ channel: z.string().optional() }).loose();
|
|
31
|
+
const PulseRecipient = z.object({
|
|
32
|
+
id: z.number().int().nullable().optional(),
|
|
33
|
+
email: z.string()
|
|
34
|
+
}).loose();
|
|
35
|
+
const PulseRecipientCompact = PulseRecipient.pick({
|
|
36
|
+
id: true,
|
|
37
|
+
email: true
|
|
38
|
+
}).strip();
|
|
39
|
+
const PulseChannel = z.object({
|
|
40
|
+
id: z.number().int().optional(),
|
|
41
|
+
channel_type: PulseChannelType,
|
|
42
|
+
channel_id: z.number().int().nullable().optional(),
|
|
43
|
+
enabled: z.boolean(),
|
|
44
|
+
schedule_type: PulseScheduleType,
|
|
45
|
+
schedule_hour: z.number().int().nullable(),
|
|
46
|
+
schedule_day: PulseScheduleDay.nullable(),
|
|
47
|
+
schedule_frame: PulseScheduleFrame.nullable(),
|
|
48
|
+
details: PulseChannelDetails.optional(),
|
|
49
|
+
recipients: z.array(PulseRecipient)
|
|
50
|
+
}).loose();
|
|
51
|
+
const PulseChannelCompact = PulseChannel.pick({
|
|
52
|
+
channel_type: true,
|
|
53
|
+
enabled: true,
|
|
54
|
+
schedule_type: true,
|
|
55
|
+
schedule_hour: true,
|
|
56
|
+
schedule_day: true,
|
|
57
|
+
schedule_frame: true,
|
|
58
|
+
details: true
|
|
59
|
+
}).strip().extend({ recipients: z.array(PulseRecipientCompact) });
|
|
60
|
+
const PulseCard = z.object({
|
|
61
|
+
id: z.number().int(),
|
|
62
|
+
name: z.string(),
|
|
63
|
+
dashboard_card_id: z.number().int().nullable(),
|
|
64
|
+
include_csv: z.boolean(),
|
|
65
|
+
include_xls: z.boolean()
|
|
66
|
+
}).loose();
|
|
67
|
+
const PulseCardCompact = PulseCard.pick({
|
|
68
|
+
id: true,
|
|
69
|
+
name: true,
|
|
70
|
+
dashboard_card_id: true,
|
|
71
|
+
include_csv: true,
|
|
72
|
+
include_xls: true
|
|
73
|
+
}).strip();
|
|
74
|
+
const Pulse = z.object({
|
|
75
|
+
id: z.number().int(),
|
|
76
|
+
name: z.string().nullable(),
|
|
77
|
+
creator_id: z.number().int(),
|
|
78
|
+
dashboard_id: z.number().int().nullable(),
|
|
79
|
+
collection_id: z.number().int().nullable(),
|
|
80
|
+
archived: z.boolean(),
|
|
81
|
+
skip_if_empty: z.boolean(),
|
|
82
|
+
parameters: z.array(Parameter),
|
|
83
|
+
cards: z.array(PulseCard),
|
|
84
|
+
channels: z.array(PulseChannel)
|
|
85
|
+
}).loose();
|
|
86
|
+
const PulseCompact = Pulse.pick({
|
|
87
|
+
id: true,
|
|
88
|
+
name: true,
|
|
89
|
+
dashboard_id: true,
|
|
90
|
+
collection_id: true,
|
|
91
|
+
archived: true,
|
|
92
|
+
skip_if_empty: true
|
|
93
|
+
}).strip().extend({
|
|
94
|
+
cards: z.array(PulseCardCompact),
|
|
95
|
+
channels: z.array(PulseChannelCompact)
|
|
96
|
+
});
|
|
97
|
+
const PulseRecipientInput = z.union([z.object({ id: z.number().int().positive() }).loose(), z.object({ email: z.string().min(1) }).loose()]);
|
|
98
|
+
const PulseCardInput = z.object({
|
|
99
|
+
id: z.number().int().positive(),
|
|
100
|
+
include_csv: z.boolean(),
|
|
101
|
+
include_xls: z.boolean(),
|
|
102
|
+
dashboard_card_id: z.number().int().positive().nullable().optional(),
|
|
103
|
+
format_rows: z.boolean().optional(),
|
|
104
|
+
pivot_results: z.boolean().optional()
|
|
105
|
+
}).loose();
|
|
106
|
+
const PulseChannelInput = z.object({
|
|
107
|
+
channel_type: PulseChannelType,
|
|
108
|
+
enabled: z.boolean().default(true),
|
|
109
|
+
schedule_type: PulseScheduleType,
|
|
110
|
+
schedule_hour: z.number().int().min(0).max(23).nullable().optional(),
|
|
111
|
+
schedule_day: PulseScheduleDay.nullable().optional(),
|
|
112
|
+
schedule_frame: PulseScheduleFrame.nullable().optional(),
|
|
113
|
+
channel_id: z.number().int().positive().nullable().optional(),
|
|
114
|
+
details: PulseChannelDetails.optional(),
|
|
115
|
+
recipients: z.array(PulseRecipientInput).optional()
|
|
116
|
+
}).loose();
|
|
117
|
+
const SUBSCRIPTION_FILTERS_GATE = {
|
|
118
|
+
feature: "dashboardSubscriptionFilters",
|
|
119
|
+
effect: "needs",
|
|
120
|
+
when: { kind: "nonEmpty" }
|
|
121
|
+
};
|
|
122
|
+
const PulseParametersInput = gateInput(z.array(Parameter).optional(), SUBSCRIPTION_FILTERS_GATE);
|
|
123
|
+
const PulseCreateInput = z.object({
|
|
124
|
+
name: z.string().min(1),
|
|
125
|
+
dashboard_id: z.number().int().positive(),
|
|
126
|
+
cards: z.array(PulseCardInput).min(1),
|
|
127
|
+
channels: z.array(PulseChannelInput).min(1),
|
|
128
|
+
skip_if_empty: z.boolean().optional(),
|
|
129
|
+
parameters: PulseParametersInput
|
|
130
|
+
}).loose();
|
|
131
|
+
const PulseUpdateInput = z.object({
|
|
132
|
+
name: z.string().min(1).optional(),
|
|
133
|
+
cards: z.array(PulseCardInput).min(1).optional(),
|
|
134
|
+
channels: z.array(PulseChannelInput).min(1).optional(),
|
|
135
|
+
skip_if_empty: z.boolean().optional(),
|
|
136
|
+
archived: z.boolean().optional(),
|
|
137
|
+
parameters: PulseParametersInput
|
|
138
|
+
}).loose();
|
|
139
|
+
//#endregion
|
|
140
|
+
export { Pulse, PulseCard, PulseCardCompact, PulseChannel, PulseChannelCompact, PulseChannelDetails, PulseChannelType, PulseCompact, PulseCreateInput, PulseRecipient, PulseRecipientCompact, PulseScheduleDay, PulseScheduleFrame, PulseScheduleType, PulseUpdateInput, SUBSCRIPTION_FILTERS_GATE };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/domain/query.ts
|
|
3
|
+
const DatasetQuery = z.object({}).loose().refine((value) => "lib/type" in value || "type" in value, { message: "dataset_query must include \"lib/type\" (MBQL 5) or \"type\" (legacy MBQL/native); empty `{}` is rejected" }).describe("MBQL 5, legacy MBQL, or native query");
|
|
4
|
+
const ExportFormat = z.enum([
|
|
5
|
+
"csv",
|
|
6
|
+
"json",
|
|
7
|
+
"xlsx"
|
|
8
|
+
]);
|
|
9
|
+
const PivotExportFormat = ExportFormat.exclude(["json"]);
|
|
10
|
+
const VisualizationSettings = z.record(z.string(), z.unknown());
|
|
11
|
+
const SortDirection = z.enum(["asc", "desc"]);
|
|
12
|
+
//#endregion
|
|
13
|
+
export { DatasetQuery, ExportFormat, PivotExportFormat, SortDirection, VisualizationSettings };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as ReplacementEntityType, c as ReplacementRun, d as ReplacementRunStatus, f as ReplacementSourceInput, i as ReplacementColumnMapping, l as ReplacementRunCompact, n as ReplacementColumn, o as ReplacementError, p as ReplacementSourceType, r as ReplacementColumnError, s as ReplacementModelWithTransformInput, t as ReplacementCheck, u as ReplacementRunStarted } from "../replacement-BGyggp-G.js";
|
|
2
|
+
export { ReplacementCheck, ReplacementColumn, ReplacementColumnError, ReplacementColumnMapping, ReplacementEntityType, ReplacementError, ReplacementModelWithTransformInput, ReplacementRun, ReplacementRunCompact, ReplacementRunStarted, ReplacementRunStatus, ReplacementSourceInput, ReplacementSourceType };
|