@mongodb-js/mongodb-schema 12.7.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.
Files changed (53) hide show
  1. package/.esm-wrapper.mjs +10 -0
  2. package/LICENSE +201 -0
  3. package/README.md +353 -0
  4. package/bin/mongodb-schema +231 -0
  5. package/dist/index.d.ts +14 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +69 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/schema-accessor.d.ts +30 -0
  10. package/dist/schema-accessor.d.ts.map +1 -0
  11. package/dist/schema-accessor.js +30 -0
  12. package/dist/schema-accessor.js.map +1 -0
  13. package/dist/schema-analyzer.d.ts +161 -0
  14. package/dist/schema-analyzer.d.ts.map +1 -0
  15. package/dist/schema-analyzer.js +379 -0
  16. package/dist/schema-analyzer.js.map +1 -0
  17. package/dist/schema-converters/internal-to-expanded.d.ts +6 -0
  18. package/dist/schema-converters/internal-to-expanded.d.ts.map +1 -0
  19. package/dist/schema-converters/internal-to-expanded.js +97 -0
  20. package/dist/schema-converters/internal-to-expanded.js.map +1 -0
  21. package/dist/schema-converters/internal-to-mongodb.d.ts +7 -0
  22. package/dist/schema-converters/internal-to-mongodb.d.ts.map +1 -0
  23. package/dist/schema-converters/internal-to-mongodb.js +93 -0
  24. package/dist/schema-converters/internal-to-mongodb.js.map +1 -0
  25. package/dist/schema-converters/internal-to-standard.d.ts +228 -0
  26. package/dist/schema-converters/internal-to-standard.d.ts.map +1 -0
  27. package/dist/schema-converters/internal-to-standard.js +318 -0
  28. package/dist/schema-converters/internal-to-standard.js.map +1 -0
  29. package/dist/semantic-types/email.d.ts +2 -0
  30. package/dist/semantic-types/email.d.ts.map +1 -0
  31. package/dist/semantic-types/email.js +8 -0
  32. package/dist/semantic-types/email.js.map +1 -0
  33. package/dist/semantic-types/index.d.ts +6 -0
  34. package/dist/semantic-types/index.d.ts.map +1 -0
  35. package/dist/semantic-types/index.js +7 -0
  36. package/dist/semantic-types/index.js.map +1 -0
  37. package/dist/stats.d.ts +11 -0
  38. package/dist/stats.d.ts.map +1 -0
  39. package/dist/stats.js +82 -0
  40. package/dist/stats.js.map +1 -0
  41. package/dist/to-typescript.d.ts +3 -0
  42. package/dist/to-typescript.d.ts.map +1 -0
  43. package/dist/to-typescript.js +103 -0
  44. package/dist/to-typescript.js.map +1 -0
  45. package/dist/types.d.ts +29 -0
  46. package/dist/types.d.ts.map +1 -0
  47. package/dist/types.js +3 -0
  48. package/dist/types.js.map +1 -0
  49. package/dist/util.d.ts +3 -0
  50. package/dist/util.d.ts.map +1 -0
  51. package/dist/util.js +13 -0
  52. package/dist/util.js.map +1 -0
  53. package/package.json +110 -0
