@metabase/client 0.1.1 → 0.1.3

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 (137) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +5 -3
  3. package/dist/auth/credential.d.ts +1 -1
  4. package/dist/auth/oauth-login.d.ts +1 -1
  5. package/dist/auth/oauth-login.js +1 -1
  6. package/dist/auth/oauth-session.d.ts +1 -1
  7. package/dist/{card-BxBzr5Uj.d.ts → card-BBLDmhtp.d.ts} +1 -1
  8. package/dist/{card-DN0sLkCG.d.ts → card-DkHtPMK4.d.ts} +3 -3
  9. package/dist/{client-DdXLlH1B.d.ts → client-eOkt3tTd.d.ts} +100 -82
  10. package/dist/client.d.ts +1 -1
  11. package/dist/{collection-DGnTvD6R.d.ts → collection-BtjnSckn.d.ts} +10 -10
  12. package/dist/{collection-fFahL-ub.d.ts → collection-DWjkDrln.d.ts} +4 -4
  13. package/dist/{credential-6aOEGqMH.d.ts → credential-B6fKSvqp.d.ts} +1 -1
  14. package/dist/{dashboard-CM7RmNeE.d.ts → dashboard-B4qWeR10.d.ts} +1 -1
  15. package/dist/{data-action-CkXVrOUH.d.ts → data-action-DqwcRA7B.d.ts} +61 -10
  16. package/dist/{database-B0JNZjDN.d.ts → database-Cw8ICtQi.d.ts} +3 -3
  17. package/dist/{database-BxqDmfcj.d.ts → database-DULVEXki.d.ts} +1 -1
  18. package/dist/{dataset-BUirJ1rO.d.ts → dataset-26H-dH4N.d.ts} +3 -3
  19. package/dist/{dataset-BBNGPVec.d.ts → dataset-Du1GRHhd.d.ts} +6 -6
  20. package/dist/{dependency-arB8Cr2H.d.ts → dependency-B8aPt_IM.d.ts} +33 -33
  21. package/dist/{dependency-CzpXmeu7.d.ts → dependency-elYkHuk5.d.ts} +25 -25
  22. package/dist/{document-tLd6pYWe.d.ts → document-rqUlE_OE.d.ts} +1 -1
  23. package/dist/domain/card.d.ts +1 -1
  24. package/dist/domain/collection.d.ts +1 -1
  25. package/dist/domain/data-action.d.ts +2 -2
  26. package/dist/domain/data-action.js +43 -10
  27. package/dist/domain/database.d.ts +1 -1
  28. package/dist/domain/dataset.d.ts +1 -1
  29. package/dist/domain/dependency.d.ts +1 -1
  30. package/dist/domain/document.d.ts +1 -1
  31. package/dist/domain/eid-translation.d.ts +1 -1
  32. package/dist/domain/field.d.ts +1 -1
  33. package/dist/domain/git-sync.d.ts +1 -1
  34. package/dist/domain/metric.d.ts +1 -1
  35. package/dist/domain/replacement.d.ts +1 -1
  36. package/dist/domain/revision.d.ts +1 -1
  37. package/dist/domain/search.d.ts +1 -1
  38. package/dist/domain/table.d.ts +1 -1
  39. package/dist/domain/timeline.d.ts +1 -1
  40. package/dist/domain/transform-inspector.d.ts +1 -1
  41. package/dist/{eid-translation-CH6NPWd-.d.ts → eid-translation-CP79Tz71.d.ts} +5 -5
  42. package/dist/{erd-CbV7xvAc.d.ts → erd-D2fpjDTj.d.ts} +1 -1
  43. package/dist/errors.d.ts +1 -1
  44. package/dist/{field-p9Rme2zB.d.ts → field-D-kF3G7v.d.ts} +2 -2
  45. package/dist/{field-D1Pfk-0S.d.ts → field-awM3Y7IP.d.ts} +2 -2
  46. package/dist/{git-sync-BTf1aYHr.d.ts → git-sync-8Tk8TirZ.d.ts} +1 -1
  47. package/dist/{git-sync-C99SVdJ9.d.ts → git-sync-nvbSaNfS.d.ts} +1 -1
  48. package/dist/{glossary-DFvnz-E5.d.ts → glossary-CQMSJmIx.d.ts} +1 -1
  49. package/dist/http/errors.d.ts +1 -1
  50. package/dist/http/oauth.d.ts +1 -1
  51. package/dist/http/oauth.js +47 -36
  52. package/dist/http/transport.d.ts +1 -1
  53. package/dist/index.d.ts +26 -26
  54. package/dist/index.js +3 -3
  55. package/dist/{json-BksZpXDC.d.ts → json-DvOVLFVY.d.ts} +1 -1
  56. package/dist/json.d.ts +1 -1
  57. package/dist/{measure-lPz8qnwz.d.ts → measure-D4ArCbsa.d.ts} +1 -1
  58. package/dist/{metric-DcYloqOQ.d.ts → metric-BtEVH_Yp.d.ts} +1 -1
  59. package/dist/{notification-Cp5GJErS.d.ts → notification-BsuPAfMW.d.ts} +1 -1
  60. package/dist/{oauth-C4ordeoJ.d.ts → oauth-CVoZpuq8.d.ts} +4 -2
  61. package/dist/{oauth-login-D734Jvbq.js → oauth-login--tDagiZu.js} +29 -11
  62. package/dist/{oauth-login-CJsT_3EE.d.ts → oauth-login-SZ4Csai8.d.ts} +3 -2
  63. package/dist/{oauth-session-BlIlcd8Q.d.ts → oauth-session-COLH4puN.d.ts} +1 -1
  64. package/dist/{paginate-COuL0Gzl.d.ts → paginate-Du9kUbXZ.d.ts} +1 -1
  65. package/dist/paginate.d.ts +1 -1
  66. package/dist/{pulse-BzKmz3Yn.d.ts → pulse-drQKS_pg.d.ts} +1 -1
  67. package/dist/{replacement-BGyggp-G.d.ts → replacement-CyvtbxGg.d.ts} +5 -5
  68. package/dist/{replacement-CVebCuNp.d.ts → replacement-g3IKzPPj.d.ts} +5 -5
  69. package/dist/{requirement-check-glU7wqhQ.d.ts → requirement-check-Nv0trVbp.d.ts} +1 -1
  70. package/dist/resources/api-key.d.ts +1 -1
  71. package/dist/resources/card.d.ts +1 -1
  72. package/dist/resources/collection.d.ts +1 -1
  73. package/dist/resources/collection.js +6 -1
  74. package/dist/resources/content-translation.d.ts +1 -1
  75. package/dist/resources/dashboard.d.ts +1 -1
  76. package/dist/resources/data-action.d.ts +22 -4
  77. package/dist/resources/data-action.js +10 -5
  78. package/dist/resources/data-app.d.ts +1 -1
  79. package/dist/resources/database.d.ts +1 -1
  80. package/dist/resources/dataset.d.ts +1 -1
  81. package/dist/resources/dependency.d.ts +1 -1
  82. package/dist/resources/document.d.ts +2 -2
  83. package/dist/resources/eid-translation.d.ts +2 -2
  84. package/dist/resources/erd.d.ts +1 -1
  85. package/dist/resources/field.d.ts +1 -1
  86. package/dist/resources/git-sync.d.ts +1 -1
  87. package/dist/resources/glossary.d.ts +1 -1
  88. package/dist/resources/library.d.ts +1 -1
  89. package/dist/resources/measure.d.ts +1 -1
  90. package/dist/resources/metric.d.ts +1 -1
  91. package/dist/resources/moderation-review.d.ts +1 -1
  92. package/dist/resources/notification.d.ts +1 -1
  93. package/dist/resources/optional-parsed.d.ts +1 -1
  94. package/dist/resources/permission.d.ts +1 -1
  95. package/dist/resources/pivot-export.d.ts +1 -1
  96. package/dist/resources/pulse.d.ts +1 -1
  97. package/dist/resources/replacement.d.ts +1 -1
  98. package/dist/resources/revision.d.ts +3 -3
  99. package/dist/resources/search.d.ts +1 -1
  100. package/dist/resources/segment.d.ts +1 -1
  101. package/dist/resources/setting.d.ts +1 -1
  102. package/dist/resources/setup.d.ts +1 -1
  103. package/dist/resources/snippet.d.ts +1 -1
  104. package/dist/resources/table.d.ts +1 -1
  105. package/dist/resources/timeline-event.d.ts +2 -2
  106. package/dist/resources/timeline.d.ts +1 -1
  107. package/dist/resources/transform-dag-run.d.ts +1 -1
  108. package/dist/resources/transform-inspector.d.ts +2 -2
  109. package/dist/resources/transform-job.d.ts +1 -1
  110. package/dist/resources/transform-python.d.ts +1 -1
  111. package/dist/resources/transform-tag.d.ts +1 -1
  112. package/dist/resources/transform-test.d.ts +1 -1
  113. package/dist/resources/transform.d.ts +1 -1
  114. package/dist/resources/upload.d.ts +1 -1
  115. package/dist/resources/user.d.ts +1 -1
  116. package/dist/{revision-Dyl-8p7d.d.ts → revision-Cft5Lcev.d.ts} +4 -4
  117. package/dist/{search-Cm5IxKss.d.ts → search-BUr4r7d2.d.ts} +5 -5
  118. package/dist/{search-Cten2h0I.d.ts → search-DX1IVRRC.d.ts} +2 -2
  119. package/dist/{segment-DQLX6r1E.d.ts → segment-c2EDEJNd.d.ts} +1 -1
  120. package/dist/signal.d.ts +3 -2
  121. package/dist/signal.js +9 -4
  122. package/dist/{snippet-Djn0rL21.d.ts → snippet-CSt-f812.d.ts} +1 -1
  123. package/dist/{table-CDZbLNow.d.ts → table-BA-k8Zgt.d.ts} +6 -6
  124. package/dist/{table-Od6uvDVW.d.ts → table-R-q8w__K.d.ts} +10 -10
  125. package/dist/{timeline-BK45hy-h.d.ts → timeline-B35sx1FM.d.ts} +31 -31
  126. package/dist/{timeline-BTs6fuRp.d.ts → timeline-D3Clk0_n.d.ts} +2 -2
  127. package/dist/{transform-WASQAXeA.d.ts → transform-DzgPup_a.d.ts} +2 -2
  128. package/dist/{transform-inspector-CMCh8WKV.d.ts → transform-inspector-BUYBt6--.d.ts} +4 -4
  129. package/dist/{transform-job-DmTwKxhc.d.ts → transform-job-DtLWrsyH.d.ts} +1 -1
  130. package/dist/{transform-test-CR_i54IV.d.ts → transform-test-B_HR-yKA.d.ts} +1 -1
  131. package/dist/{transport-BsXqRujn.d.ts → transport-CyHAGDqx.d.ts} +1 -1
  132. package/dist/{upload-B5YjVkSW.d.ts → upload-BSixoElJ.d.ts} +1 -1
  133. package/dist/version/capability-error.d.ts +1 -1
  134. package/dist/version/probe.d.ts +1 -1
  135. package/dist/version/profile.d.ts +1 -1
  136. package/dist/version/requirement-check.d.ts +1 -1
  137. package/package.json +1 -1
