asv-hlps 1.2.68 → 1.2.70
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/auth.js +0 -3
- package/lib/cjs/models/entities/cashs/Feed.d.ts +3 -0
- package/lib/cjs/npms/typeorm.d.ts +1 -0
- package/lib/cjs/npms/typeorm.js +21 -1
- package/lib/esm/auth.js +0 -3
- package/lib/esm/models/entities/cashs/Feed.d.ts +3 -0
- package/lib/esm/npms/typeorm.d.ts +1 -0
- package/lib/esm/npms/typeorm.js +19 -0
- package/package.json +1 -1
package/lib/cjs/auth.js
CHANGED
|
@@ -21,9 +21,6 @@ const getAuth = (authUser, authSte, param) => {
|
|
|
21
21
|
// ------ multi roles ------
|
|
22
22
|
// return param?.roles?.length ? this.checkRoles(["sadm", ...param.roles]) : false;
|
|
23
23
|
}
|
|
24
|
-
else {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
24
|
}
|
|
28
25
|
if ((_c = param === null || param === void 0 ? void 0 : param.steGrps) === null || _c === void 0 ? void 0 : _c.length) {
|
|
29
26
|
return param.steGrps.includes(authUser.ste.grp.code.toLowerCase());
|
|
@@ -7,4 +7,5 @@ declare type opDatesType = "currentDate" | "currentMonth" | "subCurrentMonth" |
|
|
|
7
7
|
* @param dates
|
|
8
8
|
*/
|
|
9
9
|
export declare const tormDateParams: (qb: any, propColumn: string, opDates?: opDatesType, dates?: any, datesBy?: "year" | "month") => void;
|
|
10
|
+
export declare const getModelArrayRefs: (dataSource: any, model: any, propDate: string, store: string, step: number, date: any) => Promise<any>;
|
|
10
11
|
export {};
|
package/lib/cjs/npms/typeorm.js
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
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
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.tormDateParams = void 0;
|
|
12
|
+
exports.getModelArrayRefs = exports.tormDateParams = void 0;
|
|
4
13
|
/**
|
|
5
14
|
*
|
|
6
15
|
* @param qb typeorm queryselectoer
|
|
@@ -53,3 +62,14 @@ const tormDateParams = (qb, propColumn, opDates, dates, datesBy) => {
|
|
|
53
62
|
}
|
|
54
63
|
};
|
|
55
64
|
exports.tormDateParams = tormDateParams;
|
|
65
|
+
const getModelArrayRefs = (dataSource, model, propDate, store, step, date) => __awaiter(void 0, void 0, void 0, function* () {
|
|
66
|
+
return yield dataSource
|
|
67
|
+
.getRepository(model)
|
|
68
|
+
.createQueryBuilder("r")
|
|
69
|
+
.select(`SUBSTRING(r.ref, ${step})`, "ref")
|
|
70
|
+
.where(`DATE_FORMAT(r.${propDate}, '%Y') = ${date.getFullYear()}`)
|
|
71
|
+
.andWhere("r.ref is not null")
|
|
72
|
+
.andWhere("r.store = :store", { store: store })
|
|
73
|
+
.getRawMany();
|
|
74
|
+
});
|
|
75
|
+
exports.getModelArrayRefs = getModelArrayRefs;
|
package/lib/esm/auth.js
CHANGED
|
@@ -18,9 +18,6 @@ const getAuth = (authUser, authSte, param) => {
|
|
|
18
18
|
// ------ multi roles ------
|
|
19
19
|
// return param?.roles?.length ? this.checkRoles(["sadm", ...param.roles]) : false;
|
|
20
20
|
}
|
|
21
|
-
else {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
21
|
}
|
|
25
22
|
if ((_c = param === null || param === void 0 ? void 0 : param.steGrps) === null || _c === void 0 ? void 0 : _c.length) {
|
|
26
23
|
return param.steGrps.includes(authUser.ste.grp.code.toLowerCase());
|
|
@@ -7,4 +7,5 @@ declare type opDatesType = "currentDate" | "currentMonth" | "subCurrentMonth" |
|
|
|
7
7
|
* @param dates
|
|
8
8
|
*/
|
|
9
9
|
export declare const tormDateParams: (qb: any, propColumn: string, opDates?: opDatesType, dates?: any, datesBy?: "year" | "month") => void;
|
|
10
|
+
export declare const getModelArrayRefs: (dataSource: any, model: any, propDate: string, store: string, step: number, date: any) => Promise<any>;
|
|
10
11
|
export {};
|
package/lib/esm/npms/typeorm.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
1
10
|
/**
|
|
2
11
|
*
|
|
3
12
|
* @param qb typeorm queryselectoer
|
|
@@ -49,3 +58,13 @@ export const tormDateParams = (qb, propColumn, opDates, dates, datesBy) => {
|
|
|
49
58
|
}
|
|
50
59
|
}
|
|
51
60
|
};
|
|
61
|
+
export const getModelArrayRefs = (dataSource, model, propDate, store, step, date) => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
|
+
return yield dataSource
|
|
63
|
+
.getRepository(model)
|
|
64
|
+
.createQueryBuilder("r")
|
|
65
|
+
.select(`SUBSTRING(r.ref, ${step})`, "ref")
|
|
66
|
+
.where(`DATE_FORMAT(r.${propDate}, '%Y') = ${date.getFullYear()}`)
|
|
67
|
+
.andWhere("r.ref is not null")
|
|
68
|
+
.andWhere("r.store = :store", { store: store })
|
|
69
|
+
.getRawMany();
|
|
70
|
+
});
|