@malloy-publisher/sdk 0.3.1 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/README.md +33 -9
  2. package/dist/{DocumentStorageProvider-tGvodI8f.es.js → DocumentStorage-BiFqO15i.es.js} +7126 -6943
  3. package/dist/DocumentStorage-CMyLifsz.cjs.js +134 -0
  4. package/dist/RenderedResult-CZzE8wv-.cjs.js +115 -0
  5. package/dist/{RenderedResult-mDE-4u8S.es.js → RenderedResult-CvrmYyr5.es.js} +64 -57
  6. package/dist/{ServerProvider-X2Ma0HRs.es.js → ServerProvider-BWOEKg0O.es.js} +1217 -1244
  7. package/dist/ServerProvider-Cc489A3f.cjs.js +1 -0
  8. package/dist/builder/index.cjs.js +52 -52
  9. package/dist/builder/index.es.js +3961 -3960
  10. package/dist/client/api.d.ts +100 -42
  11. package/dist/client/index.cjs.js +1 -1
  12. package/dist/client/index.es.js +1 -1
  13. package/dist/components/AppDialog.d.ts +30 -0
  14. package/dist/components/BackLink.d.ts +32 -0
  15. package/dist/components/Dashboard/DashboardBar.d.ts +21 -0
  16. package/dist/components/Dashboard/telemetry.d.ts +24 -7
  17. package/dist/components/DashboardBuilder/BuilderToolbar.d.ts +12 -10
  18. package/dist/components/DashboardBuilder/DashboardBuilder.d.ts +20 -2
  19. package/dist/components/DashboardBuilder/DashboardEditor.d.ts +21 -11
  20. package/dist/components/DashboardBuilder/newDashboard.d.ts +17 -0
  21. package/dist/components/DashboardBuilder/spliceDocument.d.ts +10 -1
  22. package/dist/components/DocumentStorage/DocumentStorage.d.ts +69 -5
  23. package/dist/components/DocumentStorage/index.d.ts +1 -0
  24. package/dist/components/ItemRow.d.ts +38 -0
  25. package/dist/components/Materializations/MaterializationDetailDialog.d.ts +1 -2
  26. package/dist/components/Materializations/MaterializationRunsList.d.ts +1 -5
  27. package/dist/components/Materializations/Materializations.d.ts +7 -3
  28. package/dist/components/Materializations/ScopeButton.d.ts +18 -0
  29. package/dist/components/Materializations/SectionLabel.d.ts +7 -4
  30. package/dist/components/Materializations/TriggerLabel.d.ts +14 -0
  31. package/dist/components/Materializations/index.d.ts +0 -1
  32. package/dist/components/Package/ContentTypeIcon.d.ts +3 -5
  33. package/dist/components/Package/NewDashboardDialog.d.ts +18 -0
  34. package/dist/components/Package/index.d.ts +0 -1
  35. package/dist/components/PackageSection.d.ts +23 -0
  36. package/dist/components/buttons.d.ts +53 -0
  37. package/dist/components/index.d.ts +5 -0
  38. package/dist/components/styles.d.ts +49 -40
  39. package/dist/hooks/useCrudMutation.d.ts +42 -0
  40. package/dist/index.cjs.js +22 -26
  41. package/dist/index.d.ts +1 -0
  42. package/dist/index.es.js +17431 -20676
  43. package/dist/telemetry/consoleEvents.d.ts +60 -0
  44. package/dist/utils/sha256.d.ts +2 -0
  45. package/package.json +1 -1
  46. package/src/components/AppDialog.tsx +115 -0
  47. package/src/components/BackLink.tsx +83 -0
  48. package/src/components/Connections/AddConnectionDialog.tsx +50 -70
  49. package/src/components/Connections/DeleteConnectionDialog.tsx +23 -50
  50. package/src/components/Connections/EditConnectionDialog.tsx +54 -73
  51. package/src/components/Dashboard/DashboardBar.tsx +88 -0
  52. package/src/components/Dashboard/telemetry.ts +24 -5
  53. package/src/components/DashboardBuilder/AddTileDialog.tsx +141 -143
  54. package/src/components/DashboardBuilder/BuilderToolbar.tsx +110 -218
  55. package/src/components/DashboardBuilder/DashboardBuilder.spec.tsx +5 -11
  56. package/src/components/DashboardBuilder/DashboardBuilder.tsx +202 -171
  57. package/src/components/DashboardBuilder/DashboardEditor.authoritative.spec.tsx +706 -0
  58. package/src/components/DashboardBuilder/DashboardEditor.package.spec.tsx +163 -0
  59. package/src/components/DashboardBuilder/DashboardEditor.spec.tsx +2 -25
  60. package/src/components/DashboardBuilder/DashboardEditor.tsx +442 -94
  61. package/src/components/DashboardBuilder/DiffDialog.tsx +75 -82
  62. package/src/components/DashboardBuilder/DrillDialog.tsx +144 -156
  63. package/src/components/DashboardBuilder/FilterDialog.tsx +276 -295
  64. package/src/components/DashboardBuilder/FilterStrip.tsx +11 -10
  65. package/src/components/DashboardBuilder/newDashboard.spec.ts +40 -0
  66. package/src/components/DashboardBuilder/newDashboard.ts +48 -0
  67. package/src/components/DashboardBuilder/spliceDocument.spec.ts +53 -0
  68. package/src/components/DashboardBuilder/spliceDocument.ts +45 -8
  69. package/src/components/DashboardBuilder/useDashboardEditor.spec.ts +56 -0
  70. package/src/components/DashboardBuilder/useDashboardEditor.ts +12 -4
  71. package/src/components/DocumentStorage/BrowserDocumentStorage.ts +7 -6
  72. package/src/components/DocumentStorage/DocumentStorage.ts +78 -5
  73. package/src/components/DocumentStorage/index.ts +1 -0
  74. package/src/components/Environment/About.tsx +14 -28
  75. package/src/components/Environment/AddPackageDialog.tsx +85 -154
  76. package/src/components/Environment/Connections.tsx +125 -205
  77. package/src/components/Environment/DeletePackageDialog.tsx +32 -77
  78. package/src/components/Environment/EditPackageDialog.tsx +46 -58
  79. package/src/components/Environment/Environment.tsx +34 -36
  80. package/src/components/Environment/Packages.tsx +63 -128
  81. package/src/components/Home/AddEnvironmentDialog.tsx +47 -70
  82. package/src/components/Home/DeleteEnvironmentDialog.tsx +32 -77
  83. package/src/components/Home/EditEnvironmentDialog.tsx +47 -61
  84. package/src/components/Home/Home.tsx +101 -214
  85. package/src/components/ItemRow.tsx +165 -0
  86. package/src/components/Materializations/CreateMaterializationDialog.tsx +34 -51
  87. package/src/components/Materializations/DeleteMaterializationDialog.tsx +31 -53
  88. package/src/components/Materializations/MaterializationDetailDialog.tsx +60 -69
  89. package/src/components/Materializations/MaterializationRunsList.tsx +29 -42
  90. package/src/components/Materializations/Materializations.tsx +137 -140
  91. package/src/components/Materializations/ScopeButton.tsx +85 -0
  92. package/src/components/Materializations/SectionLabel.tsx +7 -4
  93. package/src/components/Materializations/SetScheduleDialog.tsx +48 -89
  94. package/src/components/Materializations/TriggerLabel.tsx +36 -0
  95. package/src/components/Materializations/cron.spec.ts +113 -0
  96. package/src/components/Materializations/index.ts +0 -1
  97. package/src/components/Materializations/utils.spec.ts +182 -0
  98. package/src/components/Package/ContentTypeIcon.spec.ts +22 -37
  99. package/src/components/Package/ContentTypeIcon.tsx +10 -12
  100. package/src/components/Package/NewDashboardDialog.spec.tsx +129 -0
  101. package/src/components/Package/NewDashboardDialog.tsx +265 -0
  102. package/src/components/Package/Package.tsx +184 -238
  103. package/src/components/Package/index.ts +0 -1
  104. package/src/components/PackageSection.tsx +85 -0
  105. package/src/components/RenderedResult/RenderedResult.lifecycle.spec.tsx +198 -0
  106. package/src/components/RenderedResult/RenderedResult.tsx +22 -8
  107. package/src/components/ResultsDialog.tsx +8 -32
  108. package/src/components/buttons.tsx +114 -0
  109. package/src/components/designSystem.spec.tsx +316 -0
  110. package/src/components/given/paramCodec.spec.ts +1 -1
  111. package/src/components/index.ts +10 -0
  112. package/src/components/styles.ts +49 -85
  113. package/src/hooks/useCrudMutation.spec.tsx +119 -0
  114. package/src/hooks/useCrudMutation.tsx +85 -0
  115. package/src/index.ts +9 -0
  116. package/src/telemetry/consoleEvents.spec.ts +130 -0
  117. package/src/telemetry/consoleEvents.ts +124 -0
  118. package/src/theme/defaults.ts +34 -23
  119. package/src/theme/resolveTheme.spec.ts +9 -4
  120. package/src/theme/resolveTheme.ts +12 -8
  121. package/src/utils/sha256.ts +13 -0
  122. package/test/README.md +1 -1
  123. package/test/serverProvider.tsx +5 -2
  124. package/dist/DocumentStorageProvider-BeBD0uWc.cjs.js +0 -134
  125. package/dist/RenderedResult-CPi6uQWq.cjs.js +0 -115
  126. package/dist/ServerProvider-CH71GsoL.cjs.js +0 -1
  127. package/dist/components/Materializations/CreateEnvMaterializationDialog.d.ts +0 -14
  128. package/dist/components/Materializations/EnvironmentMaterializations.d.ts +0 -7
  129. package/dist/components/Materializations/ScheduleCard.d.ts +0 -20
  130. package/dist/components/Materializations/TriggerChip.d.ts +0 -10
  131. package/dist/components/Package/Models.d.ts +0 -6
  132. package/src/components/Materializations/CreateEnvMaterializationDialog.tsx +0 -179
  133. package/src/components/Materializations/EnvironmentMaterializations.tsx +0 -267
  134. package/src/components/Materializations/ScheduleCard.tsx +0 -231
  135. package/src/components/Materializations/TriggerChip.tsx +0 -44
  136. package/src/components/Package/Models.tsx +0 -71
