@metarisc/metarisc-js 0.0.1-alpha.64 → 0.0.1-alpha.66

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.
Files changed (180) hide show
  1. package/.eslintrc +28 -0
  2. package/README.md +32 -5
  3. package/lib/api/AnomaliesAPI.d.ts +10 -6
  4. package/lib/api/AnomaliesAPI.js +8 -8
  5. package/lib/api/CommissionsAPI.d.ts +10 -19
  6. package/lib/api/CommissionsAPI.js +4 -52
  7. package/lib/api/ContactsAPI.d.ts +14 -1
  8. package/lib/api/ContactsAPI.js +2 -2
  9. package/lib/api/ControlesPeiAPI.d.ts +27 -0
  10. package/lib/api/ControlesPeiAPI.js +47 -0
  11. package/lib/api/DatesPassageCommissionAPI.d.ts +23 -0
  12. package/lib/api/DatesPassageCommissionAPI.js +47 -0
  13. package/lib/api/DocumentsAPI.d.ts +5 -1
  14. package/lib/api/DocumentsAPI.js +2 -2
  15. package/lib/api/DossiersAPI.d.ts +24 -24
  16. package/lib/api/DossiersAPI.js +6 -66
  17. package/lib/api/ERPAPI.d.ts +42 -4
  18. package/lib/api/ERPAPI.js +8 -8
  19. package/lib/api/EvenementsAPI.d.ts +8 -2
  20. package/lib/api/EvenementsAPI.js +4 -4
  21. package/lib/api/FeedAPI.d.ts +5 -1
  22. package/lib/api/FeedAPI.js +2 -2
  23. package/lib/api/HealthcheckAPI.d.ts +10 -0
  24. package/lib/api/HealthcheckAPI.js +23 -0
  25. package/lib/api/MoiAPI.d.ts +1 -1
  26. package/lib/api/MoiAPI.js +1 -1
  27. package/lib/api/NotificationsAPI.d.ts +9 -1
  28. package/lib/api/NotificationsAPI.js +2 -2
  29. package/lib/api/OrdresDuJourAPI.d.ts +15 -0
  30. package/lib/api/OrdresDuJourAPI.js +23 -0
  31. package/lib/api/OrganisationsAPI.d.ts +29 -4
  32. package/lib/api/OrganisationsAPI.js +26 -2
  33. package/lib/api/PEIAPI.d.ts +45 -4
  34. package/lib/api/PEIAPI.js +8 -8
  35. package/lib/api/PingAPI.d.ts +0 -6
  36. package/lib/api/PingAPI.js +0 -13
  37. package/lib/api/PrescriptionsAPI.d.ts +13 -2
  38. package/lib/api/PrescriptionsAPI.js +4 -4
  39. package/lib/api/TournesDECIAPI.d.ts +28 -15
  40. package/lib/api/TournesDECIAPI.js +6 -42
  41. package/lib/api/WorkflowsAPI.d.ts +76 -0
  42. package/lib/api/WorkflowsAPI.js +71 -0
  43. package/lib/core.d.ts +6 -0
  44. package/lib/core.js +13 -1
  45. package/lib/index.d.ts +5 -0
  46. package/lib/index.js +11 -1
  47. package/lib/metarisc.d.ts +10 -0
  48. package/lib/metarisc.js +15 -0
  49. package/lib/model/ActiviteErp.d.ts +2 -10
  50. package/lib/model/ActiviteErp.js +2 -10
  51. package/lib/model/AdressePostale.d.ts +2 -4
  52. package/lib/model/AnomalieDECI.d.ts +0 -3
  53. package/lib/model/AnomaliePEI.d.ts +1 -1
  54. package/lib/model/Avis.d.ts +4 -4
  55. package/lib/model/Avis.js +6 -6
  56. package/lib/model/Contact.d.ts +6 -1
  57. package/lib/model/Contact.js +7 -0
  58. package/lib/model/DescriptifTechniqueDECI.d.ts +2 -2
  59. package/lib/model/DescriptifTechniqueDECIBase.d.ts +0 -8
  60. package/lib/model/DescriptifTechniqueERP.d.ts +2 -7
  61. package/lib/model/DescriptifTechniqueERP.js +8 -14
  62. package/lib/model/DescriptifTechniqueERPBase.d.ts +3 -11
  63. package/lib/model/DescriptifTechniqueERPBase.js +8 -14
  64. package/lib/model/DescriptifTechniquePENA.d.ts +2 -1
  65. package/lib/model/DescriptifTechniquePIBI.d.ts +1 -4
  66. package/lib/model/Dossier.d.ts +4 -5
  67. package/lib/model/ERP.d.ts +6 -9
  68. package/lib/model/FeedMessage.d.ts +1 -1
  69. package/lib/model/FeedMessageTexte.d.ts +1 -1
  70. package/lib/model/ModelError.d.ts +0 -15
  71. package/lib/model/Notification.d.ts +8 -6
  72. package/lib/model/Notification.js +5 -0
  73. package/lib/model/OrganisationGeoservice.d.ts +1 -1
  74. package/lib/model/OrganisationMembre.d.ts +3 -4
  75. package/lib/model/PEI.d.ts +4 -9
  76. package/lib/model/PEI.js +0 -6
  77. package/lib/model/PassageCommissionDossier.d.ts +2 -3
  78. package/lib/model/Prescription.d.ts +1 -2
  79. package/lib/model/PrescriptionSupportReglementaire.d.ts +0 -3
  80. package/lib/model/{ERPReferencesExterieuresInner.d.ts → ReferenceExterieure.d.ts} +1 -1
  81. package/{src/model/GetReglesDeciOrgOrganisations200Response.ts → lib/model/ReglesDeci.d.ts} +4 -2
  82. package/lib/model/TourneeDeci.d.ts +1 -2
  83. package/lib/model/TourneeDeciModele.d.ts +1 -1
  84. package/lib/model/TourneeDeciPei.d.ts +2 -3
  85. package/lib/model/TourneeDeciPeiListeAnomaliesInner.d.ts +1 -2
  86. package/lib/model/TourneeDeciSimple.d.ts +2 -3
  87. package/lib/model/Workflow.d.ts +9 -9
  88. package/lib/model/WorkflowAnalyseDeRisque.d.ts +3 -3
  89. package/lib/model/WorkflowArriveeSecretariat.d.ts +2 -2
  90. package/lib/model/WorkflowConsultationSis.d.ts +2 -2
  91. package/lib/model/WorkflowDossiersLies.d.ts +2 -2
  92. package/lib/model/WorkflowPassageCommissionSecurite.d.ts +3 -3
  93. package/lib/model/WorkflowRelectureSecretariat.d.ts +1 -1
  94. package/lib/model/WorkflowRemiseEnServicePEI.d.ts +1 -1
  95. package/lib/model/WorkflowStep.d.ts +1 -1
  96. package/lib/model/WorkflowType.d.ts +1 -1
  97. package/lib/model/WorkflowValidation.d.ts +1 -1
  98. package/lib/model/WorkflowVisite.d.ts +2 -2
  99. package/package.json +1 -1
  100. package/src/api/AnomaliesAPI.ts +15 -15
  101. package/src/api/CommissionsAPI.ts +12 -69
  102. package/src/api/ContactsAPI.ts +9 -9
  103. package/src/api/ControlesPeiAPI.ts +54 -0
  104. package/src/api/DatesPassageCommissionAPI.ts +56 -0
  105. package/src/api/DocumentsAPI.ts +9 -9
  106. package/src/api/DossiersAPI.ts +18 -88
  107. package/src/api/ERPAPI.ts +21 -21
  108. package/src/api/EvenementsAPI.ts +12 -12
  109. package/src/api/FeedAPI.ts +6 -6
  110. package/src/api/HealthcheckAPI.ts +25 -0
  111. package/src/api/MoiAPI.ts +3 -3
  112. package/src/api/NotificationsAPI.ts +10 -10
  113. package/src/api/OrdresDuJourAPI.ts +26 -0
  114. package/src/api/OrganisationsAPI.ts +43 -15
  115. package/src/api/PEIAPI.ts +21 -21
  116. package/src/api/PingAPI.ts +0 -18
  117. package/src/api/PrescriptionsAPI.ts +20 -20
  118. package/src/api/TournesDECIAPI.ts +15 -57
  119. package/src/api/UtilisateursAPI.ts +8 -8
  120. package/src/api/WorkflowsAPI.ts +84 -0
  121. package/src/auth/oauth2.ts +4 -4
  122. package/src/collection.ts +3 -3
  123. package/src/core.ts +16 -0
  124. package/src/index.ts +10 -0
  125. package/src/metarisc.ts +35 -0
  126. package/src/model/ActiviteErp.ts +2 -10
  127. package/src/model/AdressePostale.ts +2 -4
  128. package/src/model/AnomalieDECI.ts +0 -3
  129. package/src/model/AnomaliePEI.ts +1 -1
  130. package/src/model/Avis.ts +4 -4
  131. package/src/model/Contact.ts +7 -1
  132. package/src/model/DescriptifTechniqueDECI.ts +2 -2
  133. package/src/model/DescriptifTechniqueDECIBase.ts +0 -9
  134. package/src/model/DescriptifTechniqueERP.ts +2 -8
  135. package/src/model/DescriptifTechniqueERPBase.ts +3 -12
  136. package/src/model/DescriptifTechniquePENA.ts +5 -1
  137. package/src/model/DescriptifTechniquePIBI.ts +7 -4
  138. package/src/model/Dossier.ts +4 -5
  139. package/src/model/ERP.ts +6 -9
  140. package/src/model/FeedMessage.ts +1 -1
  141. package/src/model/FeedMessageTexte.ts +2 -1
  142. package/src/model/ModelError.ts +0 -15
  143. package/src/model/Notification.ts +7 -6
  144. package/src/model/OrganisationGeoservice.ts +1 -1
  145. package/src/model/OrganisationMembre.ts +3 -4
  146. package/src/model/PEI.ts +4 -10
  147. package/src/model/PassageCommissionDossier.ts +2 -3
  148. package/src/model/Prescription.ts +1 -2
  149. package/src/model/PrescriptionSupportReglementaire.ts +0 -3
  150. package/{lib/model/PEIReferencesExterieuresInner.d.ts → src/model/ReferenceExterieure.ts} +1 -1
  151. package/{lib/model/GetReglesDeciOrgOrganisations200Response.d.ts → src/model/ReglesDeci.ts} +2 -2
  152. package/src/model/TourneeDeci.ts +1 -2
  153. package/src/model/TourneeDeciModele.ts +3 -1
  154. package/src/model/TourneeDeciPei.ts +2 -3
  155. package/src/model/TourneeDeciPeiListeAnomaliesInner.ts +1 -2
  156. package/src/model/TourneeDeciSimple.ts +7 -3
  157. package/src/model/Workflow.ts +9 -9
  158. package/src/model/WorkflowAnalyseDeRisque.ts +11 -3
  159. package/src/model/WorkflowArriveeSecretariat.ts +4 -2
  160. package/src/model/WorkflowConsultationSis.ts +3 -2
  161. package/src/model/WorkflowDossiersLies.ts +3 -2
  162. package/src/model/WorkflowPassageCommissionSecurite.ts +5 -3
  163. package/src/model/WorkflowRelectureSecretariat.ts +2 -1
  164. package/src/model/WorkflowRemiseEnServicePEI.ts +3 -1
  165. package/src/model/WorkflowStep.ts +1 -1
  166. package/src/model/WorkflowType.ts +1 -1
  167. package/src/model/WorkflowValidation.ts +2 -1
  168. package/src/model/WorkflowVisite.ts +3 -2
  169. package/src/utils.ts +1 -1
  170. package/lib/model/GetPing200Response.d.ts +0 -3
  171. package/lib/model/GetReglesDeciOrgOrganisations200Response.js +0 -2
  172. package/lib/model/OrganisationMembreUtilisateur.d.ts +0 -2
  173. package/lib/model/OrganisationMembreUtilisateur.js +0 -2
  174. package/lib/model/PEIReferencesExterieuresInner.js +0 -2
  175. package/src/model/ERPReferencesExterieuresInner.ts +0 -4
  176. package/src/model/GetPing200Response.ts +0 -3
  177. package/src/model/OrganisationMembreUtilisateur.ts +0 -4
  178. package/src/model/PEIReferencesExterieuresInner.ts +0 -4
  179. /package/lib/model/{ERPReferencesExterieuresInner.js → ReferenceExterieure.js} +0 -0
  180. /package/lib/model/{GetPing200Response.js → ReglesDeci.js} +0 -0
