@malloy-publisher/sdk 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/README.md +14 -9
  2. package/dist/{DocumentStorageProvider-tGvodI8f.es.js → DocumentStorageProvider-CyOJ0hqf.es.js} +7114 -6939
  3. package/dist/DocumentStorageProvider-DGPQEd_l.cjs.js +134 -0
  4. package/dist/{RenderedResult-mDE-4u8S.es.js → RenderedResult-BnPzJ9Jf.es.js} +64 -57
  5. package/dist/{RenderedResult-CPi6uQWq.cjs.js → RenderedResult-Dp22kZsQ.cjs.js} +2 -2
  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 +41 -41
  9. package/dist/builder/index.es.js +2752 -2831
  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 +10 -5
  17. package/dist/components/DashboardBuilder/BuilderToolbar.d.ts +12 -10
  18. package/dist/components/DashboardBuilder/DashboardBuilder.d.ts +8 -2
  19. package/dist/components/DashboardBuilder/DashboardEditor.d.ts +8 -10
  20. package/dist/components/DashboardBuilder/newDashboard.d.ts +17 -0
  21. package/dist/components/DashboardBuilder/spliceDocument.d.ts +10 -1
  22. package/dist/components/ItemRow.d.ts +38 -0
  23. package/dist/components/Materializations/MaterializationDetailDialog.d.ts +1 -2
  24. package/dist/components/Materializations/MaterializationRunsList.d.ts +1 -5
  25. package/dist/components/Materializations/Materializations.d.ts +7 -3
  26. package/dist/components/Materializations/ScopeButton.d.ts +18 -0
  27. package/dist/components/Materializations/SectionLabel.d.ts +7 -4
  28. package/dist/components/Materializations/TriggerLabel.d.ts +14 -0
  29. package/dist/components/Materializations/index.d.ts +0 -1
  30. package/dist/components/Package/ContentTypeIcon.d.ts +3 -5
  31. package/dist/components/Package/NewDashboardDialog.d.ts +18 -0
  32. package/dist/components/Package/index.d.ts +0 -1
  33. package/dist/components/PackageSection.d.ts +23 -0
  34. package/dist/components/buttons.d.ts +53 -0
  35. package/dist/components/index.d.ts +5 -0
  36. package/dist/components/styles.d.ts +49 -40
  37. package/dist/hooks/useCrudMutation.d.ts +42 -0
  38. package/dist/index.cjs.js +22 -26
  39. package/dist/index.d.ts +1 -0
  40. package/dist/index.es.js +17425 -20672
  41. package/dist/telemetry/consoleEvents.d.ts +60 -0
  42. package/dist/utils/sha256.d.ts +2 -0
  43. package/package.json +1 -1
  44. package/src/components/AppDialog.tsx +115 -0
  45. package/src/components/BackLink.tsx +83 -0
  46. package/src/components/Connections/AddConnectionDialog.tsx +50 -70
  47. package/src/components/Connections/DeleteConnectionDialog.tsx +23 -50
  48. package/src/components/Connections/EditConnectionDialog.tsx +54 -73
  49. package/src/components/Dashboard/DashboardBar.tsx +88 -0
  50. package/src/components/Dashboard/telemetry.ts +10 -3
  51. package/src/components/DashboardBuilder/AddTileDialog.tsx +141 -143
  52. package/src/components/DashboardBuilder/BuilderToolbar.tsx +110 -218
  53. package/src/components/DashboardBuilder/DashboardBuilder.spec.tsx +5 -11
  54. package/src/components/DashboardBuilder/DashboardBuilder.tsx +184 -171
  55. package/src/components/DashboardBuilder/DashboardEditor.package.spec.tsx +163 -0
  56. package/src/components/DashboardBuilder/DashboardEditor.spec.tsx +2 -25
  57. package/src/components/DashboardBuilder/DashboardEditor.tsx +135 -61
  58. package/src/components/DashboardBuilder/DiffDialog.tsx +75 -82
  59. package/src/components/DashboardBuilder/DrillDialog.tsx +144 -156
  60. package/src/components/DashboardBuilder/FilterDialog.tsx +276 -295
  61. package/src/components/DashboardBuilder/FilterStrip.tsx +11 -10
  62. package/src/components/DashboardBuilder/newDashboard.spec.ts +40 -0
  63. package/src/components/DashboardBuilder/newDashboard.ts +48 -0
  64. package/src/components/DashboardBuilder/spliceDocument.spec.ts +53 -0
  65. package/src/components/DashboardBuilder/spliceDocument.ts +45 -8
  66. package/src/components/DashboardBuilder/useDashboardEditor.spec.ts +56 -0
  67. package/src/components/DashboardBuilder/useDashboardEditor.ts +12 -4
  68. package/src/components/Environment/About.tsx +14 -28
  69. package/src/components/Environment/AddPackageDialog.tsx +85 -154
  70. package/src/components/Environment/Connections.tsx +125 -205
  71. package/src/components/Environment/DeletePackageDialog.tsx +32 -77
  72. package/src/components/Environment/EditPackageDialog.tsx +46 -58
  73. package/src/components/Environment/Environment.tsx +34 -36
  74. package/src/components/Environment/Packages.tsx +63 -128
  75. package/src/components/Home/AddEnvironmentDialog.tsx +47 -70
  76. package/src/components/Home/DeleteEnvironmentDialog.tsx +32 -77
  77. package/src/components/Home/EditEnvironmentDialog.tsx +47 -61
  78. package/src/components/Home/Home.tsx +101 -214
  79. package/src/components/ItemRow.tsx +165 -0
  80. package/src/components/Materializations/CreateMaterializationDialog.tsx +34 -51
  81. package/src/components/Materializations/DeleteMaterializationDialog.tsx +31 -53
  82. package/src/components/Materializations/MaterializationDetailDialog.tsx +60 -69
  83. package/src/components/Materializations/MaterializationRunsList.tsx +29 -42
  84. package/src/components/Materializations/Materializations.tsx +137 -140
  85. package/src/components/Materializations/ScopeButton.tsx +85 -0
  86. package/src/components/Materializations/SectionLabel.tsx +7 -4
  87. package/src/components/Materializations/SetScheduleDialog.tsx +48 -89
  88. package/src/components/Materializations/TriggerLabel.tsx +36 -0
  89. package/src/components/Materializations/cron.spec.ts +113 -0
  90. package/src/components/Materializations/index.ts +0 -1
  91. package/src/components/Materializations/utils.spec.ts +182 -0
  92. package/src/components/Package/ContentTypeIcon.spec.ts +22 -37
  93. package/src/components/Package/ContentTypeIcon.tsx +10 -12
  94. package/src/components/Package/NewDashboardDialog.spec.tsx +129 -0
  95. package/src/components/Package/NewDashboardDialog.tsx +265 -0
  96. package/src/components/Package/Package.tsx +179 -238
  97. package/src/components/Package/index.ts +0 -1
  98. package/src/components/PackageSection.tsx +85 -0
  99. package/src/components/RenderedResult/RenderedResult.lifecycle.spec.tsx +198 -0
  100. package/src/components/RenderedResult/RenderedResult.tsx +22 -8
  101. package/src/components/ResultsDialog.tsx +8 -32
  102. package/src/components/buttons.tsx +114 -0
  103. package/src/components/designSystem.spec.tsx +316 -0
  104. package/src/components/given/paramCodec.spec.ts +1 -1
  105. package/src/components/index.ts +10 -0
  106. package/src/components/styles.ts +49 -85
  107. package/src/hooks/useCrudMutation.spec.tsx +119 -0
  108. package/src/hooks/useCrudMutation.tsx +85 -0
  109. package/src/index.ts +9 -0
  110. package/src/telemetry/consoleEvents.spec.ts +130 -0
  111. package/src/telemetry/consoleEvents.ts +124 -0
  112. package/src/theme/defaults.ts +34 -23
  113. package/src/theme/resolveTheme.spec.ts +9 -4
  114. package/src/theme/resolveTheme.ts +12 -8
  115. package/src/utils/sha256.ts +13 -0
  116. package/test/README.md +1 -1
  117. package/test/serverProvider.tsx +5 -2
  118. package/dist/DocumentStorageProvider-BeBD0uWc.cjs.js +0 -134
  119. package/dist/ServerProvider-CH71GsoL.cjs.js +0 -1
  120. package/dist/components/Materializations/CreateEnvMaterializationDialog.d.ts +0 -14
  121. package/dist/components/Materializations/EnvironmentMaterializations.d.ts +0 -7
  122. package/dist/components/Materializations/ScheduleCard.d.ts +0 -20
  123. package/dist/components/Materializations/TriggerChip.d.ts +0 -10
  124. package/dist/components/Package/Models.d.ts +0 -6
  125. package/src/components/Materializations/CreateEnvMaterializationDialog.tsx +0 -179
  126. package/src/components/Materializations/EnvironmentMaterializations.tsx +0 -267
  127. package/src/components/Materializations/ScheduleCard.tsx +0 -231
  128. package/src/components/Materializations/TriggerChip.tsx +0 -44
  129. 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,7 +1,7 @@
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.
@@ -20,13 +20,18 @@ export type DashboardEvent = {
20
20
  tiles: number;
21
21
  /** Whether a tile was added or removed, which moves declarations. */
22
22
  structural: boolean;
23
+ /**
24
+ * Where it went. A save into the package is a change every reader of
25
+ * that server sees; a browser save is one person's copy on one
26
+ * machine. Counting them together makes "dashboards are being edited"
27
+ * unreadable, because a read-only server reports exactly as much
28
+ * saving as a writable one.
29
+ */
30
+ where: "package" | "browser";
23
31
  durationMs: number;
24
32
  } | {
25
33
  type: "dashboard.save_refused";
26
34
  reason: string;
27
- } | {
28
- type: "dashboard.exported";
29
- bytes: number;
30
35
  } | {
31
36
  type: "dashboard.rows_shown";
32
37
  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,16 @@ 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
+ * Where `onSave` puts the file, for the event it reports. The builder
107
+ * cannot tell — it is handed a function — and a save into the package and a
108
+ * save into this browser are not the same event.
109
+ */
110
+ savesTo?: "package" | "browser";
111
+ /**
112
+ * The host's own actions for the edit bar — Done — rendered beside
107
113
  * undo, redo and save. The builder owns the edits; where the file goes
108
114
  * afterwards is the host's, so its buttons sit in the host's slot.
109
115
  */
110
116
  toolbar?: ReactNode;
111
117
  }
