@metabase/client 0.1.2 → 0.1.4

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 (191) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +2 -2
  3. package/dist/{card-CrSywvOt.d.ts → card-CAOxi3ZU.d.ts} +26 -26
  4. package/dist/{card-CbV6hLYH.d.ts → card-Ik580mDC.d.ts} +3 -3
  5. package/dist/{client-cBi6_RQs.d.ts → client-CQkS1030.d.ts} +117 -116
  6. package/dist/client.d.ts +1 -1
  7. package/dist/client.js +1 -1
  8. package/dist/{collection-Q9FNMiRh.d.ts → collection-B31DGW6J.d.ts} +4 -4
  9. package/dist/{collection-Bmtisr3r.d.ts → collection-kN2oYenF.d.ts} +43 -43
  10. package/dist/{dashboard-DBdEehA9.d.ts → dashboard-Bkl_vs7L.d.ts} +23 -23
  11. package/dist/{dashboard-CknUcTp8.d.ts → dashboard-ClJ5XHXJ.d.ts} +3 -3
  12. package/dist/{data-action-CqqZ0JYg.d.ts → data-action-CCU3lzoY.d.ts} +64 -13
  13. package/dist/data-app-DAEPU9W5.d.ts +111 -0
  14. package/dist/{database-CYNLJ8AZ.d.ts → database-B54owh7H.d.ts} +16 -16
  15. package/dist/{database-Bs5WQOOZ.d.ts → database-DNQLCRBJ.d.ts} +3 -3
  16. package/dist/{dataset-cg8ZZrOP.d.ts → dataset-Bj3bNqjm.d.ts} +71 -71
  17. package/dist/{dataset-dzWljE_C.d.ts → dataset-C05pNRjH.d.ts} +3 -3
  18. package/dist/{dependency-VqvLTDAU.d.ts → dependency-B8aPt_IM.d.ts} +163 -163
  19. package/dist/{dependency-CL-YG9KH.d.ts → dependency-NbXbo_fE.d.ts} +25 -25
  20. package/dist/{document-tLd6pYWe.d.ts → document-rqUlE_OE.d.ts} +1 -1
  21. package/dist/domain/card.d.ts +1 -1
  22. package/dist/domain/collection.d.ts +1 -1
  23. package/dist/domain/dashboard.d.ts +1 -1
  24. package/dist/domain/data-action.d.ts +2 -2
  25. package/dist/domain/data-action.js +43 -10
  26. package/dist/domain/data-app.d.ts +2 -2
  27. package/dist/domain/data-app.js +27 -14
  28. package/dist/domain/database.d.ts +1 -1
  29. package/dist/domain/dataset.d.ts +1 -1
  30. package/dist/domain/dependency.d.ts +1 -1
  31. package/dist/domain/document.d.ts +1 -1
  32. package/dist/domain/eid-translation.d.ts +1 -1
  33. package/dist/domain/embedding.d.ts +1 -1
  34. package/dist/domain/field.d.ts +1 -1
  35. package/dist/domain/git-sync.d.ts +1 -1
  36. package/dist/domain/library.d.ts +1 -1
  37. package/dist/domain/metric.d.ts +1 -1
  38. package/dist/domain/moderation-review.d.ts +1 -1
  39. package/dist/domain/notification.d.ts +1 -1
  40. package/dist/domain/parameter.d.ts +1 -1
  41. package/dist/domain/pulse.d.ts +1 -1
  42. package/dist/domain/replacement.d.ts +1 -1
  43. package/dist/domain/revision.d.ts +1 -1
  44. package/dist/domain/search.d.ts +1 -1
  45. package/dist/domain/table.d.ts +1 -1
  46. package/dist/domain/timeline.d.ts +1 -1
  47. package/dist/domain/transform-inspector.d.ts +1 -1
  48. package/dist/domain/transform-job.d.ts +1 -1
  49. package/dist/domain/transform-python.d.ts +1 -1
  50. package/dist/domain/transform-test.d.ts +2 -2
  51. package/dist/domain/transform-test.js +5 -1
  52. package/dist/domain/transform.d.ts +1 -1
  53. package/dist/{eid-translation-aQSffx0o.d.ts → eid-translation-CP79Tz71.d.ts} +40 -40
  54. package/dist/{embedding-Cz3RUJYf.d.ts → embedding-oU3gqfgX.d.ts} +1 -1
  55. package/dist/{erd-DCgdEC2S.d.ts → erd-BJ3OjckY.d.ts} +1 -1
  56. package/dist/{errors-DdMlaXqq.js → errors-D5mjCJCW.js} +12 -4
  57. package/dist/errors.d.ts +1 -1
  58. package/dist/{features-SMSfJhB6.d.ts → features-BwC2QUQB.d.ts} +4 -0
  59. package/dist/{field-ozrfbvUd.d.ts → field-Be27Kzlx.d.ts} +2 -2
  60. package/dist/{field-tqQPtVuR.d.ts → field-CCp65II7.d.ts} +3 -3
  61. package/dist/{git-sync-5lFWX1ds.d.ts → git-sync-CBplEGj0.d.ts} +1 -1
  62. package/dist/{git-sync-QL9Nu6gP.d.ts → git-sync-D1gts9j5.d.ts} +8 -8
  63. package/dist/{glossary-DwS7QVrl.d.ts → glossary-yuKOTBXb.d.ts} +1 -1
  64. package/dist/http/errors.d.ts +1 -1
  65. package/dist/http/errors.js +1 -1
  66. package/dist/http/oauth.js +1 -1
  67. package/dist/http/transport.d.ts +1 -1
  68. package/dist/http/transport.js +1 -1
  69. package/dist/index.d.ts +37 -37
  70. package/dist/index.js +6 -6
  71. package/dist/{input-gates-DwKoTJVQ.d.ts → input-gates-DLCSnwRf.d.ts} +1 -1
  72. package/dist/{json-DwGOvRtS.d.ts → json-DK8ntK_m.d.ts} +1 -1
  73. package/dist/json.d.ts +1 -1
  74. package/dist/{library-B9pEq7qP.d.ts → library-DZpIRTeG.d.ts} +2 -2
  75. package/dist/{measure-CInoXeyH.d.ts → measure-DZ7RmNPs.d.ts} +1 -1
  76. package/dist/{metric-CYOmbcM5.d.ts → metric-CKhTot_B.d.ts} +9 -9
  77. package/dist/{moderation-review-CWUQ3_HL.d.ts → moderation-review-B4RUTZ6_.d.ts} +4 -4
  78. package/dist/{notification-D-Hp82Pn.d.ts → notification-BwLEwNk9.d.ts} +2 -2
  79. package/dist/{notification-BY2JEjKp.d.ts → notification-D1MThyKE.d.ts} +2 -2
  80. package/dist/{paginate-CaJ5usdp.d.ts → paginate-CPjKDJ2m.d.ts} +1 -1
  81. package/dist/paginate.d.ts +1 -1
  82. package/dist/{parameter-BYo7uR-J.d.ts → parameter-CvyXRH6F.d.ts} +4 -4
  83. package/dist/{pulse-BUlfrJZH.d.ts → pulse-BgS7Y3MU.d.ts} +20 -20
  84. package/dist/{pulse-BTpSNxhT.d.ts → pulse-DEKvyd8u.d.ts} +2 -2
  85. package/dist/{refusal-B9aeHMc9.js → refusal-CvN0pxPR.js} +1 -1
  86. package/dist/{replacement-BQian4vA.d.ts → replacement-Bu4qxOua.d.ts} +17 -17
  87. package/dist/{replacement-Dbtvvrmz.d.ts → replacement-WU_rk924.d.ts} +9 -9
  88. package/dist/{requirement-check-CHHEHXcj.d.ts → requirement-check-B5tsY6Z_.d.ts} +2 -2
  89. package/dist/{requirements-Dx_ZVzl7.d.ts → requirements-CW0DsGzZ.d.ts} +4 -5
  90. package/dist/resources/api-key.d.ts +1 -1
  91. package/dist/resources/card.d.ts +1 -1
  92. package/dist/resources/collection.d.ts +1 -1
  93. package/dist/resources/collection.js +1 -1
  94. package/dist/resources/content-translation.d.ts +1 -1
  95. package/dist/resources/content-translation.js +1 -1
  96. package/dist/resources/dashboard.d.ts +1 -1
  97. package/dist/resources/dashboard.js +1 -1
  98. package/dist/resources/data-action.d.ts +22 -4
  99. package/dist/resources/data-action.js +11 -6
  100. package/dist/resources/data-app.d.ts +35 -52
  101. package/dist/resources/data-app.js +23 -38
  102. package/dist/resources/database.d.ts +1 -1
  103. package/dist/resources/dataset.d.ts +1 -1
  104. package/dist/resources/dependency.d.ts +1 -1
  105. package/dist/resources/dependency.js +1 -1
  106. package/dist/resources/document.d.ts +10 -3
  107. package/dist/resources/document.js +1 -1
  108. package/dist/resources/eid-translation.d.ts +2 -2
  109. package/dist/resources/erd.d.ts +1 -1
  110. package/dist/resources/erd.js +1 -1
  111. package/dist/resources/field.d.ts +1 -1
  112. package/dist/resources/field.js +1 -1
  113. package/dist/resources/git-sync.d.ts +1 -1
  114. package/dist/resources/git-sync.js +2 -2
  115. package/dist/resources/glossary.d.ts +1 -1
  116. package/dist/resources/library.d.ts +1 -1
  117. package/dist/resources/library.js +1 -1
  118. package/dist/resources/measure.d.ts +1 -1
  119. package/dist/resources/measure.js +1 -1
  120. package/dist/resources/metric.d.ts +1 -1
  121. package/dist/resources/metric.js +1 -1
  122. package/dist/resources/moderation-review.d.ts +1 -1
  123. package/dist/resources/moderation-review.js +1 -1
  124. package/dist/resources/notification.d.ts +1 -1
  125. package/dist/resources/optional-parsed.d.ts +1 -1
  126. package/dist/resources/permission.d.ts +1 -1
  127. package/dist/resources/pivot-export.d.ts +1 -1
  128. package/dist/resources/pulse.d.ts +1 -1
  129. package/dist/resources/replacement.d.ts +1 -1
  130. package/dist/resources/replacement.js +1 -1
  131. package/dist/resources/revision.d.ts +3 -3
  132. package/dist/resources/revision.js +1 -1
  133. package/dist/resources/search.d.ts +1 -1
  134. package/dist/resources/search.js +1 -1
  135. package/dist/resources/segment.d.ts +1 -1
  136. package/dist/resources/setting.d.ts +1 -1
  137. package/dist/resources/setup.d.ts +1 -1
  138. package/dist/resources/snippet.d.ts +1 -1
  139. package/dist/resources/table.d.ts +1 -1
  140. package/dist/resources/table.js +1 -1
  141. package/dist/resources/timeline-event.d.ts +2 -2
  142. package/dist/resources/timeline.d.ts +1 -1
  143. package/dist/resources/transform-dag-run.d.ts +1 -1
  144. package/dist/resources/transform-dag-run.js +1 -1
  145. package/dist/resources/transform-inspector.d.ts +4 -4
  146. package/dist/resources/transform-inspector.js +1 -1
  147. package/dist/resources/transform-job.d.ts +1 -1
  148. package/dist/resources/transform-job.js +1 -1
  149. package/dist/resources/transform-python.d.ts +1 -1
  150. package/dist/resources/transform-python.js +1 -1
  151. package/dist/resources/transform-tag.d.ts +1 -1
  152. package/dist/resources/transform-tag.js +1 -1
  153. package/dist/resources/transform-test.d.ts +1 -1
  154. package/dist/resources/transform-test.js +1 -1
  155. package/dist/resources/transform.d.ts +1 -1
  156. package/dist/resources/transform.js +1 -1
  157. package/dist/resources/upload.d.ts +1 -1
  158. package/dist/resources/user.d.ts +1 -1
  159. package/dist/{revision-DNEw6S93.d.ts → revision-CwP4-eqv.d.ts} +5 -5
  160. package/dist/{search-tK5lmRb8.d.ts → search-C0PiFw8c.d.ts} +24 -24
  161. package/dist/{search-BQWkdVg1.d.ts → search-DjJ_lu_o.d.ts} +2 -2
  162. package/dist/{segment-jyhBtOAZ.d.ts → segment-BR0OAdWN.d.ts} +1 -1
  163. package/dist/signal.d.ts +1 -1
  164. package/dist/{snippet-DsgohpTV.d.ts → snippet-C5naeVEd.d.ts} +1 -1
  165. package/dist/{table-BAl8aPZZ.d.ts → table-B3lazUvH.d.ts} +28 -28
  166. package/dist/{table-B1pQSpTA.d.ts → table-DT3kO7JU.d.ts} +9 -9
  167. package/dist/{timeline-BfX1lMob.d.ts → timeline-Bnn28jC7.d.ts} +21 -21
  168. package/dist/{timeline-BdLvwRnl.d.ts → timeline-vJHDIuDJ.d.ts} +2 -2
  169. package/dist/{transform-DwnIcpqV.d.ts → transform-B0mugBQQ.d.ts} +1 -1
  170. package/dist/{transform-Ds74yPiY.d.ts → transform-Buv3VvTt.d.ts} +3 -3
  171. package/dist/{transform-inspector-BMaRqcRM.d.ts → transform-inspector-BUYBt6--.d.ts} +8 -8
  172. package/dist/{transform-job-C85GxBHj.d.ts → transform-job-BFLbsf5-.d.ts} +1 -1
  173. package/dist/{transform-job-Dfp9Ox0l.d.ts → transform-job-DV28hc1A.d.ts} +2 -2
  174. package/dist/{transform-python-DtL3xxMj.d.ts → transform-python-B-jBoeVa.d.ts} +1 -1
  175. package/dist/{transform-test-C3hiZ4AV.d.ts → transform-test-3uuvuwyQ.d.ts} +1 -1
  176. package/dist/{transform-test-DROPvrkI.d.ts → transform-test-DpTJm7H7.d.ts} +2 -1
  177. package/dist/{transport-CS11mEqI.d.ts → transport-CM-eJat3.d.ts} +7 -3
  178. package/dist/{transport-HP7cyo9N.js → transport-D52WFGBR.js} +1 -1
  179. package/dist/{upload-Bx1D7eNy.d.ts → upload-BxRCvpJo.d.ts} +1 -1
  180. package/dist/version/capability-error.d.ts +1 -1
  181. package/dist/version/capability-error.js +1 -1
  182. package/dist/version/features.d.ts +1 -1
  183. package/dist/version/features.js +1 -0
  184. package/dist/version/input-gates.d.ts +1 -1
  185. package/dist/version/probe.d.ts +1 -1
  186. package/dist/version/profile.d.ts +1 -1
  187. package/dist/version/requirement-check.d.ts +1 -1
  188. package/dist/version/requirements.d.ts +1 -1
  189. package/dist/version/requirements.js +3 -4
  190. package/package.json +1 -1
  191. package/dist/data-app-MoMS9VUr.d.ts +0 -76
