asv-hlps 1.2.72 → 1.2.75
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/bootstrap.d.ts +1 -1
- package/lib/cjs/models/types/Type.d.ts +1 -1
- package/lib/cjs/npms/typeorm.d.ts +1 -1
- package/lib/cjs/npms/yup.d.ts +33 -45
- package/lib/cjs/npms/yup.js +2 -1
- package/lib/cjs/services/authService.d.ts +1 -1
- package/lib/cjs/utils.d.ts +1 -0
- package/lib/cjs/utils.js +7 -1
- package/lib/esm/bootstrap.d.ts +1 -1
- package/lib/esm/models/types/Type.d.ts +1 -1
- package/lib/esm/npms/typeorm.d.ts +1 -1
- package/lib/esm/npms/yup.d.ts +33 -45
- package/lib/esm/npms/yup.js +2 -1
- package/lib/esm/services/authService.d.ts +1 -1
- package/lib/esm/utils.d.ts +1 -0
- package/lib/esm/utils.js +5 -0
- package/package.json +8 -8
package/lib/cjs/bootstrap.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type VariantType = "warning" | "purple" | "secondary" | "pink" | "primary" | "success" | "danger" | "light" | "white" | "info" | "link" | string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type opDatesType = "currentDate" | "currentMonth" | "subCurrentMonth" | "currentYear" | "subCurrentYear" | "after16March";
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
* @param qb typeorm queryselectoer
|
package/lib/cjs/npms/yup.d.ts
CHANGED
|
@@ -1,47 +1,35 @@
|
|
|
1
1
|
import * as yup from "yup";
|
|
2
|
-
export declare const schemaNaCoSh: (url: string, tob: any, codeMaxLenth?: number) => yup.ObjectSchema<
|
|
3
|
-
name:
|
|
4
|
-
code:
|
|
5
|
-
shortname:
|
|
6
|
-
}
|
|
7
|
-
name:
|
|
8
|
-
code:
|
|
9
|
-
shortname:
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
name:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
export declare const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
36
|
-
username: import("yup/lib/string").RequiredStringSchema<string, import("yup/lib/types").AnyObject>;
|
|
37
|
-
password: import("yup/lib/string").RequiredStringSchema<string, import("yup/lib/types").AnyObject>;
|
|
38
|
-
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
39
|
-
username: import("yup/lib/string").RequiredStringSchema<string, import("yup/lib/types").AnyObject>;
|
|
40
|
-
password: import("yup/lib/string").RequiredStringSchema<string, import("yup/lib/types").AnyObject>;
|
|
41
|
-
}>>>;
|
|
42
|
-
export declare const yupValideUniqName: (url: string, tob: any) => import("yup/lib/string").RequiredStringSchema<string, import("yup/lib/types").AnyObject>;
|
|
43
|
-
export declare const yupValideUniqEmail: (url: string, tob: any, isRequired?: boolean) => yup.StringSchema<string, import("yup/lib/types").AnyObject, string>;
|
|
44
|
-
export declare const yupValideUniqNumber: (url: string, tob: any, isRequired?: boolean) => yup.NumberSchema<number, import("yup/lib/types").AnyObject, number>;
|
|
45
|
-
export declare const yupValideUniqCode: (url: string, max: number, tob: any) => import("yup/lib/string").RequiredStringSchema<string, import("yup/lib/types").AnyObject>;
|
|
46
|
-
export declare const yupValidateNoRequiredNumber: () => yup.StringSchema<string, import("yup/lib/types").AnyObject, string>;
|
|
2
|
+
export declare const schemaNaCoSh: (url: string, tob: any, codeMaxLenth?: number) => yup.ObjectSchema<{
|
|
3
|
+
name: string;
|
|
4
|
+
code: string;
|
|
5
|
+
shortname: string;
|
|
6
|
+
}, yup.AnyObject, {
|
|
7
|
+
name: undefined;
|
|
8
|
+
code: undefined;
|
|
9
|
+
shortname: undefined;
|
|
10
|
+
}, "">;
|
|
11
|
+
export declare const schemaNaCo: (url: string, tob: any, codeMaxLenth?: number) => yup.ObjectSchema<{
|
|
12
|
+
name: string;
|
|
13
|
+
code: string;
|
|
14
|
+
}, yup.AnyObject, {
|
|
15
|
+
name: undefined;
|
|
16
|
+
code: undefined;
|
|
17
|
+
}, "">;
|
|
18
|
+
export declare const schemaNa: (url: string, tob: any) => yup.ObjectSchema<{
|
|
19
|
+
name: string;
|
|
20
|
+
}, yup.AnyObject, {
|
|
21
|
+
name: undefined;
|
|
22
|
+
}, "">;
|
|
23
|
+
export declare const schemaLogin: () => yup.ObjectSchema<{
|
|
24
|
+
username: string;
|
|
25
|
+
password: string;
|
|
26
|
+
}, yup.AnyObject, {
|
|
27
|
+
username: undefined;
|
|
28
|
+
password: undefined;
|
|
29
|
+
}, "">;
|
|
30
|
+
export declare const yupValideUniqName: (url: string, tob: any) => yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
|
31
|
+
export declare const yupValideUniqEmail: (url: string, tob: any, isRequired?: boolean) => yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
|
32
|
+
export declare const yupValideUniqNumber: (url: string, tob: any, isRequired?: boolean) => yup.NumberSchema<number, yup.AnyObject, undefined, "">;
|
|
33
|
+
export declare const yupValideUniqCode: (url: string, max: number, tob: any) => yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
|
34
|
+
export declare const yupValidateNoRequiredNumber: () => yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
|
47
35
|
export declare const formatSelectOptions: (objs: any[], propLabel?: string, propValue?: string) => any[];
|
package/lib/cjs/npms/yup.js
CHANGED
package/lib/cjs/utils.d.ts
CHANGED
|
@@ -86,6 +86,7 @@ export declare const absFromSequence: (arr: number[]) => number[];
|
|
|
86
86
|
export declare const fillStartWithZero: (num: string | number, targetLength: number) => string;
|
|
87
87
|
export declare const fillEndWithZero: (num: string | number, targetLength: number) => string;
|
|
88
88
|
export declare const sumAmount: (tobs: any[], property: string) => number;
|
|
89
|
+
export declare const reduceSum: (tobs: any[], property: string) => number;
|
|
89
90
|
export declare const formatAmountToString: (amount: number, opt?: {
|
|
90
91
|
math?: "ceil" | "floor";
|
|
91
92
|
currency?: "cfa";
|
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.validEmail = exports.convertToCfa = exports.packAndUnit = exports.unCheckedAll = exports.inputChecked = exports.arrayMultiChecked = exports.getColorAccordingToDate = exports.genRandomColour = exports.formatNgbDate = exports.dateToString = exports.replaceSpacesWith = exports.replaceAllIn = exports.sesStorageGet = exports.sesStorageSet = exports.genSequenceRef = exports.removeBackSlashOccurences = exports.removeString = exports.deepClone = exports.findFirstSequenceMissing = exports.fillNumWithZero = exports.findSequencesMissing = exports.sequencesToNumbers = exports.notInSequence = exports.reformatDates = exports.formatToStringCfa = exports.formatToString = exports.wakeUp = exports.sleep = exports.limitTo = exports.titleCase = exports.toObjectDate = exports.removeDuplicatesByKey = exports.removeDuplicates = exports.getRandomColor = exports.getNbOfDaysBetweenTwoDates = exports.displayDateRangeFr = exports.calPercent = exports.percentOf = exports.genDateMinutesStep = exports.convertFrDateToEnDate = exports.convertEnDateToFr = exports.formatDateMd = exports.formatDateYm = exports.formatDateYmFirstDay = exports.formatDateYmd = exports.formatFromAndToDate = exports.formatDateYmHypen = exports.formatDateFirstDayFr = exports.formatDateYmdHypenFr = exports.formatDateYmdHypen = void 0;
|
|
7
|
-
exports.monthStringName = exports.returnBool = exports.formatAmountToString = 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 = void 0;
|
|
7
|
+
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 = void 0;
|
|
8
8
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
9
9
|
require("dayjs/locale/fr");
|
|
10
10
|
const formatDateYmdHypen = (date) => {
|
|
@@ -501,6 +501,12 @@ const sumAmount = (tobs, property) => {
|
|
|
501
501
|
}, 0);
|
|
502
502
|
};
|
|
503
503
|
exports.sumAmount = sumAmount;
|
|
504
|
+
const reduceSum = (tobs, property) => {
|
|
505
|
+
return tobs.reduce((prev, curr) => {
|
|
506
|
+
return +prev + +curr[property];
|
|
507
|
+
}, 0);
|
|
508
|
+
};
|
|
509
|
+
exports.reduceSum = reduceSum;
|
|
504
510
|
const formatAmountToString = (amount, opt) => {
|
|
505
511
|
let getAmount = amount;
|
|
506
512
|
switch (opt === null || opt === void 0 ? void 0 : opt.math) {
|
package/lib/esm/bootstrap.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type VariantType = "warning" | "purple" | "secondary" | "pink" | "primary" | "success" | "danger" | "light" | "white" | "info" | "link" | string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type opDatesType = "currentDate" | "currentMonth" | "subCurrentMonth" | "currentYear" | "subCurrentYear" | "after16March";
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
* @param qb typeorm queryselectoer
|
package/lib/esm/npms/yup.d.ts
CHANGED
|
@@ -1,47 +1,35 @@
|
|
|
1
1
|
import * as yup from "yup";
|
|
2
|
-
export declare const schemaNaCoSh: (url: string, tob: any, codeMaxLenth?: number) => yup.ObjectSchema<
|
|
3
|
-
name:
|
|
4
|
-
code:
|
|
5
|
-
shortname:
|
|
6
|
-
}
|
|
7
|
-
name:
|
|
8
|
-
code:
|
|
9
|
-
shortname:
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
name:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
export declare const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
36
|
-
username: import("yup/lib/string").RequiredStringSchema<string, import("yup/lib/types").AnyObject>;
|
|
37
|
-
password: import("yup/lib/string").RequiredStringSchema<string, import("yup/lib/types").AnyObject>;
|
|
38
|
-
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
39
|
-
username: import("yup/lib/string").RequiredStringSchema<string, import("yup/lib/types").AnyObject>;
|
|
40
|
-
password: import("yup/lib/string").RequiredStringSchema<string, import("yup/lib/types").AnyObject>;
|
|
41
|
-
}>>>;
|
|
42
|
-
export declare const yupValideUniqName: (url: string, tob: any) => import("yup/lib/string").RequiredStringSchema<string, import("yup/lib/types").AnyObject>;
|
|
43
|
-
export declare const yupValideUniqEmail: (url: string, tob: any, isRequired?: boolean) => yup.StringSchema<string, import("yup/lib/types").AnyObject, string>;
|
|
44
|
-
export declare const yupValideUniqNumber: (url: string, tob: any, isRequired?: boolean) => yup.NumberSchema<number, import("yup/lib/types").AnyObject, number>;
|
|
45
|
-
export declare const yupValideUniqCode: (url: string, max: number, tob: any) => import("yup/lib/string").RequiredStringSchema<string, import("yup/lib/types").AnyObject>;
|
|
46
|
-
export declare const yupValidateNoRequiredNumber: () => yup.StringSchema<string, import("yup/lib/types").AnyObject, string>;
|
|
2
|
+
export declare const schemaNaCoSh: (url: string, tob: any, codeMaxLenth?: number) => yup.ObjectSchema<{
|
|
3
|
+
name: string;
|
|
4
|
+
code: string;
|
|
5
|
+
shortname: string;
|
|
6
|
+
}, yup.AnyObject, {
|
|
7
|
+
name: undefined;
|
|
8
|
+
code: undefined;
|
|
9
|
+
shortname: undefined;
|
|
10
|
+
}, "">;
|
|
11
|
+
export declare const schemaNaCo: (url: string, tob: any, codeMaxLenth?: number) => yup.ObjectSchema<{
|
|
12
|
+
name: string;
|
|
13
|
+
code: string;
|
|
14
|
+
}, yup.AnyObject, {
|
|
15
|
+
name: undefined;
|
|
16
|
+
code: undefined;
|
|
17
|
+
}, "">;
|
|
18
|
+
export declare const schemaNa: (url: string, tob: any) => yup.ObjectSchema<{
|
|
19
|
+
name: string;
|
|
20
|
+
}, yup.AnyObject, {
|
|
21
|
+
name: undefined;
|
|
22
|
+
}, "">;
|
|
23
|
+
export declare const schemaLogin: () => yup.ObjectSchema<{
|
|
24
|
+
username: string;
|
|
25
|
+
password: string;
|
|
26
|
+
}, yup.AnyObject, {
|
|
27
|
+
username: undefined;
|
|
28
|
+
password: undefined;
|
|
29
|
+
}, "">;
|
|
30
|
+
export declare const yupValideUniqName: (url: string, tob: any) => yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
|
31
|
+
export declare const yupValideUniqEmail: (url: string, tob: any, isRequired?: boolean) => yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
|
32
|
+
export declare const yupValideUniqNumber: (url: string, tob: any, isRequired?: boolean) => yup.NumberSchema<number, yup.AnyObject, undefined, "">;
|
|
33
|
+
export declare const yupValideUniqCode: (url: string, max: number, tob: any) => yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
|
34
|
+
export declare const yupValidateNoRequiredNumber: () => yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
|
47
35
|
export declare const formatSelectOptions: (objs: any[], propLabel?: string, propValue?: string) => any[];
|
package/lib/esm/npms/yup.js
CHANGED
package/lib/esm/utils.d.ts
CHANGED
|
@@ -86,6 +86,7 @@ export declare const absFromSequence: (arr: number[]) => number[];
|
|
|
86
86
|
export declare const fillStartWithZero: (num: string | number, targetLength: number) => string;
|
|
87
87
|
export declare const fillEndWithZero: (num: string | number, targetLength: number) => string;
|
|
88
88
|
export declare const sumAmount: (tobs: any[], property: string) => number;
|
|
89
|
+
export declare const reduceSum: (tobs: any[], property: string) => number;
|
|
89
90
|
export declare const formatAmountToString: (amount: number, opt?: {
|
|
90
91
|
math?: "ceil" | "floor";
|
|
91
92
|
currency?: "cfa";
|
package/lib/esm/utils.js
CHANGED
|
@@ -427,6 +427,11 @@ export const sumAmount = (tobs, property) => {
|
|
|
427
427
|
return +prev + +curr[property];
|
|
428
428
|
}, 0);
|
|
429
429
|
};
|
|
430
|
+
export const reduceSum = (tobs, property) => {
|
|
431
|
+
return tobs.reduce((prev, curr) => {
|
|
432
|
+
return +prev + +curr[property];
|
|
433
|
+
}, 0);
|
|
434
|
+
};
|
|
430
435
|
export const formatAmountToString = (amount, opt) => {
|
|
431
436
|
let getAmount = amount;
|
|
432
437
|
switch (opt === null || opt === void 0 ? void 0 : opt.math) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "asv-hlps",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.75",
|
|
4
4
|
"description": "helpers",
|
|
5
5
|
"main": "./lib/cjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -17,19 +17,19 @@
|
|
|
17
17
|
"license": "ISC",
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/bcryptjs": "^2.4.2",
|
|
20
|
-
"@types/pdfmake": "^0.2.
|
|
20
|
+
"@types/pdfmake": "^0.2.2",
|
|
21
21
|
"@types/randomatic": "^3.1.3",
|
|
22
|
-
"@types/react": "^18.0
|
|
23
|
-
"typescript": "^
|
|
22
|
+
"@types/react": "^18.2.0",
|
|
23
|
+
"typescript": "^5.0.4"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"axios": "^
|
|
26
|
+
"axios": "^1.3.6",
|
|
27
27
|
"bcryptjs": "^2.4.3",
|
|
28
|
-
"classnames": "^2.3.
|
|
28
|
+
"classnames": "^2.3.2",
|
|
29
29
|
"dayjs": "^1.11.7",
|
|
30
30
|
"jwt-decode": "^3.1.2",
|
|
31
|
-
"pdfmake": "^0.2.
|
|
31
|
+
"pdfmake": "^0.2.7",
|
|
32
32
|
"randomatic": "^3.1.1",
|
|
33
|
-
"yup": "^
|
|
33
|
+
"yup": "^1.1.1"
|
|
34
34
|
}
|
|
35
35
|
}
|