@metabase/client 0.1.0 → 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 +21 -0
- package/README.md +6 -4
- package/dist/api-key-DJeN1-7G.d.ts +46 -0
- package/dist/{card-B6merEUN.d.ts → card-BxBzr5Uj.d.ts} +11 -11
- package/dist/{card-BZx4NSr-.d.ts → card-DN0sLkCG.d.ts} +4 -4
- package/dist/{client-DNRvXFRm.d.ts → client-DdXLlH1B.d.ts} +270 -166
- package/dist/client.d.ts +1 -1
- package/dist/client.js +4 -0
- package/dist/{collection-Bib61WiV.d.ts → collection-DGnTvD6R.d.ts} +20 -20
- package/dist/{collection-CqtGPi4W.d.ts → collection-fFahL-ub.d.ts} +18 -4
- package/dist/{dashboard-XTe46250.d.ts → dashboard-CM7RmNeE.d.ts} +2 -2
- package/dist/{dashboard-z9i1VUZC.d.ts → dashboard-DtLXVgtf.d.ts} +21 -13
- package/dist/{data-action-rS27f2Ji.d.ts → data-action-CkXVrOUH.d.ts} +7 -5
- package/dist/data-app-CqP5_fpB.d.ts +76 -0
- package/dist/{database-DqTespfa.d.ts → database-B0JNZjDN.d.ts} +3 -3
- package/dist/{database-BLUMlywE.d.ts → database-BxqDmfcj.d.ts} +9 -9
- package/dist/{dataset-C6lX1-cr.d.ts → dataset-BBNGPVec.d.ts} +22 -22
- package/dist/{dataset-Cj3XuKLe.d.ts → dataset-BUirJ1rO.d.ts} +3 -3
- package/dist/{dependency-fN5_7a22.d.ts → dependency-CzpXmeu7.d.ts} +26 -26
- package/dist/{dependency-D8Qs5Xdx.d.ts → dependency-arB8Cr2H.d.ts} +147 -95
- package/dist/{document-oZNDbDfx.d.ts → document-tLd6pYWe.d.ts} +2 -2
- package/dist/domain/api-key.d.ts +2 -0
- package/dist/domain/api-key.js +31 -0
- package/dist/domain/card.d.ts +1 -1
- package/dist/domain/collection.d.ts +1 -1
- package/dist/domain/dashboard.d.ts +2 -2
- package/dist/domain/dashboard.js +21 -4
- package/dist/domain/data-action.d.ts +2 -2
- package/dist/domain/data-action.js +8 -2
- package/dist/domain/data-app.d.ts +2 -0
- package/dist/domain/data-app.js +52 -0
- package/dist/domain/database.d.ts +1 -1
- package/dist/domain/dataset.d.ts +1 -1
- package/dist/domain/dependency.d.ts +1 -1
- package/dist/domain/dependency.js +6 -3
- package/dist/domain/document.d.ts +1 -1
- package/dist/domain/eid-translation.d.ts +1 -1
- package/dist/domain/embedding.d.ts +1 -1
- package/dist/domain/field.d.ts +2 -2
- package/dist/domain/field.js +8 -2
- package/dist/domain/git-sync.d.ts +1 -1
- package/dist/domain/library.d.ts +2 -2
- package/dist/domain/library.js +8 -2
- package/dist/domain/measure.d.ts +1 -1
- package/dist/domain/measure.js +3 -1
- package/dist/domain/metric.d.ts +1 -1
- package/dist/domain/notification.d.ts +2 -2
- package/dist/domain/notification.js +6 -1
- package/dist/domain/pulse.d.ts +2 -2
- package/dist/domain/pulse.js +10 -3
- package/dist/domain/replacement.d.ts +1 -1
- package/dist/domain/revision.d.ts +2 -2
- package/dist/domain/revision.js +29 -2
- package/dist/domain/search.d.ts +1 -1
- package/dist/domain/segment.d.ts +1 -1
- package/dist/domain/segment.js +3 -1
- package/dist/domain/setup.d.ts +1 -1
- package/dist/domain/setup.js +1 -1
- package/dist/domain/snippet.d.ts +1 -1
- package/dist/domain/table.d.ts +2 -2
- package/dist/domain/table.js +35 -4
- package/dist/domain/timeline.d.ts +1 -1
- package/dist/domain/transform-inspector.d.ts +1 -1
- package/dist/domain/transform-job.d.ts +2 -2
- package/dist/domain/transform-job.js +8 -2
- package/dist/domain/transform-python.d.ts +2 -2
- package/dist/domain/transform-python.js +15 -3
- package/dist/domain/transform-tag.d.ts +1 -1
- package/dist/domain/transform-test.d.ts +1 -1
- package/dist/domain/transform.d.ts +2 -2
- package/dist/domain/transform.js +76 -7
- package/dist/domain/user.d.ts +1 -1
- package/dist/domain/user.js +1 -1
- package/dist/{eid-translation-nuhr8St2.d.ts → eid-translation-CH6NPWd-.d.ts} +15 -15
- package/dist/{embedding-Cz3RUJYf.d.ts → embedding-oU3gqfgX.d.ts} +1 -1
- package/dist/{erd-BujD227Y.d.ts → erd-CbV7xvAc.d.ts} +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/{features-CnFkUCj2.d.ts → features-SMSfJhB6.d.ts} +36 -2
- package/dist/{field-Bqn10Fq_.d.ts → field-D1Pfk-0S.d.ts} +2 -2
- package/dist/{field-BCRO19mk.d.ts → field-p9Rme2zB.d.ts} +6 -4
- package/dist/{git-sync-gAMKsZgN.d.ts → git-sync-BTf1aYHr.d.ts} +3 -3
- package/dist/{git-sync-DNXrNVCW.d.ts → git-sync-C99SVdJ9.d.ts} +2 -2
- package/dist/{glossary-CqFlzW33.d.ts → glossary-DFvnz-E5.d.ts} +1 -1
- package/dist/http/errors.d.ts +1 -1
- package/dist/http/transport.d.ts +1 -1
- package/dist/index.d.ts +43 -41
- package/dist/index.js +7 -5
- package/dist/input-gate-registry-Dai7SfXb.js +14 -0
- package/dist/input-gates-DwKoTJVQ.d.ts +28 -0
- package/dist/{json-CZvjc3--.d.ts → json-BksZpXDC.d.ts} +1 -1
- package/dist/json-pointer.d.ts +2 -1
- package/dist/json-pointer.js +4 -1
- package/dist/json.d.ts +1 -1
- package/dist/{library-Cx9h_RkU.d.ts → library-B9pEq7qP.d.ts} +8 -6
- package/dist/{measure-KuXdjZYJ.d.ts → measure-CgH14YQZ.d.ts} +1 -1
- package/dist/{measure-CuMqPbQX.d.ts → measure-lPz8qnwz.d.ts} +1 -1
- package/dist/{metric-yvehaVCS.d.ts → metric-DcYloqOQ.d.ts} +2 -2
- package/dist/{notification-BiegPoSD.d.ts → notification-Cp5GJErS.d.ts} +3 -3
- package/dist/{notification-BT2TDAd_.d.ts → notification-D1MThyKE.d.ts} +66 -2
- package/dist/{paginate-DZWvWvbm.d.ts → paginate-COuL0Gzl.d.ts} +1 -1
- package/dist/paginate.d.ts +1 -1
- package/dist/{pulse-CMc1Rwdj.d.ts → pulse-0LG3K6qO.d.ts} +7 -5
- package/dist/{pulse-dylocLd9.d.ts → pulse-BzKmz3Yn.d.ts} +2 -2
- package/dist/{replacement-CyvtbxGg.d.ts → replacement-BGyggp-G.d.ts} +5 -5
- package/dist/{replacement-S9U3gApY.d.ts → replacement-CVebCuNp.d.ts} +5 -5
- package/dist/{requirement-check-CIA5IHC1.d.ts → requirement-check-glU7wqhQ.d.ts} +2 -2
- package/dist/{requirements-C0txASN8.d.ts → requirements-Dx_ZVzl7.d.ts} +11 -1
- package/dist/resources/api-key.d.ts +11 -0
- package/dist/resources/api-key.js +35 -0
- package/dist/resources/card.d.ts +1 -1
- package/dist/resources/collection.d.ts +1 -1
- package/dist/resources/collection.js +29 -5
- package/dist/resources/content-translation.d.ts +1 -1
- package/dist/resources/content-translation.js +1 -1
- package/dist/resources/dashboard.d.ts +1 -1
- package/dist/resources/dashboard.js +8 -5
- package/dist/resources/data-action.d.ts +3 -48
- package/dist/resources/data-action.js +9 -9
- package/dist/resources/data-app.d.ts +112 -0
- package/dist/resources/data-app.js +75 -0
- package/dist/resources/database.d.ts +1 -1
- package/dist/resources/dataset.d.ts +1 -1
- package/dist/resources/dependency.d.ts +1 -1
- package/dist/resources/dependency.js +13 -7
- package/dist/resources/document.d.ts +2 -2
- package/dist/resources/eid-translation.d.ts +2 -2
- package/dist/resources/erd.d.ts +1 -1
- package/dist/resources/field.d.ts +1 -1
- package/dist/resources/field.js +3 -2
- package/dist/resources/git-sync.d.ts +1 -1
- package/dist/resources/git-sync.js +1 -1
- package/dist/resources/glossary.d.ts +1 -1
- package/dist/resources/library.d.ts +4 -4
- package/dist/resources/library.js +2 -2
- package/dist/resources/measure.d.ts +1 -1
- package/dist/resources/metric.d.ts +1 -1
- package/dist/resources/moderation-review.d.ts +1 -1
- package/dist/resources/notification.d.ts +1 -1
- package/dist/resources/notification.js +2 -2
- package/dist/resources/optional-parsed.d.ts +1 -1
- package/dist/resources/permission.d.ts +1 -1
- package/dist/resources/pivot-export.d.ts +1 -1
- package/dist/resources/pulse.d.ts +1 -1
- package/dist/resources/pulse.js +3 -2
- package/dist/resources/replacement.d.ts +1 -1
- package/dist/resources/revision.d.ts +3 -3
- package/dist/resources/revision.js +5 -10
- package/dist/resources/search.d.ts +1 -1
- package/dist/resources/search.js +23 -2
- package/dist/resources/segment.d.ts +1 -1
- package/dist/resources/setting.d.ts +1 -1
- package/dist/resources/setup.d.ts +2 -2
- package/dist/resources/snippet.d.ts +1 -1
- package/dist/resources/table.d.ts +1 -1
- package/dist/resources/table.js +9 -10
- package/dist/resources/timeline-event.d.ts +2 -2
- package/dist/resources/timeline.d.ts +1 -1
- package/dist/resources/transform-dag-run.d.ts +1 -1
- package/dist/resources/transform-inspector.d.ts +2 -2
- package/dist/resources/transform-job.d.ts +1 -1
- package/dist/resources/transform-python.d.ts +11 -4
- package/dist/resources/transform-python.js +3 -2
- package/dist/resources/transform-tag.d.ts +1 -1
- package/dist/resources/transform-test.d.ts +1 -1
- package/dist/resources/transform.d.ts +1 -1
- package/dist/resources/transform.js +13 -3
- package/dist/resources/upload.d.ts +1 -1
- package/dist/resources/user.d.ts +2 -2
- package/dist/{revision-CQBPhohA.d.ts → revision-Dyl-8p7d.d.ts} +8 -6
- package/dist/{search-NZR6iRBs.d.ts → search-Cm5IxKss.d.ts} +8 -8
- package/dist/{search-BxJipLN6.d.ts → search-Cten2h0I.d.ts} +2 -2
- package/dist/{segment-pj3wklGe.d.ts → segment-CbAgVO-5.d.ts} +1 -1
- package/dist/{segment-D2i34X9l.d.ts → segment-DQLX6r1E.d.ts} +2 -2
- package/dist/{setup-Ez_U7GmM.d.ts → setup-JqcJ2unJ.d.ts} +1 -1
- package/dist/signal.d.ts +1 -1
- package/dist/{snippet-hEV429Pv.d.ts → snippet-C_Ilx7tR.d.ts} +2 -2
- package/dist/{snippet-RnnWa4TL.d.ts → snippet-Djn0rL21.d.ts} +2 -2
- package/dist/{table-B_lfuaHc.d.ts → table-CDZbLNow.d.ts} +6 -6
- package/dist/{table-B3-UaPHa.d.ts → table-Od6uvDVW.d.ts} +19 -14
- package/dist/{timeline-folD3mQ_.d.ts → timeline-BK45hy-h.d.ts} +31 -31
- package/dist/{timeline-C2IEcRlP.d.ts → timeline-BTs6fuRp.d.ts} +2 -2
- package/dist/{transform-CDurgE1D.d.ts → transform-C5thnJwW.d.ts} +139 -23
- package/dist/{transform-CXOT5kFe.d.ts → transform-WASQAXeA.d.ts} +39 -25
- package/dist/{transform-inspector-BUYBt6--.d.ts → transform-inspector-CMCh8WKV.d.ts} +4 -4
- package/dist/{transform-job-CTJImaOd.d.ts → transform-job-D8jTQtdX.d.ts} +5 -3
- package/dist/{transform-job-29P6BULe.d.ts → transform-job-DmTwKxhc.d.ts} +4 -4
- package/dist/{transform-python-DdDnW6yK.d.ts → transform-python-DtL3xxMj.d.ts} +49 -4
- package/dist/{transform-tag-DVUIZTEM.d.ts → transform-tag-C6j5EUkX.d.ts} +1 -1
- package/dist/{transform-test-A-CJYT6B.d.ts → transform-test-CR_i54IV.d.ts} +1 -1
- package/dist/{transform-test-BwuyrHpT.d.ts → transform-test-CeMzDpUC.d.ts} +1 -1
- package/dist/{transport-E0ZaPNWJ.d.ts → transport-BsXqRujn.d.ts} +17 -3
- package/dist/{upload-B7PG3ePk.d.ts → upload-B5YjVkSW.d.ts} +1 -1
- package/dist/{user-2r0OBoO6.d.ts → user-Sqqv7rqh.d.ts} +2 -2
- package/dist/version/capability-error.d.ts +1 -1
- package/dist/version/features.d.ts +2 -2
- package/dist/version/features.js +30 -2
- package/dist/version/input-gates.d.ts +2 -0
- package/dist/version/input-gates.js +13 -0
- package/dist/version/probe.d.ts +1 -1
- package/dist/version/profile.d.ts +1 -1
- package/dist/version/requirement-check.d.ts +1 -1
- package/dist/version/requirements.d.ts +1 -1
- package/dist/version/requirements.js +10 -0
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
Notable changes to `@metabase/client`.
|
|
4
4
|
|
|
5
|
+
## 0.1.1
|
|
6
|
+
|
|
7
|
+
- `DashboardCreateInput` holds only the fields `POST /api/dashboard` reads, so a layout passed to `dashboard.create` fails to compile; send it as a `DashboardLayoutInput` through `dashboard.update`. At run time `dashboard.create` drops any other key before the request, as the server does, and refuses a blank `name`, as the server does.
|
|
8
|
+
- `DashboardLayoutInput` and `DatabaseUpdateInput` are on the barrel.
|
|
9
|
+
- `@metabase/client/json-pointer` exports `unescapeJsonPointerSegment`, the inverse of `escapeJsonPointerSegment`.
|
|
10
|
+
- `@metabase/client/version/input-gates` exports the input gates recorded on feature-gated body fields, with `gateTriggered` and `inputGatesOf`, and `featureAvailability` says which servers hold a feature.
|
|
11
|
+
- `dataAction.update` refuses a `collection_id` before the request on a server without `dataActionCollections`, which would drop it unread.
|
|
12
|
+
- `dashboard.get` and `dashboard.update` read a dashboard holding a text, heading or other dashcard bound to no card. The server answers a stub `card` such as `{ query_average_duration: null, download_perms: "none" }` for such a dashcard, which 0.1.0 refused; it reads as `null`, and `dashboardDetailSchema` on the dashboard subpath is the reader.
|
|
13
|
+
- A transform's Python `source-tables` entry reads without `database_id` or `schema`, as the server stores an entry whose table or database is gone. `TransformSourceTableEntry` is the stored entry, and `TransformSourceTableEntryInput`, on the barrel, is the entry the create, update and Python test-run bodies take, as strict as before.
|
|
14
|
+
- Every transform read on Metabase 59 accepts a Python transform, whose `source-tables` that server keys by alias. `transformRowSchema` and `transformDetailSchema` read it as the list later servers answer, taking each alias from its key; an entry naming its table by id alone reads `database_id`, `schema` and `table` as `null`, and one whose table that server could not find reads `table_id` as `null` too. `transformSourceTablesAsList` is the feature.
|
|
15
|
+
- The dependency readers accept the action nodes Metabase 65 adds: `DependencyType` and `DependencyUsageType` take `"action"`, and `DependencyEntityData.type` takes an action's `"implicit"` or `"query"`. `dependency.graph`, `dependency.dependents` and `dependency.broken` explain an older server's refusal of an action as the entity through `actionDependencyGraph`.
|
|
16
|
+
- `notification.get`, and the `update`, `archive` and `send` that read through it, refuse a dashboard subscription with the "not a question alert" `ConfigError` instead of a shape error on its payload. `AnyNotification` is the reader: a question alert in full, any other type read no further than `id` and `payload_type`. `CARD_PAYLOAD_TYPE` has the literal type `"notification/card"`.
|
|
17
|
+
- `CurrentUser.email` is any string, so `user.current` reads an account whose address Metabase accepts and a stricter email check refuses, such as one with `!` or `/` in the local part or a digit or one-letter top-level domain.
|
|
18
|
+
- `transform.create`, `transform.update` and `transformPython.testRun` send a Python source's tables keyed by alias to Metabase 58 and 59, which read no list: a transform entry as its reference less `alias`, which 59 reads and 58, taking only table ids, refuses, or as the bare table id when it names its table by id alone, and a test-run entry as its table id. `TransformSourceTableEntryInput` also takes that id-only entry, `{ alias, table_id }` with `database_id`, `schema` and `table` absent or `null`, so a transform read from 59 updates back unchanged. `pythonTestRun` holds from 58 on a server licensed for Python transforms.
|
|
19
|
+
- `SetupInput.user.email` is any string, so `setup.create` hands Metabase an address it accepts and a stricter email check refuses, and the server judges it.
|
|
20
|
+
- `collection.itemPages` walks the `trash` alias on every server. No Metabase routes `/api/collection/trash/items`, so the walk reads the trash collection's id from `GET /api/collection/trash` first and pages its items by that id.
|
|
21
|
+
- `search.query` and `collection.itemPages` explain an older server's 400 for a `models` value it does not take as the feature it lacks: `measure` in search through `measures`, `transform` through `transforms`, `exploration` through the new `explorations`, and among collection items `measure` through the new `collectionItemMeasures`.
|
|
22
|
+
- `collection.itemPages` applies `pinned_state` on Metabase 64 and later, which read it as `pinned-state` and drop the spelling 58 through 63 read.
|
|
23
|
+
- `TransformJobUpdateInput.active` records that it needs `transformJobActivation`; a server before 61 drops it unread and still answers the job as active.
|
|
24
|
+
- `LibraryPublishTablesInput.collection_id` records that only a server with `tablePublishTargetCollection` (62+) reads it; an older one publishes into its one Library data collection. It is sent on every server.
|
|
25
|
+
|
|
5
26
|
## 0.1.0
|
|
6
27
|
|
|
7
28
|
The first published release: the whole surface.
|
package/README.md
CHANGED
|
@@ -433,11 +433,13 @@ Unless the caller passes `metadata` from `tryDiscoverMetadata`, which makes the
|
|
|
433
433
|
|
|
434
434
|
`Features` is a record of named booleans over `FEATURE_RULES`, the one table that relates a behaviour to the majors and token feature it needs (`FeatureRule`: `{ since, until?, tokenFeature? }`); `evaluateFeatures(major, tokenFeatures)` evaluates it for a `RuleMajor` (a release major, or `"development"` for a build ahead of every release), `FEATURE_NAMES` lists the keys, and `isFeatureName` narrows a string to one. Names describe behaviour (`transformTargetTableId`, `libraryChildrenCarryType`), never a version. Consumers branch on a feature, never on a major — `features.ts` is the only module that compares one.
|
|
435
435
|
|
|
436
|
-
`METHOD_REQUIREMENTS` names, per client method (`"transform.get"`, `"gitSync.branches"` — the `MethodKey` as the method is reached on the client), the features it needs, strictest first; `methodRequirements(key)` reads one entry, `METHOD_KEYS` lists the keys, and `isMethodKey` narrows a string to one. When a gated method's request fails the way a server rejects what it lacks (a 402 premium refusal, an unrouted 404, or a 400 on a value outside an older enum or a body an older route reads in another shape), the client probes the server and throws a `CapabilityError` when that profile lacks a feature the method needs — a version gate reads `This operation requires Metabase v59+ (this server is v0.58.0). Upgrade Metabase to use it.`, a token gate `This operation requires the 'remote_sync' premium feature (not enabled on this server).` — and the error's `developerDetail` is a `RequirementFailure` carrying `reason`, `detail`, `feature`, `since`, `tokenFeature` and `serverVersion` — a Zod schema as well as a type (with `RequirementReason` for its `reason` enum), so a consumer that reports the refusal in its own output can describe it. A server that turns out to have every feature failed for another reason, and its own error stands. A 400 is also an ordinary validation failure, so it stands as the server's own `HttpError` when its field errors (`fieldErrors`, `specificFieldErrors`) name a field the missing parameter feature does not gate: a `mb.table.update` carrying a tier-named `data_layer` to a server that speaks medallions, alongside another field that server rejects, throws that field's rejection rather than the tier floor. A 400 that names no field, or one from a server lacking a feature the method itself needs, is the refusal. A method that needs nothing never consults the server; a newer release or a development build is placed past the newest known major, so only a token can explain a refusal there. `checkFeatures(features, profile)` is the check itself, over any feature list (`methodRequirements(key)` gives a method's), answering the first feature the profile lacks, and `featureFailures(features, profile)` answers every one, `featureGap(profile, feature)` says which half of a rule the profile fails (`FeatureGap`: `{ kind: "version" }` or `{ kind: "token", tokenFeature }`), and `ruleGap` is the same question asked of a bare rule. A consumer that describes what a server can do — gating a test lane, or filtering prose by the server it targets — reads the same check.
|
|
436
|
+
`METHOD_REQUIREMENTS` names, per client method (`"transform.get"`, `"gitSync.branches"` — the `MethodKey` as the method is reached on the client), the features it needs, strictest first; `methodRequirements(key)` reads one entry, `METHOD_KEYS` lists the keys, and `isMethodKey` narrows a string to one. When a gated method's request fails the way a server rejects what it lacks (a 402 premium refusal, an unrouted 404, or a 400 on a value outside an older enum or a body an older route reads in another shape), the client probes the server and throws a `CapabilityError` when that profile lacks a feature the method needs — a version gate reads `This operation requires Metabase v59+ (this server is v0.58.0). Upgrade Metabase to use it.`, a token gate `This operation requires the 'remote_sync' premium feature (not enabled on this server).` — and the error's `developerDetail` is a `RequirementFailure` carrying `reason`, `detail`, `feature`, `since`, `tokenFeature` and `serverVersion` — a Zod schema as well as a type (with `RequirementReason` for its `reason` enum), so a consumer that reports the refusal in its own output can describe it. A server that turns out to have every feature failed for another reason, and its own error stands. A 400 is also an ordinary validation failure, so it stands as the server's own `HttpError` when its field errors (`fieldErrors`, `specificFieldErrors`) name a field the missing parameter feature does not gate: a `mb.table.update` carrying a tier-named `data_layer` to a server that speaks medallions, alongside another field that server rejects, throws that field's rejection rather than the tier floor. A 400 that names no field, or one from a server lacking a feature the method itself needs, is the refusal. A method that needs nothing never consults the server; a newer release or a development build is placed past the newest known major, so only a token can explain a refusal there. `checkFeatures(features, profile)` is the check itself, over any feature list (`methodRequirements(key)` gives a method's), answering the first feature the profile lacks, and `featureFailures(features, profile)` answers every one, `featureGap(profile, feature)` says which half of a rule the profile fails (`FeatureGap`: `{ kind: "version" }` or `{ kind: "token", tokenFeature }`), and `ruleGap` is the same question asked of a bare rule. `featureAvailability(feature)` says which servers hold a feature, from its rule: `v64+`, or `token dashboard_subscription_filters` when every supported server meets the version floor. A consumer that describes what a server can do — gating a test lane, or filtering prose by the server it targets — reads the same check.
|
|
437
437
|
|
|
438
|
-
|
|
438
|
+
Some input fields take a value only some servers accept. `@metabase/client/version/input-gates` records each such field on the input schema that holds it, in a registry of the client's own rather than Zod's global one. `inputGatesOf(schema)` answers the `InputGate` entries recorded on a property node, or `null` when every server takes all its values. A gate names a `feature`, an `effect` (`"needs"`: the server must hold the feature; `"supersededBy"`: a server holding it reads the value as something else; `"droppedBy"`: a server holding it drops the value unread), and the `when` that triggers it (`GateTrigger`: the field `present`, one of `values`, or a `nonEmpty` array). `gateTriggered(gate, value)` says whether a value passed for the field triggers the gate. A `droppedBy` gate is a note and nothing enforces it: `TABLE_FROM_DEFINITION_GATE` on `table_id` of `MeasureCreateInput` and `SegmentCreateInput`, which a server holding `tableFromDefinition` drops, and every server is sent because one without the feature requires it. The domain modules export every other gate as a const the resource enforces it by: `DATA_SENSITIVITY_GATE` on `FieldUpdateInput.data_sensitivity`, `DATA_LAYER_TIER_GATE` and `DATA_LAYER_MEDALLION_GATE` on `TableUpdateInput.data_layer`, `DATA_AUTHORITY_WITHDRAWAL_GATE` on `data_authority` of `TableUpdateInput` and `TableBulkEditInput`, `DATA_ACTION_COLLECTION_GATE` on `DataActionUpdateInput.collection_id`, `SUBSCRIPTION_FILTERS_GATE` on `parameters` of `PulseCreateInput` and `PulseUpdateInput`, and `REVISION_ENTITY_GATES` (`measure`, `transform`, `transform-test`) on `RevisionRevertInput.entity`. A server lacking the feature is refused or explained the way its method's own requirement is.
|
|
439
439
|
|
|
440
|
-
|
|
440
|
+
A resource whose wire shape differs between generations exports from its `@metabase/client/domain/<r>` module, beside the canonical schema, a reader that picks the exact schema for a `Features` and converts forward: `transformDetailSchema(features)` and `transformRowSchema(features)` read a `Transform` (the older generations' hydrated `table` on the detail endpoint, and no link on the rest, become `target_table_id`, and a Python source's `source-tables` keyed by alias becomes the list of `TransformSourceTableEntry`, whose `database_id`, `schema` and `table` are `null` for a table named by id alone; `transform.create`, `transform.update` and `transformPython.testRun` send the list back keyed by alias to such a server, `transformSourceBody(source, features)` and `pythonTestRunBody(params, features)` being the writers), `fieldDetailSchema(features)` reads a `FieldDetail`, which is a `FieldWithDataSensitivity` (its `data_sensitivity` `null` for an unlabelled field) on a generation with the label and a plain `Field` without the key elsewhere, told apart by `hasDataSensitivity`, `fieldRemappedValueSchema(features, sameField)` reads a `FieldRemappedValue` from the first cells of a row a generation pads with display columns, `transformJobSchema(features)` reads a `TransformJob` whose `active` is `null` on a generation that cannot switch jobs off, `transformJobRunResultSchema(features)` reads a `TransformJobRunResult` (`{ message, started, run_id }` — a stub id is `started: null, run_id: null`, the request accepted and the outcome unsaid; a numeric or null id is `started: id !== null, run_id: id`), and `libraryWireSchema(features)` with `toLibrary(wire, listing)` reads a `Library` whose `LibraryChild` entries carry `type` from the wire where the generation sends it and `is_remote_synced` from the collection listing on every generation (`LibraryCollectionInfo`, `LibraryListing`). Each `null` in a canonical field means "this server cannot say". `ResponseShapeError.developerDetail.serverSkew` carries the profile's `skew`, and a `newer-than-known` server is named as such in the message's lead line.
|
|
441
|
+
|
|
442
|
+
Types: `ServerInfo`, `ServerProfile`, `ServerVersion`, `ReleaseVersion`, `DevelopmentBuild`, `Skew`, `Edition`, `FeatureName`, `FeatureRule`, `RuleMajor`, `Features`, `FeatureGap`, `VersionGap`, `TokenGap`, `MethodKey`, `RequirementFailure`, `RequirementReason`, `InputGate`, `GateEffect`, `GateTrigger`, `PresentTrigger`, `ValuesTrigger`, `NonEmptyTrigger`.
|
|
441
443
|
|
|
442
444
|
### Resource schemas
|
|
443
445
|
|
|
@@ -472,7 +474,7 @@ dependency graph's `DependencyFindingError`, the entity relationship diagram's `
|
|
|
472
474
|
Request bodies (`<Resource>CreateInput`, `<Resource>UpdateInput`, and `MetricDefinition`, the expression
|
|
473
475
|
over metric and measure leaves that `metric.query` and `metric.breakoutValues` run) and the domain vocabulary enums
|
|
474
476
|
(`FieldBaseType`, `SearchModel`, `CollectionItemModel`, …) live in the same modules and are reached
|
|
475
|
-
at `@metabase/client/domain/<resource>`.
|
|
477
|
+
at `@metabase/client/domain/<resource>`. `DashboardCreateInput` holds only the fields `POST /api/dashboard` reads and refuses any other key, so a dashboard's layout (`dashcards`, `tabs`) is a `DashboardLayoutInput`, sent through `dashboard.update` once the dashboard exists.
|
|
476
478
|
|
|
477
479
|
### Utilities
|
|
478
480
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/domain/api-key.d.ts
|
|
3
|
+
declare const ApiKey: z.ZodObject<{
|
|
4
|
+
id: z.ZodNumber;
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
masked_key: z.ZodString;
|
|
7
|
+
group: z.ZodObject<{
|
|
8
|
+
id: z.ZodNumber;
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
}, z.core.$loose>;
|
|
11
|
+
created_at: z.ZodString;
|
|
12
|
+
updated_at: z.ZodString;
|
|
13
|
+
}, z.core.$loose>;
|
|
14
|
+
type ApiKey = z.infer<typeof ApiKey>;
|
|
15
|
+
declare const ApiKeyCompact: z.ZodObject<{
|
|
16
|
+
id: z.ZodNumber;
|
|
17
|
+
name: z.ZodString;
|
|
18
|
+
masked_key: z.ZodString;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
type ApiKeyCompact = z.infer<typeof ApiKeyCompact>;
|
|
21
|
+
declare const CreatedApiKey: z.ZodObject<{
|
|
22
|
+
id: z.ZodNumber;
|
|
23
|
+
name: z.ZodString;
|
|
24
|
+
masked_key: z.ZodString;
|
|
25
|
+
group: z.ZodObject<{
|
|
26
|
+
id: z.ZodNumber;
|
|
27
|
+
name: z.ZodString;
|
|
28
|
+
}, z.core.$loose>;
|
|
29
|
+
created_at: z.ZodString;
|
|
30
|
+
updated_at: z.ZodString;
|
|
31
|
+
unmasked_key: z.ZodString;
|
|
32
|
+
}, z.core.$loose>;
|
|
33
|
+
type CreatedApiKey = z.infer<typeof CreatedApiKey>;
|
|
34
|
+
declare const CreatedApiKeyCompact: z.ZodObject<{
|
|
35
|
+
id: z.ZodNumber;
|
|
36
|
+
name: z.ZodString;
|
|
37
|
+
unmasked_key: z.ZodString;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
type CreatedApiKeyCompact = z.infer<typeof CreatedApiKeyCompact>;
|
|
40
|
+
declare const ApiKeyCreateInput: z.ZodObject<{
|
|
41
|
+
name: z.ZodString;
|
|
42
|
+
group_id: z.ZodNumber;
|
|
43
|
+
}, z.core.$strict>;
|
|
44
|
+
type ApiKeyCreateInput = z.infer<typeof ApiKeyCreateInput>;
|
|
45
|
+
//#endregion
|
|
46
|
+
export { CreatedApiKeyCompact as a, CreatedApiKey as i, ApiKeyCompact as n, ApiKeyCreateInput as r, ApiKey as t };
|
|
@@ -2,14 +2,14 @@ import { z } from "zod";
|
|
|
2
2
|
//#region src/domain/card.d.ts
|
|
3
3
|
declare const CardType: z.ZodEnum<{
|
|
4
4
|
metric: "metric";
|
|
5
|
-
question: "question";
|
|
6
5
|
model: "model";
|
|
6
|
+
question: "question";
|
|
7
7
|
}>;
|
|
8
8
|
type CardType = z.infer<typeof CardType>;
|
|
9
9
|
declare const CardListFilter: z.ZodEnum<{
|
|
10
|
+
archived: "archived";
|
|
10
11
|
database: "database";
|
|
11
12
|
table: "table";
|
|
12
|
-
archived: "archived";
|
|
13
13
|
all: "all";
|
|
14
14
|
mine: "mine";
|
|
15
15
|
bookmarked: "bookmarked";
|
|
@@ -279,8 +279,8 @@ declare const Card: z.ZodObject<{
|
|
|
279
279
|
name: z.ZodString;
|
|
280
280
|
type: z.ZodEnum<{
|
|
281
281
|
metric: "metric";
|
|
282
|
-
question: "question";
|
|
283
282
|
model: "model";
|
|
283
|
+
question: "question";
|
|
284
284
|
}>;
|
|
285
285
|
display: z.ZodString;
|
|
286
286
|
description: z.ZodNullable<z.ZodString>;
|
|
@@ -321,8 +321,8 @@ declare const CardDetail: z.ZodObject<{
|
|
|
321
321
|
name: z.ZodString;
|
|
322
322
|
type: z.ZodEnum<{
|
|
323
323
|
metric: "metric";
|
|
324
|
-
question: "question";
|
|
325
324
|
model: "model";
|
|
325
|
+
question: "question";
|
|
326
326
|
}>;
|
|
327
327
|
display: z.ZodString;
|
|
328
328
|
description: z.ZodNullable<z.ZodString>;
|
|
@@ -699,16 +699,16 @@ type CardDetail = z.infer<typeof CardDetail>;
|
|
|
699
699
|
declare const CardCompact: z.ZodObject<{
|
|
700
700
|
type: z.ZodEnum<{
|
|
701
701
|
metric: "metric";
|
|
702
|
-
question: "question";
|
|
703
702
|
model: "model";
|
|
703
|
+
question: "question";
|
|
704
704
|
}>;
|
|
705
|
-
name: z.ZodString;
|
|
706
|
-
database_id: z.ZodNullable<z.ZodNumber>;
|
|
707
705
|
id: z.ZodNumber;
|
|
708
|
-
|
|
706
|
+
name: z.ZodString;
|
|
709
707
|
description: z.ZodNullable<z.ZodString>;
|
|
710
708
|
archived: z.ZodBoolean;
|
|
709
|
+
collection_id: z.ZodNullable<z.ZodNumber>;
|
|
711
710
|
display: z.ZodString;
|
|
711
|
+
database_id: z.ZodNullable<z.ZodNumber>;
|
|
712
712
|
dashboard_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
713
713
|
}, z.core.$strip>;
|
|
714
714
|
type CardCompact = z.infer<typeof CardCompact>;
|
|
@@ -716,8 +716,8 @@ declare const CardCreateInput: z.ZodObject<{
|
|
|
716
716
|
name: z.ZodString;
|
|
717
717
|
type: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
718
718
|
metric: "metric";
|
|
719
|
-
question: "question";
|
|
720
719
|
model: "model";
|
|
720
|
+
question: "question";
|
|
721
721
|
}>>>;
|
|
722
722
|
dataset_query: z.ZodObject<{}, z.core.$loose>;
|
|
723
723
|
display: z.ZodString;
|
|
@@ -827,8 +827,8 @@ declare const CardUpdateInput: z.ZodObject<{
|
|
|
827
827
|
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
828
828
|
type: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
829
829
|
metric: "metric";
|
|
830
|
-
question: "question";
|
|
831
830
|
model: "model";
|
|
831
|
+
question: "question";
|
|
832
832
|
}>>>;
|
|
833
833
|
dataset_query: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
834
834
|
display: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -838,8 +838,8 @@ declare const CardUpdateInput: z.ZodObject<{
|
|
|
838
838
|
enable_embedding: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
839
839
|
embedding_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
840
840
|
embedding_params: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
841
|
-
disabled: "disabled";
|
|
842
841
|
enabled: "enabled";
|
|
842
|
+
disabled: "disabled";
|
|
843
843
|
locked: "locked";
|
|
844
844
|
}>>>>;
|
|
845
845
|
collection_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as QueryMetadata } from "./dataset-C6lX1-cr.js";
|
|
3
|
-
import { n as ExportFormat } from "./query-Xsin530u.js";
|
|
4
|
-
import { f as RequestOptions, h as Transport } from "./transport-E0ZaPNWJ.js";
|
|
1
|
+
import { f as RequestOptions, h as Transport } from "./transport-BsXqRujn.js";
|
|
5
2
|
import { t as ListResult } from "./list-BT_bBm9Z.js";
|
|
3
|
+
import { a as CardListFilter, i as CardDetail, l as CardUpdateInput, o as CardQueryResult, r as CardCreateInput, t as Card } from "./card-BxBzr5Uj.js";
|
|
4
|
+
import { r as QueryMetadata } from "./dataset-BBNGPVec.js";
|
|
5
|
+
import { n as ExportFormat } from "./query-Xsin530u.js";
|
|
6
6
|
//#region src/resources/card.d.ts
|
|
7
7
|
interface CardListParams {
|
|
8
8
|
f?: CardListFilter | undefined;
|