@nmshd/runtime 3.0.1 → 3.1.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/extensibility/facades/consumption/AttributesFacade.d.ts +6 -2
- package/dist/extensibility/facades/consumption/AttributesFacade.js +13 -1
- package/dist/extensibility/facades/consumption/AttributesFacade.js.map +1 -1
- package/dist/useCases/common/RuntimeErrors.d.ts +0 -1
- package/dist/useCases/common/RuntimeErrors.js +0 -3
- package/dist/useCases/common/RuntimeErrors.js.map +1 -1
- package/dist/useCases/common/Schemas.d.ts +2 -0
- package/dist/useCases/common/Schemas.js +47 -3
- package/dist/useCases/common/Schemas.js.map +1 -1
- package/dist/useCases/consumption/attributes/GetSharedVersionsOfIdentityAttribute.d.ts +16 -0
- package/dist/useCases/consumption/attributes/GetSharedVersionsOfIdentityAttribute.js +60 -0
- package/dist/useCases/consumption/attributes/GetSharedVersionsOfIdentityAttribute.js.map +1 -0
- package/dist/useCases/consumption/attributes/GetVersionsOfAttribute.d.ts +16 -0
- package/dist/useCases/consumption/attributes/GetVersionsOfAttribute.js +48 -0
- package/dist/useCases/consumption/attributes/GetVersionsOfAttribute.js.map +1 -0
- package/dist/useCases/consumption/attributes/NotifyPeerAboutIdentityAttributeSuccession.js +1 -4
- package/dist/useCases/consumption/attributes/NotifyPeerAboutIdentityAttributeSuccession.js.map +1 -1
- package/dist/useCases/consumption/attributes/index.d.ts +2 -0
- package/dist/useCases/consumption/attributes/index.js +2 -0
- package/dist/useCases/consumption/attributes/index.js.map +1 -1
- package/lib-web/nmshd.runtime.js +195 -15
- package/lib-web/nmshd.runtime.js.map +1 -1
- package/lib-web/nmshd.runtime.min.js +1 -1
- package/lib-web/nmshd.runtime.min.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Result } from "@js-soft/ts-utils";
|
|
2
|
+
import { AttributesController } from "@nmshd/consumption";
|
|
3
|
+
import { LocalAttributeDTO } from "../../../types";
|
|
4
|
+
import { AttributeIdString, SchemaRepository, SchemaValidator, UseCase } from "../../common";
|
|
5
|
+
export interface GetSharedVersionsOfIdentityAttributeRequest {
|
|
6
|
+
attributeId: AttributeIdString;
|
|
7
|
+
}
|
|
8
|
+
declare class Validator extends SchemaValidator<GetSharedVersionsOfIdentityAttributeRequest> {
|
|
9
|
+
constructor(schemaRepository: SchemaRepository);
|
|
10
|
+
}
|
|
11
|
+
export declare class GetSharedVersionsOfIdentityAttributeUseCase extends UseCase<GetSharedVersionsOfIdentityAttributeRequest, LocalAttributeDTO[]> {
|
|
12
|
+
private readonly attributeController;
|
|
13
|
+
constructor(attributeController: AttributesController, validator: Validator);
|
|
14
|
+
protected executeInternal(request: GetSharedVersionsOfIdentityAttributeRequest): Promise<Result<LocalAttributeDTO[]>>;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.GetSharedVersionsOfIdentityAttributeUseCase = void 0;
|
|
16
|
+
const ts_utils_1 = require("@js-soft/ts-utils");
|
|
17
|
+
const consumption_1 = require("@nmshd/consumption");
|
|
18
|
+
const transport_1 = require("@nmshd/transport");
|
|
19
|
+
const typescript_ioc_1 = require("typescript-ioc");
|
|
20
|
+
const common_1 = require("../../common");
|
|
21
|
+
const AttributeMapper_1 = require("./AttributeMapper");
|
|
22
|
+
let Validator = class Validator extends common_1.SchemaValidator {
|
|
23
|
+
constructor(schemaRepository) {
|
|
24
|
+
super(schemaRepository.getSchema("GetSharedVersionsOfIdentityAttributeRequest"));
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
Validator = __decorate([
|
|
28
|
+
__param(0, typescript_ioc_1.Inject),
|
|
29
|
+
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
30
|
+
], Validator);
|
|
31
|
+
let GetSharedVersionsOfIdentityAttributeUseCase = class GetSharedVersionsOfIdentityAttributeUseCase extends common_1.UseCase {
|
|
32
|
+
constructor(attributeController, validator) {
|
|
33
|
+
super(validator);
|
|
34
|
+
this.attributeController = attributeController;
|
|
35
|
+
}
|
|
36
|
+
async executeInternal(request) {
|
|
37
|
+
const attribute = await this.attributeController.getLocalAttribute(transport_1.CoreId.from(request.attributeId));
|
|
38
|
+
if (!attribute || attribute.isRelationshipAttribute()) {
|
|
39
|
+
throw common_1.RuntimeErrors.general.invalidPropertyValue("The given ID doesn't belong to a valid IdentityAttribute.");
|
|
40
|
+
}
|
|
41
|
+
const allVersions = await this.attributeController.getVersionsOfAttribute(transport_1.CoreId.from(request.attributeId));
|
|
42
|
+
// queried ID doesn't belong to a repository attribute
|
|
43
|
+
if (attribute.shareInfo !== undefined) {
|
|
44
|
+
return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTOList(allVersions));
|
|
45
|
+
}
|
|
46
|
+
const query = {
|
|
47
|
+
"shareInfo.sourceAttribute": { $in: allVersions.map((x) => x.id.toString()) }
|
|
48
|
+
};
|
|
49
|
+
const sharedAttributes = await this.attributeController.getLocalAttributes(query);
|
|
50
|
+
return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTOList(sharedAttributes));
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
exports.GetSharedVersionsOfIdentityAttributeUseCase = GetSharedVersionsOfIdentityAttributeUseCase;
|
|
54
|
+
exports.GetSharedVersionsOfIdentityAttributeUseCase = GetSharedVersionsOfIdentityAttributeUseCase = __decorate([
|
|
55
|
+
__param(0, typescript_ioc_1.Inject),
|
|
56
|
+
__param(1, typescript_ioc_1.Inject),
|
|
57
|
+
__metadata("design:paramtypes", [consumption_1.AttributesController,
|
|
58
|
+
Validator])
|
|
59
|
+
], GetSharedVersionsOfIdentityAttributeUseCase);
|
|
60
|
+
//# sourceMappingURL=GetSharedVersionsOfIdentityAttribute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetSharedVersionsOfIdentityAttribute.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/GetSharedVersionsOfIdentityAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAA0D;AAC1D,gDAA0C;AAC1C,mDAAwC;AAExC,yCAA4G;AAC5G,uDAAoD;AAMpD,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,wBAA4D;IAChF,YAA2B,gBAAkC;QACzD,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,6CAA6C,CAAC,CAAC,CAAC;IACrF,CAAC;CACJ,CAAA;AAJK,SAAS;IACS,WAAA,uBAAM,CAAA;qCAAmB,yBAAgB;GAD3D,SAAS,CAId;AAED,IAAa,2CAA2C,GAAxD,MAAa,2CAA4C,SAAQ,gBAAyE;IACtI,YAC6B,mBAAyC,EAC1D,SAAoB;QAE5B,KAAK,CAAC,SAAS,CAAC,CAAC;QAHQ,wBAAmB,GAAn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-utils";
|
|
2
|
+
import { AttributesController } from "@nmshd/consumption";
|
|
3
|
+
import { LocalAttributeDTO } from "../../../types";
|
|
4
|
+
import { AttributeIdString, SchemaRepository, SchemaValidator, UseCase } from "../../common";
|
|
5
|
+
export interface GetVersionsOfAttributeRequest {
|
|
6
|
+
attributeId: AttributeIdString;
|
|
7
|
+
}
|
|
8
|
+
declare class Validator extends SchemaValidator<GetVersionsOfAttributeRequest> {
|
|
9
|
+
constructor(schemaRepository: SchemaRepository);
|
|
10
|
+
}
|
|
11
|
+
export declare class GetVersionsOfAttributeUseCase extends UseCase<GetVersionsOfAttributeRequest, LocalAttributeDTO[]> {
|
|
12
|
+
private readonly attributeController;
|
|
13
|
+
constructor(attributeController: AttributesController, validator: Validator);
|
|
14
|
+
protected executeInternal(request: GetVersionsOfAttributeRequest): Promise<Result<LocalAttributeDTO[]>>;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.GetVersionsOfAttributeUseCase = void 0;
|
|
16
|
+
const ts_utils_1 = require("@js-soft/ts-utils");
|
|
17
|
+
const consumption_1 = require("@nmshd/consumption");
|
|
18
|
+
const transport_1 = require("@nmshd/transport");
|
|
19
|
+
const typescript_ioc_1 = require("typescript-ioc");
|
|
20
|
+
const common_1 = require("../../common");
|
|
21
|
+
const AttributeMapper_1 = require("./AttributeMapper");
|
|
22
|
+
let Validator = class Validator extends common_1.SchemaValidator {
|
|
23
|
+
constructor(schemaRepository) {
|
|
24
|
+
super(schemaRepository.getSchema("GetVersionsOfAttributeRequest"));
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
Validator = __decorate([
|
|
28
|
+
__param(0, typescript_ioc_1.Inject),
|
|
29
|
+
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
30
|
+
], Validator);
|
|
31
|
+
let GetVersionsOfAttributeUseCase = class GetVersionsOfAttributeUseCase extends common_1.UseCase {
|
|
32
|
+
constructor(attributeController, validator) {
|
|
33
|
+
super(validator);
|
|
34
|
+
this.attributeController = attributeController;
|
|
35
|
+
}
|
|
36
|
+
async executeInternal(request) {
|
|
37
|
+
const allVersions = await this.attributeController.getVersionsOfAttribute(transport_1.CoreId.from(request.attributeId));
|
|
38
|
+
return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTOList(allVersions));
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
exports.GetVersionsOfAttributeUseCase = GetVersionsOfAttributeUseCase;
|
|
42
|
+
exports.GetVersionsOfAttributeUseCase = GetVersionsOfAttributeUseCase = __decorate([
|
|
43
|
+
__param(0, typescript_ioc_1.Inject),
|
|
44
|
+
__param(1, typescript_ioc_1.Inject),
|
|
45
|
+
__metadata("design:paramtypes", [consumption_1.AttributesController,
|
|
46
|
+
Validator])
|
|
47
|
+
], GetVersionsOfAttributeUseCase);
|
|
48
|
+
//# sourceMappingURL=GetVersionsOfAttribute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetVersionsOfAttribute.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/GetVersionsOfAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAA0D;AAC1D,gDAA0C;AAC1C,mDAAwC;AAExC,yCAA6F;AAC7F,uDAAoD;AAMpD,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,wBAA8C;IAClE,YAA2B,gBAAkC;QACzD,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,+BAA+B,CAAC,CAAC,CAAC;IACvE,CAAC;CACJ,CAAA;AAJK,SAAS;IACS,WAAA,uBAAM,CAAA;qCAAmB,yBAAgB;GAD3D,SAAS,CAId;AAED,IAAa,6BAA6B,GAA1C,MAAa,6BAA8B,SAAQ,gBAA2D;IAC1G,YAC6B,mBAAyC,EAC1D,SAAoB;QAE5B,KAAK,CAAC,SAAS,CAAC,CAAC;QAHQ,wBAAmB,GAAnB,mBAAmB,CAAsB;IAItE,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,OAAsC;QAClE,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,sBAAsB,CAAC,kBAAM,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;QAE5G,OAAO,iBAAM,CAAC,EAAE,CAAC,iCAAe,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAC;IACtE,CAAC;CACJ,CAAA;AAbY,sEAA6B;wCAA7B,6BAA6B;IAEjC,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;qCADuC,kCAAoB;QAC/C,SAAS;GAHvB,6BAA6B,CAazC"}
|
|
@@ -43,9 +43,6 @@ let NotifyPeerAboutIdentityAttributeSuccessionUseCase = class NotifyPeerAboutIde
|
|
|
43
43
|
return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(consumption_1.LocalAttribute.name));
|
|
44
44
|
if (!repositoryAttributeSuccessor.isRepositoryAttribute())
|
|
45
45
|
return ts_utils_1.Result.fail(common_1.RuntimeErrors.attributes.isNoIdentityAttribute(repositoryAttributeSuccessor.id));
|
|
46
|
-
if (typeof repositoryAttributeSuccessor.succeededBy !== "undefined") {
|
|
47
|
-
return ts_utils_1.Result.fail(common_1.RuntimeErrors.attributes.canOnlyNotifyAboutLatestVersionOfIdentityAttribute(repositoryAttributeSuccessor.id));
|
|
48
|
-
}
|
|
49
46
|
const query = {
|
|
50
47
|
"content.owner": this.accountController.identity.address.toString(),
|
|
51
48
|
"content.@type": "IdentityAttribute",
|
|
@@ -61,7 +58,7 @@ let NotifyPeerAboutIdentityAttributeSuccessionUseCase = class NotifyPeerAboutIde
|
|
|
61
58
|
const candidatePredecessorsQuery = {
|
|
62
59
|
"shareInfo.sourceAttribute": { $in: repositoryAttributeVersionIds },
|
|
63
60
|
"shareInfo.peer": request.peer,
|
|
64
|
-
|
|
61
|
+
succeededBy: { $exists: false }
|
|
65
62
|
};
|
|
66
63
|
const candidatePredecessors = await this.attributeController.getLocalAttributes(candidatePredecessorsQuery);
|
|
67
64
|
if (candidatePredecessors.length === 0) {
|
package/dist/useCases/consumption/attributes/NotifyPeerAboutIdentityAttributeSuccession.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotifyPeerAboutIdentityAttributeSuccession.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/NotifyPeerAboutIdentityAttributeSuccession.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAAqH;AACrH,4CAA4F;AAC5F,gDAAgF;AAChF,mDAAwC;AAExC,yCAA2H;AAC3H,uDAAoD;AAYpD,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,wBAAkE;IACtF,YAA2B,gBAAkC;QACzD,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,mDAAmD,CAAC,CAAC,CAAC;IAC3F,CAAC;CACJ,CAAA;AAJK,SAAS;IACS,WAAA,uBAAM,CAAA;qCAAmB,yBAAgB;GAD3D,SAAS,CAId;AAED,IAAa,iDAAiD,GAA9D,MAAa,iDAAkD,SAAQ,gBAGtE;IACG,YAC6B,iBAAoC,EACpC,mBAAyC,EACzC,iBAAoC,EACrD,SAAoB;QAE5B,KAAK,CAAC,SAAS,CAAC,CAAC;QALQ,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,wBAAmB,GAAnB,mBAAmB,CAAsB;QACzC,sBAAiB,GAAjB,iBAAiB,CAAmB;IAIjE,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,OAA0D;QACtF,MAAM,8BAA8B,GAAG,kBAAM,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACxE,MAAM,4BAA4B,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,8BAA8B,CAAC,CAAC;QACtH,IAAI,OAAO,4BAA4B,KAAK,WAAW;YAAE,OAAO,iBAAM,CAAC,IAAI,CAAC,sBAAa,CAAC,OAAO,CAAC,cAAc,CAAC,4BAAc,CAAC,IAAI,CAAC,CAAC,CAAC;QACvI,IAAI,CAAC,4BAA4B,CAAC,qBAAqB,EAAE;YAAE,OAAO,iBAAM,CAAC,IAAI,CAAC,sBAAa,CAAC,UAAU,CAAC,qBAAqB,CAAC,4BAA4B,CAAC,EAAE,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"NotifyPeerAboutIdentityAttributeSuccession.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/NotifyPeerAboutIdentityAttributeSuccession.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAAqH;AACrH,4CAA4F;AAC5F,gDAAgF;AAChF,mDAAwC;AAExC,yCAA2H;AAC3H,uDAAoD;AAYpD,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,wBAAkE;IACtF,YAA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AC;QAEH,MAAM,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,CAAC;QAE9C,MAAM,MAAM,GAAG;YACX,WAAW,EAAE,iCAAe,CAAC,cAAc,CAAC,4CAA4C,CAAC;YACzF,SAAS,EAAE,iCAAe,CAAC,cAAc,CAAC,mCAAmC,CAAC;SACjF,CAAC;QACF,OAAO,iBAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;CACJ,CAAA;AAhGY,8GAAiD;4DAAjD,iDAAiD;IAKrD,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;qCAHqC,6BAAiB;QACf,kCAAoB;QACtB,6BAAiB;QAC1C,SAAS;GARvB,iDAAiD,CAgG7D"}
|
|
@@ -9,6 +9,8 @@ export * from "./GetAttribute";
|
|
|
9
9
|
export * from "./GetAttributes";
|
|
10
10
|
export * from "./GetOwnSharedAttributes";
|
|
11
11
|
export * from "./GetPeerSharedAttributes";
|
|
12
|
+
export * from "./GetSharedVersionsOfIdentityAttribute";
|
|
13
|
+
export * from "./GetVersionsOfAttribute";
|
|
12
14
|
export * from "./NotifyPeerAboutIdentityAttributeSuccession";
|
|
13
15
|
export * from "./ShareIdentityAttribute";
|
|
14
16
|
export * from "./SucceedIdentityAttribute";
|
|
@@ -25,6 +25,8 @@ __exportStar(require("./GetAttribute"), exports);
|
|
|
25
25
|
__exportStar(require("./GetAttributes"), exports);
|
|
26
26
|
__exportStar(require("./GetOwnSharedAttributes"), exports);
|
|
27
27
|
__exportStar(require("./GetPeerSharedAttributes"), exports);
|
|
28
|
+
__exportStar(require("./GetSharedVersionsOfIdentityAttribute"), exports);
|
|
29
|
+
__exportStar(require("./GetVersionsOfAttribute"), exports);
|
|
28
30
|
__exportStar(require("./NotifyPeerAboutIdentityAttributeSuccession"), exports);
|
|
29
31
|
__exportStar(require("./ShareIdentityAttribute"), exports);
|
|
30
32
|
__exportStar(require("./SucceedIdentityAttribute"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,wEAAsD;AACtD,4DAA0C;AAC1C,kEAAgD;AAChD,oDAAkC;AAClC,sEAAoD;AACpD,gFAA8D;AAC9D,iDAA+B;AAC/B,kDAAgC;AAChC,2DAAyC;AACzC,4DAA0C;AAC1C,+EAA6D;AAC7D,2DAAyC;AACzC,6DAA2C;AAC3C,8EAA4D;AAC5D,qDAAmC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,wEAAsD;AACtD,4DAA0C;AAC1C,kEAAgD;AAChD,oDAAkC;AAClC,sEAAoD;AACpD,gFAA8D;AAC9D,iDAA+B;AAC/B,kDAAgC;AAChC,2DAAyC;AACzC,4DAA0C;AAC1C,yEAAuD;AACvD,2DAAyC;AACzC,+EAA6D;AAC7D,2DAAyC;AACzC,6DAA2C;AAC3C,8EAA4D;AAC5D,qDAAmC"}
|
package/lib-web/nmshd.runtime.js
CHANGED
|
@@ -555,10 +555,10 @@ const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
|
|
|
555
555
|
const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
|
|
556
556
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
557
557
|
exports.buildInformation = {
|
|
558
|
-
version: "3.0
|
|
559
|
-
build: "
|
|
560
|
-
date: "2023-12-
|
|
561
|
-
commit: "
|
|
558
|
+
version: "3.1.0",
|
|
559
|
+
build: "179",
|
|
560
|
+
date: "2023-12-07T08:38:54+00:00",
|
|
561
|
+
commit: "d569bd40863c953e5c8cb68ca7cbf06c92f0b1d8",
|
|
562
562
|
dependencies: {"@js-soft/docdb-querytranslator":"1.1.2","@js-soft/logging-abstractions":"1.0.1","@js-soft/ts-serval":"2.0.10","@js-soft/ts-utils":"^2.3.3","@nmshd/consumption":"3.7.4","@nmshd/content":"2.8.1","@nmshd/crypto":"2.0.5","@nmshd/transport":"2.1.4","ajv":"^8.12.0","ajv-errors":"^3.0.0","ajv-formats":"^2.1.1","json-stringify-safe":"^5.0.1","lodash":"^4.17.21","luxon":"^3.4.4","qrcode":"1.5.3","reflect-metadata":"0.1.13","ts-simple-nameof":"1.3.1","typescript-ioc":"3.2.2"},
|
|
563
563
|
libraries: {
|
|
564
564
|
serval: ts_serval_1.buildInformation,
|
|
@@ -3798,13 +3798,15 @@ exports.AttributesFacade = void 0;
|
|
|
3798
3798
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
3799
3799
|
const useCases_1 = __webpack_require__(/*! ../../../useCases */ "./dist/useCases/index.js");
|
|
3800
3800
|
let AttributesFacade = class AttributesFacade {
|
|
3801
|
-
constructor(createIdentityAttributeUseCase, shareIdentityAttributeUseCase, getPeerSharedAttributesUseCase, getOwnSharedAttributesUseCase, getAttributeUseCase, getAttributesUseCase, succeedIdentityAttributeUseCase, executeIdentityAttributeQueryUseCase, executeRelationshipAttributeQueryUseCase, succeedRelationshipAttributeAndNotifyPeerUseCase, executeThirdPartyRelationshipAttributeQueryUseCase, executeIQLQueryUseCase, validateIQLQueryUseCase, createAndShareRelationshipAttributeUseCase, notifyPeerAboutIdentityAttributeSuccessionUseCase) {
|
|
3801
|
+
constructor(createIdentityAttributeUseCase, shareIdentityAttributeUseCase, getPeerSharedAttributesUseCase, getOwnSharedAttributesUseCase, getAttributeUseCase, getAttributesUseCase, getVersionsOfAttributeUseCase, getSharedVersionsOfIdentityAttributeUseCase, succeedIdentityAttributeUseCase, executeIdentityAttributeQueryUseCase, executeRelationshipAttributeQueryUseCase, succeedRelationshipAttributeAndNotifyPeerUseCase, executeThirdPartyRelationshipAttributeQueryUseCase, executeIQLQueryUseCase, validateIQLQueryUseCase, createAndShareRelationshipAttributeUseCase, notifyPeerAboutIdentityAttributeSuccessionUseCase) {
|
|
3802
3802
|
this.createIdentityAttributeUseCase = createIdentityAttributeUseCase;
|
|
3803
3803
|
this.shareIdentityAttributeUseCase = shareIdentityAttributeUseCase;
|
|
3804
3804
|
this.getPeerSharedAttributesUseCase = getPeerSharedAttributesUseCase;
|
|
3805
3805
|
this.getOwnSharedAttributesUseCase = getOwnSharedAttributesUseCase;
|
|
3806
3806
|
this.getAttributeUseCase = getAttributeUseCase;
|
|
3807
3807
|
this.getAttributesUseCase = getAttributesUseCase;
|
|
3808
|
+
this.getVersionsOfAttributeUseCase = getVersionsOfAttributeUseCase;
|
|
3809
|
+
this.getSharedVersionsOfIdentityAttributeUseCase = getSharedVersionsOfIdentityAttributeUseCase;
|
|
3808
3810
|
this.succeedIdentityAttributeUseCase = succeedIdentityAttributeUseCase;
|
|
3809
3811
|
this.executeIdentityAttributeQueryUseCase = executeIdentityAttributeQueryUseCase;
|
|
3810
3812
|
this.executeRelationshipAttributeQueryUseCase = executeRelationshipAttributeQueryUseCase;
|
|
@@ -3830,6 +3832,12 @@ let AttributesFacade = class AttributesFacade {
|
|
|
3830
3832
|
async getAttributes(request) {
|
|
3831
3833
|
return await this.getAttributesUseCase.execute(request);
|
|
3832
3834
|
}
|
|
3835
|
+
async getVersionsOfAttribute(request) {
|
|
3836
|
+
return await this.getVersionsOfAttributeUseCase.execute(request);
|
|
3837
|
+
}
|
|
3838
|
+
async getSharedVersionsOfIdentityAttribute(request) {
|
|
3839
|
+
return await this.getSharedVersionsOfIdentityAttributeUseCase.execute(request);
|
|
3840
|
+
}
|
|
3833
3841
|
async executeIdentityAttributeQuery(request) {
|
|
3834
3842
|
return await this.executeIdentityAttributeQueryUseCase.execute(request);
|
|
3835
3843
|
}
|
|
@@ -3878,12 +3886,16 @@ exports.AttributesFacade = AttributesFacade = __decorate([
|
|
|
3878
3886
|
__param(12, typescript_ioc_1.Inject),
|
|
3879
3887
|
__param(13, typescript_ioc_1.Inject),
|
|
3880
3888
|
__param(14, typescript_ioc_1.Inject),
|
|
3889
|
+
__param(15, typescript_ioc_1.Inject),
|
|
3890
|
+
__param(16, typescript_ioc_1.Inject),
|
|
3881
3891
|
__metadata("design:paramtypes", [useCases_1.CreateIdentityAttributeUseCase,
|
|
3882
3892
|
useCases_1.ShareIdentityAttributeUseCase,
|
|
3883
3893
|
useCases_1.GetPeerSharedAttributesUseCase,
|
|
3884
3894
|
useCases_1.GetOwnSharedAttributesUseCase,
|
|
3885
3895
|
useCases_1.GetAttributeUseCase,
|
|
3886
3896
|
useCases_1.GetAttributesUseCase,
|
|
3897
|
+
useCases_1.GetVersionsOfAttributeUseCase,
|
|
3898
|
+
useCases_1.GetSharedVersionsOfIdentityAttributeUseCase,
|
|
3887
3899
|
useCases_1.SucceedIdentityAttributeUseCase,
|
|
3888
3900
|
useCases_1.ExecuteIdentityAttributeQueryUseCase,
|
|
3889
3901
|
useCases_1.ExecuteRelationshipAttributeQueryUseCase,
|
|
@@ -6522,9 +6534,6 @@ class Attributes {
|
|
|
6522
6534
|
anotherVersionOfIdentityAttributeHasAlreadyBeenSharedWithPeer(repositoryAttributeId, peer, ownSharedIdentityAttributeId) {
|
|
6523
6535
|
return new ts_utils_1.ApplicationError("error.runtime.attributes.anotherVersionOfIdentityAttributeHasAlreadyBeenSharedWithPeer", `Another version of identity attribute '${repositoryAttributeId.toString()}' has already been shared with peer '${peer.toString()}'. Id of previously shared identity attribute: ${ownSharedIdentityAttributeId.toString()}.`);
|
|
6524
6536
|
}
|
|
6525
|
-
canOnlyNotifyAboutLatestVersionOfIdentityAttribute(repositoryAttributeId) {
|
|
6526
|
-
return new ts_utils_1.ApplicationError("error.runtime.attributes.canOnlyNotifyAboutLatestVersionOfIdentityAttribute", `Identity attribute '${repositoryAttributeId.toString()}' is not the latest version the attribute. Peers can only be notified about the latest version of an identity attribute.`);
|
|
6527
|
-
}
|
|
6528
6537
|
detectedErroneousAttribute(attributeId, message) {
|
|
6529
6538
|
let msg = `Detected an error regarding attribute '${attributeId.toString()}'.`;
|
|
6530
6539
|
if (typeof message !== "undefined") {
|
|
@@ -6637,9 +6646,9 @@ exports.JsonSchema = JsonSchema;
|
|
|
6637
6646
|
"use strict";
|
|
6638
6647
|
|
|
6639
6648
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6640
|
-
exports.
|
|
6641
|
-
exports.
|
|
6642
|
-
exports.LoadPeerTokenRequest = exports.LoadPeerTokenViaSecretRequest = exports.LoadPeerTokenViaReferenceRequest = exports.GetTokensRequest = exports.GetTokenRequest = exports.GetQRCodeForTokenRequest = void 0;
|
|
6649
|
+
exports.GetSettingByKeyRequest = exports.GetSettingRequest = exports.DeleteSettingRequest = exports.CreateSettingRequest = exports.SentNotificationRequest = exports.ReceivedNotificationRequest = exports.ProcessNotificationByIdRequest = exports.GetNotificationsRequest = exports.GetNotificationRequest = exports.UpdateDraftRequest = exports.GetDraftsRequest = exports.GetDraftRequest = exports.DeleteDraftRequest = exports.CreateDraftRequest = exports.ValidateIQLQueryRequest = exports.SucceedRelationshipAttributeAndNotifyPeerRequest = exports.SucceedIdentityAttributeRequest = exports.ShareIdentityAttributeRequest = exports.NotifyPeerAboutIdentityAttributeSuccessionRequest = exports.GetVersionsOfAttributeRequest = exports.GetSharedVersionsOfIdentityAttributeRequest = exports.GetPeerSharedAttributesRequest = exports.GetOwnSharedAttributesRequest = exports.GetAttributesRequest = exports.GetAttributeRequest = exports.ExecuteThirdPartyRelationshipAttributeQueryRequest = exports.ExecuteRelationshipAttributeQueryRequest = exports.ExecuteIQLQueryRequest = exports.ExecuteIdentityAttributeQueryRequest = exports.CreateIdentityAttributeRequest = exports.CreateAndShareRelationshipAttributeRequest = exports.SentOutgoingRequestRequest = exports.RequireManualDecisionOfIncomingRequestRequest = exports.ReceivedIncomingRequestRequest = exports.GetOutgoingRequestsRequest = exports.GetOutgoingRequestRequest = exports.GetIncomingRequestsRequest = exports.GetIncomingRequestRequest = exports.DiscardOutgoingRequestRequest = exports.CreateOutgoingRequestRequest = exports.CreateAndCompleteOutgoingRequestFromRelationshipTemplateResponseRequest = exports.CompleteOutgoingRequestRequest = exports.CompleteIncomingRequestRequest = exports.CheckPrerequisitesOfIncomingRequestRequest = exports.RejectIncomingRequestRequest = exports.CanCreateOutgoingRequestRequest = exports.AcceptIncomingRequestRequest = exports.GetAttributeListenerRequest = exports.LoadPeerTokenAnonymousByTruncatedReferenceRequest = exports.LoadPeerTokenAnonymousByIdAndKeyRequest = void 0;
|
|
6650
|
+
exports.LoadPeerRelationshipTemplateViaReferenceRequest = exports.LoadPeerRelationshipTemplateViaSecretRequest = exports.GetRelationshipTemplatesRequest = exports.GetRelationshipTemplateRequest = exports.CreateTokenQrCodeForOwnTemplateRequest = exports.CreateTokenForOwnTemplateRequest = exports.CreateQrCodeForOwnTemplateRequest = exports.CreateOwnRelationshipTemplateRequest = exports.RevokeRelationshipChangeRequest = exports.RejectRelationshipChangeRequest = exports.GetRelationshipsRequest = exports.GetRelationshipByAddressRequest = exports.GetRelationshipRequest = exports.GetAttributesForRelationshipRequest = exports.CreateRelationshipRequest = exports.AcceptRelationshipChangeRequest = exports.SendMessageRequest = exports.GetMessagesRequest = exports.GetMessageRequest = exports.GetAttachmentMetadataRequest = exports.CheckIdentityRequest = exports.UploadOwnFileValidatableRequest = exports.UploadOwnFileRequest = exports.GetOrLoadFileRequest = exports.GetOrLoadFileViaReferenceRequest = exports.GetOrLoadFileViaSecretRequest = exports.GetFilesRequest = exports.GetFileRequest = exports.CreateTokenQrCodeForFileRequest = exports.CreateTokenForFileRequest = exports.CreateQrCodeForFileRequest = exports.UpdateDeviceRequest = exports.GetDeviceOnboardingInfoRequest = exports.GetDeviceRequest = exports.DeleteDeviceRequest = exports.CreateDeviceOnboardingTokenRequest = exports.CreateDeviceRequest = exports.ValidateChallengeRequest = exports.CreateChallengeRequest = exports.CreateDeviceChallengeRequest = exports.CreateIdentityChallengeRequest = exports.CreateRelationshipChallengeRequest = exports.SyncEverythingRequest = exports.DownloadAttachmentRequest = exports.SyncDatawalletRequest = exports.RegisterPushNotificationTokenRequest = exports.LoadItemFromTruncatedReferenceRequest = exports.DownloadFileRequest = exports.UpdateSettingRequest = exports.GetSettingsRequest = void 0;
|
|
6651
|
+
exports.LoadPeerTokenRequest = exports.LoadPeerTokenViaSecretRequest = exports.LoadPeerTokenViaReferenceRequest = exports.GetTokensRequest = exports.GetTokenRequest = exports.GetQRCodeForTokenRequest = exports.CreateOwnTokenRequest = exports.LoadPeerRelationshipTemplateRequest = void 0;
|
|
6643
6652
|
exports.LoadPeerTokenAnonymousByIdAndKeyRequest = {
|
|
6644
6653
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
6645
6654
|
"$ref": "#/definitions/LoadPeerTokenAnonymousByIdAndKeyRequest",
|
|
@@ -23530,6 +23539,50 @@ exports.GetPeerSharedAttributesRequest = {
|
|
|
23530
23539
|
}
|
|
23531
23540
|
}
|
|
23532
23541
|
};
|
|
23542
|
+
exports.GetSharedVersionsOfIdentityAttributeRequest = {
|
|
23543
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
23544
|
+
"$ref": "#/definitions/GetSharedVersionsOfIdentityAttributeRequest",
|
|
23545
|
+
"definitions": {
|
|
23546
|
+
"GetSharedVersionsOfIdentityAttributeRequest": {
|
|
23547
|
+
"type": "object",
|
|
23548
|
+
"properties": {
|
|
23549
|
+
"attributeId": {
|
|
23550
|
+
"$ref": "#/definitions/AttributeIdString"
|
|
23551
|
+
}
|
|
23552
|
+
},
|
|
23553
|
+
"required": [
|
|
23554
|
+
"attributeId"
|
|
23555
|
+
],
|
|
23556
|
+
"additionalProperties": false
|
|
23557
|
+
},
|
|
23558
|
+
"AttributeIdString": {
|
|
23559
|
+
"type": "string",
|
|
23560
|
+
"pattern": "ATT[A-Za-z0-9]{17}"
|
|
23561
|
+
}
|
|
23562
|
+
}
|
|
23563
|
+
};
|
|
23564
|
+
exports.GetVersionsOfAttributeRequest = {
|
|
23565
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
23566
|
+
"$ref": "#/definitions/GetVersionsOfAttributeRequest",
|
|
23567
|
+
"definitions": {
|
|
23568
|
+
"GetVersionsOfAttributeRequest": {
|
|
23569
|
+
"type": "object",
|
|
23570
|
+
"properties": {
|
|
23571
|
+
"attributeId": {
|
|
23572
|
+
"$ref": "#/definitions/AttributeIdString"
|
|
23573
|
+
}
|
|
23574
|
+
},
|
|
23575
|
+
"required": [
|
|
23576
|
+
"attributeId"
|
|
23577
|
+
],
|
|
23578
|
+
"additionalProperties": false
|
|
23579
|
+
},
|
|
23580
|
+
"AttributeIdString": {
|
|
23581
|
+
"type": "string",
|
|
23582
|
+
"pattern": "ATT[A-Za-z0-9]{17}"
|
|
23583
|
+
}
|
|
23584
|
+
}
|
|
23585
|
+
};
|
|
23533
23586
|
exports.NotifyPeerAboutIdentityAttributeSuccessionRequest = {
|
|
23534
23587
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
23535
23588
|
"$ref": "#/definitions/NotifyPeerAboutIdentityAttributeSuccessionRequest",
|
|
@@ -29175,6 +29228,134 @@ exports.GetPeerSharedAttributesUseCase = GetPeerSharedAttributesUseCase = __deco
|
|
|
29175
29228
|
|
|
29176
29229
|
/***/ }),
|
|
29177
29230
|
|
|
29231
|
+
/***/ "./dist/useCases/consumption/attributes/GetSharedVersionsOfIdentityAttribute.js":
|
|
29232
|
+
/*!**************************************************************************************!*\
|
|
29233
|
+
!*** ./dist/useCases/consumption/attributes/GetSharedVersionsOfIdentityAttribute.js ***!
|
|
29234
|
+
\**************************************************************************************/
|
|
29235
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
29236
|
+
|
|
29237
|
+
"use strict";
|
|
29238
|
+
|
|
29239
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
29240
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
29241
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
29242
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
29243
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
29244
|
+
};
|
|
29245
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
29246
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
29247
|
+
};
|
|
29248
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
29249
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
29250
|
+
};
|
|
29251
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
29252
|
+
exports.GetSharedVersionsOfIdentityAttributeUseCase = void 0;
|
|
29253
|
+
const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
|
|
29254
|
+
const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
|
|
29255
|
+
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
29256
|
+
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
29257
|
+
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
29258
|
+
const AttributeMapper_1 = __webpack_require__(/*! ./AttributeMapper */ "./dist/useCases/consumption/attributes/AttributeMapper.js");
|
|
29259
|
+
let Validator = class Validator extends common_1.SchemaValidator {
|
|
29260
|
+
constructor(schemaRepository) {
|
|
29261
|
+
super(schemaRepository.getSchema("GetSharedVersionsOfIdentityAttributeRequest"));
|
|
29262
|
+
}
|
|
29263
|
+
};
|
|
29264
|
+
Validator = __decorate([
|
|
29265
|
+
__param(0, typescript_ioc_1.Inject),
|
|
29266
|
+
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
29267
|
+
], Validator);
|
|
29268
|
+
let GetSharedVersionsOfIdentityAttributeUseCase = class GetSharedVersionsOfIdentityAttributeUseCase extends common_1.UseCase {
|
|
29269
|
+
constructor(attributeController, validator) {
|
|
29270
|
+
super(validator);
|
|
29271
|
+
this.attributeController = attributeController;
|
|
29272
|
+
}
|
|
29273
|
+
async executeInternal(request) {
|
|
29274
|
+
const attribute = await this.attributeController.getLocalAttribute(transport_1.CoreId.from(request.attributeId));
|
|
29275
|
+
if (!attribute || attribute.isRelationshipAttribute()) {
|
|
29276
|
+
throw common_1.RuntimeErrors.general.invalidPropertyValue("The given ID doesn't belong to a valid IdentityAttribute.");
|
|
29277
|
+
}
|
|
29278
|
+
const allVersions = await this.attributeController.getVersionsOfAttribute(transport_1.CoreId.from(request.attributeId));
|
|
29279
|
+
// queried ID doesn't belong to a repository attribute
|
|
29280
|
+
if (attribute.shareInfo !== undefined) {
|
|
29281
|
+
return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTOList(allVersions));
|
|
29282
|
+
}
|
|
29283
|
+
const query = {
|
|
29284
|
+
"shareInfo.sourceAttribute": { $in: allVersions.map((x) => x.id.toString()) }
|
|
29285
|
+
};
|
|
29286
|
+
const sharedAttributes = await this.attributeController.getLocalAttributes(query);
|
|
29287
|
+
return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTOList(sharedAttributes));
|
|
29288
|
+
}
|
|
29289
|
+
};
|
|
29290
|
+
exports.GetSharedVersionsOfIdentityAttributeUseCase = GetSharedVersionsOfIdentityAttributeUseCase;
|
|
29291
|
+
exports.GetSharedVersionsOfIdentityAttributeUseCase = GetSharedVersionsOfIdentityAttributeUseCase = __decorate([
|
|
29292
|
+
__param(0, typescript_ioc_1.Inject),
|
|
29293
|
+
__param(1, typescript_ioc_1.Inject),
|
|
29294
|
+
__metadata("design:paramtypes", [consumption_1.AttributesController,
|
|
29295
|
+
Validator])
|
|
29296
|
+
], GetSharedVersionsOfIdentityAttributeUseCase);
|
|
29297
|
+
//# sourceMappingURL=GetSharedVersionsOfIdentityAttribute.js.map
|
|
29298
|
+
|
|
29299
|
+
/***/ }),
|
|
29300
|
+
|
|
29301
|
+
/***/ "./dist/useCases/consumption/attributes/GetVersionsOfAttribute.js":
|
|
29302
|
+
/*!************************************************************************!*\
|
|
29303
|
+
!*** ./dist/useCases/consumption/attributes/GetVersionsOfAttribute.js ***!
|
|
29304
|
+
\************************************************************************/
|
|
29305
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
29306
|
+
|
|
29307
|
+
"use strict";
|
|
29308
|
+
|
|
29309
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
29310
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
29311
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
29312
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
29313
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
29314
|
+
};
|
|
29315
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
29316
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
29317
|
+
};
|
|
29318
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
29319
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
29320
|
+
};
|
|
29321
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
29322
|
+
exports.GetVersionsOfAttributeUseCase = void 0;
|
|
29323
|
+
const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "./node_modules/@js-soft/ts-utils/dist/index.js");
|
|
29324
|
+
const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
|
|
29325
|
+
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
29326
|
+
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "./node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
29327
|
+
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
29328
|
+
const AttributeMapper_1 = __webpack_require__(/*! ./AttributeMapper */ "./dist/useCases/consumption/attributes/AttributeMapper.js");
|
|
29329
|
+
let Validator = class Validator extends common_1.SchemaValidator {
|
|
29330
|
+
constructor(schemaRepository) {
|
|
29331
|
+
super(schemaRepository.getSchema("GetVersionsOfAttributeRequest"));
|
|
29332
|
+
}
|
|
29333
|
+
};
|
|
29334
|
+
Validator = __decorate([
|
|
29335
|
+
__param(0, typescript_ioc_1.Inject),
|
|
29336
|
+
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
29337
|
+
], Validator);
|
|
29338
|
+
let GetVersionsOfAttributeUseCase = class GetVersionsOfAttributeUseCase extends common_1.UseCase {
|
|
29339
|
+
constructor(attributeController, validator) {
|
|
29340
|
+
super(validator);
|
|
29341
|
+
this.attributeController = attributeController;
|
|
29342
|
+
}
|
|
29343
|
+
async executeInternal(request) {
|
|
29344
|
+
const allVersions = await this.attributeController.getVersionsOfAttribute(transport_1.CoreId.from(request.attributeId));
|
|
29345
|
+
return ts_utils_1.Result.ok(AttributeMapper_1.AttributeMapper.toAttributeDTOList(allVersions));
|
|
29346
|
+
}
|
|
29347
|
+
};
|
|
29348
|
+
exports.GetVersionsOfAttributeUseCase = GetVersionsOfAttributeUseCase;
|
|
29349
|
+
exports.GetVersionsOfAttributeUseCase = GetVersionsOfAttributeUseCase = __decorate([
|
|
29350
|
+
__param(0, typescript_ioc_1.Inject),
|
|
29351
|
+
__param(1, typescript_ioc_1.Inject),
|
|
29352
|
+
__metadata("design:paramtypes", [consumption_1.AttributesController,
|
|
29353
|
+
Validator])
|
|
29354
|
+
], GetVersionsOfAttributeUseCase);
|
|
29355
|
+
//# sourceMappingURL=GetVersionsOfAttribute.js.map
|
|
29356
|
+
|
|
29357
|
+
/***/ }),
|
|
29358
|
+
|
|
29178
29359
|
/***/ "./dist/useCases/consumption/attributes/NotifyPeerAboutIdentityAttributeSuccession.js":
|
|
29179
29360
|
/*!********************************************************************************************!*\
|
|
29180
29361
|
!*** ./dist/useCases/consumption/attributes/NotifyPeerAboutIdentityAttributeSuccession.js ***!
|
|
@@ -29227,9 +29408,6 @@ let NotifyPeerAboutIdentityAttributeSuccessionUseCase = class NotifyPeerAboutIde
|
|
|
29227
29408
|
return ts_utils_1.Result.fail(common_1.RuntimeErrors.general.recordNotFound(consumption_1.LocalAttribute.name));
|
|
29228
29409
|
if (!repositoryAttributeSuccessor.isRepositoryAttribute())
|
|
29229
29410
|
return ts_utils_1.Result.fail(common_1.RuntimeErrors.attributes.isNoIdentityAttribute(repositoryAttributeSuccessor.id));
|
|
29230
|
-
if (typeof repositoryAttributeSuccessor.succeededBy !== "undefined") {
|
|
29231
|
-
return ts_utils_1.Result.fail(common_1.RuntimeErrors.attributes.canOnlyNotifyAboutLatestVersionOfIdentityAttribute(repositoryAttributeSuccessor.id));
|
|
29232
|
-
}
|
|
29233
29411
|
const query = {
|
|
29234
29412
|
"content.owner": this.accountController.identity.address.toString(),
|
|
29235
29413
|
"content.@type": "IdentityAttribute",
|
|
@@ -29245,7 +29423,7 @@ let NotifyPeerAboutIdentityAttributeSuccessionUseCase = class NotifyPeerAboutIde
|
|
|
29245
29423
|
const candidatePredecessorsQuery = {
|
|
29246
29424
|
"shareInfo.sourceAttribute": { $in: repositoryAttributeVersionIds },
|
|
29247
29425
|
"shareInfo.peer": request.peer,
|
|
29248
|
-
|
|
29426
|
+
succeededBy: { $exists: false }
|
|
29249
29427
|
};
|
|
29250
29428
|
const candidatePredecessors = await this.attributeController.getLocalAttributes(candidatePredecessorsQuery);
|
|
29251
29429
|
if (candidatePredecessors.length === 0) {
|
|
@@ -29712,6 +29890,8 @@ __exportStar(__webpack_require__(/*! ./GetAttribute */ "./dist/useCases/consumpt
|
|
|
29712
29890
|
__exportStar(__webpack_require__(/*! ./GetAttributes */ "./dist/useCases/consumption/attributes/GetAttributes.js"), exports);
|
|
29713
29891
|
__exportStar(__webpack_require__(/*! ./GetOwnSharedAttributes */ "./dist/useCases/consumption/attributes/GetOwnSharedAttributes.js"), exports);
|
|
29714
29892
|
__exportStar(__webpack_require__(/*! ./GetPeerSharedAttributes */ "./dist/useCases/consumption/attributes/GetPeerSharedAttributes.js"), exports);
|
|
29893
|
+
__exportStar(__webpack_require__(/*! ./GetSharedVersionsOfIdentityAttribute */ "./dist/useCases/consumption/attributes/GetSharedVersionsOfIdentityAttribute.js"), exports);
|
|
29894
|
+
__exportStar(__webpack_require__(/*! ./GetVersionsOfAttribute */ "./dist/useCases/consumption/attributes/GetVersionsOfAttribute.js"), exports);
|
|
29715
29895
|
__exportStar(__webpack_require__(/*! ./NotifyPeerAboutIdentityAttributeSuccession */ "./dist/useCases/consumption/attributes/NotifyPeerAboutIdentityAttributeSuccession.js"), exports);
|
|
29716
29896
|
__exportStar(__webpack_require__(/*! ./ShareIdentityAttribute */ "./dist/useCases/consumption/attributes/ShareIdentityAttribute.js"), exports);
|
|
29717
29897
|
__exportStar(__webpack_require__(/*! ./SucceedIdentityAttribute */ "./dist/useCases/consumption/attributes/SucceedIdentityAttribute.js"), exports);
|