@volare.finance/nestjs.plugins 2.0.0-alpha.7 → 2.0.0-alpha.8
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.
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { AwsConfig } from './aws.config';
|
|
6
6
|
export declare class AwsService {
|
|
7
7
|
private readonly constant;
|
|
8
|
-
private readonly
|
|
8
|
+
private readonly instance;
|
|
9
9
|
constructor(constant: AwsConfig);
|
|
10
10
|
putObject(file: any, filename: string, mimetype?: string): Promise<string>;
|
|
11
11
|
getObjectToString(filename: string): Promise<string>;
|
package/dist/aws/aws.service.js
CHANGED
|
@@ -12,7 +12,7 @@ let AwsService = class AwsService {
|
|
|
12
12
|
constructor(constant) {
|
|
13
13
|
this.constant = constant;
|
|
14
14
|
if (constant.aws?.enabled) {
|
|
15
|
-
this.
|
|
15
|
+
this.instance = new client_s3_1.S3({
|
|
16
16
|
region: constant.aws.region,
|
|
17
17
|
credentials: {
|
|
18
18
|
accessKeyId: constant.aws.accessKeyId,
|
|
@@ -25,7 +25,7 @@ let AwsService = class AwsService {
|
|
|
25
25
|
if (!this.constant.aws?.enabled) {
|
|
26
26
|
throw new common_1.HttpException('This feature is not supported', common_1.HttpStatus.NOT_IMPLEMENTED);
|
|
27
27
|
}
|
|
28
|
-
const result = await this.
|
|
28
|
+
const result = await this.instance.putObject({
|
|
29
29
|
Key: filename,
|
|
30
30
|
Body: file,
|
|
31
31
|
ContentType: mimetype,
|
|
@@ -41,7 +41,7 @@ let AwsService = class AwsService {
|
|
|
41
41
|
if (!this.constant.aws?.enabled) {
|
|
42
42
|
throw new common_1.HttpException('This feature is not supported', common_1.HttpStatus.NOT_IMPLEMENTED);
|
|
43
43
|
}
|
|
44
|
-
const result = await this.
|
|
44
|
+
const result = await this.instance.getObject({
|
|
45
45
|
Key: filename,
|
|
46
46
|
Bucket: this.constant.aws.bucket,
|
|
47
47
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aws.service.js","sourceRoot":"","sources":["../../src/aws/aws.service.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,kDAAwC;AACxC,2CAA+E;AAIxE,IAAM,UAAU,GAAhB,MAAM,UAAU;IAKrB,YAAoD,QAAmB;QAAnB,aAAQ,GAAR,QAAQ,CAAW;QACrE,IAAI,QAAQ,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC;YAC1B,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"aws.service.js","sourceRoot":"","sources":["../../src/aws/aws.service.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,kDAAwC;AACxC,2CAA+E;AAIxE,IAAM,UAAU,GAAhB,MAAM,UAAU;IAKrB,YAAoD,QAAmB;QAAnB,aAAQ,GAAR,QAAQ,CAAW;QACrE,IAAI,QAAQ,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC;YAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,cAAE,CAAC;gBACrB,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM;gBAC3B,WAAW,EAAE;oBACX,WAAW,EAAE,QAAQ,CAAC,GAAG,CAAC,WAAW;oBACrC,eAAe,EAAE,QAAQ,CAAC,GAAG,CAAC,eAAe;iBAC9C;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,IAAS,EAAE,QAAgB,EAAE,QAAiB;QAC5D,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC;YAChC,MAAM,IAAI,sBAAa,CAAC,+BAA+B,EAAE,mBAAU,CAAC,eAAe,CAAC,CAAC;QACvF,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;YAC3C,GAAG,EAAE,QAAQ;YACb,IAAI,EAAE,IAAI;YACV,WAAW,EAAE,QAAQ;YACrB,MAAM,EAAE,IAAI,CA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FAULT_PROJECTION = "-_id -__v";
|
|
7
|
+
export declare const DEFAULT_PROJECTION_OBJECT: {
|
|
8
|
+
_id: number;
|
|
9
|
+
__v: number;
|
|
10
|
+
};
|
|
7
11
|
export declare class MongoService {
|
|
8
12
|
static find(query: any, filter: FilterDto): Promise<any[]>;
|
|
9
13
|
static aggregate(aggregate2: any, filter: FilterDto): any;
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* @date 2023
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.MongoService = exports.DEFAULT_PROJECTION = void 0;
|
|
7
|
+
exports.MongoService = exports.DEFAULT_PROJECTION_OBJECT = exports.DEFAULT_PROJECTION = void 0;
|
|
8
8
|
exports.DEFAULT_PROJECTION = '-_id -__v';
|
|
9
|
+
exports.DEFAULT_PROJECTION_OBJECT = { _id: 0, __v: 0 };
|
|
9
10
|
class MongoService {
|
|
10
11
|
static async find(query, filter) {
|
|
11
12
|
if (filter.where && Object.keys(filter.where).length) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mongo.service.js","sourceRoot":"","sources":["../../src/mongo/mongo.service.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIU,QAAA,kBAAkB,GAAG,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"mongo.service.js","sourceRoot":"","sources":["../../src/mongo/mongo.service.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIU,QAAA,kBAAkB,GAAG,WAAW,CAAC;AAEjC,QAAA,yBAAyB,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;AAE5D,MAAa,YAAY;IACvB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAU,EAAE,MAAiB;QAC7C,IAAI,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;YACrD,K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