@@ -1,17 +1,33 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-BsXqRujn.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CyHAGDqx.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-CkXVrOUH.js";
3
+ import { l as DataActionUpdateInput, o as DataActionExecuteInput, r as DataAction, s as DataActionExecuteResult } from "../data-action-DqwcRA7B.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
1
  import { t as explainer } from "../refusal-B9aeHMc9.js";
2
- import { DATA_ACTION_COLLECTION_GATE, DataActionExecuteResult, dataActionSchema } from "../domain/data-action.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,4 +1,4 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-BsXqRujn.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CyHAGDqx.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): {
@@ -1,2 +1,2 @@
1
- import { i as databaseResource, n as DatabaseListParams, r as DatabaseSyncSchemaParams, t as DatabaseGetParams } from "../database-B0JNZjDN.js";
1
+ import { i as databaseResource, n as DatabaseListParams, r as DatabaseSyncSchemaParams, t as DatabaseGetParams } from "../database-Cw8ICtQi.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-BUirJ1rO.js";
1
+ import { n as DatasetNativeParams, r as datasetResource, t as DatasetExportParams } from "../dataset-26H-dH4N.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-CzpXmeu7.js";
1
+ import { a as dependencyResource, i as DependencyItemPageOptions, n as DependencyDependentsParams, r as DependencyItemListParams, t as DependencyBrokenParams } from "../dependency-elYkHuk5.js";
2
2
  export { DependencyBrokenParams, DependencyDependentsParams, DependencyItemListParams, DependencyItemPageOptions, dependencyResource };
