@malloy-publisher/sdk 0.8.3 → 0.8.5
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.
- package/README.md +14 -65
- package/dist/Dashboard-ChyylkTD.cjs.js +136 -0
- package/dist/{DocumentStorage-CigwNjz4.es.js → Dashboard-H1kJlDFo.es.js} +23660 -23575
- package/dist/{RenderedResult-DpHdrFtp.cjs.js → RenderedResult-AJPMUkAD.cjs.js} +1 -1
- package/dist/{RenderedResult-BfayOSk1.es.js → RenderedResult-BRgIgxWh.es.js} +18 -18
- package/dist/{ServerProvider-CfUFleYe.es.js → ServerProvider-Boxrv6Ym.es.js} +1481 -1513
- package/dist/ServerProvider-CXrOKD6g.cjs.js +1 -0
- package/dist/builder/index.cjs.js +50 -50
- package/dist/builder/index.es.js +2587 -2511
- package/dist/client/api.d.ts +187 -1803
- package/dist/client/base.d.ts +0 -24
- package/dist/client/common.d.ts +4 -35
- package/dist/client/configuration.d.ts +25 -18
- package/dist/client/index.cjs.js +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.es.js +62 -59
- package/dist/components/DashboardBuilder/malloyText.d.ts +49 -0
- package/dist/components/DashboardBuilder/malloyTree.d.ts +2 -18
- package/dist/components/DashboardBuilder/readDocument.d.ts +2 -0
- package/dist/components/Notebook/NotebookCell.d.ts +3 -2
- package/dist/components/Notebook/cellKind.d.ts +20 -0
- package/dist/hooks/useQueryResult.d.ts +1 -1
- package/dist/index.cjs.js +15 -12
- package/dist/index.es.js +4528 -4435
- package/openapitools.json +1 -1
- package/package.json +3 -3
- package/src/components/DashboardBuilder/malloyText.spec.ts +70 -1
- package/src/components/DashboardBuilder/malloyText.ts +171 -3
- package/src/components/DashboardBuilder/malloyTree.spec.ts +35 -0
- package/src/components/DashboardBuilder/malloyTree.ts +28 -4
- package/src/components/DashboardBuilder/readDocument.spec.ts +180 -1
- package/src/components/DashboardBuilder/readDocument.ts +52 -14
- package/src/components/DashboardBuilder/spliceDocument.spec.ts +396 -2
- package/src/components/DashboardBuilder/spliceDocument.ts +121 -18
- package/src/components/Notebook/Notebook.served.spec.tsx +179 -0
- package/src/components/Notebook/Notebook.spec.tsx +33 -2
- package/src/components/Notebook/Notebook.tsx +13 -7
- package/src/components/Notebook/NotebookCell.tsx +124 -63
- package/src/components/Notebook/cellKind.spec.ts +191 -0
- package/src/components/Notebook/cellKind.ts +74 -0
- package/src/components/Package/Package.notebooks.spec.tsx +90 -0
- package/src/components/Package/Package.tsx +18 -4
- package/dist/DocumentStorage-DvUNSOiN.cjs.js +0 -134
- package/dist/ServerProvider-CuYLH_Yi.cjs.js +0 -1
package/dist/client/base.d.ts
CHANGED
|
@@ -1,42 +1,22 @@
|
|
|
1
1
|
import { Configuration } from './configuration';
|
|
2
2
|
import { AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
|
3
3
|
export declare const BASE_PATH: string;
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* @export
|
|
7
|
-
*/
|
|
8
4
|
export declare const COLLECTION_FORMATS: {
|
|
9
5
|
csv: string;
|
|
10
6
|
ssv: string;
|
|
11
7
|
tsv: string;
|
|
12
8
|
pipes: string;
|
|
13
9
|
};
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
* @export
|
|
17
|
-
* @interface RequestArgs
|
|
18
|
-
*/
|
|
19
10
|
export interface RequestArgs {
|
|
20
11
|
url: string;
|
|
21
12
|
options: RawAxiosRequestConfig;
|
|
22
13
|
}
|
|
23
|
-
/**
|
|
24
|
-
*
|
|
25
|
-
* @export
|
|
26
|
-
* @class BaseAPI
|
|
27
|
-
*/
|
|
28
14
|
export declare class BaseAPI {
|
|
29
15
|
protected basePath: string;
|
|
30
16
|
protected axios: AxiosInstance;
|
|
31
17
|
protected configuration: Configuration | undefined;
|
|
32
18
|
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
|
|
33
19
|
}
|
|
34
|
-
/**
|
|
35
|
-
*
|
|
36
|
-
* @export
|
|
37
|
-
* @class RequiredError
|
|
38
|
-
* @extends {Error}
|
|
39
|
-
*/
|
|
40
20
|
export declare class RequiredError extends Error {
|
|
41
21
|
field: string;
|
|
42
22
|
constructor(field: string, msg?: string);
|
|
@@ -47,9 +27,5 @@ interface ServerMap {
|
|
|
47
27
|
description: string;
|
|
48
28
|
}[];
|
|
49
29
|
}
|
|
50
|
-
/**
|
|
51
|
-
*
|
|
52
|
-
* @export
|
|
53
|
-
*/
|
|
54
30
|
export declare const operationServerMap: ServerMap;
|
|
55
31
|
export {};
|
package/dist/client/common.d.ts
CHANGED
|
@@ -1,54 +1,23 @@
|
|
|
1
1
|
import { Configuration } from './configuration';
|
|
2
2
|
import { RequestArgs } from './base';
|
|
3
3
|
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* @export
|
|
7
|
-
*/
|
|
8
4
|
export declare const DUMMY_BASE_URL = "https://example.com";
|
|
9
5
|
/**
|
|
10
6
|
*
|
|
11
7
|
* @throws {RequiredError}
|
|
12
|
-
* @export
|
|
13
8
|
*/
|
|
14
9
|
export declare const assertParamExists: (functionName: string, paramName: string, paramValue: unknown) => void;
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
* @export
|
|
18
|
-
*/
|
|
19
10
|
export declare const setApiKeyToObject: (object: any, keyParamName: string, configuration?: Configuration) => Promise<void>;
|
|
20
|
-
/**
|
|
21
|
-
*
|
|
22
|
-
* @export
|
|
23
|
-
*/
|
|
24
11
|
export declare const setBasicAuthToObject: (object: any, configuration?: Configuration) => void;
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* @export
|
|
28
|
-
*/
|
|
29
12
|
export declare const setBearerAuthToObject: (object: any, configuration?: Configuration) => Promise<void>;
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
* @export
|
|
33
|
-
*/
|
|
34
13
|
export declare const setOAuthToObject: (object: any, name: string, scopes: string[], configuration?: Configuration) => Promise<void>;
|
|
35
|
-
/**
|
|
36
|
-
*
|
|
37
|
-
* @export
|
|
38
|
-
*/
|
|
39
14
|
export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
|
|
40
15
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
16
|
+
* JSON serialization helper function which replaces instances of unserializable types with serializable ones.
|
|
17
|
+
* This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
|
|
18
|
+
* Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
|
|
43
19
|
*/
|
|
20
|
+
export declare const replaceWithSerializableTypeIfNeeded: (key: string, value: any) => any;
|
|
44
21
|
export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration) => any;
|
|
45
|
-
/**
|
|
46
|
-
*
|
|
47
|
-
* @export
|
|
48
|
-
*/
|
|
49
22
|
export declare const toPathString: (url: URL) => string;
|
|
50
|
-
/**
|
|
51
|
-
*
|
|
52
|
-
* @export
|
|
53
|
-
*/
|
|
54
23
|
export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Malloy Publisher - Semantic Model Serving API
|
|
3
|
-
* The Malloy Publisher - Semantic Model Serving API provides access to Malloy packages and everything they contain. A Malloy package is a directory with a `publisher.json` manifest at its root, holding Malloy models (`.malloy` files), notebooks (`.malloynb` files), embedded data (`.parquet`, `.csv`, and `.xlsx` files), and optionally an HTML data app under `public/`. ## Key Features - **Discovery**: List environments, packages, and the models, notebooks, data apps, and data a package contains - **Query Execution**: Run queries against models, execute notebooks a cell at a time, and compile-check Malloy without running it - **Data Apps**: In-package HTML data apps served from a package\'s `public/` directory - **Materializations**: Persist Malloy sources as tables, on a schedule or on demand - **Connection Management**: Configure and test warehouse connections, and browse their schemas and tables - **Watch Mode**: File watching, and a change-event stream for development workflows ## Resource Hierarchy The API follows a hierarchical resource structure: ``` Server ├── /status, /theme server state, and the UI theme ├── /connections/test validate a connection config ├── /watch-mode/… development file watching └── Environments ├── Connections schemas, tables, and ad-hoc SQL └── Packages ├── Models query and compile ├── Notebooks execute a cell at a time ├── Data Apps static HTML data apps from public/ ├── Databases embedded data files ├── Materializations persisted sources ├── Connections package-scoped connection access └── Events SSE stream of file changes ``` For worked examples, see the packages this server bundles (https://github.com/malloydata/publisher/tree/main/examples); the package format is documented in docs/packages.md (https://github.com/malloydata/publisher/blob/main/docs/packages.md).
|
|
3
|
+
* The Malloy Publisher - Semantic Model Serving API provides access to Malloy packages and everything they contain. A Malloy package is a directory with a `publisher.json` manifest at its root, holding Malloy models (`.malloy` files), notebooks (`.malloynb` files and `.malloy` files under `notebooks/`), embedded data (`.parquet`, `.csv`, and `.xlsx` files), and optionally an HTML data app under `public/`. ## Key Features - **Discovery**: List environments, packages, and the models, notebooks, data apps, and data a package contains - **Query Execution**: Run queries against models, execute notebooks a cell at a time, and compile-check Malloy without running it - **Data Apps**: In-package HTML data apps served from a package\'s `public/` directory - **Materializations**: Persist Malloy sources as tables, on a schedule or on demand - **Connection Management**: Configure and test warehouse connections, and browse their schemas and tables - **Watch Mode**: File watching, and a change-event stream for development workflows ## Resource Hierarchy The API follows a hierarchical resource structure: ``` Server ├── /status, /theme server state, and the UI theme ├── /connections/test validate a connection config ├── /watch-mode/… development file watching └── Environments ├── Connections schemas, tables, and ad-hoc SQL └── Packages ├── Models query and compile ├── Notebooks execute a cell at a time ├── Data Apps static HTML data apps from public/ ├── Databases embedded data files ├── Materializations persisted sources ├── Connections package-scoped connection access └── Events SSE stream of file changes ``` For worked examples, see the packages this server bundles (https://github.com/malloydata/publisher/tree/main/examples); the package format is documented in docs/packages.md (https://github.com/malloydata/publisher/blob/main/docs/packages.md).
|
|
4
4
|
*
|
|
5
5
|
* The version of the OpenAPI document: v0
|
|
6
6
|
*
|
|
@@ -9,11 +9,23 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
+
interface AWSv4Configuration {
|
|
13
|
+
options?: {
|
|
14
|
+
region?: string;
|
|
15
|
+
service?: string;
|
|
16
|
+
};
|
|
17
|
+
credentials?: {
|
|
18
|
+
accessKeyId?: string;
|
|
19
|
+
secretAccessKey?: string;
|
|
20
|
+
sessionToken?: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
12
23
|
export interface ConfigurationParameters {
|
|
13
24
|
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
|
14
25
|
username?: string;
|
|
15
26
|
password?: string;
|
|
16
27
|
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
|
28
|
+
awsv4?: AWSv4Configuration;
|
|
17
29
|
basePath?: string;
|
|
18
30
|
serverIndex?: number;
|
|
19
31
|
baseOptions?: any;
|
|
@@ -23,49 +35,43 @@ export declare class Configuration {
|
|
|
23
35
|
/**
|
|
24
36
|
* parameter for apiKey security
|
|
25
37
|
* @param name security name
|
|
26
|
-
* @memberof Configuration
|
|
27
38
|
*/
|
|
28
39
|
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
|
29
40
|
/**
|
|
30
41
|
* parameter for basic security
|
|
31
|
-
*
|
|
32
|
-
* @type {string}
|
|
33
|
-
* @memberof Configuration
|
|
34
42
|
*/
|
|
35
43
|
username?: string;
|
|
36
44
|
/**
|
|
37
45
|
* parameter for basic security
|
|
38
|
-
*
|
|
39
|
-
* @type {string}
|
|
40
|
-
* @memberof Configuration
|
|
41
46
|
*/
|
|
42
47
|
password?: string;
|
|
43
48
|
/**
|
|
44
49
|
* parameter for oauth2 security
|
|
45
50
|
* @param name security name
|
|
46
51
|
* @param scopes oauth2 scope
|
|
47
|
-
* @memberof Configuration
|
|
48
52
|
*/
|
|
49
53
|
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
|
50
54
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* @
|
|
55
|
+
* parameter for aws4 signature security
|
|
56
|
+
* @param {Object} AWS4Signature - AWS4 Signature security
|
|
57
|
+
* @param {string} options.region - aws region
|
|
58
|
+
* @param {string} options.service - name of the service.
|
|
59
|
+
* @param {string} credentials.accessKeyId - aws access key id
|
|
60
|
+
* @param {string} credentials.secretAccessKey - aws access key
|
|
61
|
+
* @param {string} credentials.sessionToken - aws session token
|
|
54
62
|
* @memberof Configuration
|
|
55
63
|
*/
|
|
64
|
+
awsv4?: AWSv4Configuration;
|
|
65
|
+
/**
|
|
66
|
+
* override base path
|
|
67
|
+
*/
|
|
56
68
|
basePath?: string;
|
|
57
69
|
/**
|
|
58
70
|
* override server index
|
|
59
|
-
*
|
|
60
|
-
* @type {number}
|
|
61
|
-
* @memberof Configuration
|
|
62
71
|
*/
|
|
63
72
|
serverIndex?: number;
|
|
64
73
|
/**
|
|
65
74
|
* base options for axios calls
|
|
66
|
-
*
|
|
67
|
-
* @type {any}
|
|
68
|
-
* @memberof Configuration
|
|
69
75
|
*/
|
|
70
76
|
baseOptions?: any;
|
|
71
77
|
/**
|
|
@@ -89,3 +95,4 @@ export declare class Configuration {
|
|
|
89
95
|
*/
|
|
90
96
|
isJsonMime(mime: string): boolean;
|
|
91
97
|
}
|
|
98
|
+
export {};
|
package/dist/client/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../ServerProvider-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../ServerProvider-CXrOKD6g.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.NotebookCellKindEnum=e.NotebookCellKindEnum;exports.NotebookCellResultKindEnum=e.NotebookCellResultKindEnum;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.RawNotebookFormatEnum=e.RawNotebookFormatEnum;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;
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Malloy Publisher - Semantic Model Serving API
|
|
3
|
-
* The Malloy Publisher - Semantic Model Serving API provides access to Malloy packages and everything they contain. A Malloy package is a directory with a `publisher.json` manifest at its root, holding Malloy models (`.malloy` files), notebooks (`.malloynb` files), embedded data (`.parquet`, `.csv`, and `.xlsx` files), and optionally an HTML data app under `public/`. ## Key Features - **Discovery**: List environments, packages, and the models, notebooks, data apps, and data a package contains - **Query Execution**: Run queries against models, execute notebooks a cell at a time, and compile-check Malloy without running it - **Data Apps**: In-package HTML data apps served from a package\'s `public/` directory - **Materializations**: Persist Malloy sources as tables, on a schedule or on demand - **Connection Management**: Configure and test warehouse connections, and browse their schemas and tables - **Watch Mode**: File watching, and a change-event stream for development workflows ## Resource Hierarchy The API follows a hierarchical resource structure: ``` Server ├── /status, /theme server state, and the UI theme ├── /connections/test validate a connection config ├── /watch-mode/… development file watching └── Environments ├── Connections schemas, tables, and ad-hoc SQL └── Packages ├── Models query and compile ├── Notebooks execute a cell at a time ├── Data Apps static HTML data apps from public/ ├── Databases embedded data files ├── Materializations persisted sources ├── Connections package-scoped connection access └── Events SSE stream of file changes ``` For worked examples, see the packages this server bundles (https://github.com/malloydata/publisher/tree/main/examples); the package format is documented in docs/packages.md (https://github.com/malloydata/publisher/blob/main/docs/packages.md).
|
|
3
|
+
* The Malloy Publisher - Semantic Model Serving API provides access to Malloy packages and everything they contain. A Malloy package is a directory with a `publisher.json` manifest at its root, holding Malloy models (`.malloy` files), notebooks (`.malloynb` files and `.malloy` files under `notebooks/`), embedded data (`.parquet`, `.csv`, and `.xlsx` files), and optionally an HTML data app under `public/`. ## Key Features - **Discovery**: List environments, packages, and the models, notebooks, data apps, and data a package contains - **Query Execution**: Run queries against models, execute notebooks a cell at a time, and compile-check Malloy without running it - **Data Apps**: In-package HTML data apps served from a package\'s `public/` directory - **Materializations**: Persist Malloy sources as tables, on a schedule or on demand - **Connection Management**: Configure and test warehouse connections, and browse their schemas and tables - **Watch Mode**: File watching, and a change-event stream for development workflows ## Resource Hierarchy The API follows a hierarchical resource structure: ``` Server ├── /status, /theme server state, and the UI theme ├── /connections/test validate a connection config ├── /watch-mode/… development file watching └── Environments ├── Connections schemas, tables, and ad-hoc SQL └── Packages ├── Models query and compile ├── Notebooks execute a cell at a time ├── Data Apps static HTML data apps from public/ ├── Databases embedded data files ├── Materializations persisted sources ├── Connections package-scoped connection access └── Events SSE stream of file changes ``` For worked examples, see the packages this server bundles (https://github.com/malloydata/publisher/tree/main/examples); the package format is documented in docs/packages.md (https://github.com/malloydata/publisher/blob/main/docs/packages.md).
|
|
4
4
|
*
|
|
5
5
|
* The version of the OpenAPI document: v0
|
|
6
6
|
*
|
package/dist/client/index.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as e, a as
|
|
1
|
+
import { A as e, a as o, C as i, b as n, c as t, d as r, e as p, f as u, g as A, h as m, i as c, j as E, k as l, l as C, m as y, n as F, o as P, D as b, p as d, q as g, r as S, s as k, t as M, u as h, v as x, w as D, x as v, y as T, z as R, B as f, E as N, F as z, G as Q, H as W, I as B, J as O, K as w, L as I, M as L, N as q, O as K, P as j, Q as G, R as H, S as J, T as U, U as V, V as X, W as Y, X as Z, Y as _, Z as $, _ as aa, $ as sa, a0 as ea, a1 as oa, a2 as ia, a3 as na, a4 as ta, a5 as ra, a6 as pa, a7 as ua, a8 as Aa, a9 as ma, aa as ca, ab as Ea, ac as la, ad as Ca, ae as ya, af as Fa, ag as Pa, ah as ba, ai as da, aj as ga, ak as Sa, al as ka, am as Ma, an as ha, ao as xa, ap as Da, aq as va, ar as Ta, as as Ra, at as fa, au as Na, av as za, aw as Qa, ax as Wa, ay as Ba, az as Oa, aA as wa, aB as Ia, aC as La, aD as qa, aE as Ka, aF as ja } from "../ServerProvider-Boxrv6Ym.es.js";
|
|
2
2
|
export {
|
|
3
3
|
e as AttachedDatabaseTypeEnum,
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
o as AzureConnectionAuthTypeEnum,
|
|
5
|
+
i as CompileProblemSeverityEnum,
|
|
6
6
|
n as CompileRequestScopeEnum,
|
|
7
7
|
t as CompileResultStatusEnum,
|
|
8
8
|
r as Configuration,
|
|
@@ -15,36 +15,36 @@ export {
|
|
|
15
15
|
l as ConnectionsApiFp,
|
|
16
16
|
C as ConnectionsTestApi,
|
|
17
17
|
y as ConnectionsTestApiAxiosParamCreator,
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
F as ConnectionsTestApiFactory,
|
|
19
|
+
P as ConnectionsTestApiFp,
|
|
20
20
|
b as DashboardsApi,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
d as DashboardsApiAxiosParamCreator,
|
|
22
|
+
g as DashboardsApiFactory,
|
|
23
23
|
S as DashboardsApiFp,
|
|
24
24
|
k as DataAppFitEnum,
|
|
25
25
|
M as DataAppsApi,
|
|
26
26
|
h as DataAppsApiAxiosParamCreator,
|
|
27
27
|
x as DataAppsApiFactory,
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
D as DataAppsApiFp,
|
|
29
|
+
v as DatabaseTypeEnum,
|
|
30
30
|
T as DatabasesApi,
|
|
31
31
|
R as DatabasesApiAxiosParamCreator,
|
|
32
32
|
f as DatabasesApiFactory,
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
N as DatabasesApiFp,
|
|
34
|
+
z as EnvironmentsApi,
|
|
35
35
|
Q as EnvironmentsApiAxiosParamCreator,
|
|
36
36
|
W as EnvironmentsApiFactory,
|
|
37
37
|
B as EnvironmentsApiFp,
|
|
38
38
|
O as ExecuteNotebookCellBypassFiltersEnum,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
w as FilterTypeEnum,
|
|
40
|
+
I as FreshnessFallbackEnum,
|
|
41
|
+
L as GivenControlEnum,
|
|
42
|
+
q as LedgerEntryStrategyEnum,
|
|
43
|
+
K as LogMessageSeverityEnum,
|
|
44
|
+
j as ManifestEntryFreshnessFallbackEnum,
|
|
45
|
+
G as ManifestEntryOriginEnum,
|
|
46
|
+
H as ManifestEntryRefreshEnum,
|
|
47
|
+
J as MaterializationActionActionEnum,
|
|
48
48
|
U as MaterializationStatus,
|
|
49
49
|
V as MaterializationsApi,
|
|
50
50
|
X as MaterializationsApiAxiosParamCreator,
|
|
@@ -54,43 +54,46 @@ export {
|
|
|
54
54
|
$ as ModelsApiAxiosParamCreator,
|
|
55
55
|
aa as ModelsApiFactory,
|
|
56
56
|
sa as ModelsApiFp,
|
|
57
|
-
ea as
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
na as
|
|
61
|
-
ta as
|
|
62
|
-
ra as
|
|
63
|
-
pa as
|
|
64
|
-
ua as
|
|
65
|
-
Aa as
|
|
66
|
-
ma as
|
|
67
|
-
ca as
|
|
68
|
-
Ea as
|
|
69
|
-
la as
|
|
70
|
-
Ca as
|
|
71
|
-
ya as
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
ba as
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
Sa as
|
|
78
|
-
ka as
|
|
79
|
-
Ma as
|
|
80
|
-
ha as
|
|
81
|
-
xa as
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
Ta as
|
|
85
|
-
Ra as
|
|
86
|
-
fa as
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
Qa as
|
|
90
|
-
Wa as
|
|
91
|
-
Ba as
|
|
92
|
-
Oa as
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
57
|
+
ea as NotebookCellKindEnum,
|
|
58
|
+
oa as NotebookCellResultKindEnum,
|
|
59
|
+
ia as NotebookCellResultTypeEnum,
|
|
60
|
+
na as NotebookCellTypeEnum,
|
|
61
|
+
ta as NotebooksApi,
|
|
62
|
+
ra as NotebooksApiAxiosParamCreator,
|
|
63
|
+
pa as NotebooksApiFactory,
|
|
64
|
+
ua as NotebooksApiFp,
|
|
65
|
+
Aa as PackageEmbeddingIndexStatusEnum,
|
|
66
|
+
ma as PackageManifestBindingStatusEnum,
|
|
67
|
+
ca as PackageQueryableSourcesEnum,
|
|
68
|
+
Ea as PackageScopeEnum,
|
|
69
|
+
la as PackageStorageServeBindingsInnerOriginEnum,
|
|
70
|
+
Ca as PackageWarningsInnerSeverityEnum,
|
|
71
|
+
ya as PackagesApi,
|
|
72
|
+
Fa as PackagesApiAxiosParamCreator,
|
|
73
|
+
Pa as PackagesApiFactory,
|
|
74
|
+
ba as PackagesApiFp,
|
|
75
|
+
da as PersistSourcePlanOriginEnum,
|
|
76
|
+
ga as PostgresConnectionSslmodeEnum,
|
|
77
|
+
Sa as PublisherApi,
|
|
78
|
+
ka as PublisherApiAxiosParamCreator,
|
|
79
|
+
Ma as PublisherApiFactory,
|
|
80
|
+
ha as PublisherApiFp,
|
|
81
|
+
xa as QueryClass,
|
|
82
|
+
Da as QueryResultQueryRowLimitSourceEnum,
|
|
83
|
+
va as QueryResultServedFromEnum,
|
|
84
|
+
Ta as RawNotebookFormatEnum,
|
|
85
|
+
Ra as Realization,
|
|
86
|
+
fa as RefusedSourceReasonEnum,
|
|
87
|
+
Na as RefusedSourceTierEnum,
|
|
88
|
+
za as RunContextTriggerEnum,
|
|
89
|
+
Qa as S3ConnectionProviderEnum,
|
|
90
|
+
Wa as ServerProvider,
|
|
91
|
+
Ba as ServerStatusOperationalStateEnum,
|
|
92
|
+
Oa as ThemeDefaultModeEnum,
|
|
93
|
+
wa as WatchModeApi,
|
|
94
|
+
Ia as WatchModeApiAxiosParamCreator,
|
|
95
|
+
La as WatchModeApiFactory,
|
|
96
|
+
qa as WatchModeApiFp,
|
|
97
|
+
Ka as globalQueryClient,
|
|
98
|
+
ja as useServer
|
|
96
99
|
};
|
|
@@ -1,6 +1,55 @@
|
|
|
1
1
|
export declare const isIdentifier: (text: string) => boolean;
|
|
2
|
+
/** The server's rule for the tag line: `## artifact` at the start of a line. */
|
|
3
|
+
export declare const ARTIFACT_LINE: RegExp;
|
|
4
|
+
/**
|
|
5
|
+
* A note's markdown route, by Malloy's prefix rule: the first whitespace-delimited token is
|
|
6
|
+
* `#`/`##`, an optional `|`, and `(markdown)` or its `<>`, `[]`, `{}` twin. `#(markdown)hi` has
|
|
7
|
+
* trailing junk on the prefix, which Malloy calls malformed and the server ignores.
|
|
8
|
+
*/
|
|
9
|
+
export declare function markdownNote(line: string): {
|
|
10
|
+
level: 1 | 2;
|
|
11
|
+
block: boolean;
|
|
12
|
+
} | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Whether `line` closes a block annotation as Malloy's lexer reads it: the closer sits at the
|
|
15
|
+
* opener's own column, and `|##` never closes a `#|` block. An unknown `column` (a cell's first
|
|
16
|
+
* line has lost its indentation) accepts any indent.
|
|
17
|
+
*/
|
|
18
|
+
export declare function closesBlock(line: string, column: number | undefined, closer: "|#" | "|##"): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The `##|` / `#|` blocks that have a closer, as `[opener line, closer line]`;
|
|
21
|
+
* an opener with none is not a block. An opener on a `skip` line (inside a
|
|
22
|
+
* block comment) opens nothing.
|
|
23
|
+
*/
|
|
24
|
+
export declare function blockSpans(lines: string[], skip?: (line: number) => boolean): [number, number][];
|
|
25
|
+
/** The lines that sit inside or on a block, where prose is not a tag or a note. */
|
|
26
|
+
export declare function blockLines(lines: string[]): Set<number>;
|
|
27
|
+
/**
|
|
28
|
+
* The `#(markdown)` lines and `#|(markdown)` blocks: prose attached to a declaration, not tags.
|
|
29
|
+
* A line inside a block comment (`skip`) or inside another block is no annotation.
|
|
30
|
+
*/
|
|
31
|
+
export declare function markdownLines(lines: string[], skip?: (line: number) => boolean): Set<number>;
|
|
2
32
|
/** The line carrying the model-level `## artifact` tag, or -1. */
|
|
3
33
|
export declare const artifactLine: (lines: string[]) => number;
|
|
34
|
+
/**
|
|
35
|
+
* The lines a dashboard's description is read from, by the server's rule: the
|
|
36
|
+
* notes above the artifact tag, or, when those carry no prose, the notes below
|
|
37
|
+
* it, `##"` lines and `##|"` blocks alike. `blankAbove` are the prose-less
|
|
38
|
+
* `##"` notes above when the text is read from below, which a rewrite has to
|
|
39
|
+
* clear; `below` are the `##"` notes under the tag, and `belowBlock` is true
|
|
40
|
+
* when a `##|"` block with prose sits there. `inBlock` is true when the text
|
|
41
|
+
* that is read is held in a block, which a rewrite cannot patch.
|
|
42
|
+
*/
|
|
43
|
+
export declare function descriptionNotes(lines: string[]): {
|
|
44
|
+
read: number[];
|
|
45
|
+
blankAbove: number[];
|
|
46
|
+
below: number[];
|
|
47
|
+
belowBlock: boolean;
|
|
48
|
+
inBlock: boolean;
|
|
49
|
+
text?: string;
|
|
50
|
+
};
|
|
51
|
+
/** Whether `tiles=[…]` holds an entry that is not a quoted run expression, such as a `kind=text` tile. */
|
|
52
|
+
export declare function hasNonQuotedTiles(artifactText: string): boolean;
|
|
4
53
|
/** A tile expression's steps: `orders -> by_brand + { limit: 2 }`. */
|
|
5
54
|
export interface TileSteps {
|
|
6
55
|
source: string;
|
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Where everything in a dashboard file IS, according to Malloy's own parser.
|
|
3
|
-
*
|
|
4
|
-
* The only module that touches the parse tree. The reader and the writer both
|
|
5
|
-
* locate through it, which is what makes a reader/writer disagreement about
|
|
6
|
-
* where a declaration starts or ends impossible rather than unlikely — the
|
|
7
|
-
* defect class that every hand-written scan here kept reintroducing.
|
|
8
|
-
*
|
|
9
|
-
* The rule the rest of the builder follows: LOCATORS come from this module,
|
|
10
|
-
* RECOGNIZERS may read text over a span this module bounded, and EMITTERS take
|
|
11
|
-
* positions only from a span or a token here. Nothing outside re-derives
|
|
12
|
-
* Malloy's grammar from raw text.
|
|
13
|
-
*
|
|
14
|
-
* Node identity is by ACCESSOR, never `constructor.name`: `@malloydata/malloy`
|
|
15
|
-
* is a peerDependency, so the host bundler minifies it and every class name
|
|
16
|
-
* becomes a single letter. Accessor and token names are properties, which
|
|
17
|
-
* minifiers leave alone.
|
|
18
|
-
*/
|
|
19
1
|
/** A half-open range of UTF-16 offsets into the source text. */
|
|
20
2
|
export interface Span {
|
|
21
3
|
start: number;
|
|
@@ -177,6 +159,8 @@ export interface ParsedMalloy {
|
|
|
177
159
|
* middle of a `/* … *\/`, whose text is prose however it begins.
|
|
178
160
|
*/
|
|
179
161
|
commentLine(line: number): boolean;
|
|
162
|
+
/** Whether `line` is part of a `#(markdown)` line or a `#|(markdown)` block, which are prose, not tags. */
|
|
163
|
+
proseLine(line: number): boolean;
|
|
180
164
|
/**
|
|
181
165
|
* The `#`/comment block immediately above `line`, stopping at a blank line —
|
|
182
166
|
* the unit that travels with a declaration when it moves.
|
|
@@ -56,6 +56,8 @@ export interface Block {
|
|
|
56
56
|
line: number;
|
|
57
57
|
text: string;
|
|
58
58
|
}>;
|
|
59
|
+
/** The `(markdown)` annotation lines in the block, which are not tags but leave with the declaration they describe. */
|
|
60
|
+
prose: number[];
|
|
59
61
|
}
|
|
60
62
|
/**
|
|
61
63
|
* The comment-and-tag block immediately above `declLine`, up to the blank line
|
|
@@ -9,7 +9,8 @@ interface NotebookCellProps {
|
|
|
9
9
|
expandEmbedding?: boolean;
|
|
10
10
|
hideEmbeddingIcon?: boolean;
|
|
11
11
|
resourceUri: string;
|
|
12
|
-
|
|
12
|
+
/** Whether this is the notebook's first markdown cell, which carries the copy-link icon. */
|
|
13
|
+
showCopyLink?: boolean;
|
|
13
14
|
maxResultSize?: number;
|
|
14
15
|
isExecuting?: boolean;
|
|
15
16
|
/**
|
|
@@ -55,5 +56,5 @@ interface NotebookCellProps {
|
|
|
55
56
|
/** The notebook's declared givens, so that dialog renders their controls. */
|
|
56
57
|
givenSpecs?: Given[];
|
|
57
58
|
}
|
|
58
|
-
export declare function NotebookCell({ cell, hideCodeCellIcon, hideEmbeddingIcon, resourceUri,
|
|
59
|
+
export declare function NotebookCell({ cell, hideCodeCellIcon, hideEmbeddingIcon, resourceUri, showCopyLink, maxResultSize, isExecuting, pendingRerun, onNavigate, onDrillSelf, canDrillSelf, onDrillNavigate, givens, givenSpecs, }: NotebookCellProps): import("react/jsx-runtime").JSX.Element;
|
|
59
60
|
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NotebookCell } from '../../client';
|
|
2
|
+
/**
|
|
3
|
+
* Whether the viewer sends a cell to the server to run. A served notebook's
|
|
4
|
+
* definition cell is `type: code` too, so `type` alone would execute it.
|
|
5
|
+
*/
|
|
6
|
+
export declare function cellRuns(cell: Pick<NotebookCell, "type" | "kind">): boolean;
|
|
7
|
+
type CellLines = Pick<NotebookCell, "text" | "proseLines" | "codeLine">;
|
|
8
|
+
/**
|
|
9
|
+
* A query cell's caption. A served cell's is the server's alone, absent meaning none; on an
|
|
10
|
+
* unserved cell (a `.malloynb`, an older server) it is the `#"` lines in the tag block above its `run:`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function cellCaption(cell: Pick<NotebookCell, "text" | "caption" | "proseLines" | "codeLine">): string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* A cell's code without its prose, which renders separately. A served cell loses exactly the
|
|
15
|
+
* lines the server named; an unserved one (a `.malloynb`, an older server) loses its `##` lines.
|
|
16
|
+
*/
|
|
17
|
+
export declare function stripProse(cell: CellLines): string;
|
|
18
|
+
/** One-line label for a folded definition cell: its statement kind and name. */
|
|
19
|
+
export declare function definitionSummary(cell: CellLines): string;
|
|
20
|
+
export {};
|
|
@@ -35,6 +35,6 @@ export interface QueryRequestSpec {
|
|
|
35
35
|
export declare function queryResultKey(spec: QueryRequestSpec): QueryKey;
|
|
36
36
|
export declare function useQueryResult(spec: QueryRequestSpec, { enabled }?: {
|
|
37
37
|
enabled?: boolean;
|
|
38
|
-
}): UseQueryResult<AxiosResponse<QueryResult, any, {}>, ApiError>;
|
|
38
|
+
}): UseQueryResult<AxiosResponse<QueryResult, any, {}, any>, ApiError>;
|
|
39
39
|
/** What a result surface holds while a query runs: hand it to `ResultPanel`. */
|
|
40
40
|
export type QueryResultState = ReturnType<typeof useQueryResult>;
|