@stamhoofd/metabase 2.152.0 → 2.160.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/LICENSE.md +7 -7
  2. package/README.md +113 -33
  3. package/dist/api.js +32 -17
  4. package/dist/api.js.map +1 -1
  5. package/dist/report.js +197 -44
  6. package/dist/report.js.map +1 -1
  7. package/dist/sync-report.js +181 -49
  8. package/dist/sync-report.js.map +1 -1
  9. package/dist-types/api.d.ts.map +1 -0
  10. package/{dist → dist-types}/report.d.ts +70 -15
  11. package/dist-types/report.d.ts.map +1 -0
  12. package/{dist → dist-types}/sync-report.d.ts +5 -1
  13. package/dist-types/sync-report.d.ts.map +1 -0
  14. package/package.json +40 -32
  15. package/report/eenheden.sql +31 -0
  16. package/report/gtp.sql +80 -0
  17. package/report/includes/all-non-platform-registrations-all-years.sql +19 -1
  18. package/report/includes/all-registrations.sql +8 -1
  19. package/report/includes/deduplicated-non-platform-registrations-all-years.sql +1 -0
  20. package/report/includes/deduplicated-non-platform-registrations.sql +2 -1
  21. package/report/includes/filter-registration-types.sql +20 -2
  22. package/report/includes/keeo/participant-counts.sql +4 -0
  23. package/report/includes/keeo/participant-detail-columns.sql +2 -0
  24. package/report/includes/keeo/participant-details.sql +2 -0
  25. package/report/includes/keeo/participant-subgroup.sql +6 -0
  26. package/report/includes/keeo/participant-type.sql +8 -0
  27. package/report/includes/participant-counts.sql +2 -0
  28. package/report/includes/participant-detail-columns.sql +2 -0
  29. package/report/includes/participant-details.sql +3 -0
  30. package/report/includes/participant-subgroup.sql +2 -0
  31. package/report/includes/uldk-zonder-geslacht.sql +11 -0
  32. package/report/jeugdbewegingen.sql +93 -22
  33. package/report/nationaal.sql +2 -0
  34. package/report/varia.sql +31 -0
  35. package/dist/api.d.ts.map +0 -1
  36. package/dist/report.d.ts.map +0 -1
  37. package/dist/sync-report.d.ts.map +0 -1
  38. /package/{dist → dist-types}/api.d.ts +0 -0
  39. /package/{dist → dist-types}/naming.d.ts +0 -0
  40. /package/{dist → dist-types}/naming.d.ts.map +0 -0
package/LICENSE.md CHANGED
@@ -5,25 +5,25 @@ Copyright 2020 Codawood BV
5
5
  Permission is hereby granted, free of charge, to any non-profit organization with fewer than 2,000 members (each, a “Licensee”), to use this software and associated documentation files (the “Software”), subject to the following conditions:
6
6
 
7
7
  1. Eligibility:
8
- This license applies only if neither the Licensee nor, if applicable, its parent or umbrella organization, is already subject to an existing license for this project. For the purposes of this license, a “parent or umbrella organization” means any organization with which the Licensee is affiliated, coordinated, or represented as part of a larger collective, including but not limited to national associations or federations.
8
+ This license applies only if neither the Licensee nor, if applicable, its parent or umbrella organization, is already subject to an existing license for this project. For the purposes of this license, a “parent or umbrella organization” means any organization with which the Licensee is affiliated, coordinated, or represented as part of a larger collective, including but not limited to national associations or federations.
9
9
 
10
10
  2. Modifications:
