@nmshd/transport 6.16.0 → 6.17.0
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/dist/buildInformation.js +4 -4
- package/dist/modules/accounts/IdentityController.d.ts +7 -0
- package/dist/modules/accounts/IdentityController.d.ts.map +1 -1
- package/dist/modules/accounts/IdentityController.js +12 -0
- package/dist/modules/accounts/IdentityController.js.map +1 -1
- package/dist/modules/accounts/backbone/BackboneCheckIfIdentityIsDeleted.d.ts +5 -0
- package/dist/modules/accounts/backbone/BackboneCheckIfIdentityIsDeleted.d.ts.map +1 -0
- package/dist/modules/accounts/backbone/BackboneCheckIfIdentityIsDeleted.js +3 -0
- package/dist/modules/accounts/backbone/BackboneCheckIfIdentityIsDeleted.js.map +1 -0
- package/dist/modules/accounts/backbone/IdentityClient.d.ts +2 -0
- package/dist/modules/accounts/backbone/IdentityClient.d.ts.map +1 -1
- package/dist/modules/accounts/backbone/IdentityClient.js +3 -0
- package/dist/modules/accounts/backbone/IdentityClient.js.map +1 -1
- package/package.json +2 -2
package/dist/buildInformation.js
CHANGED
|
@@ -4,10 +4,10 @@ exports.buildInformation = void 0;
|
|
|
4
4
|
const ts_serval_1 = require("@js-soft/ts-serval");
|
|
5
5
|
const crypto_1 = require("@nmshd/crypto");
|
|
6
6
|
exports.buildInformation = {
|
|
7
|
-
version: "6.
|
|
8
|
-
build: "
|
|
9
|
-
date: "2024-12-
|
|
10
|
-
commit: "
|
|
7
|
+
version: "6.17.0",
|
|
8
|
+
build: "182",
|
|
9
|
+
date: "2024-12-13T17:20:48+00:00",
|
|
10
|
+
commit: "e1bd4c755d43f42ee66c126be71c7dda17e0dcd9",
|
|
11
11
|
dependencies: {"@js-soft/docdb-access-abstractions":"1.0.4","@js-soft/logging-abstractions":"^1.0.1","@js-soft/simple-logger":"1.0.5","@js-soft/ts-utils":"^2.3.3","@nmshd/core-types":"*","@nmshd/crypto":"2.1.0","axios":"^1.7.9","fast-json-patch":"^3.1.1","form-data":"^4.0.1","https-proxy-agent":"^7.0.6","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","luxon":"^3.5.0","qs":"^6.13.1","reflect-metadata":"^0.2.2","ts-simple-nameof":"^1.3.1","uuid":"^11.0.3"},
|
|
12
12
|
libraries: {
|
|
13
13
|
crypto: crypto_1.buildInformation,
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { Result } from "@js-soft/ts-utils";
|
|
1
2
|
import { CoreAddress } from "@nmshd/core-types";
|
|
2
3
|
import { CoreBuffer, CryptoSignature, CryptoSignaturePublicKey } from "@nmshd/crypto";
|
|
3
4
|
import { TransportController } from "../../core";
|
|
4
5
|
import { AccountController } from "../accounts/AccountController";
|
|
6
|
+
import { IdentityClient } from "./backbone/IdentityClient";
|
|
5
7
|
import { Identity } from "./data/Identity";
|
|
6
8
|
export declare class IdentityController extends TransportController {
|
|
9
|
+
identityClient: IdentityClient;
|
|
7
10
|
get address(): CoreAddress;
|
|
8
11
|
get publicKey(): CryptoSignaturePublicKey;
|
|
9
12
|
get identity(): Identity;
|
|
@@ -14,5 +17,9 @@ export declare class IdentityController extends TransportController {
|
|
|
14
17
|
update(): Promise<void>;
|
|
15
18
|
sign(content: CoreBuffer): Promise<CryptoSignature>;
|
|
16
19
|
verify(content: CoreBuffer, signature: CryptoSignature): Promise<boolean>;
|
|
20
|
+
checkIfIdentityIsDeleted(): Promise<Result<{
|
|
21
|
+
isDeleted: boolean;
|
|
22
|
+
deletionDate?: string;
|
|
23
|
+
}>>;
|
|
17
24
|
}
|
|
18
25
|
//# sourceMappingURL=IdentityController.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityController.d.ts","sourceRoot":"","sources":["../../../src/modules/accounts/IdentityController.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IdentityController.d.ts","sourceRoot":"","sources":["../../../src/modules/accounts/IdentityController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,eAAe,EAA6B,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACjH,OAAO,EAA8B,mBAAmB,EAAuB,MAAM,YAAY,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,qBAAa,kBAAmB,SAAQ,mBAAmB;IAChD,cAAc,EAAE,cAAc,CAAC;IAEtC,IAAW,OAAO,IAAI,WAAW,CAEhC;IAED,IAAW,SAAS,IAAI,wBAAwB,CAE/C;IAED,IAAW,QAAQ,IAAI,QAAQ,CAE9B;IACD,OAAO,CAAC,SAAS,CAAW;gBAET,MAAM,EAAE,iBAAiB;IAOtB,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAOpE,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO;IAI7B,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAKvB,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,eAAe,CAAC;IAYnD,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC;IAKzE,wBAAwB,IAAI,OAAO,CAC5C,MAAM,CAAC;QACH,SAAS,EAAE,OAAO,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC,CACL;CAWJ"}
|
|
@@ -14,6 +14,7 @@ const ts_utils_1 = require("@js-soft/ts-utils");
|
|
|
14
14
|
const crypto_1 = require("@nmshd/crypto");
|
|
15
15
|
const core_1 = require("../../core");
|
|
16
16
|
const DeviceSecretController_1 = require("../devices/DeviceSecretController");
|
|
17
|
+
const IdentityClient_1 = require("./backbone/IdentityClient");
|
|
17
18
|
const Identity_1 = require("./data/Identity");
|
|
18
19
|
class IdentityController extends core_1.TransportController {
|
|
19
20
|
get address() {
|
|
@@ -27,6 +28,7 @@ class IdentityController extends core_1.TransportController {
|
|
|
27
28
|
}
|
|
28
29
|
constructor(parent) {
|
|
29
30
|
super(core_1.ControllerName.Identity, parent);
|
|
31
|
+
this.identityClient = new IdentityClient_1.IdentityClient(this.config, this.transport.correlator);
|
|
30
32
|
}
|
|
31
33
|
async init(identity) {
|
|
32
34
|
await super.init();
|
|
@@ -53,6 +55,16 @@ class IdentityController extends core_1.TransportController {
|
|
|
53
55
|
const valid = await core_1.CoreCrypto.verify(content, signature, this.publicKey);
|
|
54
56
|
return valid;
|
|
55
57
|
}
|
|
58
|
+
async checkIfIdentityIsDeleted() {
|
|
59
|
+
const currentDeviceCredentials = await this.parent.activeDevice.getCredentials();
|
|
60
|
+
const identityDeletionResult = await this.identityClient.checkIfIdentityIsDeleted(currentDeviceCredentials.username);
|
|
61
|
+
if (identityDeletionResult.isError)
|
|
62
|
+
return ts_utils_1.Result.fail(identityDeletionResult.error);
|
|
63
|
+
return ts_utils_1.Result.ok({
|
|
64
|
+
isDeleted: identityDeletionResult.value.isDeleted,
|
|
65
|
+
deletionDate: identityDeletionResult.value.deletionDate ?? undefined
|
|
66
|
+
});
|
|
67
|
+
}
|
|
56
68
|
}
|
|
57
69
|
exports.IdentityController = IdentityController;
|
|
58
70
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityController.js","sourceRoot":"","sources":["../../../src/modules/accounts/IdentityController.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"IdentityController.js","sourceRoot":"","sources":["../../../src/modules/accounts/IdentityController.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAAgD;AAEhD,0CAAiH;AACjH,qCAAkG;AAElG,8EAAqE;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ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wCAAwC;IACrD,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackboneCheckIfIdentityIsDeleted.js","sourceRoot":"","sources":["../../../../src/modules/accounts/backbone/BackboneCheckIfIdentityIsDeleted.ts"],"names":[],"mappings":""}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { RESTClient, RESTClientLogDirective } from "../../../core";
|
|
2
2
|
import { ClientResult } from "../../../core/backbone/ClientResult";
|
|
3
|
+
import { BackboneCheckIfIdentityIsDeletedResponse } from "./BackboneCheckIfIdentityIsDeleted";
|
|
3
4
|
import { BackbonePostIdentityRequest, BackbonePostIdentityResponse } from "./BackbonePostIdentity";
|
|
4
5
|
export declare class IdentityClient extends RESTClient {
|
|
5
6
|
protected _logDirective: RESTClientLogDirective;
|
|
6
7
|
createIdentity(value: BackbonePostIdentityRequest): Promise<ClientResult<BackbonePostIdentityResponse>>;
|
|
8
|
+
checkIfIdentityIsDeleted(username: string): Promise<ClientResult<BackboneCheckIfIdentityIsDeletedResponse>>;
|
|
7
9
|
}
|
|
8
10
|
//# sourceMappingURL=IdentityClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityClient.d.ts","sourceRoot":"","sources":["../../../../src/modules/accounts/backbone/IdentityClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAEnG,qBAAa,cAAe,SAAQ,UAAU;IAC1C,UAAmB,aAAa,yBAAsC;IAEzD,cAAc,CAAC,KAAK,EAAE,2BAA2B,GAAG,OAAO,CAAC,YAAY,CAAC,4BAA4B,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"IdentityClient.d.ts","sourceRoot":"","sources":["../../../../src/modules/accounts/backbone/IdentityClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,wCAAwC,EAAE,MAAM,oCAAoC,CAAC;AAC9F,OAAO,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAEnG,qBAAa,cAAe,SAAQ,UAAU;IAC1C,UAAmB,aAAa,yBAAsC;IAEzD,cAAc,CAAC,KAAK,EAAE,2BAA2B,GAAG,OAAO,CAAC,YAAY,CAAC,4BAA4B,CAAC,CAAC;IAIvG,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,wCAAwC,CAAC,CAAC;CAG3H"}
|
|
@@ -10,6 +10,9 @@ class IdentityClient extends core_1.RESTClient {
|
|
|
10
10
|
async createIdentity(value) {
|
|
11
11
|
return await this.post("/api/v1/Identities", value);
|
|
12
12
|
}
|
|
13
|
+
async checkIfIdentityIsDeleted(username) {
|
|
14
|
+
return await this.get(`/api/v1/Identities/IsDeleted?username=${username}`);
|
|
15
|
+
}
|
|
13
16
|
}
|
|
14
17
|
exports.IdentityClient = IdentityClient;
|
|
15
18
|
//# sourceMappingURL=IdentityClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityClient.js","sourceRoot":"","sources":["../../../../src/modules/accounts/backbone/IdentityClient.ts"],"names":[],"mappings":";;;AAAA,wCAAmE;
|
|
1
|
+
{"version":3,"file":"IdentityClient.js","sourceRoot":"","sources":["../../../../src/modules/accounts/backbone/IdentityClient.ts"],"names":[],"mappings":";;;AAAA,wCAAmE;AAKnE,MAAa,cAAe,SAAQ,iBAAU;IAA9C;;QACuB,kBAAa,GAAG,6BAAsB,CAAC,WAAW,CAAC;IAS1E,CAAC;IAPU,KAAK,CAAC,cAAc,CAAC,KAAkC;QAC1D,OAAO,MAAM,IAAI,CAAC,IAAI,CAA+B,oBAAoB,EAAE,KAAK,CAAC,CAAC;IACtF,CAAC;IAEM,KAAK,CAAC,wBAAwB,CAAC,QAAgB;QAClD,OAAO,MAAM,IAAI,CAAC,GAAG,CAA2C,yCAAyC,QAAQ,EAAE,CAAC,CAAC;IACzH,CAAC;CACJ;AAVD,wCAUC"}
|
package/package.json
CHANGED
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@js-soft/logging-abstractions": "^1.0.1",
|
|
71
71
|
"@js-soft/simple-logger": "1.0.5",
|
|
72
72
|
"@js-soft/ts-utils": "^2.3.3",
|
|
73
|
-
"@nmshd/core-types": "6.
|
|
73
|
+
"@nmshd/core-types": "6.17.0",
|
|
74
74
|
"@nmshd/crypto": "2.1.0",
|
|
75
75
|
"axios": "^1.7.9",
|
|
76
76
|
"fast-json-patch": "^3.1.1",
|
|
@@ -103,5 +103,5 @@
|
|
|
103
103
|
"access": "public",
|
|
104
104
|
"provenance": true
|
|
105
105
|
},
|
|
106
|
-
"version": "6.
|
|
106
|
+
"version": "6.17.0"
|
|
107
107
|
}
|