@orion-js/mongodb 3.11.8 → 3.12.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.
- package/README.md +15 -0
- package/dist/index.cjs +81990 -0
- package/dist/index.d.ts +204 -0
- package/dist/index.js +81964 -0
- package/package.json +29 -27
- package/LICENSE +0 -21
- package/lib/connect/connections.d.ts +0 -13
- package/lib/connect/connections.js +0 -4
- package/lib/connect/getDBName.d.ts +0 -1
- package/lib/connect/getDBName.js +0 -23
- package/lib/connect/getMongoConnection.d.ts +0 -8
- package/lib/connect/getMongoConnection.js +0 -47
- package/lib/connect/getMongoConnection.test.d.ts +0 -1
- package/lib/connect/getMongoConnection.test.js +0 -43
- package/lib/connect/getMongoURLFromEnv.d.ts +0 -1
- package/lib/connect/getMongoURLFromEnv.js +0 -21
- package/lib/connect/index.d.ts +0 -4
- package/lib/connect/index.js +0 -8
- package/lib/createCollection/createIndexPromisesTest.d.ts +0 -1
- package/lib/createCollection/createIndexPromisesTest.js +0 -12
- package/lib/createCollection/createIndexes.d.ts +0 -3
- package/lib/createCollection/createIndexes.js +0 -67
- package/lib/createCollection/createIndexes.test.d.ts +0 -1
- package/lib/createCollection/createIndexes.test.js +0 -91
- package/lib/createCollection/createIndexesPromise.test.d.ts +0 -1
- package/lib/createCollection/createIndexesPromise.test.js +0 -32
- package/lib/createCollection/generateId.d.ts +0 -3
- package/lib/createCollection/generateId.js +0 -25
- package/lib/createCollection/generateId.test.d.ts +0 -1
- package/lib/createCollection/generateId.test.js +0 -108
- package/lib/createCollection/getMethods/aggregate.test.d.ts +0 -1
- package/lib/createCollection/getMethods/aggregate.test.js +0 -20
- package/lib/createCollection/getMethods/cleanModifier.d.ts +0 -4
- package/lib/createCollection/getMethods/cleanModifier.js +0 -75
- package/lib/createCollection/getMethods/cleanModifier.test.d.ts +0 -1
- package/lib/createCollection/getMethods/cleanModifier.test.js +0 -186
- package/lib/createCollection/getMethods/countDocuments.d.ts +0 -2
- package/lib/createCollection/getMethods/countDocuments.js +0 -16
- package/lib/createCollection/getMethods/countDocuments.test.d.ts +0 -1
- package/lib/createCollection/getMethods/countDocuments.test.js +0 -21
- package/lib/createCollection/getMethods/dataLoader/dataLoad/getDataLoader.d.ts +0 -9
- package/lib/createCollection/getMethods/dataLoader/dataLoad/getDataLoader.js +0 -25
- package/lib/createCollection/getMethods/dataLoader/dataLoad/getDataLoader.test.d.ts +0 -1
- package/lib/createCollection/getMethods/dataLoader/dataLoad/getDataLoader.test.js +0 -37
- package/lib/createCollection/getMethods/dataLoader/dataLoad/index.d.ts +0 -9
- package/lib/createCollection/getMethods/dataLoader/dataLoad/index.js +0 -21
- package/lib/createCollection/getMethods/dataLoader/index.d.ts +0 -5
- package/lib/createCollection/getMethods/dataLoader/index.js +0 -14
- package/lib/createCollection/getMethods/dataLoader/loadById.d.ts +0 -2
- package/lib/createCollection/getMethods/dataLoader/loadById.js +0 -13
- package/lib/createCollection/getMethods/dataLoader/loadById.test.d.ts +0 -1
- package/lib/createCollection/getMethods/dataLoader/loadById.test.js +0 -23
- package/lib/createCollection/getMethods/dataLoader/loadData.d.ts +0 -2
- package/lib/createCollection/getMethods/dataLoader/loadData.js +0 -49
- package/lib/createCollection/getMethods/dataLoader/loadMany.d.ts +0 -2
- package/lib/createCollection/getMethods/dataLoader/loadMany.js +0 -10
- package/lib/createCollection/getMethods/dataLoader/loadMany.test.d.ts +0 -1
- package/lib/createCollection/getMethods/dataLoader/loadMany.test.js +0 -85
- package/lib/createCollection/getMethods/dataLoader/loadOne.d.ts +0 -2
- package/lib/createCollection/getMethods/dataLoader/loadOne.js +0 -10
- package/lib/createCollection/getMethods/dataLoader/loadOne.test.d.ts +0 -1
- package/lib/createCollection/getMethods/dataLoader/loadOne.test.js +0 -76
- package/lib/createCollection/getMethods/deleteMany.d.ts +0 -2
- package/lib/createCollection/getMethods/deleteMany.js +0 -16
- package/lib/createCollection/getMethods/deleteOne.d.ts +0 -2
- package/lib/createCollection/getMethods/deleteOne.js +0 -16
- package/lib/createCollection/getMethods/estimatedDocumentCount.d.ts +0 -3
- package/lib/createCollection/getMethods/estimatedDocumentCount.js +0 -10
- package/lib/createCollection/getMethods/estimatedDocumentCount.test.d.ts +0 -1
- package/lib/createCollection/getMethods/estimatedDocumentCount.test.js +0 -15
- package/lib/createCollection/getMethods/find.d.ts +0 -2
- package/lib/createCollection/getMethods/find.js +0 -21
- package/lib/createCollection/getMethods/findOne.d.ts +0 -2
- package/lib/createCollection/getMethods/findOne.js +0 -18
- package/lib/createCollection/getMethods/findOneAndUpdate.d.ts +0 -3
- package/lib/createCollection/getMethods/findOneAndUpdate.js +0 -29
- package/lib/createCollection/getMethods/findOneAndUpdate.test.d.ts +0 -1
- package/lib/createCollection/getMethods/findOneAndUpdate.test.js +0 -15
- package/lib/createCollection/getMethods/getSelector.d.ts +0 -3
- package/lib/createCollection/getMethods/getSelector.js +0 -21
- package/lib/createCollection/getMethods/getSelector.test.d.ts +0 -1
- package/lib/createCollection/getMethods/getSelector.test.js +0 -46
- package/lib/createCollection/getMethods/index.d.ts +0 -16
- package/lib/createCollection/getMethods/index.js +0 -36
- package/lib/createCollection/getMethods/insertAndFind.d.ts +0 -3
- package/lib/createCollection/getMethods/insertAndFind.js +0 -31
- package/lib/createCollection/getMethods/insertAndFind.test.d.ts +0 -1
- package/lib/createCollection/getMethods/insertAndFind.test.js +0 -50
- package/lib/createCollection/getMethods/insertMany.d.ts +0 -3
- package/lib/createCollection/getMethods/insertMany.js +0 -36
- package/lib/createCollection/getMethods/insertMany.test.d.ts +0 -1
- package/lib/createCollection/getMethods/insertMany.test.js +0 -66
- package/lib/createCollection/getMethods/insertOne.d.ts +0 -3
- package/lib/createCollection/getMethods/insertOne.js +0 -31
- package/lib/createCollection/getMethods/insertOne.test.d.ts +0 -1
- package/lib/createCollection/getMethods/insertOne.test.js +0 -104
- package/lib/createCollection/getMethods/update.test.d.ts +0 -1
- package/lib/createCollection/getMethods/update.test.js +0 -287
- package/lib/createCollection/getMethods/updateAndFind.d.ts +0 -3
- package/lib/createCollection/getMethods/updateAndFind.js +0 -18
- package/lib/createCollection/getMethods/updateAndFind.test.d.ts +0 -1
- package/lib/createCollection/getMethods/updateAndFind.test.js +0 -38
- package/lib/createCollection/getMethods/updateItem.d.ts +0 -2
- package/lib/createCollection/getMethods/updateItem.js +0 -19
- package/lib/createCollection/getMethods/updateItem.test.d.ts +0 -1
- package/lib/createCollection/getMethods/updateItem.test.js +0 -38
- package/lib/createCollection/getMethods/updateMany.d.ts +0 -3
- package/lib/createCollection/getMethods/updateMany.js +0 -30
- package/lib/createCollection/getMethods/updateOne.d.ts +0 -3
- package/lib/createCollection/getMethods/updateOne.js +0 -30
- package/lib/createCollection/getMethods/upsert.d.ts +0 -3
- package/lib/createCollection/getMethods/upsert.js +0 -31
- package/lib/createCollection/getMethods/upsert.test.d.ts +0 -1
- package/lib/createCollection/getMethods/upsert.test.js +0 -92
- package/lib/createCollection/getMethods/validateModifier/index.d.ts +0 -1
- package/lib/createCollection/getMethods/validateModifier/index.js +0 -18
- package/lib/createCollection/getMethods/validateModifier/index.test.d.ts +0 -1
- package/lib/createCollection/getMethods/validateModifier/index.test.js +0 -74
- package/lib/createCollection/getMethods/validateModifier/validateInc.d.ts +0 -7
- package/lib/createCollection/getMethods/validateModifier/validateInc.js +0 -20
- package/lib/createCollection/getMethods/validateModifier/validateInc.test.d.ts +0 -1
- package/lib/createCollection/getMethods/validateModifier/validateInc.test.js +0 -12
- package/lib/createCollection/getMethods/validateModifier/validateOperator.d.ts +0 -5
- package/lib/createCollection/getMethods/validateModifier/validateOperator.js +0 -34
- package/lib/createCollection/getMethods/validateModifier/validatePush.d.ts +0 -8
- package/lib/createCollection/getMethods/validateModifier/validatePush.js +0 -27
- package/lib/createCollection/getMethods/validateModifier/validatePush.test.d.ts +0 -1
- package/lib/createCollection/getMethods/validateModifier/validatePush.test.js +0 -90
- package/lib/createCollection/getMethods/validateModifier/validateSet.d.ts +0 -7
- package/lib/createCollection/getMethods/validateModifier/validateSet.js +0 -19
- package/lib/createCollection/getMethods/validateModifier/validateSet.test.d.ts +0 -1
- package/lib/createCollection/getMethods/validateModifier/validateSet.test.js +0 -16
- package/lib/createCollection/getMethods/validateModifier/validateUnset.d.ts +0 -7
- package/lib/createCollection/getMethods/validateModifier/validateUnset.js +0 -19
- package/lib/createCollection/getMethods/validateModifier/validateUnset.test.d.ts +0 -1
- package/lib/createCollection/getMethods/validateModifier/validateUnset.test.js +0 -71
- package/lib/createCollection/getMethods/validateModifier/validateUpsert.d.ts +0 -1
- package/lib/createCollection/getMethods/validateModifier/validateUpsert.js +0 -43
- package/lib/createCollection/getMethods/validateModifier/validateUpsert.test.d.ts +0 -1
- package/lib/createCollection/getMethods/validateModifier/validateUpsert.test.js +0 -50
- package/lib/createCollection/getMethods/wrapErrors.d.ts +0 -1
- package/lib/createCollection/getMethods/wrapErrors.js +0 -29
- package/lib/createCollection/getSchemaAndModel.d.ts +0 -10
- package/lib/createCollection/getSchemaAndModel.js +0 -41
- package/lib/createCollection/handleError.d.ts +0 -1
- package/lib/createCollection/handleError.js +0 -25
- package/lib/createCollection/index.d.ts +0 -4
- package/lib/createCollection/index.js +0 -77
- package/lib/createCollection/initItem.d.ts +0 -2
- package/lib/createCollection/initItem.js +0 -13
- package/lib/createCollection/typedModel.test.d.ts +0 -1
- package/lib/createCollection/typedModel.test.js +0 -159
- package/lib/helpers/fromDot.d.ts +0 -1
- package/lib/helpers/fromDot.js +0 -12
- package/lib/helpers/fromDot.test.d.ts +0 -1
- package/lib/helpers/fromDot.test.js +0 -47
- package/lib/helpers/toDot.d.ts +0 -1
- package/lib/helpers/toDot.js +0 -11
- package/lib/helpers/toDot.test.d.ts +0 -1
- package/lib/helpers/toDot.test.js +0 -23
- package/lib/index.d.ts +0 -5
- package/lib/index.js +0 -35
- package/lib/service/index.d.ts +0 -3
- package/lib/service/index.js +0 -32
- package/lib/service/index.test.d.ts +0 -1
- package/lib/service/index.test.js +0 -73
- package/lib/tests/setup.d.ts +0 -1
- package/lib/tests/setup.js +0 -20
- package/lib/types/index.d.ts +0 -178
- package/lib/types/index.js +0 -2
- package/lib/types/types.test.d.ts +0 -1
- package/lib/types/types.test.js +0 -59
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const range_1 = __importDefault(require("lodash/range"));
|
|
7
|
-
const random_1 = __importDefault(require("lodash/random"));
|
|
8
|
-
const sortBy_1 = __importDefault(require("lodash/sortBy"));
|
|
9
|
-
const helpers_1 = require("@orion-js/helpers");
|
|
10
|
-
const index_1 = __importDefault(require("../../index"));
|
|
11
|
-
it('should data load many not by id', async () => {
|
|
12
|
-
const Tests = (0, index_1.default)({ name: (0, helpers_1.generateId)() });
|
|
13
|
-
const id1 = await Tests.insertOne({ name: 'one', websiteId: '1', deletedAt: null });
|
|
14
|
-
const id2 = await Tests.insertOne({ name: 'two', websiteId: '1', deletedAt: null });
|
|
15
|
-
const id3 = await Tests.insertOne({ name: 'three', websiteId: '2', deletedAt: null });
|
|
16
|
-
const result = await Promise.all([
|
|
17
|
-
Tests.loadMany({
|
|
18
|
-
key: 'websiteId',
|
|
19
|
-
value: '1',
|
|
20
|
-
match: { deletedAt: null }
|
|
21
|
-
}),
|
|
22
|
-
Tests.loadMany({
|
|
23
|
-
key: 'websiteId',
|
|
24
|
-
value: '2',
|
|
25
|
-
match: { deletedAt: null }
|
|
26
|
-
})
|
|
27
|
-
]);
|
|
28
|
-
const [[loaded1, loaded2], [loaded3]] = result;
|
|
29
|
-
expect([id1, id2]).toContain(loaded1._id);
|
|
30
|
-
expect([id1, id2]).toContain(loaded2._id);
|
|
31
|
-
expect(loaded3._id).toBe(id3);
|
|
32
|
-
});
|
|
33
|
-
it('should load many on many', async () => {
|
|
34
|
-
const Tests = (0, index_1.default)({ name: (0, helpers_1.generateId)() });
|
|
35
|
-
await Tests.insertOne({ websiteId: 1, deletedAt: null });
|
|
36
|
-
await Tests.insertOne({ websiteId: 2, deletedAt: null });
|
|
37
|
-
await Tests.insertOne({ websiteId: 3, deletedAt: null });
|
|
38
|
-
const [result1, result2] = await Promise.all([
|
|
39
|
-
Tests.loadMany({
|
|
40
|
-
key: 'websiteId',
|
|
41
|
-
values: [1, 2],
|
|
42
|
-
sort: { websiteId: 1 }
|
|
43
|
-
}),
|
|
44
|
-
Tests.loadMany({
|
|
45
|
-
key: 'websiteId',
|
|
46
|
-
values: [2, 3],
|
|
47
|
-
sort: { websiteId: 1 }
|
|
48
|
-
})
|
|
49
|
-
]);
|
|
50
|
-
const values1 = result1.map(r => r.websiteId);
|
|
51
|
-
const values2 = result2.map(r => r.websiteId);
|
|
52
|
-
expect(values1).toEqual([1, 2]);
|
|
53
|
-
expect(values2).toEqual([2, 3]);
|
|
54
|
-
});
|
|
55
|
-
it('should load sorted data', async () => {
|
|
56
|
-
const Tests = (0, index_1.default)({ name: (0, helpers_1.generateId)() });
|
|
57
|
-
for (const _ of (0, range_1.default)(100)) {
|
|
58
|
-
await Tests.insertOne({ index: (0, random_1.default)(100), websiteId: '1' });
|
|
59
|
-
await Tests.insertOne({ index: (0, random_1.default)(100), websiteId: '2' });
|
|
60
|
-
await Tests.insertOne({ index: (0, random_1.default)(100), websiteId: '3' });
|
|
61
|
-
}
|
|
62
|
-
const [results1, results2, results3] = await Promise.all([
|
|
63
|
-
Tests.loadMany({
|
|
64
|
-
key: 'websiteId',
|
|
65
|
-
value: '1',
|
|
66
|
-
sort: { index: 1 }
|
|
67
|
-
}),
|
|
68
|
-
Tests.loadMany({
|
|
69
|
-
key: 'websiteId',
|
|
70
|
-
value: '2',
|
|
71
|
-
sort: { index: 1 }
|
|
72
|
-
}),
|
|
73
|
-
Tests.loadMany({
|
|
74
|
-
key: 'websiteId',
|
|
75
|
-
value: '3',
|
|
76
|
-
sort: { index: 1 }
|
|
77
|
-
})
|
|
78
|
-
]);
|
|
79
|
-
const indexes1 = results1.map(result => result.index);
|
|
80
|
-
const indexes2 = results2.map(result => result.index);
|
|
81
|
-
const indexes3 = results3.map(result => result.index);
|
|
82
|
-
expect(indexes1).toEqual((0, sortBy_1.default)(indexes1));
|
|
83
|
-
expect(indexes2).toEqual((0, sortBy_1.default)(indexes2));
|
|
84
|
-
expect(indexes3).toEqual((0, sortBy_1.default)(indexes3));
|
|
85
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function default_1(collection) {
|
|
4
|
-
const loadOne = async (options) => {
|
|
5
|
-
const [result] = await collection.loadData(options);
|
|
6
|
-
return result;
|
|
7
|
-
};
|
|
8
|
-
return loadOne;
|
|
9
|
-
}
|
|
10
|
-
exports.default = default_1;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const index_1 = __importDefault(require("../../index"));
|
|
16
|
-
const helpers_1 = require("@orion-js/helpers");
|
|
17
|
-
const typed_model_1 = require("@orion-js/typed-model");
|
|
18
|
-
it('should data load one not by id', async () => {
|
|
19
|
-
let LoadOneTestModel = class LoadOneTestModel {
|
|
20
|
-
};
|
|
21
|
-
__decorate([
|
|
22
|
-
(0, typed_model_1.Prop)(),
|
|
23
|
-
__metadata("design:type", String)
|
|
24
|
-
], LoadOneTestModel.prototype, "_id", void 0);
|
|
25
|
-
__decorate([
|
|
26
|
-
(0, typed_model_1.Prop)(),
|
|
27
|
-
__metadata("design:type", String)
|
|
28
|
-
], LoadOneTestModel.prototype, "name", void 0);
|
|
29
|
-
__decorate([
|
|
30
|
-
(0, typed_model_1.Prop)(),
|
|
31
|
-
__metadata("design:type", String)
|
|
32
|
-
], LoadOneTestModel.prototype, "websiteId", void 0);
|
|
33
|
-
__decorate([
|
|
34
|
-
(0, typed_model_1.Prop)({ optional: true }),
|
|
35
|
-
__metadata("design:type", Date)
|
|
36
|
-
], LoadOneTestModel.prototype, "deletedAt", void 0);
|
|
37
|
-
LoadOneTestModel = __decorate([
|
|
38
|
-
(0, typed_model_1.TypedModel)()
|
|
39
|
-
], LoadOneTestModel);
|
|
40
|
-
const Tests = (0, index_1.default)({
|
|
41
|
-
name: (0, helpers_1.generateId)(),
|
|
42
|
-
model: (0, typed_model_1.getModelForClass)(LoadOneTestModel)
|
|
43
|
-
});
|
|
44
|
-
const id1 = await Tests.insertOne({ name: 'one', websiteId: '1', deletedAt: null });
|
|
45
|
-
const id2 = await Tests.insertOne({ name: 'two', websiteId: '1', deletedAt: null });
|
|
46
|
-
const id3 = await Tests.insertOne({ name: 'three', websiteId: '2', deletedAt: null });
|
|
47
|
-
const [loaded1, loaded2, loaded3] = await Promise.all([
|
|
48
|
-
Tests.loadOne({
|
|
49
|
-
key: 'websiteId',
|
|
50
|
-
value: '1',
|
|
51
|
-
match: { deletedAt: null }
|
|
52
|
-
}),
|
|
53
|
-
Tests.loadOne({
|
|
54
|
-
key: 'websiteId',
|
|
55
|
-
value: '1',
|
|
56
|
-
match: { deletedAt: null }
|
|
57
|
-
}),
|
|
58
|
-
Tests.loadOne({
|
|
59
|
-
key: 'websiteId',
|
|
60
|
-
value: '2',
|
|
61
|
-
match: { deletedAt: null }
|
|
62
|
-
})
|
|
63
|
-
]);
|
|
64
|
-
expect([id1, id2]).toContain(loaded1._id);
|
|
65
|
-
expect([id1, id2]).toContain(loaded2._id);
|
|
66
|
-
expect(loaded3._id).toBe(id3);
|
|
67
|
-
});
|
|
68
|
-
it('handles undefined', async () => {
|
|
69
|
-
const Tests = (0, index_1.default)({ name: (0, helpers_1.generateId)() });
|
|
70
|
-
const result = await Tests.loadOne({
|
|
71
|
-
key: 'websiteId',
|
|
72
|
-
value: '1',
|
|
73
|
-
match: { deletedAt: null }
|
|
74
|
-
});
|
|
75
|
-
expect(result).toBeUndefined();
|
|
76
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const getSelector_1 = __importDefault(require("./getSelector"));
|
|
7
|
-
function default_1(collection) {
|
|
8
|
-
const func = async function (selectorArg, options) {
|
|
9
|
-
await collection.connectionPromise;
|
|
10
|
-
const selector = (0, getSelector_1.default)(arguments);
|
|
11
|
-
const result = await collection.rawCollection.deleteMany(selector, options);
|
|
12
|
-
return result;
|
|
13
|
-
};
|
|
14
|
-
return func;
|
|
15
|
-
}
|
|
16
|
-
exports.default = default_1;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const getSelector_1 = __importDefault(require("./getSelector"));
|
|
7
|
-
function default_1(collection) {
|
|
8
|
-
const func = async function (selectorArg, options) {
|
|
9
|
-
await collection.connectionPromise;
|
|
10
|
-
const selector = (0, getSelector_1.default)(arguments);
|
|
11
|
-
const result = await collection.rawCollection.deleteOne(selector, options);
|
|
12
|
-
return result;
|
|
13
|
-
};
|
|
14
|
-
return func;
|
|
15
|
-
}
|
|
16
|
-
exports.default = default_1;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = (collection) => {
|
|
4
|
-
const func = async function (options) {
|
|
5
|
-
await collection.connectionPromise;
|
|
6
|
-
const result = await collection.rawCollection.estimatedDocumentCount(options);
|
|
7
|
-
return result;
|
|
8
|
-
};
|
|
9
|
-
return func;
|
|
10
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const helpers_1 = require("@orion-js/helpers");
|
|
7
|
-
const __1 = __importDefault(require(".."));
|
|
8
|
-
describe('estimatedDocumentCount operation', () => {
|
|
9
|
-
it('should count all documents', async () => {
|
|
10
|
-
const Tests = (0, __1.default)({ name: (0, helpers_1.generateId)() });
|
|
11
|
-
await Tests.insertMany([{ hello: 'world' }, { hello: 'world' }]);
|
|
12
|
-
const count = await Tests.estimatedDocumentCount();
|
|
13
|
-
expect(count).toBe(2);
|
|
14
|
-
});
|
|
15
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const getSelector_1 = __importDefault(require("./getSelector"));
|
|
7
|
-
function default_1(collection) {
|
|
8
|
-
const find = function (selectorArg, options) {
|
|
9
|
-
const selector = (0, getSelector_1.default)(arguments);
|
|
10
|
-
const cursor = collection.rawCollection.find(selector, options);
|
|
11
|
-
cursor._oldToArray = cursor.toArray;
|
|
12
|
-
cursor.toArray = async () => {
|
|
13
|
-
await collection.connectionPromise;
|
|
14
|
-
const items = await cursor._oldToArray();
|
|
15
|
-
return items.map(item => collection.initItem(item));
|
|
16
|
-
};
|
|
17
|
-
return cursor;
|
|
18
|
-
};
|
|
19
|
-
return find;
|
|
20
|
-
}
|
|
21
|
-
exports.default = default_1;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const getSelector_1 = __importDefault(require("./getSelector"));
|
|
7
|
-
function default_1(collection) {
|
|
8
|
-
const findOne = async function (selectorArg, options) {
|
|
9
|
-
await collection.connectionPromise;
|
|
10
|
-
const selector = (0, getSelector_1.default)(arguments);
|
|
11
|
-
const item = (await collection.rawCollection.findOne(selector, options));
|
|
12
|
-
if (!item)
|
|
13
|
-
return item;
|
|
14
|
-
return collection.initItem(item);
|
|
15
|
-
};
|
|
16
|
-
return findOne;
|
|
17
|
-
}
|
|
18
|
-
exports.default = default_1;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const getSelector_1 = __importDefault(require("./getSelector"));
|
|
7
|
-
const validateModifier_1 = __importDefault(require("./validateModifier"));
|
|
8
|
-
const cleanModifier_1 = __importDefault(require("./cleanModifier"));
|
|
9
|
-
exports.default = (collection) => {
|
|
10
|
-
const findOneAndUpdate = async function (selectorArg, modifierArg, options = {}) {
|
|
11
|
-
await collection.connectionPromise;
|
|
12
|
-
let modifier = modifierArg;
|
|
13
|
-
const selector = (0, getSelector_1.default)(arguments);
|
|
14
|
-
if (!modifier) {
|
|
15
|
-
throw new Error('Modifier is required when making an update');
|
|
16
|
-
}
|
|
17
|
-
if (collection.schema) {
|
|
18
|
-
const schema = collection.getSchema();
|
|
19
|
-
modifier = options.clean !== false ? await (0, cleanModifier_1.default)(schema, modifier) : modifier;
|
|
20
|
-
if (options.validate !== false)
|
|
21
|
-
await (0, validateModifier_1.default)(schema, modifier);
|
|
22
|
-
}
|
|
23
|
-
const result = await collection.rawCollection.findOneAndUpdate(selector, modifier, options.mongoOptions);
|
|
24
|
-
if (!result)
|
|
25
|
-
return null;
|
|
26
|
-
return collection.initItem(result);
|
|
27
|
-
};
|
|
28
|
-
return findOneAndUpdate;
|
|
29
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const helpers_1 = require("@orion-js/helpers");
|
|
7
|
-
const __1 = __importDefault(require(".."));
|
|
8
|
-
it('updates a document without errors', async () => {
|
|
9
|
-
const Tests = (0, __1.default)({ name: (0, helpers_1.generateId)() });
|
|
10
|
-
const docId = await Tests.insertOne({ hello: 'world' });
|
|
11
|
-
const result = await Tests.findOneAndUpdate(docId, { $set: { hello: 'country' } }, { mongoOptions: { returnDocument: 'before' } });
|
|
12
|
-
expect(result.hello).toBe('world');
|
|
13
|
-
const final = await Tests.findOne(docId);
|
|
14
|
-
expect(final.hello).toBe('country');
|
|
15
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const isPlainObject_1 = __importDefault(require("lodash/isPlainObject"));
|
|
7
|
-
function getSelector(args) {
|
|
8
|
-
if (args.length === 0)
|
|
9
|
-
return {};
|
|
10
|
-
const selector = args[0];
|
|
11
|
-
if (typeof selector === 'string') {
|
|
12
|
-
return { _id: selector };
|
|
13
|
-
}
|
|
14
|
-
if ((0, isPlainObject_1.default)(selector)) {
|
|
15
|
-
return selector;
|
|
16
|
-
}
|
|
17
|
-
return {
|
|
18
|
-
_id: 'shouldReturnNull'
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
exports.default = getSelector;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const getSelector_1 = __importDefault(require("./getSelector"));
|
|
16
|
-
const typed_model_1 = require("@orion-js/typed-model");
|
|
17
|
-
const mongoFunctionMock = function (selectorArg) {
|
|
18
|
-
return (0, getSelector_1.default)(arguments);
|
|
19
|
-
};
|
|
20
|
-
it('should find by id when a string is passed', async () => {
|
|
21
|
-
expect(mongoFunctionMock('hello')).toEqual({ _id: 'hello' });
|
|
22
|
-
});
|
|
23
|
-
it('should return none selector when not an object or a string is passed', async () => {
|
|
24
|
-
expect(mongoFunctionMock(null)).toEqual({ _id: 'shouldReturnNull' });
|
|
25
|
-
expect(mongoFunctionMock(undefined)).toEqual({ _id: 'shouldReturnNull' });
|
|
26
|
-
});
|
|
27
|
-
it('should return full selector when no argument is passed', async () => {
|
|
28
|
-
expect(mongoFunctionMock()).toEqual({});
|
|
29
|
-
});
|
|
30
|
-
it('should return the selector when a valid mongo selector is passed', async () => {
|
|
31
|
-
const selector = { _id: 'hello', number: 123 };
|
|
32
|
-
expect(mongoFunctionMock(selector)).toBe(selector);
|
|
33
|
-
});
|
|
34
|
-
it('should allow passing $in to selectors with typed id', async () => {
|
|
35
|
-
let Example = class Example {
|
|
36
|
-
};
|
|
37
|
-
__decorate([
|
|
38
|
-
(0, typed_model_1.Prop)(),
|
|
39
|
-
__metadata("design:type", String)
|
|
40
|
-
], Example.prototype, "_id", void 0);
|
|
41
|
-
Example = __decorate([
|
|
42
|
-
(0, typed_model_1.TypedSchema)()
|
|
43
|
-
], Example);
|
|
44
|
-
const selector1 = { _id: { $in: ['prefix_'] } };
|
|
45
|
-
const selector2 = 'prefix_1';
|
|
46
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import find from './find';
|
|
2
|
-
import findOne from './findOne';
|
|
3
|
-
import upsert from './upsert';
|
|
4
|
-
import findOneAndUpdate from './findOneAndUpdate';
|
|
5
|
-
import updateOne from './updateOne';
|
|
6
|
-
import updateMany from './updateMany';
|
|
7
|
-
import updateAndFind from './updateAndFind';
|
|
8
|
-
import deleteOne from './deleteOne';
|
|
9
|
-
import deleteMany from './deleteMany';
|
|
10
|
-
import insertOne from './insertOne';
|
|
11
|
-
import insertMany from './insertMany';
|
|
12
|
-
import updateItem from './updateItem';
|
|
13
|
-
import countDocuments from './countDocuments';
|
|
14
|
-
import estimatedDocumentCount from './estimatedDocumentCount';
|
|
15
|
-
import insertAndFind from './insertAndFind';
|
|
16
|
-
export { findOne, find, findOneAndUpdate, insertOne, insertMany, insertAndFind, updateOne, updateMany, updateAndFind, updateItem, deleteOne, deleteMany, upsert, estimatedDocumentCount, countDocuments };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.countDocuments = exports.estimatedDocumentCount = exports.upsert = exports.deleteMany = exports.deleteOne = exports.updateItem = exports.updateAndFind = exports.updateMany = exports.updateOne = exports.insertAndFind = exports.insertMany = exports.insertOne = exports.findOneAndUpdate = exports.find = exports.findOne = void 0;
|
|
7
|
-
const find_1 = __importDefault(require("./find"));
|
|
8
|
-
exports.find = find_1.default;
|
|
9
|
-
const findOne_1 = __importDefault(require("./findOne"));
|
|
10
|
-
exports.findOne = findOne_1.default;
|
|
11
|
-
const upsert_1 = __importDefault(require("./upsert"));
|
|
12
|
-
exports.upsert = upsert_1.default;
|
|
13
|
-
const findOneAndUpdate_1 = __importDefault(require("./findOneAndUpdate"));
|
|
14
|
-
exports.findOneAndUpdate = findOneAndUpdate_1.default;
|
|
15
|
-
const updateOne_1 = __importDefault(require("./updateOne"));
|
|
16
|
-
exports.updateOne = updateOne_1.default;
|
|
17
|
-
const updateMany_1 = __importDefault(require("./updateMany"));
|
|
18
|
-
exports.updateMany = updateMany_1.default;
|
|
19
|
-
const updateAndFind_1 = __importDefault(require("./updateAndFind"));
|
|
20
|
-
exports.updateAndFind = updateAndFind_1.default;
|
|
21
|
-
const deleteOne_1 = __importDefault(require("./deleteOne"));
|
|
22
|
-
exports.deleteOne = deleteOne_1.default;
|
|
23
|
-
const deleteMany_1 = __importDefault(require("./deleteMany"));
|
|
24
|
-
exports.deleteMany = deleteMany_1.default;
|
|
25
|
-
const insertOne_1 = __importDefault(require("./insertOne"));
|
|
26
|
-
exports.insertOne = insertOne_1.default;
|
|
27
|
-
const insertMany_1 = __importDefault(require("./insertMany"));
|
|
28
|
-
exports.insertMany = insertMany_1.default;
|
|
29
|
-
const updateItem_1 = __importDefault(require("./updateItem"));
|
|
30
|
-
exports.updateItem = updateItem_1.default;
|
|
31
|
-
const countDocuments_1 = __importDefault(require("./countDocuments"));
|
|
32
|
-
exports.countDocuments = countDocuments_1.default;
|
|
33
|
-
const estimatedDocumentCount_1 = __importDefault(require("./estimatedDocumentCount"));
|
|
34
|
-
exports.estimatedDocumentCount = estimatedDocumentCount_1.default;
|
|
35
|
-
const insertAndFind_1 = __importDefault(require("./insertAndFind"));
|
|
36
|
-
exports.insertAndFind = insertAndFind_1.default;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const isPlainObject_1 = __importDefault(require("lodash/isPlainObject"));
|
|
7
|
-
const fromDot_1 = __importDefault(require("../../helpers/fromDot"));
|
|
8
|
-
const schema_1 = require("@orion-js/schema");
|
|
9
|
-
const wrapErrors_1 = require("./wrapErrors");
|
|
10
|
-
exports.default = (collection) => {
|
|
11
|
-
const insertAndFind = async (insertDoc, options = {}) => {
|
|
12
|
-
await collection.connectionPromise;
|
|
13
|
-
let doc = insertDoc;
|
|
14
|
-
if (!doc || !(0, isPlainObject_1.default)(doc)) {
|
|
15
|
-
throw new Error('Insert must receive a document');
|
|
16
|
-
}
|
|
17
|
-
if (!doc._id) {
|
|
18
|
-
doc._id = collection.generateId();
|
|
19
|
-
}
|
|
20
|
-
if (collection.schema) {
|
|
21
|
-
const schema = collection.getSchema();
|
|
22
|
-
doc = await (0, schema_1.clean)(schema, (0, fromDot_1.default)(doc));
|
|
23
|
-
await (0, schema_1.validate)(schema, doc);
|
|
24
|
-
}
|
|
25
|
-
await (0, wrapErrors_1.wrapErrors)(async () => {
|
|
26
|
-
await collection.rawCollection.insertOne(doc, options.mongoOptions);
|
|
27
|
-
});
|
|
28
|
-
return doc;
|
|
29
|
-
};
|
|
30
|
-
return insertAndFind;
|
|
31
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const insertOne_1 = __importDefault(require("./insertOne"));
|
|
16
|
-
const helpers_1 = require("@orion-js/helpers");
|
|
17
|
-
const __1 = __importDefault(require(".."));
|
|
18
|
-
const typed_model_1 = require("@orion-js/typed-model");
|
|
19
|
-
describe('insertAndFind', () => {
|
|
20
|
-
it('should return a function', async () => {
|
|
21
|
-
const Tests = (0, __1.default)({ name: (0, helpers_1.generateId)() });
|
|
22
|
-
const insertOne = (0, insertOne_1.default)(Tests);
|
|
23
|
-
expect(typeof insertOne).toBe('function');
|
|
24
|
-
});
|
|
25
|
-
it('inserts and finds a cleaned document', async () => {
|
|
26
|
-
let TestSchema1 = class TestSchema1 {
|
|
27
|
-
};
|
|
28
|
-
__decorate([
|
|
29
|
-
(0, typed_model_1.Prop)(),
|
|
30
|
-
__metadata("design:type", String)
|
|
31
|
-
], TestSchema1.prototype, "_id", void 0);
|
|
32
|
-
__decorate([
|
|
33
|
-
(0, typed_model_1.Prop)({
|
|
34
|
-
clean: string => `cleaned ${string}`
|
|
35
|
-
}),
|
|
36
|
-
__metadata("design:type", String)
|
|
37
|
-
], TestSchema1.prototype, "hello", void 0);
|
|
38
|
-
TestSchema1 = __decorate([
|
|
39
|
-
(0, typed_model_1.TypedSchema)()
|
|
40
|
-
], TestSchema1);
|
|
41
|
-
const Tests = (0, __1.default)({ name: (0, helpers_1.generateId)(), schema: TestSchema1 });
|
|
42
|
-
const result = await Tests.insertAndFind({ hello: 'world' });
|
|
43
|
-
const count = await Tests.estimatedDocumentCount();
|
|
44
|
-
expect(count).toBe(1);
|
|
45
|
-
expect(result).toEqual({
|
|
46
|
-
_id: result._id,
|
|
47
|
-
hello: 'cleaned world'
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const isPlainObject_1 = __importDefault(require("lodash/isPlainObject"));
|
|
7
|
-
const lodash_1 = require("lodash");
|
|
8
|
-
const fromDot_1 = __importDefault(require("../../helpers/fromDot"));
|
|
9
|
-
const schema_1 = require("@orion-js/schema");
|
|
10
|
-
const wrapErrors_1 = require("./wrapErrors");
|
|
11
|
-
exports.default = (collection) => {
|
|
12
|
-
const insertMany = async (docs, options = {}) => {
|
|
13
|
-
await collection.connectionPromise;
|
|
14
|
-
for (let index = 0; index < docs.length; index++) {
|
|
15
|
-
let doc = (0, lodash_1.cloneDeep)(docs[index]);
|
|
16
|
-
if (!doc || !(0, isPlainObject_1.default)(doc)) {
|
|
17
|
-
throw new Error(`Item at index ${index} is not a document`);
|
|
18
|
-
}
|
|
19
|
-
if (!doc._id) {
|
|
20
|
-
doc._id = collection.generateId();
|
|
21
|
-
}
|
|
22
|
-
if (collection.schema) {
|
|
23
|
-
const schema = collection.getSchema();
|
|
24
|
-
doc = await (0, schema_1.clean)(schema, (0, fromDot_1.default)(doc));
|
|
25
|
-
await (0, schema_1.validate)(schema, doc);
|
|
26
|
-
}
|
|
27
|
-
docs[index] = doc;
|
|
28
|
-
}
|
|
29
|
-
const { insertedIds } = await (0, wrapErrors_1.wrapErrors)(() => {
|
|
30
|
-
return collection.rawCollection.insertMany(docs, options.mongoOptions);
|
|
31
|
-
});
|
|
32
|
-
const ids = (0, lodash_1.values)(insertedIds);
|
|
33
|
-
return ids.map(id => id.toString());
|
|
34
|
-
};
|
|
35
|
-
return insertMany;
|
|
36
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|