@@ -1,4 +1,4 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-CS11mEqI.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CM-eJat3.js";
2
2
  import { t as CsvFile } from "../csv-upload--K35QedP.js";
3
3
  //#region src/resources/content-translation.d.ts
4
4
  declare function contentTranslationResource(transport: Transport): {
@@ -1,4 +1,4 @@
1
- import { t as explainer } from "../refusal-B9aeHMc9.js";
1
+ import { t as explainer } from "../refusal-CvN0pxPR.js";
2
2
  import { ContentTranslationUploadResult } from "../domain/content-translation.js";
3
3
  import { buildCsvFormData } from "./csv-upload.js";
4
4
  //#region src/resources/content-translation.ts
@@ -1,2 +1,2 @@
1
- import { a as DashcardCardProblem, i as DashcardCardMissing, n as DashcardCardArchived, o as DashcardCardUnreadable, r as DashcardCardIssue, s as dashboardResource, t as DashboardListParams } from "../dashboard-CknUcTp8.js";
1
+ import { a as DashcardCardProblem, i as DashcardCardMissing, n as DashcardCardArchived, o as DashcardCardUnreadable, r as DashcardCardIssue, s as dashboardResource, t as DashboardListParams } from "../dashboard-ClJ5XHXJ.js";
2
2
  export { DashboardListParams, DashcardCardArchived, DashcardCardIssue, DashcardCardMissing, DashcardCardProblem, DashcardCardUnreadable, dashboardResource };
@@ -1,5 +1,5 @@
1
1
  import { ConfigError } from "../errors.js";
2
- import { a as HttpError } from "../errors-DdMlaXqq.js";
2
+ import { a as HttpError } from "../errors-D5mjCJCW.js";
3
3
  import { ParameterValues } from "../domain/parameter.js";
4
4
  import { cardResource } from "./card.js";
5
5
  import { Dashboard, DashboardCopy, DashboardCreateInput, Dashcard, dashboardDetailSchema } from "../domain/dashboard.js";
@@ -1,17 +1,33 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-CS11mEqI.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CM-eJat3.js";
2
2
  import { t as ListResult } from "../list-BT_bBm9Z.js";
3
- import { a as DataActionExecuteInput, c as DataActionUpdateInput, n as DataAction, o as DataActionExecuteResult } from "../data-action-CqqZ0JYg.js";
3
+ import { l as DataActionUpdateInput, o as DataActionExecuteInput, r as DataAction, s as DataActionExecuteResult } from "../data-action-CCU3lzoY.js";
4
4
  //#region src/resources/data-action.d.ts
5
5
  declare function dataActionResource(transport: Transport): {
6
6
  list: (options?: RequestOptions) => Promise<ListResult<DataAction>>;
7
7
  get: (id: number, options?: RequestOptions) => Promise<DataAction>;
8
8
  create: (params: {
9
- name: string;
10
9
  type: "query";
11
- database_id: number;
12
10
  dataset_query: {
13
11
  [x: string]: unknown;
14
12
  };
13
+ name: string;
14
+ parameters?: {
15
+ [x: string]: unknown;
16
+ id: string;
17
+ type: string;
18
+ target: unknown;
19
+ name?: string | undefined;
20
+ slug?: string | undefined;
21
+ required?: boolean | undefined;
22
+ }[] | undefined;
23
+ collection_id?: number | null | undefined;
24
+ description?: string | null | undefined;
25
+ visualization_settings?: unknown;
26
+ } | {
27
+ type: "implicit";
28
+ kind: "row/create" | "row/update" | "row/delete";
29
+ table_id: number;
30
+ name: string;
15
31
  parameters?: {
16
32
  [x: string]: unknown;
17
33
  id: string;
@@ -50,6 +66,8 @@ declare function dataActionResource(transport: Transport): {
50
66
  collection_id: number | null;
51
67
  database_id?: number | null | undefined;
52
68
  dataset_query?: unknown;
69
+ kind?: string | undefined;
70
+ table_id?: number | null | undefined;
53
71
  }>;
54
72
  update: (id: number, params: DataActionUpdateInput, options?: RequestOptions) => Promise<DataAction>;
55
73
  archive: (id: number, options?: RequestOptions) => Promise<DataAction>;
@@ -1,5 +1,5 @@
1
- import { t as explainer } from "../refusal-B9aeHMc9.js";
2
- import { DATA_ACTION_COLLECTION_GATE, DataActionExecuteResult, dataActionSchema } from "../domain/data-action.js";
1
+ import { t as explainer } from "../refusal-CvN0pxPR.js";
2
+ import { DATA_ACTION_COLLECTION_GATE, DATA_ACTION_TABLE_GATE, DataActionExecuteResult, dataActionSchema } from "../domain/data-action.js";
3
3
  import { gateTriggered } from "../version/input-gates.js";
4
4
  import { z } from "zod";
5
5
  //#region src/resources/data-action.ts
@@ -22,7 +22,10 @@ function dataActionResource(transport) {
22
22
  const schema = await readSchema(options);
23
23
  return transport.requestParsed(schema, `/api/action/${id}`, { ...options });
24
24
  }
25
- /** Create a data action — a parameterized native query that writes to a database — in a collection. */
25
+ /**
26
+ * Create a data action in a collection: a parameterized native query that writes to a database, or
27
+ * an implicit action that inserts, updates, or deletes one row of a table.
28
+ */
26
29
  async function create(params, options = {}) {
27
30
  const schema = await readSchema(options);
28
31
  return transport.requestParsed(schema, "/api/action", {
@@ -33,11 +36,13 @@ function dataActionResource(transport) {
33
36
  }
34
37
  /**
35
38
  * Update a data action by id, patching only the fields the body carries. A server whose data
36
- * actions have no collection never moves the action, and from 58.31 it strips the undeclared key and
37
- * answers as if it had. So the field is refused there before the wire.
39
+ * actions have no collection never moves the action, and one whose data actions need a model never
40
+ * moves an implicit action to another table; from 58.31 it strips the undeclared key and answers as
41
+ * if it had. So each field is refused there before the wire.
38
42
  */
39
43
  async function update(id, params, options = {}) {
40
- await transport.requireFeatures(gateTriggered(DATA_ACTION_COLLECTION_GATE, params.collection_id) ? [DATA_ACTION_COLLECTION_GATE.feature] : [], options);
44
+ const tableId = "table_id" in params ? params.table_id : void 0;
45
+ await transport.requireFeatures([...gateTriggered(DATA_ACTION_COLLECTION_GATE, params.collection_id) ? [DATA_ACTION_COLLECTION_GATE.feature] : [], ...gateTriggered(DATA_ACTION_TABLE_GATE, tableId) ? [DATA_ACTION_TABLE_GATE.feature] : []], options);
41
46
  const schema = await readSchema(options);
42
47
  return transport.requestParsed(schema, `/api/action/${id}`, {
43
48
  ...options,
@@ -1,10 +1,8 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-CS11mEqI.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CM-eJat3.js";
2
2
  import { t as ListResult } from "../list-BT_bBm9Z.js";
3
3
  //#region src/resources/data-app.d.ts
4
4
  declare function dataAppResource(transport: Transport): {
5
- list: (filter?: {
6
- available?: boolean | undefined;
7
- } | undefined, options?: RequestOptions | undefined) => Promise<ListResult<{
5
+ list: (options?: RequestOptions | undefined) => Promise<ListResult<{
8
6
  [x: string]: unknown;
9
7
  id: number;
10
8
  name: string;
@@ -42,54 +40,9 @@ declare function dataAppResource(transport: Transport): {
42
40
  name: string;
43
41
  display_name: string;
44
42
  }>;
45
- create: (params: {
46
- name: string;
47
- display_name?: string | undefined;
48
- description?: string | null | undefined;
49
- version?: number | undefined;
50
- bundle_path?: string | undefined;
51
- allowed_hosts?: string[] | undefined;
52
- enabled?: boolean | undefined;
53
- }, options?: RequestOptions | undefined) => Promise<{
54
- [x: string]: unknown;
55
- id: number;
56
- name: string;
57
- display_name: string;
58
- description: string | null;
59
- version: number;
60
- outdated: boolean;
61
- bundle_path: string;
62
- enabled: boolean;
63
- allowed_hosts: string[];
64
- resource_collection_id: number;
65
- bundle_hash: string | null;
66
- created_at: string;
67
- updated_at: string;
68
- }>;
69
43
  update: (slug: string, params: {
70
- display_name?: string | undefined;
71
- description?: string | null | undefined;
72
- version?: number | undefined;
73
- bundle_path?: string | undefined;
74
- allowed_hosts?: string[] | undefined;
75
- enabled?: boolean | undefined;
76
- }, options?: RequestOptions | undefined) => Promise<{
77
- [x: string]: unknown;
78
- id: number;
79
- name: string;
80
- display_name: string;
81
- description: string | null;
82
- version: number;
83
- outdated: boolean;
84
- bundle_path: string;
85
44
  enabled: boolean;
86
- allowed_hosts: string[];
87
- resource_collection_id: number;
88
- bundle_hash: string | null;
89
- created_at: string;
90
- updated_at: string;
91
- }>;
92
- replaceBundle: (slug: string, bundle: string, options?: RequestOptions | undefined) => Promise<{
45
+ }, options?: RequestOptions | undefined) => Promise<{
93
46
  [x: string]: unknown;
94
47
  id: number;
95
48
  name: string;
@@ -105,8 +58,38 @@ declare function dataAppResource(transport: Transport): {
105
58
  created_at: string;
106
59
  updated_at: string;
107
60
  }>;
108
- typedSchema: (slug: string, options?: RequestOptions | undefined) => Promise<string>;
109
- delete: (slug: string, options?: RequestOptions | undefined) => Promise<void>;
61
+ generateSchema: (options?: RequestOptions | undefined) => Promise<{
62
+ path: string;
63
+ contents: string;
64
+ }[]>;
65
+ generateQueries: (params: {
66
+ collection: string;
67
+ queries: Record<string, {
68
+ entityId: string;
69
+ query: {
70
+ stages: [{
71
+ [x: string]: unknown;
72
+ }];
73
+ };
74
+ }>;
75
+ }, options?: RequestOptions | undefined) => Promise<{
76
+ path: string;
77
+ contents: string;
78
+ }[]>;
79
+ generateActions: (params: {
80
+ collection: string;
81
+ actions: Record<string, {
82
+ entityId: string;
83
+ kind: "row/create" | "row/update" | "row/delete";
84
+ table: {
85
+ [x: string]: unknown;
86
+ id: number;
87
+ };
88
+ }>;
89
+ }, options?: RequestOptions | undefined) => Promise<{
90
+ path: string;
91
+ contents: string;
92
+ }[]>;
110
93
  };
111
94
  //#endregion
112
95
  export { dataAppResource };
@@ -1,5 +1,5 @@
1
- import { t as explainer } from "../refusal-B9aeHMc9.js";
2
- import { DataApp, DataAppEntry } from "../domain/data-app.js";
1
+ import { t as explainer } from "../refusal-CvN0pxPR.js";
2
+ import { DataApp, DataAppEntry, DataAppGeneratedFiles } from "../domain/data-app.js";
3
3
  import { z } from "zod";
4
4
  //#region src/resources/data-app.ts
5
5
  const DATA_APPS_PATH = "/api/ee/apps";
@@ -8,13 +8,10 @@ function appPath(slug) {
8
8
  }
9
9
  function dataAppResource(transport) {
10
10
  const { explain } = explainer(transport, "dataApp");
11
- /** List the data apps; `available` keeps only the enabled ones that aren't outdated. `GET /api/ee/apps` answers a bare array. */
12
- async function list(filter = {}, options = {}) {
11
+ /** List the data apps. `GET /api/ee/apps` answers a bare array. */
12
+ async function list(options = {}) {
13
13
  return {
14
- data: await transport.requestParsed(z.array(DataAppEntry), DATA_APPS_PATH, {
15
- ...options,
16
- query: { available: filter.available }
17
- }),
14
+ data: await transport.requestParsed(z.array(DataAppEntry), DATA_APPS_PATH, { ...options }),
18
15
  total: null
19
16
  };
20
17
  }
@@ -22,15 +19,7 @@ function dataAppResource(transport) {
22
19
  async function get(slug, options = {}) {
23
20
  return transport.requestParsed(DataAppEntry, appPath(slug), { ...options });
24
21
  }
25
- /** Create a data app with its resource collection and an empty bundle; it is disabled unless the body says otherwise. */
26
- async function create(params, options = {}) {
27
- return transport.requestParsed(DataApp, DATA_APPS_PATH, {
28
- ...options,
29
- method: "POST",
30
- body: params
31
- });
32
- }
33
- /** Update a data app's fields, or enable or disable it. */
22
+ /** Enable or disable a data app; anything else about an app changes only through a repository import. */
34
23
  async function update(slug, params, options = {}) {
35
24
  return transport.requestParsed(DataApp, appPath(slug), {
36
25
  ...options,
@@ -38,37 +27,33 @@ function dataAppResource(transport) {
38
27
  body: params
39
28
  });
40
29
  }
41
- /** Replace a data app's bundle with the text of a built bundle. */
42
- async function replaceBundle(slug, bundle, options = {}) {
43
- return transport.requestParsed(DataApp, `${appPath(slug)}/bundle`, {
44
- ...options,
45
- method: "PUT",
46
- body: { bundle }
47
- });
30
+ /** An app's `src/metabase.schema.ts`: the Library's published tables, with their fields, segments and measures, and the Library's metrics. */
31
+ async function generateSchema(options = {}) {
32
+ return transport.requestParsed(DataAppGeneratedFiles, `${DATA_APPS_PATH}/generate/schema`, { ...options });
48
33
  }
49
- /** The TypeScript module of the app's queries and actions: a `defineQuery` or `defineAction` call per question and action in its collection. */
50
- async function typedSchema(slug, options = {}) {
51
- return (await transport.requestRaw(`${appPath(slug)}/typed-schema`, {
34
+ /** The YAML files of the questions an app's `defineQuery` exports define, by file name in its collection's directory. */
35
+ async function generateQueries(params, options = {}) {
36
+ return transport.requestParsed(DataAppGeneratedFiles, `${DATA_APPS_PATH}/generate/queries`, {
52
37
  ...options,
53
- expectContentType: "text"
54
- })).text();
38
+ method: "POST",
39
+ body: params
40
+ });
55
41
  }
56
- /** Delete a data app with its bundle, its collection and its group assignments. */
57
- async function remove(slug, options = {}) {
58
- await transport.requestRaw(appPath(slug), {
42
+ /** The YAML files of the implicit actions an app's `defineAction` exports define, by file name in its collection's directory. */
43
+ async function generateActions(params, options = {}) {
44
+ return transport.requestParsed(DataAppGeneratedFiles, `${DATA_APPS_PATH}/generate/actions`, {
59
45
  ...options,
60
- method: "DELETE",
61
- expectContentType: "binary"
46
+ method: "POST",
47
+ body: params
62
48
  });
63
49
  }
64
50
  return {
65
51
  list: explain("list", list),
66
52
  get: explain("get", get),
67
- create: explain("create", create),
68
53
  update: explain("update", update),
69
- replaceBundle: explain("replaceBundle", replaceBundle),
70
- typedSchema: explain("typedSchema", typedSchema),
71
- delete: explain("delete", remove)
54
+ generateSchema: explain("generateSchema", generateSchema),
55
+ generateQueries: explain("generateQueries", generateQueries),
56
+ generateActions: explain("generateActions", generateActions)
72
57
  };
73
58
  }
74
59
  //#endregion
@@ -1,2 +1,2 @@
1
- import { i as databaseResource, n as DatabaseListParams, r as DatabaseSyncSchemaParams, t as DatabaseGetParams } from "../database-Bs5WQOOZ.js";
1
+ import { i as databaseResource, n as DatabaseListParams, r as DatabaseSyncSchemaParams, t as DatabaseGetParams } from "../database-DNQLCRBJ.js";
2
2
  export { DatabaseGetParams, DatabaseListParams, DatabaseSyncSchemaParams, databaseResource };
@@ -1,2 +1,2 @@
1
- import { n as DatasetNativeParams, r as datasetResource, t as DatasetExportParams } from "../dataset-dzWljE_C.js";
1
+ import { n as DatasetNativeParams, r as datasetResource, t as DatasetExportParams } from "../dataset-C05pNRjH.js";
2
2
  export { DatasetExportParams, DatasetNativeParams, datasetResource };
@@ -1,2 +1,2 @@
1
- import { a as dependencyResource, i as DependencyItemPageOptions, n as DependencyDependentsParams, r as DependencyItemListParams, t as DependencyBrokenParams } from "../dependency-CL-YG9KH.js";
1
+ import { a as dependencyResource, i as DependencyItemPageOptions, n as DependencyDependentsParams, r as DependencyItemListParams, t as DependencyBrokenParams } from "../dependency-NbXbo_fE.js";
2
2
  export { DependencyBrokenParams, DependencyDependentsParams, DependencyItemListParams, DependencyItemPageOptions, dependencyResource };
@@ -1,5 +1,5 @@
1
1
  import { paginatePages } from "../paginate.js";
2
- import { t as explainer } from "../refusal-B9aeHMc9.js";
2
+ import { t as explainer } from "../refusal-CvN0pxPR.js";
3
3
  import { BreakingSource, DependencyEntity, DependencyGraph, DependencyNode } from "../domain/dependency.js";
4
4
  import { z } from "zod";
5
5
  //#region src/resources/dependency.ts
@@ -1,6 +1,6 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-CS11mEqI.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CM-eJat3.js";
2
2
  import { t as ListResult } from "../list-BT_bBm9Z.js";
3
- import { a as DocumentUpdateInput, i as DocumentCreateInput, t as Document } from "../document-tLd6pYWe.js";
3
+ import { a as DocumentUpdateInput, i as DocumentCreateInput, t as Document } from "../document-rqUlE_OE.js";
4
4
  //#region src/resources/document.d.ts
5
5
  declare function documentResource(transport: Transport): {
6
6
  list: (options?: RequestOptions) => Promise<ListResult<Document>>;
@@ -22,7 +22,14 @@ declare function documentResource(transport: Transport): {
22
22
  text?: string | undefined;
23
23
  attrs?: Record<string, unknown> | undefined;
24
24
  marks?: Record<string, unknown>[] | undefined;
25
- content?: /*elided*/ any[] | undefined;
25
+ content?: {
26
+ [x: string]: unknown;
27
+ type: string;
28
+ text?: string | undefined;
29
+ attrs?: Record<string, unknown> | undefined;
30
+ marks?: Record<string, unknown>[] | undefined;
31
+ content?: /*elided*/ any[] | undefined;
32
+ }[] | undefined;
26
33
  } | null;
27
34
  entity_id: string | null;
28
35
  collection_id: number | null;
@@ -1,4 +1,4 @@
1
- import { t as explainer } from "../refusal-B9aeHMc9.js";
1
+ import { t as explainer } from "../refusal-CvN0pxPR.js";
2
2
  import { Document } from "../domain/document.js";
3
3
  import { z } from "zod";
4
4
  //#region src/resources/document.ts
@@ -1,5 +1,5 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-CS11mEqI.js";
2
- import { a as EidTranslateResult, i as EidTranslateInput } from "../eid-translation-aQSffx0o.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CM-eJat3.js";
2
+ import { a as EidTranslateResult, i as EidTranslateInput } from "../eid-translation-CP79Tz71.js";
3
3
  //#region src/resources/eid-translation.d.ts
4
4
  declare function eidTranslationResource(transport: Transport): {
5
5
  translate: (params: EidTranslateInput, options?: RequestOptions) => Promise<EidTranslateResult>;
@@ -1,2 +1,2 @@
1
- import { n as erdResource, t as ErdParams } from "../erd-DCgdEC2S.js";
1
+ import { n as erdResource, t as ErdParams } from "../erd-BJ3OjckY.js";
2
2
  export { ErdParams, erdResource };
@@ -1,4 +1,4 @@
1
- import { t as explainer } from "../refusal-B9aeHMc9.js";
1
+ import { t as explainer } from "../refusal-CvN0pxPR.js";
2
2
  import { Erd } from "../domain/erd.js";
3
3
  //#region src/resources/erd.ts
4
4
  const ERD_PATH = "/api/ee/erd";
@@ -1,2 +1,2 @@
1
- import { a as FieldSetDataSensitivityParams, i as FieldSearchParams, n as FieldSearchBounded, o as fieldResource, r as FieldSearchByValue, t as FieldRemappingParams } from "../field-ozrfbvUd.js";
1
+ import { a as FieldSetDataSensitivityParams, i as FieldSearchParams, n as FieldSearchBounded, o as fieldResource, r as FieldSearchByValue, t as FieldRemappingParams } from "../field-Be27Kzlx.js";
2
2
  export { FieldRemappingParams, FieldSearchBounded, FieldSearchByValue, FieldSearchParams, FieldSetDataSensitivityParams, fieldResource };
@@ -1,5 +1,5 @@
1
1
  import { DATA_SENSITIVITY_GATE, FieldSearchMatches, FieldValues, FieldWithDataSensitivity, fieldDetailSchema, fieldRemappedValueSchema } from "../domain/field.js";
2
- import { t as explainer } from "../refusal-B9aeHMc9.js";
2
+ import { t as explainer } from "../refusal-CvN0pxPR.js";
3
3
  import { gateTriggered } from "../version/input-gates.js";
4
4
  import { fetchOptionalParsed } from "./optional-parsed.js";
5
5
  import { z } from "zod";
@@ -1,2 +1,2 @@
1
- import { a as SyncRemoteChangesParams, c as SyncWaitParams, i as SyncImportParams, l as gitSyncResource, n as SyncExportParams, o as SyncScopeCollection, r as SyncExportPreflightParams, s as SyncStashParams, t as SyncCreateBranchParams } from "../git-sync-5lFWX1ds.js";
1
+ import { a as SyncRemoteChangesParams, c as SyncWaitParams, i as SyncImportParams, l as gitSyncResource, n as SyncExportParams, o as SyncScopeCollection, r as SyncExportPreflightParams, s as SyncStashParams, t as SyncCreateBranchParams } from "../git-sync-CBplEGj0.js";
2
2
  export { SyncCreateBranchParams, SyncExportParams, SyncExportPreflightParams, SyncImportParams, SyncRemoteChangesParams, SyncScopeCollection, SyncStashParams, SyncWaitParams, gitSyncResource };
@@ -1,9 +1,9 @@
1
1
  import { SessionProperties } from "../domain/session-properties.js";
2
2
  import { ConfigError } from "../errors.js";
3
- import { a as HttpError } from "../errors-DdMlaXqq.js";
3
+ import { a as HttpError } from "../errors-D5mjCJCW.js";
4
4
  import { profileFromProperties } from "../version/probe.js";
5
5
  import { Collection } from "../domain/collection.js";
6
- import { t as explainer } from "../refusal-B9aeHMc9.js";
6
+ import { t as explainer } from "../refusal-CvN0pxPR.js";
7
7
  import { listCollectionsAs } from "./collection.js";
8
8
  import { pollUntil } from "../poll.js";
9
9
  import { fetchOptionalParsed } from "./optional-parsed.js";
@@ -1,2 +1,2 @@
1
- import { n as glossaryResource, t as GlossaryListParams } from "../glossary-DwS7QVrl.js";
1
+ import { n as glossaryResource, t as GlossaryListParams } from "../glossary-yuKOTBXb.js";
2
2
  export { GlossaryListParams, glossaryResource };
@@ -1,4 +1,4 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-CS11mEqI.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CM-eJat3.js";
2
2
  //#region src/resources/library.d.ts
3
3
  declare function libraryResource(transport: Transport): {
4
4
  get: (options?: RequestOptions | undefined) => Promise<{
@@ -1,6 +1,6 @@
1
1
  import { TableSelectors } from "../domain/table.js";
2
2
  import { Collection } from "../domain/collection.js";
3
- import { t as explainer } from "../refusal-B9aeHMc9.js";
3
+ import { t as explainer } from "../refusal-CvN0pxPR.js";
4
4
  import { listCollectionsAs } from "./collection.js";
5
5
  import { parseRequestBody } from "./request-body.js";
6
6
  import { LibraryCollectionInfo, LibraryPublishTablesInput, libraryWireSchema, toLibrary } from "../domain/library.js";
@@ -1,2 +1,2 @@
1
- import { n as measureResource, t as MeasureArchiveParams } from "../measure-CInoXeyH.js";
1
+ import { n as measureResource, t as MeasureArchiveParams } from "../measure-DZ7RmNPs.js";
2
2
  export { MeasureArchiveParams, measureResource };
@@ -1,4 +1,4 @@
1
- import { t as explainer } from "../refusal-B9aeHMc9.js";
1
+ import { t as explainer } from "../refusal-CvN0pxPR.js";
2
2
  import { Measure } from "../domain/measure.js";
3
3
  import { z } from "zod";
4
4
  //#region src/resources/measure.ts
@@ -1,2 +1,2 @@
1
- import { i as metricResource, r as MetricDimensionListParams } from "../client-cBi6_RQs.js";
1
+ import { i as metricResource, r as MetricDimensionListParams } from "../client-CQkS1030.js";
2
2
  export { MetricDimensionListParams, metricResource };
@@ -1,5 +1,5 @@
1
1
  import { CardQueryResult } from "../domain/card.js";
2
- import { t as explainer } from "../refusal-B9aeHMc9.js";
2
+ import { t as explainer } from "../refusal-CvN0pxPR.js";
3
3
  import { MetricBreakoutValues, MetricDimensionListing } from "../domain/metric.js";
4
4
  //#region src/resources/metric.ts
5
5
  function metricResource(transport) {
@@ -1,4 +1,4 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-CS11mEqI.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CM-eJat3.js";
2
2
  //#region src/resources/moderation-review.d.ts
3
3
  declare function moderationReviewResource(transport: Transport): {
4
4
  create: (params: {
@@ -1,5 +1,5 @@
1
1
  import { ModerationReview, ModerationReviewCreateInput } from "../domain/moderation-review.js";
2
- import { t as explainer } from "../refusal-B9aeHMc9.js";
2
+ import { t as explainer } from "../refusal-CvN0pxPR.js";
3
3
  import { parseRequestBody } from "./request-body.js";
4
4
  //#region src/resources/moderation-review.ts
5
5
  function moderationReviewResource(transport) {
@@ -1,2 +1,2 @@
1
- import { i as notificationResource, n as assertCardAlert, r as mergeAlertUpdate, t as NotificationListParams } from "../notification-D-Hp82Pn.js";
1
+ import { i as notificationResource, n as assertCardAlert, r as mergeAlertUpdate, t as NotificationListParams } from "../notification-BwLEwNk9.js";
2
2
  export { NotificationListParams, assertCardAlert, mergeAlertUpdate, notificationResource };
@@ -1,4 +1,4 @@
1
- import { f as RequestOptions, g as TransportRequestOptions, h as Transport } from "../transport-CS11mEqI.js";
1
+ import { f as RequestOptions, g as TransportRequestOptions, h as Transport } from "../transport-CM-eJat3.js";
2
2
  import { ZodType } from "zod";
3
3
  //#region src/resources/optional-parsed.d.ts
4
4
  type OptionalParsedOptions = RequestOptions & Pick<TransportRequestOptions, "query">;
@@ -1,4 +1,4 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-CS11mEqI.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CM-eJat3.js";
2
2
  import { a as PermissionsGraph } from "../permission-BnCQw5Kp.js";
3
3
  //#region src/resources/permission.d.ts
4
4
  declare function permissionResource(transport: Transport): {
@@ -1,4 +1,4 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-CS11mEqI.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CM-eJat3.js";
2
2
  import { n as ExportFormat } from "../query-Xsin530u.js";
3
3
  //#region src/resources/pivot-export.d.ts
4
4
  /**
@@ -1,2 +1,2 @@
1
- import { n as mergePulseUpdate, r as pulseResource, t as PulseListParams } from "../pulse-BTpSNxhT.js";
1
+ import { n as mergePulseUpdate, r as pulseResource, t as PulseListParams } from "../pulse-DEKvyd8u.js";
2
2
  export { PulseListParams, mergePulseUpdate, pulseResource };
@@ -1,2 +1,2 @@
1
- import { n as replacementResource, t as ReplacementRunListParams } from "../replacement-Dbtvvrmz.js";
1
+ import { n as replacementResource, t as ReplacementRunListParams } from "../replacement-WU_rk924.js";
2
2
  export { ReplacementRunListParams, replacementResource };
@@ -1,4 +1,4 @@
1
- import { t as explainer } from "../refusal-B9aeHMc9.js";
1
+ import { t as explainer } from "../refusal-CvN0pxPR.js";
2
2
  import { ReplacementCheck, ReplacementRun, ReplacementRunStarted } from "../domain/replacement.js";
3
3
  import { z } from "zod";
4
4
  //#region src/resources/replacement.ts
@@ -1,8 +1,8 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-CS11mEqI.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CM-eJat3.js";
2
2
  import { t as ListResult } from "../list-BT_bBm9Z.js";
3
3
  //#region src/resources/revision.d.ts
4
4
  declare function revisionResource(transport: Transport): {
5
- list: (entity: "transform" | "card" | "dashboard" | "document" | "measure" | "segment" | "transform-test", id: number, options?: RequestOptions | undefined) => Promise<ListResult<{
5
+ list: (entity: "card" | "dashboard" | "document" | "measure" | "segment" | "transform" | "transform-test", id: number, options?: RequestOptions | undefined) => Promise<ListResult<{
6
6
  [x: string]: unknown;
7
7
  id: number;
8
8
  timestamp: string;
@@ -23,7 +23,7 @@ declare function revisionResource(transport: Transport): {
23
23
  };
24
24
  }>>;
25
25
  revert: (params: {
26
- entity: "transform" | "card" | "dashboard" | "document" | "measure" | "segment" | "transform-test";
26
+ entity: "card" | "dashboard" | "document" | "measure" | "segment" | "transform" | "transform-test";
27
27
  id: number;
28
28
  revision_id: number;
29
29
  }, options?: RequestOptions | undefined) => Promise<{
@@ -1,4 +1,4 @@
1
- import { t as explainer } from "../refusal-B9aeHMc9.js";
1
+ import { t as explainer } from "../refusal-CvN0pxPR.js";
2
2
  import { gateTriggered } from "../version/input-gates.js";
3
3
  import { REVISION_ENTITY_GATES, Revision, RevisionRow } from "../domain/revision.js";
4
4
  import { z } from "zod";
@@ -1,2 +1,2 @@
1
- import { n as SearchParams, r as searchResource, t as SearchPage } from "../search-BQWkdVg1.js";
1
+ import { n as SearchParams, r as searchResource, t as SearchPage } from "../search-DjJ_lu_o.js";
2
2
  export { SearchPage, SearchParams, searchResource };
@@ -1,4 +1,4 @@
1
- import { t as explainer } from "../refusal-B9aeHMc9.js";
1
+ import { t as explainer } from "../refusal-CvN0pxPR.js";
2
2
  import { SearchResult } from "../domain/search.js";
3
3
  import { z } from "zod";
4
4
  //#region src/resources/search.ts
@@ -1,2 +1,2 @@
1
- import { n as segmentResource, t as SegmentArchiveParams } from "../segment-jyhBtOAZ.js";
1
+ import { n as segmentResource, t as SegmentArchiveParams } from "../segment-BR0OAdWN.js";
2
2
  export { SegmentArchiveParams, segmentResource };
@@ -1,4 +1,4 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-CS11mEqI.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CM-eJat3.js";
2
2
  import { t as ListResult } from "../list-BT_bBm9Z.js";
3
3
  import { t as Setting } from "../setting-DXuQGXGF.js";
4
4
  //#region src/resources/setting.d.ts
@@ -1,4 +1,4 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-CS11mEqI.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CM-eJat3.js";
2
2
  import { n as SetupResult, t as SetupInput } from "../setup-JqcJ2unJ.js";
3
3
  //#region src/resources/setup.d.ts
4
4
  declare function setupResource(transport: Transport): {
@@ -1,2 +1,2 @@
1
- import { n as snippetResource, t as SnippetListParams } from "../snippet-DsgohpTV.js";
1
+ import { n as snippetResource, t as SnippetListParams } from "../snippet-C5naeVEd.js";
2
2
  export { SnippetListParams, snippetResource };
@@ -1,2 +1,2 @@
1
- import { n as tableResource, t as TableListParams } from "../table-B1pQSpTA.js";
1
+ import { n as tableResource, t as TableListParams } from "../table-DT3kO7JU.js";
2
2
  export { TableListParams, tableResource };