11
- Modifications to the Software are permitted only if they are published publicly under the MIT License, covering only the modifications; the original Software remains under this license and may not be sublicensed without a separate agreement. Any modification made by a Licensee (other than modifications by the original author, its representatives, or the copyright owner) shall be deemed to be distributed under the MIT License. Submission of modifications through publicly accessible channels, including but not limited to pull requests on code repositories such as GitHub, shall be considered an explicit acknowledgment and grant by the Licensee that such modifications are made available under the MIT License. Licensees may not sublicense, transfer, or assign the rights granted under this license except as expressly permitted herein.
11
+ Modifications to the Software are permitted only if they are published publicly under the MIT License, covering only the modifications; the original Software remains under this license and may not be sublicensed without a separate agreement. Any modification made by a Licensee (other than modifications by the original author, its representatives, or the copyright owner) shall be deemed to be distributed under the MIT License. Submission of modifications through publicly accessible channels, including but not limited to pull requests on code repositories such as GitHub, shall be considered an explicit acknowledgment and grant by the Licensee that such modifications are made available under the MIT License. Licensees may not sublicense, transfer, or assign the rights granted under this license except as expressly permitted herein.
12
12
 
13
13
  3. Precedence of Existing Licenses:
14
- If the Licensee, or its parent or umbrella organization, is already subject to an existing license for this project, that license shall take precedence, and no additional free license is granted. Nothing in this license shall be construed to override any pre-existing exclusive license agreement.
14
+ If the Licensee, or its parent or umbrella organization, is already subject to an existing license for this project, that license shall take precedence, and no additional free license is granted. Nothing in this license shall be construed to override any pre-existing exclusive license agreement.
15
15
 
16
16
  4. Data Protection / GDPR Responsibility:
17
- Licensees are solely responsible for ensuring that any processing of personal data using this software complies with applicable data protection laws, including the EU General Data Protection Regulation (GDPR).
17
+ Licensees are solely responsible for ensuring that any processing of personal data using this software complies with applicable data protection laws, including the EU General Data Protection Regulation (GDPR).
18
18
 
19
19
  5. Termination and Revocation:
20
- The copyright holders may revoke this license at any time, at their sole discretion.
20
+ The copyright holders may revoke this license at any time, at their sole discretion.
21
21
 
22
22
  6. Governing Law:
23
- This license shall be governed by and construed in accordance with the laws of Belgium, without regard to conflict of law principles.
23
+ This license shall be governed by and construed in accordance with the laws of Belgium, without regard to conflict of law principles.
24
24
 
25
25
  7. Third-Party Licenses:
26
- Certain files or components included in the Software may be governed by separate licenses, including open-source licenses, or contributed by third parties under different terms. Such files are not automatically covered by this license. Licensees are responsible for reviewing and complying with any additional license terms that apply to these files.
26
+ Certain files or components included in the Software may be governed by separate licenses, including open-source licenses, or contributed by third parties under different terms. Such files are not automatically covered by this license. Licensees are responsible for reviewing and complying with any additional license terms that apply to these files.
27
27
 
28
28
  For the purposes of this license, a “non-profit organization” means an entity recognized as non-profit under applicable law in its jurisdiction, which does not distribute profits to its members or owners.
29
29
 
package/README.md CHANGED
@@ -2,22 +2,22 @@
2
2
 
3
3
  Everything that configures Metabase: the ledenstatistieken report and the API client that writes it.
4
4
 
5
- | | |
6
- |---|---|
7
- | `report/*.sql` | The report, one file per tab, as queries on the platform statistics database |
8
- | `src/report.ts` | Reads those files. Knows nothing about Metabase |
9
- | `src/api.ts` | Minimal client for the Metabase HTTP API |
10
- | `src/sync-report.ts` | Says the report in Metabase's vocabulary and writes it |
11
- | `src/naming.ts` | What things are called in Metabase, so every caller agrees |
5
+ | | |
6
+ | -------------------- | ---------------------------------------------------------------------------- |
7
+ | `report/*.sql` | The report, one file per tab, as queries on the platform statistics database |
8
+ | `src/report.ts` | Reads those files. Knows nothing about Metabase |
9
+ | `src/api.ts` | Minimal client for the Metabase HTTP API |
10
+ | `src/sync-report.ts` | Says the report in Metabase's vocabulary and writes it |
11
+ | `src/naming.ts` | What things are called in Metabase, so every caller agrees |
12
12
 
13
13
  ## What the report counts
14
14
 
15
15
  Two fragments decide that, and every card opens on one of them:
16
16
 
