@metarisc/metarisc-js 0.0.1-alpha.3 → 0.0.1-alpha.31
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/.eslintrc +10 -2
- package/.github/workflows/main.yml +1 -1
- package/README.md +69 -0
- package/lib/api/DossiersAPI.d.ts +62 -0
- package/lib/api/DossiersAPI.js +133 -0
- package/lib/api/EvenementsAPI.d.ts +41 -0
- package/lib/api/EvenementsAPI.js +87 -0
- package/lib/api/FeedAPI.d.ts +11 -0
- package/lib/api/FeedAPI.js +24 -0
- package/lib/api/MoiAPI.d.ts +11 -0
- package/lib/api/MoiAPI.js +24 -0
- package/lib/api/NotificationsAPI.d.ts +30 -0
- package/lib/api/NotificationsAPI.js +68 -0
- package/lib/api/OrganisationsAPI.d.ts +19 -0
- package/lib/api/OrganisationsAPI.js +40 -0
- package/lib/api/PEIAPI.d.ts +43 -0
- package/lib/api/PEIAPI.js +88 -0
- package/lib/api/PingAPI.d.ts +11 -0
- package/lib/api/PingAPI.js +24 -0
- package/lib/api/SupportAPI.d.ts +25 -0
- package/lib/api/SupportAPI.js +54 -0
- package/lib/api/UtilisateursAPI.d.ts +29 -0
- package/lib/api/UtilisateursAPI.js +67 -0
- package/lib/auth/oauth2.d.ts +57 -0
- package/lib/auth/oauth2.js +56 -0
- package/lib/client.d.ts +52 -0
- package/lib/client.js +148 -0
- package/lib/collection.d.ts +42 -0
- package/lib/collection.js +59 -0
- package/lib/core.d.ts +40 -0
- package/lib/core.js +34 -0
- package/lib/error/SessionExpiredError.d.ts +3 -0
- package/lib/error/SessionExpiredError.js +11 -0
- package/lib/index.d.ts +18 -1
- package/lib/index.js +36 -1
- package/lib/metarisc.d.ts +26 -18
- package/lib/metarisc.js +45 -28
- package/lib/model/AdressePostale.d.ts +14 -0
- package/lib/model/AdressePostale.js +2 -0
- package/lib/model/AnomalieDECI.d.ts +10 -0
- package/lib/model/AnomalieDECI.js +9 -0
- package/lib/model/AnomaliePEI.d.ts +8 -0
- package/lib/model/AnomaliePEI.js +2 -0
- package/lib/model/Contact.d.ts +15 -0
- package/lib/model/Contact.js +2 -0
- package/lib/model/DescriptifTechniqueDECI.d.ts +34 -0
- package/lib/model/DescriptifTechniqueDECI.js +38 -0
- package/lib/model/DescriptifTechniqueDECIBase.d.ts +38 -0
- package/lib/model/DescriptifTechniqueDECIBase.js +23 -0
- package/lib/model/DescriptifTechniquePENA.d.ts +36 -0
- package/lib/model/DescriptifTechniquePENA.js +38 -0
- package/lib/model/DescriptifTechniquePIBI.d.ts +39 -0
- package/lib/model/DescriptifTechniquePIBI.js +34 -0
- package/lib/model/Document.d.ts +3 -0
- package/lib/model/Document.js +2 -0
- package/lib/model/Dossier.d.ts +17 -0
- package/lib/model/Dossier.js +8 -0
- package/lib/model/Email.d.ts +6 -0
- package/lib/model/Email.js +2 -0
- package/lib/model/Evenement.d.ts +14 -0
- package/lib/model/Evenement.js +10 -0
- package/lib/model/FeedMessage.d.ts +2 -0
- package/lib/model/FeedMessage.js +2 -0
- package/lib/model/FeedMessageBase.d.ts +6 -0
- package/lib/model/FeedMessageBase.js +2 -0
- package/lib/model/FeedMessageTexte.d.ts +4 -0
- package/lib/model/FeedMessageTexte.js +2 -0
- package/lib/model/GetEvenementDetails404Response.d.ts +6 -0
- package/lib/model/GetEvenementDetails404Response.js +2 -0
- package/lib/model/GetNotification404Response.d.ts +6 -0
- package/lib/model/GetNotification404Response.js +2 -0
- package/lib/model/Moi200Response.d.ts +12 -0
- package/lib/model/Moi200Response.js +2 -0
- package/lib/model/Notification.d.ts +12 -0
- package/lib/model/Notification.js +2 -0
- package/lib/model/Organisation.d.ts +9 -0
- package/lib/model/Organisation.js +7 -0
- package/lib/model/PEI.d.ts +19 -0
- package/lib/model/PEI.js +8 -0
- package/lib/model/PEIReferencesExterieuresInner.d.ts +4 -0
- package/lib/model/PEIReferencesExterieuresInner.js +2 -0
- package/lib/model/PieceJointe.d.ts +7 -0
- package/lib/model/PieceJointe.js +2 -0
- package/lib/model/Ping200Response.d.ts +3 -0
- package/lib/model/Ping200Response.js +2 -0
- package/lib/model/PostDossierRequest.d.ts +5 -0
- package/lib/model/PostDossierRequest.js +2 -0
- package/lib/model/PostEvenementRequest.d.ts +7 -0
- package/lib/model/PostEvenementRequest.js +2 -0
- package/lib/model/PostNotification400Response.d.ts +6 -0
- package/lib/model/PostNotification400Response.js +2 -0
- package/lib/model/PostNotification500Response.d.ts +6 -0
- package/lib/model/PostNotification500Response.js +2 -0
- package/lib/model/PostNotificationRequest.d.ts +9 -0
- package/lib/model/PostNotificationRequest.js +2 -0
- package/lib/model/PostTicketRequest.d.ts +10 -0
- package/lib/model/PostTicketRequest.js +2 -0
- package/lib/model/Tag.d.ts +3 -0
- package/lib/model/Tag.js +2 -0
- package/lib/model/Ticket.d.ts +17 -0
- package/lib/model/Ticket.js +12 -0
- package/lib/model/Type.d.ts +5 -0
- package/lib/model/Type.js +2 -0
- package/lib/model/Utilisateur.d.ts +12 -0
- package/lib/model/Utilisateur.js +2 -0
- package/lib/model/Workflow.d.ts +4 -0
- package/lib/model/Workflow.js +2 -0
- package/lib/model/WorkflowBase.d.ts +14 -0
- package/lib/model/WorkflowBase.js +2 -0
- package/lib/model/WorkflowDossiersLies.d.ts +4 -0
- package/lib/model/WorkflowDossiersLies.js +2 -0
- package/lib/model/WorkflowPassageCommissionSecurite.d.ts +4 -0
- package/lib/model/WorkflowPassageCommissionSecurite.js +2 -0
- package/lib/model/WorkflowRemiseEnServicePEI.d.ts +5 -0
- package/lib/model/WorkflowRemiseEnServicePEI.js +2 -0
- package/lib/tus.d.ts +7 -0
- package/lib/tus.js +43 -0
- package/lib/utils.d.ts +9 -0
- package/lib/utils.js +35 -0
- package/package.json +26 -18
- package/src/api/DossiersAPI.ts +155 -0
- package/src/api/EvenementsAPI.ts +101 -0
- package/src/api/FeedAPI.ts +27 -0
- package/src/api/MoiAPI.ts +27 -0
- package/src/api/NotificationsAPI.ts +79 -0
- package/src/api/OrganisationsAPI.ts +46 -0
- package/src/api/PEIAPI.ts +103 -0
- package/src/api/PingAPI.ts +27 -0
- package/src/api/SupportAPI.ts +63 -0
- package/src/api/UtilisateursAPI.ts +78 -0
- package/src/auth/oauth2.ts +112 -0
- package/src/client.ts +178 -0
- package/src/collection.ts +96 -0
- package/src/core.ts +68 -0
- package/src/error/SessionExpiredError.ts +8 -0
- package/src/index.ts +28 -1
- package/src/metarisc.ts +88 -54
- package/src/model/AdressePostale.ts +14 -0
- package/src/model/AnomalieDECI.ts +11 -0
- package/src/model/AnomaliePEI.ts +9 -0
- package/src/model/Contact.ts +15 -0
- package/src/model/DescriptifTechniqueDECI.ts +39 -0
- package/src/model/DescriptifTechniqueDECIBase.ts +42 -0
- package/src/model/DescriptifTechniquePENA.ts +41 -0
- package/src/model/DescriptifTechniquePIBI.ts +44 -0
- package/src/model/Document.ts +3 -0
- package/src/model/Dossier.ts +19 -0
- package/src/model/Email.ts +6 -0
- package/src/model/Evenement.ts +15 -0
- package/src/model/FeedMessage.ts +3 -0
- package/src/model/FeedMessageBase.ts +6 -0
- package/src/model/FeedMessageTexte.ts +5 -0
- package/src/model/GetEvenementDetails404Response.ts +6 -0
- package/src/model/GetNotification404Response.ts +6 -0
- package/src/model/Moi200Response.ts +12 -0
- package/src/model/Notification.ts +12 -0
- package/src/model/Organisation.ts +10 -0
- package/src/model/PEI.ts +21 -0
- package/src/model/PEIReferencesExterieuresInner.ts +4 -0
- package/src/model/PieceJointe.ts +7 -0
- package/src/model/Ping200Response.ts +3 -0
- package/src/model/PostDossierRequest.ts +5 -0
- package/src/model/PostEvenementRequest.ts +7 -0
- package/src/model/PostNotification400Response.ts +6 -0
- package/src/model/PostNotification500Response.ts +6 -0
- package/src/model/PostNotificationRequest.ts +9 -0
- package/src/model/PostTicketRequest.ts +10 -0
- package/src/model/Tag.ts +3 -0
- package/src/model/Ticket.ts +18 -0
- package/src/model/Type.ts +5 -0
- package/src/model/Utilisateur.ts +12 -0
- package/src/model/Workflow.ts +5 -0
- package/src/model/WorkflowBase.ts +14 -0
- package/src/model/WorkflowDossiersLies.ts +5 -0
- package/src/model/WorkflowPassageCommissionSecurite.ts +5 -0
- package/src/model/WorkflowRemiseEnServicePEI.ts +6 -0
- package/src/tus.ts +44 -0
- package/src/utils.ts +35 -0
- package/tsconfig.json +11 -10
package/.eslintrc
CHANGED
|
@@ -2,11 +2,19 @@
|
|
|
2
2
|
"root": true,
|
|
3
3
|
"parser": "@typescript-eslint/parser",
|
|
4
4
|
"plugins": [
|
|
5
|
-
"@typescript-eslint"
|
|
5
|
+
"@typescript-eslint",
|
|
6
|
+
"unused-imports",
|
|
7
|
+
"import"
|
|
6
8
|
],
|
|
7
9
|
"extends": [
|
|
8
10
|
"eslint:recommended",
|
|
9
11
|
"plugin:@typescript-eslint/eslint-recommended",
|
|
10
12
|
"plugin:@typescript-eslint/recommended"
|
|
11
|
-
]
|
|
13
|
+
],
|
|
14
|
+
"rules": {
|
|
15
|
+
"@typescript-eslint/no-explicit-any": ["off"],
|
|
16
|
+
"no-multiple-empty-lines": [1, { "max": 1, "maxEOF": 0, "maxBOF": 0 }],
|
|
17
|
+
"unused-imports/no-unused-imports": "error",
|
|
18
|
+
"import/no-duplicates": ["error", {"considerQueryString": true, "prefer-inline": true}]
|
|
19
|
+
}
|
|
12
20
|
}
|
package/README.md
CHANGED
|
@@ -1,3 +1,72 @@
|
|
|
1
1
|
# Metarisc JS
|
|
2
2
|
|
|
3
3
|
La librairie Metarisc JS offre un accès simple et pratique à l'API Metarisc à partir d'applications écrites en langage JS. Elle comprend un ensemble de classes et de fonctions pour l'ensemble des ressources de l'API.
|
|
4
|
+
|
|
5
|
+
## NPM
|
|
6
|
+
|
|
7
|
+
Vous pouvez installer la librairie en utilisant [NPM](https://www.npmjs.com). Exécutez la commande suivante dans votre projet :
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i @metarisc/metarisc-js
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Pour utiliser la librairie, il suffit de l'importer comme ceci :
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { Metarisc } from '@metarisc/metarisc-js';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Utilisation
|
|
20
|
+
|
|
21
|
+
### Requêtes
|
|
22
|
+
|
|
23
|
+
Pour effectuer une requête sur Metarisc, il faut tout d'adord initialisé le client metarisc de cette manière :
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
const m = new Metarisc({
|
|
27
|
+
metarisc_url: "https://api.metarisc.fr",
|
|
28
|
+
client_id: "CLIENT_ID",
|
|
29
|
+
client_secret: "CLIENT_SECRET"
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
m.dossiers.getDossier("123456");
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Ensuite vous pouvez faire vos requêtes.
|
|
36
|
+
|
|
37
|
+
#### Requêtes simple
|
|
38
|
+
|
|
39
|
+
Pour faire un appel API après initialisation du client, vous pouvez utiliser l'accès rapide à l'API souhaitée.
|
|
40
|
+
|
|
41
|
+
Exemple :
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
m.dossiers.getDossier("123456");
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Le type de retour d'une requête simple est :
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
Promise<AxiosResponse<T>>;
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
(voir les documentations suivantes [Promise](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Promise) et [AxiosResponse](https://axios-http.com/docs/res_schema))
|
|
54
|
+
|
|
55
|
+
#### Requêtes paginées
|
|
56
|
+
|
|
57
|
+
Pour récupérer des résultats paginés Metarisc (voir la [documentation](http://metarisc.fr/docs/api/#/#pagination)), il suffit de faire appel à l'api souhaitée de la même manière que pour une requête simple.
|
|
58
|
+
|
|
59
|
+
Exemple :
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
const m = new Metarisc(config);
|
|
63
|
+
m.NotificationsAPI.paginateNotifications();
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Le type de retour d'une requête paginée est :
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
AsyncGenerator<T>;
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
(voir la documentation suivante [AsyncGenerator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncGenerator))
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Core, MetariscConfig } from "../core";
|
|
2
|
+
import type { AxiosResponse } from "axios";
|
|
3
|
+
import { Client } from "../client";
|
|
4
|
+
import { Collection } from "../collection";
|
|
5
|
+
import { Dossier } from '../model/Dossier';
|
|
6
|
+
import { PostDossierRequest } from '../model/PostDossierRequest';
|
|
7
|
+
import { Workflow } from '../model/Workflow';
|
|
8
|
+
import { Tag } from '../model/Tag';
|
|
9
|
+
import { Document } from '../model/Document';
|
|
10
|
+
export declare class DossiersAPI extends Core {
|
|
11
|
+
constructor(config: MetariscConfig, client?: Client);
|
|
12
|
+
/**
|
|
13
|
+
* Récupération de l'ensemble des données d'un dossier.
|
|
14
|
+
* @param dossierId Identifiant unique du Dossier
|
|
15
|
+
*/
|
|
16
|
+
getDossier(dossierId: string): Promise<AxiosResponse<Dossier>>;
|
|
17
|
+
/**
|
|
18
|
+
* Récupération des détails d'un workflow.
|
|
19
|
+
* @param dossierId Identifiant unique du Dossier
|
|
20
|
+
* @param workflowId Identifiant unique du Workflow
|
|
21
|
+
*/
|
|
22
|
+
getDossierWorkflowsDetails(dossierId: string, workflowId: string): Promise<AxiosResponse<Workflow>>;
|
|
23
|
+
/**
|
|
24
|
+
* Récupération de la liste des tags d'un dossier.
|
|
25
|
+
* @param dossierId Identifiant unique du Dossier
|
|
26
|
+
* @param page Numéro de page
|
|
27
|
+
* @param perPage Nombre de résultats demandé
|
|
28
|
+
*/
|
|
29
|
+
paginateDossierTags(dossierId: string, page?: number, perPage?: number): Collection<Tag>;
|
|
30
|
+
/**
|
|
31
|
+
* Liste des documents liés à un workflow.
|
|
32
|
+
* @param dossierId Identifiant unique du Dossier
|
|
33
|
+
* @param workflowId Identifiant unique du Workflow
|
|
34
|
+
* @param page Numéro de page
|
|
35
|
+
* @param perPage Nombre de résultats demandé
|
|
36
|
+
*/
|
|
37
|
+
paginateDossierWorkflowDocuments(dossierId: string, workflowId: string, page?: number, perPage?: number): Collection<Document>;
|
|
38
|
+
/**
|
|
39
|
+
* Récupération de la liste des workflows d'un dossier.
|
|
40
|
+
* @param dossierId Identifiant unique du Dossier
|
|
41
|
+
* @param page Numéro de page
|
|
42
|
+
* @param perPage Nombre de résultats demandé
|
|
43
|
+
*/
|
|
44
|
+
paginateDossierWorkflows(dossierId: string, page?: number, perPage?: number): Collection<Workflow>;
|
|
45
|
+
/**
|
|
46
|
+
* Récupération de la liste des dossiers selon des critères de recherche.
|
|
47
|
+
* @param page Numéro de page
|
|
48
|
+
* @param perPage Nombre de résultats demandé
|
|
49
|
+
*/
|
|
50
|
+
paginateDossiers(page?: number, perPage?: number): Collection<Dossier>;
|
|
51
|
+
/**
|
|
52
|
+
* TODO : Modification d'un dossier existant.
|
|
53
|
+
* @param dossierId Identifiant unique du Dossier
|
|
54
|
+
* @param dossier
|
|
55
|
+
*/
|
|
56
|
+
patchDossier(dossierId: string, dossier?: Dossier): Promise<AxiosResponse<Dossier>>;
|
|
57
|
+
/**
|
|
58
|
+
* TODO : Création d'un nouveau dossier.
|
|
59
|
+
* @param postDossierRequest
|
|
60
|
+
*/
|
|
61
|
+
postDossier(postDossierRequest?: PostDossierRequest): Promise<AxiosResponse<Dossier>>;
|
|
62
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DossiersAPI = void 0;
|
|
4
|
+
const core_1 = require("../core");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
class DossiersAPI extends core_1.Core {
|
|
7
|
+
constructor(config, client) {
|
|
8
|
+
super(config, client);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Récupération de l'ensemble des données d'un dossier.
|
|
12
|
+
* @param dossierId Identifiant unique du Dossier
|
|
13
|
+
*/
|
|
14
|
+
async getDossier(dossierId) {
|
|
15
|
+
const pathVariable = { 'dossier_id': dossierId };
|
|
16
|
+
return this.request({
|
|
17
|
+
method: 'GET',
|
|
18
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/dossiers/{dossier_id}'),
|
|
19
|
+
headers: {},
|
|
20
|
+
params: {},
|
|
21
|
+
body: {}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Récupération des détails d'un workflow.
|
|
26
|
+
* @param dossierId Identifiant unique du Dossier
|
|
27
|
+
* @param workflowId Identifiant unique du Workflow
|
|
28
|
+
*/
|
|
29
|
+
async getDossierWorkflowsDetails(dossierId, workflowId) {
|
|
30
|
+
const pathVariable = { 'dossier_id': dossierId, 'workflow_id': workflowId };
|
|
31
|
+
return this.request({
|
|
32
|
+
method: 'GET',
|
|
33
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/dossiers/{dossier_id}/workflows/{workflow_id}'),
|
|
34
|
+
headers: {},
|
|
35
|
+
params: {},
|
|
36
|
+
body: {}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Récupération de la liste des tags d'un dossier.
|
|
41
|
+
* @param dossierId Identifiant unique du Dossier
|
|
42
|
+
* @param page Numéro de page
|
|
43
|
+
* @param perPage Nombre de résultats demandé
|
|
44
|
+
*/
|
|
45
|
+
paginateDossierTags(dossierId, page, perPage) {
|
|
46
|
+
const pathVariable = { 'dossier_id': dossierId };
|
|
47
|
+
return this.collect({
|
|
48
|
+
method: 'GET',
|
|
49
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/dossiers/{dossier_id}/tags'),
|
|
50
|
+
headers: {},
|
|
51
|
+
params: { 'page': page?.toString(), 'per_page': perPage?.toString() },
|
|
52
|
+
body: {}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Liste des documents liés à un workflow.
|
|
57
|
+
* @param dossierId Identifiant unique du Dossier
|
|
58
|
+
* @param workflowId Identifiant unique du Workflow
|
|
59
|
+
* @param page Numéro de page
|
|
60
|
+
* @param perPage Nombre de résultats demandé
|
|
61
|
+
*/
|
|
62
|
+
paginateDossierWorkflowDocuments(dossierId, workflowId, page, perPage) {
|
|
63
|
+
const pathVariable = { 'dossier_id': dossierId, 'workflow_id': workflowId };
|
|
64
|
+
return this.collect({
|
|
65
|
+
method: 'GET',
|
|
66
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/dossiers/{dossier_id}/workflows/{workflow_id}/documents'),
|
|
67
|
+
headers: {},
|
|
68
|
+
params: { 'page': page?.toString(), 'per_page': perPage?.toString() },
|
|
69
|
+
body: {}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Récupération de la liste des workflows d'un dossier.
|
|
74
|
+
* @param dossierId Identifiant unique du Dossier
|
|
75
|
+
* @param page Numéro de page
|
|
76
|
+
* @param perPage Nombre de résultats demandé
|
|
77
|
+
*/
|
|
78
|
+
paginateDossierWorkflows(dossierId, page, perPage) {
|
|
79
|
+
const pathVariable = { 'dossier_id': dossierId };
|
|
80
|
+
return this.collect({
|
|
81
|
+
method: 'GET',
|
|
82
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/dossiers/{dossier_id}/workflows'),
|
|
83
|
+
headers: {},
|
|
84
|
+
params: { 'page': page?.toString(), 'per_page': perPage?.toString() },
|
|
85
|
+
body: {}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Récupération de la liste des dossiers selon des critères de recherche.
|
|
90
|
+
* @param page Numéro de page
|
|
91
|
+
* @param perPage Nombre de résultats demandé
|
|
92
|
+
*/
|
|
93
|
+
paginateDossiers(page, perPage) {
|
|
94
|
+
const pathVariable = {};
|
|
95
|
+
return this.collect({
|
|
96
|
+
method: 'GET',
|
|
97
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/dossiers'),
|
|
98
|
+
headers: {},
|
|
99
|
+
params: { 'page': page?.toString(), 'per_page': perPage?.toString() },
|
|
100
|
+
body: {}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* TODO : Modification d'un dossier existant.
|
|
105
|
+
* @param dossierId Identifiant unique du Dossier
|
|
106
|
+
* @param dossier
|
|
107
|
+
*/
|
|
108
|
+
async patchDossier(dossierId, dossier) {
|
|
109
|
+
const pathVariable = { 'dossier_id': dossierId };
|
|
110
|
+
return this.request({
|
|
111
|
+
method: 'PATCH',
|
|
112
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/dossiers/{dossier_id}'),
|
|
113
|
+
headers: {},
|
|
114
|
+
params: {},
|
|
115
|
+
body: { 'id': dossier?.id, 'type': dossier?.type, 'description': dossier?.description, 'date_de_creation': dossier?.date_de_creation, 'createur': dossier?.createur, 'application_utilisee': dossier?.application_utilisee, 'statut': dossier?.statut }
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* TODO : Création d'un nouveau dossier.
|
|
120
|
+
* @param postDossierRequest
|
|
121
|
+
*/
|
|
122
|
+
async postDossier(postDossierRequest) {
|
|
123
|
+
const pathVariable = {};
|
|
124
|
+
return this.request({
|
|
125
|
+
method: 'POST',
|
|
126
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/dossiers'),
|
|
127
|
+
headers: {},
|
|
128
|
+
params: {},
|
|
129
|
+
body: { 'titre': postDossierRequest?.titre, 'description': postDossierRequest?.description, 'workflows': postDossierRequest?.workflows }
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
exports.DossiersAPI = DossiersAPI;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Core, MetariscConfig } from "../core";
|
|
2
|
+
import type { AxiosResponse } from "axios";
|
|
3
|
+
import { Client } from "../client";
|
|
4
|
+
import { Collection } from "../collection";
|
|
5
|
+
import { Evenement } from '../model/Evenement';
|
|
6
|
+
import { PostEvenementRequest } from '../model/PostEvenementRequest';
|
|
7
|
+
import { Utilisateur } from '../model/Utilisateur';
|
|
8
|
+
export declare class EvenementsAPI extends Core {
|
|
9
|
+
constructor(config: MetariscConfig, client?: Client);
|
|
10
|
+
/**
|
|
11
|
+
* Suppression d'un événement correspondant à l'id donné.
|
|
12
|
+
* @param evenementId Identifiant unique de l'Événement
|
|
13
|
+
*/
|
|
14
|
+
deleteEvenement(evenementId: string): Promise<AxiosResponse<void>>;
|
|
15
|
+
/**
|
|
16
|
+
* Récupération des détails d'un événement correspondant à l'id donné.
|
|
17
|
+
* @param evenementId Identifiant unique de l'Événement
|
|
18
|
+
* @param evenement
|
|
19
|
+
*/
|
|
20
|
+
getEvenementDetails(evenementId: string, evenement?: Evenement): Promise<AxiosResponse<Evenement>>;
|
|
21
|
+
/**
|
|
22
|
+
* Récupération d'une liste paginée d'utilisateurs liés à un événement calendaire.
|
|
23
|
+
* @param evenementId Identifiant unique de l'Événement
|
|
24
|
+
* @param page Le numéro de la page.
|
|
25
|
+
* @param perPage Limite le nombre d'objets retournés. La limite est comprise entre 1 et 100, la valeur par défaut étant de 10.
|
|
26
|
+
*/
|
|
27
|
+
paginateEvenementUtilisateurs(evenementId: string, page?: number, perPage?: number): Collection<Utilisateur>;
|
|
28
|
+
/**
|
|
29
|
+
* Récupération des détails de tous les événements calendaires existants.
|
|
30
|
+
* @param page Le numéro de la page.
|
|
31
|
+
* @param perPage Limite le nombre d'objets retournés. La limite est comprise entre 1 et 100, la valeur par défaut étant de 10.
|
|
32
|
+
* @param type Le type d'événement
|
|
33
|
+
* @param period la période (ISO 8601) séparée par un slash (/) pendant laquelle l'événement se déroule. Exemple 2004-12-02T23:00/2005-01-01T12:30
|
|
34
|
+
*/
|
|
35
|
+
paginateEvenements(page?: number, perPage?: number, type?: string, period?: string): Collection<Evenement>;
|
|
36
|
+
/**
|
|
37
|
+
* TODO : Création d'un événement.
|
|
38
|
+
* @param postEvenementRequest
|
|
39
|
+
*/
|
|
40
|
+
postEvenement(postEvenementRequest?: PostEvenementRequest): Promise<AxiosResponse<Evenement>>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EvenementsAPI = void 0;
|
|
4
|
+
const core_1 = require("../core");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
class EvenementsAPI extends core_1.Core {
|
|
7
|
+
constructor(config, client) {
|
|
8
|
+
super(config, client);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Suppression d'un événement correspondant à l'id donné.
|
|
12
|
+
* @param evenementId Identifiant unique de l'Événement
|
|
13
|
+
*/
|
|
14
|
+
async deleteEvenement(evenementId) {
|
|
15
|
+
const pathVariable = { 'evenement_id': evenementId };
|
|
16
|
+
return this.request({
|
|
17
|
+
method: 'DELETE',
|
|
18
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/evenements/{evenement_id}'),
|
|
19
|
+
headers: {},
|
|
20
|
+
params: {},
|
|
21
|
+
body: {}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Récupération des détails d'un événement correspondant à l'id donné.
|
|
26
|
+
* @param evenementId Identifiant unique de l'Événement
|
|
27
|
+
* @param evenement
|
|
28
|
+
*/
|
|
29
|
+
async getEvenementDetails(evenementId, evenement) {
|
|
30
|
+
const pathVariable = { 'evenement_id': evenementId };
|
|
31
|
+
return this.request({
|
|
32
|
+
method: 'GET',
|
|
33
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/evenements/{evenement_id}'),
|
|
34
|
+
headers: {},
|
|
35
|
+
params: {},
|
|
36
|
+
body: { 'id': evenement?.id, 'title': evenement?.title, 'type': evenement?.type, 'description': evenement?.description, 'date_debut': evenement?.date_debut, 'date_fin': evenement?.date_fin }
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Récupération d'une liste paginée d'utilisateurs liés à un événement calendaire.
|
|
41
|
+
* @param evenementId Identifiant unique de l'Événement
|
|
42
|
+
* @param page Le numéro de la page.
|
|
43
|
+
* @param perPage Limite le nombre d'objets retournés. La limite est comprise entre 1 et 100, la valeur par défaut étant de 10.
|
|
44
|
+
*/
|
|
45
|
+
paginateEvenementUtilisateurs(evenementId, page, perPage) {
|
|
46
|
+
const pathVariable = { 'evenement_id': evenementId };
|
|
47
|
+
return this.collect({
|
|
48
|
+
method: 'GET',
|
|
49
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/evenements/{evenement_id}/utilisateurs'),
|
|
50
|
+
headers: {},
|
|
51
|
+
params: { 'page': page?.toString(), 'per_page': perPage?.toString() },
|
|
52
|
+
body: {}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Récupération des détails de tous les événements calendaires existants.
|
|
57
|
+
* @param page Le numéro de la page.
|
|
58
|
+
* @param perPage Limite le nombre d'objets retournés. La limite est comprise entre 1 et 100, la valeur par défaut étant de 10.
|
|
59
|
+
* @param type Le type d'événement
|
|
60
|
+
* @param period la période (ISO 8601) séparée par un slash (/) pendant laquelle l'événement se déroule. Exemple 2004-12-02T23:00/2005-01-01T12:30
|
|
61
|
+
*/
|
|
62
|
+
paginateEvenements(page, perPage, type, period) {
|
|
63
|
+
const pathVariable = {};
|
|
64
|
+
return this.collect({
|
|
65
|
+
method: 'GET',
|
|
66
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/evenements'),
|
|
67
|
+
headers: {},
|
|
68
|
+
params: { 'page': page?.toString(), 'per_page': perPage?.toString(), 'type': type, 'period': period },
|
|
69
|
+
body: {}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* TODO : Création d'un événement.
|
|
74
|
+
* @param postEvenementRequest
|
|
75
|
+
*/
|
|
76
|
+
async postEvenement(postEvenementRequest) {
|
|
77
|
+
const pathVariable = {};
|
|
78
|
+
return this.request({
|
|
79
|
+
method: 'POST',
|
|
80
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/evenements'),
|
|
81
|
+
headers: {},
|
|
82
|
+
params: {},
|
|
83
|
+
body: { 'title': postEvenementRequest?.title, 'type': postEvenementRequest?.type, 'description': postEvenementRequest?.description, 'date_debut': postEvenementRequest?.date_debut, 'date_fin': postEvenementRequest?.date_fin }
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
exports.EvenementsAPI = EvenementsAPI;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Core, MetariscConfig } from "../core";
|
|
2
|
+
import { Client } from "../client";
|
|
3
|
+
import { Collection } from "../collection";
|
|
4
|
+
import { FeedMessage } from '../model/FeedMessage';
|
|
5
|
+
export declare class FeedAPI extends Core {
|
|
6
|
+
constructor(config: MetariscConfig, client?: Client);
|
|
7
|
+
/**
|
|
8
|
+
* Récupération d'une liste de message composant un flux d'activité pour l'utilisateur connecté.
|
|
9
|
+
*/
|
|
10
|
+
paginateFeedMessages(): Collection<FeedMessage>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FeedAPI = void 0;
|
|
4
|
+
const core_1 = require("../core");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
class FeedAPI extends core_1.Core {
|
|
7
|
+
constructor(config, client) {
|
|
8
|
+
super(config, client);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Récupération d'une liste de message composant un flux d'activité pour l'utilisateur connecté.
|
|
12
|
+
*/
|
|
13
|
+
paginateFeedMessages() {
|
|
14
|
+
const pathVariable = {};
|
|
15
|
+
return this.collect({
|
|
16
|
+
method: 'GET',
|
|
17
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/feed'),
|
|
18
|
+
headers: {},
|
|
19
|
+
params: {},
|
|
20
|
+
body: {}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.FeedAPI = FeedAPI;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Core, MetariscConfig } from "../core";
|
|
2
|
+
import type { AxiosResponse } from "axios";
|
|
3
|
+
import { Client } from "../client";
|
|
4
|
+
import { Moi200Response } from '../model/Moi200Response';
|
|
5
|
+
export declare class MoiAPI extends Core {
|
|
6
|
+
constructor(config: MetariscConfig, client?: Client);
|
|
7
|
+
/**
|
|
8
|
+
* Récupérer les détails de l'utilisateur connecté.
|
|
9
|
+
*/
|
|
10
|
+
moi(): Promise<AxiosResponse<Moi200Response>>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MoiAPI = void 0;
|
|
4
|
+
const core_1 = require("../core");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
class MoiAPI extends core_1.Core {
|
|
7
|
+
constructor(config, client) {
|
|
8
|
+
super(config, client);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Récupérer les détails de l'utilisateur connecté.
|
|
12
|
+
*/
|
|
13
|
+
async moi() {
|
|
14
|
+
const pathVariable = {};
|
|
15
|
+
return this.request({
|
|
16
|
+
method: 'GET',
|
|
17
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/@moi'),
|
|
18
|
+
headers: {},
|
|
19
|
+
params: {},
|
|
20
|
+
body: {}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.MoiAPI = MoiAPI;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Core, MetariscConfig } from "../core";
|
|
2
|
+
import type { AxiosResponse } from "axios";
|
|
3
|
+
import { Client } from "../client";
|
|
4
|
+
import { Collection } from "../collection";
|
|
5
|
+
import { Notification } from '../model/Notification';
|
|
6
|
+
import { PostNotificationRequest } from '../model/PostNotificationRequest';
|
|
7
|
+
export declare class NotificationsAPI extends Core {
|
|
8
|
+
constructor(config: MetariscConfig, client?: Client);
|
|
9
|
+
/**
|
|
10
|
+
* Suppression d'une notification correspondante à l'id donné.
|
|
11
|
+
* @param notificationId Identifiant unique de la Notification
|
|
12
|
+
*/
|
|
13
|
+
deleteNotification(notificationId: string): Promise<AxiosResponse<void>>;
|
|
14
|
+
/**
|
|
15
|
+
* Récupération des détails d'une notification correspondante à l'id donné.
|
|
16
|
+
* @param notificationId Identifiant unique de la Notification
|
|
17
|
+
*/
|
|
18
|
+
getNotification(notificationId: string): Promise<AxiosResponse<Notification>>;
|
|
19
|
+
/**
|
|
20
|
+
* Récupération des détails de toutes les notifications existantes pour l'utilisateur connecté.
|
|
21
|
+
* @param page Numéro de page
|
|
22
|
+
* @param perPage Nombre de résultats demandé
|
|
23
|
+
*/
|
|
24
|
+
paginateNotifications(page?: number, perPage?: number): Collection<Notification>;
|
|
25
|
+
/**
|
|
26
|
+
* Création d'une notification.
|
|
27
|
+
* @param postNotificationRequest
|
|
28
|
+
*/
|
|
29
|
+
postNotification(postNotificationRequest?: PostNotificationRequest): Promise<AxiosResponse<Notification>>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationsAPI = void 0;
|
|
4
|
+
const core_1 = require("../core");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
class NotificationsAPI extends core_1.Core {
|
|
7
|
+
constructor(config, client) {
|
|
8
|
+
super(config, client);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Suppression d'une notification correspondante à l'id donné.
|
|
12
|
+
* @param notificationId Identifiant unique de la Notification
|
|
13
|
+
*/
|
|
14
|
+
async deleteNotification(notificationId) {
|
|
15
|
+
const pathVariable = { 'notification_id': notificationId };
|
|
16
|
+
return this.request({
|
|
17
|
+
method: 'DELETE',
|
|
18
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/notifications/{notification_id}'),
|
|
19
|
+
headers: {},
|
|
20
|
+
params: {},
|
|
21
|
+
body: {}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Récupération des détails d'une notification correspondante à l'id donné.
|
|
26
|
+
* @param notificationId Identifiant unique de la Notification
|
|
27
|
+
*/
|
|
28
|
+
async getNotification(notificationId) {
|
|
29
|
+
const pathVariable = { 'notification_id': notificationId };
|
|
30
|
+
return this.request({
|
|
31
|
+
method: 'GET',
|
|
32
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/notifications/{notification_id}'),
|
|
33
|
+
headers: {},
|
|
34
|
+
params: {},
|
|
35
|
+
body: {}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Récupération des détails de toutes les notifications existantes pour l'utilisateur connecté.
|
|
40
|
+
* @param page Numéro de page
|
|
41
|
+
* @param perPage Nombre de résultats demandé
|
|
42
|
+
*/
|
|
43
|
+
paginateNotifications(page, perPage) {
|
|
44
|
+
const pathVariable = {};
|
|
45
|
+
return this.collect({
|
|
46
|
+
method: 'GET',
|
|
47
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/notifications'),
|
|
48
|
+
headers: {},
|
|
49
|
+
params: { 'page': page?.toString(), 'per_page': perPage?.toString() },
|
|
50
|
+
body: {}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Création d'une notification.
|
|
55
|
+
* @param postNotificationRequest
|
|
56
|
+
*/
|
|
57
|
+
async postNotification(postNotificationRequest) {
|
|
58
|
+
const pathVariable = {};
|
|
59
|
+
return this.request({
|
|
60
|
+
method: 'POST',
|
|
61
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/notifications'),
|
|
62
|
+
headers: {},
|
|
63
|
+
params: {},
|
|
64
|
+
body: { 'title': postNotificationRequest?.title, 'message': postNotificationRequest?.message, 'contexte': postNotificationRequest?.contexte, 'utilisateur_id': postNotificationRequest?.utilisateur_id }
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.NotificationsAPI = NotificationsAPI;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Core, MetariscConfig } from "../core";
|
|
2
|
+
import type { AxiosResponse } from "axios";
|
|
3
|
+
import { Client } from "../client";
|
|
4
|
+
import { Collection } from "../collection";
|
|
5
|
+
import { Organisation } from '../model/Organisation';
|
|
6
|
+
export declare class OrganisationsAPI extends Core {
|
|
7
|
+
constructor(config: MetariscConfig, client?: Client);
|
|
8
|
+
/**
|
|
9
|
+
* Récupération des détails d'une organisation.
|
|
10
|
+
* @param orgId Identifiant unique de l'Organisation
|
|
11
|
+
*/
|
|
12
|
+
getOrganisation(orgId: string): Promise<AxiosResponse<Organisation>>;
|
|
13
|
+
/**
|
|
14
|
+
* Liste paginée des organisations.
|
|
15
|
+
* @param page Numéro de page
|
|
16
|
+
* @param perPage Nombre de résultats demandé
|
|
17
|
+
*/
|
|
18
|
+
paginateOrganisations(page?: number, perPage?: number): Collection<Organisation>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OrganisationsAPI = void 0;
|
|
4
|
+
const core_1 = require("../core");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
class OrganisationsAPI extends core_1.Core {
|
|
7
|
+
constructor(config, client) {
|
|
8
|
+
super(config, client);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Récupération des détails d'une organisation.
|
|
12
|
+
* @param orgId Identifiant unique de l'Organisation
|
|
13
|
+
*/
|
|
14
|
+
async getOrganisation(orgId) {
|
|
15
|
+
const pathVariable = { 'org_id': orgId };
|
|
16
|
+
return this.request({
|
|
17
|
+
method: 'GET',
|
|
18
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/organisations/{org_id}'),
|
|
19
|
+
headers: {},
|
|
20
|
+
params: {},
|
|
21
|
+
body: {}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Liste paginée des organisations.
|
|
26
|
+
* @param page Numéro de page
|
|
27
|
+
* @param perPage Nombre de résultats demandé
|
|
28
|
+
*/
|
|
29
|
+
paginateOrganisations(page, perPage) {
|
|
30
|
+
const pathVariable = {};
|
|
31
|
+
return this.collect({
|
|
32
|
+
method: 'GET',
|
|
33
|
+
endpoint: utils_1.Utils.constructPath(pathVariable, '/organisations'),
|
|
34
|
+
headers: {},
|
|
35
|
+
params: { 'page': page?.toString(), 'per_page': perPage?.toString() },
|
|
36
|
+
body: {}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.OrganisationsAPI = OrganisationsAPI;
|