@@ -1952,6 +1952,56 @@ export interface ModelError {
1952
1952
  */
1953
1953
  'reason'?: string;
1954
1954
  }
1955
+ /**
1956
+ * The text to write into a dashboard file
1957
+ * @export
1958
+ * @interface ModelSourceWriteRequest
1959
+ */
1960
+ export interface ModelSourceWriteRequest {
1961
+ /**
1962
+ * The whole file\'s Malloy text
1963
+ * @type {string}
1964
+ * @memberof ModelSourceWriteRequest
1965
+ */
1966
+ 'source': string;
1967
+ /**
1968
+ * SHA-256 (hex) of the text the caller opened. Refused with 409 when the file on disk no longer hashes to it. Omit to create the file, which is then refused with 409 if it already exists.
1969
+ * @type {string}
1970
+ * @memberof ModelSourceWriteRequest
1971
+ */
1972
+ 'expectedHash'?: string;
1973
+ }
1974
+ /**
1975
+ * What a dashboard write left in the package
1976
+ * @export
1977
+ * @interface ModelSourceWriteResult
1978
+ */
1979
+ export interface ModelSourceWriteResult {
1980
+ /**
1981
+ * Resource path to the model file that was written
1982
+ * @type {string}
1983
+ * @memberof ModelSourceWriteResult
1984
+ */
1985
+ 'resource'?: string;
1986
+ /**
1987
+ * The file written, relative to the package
1988
+ * @type {string}
1989
+ * @memberof ModelSourceWriteResult
1990
+ */
1991
+ 'path': string;
1992
+ /**
1993
+ * SHA-256 (hex) of the text as written; the next write\'s `expectedHash`
1994
+ * @type {string}
1995
+ * @memberof ModelSourceWriteResult
1996
+ */
1997
+ 'contentHash': string;
1998
+ /**
1999
+ * True when the file did not exist before
2000
+ * @type {boolean}
2001
+ * @memberof ModelSourceWriteResult
2002
+ */
2003
+ 'created'?: boolean;
2004
+ }
1955
2005
  /**
1956
2006
  * MotherDuck database connection configuration
1957
2007
  * @export
@@ -2588,7 +2638,7 @@ export interface PostgresConnection {
2588
2638
  */
2589
2639
  'connectionString'?: string;
2590
2640
  /**
2591
- * TLS mode for a connection reached through a `proxy` (SSH bastion). Because the driver connects to a local tunnel endpoint, the cert hostname can\'t be checked from the tunnel address alone; use `verify-full` to check it against the real host. `verify-ca` validates the server cert chain against the trusted CA bundle (e.g. the baked Amazon RDS roots) without the hostname, `verify-full` validates the chain AND the hostname against the real host (verified via SNI through the tunnel; requires the target\'s CA to be trusted by Node\'s bundled CA roots or NODE_EXTRA_CA_CERTS), `no-verify` encrypts without verifying, and `disable` uses no TLS. Note `verify-full` trusts a broader CA set than `verify-ca` here — ambient roots plus NODE_EXTRA_CA_CERTS, rather than the pinned NODE_EXTRA_CA_CERTS bundle that `verify-ca` uses — so it is intentionally not a strict superset; it adds the hostname check without narrowing CA trust. The server defaults it to `no-verify` when a proxy is set (so a force-SSL target isn\'t rejected for plaintext) — a server-applied default, not a schema default. Only valid on a proxied connection — a direct connection uses the deployment PGSSLMODE and rejects this field.
2641
+ * TLS mode for a connection reached through a `proxy` (SSH bastion). Because the driver connects to a local tunnel endpoint, the cert hostname can\'t be checked from the tunnel address alone; use `verify-full` to check it against the real host. `verify-ca` validates the server cert chain against the trusted CA bundle (e.g. the baked Amazon RDS roots) without the hostname, `verify-full` validates the chain AND the hostname against the real host (verified via SNI through the tunnel; requires the target\'s CA to be trusted by Node\'s bundled CA roots or NODE_EXTRA_CA_CERTS), `no-verify` encrypts without verifying, and `disable` uses no TLS. A `storage=` build of a proxied source applies the same mode through its own tunnel, `verify-full` included. Note `verify-full` trusts a broader CA set than `verify-ca` here — ambient roots plus NODE_EXTRA_CA_CERTS, rather than the pinned NODE_EXTRA_CA_CERTS bundle that `verify-ca` uses — so it is intentionally not a strict superset; it adds the hostname check without narrowing CA trust. The server defaults it to `no-verify` when a proxy is set (so a force-SSL target isn\'t rejected for plaintext) — a server-applied default, not a schema default. Only valid on a proxied connection — a direct connection uses the deployment PGSSLMODE and rejects this field.
2592
2642
  * @type {string}
2593
2643
  * @memberof PostgresConnection
2594
2644
  */
