namirasoft-node 1.3.65 → 1.3.66

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.
@@ -1,4 +0,0 @@
1
- export declare class OTPOperation {
2
- static run(command: string, cwd: string | undefined): Promise<void>;
3
- static runSync(command: string, cwd: string | undefined): Promise<any>;
4
- }
@@ -1,43 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.OTPOperation = void 0;
13
- const { exec, execSync } = require('child_process');
14
- class OTPOperation {
15
- static run(command, cwd) {
16
- return __awaiter(this, void 0, void 0, function* () {
17
- yield exec(command, { cwd }, (error, stdout, stderr) => {
18
- if (error) {
19
- console.error(`error: ${error.message}`);
20
- return;
21
- }
22
- if (stderr) {
23
- console.error(`stderr: ${stderr}`);
24
- return;
25
- }
26
- console.log(`stdout:\n${stdout}`);
27
- });
28
- });
29
- }
30
- static runSync(command, cwd) {
31
- return __awaiter(this, void 0, void 0, function* () {
32
- try {
33
- return yield execSync(command, { cwd, encoding: 'utf-8' });
34
- }
35
- catch (error) {
36
- console.error(error.stdout);
37
- throw error;
38
- }
39
- });
40
- }
41
- }
42
- exports.OTPOperation = OTPOperation;
43
- //# sourceMappingURL=CMDOperation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CMDOperation.js","sourceRoot":"","sources":["../src/CMDOperation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AACpD,MAAa,YAAY;IAErB,MAAM,CAAO,GAAG,CAAC,OAAe,EAAE,GAAuB;;YAErD,MAAM,IAAI,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;gBAEnD,IAAI,KAAK,EACT;oBACI,OAAO,CAAC,KAAK,CAAC,UAAU,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;oBACzC,OAAO;iBACV;gBACD,IAAI,MAAM,EACV;oBACI,OAAO,CAAC,KAAK,CAAC,WAAW,MAAM,EAAE,CAAC,CAAC;oBACnC,OAAO;iBACV;gBACD,OAAO,CAAC,GAAG,CAAC,YAAY,MAAM,EAAE,CAAC,CAAC;YACtC,CAAC,CAAC,CAAC;QACP,CAAC;KAAA;IACD,MAAM,CAAO,OAAO,CAAC,OAAe,EAAE,GAAuB;;YAEzD,IACA;gBACI,OAAO,MAAM,QAAQ,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;aAC9D;YAAC,OAAO,KAAU,EACnB;gBACI,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBAC5B,MAAM,KAAK,CAAC;aACf;QACL,CAAC;KAAA;CACJ;AA9BD,oCA8BC"}
@@ -1,16 +0,0 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- import { AttachmentLike } from "nodemailer/lib/mailer";
4
- import { Readable } from "stream";
5
- export declare class EmailService {
6
- host: string;
7
- username: string;
8
- username_from: string;
9
- password: string;
10
- error_title: string;
11
- error_recipients: string;
12
- constructor(host: string, username: string, username_from: string, password: string, error_title: string, error_recipients: string);
13
- sendExeption(error: Error, meta: any, callback?: (err: Error | null, info: any) => void): void;
14
- sendError(title: string, message: string, callback?: (err: Error | null, info: any) => void): void;
15
- send(to: string, subject: string, text: string, html?: string | Buffer | Readable | AttachmentLike | undefined, callback?: (err: Error | null, info: any) => void): void;
16
- }
@@ -1,81 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.EmailService = void 0;
7
- const nodemailer_1 = __importDefault(require("nodemailer"));
8
- const nodemailer_smtp_transport_1 = __importDefault(require("nodemailer-smtp-transport"));
9
- class EmailService {
10
- constructor(host, username, username_from, password, error_title, error_recipients) {
11
- this.host = host;
12
- this.username = username;
13
- this.username_from = username_from;
14
- this.password = password;
15
- this.error_title = error_title;
16
- this.error_recipients = error_recipients;
17
- }
18
- sendExeption(error, meta, callback) {
19
- let title = error.message;
20
- let message = title;
21
- if (meta)
22
- message += "\r\n" + JSON.stringify(meta);
23
- message += "\r\n" + error.stack;
24
- this.sendError(title, message, callback);
25
- }
26
- sendError(title, message, callback) {
27
- if (!title)
28
- title = '';
29
- let toks = this.error_recipients.split(',');
30
- for (let i = 0; i < toks.length; i++) {
31
- const email = toks[i];
32
- this.send(email, this.error_title + " - " + title, message, undefined, callback);
33
- }
34
- }
35
- send(to, subject, text, html, callback) {
36
- if (!this.username)
37
- return;
38
- if (!this.password)
39
- return;
40
- let transform = {};
41
- if (this.host === 'gmail')
42
- transform = (0, nodemailer_smtp_transport_1.default)({
43
- service: 'gmail',
44
- host: 'smtp.gmail.com',
45
- auth: {
46
- user: this.username,
47
- pass: this.password
48
- }
49
- });
50
- else
51
- transform = {
52
- host: this.host,
53
- port: 465,
54
- secure: true,
55
- auth: {
56
- user: this.username,
57
- pass: this.password
58
- }
59
- };
60
- let transporter = nodemailer_1.default.createTransport(transform);
61
- let mailOptions = {
62
- from: this.username_from,
63
- to,
64
- subject,
65
- text,
66
- html
67
- };
68
- if (html)
69
- mailOptions.html = html;
70
- transporter.sendMail(mailOptions, function (error, info) {
71
- if (callback)
72
- callback(error, info);
73
- else {
74
- if (error)
75
- console.log(error);
76
- }
77
- });
78
- }
79
- }
80
- exports.EmailService = EmailService;
81
- //# sourceMappingURL=EmailService.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EmailService.js","sourceRoot":"","sources":["../src/EmailService.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAoC;AACpC,0FAAsD;AAItD,MAAa,YAAY;IAQrB,YAAY,IAAY,EAAE,QAAgB,EAAE,aAAqB,EAAE,QAAgB,EAAE,WAAmB,EAAE,gBAAwB;QAE9H,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC7C,CAAC;IACD,YAAY,CAAC,KAAY,EAAE,IAAS,EAAE,QAAiD;QAEnF,IAAI,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC;QAC1B,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,IAAI,IAAI;YACJ,OAAO,IAAI,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC7C,OAAO,IAAI,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC;QAChC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;IACD,SAAS,CAAC,KAAa,EAAE,OAAe,EAAE,QAAiD;QAEvF,IAAI,CAAC,KAAK;YACN,KAAK,GAAG,EAAE,CAAC;QACf,IAAI,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAA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