@mongodb-js/compass-web 0.28.2 → 0.29.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.
@@ -1,4 +1,5 @@
1
1
  import { default as React_2 } from 'react';
2
+ import { z } from '@mongodb-js/compass-user-data';
2
3
 
3
4
  /**
4
5
  * Valid statuses for activeOrLaunchedExperimentsToStatus
@@ -88,7 +89,7 @@ declare interface AsyncStatus {
88
89
  message?: string;
89
90
  }
90
91
 
91
- declare const ATLAS_CLOUD_FEATURE_FLAGS: "DATA_EXPLORER_COMPASS_WEB_ENABLE_DATA_MODELING"[];
92
+ declare const ATLAS_CLOUD_FEATURE_FLAGS: NonNullable<"DATA_EXPLORER_COMPASS_WEB_ENABLE_DATA_MODELING" | "DATA_EXPLORER_COMPASS_WEB_ENABLE_RESTORE_WORKSPACES" | null>[];
92
93
 
93
94
  export declare type AtlasCloudFeatureFlags = Record<(typeof ATLAS_CLOUD_FEATURE_FLAGS)[number], boolean>;
94
95
 
@@ -227,14 +228,28 @@ declare type CliOnlyPreferences = {
227
228
  trustedConnectionString?: boolean;
228
229
  };
229
230
 
230
- declare type CollectionSubtab = 'Documents' | 'Aggregations' | 'Schema' | 'Indexes' | 'Validation' | 'GlobalWrites';
231
+ declare type CollectionSubtab = z.output<typeof CollectionSubtabSchema>;
231
232
 
232
- declare type CollectionsWorkspace = {
233
- type: 'Collections';
233
+ declare const CollectionSubtabSchema: z.ZodEnum<["Documents", "Aggregations", "Schema", "Indexes", "Validation", "GlobalWrites"]>;
234
+
235
+ declare type CollectionsWorkspace = z.output<typeof CollectionsWorkspaceSchema>;
236
+
237
+ declare const CollectionsWorkspaceSchema: z.ZodObject<{
238
+ type: z.ZodLiteral<"Collections">;
239
+ connectionId: z.ZodString;
240
+ namespace: z.ZodString;
241
+ inferredFromPrivileges: z.ZodOptional<z.ZodBoolean>;
242
+ }, "strip", z.ZodTypeAny, {
243
+ type: "Collections";
234
244
  connectionId: string;
235
245
  namespace: string;
236
- inferredFromPrivileges?: boolean;
237
- };
246
+ inferredFromPrivileges?: boolean | undefined;
247
+ }, {
248
+ type: "Collections";
249
+ connectionId: string;
250
+ namespace: string;
251
+ inferredFromPrivileges?: boolean | undefined;
252
+ }>;
238
253
 
239
254
  export declare type CollectionTabInfo = {
240
255
  isTimeSeries: boolean;
@@ -243,19 +258,44 @@ export declare type CollectionTabInfo = {
243
258
  inferredFromPrivileges: boolean;
244
259
  };
245
260
 
246
- declare type CollectionWorkspace = {
261
+ declare type CollectionWorkspace = z.output<typeof CollectionWorkspaceSchema> & {
247
262
  tabId: string;
248
- type: 'Collection';
263
+ };
264
+
265
+ declare const CollectionWorkspaceSchema: z.ZodObject<{
266
+ type: z.ZodLiteral<"Collection">;
267
+ subTab: z.ZodEnum<["Documents", "Aggregations", "Schema", "Indexes", "Validation", "GlobalWrites"]>;
268
+ initialQuery: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
269
+ initialPipeline: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
270
+ initialPipelineText: z.ZodOptional<z.ZodString>;
271
+ initialAggregation: z.ZodOptional<z.ZodUnknown>;
272
+ editViewName: z.ZodOptional<z.ZodString>;
273
+ connectionId: z.ZodString;
274
+ namespace: z.ZodString;
275
+ inferredFromPrivileges: z.ZodOptional<z.ZodBoolean>;
276
+ }, "strip", z.ZodTypeAny, {
277
+ type: "Collection";
249
278
  connectionId: string;
250
279
  namespace: string;
251
- subTab: CollectionSubtab;
252
- initialQuery?: unknown;
253
- initialPipeline?: unknown[];
254
- initialPipelineText?: string;
280
+ subTab: "Documents" | "Aggregations" | "Schema" | "Indexes" | "Validation" | "GlobalWrites";
281
+ inferredFromPrivileges?: boolean | undefined;
282
+ initialQuery?: Record<string, any> | undefined;
283
+ initialPipeline?: unknown[] | undefined;
284
+ initialPipelineText?: string | undefined;
255
285
  initialAggregation?: unknown;
256
- editViewName?: string;
257
- inferredFromPrivileges?: boolean;
258
- };
286
+ editViewName?: string | undefined;
287
+ }, {
288
+ type: "Collection";
289
+ connectionId: string;
290
+ namespace: string;
291
+ subTab: "Documents" | "Aggregations" | "Schema" | "Indexes" | "Validation" | "GlobalWrites";
292
+ inferredFromPrivileges?: boolean | undefined;
293
+ initialQuery?: Record<string, any> | undefined;
294
+ initialPipeline?: unknown[] | undefined;
295
+ initialPipelineText?: string | undefined;
296
+ initialAggregation?: unknown;
297
+ editViewName?: string | undefined;
298
+ }>;
259
299
 
260
300
  export declare const CompassExperimentationProvider: React_2.FC<{
261
301
  children: React_2.ReactNode;
@@ -364,14 +404,28 @@ declare interface ConstructorOptions<T extends TypeData> {
364
404
  trackerOptions?: TrackerOptions<T['experimentViewedProps']>;
365
405
  }
366
406
 
367
- declare type DatabasesWorkspace = {
368
- type: 'Databases';
407
+ declare type DatabasesWorkspace = z.output<typeof DatabasesWorkspaceSchema>;
408
+
409
+ declare const DatabasesWorkspaceSchema: z.ZodObject<{
410
+ type: z.ZodLiteral<"Databases">;
411
+ connectionId: z.ZodString;
412
+ }, "strip", z.ZodTypeAny, {
413
+ type: "Databases";
369
414
  connectionId: string;
370
- };
415
+ }, {
416
+ type: "Databases";
417
+ connectionId: string;
418
+ }>;
371
419
 
372
- declare type DataModelingWorkspace = {
373
- type: 'Data Modeling';
374
- };
420
+ declare type DataModelingWorkspace = z.output<typeof DataModelingWorkspaceSchema>;
421
+
422
+ declare const DataModelingWorkspaceSchema: z.ZodObject<{
423
+ type: z.ZodLiteral<"Data Modeling">;
424
+ }, "strip", z.ZodTypeAny, {
425
+ type: "Data Modeling";
426
+ }, {
427
+ type: "Data Modeling";
428
+ }>;
375
429
 
376
430
  /** @public */