@@ -5177,16 +5227,6 @@ export declare const MaterializationsApiAxiosParamCreator: (configuration?: Conf
5177
5227
  * @throws {RequiredError}
5178
5228
  */
5179
5229
  getMaterialization: (environmentName: string, packageName: string, materializationId: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
5180
- /**
5181
- * Returns every materialization across all packages in the environment, ordered by most recent first. Each item carries its `packageName`, so an environment-scoped view can group or label by package. This is the collection-level sibling of the per-package `/packages/{packageName}/materializations` list; the literal `materializations` segment is matched ahead of `{packageName}`, so `materializations` cannot be used as a package name.
5182
- * @summary List all materializations in an environment
5183
- * @param {string} environmentName Name of the environment
5184
- * @param {number} [limit] Maximum number of materializations to return
5185
- * @param {number} [offset] Number of materializations to skip
5186
- * @param {*} [options] Override http request option.
5187
- * @throws {RequiredError}
5188
- */
5189
- listEnvironmentMaterializations: (environmentName: string, limit?: number, offset?: number, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
5190
5230
  /**
5191
5231
  * Returns the materialization history for the package, ordered by most recent first.
5192
5232
  * @summary List materializations for a package
@@ -5246,16 +5286,6 @@ export declare const MaterializationsApiFp: (configuration?: Configuration) => {
5246
5286
  * @throws {RequiredError}
5247
5287
  */
5248
5288
  getMaterialization(environmentName: string, packageName: string, materializationId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Materialization>>;
5249
- /**
5250
- * Returns every materialization across all packages in the environment, ordered by most recent first. Each item carries its `packageName`, so an environment-scoped view can group or label by package. This is the collection-level sibling of the per-package `/packages/{packageName}/materializations` list; the literal `materializations` segment is matched ahead of `{packageName}`, so `materializations` cannot be used as a package name.
5251
- * @summary List all materializations in an environment
5252
- * @param {string} environmentName Name of the environment
5253
- * @param {number} [limit] Maximum number of materializations to return
5254
- * @param {number} [offset] Number of materializations to skip
5255
- * @param {*} [options] Override http request option.
5256
- * @throws {RequiredError}
5257
- */
5258
- listEnvironmentMaterializations(environmentName: string, limit?: number, offset?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<Materialization>>>;
5259
5289
  /**
5260
5290
  * Returns the materialization history for the package, ordered by most recent first.
5261
5291
  * @summary List materializations for a package
@@ -5315,16 +5345,6 @@ export declare const MaterializationsApiFactory: (configuration?: Configuration,
5315
5345
  * @throws {RequiredError}
5316
5346
  */
5317
5347
  getMaterialization(environmentName: string, packageName: string, materializationId: string, options?: RawAxiosRequestConfig): AxiosPromise<Materialization>;
5318
- /**
5319
- * Returns every materialization across all packages in the environment, ordered by most recent first. Each item carries its `packageName`, so an environment-scoped view can group or label by package. This is the collection-level sibling of the per-package `/packages/{packageName}/materializations` list; the literal `materializations` segment is matched ahead of `{packageName}`, so `materializations` cannot be used as a package name.
5320
- * @summary List all materializations in an environment
5321
- * @param {string} environmentName Name of the environment
5322
- * @param {number} [limit] Maximum number of materializations to return
5323
- * @param {number} [offset] Number of materializations to skip
5324
- * @param {*} [options] Override http request option.
5325
- * @throws {RequiredError}
5326
- */
5327
- listEnvironmentMaterializations(environmentName: string, limit?: number, offset?: number, options?: RawAxiosRequestConfig): AxiosPromise<Array<Materialization>>;
5328
5348
  /**
5329
5349
  * Returns the materialization history for the package, ordered by most recent first.
5330
5350
  * @summary List materializations for a package
@@ -5389,17 +5409,6 @@ export declare class MaterializationsApi extends BaseAPI {
5389
5409
  * @memberof MaterializationsApi
5390
5410
  */
5391
5411
  getMaterialization(environmentName: string, packageName: string, materializationId: string, options?: RawAxiosRequestConfig): Promise< AxiosResponse<Materialization, any, {}>>;
5392
- /**
5393
- * Returns every materialization across all packages in the environment, ordered by most recent first. Each item carries its `packageName`, so an environment-scoped view can group or label by package. This is the collection-level sibling of the per-package `/packages/{packageName}/materializations` list; the literal `materializations` segment is matched ahead of `{packageName}`, so `materializations` cannot be used as a package name.
5394
- * @summary List all materializations in an environment
5395
- * @param {string} environmentName Name of the environment
5396
- * @param {number} [limit] Maximum number of materializations to return
5397
- * @param {number} [offset] Number of materializations to skip
5398
- * @param {*} [options] Override http request option.
5399
- * @throws {RequiredError}
5400
- * @memberof MaterializationsApi
5401
- */
5402
- listEnvironmentMaterializations(environmentName: string, limit?: number, offset?: number, options?: RawAxiosRequestConfig): Promise< AxiosResponse<Materialization[], any, {}>>;
5403
5412
  /**
5404
5413
  * Returns the materialization history for the package, ordered by most recent first.
5405
5414
  * @summary List materializations for a package
@@ -5480,6 +5489,18 @@ export declare const ModelsApiAxiosParamCreator: (configuration?: Configuration)
5480
5489
  * @throws {RequiredError}
5481
5490
  */
5482
5491
  listModels: (environmentName: string, packageName: string, versionId?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
5492
+ /**
5493
+ * Writes the Malloy text of a dashboard file — `dashboards/<slug>.malloy`, the only paths this endpoint accepts — into the package, and reloads the package in place so the dashboard is served from the new text. This is the dashboard builder\'s save. The text is compiled first, as the file, and refused with its problems when it does not compile; nothing is written. The write is atomic (a sibling temporary file renamed over the target). If the reload that follows fails to compile the package, the previous text is restored (or a new file removed) and the package reloaded again, so a save never leaves the package serving less than it did. `expectedHash` is the SHA-256 (hex) of the text the caller opened, as `GET …/models/{path}` returned it in `sourceText`. When the file on disk no longer hashes to it, the write is refused with 409 and nothing is merged: the caller re-opens and reapplies its change. Omit it to CREATE the file: a file that already exists is then refused with 409 too, so an unconditional overwrite is not something a caller can ask for by leaving a field out. The check, the write, the reload and the restore all happen under one hold of the package lock, so two saves racing on one file cannot both pass the check, and a rollback cannot revert the other writer\'s text instead of its own. A create answers 201 and an update 200; `created` in the body says the same thing. Refused with 403 when `publisher.config.json` has `frozenConfig: true`. Like every write on this server, it is unauthenticated and meant to sit behind an authenticating gateway; see docs/security-posture.md.
5494
+ * @summary Write a dashboard file into the package
5495
+ * @param {string} environmentName Name of the environment
5496
+ * @param {string} packageName Name of the package
5497
+ * @param {string} path The dashboard file, &#x60;dashboards/&lt;slug&gt;.malloy&#x60;
5498
+ * @param {ModelSourceWriteRequest} modelSourceWriteRequest
5499
+ * @param {string} [versionId] Version identifier for the package
5500
+ * @param {*} [options] Override http request option.
5501
+ * @throws {RequiredError}
5502
+ */
5503
+ updateModelSource: (environmentName: string, packageName: string, path: string, modelSourceWriteRequest: ModelSourceWriteRequest, versionId?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
5483
5504
  };
5484
5505
  /**
5485
5506
  * ModelsApi - functional programming interface
@@ -5529,6 +5550,18 @@ export declare const ModelsApiFp: (configuration?: Configuration) => {
5529
5550
  * @throws {RequiredError}
5530
5551
  */
5531
5552
  listModels(environmentName: string, packageName: string, versionId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<Model>>>;
5553
+ /**
5554
+ * Writes the Malloy text of a dashboard file — `dashboards/<slug>.malloy`, the only paths this endpoint accepts — into the package, and reloads the package in place so the dashboard is served from the new text. This is the dashboard builder\'s save. The text is compiled first, as the file, and refused with its problems when it does not compile; nothing is written. The write is atomic (a sibling temporary file renamed over the target). If the reload that follows fails to compile the package, the previous text is restored (or a new file removed) and the package reloaded again, so a save never leaves the package serving less than it did. `expectedHash` is the SHA-256 (hex) of the text the caller opened, as `GET …/models/{path}` returned it in `sourceText`. When the file on disk no longer hashes to it, the write is refused with 409 and nothing is merged: the caller re-opens and reapplies its change. Omit it to CREATE the file: a file that already exists is then refused with 409 too, so an unconditional overwrite is not something a caller can ask for by leaving a field out. The check, the write, the reload and the restore all happen under one hold of the package lock, so two saves racing on one file cannot both pass the check, and a rollback cannot revert the other writer\'s text instead of its own. A create answers 201 and an update 200; `created` in the body says the same thing. Refused with 403 when `publisher.config.json` has `frozenConfig: true`. Like every write on this server, it is unauthenticated and meant to sit behind an authenticating gateway; see docs/security-posture.md.
5555
+ * @summary Write a dashboard file into the package
5556
+ * @param {string} environmentName Name of the environment
5557
+ * @param {string} packageName Name of the package
5558
+ * @param {string} path The dashboard file, &#x60;dashboards/&lt;slug&gt;.malloy&#x60;
5559
+ * @param {ModelSourceWriteRequest} modelSourceWriteRequest
5560
+ * @param {string} [versionId] Version identifier for the package
5561
+ * @param {*} [options] Override http request option.
5562
+ * @throws {RequiredError}
5563
+ */
5564
+ updateModelSource(environmentName: string, packageName: string, path: string, modelSourceWriteRequest: ModelSourceWriteRequest, versionId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ModelSourceWriteResult>>;
5532
5565
  };
5533
5566
  /**
5534
5567
  * ModelsApi - factory interface
@@ -5578,6 +5611,18 @@ export declare const ModelsApiFactory: (configuration?: Configuration, basePath?
5578
5611
  * @throws {RequiredError}
5579
5612
  */
5580
5613
  listModels(environmentName: string, packageName: string, versionId?: string, options?: RawAxiosRequestConfig): AxiosPromise<Array<Model>>;
5614
+ /**
5615
+ * Writes the Malloy text of a dashboard file — `dashboards/<slug>.malloy`, the only paths this endpoint accepts — into the package, and reloads the package in place so the dashboard is served from the new text. This is the dashboard builder\'s save. The text is compiled first, as the file, and refused with its problems when it does not compile; nothing is written. The write is atomic (a sibling temporary file renamed over the target). If the reload that follows fails to compile the package, the previous text is restored (or a new file removed) and the package reloaded again, so a save never leaves the package serving less than it did. `expectedHash` is the SHA-256 (hex) of the text the caller opened, as `GET …/models/{path}` returned it in `sourceText`. When the file on disk no longer hashes to it, the write is refused with 409 and nothing is merged: the caller re-opens and reapplies its change. Omit it to CREATE the file: a file that already exists is then refused with 409 too, so an unconditional overwrite is not something a caller can ask for by leaving a field out. The check, the write, the reload and the restore all happen under one hold of the package lock, so two saves racing on one file cannot both pass the check, and a rollback cannot revert the other writer\'s text instead of its own. A create answers 201 and an update 200; `created` in the body says the same thing. Refused with 403 when `publisher.config.json` has `frozenConfig: true`. Like every write on this server, it is unauthenticated and meant to sit behind an authenticating gateway; see docs/security-posture.md.
5616
+ * @summary Write a dashboard file into the package
5617
+ * @param {string} environmentName Name of the environment
5618
+ * @param {string} packageName Name of the package
5619
+ * @param {string} path The dashboard file, &#x60;dashboards/&lt;slug&gt;.malloy&#x60;
5620
+ * @param {ModelSourceWriteRequest} modelSourceWriteRequest
5621
+ * @param {string} [versionId] Version identifier for the package
5622
+ * @param {*} [options] Override http request option.
5623
+ * @throws {RequiredError}
5624
+ */
5625
+ updateModelSource(environmentName: string, packageName: string, path: string, modelSourceWriteRequest: ModelSourceWriteRequest, versionId?: string, options?: RawAxiosRequestConfig): AxiosPromise<ModelSourceWriteResult>;
5581
5626
  };
5582
5627
  /**
5583
5628
  * ModelsApi - object-oriented interface
@@ -5633,6 +5678,19 @@ export declare class ModelsApi extends BaseAPI {
5633
5678
  * @memberof ModelsApi
5634
5679
  */
5635
5680
  listModels(environmentName: string, packageName: string, versionId?: string, options?: RawAxiosRequestConfig): Promise< AxiosResponse<Model[], any, {}>>;
5681
+ /**
5682
+ * Writes the Malloy text of a dashboard file — `dashboards/<slug>.malloy`, the only paths this endpoint accepts — into the package, and reloads the package in place so the dashboard is served from the new text. This is the dashboard builder\'s save. The text is compiled first, as the file, and refused with its problems when it does not compile; nothing is written. The write is atomic (a sibling temporary file renamed over the target). If the reload that follows fails to compile the package, the previous text is restored (or a new file removed) and the package reloaded again, so a save never leaves the package serving less than it did. `expectedHash` is the SHA-256 (hex) of the text the caller opened, as `GET …/models/{path}` returned it in `sourceText`. When the file on disk no longer hashes to it, the write is refused with 409 and nothing is merged: the caller re-opens and reapplies its change. Omit it to CREATE the file: a file that already exists is then refused with 409 too, so an unconditional overwrite is not something a caller can ask for by leaving a field out. The check, the write, the reload and the restore all happen under one hold of the package lock, so two saves racing on one file cannot both pass the check, and a rollback cannot revert the other writer\'s text instead of its own. A create answers 201 and an update 200; `created` in the body says the same thing. Refused with 403 when `publisher.config.json` has `frozenConfig: true`. Like every write on this server, it is unauthenticated and meant to sit behind an authenticating gateway; see docs/security-posture.md.
5683
+ * @summary Write a dashboard file into the package
5684
+ * @param {string} environmentName Name of the environment
5685
+ * @param {string} packageName Name of the package
5686
+ * @param {string} path The dashboard file, &#x60;dashboards/&lt;slug&gt;.malloy&#x60;
5687
+ * @param {ModelSourceWriteRequest} modelSourceWriteRequest
5688
+ * @param {string} [versionId] Version identifier for the package
5689
+ * @param {*} [options] Override http request option.
5690
+ * @throws {RequiredError}
5691
+ * @memberof ModelsApi
5692
+ */
5693
+ updateModelSource(environmentName: string, packageName: string, path: string, modelSourceWriteRequest: ModelSourceWriteRequest, versionId?: string, options?: RawAxiosRequestConfig): Promise< AxiosResponse<ModelSourceWriteResult, any, {}>>;
5636
5694
  }
5637
5695
  /**
5638
5696
  * NotebooksApi - axios parameter creator
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../ServerProvider-CH71GsoL.cjs.js");exports.AttachedDatabaseTypeEnum=e.AttachedDatabaseTypeEnum;exports.AzureConnectionAuthTypeEnum=e.AzureConnectionAuthTypeEnum;exports.CompileProblemSeverityEnum=e.CompileProblemSeverityEnum;exports.CompileRequestScopeEnum=e.CompileRequestScopeEnum;exports.CompileResultStatusEnum=e.CompileResultStatusEnum;exports.Configuration=e.Configuration;exports.ConnectionProxyTypeEnum=e.ConnectionProxyTypeEnum;exports.ConnectionStatusStatusEnum=e.ConnectionStatusStatusEnum;exports.ConnectionTypeEnum=e.ConnectionTypeEnum;exports.ConnectionsApi=e.ConnectionsApi;exports.ConnectionsApiAxiosParamCreator=e.ConnectionsApiAxiosParamCreator;exports.ConnectionsApiFactory=e.ConnectionsApiFactory;exports.ConnectionsApiFp=e.ConnectionsApiFp;exports.ConnectionsTestApi=e.ConnectionsTestApi;exports.ConnectionsTestApiAxiosParamCreator=e.ConnectionsTestApiAxiosParamCreator;exports.ConnectionsTestApiFactory=e.ConnectionsTestApiFactory;exports.ConnectionsTestApiFp=e.ConnectionsTestApiFp;exports.DashboardsApi=e.DashboardsApi;exports.DashboardsApiAxiosParamCreator=e.DashboardsApiAxiosParamCreator;exports.DashboardsApiFactory=e.DashboardsApiFactory;exports.DashboardsApiFp=e.DashboardsApiFp;exports.DataAppFitEnum=e.DataAppFitEnum;exports.DataAppsApi=e.DataAppsApi;exports.DataAppsApiAxiosParamCreator=e.DataAppsApiAxiosParamCreator;exports.DataAppsApiFactory=e.DataAppsApiFactory;exports.DataAppsApiFp=e.DataAppsApiFp;exports.DatabaseTypeEnum=e.DatabaseTypeEnum;exports.DatabasesApi=e.DatabasesApi;exports.DatabasesApiAxiosParamCreator=e.DatabasesApiAxiosParamCreator;exports.DatabasesApiFactory=e.DatabasesApiFactory;exports.DatabasesApiFp=e.DatabasesApiFp;exports.EnvironmentsApi=e.EnvironmentsApi;exports.EnvironmentsApiAxiosParamCreator=e.EnvironmentsApiAxiosParamCreator;exports.EnvironmentsApiFactory=e.EnvironmentsApiFactory;exports.EnvironmentsApiFp=e.EnvironmentsApiFp;exports.ExecuteNotebookCellBypassFiltersEnum=e.ExecuteNotebookCellBypassFiltersEnum;exports.FilterTypeEnum=e.FilterTypeEnum;exports.FreshnessFallbackEnum=e.FreshnessFallbackEnum;exports.GivenControlEnum=e.GivenControlEnum;exports.LedgerEntryStrategyEnum=e.LedgerEntryStrategyEnum;exports.LogMessageSeverityEnum=e.LogMessageSeverityEnum;exports.ManifestEntryFreshnessFallbackEnum=e.ManifestEntryFreshnessFallbackEnum;exports.ManifestEntryOriginEnum=e.ManifestEntryOriginEnum;exports.ManifestEntryRefreshEnum=e.ManifestEntryRefreshEnum;exports.MaterializationActionActionEnum=e.MaterializationActionActionEnum;exports.MaterializationStatus=e.MaterializationStatus;exports.MaterializationsApi=e.MaterializationsApi;exports.MaterializationsApiAxiosParamCreator=e.MaterializationsApiAxiosParamCreator;exports.MaterializationsApiFactory=e.MaterializationsApiFactory;exports.MaterializationsApiFp=e.MaterializationsApiFp;exports.ModelsApi=e.ModelsApi;exports.ModelsApiAxiosParamCreator=e.ModelsApiAxiosParamCreator;exports.ModelsApiFactory=e.ModelsApiFactory;exports.ModelsApiFp=e.ModelsApiFp;exports.NotebookCellResultTypeEnum=e.NotebookCellResultTypeEnum;exports.NotebookCellTypeEnum=e.NotebookCellTypeEnum;exports.NotebooksApi=e.NotebooksApi;exports.NotebooksApiAxiosParamCreator=e.NotebooksApiAxiosParamCreator;exports.NotebooksApiFactory=e.NotebooksApiFactory;exports.NotebooksApiFp=e.NotebooksApiFp;exports.PackageEmbeddingIndexStatusEnum=e.PackageEmbeddingIndexStatusEnum;exports.PackageManifestBindingStatusEnum=e.PackageManifestBindingStatusEnum;exports.PackageQueryableSourcesEnum=e.PackageQueryableSourcesEnum;exports.PackageScopeEnum=e.PackageScopeEnum;exports.PackageStorageServeBindingsInnerOriginEnum=e.PackageStorageServeBindingsInnerOriginEnum;exports.PackageWarningsInnerSeverityEnum=e.PackageWarningsInnerSeverityEnum;exports.PackagesApi=e.PackagesApi;exports.PackagesApiAxiosParamCreator=e.PackagesApiAxiosParamCreator;exports.PackagesApiFactory=e.PackagesApiFactory;exports.PackagesApiFp=e.PackagesApiFp;exports.PersistSourcePlanOriginEnum=e.PersistSourcePlanOriginEnum;exports.PostgresConnectionSslmodeEnum=e.PostgresConnectionSslmodeEnum;exports.PublisherApi=e.PublisherApi;exports.PublisherApiAxiosParamCreator=e.PublisherApiAxiosParamCreator;exports.PublisherApiFactory=e.PublisherApiFactory;exports.PublisherApiFp=e.PublisherApiFp;exports.QueryClass=e.QueryClass;exports.QueryResultQueryRowLimitSourceEnum=e.QueryResultQueryRowLimitSourceEnum;exports.QueryResultServedFromEnum=e.QueryResultServedFromEnum;exports.Realization=e.Realization;exports.RefusedSourceReasonEnum=e.RefusedSourceReasonEnum;exports.RefusedSourceTierEnum=e.RefusedSourceTierEnum;exports.RunContextTriggerEnum=e.RunContextTriggerEnum;exports.S3ConnectionProviderEnum=e.S3ConnectionProviderEnum;exports.ServerProvider=e.ServerProvider;exports.ServerStatusOperationalStateEnum=e.ServerStatusOperationalStateEnum;exports.ThemeDefaultModeEnum=e.ThemeDefaultModeEnum;exports.WatchModeApi=e.WatchModeApi;exports.WatchModeApiAxiosParamCreator=e.WatchModeApiAxiosParamCreator;exports.WatchModeApiFactory=e.WatchModeApiFactory;exports.WatchModeApiFp=e.WatchModeApiFp;exports.globalQueryClient=e.globalQueryClient;exports.useServer=e.useServer;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../ServerProvider-Cc489A3f.cjs.js");exports.AttachedDatabaseTypeEnum=e.AttachedDatabaseTypeEnum;exports.AzureConnectionAuthTypeEnum=e.AzureConnectionAuthTypeEnum;exports.CompileProblemSeverityEnum=e.CompileProblemSeverityEnum;exports.CompileRequestScopeEnum=e.CompileRequestScopeEnum;exports.CompileResultStatusEnum=e.CompileResultStatusEnum;exports.Configuration=e.Configuration;exports.ConnectionProxyTypeEnum=e.ConnectionProxyTypeEnum;exports.ConnectionStatusStatusEnum=e.ConnectionStatusStatusEnum;exports.ConnectionTypeEnum=e.ConnectionTypeEnum;exports.ConnectionsApi=e.ConnectionsApi;exports.ConnectionsApiAxiosParamCreator=e.ConnectionsApiAxiosParamCreator;exports.ConnectionsApiFactory=e.ConnectionsApiFactory;exports.ConnectionsApiFp=e.ConnectionsApiFp;exports.ConnectionsTestApi=e.ConnectionsTestApi;exports.ConnectionsTestApiAxiosParamCreator=e.ConnectionsTestApiAxiosParamCreator;exports.ConnectionsTestApiFactory=e.ConnectionsTestApiFactory;exports.ConnectionsTestApiFp=e.ConnectionsTestApiFp;exports.DashboardsApi=e.DashboardsApi;exports.DashboardsApiAxiosParamCreator=e.DashboardsApiAxiosParamCreator;exports.DashboardsApiFactory=e.DashboardsApiFactory;exports.DashboardsApiFp=e.DashboardsApiFp;exports.DataAppFitEnum=e.DataAppFitEnum;exports.DataAppsApi=e.DataAppsApi;exports.DataAppsApiAxiosParamCreator=e.DataAppsApiAxiosParamCreator;exports.DataAppsApiFactory=e.DataAppsApiFactory;exports.DataAppsApiFp=e.DataAppsApiFp;exports.DatabaseTypeEnum=e.DatabaseTypeEnum;exports.DatabasesApi=e.DatabasesApi;exports.DatabasesApiAxiosParamCreator=e.DatabasesApiAxiosParamCreator;exports.DatabasesApiFactory=e.DatabasesApiFactory;exports.DatabasesApiFp=e.DatabasesApiFp;exports.EnvironmentsApi=e.EnvironmentsApi;exports.EnvironmentsApiAxiosParamCreator=e.EnvironmentsApiAxiosParamCreator;exports.EnvironmentsApiFactory=e.EnvironmentsApiFactory;exports.EnvironmentsApiFp=e.EnvironmentsApiFp;exports.ExecuteNotebookCellBypassFiltersEnum=e.ExecuteNotebookCellBypassFiltersEnum;exports.FilterTypeEnum=e.FilterTypeEnum;exports.FreshnessFallbackEnum=e.FreshnessFallbackEnum;exports.GivenControlEnum=e.GivenControlEnum;exports.LedgerEntryStrategyEnum=e.LedgerEntryStrategyEnum;exports.LogMessageSeverityEnum=e.LogMessageSeverityEnum;exports.ManifestEntryFreshnessFallbackEnum=e.ManifestEntryFreshnessFallbackEnum;exports.ManifestEntryOriginEnum=e.ManifestEntryOriginEnum;exports.ManifestEntryRefreshEnum=e.ManifestEntryRefreshEnum;exports.MaterializationActionActionEnum=e.MaterializationActionActionEnum;exports.MaterializationStatus=e.MaterializationStatus;exports.MaterializationsApi=e.MaterializationsApi;exports.MaterializationsApiAxiosParamCreator=e.MaterializationsApiAxiosParamCreator;exports.MaterializationsApiFactory=e.MaterializationsApiFactory;exports.MaterializationsApiFp=e.MaterializationsApiFp;exports.ModelsApi=e.ModelsApi;exports.ModelsApiAxiosParamCreator=e.ModelsApiAxiosParamCreator;exports.ModelsApiFactory=e.ModelsApiFactory;exports.ModelsApiFp=e.ModelsApiFp;exports.NotebookCellResultTypeEnum=e.NotebookCellResultTypeEnum;exports.NotebookCellTypeEnum=e.NotebookCellTypeEnum;exports.NotebooksApi=e.NotebooksApi;exports.NotebooksApiAxiosParamCreator=e.NotebooksApiAxiosParamCreator;exports.NotebooksApiFactory=e.NotebooksApiFactory;exports.NotebooksApiFp=e.NotebooksApiFp;exports.PackageEmbeddingIndexStatusEnum=e.PackageEmbeddingIndexStatusEnum;exports.PackageManifestBindingStatusEnum=e.PackageManifestBindingStatusEnum;exports.PackageQueryableSourcesEnum=e.PackageQueryableSourcesEnum;exports.PackageScopeEnum=e.PackageScopeEnum;exports.PackageStorageServeBindingsInnerOriginEnum=e.PackageStorageServeBindingsInnerOriginEnum;exports.PackageWarningsInnerSeverityEnum=e.PackageWarningsInnerSeverityEnum;exports.PackagesApi=e.PackagesApi;exports.PackagesApiAxiosParamCreator=e.PackagesApiAxiosParamCreator;exports.PackagesApiFactory=e.PackagesApiFactory;exports.PackagesApiFp=e.PackagesApiFp;exports.PersistSourcePlanOriginEnum=e.PersistSourcePlanOriginEnum;exports.PostgresConnectionSslmodeEnum=e.PostgresConnectionSslmodeEnum;exports.PublisherApi=e.PublisherApi;exports.PublisherApiAxiosParamCreator=e.PublisherApiAxiosParamCreator;exports.PublisherApiFactory=e.PublisherApiFactory;exports.PublisherApiFp=e.PublisherApiFp;exports.QueryClass=e.QueryClass;exports.QueryResultQueryRowLimitSourceEnum=e.QueryResultQueryRowLimitSourceEnum;exports.QueryResultServedFromEnum=e.QueryResultServedFromEnum;exports.Realization=e.Realization;exports.RefusedSourceReasonEnum=e.RefusedSourceReasonEnum;exports.RefusedSourceTierEnum=e.RefusedSourceTierEnum;exports.RunContextTriggerEnum=e.RunContextTriggerEnum;exports.S3ConnectionProviderEnum=e.S3ConnectionProviderEnum;exports.ServerProvider=e.ServerProvider;exports.ServerStatusOperationalStateEnum=e.ServerStatusOperationalStateEnum;exports.ThemeDefaultModeEnum=e.ThemeDefaultModeEnum;exports.WatchModeApi=e.WatchModeApi;exports.WatchModeApiAxiosParamCreator=e.WatchModeApiAxiosParamCreator;exports.WatchModeApiFactory=e.WatchModeApiFactory;exports.WatchModeApiFp=e.WatchModeApiFp;exports.globalQueryClient=e.globalQueryClient;exports.useServer=e.useServer;
@@ -1,4 +1,4 @@
1
- import { A as e, a as i, C as o, b as n, c as t, aC as r, e as p, f as u, d as A, O as m, I as c, K as E, J as l, X as C, U as y, W as P, V as F, $ as b, Y as g, _ as d, Z as S, D as k, a3 as M, a0 as h, a2 as x, a1 as v, h as D, a7 as T, a4 as R, a6 as f, a5 as z, ab as N, a8 as Q, aa as W, a9 as B, ap as O, F as I, i as L, G as q, L as w, j, k as G, M as H, l as J, ag as K, m as U, af as V, ac as X, ae as Y, ad as Z, ak as _, ah as $, aj as aa, ai as sa, n as ea, N as ia, ao as oa, al as na, an as ta, am as ra, q as pa, p as ua, o as Aa, P as ma, r as ca, s as Ea, at as la, aq as Ca, as as ya, ar as Pa, t as Fa, v as ba, ax as ga, au as da, aw as Sa, av as ka, Q as Ma, w as ha, x as xa, R as va, z as Da, y as Ta, B as Ra, E as fa, S as za, H as Na, T as Qa, aB as Wa, ay as Ba, aA as Oa, az as Ia, g as La, u as qa } from "../ServerProvider-X2Ma0HRs.es.js";
1
+ import { A as e, a as i, C as o, b as n, c as t, aC as r, e as p, f as u, d as A, O as m, I as c, K as E, J as l, X as C, U as y, W as P, V as F, $ as b, Y as g, _ as d, Z as S, D as k, a3 as M, a0 as h, a2 as x, a1 as v, h as D, a7 as T, a4 as R, a6 as f, a5 as z, ab as N, a8 as Q, aa as W, a9 as B, ap as O, F as I, i as L, G as q, L as w, j, k as G, M as H, l as J, ag as K, m as U, af as V, ac as X, ae as Y, ad as Z, ak as _, ah as $, aj as aa, ai as sa, n as ea, N as ia, ao as oa, al as na, an as ta, am as ra, q as pa, p as ua, o as Aa, P as ma, r as ca, s as Ea, at as la, aq as Ca, as as ya, ar as Pa, t as Fa, v as ba, ax as ga, au as da, aw as Sa, av as ka, Q as Ma, w as ha, x as xa, R as va, z as Da, y as Ta, B as Ra, E as fa, S as za, H as Na, T as Qa, aB as Wa, ay as Ba, aA as Oa, az as Ia, g as La, u as qa } from "../ServerProvider-BWOEKg0O.es.js";
2
2
  export {
3
3
  e as AttachedDatabaseTypeEnum,
4
4
  i as AzureConnectionAuthTypeEnum,
@@ -0,0 +1,30 @@
1
+ import * as React from "react";
2
+ /**
3
+ * Every dialog in the Console, in one shape.
4
+ *
5
+ * A dialog is a page that arrived in a box: it should be set like one. The
6
+ * title is the page's heading at the same size, weight and tracking; a line
7
+ * under it says what the dialog is for, where a page's description would be;
8
+ * the body is one column with one gap; and the actions sit at the bottom right
9
+ * with the same padding every time — a text Cancel and a filled confirm, the
10
+ * two roles `buttons.tsx` names.
11
+ *
12
+ * Three dialogs stay off it deliberately, and each needs something this does
13
+ * not have: `ModelExplorerDialog` is `fullScreen`, and `RowsDialog` and
14
+ * `MaterializationDetailDialog` title themselves with a node rather than a
15
+ * string. Widening this for three callers would cost more than it saves —
16
+ * but a fourth exception is a reason to widen it, not to hand-roll a fourth.
17
+ */
18
+ export declare function AppDialog({ open, onClose, title, description, maxWidth, showClose, actions, children, }: {
19
+ open: boolean;
20
+ onClose: () => void;
21
+ title: string;
22
+ /** What the dialog is for, in a line. The page's description, in a box. */
23
+ description?: React.ReactNode;
24
+ maxWidth?: "xs" | "sm" | "md" | "lg" | false;
25
+ /** An X in the title, for a dialog whose actions do not include a way out. */
26
+ showClose?: boolean;
27
+ /** The buttons, in order. Cancel first, the thing it does last. */
28
+ actions?: React.ReactNode;
29
+ children: React.ReactNode;
30
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,32 @@
1
+ import * as React from "react";
2
+ /**
3
+ * The way up, at the top of a page: an arrow and the name of the thing you came
4
+ * from.
5
+ *
6
+ * Every page that has a parent shows one, in this one shape. The breadcrumb in
7
+ * the app's header bar is a different affordance and does not replace it: it is
8
+ * chrome the eye skips, it cannot say what the parent IS (it renders a model
9
+ * path as one opaque chip), and it is absent on the pages the app shell does
10
+ * not parameterise.
11
+ *
12
+ * The click is the host's, so a Console navigates its router and an embedder
13
+ * does whatever it does. Give it an `href` as well wherever the parent has a
14
+ * URL: that is what makes it a link rather than a widget that looks like one —
15
+ * focusable from the keyboard, announced as a link, and shown in the status bar
16
+ * on hover. Without an `href` it still has to be reachable, so it renders as a
17
+ * button rather than as an anchor with nothing to point at, which is focusable
18
+ * by neither keyboard nor assistive technology.
19
+ *
20
+ * A PLAIN left click is the host's and the default is suppressed, or the page
21
+ * would navigate twice — once through the host's router and once as a document
22
+ * load, which is the slower of the two and undoes the first. A middle-click or
23
+ * a modified click is deliberately left to the browser: that is what opens the
24
+ * parent in a new tab, and it is the reason for the `href` in the first place.
25
+ */
26
+ export declare function BackLink({ label, href, onClick, }: {
27
+ /** The parent, named: "Back to {label}". */
28
+ label: string;
29
+ /** The parent's URL, when it has one. */
30
+ href?: string;
31
+ onClick: (event: React.MouseEvent) => void;
32
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * The bar above a dashboard, in the one shape both the reader's view and the
4
+ * builder use.
5
+ *
6
+ * Reading and editing are the same page in two states, so the bar that carries
7
+ * the switch is the same bar: same height, same ground, same edge, and the
8
+ * same left and right margins as the dashboard under it — the state on the
9
+ * left, the way out of it on the right. The fixed height is the load-bearing
10
+ * part: it is what makes switching modes move nothing on the page.
11
+ *
12
+ * No horizontal padding of its own: it is laid out inside whatever insets the
13
+ * dashboard, so the left item lines up with the title below it and the right
14
+ * item with the right edge of the grid.
15
+ */
16
+ export declare function DashboardBar({ left, children, }: {
17
+ /** The page's state, at the left edge: a chip, or nothing while reading. */
18
+ left?: ReactNode;
19
+ /** What can be done about it, at the right edge. */
20
+ children?: ReactNode;
21
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,15 +1,19 @@
1
1
  /**
2
2
  * What a dashboard surface reports about itself, for the host to log or
3
- * count: the operations that matter (open, save, export, the rows behind a
4
- * value, exploring a tile), each with its outcome and how long it took.
3
+ * count: the operations that matter (open, save, the rows behind a value,
4
+ * exploring a tile), each with its outcome and how long it took.
5
5
  *
6
6
  * Context-free on purpose — the host that mounted the surface knows which
7
7
  * environment, package and dashboard it is, and adds that when it logs.
8
8
  */
9
9
  export type DashboardEvent = {
10
10
  type: "dashboard.opened";
11
- /** The package file, or a draft the host had saved. */
12
- from: "package" | "draft";
11
+ /**
12
+ * The package file, a draft the host had saved beside it, or the
13
+ * host's own copy when that copy is the record. A record open is not a
14
+ * "draft" open: nothing was resumed and nothing is pending.
15
+ */
16
+ from: "package" | "draft" | "record";
13
17
  tiles: number;
14
18
  durationMs: number;
15
19
  } | {
@@ -20,13 +24,26 @@ export type DashboardEvent = {
20
24
  tiles: number;
21
25
  /** Whether a tile was added or removed, which moves declarations. */
22
26
  structural: boolean;
27
+ /**
28
+ * Where it went, named by which storage took the write rather than by
29
+ * where that storage happens to keep things, since "browser" and
30
+ * "host" do not divide by English: `package` is the package file on
31
+ * the server, `browser` is the Console's own browser store, and `host`
32
+ * is a host storage that holds the record.
33
+ *
34
+ * Separate because they are not the same event. A save into the
35
+ * package or the record is a change every reader sees; a browser save
36
+ * is one person's copy on one machine. Counting them together makes
37
+ * "dashboards are being edited" unreadable, because a read-only server
38
+ * reports exactly as much saving as a writable one.
39
+ */
40
+ where: "package" | "browser" | "host";
41
+ /** The workspace that took the write, so the event says so itself. */
42
+ workspace?: string;
23
43
  durationMs: number;
24
44
  } | {
25
45
  type: "dashboard.save_refused";
26
46
  reason: string;
27
- } | {
28
- type: "dashboard.exported";
29
- bytes: number;
30
47
  } | {
31
48
  type: "dashboard.rows_shown";
32
49
  source: string;
@@ -1,12 +1,16 @@
1
1
  import { ReactNode } from 'react';
2
2
  /**
3
- * The edit bar across the top of the builder, in the shape every builder has
4
- * settled on: that you are editing on the left, what you can do about it on
5
- * the right.
3
+ * The edit bar across the top of the builder: that you are editing on the
4
+ * left, what you can do about it on the right, in the same {@link DashboardBar}
5
+ * the reader's view uses, so switching modes swaps the contents of one bar
6
+ * rather than replacing one bar with a different one.
6
7
  *
7
- * Sticky, so undo and save stay in reach on a long dashboard; the reader's own
8
- * header (title and description) stays in the page below it rather than being
9
- * repeated here.
8
+ * The right-hand controls are grouped by what they do, separated rather than
9
+ * run together: change the page (a tile, its settings), take a change back or
10
+ * put it down (undo, redo, save), and leave (Done, where the reader's view has
11
+ * Edit). Sticky, so undo and save stay in reach on a long dashboard; the
12
+ * reader's own header (title and description) stays in the page below it
13
+ * rather than being repeated here.
10
14
  */
11
15
  export interface BuilderToolbarProps {
12
16
  canUndo: boolean;
@@ -17,13 +21,11 @@ export interface BuilderToolbarProps {
17
21
  saving: boolean;
18
22
  /** Absent when the builder has nowhere to save: no Save, no unsaved marker. */
19
23
  onSave?: () => void;
20
- /** The host's actions, beside the builder's own: Export, Done. */
24
+ /** The host's way out of editing: Done, at the right edge. */
21
25
  actions?: ReactNode;
22
26
  /** Open the add-tile picker. Absent when the host passed no catalog to pick from. */
23
27
  onAddTile?: () => void;
24
28
  /** Open the page's settings, anchored to the button that asked. */
25
29
  onSettings: (anchor: HTMLElement) => void;
26
- /** Quick layout: every tile this file owns to one width. */
27
- onQuickLayout: (share: 1 | 2 | 3 | 4) => void;
28
30
  }
29
- export declare function BuilderToolbar({ canUndo, canRedo, onUndo, onRedo, dirty, saving, onSave, actions, onAddTile, onSettings, onQuickLayout, }: BuilderToolbarProps): import("react/jsx-runtime").JSX.Element;
31
+ export declare function BuilderToolbar({ canUndo, canRedo, onUndo, onRedo, dirty, saving, onSave, actions, onAddTile, onSettings, }: BuilderToolbarProps): import("react/jsx-runtime").JSX.Element;
@@ -103,10 +103,28 @@ export interface DashboardBuilderProps {
103
103
  /** Saves and refusals, for the host to log; see `DashboardEvent`. */
104
104
  onEvent?: DashboardEventHandler;
105
105
  /**
106
- * The host's own actions for the edit bar — Export, Done — rendered beside
106
+ * Whether the document differs from what was last saved, on every change
107
+ * and on mount.
108
+ *
109
+ * For a host that has to decide whether it may replace what is open — a
110
+ * newer version arriving from its store, a navigation away. `onChange`
111
+ * cannot answer that: the saved baseline lives in this hook, so a parent
112
+ * comparing the document it is handed against the one it passed in reads
113
+ * dirty immediately after a successful save.
114
+ */
115
+ onDirtyChange?: (dirty: boolean) => void;
116
+ /**
117
+ * Where `onSave` puts the file, for the event it reports. The builder
118
+ * cannot tell — it is handed a function — and a save into the package, into
119
+ * this browser, and into a host store that holds the record are not the
120
+ * same event.
121
+ */
122
+ savesTo?: "package" | "browser" | "host";
123
+ /**
124
+ * The host's own actions for the edit bar — Done — rendered beside
107
125
  * undo, redo and save. The builder owns the edits; where the file goes
108
126
  * afterwards is the host's, so its buttons sit in the host's slot.
109
127
  */
110
128
  toolbar?: ReactNode;
111
129
  }
112
- export declare function DashboardBuilder({ source, document, onSave, onChange, renderTile, controls, givens, catalog, toolbar, dashboards, onEvent, }: DashboardBuilderProps): import("react/jsx-runtime").JSX.Element;
130
+ export declare function DashboardBuilder({ source, document, onSave, onChange, onDirtyChange, renderTile, controls, givens, catalog, toolbar, dashboards, onEvent, savesTo, }: DashboardBuilderProps): import("react/jsx-runtime").JSX.Element;
@@ -5,28 +5,38 @@ import { DashboardEventHandler } from '../Dashboard/telemetry';
5
5
  * control row and live tiles that follow the document, a catalog for the
6
6
  * filter window's field search, and saving.
7
7
  *
8
- * SAVING is through the host's {@link DocumentStorage}, not to the package.
9
- * The package dashboard is a read-only origin: editing works on a copy, the
10
- * copy is saved where the host keeps documents (the Console's default is this
11
- * browser), and "Export" hands the file back so it can be put in the package.
12
- * That is the plan's copy-and-export model, and it needs no server write path.
13
- * A host with no storage still gets the editor, without Save.
8
+ * SAVING goes wherever the record is. A {@link Workspace} the host marks
9
+ * `authoritative` IS the record, so the editor opens that copy and writes back
10
+ * to it, and the package file is a deploy of it. Otherwise the record is the
11
+ * package: the editor writes there on a server that takes writes, and
12
+ * otherwise keeps a copy beside it in the host's {@link DocumentStorage} — the
13
+ * Console's default is this browser, where the copy is offered back on the
14
+ * next visit. A host with neither still gets the editor, without Save.
14
15
  *
15
16
  * What that costs is stated in the toolbar: a control added here is live in the
16
17
  * editor (its value is written into each tile's query) but reaches the package
17
- * only when the exported file does.
18
+ * only when the file is saved into it.
18
19
  */
19
20
  export interface DashboardEditorProps {
20
21
  environmentName: string;
21
22
  packageName: string;
22
23
  /** The dashboard's slug: `overview`, not `dashboards/overview.malloy`. */
23
24
  dashboardName: string;
24
- /** Leave the editor: the host's "Done". Absent, no Done button. */
25
+ /** Leave the editor: the host's "Done editing". Absent, no such button. */
25
26
  onExit?: () => void;
26
27
  /**
27
- * What the editor does — opened, saved, exported, refused — for the host
28
- * to log or count; see `DashboardEvent`.
28
+ * What the editor does — opened, saved, refused — for the host to log or
29
+ * count; see `DashboardEvent`.
29
30
  */
30
31
  onEvent?: DashboardEventHandler;
32
+ /**
33
+ * Whether there are edits the record does not have, on every change and
34
+ * whenever the editor opens a document.
35
+ *
36
+ * For a host that owns the way out: a route change, a tab close, its own
37
+ * "are you sure". The editor will not discard unsaved work on its own, so
38
+ * without this a host cannot tell whether leaving costs anything.
39
+ */
40
+ onDirtyChange?: (dirty: boolean) => void;
31
41
  }
32
- export declare function DashboardEditor({ environmentName, packageName, dashboardName, onExit, onEvent, }: DashboardEditorProps): import("react/jsx-runtime").JSX.Element;
42
+ export declare function DashboardEditor({ environmentName, packageName, dashboardName, onExit, onEvent, onDirtyChange, }: DashboardEditorProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * A new dashboard file, the way the builder would have written it: the
3
+ * dashboard-declared-givens convention with no givens yet, one extension of
4
+ * the chosen source named the way the builder names one (`<source>_tiles`),
5
+ * and one tile on it — the reader needs a tile to lay out, and a first view
6
+ * is what the author picked anyway.
7
+ */
8
+ export interface NewDashboard {
9
+ title: string;
10
+ /** The model that declares the source, relative to the package root. */
11
+ modelPath: string;
12
+ source: string;
13
+ view: string;
14
+ }
15
+ /** `Sales by region` → `sales-by-region`: the file name, and so the slug. */
16
+ export declare function slugFor(title: string): string;
17
+ export declare function newDashboardSource({ title, modelPath, source, view, }: NewDashboard): string;
@@ -1,4 +1,4 @@
1
- import { DashboardDocument } from './document';
1
+ import { DashboardDocument, DashboardTile } from './document';
2
2
  /**
3
3
  * Write a change back into a `dashboards/*.malloy` file by PATCHING it.
4
4
  *
@@ -41,4 +41,13 @@ export type SpliceResult = {
41
41
  } | SpliceFailure;
42
42
  /** Narrow to the failure arm; see {@link readFailed} for why a guard. */
43
43
  export declare const spliceFailed: (result: SpliceResult) => result is SpliceFailure;
44
+ /**
45
+ * One tile's identity TO THE FILE, ignoring presentation and position — but
46
+ * not its declaration: a tile redeclared from another view is a different tile
47
+ * to the file, removed and added, which `document.tileKey` does not say.
48
+ * `document.tileKey` is the grid's identity, which a drag names and React keys
49
+ * on; this one decides what gets written. Anything asking "will this save
50
+ * rewrite declarations?" wants THIS key.
51
+ */
52
+ export declare const tileFileKey: (t: DashboardTile) => string;
44
53
  export declare function spliceDashboardDocument(sourceText: string, next: DashboardDocument): Promise<SpliceResult>;