@@ -1,6 +1,6 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-BsXqRujn.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CyHAGDqx.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>>;
@@ -1,5 +1,5 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-BsXqRujn.js";
2
- import { a as EidTranslateResult, i as EidTranslateInput } from "../eid-translation-CH6NPWd-.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CyHAGDqx.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-CbV7xvAc.js";
1
+ import { n as erdResource, t as ErdParams } from "../erd-D2fpjDTj.js";
2
2
  export { ErdParams, erdResource };
@@ -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-D1Pfk-0S.js";
1
+ import { a as FieldSetDataSensitivityParams, i as FieldSearchParams, n as FieldSearchBounded, o as fieldResource, r as FieldSearchByValue, t as FieldRemappingParams } from "../field-awM3Y7IP.js";
2
2
  export { FieldRemappingParams, FieldSearchBounded, FieldSearchByValue, FieldSearchParams, FieldSetDataSensitivityParams, fieldResource };
@@ -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-BTf1aYHr.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-8Tk8TirZ.js";
2
2
  export { SyncCreateBranchParams, SyncExportParams, SyncExportPreflightParams, SyncImportParams, SyncRemoteChangesParams, SyncScopeCollection, SyncStashParams, SyncWaitParams, gitSyncResource };
@@ -1,2 +1,2 @@
1
- import { n as glossaryResource, t as GlossaryListParams } from "../glossary-DFvnz-E5.js";
1
+ import { n as glossaryResource, t as GlossaryListParams } from "../glossary-CQMSJmIx.js";
2
2
  export { GlossaryListParams, glossaryResource };
