asv-hlps 1.4.44 → 1.4.45
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/lib/cjs/queries/hlpQuery.d.ts +2 -0
- package/lib/cjs/queries/hlpQuery.js +13 -0
- package/lib/cjs/sales/sale.js +1 -1
- package/lib/cjs/utils.js +3 -1
- package/lib/esm/queries/hlpQuery.d.ts +2 -0
- package/lib/esm/queries/hlpQuery.js +13 -0
- package/lib/esm/sales/sale.js +1 -1
- package/lib/esm/utils.js +3 -1
- package/package.json +6 -6
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { SelectQueryBuilder } from "typeorm";
|
|
2
2
|
declare class HlpQuery {
|
|
3
3
|
where: <T = any>(qb: SelectQueryBuilder<T>, key: string, prm: any, qOn?: string) => void;
|
|
4
|
+
whereIn: <T = any>(qb: SelectQueryBuilder<T>, key: string, prm: any, qOn?: string) => void;
|
|
5
|
+
whereNotIn: <T = any>(qb: SelectQueryBuilder<T>, key: string, prm: any, qOn?: string) => void;
|
|
4
6
|
opDate: <T = any>(qb: SelectQueryBuilder<T>, key: string, prm: any) => void;
|
|
5
7
|
join: <T = any>(qb: SelectQueryBuilder<T>, key: string, rStr: string, status?: "lj" | "ljs") => void;
|
|
6
8
|
joker: <T = any>(qb: SelectQueryBuilder<T>, joker: {
|
|
@@ -9,6 +9,19 @@ class HlpQuery {
|
|
|
9
9
|
qb.andWhere(`${key} = :${qVar}`, { [qVar]: prm });
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
|
+
this.whereIn = (qb, key, prm, qOn) => {
|
|
13
|
+
const qVar = !qOn ? key.substring(key.indexOf(".") + 1) : qOn;
|
|
14
|
+
if (prm) {
|
|
15
|
+
qb.andWhere(`LOWER(${key}) IN (:...${qVar}) `, { [qVar]: prm });
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
this.whereNotIn = (qb, key, prm, qOn) => {
|
|
19
|
+
const qVar = !qOn ? key.substring(key.indexOf(".") + 1) : qOn;
|
|
20
|
+
if (prm) {
|
|
21
|
+
qb.andWhere(`LOWER(${key}) NOT IN (:...${qVar}) `, { [qVar]: prm });
|
|
22
|
+
// qb.andWhere("LOWER(role.code) IN (:...roleCodes)", { roleCodes: prms.roleCodes.ins });
|
|
23
|
+
}
|
|
24
|
+
};
|
|
12
25
|
this.opDate = (qb, key, prm) => {
|
|
13
26
|
var _a, _b, _c;
|
|
14
27
|
if (prm === null || prm === void 0 ? void 0 : prm.opDate) {
|
package/lib/cjs/sales/sale.js
CHANGED
|
@@ -130,7 +130,7 @@ const tabLabel = (sale) => {
|
|
|
130
130
|
exports.tabLabel = tabLabel;
|
|
131
131
|
const refSaleGenerator = () => {
|
|
132
132
|
let date = new Date();
|
|
133
|
-
const nDate = "C" + date.toLocaleDateString().split("-").join("") + date.toLocaleTimeString().split(":").join("");
|
|
133
|
+
const nDate = "C" + date.toLocaleDateString().split("-").join("") + date.toLocaleTimeString("en-US", { hour12: false }).split(":").join("");
|
|
134
134
|
return (0, utils_1.removeBackSlashOccurences)(nDate, "").toLocaleUpperCase();
|
|
135
135
|
// return randomatic('A', 4) + date.toLocaleDateString().split('-').join('') + date.toLocaleTimeString().split(':').join('')
|
|
136
136
|
};
|
package/lib/cjs/utils.js
CHANGED
|
@@ -260,7 +260,9 @@ exports.removeBackSlashOccurences = removeBackSlashOccurences;
|
|
|
260
260
|
}; */
|
|
261
261
|
const refGenerator = (char = "c", regex = /\/+/gi, toChar = "") => {
|
|
262
262
|
let date = new Date();
|
|
263
|
-
let nDate = char.toUpperCase() +
|
|
263
|
+
let nDate = char.toUpperCase() +
|
|
264
|
+
date.toLocaleDateString().split("-").join("") +
|
|
265
|
+
date.toLocaleTimeString("en-US", { hour12: false }).split(":").join("");
|
|
264
266
|
nDate = (0, exports.replaceAllIn)(nDate, regex, toChar).toLocaleUpperCase();
|
|
265
267
|
return nDate.indexOf(" ") ? nDate.substring(0, nDate.indexOf(" ")).trim() : nDate;
|
|
266
268
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { SelectQueryBuilder } from "typeorm";
|
|
2
2
|
declare class HlpQuery {
|
|
3
3
|
where: <T = any>(qb: SelectQueryBuilder<T>, key: string, prm: any, qOn?: string) => void;
|
|
4
|
+
whereIn: <T = any>(qb: SelectQueryBuilder<T>, key: string, prm: any, qOn?: string) => void;
|
|
5
|
+
whereNotIn: <T = any>(qb: SelectQueryBuilder<T>, key: string, prm: any, qOn?: string) => void;
|
|
4
6
|
opDate: <T = any>(qb: SelectQueryBuilder<T>, key: string, prm: any) => void;
|
|
5
7
|
join: <T = any>(qb: SelectQueryBuilder<T>, key: string, rStr: string, status?: "lj" | "ljs") => void;
|
|
6
8
|
joker: <T = any>(qb: SelectQueryBuilder<T>, joker: {
|
|
@@ -7,6 +7,19 @@ class HlpQuery {
|
|
|
7
7
|
qb.andWhere(`${key} = :${qVar}`, { [qVar]: prm });
|
|
8
8
|
}
|
|
9
9
|
};
|
|
10
|
+
this.whereIn = (qb, key, prm, qOn) => {
|
|
11
|
+
const qVar = !qOn ? key.substring(key.indexOf(".") + 1) : qOn;
|
|
12
|
+
if (prm) {
|
|
13
|
+
qb.andWhere(`LOWER(${key}) IN (:...${qVar}) `, { [qVar]: prm });
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
this.whereNotIn = (qb, key, prm, qOn) => {
|
|
17
|
+
const qVar = !qOn ? key.substring(key.indexOf(".") + 1) : qOn;
|
|
18
|
+
if (prm) {
|
|
19
|
+
qb.andWhere(`LOWER(${key}) NOT IN (:...${qVar}) `, { [qVar]: prm });
|
|
20
|
+
// qb.andWhere("LOWER(role.code) IN (:...roleCodes)", { roleCodes: prms.roleCodes.ins });
|
|
21
|
+
}
|
|
22
|
+
};
|
|
10
23
|
this.opDate = (qb, key, prm) => {
|
|
11
24
|
var _a, _b, _c;
|
|
12
25
|
if (prm === null || prm === void 0 ? void 0 : prm.opDate) {
|
package/lib/esm/sales/sale.js
CHANGED
|
@@ -110,7 +110,7 @@ export const tabLabel = (sale) => {
|
|
|
110
110
|
};
|
|
111
111
|
export const refSaleGenerator = () => {
|
|
112
112
|
let date = new Date();
|
|
113
|
-
const nDate = "C" + date.toLocaleDateString().split("-").join("") + date.toLocaleTimeString().split(":").join("");
|
|
113
|
+
const nDate = "C" + date.toLocaleDateString().split("-").join("") + date.toLocaleTimeString("en-US", { hour12: false }).split(":").join("");
|
|
114
114
|
return removeBackSlashOccurences(nDate, "").toLocaleUpperCase();
|
|
115
115
|
// return randomatic('A', 4) + date.toLocaleDateString().split('-').join('') + date.toLocaleTimeString().split(':').join('')
|
|
116
116
|
};
|
package/lib/esm/utils.js
CHANGED
|
@@ -225,7 +225,9 @@ export const removeBackSlashOccurences = (text, toChar) => {
|
|
|
225
225
|
}; */
|
|
226
226
|
export const refGenerator = (char = "c", regex = /\/+/gi, toChar = "") => {
|
|
227
227
|
let date = new Date();
|
|
228
|
-
let nDate = char.toUpperCase() +
|
|
228
|
+
let nDate = char.toUpperCase() +
|
|
229
|
+
date.toLocaleDateString().split("-").join("") +
|
|
230
|
+
date.toLocaleTimeString("en-US", { hour12: false }).split(":").join("");
|
|
229
231
|
nDate = replaceAllIn(nDate, regex, toChar).toLocaleUpperCase();
|
|
230
232
|
return nDate.indexOf(" ") ? nDate.substring(0, nDate.indexOf(" ")).trim() : nDate;
|
|
231
233
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "asv-hlps",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.45",
|
|
4
4
|
"description": "helpers",
|
|
5
5
|
"main": "./lib/cjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/express": "^5.0.3",
|
|
20
20
|
"@types/jwt-decode": "^3.1.0",
|
|
21
|
-
"@types/lodash": "^4.17.
|
|
21
|
+
"@types/lodash": "^4.17.19",
|
|
22
22
|
"@types/pdfmake": "^0.2.11",
|
|
23
23
|
"@types/randomatic": "^3.1.5",
|
|
24
|
-
"@types/react": "^19.1.
|
|
24
|
+
"@types/react": "^19.1.8"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@tanstack/react-query": "^5.
|
|
28
|
-
"axios": "^1.
|
|
27
|
+
"@tanstack/react-query": "^5.81.2",
|
|
28
|
+
"axios": "^1.10.0",
|
|
29
29
|
"class-validator": "^0.14.2",
|
|
30
30
|
"classnames": "^2.5.1",
|
|
31
31
|
"dayjs": "^1.11.13",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"lodash": "^4.17.21",
|
|
35
35
|
"pdfmake": "^0.2.20",
|
|
36
36
|
"randomatic": "^3.1.1",
|
|
37
|
-
"typeorm": "^0.3.
|
|
37
|
+
"typeorm": "^0.3.25",
|
|
38
38
|
"typescript": "^5.8.3",
|
|
39
39
|
"yup": "^1.6.1",
|
|
40
40
|
"zustand": "^5.0.5"
|