@servicelabsco/slabs-access-manager 1.0.46 → 1.0.47
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/access/libraries/evaluate.email.rule.js +4 -2
- package/dist/access/libraries/evaluate.email.rule.js.map +1 -1
- package/dist/accessUtility/es6.classes.d.ts +1 -1
- package/dist/accessUtility/libraries/slabs.util.d.ts +1 -0
- package/dist/accessUtility/libraries/slabs.util.js +7 -0
- package/dist/accessUtility/libraries/slabs.util.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EvaluateEmailRule = void 0;
|
|
4
4
|
const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
|
|
5
|
-
const cheerio = require("cheerio");
|
|
6
5
|
const email_message_entity_1 = require("../entities/email.message.entity");
|
|
7
6
|
const email_rule_entity_1 = require("../entities/email.rule.entity");
|
|
8
7
|
const date_fn_1 = require("./date.fn");
|
|
8
|
+
const cheerio = require("cheerio");
|
|
9
|
+
const slabs_util_1 = require("../../accessUtility/libraries/slabs.util");
|
|
9
10
|
class EvaluateEmailRule {
|
|
10
11
|
constructor(awsS3Service, uploadService, businessPropertyService) {
|
|
11
12
|
this.awsS3Service = awsS3Service;
|
|
@@ -27,9 +28,10 @@ class EvaluateEmailRule {
|
|
|
27
28
|
const uploadService = this.uploadService;
|
|
28
29
|
const dateFn = date_fn_1.DateFn;
|
|
29
30
|
const config = this.getConfig(data.message.email.business_id);
|
|
31
|
+
const parseDate = slabs_util_1.SlabsUtil.parseDate;
|
|
30
32
|
await new nestjs_utility_services_1.CodeEvaluator().execute(script.script, {
|
|
31
33
|
data,
|
|
32
|
-
fn: { htmlParser, uploadService, dateFn, config },
|
|
34
|
+
fn: { htmlParser, uploadService, dateFn, config, parseDate },
|
|
33
35
|
});
|
|
34
36
|
}
|
|
35
37
|
getConfig(businessId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluate.email.rule.js","sourceRoot":"","sources":["../../../src/access/libraries/evaluate.email.rule.ts"],"names":[],"mappings":";;;AAAA,oFAAuI;
|
|
1
|
+
{"version":3,"file":"evaluate.email.rule.js","sourceRoot":"","sources":["../../../src/access/libraries/evaluate.email.rule.ts"],"names":[],"mappings":";;;AAAA,oFAAuI;AAGvI,2EAAsE;AAEtE,qEAAgE;AAEhE,uCAAmC;AACnC,mCAAoC;AACpC,yEAAqE;AAIrE,MAAa,iBAAiB;IAC1B,YACqB,YAA0B,EAC1B,aAA4B,EAC5B,uBAAgD;QAFhD,iBAAY,GAAZ,YAAY,CAAc;QAC1B,kBAAa,GAAb,aAAa,CAAe;QAC5B,4BAAuB,GAAvB,uBAAuB,CAAyB;IACjE,CAAC;IAOL,KAAK,CAAC,OAAO,CAAC,EAAU;QACpB,MAAM,OAAO,GAAG,MAAM,yCAAkB,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY,CAAC,EAAE,CAAC,CAAC;QAE5H,MAAM,iBAAiB,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAC/D,MAAM,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC;QAE9C,OAAO,CAAC,YAAY,GAAG,IAAI,IAAI,EAAE,CAAC;QAClC,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC;IAC1B,CAAC;IAQO,KAAK,CAAC,WAAW,CAAC,IAAqB,EAAE,IAA+B;QAC5E,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QACxC,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC;QAE/B,MAAM,MAAM,GAAG,MAAM,4CAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC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CAAC,IAAI,KAAK,IAAI,CAAC;QAC9B,CAAC,CAAC;aACD,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;IAOD,KAAK,CAAC,oBAAoB,CAAC,WAAoC;QAC3D,MAAM,CAAC,GAA4B,EAAE,CAAC;QAEtC,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACnC,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;YAC3E,UAAU,CAAC,GAAG,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;YAEzF,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACvB,CAAC;QAED,OAAO,CAAC,CAAC;IACb,CAAC;CACJ;AA1ID,8CA0IC"}
|
|
@@ -163,7 +163,7 @@ declare const es6Classes: {
|
|
|
163
163
|
entities: (typeof TagAssignmentEntity | typeof FcmTemplateEntity | typeof FcmNotificationEntity | typeof NotificationEntity | typeof InappNotificationEntity | typeof SmsNotificationEntity | typeof WhatsappNotificationEntity | typeof EmailNotificationEntity | typeof ViolationDefinitionEntity | typeof BusinessViolationEntity | typeof DataViolationEntity | typeof BulkUploadColumnEntity | typeof BulkUploadTypeEntity | typeof BulkDefinitionEntity | typeof BulkDefinitionProcessingEntity | typeof BulkUploadItemEntity | typeof BulkUploadEntity | typeof UploadModificationEntity | typeof PdfTemplatesEntity | typeof CurrencyEntity | typeof ListingModelEntity | typeof BusinessBulkDefinitionEntity | typeof UiPoliciesEntity | typeof BusinessPolicyEntity | typeof DataAccessEntity | typeof DataMappingEntity | typeof GstStateEntity | typeof ItemUnitEntity | typeof ItemViolationEntity | typeof NotificationRecipientEntity | typeof PdfLogEntity | typeof PdfDocumentsEntity | typeof WebhookRequestEntity)[];
|
|
164
164
|
enums: (typeof UiPoliciesTypeEnum | typeof BulkUploadStatusTypeEnum | typeof DataViolationStatusTypeEnum | typeof DriveResourceAccessRoleTypeEnum | typeof ViolationColumnTypeEnum | typeof ViolationTypeEnum)[];
|
|
165
165
|
jobs: (typeof PushToBulkItemJob | typeof AnalyseBulkUploadJob | typeof BulkDefinitionJob | typeof BulkDefinitionLoadJob | typeof BulkDefinitionProcessingJob | typeof BulkUploadColumnJob | typeof BulkUploadColumnMatchJob | typeof BulkUploadStatsJob | typeof BulkUploadItemJob | typeof SetBulkUploadStatusJob | typeof BulkUploadJob | typeof BulkUploadTypeJob | typeof BusinessBulkDefinitionJob | typeof BusinessPolicyJob | typeof BusinessViolationJob | typeof CurrencyJob | typeof DataAccessJob | typeof DataMappingJob | typeof DataViolationJob | typeof EmailNotificationJob | typeof GchatNotificationJob | typeof GstStateJob | typeof InappNotificationJob | typeof ItemUnitJob | typeof ItemViolationJob | typeof ListingModelJob | typeof NotificationJob | typeof NotificationRecipientJob | typeof PdfLogJob | typeof PdfDocumentJob | typeof ResetBusinessPolicyJob | typeof SanitizeBulkUploadJob | typeof SlackNotificationJob | typeof SmsNotificationJob | typeof TagAssignmentJob | typeof UiPoliciesJob | typeof UploadModificationJob | typeof ViolationDefinitionJob | typeof WebhookRequestJob | typeof WhatsappNotificationJob)[];
|
|
166
|
-
libraries: (typeof ReadXlsFile | typeof AnalyseBulkUpload | typeof ProcessCommonData | typeof ProcessBulkDefinitionData | typeof ProcessBulkDefinitionList | typeof ProcessItemUnitData | typeof ProcessItemUnitList | typeof ProcessViolationDefinitionList | typeof ProcessManualPdfDocument | typeof GenerateBulkUploadSheet | typeof JsonEvaluator | typeof LoadXlsFile | typeof ProcessPdfDocument | typeof ProcessReportListing | typeof SetBulkUploadLogFile
|
|
166
|
+
libraries: (typeof SlabsUtil | typeof ReadXlsFile | typeof AnalyseBulkUpload | typeof ProcessCommonData | typeof ProcessBulkDefinitionData | typeof ProcessBulkDefinitionList | typeof ProcessItemUnitData | typeof ProcessItemUnitList | typeof ProcessViolationDefinitionList | typeof ProcessManualPdfDocument | typeof GenerateBulkUploadSheet | typeof JsonEvaluator | typeof LoadXlsFile | typeof ProcessPdfDocument | typeof ProcessReportListing | typeof SetBulkUploadLogFile)[];
|
|
167
167
|
services: (typeof BulkUploadService | typeof FileUploadService | typeof PdfService | typeof PdfDocumentService | typeof BusinessPolicyService | typeof LambdaService | typeof DataAccessService | typeof Es6JobsService | typeof Es6Service | typeof GoogleDriveService)[];
|
|
168
168
|
subscribers: (typeof BulkDefinitionLoadSubscriber | typeof BulkDefinitionProcessingSubscriber | typeof BulkDefinitionSubscriber | typeof BulkUploadColumnSubscriber | typeof BulkUploadItemSubscriber | typeof BulkUploadSubscriber | typeof BulkUploadTypeSubscriber | typeof BusinessBulkDefinitionSubscriber | typeof BusinessPolicySubscriber | typeof BusinessViolationSubscriber | typeof CurrencySubscriber | typeof DataAccessSubscriber | typeof DataMappingSubscriber | typeof DataViolationSubscriber | typeof EmailNotificationSubscriber | typeof GchatNotificationSubscriber | typeof GstStateSubscriber | typeof InappNotificationSubscriber | typeof ItemUnitSubscriber | typeof ItemViolationSubscriber | typeof ListingModelSubscriber | typeof NotificationRecipientSubscriber | typeof NotificationSubscriber | typeof PdfDocumentSubscriber | typeof PdfLogSubscriber | typeof SlackNotificationSubscriber | typeof SmsNotificationSubscriber | typeof TagAssignmentSubscriber | typeof UiPoliciesSubscriber | typeof UploadModificationSubscriber | typeof ViolationDefinitionSubscriber | typeof WebhookRequestSubscriber | typeof WhatsappNotificationSubscriber)[];
|
|
169
169
|
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SlabsUtil = void 0;
|
|
4
4
|
const DEFAULT_CURRENCY_IDENTIFIER = 'INR';
|
|
5
|
+
const date_fns_1 = require("date-fns");
|
|
5
6
|
class SlabsUtil {
|
|
6
7
|
static formatCurrency(data) {
|
|
7
8
|
let { amount, region, currency, style, noDecimal } = data;
|
|
@@ -22,6 +23,12 @@ class SlabsUtil {
|
|
|
22
23
|
currency,
|
|
23
24
|
}).format(amount);
|
|
24
25
|
}
|
|
26
|
+
static parseDate(str, format, offset = 0) {
|
|
27
|
+
if (!str)
|
|
28
|
+
return null;
|
|
29
|
+
const d = (0, date_fns_1.parse)(str, format, new Date());
|
|
30
|
+
return d instanceof Date && isFinite(d.getSeconds()) ? (0, date_fns_1.subMinutes)(d, offset) : null;
|
|
31
|
+
}
|
|
25
32
|
}
|
|
26
33
|
exports.SlabsUtil = SlabsUtil;
|
|
27
34
|
//# sourceMappingURL=slabs.util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slabs.util.js","sourceRoot":"","sources":["../../../src/accessUtility/libraries/slabs.util.ts"],"names":[],"mappings":";;;AAAA,MAAM,2BAA2B,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"slabs.util.js","sourceRoot":"","sources":["../../../src/accessUtility/libraries/slabs.util.ts"],"names":[],"mappings":";;;AAAA,MAAM,2BAA2B,GAAG,KAAK,CAAC;AAC1C,uCAA6C;AAM7C,MAAa,SAAS;IAWlB,MAAM,CAAC,cAAc,CAAC,IAA8F;QAChH,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;QAC1D,MAAM,GAAG,MAAM,IAAI,OAAO,CAAC;QAC3B,QAAQ,GAAG,QAAQ,IAAI,2BAA2B,CAAC;QACnD,KAAK,GAAG,KAAK,IAAI,UAAU,CAAC;QAC5B,SAAS,GAAG,SAAS,IAAI,KAAK,CAAC;QAE/B,IAAI,SAAS,EAAE,CAAC;YACZ,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;gBACjC,KAAK;gBACL,QAAQ;gBACR,qBAAqB,EAAE,MAAM,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CA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