package/.eslintrc CHANGED
@@ -40,7 +40,35 @@
40
40
  }
41
41
  ],
42
42
  "comma-dangle": [
43
+ "error", {
44
+ "arrays": "never",
45
+ "objects": "never",
46
+ "imports": "never",
47
+ "exports": "never",
48
+ "functions": "never"
49
+ }
50
+ ],
51
+ "space-in-parens": [
52
+ "error", "never"
53
+ ],
54
+ "no-multi-spaces": [
43
55
  "error"
56
+ ],
57
+ "space-before-function-paren": [
58
+ "error", {
59
+ "anonymous": "never",
60
+ "named": "never",
61
+ "asyncArrow": "always"
62
+ }
63
+ ],
64
+ "space-before-blocks": [
65
+ "error", "always"
66
+ ],
67
+ "object-curly-spacing": [
68
+ "error", "always"
69
+ ],
70
+ "array-bracket-spacing": [
71
+ "error", "never"
44
72
  ]
45
73
  }
46
74
  }
package/README.md CHANGED
@@ -13,7 +13,7 @@ npm i @metarisc/metarisc-js
13
13
  Pour utiliser la librairie, il suffit de l'importer comme ceci :
14
14
 
15
15
  ```ts
16
- import { Metarisc } from '@metarisc/metarisc-js';
16
+ import { Metarisc } from "@metarisc/metarisc-js";
17
17
  ```
