@sfxcode/nuxt-ui-mongocamp 1.4.0 → 1.5.1
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 +1 -1
- package/dist/module.json +2 -2
- package/dist/runtime/components/MongocampAggregationBuilder.d.vue.ts +1 -0
- package/dist/runtime/components/MongocampAggregationBuilder.vue +29 -2
- package/dist/runtime/components/MongocampAggregationBuilder.vue.d.ts +1 -0
- package/dist/runtime/components/MongocampAggregationStagePreview.d.vue.ts +1 -0
- package/dist/runtime/components/MongocampAggregationStagePreview.vue +4 -3
- package/dist/runtime/components/MongocampAggregationStagePreview.vue.d.ts +1 -0
- package/dist/runtime/components/MongocampBucketFiles.vue +61 -0
- package/dist/runtime/components/MongocampBulkDelete.d.vue.ts +2 -12
- package/dist/runtime/components/MongocampBulkDelete.vue +14 -40
- package/dist/runtime/components/MongocampBulkDelete.vue.d.ts +2 -12
- package/dist/runtime/components/MongocampBulkEdit.d.vue.ts +5 -6
- package/dist/runtime/components/MongocampBulkEdit.vue +43 -26
- package/dist/runtime/components/MongocampBulkEdit.vue.d.ts +5 -6
- package/dist/runtime/components/MongocampChart.vue +1 -4
- package/dist/runtime/components/MongocampCollectionCharts.d.vue.ts +2 -0
- package/dist/runtime/components/MongocampCollectionCharts.vue +9 -8
- package/dist/runtime/components/MongocampCollectionCharts.vue.d.ts +2 -0
- package/dist/runtime/components/MongocampCollectionCopy.vue +19 -258
- package/dist/runtime/components/MongocampCollectionData.d.vue.ts +2 -0
- package/dist/runtime/components/MongocampCollectionData.vue +206 -126
- package/dist/runtime/components/MongocampCollectionData.vue.d.ts +2 -0
- package/dist/runtime/components/MongocampCollectionRename.d.vue.ts +22 -0
- package/dist/runtime/components/MongocampCollectionRename.vue +116 -0
- package/dist/runtime/components/MongocampCollectionRename.vue.d.ts +22 -0
- package/dist/runtime/components/MongocampCollections.vue +31 -12
- package/dist/runtime/components/MongocampCommandPalette.vue +2 -2
- package/dist/runtime/components/MongocampDashboard.vue +19 -4
- package/dist/runtime/components/MongocampDatabases.vue +13 -2
- package/dist/runtime/components/MongocampExportAll.vue +13 -26
- package/dist/runtime/components/MongocampImport.vue +169 -3
- package/dist/runtime/components/MongocampIndexes.vue +54 -13
- package/dist/runtime/components/MongocampJobs.vue +14 -3
- package/dist/runtime/components/MongocampRoleGrants.vue +16 -3
- package/dist/runtime/components/MongocampRoles.vue +13 -2
- package/dist/runtime/components/MongocampServerInfo.d.vue.ts +24 -0
- package/dist/runtime/components/MongocampServerInfo.vue +331 -0
- package/dist/runtime/components/MongocampServerInfo.vue.d.ts +24 -0
- package/dist/runtime/components/MongocampServerOverview.vue +16 -39
- package/dist/runtime/components/MongocampSettings.d.vue.ts +3 -0
- package/dist/runtime/components/MongocampSettings.vue +14 -2
- package/dist/runtime/components/MongocampSettings.vue.d.ts +3 -0
- package/dist/runtime/components/MongocampUsers.vue +16 -3
- package/dist/runtime/components/MongocampVersion.d.vue.ts +7 -1
- package/dist/runtime/components/MongocampVersion.vue +49 -19
- package/dist/runtime/components/MongocampVersion.vue.d.ts +7 -1
- package/dist/runtime/composables/useMongocampAdminGate.d.ts +12 -0
- package/dist/runtime/composables/useMongocampAdminGate.js +12 -0
- package/dist/runtime/composables/useMongocampAggregation.d.ts +11 -0
- package/dist/runtime/composables/useMongocampAggregation.js +12 -5
- package/dist/runtime/composables/useMongocampBulkByFilter.d.ts +15 -0
- package/dist/runtime/composables/useMongocampBulkByFilter.js +32 -0
- package/dist/runtime/composables/useMongocampCollectionCopy.d.ts +25 -65
- package/dist/runtime/composables/useMongocampCollectionCopy.js +27 -84
- package/dist/runtime/composables/useMongocampExportAll.d.ts +27 -21
- package/dist/runtime/composables/useMongocampExportAll.js +51 -21
- package/dist/runtime/composables/useMongocampExtendedJson.d.ts +2 -1
- package/dist/runtime/composables/useMongocampExtendedJson.js +32 -5
- package/dist/runtime/composables/useMongocampFetchAll.js +1 -1
- package/dist/runtime/composables/useMongocampFieldTypes.d.ts +24 -0
- package/dist/runtime/composables/useMongocampFieldTypes.js +44 -0
- package/dist/runtime/composables/useMongocampImport.d.ts +4 -0
- package/dist/runtime/composables/useMongocampImport.js +5 -2
- package/dist/runtime/composables/useMongocampIndex.d.ts +6 -1
- package/dist/runtime/composables/useMongocampIndex.js +7 -1
- package/dist/runtime/composables/useMongocampPermissions.d.ts +8 -5
- package/dist/runtime/composables/useMongocampPermissions.js +24 -2
- package/dist/runtime/composables/useMongocampQuery.d.ts +3 -3
- package/dist/runtime/composables/useMongocampServerOverview.d.ts +4 -11
- package/dist/runtime/composables/useMongocampServerOverview.js +12 -22
- package/dist/runtime/composables/useMongocampSystem.d.ts +10 -1
- package/dist/runtime/composables/useMongocampSystem.js +11 -1
- package/dist/runtime/locales/de.json +104 -71
- package/dist/runtime/locales/en.json +104 -71
- package/dist/runtime/plugin.d.ts +2 -2
- package/dist/runtime/utils/aggregationErrors.d.ts +4 -0
- package/dist/runtime/utils/aggregationErrors.js +7 -0
- package/dist/runtime/utils/batchInsert.d.ts +6 -0
- package/dist/runtime/utils/batchInsert.js +31 -3
- package/dist/runtime/utils/bsonTypes.d.ts +10 -0
- package/dist/runtime/utils/bsonTypes.js +42 -0
- package/dist/runtime/utils/collectionCopy.d.ts +0 -2
- package/dist/runtime/utils/collectionCopy.js +0 -1
- package/dist/runtime/utils/configRows.d.ts +7 -0
- package/dist/runtime/utils/configRows.js +4 -0
- package/dist/runtime/utils/documentCompare.js +2 -1
- package/dist/runtime/utils/documentPaths.d.ts +5 -8
- package/dist/runtime/utils/documentPaths.js +5 -10
- package/dist/runtime/utils/documentTree.js +9 -1
- package/dist/runtime/utils/exportDocuments.d.ts +0 -2
- package/dist/runtime/utils/exportDocuments.js +0 -1
- package/dist/runtime/utils/exportRows.d.ts +2 -0
- package/dist/runtime/utils/exportRows.js +5 -2
- package/dist/runtime/utils/fieldDetails.d.ts +51 -0
- package/dist/runtime/utils/fieldDetails.js +113 -0
- package/dist/runtime/utils/indexForm.d.ts +47 -33
- package/dist/runtime/utils/indexForm.js +32 -21
- package/dist/runtime/utils/serverInfo.d.ts +8 -0
- package/dist/runtime/utils/serverInfo.js +21 -0
- package/package.json +11 -11
- package/dist/runtime/utils/indexCopy.d.ts +0 -26
- package/dist/runtime/utils/indexCopy.js +0 -22
- package/dist/runtime/utils/limitedMap.d.ts +0 -17
- package/dist/runtime/utils/limitedMap.js +0 -19
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"yes": "Yes",
|
|
16
16
|
"no": "No",
|
|
17
17
|
"admin": "Admin",
|
|
18
|
-
"standard": "Standard"
|
|
18
|
+
"standard": "Standard",
|
|
19
|
+
"adminOnly": "This area is for administrators only."
|
|
19
20
|
},
|
|
20
21
|
"login": {
|
|
21
22
|
"heading": "Mongocamp Login",
|
|
@@ -139,7 +140,8 @@
|
|
|
139
140
|
"chartDocuments": "Documents",
|
|
140
141
|
"chartOther": "other",
|
|
141
142
|
"chartLabel": "{metric} per collection",
|
|
142
|
-
"chartDescription": "The {count} biggest collections"
|
|
143
|
+
"chartDescription": "The {count} biggest collections",
|
|
144
|
+
"renameTooltip": "Rename collection"
|
|
143
145
|
},
|
|
144
146
|
"collectionInfos": {
|
|
145
147
|
"documents": "Documents",
|
|
@@ -164,18 +166,9 @@
|
|
|
164
166
|
"columnInAllSamples": "In all samples",
|
|
165
167
|
"columnIndex": "Index",
|
|
166
168
|
"columnKeys": "Keys",
|
|
167
|
-
"columnSizeKb": "Size (KB)",
|
|
168
169
|
"deleteIndexTooltip": "Delete index",
|
|
169
|
-
"fieldName": "Field Name",
|
|
170
|
-
"ascending": "Ascending",
|
|
171
|
-
"indexType": "Index Type",
|
|
172
|
-
"expireAfter": "Expire After (e.g. 3600s)",
|
|
173
|
-
"expireAfterHelp": "Only used for the expiring index type.",
|
|
174
170
|
"createIndexTitle": "Create Index",
|
|
175
|
-
"deleteIndexTitle": "Delete Index",
|
|
176
|
-
"confirmDeleteIndex": "Are you sure you want to delete the index \"{indexName}\"? This action cannot be undone.",
|
|
177
171
|
"errorCreateIndex": "Error creating index",
|
|
178
|
-
"errorDeleteIndex": "Error deleting index",
|
|
179
172
|
"typeStandard": "standard",
|
|
180
173
|
"statsTitle": "Field statistics",
|
|
181
174
|
"statsAnalyze": "Analyze fields",
|
|
@@ -249,7 +242,15 @@
|
|
|
249
242
|
"viewJson": "JSON",
|
|
250
243
|
"viewModeLabel": "Page view",
|
|
251
244
|
"editLoadFailed": "The full document could not be loaded for editing",
|
|
252
|
-
"
|
|
245
|
+
"compareLoading": "Loading the documents…",
|
|
246
|
+
"compareUntyped": "The documents could not be read with their types, so the table's values are compared: a change of type (an int and a long with the same number) is not shown.",
|
|
247
|
+
"chartTooltip": "Chart a field",
|
|
248
|
+
"chartTitle": "Chart a field of the matching documents",
|
|
249
|
+
"chartField": "Field",
|
|
250
|
+
"chartScopeAll": "All {count} document of the collection. | All {count} documents of the collection.",
|
|
251
|
+
"chartScopeFiltered": "The {count} document that match the current filter. | The {count} documents that match the current filter.",
|
|
252
|
+
"chartTooLong": "The current filter is too long to send with a chart request. Narrow it first.",
|
|
253
|
+
"aggregateTooltip": "Aggregate the matching documents"
|
|
253
254
|
},
|
|
254
255
|
"bucketFiles": {
|
|
255
256
|
"filterPlaceholder": "Filter by filename...",
|
|
@@ -271,15 +272,16 @@
|
|
|
271
272
|
"downloadFileTooltip": "Download file",
|
|
272
273
|
"renameTooltip": "Rename / edit metadata",
|
|
273
274
|
"deleteFileTooltip": "Delete file",
|
|
274
|
-
"metadataKey": "Key",
|
|
275
|
-
"metadataValue": "Value",
|
|
276
275
|
"previewTooltip": "Preview file",
|
|
277
276
|
"dropHere": "Drop files to upload",
|
|
278
277
|
"uploadProgress": "Uploading {done} of {total}…",
|
|
279
278
|
"uploadSummary": "{uploaded} uploaded, {failed} failed",
|
|
280
279
|
"metadataInvalidJson": "Not valid JSON",
|
|
281
280
|
"metadataNotObject": "Metadata must be a JSON object",
|
|
282
|
-
"metadataHelp": "A JSON object; leave empty for no metadata"
|
|
281
|
+
"metadataHelp": "A JSON object; leave empty for no metadata",
|
|
282
|
+
"distribution": "Distribution of the stored files",
|
|
283
|
+
"distributionField": "Field",
|
|
284
|
+
"distributionNone": "No field of the stored files can be charted."
|
|
283
285
|
},
|
|
284
286
|
"jobs": {
|
|
285
287
|
"heading": "Jobs",
|
|
@@ -351,7 +353,9 @@
|
|
|
351
353
|
"columnType": "Type",
|
|
352
354
|
"columnRestart": "Restart",
|
|
353
355
|
"restartNeeded": "needs restart",
|
|
354
|
-
"empty": "No settings found"
|
|
356
|
+
"empty": "No settings found",
|
|
357
|
+
"grantHintTitle": "A missing grant is answered with 401",
|
|
358
|
+
"grantHint": "AUTH_GRANT_DENIED_STATUS is 401 (the default). The generated client treats a 401 as a dead session, so this module turns that answer into a 403 itself and nobody is logged out. Set AUTH_GRANT_DENIED_STATUS to 403 on the server to make 403 the server's own answer."
|
|
355
359
|
},
|
|
356
360
|
"databases": {
|
|
357
361
|
"heading": "Databases",
|
|
@@ -365,6 +369,41 @@
|
|
|
365
369
|
"chartSize": "Size on disk",
|
|
366
370
|
"chartDescription": "Size of {count} databases, biggest first"
|
|
367
371
|
},
|
|
372
|
+
"serverInfo": {
|
|
373
|
+
"heading": "Server information",
|
|
374
|
+
"serverHeading": "Server",
|
|
375
|
+
"mongocampVersion": "MongoCamp",
|
|
376
|
+
"mongoDbVersion": "MongoDB",
|
|
377
|
+
"mongoDbMajor": "MongoDB major version",
|
|
378
|
+
"uptime": "Uptime (database)",
|
|
379
|
+
"replicaSet": "Replica set",
|
|
380
|
+
"replicaState": "State",
|
|
381
|
+
"replicaMembers": "{healthy} of {count} members healthy",
|
|
382
|
+
"statsHeading": "Database load",
|
|
383
|
+
"connections": "Connections",
|
|
384
|
+
"connectionsCurrent": "In use",
|
|
385
|
+
"connectionsAvailable": "Available",
|
|
386
|
+
"connectionsTotal": "Opened since start",
|
|
387
|
+
"opCounters": "Operations since the database server started",
|
|
388
|
+
"partialNote": "The database user lacks the clusterMonitor role, so uptime, connections and counters are not available.",
|
|
389
|
+
"capabilitiesHeading": "Capabilities",
|
|
390
|
+
"features": "Features",
|
|
391
|
+
"limits": "Limits",
|
|
392
|
+
"importMaxBytes": "Largest import",
|
|
393
|
+
"grantDeniedStatus": "Status for a missing grant",
|
|
394
|
+
"deniedStages": "Refused aggregation operators",
|
|
395
|
+
"olderServer": "This server has no capabilities route (older than 1.9.0).",
|
|
396
|
+
"partFailed": "{part} could not be loaded.",
|
|
397
|
+
"partStats": "The database load",
|
|
398
|
+
"partCapabilities": "The capabilities",
|
|
399
|
+
"partInfo": "The MongoDB version",
|
|
400
|
+
"op_insert": "insert",
|
|
401
|
+
"op_query": "query",
|
|
402
|
+
"op_update": "update",
|
|
403
|
+
"op_delete": "delete",
|
|
404
|
+
"op_getmore": "getmore",
|
|
405
|
+
"op_command": "command"
|
|
406
|
+
},
|
|
368
407
|
"version": {
|
|
369
408
|
"unavailable": "MongoCamp unavailable"
|
|
370
409
|
},
|
|
@@ -453,22 +492,18 @@
|
|
|
453
492
|
"pageSelected": "All {count} documents on this page are selected.",
|
|
454
493
|
"selectAllMatching": "Select all {total} matching documents",
|
|
455
494
|
"allMatchingSelected": "All {count} matching documents are selected.",
|
|
456
|
-
"
|
|
457
|
-
"collectingUnknown": "Collecting ids: {loaded}",
|
|
458
|
-
"cancelCollecting": "Cancel",
|
|
459
|
-
"matchingTooMany": "{total} documents match, more than the {cap} that can be handled at once. Narrow the filter first.",
|
|
460
|
-
"matchingChanged": "The collection changed while the ids were collected, so nothing was selected. Try again.",
|
|
461
|
-
"matchingDrift": "{collected} documents were found; the list reported {reported}. Documents were added or removed meanwhile.",
|
|
495
|
+
"matchingDrift": "{counted} documents match now; the list showed {reported}. Documents were added or removed meanwhile.",
|
|
462
496
|
"typeToConfirm": "To delete every matching document, type the collection name {name}.",
|
|
463
497
|
"typeToConfirmLabel": "Collection name",
|
|
464
|
-
"progressDelete": "Deleted {done} of {total}",
|
|
465
|
-
"progressEdit": "Updated {done} of {total}",
|
|
466
|
-
"stop": "Stop",
|
|
467
|
-
"stoppedDelete": "Stopped: {done} of {total} deleted. The other {left} were not touched.",
|
|
468
|
-
"stoppedEdit": "Stopped: {done} of {total} updated. The other {left} were not touched.",
|
|
469
498
|
"matchingDeleted": "Deleted {deleted} of {total} documents",
|
|
470
499
|
"matchingUpdated": "Updated {updated} of {total} documents",
|
|
471
|
-
"compareSelected": "Compare selected"
|
|
500
|
+
"compareSelected": "Compare selected",
|
|
501
|
+
"counting": "Counting matching documents…",
|
|
502
|
+
"typeInt": "Integer (int32)",
|
|
503
|
+
"typeLong": "Long (int64)",
|
|
504
|
+
"typeDouble": "Double",
|
|
505
|
+
"typeDecimal": "Decimal128",
|
|
506
|
+
"editMixed": "The values of this field have more than one type. Choose the type the new value should have."
|
|
472
507
|
},
|
|
473
508
|
"filterBuilder": {
|
|
474
509
|
"matchLabel": "Match",
|
|
@@ -512,8 +547,8 @@
|
|
|
512
547
|
"import": {
|
|
513
548
|
"trigger": "Import documents",
|
|
514
549
|
"title": "Import documents",
|
|
515
|
-
"chooseFile": "Choose a JSON or CSV file",
|
|
516
|
-
"hint": "A JSON array of objects,
|
|
550
|
+
"chooseFile": "Choose a JSON, NDJSON or CSV file",
|
|
551
|
+
"hint": "A JSON array of objects, a CSV file with a header row (up to {maxRows} rows and {maxMb} MB), or a NDJSON file — one JSON document per line, as the export writes it — which goes to the server as it is, without that limit.",
|
|
517
552
|
"chooseButton": "Choose file",
|
|
518
553
|
"readError": "The file could not be read",
|
|
519
554
|
"format": "Format",
|
|
@@ -567,13 +602,21 @@
|
|
|
567
602
|
"invalid-boolean": "Expected true/false, yes/no or 1/0",
|
|
568
603
|
"invalid-date": "Not a valid ISO date",
|
|
569
604
|
"invalid-json-value": "Not valid JSON"
|
|
570
|
-
}
|
|
605
|
+
},
|
|
606
|
+
"ndjsonNote": "The file is sent to the server as it is, line by line: there is no row limit and nothing is held in the browser. Types follow the server's rules (extended JSON wrappers are honoured, a timestamp-shaped text becomes a date) and no metadata is stamped. A line that cannot be stored does not stop the others.",
|
|
607
|
+
"ndjsonUnreadable": "{count} of the first lines is not a JSON object. | {count} of the first lines are not JSON objects.",
|
|
608
|
+
"importFile": "Import file",
|
|
609
|
+
"ndjsonImporting": "The server is reading the file…",
|
|
610
|
+
"ndjsonFailed": "{failed} of {read} lines could not be imported",
|
|
611
|
+
"ndjsonLine": "Line {line}: {reason}",
|
|
612
|
+
"ndjsonMoreErrors": "Only the first failed lines are named."
|
|
571
613
|
},
|
|
572
614
|
"aggregation": {
|
|
573
615
|
"errors": {
|
|
574
616
|
"forbidden": "This pipeline uses {operator}, which is not allowed here.",
|
|
575
617
|
"retryable": "The request was blocked on its way to the server. Try again.",
|
|
576
|
-
"unavailable": "The server did not answer this request. Try again."
|
|
618
|
+
"unavailable": "The server did not answer this request. Try again.",
|
|
619
|
+
"filterTooLong": "The filter is too long to chart ({max} characters at most). Narrow it first."
|
|
577
620
|
},
|
|
578
621
|
"modeVisual": "Stages",
|
|
579
622
|
"modeJson": "JSON",
|
|
@@ -666,10 +709,11 @@
|
|
|
666
709
|
"saveFailedLimit": "At most 50 pipelines can be saved — delete one first",
|
|
667
710
|
"saveFailedSize": "The saved pipelines are too large — delete one first",
|
|
668
711
|
"savedNote": "Saved in this browser only.",
|
|
669
|
-
"unitYear": "Year"
|
|
712
|
+
"unitYear": "Year",
|
|
713
|
+
"appliesTo": "Applies to:",
|
|
714
|
+
"removeFilter": "Remove the filter"
|
|
670
715
|
},
|
|
671
716
|
"documentView": {
|
|
672
|
-
"heading": "Document",
|
|
673
717
|
"modeTree": "Tree",
|
|
674
718
|
"modeJson": "JSON",
|
|
675
719
|
"modeLabel": "View mode",
|
|
@@ -750,7 +794,7 @@
|
|
|
750
794
|
"expireLabel": "Expire after",
|
|
751
795
|
"expireHelp": "A number and s, m, h or d, for example 3600s or 7d.",
|
|
752
796
|
"compoundNote": "With several fields the order matters: the first field is the one queries must filter on.",
|
|
753
|
-
"textNote": "A text index
|
|
797
|
+
"textNote": "A text index can cover several fields; a collection has at most one.",
|
|
754
798
|
"create": "Create index",
|
|
755
799
|
"problemNoField": "Enter at least one field",
|
|
756
800
|
"problemEmptyField": "A field name is empty",
|
|
@@ -770,7 +814,15 @@
|
|
|
770
814
|
"chartSize": "Index size",
|
|
771
815
|
"chartUsage": "Index uses",
|
|
772
816
|
"chartSizeDescription": "Size of {count} indexes, biggest first",
|
|
773
|
-
"chartUsageDescription": "Uses since the server started, for {count} indexes, most used first"
|
|
817
|
+
"chartUsageDescription": "Uses since the server started, for {count} indexes, most used first",
|
|
818
|
+
"sparseLabel": "Sparse",
|
|
819
|
+
"sparseHelp": "Only index documents that have the field.",
|
|
820
|
+
"hiddenLabel": "Hidden",
|
|
821
|
+
"hiddenHelp": "Keep the index up to date but do not use it for queries.",
|
|
822
|
+
"partialLabel": "Partial filter (optional)",
|
|
823
|
+
"partialHelp": "A MongoDB filter as JSON: only the documents it matches are indexed. Not together with Sparse.",
|
|
824
|
+
"problemPartialJson": "The partial filter must be a JSON object, for example the filter of a query",
|
|
825
|
+
"problemSparsePartial": "Sparse and a partial filter cannot be combined"
|
|
774
826
|
},
|
|
775
827
|
"collectionCopy": {
|
|
776
828
|
"title": "Copy collection {source}",
|
|
@@ -783,7 +835,6 @@
|
|
|
783
835
|
"countFiltered": "{count} matching document will be copied. | {count} matching documents will be copied.",
|
|
784
836
|
"countLoading": "Counting documents…",
|
|
785
837
|
"countFailed": "The documents could not be counted",
|
|
786
|
-
"tooMany": "This collection holds {count} documents; at most {cap} can be copied here.",
|
|
787
838
|
"problemEmpty": "Enter a name",
|
|
788
839
|
"problemTooLong": "At most {max} characters",
|
|
789
840
|
"problemInvalid": "Use letters, digits and _ - . only, starting with a letter, digit or _",
|
|
@@ -791,38 +842,25 @@
|
|
|
791
842
|
"problemSame": "Choose a name other than the source",
|
|
792
843
|
"problemExists": "A collection with this name already exists",
|
|
793
844
|
"start": "Copy",
|
|
794
|
-
"stop": "Stop",
|
|
795
|
-
"retry": "Retry failed batches",
|
|
796
845
|
"close": "Close",
|
|
797
|
-
"reading": "Reading {done} of {total}",
|
|
798
|
-
"writing": "Writing {done} of {total}",
|
|
799
846
|
"doneTitle": "Copied {count} document to {target}. | Copied {count} documents to {target}.",
|
|
800
|
-
"verified": "The new collection holds {count} documents.",
|
|
801
|
-
"verifyMismatch": "The new collection holds {actual} documents, but {expected} were copied. Check it before relying on the copy.",
|
|
802
|
-
"failedTitle": "{failed} of {total} documents could not be copied",
|
|
803
|
-
"failedRange": "Documents {from}–{to}: {reason}",
|
|
804
|
-
"maybePartial": "A failed batch may have been partly written. Retrying can then fail on documents that already exist; in that case drop the new collection and copy again.",
|
|
805
|
-
"incomplete": "The new collection {target} is incomplete.",
|
|
806
|
-
"stopped": "Stopped: {done} of {total} documents were copied; {skipped} were not sent. The new collection {target} is incomplete.",
|
|
807
|
-
"changed": "The source changed while it was read, so the copy may miss or repeat a document.",
|
|
808
847
|
"refusedExists": "A collection named {target} exists now. Choose another name.",
|
|
809
848
|
"failedGeneric": "The copy failed",
|
|
810
849
|
"quickBackup": "Quick backup",
|
|
811
850
|
"quickBackupHint": "Copies everything now into a new collection named {name}, without asking for a name.",
|
|
812
|
-
"quickBackupFailed": "This collection cannot be copied",
|
|
813
851
|
"withIndexes": "Also create the same indexes",
|
|
814
|
-
"withIndexesHelp": "The
|
|
815
|
-
"indexes": "Creating indexes {done} of {total}",
|
|
852
|
+
"withIndexesHelp": "The server creates the same indexes on the new collection from the real index definitions.",
|
|
816
853
|
"indexesCopied": "Indexes created: {count}",
|
|
817
854
|
"indexesNone": "The source has no indexes besides the default one.",
|
|
818
|
-
"
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
"
|
|
822
|
-
"
|
|
823
|
-
"
|
|
824
|
-
"
|
|
825
|
-
"
|
|
855
|
+
"running": "Copying {count} document inside the database… | Copying {count} documents inside the database…"
|
|
856
|
+
},
|
|
857
|
+
"collectionRename": {
|
|
858
|
+
"title": "Rename collection {source}",
|
|
859
|
+
"grantsWarning": "Grants are matched by name: every grant for the old name stops applying and none exists for the new one. Documents and indexes stay.",
|
|
860
|
+
"targetLabel": "New name",
|
|
861
|
+
"confirm": "Rename",
|
|
862
|
+
"refusedExists": "A collection named {target} exists now. Choose another name.",
|
|
863
|
+
"failedGeneric": "The collection could not be renamed"
|
|
826
864
|
},
|
|
827
865
|
"exportAll": {
|
|
828
866
|
"title": "Export all matching",
|
|
@@ -834,17 +872,17 @@
|
|
|
834
872
|
"formatJson": "JSON (one array)",
|
|
835
873
|
"formatNdjson": "NDJSON (one document per line)",
|
|
836
874
|
"formatCsv": "CSV",
|
|
837
|
-
"cap": "At most {cap} documents are exported; more are cut off and the file says so here.",
|
|
838
875
|
"start": "Export",
|
|
839
876
|
"stop": "Cancel",
|
|
840
877
|
"close": "Close",
|
|
841
|
-
"reading": "Reading {done} of {total}",
|
|
842
878
|
"done": "Exported {count} document to {file}. | Exported {count} documents to {file}.",
|
|
843
|
-
"truncated": "The file is incomplete: only the first {count} of {total} documents were exported. Narrow the filter.",
|
|
844
|
-
"changed": "Documents were added or removed while reading, so the file may miss or repeat one.",
|
|
845
879
|
"cancelled": "Cancelled — nothing was downloaded.",
|
|
846
880
|
"failed": "The export failed",
|
|
847
|
-
"menuItem": "Export all matching…"
|
|
881
|
+
"menuItem": "Export all matching…",
|
|
882
|
+
"streamNote": "The server streams the file: there is no limit on the number of documents.",
|
|
883
|
+
"receiving": "Receiving the file: {size}",
|
|
884
|
+
"incomplete": "The server stopped before the end, so {file} is incomplete. Try again.",
|
|
885
|
+
"doneSize": "Exported {file} ({size})."
|
|
848
886
|
},
|
|
849
887
|
"charts": {
|
|
850
888
|
"titleValues": "Most common values",
|
|
@@ -893,8 +931,6 @@
|
|
|
893
931
|
"statIndexes": "Index weight",
|
|
894
932
|
"statIndexesHint": "{share} of the size on disk",
|
|
895
933
|
"statDisk": "{size} on disk",
|
|
896
|
-
"reading": "Reading collections: {done} of {total}",
|
|
897
|
-
"stop": "Stop",
|
|
898
934
|
"partial": "{read} of {total} collections were read; {skipped} were left out (the limit is {max}).",
|
|
899
935
|
"failedCollections": "{count} collections could not be read: {names}",
|
|
900
936
|
"biggestTitle": "Biggest collections",
|
|
@@ -914,7 +950,6 @@
|
|
|
914
950
|
"clusterTitle": "Cluster",
|
|
915
951
|
"coordinator": "Coordinator",
|
|
916
952
|
"siteMaster": "Site master",
|
|
917
|
-
"member": "Member",
|
|
918
953
|
"jobsTitle": "Next jobs",
|
|
919
954
|
"jobsNone": "No job has a next run",
|
|
920
955
|
"allJobs": "All jobs",
|
|
@@ -1019,9 +1054,7 @@
|
|
|
1019
1054
|
"changed": "changed",
|
|
1020
1055
|
"added": "added",
|
|
1021
1056
|
"removed": "removed"
|
|
1022
|
-
}
|
|
1023
|
-
"first": "First document",
|
|
1024
|
-
"second": "Second document"
|
|
1057
|
+
}
|
|
1025
1058
|
},
|
|
1026
1059
|
"aggregationChart": {
|
|
1027
1060
|
"viewTable": "Table",
|
package/dist/runtime/plugin.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
declare const _default: import("
|
|
1
|
+
declare const _default: import("nuxt/app").Plugin<{
|
|
2
2
|
mongocampVersion: import("vue").Ref<import("@sfxcode/nuxt-mongocamp-server").Version | undefined, import("@sfxcode/nuxt-mongocamp-server").Version | undefined>;
|
|
3
|
-
}> & import("
|
|
3
|
+
}> & import("nuxt/app").ObjectPlugin<{
|
|
4
4
|
mongocampVersion: import("vue").Ref<import("@sfxcode/nuxt-mongocamp-server").Version | undefined, import("@sfxcode/nuxt-mongocamp-server").Version | undefined>;
|
|
5
5
|
}>;
|
|
6
6
|
export default _default;
|
|
@@ -3,6 +3,10 @@ export declare class ForbiddenPipelineError extends Error {
|
|
|
3
3
|
findings: ForbiddenUse[];
|
|
4
4
|
constructor(findings: ForbiddenUse[]);
|
|
5
5
|
}
|
|
6
|
+
export declare class FilterTooLongError extends Error {
|
|
7
|
+
max: number;
|
|
8
|
+
constructor(max: number);
|
|
9
|
+
}
|
|
6
10
|
export interface ServerErrorInfo {
|
|
7
11
|
kind: 'mongo' | 'other';
|
|
8
12
|
message: string;
|
|
@@ -5,6 +5,13 @@ export class ForbiddenPipelineError extends Error {
|
|
|
5
5
|
this.name = "ForbiddenPipelineError";
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
+
export class FilterTooLongError extends Error {
|
|
9
|
+
constructor(max) {
|
|
10
|
+
super(`The filter is longer than ${max} characters`);
|
|
11
|
+
this.max = max;
|
|
12
|
+
this.name = "FilterTooLongError";
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
const MONGO_COMMAND_FAILED = /^Command failed with error \d+ \([^)]*\): '([\s\S]*?)' on server \S+?\.\s+The full response is[\s\S]*$/;
|
|
9
16
|
const SERVER_ADDRESS = / on server \S+?(?=\.(?:\s|$)|\s|$)/g;
|
|
10
17
|
const BARE_ADDRESS = /\b(?:\d{1,3}\.){3}\d{1,3}(?::\d+)?\b|\b[a-z0-9-]+(?:\.[a-z0-9-]+)+:\d{2,5}\b/gi;
|
|
@@ -4,9 +4,15 @@ export interface BatchInsertFailure {
|
|
|
4
4
|
error: unknown;
|
|
5
5
|
mayBePartial: boolean;
|
|
6
6
|
}
|
|
7
|
+
export interface BatchInsertRowError {
|
|
8
|
+
index: number;
|
|
9
|
+
code?: number;
|
|
10
|
+
message: string;
|
|
11
|
+
}
|
|
7
12
|
export interface BatchInsertResult {
|
|
8
13
|
inserted: number;
|
|
9
14
|
failedBatches: BatchInsertFailure[];
|
|
15
|
+
rowErrors: BatchInsertRowError[];
|
|
10
16
|
skipped: number;
|
|
11
17
|
aborted: boolean;
|
|
12
18
|
}
|
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
const DEFAULT_BATCH_SIZE = 1e3;
|
|
2
2
|
const MAX_BATCH_SIZE = 1e4;
|
|
3
|
+
function rowErrorsAsFailures(rowErrors) {
|
|
4
|
+
const failures = [];
|
|
5
|
+
for (const e of [...rowErrors].sort((a, b) => a.index - b.index)) {
|
|
6
|
+
const last = failures.at(-1);
|
|
7
|
+
const lastMessage = last?.error?.message;
|
|
8
|
+
if (last && last.start + last.count === e.index && lastMessage === e.message) {
|
|
9
|
+
last.count++;
|
|
10
|
+
continue;
|
|
11
|
+
}
|
|
12
|
+
failures.push({ start: e.index, count: 1, error: Object.assign(new Error(e.message), { code: e.code }), mayBePartial: false });
|
|
13
|
+
}
|
|
14
|
+
return failures;
|
|
15
|
+
}
|
|
16
|
+
function readSummary(value) {
|
|
17
|
+
if (typeof value !== "object" || value === null) return void 0;
|
|
18
|
+
const { insertedCount, errors } = value;
|
|
19
|
+
if (typeof insertedCount !== "number") return void 0;
|
|
20
|
+
const list = Array.isArray(errors) ? errors : [];
|
|
21
|
+
return {
|
|
22
|
+
insertedCount,
|
|
23
|
+
errors: list.flatMap((e) => {
|
|
24
|
+
const { index, code, message } = e ?? {};
|
|
25
|
+
return typeof index === "number" ? [{ index, code: typeof code === "number" ? code : void 0, message: typeof message === "string" ? message : "" }] : [];
|
|
26
|
+
})
|
|
27
|
+
};
|
|
28
|
+
}
|
|
3
29
|
export async function runBatchInsert(rows, insert, options = {}) {
|
|
4
30
|
const batchSize = Math.min(Math.max(Math.floor(options.batchSize ?? DEFAULT_BATCH_SIZE) || DEFAULT_BATCH_SIZE, 1), MAX_BATCH_SIZE);
|
|
5
|
-
const result = { inserted: 0, failedBatches: [], skipped: 0, aborted: false };
|
|
31
|
+
const result = { inserted: 0, failedBatches: [], rowErrors: [], skipped: 0, aborted: false };
|
|
6
32
|
let done = 0;
|
|
7
33
|
for (let start = 0; start < rows.length; start += batchSize) {
|
|
8
34
|
if (options.signal?.aborted) {
|
|
@@ -12,13 +38,15 @@ export async function runBatchInsert(rows, insert, options = {}) {
|
|
|
12
38
|
}
|
|
13
39
|
const batch = rows.slice(start, start + batchSize);
|
|
14
40
|
try {
|
|
15
|
-
await insert(batch);
|
|
16
|
-
result.inserted += batch.length;
|
|
41
|
+
const summary = readSummary(await insert(batch));
|
|
42
|
+
result.inserted += summary ? summary.insertedCount : batch.length;
|
|
43
|
+
for (const e of summary?.errors ?? []) result.rowErrors.push({ index: start + e.index, code: e.code, message: e.message });
|
|
17
44
|
} catch (error) {
|
|
18
45
|
result.failedBatches.push({ start, count: batch.length, error, mayBePartial: !(options.isAtomicFailure?.(error) ?? false) });
|
|
19
46
|
}
|
|
20
47
|
done += batch.length;
|
|
21
48
|
options.onProgress?.({ done, total: rows.length });
|
|
22
49
|
}
|
|
50
|
+
if (result.rowErrors.length > 0) result.failedBatches = [...result.failedBatches, ...rowErrorsAsFailures(result.rowErrors)].sort((a, b) => a.start - b.start);
|
|
23
51
|
return result;
|
|
24
52
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type BsonType = 'string' | 'int' | 'long' | 'double' | 'decimal' | 'bool' | 'date' | 'objectId' | 'null';
|
|
2
|
+
/** Dotted path of a field → the type to write it as (array elements as `tags[]`). */
|
|
3
|
+
export type TypeHints = Record<string, BsonType>;
|
|
4
|
+
export declare const BSON_TYPES: readonly BsonType[];
|
|
5
|
+
/**
|
|
6
|
+
* `value` written as `type`. A value that does not fit the type (2.5 as an int, text that is no id as an objectId, a long
|
|
7
|
+
* beyond 2^53 given as a number) is returned **unchanged** — the server then picks the type, which is what a plain value
|
|
8
|
+
* would have got anyway. Never throws.
|
|
9
|
+
*/
|
|
10
|
+
export declare function wireValue(type: BsonType, value: unknown): unknown;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export const BSON_TYPES = ["string", "int", "long", "double", "decimal", "bool", "date", "objectId", "null"];
|
|
2
|
+
const INT32_MIN = -(2 ** 31);
|
|
3
|
+
const INT32_MAX = 2 ** 31 - 1;
|
|
4
|
+
const INTEGER_TEXT = /^-?\d+$/;
|
|
5
|
+
const DECIMAL_TEXT = /^-?\d+(?:\.\d+)?(?:e[+-]?\d+)?$/i;
|
|
6
|
+
const OBJECT_ID_TEXT = /^[0-9a-f]{24}$/i;
|
|
7
|
+
const FULL_TIMESTAMP = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:?\d{2})$/;
|
|
8
|
+
const isFullTimestamp = (value) => FULL_TIMESTAMP.test(value) && !Number.isNaN(Date.parse(value));
|
|
9
|
+
function toNumber(value) {
|
|
10
|
+
const n = typeof value === "number" ? value : typeof value === "string" && value.trim() !== "" ? Number(value) : Number.NaN;
|
|
11
|
+
return Number.isFinite(n) ? n : void 0;
|
|
12
|
+
}
|
|
13
|
+
export function wireValue(type, value) {
|
|
14
|
+
switch (type) {
|
|
15
|
+
case "int": {
|
|
16
|
+
const n = toNumber(value);
|
|
17
|
+
return n !== void 0 && Number.isInteger(n) && n >= INT32_MIN && n <= INT32_MAX ? { $numberInt: String(n) } : value;
|
|
18
|
+
}
|
|
19
|
+
case "long": {
|
|
20
|
+
if (typeof value === "string" && INTEGER_TEXT.test(value.trim())) return { $numberLong: value.trim() };
|
|
21
|
+
const n = toNumber(value);
|
|
22
|
+
return n !== void 0 && Number.isSafeInteger(n) ? { $numberLong: String(n) } : value;
|
|
23
|
+
}
|
|
24
|
+
case "double": {
|
|
25
|
+
const n = toNumber(value);
|
|
26
|
+
return n !== void 0 ? { $numberDouble: String(n) } : value;
|
|
27
|
+
}
|
|
28
|
+
case "decimal": {
|
|
29
|
+
if (typeof value === "string" && DECIMAL_TEXT.test(value.trim())) return { $numberDecimal: value.trim() };
|
|
30
|
+
const n = toNumber(value);
|
|
31
|
+
return n !== void 0 ? { $numberDecimal: String(n) } : value;
|
|
32
|
+
}
|
|
33
|
+
case "date":
|
|
34
|
+
return typeof value === "string" && isFullTimestamp(value) ? { $date: value } : value;
|
|
35
|
+
case "objectId":
|
|
36
|
+
return typeof value === "string" && OBJECT_ID_TEXT.test(value) ? { $oid: value } : value;
|
|
37
|
+
case "string":
|
|
38
|
+
return typeof value === "string" && isFullTimestamp(value) ? { $string: value } : value;
|
|
39
|
+
default:
|
|
40
|
+
return value;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/** More documents than this are not copied through the browser (everything is held in memory while copying). */
|
|
2
|
-
export declare const MAX_COPY_DOCUMENTS = 50000;
|
|
3
1
|
export declare const MAX_COLLECTION_NAME_LENGTH = 100;
|
|
4
2
|
export type TargetNameProblem = 'empty' | 'too-long' | 'invalid-characters' | 'protected' | 'same-as-source' | 'exists';
|
|
5
3
|
/**
|
|
@@ -9,3 +9,10 @@ export interface ConfigRow {
|
|
|
9
9
|
}
|
|
10
10
|
export declare function isSecretConfigKey(key: string): boolean;
|
|
11
11
|
export declare function buildConfigRows(configurations: unknown): ConfigRow[];
|
|
12
|
+
export declare const GRANT_STATUS_KEY = "AUTH_GRANT_DENIED_STATUS";
|
|
13
|
+
/**
|
|
14
|
+
* Whether the server still answers a missing grant with `401` (its default; `403` is planned for the next major version): a
|
|
15
|
+
* generated client clears the session on a 401, which this module works around by turning that 401 into a 403 itself. `false`
|
|
16
|
+
* when the setting is `403`, absent (an older server) or unreadable.
|
|
17
|
+
*/
|
|
18
|
+
export declare function grantStatusHint(rows: readonly ConfigRow[]): boolean;
|
|
@@ -51,3 +51,7 @@ export function buildConfigRows(configurations) {
|
|
|
51
51
|
}
|
|
52
52
|
return rows.sort((a, b) => a.key.localeCompare(b.key));
|
|
53
53
|
}
|
|
54
|
+
export const GRANT_STATUS_KEY = "AUTH_GRANT_DENIED_STATUS";
|
|
55
|
+
export function grantStatusHint(rows) {
|
|
56
|
+
return rows.find((row) => row.key === GRANT_STATUS_KEY)?.value.trim() === "401";
|
|
57
|
+
}
|
|
@@ -8,9 +8,10 @@ export function plainValue(value) {
|
|
|
8
8
|
}
|
|
9
9
|
const WRAPPED_AS_TEXT = /* @__PURE__ */ new Set(["objectId", "date", "long", "decimal"]);
|
|
10
10
|
const NUMERIC = /* @__PURE__ */ new Set(["number", "int", "long", "double", "decimal"]);
|
|
11
|
+
const EXACT_NUMERIC = /* @__PURE__ */ new Set(["int", "long", "double", "decimal"]);
|
|
11
12
|
function typesAgree(a, b) {
|
|
12
13
|
if (a === b) return true;
|
|
13
|
-
if (NUMERIC.has(a) && NUMERIC.has(b)) return
|
|
14
|
+
if (NUMERIC.has(a) && NUMERIC.has(b)) return !(EXACT_NUMERIC.has(a) && EXACT_NUMERIC.has(b));
|
|
14
15
|
return a === "string" && WRAPPED_AS_TEXT.has(b) || b === "string" && WRAPPED_AS_TEXT.has(a);
|
|
15
16
|
}
|
|
16
17
|
function leafEqual(a, b) {
|
|
@@ -10,21 +10,18 @@ export interface FlattenOptions {
|
|
|
10
10
|
maxDepth?: number;
|
|
11
11
|
/** Stops after this many entries (default 10 000); `truncated` tells. */
|
|
12
12
|
maxEntries?: number;
|
|
13
|
-
/** Type a 24-hex string as `objectId` and a full ISO timestamp as `date` (see `typeOf`). Default off. */
|
|
14
|
-
inferStrings?: boolean;
|
|
15
13
|
}
|
|
16
14
|
export interface FlattenResult {
|
|
17
15
|
entries: FlatEntry[];
|
|
18
16
|
truncated: boolean;
|
|
19
17
|
}
|
|
20
18
|
/**
|
|
21
|
-
* What a value is, with extended-JSON wrappers recognised as their BSON type.
|
|
22
|
-
*
|
|
23
|
-
*
|
|
19
|
+
* What a value is, with extended-JSON wrappers recognised as their BSON type. Read a document with `extendedJson=canonical`
|
|
20
|
+
* (server 1.8.1) to get the types: `_id` and nested ids are `{ $oid }`, dates `{ $date }`, numbers `{ $numberInt }` /
|
|
21
|
+
* `{ $numberLong }` / `{ $numberDouble }` / `{ $numberDecimal }`, date-looking text `{ $string }`. A document read as plain
|
|
22
|
+
* JSON has no wrappers (ids and dates are strings) and is typed as what JSON says — the module no longer guesses.
|
|
24
23
|
*/
|
|
25
|
-
export declare function typeOf(value: unknown
|
|
26
|
-
inferStrings?: boolean;
|
|
27
|
-
}): PathValueType;
|
|
24
|
+
export declare function typeOf(value: unknown): PathValueType;
|
|
28
25
|
/** Splits a path at its unescaped dots; `''` is the empty path (no segments). */
|
|
29
26
|
export declare function splitPath(path: string): string[];
|
|
30
27
|
export declare function joinPath(segments: Array<string | number>): string;
|
|
@@ -10,24 +10,20 @@ const WRAPPER_TYPES = {
|
|
|
10
10
|
$numberLong: "long",
|
|
11
11
|
$numberInt: "int",
|
|
12
12
|
$numberDouble: "double",
|
|
13
|
-
$numberDecimal: "decimal"
|
|
13
|
+
$numberDecimal: "decimal",
|
|
14
|
+
// text that looks like a date, marked as text by the server in a typed read
|
|
15
|
+
$string: "string"
|
|
14
16
|
};
|
|
15
17
|
function wrapperType(value) {
|
|
16
18
|
const keys = Object.keys(value);
|
|
17
19
|
return keys.length === 1 ? WRAPPER_TYPES[keys[0]] : void 0;
|
|
18
20
|
}
|
|
19
|
-
|
|
20
|
-
const FULL_TIMESTAMP = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:?\d{2})$/;
|
|
21
|
-
export function typeOf(value, options = {}) {
|
|
21
|
+
export function typeOf(value) {
|
|
22
22
|
if (value === null || value === void 0) return "null";
|
|
23
23
|
if (Array.isArray(value)) return "array";
|
|
24
24
|
if (value instanceof Date) return "date";
|
|
25
25
|
switch (typeof value) {
|
|
26
26
|
case "string":
|
|
27
|
-
if (options.inferStrings) {
|
|
28
|
-
if (OBJECT_ID_TEXT.test(value)) return "objectId";
|
|
29
|
-
if (FULL_TIMESTAMP.test(value) && !Number.isNaN(Date.parse(value))) return "date";
|
|
30
|
-
}
|
|
31
27
|
return "string";
|
|
32
28
|
case "boolean":
|
|
33
29
|
return "boolean";
|
|
@@ -68,12 +64,11 @@ export function joinPath(segments) {
|
|
|
68
64
|
export function flattenDocument(doc, options = {}) {
|
|
69
65
|
const maxDepth = options.maxDepth ?? DEFAULT_MAX_DEPTH;
|
|
70
66
|
const maxEntries = options.maxEntries ?? DEFAULT_MAX_ENTRIES;
|
|
71
|
-
const inferStrings = options.inferStrings ?? false;
|
|
72
67
|
const entries = [];
|
|
73
68
|
let truncated = false;
|
|
74
69
|
const visit = (value, segments, depth) => {
|
|
75
70
|
if (truncated) return;
|
|
76
|
-
const type = typeOf(value
|
|
71
|
+
const type = typeOf(value);
|
|
77
72
|
const container = type === "object" || type === "array";
|
|
78
73
|
const children = container ? Array.isArray(value) ? value.map((v, i) => [String(i), v]) : Object.entries(value) : [];
|
|
79
74
|
if (!container || children.length === 0 || depth >= maxDepth) {
|