@malloy-publisher/sdk 0.0.87 → 0.0.89

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.
@@ -1,19 +1,6 @@
1
1
  import { Configuration } from './configuration';
2
2
  import { AxiosPromise, AxiosInstance, RawAxiosRequestConfig, AxiosResponse } from 'axios';
3
3
  import { RequestArgs, BaseAPI } from './base';
4
- /**
5
- *
6
- * @export
7
- * @interface About
8
- */
9
- export interface About {
10
- /**
11
- * Readme markdown.
12
- * @type {string}
13
- * @memberof About
14
- */
15
- 'readme'?: string;
16
- }
17
4
  /**
18
5
  *
19
6
  * @export
@@ -262,6 +249,30 @@ export interface ConnectionAttributes {
262
249
  */
263
250
  'canStream'?: boolean;
264
251
  }
252
+ /**
253
+ *
254
+ * @export
255
+ * @interface ConnectionStatus
256
+ */
257
+ export interface ConnectionStatus {
258
+ /**
259
+ *
260
+ * @type {string}
261
+ * @memberof ConnectionStatus
262
+ */
263
+ 'status'?: ConnectionStatusStatusEnum;
264
+ /**
265
+ *
266
+ * @type {string}
267
+ * @memberof ConnectionStatus
268
+ */
269
+ 'errorMessage'?: string;
270
+ }
271
+ export declare const ConnectionStatusStatusEnum: {
272
+ readonly Ok: "ok";
273
+ readonly Failed: "failed";
274
+ };
275
+ export type ConnectionStatusStatusEnum = typeof ConnectionStatusStatusEnum[keyof typeof ConnectionStatusStatusEnum];
265
276
  /**
266
277
  * An in-memory DuckDB database embedded in the package.
267
278
  * @export
@@ -476,6 +487,12 @@ export interface Package {
476
487
  * @memberof Package
477
488
  */
478
489
  'description'?: string;
490
+ /**
491
+ * Package location, it can be an absolute path or an URI (e.g. github, s3, gcs, etc.).
492
+ * @type {string}
493
+ * @memberof Package
494
+ */
495
+ 'location'?: string;
479
496
  }
480
497
  /**
481
498
  *
@@ -544,6 +561,24 @@ export interface Project {
544
561
  * @memberof Project
545
562
  */
546
563
  'readme'?: string;
564
+ /**
565
+ * Project location, it can be an absolute path or an URI (e.g. github, s3, gcs, etc.).
566
+ * @type {string}
567
+ * @memberof Project
568
+ */
569
+ 'location'?: string;
570
+ /**
571
+ *
572
+ * @type {Array<Connection>}
573
+ * @memberof Project
574
+ */
575
+ 'connections'?: Array<Connection>;
576
+ /**
577
+ *
578
+ * @type {Array<Package>}
579
+ * @memberof Project
580
+ */
581
+ 'packages'?: Array<Package>;
547
582
  }
548
583
  /**
549
584
  * Named model query.
@@ -676,6 +711,25 @@ export interface SchemaName {
676
711
  */
677
712
  'isHidden'?: boolean;
678
713
  }
714
+ /**
715
+ *
716
+ * @export
717
+ * @interface ServerStatus
718
+ */
719
+ export interface ServerStatus {
720
+ /**
721
+ *
722
+ * @type {number}
723
+ * @memberof ServerStatus
724
+ */
725
+ 'timestamp'?: number;
726
+ /**
727
+ *
728
+ * @type {Array<Project>}
729
+ * @memberof ServerStatus
730
+ */
731
+ 'projects'?: Array<Project>;
732
+ }
679
733
  /**
680
734
  *
681
735
  * @export
@@ -744,6 +798,19 @@ export interface SqlSource {
744
798
  */
745
799
  'source'?: string;
746
800
  }
801
+ /**
802
+ * Request to start watching a project
803
+ * @export
804
+ * @interface StartWatchRequest
805
+ */
806
+ export interface StartWatchRequest {
807
+ /**
808
+ * Name of the project to watch
809
+ * @type {string}
810
+ * @memberof StartWatchRequest
811
+ */
812
+ 'projectName': string;
813
+ }
747
814
  /**
748
815
  *
749
816
  * @export
@@ -875,6 +942,31 @@ export interface View {
875
942
  */