18
18
 
19
19
  ## Utilisation
@@ -24,9 +24,9 @@ Pour effectuer une requête sur Metarisc, il faut tout d'adord initialisé le cl
24
24
 
25
25
  ```ts
26
26
  const m = new Metarisc({
27
- metarisc_url: "https://api.metarisc.fr",
28
- client_id: "CLIENT_ID",
29
- client_secret: "CLIENT_SECRET"
27
+ metarisc_url: "https://api.metarisc.fr",
28
+ client_id: "CLIENT_ID",
29
+ client_secret: "CLIENT_SECRET"
30
30
  });
31
31
 
32
32
  m.dossiers.getDossier("123456");
@@ -69,4 +69,31 @@ Le type de retour d'une requête paginée est :
69
69
  AsyncGenerator<T>;
70
70
  ```
71
71
 
72
- (voir la documentation suivante [AsyncGenerator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncGenerator))
72
+ (voir la documentation suivante [AsyncGenerator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncGenerator))
73
+
74
+ #### Écouteur d'événements pour les requêtes
75
+
76
+ Il est possible d'ajouter un écouteur d'événements sur chaque requête effectuée par le client Metarisc. Pour ce faire, vous pouvez utiliser la méthode on() de l'objet core, en spécifiant le nom de l'événement on("request", function)
77
+
78
+ ```ts
79
+ m.on("request", (config: Event): void => {
80
+ //Action à effectuer à chaque requête
81
+ });
82
+ ```
83
+
84
+ Cet écouteur est particulièrement utile pour effectuer des vérifications, comme la validation du token d'authentification avant l'envoi de chaque requête.
85
+
86
+ La fonction de rappel (callback) reçoit en paramètre un objet Event. Cet objet contient une propriété detail, où sont stockées toutes les informations relatives à la requête entrante.
87
+
88
+ ```ts
89
+ m.on("request", (config: Event): void => {
90
+ console.log(config.detail); // Retourne un objet de type RequestConfig
91
+ //{
92
+ //body?: any;
93
+ //headers?: { [name: string]: string | string[] };
94
+ //params?: { [param: string]: string | string[] };
95
+ //endpoint?: string;
96
+ //method?: string;
97
+ //}
98
+ });
99
+ ```
@@ -6,19 +6,23 @@ import { AnomalieDECI } from '../model/AnomalieDECI';
6
6
  export declare class AnomaliesAPI extends Core {
7
7
  constructor(config: MetariscConfig, client?: Client);
8
8
  /**
9
- * Suppression d'une anomalie DECI type.
9
+ * Suppression d'une anomalie DECI type dans la bibliothèque DECI.
10
10
  */
11
11
  deleteAnomalie(anomalieId: string): Promise<AxiosResponse<void>>;
12
12
  /**
13
- * Détails d'une anomalie type DECI.
13
+ * Détails d'une anomalie type DECI présente dans la bibliothèque DECI.
14
14
  */
15
15
  getAnomalie(anomalieId: string): Promise<AxiosResponse<AnomalieDECI>>;
16
16
  /**
17
- * Liste des anomalies.
17
+ * Retourne une liste des anomalies types dans la bibliothèque DECI.
18
18
  */
19
- paginateAnomalies(page?: number, perPage?: number, texte?: string): Collection<AnomalieDECI>;
19
+ paginateAnomalies(page?: number, perPage?: number, sort?: string, texte?: string, code?: string): Collection<AnomalieDECI>;
20
20
  /**
21
- * Ajout d'une nouvelle anomalie DECI type pour une organisation.
21
+ * Ajout d'une nouvelle anomalie DECI type dans la bibliothèque DECI.
22
22
  */
23
- postAnomalie(anomalieDECI?: AnomalieDECI): Promise<AxiosResponse<AnomalieDECI>>;
23
+ postAnomalie(params: {
24
+ code: number;
25
+ texte: string;
26
+ indiceDeGravite: number;
27
+ }): Promise<AxiosResponse<AnomalieDECI>>;
24
28
  }
