asv-hlps 1.3.75 → 1.3.77
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/auth.d.ts +1 -0
- package/lib/cjs/auth/auth.js +7 -1
- package/lib/cjs/utils.d.ts +1 -0
- package/lib/cjs/utils.js +5 -1
- package/lib/esm/auth/auth.d.ts +1 -0
- package/lib/esm/auth/auth.js +7 -1
- package/lib/esm/utils.d.ts +1 -0
- package/lib/esm/utils.js +3 -0
- package/package.json +1 -1
package/lib/cjs/auth/auth.d.ts
CHANGED
package/lib/cjs/auth/auth.js
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAuth = void 0;
|
|
4
4
|
const user_1 = require("../users/user");
|
|
5
|
+
const arraySome = (arr1, arr2) => {
|
|
6
|
+
return arr1.some((x) => arr2.includes(x));
|
|
7
|
+
};
|
|
5
8
|
const getAuth = (authUser, authSte, param) => {
|
|
6
9
|
var _a, _b, _c, _d, _e, _f;
|
|
7
10
|
if ((param === null || param === void 0 ? void 0 : param.tag) && (authUser === null || authUser === void 0 ? void 0 : authUser.tags.length)) {
|
|
@@ -15,7 +18,10 @@ const getAuth = (authUser, authSte, param) => {
|
|
|
15
18
|
}
|
|
16
19
|
}
|
|
17
20
|
if (((_a = param === null || param === void 0 ? void 0 : param.roles) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
18
|
-
if (
|
|
21
|
+
/* if (isStaffSte(authSte, authUser.ste.name) && ["sadm", ...param.roles].includes(authUser.role.code.toLowerCase())) {
|
|
22
|
+
return true;
|
|
23
|
+
} */
|
|
24
|
+
if ((0, user_1.isStaffSte)(authSte, authUser.ste.name) && arraySome(["sadm", ...param.roles], authUser.roles)) {
|
|
19
25
|
return true;
|
|
20
26
|
}
|
|
21
27
|
}
|
package/lib/cjs/utils.d.ts
CHANGED
|
@@ -103,3 +103,4 @@ export declare const countryIsoToFlag: (code: string) => string;
|
|
|
103
103
|
export declare const removeParamKeyName: (params: any, name?: string) => any;
|
|
104
104
|
export declare const roundLastNDigits: (num: number, digits?: number) => number | false;
|
|
105
105
|
export declare const toggleProp: (tob: any, propToToggle: string) => any;
|
|
106
|
+
export declare const arraySome: (arr1: any[], arr2: any[]) => boolean;
|
package/lib/cjs/utils.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.packAndUnit = exports.unCheckedAll = exports.inputChecked = exports.arrayMultiChecked = exports.getPeriodDateColor = exports.getColorAccordingToDate = exports.genRandomColour = exports.formatNgbDate = exports.getNbOfDaysBetweenTwoDates = exports.displayDateRangeFr = exports.reformatDates = exports.firstDayOfDate = exports.dateToString = exports.dateDiff = exports.dateFormatter = exports.replaceSpacesWith = exports.replaceAllIn = exports.toPlural = exports.sesStorageGet = exports.sesStorageSet = exports.genSequenceRef = exports.refGenerator = exports.removeBackSlashOccurences = exports.stringifyFormatter = exports.removeString = exports.diffArraysByProp = exports.diffArraysByFunc = exports.deepClone = exports.findFirstSequenceMissing = exports.fillNumWithZero = exports.findSequencesMissing = exports.sequencesToNumbers = exports.notInSequence = exports.currencyFormatterCfa = exports.formatToStringCfa = exports.currencyFormatter = exports.formatToString = exports.checkAuth = exports.wakeUp = exports.sleep = exports.limitTo = exports.titleCase = exports.toObjectDate = exports.duplicateObjects = exports.removeDuplicateObjects = exports.getRandomColor = exports.calPercent = exports.percentOf = exports.genDateMinutesStep = exports.formatDateFirstDayFr = void 0;
|
|
7
|
-
exports.toggleProp = exports.roundLastNDigits = exports.removeParamKeyName = exports.countryIsoToFlag = exports.monthStringName = exports.returnBool = exports.formatAmountToString = exports.reduceSum = exports.sumAmount = exports.fillEndWithZero = exports.fillStartWithZero = exports.absFromSequence = exports.returnDates = exports.displayFrDatePeriode = exports.getArrayOfRandomColor = exports.randomHslColor = exports.randomHexColor = exports.randomRgbColor = exports.randomInteger = exports.insertAtInArray = exports.isBirthday = exports.padEndWithZero = exports.padStartWithZero = exports.formatMonthYearToLocaleString = exports.calculPercent = exports.validEmail = exports.convertToCfa = void 0;
|
|
7
|
+
exports.arraySome = exports.toggleProp = exports.roundLastNDigits = exports.removeParamKeyName = exports.countryIsoToFlag = exports.monthStringName = exports.returnBool = exports.formatAmountToString = exports.reduceSum = exports.sumAmount = exports.fillEndWithZero = exports.fillStartWithZero = exports.absFromSequence = exports.returnDates = exports.displayFrDatePeriode = exports.getArrayOfRandomColor = exports.randomHslColor = exports.randomHexColor = exports.randomRgbColor = exports.randomInteger = exports.insertAtInArray = exports.isBirthday = exports.padEndWithZero = exports.padStartWithZero = exports.formatMonthYearToLocaleString = exports.calculPercent = exports.validEmail = exports.convertToCfa = void 0;
|
|
8
8
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
9
9
|
const relativeTime_1 = __importDefault(require("dayjs/plugin/relativeTime"));
|
|
10
10
|
const lodash_1 = __importDefault(require("lodash"));
|
|
@@ -742,3 +742,7 @@ const toggleProp = (tob, propToToggle) => {
|
|
|
742
742
|
return nTob;
|
|
743
743
|
};
|
|
744
744
|
exports.toggleProp = toggleProp;
|
|
745
|
+
const arraySome = (arr1, arr2) => {
|
|
746
|
+
return arr1.some((x) => arr2.includes(x));
|
|
747
|
+
};
|
|
748
|
+
exports.arraySome = arraySome;
|
package/lib/esm/auth/auth.d.ts
CHANGED
package/lib/esm/auth/auth.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { isStaffSte } from "../users/user";
|
|
2
|
+
const arraySome = (arr1, arr2) => {
|
|
3
|
+
return arr1.some((x) => arr2.includes(x));
|
|
4
|
+
};
|
|
2
5
|
const getAuth = (authUser, authSte, param) => {
|
|
3
6
|
var _a, _b, _c, _d, _e, _f;
|
|
4
7
|
if ((param === null || param === void 0 ? void 0 : param.tag) && (authUser === null || authUser === void 0 ? void 0 : authUser.tags.length)) {
|
|
@@ -12,7 +15,10 @@ const getAuth = (authUser, authSte, param) => {
|
|
|
12
15
|
}
|
|
13
16
|
}
|
|
14
17
|
if (((_a = param === null || param === void 0 ? void 0 : param.roles) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
15
|
-
if (isStaffSte(authSte, authUser.ste.name) && ["sadm", ...param.roles].includes(authUser.role.code.toLowerCase())) {
|
|
18
|
+
/* if (isStaffSte(authSte, authUser.ste.name) && ["sadm", ...param.roles].includes(authUser.role.code.toLowerCase())) {
|
|
19
|
+
return true;
|
|
20
|
+
} */
|
|
21
|
+
if (isStaffSte(authSte, authUser.ste.name) && arraySome(["sadm", ...param.roles], authUser.roles)) {
|
|
16
22
|
return true;
|
|
17
23
|
}
|
|
18
24
|
}
|
package/lib/esm/utils.d.ts
CHANGED
|
@@ -103,3 +103,4 @@ export declare const countryIsoToFlag: (code: string) => string;
|
|
|
103
103
|
export declare const removeParamKeyName: (params: any, name?: string) => any;
|
|
104
104
|
export declare const roundLastNDigits: (num: number, digits?: number) => number | false;
|
|
105
105
|
export declare const toggleProp: (tob: any, propToToggle: string) => any;
|
|
106
|
+
export declare const arraySome: (arr1: any[], arr2: any[]) => boolean;
|
package/lib/esm/utils.js
CHANGED