@smartsoft001/mongo 2.68.0 → 2.70.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/package.json +1 -1
- package/project.json +2 -2
- package/src/lib/mongo.module.ts +1 -0
- package/src/lib/mongo.unitofwork.ts +2 -1
- package/src/lib/repositories/attachment.repository.spec.ts +2 -1
- package/src/lib/repositories/attachment.repository.ts +3 -2
- package/src/lib/repositories/item.repository.ts +10 -9
package/package.json
CHANGED
package/project.json
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
|
|
4
4
|
"sourceRoot": "packages/shared/mongo/src",
|
|
5
5
|
"projectType": "library",
|
|
6
|
+
"tags": ["scope:shared", "type:util"],
|
|
6
7
|
"generators": {},
|
|
7
8
|
"targets": {
|
|
8
9
|
"lint": {
|
|
@@ -43,6 +44,5 @@
|
|
|
43
44
|
},
|
|
44
45
|
"dependsOn": ["build"]
|
|
45
46
|
}
|
|
46
|
-
}
|
|
47
|
-
"tags": ["scope:shared", "type:util"]
|
|
47
|
+
}
|
|
48
48
|
}
|
package/src/lib/mongo.module.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Injectable } from '@nestjs/common';
|
|
2
|
-
import { ITransaction, IUnitOfWork } from '@smartsoft001/domain-core';
|
|
3
2
|
import { ClientSession, MongoClient, TransactionOptions } from 'mongodb';
|
|
4
3
|
|
|
4
|
+
import { ITransaction, IUnitOfWork } from '@smartsoft001/domain-core';
|
|
5
|
+
|
|
5
6
|
import { MongoConfig } from './mongo.module';
|
|
6
7
|
import { getMongoUrl } from './mongo.utils';
|
|
7
8
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { IEntity } from '@smartsoft001/domain-core';
|
|
2
1
|
import { MongoClient, GridFSBucket } from 'mongodb';
|
|
3
2
|
|
|
3
|
+
import { IEntity } from '@smartsoft001/domain-core';
|
|
4
|
+
|
|
4
5
|
import { Readable } from 'stream';
|
|
5
6
|
|
|
6
7
|
import { MongoAttachmentRepository } from './attachment.repository';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Injectable } from '@nestjs/common';
|
|
2
|
-
import { IEntity, IAttachmentRepository } from '@smartsoft001/domain-core';
|
|
3
2
|
import { MongoClient } from 'mongodb';
|
|
4
3
|
import * as mongo from 'mongodb';
|
|
5
4
|
|
|
5
|
+
import { IEntity, IAttachmentRepository } from '@smartsoft001/domain-core';
|
|
6
|
+
|
|
6
7
|
import { Readable, Stream } from 'stream';
|
|
7
8
|
|
|
8
9
|
import { MongoConfig } from '../mongo.module';
|
|
@@ -44,7 +45,7 @@ export class MongoAttachmentRepository<
|
|
|
44
45
|
|
|
45
46
|
if (options?.streamCallback) options.streamCallback(writeStream);
|
|
46
47
|
|
|
47
|
-
data.stream.pipe(writeStream);
|
|
48
|
+
data.stream.pipe(writeStream as any);
|
|
48
49
|
|
|
49
50
|
writeStream.on('error', (error) => {
|
|
50
51
|
rej(error);
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
import { Injectable } from '@nestjs/common';
|
|
2
|
-
import {
|
|
3
|
-
IEntity,
|
|
4
|
-
IItemRepository,
|
|
5
|
-
IItemRepositoryOptions,
|
|
6
|
-
ISpecification,
|
|
7
|
-
} from '@smartsoft001/domain-core';
|
|
8
|
-
import { getModelFieldsWithOptions } from '@smartsoft001/models';
|
|
9
|
-
import { IUser } from '@smartsoft001/users';
|
|
10
|
-
import { ObjectService } from '@smartsoft001/utils';
|
|
11
2
|
import {
|
|
12
3
|
ChangeStream,
|
|
13
4
|
Collection,
|
|
@@ -19,6 +10,16 @@ import {
|
|
|
19
10
|
import { Observable, Observer } from 'rxjs';
|
|
20
11
|
import { finalize, share } from 'rxjs/operators';
|
|
21
12
|
|
|
13
|
+
import {
|
|
14
|
+
IEntity,
|
|
15
|
+
IItemRepository,
|
|
16
|
+
IItemRepositoryOptions,
|
|
17
|
+
ISpecification,
|
|
18
|
+
} from '@smartsoft001/domain-core';
|
|
19
|
+
import { getModelFieldsWithOptions } from '@smartsoft001/models';
|
|
20
|
+
import { IUser } from '@smartsoft001/users';
|
|
21
|
+
import { ObjectService } from '@smartsoft001/utils';
|
|
22
|
+
|
|
22
23
|
import { MongoConfig } from '../mongo.module';
|
|
23
24
|
import { IMongoTransaction } from '../mongo.unitofwork';
|
|
24
25
|
import { getMongoUrl } from '../mongo.utils';
|