17
- | | |
18
- |---|---|
19
- | `includes/all-non-platform-registrations.sql` | one row per registration: who was registered where, in which leeftijdsgroep, in which year |
20
- | `includes/deduplicated-non-platform-registrations.sql` | that narrowed to one row per member per eenheid, carrying what they are |
17
+ | | |
18
+ | ------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
19
+ | `includes/all-non-platform-registrations.sql` | one row per registration: who was registered where, in which leeftijdsgroep, in which year |
20
+ | `includes/deduplicated-non-platform-registrations.sql` | that narrowed to one row per member per eenheid, carrying what they are |
21
21
 
22
22
  Each fragment is a complete query. It states its own dependencies -- `deduplicated-non-platform-registrations` opens a `WITH` on
23
23
  `all-non-platform-registrations`, which opens one on `all-registrations` -- so whoever reads one
@@ -27,6 +27,10 @@ learns what it is built from. It also means every fragment runs as it stands: pa
27
27
  how a figure is investigated apart from the aggregates the cards draw over it.
28
28
  `includes/deduplicated-non-platform-registrations-all-years.sql` is the same over every werkjaar at once -- the year filter does not
29
29
  reach it, which is what the trend cards read; a test keeps its ranking identical to the single-year fragment's.
30
+ A card that only needs the last few werkjaren gives `aantal_werkjaren` a number (`-- defaults: aantal_werkjaren = 3`):
31
+ that switches on an optional clause in `all-non-platform-registrations-all-years` which keeps the chosen werkjaar and
32
+ the ones before it, before the ranking runs. Filtering the result afterwards reads the same rows but builds every
33
+ werkjaar first, which is as slow as the platform has years.
30
34
 
31
35
  A fragment that is a condition rather than a query -- which aansluitingen count, which kinds of
32
36
  registration count -- carries a `filter-` prefix and is a bare predicate: the query that includes it
@@ -38,21 +42,32 @@ The ledenstatistieken count members, not registrations, so every card of that da
38
42
  and none reads the registrations directly. Someone registered in two leeftijdsgroepen of the same eenheid holds
39
43
  two registrations, and counted there they land in two bars of the same chart, or -- if they are leiding in one
40
44
  leeftijdsgroep and lid in the other -- on both sides of the omkaderingscijfer at once. That fragment picks the one
41
- registration that speaks for them: leiding beats lid, and the oldest leeftijdsgroep wins between two.
45
+ registration that speaks for them: a leeftijdsgroep beats an activiteit, one that still stands beats
46
+ one that was cancelled, leiding beats lid, and the oldest leeftijdsgroep wins between two. The
47
+ leeftijdsgroep comes first because an activiteit says where someone went, not what they are: a lid who
48
+ left their leeftijdsgroep in november and joined a kamp afterwards is still counted in the
49
+ leeftijdsgroep they were a lid of.
42
50
 
43
51
  The aanlevering is the exception and keeps reading its own rows. The department counts inschrijvingen
44
52
  rather than inschrijvers, and reads what a member is from the cancelled registrations as well, so
45
53
  `jeugdbewegingen.sql` decides it in its own `deelnemers`.
46
54
 
47
55
  Which registrations reach either of those is `includes/filter-registration-types.sql`: a registration
48
- stands in a leeftijdsgroep, an activiteit or a wachtlijst, and only the first two count as being a
49
- lid -- counting the wachtlijsten would put the people waiting for a place among the leden. The
50
- aanlevering pins itself further to the leeftijdsgroepen alone in `jeugdbewegingen.sql`.
56
+ stands in a leeftijdsgroep, an activiteit or a wachtlijst. A leeftijdsgroep makes someone a lid of
57
+ that eenheid, a wachtlijst makes them nobody's -- counting those would put the people waiting for a
58
+ place among the leden -- and an activiteit counts only for whoever is in no leeftijdsgroep that
59
+ werkjaar. Only for them, because a lid of one eenheid who joins the kamp of another was counted at
60
+ both: once through their leeftijdsgroep and once through the activiteit, the second time among that
61
+ eenheid's kinderen, where it moved its omkaderingscijfer and GTP index as well as its ledenaantal.
62
+ Whoever still counts through an activiteit is in no leeftijdsgroep, so `all-registrations` names them
63
+ `Activiteit` rather than naming the kamp: the charts that draw the leden per leeftijdsgroep group on
64
+ that column, and a kamp would stand among the takken there. The aanlevering pins itself further to the
65
+ leeftijdsgroepen alone in `jeugdbewegingen.sql`.
51
66
 