@@ -8,7 +8,7 @@ class AnomaliesAPI extends core_1.Core {
8
8
  super(config, client);
9
9
  }
10
10
  /**
11
- * Suppression d'une anomalie DECI type.
11
+ * Suppression d'une anomalie DECI type dans la bibliothèque DECI.
12
12
  */
13
13
  async deleteAnomalie(anomalieId) {
14
14
  const pathVariable = { 'anomalie_id': (new String(anomalieId)).toString() };
@@ -20,7 +20,7 @@ class AnomaliesAPI extends core_1.Core {
20
20
  });
21
21
  }
22
22
  /**
23
- * Détails d'une anomalie type DECI.
23
+ * Détails d'une anomalie type DECI présente dans la bibliothèque DECI.
24
24
  */
25
25
  async getAnomalie(anomalieId) {
26
26
  const pathVariable = { 'anomalie_id': (new String(anomalieId)).toString() };
@@ -32,27 +32,27 @@ class AnomaliesAPI extends core_1.Core {
32
32
  });
33
33
  }
34
34
  /**
35
- * Liste des anomalies.
35
+ * Retourne une liste des anomalies types dans la bibliothèque DECI.
36
36
  */
37
- paginateAnomalies(page, perPage, texte) {
37
+ paginateAnomalies(page, perPage, sort, texte, code) {
38
38
  const pathVariable = {};
39
39
  return this.collect({
40
40
  method: 'GET',
41
41
  endpoint: utils_1.Utils.constructPath(pathVariable, '/anomalies'),
42
- params: { 'page': page?.toString(), 'per_page': perPage?.toString(), 'texte': texte },
42
+ params: { 'page': page?.toString(), 'per_page': perPage?.toString(), 'sort': sort, 'texte': texte, 'code': code },
43
43
  body: utils_1.Utils.payloadFilter({})
44
44
  });
45
45
  }
46
46
  /**
47
- * Ajout d'une nouvelle anomalie DECI type pour une organisation.
47
+ * Ajout d'une nouvelle anomalie DECI type dans la bibliothèque DECI.
48
48
  */
49
- async postAnomalie(anomalieDECI) {
49
+ async postAnomalie(params) {
50
50
  const pathVariable = {};
51
51
  return this.request({
52
52
  method: 'POST',
53
53
  endpoint: utils_1.Utils.constructPath(pathVariable, '/anomalies'),
54
54
  params: {},
55
- body: utils_1.Utils.payloadFilter({ 'code': anomalieDECI?.code, 'texte': anomalieDECI?.texte, 'indice_de_gravite': anomalieDECI?.indice_de_gravite })
55
+ body: utils_1.Utils.payloadFilter(params)
56
56
  });
57
57
  }
58
58
  }
@@ -4,17 +4,12 @@ import { Client } from "../client";
4
4
  import { Collection } from "../collection";
5
5
  import { Commission } from '../model/Commission';
6
6
  import { PassageCommission } from '../model/PassageCommission';
7
- import { PassageCommissionDossier } from '../model/PassageCommissionDossier';
8
7
  export declare class CommissionsAPI extends Core {
9
8
  constructor(config: MetariscConfig, client?: Client);
10
9
  /**
11
10
  * Récupération des détails de la commission.
12
11
  */
13
12
  getCommission(commissionId: string): Promise<AxiosResponse<Commission>>;
14
- /**
15
- * Récupération d'une date de passage en commission.
16
- */
17
- getCommissionDate(commissionId: string, dateId: string): Promise<AxiosResponse<PassageCommission>>;
18
13
  /**
19
14
  * Liste des commissions.
20
15
  */
@@ -23,24 +18,20 @@ export declare class CommissionsAPI extends Core {
23
18
  * Récupération de la liste des dates de passage de la commission.
24
19
  */
25
20
  paginateCommissionDates(commissionId: string, page?: number, perPage?: number): Collection<PassageCommission>;
26
- /**
27
- * Récupération d'une liste de dossiers à l'ordre du jour liés à une date de passage en commission.
28
- */
29
- paginateCommissionDateDossiers(commissionId: string, dateId: string, page?: number, perPage?: number): Collection<PassageCommissionDossier>;
30
21
  /**
31
22
  * Ajoute une commission.
32
23
  */
33
- postCommission(commission?: Commission): Promise<AxiosResponse<Commission>>;
24
+ postCommission(params: {
25
+ type: string;
26
+ libelle: string;
27
+ }): Promise<AxiosResponse<Commission>>;
34
28
  /**
35
29
  * Ajout d'une date de passage en commission.
36
30
  */
37
- postCommissionDate(commissionId: string, passageCommission?: PassageCommission): Promise<AxiosResponse<PassageCommission>>;
38
- /**
39
- * Mise à jour des détails d'un dossier lié à une date de passage en commission
40
- */
41
- updateCommissionDateDossier(commissionId: string, dateId: string, dossierId: string, passageCommissionDossier?: PassageCommissionDossier): Promise<AxiosResponse<PassageCommissionDossier>>;
42
- /**
43
- * Ajout d'un dossier à l'ordre du jour d'un passage en commission.
44
- */
45
- postCommissionDateDossier(commissionId: string, dateId: string, passageCommissionDossier?: PassageCommissionDossier): Promise<AxiosResponse<PassageCommissionDossier>>;
31
+ postCommissionDate(commissionId: string, params: {
32
+ dateDebut: Date;
33
+ dateFin: Date;
34
+ type: string;
35
+ libelle: string;
36
+ }): Promise<AxiosResponse<PassageCommission>>;
46
37
  }
@@ -19,18 +19,6 @@ class CommissionsAPI extends core_1.Core {
19
19
  body: utils_1.Utils.payloadFilter({})
20
20
  });
21
21
  }