876
943
  'annotations'?: Array<string>;
877
944
  }
945
+ /**
946
+ * Current watch mode status
947
+ * @export
948
+ * @interface WatchStatus
949
+ */
950
+ export interface WatchStatus {
951
+ /**
952
+ * Whether watch mode is currently enabled
953
+ * @type {boolean}
954
+ * @memberof WatchStatus
955
+ */
956
+ 'enabled'?: boolean;
957
+ /**
958
+ * Name of the project being watched
959
+ * @type {string}
960
+ * @memberof WatchStatus
961
+ */
962
+ 'projectName'?: string;
963
+ /**
964
+ * The path being watched, null if not watching
965
+ * @type {string}
966
+ * @memberof WatchStatus
967
+ */
968
+ 'watchingPath'?: string;
969
+ }
878
970
  /**
879
971
  * ConnectionsApi - axios parameter creator
880
972
  * @export
@@ -1032,7 +1124,7 @@ export declare const ConnectionsApiFp: (configuration?: Configuration) => {
1032
1124
  * @param {*} [options] Override http request option.
1033
1125
  * @throws {RequiredError}
1034
1126
  */
1035
- getTest(projectName: string, connectionName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
1127
+ getTest(projectName: string, connectionName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ConnectionStatus>>;
1036
1128
  /**
1037
1129
  *
1038
1130
  * @summary Returns a list of the connections in the project.
@@ -1125,7 +1217,7 @@ export declare const ConnectionsApiFactory: (configuration?: Configuration, base
1125
1217
  * @param {*} [options] Override http request option.
1126
1218
  * @throws {RequiredError}
1127
1219
  */
1128
- getTest(projectName: string, connectionName: string, options?: RawAxiosRequestConfig): AxiosPromise<void>;
1220
+ getTest(projectName: string, connectionName: string, options?: RawAxiosRequestConfig): AxiosPromise<ConnectionStatus>;
1129
1221
  /**
1130
1222
  *
1131
1223
  * @summary Returns a list of the connections in the project.
@@ -1226,7 +1318,7 @@ export declare class ConnectionsApi extends BaseAPI {
1226
1318
  * @throws {RequiredError}
1227
1319
  * @memberof ConnectionsApi
1228
1320
  */
1229
- getTest(projectName: string, connectionName: string, options?: RawAxiosRequestConfig): Promise< AxiosResponse<void, any>>;
1321
+ getTest(projectName: string, connectionName: string, options?: RawAxiosRequestConfig): Promise< AxiosResponse<ConnectionStatus, any>>;
1230
1322
  /**
1231
1323
  *
1232
1324
  * @summary Returns a list of the connections in the project.
@@ -1963,6 +2055,61 @@ export declare class ProjectsApi extends BaseAPI {
1963
2055
  */
1964
2056
  updateProject(projectName: string, body: object, options?: RawAxiosRequestConfig): Promise< AxiosResponse<Project, any>>;
1965
2057
  }
2058
+ /**
2059
+ * PublisherApi - axios parameter creator
2060
+ * @export
2061
+ */
2062
+ export declare const PublisherApiAxiosParamCreator: (configuration?: Configuration) => {
2063
+ /**
2064
+ *
2065
+ * @summary Server status
2066
+ * @param {*} [options] Override http request option.
2067
+ * @throws {RequiredError}
2068
+ */
2069
+ getStatus: (options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
2070
+ };
2071
+ /**
2072
+ * PublisherApi - functional programming interface
2073
+ * @export
2074
+ */
2075
+ export declare const PublisherApiFp: (configuration?: Configuration) => {
2076
+ /**
2077
+ *
2078
+ * @summary Server status
2079
+ * @param {*} [options] Override http request option.
2080
+ * @throws {RequiredError}
2081
+ */
2082
+ getStatus(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ServerStatus>>;
2083
+ };
2084
+ /**
2085
+ * PublisherApi - factory interface
2086
+ * @export
2087
+ */
2088
+ export declare const PublisherApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
2089
+ /**
2090
+ *
2091
+ * @summary Server status
2092
+ * @param {*} [options] Override http request option.
2093
+ * @throws {RequiredError}
2094
+ */
2095
+ getStatus(options?: RawAxiosRequestConfig): AxiosPromise<ServerStatus>;
2096
+ };
2097
+ /**
2098
+ * PublisherApi - object-oriented interface
2099
+ * @export
2100
+ * @class PublisherApi
2101
+ * @extends {BaseAPI}
2102
+ */
2103
+ export declare class PublisherApi extends BaseAPI {
2104
+ /**
2105
+ *
2106
+ * @summary Server status
2107
+ * @param {*} [options] Override http request option.
2108
+ * @throws {RequiredError}
2109
+ * @memberof PublisherApi
2110
+ */
2111
+ getStatus(options?: RawAxiosRequestConfig): Promise< AxiosResponse<ServerStatus, any>>;
2112
+ }
1966
2113
  /**
1967
2114
  * QueryresultsApi - axios parameter creator
1968
2115
  * @export
@@ -2113,3 +2260,120 @@ export declare class SchedulesApi extends BaseAPI {
2113
2260
  */
2114
2261
  listSchedules(projectName: string, packageName: string, versionId?: string, options?: RawAxiosRequestConfig): Promise< AxiosResponse<Schedule[], any>>;
2115
2262
  }
2263
+ /**
2264
+ * WatchModeApi - axios parameter creator
2265
+ * @export
2266
+ */
2267
+ export declare const WatchModeApiAxiosParamCreator: (configuration?: Configuration) => {
2268
+ /**
2269
+ *
2270
+ * @summary Returns the current watch mode status.
2271
+ * @param {*} [options] Override http request option.
2272
+ * @throws {RequiredError}
2273
+ */
2274
+ getWatchStatus: (options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
2275
+ /**
2276
+ *
2277
+ * @summary Starts watching a project for file changes.
2278
+ * @param {StartWatchRequest} startWatchRequest
2279
+ * @param {*} [options] Override http request option.
2280
+ * @throws {RequiredError}
2281
+ */
2282
+ startWatching: (startWatchRequest: StartWatchRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
2283
+ /**
2284
+ *
2285
+ * @summary Stops watching for file changes.
2286
+ * @param {*} [options] Override http request option.
2287
+ * @throws {RequiredError}
2288
+ */
2289
+ stopWatching: (options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
2290
+ };
2291
+ /**
2292
+ * WatchModeApi - functional programming interface
2293
+ * @export
2294
+ */
2295
+ export declare const WatchModeApiFp: (configuration?: Configuration) => {
2296
+ /**
2297
+ *
2298
+ * @summary Returns the current watch mode status.
2299
+ * @param {*} [options] Override http request option.
2300
+ * @throws {RequiredError}
2301
+ */
2302
+ getWatchStatus(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<WatchStatus>>;
2303
+ /**
2304
+ *
2305
+ * @summary Starts watching a project for file changes.
2306
+ * @param {StartWatchRequest} startWatchRequest
2307
+ * @param {*} [options] Override http request option.
2308
+ * @throws {RequiredError}
2309
+ */
2310
+ startWatching(startWatchRequest: StartWatchRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
2311
+ /**
2312
+ *
2313
+ * @summary Stops watching for file changes.
2314
+ * @param {*} [options] Override http request option.
2315
+ * @throws {RequiredError}
2316
+ */
2317
+ stopWatching(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
2318
+ };
2319
+ /**
2320
+ * WatchModeApi - factory interface
2321
+ * @export
2322
+ */
2323
+ export declare const WatchModeApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
2324
+ /**
2325
+ *
2326
+ * @summary Returns the current watch mode status.
2327
+ * @param {*} [options] Override http request option.
2328
+ * @throws {RequiredError}
2329
+ */
2330
+ getWatchStatus(options?: RawAxiosRequestConfig): AxiosPromise<WatchStatus>;
2331
+ /**
2332
+ *
2333
+ * @summary Starts watching a project for file changes.
2334
+ * @param {StartWatchRequest} startWatchRequest
2335
+ * @param {*} [options] Override http request option.
2336
+ * @throws {RequiredError}
2337
+ */
2338
+ startWatching(startWatchRequest: StartWatchRequest, options?: RawAxiosRequestConfig): AxiosPromise<void>;
2339
+ /**
2340
+ *
2341
+ * @summary Stops watching for file changes.
2342
+ * @param {*} [options] Override http request option.
2343
+ * @throws {RequiredError}
2344
+ */
2345
+ stopWatching(options?: RawAxiosRequestConfig): AxiosPromise<void>;
2346
+ };
2347
+ /**
2348
+ * WatchModeApi - object-oriented interface
2349
+ * @export
2350
+ * @class WatchModeApi
2351
+ * @extends {BaseAPI}
2352
+ */
2353
+ export declare class WatchModeApi extends BaseAPI {
2354
+ /**
2355
+ *
2356
+ * @summary Returns the current watch mode status.
2357
+ * @param {*} [options] Override http request option.
2358
+ * @throws {RequiredError}
2359
+ * @memberof WatchModeApi
2360
+ */
2361
+ getWatchStatus(options?: RawAxiosRequestConfig): Promise< AxiosResponse<WatchStatus, any>>;
2362
+ /**
2363
+ *
2364
+ * @summary Starts watching a project for file changes.
2365
+ * @param {StartWatchRequest} startWatchRequest
2366
+ * @param {*} [options] Override http request option.
2367
+ * @throws {RequiredError}
2368
+ * @memberof WatchModeApi
2369
+ */
2370
+ startWatching(startWatchRequest: StartWatchRequest, options?: RawAxiosRequestConfig): Promise< AxiosResponse<void, any>>;
2371
+ /**
2372
+ *
2373
+ * @summary Stops watching for file changes.
2374
+ * @param {*} [options] Override http request option.
2375
+ * @throws {RequiredError}
2376
+ * @memberof WatchModeApi
2377
+ */
2378
+ stopWatching(options?: RawAxiosRequestConfig): Promise< AxiosResponse<void, any>>;
2379
+ }
@@ -1 +1,6 @@
1
- export declare function AnalyzePackageButton(): import("react/jsx-runtime").JSX.Element;
1
+ import { default as React } from 'react';
2
+ import { WorkbookLocator } from './Workbook/WorkbookStorage';
3
+ export interface AnalyzePackageButtonProps {
4
+ onWorkbookSelect: (workbook: WorkbookLocator, event: React.MouseEvent) => void;
5
+ }
6
+ export declare function AnalyzePackageButton({ onWorkbookSelect, }: AnalyzePackageButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,9 @@
1
- import { PackageContextProps } from '../Package';
2
1
  import { WorkbookLocator, WorkbookStorage, Workspace } from './WorkbookStorage';
3
2
  export declare class BrowserWorkbookStorage implements WorkbookStorage {
4
- private makeKey;
5
- listWorkspaces(context: PackageContextProps, writeableOnly: boolean): Promise<Workspace[]>;
6
- listWorkbooks(workspace: Workspace, context: PackageContextProps): Promise<WorkbookLocator[]>;
7
- getWorkbook(context: PackageContextProps, path: WorkbookLocator): Promise<string>;
8
- deleteWorkbook(context: PackageContextProps, path: WorkbookLocator): Promise<void>;
9
- saveWorkbook(context: PackageContextProps, path: WorkbookLocator, notebook: string): Promise<void>;
10
- moveWorkbook(context: PackageContextProps, from: WorkbookLocator, to: WorkbookLocator): Promise<void>;
3
+ listWorkspaces(writeableOnly: boolean): Promise<Workspace[]>;
4
+ listWorkbooks(_workspace: Workspace): Promise<WorkbookLocator[]>;
5
+ getWorkbook(path: WorkbookLocator): Promise<string>;
6
+ deleteWorkbook(path: WorkbookLocator): Promise<void>;
7
+ saveWorkbook(path: WorkbookLocator, notebook: string): Promise<void>;
8
+ moveWorkbook(from: WorkbookLocator, to: WorkbookLocator): Promise<void>;
11
9
  }
@@ -4,6 +4,8 @@ interface WorkbookProps {
4
4
  expandCodeCells?: boolean;
5
5
  expandEmbeddings?: boolean;
6
6
  hideEmbeddingIcons?: boolean;
7
+ defaultProjectName?: string;
8
+ defaultPackageName?: string;
7
9
  }
8
- export default function Workbook({ workbookPath, expandCodeCells, expandEmbeddings, hideEmbeddingIcons, }: WorkbookProps): import("react/jsx-runtime").JSX.Element;
10
+ export default function Workbook({ workbookPath, expandCodeCells, expandEmbeddings, hideEmbeddingIcons, defaultProjectName, defaultPackageName, }: WorkbookProps): import("react/jsx-runtime").JSX.Element;
9
11
  export {};
@@ -1,4 +1,3 @@
1
- import { PackageContextProps } from '../Package';
2
1
  import { WorkbookLocator, WorkbookStorage } from './WorkbookStorage';
3
2
  /**
4
3
  * Interface representing the data structure of a Mutable Workbook
@@ -38,14 +37,12 @@ export declare class WorkbookManager {
38
37
  private workbookData;
39
38
  private isSaved;
40
39
  private workbookStorage;
41
- private packageContext;
42
40
  /**
43
41
  * Creates a new WorkbookManager instance
44
42
  * @param {WorkbookStorage} workbookStorage - Storage implementation
45
- * @param {PackageContextProps} packageContext - Package context for storage
46
43
  * @param {WorkbookData} workbookData - Initial workbook data
47
44
  */
48
- constructor(workbookStorage: WorkbookStorage, packageContext: PackageContextProps, workbookData: WorkbookData);
45
+ constructor(workbookStorage: WorkbookStorage, workbookData: WorkbookData);
49
46
  /**
50
47
  * Gets the current workbook data
51
48
  * @returns {WorkbookData} The current workbook data
@@ -75,7 +72,7 @@ export declare class WorkbookManager {
75
72
  * @returns {string} The Malloy workbook string
76
73
  */
77
74
  toMalloyWorkbook(): string;
78
- static newWorkbook(workbookStorage: WorkbookStorage, packageContext: PackageContextProps): WorkbookManager;
75
+ static newWorkbook(workbookStorage: WorkbookStorage): WorkbookManager;
79
76
  /**
80
77
  * Creates a new workbook manager by loading from local storage.
81
78
  * Returns an empty instance if the workbook is not found.
@@ -83,5 +80,5 @@ export declare class WorkbookManager {
83
80
  * @param userContext - The user context for storage
84
81
  * @param workbookPath - The path to the workbook file (relative to project/package)
85
82
  */
86
- static loadWorkbook(workbookStorage: WorkbookStorage, packageContext: PackageContextProps, workbookPath: WorkbookLocator): Promise<WorkbookManager>;
83
+ static loadWorkbook(workbookStorage: WorkbookStorage, workbookPath: WorkbookLocator): Promise<WorkbookManager>;
87
84
  }
@@ -1,4 +1,3 @@
1
- import { PackageContextProps } from '../Package';
2
1
  export interface Workspace {
3
2
  name: string;
4
3
  writeable: boolean;
@@ -9,10 +8,10 @@ export interface WorkbookLocator {
9
8
  workspace: string;
10
9
  }
11
10
  export interface WorkbookStorage {
12
- listWorkspaces(context: PackageContextProps, writeableOnly: boolean): Promise<Workspace[]>;
13
- listWorkbooks(workspace: Workspace, context: PackageContextProps): Promise<WorkbookLocator[]>;
14
- getWorkbook(context: PackageContextProps, path: WorkbookLocator): Promise<string>;
15
- deleteWorkbook(context: PackageContextProps, path: WorkbookLocator): Promise<void>;
16
- saveWorkbook(context: PackageContextProps, path: WorkbookLocator, workbook: string): Promise<void>;
17
- moveWorkbook(context: PackageContextProps, from: WorkbookLocator, to: WorkbookLocator): Promise<void>;
11
+ listWorkspaces(writeableOnly: boolean): Promise<Workspace[]>;
12
+ listWorkbooks(workspace: Workspace): Promise<WorkbookLocator[]>;
13
+ getWorkbook(path: WorkbookLocator): Promise<string>;
14
+ deleteWorkbook(path: WorkbookLocator): Promise<void>;
15
+ saveWorkbook(path: WorkbookLocator, workbook: string): Promise<void>;
16
+ moveWorkbook(from: WorkbookLocator, to: WorkbookLocator): Promise<void>;
18
17
  }