52
67
  ## One definition, in Metabase too
53
68
 
54
69
  `@include` puts a fragment in one place in git. Snippets put it in one place in Metabase: every
55
- `includes/*.sql` is written as a snippet of its own, and a question refers to it -- `{{snippet: deduplicated-non-platform-registrations}}`
70
+ fragment a question refers to is written as a snippet of its own, and a question refers to it -- `{{snippet: deduplicated-non-platform-registrations}}`
56
71
  where the file says `-- @include deduplicated-non-platform-registrations`, with it referring to
57
72
  `{{snippet: all-non-platform-registrations}}` rather than holding a second copy of those rows. A card is then the handful of lines that say what it counts
58
73
  instead of the two hundred that say what a lid is, and whoever changes what a lid is changes it once
@@ -74,6 +89,14 @@ The fragments are still expanded as well. `card.sql` is the whole query, which i
74
89
  and what says whether the sql itself is right; `card.snippetSql` is that query with the fragments left
75
90
  as references, and is what Metabase is given.
76
91
 
92
+ `-- @inline <name>` is the other way to read the same file: it is written out where it stands in both,
93
+ so Metabase is given the sql rather than a reference, and no snippet is offered for it. It is for a
94
+ fragment that exists only so an environment can say a piece of a query its own way -- the kenmerken a
95
+ sheet splits its rijen into, the kolomnamen it groups them on -- where a snippet would stand in the
96
+ sidebar as a piece of syntax nobody would open, with nothing referring to it. An inlined fragment reads no fragment of its own: written
97
+ out, a nested `{{snippet: ...}}` would reach Metabase against tags the question never declared, and
98
+ it is refused rather than left to fail there.
99
+
77
100
  ## One report, several platforms
78
101
 
79
102
  The same report is written for every platform, and they do not all count every figure the same way:
@@ -81,14 +104,57 @@ the GTP index weighs leeftijdsgroepen for keeo and the age of a lid for ravot, w
81
104
  half. A statistics database holds one platform, so which variant a card gets is decided while the
82
105
  report is loaded — `loadReport(env)` takes the environment, the same name the data source carries.
83
106
 
84
- | | |
85
- |---|---|
107
+ | | |
108
+ | ------------------------------- | -------------------------------------------------- |
86
109
  | `report/includes/<env>/gtp.sql` | what `@include gtp` expands to in that environment |
