@mongodb-js/compass-web 0.28.1 → 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
 
@@ -174,6 +175,11 @@ export declare interface AtlasClusterMetadata {
174
175
  */
175
176
  rollingIndexes: boolean;
176
177
  };
178
+ /**
179
+ * User-friendly connection string for the Atlas cluster, which uses the SRV address if available.
180
+ * Otherwise, will default to <your-cluster> as a placeholder.
181
+ */
182
+ userConnectionString: string;
177
183
  }
178
184
 
179
185
  declare type AtlasOrgPreferences = {
@@ -222,14 +228,28 @@ declare type CliOnlyPreferences = {
222
228
  trustedConnectionString?: boolean;
223
229
  };
224
230
 
225
- declare type CollectionSubtab = 'Documents' | 'Aggregations' | 'Schema' | 'Indexes' | 'Validation' | 'GlobalWrites';
231
+ declare type CollectionSubtab = z.output<typeof CollectionSubtabSchema>;
232
+
233
+ declare const CollectionSubtabSchema: z.ZodEnum<["Documents", "Aggregations", "Schema", "Indexes", "Validation", "GlobalWrites"]>;
234
+
235
+ declare type CollectionsWorkspace = z.output<typeof CollectionsWorkspaceSchema>;
226
236
 
227
- declare type CollectionsWorkspace = {
228
- type: 'Collections';
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";
229
244
  connectionId: string;
230
245
  namespace: string;
231
- inferredFromPrivileges?: boolean;
232
- };
246
+ inferredFromPrivileges?: boolean | undefined;
247
+ }, {
248
+ type: "Collections";
249
+ connectionId: string;
250
+ namespace: string;
251
+ inferredFromPrivileges?: boolean | undefined;
252
+ }>;
233
253
 
234
254
  export declare type CollectionTabInfo = {
235
255
  isTimeSeries: boolean;
@@ -238,19 +258,44 @@ export declare type CollectionTabInfo = {
238
258
  inferredFromPrivileges: boolean;
239
259
  };
240
260
 
241
- declare type CollectionWorkspace = {
261
+ declare type CollectionWorkspace = z.output<typeof CollectionWorkspaceSchema> & {
242
262
  tabId: string;
243
- 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";
244
278
  connectionId: string;
245
279
  namespace: string;
246
- subTab: CollectionSubtab;
247
- initialQuery?: unknown;
248
- initialPipeline?: unknown[];
249
- 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;
250
285
  initialAggregation?: unknown;
251
- editViewName?: string;
252
- inferredFromPrivileges?: boolean;
253
- };
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
+ }>;
254
299
 
255
300
  export declare const CompassExperimentationProvider: React_2.FC<{
256
301
  children: React_2.ReactNode;
@@ -359,14 +404,28 @@ declare interface ConstructorOptions<T extends TypeData> {
359
404
  trackerOptions?: TrackerOptions<T['experimentViewedProps']>;
360
405
  }
361
406
 
362
- declare type DatabasesWorkspace = {
363
- 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";
364
414
  connectionId: string;
365
- };
415
+ }, {
416
+ type: "Databases";
417
+ connectionId: string;
418
+ }>;
366
419
 
367
- declare type DataModelingWorkspace = {
368
- type: 'Data Modeling';
369
- };
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
+ }>;
370
429
 
371
430
  /** @public */
372
431
  export declare type DebugFunction = (...args: any[]) => void;