@@ -1,4 +1,4 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-BsXqRujn.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CyHAGDqx.js";
2
2
  //#region src/resources/library.d.ts
3
3
  declare function libraryResource(transport: Transport): {
4
4
  get: (options?: RequestOptions | undefined) => Promise<{
@@ -1,2 +1,2 @@
1
- import { n as measureResource, t as MeasureArchiveParams } from "../measure-lPz8qnwz.js";
1
+ import { n as measureResource, t as MeasureArchiveParams } from "../measure-D4ArCbsa.js";
2
2
  export { MeasureArchiveParams, measureResource };
@@ -1,2 +1,2 @@
1
- import { i as metricResource, r as MetricDimensionListParams } from "../client-DdXLlH1B.js";
1
+ import { i as metricResource, r as MetricDimensionListParams } from "../client-eOkt3tTd.js";
2
2
  export { MetricDimensionListParams, metricResource };
@@ -1,4 +1,4 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-BsXqRujn.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CyHAGDqx.js";
2
2
  //#region src/resources/moderation-review.d.ts
3
3
  declare function moderationReviewResource(transport: Transport): {
4
4
  create: (params: {
@@ -1,2 +1,2 @@
1
- import { i as notificationResource, n as assertCardAlert, r as mergeAlertUpdate, t as NotificationListParams } from "../notification-Cp5GJErS.js";
1
+ import { i as notificationResource, n as assertCardAlert, r as mergeAlertUpdate, t as NotificationListParams } from "../notification-BsuPAfMW.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-BsXqRujn.js";
1
+ import { f as RequestOptions, g as TransportRequestOptions, h as Transport } from "../transport-CyHAGDqx.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-BsXqRujn.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CyHAGDqx.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-BsXqRujn.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CyHAGDqx.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-BzKmz3Yn.js";
1
+ import { n as mergePulseUpdate, r as pulseResource, t as PulseListParams } from "../pulse-drQKS_pg.js";
2
2
  export { PulseListParams, mergePulseUpdate, pulseResource };
@@ -1,2 +1,2 @@
1
- import { n as replacementResource, t as ReplacementRunListParams } from "../replacement-CVebCuNp.js";
1
+ import { n as replacementResource, t as ReplacementRunListParams } from "../replacement-g3IKzPPj.js";
2
2
  export { ReplacementRunListParams, replacementResource };
@@ -1,8 +1,8 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-BsXqRujn.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CyHAGDqx.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,2 +1,2 @@
1
- import { n as SearchParams, r as searchResource, t as SearchPage } from "../search-Cten2h0I.js";
1
+ import { n as SearchParams, r as searchResource, t as SearchPage } from "../search-DX1IVRRC.js";
2
2
  export { SearchPage, SearchParams, searchResource };
@@ -1,2 +1,2 @@
1
- import { n as segmentResource, t as SegmentArchiveParams } from "../segment-DQLX6r1E.js";
1
+ import { n as segmentResource, t as SegmentArchiveParams } from "../segment-c2EDEJNd.js";
2
2
  export { SegmentArchiveParams, segmentResource };
@@ -1,4 +1,4 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-BsXqRujn.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CyHAGDqx.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-BsXqRujn.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CyHAGDqx.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-Djn0rL21.js";
1
+ import { n as snippetResource, t as SnippetListParams } from "../snippet-CSt-f812.js";
2
2
  export { SnippetListParams, snippetResource };
@@ -1,2 +1,2 @@
1
- import { n as tableResource, t as TableListParams } from "../table-CDZbLNow.js";
1
+ import { n as tableResource, t as TableListParams } from "../table-BA-k8Zgt.js";
2
2
  export { TableListParams, tableResource };
@@ -1,5 +1,5 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-BsXqRujn.js";
2
- import { i as TimelineEvent, o as TimelineEventCreateInput, s as TimelineEventUpdateInput } from "../timeline-BK45hy-h.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CyHAGDqx.js";
2
+ import { i as TimelineEvent, o as TimelineEventCreateInput, s as TimelineEventUpdateInput } from "../timeline-B35sx1FM.js";
3
3
  //#region src/resources/timeline-event.d.ts
4
4
  declare function timelineEventResource(transport: Transport): {
5
5
  get: (id: number, options?: RequestOptions) => Promise<TimelineEvent>;
@@ -1,2 +1,2 @@
1
- import { n as TimelineListParams, r as timelineResource, t as TimelineEventsParams } from "../timeline-BTs6fuRp.js";
1
+ import { n as TimelineListParams, r as timelineResource, t as TimelineEventsParams } from "../timeline-D3Clk0_n.js";
2
2
  export { TimelineEventsParams, TimelineListParams, timelineResource };
@@ -1,4 +1,4 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-BsXqRujn.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CyHAGDqx.js";
2
2
  import { t as ListResult } from "../list-BT_bBm9Z.js";
3
3
  //#region src/resources/transform-dag-run.d.ts
4
4
  declare function transformDagRunResource(transport: Transport): {
@@ -1,4 +1,4 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-BsXqRujn.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CyHAGDqx.js";
2
2
  //#region src/resources/transform-inspector.d.ts
3
3
  declare function transformInspectorResource(transport: Transport): {
4
4
  discover: (id: number, options?: RequestOptions | undefined) => Promise<{
@@ -149,7 +149,7 @@ declare function transformInspectorResource(transport: Transport): {
149
149
  [x: string]: unknown;
150
150
  name: string;
151
151
  };
152
- severity: "warning" | "info" | "error";
152
+ severity: "error" | "info" | "warning";
153
153
  message: string;
154
154
  metadata?: {
155
155
  [x: string]: unknown;
@@ -1,2 +1,2 @@
1
- import { n as transformJobResource, t as TransformJobRunParams } from "../transform-job-DmTwKxhc.js";
1
+ import { n as transformJobResource, t as TransformJobRunParams } from "../transform-job-DtLWrsyH.js";
2
2
  export { TransformJobRunParams, transformJobResource };
@@ -1,4 +1,4 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-BsXqRujn.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CyHAGDqx.js";
2
2
  //#region src/resources/transform-python.d.ts
3
3
  declare function transformPythonResource(transport: Transport): {
4
4
  getLibrary: (path: string, options?: RequestOptions | undefined) => Promise<{
@@ -1,4 +1,4 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-BsXqRujn.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CyHAGDqx.js";
2
2
  import { t as ListResult } from "../list-BT_bBm9Z.js";
3
3
  //#region src/resources/transform-tag.d.ts
4
4
  declare function transformTagResource(transport: Transport): {
@@ -1,2 +1,2 @@
1
- import { n as transformTestResource, t as TransformTestListParams } from "../transform-test-CR_i54IV.js";
1
+ import { n as transformTestResource, t as TransformTestListParams } from "../transform-test-B_HR-yKA.js";
2
2
  export { TransformTestListParams, transformTestResource };
@@ -1,2 +1,2 @@
1
- import { a as TransformRunSummaryPageParams, i as TransformRunParams, n as TransformRunPageOptions, o as transformResource, r as TransformRunPageParams, t as TransformDagParams } from "../transform-WASQAXeA.js";
1
+ import { a as TransformRunSummaryPageParams, i as TransformRunParams, n as TransformRunPageOptions, o as transformResource, r as TransformRunPageParams, t as TransformDagParams } from "../transform-DzgPup_a.js";
2
2
  export { TransformDagParams, TransformRunPageOptions, TransformRunPageParams, TransformRunParams, TransformRunSummaryPageParams, transformResource };
@@ -1,2 +1,2 @@
1
- import { n as uploadResource, t as UploadCsvParams } from "../upload-B5YjVkSW.js";
1
+ import { n as uploadResource, t as UploadCsvParams } from "../upload-BSixoElJ.js";
2
2
  export { UploadCsvParams, uploadResource };
@@ -1,4 +1,4 @@
1
- import { f as RequestOptions, h as Transport } from "../transport-BsXqRujn.js";
1
+ import { f as RequestOptions, h as Transport } from "../transport-CyHAGDqx.js";
2
2
  import { t as CurrentUser } from "../user-Sqqv7rqh.js";
3
3
  //#region src/resources/user.d.ts
4
4
  declare function userResource(transport: Transport): {
@@ -2,12 +2,12 @@ import { r as InputGate } from "./input-gates-DwKoTJVQ.js";
2
2
  import { z } from "zod";
3
3
  //#region src/domain/revision.d.ts
4
4
  declare const RevisionEntity: z.ZodEnum<{
5
- transform: "transform";
6
5
  card: "card";
7
6
  dashboard: "dashboard";
8
7
  document: "document";
9
8
  measure: "measure";
10
9
  segment: "segment";
10
+ transform: "transform";
11
11
  "transform-test": "transform-test";
12
12
  }>;
13
13
  type RevisionEntity = z.infer<typeof RevisionEntity>;
@@ -30,14 +30,14 @@ declare const Revision: z.ZodObject<{
30
30
  type Revision = z.infer<typeof Revision>;
31
31
  declare const RevisionCompact: z.ZodObject<{
32
32
  id: z.ZodNumber;
33
- description: z.ZodString;
34
- timestamp: z.ZodString;
35
33
  user: z.ZodObject<{
36
34
  id: z.ZodNumber;
37
35
  first_name: z.ZodNullable<z.ZodString>;
38
36
  last_name: z.ZodNullable<z.ZodString>;
39
37
  common_name: z.ZodString;
40
38
  }, z.core.$loose>;
39
+ description: z.ZodString;
40
+ timestamp: z.ZodString;
41
41
  is_creation: z.ZodBoolean;
42
42
  is_reversion: z.ZodBoolean;
43
43
  }, z.core.$strip>;
@@ -57,12 +57,12 @@ type RevisionRow = z.infer<typeof RevisionRow>;
57
57
  declare const REVISION_ENTITY_GATES: readonly InputGate[];
58
58
  declare const RevisionRevertInput: z.ZodObject<{
59
59
  entity: z.ZodEnum<{
60
- transform: "transform";
61
60
  card: "card";
62
61
  dashboard: "dashboard";
63
62
  document: "document";
64
63
  measure: "measure";
65
64
  segment: "segment";
65
+ transform: "transform";
66
66
  "transform-test": "transform-test";
67
67
  }>;
68
68
  id: z.ZodNumber;
@@ -2,7 +2,6 @@ import { z } from "zod";
2
2
  //#region src/domain/search.d.ts
3
3
  declare const SEARCH_MODELS: readonly ["card", "dataset", "metric", "dashboard", "collection", "database", "table", "segment", "measure", "document", "exploration", "action", "transform", "indexed-entity"];
4
4
  declare const SearchModel: z.ZodEnum<{
5
- transform: "transform";
6
5
  collection: "collection";
7
6
  card: "card";
8
7
  dashboard: "dashboard";
@@ -13,6 +12,7 @@ declare const SearchModel: z.ZodEnum<{
13
12
  measure: "measure";
14
13
  segment: "segment";
15
14
  table: "table";
15
+ transform: "transform";
16
16
  exploration: "exploration";
17
17
  "indexed-entity": "indexed-entity";
18
18
  action: "action";
@@ -22,7 +22,6 @@ declare const SearchResult: z.ZodObject<{
22
22
  id: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
23
23
  name: z.ZodString;
24
24
  model: z.ZodEnum<{
25
- transform: "transform";
26
25
  collection: "collection";
27
26
  card: "card";
28
27
  dashboard: "dashboard";
@@ -33,6 +32,7 @@ declare const SearchResult: z.ZodObject<{
33
32
  measure: "measure";
34
33
  segment: "segment";
35
34
  table: "table";
35
+ transform: "transform";
36
36
  exploration: "exploration";
37
37
  "indexed-entity": "indexed-entity";
38
38
  action: "action";
@@ -61,10 +61,7 @@ declare const SearchResult: z.ZodObject<{
61
61
  type SearchResult = z.infer<typeof SearchResult>;
62
62
  declare const SearchResultCompact: z.ZodObject<{
63
63
  id: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
64
- name: z.ZodString;
65
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
66
64
  model: z.ZodEnum<{
67
- transform: "transform";
68
65
  collection: "collection";
69
66
  card: "card";
70
67
  dashboard: "dashboard";
@@ -75,10 +72,13 @@ declare const SearchResultCompact: z.ZodObject<{
75
72
  measure: "measure";
76
73
  segment: "segment";
77
74
  table: "table";
75
+ transform: "transform";
78
76
  exploration: "exploration";
79
77
  "indexed-entity": "indexed-entity";
80
78
  action: "action";
81
79
  }>;
80
+ name: z.ZodString;
81
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
82
82
  table_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
83
83
  database_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
84
84
  table_schema: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -1,5 +1,5 @@
1
- import { f as RequestOptions, h as Transport } from "./transport-BsXqRujn.js";
2
- import { n as SearchModel, r as SearchResult } from "./search-Cm5IxKss.js";
1
+ import { f as RequestOptions, h as Transport } from "./transport-CyHAGDqx.js";
2
+ import { n as SearchModel, r as SearchResult } from "./search-BUr4r7d2.js";
3
3
  //#region src/resources/search.d.ts
4
4
  interface SearchPage {
5
5
  data: SearchResult[];
@@ -1,4 +1,4 @@
1
- import { f as RequestOptions, h as Transport } from "./transport-BsXqRujn.js";
1
+ import { f as RequestOptions, h as Transport } from "./transport-CyHAGDqx.js";
2
2
  import { t as ListResult } from "./list-BT_bBm9Z.js";
3
3
  import { i as SegmentUpdateInput, r as SegmentCreateInput, t as Segment } from "./segment-CbAgVO-5.js";
4
4
  //#region src/resources/segment.d.ts
package/dist/signal.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { X as MetabaseError } from "./transport-BsXqRujn.js";
1
+ import { X as MetabaseError } from "./transport-CyHAGDqx.js";
2
2
  //#region src/signal.d.ts
3
3
  declare function combineAborts(...signals: Array<AbortSignal | undefined>): AbortSignal;
4
4
  declare function throwIfAborted(...signals: Array<AbortSignal | undefined>): void;
5
5
  declare function abortReason(signal: AbortSignal): MetabaseError;
6
6
  declare function untilAborted<T>(promise: Promise<T>, signal: AbortSignal | undefined): Promise<T>;
7
+ declare function whenAborted(signal: AbortSignal | undefined, onAbort: (reason: MetabaseError) => void): () => void;
7
8
  //#endregion
8
- export { abortReason, combineAborts, throwIfAborted, untilAborted };
9
+ export { abortReason, combineAborts, throwIfAborted, untilAborted, whenAborted };
package/dist/signal.js CHANGED
@@ -16,10 +16,15 @@ function untilAborted(promise, signal) {
16
16
  if (signal === void 0) return promise;
17
17
  throwIfAborted(signal);
18
18
  return new Promise((resolve, reject) => {
19
- const onAbort = () => reject(abortReason(signal));
20
- signal.addEventListener("abort", onAbort, { once: true });
21
- promise.then(resolve, reject).finally(() => signal.removeEventListener("abort", onAbort));
19
+ const stopWatching = whenAborted(signal, reject);
20
+ promise.then(resolve, reject).finally(stopWatching);
22
21
  });
23
22
  }
23
+ function whenAborted(signal, onAbort) {
24
+ if (signal === void 0) return () => void 0;
25
+ const listener = () => onAbort(abortReason(signal));
26
+ signal.addEventListener("abort", listener, { once: true });
27
+ return () => signal.removeEventListener("abort", listener);
28
+ }
24
29
  //#endregion
25
- export { abortReason, combineAborts, throwIfAborted, untilAborted };
30
+ export { abortReason, combineAborts, throwIfAborted, untilAborted, whenAborted };
@@ -1,4 +1,4 @@
1
- import { f as RequestOptions, h as Transport } from "./transport-BsXqRujn.js";
1
+ import { f as RequestOptions, h as Transport } from "./transport-CyHAGDqx.js";
2
2
  import { t as ListResult } from "./list-BT_bBm9Z.js";
3
3
  import { i as SnippetUpdateInput, r as SnippetCreateInput, t as Snippet } from "./snippet-C_Ilx7tR.js";
4
4
  //#region src/resources/snippet.d.ts
@@ -1,6 +1,6 @@
1
- import { f as RequestOptions, h as Transport } from "./transport-BsXqRujn.js";
1
+ import { f as RequestOptions, h as Transport } from "./transport-CyHAGDqx.js";
2
2
  import { t as ListResult } from "./list-BT_bBm9Z.js";
3
- import { S as TableSchemaSyncResult, a as Table, g as TableForeignKey, h as TableFieldValuesResult, p as TableDataSource, u as TableDataLayer, y as TableQueryMetadata } from "./table-Od6uvDVW.js";
3
+ import { S as TableSchemaSyncResult, a as Table, g as TableForeignKey, h as TableFieldValuesResult, p as TableDataSource, u as TableDataLayer, y as TableQueryMetadata } from "./table-R-q8w__K.js";
4
4
  import { r as UploadUpdateResult } from "./upload-UPfZFdbH.js";
5
5
  import { t as CsvFile } from "./csv-upload--K35QedP.js";
6
6
  //#region src/resources/table.d.ts
@@ -67,9 +67,9 @@ declare function tableResource(transport: Transport): {
67
67
  caveats?: string | null | undefined;
68
68
  points_of_interest?: string | null | undefined;
69
69
  show_in_getting_started?: boolean | undefined;
70
- field_order?: "custom" | "database" | "alphabetical" | "smart" | undefined;
70
+ field_order?: "database" | "custom" | "alphabetical" | "smart" | undefined;
71
71
  data_authority?: "unconfigured" | "authoritative" | "computed" | "ingested" | null | undefined;
72
- data_source?: "unknown" | "transform" | "upload" | "ingested" | "metabase-transform" | "source-data" | null | undefined;
72
+ data_source?: "unknown" | "upload" | "transform" | "ingested" | "metabase-transform" | "source-data" | null | undefined;
73
73
  data_layer?: "internal" | "hidden" | "final" | "gold" | "silver" | "bronze" | "copper" | null | undefined;
74
74
  owner_email?: string | null | undefined;
75
75
  owner_user_id?: number | null | undefined;
@@ -122,7 +122,7 @@ declare function tableResource(transport: Transport): {
122
122
  schema_ids?: string[] | undefined;
123
123
  table_ids?: number[] | undefined;
124
124
  data_authority?: "unconfigured" | "authoritative" | "computed" | "ingested" | null | undefined;
125
- data_source?: "unknown" | "transform" | "upload" | "ingested" | "metabase-transform" | "source-data" | null | undefined;
125
+ data_source?: "unknown" | "upload" | "transform" | "ingested" | "metabase-transform" | "source-data" | null | undefined;
126
126
  data_layer?: "internal" | "hidden" | "final" | null | undefined;
127
127
  entity_type?: "entity/GenericTable" | "entity/UserTable" | "entity/CompanyTable" | "entity/TransactionTable" | "entity/ProductTable" | "entity/SubscriptionTable" | "entity/EventTable" | null | undefined;
128
128
  owner_email?: string | null | undefined;
@@ -133,7 +133,7 @@ declare function tableResource(transport: Transport): {
133
133
  schema_ids?: string[] | undefined;
134
134
  table_ids?: number[] | undefined;
135
135
  data_authority?: "unconfigured" | "authoritative" | "computed" | "ingested" | null | undefined;
136
- data_source?: "unknown" | "transform" | "upload" | "ingested" | "metabase-transform" | "source-data" | null | undefined;
136
+ data_source?: "unknown" | "upload" | "transform" | "ingested" | "metabase-transform" | "source-data" | null | undefined;
137
137
  data_layer?: "internal" | "hidden" | "final" | null | undefined;
138
138
  entity_type?: "entity/GenericTable" | "entity/UserTable" | "entity/CompanyTable" | "entity/TransactionTable" | "entity/ProductTable" | "entity/SubscriptionTable" | "entity/EventTable" | null | undefined;
139
139
  owner_email?: string | null | undefined;