@silexpert/core 0.4.83 → 0.4.86
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/es/api/resources/Society.d.ts +2 -1
- package/es/api/resources/Society.d.ts.map +1 -1
- package/es/api/resources/Society.js +3 -0
- package/es/api/resources/Society.js.map +1 -1
- package/es/types/Enum/BrandClementine.d.ts +62 -0
- package/es/types/Enum/BrandClementine.d.ts.map +1 -0
- package/es/types/Enum/BrandClementine.js +74 -0
- package/es/types/Enum/BrandClementine.js.map +1 -0
- package/es/types/Enum/BrandComptalib.d.ts +26 -0
- package/es/types/Enum/BrandComptalib.d.ts.map +1 -0
- package/es/types/Enum/BrandComptalib.js +53 -0
- package/es/types/Enum/BrandComptalib.js.map +1 -0
- package/es/types/Enum/BrandLegalstart.d.ts +26 -0
- package/es/types/Enum/BrandLegalstart.d.ts.map +1 -0
- package/es/types/Enum/BrandLegalstart.js +28 -0
- package/es/types/Enum/BrandLegalstart.js.map +1 -0
- package/es/types/Interface/api/society/QuerySociety.d.ts +5 -0
- package/es/types/Interface/api/society/QuerySociety.d.ts.map +1 -0
- package/es/types/Interface/api/society/QuerySociety.js +21 -0
- package/es/types/Interface/api/society/QuerySociety.js.map +1 -0
- package/es/types/index.d.ts +4 -0
- package/es/types/index.d.ts.map +1 -1
- package/es/types/index.js +4 -0
- package/es/types/index.js.map +1 -1
- package/es/utils/brands.d.ts +12 -0
- package/es/utils/brands.d.ts.map +1 -0
- package/es/utils/brands.js +54 -0
- package/es/utils/brands.js.map +1 -0
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.d.ts.map +1 -1
- package/es/utils/index.js +1 -0
- package/es/utils/index.js.map +1 -1
- package/js/api/resources/Society.js +6 -0
- package/js/api/resources/Society.js.map +1 -1
- package/js/types/Enum/BrandClementine.js +73 -0
- package/js/types/Enum/BrandClementine.js.map +1 -0
- package/js/types/Enum/BrandComptalib.js +55 -0
- package/js/types/Enum/BrandComptalib.js.map +1 -0
- package/js/types/Enum/BrandLegalstart.js +31 -0
- package/js/types/Enum/BrandLegalstart.js.map +1 -0
- package/js/types/Interface/api/society/QuerySociety.js +29 -0
- package/js/types/Interface/api/society/QuerySociety.js.map +1 -0
- package/js/types/index.js +48 -0
- package/js/types/index.js.map +1 -1
- package/js/utils/brands.js +82 -0
- package/js/utils/brands.js.map +1 -0
- package/js/utils/index.js +12 -0
- package/js/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/Society.ts +5 -0
- package/ts/types/Enum/BrandClementine.ts +73 -0
- package/ts/types/Enum/BrandComptalib.ts +52 -0
- package/ts/types/Enum/BrandLegalstart.ts +27 -0
- package/ts/types/Interface/api/society/QuerySociety.ts +9 -0
- package/ts/types/index.ts +4 -0
- package/ts/utils/brands.ts +71 -0
- package/ts/utils/index.ts +1 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const BrandLegalstart = [
|
|
2
|
+
{
|
|
3
|
+
idTypeBrand: 1,
|
|
4
|
+
name: 'LegalStart',
|
|
5
|
+
colors: {
|
|
6
|
+
primary: '#16a974',
|
|
7
|
+
},
|
|
8
|
+
listMails: {
|
|
9
|
+
administratif: 'comptastart@legalstart.fr',
|
|
10
|
+
app: 'comptastart@legalstart.fr',
|
|
11
|
+
bonjour: 'comptastart@legalstart.fr',
|
|
12
|
+
contact: 'comptastart@legalstart.fr',
|
|
13
|
+
facturation: 'comptastart@legalstart.fr',
|
|
14
|
+
feedback: 'comptastart@legalstart.fr',
|
|
15
|
+
juridique: 'comptastart@legalstart.fr',
|
|
16
|
+
informatique: 'comptastart@legalstart.fr',
|
|
17
|
+
msd: 'comptastart@legalstart.fr',
|
|
18
|
+
noreply: 'comptastart@legalstart.fr',
|
|
19
|
+
qualite: 'comptastart@legalstart.fr',
|
|
20
|
+
paiement: 'comptastart@legalstart.fr',
|
|
21
|
+
social: 'comptastart@legalstart.fr',
|
|
22
|
+
support: 'comptastart@legalstart.fr',
|
|
23
|
+
tva: 'comptastart@legalstart.fr',
|
|
24
|
+
wb: 'comptastart@legalstart.fr',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
];
|
package/ts/types/index.ts
CHANGED
|
@@ -350,6 +350,9 @@ export * from './Enum/Notification';
|
|
|
350
350
|
export * from './Enum/Comment';
|
|
351
351
|
export * from './Enum/Channel';
|
|
352
352
|
export * from './Enum/ExerciceNoteType';
|
|
353
|
+
export * from './Enum/BrandClementine';
|
|
354
|
+
export * from './Enum/BrandLegalstart';
|
|
355
|
+
export * from './Enum/BrandComptalib';
|
|
353
356
|
|
|
354
357
|
// Interfaces API
|
|
355
358
|
export * from './Interface/api/businessPartner/ReadBusinessPartner';
|
|
@@ -382,6 +385,7 @@ export * from './Interface/api/file/TFile';
|
|
|
382
385
|
export * from './Interface/api/cerfa/CreateCerfa';
|
|
383
386
|
export * from './Interface/api/customerProviderOperation/CreateCustomerProviderOperation';
|
|
384
387
|
export * from './Interface/api/society/LegalFormSiren';
|
|
388
|
+
export * from './Interface/api/society/QuerySociety';
|
|
385
389
|
export * from './Interface/api/society/GetDataSociety';
|
|
386
390
|
export * from './Interface/api/society/CreateSociety';
|
|
387
391
|
export * from './Interface/api/society/UpdateSociety';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { get as getLodash } from 'lodash';
|
|
2
|
+
import { BrandClementine } from '../types/Enum/BrandClementine';
|
|
3
|
+
import { BrandLegalstart } from '../types/Enum/BrandLegalstart';
|
|
4
|
+
import { BrandComptalib } from '../types/Enum/BrandComptalib';
|
|
5
|
+
|
|
6
|
+
type brand = {
|
|
7
|
+
idTypeBrand: number,
|
|
8
|
+
name: string
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
type getBrandConfigParams = {
|
|
12
|
+
idTypeBrand?: number,
|
|
13
|
+
objectWaited?: string,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const getBrandNameByNodeEnv = (): 'Legalstart'| 'Comptalib' | 'Clementine' => {
|
|
17
|
+
if (process.env.NODE_ENV) {
|
|
18
|
+
if (['staging_legalstart', 'production_legalstart'].includes(process.env.NODE_ENV)) {
|
|
19
|
+
return 'Legalstart';
|
|
20
|
+
}
|
|
21
|
+
if (['staging_comptalib', 'production_comptalib'].includes(process.env.NODE_ENV)) {
|
|
22
|
+
return 'Comptalib';
|
|
23
|
+
}
|
|
24
|
+
} else if (process.env.API_HOST) {
|
|
25
|
+
if (process.env.API_HOST.indexOf('legalstart') > -1) {
|
|
26
|
+
return 'Legalstart';
|
|
27
|
+
}
|
|
28
|
+
if (process.env.API_HOST.indexOf('comptalib') > -1) {
|
|
29
|
+
return 'Comptalib';
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return 'Clementine';
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const getBrandConfig = (params: getBrandConfigParams): brand => {
|
|
36
|
+
const {
|
|
37
|
+
idTypeBrand = null, objectWaited = null,
|
|
38
|
+
} = params;
|
|
39
|
+
let brand;
|
|
40
|
+
const currentEnvName = getBrandNameByNodeEnv();
|
|
41
|
+
const listEnvEnum = { BrandClementine, BrandLegalstart, BrandComptalib };
|
|
42
|
+
// @ts-ignore
|
|
43
|
+
const currentConfigFile:brand[] = listEnvEnum[`Brand${currentEnvName}`];
|
|
44
|
+
|
|
45
|
+
if (idTypeBrand) {
|
|
46
|
+
// Récupération de la brand via idTypeBrand
|
|
47
|
+
brand = currentConfigFile.find((b: brand) => b.idTypeBrand === idTypeBrand);
|
|
48
|
+
}
|
|
49
|
+
// else if (idSociety) {
|
|
50
|
+
// 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)
|
|
51
|
+
|
|
52
|
+
if (!brand) {
|
|
53
|
+
// Si aucune brand trouvée, on passe par défaut la première brand de la liste
|
|
54
|
+
[brand] = currentConfigFile.sort((a: brand, b: brand) => a.idTypeBrand - b.idTypeBrand);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (objectWaited) {
|
|
58
|
+
// Si on attend un attribut particulier de la brand, on le parcourt
|
|
59
|
+
let objectToReturn = getLodash(brand, objectWaited);
|
|
60
|
+
// Si aucun attribut trouvé, on renvoit celui de Clementine par défaut
|
|
61
|
+
if (!objectToReturn) {
|
|
62
|
+
const brandDefault = currentConfigFile.find((b: brand) => b.name === currentEnvName);
|
|
63
|
+
objectToReturn = getLodash(brandDefault, objectWaited);
|
|
64
|
+
}
|
|
65
|
+
return objectToReturn;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return brand;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export { getBrandConfig, getBrandNameByNodeEnv };
|
package/ts/utils/index.ts
CHANGED