@@ -0,0 +1,231 @@
1
+ #!/usr/bin/env node
2
+
3
+ /* eslint-disable no-console */
4
+ /* eslint-disable @typescript-eslint/no-var-requires */
5
+
6
+ const { SchemaAnalyzer, schemaStats: _schemaStats } = require('../');
7
+ const schemaStats = _schemaStats.default;
8
+
9
+ const { MongoClient } = require('mongodb');
10
+ const toNS = require('mongodb-ns');
11
+ const yaml = require('js-yaml');
12
+ const pkg = require('../package.json');
13
+ const Table = require('cli-table');
14
+ const numeral = require('numeral');
15
+ const { EJSON } = require('bson');
16
+ const ProgressBar = require('progress');
17
+
18
+ const yargs = require('yargs/yargs');
19
+ const { hideBin } = require('yargs/helpers');
20
+
21
+ const argv = yargs(hideBin(process.argv))
22
+ .strict()
23
+ .usage('Usage: $0 <uri> <ns> [--format=<json|yaml|table> --number=<n>]')
24
+ .demand(2)
25
+ .option('n', {
26
+ alias: 'number',
27
+ default: 100,
28
+ describe: 'The number of documents to return.',
29
+ })
30
+ .option('f', {
31
+ alias: 'format',
32
+ default: 'json',
33
+ describe: 'The output format.',
34
+ choices: ['json', 'yaml', 'table'],
35
+ })
36
+ .option('o', {
37
+ alias: 'output',
38
+ type: 'boolean',
39
+ describe: 'Print the computed schema to stdout.',
40
+ default: true,
41
+ })
42
+ .option('s', {
43
+ alias: 'stats',
44
+ type: 'boolean',
45
+ describe: 'print schema statistics to stderr',
46
+ })
47
+ .option('p', {
48
+ alias: 'promote',
49
+ type: 'boolean',
50
+ default: true,
51
+ describe: 'promote values to Javascript numbers.',
52
+ })
53
+ .options('t', {
54
+ alias: 'semantic-types',
55
+ type: 'boolean',
56
+ default: false,
57
+ describe:
58
+ 'semantic type detection, currently supported are emails and geojson',
59
+ })
60
+ .option('values', {
61
+ type: 'boolean',
62
+ default: true,
63
+ describe: 'enables the collection of sample values',
64
+ })
65
+ .option('sampling', {
66
+ type: 'boolean',
67
+ default: true,
68
+ describe: 'use random sampling on the collection.',
69
+ })
70
+ .describe('version', 'Show version.')
71
+ .alias('h', 'help')
72
+ .describe('h', 'Show this screen.')
73
+ .help('h')
74
+ .wrap(100)
75
+ .example(
76
+ '$0 localhost:27017 mongodb.fanclub --number 1000 --stats ' + '--no-output',
77
+ 'analyze 1000 docs from the mongodb.fanclub ' +
78
+ 'collection and only show statistics.',
79
+ )
80
+ .example(
81
+ '$0 localhost:27017 test.foo --format table',
82
+ 'analyze 100 docs from the test.foo collection and print ' +
83
+ 'the schema in table form.',
84
+ ).argv;
85
+
86
+ let uri = argv._[0];
87
+ if (!uri.startsWith('mongodb://') && !uri.startsWith('mongodb+srv://')) {
88
+ uri = 'mongodb://' + uri;
89
+ }
90
+ const sampleSize = parseInt(argv.number, 10);
91
+
92
+ if (argv.version) {
93
+ console.error(pkg.version);
94
+ process.exit(1);
95
+ }
96
+
97
+ function addTableRow(table, field) {
98
+ table.push([
99
+ field.path,
100
+ field.type,
101
+ numeral(field.probability).format('0.000%'),
102
+ ]);
103
+
104
+ if (field.fields) {
105
+ field.fields.map(function (child) {
106
+ addTableRow(table, child);
107
+ });
108
+ }
109
+
110
+ if (field.arrayFields) {
111
+ field.arrayFields.map(function (child) {
112
+ addTableRow(table, child);
113
+ });
114
+ }
115
+ }
116
+
117
+ function getTable(schema) {
118
+ const table = new Table({
119
+ head: ['Path', 'Type', 'Probability'],
120
+ colWidths: [50, 30, 20],
121
+ });
122
+ schema.fields.map(function (field) {
123
+ addTableRow(table, field);
124
+ });
125
+ return table;
126
+ }
127
+
128
+ const bar = new ProgressBar('analyzing [:bar] :percent :etas ', {
129
+ total: argv.number,
130
+ width: 60,
131
+ complete: '=',
132
+ incomplete: ' ',
133
+ clear: true,
134
+ });
135
+
136
+ function sample(collection, size = 1000) {
137
+ return collection.aggregate(
138
+ [
139
+ {
140
+ $sample: {
141
+ size,
142
+ },
143
+ },
144
+ ],
145
+ {
146
+ allowDiskUse: true,
147
+ },
148
+ );
149
+ }
150
+
151
+ const client = new MongoClient(uri);
152
+
153
+ (async function main() {
154
+ try {
155
+ await client.connect();
156
+ } catch (err) {
157
+ if (err) {
158
+ console.error('Failed to connect to MongoDB: ', err);
159
+ process.exit(1);
160
+ }
161
+ }
162
+
163
+ const ns = toNS(argv._[1]);
164
+ const db = client.db(ns.database);
165
+ let ts;
166
+
167
+ const options = {
168
+ size: sampleSize,
169
+ query: {},
170
+ promoteValues: argv.promote,
171
+ };
172
+
173
+ const schemaOptions = {
174
+ storeValues: argv.values,
175
+ semanticTypes: argv.semanticTypes,
176
+ };
177
+
178
+ const analyzer = new SchemaAnalyzer(schemaOptions);
179
+ try {
180
+ const input = argv.sampling
181
+ ? sample(db.collection(ns.collection), sampleSize)
182
+ : db
183
+ .collection(ns.collection)
184
+ .find(options.query, {
185
+ promoteValues: options.promoteValues,
186
+ })
187
+ .limit(options.size);
188
+
189
+ for await (const doc of input) {
190
+ bar.tick();
191
+ analyzer.analyzeDoc(doc);
192
+ }
193
+ } catch (err) {
194
+ console.error('error:', err.message);
195
+ process.exit(1);
196
+ }
197
+
198
+ const schema = analyzer.getResult();
199
+
200
+ if (argv.output) {
201
+ let output = '';
202
+ if (argv.format === 'yaml') {
203
+ output = yaml.dump(schema);
204
+ } else if (argv.format === 'table') {
205
+ output = getTable(schema).toString();
206
+ } else {
207
+ output = EJSON.stringify(schema, null, 2);
208
+ }
209
+ console.log(output);
210
+ }
211
+
212
+ if (argv.stats) {
213
+ let branchOutput = '[';
214
+ const branchingFactors = schemaStats.branch(schema);
215
+ if (branchingFactors.length > 20) {
216
+ branchOutput += `${branchingFactors.slice(0, 20).join(',')},...] (top 20 shown)`;
217
+ } else {
218
+ branchOutput += branchingFactors.join(',') + ']';
219
+ }
220
+
221
+ console.error('toplevel fields:', schema.fields.length);
222
+ console.error('branching factors:', branchOutput);
223
+ console.error('schema width: ' + schemaStats.width(schema));
224
+ console.error('schema depth: ' + schemaStats.depth(schema));
225
+ }
226
+
227
+ console.dir(analyzer.getSchemaPaths());
228
+ console.dir(analyzer.getSimplifiedSchema(), { depth: null });
229
+
230
+ client.close();
231
+ })();
@@ -0,0 +1,14 @@
1
+ import type { SchemaAccessor } from './schema-accessor';
2
+ import { SchemaAnalyzer } from './schema-analyzer';
3
+ import type { ArraySchemaType, BaseSchemaType, ConstantSchemaType, DocumentSchemaType, PrimitiveSchemaType, SchemaType, Schema as InternalSchema, SchemaField, SchemaParseOptions, SimplifiedSchemaBaseType, SimplifiedSchemaArrayType, SimplifiedSchemaDocumentType, SimplifiedSchemaType, SimplifiedSchemaField, SimplifiedSchema } from './schema-analyzer';
4
+ import * as schemaStats from './stats';
5
+ import type { AnyIterable, StandardJSONSchema, MongoDBJSONSchema, ExpandedJSONSchema, JSONSchema } from './types';
6
+ import { toTypescriptTypeDefinition } from './to-typescript';
7
+ declare function analyzeDocuments(source: AnyIterable, options?: SchemaParseOptions): Promise<SchemaAccessor>;
8
+ declare function parseSchema(source: AnyIterable, options?: Partial<SchemaParseOptions>): Promise<InternalSchema>;
9
+ declare function getSchemaPaths(source: AnyIterable): Promise<string[][]>;
10
+ declare function getSimplifiedSchema(source: AnyIterable): Promise<SimplifiedSchema>;
11
+ export default parseSchema;
12
+ export type { ArraySchemaType, BaseSchemaType, ConstantSchemaType, DocumentSchemaType, PrimitiveSchemaType, SchemaType, InternalSchema as Schema, InternalSchema, SchemaField, SchemaParseOptions, SimplifiedSchemaBaseType, SimplifiedSchemaArrayType, SimplifiedSchemaDocumentType, SimplifiedSchemaType, SimplifiedSchemaField, SimplifiedSchema, StandardJSONSchema, MongoDBJSONSchema, ExpandedJSONSchema, JSONSchema, SchemaAccessor, };
13
+ export { parseSchema, analyzeDocuments, getSchemaPaths, getSimplifiedSchema, SchemaAnalyzer, schemaStats, toTypescriptTypeDefinition, };
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAA8B,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,EACV,MAAM,IAAI,cAAc,EACxB,WAAW,EACX,kBAAkB,EAClB,wBAAwB,EACxB,yBAAyB,EACzB,4BAA4B,EAC5B,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,KAAK,WAAW,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,UAAU,EACX,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAK7D,iBAAe,gBAAgB,CAC7B,MAAM,EAAE,WAAW,EACnB,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,cAAc,CAAC,CASzB;AAMD,iBAAe,WAAW,CACxB,MAAM,EAAE,WAAW,EACnB,OAAO,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,GACpC,OAAO,CAAC,cAAc,CAAC,CAEzB;AAGD,iBAAe,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAEtE;AAGD,iBAAe,mBAAmB,CAChC,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,gBAAgB,CAAC,CAE3B;AAED,eAAe,WAAW,CAAC;AAE3B,YAAY,EACV,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,EACV,cAAc,IAAI,MAAM,EACxB,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,wBAAwB,EACxB,yBAAyB,EACzB,4BAA4B,EAC5B,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,UAAU,EACV,cAAc,GACf,CAAC;AAEF,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,WAAW,EACX,0BAA0B,GAC3B,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.toTypescriptTypeDefinition = exports.schemaStats = exports.SchemaAnalyzer = void 0;
37
+ exports.parseSchema = parseSchema;
38
+ exports.analyzeDocuments = analyzeDocuments;
39
+ exports.getSchemaPaths = getSchemaPaths;
40
+ exports.getSimplifiedSchema = getSimplifiedSchema;
41
+ const schema_accessor_1 = require("./schema-accessor");
42
+ const schema_analyzer_1 = require("./schema-analyzer");
43
+ Object.defineProperty(exports, "SchemaAnalyzer", { enumerable: true, get: function () { return schema_analyzer_1.SchemaAnalyzer; } });
44
+ const internal_to_expanded_1 = require("./schema-converters/internal-to-expanded");
45
+ const internal_to_mongodb_1 = require("./schema-converters/internal-to-mongodb");
46
+ const internal_to_standard_1 = require("./schema-converters/internal-to-standard");
47
+ const schemaStats = __importStar(require("./stats"));
48
+ exports.schemaStats = schemaStats;
49
+ const to_typescript_1 = require("./to-typescript");
50
+ Object.defineProperty(exports, "toTypescriptTypeDefinition", { enumerable: true, get: function () { return to_typescript_1.toTypescriptTypeDefinition; } });
51
+ async function analyzeDocuments(source, options) {
52
+ const internalSchema = (await (0, schema_analyzer_1.getCompletedSchemaAnalyzer)(source, options)).getResult();
53
+ return new schema_accessor_1.InternalSchemaBasedAccessor(internalSchema, {
54
+ internalToStandard: internal_to_standard_1.convertInternalToStandard,
55
+ internalToMongoDB: internal_to_mongodb_1.convertInternalToMongodb,
56
+ internalToExpanded: internal_to_expanded_1.convertInternalToExpanded,
57
+ });
58
+ }
59
+ async function parseSchema(source, options) {
60
+ return (await (0, schema_analyzer_1.getCompletedSchemaAnalyzer)(source, options)).getResult();
61
+ }
62
+ async function getSchemaPaths(source) {
63
+ return (await (0, schema_analyzer_1.getCompletedSchemaAnalyzer)(source)).getSchemaPaths();
64
+ }
65
+ async function getSimplifiedSchema(source) {
66
+ return (await (0, schema_analyzer_1.getCompletedSchemaAnalyzer)(source)).getSimplifiedSchema();
67
+ }
68
+ exports.default = parseSchema;
69
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoGE,kCAAW;AACX,4CAAgB;AAChB,wCAAc;AACd,kDAAmB;AAtGrB,uDAAgE;AAChE,uDAA+E;AAsG7E,+FAtGmC,gCAAc,OAsGnC;AApFhB,mFAAqF;AACrF,iFAAmF;AACnF,mFAAqF;AACrF,qDAAuC;AAkFrC,kCAAW;AA1Eb,mDAA6D;AA2E3D,2GA3EO,0CAA0B,OA2EP;AAtE5B,KAAK,UAAU,gBAAgB,CAC7B,MAAmB,EACnB,OAA4B;IAE5B,MAAM,cAAc,GAAG,CACrB,MAAM,IAAA,4CAA0B,EAAC,MAAM,EAAE,OAAO,CAAC,CAClD,CAAC,SAAS,EAAE,CAAC;IACd,OAAO,IAAI,6CAA2B,CAAC,cAAc,EAAE;QACrD,kBAAkB,EAAE,gDAAyB;QAC7C,iBAAiB,EAAE,8CAAwB;QAC3C,kBAAkB,EAAE,gDAAyB;KAC9C,CAAC,CAAC;AACL,CAAC;AAMD,KAAK,UAAU,WAAW,CACxB,MAAmB,EACnB,OAAqC;IAErC,OAAO,CAAC,MAAM,IAAA,4CAA0B,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;AACzE,CAAC;AAGD,KAAK,UAAU,cAAc,CAAC,MAAmB;IAC/C,OAAO,CAAC,MAAM,IAAA,4CAA0B,EAAC,MAAM,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC;AACrE,CAAC;AAGD,KAAK,UAAU,mBAAmB,CAChC,MAAmB;IAEnB,OAAO,CAAC,MAAM,IAAA,4CAA0B,EAAC,MAAM,CAAC,CAAC,CAAC,mBAAmB,EAAE,CAAC;AAC1E,CAAC;AAED,kBAAe,WAAW,CAAC"}
@@ -0,0 +1,30 @@
1
+ import type { Schema as InternalSchema } from './schema-analyzer';
2
+ import type { ExpandedJSONSchema, MongoDBJSONSchema, SchemaConverterFn, StandardJSONSchema } from './types';
3
+ type Options = {
4
+ signal?: AbortSignal;
5
+ };
6
+ export interface SchemaAccessor {
7
+ getStandardJsonSchema: (options?: Options) => Promise<StandardJSONSchema>;
8
+ getMongoDBJsonSchema: (options?: Options) => Promise<MongoDBJSONSchema>;
9
+ getExpandedJSONSchema: (options?: Options) => Promise<ExpandedJSONSchema>;
10
+ getInternalSchema: (options?: Options) => Promise<InternalSchema>;
11
+ }
12
+ export type InternalConverters = {
13
+ internalToStandard: SchemaConverterFn<InternalSchema, StandardJSONSchema>;
14
+ internalToExpanded: SchemaConverterFn<InternalSchema, ExpandedJSONSchema>;
15
+ internalToMongoDB: SchemaConverterFn<InternalSchema, MongoDBJSONSchema>;
16
+ };
17
+ export declare class InternalSchemaBasedAccessor implements SchemaAccessor {
18
+ private internalSchema;
19
+ private standardJSONSchema?;
20
+ private mongodbJSONSchema?;
21
+ private expandedJSONSchema?;
22
+ private converters;
23
+ constructor(internalSchema: InternalSchema, converters: InternalConverters);
24
+ getInternalSchema(): Promise<InternalSchema>;
25
+ getStandardJsonSchema(options?: Options): Promise<StandardJSONSchema>;
26
+ getMongoDBJsonSchema(options?: Options): Promise<MongoDBJSONSchema>;
27
+ getExpandedJSONSchema(options?: Options): Promise<ExpandedJSONSchema>;
28
+ }
29
+ export {};
30
+ //# sourceMappingURL=schema-accessor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-accessor.d.ts","sourceRoot":"","sources":["../src/schema-accessor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,cA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BAAoB,CACxB,OAAO,GAAE,OAAY,GACpB,OAAO,CAAC,iBAAiB,CAAC;IAUvB,qBAAqB,CACzB,OAAO,GAAE,OAAY,GACpB,OAAO,CAAC,kBAAkB,CAAC;CAI/B"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InternalSchemaBasedAccessor = void 0;
4
+ class InternalSchemaBasedAccessor {
5
+ internalSchema;
6
+ standardJSONSchema;
7
+ mongodbJSONSchema;
8
+ expandedJSONSchema;
9
+ converters;
10
+ constructor(internalSchema, converters) {
11
+ this.internalSchema = internalSchema;
12
+ this.converters = converters;
13
+ }
14
+ getInternalSchema() {
15
+ return Promise.resolve(this.internalSchema);
16
+ }
17
+ async getStandardJsonSchema(options = {}) {
18
+ return (this.standardJSONSchema ??=
19
+ await this.converters.internalToStandard(this.internalSchema, options));
20
+ }
21
+ async getMongoDBJsonSchema(options = {}) {
22
+ return (this.mongodbJSONSchema ??= await this.converters.internalToMongoDB(this.internalSchema, options));
23
+ }
24
+ async getExpandedJSONSchema(options = {}) {
25
+ return (this.expandedJSONSchema ??=
26
+ await this.converters.internalToExpanded(this.internalSchema, options));
27
+ }
28
+ }
29
+ exports.InternalSchemaBasedAccessor = InternalSchemaBasedAccessor;
30
+ //# sourceMappingURL=schema-accessor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-accessor.js","sourceRoot":"","sources":["../src/schema-accessor.ts"],"names":[],"mappings":";;;AA+BA,MAAa,2BAA2B;IAC9B,cAAc,CAAiB;IAC/B,kBAAkB,CAAsB;IACxC,iBAAiB,CAAqB;IACtC,kBAAkB,CAAsB;IACxC,UAAU,CAAqB;IAEvC,YAAY,cAA8B,EAAE,UAA8B;QACxE,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED,iBAAiB;QACf,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC9C,CAAC;IAMD,KAAK,CAAC,qBAAqB,CACzB,UAAmB,EAAE;QAErB,OAAO,CAAC,IAAI,CAAC,kBAAkB;YAC7B,MAAM,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC;IAC5E,CAAC;IAKD,KAAK,CAAC,oBAAoB,CACxB,UAAmB,EAAE;QAErB,OAAO,CAAC,IAAI,CAAC,iBAAiB,KAAK,MAAM,IAAI,CAAC,UAAU,CAAC,iBAAiB,CACxE,IAAI,CAAC,cAAc,EACnB,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAKD,KAAK,CAAC,qBAAqB,CACzB,UAAmB,EAAE;QAErB,OAAO,CAAC,IAAI,CAAC,kBAAkB;YAC7B,MAAM,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC;IAC5E,CAAC;CACF;AAhDD,kEAgDC"}
@@ -0,0 +1,161 @@
1
+ import Reservoir from 'reservoir';
2
+ import type { Document, ObjectId, MinKey, MaxKey, Long, Double, Int32, Decimal128, BSONRegExp, BSONSymbol, Timestamp } from 'bson';
3
+ import { Binary, Code } from 'bson';
4
+ import type { AnyIterable } from './types';
5
+ type TypeCastMap = {
6
+ Array: unknown[];
7
+ Binary: Binary;
8
+ Boolean: boolean;
9
+ Code: Code;
10
+ CodeWScope: Code;
11
+ Date: Date;
12
+ Decimal128: Decimal128;
13
+ Double: Double;
14
+ Int32: Int32;
15
+ Int64: Long;
16
+ MaxKey: MaxKey;
17
+ MinKey: MinKey;
18
+ Null: null;
19
+ Object: Record<string, unknown>;
20
+ ObjectId: ObjectId;
21
+ BSONRegExp: BSONRegExp;
22
+ String: string;
23
+ BSONSymbol: BSONSymbol;
24
+ Timestamp: Timestamp;
25
+ Undefined: undefined;
26
+ };
27
+ type TypeCastTypes = keyof TypeCastMap;
28
+ type BSONValue = TypeCastMap[TypeCastTypes];
29
+ export type BaseSchemaType = {
30
+ path: string[];
31
+ name: string;
32
+ count: number;
33
+ probability: number;
34
+ bsonType: string;
35
+ hasDuplicates?: boolean;
36
+ unique?: number;
37
+ };
38
+ export type ConstantSchemaType = BaseSchemaType & {
39
+ name: 'Null' | 'Undefined';
40
+ };
41
+ export type PrimitiveSchemaType = BaseSchemaType & {
42
+ name: 'String' | 'Number' | 'Int32' | 'Boolean' | 'Decimal128' | 'Long' | 'ObjectId' | 'Date' | 'RegExp' | 'Symbol' | 'MaxKey' | 'MinKey' | 'Binary' | 'Code' | 'Timestamp' | 'DBRef';
43
+ values: BSONValue[];
44
+ };
45
+ export type ArraySchemaType = BaseSchemaType & {
46
+ name: 'Array';
47
+ lengths: number[];
48
+ averageLength: number;
49
+ totalCount: number;
50
+ types: SchemaType[];
51
+ };
52
+ export type DocumentSchemaType = BaseSchemaType & {
53
+ name: 'Document';
54
+ fields: SchemaField[];
55
+ };
56
+ export type SchemaType = BaseSchemaType | ConstantSchemaType | PrimitiveSchemaType | ArraySchemaType | DocumentSchemaType;
57
+ export type SchemaField = {
58
+ name: string;
59
+ count: number;
60
+ path: string[];
61
+ type: string | string[];
62
+ probability: number;
63
+ hasDuplicates: boolean;
64
+ types: SchemaType[];
65
+ };
66
+ export type Schema = {
67
+ count: number;
68
+ fields: SchemaField[];
69
+ };
70
+ type SchemaBSONType = Exclude<keyof TypeCastMap, 'Object'> | 'Document';
71
+ type SchemaAnalysisBaseType = {
72
+ name: string;
73
+ path: string[];
74
+ bsonType: SchemaBSONType;
75
+ count: number;
76
+ values?: ReturnType<typeof Reservoir>;
77
+ };
78
+ type SchemaAnalysisNullType = SchemaAnalysisBaseType & {
79
+ name: 'Null';
80
+ };
81
+ type SchemaAnalysisPrimitiveType = SchemaAnalysisBaseType & {
82
+ name: 'String' | 'Number' | 'Int32' | 'Boolean' | 'Decimal128' | 'Long' | 'ObjectId' | 'Date' | 'RegExp' | 'Symbol' | 'MaxKey' | 'MinKey' | 'Binary' | 'Code' | 'Timestamp' | 'DBRef';
83
+ };
84
+ type SchemaAnalysisArrayType = SchemaAnalysisBaseType & {
85
+ name: 'Array';
86
+ lengths: number[];
87
+ types: SchemaAnalysisFieldTypes;
88
+ };
89
+ type SchemaAnalysisDocumentType = SchemaAnalysisBaseType & {
90
+ name: 'Document';
91
+ fields: SchemaAnalysisFieldsMap;
92
+ };
93
+ type SchemaAnalysisType = SchemaAnalysisBaseType | SchemaAnalysisNullType | SchemaAnalysisPrimitiveType | SchemaAnalysisArrayType | SchemaAnalysisDocumentType;
94
+ type SchemaAnalysisFieldTypes = {
95
+ [fieldName: string]: SchemaAnalysisType;
96
+ };
97
+ type SchemaAnalysisField = {
98
+ name: string;
99
+ path: string[];
100
+ count: number;
101
+ types: SchemaAnalysisFieldTypes;
102
+ };
103
+ type SchemaAnalysisFieldsMap = {
104
+ [fieldName: string]: SchemaAnalysisField;
105
+ };
106
+ type SchemaAnalysisRoot = {
107
+ fields: SchemaAnalysisFieldsMap;
108
+ count: number;
109
+ };
110
+ type SemanticTypeFunction = (value: BSONValue, path?: string[]) => boolean;
111
+ type SemanticTypeMap = {
112
+ [typeName: string]: SemanticTypeFunction | boolean;
113
+ };
114
+ type AllSchemaParseOptions = {
115
+ semanticTypes: boolean | SemanticTypeMap;
116
+ storeValues: boolean;
117
+ signal?: AbortSignal;
118
+ storedValuesLengthLimit: number;
119
+ distinctFieldsAbortThreshold?: number;
120
+ };
121
+ export type SchemaParseOptions = Partial<AllSchemaParseOptions>;
122
+ export type SimplifiedSchemaBaseType = {
123
+ bsonType: SchemaBSONType;
124
+ };
125
+ export type SimplifiedSchemaArrayType = SimplifiedSchemaBaseType & {
126
+ bsonType: 'Array';
127
+ types: SimplifiedSchemaType[];
128
+ };
129
+ export type SimplifiedSchemaDocumentType = SimplifiedSchemaBaseType & {
130
+ bsonType: 'Document';
131
+ fields: SimplifiedSchema;
132
+ };
133
+ export type SimplifiedSchemaType = SimplifiedSchemaBaseType | SimplifiedSchemaArrayType | SimplifiedSchemaDocumentType;
134
+ export type SimplifiedSchemaField = {
135
+ types: SimplifiedSchemaType[];
136
+ };
137
+ export type SimplifiedSchema = {
138
+ [fieldName: string]: SimplifiedSchemaField;
139
+ };
140
+ export declare class SchemaAnalyzer {
141
+ semanticTypes: SemanticTypeMap;
142
+ options: AllSchemaParseOptions;
143
+ documentsAnalyzed: number;
144
+ fieldsCount: number;
145
+ schemaAnalysisRoot: SchemaAnalysisRoot;
146
+ finalized: boolean;
147
+ schemaResult: Schema;
148
+ fieldAndTypeAnalysisCounter: number;
149
+ constructor(options?: SchemaParseOptions);
150
+ allowAbortDuringAnalysis(): Promise<void>;
151
+ increaseFieldCount(): void;
152
+ getSemanticType(value: BSONValue, path: string[]): string;
153
+ analyzeDoc(doc: Document): Promise<void>;
154
+ getResult(): Schema;
155
+ getSchemaPaths(): string[][];
156
+ getSimplifiedSchema(): SimplifiedSchema;
157
+ }
158
+ export declare function verifyStreamSource(source: AnyIterable): AnyIterable;
159
+ export declare function getCompletedSchemaAnalyzer(source: AnyIterable, options?: SchemaParseOptions): Promise<SchemaAnalyzer>;
160
+ export {};
161
+ //# sourceMappingURL=schema-analyzer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-analyzer.d.ts","sourceRoot":"","sources":["../src/schema-analyzer.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,MAAM,EACN,IAAI,EACJ,MAAM,EACN,KAAK,EACL,UAAU,EACV,UAAU,EACV,UAAU,EACV,SAAS,EACV,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAGpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAG3C,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,OAAO,EAAE,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