@futdevpro/nts-dynamo 1.2.97 → 1.2.98

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.
@@ -12,6 +12,7 @@ export declare class DynamoBEEmailService {
12
12
  email: string;
13
13
  pass: string;
14
14
  senderName: string;
15
+ rootPath: string;
15
16
  templatePaths: {
16
17
  [templateName: string]: string;
17
18
  };
@@ -27,7 +27,7 @@ class DynamoBEEmailService {
27
27
  /* this.constructionFinishedCallback = set.constructionFinishedCallback; */
28
28
  if (set.templatePaths) {
29
29
  for (let key in set.templatePaths) {
30
- this.loadTemplate(key, set.templatePaths[key]);
30
+ this.loadTemplate(key, set.rootPath, set.templatePaths[key]);
31
31
  }
32
32
  }
33
33
  else {
@@ -87,12 +87,12 @@ class DynamoBEEmailService {
87
87
  }
88
88
  });
89
89
  }
90
- loadTemplate(templateName, templatePath) {
90
+ loadTemplate(templateName, rootPath, templatePath) {
91
91
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
92
92
  try {
93
93
  this.templateLoadingInProgressCounter++;
94
94
  return new Promise((resolve, reject) => {
95
- templatePath = Path.join(__dirname, templatePath);
95
+ templatePath = Path.join(rootPath, templatePath);
96
96
  FileSystem.readFile(templatePath, 'utf8', (err, template) => {
97
97
  if (err) {
98
98
  console.log(`\nDynamoBEEmailService readFile ERROR (0), Couldn't load email template; ${templateName} from ${templatePath}\nerror:\n`, err, '\n');
@@ -622,8 +622,8 @@
622
622
  "affectsGlobalScope": false
623
623
  },
624
624
  "../src/_services/dynamobe-email.service.ts": {
625
- "version": "f06cd96bd15efded7b68f972465fce648821d43e7c32f64e33455170ad85635a",
626
- "signature": "8819c511a1c231f6cd59e95b92396526d033d7c38a0539500d9166b50b16fcda",
625
+ "version": "e6362a16a988f1447cb4f9703f8aae9a5d213e9eb654cf5ef9d86c47ed793b80",
626
+ "signature": "f36eaabc0c174cfe8f05ff13bd87b835ad3b682a8827abfbc271f4f297c5c81a",
627
627
  "affectsGlobalScope": false
628
628
  },
629
629
  "../src/_services/dynamobe-email-service-collection.service.ts": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@futdevpro/nts-dynamo",
3
- "version": "01.02.97",
3
+ "version": "01.02.98",
4
4
  "description": "Dynamic NodeTS (NodeJS-Typescript), MongoDB Backend System Framework by Future Development Ltd.",
5
5
  "main": "./lib/index.js",
6
6
  "repository": {
@@ -26,6 +26,7 @@ export class DynamoBEEmailService {
26
26
  pass: string,
27
27
  senderName: string,
28
28
  /* constructionFinishedCallback: () => void, */
29
+ rootPath: string,
29
30
  templatePaths: {
30
31
  [templateName: string]: string
31
32
  },
@@ -46,7 +47,7 @@ export class DynamoBEEmailService {
46
47
  /* this.constructionFinishedCallback = set.constructionFinishedCallback; */
47
48
  if (set.templatePaths) {
48
49
  for(let key in set.templatePaths) {
49
- this.loadTemplate(key, set.templatePaths[key]);
50
+ this.loadTemplate(key, set.rootPath, set.templatePaths[key]);
50
51
  }
51
52
  } else {
52
53
  this.constructionFinished();
@@ -116,11 +117,11 @@ export class DynamoBEEmailService {
116
117
  }
117
118
  }
118
119
 
119
- private async loadTemplate(templateName: string, templatePath: string): Promise<void> {
120
+ private async loadTemplate(templateName: string, rootPath: string, templatePath: string): Promise<void> {
120
121
  try {
121
122
  this.templateLoadingInProgressCounter++;
122
123
  return new Promise<void>((resolve, reject) => {
123
- templatePath = Path.join(__dirname, templatePath);
124
+ templatePath = Path.join(rootPath, templatePath);
124
125
  FileSystem.readFile(templatePath, 'utf8' , (err, template) => {
125
126
  if (err) {
126
127
  console.log(`\nDynamoBEEmailService readFile ERROR (0), Couldn't load email template; ${templateName} from ${templatePath}\nerror:\n`, err, '\n');