112
- export declare function DashboardBuilder({ source, document, onSave, onChange, renderTile, controls, givens, catalog, toolbar, dashboards, onEvent, }: DashboardBuilderProps): import("react/jsx-runtime").JSX.Element;
118
+ export declare function DashboardBuilder({ source, document, onSave, onChange, renderTile, controls, givens, catalog, toolbar, dashboards, onEvent, savesTo, }: DashboardBuilderProps): import("react/jsx-runtime").JSX.Element;
@@ -5,27 +5,25 @@ 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 to the package on a server that takes writes, and otherwise to
9
+ * the host's {@link DocumentStorage} — the Console's default is this browser,
10
+ * where the copy is offered back on the next visit. A host with neither still
11
+ * gets the editor, without Save.
14
12
  *
15
13
  * What that costs is stated in the toolbar: a control added here is live in the
16
14
  * editor (its value is written into each tile's query) but reaches the package
17
- * only when the exported file does.
15
+ * only when the file is saved into it.
18
16
  */
19
17
  export interface DashboardEditorProps {
20
18
  environmentName: string;
21
19
  packageName: string;
22
20
  /** The dashboard's slug: `overview`, not `dashboards/overview.malloy`. */
23
21
  dashboardName: string;
24
- /** Leave the editor: the host's "Done". Absent, no Done button. */
22
+ /** Leave the editor: the host's "Done editing". Absent, no such button. */
25
23
  onExit?: () => void;
26
24
  /**
27
- * What the editor does — opened, saved, exported, refused — for the host
28
- * to log or count; see `DashboardEvent`.
25
+ * What the editor does — opened, saved, refused — for the host to log or
26
+ * count; see `DashboardEvent`.
29
27
  */
30
28
  onEvent?: DashboardEventHandler;
31
29
  }
@@ -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>;
@@ -0,0 +1,38 @@
1
+ import * as React from "react";
2
+ /**
3
+ * One thing in a list, anywhere in the Console: a colored icon plate, the
4
+ * thing's name, what it is, and whatever acts on it at the right edge. One per
5
+ * row.
6
+ *
7
+ * The rule is that a list is a list: everything a reader scans down is drawn
8
+ * this way, so the same reading task looks the same on every page. A grid of
9
+ * cards says "these are tiles to arrange", which is not what any of these
10
+ * lists are; a row also lets the description be a description rather than two
11
+ * clamped lines.
12
+ *
13
+ * The color is passed rather than derived here: the package page keys it off
14
+ * content type (see `CONTENT_TINT`), and the environment-scoped lists off what
15
+ * kind of thing the list holds (see `SURFACE_TINT`). Both are exhaustive maps,
16
+ * so the color stays a property of the kind and not of the call site.
17
+ */
18
+ export declare function ItemRow({ icon, tint, label, mono, description, rightLabel, trailingAction, onClick, ariaLabel, }: {
19
+ /** The glyph, drawn white on the tinted plate. */
20
+ icon: React.ReactNode;
21
+ tint: string;
22
+ label: string;
23
+ /** Monospace label, for a name that is a file path. */
24
+ mono?: boolean;
25
+ /** What this one is, in the author's words. One line, then ellipsis. */
26
+ description?: string;
27
+ /** A fact about the row, right-aligned before any action: "1.0 K rows". */
28
+ rightLabel?: string;
29
+ /**
30
+ * Rendered at the end of the row: a menu, an open-in-new-tab button. Clicks
31
+ * on it should `event.stopPropagation()` so the row's own click does not
32
+ * also fire.
33
+ */
34
+ trailingAction?: React.ReactNode;
35
+ onClick?: (event: React.MouseEvent) => void;
36
+ /** Overrides the accessible name, which is otherwise the label. */
37
+ ariaLabel?: string;
38
+ }): import("react/jsx-runtime").JSX.Element;
@@ -2,8 +2,7 @@ import { BuildPlan, Materialization } from '../../client';
2
2
  type MaterializationDetailDialogProps = {
3
3
  materialization: Materialization | null;
4
4
  buildPlan: BuildPlan | null;
5
- showBuildPlan?: boolean;
6
5
  onClose: () => void;
7
6
  };
8
- export default function MaterializationDetailDialog({ materialization, buildPlan, showBuildPlan, onClose, }: MaterializationDetailDialogProps): import("react/jsx-runtime").JSX.Element;
7
+ export default function MaterializationDetailDialog({ materialization, buildPlan, onClose, }: MaterializationDetailDialogProps): import("react/jsx-runtime").JSX.Element;
9
8
  export {};
@@ -3,13 +3,9 @@ type MaterializationRunsListProps = {
3
3
  materializations: Materialization[];
4
4
  mutable: boolean;
5
5
  isMutating: boolean;
6
- /** Show a Package column — for the environment-scoped view spanning packages. */
7
- showPackage?: boolean;
8
- /** Navigate to a package (used by the Package column links). */
9
- onClickPackage?: (packageName: string) => void;
10
6
  onStop: (materialization: Materialization) => void;
11
7
  onDelete: (materialization: Materialization, dropTables: boolean) => void;
12
8
  onViewDetails: (materialization: Materialization) => void;
13
9
  };
14
- export default function MaterializationRunsList({ materializations, mutable, isMutating, showPackage, onClickPackage, onStop, onDelete, onViewDetails, }: MaterializationRunsListProps): import("react/jsx-runtime").JSX.Element;
10
+ export default function MaterializationRunsList({ materializations, mutable, isMutating, onStop, onDelete, onViewDetails, }: MaterializationRunsListProps): import("react/jsx-runtime").JSX.Element;
15
11
  export {};
@@ -1,7 +1,11 @@
1
- import { default as React } from 'react';
2
1
  interface MaterializationsProps {
3
2
  resourceUri: string;
4
- onClickPackageFile?: (to: string, event?: React.MouseEvent) => void;
5
3
  }
6
- export default function Materializations({ resourceUri, onClickPackageFile, }: MaterializationsProps): import("react/jsx-runtime").JSX.Element;
4
+ /**
5
+ * The package's materializations, as a section of its page: what has been
6
+ * built, and the three controls that change it — scope, schedule, and a new
7
+ * build. The runs are the package's own history, so they sit beside its
8
+ * dashboards and models rather than one click away on a page of their own.
9
+ */
10
+ export default function Materializations({ resourceUri, }: MaterializationsProps): import("react/jsx-runtime").JSX.Element;
7
11
  export {};
@@ -0,0 +1,18 @@
1
+ export type Scope = "package" | "version";
2
+ /**
3
+ * The package's persist scope, as one button.
4
+ *
5
+ * It is a menu rather than a pair of toggles because the two values are a
6
+ * choice, not a filter, and because the choice is usually made once and then
7
+ * left alone — the section's heading row is not the place for a permanent
8
+ * two-button control. What each value means is in the menu, where it is read at
9
+ * the moment of choosing rather than sitting on the page forever.
10
+ */
11
+ export default function ScopeButton({ scope, disabled, disabledReason, isSubmitting, onChange, }: {
12
+ scope: Scope;
13
+ disabled?: boolean;
14
+ /** Why the control is disabled, shown on hover. */
15
+ disabledReason?: string;
16
+ isSubmitting?: boolean;
17
+ onChange: (scope: Scope) => Promise<unknown>;
18
+ }): import("react/jsx-runtime").JSX.Element;