87
- | `-- description@ravot:` | what a card's `-- description:` says there |
88
-
89
- A card names neither and keeps saying `@include gtp`, which is what keeps one report from quietly
90
- becoming two. An override of a name no fragment carries is refused rather than ignored: nothing
91
- includes it, so a misspelled file would change nothing and say nothing.
110
+ | `-- description@ravot:` | what a card's `-- description:` says there |
111
+ | `-- except: keeo` | the tab or card is not written there at all |
112
+ | `-- only: keeo` | the card is written there and nowhere else |
113
+
114
+ A card names the first two and keeps saying `@include gtp`, which is what keeps one report from
115
+ quietly becoming two. An override of a name no fragment carries is refused rather than ignored:
116
+ nothing includes it, so a misspelled file would change nothing and say nothing.
117
+
118
+ `except` is the one that leaves something out rather than saying it differently, for the figure a
119
+ platform records nothing about. Keeo no longer asks its leden for a geslacht, so the seven cards that
120
+ split on one are not written there. A card left alone on a row by this takes the row:
121
+ `-- size@keeo: full` on the lidgeldverdeling of the eenheden page and on the
122
+ leeftijdsgroepenvergelijking of the nationale page, each of which stood beside a geslachtenverdeling.
123
+
124
+ Where the figure is worth reading without the split, it is drawn two ways rather than dropped. A card
125
+ cannot be two shapes, so it is two cards, and `only` is what keeps them from both being written:
126
+
127
+ | | drawn everywhere but keeo | drawn there |
128
+ | ------------------------------------- | ------------------------------ | ----------------------------------------------------- |
129
+ | de leeftijdsverdeling van een eenheid | `eenheid-leeftijd-en-geslacht` | `eenheid-leden-per-leeftijd` |
130
+ | de ULDK-tabel en haar totalen | `uldk`, `uldk-totaal` | `uldk-zonder-geslacht`, `uldk-zonder-geslacht-totaal` |
131
+ | het deelnemerstabblad van de koepel | `deelnemers-bovenlokaal` | `deelnemers-bovenlokaal-werk-en-projectgroepen` |
132
+
133
+ `except: keeo` on the first and `only: keeo` on the second, which is the whole of the pairing:
134
+ `except` on both would hand a platform naming neither of them both shapes of one figure. The ULDK
135
+ pair says why that matters — both tables are titled `ULDK`, as the page names them, so a platform
136
+ given the two would store them as one question. Two cards of a tab may share a title exactly because
137
+ no environment writes both, and that is checked per environment rather than over the file.
138
+
139
+ The aanlevering follows, and is where this cannot be said with `except`: a sheet has to be delivered
140
+ whole, so the column goes rather than the card. `includes/participant-details.sql` is the kenmerken a
141
+ deelnemerstabblad splits its rijen into and `includes/participant-detail-columns.sql` the same ones
142
+ as the names it groups and orders on — keeo's variants of the two name the geboortejaar alone. Both
143
+ are read by both deelnemerstabbladen, and a test keeps them naming the same kenmerken: a column
144
+ selected but not grouped on is a sheet that refuses to run. Both are inlined: what they hold is the
145
+ columns of one sheet rather than a definition the report counts by, and neither is read anywhere but
146
+ in the deelnemerstabbladen.
147
+
148
+ Not grouping on it is the point rather than a consequence. A werkjaar imported from the client's own
149
+ statistics still has the answer on file, so a sheet that kept the column would deliver those years
150
+ split into more rows than the years after them. The rows the CTEs are built from still carry the
151
+ `Geslacht` — they are the registrations as they stand, and every other page reads them — but nothing
152
+ in the sheet reads it.
153
+
154
+ What an environment leaves out is still read once, by `loadRetiredReport(env)`. A question is stored
155
+ in Metabase under its card and its tab, so the questions of a card that stopped being written are
156
+ only recognisable from the report that no longer holds it — and without them they would be archived
157
+ as something the client wrote themselves, which is to say not at all.
92
158
 
93
159
  ## What a leeftijdsgroep counts as
94
160
 
@@ -113,9 +179,11 @@ Ravot's list is the one to read before changing either. Its ondersteunende leden
113
179
  may not be categorised as leiding: the omkaderingscijfer and the GTP index would then count them as
114
180
  leiding the kinderen of an eenheid are looked after by. The aanlevering delivers them among the
115
181
  leiding anyway — the department has no third word for them — by naming the leeftijdsgroep itself in
116
- `ravot/type-deelnemers.sql`, which only works for as long as the category does not say it.
182
+ `ravot/participant-type.sql`, which only works for as long as the category does not say it. Keeo
183
+ names two there: its stam is delivered among the leden and its ondersteunende leden among the
184
+ leiding, and both stay volwassenen everywhere else.
117
185
 
118
- Standing in front of the reader only holds until the next `yarn metabase report`, which rewrites every
186
+ Standing in front of the reader only holds until the next `yarn metabase report` in the separate devops project, which rewrites every
119
187
  card from these files — an edit made in Metabase is a correction to bring back here, not a place to
120
188
  keep one.
121
189
 
@@ -125,7 +193,19 @@ delivery template: tables to download as .xlsx and paste into it rather than cha
125
193
  a `dashboard:` of its own, which writes it as a second dashboard in the collection instead of as a