22
- /**
23
- * Récupération d'une date de passage en commission.
24
- */
25
- async getCommissionDate(commissionId, dateId) {
26
- const pathVariable = { 'commission_id': (new String(commissionId)).toString(), 'date_id': (new String(dateId)).toString() };
27
- return this.request({
28
- method: 'GET',
29
- endpoint: utils_1.Utils.constructPath(pathVariable, '/commissions/{commission_id}/dates/{date_id}'),
30
- params: {},
31
- body: utils_1.Utils.payloadFilter({})
32
- });
33
- }
34
22
  /**
35
23
  * Liste des commissions.
36
24
  */
@@ -55,64 +43,28 @@ class CommissionsAPI extends core_1.Core {
55
43
  body: utils_1.Utils.payloadFilter({})
56
44
  });
57
45
  }
58
- /**
59
- * Récupération d'une liste de dossiers à l'ordre du jour liés à une date de passage en commission.
60
- */
61
- paginateCommissionDateDossiers(commissionId, dateId, page, perPage) {
62
- const pathVariable = { 'commission_id': (new String(commissionId)).toString(), 'date_id': (new String(dateId)).toString() };
63
- return this.collect({
64
- method: 'GET',
65
- endpoint: utils_1.Utils.constructPath(pathVariable, '/commissions/{commission_id}/dates/{date_id}/ordre_du_jour'),
66
- params: { 'page': page?.toString(), 'per_page': perPage?.toString() },
67
- body: utils_1.Utils.payloadFilter({})
68
- });
69
- }
70
46
  /**
71
47
  * Ajoute une commission.
72
48
  */
