@metarisc/metarisc-js 0.0.1-alpha.34 → 0.0.1-alpha.36
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/api/AnomaliesAPI.d.ts +16 -0
- package/lib/api/AnomaliesAPI.js +42 -0
- package/lib/api/CommissionsAPI.d.ts +19 -0
- package/lib/api/CommissionsAPI.js +44 -0
- package/lib/api/ERPAPI.d.ts +6 -0
- package/lib/api/ERPAPI.js +14 -0
- package/lib/api/PEIAPI.d.ts +6 -0
- package/lib/api/PEIAPI.js +14 -0
- package/lib/api/PrescriptionsAPI.d.ts +38 -0
- package/lib/api/PrescriptionsAPI.js +97 -0
- package/lib/api/TournesDECIAPI.d.ts +6 -0
- package/lib/api/TournesDECIAPI.js +14 -0
- package/lib/metarisc.d.ts +1 -0
- package/lib/metarisc.js +2 -0
- package/lib/model/PostCommissionDateDossierRequest.d.ts +3 -0
- package/lib/model/PostCommissionDateDossierRequest.js +2 -0
- package/lib/model/PostCommissionRequest.d.ts +7 -0
- package/lib/model/PostCommissionRequest.js +2 -0
- package/lib/model/PostPeiRequest.d.ts +7 -0
- package/lib/model/PostPeiRequest.js +2 -0
- package/lib/model/PostPrescriptionRequest.d.ts +6 -0
- package/lib/model/PostPrescriptionRequest.js +2 -0
- package/lib/model/PostPrescriptionRequestSupportsReglementairesInner.d.ts +3 -0
- package/lib/model/PostPrescriptionRequestSupportsReglementairesInner.js +2 -0
- package/lib/model/PostSupportReglementaireRequest.d.ts +8 -0
- package/lib/model/PostSupportReglementaireRequest.js +2 -0
- package/lib/model/PostTourneeDeciRequest.d.ts +4 -0
- package/lib/model/PostTourneeDeciRequest.js +2 -0
- package/lib/model/PrescriptionSupportReglementaire.d.ts +9 -0
- package/lib/model/PrescriptionSupportReglementaire.js +5 -1
- package/lib/tus.d.ts +2 -2
- package/lib/tus.js +16 -2
- package/package.json +2 -2
- package/src/api/AnomaliesAPI.ts +49 -0
- package/src/api/CommissionsAPI.ts +52 -0
- package/src/api/ERPAPI.ts +17 -0
- package/src/api/PEIAPI.ts +17 -0
- package/src/api/PrescriptionsAPI.ts +115 -0
- package/src/api/TournesDECIAPI.ts +17 -0
- package/src/metarisc.ts +5 -0
- package/src/model/PostCommissionDateDossierRequest.ts +3 -0
- package/src/model/PostCommissionRequest.ts +7 -0
- package/src/model/PostPeiRequest.ts +8 -0
- package/src/model/PostPrescriptionRequest.ts +7 -0
- package/src/model/PostPrescriptionRequestSupportsReglementairesInner.ts +3 -0
- package/src/model/PostSupportReglementaireRequest.ts +8 -0
- package/src/model/PostTourneeDeciRequest.ts +4 -0
- package/src/model/PrescriptionSupportReglementaire.ts +10 -0
- package/src/tus.ts +25 -5
|
@@ -1,13 +1,29 @@
|
|
|
1
1
|
import { Core, MetariscConfig } from "../core";
|
|
2
|
+
import type { AxiosResponse } from "axios";
|
|
2
3
|
import { Client } from "../client";
|
|
3
4
|
import { Collection } from "../collection";
|
|
4
5
|
import { AnomalieDECI } from '../model/AnomalieDECI';
|
|
5
6
|
export declare class AnomaliesAPI extends Core {
|
|
6
7
|
constructor(config: MetariscConfig, client?: Client);
|
|
8
|
+
/**
|
|
9
|
+
* Suppression d'une anomalie.
|
|
10
|
+
* @param anomalieId Identifiant unique de l'anomalie
|
|
11
|
+
*/
|
|
12
|
+
deleteAnomalie(anomalieId: string): Promise<AxiosResponse<void>>;
|
|
13
|
+
/**
|
|
14
|
+
* Détails d'une anomalie.
|
|
15
|
+
* @param anomalieId Identifiant unique de l'anomalie
|
|
16
|
+
*/
|
|
17
|
+
getAnomalie(anomalieId: string): Promise<AxiosResponse<AnomalieDECI>>;
|
|
7
18
|
/**
|
|
8
19
|
* Liste des anomalies.
|
|
9
20
|
* @param page Numéro de page
|
|
10
21
|
* @param perPage Nombre de résultats demandé
|
|
11
22
|
*/
|
|
12
23
|
paginateAnomalies(page?: number, perPage?: number): Collection<AnomalieDECI>;
|
|
24
|
+
/**
|
|
25
|
+
* Ajout d'une nouvelle anomalie.
|
|
26
|
+
* @param anomalieDECI
|
|
27
|
+
*/
|
|
28
|
+
postAnomalie(anomalieDECI?: AnomalieDECI): Promise<AxiosResponse<AnomalieDECI>>;
|
|
13
29
|
}
|
package/lib/api/AnomaliesAPI.js
CHANGED
|
@@ -7,6 +7,34 @@ class AnomaliesAPI extends core_1.Core {
|
|
|
7
7
|
constructor(config, client) {
|
|
8
8
|
super(config, client);
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Suppression d'une anomalie.
|
|
12
|
+
* @param anomalieId Identifiant unique de l'anomalie
|
|
13
|
+
*/
|
|
14
|
+
async deleteAnomalie(anomalieId) {
|
|
15
|
+
const pathVariable = { 'anomalie_id': anomalieId };
|
|
16
|
+
return this.request({
|
|
17
|
+
method: 'DELETE',
|
|
18
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/anomalies/{anomalie_id}'),
|
|
19
|
+
headers: {},
|
|
20
|
+
params: {},
|
|
21
|
+
body: {}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Détails d'une anomalie.
|
|
26
|
+
* @param anomalieId Identifiant unique de l'anomalie
|
|
27
|
+
*/
|
|
28
|
+
async getAnomalie(anomalieId) {
|
|
29
|
+
const pathVariable = { 'anomalie_id': anomalieId };
|
|
30
|
+
return this.request({
|
|
31
|
+
method: 'GET',
|
|
32
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/anomalies/{anomalie_id}'),
|
|
33
|
+
headers: {},
|
|
34
|
+
params: {},
|
|
35
|
+
body: {}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
10
38
|
/**
|
|
11
39
|
* Liste des anomalies.
|
|
12
40
|
* @param page Numéro de page
|
|
@@ -22,5 +50,19 @@ class AnomaliesAPI extends core_1.Core {
|
|
|
22
50
|
body: {}
|
|
23
51
|
});
|
|
24
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Ajout d'une nouvelle anomalie.
|
|
55
|
+
* @param anomalieDECI
|
|
56
|
+
*/
|
|
57
|
+
async postAnomalie(anomalieDECI) {
|
|
58
|
+
const pathVariable = {};
|
|
59
|
+
return this.request({
|
|
60
|
+
method: 'POST',
|
|
61
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/anomalies'),
|
|
62
|
+
headers: {},
|
|
63
|
+
params: {},
|
|
64
|
+
body: { 'code': anomalieDECI?.code, 'texte': anomalieDECI?.texte, 'indice_de_gravite': anomalieDECI?.indice_de_gravite }
|
|
65
|
+
});
|
|
66
|
+
}
|
|
25
67
|
}
|
|
26
68
|
exports.AnomaliesAPI = AnomaliesAPI;
|
|
@@ -5,8 +5,15 @@ import { Collection } from "../collection";
|
|
|
5
5
|
import { Commission } from '../model/Commission';
|
|
6
6
|
import { PassageCommission } from '../model/PassageCommission';
|
|
7
7
|
import { PassageCommissionDossier } from '../model/PassageCommissionDossier';
|
|
8
|
+
import { PostCommissionDateDossierRequest } from '../model/PostCommissionDateDossierRequest';
|
|
9
|
+
import { PostCommissionRequest } from '../model/PostCommissionRequest';
|
|
8
10
|
export declare class CommissionsAPI extends Core {
|
|
9
11
|
constructor(config: MetariscConfig, client?: Client);
|
|
12
|
+
/**
|
|
13
|
+
* Suppression d'une commission.
|
|
14
|
+
* @param commissionId Identifiant unique de la commission
|
|
15
|
+
*/
|
|
16
|
+
deleteCommission(commissionId: string): Promise<AxiosResponse<void>>;
|
|
10
17
|
/**
|
|
11
18
|
* Récupération des détails de la commission.
|
|
12
19
|
* @param commissionId Identifiant unique de la commission
|
|
@@ -39,4 +46,16 @@ export declare class CommissionsAPI extends Core {
|
|
|
39
46
|
* @param perPage Nombre de résultats demandé
|
|
40
47
|
*/
|
|
41
48
|
paginateCommissions(page?: number, perPage?: number): Collection<Commission>;
|
|
49
|
+
/**
|
|
50
|
+
* Ajoute une commission.
|
|
51
|
+
* @param postCommissionRequest
|
|
52
|
+
*/
|
|
53
|
+
postCommission(postCommissionRequest?: PostCommissionRequest): Promise<AxiosResponse<Commission>>;
|
|
54
|
+
/**
|
|
55
|
+
* Ajout d'un dossier à l'ordre du jour d'un passage en commission.
|
|
56
|
+
* @param commissionId Identifiant unique de la commission
|
|
57
|
+
* @param dateId Identifiant unique du passage en commission
|
|
58
|
+
* @param postCommissionDateDossierRequest
|
|
59
|
+
*/
|
|
60
|
+
postCommissionDateDossier(commissionId: string, dateId: string, postCommissionDateDossierRequest?: PostCommissionDateDossierRequest): Promise<AxiosResponse<PassageCommissionDossier>>;
|
|
42
61
|
}
|
|
@@ -7,6 +7,20 @@ class CommissionsAPI extends core_1.Core {
|
|
|
7
7
|
constructor(config, client) {
|
|
8
8
|
super(config, client);
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Suppression d'une commission.
|
|
12
|
+
* @param commissionId Identifiant unique de la commission
|
|
13
|
+
*/
|
|
14
|
+
async deleteCommission(commissionId) {
|
|
15
|
+
const pathVariable = { 'commission_id': commissionId };
|
|
16
|
+
return this.request({
|
|
17
|
+
method: 'DELETE',
|
|
18
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/commissions/{commission_id}'),
|
|
19
|
+
headers: {},
|
|
20
|
+
params: {},
|
|
21
|
+
body: {}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
10
24
|
/**
|
|
11
25
|
* Récupération des détails de la commission.
|
|
12
26
|
* @param commissionId Identifiant unique de la commission
|
|
@@ -84,5 +98,35 @@ class CommissionsAPI extends core_1.Core {
|
|
|
84
98
|
body: {}
|
|
85
99
|
});
|
|
86
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Ajoute une commission.
|
|
103
|
+
* @param postCommissionRequest
|
|
104
|
+
*/
|
|
105
|
+
async postCommission(postCommissionRequest) {
|
|
106
|
+
const pathVariable = {};
|
|
107
|
+
return this.request({
|
|
108
|
+
method: 'POST',
|
|
109
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/commissions'),
|
|
110
|
+
headers: {},
|
|
111
|
+
params: {},
|
|
112
|
+
body: { 'type': postCommissionRequest?.type, 'libelle': postCommissionRequest?.libelle }
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Ajout d'un dossier à l'ordre du jour d'un passage en commission.
|
|
117
|
+
* @param commissionId Identifiant unique de la commission
|
|
118
|
+
* @param dateId Identifiant unique du passage en commission
|
|
119
|
+
* @param postCommissionDateDossierRequest
|
|
120
|
+
*/
|
|
121
|
+
async postCommissionDateDossier(commissionId, dateId, postCommissionDateDossierRequest) {
|
|
122
|
+
const pathVariable = { 'commission_id': commissionId, 'date_id': dateId };
|
|
123
|
+
return this.request({
|
|
124
|
+
method: 'POST',
|
|
125
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/commissions/{commission_id}/dates/{date_id}/ordre_du_jour'),
|
|
126
|
+
headers: {},
|
|
127
|
+
params: {},
|
|
128
|
+
body: { 'dossier_id': postCommissionDateDossierRequest?.dossier_id }
|
|
129
|
+
});
|
|
130
|
+
}
|
|
87
131
|
}
|
|
88
132
|
exports.CommissionsAPI = CommissionsAPI;
|
package/lib/api/ERPAPI.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { Core, MetariscConfig } from "../core";
|
|
2
|
+
import type { AxiosResponse } from "axios";
|
|
2
3
|
import { Client } from "../client";
|
|
3
4
|
import { Collection } from "../collection";
|
|
4
5
|
import { ERP } from '../model/ERP';
|
|
5
6
|
export declare class ERPAPI extends Core {
|
|
6
7
|
constructor(config: MetariscConfig, client?: Client);
|
|
8
|
+
/**
|
|
9
|
+
* Récupération des détails de l'ERP.
|
|
10
|
+
* @param erpId Identifiant unique de l'ERP
|
|
11
|
+
*/
|
|
12
|
+
getErp(erpId: string): Promise<AxiosResponse<ERP>>;
|
|
7
13
|
/**
|
|
8
14
|
* Récupération de la liste des ERP.
|
|
9
15
|
* @param page Numéro de page
|
package/lib/api/ERPAPI.js
CHANGED
|
@@ -7,6 +7,20 @@ class ERPAPI extends core_1.Core {
|
|
|
7
7
|
constructor(config, client) {
|
|
8
8
|
super(config, client);
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Récupération des détails de l'ERP.
|
|
12
|
+
* @param erpId Identifiant unique de l'ERP
|
|
13
|
+
*/
|
|
14
|
+
async getErp(erpId) {
|
|
15
|
+
const pathVariable = { 'erp_id': erpId };
|
|
16
|
+
return this.request({
|
|
17
|
+
method: 'GET',
|
|
18
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/erp/{erp_id}'),
|
|
19
|
+
headers: {},
|
|
20
|
+
params: {},
|
|
21
|
+
body: {}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
10
24
|
/**
|
|
11
25
|
* Récupération de la liste des ERP.
|
|
12
26
|
* @param page Numéro de page
|
package/lib/api/PEIAPI.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { AxiosResponse } from "axios";
|
|
|
3
3
|
import { Client } from "../client";
|
|
4
4
|
import { Collection } from "../collection";
|
|
5
5
|
import { PEI } from '../model/PEI';
|
|
6
|
+
import { PostPeiRequest } from '../model/PostPeiRequest';
|
|
6
7
|
import { Contact } from '../model/Contact';
|
|
7
8
|
import { DescriptifTechniqueDECI } from '../model/DescriptifTechniqueDECI';
|
|
8
9
|
import { PieceJointe } from '../model/PieceJointe';
|
|
@@ -40,4 +41,9 @@ export declare class PEIAPI extends Core {
|
|
|
40
41
|
* @param perPage Nombre de résultats demandé
|
|
41
42
|
*/
|
|
42
43
|
paginatePeiPiecesJointes(peiId: string, page?: number, perPage?: number): Collection<PieceJointe>;
|
|
44
|
+
/**
|
|
45
|
+
* Ajout d'un PEI.
|
|
46
|
+
* @param postPeiRequest
|
|
47
|
+
*/
|
|
48
|
+
postPei(postPeiRequest?: PostPeiRequest): Promise<AxiosResponse<PEI>>;
|
|
43
49
|
}
|
package/lib/api/PEIAPI.js
CHANGED
|
@@ -84,5 +84,19 @@ class PEIAPI extends core_1.Core {
|
|
|
84
84
|
body: {}
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Ajout d'un PEI.
|
|
89
|
+
* @param postPeiRequest
|
|
90
|
+
*/
|
|
91
|
+
async postPei(postPeiRequest) {
|
|
92
|
+
const pathVariable = {};
|
|
93
|
+
return this.request({
|
|
94
|
+
method: 'POST',
|
|
95
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/pei'),
|
|
96
|
+
headers: {},
|
|
97
|
+
params: {},
|
|
98
|
+
body: { 'implantation': postPeiRequest?.implantation, 'numero': postPeiRequest?.numero, 'numero_compteur': postPeiRequest?.numero_compteur, 'numero_serie_appareil': postPeiRequest?.numero_serie_appareil }
|
|
99
|
+
});
|
|
100
|
+
}
|
|
87
101
|
}
|
|
88
102
|
exports.PEIAPI = PEIAPI;
|
|
@@ -1,13 +1,51 @@
|
|
|
1
1
|
import { Core, MetariscConfig } from "../core";
|
|
2
|
+
import type { AxiosResponse } from "axios";
|
|
2
3
|
import { Client } from "../client";
|
|
3
4
|
import { Collection } from "../collection";
|
|
5
|
+
import { PostPrescriptionRequest } from '../model/PostPrescriptionRequest';
|
|
6
|
+
import { PostSupportReglementaireRequest } from '../model/PostSupportReglementaireRequest';
|
|
4
7
|
import { Prescription } from '../model/Prescription';
|
|
8
|
+
import { PrescriptionSupportReglementaire } from '../model/PrescriptionSupportReglementaire';
|
|
5
9
|
export declare class PrescriptionsAPI extends Core {
|
|
6
10
|
constructor(config: MetariscConfig, client?: Client);
|
|
11
|
+
/**
|
|
12
|
+
* Suppression d'une prescription type de la bibliothèque.
|
|
13
|
+
* @param prescriptionId Identifiant unique de la prescription
|
|
14
|
+
*/
|
|
15
|
+
deletePrescription(prescriptionId: string): Promise<AxiosResponse<void>>;
|
|
16
|
+
/**
|
|
17
|
+
* Suppression d'un support réglementaire.
|
|
18
|
+
* @param supportReglementaireId Identifiant unique du support réglementaire
|
|
19
|
+
*/
|
|
20
|
+
deleteSupportReglementaire(supportReglementaireId: string): Promise<AxiosResponse<void>>;
|
|
21
|
+
/**
|
|
22
|
+
* Récupération des détails d'une prescription dans la bibliothèque.
|
|
23
|
+
* @param prescriptionId Identifiant unique de la prescription
|
|
24
|
+
*/
|
|
25
|
+
getPrescription(prescriptionId: string): Promise<AxiosResponse<Prescription>>;
|
|
26
|
+
/**
|
|
27
|
+
* Récupération des détails d'un support réglementaire.
|
|
28
|
+
* @param supportReglementaireId Identifiant unique du support réglementaire
|
|
29
|
+
*/
|
|
30
|
+
getSupportReglementaire(supportReglementaireId: string): Promise<AxiosResponse<PrescriptionSupportReglementaire>>;
|
|
7
31
|
/**
|
|
8
32
|
* Liste des prescriptions.
|
|
9
33
|
* @param page Numéro de page
|
|
10
34
|
* @param perPage Nombre de résultats demandé
|
|
11
35
|
*/
|
|
12
36
|
paginatePrescriptions(page?: number, perPage?: number): Collection<Prescription>;
|
|
37
|
+
/**
|
|
38
|
+
* Liste des supports réglementaires.
|
|
39
|
+
*/
|
|
40
|
+
paginateSupportsReglementaires(): Collection<PrescriptionSupportReglementaire>;
|
|
41
|
+
/**
|
|
42
|
+
* Ajout d'une nouvelle prescription type dans la bibliothèque.
|
|
43
|
+
* @param postPrescriptionRequest
|
|
44
|
+
*/
|
|
45
|
+
postPrescription(postPrescriptionRequest?: PostPrescriptionRequest): Promise<AxiosResponse<Prescription>>;
|
|
46
|
+
/**
|
|
47
|
+
* Ajouter un support réglementaire.
|
|
48
|
+
* @param postSupportReglementaireRequest
|
|
49
|
+
*/
|
|
50
|
+
postSupportReglementaire(postSupportReglementaireRequest?: PostSupportReglementaireRequest): Promise<AxiosResponse<PrescriptionSupportReglementaire>>;
|
|
13
51
|
}
|
|
@@ -7,6 +7,62 @@ class PrescriptionsAPI extends core_1.Core {
|
|
|
7
7
|
constructor(config, client) {
|
|
8
8
|
super(config, client);
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Suppression d'une prescription type de la bibliothèque.
|
|
12
|
+
* @param prescriptionId Identifiant unique de la prescription
|
|
13
|
+
*/
|
|
14
|
+
async deletePrescription(prescriptionId) {
|
|
15
|
+
const pathVariable = { 'prescription_id': prescriptionId };
|
|
16
|
+
return this.request({
|
|
17
|
+
method: 'DELETE',
|
|
18
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/prescriptions/{prescription_id}'),
|
|
19
|
+
headers: {},
|
|
20
|
+
params: {},
|
|
21
|
+
body: {}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Suppression d'un support réglementaire.
|
|
26
|
+
* @param supportReglementaireId Identifiant unique du support réglementaire
|
|
27
|
+
*/
|
|
28
|
+
async deleteSupportReglementaire(supportReglementaireId) {
|
|
29
|
+
const pathVariable = { 'support_reglementaire_id': supportReglementaireId };
|
|
30
|
+
return this.request({
|
|
31
|
+
method: 'DELETE',
|
|
32
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/supports_reglementaires/{support_reglementaire_id}'),
|
|
33
|
+
headers: {},
|
|
34
|
+
params: {},
|
|
35
|
+
body: {}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Récupération des détails d'une prescription dans la bibliothèque.
|
|
40
|
+
* @param prescriptionId Identifiant unique de la prescription
|
|
41
|
+
*/
|
|
42
|
+
async getPrescription(prescriptionId) {
|
|
43
|
+
const pathVariable = { 'prescription_id': prescriptionId };
|
|
44
|
+
return this.request({
|
|
45
|
+
method: 'GET',
|
|
46
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/prescriptions/{prescription_id}'),
|
|
47
|
+
headers: {},
|
|
48
|
+
params: {},
|
|
49
|
+
body: {}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Récupération des détails d'un support réglementaire.
|
|
54
|
+
* @param supportReglementaireId Identifiant unique du support réglementaire
|
|
55
|
+
*/
|
|
56
|
+
async getSupportReglementaire(supportReglementaireId) {
|
|
57
|
+
const pathVariable = { 'support_reglementaire_id': supportReglementaireId };
|
|
58
|
+
return this.request({
|
|
59
|
+
method: 'GET',
|
|
60
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/supports_reglementaires/{support_reglementaire_id}'),
|
|
61
|
+
headers: {},
|
|
62
|
+
params: {},
|
|
63
|
+
body: {}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
10
66
|
/**
|
|
11
67
|
* Liste des prescriptions.
|
|
12
68
|
* @param page Numéro de page
|
|
@@ -22,5 +78,46 @@ class PrescriptionsAPI extends core_1.Core {
|
|
|
22
78
|
body: {}
|
|
23
79
|
});
|
|
24
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Liste des supports réglementaires.
|
|
83
|
+
*/
|
|
84
|
+
paginateSupportsReglementaires() {
|
|
85
|
+
const pathVariable = {};
|
|
86
|
+
return this.collect({
|
|
87
|
+
method: 'GET',
|
|
88
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/supports_reglementaires'),
|
|
89
|
+
headers: {},
|
|
90
|
+
params: {},
|
|
91
|
+
body: {}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Ajout d'une nouvelle prescription type dans la bibliothèque.
|
|
96
|
+
* @param postPrescriptionRequest
|
|
97
|
+
*/
|
|
98
|
+
async postPrescription(postPrescriptionRequest) {
|
|
99
|
+
const pathVariable = {};
|
|
100
|
+
return this.request({
|
|
101
|
+
method: 'POST',
|
|
102
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/prescriptions'),
|
|
103
|
+
headers: {},
|
|
104
|
+
params: {},
|
|
105
|
+
body: { 'contenu': postPrescriptionRequest?.contenu, 'type': postPrescriptionRequest?.type, 'supports_reglementaires': postPrescriptionRequest?.supports_reglementaires }
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Ajouter un support réglementaire.
|
|
110
|
+
* @param postSupportReglementaireRequest
|
|
111
|
+
*/
|
|
112
|
+
async postSupportReglementaire(postSupportReglementaireRequest) {
|
|
113
|
+
const pathVariable = {};
|
|
114
|
+
return this.request({
|
|
115
|
+
method: 'POST',
|
|
116
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/supports_reglementaires'),
|
|
117
|
+
headers: {},
|
|
118
|
+
params: {},
|
|
119
|
+
body: { 'nature': postSupportReglementaireRequest?.nature, 'legifrance_cid': postSupportReglementaireRequest?.legifrance_cid, 'contenu': postSupportReglementaireRequest?.contenu, 'titre': postSupportReglementaireRequest?.titre, 'etat': postSupportReglementaireRequest?.etat, 'reference': postSupportReglementaireRequest?.reference }
|
|
120
|
+
});
|
|
121
|
+
}
|
|
25
122
|
}
|
|
26
123
|
exports.PrescriptionsAPI = PrescriptionsAPI;
|
|
@@ -2,6 +2,7 @@ import { Core, MetariscConfig } from "../core";
|
|
|
2
2
|
import type { AxiosResponse } from "axios";
|
|
3
3
|
import { Client } from "../client";
|
|
4
4
|
import { Collection } from "../collection";
|
|
5
|
+
import { PostTourneeDeciRequest } from '../model/PostTourneeDeciRequest';
|
|
5
6
|
import { TourneeDeci } from '../model/TourneeDeci';
|
|
6
7
|
import { TourneeDeciPei } from '../model/TourneeDeciPei';
|
|
7
8
|
export declare class TournesDECIAPI extends Core {
|
|
@@ -30,4 +31,9 @@ export declare class TournesDECIAPI extends Core {
|
|
|
30
31
|
* @param perPage Nombre de résultats demandé
|
|
31
32
|
*/
|
|
32
33
|
paginateTourneesDeci(page?: number, perPage?: number): Collection<TourneeDeci>;
|
|
34
|
+
/**
|
|
35
|
+
* Ajout d'une nouvelle tournée DECI.
|
|
36
|
+
* @param postTourneeDeciRequest
|
|
37
|
+
*/
|
|
38
|
+
postTourneeDeci(postTourneeDeciRequest?: PostTourneeDeciRequest): Promise<AxiosResponse<TourneeDeci>>;
|
|
33
39
|
}
|
|
@@ -67,5 +67,19 @@ class TournesDECIAPI extends core_1.Core {
|
|
|
67
67
|
body: {}
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Ajout d'une nouvelle tournée DECI.
|
|
72
|
+
* @param postTourneeDeciRequest
|
|
73
|
+
*/
|
|
74
|
+
async postTourneeDeci(postTourneeDeciRequest) {
|
|
75
|
+
const pathVariable = {};
|
|
76
|
+
return this.request({
|
|
77
|
+
method: 'POST',
|
|
78
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/tournees_deci'),
|
|
79
|
+
headers: {},
|
|
80
|
+
params: {},
|
|
81
|
+
body: { 'libelle': postTourneeDeciRequest?.libelle, 'description': postTourneeDeciRequest?.description }
|
|
82
|
+
});
|
|
83
|
+
}
|
|
70
84
|
}
|
|
71
85
|
exports.TournesDECIAPI = TournesDECIAPI;
|
package/lib/metarisc.d.ts
CHANGED
package/lib/metarisc.js
CHANGED
|
@@ -37,6 +37,8 @@ class Metarisc extends core_1.Core {
|
|
|
37
37
|
return new PingAPI_1.PingAPI(config, tmpClient);
|
|
38
38
|
case 'anomalies':
|
|
39
39
|
return new AnomaliesAPI_1.AnomaliesAPI(config, tmpClient);
|
|
40
|
+
case 'supports_reglementaires':
|
|
41
|
+
return new PrescriptionsAPI_1.PrescriptionsAPI(config, tmpClient);
|
|
40
42
|
case 'feed':
|
|
41
43
|
return new FeedAPI_1.FeedAPI(config, tmpClient);
|
|
42
44
|
case 'tournees_deci':
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PostPrescriptionRequestSupportsReglementairesInner } from '../../src/model/PostPrescriptionRequestSupportsReglementairesInner';
|
|
2
|
+
export type PostPrescriptionRequest = {
|
|
3
|
+
'contenu'?: string;
|
|
4
|
+
'type'?: string;
|
|
5
|
+
'supports_reglementaires'?: Array<PostPrescriptionRequestSupportsReglementairesInner>;
|
|
6
|
+
};
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
export type PrescriptionSupportReglementaire = {
|
|
2
2
|
'id'?: string;
|
|
3
3
|
'nature'?: NatureEnum;
|
|
4
|
+
/**
|
|
5
|
+
* Le CID est l’identifiant commun à l’ensemble des versions d’un objet Legifrance (article, section, texte). Si le CID est renseigné, alors ce support réglementaire est sourcé depuis Legifrance.
|
|
6
|
+
*/
|
|
4
7
|
'legifrance_cid'?: string;
|
|
5
8
|
'contenu'?: string;
|
|
9
|
+
'titre'?: string;
|
|
10
|
+
'etat'?: EtatEnum;
|
|
11
|
+
'reference'?: string;
|
|
6
12
|
};
|
|
7
13
|
export declare enum NatureEnum {
|
|
8
14
|
Arrete = "arrete",
|
|
9
15
|
Article = "article",
|
|
10
16
|
Local = "local"
|
|
11
17
|
}
|
|
18
|
+
export declare enum EtatEnum {
|
|
19
|
+
EnVigueur = "en_vigueur"
|
|
20
|
+
}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NatureEnum = void 0;
|
|
3
|
+
exports.EtatEnum = exports.NatureEnum = void 0;
|
|
4
4
|
var NatureEnum;
|
|
5
5
|
(function (NatureEnum) {
|
|
6
6
|
NatureEnum["Arrete"] = "arrete";
|
|
7
7
|
NatureEnum["Article"] = "article";
|
|
8
8
|
NatureEnum["Local"] = "local";
|
|
9
9
|
})(NatureEnum = exports.NatureEnum || (exports.NatureEnum = {}));
|
|
10
|
+
var EtatEnum;
|
|
11
|
+
(function (EtatEnum) {
|
|
12
|
+
EtatEnum["EnVigueur"] = "en_vigueur";
|
|
13
|
+
})(EtatEnum = exports.EtatEnum || (exports.EtatEnum = {}));
|
package/lib/tus.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Core, MetariscConfig } from
|
|
2
|
-
import { Client } from
|
|
1
|
+
import { Core, MetariscConfig } from './core';
|
|
2
|
+
import { Client } from './client';
|
|
3
3
|
export declare class Tus extends Core {
|
|
4
4
|
constructor(config: MetariscConfig, client: Client);
|
|
5
5
|
upload(file: File, errorFn: (error: Error) => void, chunckFn: (url: string, progress: number) => void, successFn: () => void): void;
|
package/lib/tus.js
CHANGED
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Tus = void 0;
|
|
4
4
|
const core_1 = require("./core");
|
|
5
5
|
const tus_js_client_1 = require("tus-js-client");
|
|
6
|
+
const utils_1 = require("./utils");
|
|
7
|
+
const SessionExpiredError_1 = require("./error/SessionExpiredError");
|
|
6
8
|
class Tus extends core_1.Core {
|
|
7
9
|
constructor(config, client) {
|
|
8
10
|
super(config, client);
|
|
@@ -16,8 +18,20 @@ class Tus extends core_1.Core {
|
|
|
16
18
|
fileName: file.name,
|
|
17
19
|
filetype: file.type,
|
|
18
20
|
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
onBeforeRequest: async (request) => {
|
|
22
|
+
const access_token = this.client.getAccessToken();
|
|
23
|
+
if (access_token && utils_1.Utils.tokenExpired(access_token)) {
|
|
24
|
+
try {
|
|
25
|
+
await this.refreshToken();
|
|
26
|
+
request.setHeader("Authorization", this.client.getAccessToken() ?? "");
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
throw new SessionExpiredError_1.SessionExpiredError("La session utilisateur a expirée. " + e.message);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
request.setHeader("Authorization", this.client.getAccessToken() ?? "");
|
|
34
|
+
}
|
|
21
35
|
},
|
|
22
36
|
onError: (error) => {
|
|
23
37
|
errorFn(error);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@metarisc/metarisc-js",
|
|
3
3
|
"main": "lib/index.js",
|
|
4
4
|
"types": "lib/index.d.ts",
|
|
5
|
-
"version": "0.0.1-alpha.
|
|
5
|
+
"version": "0.0.1-alpha.36",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"lint": "eslint . --ext .ts --fix",
|
|
8
8
|
"compile": "tsc",
|
|
@@ -23,6 +23,6 @@
|
|
|
23
23
|
"axios-oauth-client": "^2.0.4",
|
|
24
24
|
"axios-retry": "^3.5.0",
|
|
25
25
|
"jwt-decode": "^4.0.0",
|
|
26
|
-
"tus-js-client": "^
|
|
26
|
+
"tus-js-client": "^4.1.0"
|
|
27
27
|
}
|
|
28
28
|
}
|
package/src/api/AnomaliesAPI.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Core, MetariscConfig } from "../core";
|
|
2
2
|
import { Utils } from "../utils";
|
|
3
|
+
import type { AxiosResponse } from "axios";
|
|
3
4
|
import { Client } from "../client";
|
|
4
5
|
import { Collection } from "../collection";
|
|
5
6
|
import { AnomalieDECI } from '../model/AnomalieDECI';
|
|
@@ -9,6 +10,38 @@ export class AnomaliesAPI extends Core {
|
|
|
9
10
|
super(config, client);
|
|
10
11
|
}
|
|
11
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Suppression d'une anomalie.
|
|
15
|
+
* @param anomalieId Identifiant unique de l'anomalie
|
|
16
|
+
*/
|
|
17
|
+
async deleteAnomalie(anomalieId: string): Promise<AxiosResponse<void>>
|
|
18
|
+
{
|
|
19
|
+
const pathVariable = { 'anomalie_id': anomalieId };
|
|
20
|
+
return this.request({
|
|
21
|
+
method: 'DELETE',
|
|
22
|
+
endpoint: Utils.constructPath(pathVariable, '/anomalies/{anomalie_id}'),
|
|
23
|
+
headers: { },
|
|
24
|
+
params: { },
|
|
25
|
+
body: {}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Détails d'une anomalie.
|
|
31
|
+
* @param anomalieId Identifiant unique de l'anomalie
|
|
32
|
+
*/
|
|
33
|
+
async getAnomalie(anomalieId: string): Promise<AxiosResponse<AnomalieDECI>>
|
|
34
|
+
{
|
|
35
|
+
const pathVariable = { 'anomalie_id': anomalieId };
|
|
36
|
+
return this.request({
|
|
37
|
+
method: 'GET',
|
|
38
|
+
endpoint: Utils.constructPath(pathVariable, '/anomalies/{anomalie_id}'),
|
|
39
|
+
headers: { },
|
|
40
|
+
params: { },
|
|
41
|
+
body: {}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
12
45
|
/**
|
|
13
46
|
* Liste des anomalies.
|
|
14
47
|
* @param page Numéro de page
|
|
@@ -26,4 +59,20 @@ export class AnomaliesAPI extends Core {
|
|
|
26
59
|
});
|
|
27
60
|
}
|
|
28
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Ajout d'une nouvelle anomalie.
|
|
64
|
+
* @param anomalieDECI
|
|
65
|
+
*/
|
|
66
|
+
async postAnomalie(anomalieDECI?: AnomalieDECI): Promise<AxiosResponse<AnomalieDECI>>
|
|
67
|
+
{
|
|
68
|
+
const pathVariable = { };
|
|
69
|
+
return this.request({
|
|
70
|
+
method: 'POST',
|
|
71
|
+
endpoint: Utils.constructPath(pathVariable, '/anomalies'),
|
|
72
|
+
headers: { },
|
|
73
|
+
params: { },
|
|
74
|
+
body: { 'code': anomalieDECI?.code, 'texte': anomalieDECI?.texte, 'indice_de_gravite': anomalieDECI?.indice_de_gravite }
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
29
78
|
}
|
|
@@ -6,12 +6,30 @@ import { Collection } from "../collection";
|
|
|
6
6
|
import { Commission } from '../model/Commission';
|
|
7
7
|
import { PassageCommission } from '../model/PassageCommission';
|
|
8
8
|
import { PassageCommissionDossier } from '../model/PassageCommissionDossier';
|
|
9
|
+
import { PostCommissionDateDossierRequest } from '../model/PostCommissionDateDossierRequest';
|
|
10
|
+
import { PostCommissionRequest } from '../model/PostCommissionRequest';
|
|
9
11
|
|
|
10
12
|
export class CommissionsAPI extends Core {
|
|
11
13
|
constructor(config: MetariscConfig, client?: Client) {
|
|
12
14
|
super(config, client);
|
|
13
15
|
}
|
|
14
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Suppression d'une commission.
|
|
19
|
+
* @param commissionId Identifiant unique de la commission
|
|
20
|
+
*/
|
|
21
|
+
async deleteCommission(commissionId: string): Promise<AxiosResponse<void>>
|
|
22
|
+
{
|
|
23
|
+
const pathVariable = { 'commission_id': commissionId };
|
|
24
|
+
return this.request({
|
|
25
|
+
method: 'DELETE',
|
|
26
|
+
endpoint: Utils.constructPath(pathVariable, '/commissions/{commission_id}'),
|
|
27
|
+
headers: { },
|
|
28
|
+
params: { },
|
|
29
|
+
body: {}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
15
33
|
/**
|
|
16
34
|
* Récupération des détails de la commission.
|
|
17
35
|
* @param commissionId Identifiant unique de la commission
|
|
@@ -99,4 +117,38 @@ export class CommissionsAPI extends Core {
|
|
|
99
117
|
});
|
|
100
118
|
}
|
|
101
119
|
|
|
120
|
+
/**
|
|
121
|
+
* Ajoute une commission.
|
|
122
|
+
* @param postCommissionRequest
|
|
123
|
+
*/
|
|
124
|
+
async postCommission(postCommissionRequest?: PostCommissionRequest): Promise<AxiosResponse<Commission>>
|
|
125
|
+
{
|
|
126
|
+
const pathVariable = { };
|
|
127
|
+
return this.request({
|
|
128
|
+
method: 'POST',
|
|
129
|
+
endpoint: Utils.constructPath(pathVariable, '/commissions'),
|
|
130
|
+
headers: { },
|
|
131
|
+
params: { },
|
|
132
|
+
body: { 'type': postCommissionRequest?.type, 'libelle': postCommissionRequest?.libelle }
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Ajout d'un dossier à l'ordre du jour d'un passage en commission.
|
|
138
|
+
* @param commissionId Identifiant unique de la commission
|
|
139
|
+
* @param dateId Identifiant unique du passage en commission
|
|
140
|
+
* @param postCommissionDateDossierRequest
|
|
141
|
+
*/
|
|
142
|
+
async postCommissionDateDossier(commissionId: string, dateId: string, postCommissionDateDossierRequest?: PostCommissionDateDossierRequest): Promise<AxiosResponse<PassageCommissionDossier>>
|
|
143
|
+
{
|
|
144
|
+
const pathVariable = { 'commission_id': commissionId, 'date_id': dateId };
|
|
145
|
+
return this.request({
|
|
146
|
+
method: 'POST',
|
|
147
|
+
endpoint: Utils.constructPath(pathVariable, '/commissions/{commission_id}/dates/{date_id}/ordre_du_jour'),
|
|
148
|
+
headers: { },
|
|
149
|
+
params: { },
|
|
150
|
+
body: { 'dossier_id': postCommissionDateDossierRequest?.dossier_id }
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
|
|
102
154
|
}
|
package/src/api/ERPAPI.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Core, MetariscConfig } from "../core";
|
|
2
2
|
import { Utils } from "../utils";
|
|
3
|
+
import type { AxiosResponse } from "axios";
|
|
3
4
|
import { Client } from "../client";
|
|
4
5
|
import { Collection } from "../collection";
|
|
5
6
|
import { ERP } from '../model/ERP';
|
|
@@ -9,6 +10,22 @@ export class ERPAPI extends Core {
|
|
|
9
10
|
super(config, client);
|
|
10
11
|
}
|
|
11
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Récupération des détails de l'ERP.
|
|
15
|
+
* @param erpId Identifiant unique de l'ERP
|
|
16
|
+
*/
|
|
17
|
+
async getErp(erpId: string): Promise<AxiosResponse<ERP>>
|
|
18
|
+
{
|
|
19
|
+
const pathVariable = { 'erp_id': erpId };
|
|
20
|
+
return this.request({
|
|
21
|
+
method: 'GET',
|
|
22
|
+
endpoint: Utils.constructPath(pathVariable, '/erp/{erp_id}'),
|
|
23
|
+
headers: { },
|
|
24
|
+
params: { },
|
|
25
|
+
body: {}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
12
29
|
/**
|
|
13
30
|
* Récupération de la liste des ERP.
|
|
14
31
|
* @param page Numéro de page
|
package/src/api/PEIAPI.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { AxiosResponse } from "axios";
|
|
|
4
4
|
import { Client } from "../client";
|
|
5
5
|
import { Collection } from "../collection";
|
|
6
6
|
import { PEI } from '../model/PEI';
|
|
7
|
+
import { PostPeiRequest } from '../model/PostPeiRequest';
|
|
7
8
|
import { Contact } from '../model/Contact';
|
|
8
9
|
import { DescriptifTechniqueDECI } from '../model/DescriptifTechniqueDECI';
|
|
9
10
|
import { PieceJointe } from '../model/PieceJointe';
|
|
@@ -100,4 +101,20 @@ export class PEIAPI extends Core {
|
|
|
100
101
|
});
|
|
101
102
|
}
|
|
102
103
|
|
|
104
|
+
/**
|
|
105
|
+
* Ajout d'un PEI.
|
|
106
|
+
* @param postPeiRequest
|
|
107
|
+
*/
|
|
108
|
+
async postPei(postPeiRequest?: PostPeiRequest): Promise<AxiosResponse<PEI>>
|
|
109
|
+
{
|
|
110
|
+
const pathVariable = { };
|
|
111
|
+
return this.request({
|
|
112
|
+
method: 'POST',
|
|
113
|
+
endpoint: Utils.constructPath(pathVariable, '/pei'),
|
|
114
|
+
headers: { },
|
|
115
|
+
params: { },
|
|
116
|
+
body: { 'implantation': postPeiRequest?.implantation, 'numero': postPeiRequest?.numero, 'numero_compteur': postPeiRequest?.numero_compteur, 'numero_serie_appareil': postPeiRequest?.numero_serie_appareil }
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
103
120
|
}
|
|
@@ -1,14 +1,82 @@
|
|
|
1
1
|
import { Core, MetariscConfig } from "../core";
|
|
2
2
|
import { Utils } from "../utils";
|
|
3
|
+
import type { AxiosResponse } from "axios";
|
|
3
4
|
import { Client } from "../client";
|
|
4
5
|
import { Collection } from "../collection";
|
|
6
|
+
import { PostPrescriptionRequest } from '../model/PostPrescriptionRequest';
|
|
7
|
+
import { PostSupportReglementaireRequest } from '../model/PostSupportReglementaireRequest';
|
|
5
8
|
import { Prescription } from '../model/Prescription';
|
|
9
|
+
import { PrescriptionSupportReglementaire } from '../model/PrescriptionSupportReglementaire';
|
|
6
10
|
|
|
7
11
|
export class PrescriptionsAPI extends Core {
|
|
8
12
|
constructor(config: MetariscConfig, client?: Client) {
|
|
9
13
|
super(config, client);
|
|
10
14
|
}
|
|
11
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Suppression d'une prescription type de la bibliothèque.
|
|
18
|
+
* @param prescriptionId Identifiant unique de la prescription
|
|
19
|
+
*/
|
|
20
|
+
async deletePrescription(prescriptionId: string): Promise<AxiosResponse<void>>
|
|
21
|
+
{
|
|
22
|
+
const pathVariable = { 'prescription_id': prescriptionId };
|
|
23
|
+
return this.request({
|
|
24
|
+
method: 'DELETE',
|
|
25
|
+
endpoint: Utils.constructPath(pathVariable, '/prescriptions/{prescription_id}'),
|
|
26
|
+
headers: { },
|
|
27
|
+
params: { },
|
|
28
|
+
body: {}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Suppression d'un support réglementaire.
|
|
34
|
+
* @param supportReglementaireId Identifiant unique du support réglementaire
|
|
35
|
+
*/
|
|
36
|
+
async deleteSupportReglementaire(supportReglementaireId: string): Promise<AxiosResponse<void>>
|
|
37
|
+
{
|
|
38
|
+
const pathVariable = { 'support_reglementaire_id': supportReglementaireId };
|
|
39
|
+
return this.request({
|
|
40
|
+
method: 'DELETE',
|
|
41
|
+
endpoint: Utils.constructPath(pathVariable, '/supports_reglementaires/{support_reglementaire_id}'),
|
|
42
|
+
headers: { },
|
|
43
|
+
params: { },
|
|
44
|
+
body: {}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Récupération des détails d'une prescription dans la bibliothèque.
|
|
50
|
+
* @param prescriptionId Identifiant unique de la prescription
|
|
51
|
+
*/
|
|
52
|
+
async getPrescription(prescriptionId: string): Promise<AxiosResponse<Prescription>>
|
|
53
|
+
{
|
|
54
|
+
const pathVariable = { 'prescription_id': prescriptionId };
|
|
55
|
+
return this.request({
|
|
56
|
+
method: 'GET',
|
|
57
|
+
endpoint: Utils.constructPath(pathVariable, '/prescriptions/{prescription_id}'),
|
|
58
|
+
headers: { },
|
|
59
|
+
params: { },
|
|
60
|
+
body: {}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Récupération des détails d'un support réglementaire.
|
|
66
|
+
* @param supportReglementaireId Identifiant unique du support réglementaire
|
|
67
|
+
*/
|
|
68
|
+
async getSupportReglementaire(supportReglementaireId: string): Promise<AxiosResponse<PrescriptionSupportReglementaire>>
|
|
69
|
+
{
|
|
70
|
+
const pathVariable = { 'support_reglementaire_id': supportReglementaireId };
|
|
71
|
+
return this.request({
|
|
72
|
+
method: 'GET',
|
|
73
|
+
endpoint: Utils.constructPath(pathVariable, '/supports_reglementaires/{support_reglementaire_id}'),
|
|
74
|
+
headers: { },
|
|
75
|
+
params: { },
|
|
76
|
+
body: {}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
12
80
|
/**
|
|
13
81
|
* Liste des prescriptions.
|
|
14
82
|
* @param page Numéro de page
|
|
@@ -26,4 +94,51 @@ export class PrescriptionsAPI extends Core {
|
|
|
26
94
|
});
|
|
27
95
|
}
|
|
28
96
|
|
|
97
|
+
/**
|
|
98
|
+
* Liste des supports réglementaires.
|
|
99
|
+
*/
|
|
100
|
+
paginateSupportsReglementaires(): Collection<PrescriptionSupportReglementaire>
|
|
101
|
+
{
|
|
102
|
+
const pathVariable = { };
|
|
103
|
+
return this.collect<PrescriptionSupportReglementaire>({
|
|
104
|
+
method: 'GET',
|
|
105
|
+
endpoint: Utils.constructPath(pathVariable, '/supports_reglementaires'),
|
|
106
|
+
headers: { },
|
|
107
|
+
params: { },
|
|
108
|
+
body: {}
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Ajout d'une nouvelle prescription type dans la bibliothèque.
|
|
114
|
+
* @param postPrescriptionRequest
|
|
115
|
+
*/
|
|
116
|
+
async postPrescription(postPrescriptionRequest?: PostPrescriptionRequest): Promise<AxiosResponse<Prescription>>
|
|
117
|
+
{
|
|
118
|
+
const pathVariable = { };
|
|
119
|
+
return this.request({
|
|
120
|
+
method: 'POST',
|
|
121
|
+
endpoint: Utils.constructPath(pathVariable, '/prescriptions'),
|
|
122
|
+
headers: { },
|
|
123
|
+
params: { },
|
|
124
|
+
body: { 'contenu': postPrescriptionRequest?.contenu, 'type': postPrescriptionRequest?.type, 'supports_reglementaires': postPrescriptionRequest?.supports_reglementaires }
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Ajouter un support réglementaire.
|
|
130
|
+
* @param postSupportReglementaireRequest
|
|
131
|
+
*/
|
|
132
|
+
async postSupportReglementaire(postSupportReglementaireRequest?: PostSupportReglementaireRequest): Promise<AxiosResponse<PrescriptionSupportReglementaire>>
|
|
133
|
+
{
|
|
134
|
+
const pathVariable = { };
|
|
135
|
+
return this.request({
|
|
136
|
+
method: 'POST',
|
|
137
|
+
endpoint: Utils.constructPath(pathVariable, '/supports_reglementaires'),
|
|
138
|
+
headers: { },
|
|
139
|
+
params: { },
|
|
140
|
+
body: { 'nature': postSupportReglementaireRequest?.nature, 'legifrance_cid': postSupportReglementaireRequest?.legifrance_cid, 'contenu': postSupportReglementaireRequest?.contenu, 'titre': postSupportReglementaireRequest?.titre, 'etat': postSupportReglementaireRequest?.etat, 'reference': postSupportReglementaireRequest?.reference }
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
|
|
29
144
|
}
|
|
@@ -3,6 +3,7 @@ import { Utils } from "../utils";
|
|
|
3
3
|
import type { AxiosResponse } from "axios";
|
|
4
4
|
import { Client } from "../client";
|
|
5
5
|
import { Collection } from "../collection";
|
|
6
|
+
import { PostTourneeDeciRequest } from '../model/PostTourneeDeciRequest';
|
|
6
7
|
import { TourneeDeci } from '../model/TourneeDeci';
|
|
7
8
|
import { TourneeDeciPei } from '../model/TourneeDeciPei';
|
|
8
9
|
|
|
@@ -79,4 +80,20 @@ export class TournesDECIAPI extends Core {
|
|
|
79
80
|
});
|
|
80
81
|
}
|
|
81
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Ajout d'une nouvelle tournée DECI.
|
|
85
|
+
* @param postTourneeDeciRequest
|
|
86
|
+
*/
|
|
87
|
+
async postTourneeDeci(postTourneeDeciRequest?: PostTourneeDeciRequest): Promise<AxiosResponse<TourneeDeci>>
|
|
88
|
+
{
|
|
89
|
+
const pathVariable = { };
|
|
90
|
+
return this.request({
|
|
91
|
+
method: 'POST',
|
|
92
|
+
endpoint: Utils.constructPath(pathVariable, '/tournees_deci'),
|
|
93
|
+
headers: { },
|
|
94
|
+
params: { },
|
|
95
|
+
body: { 'libelle': postTourneeDeciRequest?.libelle, 'description': postTourneeDeciRequest?.description }
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
82
99
|
}
|
package/src/metarisc.ts
CHANGED
|
@@ -47,6 +47,8 @@ export class Metarisc extends Core
|
|
|
47
47
|
|
|
48
48
|
public anomalies?: AnomaliesAPI;
|
|
49
49
|
|
|
50
|
+
public supports_reglementaires?: PrescriptionsAPI;
|
|
51
|
+
|
|
50
52
|
public feed?: FeedAPI;
|
|
51
53
|
|
|
52
54
|
public tournees_deci?: TournesDECIAPI;
|
|
@@ -94,6 +96,9 @@ export class Metarisc extends Core
|
|
|
94
96
|
case 'anomalies':
|
|
95
97
|
return new AnomaliesAPI(config, tmpClient);
|
|
96
98
|
|
|
99
|
+
case 'supports_reglementaires':
|
|
100
|
+
return new PrescriptionsAPI(config, tmpClient);
|
|
101
|
+
|
|
97
102
|
case 'feed':
|
|
98
103
|
return new FeedAPI(config, tmpClient);
|
|
99
104
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PostPrescriptionRequestSupportsReglementairesInner } from '../../src/model/PostPrescriptionRequestSupportsReglementairesInner';
|
|
2
|
+
|
|
3
|
+
export type PostPrescriptionRequest = {
|
|
4
|
+
'contenu'?: string;
|
|
5
|
+
'type'?: string;
|
|
6
|
+
'supports_reglementaires'?: Array<PostPrescriptionRequestSupportsReglementairesInner>;
|
|
7
|
+
};
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
export type PrescriptionSupportReglementaire = {
|
|
2
2
|
'id'?: string;
|
|
3
3
|
'nature'?: NatureEnum;
|
|
4
|
+
/**
|
|
5
|
+
* Le CID est l’identifiant commun à l’ensemble des versions d’un objet Legifrance (article, section, texte). Si le CID est renseigné, alors ce support réglementaire est sourcé depuis Legifrance.
|
|
6
|
+
*/
|
|
4
7
|
'legifrance_cid'?: string;
|
|
5
8
|
'contenu'?: string;
|
|
9
|
+
'titre'?: string;
|
|
10
|
+
'etat'?: EtatEnum;
|
|
11
|
+
'reference'?: string;
|
|
6
12
|
};
|
|
7
13
|
|
|
8
14
|
export enum NatureEnum {
|
|
@@ -10,3 +16,7 @@ export enum NatureEnum {
|
|
|
10
16
|
Article = 'article',
|
|
11
17
|
Local = 'local'
|
|
12
18
|
}
|
|
19
|
+
|
|
20
|
+
export enum EtatEnum {
|
|
21
|
+
EnVigueur = 'en_vigueur'
|
|
22
|
+
}
|
package/src/tus.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { Core, MetariscConfig } from
|
|
2
|
-
import { Upload } from 'tus-js-client';
|
|
3
|
-
import { Client } from
|
|
1
|
+
import { Core, MetariscConfig } from './core';
|
|
2
|
+
import { HttpRequest, Upload } from 'tus-js-client';
|
|
3
|
+
import { Client } from './client';
|
|
4
|
+
import { Utils } from './utils';
|
|
5
|
+
import { SessionExpiredError } from './error/SessionExpiredError';
|
|
4
6
|
|
|
5
7
|
export class Tus extends Core
|
|
6
8
|
{
|
|
@@ -17,8 +19,26 @@ export class Tus extends Core
|
|
|
17
19
|
fileName: file.name,
|
|
18
20
|
filetype: file.type,
|
|
19
21
|
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
onBeforeRequest: async (request: HttpRequest) => {
|
|
23
|
+
const access_token = this.client.getAccessToken();
|
|
24
|
+
if (access_token && Utils.tokenExpired(access_token)) {
|
|
25
|
+
try {
|
|
26
|
+
await this.refreshToken();
|
|
27
|
+
request.setHeader(
|
|
28
|
+
"Authorization",
|
|
29
|
+
this.client.getAccessToken() ?? ""
|
|
30
|
+
);
|
|
31
|
+
} catch (e) {
|
|
32
|
+
throw new SessionExpiredError(
|
|
33
|
+
"La session utilisateur a expirée. " + e.message
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
request.setHeader(
|
|
38
|
+
"Authorization",
|
|
39
|
+
this.client.getAccessToken() ?? ""
|
|
40
|
+
);
|
|
41
|
+
}
|
|
22
42
|
},
|
|
23
43
|
onError: (error) => {
|
|
24
44
|
errorFn(error);
|