prime-sdk 1.4.0 → 1.4.2
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 +2 -2
- package/src/external/aws/sqs/sqs.service.ts +1 -17
- package/src/lib/queue/interfaces/queue.interface.ts +1 -2
- package/src/lib/queue/queue.ts +6 -24
- package/src/lib/queue/types/queue.type.ts +0 -3
- package/dist/app.module.d.ts +0 -2
- package/dist/app.module.js +0 -82
- package/dist/app.module.js.map +0 -1
- package/dist/app.service.d.ts +0 -15
- package/dist/app.service.js +0 -68
- package/dist/app.service.js.map +0 -1
- package/dist/external/aws/kms/kms.provider.d.ts +0 -12
- package/dist/external/aws/kms/kms.provider.js +0 -31
- package/dist/external/aws/kms/kms.provider.js.map +0 -1
- package/dist/external/aws/kms/kms.service.d.ts +0 -9
- package/dist/external/aws/kms/kms.service.js +0 -43
- package/dist/external/aws/kms/kms.service.js.map +0 -1
- package/dist/external/aws/s3/s3.provider.d.ts +0 -12
- package/dist/external/aws/s3/s3.provider.js +0 -31
- package/dist/external/aws/s3/s3.provider.js.map +0 -1
- package/dist/external/aws/s3/s3.service.d.ts +0 -14
- package/dist/external/aws/s3/s3.service.js +0 -87
- package/dist/external/aws/s3/s3.service.js.map +0 -1
- package/dist/external/aws/ses/ses.provider.d.ts +0 -12
- package/dist/external/aws/ses/ses.provider.js +0 -31
- package/dist/external/aws/ses/ses.provider.js.map +0 -1
- package/dist/external/aws/ses/ses.service.d.ts +0 -9
- package/dist/external/aws/ses/ses.service.js +0 -60
- package/dist/external/aws/ses/ses.service.js.map +0 -1
- package/dist/external/aws/sns/sns.provider.d.ts +0 -12
- package/dist/external/aws/sns/sns.provider.js +0 -31
- package/dist/external/aws/sns/sns.provider.js.map +0 -1
- package/dist/external/aws/sns/sns.service.d.ts +0 -9
- package/dist/external/aws/sns/sns.service.js +0 -43
- package/dist/external/aws/sns/sns.service.js.map +0 -1
- package/dist/external/aws/sqs/sqs.provider.d.ts +0 -12
- package/dist/external/aws/sqs/sqs.provider.js +0 -31
- package/dist/external/aws/sqs/sqs.provider.js.map +0 -1
- package/dist/external/aws/sqs/sqs.service.d.ts +0 -20
- package/dist/external/aws/sqs/sqs.service.js +0 -65
- package/dist/external/aws/sqs/sqs.service.js.map +0 -1
- package/dist/external/redis/interfaces/redis.interface.d.ts +0 -7
- package/dist/external/redis/interfaces/redis.interface.js +0 -5
- package/dist/external/redis/interfaces/redis.interface.js.map +0 -1
- package/dist/external/redis/redis.provider.d.ts +0 -5
- package/dist/external/redis/redis.provider.js +0 -46
- package/dist/external/redis/redis.provider.js.map +0 -1
- package/dist/external/redis/redis.service.d.ts +0 -10
- package/dist/external/redis/redis.service.js +0 -45
- package/dist/external/redis/redis.service.js.map +0 -1
- package/dist/external/redis/types/ioredis.types.d.ts +0 -19
- package/dist/external/redis/types/ioredis.types.js +0 -9
- package/dist/external/redis/types/ioredis.types.js.map +0 -1
- package/dist/index.d.ts +0 -20
- package/dist/index.js +0 -42
- package/dist/index.js.map +0 -1
- package/dist/lib/cache/cache.d.ts +0 -10
- package/dist/lib/cache/cache.js +0 -38
- package/dist/lib/cache/cache.js.map +0 -1
- package/dist/lib/cache/cache.module.d.ts +0 -5
- package/dist/lib/cache/cache.module.js +0 -37
- package/dist/lib/cache/cache.module.js.map +0 -1
- package/dist/lib/cache/interfaces/cache.interface.d.ts +0 -7
- package/dist/lib/cache/interfaces/cache.interface.js +0 -5
- package/dist/lib/cache/interfaces/cache.interface.js.map +0 -1
- package/dist/lib/crypto/crypto.d.ts +0 -9
- package/dist/lib/crypto/crypto.js +0 -35
- package/dist/lib/crypto/crypto.js.map +0 -1
- package/dist/lib/crypto/crypto.module.d.ts +0 -5
- package/dist/lib/crypto/crypto.module.js +0 -30
- package/dist/lib/crypto/crypto.module.js.map +0 -1
- package/dist/lib/crypto/interfaces/crypto.interface.d.ts +0 -7
- package/dist/lib/crypto/interfaces/crypto.interface.js +0 -5
- package/dist/lib/crypto/interfaces/crypto.interface.js.map +0 -1
- package/dist/lib/crypto/types/crypto.type.d.ts +0 -9
- package/dist/lib/crypto/types/crypto.type.js +0 -3
- package/dist/lib/crypto/types/crypto.type.js.map +0 -1
- package/dist/lib/email/email.d.ts +0 -9
- package/dist/lib/email/email.js +0 -35
- package/dist/lib/email/email.js.map +0 -1
- package/dist/lib/email/email.module.d.ts +0 -5
- package/dist/lib/email/email.module.js +0 -30
- package/dist/lib/email/email.module.js.map +0 -1
- package/dist/lib/email/interfaces/email.interface.d.ts +0 -7
- package/dist/lib/email/interfaces/email.interface.js +0 -5
- package/dist/lib/email/interfaces/email.interface.js.map +0 -1
- package/dist/lib/email/types/email.type.d.ts +0 -11
- package/dist/lib/email/types/email.type.js +0 -3
- package/dist/lib/email/types/email.type.js.map +0 -1
- package/dist/lib/events/event.module.d.ts +0 -5
- package/dist/lib/events/event.module.js +0 -30
- package/dist/lib/events/event.module.js.map +0 -1
- package/dist/lib/events/events.d.ts +0 -9
- package/dist/lib/events/events.js +0 -35
- package/dist/lib/events/events.js.map +0 -1
- package/dist/lib/events/interfaces/event.interface.d.ts +0 -7
- package/dist/lib/events/interfaces/event.interface.js +0 -5
- package/dist/lib/events/interfaces/event.interface.js.map +0 -1
- package/dist/lib/events/types/event.type.d.ts +0 -8
- package/dist/lib/events/types/event.type.js +0 -3
- package/dist/lib/events/types/event.type.js.map +0 -1
- package/dist/lib/queue/interfaces/consumer.interface.d.ts +0 -6
- package/dist/lib/queue/interfaces/consumer.interface.js +0 -5
- package/dist/lib/queue/interfaces/consumer.interface.js.map +0 -1
- package/dist/lib/queue/interfaces/queue.interface.d.ts +0 -13
- package/dist/lib/queue/interfaces/queue.interface.js +0 -5
- package/dist/lib/queue/interfaces/queue.interface.js.map +0 -1
- package/dist/lib/queue/queue.d.ts +0 -18
- package/dist/lib/queue/queue.js +0 -88
- package/dist/lib/queue/queue.js.map +0 -1
- package/dist/lib/queue/queue.module.d.ts +0 -5
- package/dist/lib/queue/queue.module.js +0 -30
- package/dist/lib/queue/queue.module.js.map +0 -1
- package/dist/lib/queue/types/queue.type.d.ts +0 -10
- package/dist/lib/queue/types/queue.type.js +0 -3
- package/dist/lib/queue/types/queue.type.js.map +0 -1
- package/dist/lib/storage/interfaces/storage.interface.d.ts +0 -12
- package/dist/lib/storage/interfaces/storage.interface.js +0 -5
- package/dist/lib/storage/interfaces/storage.interface.js.map +0 -1
- package/dist/lib/storage/storage.d.ts +0 -14
- package/dist/lib/storage/storage.js +0 -50
- package/dist/lib/storage/storage.js.map +0 -1
- package/dist/lib/storage/storage.module.d.ts +0 -5
- package/dist/lib/storage/storage.module.js +0 -30
- package/dist/lib/storage/storage.module.js.map +0 -1
- package/dist/lib/storage/types/storage.type.d.ts +0 -34
- package/dist/lib/storage/types/storage.type.js +0 -3
- package/dist/lib/storage/types/storage.type.js.map +0 -1
- package/dist/main.d.ts +0 -1
- package/dist/main.js +0 -10
- package/dist/main.js.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ses.provider.js","sourceRoot":"","sources":["../../../../src/external/aws/ses/ses.provider.ts"],"names":[],"mappings":";;;AAAA,oDAAgD;AAYhD,MAAM,WAAW,GAAG,CAAC,MAAgB,EAAE,EAAE;IACvC,OAAO;QACL,OAAO,EAAE,gBAAgB;QACzB,UAAU,EAAE,GAAG,EAAE;YACf,OAAO,IAAI,sBAAS,CAAC;gBACnB,WAAW,EAAE;oBACX,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,WAAW;oBAC3C,eAAe,EAAE,MAAM,CAAC,WAAW,CAAC,eAAe;iBACpD;gBACD,GAAG,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACrD,MAAM,EAAE,MAAM,CAAC,MAAM;aACtB,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAa,SAAS;IACpB,MAAM,CAAC,OAAO,CAAC,MAAgB;QAC7B,MAAM,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;QAExC,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,SAAS,EAAE,CAAC,WAAW,CAAC;YACxB,OAAO,EAAE,CAAC,WAAW,CAAC;SACvB,CAAC;IACJ,CAAC;CACF;AAVD,8BAUC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SendEmailCommandOutput, SendRawEmailCommandOutput, SESClient } from '@aws-sdk/client-ses';
|
|
2
|
-
import { IEmail } from 'src/lib/email/interfaces/email.interface';
|
|
3
|
-
import { SendMail, SendRawMail } from 'src/lib/email/types/email.type';
|
|
4
|
-
export declare class SES implements IEmail {
|
|
5
|
-
private readonly client;
|
|
6
|
-
constructor(client: SESClient);
|
|
7
|
-
sendRawEmail(data: SendRawMail): Promise<SendRawEmailCommandOutput>;
|
|
8
|
-
sendEmail(data: SendMail): Promise<SendEmailCommandOutput>;
|
|
9
|
-
}
|
|
@@ -1,60 +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 __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.SES = void 0;
|
|
16
|
-
const common_1 = require("@nestjs/common");
|
|
17
|
-
const client_ses_1 = require("@aws-sdk/client-ses");
|
|
18
|
-
let SES = class SES {
|
|
19
|
-
constructor(client) {
|
|
20
|
-
this.client = client;
|
|
21
|
-
}
|
|
22
|
-
async sendRawEmail(data) {
|
|
23
|
-
const resEncodedMessage = new TextEncoder().encode(data.message);
|
|
24
|
-
const params = {
|
|
25
|
-
Source: data.from,
|
|
26
|
-
Destination: data.to,
|
|
27
|
-
RawMessage: {
|
|
28
|
-
Data: resEncodedMessage,
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
const command = new client_ses_1.SendRawEmailCommand(params);
|
|
32
|
-
return await this.client.send(command);
|
|
33
|
-
}
|
|
34
|
-
async sendEmail(data) {
|
|
35
|
-
const command = new client_ses_1.SendEmailCommand({
|
|
36
|
-
Source: data.source,
|
|
37
|
-
Destination: { ToAddresses: data.destination },
|
|
38
|
-
Message: {
|
|
39
|
-
Body: {
|
|
40
|
-
Html: {
|
|
41
|
-
Charset: 'UTF-8',
|
|
42
|
-
Data: data.message,
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
Subject: {
|
|
46
|
-
Charset: 'UTF-8',
|
|
47
|
-
Data: data.subject,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
return await this.client.send(command);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
exports.SES = SES;
|
|
55
|
-
exports.SES = SES = __decorate([
|
|
56
|
-
(0, common_1.Injectable)(),
|
|
57
|
-
__param(0, (0, common_1.Inject)('CONNECTION_SES')),
|
|
58
|
-
__metadata("design:paramtypes", [client_ses_1.SESClient])
|
|
59
|
-
], SES);
|
|
60
|
-
//# sourceMappingURL=ses.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ses.service.js","sourceRoot":"","sources":["../../../../src/external/aws/ses/ses.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoD;AACpD,oDAM6B;AAKtB,IAAM,GAAG,GAAT,MAAM,GAAG;IACd,YAAuD,MAAiB;QAAjB,WAAM,GAAN,MAAM,CAAW;IAAG,CAAC;IAE5E,KAAK,CAAC,YAAY,CAAC,IAAiB;QAClC,MAAM,iBAAiB,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAEjE,MAAM,MAAM,GAAG;YACb,MAAM,EAAE,IAAI,CAAC,IAAI;YACjB,WAAW,EAAE,IAAI,CAAC,EAAE;YACpB,UAAU,EAAE;gBACV,IAAI,EAAE,iBAAiB;aACxB;SACF,CAAC;QAEF,MAAM,OAAO,GAAG,IAAI,gCAAmB,CAAC,MAAM,CAAC,CAAC;QAEhD,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,IAAc;QAC5B,MAAM,OAAO,GAAG,IAAI,6BAAgB,CAAC;YACnC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,WAAW,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE;YAC9C,OAAO,EAAE;gBACP,IAAI,EAAE;oBACJ,IAAI,EAAE;wBACJ,OAAO,EAAE,OAAO;wBAChB,IAAI,EAAE,IAAI,CAAC,OAAO;qBACnB;iBACF;gBACD,OAAO,EAAE;oBACP,OAAO,EAAE,OAAO;oBAChB,IAAI,EAAE,IAAI,CAAC,OAAO;iBACnB;aACF;SACF,CAAC,CAAC;QAEH,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;CACF,CAAA;AAvCY,kBAAG;cAAH,GAAG;IADf,IAAA,mBAAU,GAAE;IAEE,WAAA,IAAA,eAAM,EAAC,gBAAgB,CAAC,CAAA;qCAA0B,sBAAS;GAD7D,GAAG,CAuCf"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DynamicModule } from '@nestjs/common';
|
|
2
|
-
export type SNSSetup = {
|
|
3
|
-
region: string;
|
|
4
|
-
endpoint?: string;
|
|
5
|
-
credentials: {
|
|
6
|
-
accessKeyId: string;
|
|
7
|
-
secretAccessKey: string;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
export declare class SNSModule {
|
|
11
|
-
static forRoot(params: SNSSetup): DynamicModule;
|
|
12
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SNSModule = void 0;
|
|
4
|
-
const client_sns_1 = require("@aws-sdk/client-sns");
|
|
5
|
-
const SNSProvider = (params) => {
|
|
6
|
-
return {
|
|
7
|
-
provide: 'CONNECTION_SNS',
|
|
8
|
-
useFactory: () => {
|
|
9
|
-
return new client_sns_1.SNSClient({
|
|
10
|
-
credentials: {
|
|
11
|
-
accessKeyId: params.credentials.accessKeyId,
|
|
12
|
-
secretAccessKey: params.credentials.secretAccessKey,
|
|
13
|
-
},
|
|
14
|
-
...(params.endpoint && { endpoint: params.endpoint }),
|
|
15
|
-
region: params.region,
|
|
16
|
-
});
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
class SNSModule {
|
|
21
|
-
static forRoot(params) {
|
|
22
|
-
const snsProvider = SNSProvider(params);
|
|
23
|
-
return {
|
|
24
|
-
module: SNSModule,
|
|
25
|
-
providers: [snsProvider],
|
|
26
|
-
exports: [snsProvider],
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.SNSModule = SNSModule;
|
|
31
|
-
//# sourceMappingURL=sns.provider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sns.provider.js","sourceRoot":"","sources":["../../../../src/external/aws/sns/sns.provider.ts"],"names":[],"mappings":";;;AAAA,oDAAgD;AAYhD,MAAM,WAAW,GAAG,CAAC,MAAgB,EAAE,EAAE;IACvC,OAAO;QACL,OAAO,EAAE,gBAAgB;QACzB,UAAU,EAAE,GAAG,EAAE;YACf,OAAO,IAAI,sBAAS,CAAC;gBACnB,WAAW,EAAE;oBACX,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,WAAW;oBAC3C,eAAe,EAAE,MAAM,CAAC,WAAW,CAAC,eAAe;iBACpD;gBACD,GAAG,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACrD,MAAM,EAAE,MAAM,CAAC,MAAM;aACtB,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAa,SAAS;IACpB,MAAM,CAAC,OAAO,CAAC,MAAgB;QAC7B,MAAM,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;QAExC,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,SAAS,EAAE,CAAC,WAAW,CAAC;YACxB,OAAO,EAAE,CAAC,WAAW,CAAC;SACvB,CAAC;IACJ,CAAC;CACF;AAVD,8BAUC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { PublishCommandOutput, SNSClient } from '@aws-sdk/client-sns';
|
|
2
|
-
import { IEvent } from 'src/lib/events/interfaces/event.interface';
|
|
3
|
-
import { EventData, EventSmsData } from 'src/lib/events/types/event.type';
|
|
4
|
-
export declare class Sns implements IEvent {
|
|
5
|
-
private readonly client;
|
|
6
|
-
constructor(client: SNSClient);
|
|
7
|
-
publishSns(event: EventData): Promise<PublishCommandOutput>;
|
|
8
|
-
publishSms(event: EventSmsData): Promise<PublishCommandOutput>;
|
|
9
|
-
}
|
|
@@ -1,43 +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 __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.Sns = void 0;
|
|
16
|
-
const client_sns_1 = require("@aws-sdk/client-sns");
|
|
17
|
-
const common_1 = require("@nestjs/common");
|
|
18
|
-
let Sns = class Sns {
|
|
19
|
-
constructor(client) {
|
|
20
|
-
this.client = client;
|
|
21
|
-
}
|
|
22
|
-
async publishSns(event) {
|
|
23
|
-
const command = new client_sns_1.PublishCommand({
|
|
24
|
-
TopicArn: event.topic,
|
|
25
|
-
Message: event.message,
|
|
26
|
-
});
|
|
27
|
-
return await this.client.send(command);
|
|
28
|
-
}
|
|
29
|
-
async publishSms(event) {
|
|
30
|
-
const command = new client_sns_1.PublishCommand({
|
|
31
|
-
PhoneNumber: event.phoneNumber,
|
|
32
|
-
Message: event.message,
|
|
33
|
-
});
|
|
34
|
-
return await this.client.send(command);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
exports.Sns = Sns;
|
|
38
|
-
exports.Sns = Sns = __decorate([
|
|
39
|
-
(0, common_1.Injectable)(),
|
|
40
|
-
__param(0, (0, common_1.Inject)('CONNECTION_SNS')),
|
|
41
|
-
__metadata("design:paramtypes", [client_sns_1.SNSClient])
|
|
42
|
-
], Sns);
|
|
43
|
-
//# sourceMappingURL=sns.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sns.service.js","sourceRoot":"","sources":["../../../../src/external/aws/sns/sns.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAI6B;AAC7B,2CAAoD;AAK7C,IAAM,GAAG,GAAT,MAAM,GAAG;IACd,YAAuD,MAAiB;QAAjB,WAAM,GAAN,MAAM,CAAW;IAAG,CAAC;IAE5E,KAAK,CAAC,UAAU,CAAC,KAAgB;QAC/B,MAAM,OAAO,GAAG,IAAI,2BAAc,CAAC;YACjC,QAAQ,EAAE,KAAK,CAAC,KAAK;YACrB,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC,CAAC;QAEH,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,KAAmB;QAClC,MAAM,OAAO,GAAG,IAAI,2BAAc,CAAC;YACjC,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC,CAAC;QAEH,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;CACF,CAAA;AApBY,kBAAG;cAAH,GAAG;IADf,IAAA,mBAAU,GAAE;IAEE,WAAA,IAAA,eAAM,EAAC,gBAAgB,CAAC,CAAA;qCAA0B,sBAAS;GAD7D,GAAG,CAoBf"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DynamicModule } from '@nestjs/common';
|
|
2
|
-
export type SqsSetup = {
|
|
3
|
-
region: string;
|
|
4
|
-
endpoint: string;
|
|
5
|
-
credentials: {
|
|
6
|
-
accessKeyId: string;
|
|
7
|
-
secretAccessKey: string;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
export declare class SqsModule {
|
|
11
|
-
static forRoot(params: SqsSetup): DynamicModule;
|
|
12
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SqsModule = void 0;
|
|
4
|
-
const client_sqs_1 = require("@aws-sdk/client-sqs");
|
|
5
|
-
const SqsProvider = (params) => {
|
|
6
|
-
return {
|
|
7
|
-
provide: 'CONNECTION_SQS',
|
|
8
|
-
useFactory: () => {
|
|
9
|
-
return new client_sqs_1.SQSClient({
|
|
10
|
-
region: params.region,
|
|
11
|
-
endpoint: params.endpoint,
|
|
12
|
-
credentials: {
|
|
13
|
-
accessKeyId: params.credentials.accessKeyId,
|
|
14
|
-
secretAccessKey: params.credentials.secretAccessKey,
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
class SqsModule {
|
|
21
|
-
static forRoot(params) {
|
|
22
|
-
const sqsProvider = SqsProvider(params);
|
|
23
|
-
return {
|
|
24
|
-
module: SqsModule,
|
|
25
|
-
providers: [sqsProvider],
|
|
26
|
-
exports: [sqsProvider],
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.SqsModule = SqsModule;
|
|
31
|
-
//# sourceMappingURL=sqs.provider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sqs.provider.js","sourceRoot":"","sources":["../../../../src/external/aws/sqs/sqs.provider.ts"],"names":[],"mappings":";;;AAAA,oDAAgD;AAYhD,MAAM,WAAW,GAAG,CAAC,MAAgB,EAAE,EAAE;IACvC,OAAO;QACL,OAAO,EAAE,gBAAgB;QACzB,UAAU,EAAE,GAAG,EAAE;YACf,OAAO,IAAI,sBAAS,CAAC;gBACnB,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,WAAW,EAAE;oBACX,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,WAAW;oBAC3C,eAAe,EAAE,MAAM,CAAC,WAAW,CAAC,eAAe;iBACpD;aACF,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAa,SAAS;IACpB,MAAM,CAAC,OAAO,CAAC,MAAgB;QAC7B,MAAM,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;QAExC,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,SAAS,EAAE,CAAC,WAAW,CAAC;YACxB,OAAO,EAAE,CAAC,WAAW,CAAC;SACvB,CAAC;IACJ,CAAC;CACF;AAVD,8BAUC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { DeleteMessageCommand, ReceiveMessageCommand, ReceiveMessageResult, SQSClient } from '@aws-sdk/client-sqs';
|
|
2
|
-
import { IQueue } from 'src/lib/queue/interfaces/queue.interface';
|
|
3
|
-
export declare class Sqs implements IQueue {
|
|
4
|
-
private readonly client;
|
|
5
|
-
private queueUrl;
|
|
6
|
-
private bulk;
|
|
7
|
-
private waitTimeSeconds;
|
|
8
|
-
private AttributeNames;
|
|
9
|
-
constructor(client: SQSClient);
|
|
10
|
-
setup({ waitTimeSeconds, bulk, queueUrl, AttributeNames }: {
|
|
11
|
-
waitTimeSeconds: any;
|
|
12
|
-
bulk: any;
|
|
13
|
-
queueUrl: any;
|
|
14
|
-
AttributeNames: any;
|
|
15
|
-
}): void;
|
|
16
|
-
sendCommand(command: ReceiveMessageCommand | DeleteMessageCommand): Promise<unknown>;
|
|
17
|
-
receiveMessages(): Promise<ReceiveMessageResult>;
|
|
18
|
-
receiveMessagesV2(): Promise<ReceiveMessageResult>;
|
|
19
|
-
deleteMessage(receiptHandle: any): Promise<unknown>;
|
|
20
|
-
}
|
|
@@ -1,65 +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 __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.Sqs = void 0;
|
|
16
|
-
const client_sqs_1 = require("@aws-sdk/client-sqs");
|
|
17
|
-
const common_1 = require("@nestjs/common");
|
|
18
|
-
let Sqs = class Sqs {
|
|
19
|
-
constructor(client) {
|
|
20
|
-
this.client = client;
|
|
21
|
-
this.AttributeNames = [client_sqs_1.QueueAttributeName.All];
|
|
22
|
-
}
|
|
23
|
-
setup({ waitTimeSeconds, bulk, queueUrl, AttributeNames }) {
|
|
24
|
-
this.waitTimeSeconds = waitTimeSeconds;
|
|
25
|
-
this.bulk = bulk;
|
|
26
|
-
this.queueUrl = queueUrl;
|
|
27
|
-
this.AttributeNames = AttributeNames;
|
|
28
|
-
}
|
|
29
|
-
async sendCommand(command) {
|
|
30
|
-
return this.client.send(command);
|
|
31
|
-
}
|
|
32
|
-
async receiveMessages() {
|
|
33
|
-
const input = {
|
|
34
|
-
QueueUrl: this.queueUrl,
|
|
35
|
-
MaxNumberOfMessages: this.bulk,
|
|
36
|
-
WaitTimeSeconds: this.waitTimeSeconds,
|
|
37
|
-
};
|
|
38
|
-
const command = new client_sqs_1.ReceiveMessageCommand(input);
|
|
39
|
-
return (await this.sendCommand(command));
|
|
40
|
-
}
|
|
41
|
-
async receiveMessagesV2() {
|
|
42
|
-
const input = {
|
|
43
|
-
QueueUrl: this.queueUrl,
|
|
44
|
-
AttributeNames: this.AttributeNames,
|
|
45
|
-
MaxNumberOfMessages: this.bulk,
|
|
46
|
-
WaitTimeSeconds: this.waitTimeSeconds,
|
|
47
|
-
};
|
|
48
|
-
const command = new client_sqs_1.ReceiveMessageCommand(input);
|
|
49
|
-
return (await this.sendCommand(command));
|
|
50
|
-
}
|
|
51
|
-
async deleteMessage(receiptHandle) {
|
|
52
|
-
const deleteCommand = new client_sqs_1.DeleteMessageCommand({
|
|
53
|
-
QueueUrl: this.queueUrl,
|
|
54
|
-
ReceiptHandle: receiptHandle,
|
|
55
|
-
});
|
|
56
|
-
return await this.sendCommand(deleteCommand);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
exports.Sqs = Sqs;
|
|
60
|
-
exports.Sqs = Sqs = __decorate([
|
|
61
|
-
(0, common_1.Injectable)(),
|
|
62
|
-
__param(0, (0, common_1.Inject)('CONNECTION_SQS')),
|
|
63
|
-
__metadata("design:paramtypes", [client_sqs_1.SQSClient])
|
|
64
|
-
], Sqs);
|
|
65
|
-
//# sourceMappingURL=sqs.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sqs.service.js","sourceRoot":"","sources":["../../../../src/external/aws/sqs/sqs.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAM6B;AAC7B,2CAAoD;AAI7C,IAAM,GAAG,GAAT,MAAM,GAAG;IAMd,YAAsC,MAAkC;QAAjB,WAAM,GAAN,MAAM,CAAW;QAFhE,mBAAc,GAA8B,CAAC,+BAAkB,CAAC,GAAG,CAAC,CAAC;IAEF,CAAC;IAE5E,KAAK,CAAC,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE;QACvD,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,WAAW,CACf,OAAqD;QAErD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,MAAM,KAAK,GAAG;YACZ,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,mBAAmB,EAAE,IAAI,CAAC,IAAI;YAC9B,eAAe,EAAE,IAAI,CAAC,eAAe;SACtC,CAAC;QAEF,MAAM,OAAO,GAAG,IAAI,kCAAqB,CAAC,KAAK,CAAC,CAAC;QAEjD,OAAO,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAyB,CAAC;IACnE,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,MAAM,KAAK,GAAG;YACZ,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,mBAAmB,EAAE,IAAI,CAAC,IAAI;YAC9B,eAAe,EAAE,IAAI,CAAC,eAAe;SACtC,CAAC;QAEF,MAAM,OAAO,GAAG,IAAI,kCAAqB,CAAC,KAAK,CAAC,CAAC;QAEjD,OAAO,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAyB,CAAC;IACnE,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,aAAa;QAC/B,MAAM,aAAa,GAAG,IAAI,iCAAoB,CAAC;YAC7C,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,aAAa,EAAE,aAAa;SAC7B,CAAC,CAAC;QAEH,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;IAC/C,CAAC;CACF,CAAA;AAtDY,kBAAG;cAAH,GAAG;IADf,IAAA,mBAAU,GAAE;IAOE,WAAA,IAAA,eAAM,EAAC,gBAAgB,CAAC,CAAA;qCAA0B,sBAAS;GAN7D,GAAG,CAsDf"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
export interface IRedisService {
|
|
3
|
-
setRedisKey(key: string, value: Date | number | Buffer | string, ttl?: number): Promise<void>;
|
|
4
|
-
getRedisKey(key: string): Promise<string>;
|
|
5
|
-
deleteRedisKey(key: string): Promise<void>;
|
|
6
|
-
}
|
|
7
|
-
export declare const IRedisService: unique symbol;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"redis.interface.js","sourceRoot":"","sources":["../../../../src/external/redis/interfaces/redis.interface.ts"],"names":[],"mappings":";;;AAYa,QAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC"}
|
|
@@ -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 RedisModule_1;
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.RedisModule = void 0;
|
|
11
|
-
const common_1 = require("@nestjs/common");
|
|
12
|
-
const ioredis_1 = require("ioredis");
|
|
13
|
-
const ioredis_types_1 = require("./types/ioredis.types");
|
|
14
|
-
const RedisProvider = (params) => {
|
|
15
|
-
return {
|
|
16
|
-
provide: 'CONNECTION_REDIS',
|
|
17
|
-
useFactory: () => {
|
|
18
|
-
switch (params.type) {
|
|
19
|
-
case ioredis_types_1.TypeRedis.SIMPLE:
|
|
20
|
-
return new ioredis_1.Redis({
|
|
21
|
-
port: params.connection.port,
|
|
22
|
-
host: params.connection.host,
|
|
23
|
-
...(params.redisOptions && { ...params.redisOptions }),
|
|
24
|
-
});
|
|
25
|
-
case ioredis_types_1.TypeRedis.CLUSTER:
|
|
26
|
-
const cluster = new ioredis_1.Redis.Cluster(params.nodes, params.clusterOptions);
|
|
27
|
-
return cluster;
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
let RedisModule = RedisModule_1 = class RedisModule {
|
|
33
|
-
static forRoot(params) {
|
|
34
|
-
const redisProvider = RedisProvider(params);
|
|
35
|
-
return {
|
|
36
|
-
module: RedisModule_1,
|
|
37
|
-
providers: [redisProvider],
|
|
38
|
-
exports: [redisProvider],
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
exports.RedisModule = RedisModule;
|
|
43
|
-
exports.RedisModule = RedisModule = RedisModule_1 = __decorate([
|
|
44
|
-
(0, common_1.Module)({})
|
|
45
|
-
], RedisModule);
|
|
46
|
-
//# sourceMappingURL=redis.provider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"redis.provider.js","sourceRoot":"","sources":["../../../src/external/redis/redis.provider.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAuD;AACvD,qCAAyC;AACzC,yDAI+B;AAE/B,MAAM,aAAa,GAAG,CAAC,MAA4C,EAAE,EAAE;IACrE,OAAO;QACL,OAAO,EAAE,kBAAkB;QAC3B,UAAU,EAAE,GAAoB,EAAE;YAChC,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;gBACpB,KAAK,yBAAS,CAAC,MAAM;oBACnB,OAAO,IAAI,eAAK,CAAC;wBACf,IAAI,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI;wBAC5B,IAAI,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI;wBAC5B,GAAG,CAAC,MAAM,CAAC,YAAY,IAAI,EAAE,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC;qBACvD,CAAC,CAAC;gBACL,KAAK,yBAAS,CAAC,OAAO;oBACpB,MAAM,OAAO,GAAG,IAAI,eAAK,CAAC,OAAO,CAC/B,MAAM,CAAC,KAAK,EACZ,MAAM,CAAC,cAAc,CACtB,CAAC;oBACF,OAAO,OAAO,CAAC;YACnB,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAGK,IAAM,WAAW,mBAAjB,MAAM,WAAW;IACtB,MAAM,CAAC,OAAO,CAAC,MAA4C;QACzD,MAAM,aAAa,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;QAC5C,OAAO;YACL,MAAM,EAAE,aAAW;YACnB,SAAS,EAAE,CAAC,aAAa,CAAC;YAC1B,OAAO,EAAE,CAAC,aAAa,CAAC;SACzB,CAAC;IACJ,CAAC;CACF,CAAA;AATY,kCAAW;sBAAX,WAAW;IADvB,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,WAAW,CASvB"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Cluster, Redis } from 'ioredis';
|
|
3
|
-
import { IRedisService } from './interfaces/redis.interface';
|
|
4
|
-
export declare class RedisService implements IRedisService {
|
|
5
|
-
private readonly client;
|
|
6
|
-
constructor(client: Cluster | Redis);
|
|
7
|
-
setRedisKey(key: string, value: Date | number | Buffer | string, ttl?: number): Promise<void>;
|
|
8
|
-
getRedisKey(key: string): Promise<string>;
|
|
9
|
-
deleteRedisKey(key: string): Promise<void>;
|
|
10
|
-
}
|
|
@@ -1,45 +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 __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.RedisService = void 0;
|
|
16
|
-
const common_1 = require("@nestjs/common");
|
|
17
|
-
let RedisService = class RedisService {
|
|
18
|
-
constructor(client) {
|
|
19
|
-
this.client = client;
|
|
20
|
-
}
|
|
21
|
-
async setRedisKey(key, value, ttl) {
|
|
22
|
-
if (value instanceof Date) {
|
|
23
|
-
value = value.toISOString();
|
|
24
|
-
}
|
|
25
|
-
if (ttl) {
|
|
26
|
-
await this.client.set(key, value, 'EX', ttl);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
await this.client.set(key, value);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
async getRedisKey(key) {
|
|
33
|
-
return await this.client.get(key);
|
|
34
|
-
}
|
|
35
|
-
async deleteRedisKey(key) {
|
|
36
|
-
await this.client.del(key);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
exports.RedisService = RedisService;
|
|
40
|
-
exports.RedisService = RedisService = __decorate([
|
|
41
|
-
(0, common_1.Injectable)(),
|
|
42
|
-
__param(0, (0, common_1.Inject)('CONNECTION_REDIS')),
|
|
43
|
-
__metadata("design:paramtypes", [Object])
|
|
44
|
-
], RedisService);
|
|
45
|
-
//# sourceMappingURL=redis.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"redis.service.js","sourceRoot":"","sources":["../../../src/external/redis/redis.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoD;AAK7C,IAAM,YAAY,GAAlB,MAAM,YAAY;IACvB,YAC+C,MAAuB;QAAvB,WAAM,GAAN,MAAM,CAAiB;IACnE,CAAC;IAEJ,KAAK,CAAC,WAAW,CACf,GAAW,EACX,KAAsC,EACtC,GAAY;QAEZ,IAAI,KAAK,YAAY,IAAI,EAAE,CAAC;YAC1B,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;QAC9B,CAAC;QACD,IAAI,GAAG,EAAE,CAAC;YACR,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;QAC/C,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IACD,KAAK,CAAC,WAAW,CAAC,GAAW;QAC3B,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,GAAW;QAC9B,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;CACF,CAAA;AA1BY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,eAAM,EAAC,kBAAkB,CAAC,CAAA;;GAFlB,YAAY,CA0BxB"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ClusterOptions, RedisOptions } from 'ioredis';
|
|
2
|
-
export declare enum TypeRedis {
|
|
3
|
-
SIMPLE = "simple",
|
|
4
|
-
CLUSTER = "cluster"
|
|
5
|
-
}
|
|
6
|
-
export type Connection = {
|
|
7
|
-
port: number;
|
|
8
|
-
host: string;
|
|
9
|
-
};
|
|
10
|
-
export type SimpleRedisSetup = {
|
|
11
|
-
type: TypeRedis.SIMPLE;
|
|
12
|
-
connection: Connection;
|
|
13
|
-
redisOptions?: RedisOptions;
|
|
14
|
-
};
|
|
15
|
-
export type ClusterRedisSetup = {
|
|
16
|
-
type: TypeRedis.CLUSTER;
|
|
17
|
-
nodes: Connection[];
|
|
18
|
-
clusterOptions?: ClusterOptions;
|
|
19
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TypeRedis = void 0;
|
|
4
|
-
var TypeRedis;
|
|
5
|
-
(function (TypeRedis) {
|
|
6
|
-
TypeRedis["SIMPLE"] = "simple";
|
|
7
|
-
TypeRedis["CLUSTER"] = "cluster";
|
|
8
|
-
})(TypeRedis || (exports.TypeRedis = TypeRedis = {}));
|
|
9
|
-
//# sourceMappingURL=ioredis.types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ioredis.types.js","sourceRoot":"","sources":["../../../../src/external/redis/types/ioredis.types.ts"],"names":[],"mappings":";;;AAEA,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,8BAAiB,CAAA;IACjB,gCAAmB,CAAA;AACrB,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB"}
|
package/dist/index.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { QueueModule } from './lib/queue/queue.module';
|
|
2
|
-
import { Queue } from './lib/queue/queue';
|
|
3
|
-
import { IConsumer } from './lib/queue/interfaces/consumer.interface';
|
|
4
|
-
import { StorageModule } from './lib/storage/storage.module';
|
|
5
|
-
import { Storage } from './lib/storage/storage';
|
|
6
|
-
import { IStorage } from './lib/storage/interfaces/storage.interface';
|
|
7
|
-
import { EventModule } from './lib/events/event.module';
|
|
8
|
-
import { Events } from './lib/events/events';
|
|
9
|
-
import { IEvent } from './lib/events/interfaces/event.interface';
|
|
10
|
-
import { EmailModule } from './lib/email/email.module';
|
|
11
|
-
import { Email } from './lib/email/email';
|
|
12
|
-
import { IEmail } from './lib/email/interfaces/email.interface';
|
|
13
|
-
import { CryptoModule } from './lib/crypto/crypto.module';
|
|
14
|
-
import { Crypto } from './lib/crypto/crypto';
|
|
15
|
-
import { ICrypto } from './lib/crypto/interfaces/crypto.interface';
|
|
16
|
-
import { CacheModule } from './lib/cache/cache.module';
|
|
17
|
-
import { Cache } from './lib/cache/cache';
|
|
18
|
-
import { ICache } from './lib/cache/interfaces/cache.interface';
|
|
19
|
-
import { SimpleRedisSetup, ClusterRedisSetup, TypeRedis } from './external/redis/types/ioredis.types';
|
|
20
|
-
export { QueueModule, Queue, IConsumer, StorageModule, Storage, IStorage, EventModule, Events, IEvent, EmailModule, Email, IEmail, CryptoModule, Crypto, ICrypto, CacheModule, Cache, ICache, SimpleRedisSetup, ClusterRedisSetup, TypeRedis, };
|
package/dist/index.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TypeRedis = exports.ICache = exports.Cache = exports.CacheModule = exports.ICrypto = exports.Crypto = exports.CryptoModule = exports.IEmail = exports.Email = exports.EmailModule = exports.IEvent = exports.Events = exports.EventModule = exports.IStorage = exports.Storage = exports.StorageModule = exports.IConsumer = exports.Queue = exports.QueueModule = void 0;
|
|
4
|
-
const queue_module_1 = require("./lib/queue/queue.module");
|
|
5
|
-
Object.defineProperty(exports, "QueueModule", { enumerable: true, get: function () { return queue_module_1.QueueModule; } });
|
|
6
|
-
const queue_1 = require("./lib/queue/queue");
|
|
7
|
-
Object.defineProperty(exports, "Queue", { enumerable: true, get: function () { return queue_1.Queue; } });
|
|
8
|
-
const consumer_interface_1 = require("./lib/queue/interfaces/consumer.interface");
|
|
9
|
-
Object.defineProperty(exports, "IConsumer", { enumerable: true, get: function () { return consumer_interface_1.IConsumer; } });
|
|
10
|
-
const storage_module_1 = require("./lib/storage/storage.module");
|
|
11
|
-
Object.defineProperty(exports, "StorageModule", { enumerable: true, get: function () { return storage_module_1.StorageModule; } });
|
|
12
|
-
const storage_1 = require("./lib/storage/storage");
|
|
13
|
-
Object.defineProperty(exports, "Storage", { enumerable: true, get: function () { return storage_1.Storage; } });
|
|
14
|
-
const storage_interface_1 = require("./lib/storage/interfaces/storage.interface");
|
|
15
|
-
Object.defineProperty(exports, "IStorage", { enumerable: true, get: function () { return storage_interface_1.IStorage; } });
|
|
16
|
-
const event_module_1 = require("./lib/events/event.module");
|
|
17
|
-
Object.defineProperty(exports, "EventModule", { enumerable: true, get: function () { return event_module_1.EventModule; } });
|
|
18
|
-
const events_1 = require("./lib/events/events");
|
|
19
|
-
Object.defineProperty(exports, "Events", { enumerable: true, get: function () { return events_1.Events; } });
|
|
20
|
-
const event_interface_1 = require("./lib/events/interfaces/event.interface");
|
|
21
|
-
Object.defineProperty(exports, "IEvent", { enumerable: true, get: function () { return event_interface_1.IEvent; } });
|
|
22
|
-
const email_module_1 = require("./lib/email/email.module");
|
|
23
|
-
Object.defineProperty(exports, "EmailModule", { enumerable: true, get: function () { return email_module_1.EmailModule; } });
|
|
24
|
-
const email_1 = require("./lib/email/email");
|
|
25
|
-
Object.defineProperty(exports, "Email", { enumerable: true, get: function () { return email_1.Email; } });
|
|
26
|
-
const email_interface_1 = require("./lib/email/interfaces/email.interface");
|
|
27
|
-
Object.defineProperty(exports, "IEmail", { enumerable: true, get: function () { return email_interface_1.IEmail; } });
|
|
28
|
-
const crypto_module_1 = require("./lib/crypto/crypto.module");
|
|
29
|
-
Object.defineProperty(exports, "CryptoModule", { enumerable: true, get: function () { return crypto_module_1.CryptoModule; } });
|
|
30
|
-
const crypto_1 = require("./lib/crypto/crypto");
|
|
31
|
-
Object.defineProperty(exports, "Crypto", { enumerable: true, get: function () { return crypto_1.Crypto; } });
|
|
32
|
-
const crypto_interface_1 = require("./lib/crypto/interfaces/crypto.interface");
|
|
33
|
-
Object.defineProperty(exports, "ICrypto", { enumerable: true, get: function () { return crypto_interface_1.ICrypto; } });
|
|
34
|
-
const cache_module_1 = require("./lib/cache/cache.module");
|
|
35
|
-
Object.defineProperty(exports, "CacheModule", { enumerable: true, get: function () { return cache_module_1.CacheModule; } });
|
|
36
|
-
const cache_1 = require("./lib/cache/cache");
|
|
37
|
-
Object.defineProperty(exports, "Cache", { enumerable: true, get: function () { return cache_1.Cache; } });
|
|
38
|
-
const cache_interface_1 = require("./lib/cache/interfaces/cache.interface");
|
|
39
|
-
Object.defineProperty(exports, "ICache", { enumerable: true, get: function () { return cache_interface_1.ICache; } });
|
|
40
|
-
const ioredis_types_1 = require("./external/redis/types/ioredis.types");
|
|
41
|
-
Object.defineProperty(exports, "TypeRedis", { enumerable: true, get: function () { return ioredis_types_1.TypeRedis; } });
|
|
42
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,2DAAuD;AA8BrD,4FA9BO,0BAAW,OA8BP;AA7Bb,6CAA0C;AA8BxC,sFA9BO,aAAK,OA8BP;AA7BP,kFAAsE;AA8BpE,0FA9BO,8BAAS,OA8BP;AA5BX,iEAA6D;AA6B3D,8FA7BO,8BAAa,OA6BP;AA5Bf,mDAAgD;AA6B9C,wFA7BO,iBAAO,OA6BP;AA5BT,kFAAsE;AA6BpE,yFA7BO,4BAAQ,OA6BP;AA3BV,4DAAwD;AA4BtD,4FA5BO,0BAAW,OA4BP;AA3Bb,gDAA6C;AA4B3C,uFA5BO,eAAM,OA4BP;AA3BR,6EAAiE;AA4B/D,uFA5BO,wBAAM,OA4BP;AA1BR,2DAAuD;AA2BrD,4FA3BO,0BAAW,OA2BP;AA1Bb,6CAA0C;AA2BxC,sFA3BO,aAAK,OA2BP;AA1BP,4EAAgE;AA2B9D,uFA3BO,wBAAM,OA2BP;AAzBR,8DAA0D;AA0BxD,6FA1BO,4BAAY,OA0BP;AAzBd,gDAA6C;AA0B3C,uFA1BO,eAAM,OA0BP;AAzBR,+EAAmE;AA0BjE,wFA1BO,0BAAO,OA0BP;AAxBT,2DAAuD;AAyBrD,4FAzBO,0BAAW,OAyBP;AAxBb,6CAA0C;AAyBxC,sFAzBO,aAAK,OAyBP;AAxBP,4EAAgE;AAyB9D,uFAzBO,wBAAM,OAyBP;AAxBR,wEAI8C;AAuB5C,0FAxBA,yBAAS,OAwBA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { ICache } from './interfaces/cache.interface';
|
|
3
|
-
import { IRedisService } from 'src/external/redis/interfaces/redis.interface';
|
|
4
|
-
export declare class Cache implements ICache {
|
|
5
|
-
private readonly client;
|
|
6
|
-
constructor(client: IRedisService);
|
|
7
|
-
set(key: string, value: string | number | Date | Buffer, ttl?: number): Promise<void>;
|
|
8
|
-
get(key: string): Promise<string>;
|
|
9
|
-
delete(key: string): Promise<void>;
|
|
10
|
-
}
|
package/dist/lib/cache/cache.js
DELETED
|
@@ -1,38 +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 __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.Cache = void 0;
|
|
16
|
-
const common_1 = require("@nestjs/common");
|
|
17
|
-
const redis_interface_1 = require("../../external/redis/interfaces/redis.interface");
|
|
18
|
-
let Cache = class Cache {
|
|
19
|
-
constructor(client) {
|
|
20
|
-
this.client = client;
|
|
21
|
-
}
|
|
22
|
-
async set(key, value, ttl) {
|
|
23
|
-
await this.client.setRedisKey(key, value, ttl);
|
|
24
|
-
}
|
|
25
|
-
async get(key) {
|
|
26
|
-
return await this.client.getRedisKey(key);
|
|
27
|
-
}
|
|
28
|
-
async delete(key) {
|
|
29
|
-
await this.client.deleteRedisKey(key);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
exports.Cache = Cache;
|
|
33
|
-
exports.Cache = Cache = __decorate([
|
|
34
|
-
(0, common_1.Injectable)(),
|
|
35
|
-
__param(0, (0, common_1.Inject)(redis_interface_1.IRedisService)),
|
|
36
|
-
__metadata("design:paramtypes", [Object])
|
|
37
|
-
], Cache);
|
|
38
|
-
//# sourceMappingURL=cache.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../src/lib/cache/cache.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoD;AAEpD,qFAA8E;AAGvE,IAAM,KAAK,GAAX,MAAM,KAAK;IAChB,YAAoD,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAC7E,KAAK,CAAC,GAAG,CACP,GAAW,EACX,KAAsC,EACtC,GAAY;QAEZ,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IACjD,CAAC;IACD,KAAK,CAAC,GAAG,CAAC,GAAW;QACnB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAW;QACtB,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC;CACF,CAAA;AAhBY,sBAAK;gBAAL,KAAK;IADjB,IAAA,mBAAU,GAAE;IAEE,WAAA,IAAA,eAAM,EAAC,+BAAa,CAAC,CAAA;;GADvB,KAAK,CAgBjB"}
|