@@ -1045,7 +1104,7 @@ declare const FEATURE_FLAG_DEFINITIONS: readonly [{
1045
1104
  };
1046
1105
  }, {
1047
1106
  readonly name: "enableDataModeling";
1048
- readonly stage: "development";
1107
+ readonly stage: "released";
1049
1108
  readonly atlasCloudFeatureFlagName: "DATA_EXPLORER_COMPASS_WEB_ENABLE_DATA_MODELING";
1050
1109
  readonly description: {
1051
1110
  readonly short: "Design, Visualize, and Evolve your Data Model";
@@ -1099,6 +1158,13 @@ declare const FEATURE_FLAG_DEFINITIONS: readonly [{
1099
1158
  readonly description: {
1100
1159
  readonly short: "Enable the performance insights AI Assistant entrypoints";
1101
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
+ };
1102
1168
  }, {
1103
1169
  readonly name: "enableAutomaticRelationshipInference";
1104
1170
  readonly stage: "released";
@@ -1257,9 +1323,15 @@ export declare type LogMessage = {
1257
1323
  attr?: any;
1258
1324
  };
1259
1325
 
1260
- declare type MyQueriesWorkspace = {
1261
- type: 'My Queries';
1262
- };
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
+ }>;
1263
1335
 
1264
1336
  declare type NonUserPreferences = {
1265
1337
  ignoreAdditionalCommandLineFlags?: boolean;
@@ -1450,10 +1522,18 @@ declare interface ServerGhostAssignment<ExperimentName, ExperimentVariantName> e
1450
1522
  linkedHoldoutTestName: string;
1451
1523
  }
1452
1524
 
1453
- declare type ServerStatsWorkspace = {
1454
- 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";
1455
1532
  connectionId: string;
1456
- };
1533
+ }, {
1534
+ type: "Performance";
1535
+ connectionId: string;
1536
+ }>;
1457
1537
 
1458
1538
  /**
1459
1539
  * The different values of severity for logging
@@ -1464,12 +1544,24 @@ declare enum Severity {
1464
1544
  ERROR = "error"
1465
1545
  }
1466
1546
 
1467
- declare type ShellWorkspace = {
1468
- 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";
1469
1556
  connectionId: string;
1470
- initialEvaluate?: string | string[];
1471
- initialInput?: string;
1472
- };
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
+ }>;
1473
1565
 
1474
1566
  declare const SORT_ORDER_VALUES: readonly ["", "{ _id: 1 }", "{ _id: -1 }", "{ $natural: -1 }"];
1475
1567
 
@@ -1742,7 +1834,7 @@ declare interface Tracker<ExperimentViewedProps> {
1742
1834
  maxTimeMS?: number;
1743
1835
  installURLHandlers: boolean;
1744
1836
  protectConnectionStringsForNewConnections: boolean;
1745
- atlasServiceBackendPreset: 'atlas-local' | 'atlas-dev' | 'atlas-qa' | 'atlas' | 'web-sandbox-atlas-local' | 'web-sandbox-atlas-dev' | 'web-sandbox-atlas-qa' | 'web-sandbox-atlas';
1837
+ atlasServiceBackendPreset: 'atlas-local' | 'atlas-dev' | 'atlas-qa' | 'atlas-staging' | 'atlas' | 'web-sandbox-atlas-local' | 'web-sandbox-atlas-dev' | 'web-sandbox-atlas-qa' | 'web-sandbox-atlas';
1746
1838
  optInGenAIFeatures: boolean;
1747
1839
  enableExplainPlan: boolean;
1748
1840
  enableAtlasSearchIndexes: boolean;
@@ -1776,20 +1868,127 @@ declare interface Tracker<ExperimentViewedProps> {
1776
1868
  team?: LoggerTeam;
1777
1869
  }
1778
1870
 
1779
- declare type WelcomeWorkspace = {
1780
- type: 'Welcome';
1781
- };
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
+ }>;
1782
1880
 
1783
1881
  declare type Workspace<T extends AnyWorkspace['type']> = Extract<AnyWorkspace, {
1784
1882
  type: T;
1785
1883
  }>;
1786
1884
 
1787
- 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, {
1788
1989
  id: string;
1789
- } & WorkspaceTabProps;
1790
-
1791
- declare type WorkspaceTabProps = WelcomeWorkspace | MyQueriesWorkspace | DataModelingWorkspace | ShellWorkspace | ServerStatsWorkspace | DatabasesWorkspace | CollectionsWorkspace | (Omit<CollectionWorkspace, 'tabId'> & {
1792
- subTab: CollectionSubtab;
1793
- });
1990
+ }, {
1991
+ id: string;
1992
+ }>>;
1794
1993
 
1795
1994
  export { }