ztechno_core 0.0.27 → 0.0.30

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/LICENSE CHANGED
@@ -1 +1 @@
1
- MIT
1
+ MIT
package/README.md CHANGED
@@ -1,81 +1,81 @@
1
- # ztech_jquery_ext
2
- #### Extends JQuery library for more compact code base
3
-
4
- [![npm version](https://badge.fury.io/js/ztech_jquery_ext.svg)](https://www.npmjs.com/package/ztech_jquery_ext)
5
-
6
- Requirements
7
- -----
8
- + [jQuery](http://jquery.com/)
9
-
10
-
11
- Installation
12
- -----
13
-
14
- ### [NPM](https://www.npmjs.com/package/ztech_jquery_ext)
15
- ```bash
16
- npm install ztech_jquery_ext
17
- ```
18
-
19
- ### [Yarn](https://yarn.pm/ztech_jquery_ext)
20
- ```bash
21
- yarn add ztech_jquery_ext
22
- ```
23
-
24
- ### [CDN - jsDelivr](https://www.jsdelivr.com/package/npm/ztech_jquery_ext)
25
- ```html
26
- <link href="https://cdn.jsdelivr.net/npm/ztech_jquery_ext/dist/css/ztech_jquery_ext.min.css" rel="stylesheet" type="text/css" />
27
- <script src="https://cdn.jsdelivr.net/npm/ztech_jquery_ext/dist/js/ztech_jquery_ext.min.js" type="text/javascript"></script>
28
- ```
29
-
30
- ### [CDN - UNPKG](https://unpkg.com/browse/ztech_jquery_ext/)
31
- ```html
32
- <link href="https://unpkg.com/ztech_jquery_ext/dist/css/ztech_jquery_ext.min.css" rel="stylesheet" type="text/css" />
33
- <script src="https://unpkg.com/ztech_jquery_ext/dist/js/ztech_jquery_ext.min.js" type="text/javascript"></script>
34
- ```
35
-
36
- TypeScript Support
37
- -----
38
- In order to include types add the following in tsconfig.json
39
- ```json
40
- {
41
- "compilerOptions": {
42
- "types": ["ztech_jquery_ext"]
43
- }
44
- }
45
- ```
46
-
47
- Alternatively Add the following reference at the top of the javascript/typescript file
48
- ```js
49
- /// <reference types="ztech_jquery_ext" />
50
- ```
51
-
52
- Usage
53
- -----
54
-
55
- Include jQuery
56
- ```html
57
- <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
58
- ```
59
-
60
- Include Plugin JS
61
- ```html
62
- <script src="https://cdn.jsdelivr.net/npm/ztech_jquery_ext/dist/js/ztech_jquery_ext.min.js" type="text/javascript"></script>
63
- ```
64
-
65
- Usage
66
- ```js
67
- // [JQuery, JQuery, JQuery, ...]
68
- var rows = $('.row').$arr();
69
-
70
- // [number, number, number, ...]
71
- var userids = $('.user').$map(function ($ele) {
72
- return $ele.attr('id');
73
- });
74
- ```
75
-
76
- License
77
- ----
78
- MIT
79
-
80
-
81
- Created with :heart: [create-jquery-plugin](https://www.npmjs.com/package/create-jquery-plugin)
1
+ # ztech_jquery_ext
2
+ #### Extends JQuery library for more compact code base
3
+
4
+ [![npm version](https://badge.fury.io/js/ztech_jquery_ext.svg)](https://www.npmjs.com/package/ztech_jquery_ext)
5
+
6
+ Requirements
7
+ -----
8
+ + [jQuery](http://jquery.com/)
9
+
10
+
11
+ Installation
12
+ -----
13
+
14
+ ### [NPM](https://www.npmjs.com/package/ztech_jquery_ext)
15
+ ```bash
16
+ npm install ztech_jquery_ext
17
+ ```
18
+
19
+ ### [Yarn](https://yarn.pm/ztech_jquery_ext)
20
+ ```bash
21
+ yarn add ztech_jquery_ext
22
+ ```
23
+
24
+ ### [CDN - jsDelivr](https://www.jsdelivr.com/package/npm/ztech_jquery_ext)
25
+ ```html
26
+ <link href="https://cdn.jsdelivr.net/npm/ztech_jquery_ext/dist/css/ztech_jquery_ext.min.css" rel="stylesheet" type="text/css" />
27
+ <script src="https://cdn.jsdelivr.net/npm/ztech_jquery_ext/dist/js/ztech_jquery_ext.min.js" type="text/javascript"></script>
28
+ ```
29
+
30
+ ### [CDN - UNPKG](https://unpkg.com/browse/ztech_jquery_ext/)
31
+ ```html
32
+ <link href="https://unpkg.com/ztech_jquery_ext/dist/css/ztech_jquery_ext.min.css" rel="stylesheet" type="text/css" />
33
+ <script src="https://unpkg.com/ztech_jquery_ext/dist/js/ztech_jquery_ext.min.js" type="text/javascript"></script>
34
+ ```
35
+
36
+ TypeScript Support
37
+ -----
38
+ In order to include types add the following in tsconfig.json
39
+ ```json
40
+ {
41
+ "compilerOptions": {
42
+ "types": ["ztech_jquery_ext"]
43
+ }
44
+ }
45
+ ```
46
+
47
+ Alternatively Add the following reference at the top of the javascript/typescript file
48
+ ```js
49
+ /// <reference types="ztech_jquery_ext" />
50
+ ```
51
+
52
+ Usage
53
+ -----
54
+
55
+ Include jQuery
56
+ ```html
57
+ <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
58
+ ```
59
+
60
+ Include Plugin JS
61
+ ```html
62
+ <script src="https://cdn.jsdelivr.net/npm/ztech_jquery_ext/dist/js/ztech_jquery_ext.min.js" type="text/javascript"></script>
63
+ ```
64
+
65
+ Usage
66
+ ```js
67
+ // [JQuery, JQuery, JQuery, ...]
68
+ var rows = $('.row').$arr();
69
+
70
+ // [number, number, number, ...]
71
+ var userids = $('.user').$map(function ($ele) {
72
+ return $ele.attr('id');
73
+ });
74
+ ```
75
+
76
+ License
77
+ ----
78
+ MIT
79
+
80
+
81
+ Created with :heart: [create-jquery-plugin](https://www.npmjs.com/package/create-jquery-plugin)
@@ -15,7 +15,8 @@ class ZMailService {
15
15
  from: mailOpts.from || this.opt.mailSender,
16
16
  to: mailOpts.recipient,
17
17
  subject: mailOpts.subject,
18
- text: mailOpts.body || mailOpts.html,
18
+ text: mailOpts.body || undefined,
19
+ html: mailOpts.html || undefined,
19
20
  };
20
21
  return new Promise((resolve, reject) => {
21
22
  mailTransporter.sendMail(mailDetails, function (err, data) {
@@ -60,6 +60,9 @@ class ZUserService {
60
60
  return { session };
61
61
  }
62
62
  async auth(opt) {
63
+ if (!opt.session || (!opt.name && !opt.pass)) {
64
+ return { authenticated: false };
65
+ }
63
66
  const res = await (opt.session
64
67
  ? this.sqlService.query(
65
68
  `
package/package.json CHANGED
@@ -1,45 +1,45 @@
1
- {
2
- "name": "ztechno_core",
3
- "version": "0.0.27",
4
- "description": "Core files for ztechno framework",
5
- "main": "lib/index.js",
6
- "types": "lib/index.d.ts",
7
- "typings": "lib/index.d.ts",
8
- "license": "MIT",
9
- "author": "Ivan Auda (ZTechnologies International)",
10
- "files": [
11
- "lib/**/*"
12
- ],
13
- "scripts": {
14
- "test": "jest --config jestconfig.json",
15
- "build": "tsc",
16
- "format": "prettier --write \"lib/**/*.ts\" \"lib/**/*.js\"",
17
- "lint": "tslint -p tsconfig.json",
18
- "preversion": "npm run lint",
19
- "version": "npm run format && git add -A src",
20
- "postversion": "git push && git push --tags",
21
- "update": "npm run build && npm version patch && npm publish"
22
- },
23
- "keywords": [
24
- "ztechno",
25
- "core",
26
- "utils",
27
- "service"
28
- ],
29
- "devDependencies": {
30
- "@types/jest": "^29.2.3",
31
- "@types/mysql": "^2.15.21",
32
- "jest": "^29.3.1",
33
- "prettier": "^2.7.1",
34
- "ts-jest": "^29.0.3",
35
- "tslint": "^6.1.3",
36
- "tslint-config-prettier": "^1.18.0",
37
- "typescript": "^4.9.3"
38
- },
39
- "dependencies": {
40
- "dom-parser": "^0.1.6",
41
- "mysql": "^2.18.1",
42
- "nodemailer": "^6.8.0",
43
- "translate": "^1.4.1"
44
- }
45
- }
1
+ {
2
+ "name": "ztechno_core",
3
+ "version": "0.0.30",
4
+ "description": "Core files for ztechno framework",
5
+ "main": "lib/index.js",
6
+ "types": "lib/index.d.ts",
7
+ "typings": "lib/index.d.ts",
8
+ "license": "MIT",
9
+ "author": "Ivan Auda (ZTechnologies International)",
10
+ "files": [
11
+ "lib/**/*"
12
+ ],
13
+ "scripts": {
14
+ "test": "jest --config jestconfig.json",
15
+ "build": "tsc",
16
+ "format": "prettier --write \"lib/**/*.ts\" \"lib/**/*.js\"",
17
+ "lint": "tslint -p tsconfig.json",
18
+ "preversion": "npm run lint",
19
+ "version": "npm run format && git add -A src",
20
+ "postversion": "git push && git push --tags",
21
+ "update": "npm run build && npm version patch && npm publish"
22
+ },
23
+ "keywords": [
24
+ "ztechno",
25
+ "core",
26
+ "utils",
27
+ "service"
28
+ ],
29
+ "devDependencies": {
30
+ "@types/jest": "^29.2.3",
31
+ "@types/mysql": "^2.15.21",
32
+ "jest": "^29.3.1",
33
+ "prettier": "^2.7.1",
34
+ "ts-jest": "^29.0.3",
35
+ "tslint": "^6.1.3",
36
+ "tslint-config-prettier": "^1.18.0",
37
+ "typescript": "^4.9.3"
38
+ },
39
+ "dependencies": {
40
+ "dom-parser": "^0.1.6",
41
+ "mysql": "^2.18.1",
42
+ "nodemailer": "^6.8.0",
43
+ "translate": "^1.4.1"
44
+ }
45
+ }