@constl/mandataire
Advanced tools
Comparing version 2.0.7 to 2.0.8
@@ -103,3 +103,3 @@ import { v4 as uuidv4 } from "uuid"; | ||
id, | ||
code: retour.erreur || ERREUR_EXÉCUTION_IPA, | ||
code: retour.codeErreur || ERREUR_EXÉCUTION_IPA, | ||
}); | ||
@@ -202,2 +202,4 @@ } | ||
get(obj, prop) { | ||
// Inscrire ici les fonctions publiques du mandataire qui ne | ||
// doivent pas être envoyées à Constellation | ||
const directes = ["suivreErreurs"]; | ||
@@ -204,0 +206,0 @@ if (directes.includes(prop)) { |
@@ -1,1 +0,1 @@ | ||
export declare const version = "2.0.7"; | ||
export declare const version = "2.0.8"; |
// Generated by genversion. | ||
export const version = "2.0.7"; | ||
export const version = "2.0.8"; | ||
//# sourceMappingURL=version.js.map |
@@ -10,17 +10,18 @@ import { mandataire } from "@constl/ipa"; | ||
class Mandataire extends Mandatairifiable { | ||
gestionnaireClient; | ||
ipa; | ||
constructor({ opts }) { | ||
super(); | ||
this.gestionnaireClient = | ||
new mandataire.gestionnaireClient.GestionnaireClient((m) => { | ||
this.recevoirMessageDIpa(m); | ||
}, ({ erreur, idRequète, code, }) => this.recevoirMessageDIpa({ | ||
this.ipa = new mandataire.EnveloppeIpa((m) => { | ||
this.recevoirMessageDIpa(m); | ||
}, (e) => { | ||
this.recevoirMessageDIpa({ | ||
type: "erreur", | ||
erreur, | ||
id: idRequète, | ||
codeErreur: code, | ||
}), opts); | ||
erreur: e.erreur, | ||
codeErreur: e.code, | ||
id: e.id, | ||
}); | ||
}, opts); | ||
} | ||
envoyerMessageÀIpa(message) { | ||
this.gestionnaireClient.gérerMessage(message); | ||
this.ipa.gérerMessage(message); | ||
} | ||
@@ -27,0 +28,0 @@ } |
{ | ||
"name": "@constl/mandataire", | ||
"version": "2.0.7", | ||
"version": "2.0.8", | ||
"description": "Un mandataire très léger pour le client Constellation.", | ||
@@ -23,3 +23,3 @@ "author": "Julien Jean Malard-Adam", | ||
"devDependencies": { | ||
"@constl/ipa": "^1.0.31", | ||
"@constl/ipa": "^1.1.1", | ||
"@constl/orbit-db-types": "^2.0.0", | ||
@@ -26,0 +26,0 @@ "@constl/utils-ipa": "^1.0.1", |
@@ -178,3 +178,3 @@ import type TypedEmitter from "typed-emitter"; | ||
id, | ||
code: retour.erreur || ERREUR_EXÉCUTION_IPA, | ||
code: retour.codeErreur || ERREUR_EXÉCUTION_IPA, | ||
}); | ||
@@ -302,2 +302,4 @@ } | ||
get(obj: Mandatairifiable, prop: string): unknown { | ||
// Inscrire ici les fonctions publiques du mandataire qui ne | ||
// doivent pas être envoyées à Constellation | ||
const directes = ["suivreErreurs"]; | ||
@@ -304,0 +306,0 @@ if (directes.includes(prop)) { |
// Generated by genversion. | ||
export const version = "2.0.7"; | ||
export const version = "2.0.8"; |
@@ -11,4 +11,4 @@ import type { MessageDIpa, MessagePourIpa } from "@/messages.js"; | ||
MandataireConstellation, | ||
type ErreurMandataire, | ||
} from "@/mandataire.js"; | ||
import { isNode, isElectronMain } from "wherearewe"; | ||
@@ -20,31 +20,23 @@ | ||
class Mandataire extends Mandatairifiable { | ||
gestionnaireClient: mandataire.gestionnaireClient.GestionnaireClient; | ||
ipa: mandataire.EnveloppeIpa; | ||
constructor({ opts }: { opts: client.optsConstellation }) { | ||
super(); | ||
this.gestionnaireClient = | ||
new mandataire.gestionnaireClient.GestionnaireClient( | ||
(m: MessageDIpa) => { | ||
this.recevoirMessageDIpa(m); | ||
}, | ||
({ | ||
erreur, | ||
idRequète, | ||
code, | ||
}: { | ||
erreur: string; | ||
idRequète?: string; | ||
code?: string; | ||
}) => | ||
this.recevoirMessageDIpa({ | ||
type: "erreur", | ||
erreur, | ||
id: idRequète, | ||
codeErreur: code, | ||
}), | ||
opts, | ||
); | ||
this.ipa = new mandataire.EnveloppeIpa( | ||
(m: MessageDIpa) => { | ||
this.recevoirMessageDIpa(m); | ||
}, | ||
(e: ErreurMandataire) => { | ||
this.recevoirMessageDIpa({ | ||
type: "erreur", | ||
erreur: e.erreur, | ||
codeErreur: e.code, | ||
id: e.id, | ||
}); | ||
}, | ||
opts, | ||
); | ||
} | ||
envoyerMessageÀIpa(message: MessagePourIpa): void { | ||
this.gestionnaireClient.gérerMessage(message); | ||
this.ipa.gérerMessage(message); | ||
} | ||
@@ -51,0 +43,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
279215
3535