@silexpert/core 1.1.257 → 1.1.259
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/dist/cjs/api/resources/Comment.d.ts +1 -0
- package/dist/cjs/api/resources/Comment.d.ts.map +1 -1
- package/dist/cjs/api/resources/Comment.js +3 -0
- package/dist/cjs/api/resources/Comment.js.map +1 -1
- package/dist/cjs/types/Enum/BrandAnytime.d.ts +457 -0
- package/dist/cjs/types/Enum/BrandAnytime.d.ts.map +1 -0
- package/dist/cjs/types/Enum/BrandAnytime.js +333 -0
- package/dist/cjs/types/Enum/BrandAnytime.js.map +1 -0
- package/dist/cjs/types/Enum/ReportType.d.ts +4 -0
- package/dist/cjs/types/Enum/ReportType.d.ts.map +1 -1
- package/dist/cjs/types/Enum/ReportType.js +4 -0
- package/dist/cjs/types/Enum/ReportType.js.map +1 -1
- package/dist/cjs/types/Enum/StateSynchro.d.ts +5 -0
- package/dist/cjs/types/Enum/StateSynchro.d.ts.map +1 -0
- package/dist/cjs/types/Enum/StateSynchro.js +9 -0
- package/dist/cjs/types/Enum/StateSynchro.js.map +1 -0
- package/dist/cjs/types/Interface/api/calendarEvent/createCalendarEvent.d.ts +1 -0
- package/dist/cjs/types/Interface/api/calendarEvent/createCalendarEvent.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/calendarEvent/createCalendarEvent.js +4 -0
- package/dist/cjs/types/Interface/api/calendarEvent/createCalendarEvent.js.map +1 -1
- package/dist/cjs/types/Interface/models/IBankAccount.d.ts +2 -0
- package/dist/cjs/types/Interface/models/IBankAccount.d.ts.map +1 -1
- package/dist/cjs/types/Interface/models/IBankAccount.js.map +1 -1
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/types/index.js +1 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/utils/bankAccount.d.ts +2 -5
- package/dist/cjs/utils/bankAccount.d.ts.map +1 -1
- package/dist/cjs/utils/bankAccount.js +12 -15
- package/dist/cjs/utils/bankAccount.js.map +1 -1
- package/dist/cjs/utils/brands.d.ts +1 -1
- package/dist/cjs/utils/brands.d.ts.map +1 -1
- package/dist/cjs/utils/brands.js +8 -4
- package/dist/cjs/utils/brands.js.map +1 -1
- package/dist/mjs/api/resources/Comment.d.ts +1 -0
- package/dist/mjs/api/resources/Comment.d.ts.map +1 -1
- package/dist/mjs/api/resources/Comment.js +3 -0
- package/dist/mjs/api/resources/Comment.js.map +1 -1
- package/dist/mjs/types/Enum/BrandAnytime.d.ts +457 -0
- package/dist/mjs/types/Enum/BrandAnytime.d.ts.map +1 -0
- package/dist/mjs/types/Enum/BrandAnytime.js +330 -0
- package/dist/mjs/types/Enum/BrandAnytime.js.map +1 -0
- package/dist/mjs/types/Enum/ReportType.d.ts +4 -0
- package/dist/mjs/types/Enum/ReportType.d.ts.map +1 -1
- package/dist/mjs/types/Enum/ReportType.js +4 -0
- package/dist/mjs/types/Enum/ReportType.js.map +1 -1
- package/dist/mjs/types/Enum/StateSynchro.d.ts +5 -0
- package/dist/mjs/types/Enum/StateSynchro.d.ts.map +1 -0
- package/dist/mjs/types/Enum/StateSynchro.js +6 -0
- package/dist/mjs/types/Enum/StateSynchro.js.map +1 -0
- package/dist/mjs/types/Interface/api/calendarEvent/createCalendarEvent.d.ts +1 -0
- package/dist/mjs/types/Interface/api/calendarEvent/createCalendarEvent.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/calendarEvent/createCalendarEvent.js +5 -0
- package/dist/mjs/types/Interface/api/calendarEvent/createCalendarEvent.js.map +1 -1
- package/dist/mjs/types/Interface/models/IBankAccount.d.ts +2 -0
- package/dist/mjs/types/Interface/models/IBankAccount.d.ts.map +1 -1
- package/dist/mjs/types/Interface/models/IBankAccount.js.map +1 -1
- package/dist/mjs/types/index.d.ts +1 -0
- package/dist/mjs/types/index.d.ts.map +1 -1
- package/dist/mjs/types/index.js +1 -0
- package/dist/mjs/types/index.js.map +1 -1
- package/dist/mjs/utils/bankAccount.d.ts +2 -5
- package/dist/mjs/utils/bankAccount.d.ts.map +1 -1
- package/dist/mjs/utils/bankAccount.js +4 -7
- package/dist/mjs/utils/bankAccount.js.map +1 -1
- package/dist/mjs/utils/brands.d.ts +1 -1
- package/dist/mjs/utils/brands.d.ts.map +1 -1
- package/dist/mjs/utils/brands.js +8 -4
- package/dist/mjs/utils/brands.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/Comment.ts +4 -0
- package/ts/types/Enum/BrandAnytime.ts +330 -0
- package/ts/types/Enum/ReportType.ts +4 -0
- package/ts/types/Enum/StateSynchro.ts +4 -0
- package/ts/types/Interface/api/calendarEvent/createCalendarEvent.ts +3 -0
- package/ts/types/Interface/models/IBankAccount.ts +2 -0
- package/ts/types/index.ts +1 -0
- package/ts/utils/bankAccount.ts +4 -9
- package/ts/utils/brands.ts +9 -4
|
@@ -1,7 +1,4 @@
|
|
|
1
|
+
import { StateSynchro } from '../types/Enum/StateSynchro';
|
|
1
2
|
import { IBankAccount, IBankConnection } from '../types';
|
|
2
|
-
export declare
|
|
3
|
-
SYNCHRONIZED = 1,
|
|
4
|
-
DESYNCHRONIZED = 2
|
|
5
|
-
}
|
|
6
|
-
export declare function isSynchro(params: IBankAccount, dateOfTermination?: Date, bankConnection?: IBankConnection): StateSynchro;
|
|
3
|
+
export declare function getSynchronizationState(params: IBankAccount, dateOfTermination?: Date, bankConnection?: IBankConnection): StateSynchro;
|
|
7
4
|
//# sourceMappingURL=bankAccount.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bankAccount.d.ts","sourceRoot":"","sources":["../../../ts/utils/bankAccount.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"bankAccount.d.ts","sourceRoot":"","sources":["../../../ts/utils/bankAccount.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAIzD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,EAAE,iBAAiB,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,eAAe,GAAI,YAAY,CA6BvI"}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getSynchronizationState = void 0;
|
|
4
4
|
const dayjs = require("dayjs");
|
|
5
|
+
const StateSynchro_1 = require("../types/Enum/StateSynchro");
|
|
5
6
|
const PartnerTransactionType_1 = require("../types/Enum/PartnerTransactionType");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
StateSynchro[StateSynchro["SYNCHRONIZED"] = 1] = "SYNCHRONIZED";
|
|
9
|
-
StateSynchro[StateSynchro["DESYNCHRONIZED"] = 2] = "DESYNCHRONIZED";
|
|
10
|
-
})(StateSynchro = exports.StateSynchro || (exports.StateSynchro = {}));
|
|
11
|
-
function isSynchro(params, dateOfTermination, bankConnection) {
|
|
7
|
+
const class_validator_1 = require("class-validator");
|
|
8
|
+
function getSynchronizationState(params, dateOfTermination, bankConnection) {
|
|
12
9
|
// si le compte est désactivé au niveau budget on le considére comme syncrho
|
|
13
|
-
if (params.disabledAt
|
|
14
|
-
return StateSynchro.SYNCHRONIZED;
|
|
10
|
+
if ((0, class_validator_1.isDefined)(params.disabledAt))
|
|
11
|
+
return StateSynchro_1.StateSynchro.SYNCHRONIZED;
|
|
15
12
|
// // si non Défini alors tjs synchro
|
|
16
13
|
if (params.idPartnerType === null)
|
|
17
|
-
return StateSynchro.SYNCHRONIZED;
|
|
14
|
+
return StateSynchro_1.StateSynchro.SYNCHRONIZED;
|
|
18
15
|
// // Si JE DECLARE ou AUTRE alors tjs synchro
|
|
19
16
|
if (params.idPartnerType && [PartnerTransactionType_1.PartnerTransactionType.JE_DECLARE, PartnerTransactionType_1.PartnerTransactionType.OTHER].includes(params.idPartnerType))
|
|
20
|
-
return StateSynchro.SYNCHRONIZED;
|
|
17
|
+
return StateSynchro_1.StateSynchro.SYNCHRONIZED;
|
|
21
18
|
/** Si budget lastUpdate = la date du jour alors synchro
|
|
22
19
|
* Ou si lastupdate = inProgressImport et lastupdate est après lastTryImport
|
|
23
20
|
*/
|
|
@@ -28,10 +25,10 @@ function isSynchro(params, dateOfTermination, bankConnection) {
|
|
|
28
25
|
(dayjs(params.lastUpdate).format('YYYY-MM-DD') === dayjs(params.inProgressImport).format('YYYY-MM-DD') &&
|
|
29
26
|
(!params.lastTryImport || dayjs(params.lastUpdate).format('YYYYMMDD') >= dayjs(params.lastTryImport).format('YYYYMMDD'))))
|
|
30
27
|
&& (!bankConnection || (bankConnection === null || bankConnection === void 0 ? void 0 : bankConnection.errorCode) === null))
|
|
31
|
-
return StateSynchro.SYNCHRONIZED;
|
|
28
|
+
return StateSynchro_1.StateSynchro.SYNCHRONIZED;
|
|
32
29
|
if (dateOfTermination && (dayjs(params.lastUpdate).isAfter(dateOfTermination) || dayjs(params.lastUpdate).isSame(dateOfTermination)))
|
|
33
|
-
return StateSynchro.SYNCHRONIZED;
|
|
34
|
-
return StateSynchro.DESYNCHRONIZED;
|
|
30
|
+
return StateSynchro_1.StateSynchro.SYNCHRONIZED;
|
|
31
|
+
return StateSynchro_1.StateSynchro.DESYNCHRONIZED;
|
|
35
32
|
}
|
|
36
|
-
exports.
|
|
33
|
+
exports.getSynchronizationState = getSynchronizationState;
|
|
37
34
|
//# sourceMappingURL=bankAccount.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bankAccount.js","sourceRoot":"","sources":["../../../ts/utils/bankAccount.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;
|
|
1
|
+
{"version":3,"file":"bankAccount.js","sourceRoot":"","sources":["../../../ts/utils/bankAccount.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B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AAI,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,SAAS,MAAK,IAAI,CAAC;QAC1D,OAAO,2BAAY,CAAC,YAAY,CAAC;IAEnC,IAAI,iBAAiB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;QAAE,OAAO,2BAAY,CAAC,YAAY,CAAC;IAEvK,OAAO,2BAAY,CAAC,cAAc,CAAC;AACrC,CAAC;AA7BD,0DA6BC","sourcesContent":["import * as dayjs from 'dayjs';\nimport { StateSynchro } from '../types/Enum/StateSynchro';\nimport { IBankAccount, IBankConnection } from '../types';\nimport { PartnerTransactionType } from '../types/Enum/PartnerTransactionType';\nimport { isDefined } from 'class-validator';\n\nexport function getSynchronizationState(params: IBankAccount, dateOfTermination?: Date, bankConnection?: IBankConnection ): StateSynchro {\n // si le compte est désactivé au niveau budget on le considére comme syncrho\n if (isDefined(params.disabledAt)) return StateSynchro.SYNCHRONIZED;\n\n // // si non Défini alors tjs synchro\n if (params.idPartnerType === null) return StateSynchro.SYNCHRONIZED;\n\n // // Si JE DECLARE ou AUTRE alors tjs synchro\n if (params.idPartnerType && [PartnerTransactionType.JE_DECLARE, PartnerTransactionType.OTHER].includes(params.idPartnerType)) return StateSynchro.SYNCHRONIZED;\n\n /** Si budget lastUpdate = la date du jour alors synchro\n * Ou si lastupdate = inProgressImport et lastupdate est après lastTryImport\n */\n if (params.idPartnerType && params.lastUpdate &&\n [PartnerTransactionType.QONTO, PartnerTransactionType.SHINE, PartnerTransactionType.BUDGET_INSIGHT].includes(params.idPartnerType) \n && \n (\n (dayjs(params.lastUpdate).format('YYYY-MM-DD') === dayjs().format('YYYY-MM-DD') ) || // si lastUpdate = date du jour OU\n (\n dayjs(params.lastUpdate).format('YYYY-MM-DD') === dayjs(params.inProgressImport).format('YYYY-MM-DD') &&\n (!params.lastTryImport || dayjs(params.lastUpdate).format('YYYYMMDD') >= dayjs(params.lastTryImport).format('YYYYMMDD')) \n )\n )\n && (!bankConnection || bankConnection?.errorCode === null)\n ) return StateSynchro.SYNCHRONIZED;\n \n if (dateOfTermination && (dayjs(params.lastUpdate).isAfter(dateOfTermination) || dayjs(params.lastUpdate).isSame(dateOfTermination))) return StateSynchro.SYNCHRONIZED;\n \n return StateSynchro.DESYNCHRONIZED;\n}\n"]}
|
|
@@ -22,7 +22,7 @@ type brand = {
|
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
|
-
declare const allBrands: readonly ["Legalstart", "Comptalib", "Clementine", "Pourcentage", "StatutsExpress"];
|
|
25
|
+
declare const allBrands: readonly ["Legalstart", "Comptalib", "Clementine", "Pourcentage", "StatutsExpress", "Anytime"];
|
|
26
26
|
type BrandList = typeof allBrands[number];
|
|
27
27
|
type getBrandConfigParams = {
|
|
28
28
|
idTypeBrand?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brands.d.ts","sourceRoot":"","sources":["../../../ts/utils/brands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"brands.d.ts","sourceRoot":"","sources":["../../../ts/utils/brands.ts"],"names":[],"mappings":"AAQA,KAAK,KAAK,GAAG;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,SAAS,EAAE;QACT,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,UAAU,EAAE;QACV,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE;QACR,KAAK,EAAE;YACL,EAAE,EAAG,MAAM,CAAC;SACb,CAAC;QACF,WAAW,EAAE;YACX,EAAE,EAAG,MAAM,CAAC;SACb,CAAA;KACF,CAAC;CACH,CAAC;AAEF,QAAA,MAAM,SAAS,gGAAiG,CAAC;AACjH,KAAK,SAAS,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;AAE1C,KAAK,oBAAoB,GAAG;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAC;AAEF,QAAA,MAAM,qBAAqB,aAAc,MAAM,KAAG,SAqBjD,CAAC;AAEF,QAAA,MAAM,WAAW,cAAe,SAAS,YAAY,MAAM,KAAG,OAG7D,CAAC;AAEF,QAAA,MAAM,oBAAoB,aAAc,MAAM,YAY7C,CAAC;AAEF,QAAA,MAAM,cAAc,WAAY,oBAAoB,UAqCnD,CAAC;AAEF,QAAA,MAAM,eAAe,UAAW,MAAM,KAAG,YAAY,GAAG,WAAW,GAAG,YAAY,GAAG,aAAa,GAAG,qBAAqB,GAAG,SAAS,GAAG,IASxI,CAAC;AAEF,QAAA,MAAM,eAAe,aAAc,MAAM,KAAG,MAAM,MAAM,CAUvD,CAAC;AAEF,OAAO,EACL,cAAc,EAAE,WAAW,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,eAAe,EAAE,eAAe,GAC3G,CAAC"}
|
package/dist/cjs/utils/brands.js
CHANGED
|
@@ -7,7 +7,8 @@ const BrandLegalstart_1 = require("../types/Enum/BrandLegalstart");
|
|
|
7
7
|
const BrandComptalib_1 = require("../types/Enum/BrandComptalib");
|
|
8
8
|
const BrandPourcentage_1 = require("../types/Enum/BrandPourcentage");
|
|
9
9
|
const BrandStatutsExpress_1 = require("../types/Enum/BrandStatutsExpress");
|
|
10
|
-
const
|
|
10
|
+
const BrandAnytime_1 = require("../types/Enum/BrandAnytime");
|
|
11
|
+
const allBrands = ['Legalstart', 'Comptalib', 'Clementine', 'Pourcentage', 'StatutsExpress', 'Anytime'];
|
|
11
12
|
const getBrandNameByNodeEnv = (nodeEnv) => {
|
|
12
13
|
var _a;
|
|
13
14
|
const env = (_a = nodeEnv !== null && nodeEnv !== void 0 ? nodeEnv : process.env.NODE_ENV) !== null && _a !== void 0 ? _a : process.env.API_HOST;
|
|
@@ -24,6 +25,9 @@ const getBrandNameByNodeEnv = (nodeEnv) => {
|
|
|
24
25
|
if (env.indexOf('statuts') > -1 || env.indexOf('Statuts') > -1) {
|
|
25
26
|
return 'StatutsExpress';
|
|
26
27
|
}
|
|
28
|
+
if (env.indexOf('anytime') > -1 || env.indexOf('Anytime') > -1) {
|
|
29
|
+
return 'Anytime';
|
|
30
|
+
}
|
|
27
31
|
}
|
|
28
32
|
return 'Clementine';
|
|
29
33
|
};
|
|
@@ -38,7 +42,7 @@ const getAllBrandByNodeEnv = (nodeEnv) => {
|
|
|
38
42
|
const nodeEnvUsed = nodeEnv !== null && nodeEnv !== void 0 ? nodeEnv : process.env.NODE_ENV;
|
|
39
43
|
const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);
|
|
40
44
|
const listEnvEnum = {
|
|
41
|
-
BrandClementine: BrandClementine_1.BrandClementine, BrandLegalstart: BrandLegalstart_1.BrandLegalstart, BrandComptalib: BrandComptalib_1.BrandComptalib, BrandPourcentage: BrandPourcentage_1.BrandPourcentage, BrandStatutsExpress: BrandStatutsExpress_1.BrandStatutsExpress,
|
|
45
|
+
BrandClementine: BrandClementine_1.BrandClementine, BrandLegalstart: BrandLegalstart_1.BrandLegalstart, BrandComptalib: BrandComptalib_1.BrandComptalib, BrandPourcentage: BrandPourcentage_1.BrandPourcentage, BrandStatutsExpress: BrandStatutsExpress_1.BrandStatutsExpress, BrandAnytime: BrandAnytime_1.BrandAnytime,
|
|
42
46
|
};
|
|
43
47
|
// @ts-ignore
|
|
44
48
|
const currentConfigFile = listEnvEnum[`Brand${currentEnvName}`];
|
|
@@ -52,7 +56,7 @@ const getBrandConfig = (params) => {
|
|
|
52
56
|
const nodeEnvUsed = nodeEnv !== null && nodeEnv !== void 0 ? nodeEnv : process.env.NODE_ENV;
|
|
53
57
|
const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);
|
|
54
58
|
const listEnvEnum = {
|
|
55
|
-
BrandClementine: BrandClementine_1.BrandClementine, BrandLegalstart: BrandLegalstart_1.BrandLegalstart, BrandComptalib: BrandComptalib_1.BrandComptalib, BrandPourcentage: BrandPourcentage_1.BrandPourcentage, BrandStatutsExpress: BrandStatutsExpress_1.BrandStatutsExpress,
|
|
59
|
+
BrandClementine: BrandClementine_1.BrandClementine, BrandLegalstart: BrandLegalstart_1.BrandLegalstart, BrandComptalib: BrandComptalib_1.BrandComptalib, BrandPourcentage: BrandPourcentage_1.BrandPourcentage, BrandStatutsExpress: BrandStatutsExpress_1.BrandStatutsExpress, BrandAnytime: BrandAnytime_1.BrandAnytime,
|
|
56
60
|
};
|
|
57
61
|
// @ts-ignore
|
|
58
62
|
const currentConfigFile = listEnvEnum[`Brand${currentEnvName}`];
|
|
@@ -101,7 +105,7 @@ const getSubBrandList = (nodeEnv) => {
|
|
|
101
105
|
const nodeEnvUsed = nodeEnv !== null && nodeEnv !== void 0 ? nodeEnv : process.env.NODE_ENV;
|
|
102
106
|
const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);
|
|
103
107
|
const listEnvEnum = {
|
|
104
|
-
BrandClementine: BrandClementine_1.BrandClementine, BrandLegalstart: BrandLegalstart_1.BrandLegalstart, BrandComptalib: BrandComptalib_1.BrandComptalib, BrandPourcentage: BrandPourcentage_1.BrandPourcentage, BrandStatutsExpress: BrandStatutsExpress_1.BrandStatutsExpress,
|
|
108
|
+
BrandClementine: BrandClementine_1.BrandClementine, BrandLegalstart: BrandLegalstart_1.BrandLegalstart, BrandComptalib: BrandComptalib_1.BrandComptalib, BrandPourcentage: BrandPourcentage_1.BrandPourcentage, BrandStatutsExpress: BrandStatutsExpress_1.BrandStatutsExpress, BrandAnytime: BrandAnytime_1.BrandAnytime,
|
|
105
109
|
};
|
|
106
110
|
// @ts-ignore
|
|
107
111
|
const currentConfigFile = listEnvEnum[`Brand${currentEnvName}`];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brands.js","sourceRoot":"","sources":["../../../ts/utils/brands.ts"],"names":[],"mappings":";;;AAAA,mCAA0C;AAC1C,mEAAgE;AAChE,mEAAgE;AAChE,iEAA8D;AAC9D,qEAAkE;AAClE,2EAAwE;AA2BxE,MAAM,SAAS,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,CAAU,CAAC;AAStG,MAAM,qBAAqB,GAAG,CAAC,OAAgB,EAAa,EAAE;;IAC5D,MAAM,GAAG,GAAG,MAAA,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,mCAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;IACpE,IAAI,GAAG,EAAE;QACP,IAAI,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,IAAK,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE;YACjN,OAAO,YAAY,CAAC;SACrB;QACD,IAAI,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE;YAClE,OAAO,WAAW,CAAC;SACpB;QACD,IAAI,GAAG,CAAC,OAAO,CAAC,aAAa,C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AAE,eAAe,EAAf,iCAAe,EAAE,cAAc,EAAd,+BAAc,EAAE,gBAAgB,EAAhB,mCAAgB,EAAE,mBAAmB,EAAnB,yCAAmB;KACxF,CAAC;IACF,aAAa;IACb,MAAM,iBAAiB,GAAY,WAAW,CAAC,QAAQ,cAAc,EAAE,CAAC,CAAC;IAEzE,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC;AAG2F,0CAAe","sourcesContent":["import { get as getLodash } from 'lodash';\nimport { BrandClementine } from '../types/Enum/BrandClementine';\nimport { BrandLegalstart } from '../types/Enum/BrandLegalstart';\nimport { BrandComptalib } from '../types/Enum/BrandComptalib';\nimport { BrandPourcentage } from '../types/Enum/BrandPourcentage';\nimport { BrandStatutsExpress } from '../types/Enum/BrandStatutsExpress';\n\ntype brand = {\n idTypeBrand: number,\n colors: {\n primary: string,\n },\n listMails: {\n bonjour: string,\n },\n listPhones: {\n contact: string,\n },\n name: string,\n urlApi1?: string,\n urlClient?: string,\n urlApp?: string,\n offices?: {\n LAXOU: {\n id : number,\n },\n HOME_OFFICE: {\n id : number,\n }\n },\n};\n\nconst allBrands = ['Legalstart', 'Comptalib', 'Clementine', 'Pourcentage', 'StatutsExpress'] as const;\ntype BrandList = typeof allBrands[number];\n\ntype getBrandConfigParams = {\n idTypeBrand?: number,\n objectWaited?: string,\n nodeEnv?: string\n};\n\nconst getBrandNameByNodeEnv = (nodeEnv?: string): BrandList => {\n const env = nodeEnv ?? process.env.NODE_ENV ?? process.env.API_HOST;\n if (env) {\n if (env.indexOf('legalstart') > -1 || env.indexOf('Legalstart') > -1 || env.indexOf('ComptaStart') > -1 || env.indexOf('comptaStart') > -1 || env.indexOf('Comptastart') > -1 || env.indexOf('comptastart') > -1) {\n return 'Legalstart';\n }\n if (env.indexOf('comptalib') > -1 || env.indexOf('Comptalib') > -1) {\n return 'Comptalib';\n }\n if (env.indexOf('pourcentage') > -1 || env.indexOf('Pourcentage') > -1) {\n return 'Pourcentage';\n }\n if (env.indexOf('statuts') > -1 || env.indexOf('Statuts') > -1) {\n return 'StatutsExpress';\n }\n }\n return 'Clementine';\n};\n\nconst isItThisEnv = (brandList: BrandList, nodeEnv?: string): boolean => {\n const env = nodeEnv ?? process.env.NODE_ENV ?? process.env.API_HOST;\n return getBrandNameByNodeEnv(env) === brandList;\n};\n\nconst getAllBrandByNodeEnv = (nodeEnv?: string): Array<brand> => {\n const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;\n const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);\n const listEnvEnum = {\n BrandClementine, BrandLegalstart, BrandComptalib, BrandPourcentage, BrandStatutsExpress,\n };\n // @ts-ignore\n const currentConfigFile:brand[] = listEnvEnum[`Brand${currentEnvName}`];\n\n const brand = currentConfigFile;\n\n return brand;\n};\n\nconst getBrandConfig = (params: getBrandConfigParams): brand => {\n const {\n idTypeBrand = null, objectWaited = null, nodeEnv,\n } = params;\n let brand;\n const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;\n const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);\n const listEnvEnum = {\n BrandClementine, BrandLegalstart, BrandComptalib, BrandPourcentage, BrandStatutsExpress,\n };\n // @ts-ignore\n const currentConfigFile:brand[] = listEnvEnum[`Brand${currentEnvName}`];\n\n if (idTypeBrand) {\n // Récupération de la brand via idTypeBrand\n brand = currentConfigFile.find((b: brand) => b.idTypeBrand === idTypeBrand);\n }\n // else if (idSociety) {\n // Récupération de la brand via l'idSociety -> impossible directement depuis le core (pas d'accès au resources, ni au token pour l'appel via fetch)\n\n if (!brand) {\n // Si aucune brand trouvée, on passe par défaut la première brand de la liste\n [brand] = currentConfigFile.sort((a: brand, b: brand) => a.idTypeBrand - b.idTypeBrand);\n }\n\n if (objectWaited) {\n // Si on attend un attribut particulier de la brand, on le parcourt\n let objectToReturn = getLodash(brand, objectWaited);\n // Si aucun attribut trouvé, on renvoit celui de Clementine par défaut\n if (!objectToReturn) {\n const brandDefault = currentConfigFile.find((b: brand) => b.name === currentEnvName);\n objectToReturn = getLodash(brandDefault, objectWaited);\n }\n return objectToReturn;\n }\n\n return brand;\n};\n\nconst getBrandByEmail = (email: string): 'Legalstart' | 'Comptalib' | 'Clementine' | 'Pourcentage' | 'Lecomptablefrancais' | 'Statuts' | null => {\n if (email.indexOf('legalstart.fr') > -1 || email.indexOf('comptastartbyclementine.fr') > -1) return 'Legalstart';\n if (email.indexOf('statuts-express.fr') > -1) return 'Statuts';\n if (email.indexOf('comptalib.com') > -1) return 'Comptalib';\n if (email.indexOf('pourcentage.fr') > -1) return 'Pourcentage';\n if (email.indexOf('compta-clementine.fr') > -1) return 'Clementine';\n if (email.indexOf('clementine.fr') > -1) return 'Clementine';\n if (email.indexOf('lecomptablefrancais.fr') > -1) return 'Lecomptablefrancais';\n return null;\n};\n\nconst getSubBrandList = (nodeEnv?: string): Array<object> => {\n const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;\n const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);\n const listEnvEnum = {\n BrandClementine, BrandLegalstart, BrandComptalib, BrandPourcentage, BrandStatutsExpress,\n };\n // @ts-ignore\n const currentConfigFile: brand[] = listEnvEnum[`Brand${currentEnvName}`];\n\n return currentConfigFile;\n};\n\nexport {\n getBrandConfig, isItThisEnv, getAllBrandByNodeEnv, getBrandNameByNodeEnv, getBrandByEmail, getSubBrandList,\n};"]}
|
|
1
|
+
{"version":3,"file":"brands.js","sourceRoot":"","sources":["../../../ts/utils/brands.ts"],"names":[],"mappings":";;;AAAA,mCAA0C;AAC1C,mEAAgE;AAChE,mEAAgE;AAChE,iEAA8D;AAC9D,qEAAkE;AAClE,2EAAwE;AACxE,6DAA0D;AA2B1D,MAAM,SAAS,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,SAAS,CAAU,CAAC;AASjH,MAAM,qBAAqB,GAAG,CAAC,OAAgB,EAAa,EAAE;;IAC5D,MAAM,GAAG,GA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C,CAAC;AAG2F,0CAAe","sourcesContent":["import { get as getLodash } from 'lodash';\nimport { BrandClementine } from '../types/Enum/BrandClementine';\nimport { BrandLegalstart } from '../types/Enum/BrandLegalstart';\nimport { BrandComptalib } from '../types/Enum/BrandComptalib';\nimport { BrandPourcentage } from '../types/Enum/BrandPourcentage';\nimport { BrandStatutsExpress } from '../types/Enum/BrandStatutsExpress';\nimport { BrandAnytime } from '../types/Enum/BrandAnytime';\n\ntype brand = {\n idTypeBrand: number,\n colors: {\n primary: string,\n },\n listMails: {\n bonjour: string,\n },\n listPhones: {\n contact: string,\n },\n name: string,\n urlApi1?: string,\n urlClient?: string,\n urlApp?: string,\n offices?: {\n LAXOU: {\n id : number,\n },\n HOME_OFFICE: {\n id : number,\n }\n },\n};\n\nconst allBrands = ['Legalstart', 'Comptalib', 'Clementine', 'Pourcentage', 'StatutsExpress', 'Anytime'] as const;\ntype BrandList = typeof allBrands[number];\n\ntype getBrandConfigParams = {\n idTypeBrand?: number,\n objectWaited?: string,\n nodeEnv?: string\n};\n\nconst getBrandNameByNodeEnv = (nodeEnv?: string): BrandList => {\n const env = nodeEnv ?? process.env.NODE_ENV ?? process.env.API_HOST;\n if (env) {\n if (env.indexOf('legalstart') > -1 || env.indexOf('Legalstart') > -1 || env.indexOf('ComptaStart') > -1 || env.indexOf('comptaStart') > -1 || env.indexOf('Comptastart') > -1 || env.indexOf('comptastart') > -1) {\n return 'Legalstart';\n }\n if (env.indexOf('comptalib') > -1 || env.indexOf('Comptalib') > -1) {\n return 'Comptalib';\n }\n if (env.indexOf('pourcentage') > -1 || env.indexOf('Pourcentage') > -1) {\n return 'Pourcentage';\n }\n if (env.indexOf('statuts') > -1 || env.indexOf('Statuts') > -1) {\n return 'StatutsExpress';\n }\n\n if (env.indexOf('anytime') > -1 || env.indexOf('Anytime') > -1) {\n return 'Anytime';\n }\n }\n return 'Clementine';\n};\n\nconst isItThisEnv = (brandList: BrandList, nodeEnv?: string): boolean => {\n const env = nodeEnv ?? process.env.NODE_ENV ?? process.env.API_HOST;\n return getBrandNameByNodeEnv(env) === brandList;\n};\n\nconst getAllBrandByNodeEnv = (nodeEnv?: string): Array<brand> => {\n const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;\n const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);\n const listEnvEnum = {\n BrandClementine, BrandLegalstart, BrandComptalib, BrandPourcentage, BrandStatutsExpress, BrandAnytime,\n };\n // @ts-ignore\n const currentConfigFile:brand[] = listEnvEnum[`Brand${currentEnvName}`];\n\n const brand = currentConfigFile;\n\n return brand;\n};\n\nconst getBrandConfig = (params: getBrandConfigParams): brand => {\n const {\n idTypeBrand = null, objectWaited = null, nodeEnv,\n } = params;\n let brand;\n const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;\n const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);\n const listEnvEnum = {\n BrandClementine, BrandLegalstart, BrandComptalib, BrandPourcentage, BrandStatutsExpress, BrandAnytime,\n };\n // @ts-ignore\n const currentConfigFile:brand[] = listEnvEnum[`Brand${currentEnvName}`];\n\n if (idTypeBrand) {\n // Récupération de la brand via idTypeBrand\n brand = currentConfigFile.find((b: brand) => b.idTypeBrand === idTypeBrand);\n }\n // else if (idSociety) {\n // Récupération de la brand via l'idSociety -> impossible directement depuis le core (pas d'accès au resources, ni au token pour l'appel via fetch)\n\n if (!brand) {\n // Si aucune brand trouvée, on passe par défaut la première brand de la liste\n [brand] = currentConfigFile.sort((a: brand, b: brand) => a.idTypeBrand - b.idTypeBrand);\n }\n\n if (objectWaited) {\n // Si on attend un attribut particulier de la brand, on le parcourt\n let objectToReturn = getLodash(brand, objectWaited);\n // Si aucun attribut trouvé, on renvoit celui de Clementine par défaut\n if (!objectToReturn) {\n const brandDefault = currentConfigFile.find((b: brand) => b.name === currentEnvName);\n objectToReturn = getLodash(brandDefault, objectWaited);\n }\n return objectToReturn;\n }\n\n return brand;\n};\n\nconst getBrandByEmail = (email: string): 'Legalstart' | 'Comptalib' | 'Clementine' | 'Pourcentage' | 'Lecomptablefrancais' | 'Statuts' | null => {\n if (email.indexOf('legalstart.fr') > -1 || email.indexOf('comptastartbyclementine.fr') > -1) return 'Legalstart';\n if (email.indexOf('statuts-express.fr') > -1) return 'Statuts';\n if (email.indexOf('comptalib.com') > -1) return 'Comptalib';\n if (email.indexOf('pourcentage.fr') > -1) return 'Pourcentage';\n if (email.indexOf('compta-clementine.fr') > -1) return 'Clementine';\n if (email.indexOf('clementine.fr') > -1) return 'Clementine';\n if (email.indexOf('lecomptablefrancais.fr') > -1) return 'Lecomptablefrancais';\n return null;\n};\n\nconst getSubBrandList = (nodeEnv?: string): Array<object> => {\n const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;\n const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);\n const listEnvEnum = {\n BrandClementine, BrandLegalstart, BrandComptalib, BrandPourcentage, BrandStatutsExpress, BrandAnytime,\n };\n // @ts-ignore\n const currentConfigFile: brand[] = listEnvEnum[`Brand${currentEnvName}`];\n\n return currentConfigFile;\n};\n\nexport {\n getBrandConfig, isItThisEnv, getAllBrandByNodeEnv, getBrandNameByNodeEnv, getBrandByEmail, getSubBrandList,\n};"]}
|
|
@@ -3,5 +3,6 @@ import { IComment } from '../../types';
|
|
|
3
3
|
export declare class Comment extends Resource {
|
|
4
4
|
getAll(params: Partial<IComment>): Promise<Comment[]>;
|
|
5
5
|
create(payload: IComment): Promise<Comment>;
|
|
6
|
+
update(idComment: number, payload: Partial<IComment>): Promise<Comment>;
|
|
6
7
|
}
|
|
7
8
|
//# sourceMappingURL=Comment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Comment.d.ts","sourceRoot":"","sources":["../../../../ts/api/resources/Comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,QAAQ,EACT,MAAM,aAAa,CAAC;AAErB,qBAAa,OAAQ,SAAQ,QAAQ;IACnC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAIrD,MAAM,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Comment.d.ts","sourceRoot":"","sources":["../../../../ts/api/resources/Comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,QAAQ,EACT,MAAM,aAAa,CAAC;AAErB,qBAAa,OAAQ,SAAQ,QAAQ;IACnC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAIrD,MAAM,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IAI3C,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;CAGxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Comment.js","sourceRoot":"","sources":["../../../../ts/api/resources/Comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAKvC,MAAM,OAAO,OAAQ,SAAQ,QAAQ;IACnC,MAAM,CAAC,MAAyB;QAC9B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,MAAM,CAAC,OAAiB;QACtB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;CACF","sourcesContent":["import { Resource } from '../Resource';\nimport {\n IComment,\n} from '../../types';\n\nexport class Comment extends Resource {\n getAll(params: Partial<IComment>): Promise<Comment[]> {\n return this.axios.$get('/comments', { params });\n }\n \n create(payload: IComment): Promise<Comment> {\n return this.axios.$post('/comments', payload);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Comment.js","sourceRoot":"","sources":["../../../../ts/api/resources/Comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAKvC,MAAM,OAAO,OAAQ,SAAQ,QAAQ;IACnC,MAAM,CAAC,MAAyB;QAC9B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,MAAM,CAAC,OAAiB;QACtB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;IAED,MAAM,CAAC,SAAiB,EAAE,OAA0B;QAClD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;CACF","sourcesContent":["import { Resource } from '../Resource';\nimport {\n IComment,\n} from '../../types';\n\nexport class Comment extends Resource {\n getAll(params: Partial<IComment>): Promise<Comment[]> {\n return this.axios.$get('/comments', { params });\n }\n \n create(payload: IComment): Promise<Comment> {\n return this.axios.$post('/comments', payload);\n }\n\n update(idComment: number, payload: Partial<IComment>): Promise<Comment> {\n return this.axios.$put(`/comments/${idComment}`, payload);\n }\n}\n"]}
|