126
194
  page of the ledenstatistieken. That is also why those cards name their columns -- Metabase writes the
127
195
  header of an export from the column's title, and a sheet read by a government department has to keep
128
- the names the template gives it.
196
+ the names the template gives it. A figure the koepel wants out of the same sheet for itself stands
197
+ behind those, in a column the template has no cell for: keeo reads how many of a row are the stam
198
+ and the ondersteunende leden it delivers among the leden and the leiding.
199
+
200
+ Not every ploeg of a koepel is a structuurvrijwilliger of it, and that is the third pair above: the
201
+ deelnemerstabblad of the koepel is written once for keeo and once for everyone else, so neither card
202
+ carries the other's conditions. Keeo's names its werkgroepen and projectgroepen, and its losse leden
203
+ beside them, and leaves out its personeel even where that sits in a werkgroep as well -- a fact of the
204
+ member rather than of the inschrijving being read. Named rather than read off the categories they are
205
+ filed under, because nothing here knows those: a category lives as json on the unit's registration
206
+ period and the statistics database holds no such thing. So the list is the whole answer, like the
207
+ takken above it -- a ploeg it does not name delivers nobody, and one that is renamed or added in the
208
+ administration has to be renamed or added here too.
129
209
 
130
210
  The koepel's own organization is treated the other way around by the two. The ledenstatistieken leave
131
211
  it out by default -- it is the national body, not an eenheid, and the client's own report normally
@@ -140,15 +220,15 @@ koepel under that same id, so both hold in the years imported from the client's
140
220
  well as in the years the sync owns.
141
221
 
142
222
  Installing Metabase differs per environment — Docker locally (`stam platform-report start`), a jar
143
- under systemd on a server (`yarn metabase install` in devops) — but configuring it is the same HTTP
223
+ under systemd on a server (`yarn metabase install` in the separate devops project) — but configuring it is the same HTTP
144
224
  calls either way. That is why this package holds no install logic and no credentials: a caller passes the
145
225
  base URL, the credentials and the data source to write against.
146
226
 
147
- | | Local | Server |
148
- |---|---|---|
149
- | Written by | `stam platform-report dashboards` | `yarn metabase report -s keeo/keeo-metabase-001` |
150
- | Authenticates with | the admin account the CLI created | an api key from 1Password |
151
- | Data source | registered by the CLI | added once by hand, looked up by name |
227
+ | | Local | Server |
228
+ | ------------------ | --------------------------------- | ------------------------------------------------------------------------------- |
229
+ | Written by | `stam platform-report dashboards` | `yarn metabase report -s keeo/keeo-metabase-001` in the separate devops project |
230
+ | Authenticates with | the admin account the CLI created | an api key from 1Password |
231
+ | Data source | registered by the CLI | added once by hand, looked up by name |
152
232
 
153
233
  Nothing this writes carries the name of a platform: the collection is `Ledenstatistieken` and holds
154
234
  the dashboards `Ledenstatistieken` and `Aanlevering ...`, whichever platform they count. A server
@@ -173,5 +253,5 @@ and filters — and never run a card. A column renamed in the statistics migrati
173
253
  in Metabase rather than here.
174
254
 
175
255
  ```bash
176
- yarn stam test metabase
256
+ pnpm stam test metabase
177
257
  ```
package/dist/api.js CHANGED
@@ -95,7 +95,8 @@ export class MetabaseApi {
95
95
  user = await this.currentUser();
96
96
  }