377
431
  export declare type DebugFunction = (...args: any[]) => void;
@@ -1104,6 +1158,13 @@ declare const FEATURE_FLAG_DEFINITIONS: readonly [{
1104
1158
  readonly description: {
1105
1159
  readonly short: "Enable the performance insights AI Assistant entrypoints";
1106
1160
  };
1161
+ }, {
1162
+ readonly name: "enableRestoreWorkspaces";
1163
+ readonly stage: "development";
1164
+ readonly atlasCloudFeatureFlagName: "DATA_EXPLORER_COMPASS_WEB_ENABLE_RESTORE_WORKSPACES";
1165
+ readonly description: {
1166
+ readonly short: "Enable restoring previous workspace tabs on startup";
1167
+ };
1107
1168
  }, {
1108
1169
  readonly name: "enableAutomaticRelationshipInference";
1109
1170
  readonly stage: "released";
@@ -1262,9 +1323,15 @@ export declare type LogMessage = {
1262
1323
  attr?: any;
1263
1324
  };
1264
1325
 
1265
- declare type MyQueriesWorkspace = {
1266
- type: 'My Queries';
1267
- };
1326
+ declare type MyQueriesWorkspace = z.output<typeof MyQueriesWorkspaceSchema>;
1327
+
1328
+ declare const MyQueriesWorkspaceSchema: z.ZodObject<{
1329
+ type: z.ZodLiteral<"My Queries">;
1330
+ }, "strip", z.ZodTypeAny, {
1331
+ type: "My Queries";
1332
+ }, {
1333
+ type: "My Queries";
1334
+ }>;
1268
1335
 
1269
1336
  declare type NonUserPreferences = {
1270
1337
  ignoreAdditionalCommandLineFlags?: boolean;
@@ -1455,10 +1522,18 @@ declare interface ServerGhostAssignment<ExperimentName, ExperimentVariantName> e
1455
1522
  linkedHoldoutTestName: string;
1456
1523
  }
1457
1524
 
1458
- declare type ServerStatsWorkspace = {
1459
- type: 'Performance';
1525
+ declare type ServerStatsWorkspace = z.output<typeof ServerStatsWorkspaceSchema>;
1526
+
1527
+ declare const ServerStatsWorkspaceSchema: z.ZodObject<{
1528
+ type: z.ZodLiteral<"Performance">;
1529
+ connectionId: z.ZodString;
1530
+ }, "strip", z.ZodTypeAny, {
1531
+ type: "Performance";
1460
1532
  connectionId: string;
1461
- };
1533
+ }, {
1534
+ type: "Performance";
1535
+ connectionId: string;
1536
+ }>;
1462
1537
 
1463
1538
  /**
1464
1539
  * The different values of severity for logging
@@ -1469,12 +1544,24 @@ declare enum Severity {
1469
1544
  ERROR = "error"
1470
1545
  }
1471
1546
 
1472
- declare type ShellWorkspace = {
1473
- type: 'Shell';
1547
+ declare type ShellWorkspace = z.output<typeof ShellWorkspaceSchema>;
1548
+
1549
+ declare const ShellWorkspaceSchema: z.ZodObject<{
1550
+ type: z.ZodLiteral<"Shell">;
1551
+ connectionId: z.ZodString;
1552
+ initialEvaluate: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1553
+ initialInput: z.ZodOptional<z.ZodString>;
1554
+ }, "strip", z.ZodTypeAny, {
1555
+ type: "Shell";
1474
1556
  connectionId: string;
1475
- initialEvaluate?: string | string[];
1476
- initialInput?: string;
1477
- };
1557
+ initialEvaluate?: string | string[] | undefined;
1558
+ initialInput?: string | undefined;
1559
+ }, {
1560
+ type: "Shell";
1561
+ connectionId: string;
1562
+ initialEvaluate?: string | string[] | undefined;
1563
+ initialInput?: string | undefined;
1564
+ }>;
1478
1565
 
1479
1566
  declare const SORT_ORDER_VALUES: readonly ["", "{ _id: 1 }", "{ _id: -1 }", "{ $natural: -1 }"];
1480
1567
 
@@ -1781,20 +1868,127 @@ declare interface Tracker<ExperimentViewedProps> {
1781
1868
  team?: LoggerTeam;
1782
1869
  }
1783
1870
 
1784
- declare type WelcomeWorkspace = {
1785
- type: 'Welcome';
1786
- };
1871
+ declare type WelcomeWorkspace = z.output<typeof WelcomeWorkspaceSchema>;
1872
+
1873
+ declare const WelcomeWorkspaceSchema: z.ZodObject<{
1874
+ type: z.ZodLiteral<"Welcome">;
1875
+ }, "strip", z.ZodTypeAny, {
1876
+ type: "Welcome";
1877
+ }, {
1878
+ type: "Welcome";
1879
+ }>;
1787
1880
 
1788
1881
  declare type Workspace<T extends AnyWorkspace['type']> = Extract<AnyWorkspace, {
1789
1882
  type: T;
1790
1883
  }>;
1791
1884
 
1792
- export declare type WorkspaceTab = {
1885
+ export declare type WorkspaceTab = z.output<typeof WorkspaceTabSchema>;
1886
+
1887
+ declare const WorkspaceTabSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1888
+ type: z.ZodLiteral<"Welcome">;
1889
+ }, "strip", z.ZodTypeAny, {
1890
+ type: "Welcome";
1891
+ }, {
1892
+ type: "Welcome";
1893
+ }>, z.ZodObject<{
1894
+ type: z.ZodLiteral<"My Queries">;
1895
+ }, "strip", z.ZodTypeAny, {
1896
+ type: "My Queries";
1897
+ }, {
1898
+ type: "My Queries";
1899
+ }>, z.ZodObject<{
1900
+ type: z.ZodLiteral<"Data Modeling">;
1901
+ }, "strip", z.ZodTypeAny, {
1902
+ type: "Data Modeling";
1903
+ }, {
1904
+ type: "Data Modeling";
1905
+ }>, z.ZodObject<{
1906
+ type: z.ZodLiteral<"Databases">;
1907
+ connectionId: z.ZodString;
1908
+ }, "strip", z.ZodTypeAny, {
1909
+ type: "Databases";
1910
+ connectionId: string;
1911
+ }, {
1912
+ type: "Databases";
1913
+ connectionId: string;
1914
+ }>, z.ZodObject<{
1915
+ type: z.ZodLiteral<"Performance">;
1916
+ connectionId: z.ZodString;
1917
+ }, "strip", z.ZodTypeAny, {
1918
+ type: "Performance";
1919
+ connectionId: string;
1920
+ }, {
1921
+ type: "Performance";
1922
+ connectionId: string;
1923
+ }>, z.ZodObject<{
1924
+ type: z.ZodLiteral<"Shell">;
1925
+ connectionId: z.ZodString;
1926
+ initialEvaluate: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1927
+ initialInput: z.ZodOptional<z.ZodString>;
1928
+ }, "strip", z.ZodTypeAny, {
1929
+ type: "Shell";
1930
+ connectionId: string;
1931
+ initialEvaluate?: string | string[] | undefined;
1932
+ initialInput?: string | undefined;
1933
+ }, {
1934
+ type: "Shell";
1935
+ connectionId: string;
1936
+ initialEvaluate?: string | string[] | undefined;
1937
+ initialInput?: string | undefined;
1938
+ }>, z.ZodObject<{
1939
+ type: z.ZodLiteral<"Collections">;
1940
+ connectionId: z.ZodString;
1941
+ namespace: z.ZodString;
1942
+ inferredFromPrivileges: z.ZodOptional<z.ZodBoolean>;
1943
+ }, "strip", z.ZodTypeAny, {
1944
+ type: "Collections";
1945
+ connectionId: string;
1946
+ namespace: string;
1947
+ inferredFromPrivileges?: boolean | undefined;
1948
+ }, {
1949
+ type: "Collections";
1950
+ connectionId: string;
1951
+ namespace: string;
1952
+ inferredFromPrivileges?: boolean | undefined;
1953
+ }>, z.ZodObject<{
1954
+ type: z.ZodLiteral<"Collection">;
1955
+ subTab: z.ZodEnum<["Documents", "Aggregations", "Schema", "Indexes", "Validation", "GlobalWrites"]>;
1956
+ initialQuery: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1957
+ initialPipeline: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
1958
+ initialPipelineText: z.ZodOptional<z.ZodString>;
1959
+ initialAggregation: z.ZodOptional<z.ZodUnknown>;
1960
+ editViewName: z.ZodOptional<z.ZodString>;
1961
+ connectionId: z.ZodString;
1962
+ namespace: z.ZodString;
1963
+ inferredFromPrivileges: z.ZodOptional<z.ZodBoolean>;
1964
+ }, "strip", z.ZodTypeAny, {
1965
+ type: "Collection";
1966
+ connectionId: string;
1967
+ namespace: string;
1968
+ subTab: "Documents" | "Aggregations" | "Schema" | "Indexes" | "Validation" | "GlobalWrites";
1969
+ inferredFromPrivileges?: boolean | undefined;
1970
+ initialQuery?: Record<string, any> | undefined;
1971
+ initialPipeline?: unknown[] | undefined;
1972
+ initialPipelineText?: string | undefined;
1973
+ initialAggregation?: unknown;
1974
+ editViewName?: string | undefined;
1975
+ }, {
1976
+ type: "Collection";
1977
+ connectionId: string;
1978
+ namespace: string;
1979
+ subTab: "Documents" | "Aggregations" | "Schema" | "Indexes" | "Validation" | "GlobalWrites";
1980
+ inferredFromPrivileges?: boolean | undefined;
1981
+ initialQuery?: Record<string, any> | undefined;
1982
+ initialPipeline?: unknown[] | undefined;
1983
+ initialPipelineText?: string | undefined;
1984
+ initialAggregation?: unknown;
1985
+ editViewName?: string | undefined;
1986
+ }>]>, z.ZodObject<{
1987
+ id: z.ZodString;
1988
+ }, "strip", z.ZodTypeAny, {
1793
1989
  id: string;
1794
- } & WorkspaceTabProps;
1795
-
1796
- declare type WorkspaceTabProps = WelcomeWorkspace | MyQueriesWorkspace | DataModelingWorkspace | ShellWorkspace | ServerStatsWorkspace | DatabasesWorkspace | CollectionsWorkspace | (Omit<CollectionWorkspace, 'tabId'> & {
1797
- subTab: CollectionSubtab;
1798
- });
1990
+ }, {
1991
+ id: string;
1992
+ }>>;
1799
1993
 
1800
1994
  export { }