73
- async postCommission(commission) {
49
+ async postCommission(params) {
74
50
  const pathVariable = {};
75
51
  return this.request({
76
52
  method: 'POST',
77
53
  endpoint: utils_1.Utils.constructPath(pathVariable, '/commissions'),
78
54
  params: {},
79
- body: utils_1.Utils.payloadFilter({ 'id': commission?.id, 'type': commission?.type, 'libelle': commission?.libelle })
55
+ body: utils_1.Utils.payloadFilter(params)
80
56
  });
81
57
  }
82
58
  /**
83
59
  * Ajout d'une date de passage en commission.
84
60
  */
85
- async postCommissionDate(commissionId, passageCommission) {
61
+ async postCommissionDate(commissionId, params) {
86
62
  const pathVariable = { 'commission_id': (new String(commissionId)).toString() };
87
63
  return this.request({
88
64
  method: 'POST',
89
65
  endpoint: utils_1.Utils.constructPath(pathVariable, '/commissions/{commission_id}/dates'),
90
66
  params: {},
91
- body: utils_1.Utils.payloadFilter({ 'id': passageCommission?.id, 'date_debut': passageCommission?.date_debut ? utils_1.Utils.formatDate(passageCommission?.date_debut) : undefined, 'date_fin': passageCommission?.date_fin ? utils_1.Utils.formatDate(passageCommission?.date_fin) : undefined, 'type': passageCommission?.type, 'libelle': passageCommission?.libelle })
92
- });
93
- }
94
- /**
95
- * Mise à jour des détails d'un dossier lié à une date de passage en commission
96
- */
97
- async updateCommissionDateDossier(commissionId, dateId, dossierId, passageCommissionDossier) {
98
- const pathVariable = { 'commission_id': (new String(commissionId)).toString(), 'date_id': (new String(dateId)).toString(), 'dossier_id': (new String(dossierId)).toString() };
99
- return this.request({
100
- method: 'POST',
101
- endpoint: utils_1.Utils.constructPath(pathVariable, '/commissions/{commission_id}/dates/{date_id}/ordre_du_jour/{dossier_id}'),
102
- params: {},
103
- body: utils_1.Utils.payloadFilter({ 'id': passageCommissionDossier?.id, 'dossier': passageCommissionDossier?.dossier, 'dossier_id': passageCommissionDossier?.dossier_id, 'avis': passageCommissionDossier?.avis, 'statut': passageCommissionDossier?.statut })
104
- });
105
- }
106
- /**
107
- * Ajout d'un dossier à l'ordre du jour d'un passage en commission.
108
- */
109
- async postCommissionDateDossier(commissionId, dateId, passageCommissionDossier) {
110
- const pathVariable = { 'commission_id': (new String(commissionId)).toString(), 'date_id': (new String(dateId)).toString() };
111
- return this.request({
112
- method: 'POST',
113
- endpoint: utils_1.Utils.constructPath(pathVariable, '/commissions/{commission_id}/dates/{date_id}/ordre_du_jour'),
114
- params: {},
115
- body: utils_1.Utils.payloadFilter({ 'id': passageCommissionDossier?.id, 'dossier': passageCommissionDossier?.dossier, 'dossier_id': passageCommissionDossier?.dossier_id, 'avis': passageCommissionDossier?.avis, 'statut': passageCommissionDossier?.statut })
67
+ body: utils_1.Utils.payloadFilter(params)
116
68
  });
117
69
  }
118
70
  }
@@ -20,5 +20,18 @@ export declare class ContactsAPI extends Core {
20
20
  /**
21
21
  * Mise à jour d'une fiche contact existante.
22
22
  */
23
- updateContact(contactId: string, contact?: Contact): Promise<AxiosResponse<Contact>>;
23
+ updateContact(contactId: string, params: {
24
+ nom?: string;
25
+ prenom?: string;
26
+ fonction?: string;
27
+ telephoneFixe?: string;
28
+ telephonePortable?: string;
29
+ telephoneFax?: string;
30
+ adresse?: string;
31
+ siteWebUrl?: string;
32
+ civilite?: string;
33
+ societe?: string;
34
+ email?: string;
35
+ observations?: string;
36
+ }): Promise<AxiosResponse<Contact>>;
24
37
  }
@@ -46,13 +46,13 @@ class ContactsAPI extends core_1.Core {
46
46
  /**
47
47
  * Mise à jour d'une fiche contact existante.
48
48
  */
49
- async updateContact(contactId, contact) {
49
+ async updateContact(contactId, params) {
50
50
  const pathVariable = { 'contact_id': (new String(contactId)).toString() };
51
51
  return this.request({
52
52
  method: 'POST',
53
53
  endpoint: utils_1.Utils.constructPath(pathVariable, '/contacts/{contact_id}'),
54
54
  params: {},
55
- body: utils_1.Utils.payloadFilter({ 'id': contact?.id, 'nom': contact?.nom, 'prenom': contact?.prenom, 'fonction': contact?.fonction, 'telephone_fixe': contact?.telephone_fixe, 'telephone_portable': contact?.telephone_portable, 'telephone_fax': contact?.telephone_fax, 'adresse': contact?.adresse, 'site_web_url': contact?.site_web_url, 'civilite': contact?.civilite, 'societe': contact?.societe, 'email': contact?.email, 'observations': contact?.observations })
55
+ body: utils_1.Utils.payloadFilter(params)
56
56
  });
57
57
  }
58
58
  }
@@ -0,0 +1,27 @@
1
+ import { Core, MetariscConfig } from "../core";
2
+ import type { AxiosResponse } from "axios";
3
+ import { Client } from "../client";
4
+ import { TourneeDeciPei } from '../model/TourneeDeciPei';
5
+ export declare class ControlesPeiAPI extends Core {
6
+ constructor(config: MetariscConfig, client?: Client);
7
+ /**
8
+ * Suppression du contrôle PEI de la tournée DECI.
9
+ */
10
+ deleteControle(peiId: string): Promise<AxiosResponse<void>>;
11
+ /**
12
+ * Récupération des détails liés au contrôle d'un PEI d'une tournée.
13
+ */
14
+ getControle(peiId: string): Promise<AxiosResponse<TourneeDeciPei>>;
15
+ /**
16
+ * Mise à jour du PEI contrôlé.
17
+ */
18
+ updateControle(peiId: string, params: {
19
+ dateDuControle?: Date;
20
+ listeAnomalies?: {
21
+ code?: number;
22
+ a_lever?: boolean;
23
+ };
24
+ essaisEnginUtilise?: string;
25
+ ordre?: number;
26
+ }): Promise<AxiosResponse<TourneeDeciPei>>;
27
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ControlesPeiAPI = void 0;
4
+ const core_1 = require("../core");
5
+ const utils_1 = require("../utils");
6
+ class ControlesPeiAPI extends core_1.Core {
7
+ constructor(config, client) {
8
+ super(config, client);
9
+ }
10
+ /**
11
+ * Suppression du contrôle PEI de la tournée DECI.
12
+ */
13
+ async deleteControle(peiId) {
14
+ const pathVariable = { 'pei_id': (new String(peiId)).toString() };
15
+ return this.request({
16
+ method: 'DELETE',
17
+ endpoint: utils_1.Utils.constructPath(pathVariable, '/controles_pei/{pei_id}'),
18
+ params: {},
19
+ body: utils_1.Utils.payloadFilter({})
20
+ });
21
+ }
22
+ /**
23
+ * Récupération des détails liés au contrôle d'un PEI d'une tournée.
24
+ */
25
+ async getControle(peiId) {
26
+ const pathVariable = { 'pei_id': (new String(peiId)).toString() };
27
+ return this.request({
28
+ method: 'GET',
29
+ endpoint: utils_1.Utils.constructPath(pathVariable, '/controles_pei/{pei_id}'),
30
+ params: {},
31
+ body: utils_1.Utils.payloadFilter({})
32
+ });
33
+ }
34
+ /**
35
+ * Mise à jour du PEI contrôlé.
36
+ */
37
+ async updateControle(peiId, params) {
38
+ const pathVariable = { 'pei_id': (new String(peiId)).toString() };
39
+ return this.request({
40
+ method: 'POST',
41
+ endpoint: utils_1.Utils.constructPath(pathVariable, '/controles_pei/{pei_id}'),
42
+ params: {},
43
+ body: utils_1.Utils.payloadFilter(params)
44
+ });
45
+ }
46
+ }
47
+ exports.ControlesPeiAPI = ControlesPeiAPI;
@@ -0,0 +1,23 @@
1
+ import { Core, MetariscConfig } from "../core";
2
+ import type { AxiosResponse } from "axios";
3
+ import { Client } from "../client";
4
+ import { Collection } from "../collection";
5
+ import { PassageCommission } from '../model/PassageCommission';
6
+ import { PassageCommissionDossier } from '../model/PassageCommissionDossier';
7
+ export declare class DatesPassageCommissionAPI extends Core {
8
+ constructor(config: MetariscConfig, client?: Client);
9
+ /**
10
+ * Récupération d'une date de passage en commission.
11
+ */
12
+ getCommissionDate(dateId: string): Promise<AxiosResponse<PassageCommission>>;
13
+ /**
14
+ * Récupération d'une liste de dossiers à l'ordre du jour liés à une date de passage en commission.
15
+ */
16
+ paginateCommissionDateDossiers(dateId: string, page?: number, perPage?: number): Collection<PassageCommissionDossier>;
17
+ /**
18
+ * Ajout d'un dossier à l'ordre du jour d'un passage en commission.
19
+ */
20
+ postCommissionDateDossier(dateId: string, params: {
21
+ dossierId: string;
22
+ }): Promise<AxiosResponse<PassageCommissionDossier>>;
23
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DatesPassageCommissionAPI = void 0;
4
+ const core_1 = require("../core");
5
+ const utils_1 = require("../utils");
6
+ class DatesPassageCommissionAPI extends core_1.Core {
7
+ constructor(config, client) {
8
+ super(config, client);
9
+ }
10
+ /**
11
+ * Récupération d'une date de passage en commission.
12
+ */
13
+ async getCommissionDate(dateId) {
14
+ const pathVariable = { 'date_id': (new String(dateId)).toString() };
15
+ return this.request({
16
+ method: 'GET',
17
+ endpoint: utils_1.Utils.constructPath(pathVariable, '/dates_passage_commission/{date_id}'),
18
+ params: {},
19
+ body: utils_1.Utils.payloadFilter({})
20
+ });
21
+ }
22
+ /**
23
+ * Récupération d'une liste de dossiers à l'ordre du jour liés à une date de passage en commission.
24
+ */
25
+ paginateCommissionDateDossiers(dateId, page, perPage) {
26
+ const pathVariable = { 'date_id': (new String(dateId)).toString() };
27
+ return this.collect({
28
+ method: 'GET',
29
+ endpoint: utils_1.Utils.constructPath(pathVariable, '/dates_passage_commission/{date_id}/ordre_du_jour'),
30
+ params: { 'page': page?.toString(), 'per_page': perPage?.toString() },
31
+ body: utils_1.Utils.payloadFilter({})
32
+ });
33
+ }
34
+ /**
35
+ * Ajout d'un dossier à l'ordre du jour d'un passage en commission.
36
+ */
37
+ async postCommissionDateDossier(dateId, params) {
38
+ const pathVariable = { 'date_id': (new String(dateId)).toString() };
39
+ return this.request({
40
+ method: 'POST',
41
+ endpoint: utils_1.Utils.constructPath(pathVariable, '/dates_passage_commission/{date_id}/ordre_du_jour'),
42
+ params: {},
43
+ body: utils_1.Utils.payloadFilter(params)
44
+ });
45
+ }
46
+ }
47
+ exports.DatesPassageCommissionAPI = DatesPassageCommissionAPI;
@@ -20,5 +20,9 @@ export declare class DocumentsAPI extends Core {
20
20
  /**
21
21
  * Mise à jour d'un document existant.
22
22
  */
23
- postDocument(documentId: string, pieceJointe?: PieceJointe): Promise<AxiosResponse<PieceJointe>>;
23
+ postDocument(documentId: string, params: {
24
+ nom?: string;
25
+ description?: string;
26
+ type?: string;
27
+ }): Promise<AxiosResponse<PieceJointe>>;
24
28
  }
@@ -46,13 +46,13 @@ class DocumentsAPI extends core_1.Core {
46
46
  /**
47
47
  * Mise à jour d'un document existant.
48
48
  */
49
- async postDocument(documentId, pieceJointe) {
49
+ async postDocument(documentId, params) {
50
50
  const pathVariable = { 'document_id': (new String(documentId)).toString() };
51
51
  return this.request({
52
52
  method: 'POST',
53
53
  endpoint: utils_1.Utils.constructPath(pathVariable, '/documents/{document_id}'),
54
54
  params: {},
55
- body: utils_1.Utils.payloadFilter({ 'id': pieceJointe?.id, 'url': pieceJointe?.url, 'nom': pieceJointe?.nom, 'description': pieceJointe?.description, 'type': pieceJointe?.type })
55
+ body: utils_1.Utils.payloadFilter(params)
56
56
  });
57
57
  }
58
58
  }
@@ -5,18 +5,14 @@ import { Collection } from "../collection";
5
5
  import { Contact } from '../model/Contact';
6
6
  import { Dossier } from '../model/Dossier';
7
7
  import { PieceJointe } from '../model/PieceJointe';
8
- import { Workflow } from '../model/Workflow';
9
8
  import { Tag } from '../model/Tag';
9
+ import { Workflow } from '../model/Workflow';
10
10
  export declare class DossiersAPI extends Core {
11
11
  constructor(config: MetariscConfig, client?: Client);
12
12
  /**
13
13
  * Récupération de l'ensemble des données d'un dossier.
14
14
  */
15
15
  getDossier(dossierId: string): Promise<AxiosResponse<Dossier>>;
16
- /**
17
- * Récupération des détails d'un workflow.
18
- */
19
- getDossierWorkflowsDetails(dossierId: string, workflowId: string): Promise<AxiosResponse<Workflow>>;
20
16
  /**
21
17
  * Récupération de la liste des contacts.
22
18
  */
@@ -25,10 +21,6 @@ export declare class DossiersAPI extends Core {
25
21
  * Récupération de la liste des documents.
26
22
  */
27
23
  paginateDossierDocuments(dossierId: string, page?: number, perPage?: number): Collection<PieceJointe>;
28
- /**
29
- * Récupération de la liste des documents.
30
- */
31
- paginateDossierWorkflowsWorkflowDocuments(dossierId: string, workflowId: string, page?: number, perPage?: number): Collection<PieceJointe>;
32
24
  /**
33
25
  * Récupération de la liste des dossiers selon des critères de recherche.
34
26
  */
@@ -44,25 +36,33 @@ export declare class DossiersAPI extends Core {
44
36
  /**
45
37
  * Ajout d'un contact.
46
38
  */
47
- postContactsDossier(dossierId: string, contact?: Contact): Promise<AxiosResponse<Contact>>;
39
+ postContactsDossier(dossierId: string, params: {
40
+ nom?: string;
41
+ prenom?: string;
42
+ fonction?: string;
43
+ telephoneFixe?: string;
44
+ telephonePortable?: string;
45
+ telephoneFax?: string;
46
+ adresse?: string;
47
+ siteWebUrl?: string;
48
+ civilite?: string;
49
+ societe?: string;
50
+ email?: string;
51
+ observations?: string;
52
+ }): Promise<AxiosResponse<Contact>>;
48
53
  /**
49
54
  * Ajout d'un document.
50
55
  */
51
- postDocumentsDossier(dossierId: string, pieceJointe?: PieceJointe): Promise<AxiosResponse<PieceJointe>>;
52
- /**
53
- * Ajout d'un document.
54
- */
55
- postDocumentsWorkflowWorkflowsDossier(dossierId: string, workflowId: string, pieceJointe?: PieceJointe): Promise<AxiosResponse<PieceJointe>>;
56
+ postDocumentsDossier(dossierId: string, params: {
57
+ url: string;
58
+ nom?: string;
59
+ description?: string;
60
+ type?: string;
61
+ }): Promise<AxiosResponse<PieceJointe>>;
56
62
  /**
57
63
  * Modification d'un dossier existant
58
64
  */
59
- patchDossier(dossierId: string, dossier?: Dossier): Promise<AxiosResponse<Dossier>>;
60
- /**
61
- * Terminer un workflow d'un dossier. Cela met à jour l'ensemble de son traitement.
62
- */
63
- postTerminerWorkflowWorkflowsDossier(dossierId: string, workflowId: string): Promise<AxiosResponse<void>>;
64
- /**
65
- * Mise à jour d'un workflow.
66
- */
67
- updateDossierWorkflowsDetails(dossierId: string, workflowId: string, workflow?: Workflow): Promise<AxiosResponse<Workflow>>;
65
+ patchDossier(dossierId: string, params: {
66
+ objet?: string;
67
+ }): Promise<AxiosResponse<Dossier>>;
68
68
  }