97
97
  catch (error) {
98
- if (error instanceof MetabaseApiError && (error.status === 401 || error.status === 403)) {
98
+ if (error instanceof MetabaseApiError &&
99
+ (error.status === 401 || error.status === 403)) {
99
100
  throw new Error(`${this.baseUrl} rejected the api key. Create a new one under Admin > Settings > Authentication > API keys and update it in 1Password.`, { cause: error });
100
101
  }
101
102
  throw error;
@@ -110,7 +111,7 @@ export class MetabaseApi {
110
111
  return Array.isArray(result) ? result : result.data;
111
112
  }
112
113
  async findDatabaseByName(name) {
113
- return (await this.listDatabases()).find(database => database.name === name);
114
+ return (await this.listDatabases()).find((database) => database.name === name);
114
115
  }
115
116
  /**
116
117
  * The registered database to write questions against, which has to be there already.
@@ -121,7 +122,7 @@ export class MetabaseApi {
121
122
  async requireDatabaseByName(name) {
122
123
  const match = await this.findDatabaseByName(name);
123
124
  if (!match) {
124
- const known = (await this.listDatabases()).map(database => database.name);
125
+ const known = (await this.listDatabases()).map((database) => database.name);
125
126
  throw new Error(`${this.baseUrl} has no data source named "${name}"${known.length > 0 ? `, only: ${known.join(', ')}` : ''}. Add it under Admin > Databases first.`);
126
127
  }
127
128
  return match;
@@ -170,15 +171,15 @@ export class MetabaseApi {
170
171
  const hidden = [];
171
172
  for (;;) {
172
173
  const metadata = await this.request('GET', `/api/database/${databaseId}/metadata?include_hidden=true`);
173
- const tables = (metadata.tables ?? []).filter(table => names.includes(table.name));
174
- for (const table of tables.filter(table => table.visibility_type !== 'hidden')) {
174
+ const tables = (metadata.tables ?? []).filter((table) => names.includes(table.name));
175
+ for (const table of tables.filter((table) => table.visibility_type !== 'hidden')) {
175
176
  await this.request('PUT', `/api/table/${table.id}`, { visibility_type: 'hidden' });
176
177
  hidden.push(table.name);
177
178
  }
178
179
  if (tables.length === names.length || Date.now() >= deadline) {
179
180
  return hidden;
180
181
  }
181
- await new Promise(resolve => setTimeout(resolve, 2_000));
182
+ await new Promise((resolve) => setTimeout(resolve, 2_000));
182
183
  }
183
184
  }
184
185
  /**
@@ -187,7 +188,7 @@ export class MetabaseApi {
187
188
  * than by name, which is the only thing Metabase guarantees about it.
188
189
  */
189
190
  async removeSampleDatabase() {
190
- const sample = (await this.listDatabases()).find(database => database.is_sample === true);
191
+ const sample = (await this.listDatabases()).find((database) => database.is_sample === true);
191
192
  if (!sample) {
192
193
  return { removed: false };
193
194
  }
@@ -196,18 +197,21 @@ export class MetabaseApi {
196
197
  }
197
198
  async listCollections() {
198
199
  const collections = await this.request('GET', '/api/collection');
199
- return collections.filter(collection => collection.archived !== true);
200
+ return collections.filter((collection) => collection.archived !== true);
200
201
  }
201
202
  /**
202
203
  * The collection the report lives in, created if it is not there yet. Everything the CLI writes
203
204
  * goes in one collection so it stays apart from whatever the client builds themselves.
204
205
  */
205
206
  async ensureCollection(name) {
206
- const match = (await this.listCollections()).find(collection => collection.name === name);
207
+ const match = (await this.listCollections()).find((collection) => collection.name === name);
207
208
  if (match) {
208
209
  return { id: match.id, created: false };
209
210
  }
210
- const created = await this.request('POST', '/api/collection', { name, parent_id: null });
211
+ const created = await this.request('POST', '/api/collection', {
212
+ name,
213
+ parent_id: null,
214
+ });
211
215
  return { id: created.id, created: true };
212
216
  }
213
217
  /**
@@ -237,20 +241,27 @@ export class MetabaseApi {
237
241
  * would otherwise keep showing words the report stopped saying.
238
242
  */
239
243
  async saveSnippet(input, existingId) {
240
- const body = { name: input.name, content: input.content, description: input.description ?? null };
244
+ const body = {
245
+ name: input.name,
246
+ content: input.content,
247
+ description: input.description ?? null,
248
+ };
241
249
  if (existingId !== undefined) {
242
- await this.request('PUT', `/api/native-query-snippet/${existingId}`, { ...body, archived: false });
250
+ await this.request('PUT', `/api/native-query-snippet/${existingId}`, {
251
+ ...body,
252
+ archived: false,
253
+ });
243
254
  return existingId;
244
255
  }
245
256
  return (await this.request('POST', '/api/native-query-snippet', body)).id;
246
257
  }
247
258
  async listCards(collectionId) {
248
259
  const items = await this.request('GET', `/api/collection/${collectionId}/items?models=card`);
249
- return (items.data ?? []).map(item => ({ id: item.id, name: item.name }));
260
+ return (items.data ?? []).map((item) => ({ id: item.id, name: item.name }));
250
261
  }
251
262
  async listDashboards(collectionId) {
252
263
  const items = await this.request('GET', `/api/collection/${collectionId}/items?models=dashboard`);
253
- return (items.data ?? []).map(item => ({ id: item.id, name: item.name }));
264
+ return (items.data ?? []).map((item) => ({ id: item.id, name: item.name }));
254
265
  }
255
266
  /**
256
267
  * Write a native question. Updating an existing card rather than replacing it keeps its id, and
@@ -283,7 +294,7 @@ export class MetabaseApi {
283
294
  async runCardValues(cardId) {
284
295
  const result = await this.request('POST', `/api/card/${cardId}/query`);
285
296
  return (result.data?.rows ?? [])
286
- .map(row => row[0])
297
+ .map((row) => row[0])
287
298
  .filter((value) => typeof value === 'string' && value.length > 0);
288
299
  }
289
300
  async createDashboard(name, description, collectionId) {
@@ -299,7 +310,11 @@ export class MetabaseApi {
299
310
  const dashboard = await this.request('GET', `/api/dashboard/${id}`);
300
311
  return {
301
312
  tabs: dashboard.tabs ?? [],
302
- cards: (dashboard.dashcards ?? []).map(dashcard => ({ id: dashcard.id, cardId: dashcard.card_id, tabId: dashcard.dashboard_tab_id })),
313
+ cards: (dashboard.dashcards ?? []).map((dashcard) => ({
314
+ id: dashcard.id,
315
+ cardId: dashcard.card_id,
316
+ tabId: dashcard.dashboard_tab_id,
317
+ })),
303
318
  };
304
319
  }
305
320
  /**
@@ -326,7 +341,7 @@ export class MetabaseApi {
326
341
  */
327
342
  async bookmarkDashboard(id) {
328
343
  const bookmarks = await this.request('GET', '/api/bookmark');
329
- if (bookmarks.some(bookmark => bookmark.type === 'dashboard' && bookmark.item_id === id)) {
344
+ if (bookmarks.some((bookmark) => bookmark.type === 'dashboard' && bookmark.item_id === id)) {
330
345
  return { created: false };
331
346
  }
332
347
  await this.request('POST', `/api/bookmark/dashboard/${id}`);
package/dist/api.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AA6EA,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACD;IAAtC,YAAY,OAAe,EAAW,MAAc;QAChD,KAAK,CAAC,OAAO,CAAC,CAAC;QADmB,WAAM,GAAN,MAAM,CAAQ;QAEhD,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACnC,CAAC;CACJ;AAQD;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,WAAW;IAIS;IAHrB,OAAO,CAAqB;IACnB,MAAM,CAAqB;IAE5C,YAA6B,OAAe,EAAE,UAA+B,EAAE;QAAlD,YAAO,GAAP,OAAO,CAAQ;QACxC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IACjC,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,aAAa;QACf,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,OAAO,CAAoC,KAAK,EAAE,yBAAyB,CAAC,CAAC;QAC3G,OAAO,UAAU,CAAC,aAAa,CAAC,IAAI,SAAS,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK,CAAC,KAAa,EAAE,KAAoB;QAC3C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAiB,MAAM,EAAE,YAAY,EAAE;YACpE,KAAK;YACL,IAAI,EAAE;gBACF,UAAU,EAAE,KAAK,CAAC,SAAS;gBAC3B,SAAS,EAAE,KAAK,CAA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