chatbot-nc 2.1.43 → 2.1.44
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/dist/cjs/aws/services/AWSSQS.d.ts +3 -0
- package/dist/cjs/aws/services/AWSSQS.js +22 -0
- package/dist/cjs/aws/services/AWSSQS.js.map +1 -0
- package/dist/esm/aws/services/AWSSQS.d.ts +3 -0
- package/dist/esm/aws/services/AWSSQS.js +28 -0
- package/dist/esm/aws/services/AWSSQS.js.map +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SQS = void 0;
|
|
4
|
+
const client_sqs_1 = require("@aws-sdk/client-sqs"); // ES Modules import
|
|
5
|
+
const environment = (process.env.NODE_ENVIRONMENT || 'Test');
|
|
6
|
+
const awsRegion = (process.env.AWS_DEFAULT_REGION || 'us-east-1');
|
|
7
|
+
const client = new client_sqs_1.SQSClient({ region: awsRegion });
|
|
8
|
+
const publish = async (topic, subject, message, messageAttributes) => {
|
|
9
|
+
try {
|
|
10
|
+
const topicName = `${environment}-${topic}`;
|
|
11
|
+
// let auditLogger = new AuditLogger();
|
|
12
|
+
// await auditLogger.audit(message, subject, messageAttributes);
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
console.error(`error occured while publishing event ${subject} to SNS `);
|
|
16
|
+
console.error(error, error.stack);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
exports.SQS = {
|
|
20
|
+
publish
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=AWSSQS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AWSSQS.js","sourceRoot":"","sources":["../../../../aws/services/AWSSQS.ts"],"names":[],"mappings":";;;AAAA,oDAAgD,CAAC,oBAAoB;AAErE,MAAM,WAAW,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,MAAM,CAAC,CAAC;AAC7D,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,WAAW,CAAC,CAAC;AAElE,MAAM,MAAM,GAAG,IAAI,sBAAS,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AAEpD,MAAM,OAAO,GAAG,KAAK,EAAE,KAAa,EAAE,OAAe,EAAE,OAAe,EAAE,iBAAuC,EAAE,EAAE;IAC/G,IAAI,CAAC;QACD,MAAM,SAAS,GAAG,GAAG,WAAW,IAAI,KAAK,EAAE,CAAC;QAC5C,uCAAuC;QACvC,gEAAgE;IACpE,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QAClB,OAAO,CAAC,KAAK,CAAC,wCAAwC,OAAO,UAAU,CAAC,CAAA;QACxE,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;AACL,CAAC,CAAA;AAGY,QAAA,GAAG,GAAG;IACf,OAAO;CACV,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { SQSClient } from "@aws-sdk/client-sqs"; // ES Modules import
|
|
11
|
+
const environment = (process.env.NODE_ENVIRONMENT || 'Test');
|
|
12
|
+
const awsRegion = (process.env.AWS_DEFAULT_REGION || 'us-east-1');
|
|
13
|
+
const client = new SQSClient({ region: awsRegion });
|
|
14
|
+
const publish = (topic, subject, message, messageAttributes) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const topicName = `${environment}-${topic}`;
|
|
17
|
+
// let auditLogger = new AuditLogger();
|
|
18
|
+
// await auditLogger.audit(message, subject, messageAttributes);
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
console.error(`error occured while publishing event ${subject} to SNS `);
|
|
22
|
+
console.error(error, error.stack);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
export const SQS = {
|
|
26
|
+
publish
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=AWSSQS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AWSSQS.js","sourceRoot":"","sources":["../../../../aws/services/AWSSQS.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC,CAAC,oBAAoB;AAErE,MAAM,WAAW,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,MAAM,CAAC,CAAC;AAC7D,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,WAAW,CAAC,CAAC;AAElE,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AAEpD,MAAM,OAAO,GAAG,CAAO,KAAa,EAAE,OAAe,EAAE,OAAe,EAAE,iBAAuC,EAAE,EAAE;IAC/G,IAAI,CAAC;QACD,MAAM,SAAS,GAAG,GAAG,WAAW,IAAI,KAAK,EAAE,CAAC;QAC5C,uCAAuC;QACvC,gEAAgE;IACpE,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QAClB,OAAO,CAAC,KAAK,CAAC,wCAAwC,OAAO,UAAU,CAAC,CAAA;QACxE,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;AACL,CAAC,CAAA,CAAA;AAGD,MAAM,CAAC,MAAM,GAAG,GAAG;IACf,OAAO;CACV,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chatbot-nc",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.44",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@aws-sdk/client-s3": "^3.241.0",
|
|
38
38
|
"@aws-sdk/client-sesv2": "^3.264.0",
|
|
39
39
|
"@aws-sdk/client-sns": "^3.292.0",
|
|
40
|
+
"@aws-sdk/client-sqs": "^3.696.0",
|
|
40
41
|
"@aws-sdk/client-ssm": "^3.290.0",
|
|
41
42
|
"@aws-sdk/client-sts": "^3.315.0",
|
|
42
43
|
"@aws-sdk/client-transcribe": "^3.645.0",
|