@nmshd/runtime 4.1.5 → 4.3.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 +5 -5
- package/dist/useCases/common/Schemas.d.ts.map +1 -1
- package/dist/useCases/common/Schemas.js +74 -5
- package/dist/useCases/common/Schemas.js.map +1 -1
- package/dist/useCases/consumption/attributes/GetOwnSharedAttributes.d.ts +3 -0
- package/dist/useCases/consumption/attributes/GetOwnSharedAttributes.d.ts.map +1 -1
- package/dist/useCases/consumption/attributes/GetOwnSharedAttributes.js.map +1 -1
- package/dist/useCases/consumption/attributes/GetPeerSharedAttributes.d.ts +3 -0
- package/dist/useCases/consumption/attributes/GetPeerSharedAttributes.d.ts.map +1 -1
- package/dist/useCases/consumption/attributes/GetPeerSharedAttributes.js.map +1 -1
- package/dist/useCases/consumption/attributes/GetRepositoryAttributes.d.ts +11 -0
- package/dist/useCases/consumption/attributes/GetRepositoryAttributes.d.ts.map +1 -1
- package/dist/useCases/consumption/attributes/GetRepositoryAttributes.js +6 -5
- package/dist/useCases/consumption/attributes/GetRepositoryAttributes.js.map +1 -1
- package/dist/useCases/consumption/attributes/GetSharedVersionsOfRepositoryAttribute.d.ts +3 -0
- package/dist/useCases/consumption/attributes/GetSharedVersionsOfRepositoryAttribute.d.ts.map +1 -1
- package/dist/useCases/consumption/attributes/GetSharedVersionsOfRepositoryAttribute.js.map +1 -1
- package/dist/useCases/transport/messages/SendMessage.d.ts +4 -1
- package/dist/useCases/transport/messages/SendMessage.d.ts.map +1 -1
- package/dist/useCases/transport/messages/SendMessage.js +34 -1
- package/dist/useCases/transport/messages/SendMessage.js.map +1 -1
- package/dist/useCases/transport/relationships/GetAttributesForRelationship.d.ts +3 -0
- package/dist/useCases/transport/relationships/GetAttributesForRelationship.d.ts.map +1 -1
- package/dist/useCases/transport/relationships/GetAttributesForRelationship.js.map +1 -1
- package/lib-web/nmshd.runtime.js +119 -16
- 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 +2 -2
|
@@ -8,6 +8,9 @@ export interface GetOwnSharedAttributesRequest {
|
|
|
8
8
|
onlyValid?: boolean;
|
|
9
9
|
query?: GetOwnSharedAttributeRequestQuery;
|
|
10
10
|
hideTechnical?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* default: true
|
|
13
|
+
*/
|
|
11
14
|
onlyLatestVersions?: boolean;
|
|
12
15
|
}
|
|
13
16
|
export interface GetOwnSharedAttributeRequestQuery {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GetOwnSharedAttributes.d.ts","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/GetOwnSharedAttributes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAKzF,MAAM,WAAW,6BAA6B;IAC1C,IAAI,EAAE,aAAa,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,iCAAiC,CAAC;IAC1C,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,iCAAiC;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACpC,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACnC,mBAAmB,CAAC,EAAE,MAAM,G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,SAAQ,OAAO,CAAC,6BAA6B,EAAE,iBAAiB,EAAE,CAAC;IAE9F,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBADlB,mBAAmB,EAAE,oBAAoB,EACzC,kBAAkB,EAAE,kBAAkB,EACvD,SAAS,EAAE,SAAS;cAKhB,eAAe,CAAC,OAAO,EAAE,6BAA6B,GAAG,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC,CAAC;CAiBhH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GetOwnSharedAttributes.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/GetOwnSharedAttributes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAA0D;AAC1D,gDAAsD;AACtD,mDAAwC;AAExC,yCAAyF;AACzF,8DAA2D;AAC3D,uDAAoD;AACpD,mDAAkF;
|
|
1
|
+
{"version":3,"file":"GetOwnSharedAttributes.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/GetOwnSharedAttributes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAA0D;AAC1D,gDAAsD;AACtD,mDAAwC;AAExC,yCAAyF;AACzF,8DAA2D;AAC3D,uDAAoD;AACpD,mDAAkF;AA6BlF,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,EACzC,kBAAsC,EACvD,SAAoB;QAE5B,KAAK,CAAC,SAAS,CAAC,CAAC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default: true
|
|
12
|
+
*/
|
|
10
13
|
onlyLatestVersions?: boolean;
|
|
11
14
|
}
|
|
12
15
|
export interface GetPeerSharedAttributesRequestQuery {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GetPeerSharedAttributes.d.ts","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/GetPeerSharedAttributes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAKzF,MAAM,WAAW,8BAA8B;IAC3C,IAAI,EAAE,aAAa,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,mCAAmC,CAAC;IAC5C,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,mCAAmC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACpC,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACnC,mBAAmB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxC,iBAAiB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACtC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAClC,qBAAqB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1C,yBAAyB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC9C,qBAAqB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC9B,4BAA4B,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACjD,iCAAiC,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACzD;AAED,cAAM,SAAU,SAAQ,eAAe,CAAC,8BAA8B,CAAC;gBACxC,gBAAgB,EAAE,gBAAgB;CAGhE;AAED,qBAAa,8BAA+B,SAAQ,OAAO,CAAC,8BAA8B,EAAE,iBAAiB,EAAE,CAAC;IAEhG,OAAO,CAAC,QAAQ,CAAC,mBAAmB;gBAAnB,mBAAmB,EAAE,oBAAoB,EAC1D,SAAS,EAAE,SAAS;cAKhB,eAAe,CAAC,OAAO,EAAE,8BAA8B,GAAG,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC,CAAC;CAejH"}
|
|
1
|
+
{"version":3,"file":"GetPeerSharedAttributes.d.ts","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/GetPeerSharedAttributes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAKzF,MAAM,WAAW,8BAA8B;IAC3C,IAAI,EAAE,aAAa,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,mCAAmC,CAAC;IAC5C,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,mCAAmC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACpC,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACnC,mBAAmB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxC,iBAAiB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACtC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAClC,qBAAqB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1C,yBAAyB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC9C,qBAAqB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC9B,4BAA4B,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACjD,iCAAiC,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACzD;AAED,cAAM,SAAU,SAAQ,eAAe,CAAC,8BAA8B,CAAC;gBACxC,gBAAgB,EAAE,gBAAgB;CAGhE;AAED,qBAAa,8BAA+B,SAAQ,OAAO,CAAC,8BAA8B,EAAE,iBAAiB,EAAE,CAAC;IAEhG,OAAO,CAAC,QAAQ,CAAC,mBAAmB;gBAAnB,mBAAmB,EAAE,oBAAoB,EAC1D,SAAS,EAAE,SAAS;cAKhB,eAAe,CAAC,OAAO,EAAE,8BAA8B,GAAG,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC,CAAC;CAejH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GetPeerSharedAttributes.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/GetPeerSharedAttributes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAA0D;AAC1D,mDAAwC;AAExC,yCAAyF;AACzF,8DAA2D;AAC3D,uDAAoD;AACpD,mDAAkF;
|
|
1
|
+
{"version":3,"file":"GetPeerSharedAttributes.js","source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CAAe,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAAC;IACrE,CAAC;CACJ,CAAA;AAvBY,wEAA8B;yCAA9B,8BAA8B;IAElC,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;qCADuC,kCAAoB;QAC/C,SAAS;GAHvB,8BAA8B,CAuB1C"}
|
|
@@ -3,7 +3,18 @@ import { AttributesController } from "@nmshd/consumption";
|
|
|
3
3
|
import { LocalAttributeDTO } from "../../../types";
|
|
4
4
|
import { SchemaRepository, SchemaValidator, UseCase } from "../../common";
|
|
5
5
|
export interface GetRepositoryAttributesRequest {
|
|
6
|
+
/**
|
|
7
|
+
* default: true
|
|
8
|
+
*/
|
|
6
9
|
onlyLatestVersions?: boolean;
|
|
10
|
+
query?: GetRepositoryAttributesRequestQuery;
|
|
11
|
+
}
|
|
12
|
+
export interface GetRepositoryAttributesRequestQuery {
|
|
13
|
+
createdAt?: string;
|
|
14
|
+
"content.tags"?: string | string[];
|
|
15
|
+
"content.validFrom"?: string | string[];
|
|
16
|
+
"content.validTo"?: string | string[];
|
|
17
|
+
"content.value.@type"?: string | string[];
|
|
7
18
|
}
|
|
8
19
|
export interface GetRepositoryAttributesResponse extends Array<LocalAttributeDTO> {
|
|
9
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GetRepositoryAttributes.d.ts","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/GetRepositoryAttributes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAG1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"GetRepositoryAttributes.d.ts","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/GetRepositoryAttributes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAG1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,OAAO,EAAiB,MAAM,cAAc,CAAC;AAEzF,MAAM,WAAW,8BAA8B;IAC3C;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,KAAK,CAAC,EAAE,mCAAmC,CAAC;CAC/C;AAED,MAAM,WAAW,mCAAmC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACnC,mBAAmB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxC,iBAAiB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACtC,qBAAqB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC7C;AAED,MAAM,WAAW,+BAAgC,SAAQ,KAAK,CAAC,iBAAiB,CAAC;CAAG;AAEpF,cAAM,SAAU,SAAQ,eAAe,CAAC,8BAA8B,CAAC;gBACxC,gBAAgB,EAAE,gBAAgB;CAGhE;AAED,qBAAa,8BAA+B,SAAQ,OAAO,CAAC,8BAA8B,EAAE,+BAA+B,CAAC;IAE5G,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBAApB,oBAAoB,EAAE,oBAAoB,EAC3D,SAAS,EAAE,SAAS;cAKhB,eAAe,CAAC,OAAO,EAAE,8BAA8B,GAAG,OAAO,CAAC,MAAM,CAAC,+BAA+B,CAAC,CAAC;CAc7H"}
|
|
@@ -33,13 +33,14 @@ let GetRepositoryAttributesUseCase = class GetRepositoryAttributesUseCase extend
|
|
|
33
33
|
this.attributesController = attributesController;
|
|
34
34
|
}
|
|
35
35
|
async executeInternal(request) {
|
|
36
|
-
const query = {
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
const query = request.query ?? {};
|
|
37
|
+
const flattenedQuery = (0, common_1.flattenObject)(query);
|
|
38
|
+
const dbQuery = __1.GetAttributesUseCase.queryTranslator.parse(flattenedQuery);
|
|
39
|
+
dbQuery.shareInfo = { $exists: false };
|
|
39
40
|
if (typeof request.onlyLatestVersions === "undefined" || request.onlyLatestVersions) {
|
|
40
|
-
|
|
41
|
+
dbQuery["succeededBy"] = { $exists: false };
|
|
41
42
|
}
|
|
42
|
-
const attributes = await this.attributesController.getLocalAttributes(
|
|
43
|
+
const attributes = await this.attributesController.getLocalAttributes(dbQuery);
|
|
43
44
|
return ts_utils_1.Result.ok(__1.AttributeMapper.toAttributeDTOList(attributes));
|
|
44
45
|
}
|
|
45
46
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GetRepositoryAttributes.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/GetRepositoryAttributes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAA0D;AAC1D,mDAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"GetRepositoryAttributes.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/GetRepositoryAttributes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAA0D;AAC1D,mDAAwC;AACxC,0BAAsF;AAEtF,yCAAyF;AAoBzF,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,wBAA+C;IACnE,YAA2B,gBAAkC;QACzD,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,gCAAgC,CAAC,CAAC,CAAC;IACxE,CAAC;CACJ,CAAA;AAJK,SAAS;IACS,WAAA,uBAAM,CAAA;qCAAmB,yBAAgB;GAD3D,SAAS,CAId;AAED,IAAa,8BAA8B,GAA3C,MAAa,8BAA+B,SAAQ,gBAAwE;IACxH,YAC6B,oBAA0C,EAC3D,SAAoB;QAE5B,KAAK,CAAC,SAAS,CAAC,CAAC;QAHQ,yBAAoB,GAApB,oBAAoB,CAAsB;IAIvE,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,OAAuC;QACnE,MAAM,KAAK,GAA8B,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;QAC7D,MAAM,cAAc,GAAG,IAAA,sBAAa,EAAC,KAAK,CAAC,CAAC;QAC5C,MAAM,OAAO,GAAG,wBAAoB,CAAC,eAAe,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QAC3E,OAAO,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAEvC,IAAI,OAAO,OAAO,CAAC,kBAAkB,KAAK,WAAW,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;YAClF,OAAO,CAAC,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAChD,CAAC;QAED,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAE/E,OAAO,iBAAM,CAAC,EAAE,CAAC,mBAAe,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAAC;IACrE,CAAC;CACJ,CAAA;AAtBY,wEAA8B;yCAA9B,8BAA8B;IAElC,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;qCADwC,kCAAoB;QAChD,SAAS;GAHvB,8BAA8B,CAsB1C"}
|
|
@@ -6,6 +6,9 @@ import { AddressString, AttributeIdString, SchemaRepository, SchemaValidator, Us
|
|
|
6
6
|
export interface GetSharedVersionsOfRepositoryAttributeRequest {
|
|
7
7
|
attributeId: AttributeIdString;
|
|
8
8
|
peers?: AddressString[];
|
|
9
|
+
/**
|
|
10
|
+
* default: true
|
|
11
|
+
*/
|
|
9
12
|
onlyLatestVersions?: boolean;
|
|
10
13
|
}
|
|
11
14
|
declare class Validator extends SchemaValidator<GetSharedVersionsOfRepositoryAttributeRequest> {
|
package/dist/useCases/consumption/attributes/GetSharedVersionsOfRepositoryAttribute.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GetSharedVersionsOfRepositoryAttribute.d.ts","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/GetSharedVersionsOfRepositoryAttribute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAkB,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAuB,MAAM,kBAAkB,CAAC;AAE1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAiB,gBAAgB,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG3H,MAAM,WAAW,6CAA6C;IAC1D,WAAW,EAAE,iBAAiB,CAAC;IAC/B,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,cAAM,SAAU,SAAQ,eAAe,CAAC,6CAA6C,CAAC;gBACvD,gBAAgB,EAAE,gBAAgB;CAGhE;AAED,qBAAa,6CAA8C,SAAQ,OAAO,CAAC,6CAA6C,EAAE,iBAAiB,EAAE,CAAC;IAE9H,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,mBAAmB;gBADnB,iBAAiB,EAAE,iBAAiB,EACpC,mBAAmB,EAAE,oBAAoB,EAC1D,SAAS,EAAE,SAAS;cAKhB,eAAe,CAAC,OAAO,EAAE,6CAA6C,GAAG,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC,CAAC;CAqBhI"}
|
|
1
|
+
{"version":3,"file":"GetSharedVersionsOfRepositoryAttribute.d.ts","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/GetSharedVersionsOfRepositoryAttribute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAkB,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAuB,MAAM,kBAAkB,CAAC;AAE1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAiB,gBAAgB,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG3H,MAAM,WAAW,6CAA6C;IAC1D,WAAW,EAAE,iBAAiB,CAAC;IAC/B,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;IACxB;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,cAAM,SAAU,SAAQ,eAAe,CAAC,6CAA6C,CAAC;gBACvD,gBAAgB,EAAE,gBAAgB;CAGhE;AAED,qBAAa,6CAA8C,SAAQ,OAAO,CAAC,6CAA6C,EAAE,iBAAiB,EAAE,CAAC;IAE9H,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,mBAAmB;gBADnB,iBAAiB,EAAE,iBAAiB,EACpC,mBAAmB,EAAE,oBAAoB,EAC1D,SAAS,EAAE,SAAS;cAKhB,eAAe,CAAC,OAAO,EAAE,6CAA6C,GAAG,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC,CAAC;CAqBhI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GetSharedVersionsOfRepositoryAttribute.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/GetSharedVersionsOfRepositoryAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAA0E;AAC1E,gDAA0E;AAC1E,mDAAwC;AAExC,yCAA2H;AAC3H,uDAAoD;
|
|
1
|
+
{"version":3,"file":"GetSharedVersionsOfRepositoryAttribute.js","sourceRoot":"","sources":["../../../../src/useCases/consumption/attributes/GetSharedVersionsOfRepositoryAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAA0E;AAC1E,gDAA0E;AAC1E,mDAAwC;AAExC,yCAA2H;AAC3H,uDAAoD;AAWpD,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,wBAA8D;IAClF,YAA2B,gBAAkC;QACzD,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,+CAA+C,CAAC,CAAC,CAAC;IACvF,CAAC;CACJ,CAAA;AAJK,SAAS;IACS,WAAA,uBAAM,CAAA;qCAAmB,yBAAgB;GAD3D,SAAS,CAId;AAED,IAAa,6CAA6C,GAA1D,MAAa,6CAA8C,SAAQ,gBAA2E;IAC1I,YAC6B,iBAAoC,EACpC,mBAAyC,EAC1D,SAAoB;QAE5B,KAAK,CAAC,SAAS,CAAC,CAAC;QAJQ,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,wBAAmB,GAAnB,mBAAmB,CAAsB;IAItE,CAAC;IAES,KAAK,CAAC,eAAe,CAAC,OAAsD;QAClF,MAAM,qBAAqB,GAAG,kBAAM,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAC/D,MAAM,mBAAmB,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,qBAAqB,CAAC,CAAC;QAEpG,IAAI,OAAO,mBAAmB,KAAK,WAAW,EAAE,CAAC;YAC7C,OAAO,iBAAM,CAAC,IAAI,CAAC,sBAAa,CAAC,OAAO,CAAC,cAAc,CAAC,4BAAc,CAAC,CAAC,CAAC;QAC7E,CAAC;QAED,IAAI,CAAC,mBAAmB,CAAC,qBAAqB,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YACtF,OAAO,iBAAM,CAAC,IAAI,CAAC,sBAAa,CAAC,UAAU,CAAC,wBAAwB,CAAC,qBAAqB,CAAC,CAAC,CAAC;QACjG,CAAC;QAED,IAAI,OAAO,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9B,OAAO,iBAAM,CAAC,IAAI,CAAC,sBAAa,CAAC,OAAO,CAAC,oBAAoB,CAAC,iDAAiD,CAAC,CAAC,CAAC;QACtH,CAAC;QAED,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,uBAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QACzE,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,sCAAsC,CAAC,qBAAqB,EAAE,KAAK,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAEvJ,OAAO,iBAAM,CAAC,EAAE,CAAC,iCAAe,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC,CAAC;IACzE,CAAC;CACJ,CAAA;AA9BY,sGAA6C;wDAA7C,6CAA6C;IAEjD,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;qCAFqC,6BAAiB;QACf,kCAAoB;QAC/C,SAAS;GAJvB,6CAA6C,CA8BzD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Result } from "@js-soft/ts-utils";
|
|
2
|
+
import { OutgoingRequestsController } from "@nmshd/consumption";
|
|
2
3
|
import { AccountController, FileController, MessageController } from "@nmshd/transport";
|
|
3
4
|
import { MessageDTO } from "../../../types";
|
|
4
5
|
import { AddressString, FileIdString, SchemaRepository, SchemaValidator, UseCase } from "../../common";
|
|
@@ -17,8 +18,10 @@ export declare class SendMessageUseCase extends UseCase<SendMessageRequest, Mess
|
|
|
17
18
|
private readonly messageController;
|
|
18
19
|
private readonly fileController;
|
|
19
20
|
private readonly accountController;
|
|
20
|
-
|
|
21
|
+
private readonly outgoingRequestsController;
|
|
22
|
+
constructor(messageController: MessageController, fileController: FileController, accountController: AccountController, outgoingRequestsController: OutgoingRequestsController, validator: Validator);
|
|
21
23
|
protected executeInternal(request: SendMessageRequest): Promise<Result<MessageDTO>>;
|
|
24
|
+
private validateMessageContent;
|
|
22
25
|
private transformAttachments;
|
|
23
26
|
}
|
|
24
27
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SendMessage.d.ts","sourceRoot":"","sources":["../../../../src/useCases/transport/messages/SendMessage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SendMessage.d.ts","sourceRoot":"","sources":["../../../../src/useCases/transport/messages/SendMessage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAA6B,cAAc,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGnH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAiB,gBAAgB,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGtH,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B,OAAO,EAAE,GAAG,CAAC;IAEb,WAAW,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC;AAED,cAAM,SAAU,SAAQ,eAAe,CAAC,kBAAkB,CAAC;gBAC5B,gBAAgB,EAAE,gBAAgB;CAGhE;AAED,qBAAa,kBAAmB,SAAQ,OAAO,CAAC,kBAAkB,EAAE,UAAU,CAAC;IAE/D,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,0BAA0B;gBAH1B,iBAAiB,EAAE,iBAAiB,EACpC,cAAc,EAAE,cAAc,EAC9B,iBAAiB,EAAE,iBAAiB,EACpC,0BAA0B,EAAE,0BAA0B,EACvE,SAAS,EAAE,SAAS;cAKhB,eAAe,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YAoB3E,sBAAsB;YAuBtB,oBAAoB;CAkBrC"}
|
|
@@ -11,10 +11,17 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
+
};
|
|
14
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
18
|
exports.SendMessageUseCase = void 0;
|
|
19
|
+
const ts_serval_1 = require("@js-soft/ts-serval");
|
|
16
20
|
const ts_utils_1 = require("@js-soft/ts-utils");
|
|
21
|
+
const consumption_1 = require("@nmshd/consumption");
|
|
22
|
+
const content_1 = require("@nmshd/content");
|
|
17
23
|
const transport_1 = require("@nmshd/transport");
|
|
24
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
18
25
|
const typescript_ioc_1 = require("typescript-ioc");
|
|
19
26
|
const common_1 = require("../../common");
|
|
20
27
|
const MessageMapper_1 = require("./MessageMapper");
|
|
@@ -28,13 +35,17 @@ Validator = __decorate([
|
|
|
28
35
|
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
29
36
|
], Validator);
|
|
30
37
|
let SendMessageUseCase = class SendMessageUseCase extends common_1.UseCase {
|
|
31
|
-
constructor(messageController, fileController, accountController, validator) {
|
|
38
|
+
constructor(messageController, fileController, accountController, outgoingRequestsController, validator) {
|
|
32
39
|
super(validator);
|
|
33
40
|
this.messageController = messageController;
|
|
34
41
|
this.fileController = fileController;
|
|
35
42
|
this.accountController = accountController;
|
|
43
|
+
this.outgoingRequestsController = outgoingRequestsController;
|
|
36
44
|
}
|
|
37
45
|
async executeInternal(request) {
|
|
46
|
+
const validationError = await this.validateMessageContent(request.content, request.recipients);
|
|
47
|
+
if (validationError)
|
|
48
|
+
return ts_utils_1.Result.fail(validationError);
|
|
38
49
|
const transformAttachmentsResult = await this.transformAttachments(request.attachments);
|
|
39
50
|
if (transformAttachmentsResult.isError) {
|
|
40
51
|
return ts_utils_1.Result.fail(transformAttachmentsResult.error);
|
|
@@ -47,6 +58,26 @@ let SendMessageUseCase = class SendMessageUseCase extends common_1.UseCase {
|
|
|
47
58
|
await this.accountController.syncDatawallet();
|
|
48
59
|
return ts_utils_1.Result.ok(MessageMapper_1.MessageMapper.toMessageDTO(result));
|
|
49
60
|
}
|
|
61
|
+
async validateMessageContent(content, recipients) {
|
|
62
|
+
const transformedContent = ts_serval_1.Serializable.fromUnknown(content);
|
|
63
|
+
if (!(transformedContent instanceof content_1.Request))
|
|
64
|
+
return;
|
|
65
|
+
if (typeof transformedContent.id === "undefined") {
|
|
66
|
+
return common_1.RuntimeErrors.general.invalidPropertyValue("The Request must have an id.");
|
|
67
|
+
}
|
|
68
|
+
const localRequest = await this.outgoingRequestsController.getOutgoingRequest(transformedContent.id);
|
|
69
|
+
if (!localRequest)
|
|
70
|
+
return common_1.RuntimeErrors.general.recordNotFound(content_1.Request);
|
|
71
|
+
if (!lodash_1.default.isEqual(transformedContent.toJSON(), localRequest.content.toJSON())) {
|
|
72
|
+
return common_1.RuntimeErrors.general.invalidPropertyValue("The sent Request must have the same content as the LocalRequest.");
|
|
73
|
+
}
|
|
74
|
+
if (recipients.length > 1)
|
|
75
|
+
return common_1.RuntimeErrors.general.invalidPropertyValue("Only one recipient is allowed for sending Requests.");
|
|
76
|
+
const recipient = transport_1.CoreAddress.from(recipients[0]);
|
|
77
|
+
if (!recipient.equals(localRequest.peer))
|
|
78
|
+
return common_1.RuntimeErrors.general.invalidPropertyValue("The recipient does not match the Request's peer.");
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
50
81
|
async transformAttachments(attachmentsIds) {
|
|
51
82
|
if (!attachmentsIds || attachmentsIds.length === 0) {
|
|
52
83
|
return ts_utils_1.Result.ok([]);
|
|
@@ -68,9 +99,11 @@ exports.SendMessageUseCase = SendMessageUseCase = __decorate([
|
|
|
68
99
|
__param(1, typescript_ioc_1.Inject),
|
|
69
100
|
__param(2, typescript_ioc_1.Inject),
|
|
70
101
|
__param(3, typescript_ioc_1.Inject),
|
|
102
|
+
__param(4, typescript_ioc_1.Inject),
|
|
71
103
|
__metadata("design:paramtypes", [transport_1.MessageController,
|
|
72
104
|
transport_1.FileController,
|
|
73
105
|
transport_1.AccountController,
|
|
106
|
+
consumption_1.OutgoingRequestsController,
|
|
74
107
|
Validator])
|
|
75
108
|
], SendMessageUseCase);
|
|
76
109
|
//# sourceMappingURL=SendMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SendMessage.js","sourceRoot":"","sources":["../../../../src/useCases/transport/messages/SendMessage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SendMessage.js","sourceRoot":"","sources":["../../../../src/useCases/transport/messages/SendMessage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kDAAkD;AAClD,gDAA2C;AAC3C,oDAAgE;AAChE,4CAAyC;AACzC,gDAAmH;AACnH,oDAAuB;AACvB,mDAAwC;AAExC,yCAAsH;AACtH,mDAAgD;AAYhD,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,wBAAmC;IACvD,YAA2B,gBAAkC;QACzD,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAC5D,CAAC;CACJ,CAAA;AAJK,SAAS;IACS,WAAA,uBAAM,CAAA;qCAAmB,yBAAgB;GAD3D,SAAS,CAId;AAED,IAAa,kBAAkB,GAA/B,M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zB,CAAC;QAED,MAAM,KAAK,GAAW,EAAE,CAAC;QAEzB,KAAK,MAAM,YAAY,IAAI,cAAc,EAAE,CAAC;YACxC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,kBAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;YAE1E,IAAI,CAAC,IAAI,EAAE,CAAC;gBACR,OAAO,iBAAM,CAAC,IAAI,CAAC,sBAAa,CAAC,OAAO,CAAC,cAAc,CAAC,gBAAI,CAAC,CAAC,CAAC;YACnE,CAAC;YAED,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;QACD,OAAO,iBAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;CACJ,CAAA;AAxEY,gDAAkB;6BAAlB,kBAAkB;IAEtB,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;qCAJqC,6BAAiB;QACpB,0BAAc;QACX,6BAAiB;QACR,wCAA0B;QAC5D,SAAS;GANvB,kBAAkB,CAwE9B"}
|
|
@@ -6,6 +6,9 @@ import { RelationshipIdString, SchemaRepository, SchemaValidator, UseCase } from
|
|
|
6
6
|
export interface GetAttributesForRelationshipRequest {
|
|
7
7
|
id: RelationshipIdString;
|
|
8
8
|
hideTechnical?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* default: true
|
|
11
|
+
*/
|
|
9
12
|
onlyLatestVersions?: boolean;
|
|
10
13
|
}
|
|
11
14
|
export interface GetAttributesForRelationshipResponse extends Array<LocalAttributeDTO> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GetAttributesForRelationship.d.ts","sourceRoot":"","sources":["../../../../src/useCases/transport/relationships/GetAttributesForRelationship.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAwB,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAiB,gBAAgB,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG/G,MAAM,WAAW,mCAAmC;IAChD,EAAE,EAAE,oBAAoB,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,oCAAqC,SAAQ,KAAK,CAAC,iBAAiB,CAAC;CAAG;AAEzF,cAAM,SAAU,SAAQ,eAAe,CAAC,mCAAmC,CAAC;gBAC7C,gBAAgB,EAAE,gBAAgB;CAGhE;AAED,qBAAa,mCAAoC,SAAQ,OAAO,CAAC,mCAAmC,EAAE,oCAAoC,CAAC;IAE3H,OAAO,CAAC,QAAQ,CAAC,uBAAuB;IACxC,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBADpB,uBAAuB,EAAE,uBAAuB,EAChD,oBAAoB,EAAE,oBAAoB,EAC3D,SAAS,EAAE,SAAS;cAKhB,eAAe,CAAC,OAAO,EAAE,mCAAmC,GAAG,OAAO,CAAC,MAAM,CAAC,oCAAoC,CAAC,CAAC;CAmBvI"}
|
|
1
|
+
{"version":3,"file":"GetAttributesForRelationship.d.ts","sourceRoot":"","sources":["../../../../src/useCases/transport/relationships/GetAttributesForRelationship.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAwB,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAiB,gBAAgB,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG/G,MAAM,WAAW,mCAAmC;IAChD,EAAE,EAAE,oBAAoB,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,oCAAqC,SAAQ,KAAK,CAAC,iBAAiB,CAAC;CAAG;AAEzF,cAAM,SAAU,SAAQ,eAAe,CAAC,mCAAmC,CAAC;gBAC7C,gBAAgB,EAAE,gBAAgB;CAGhE;AAED,qBAAa,mCAAoC,SAAQ,OAAO,CAAC,mCAAmC,EAAE,oCAAoC,CAAC;IAE3H,OAAO,CAAC,QAAQ,CAAC,uBAAuB;IACxC,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBADpB,uBAAuB,EAAE,uBAAuB,EAChD,oBAAoB,EAAE,oBAAoB,EAC3D,SAAS,EAAE,SAAS;cAKhB,eAAe,CAAC,OAAO,EAAE,mCAAmC,GAAG,OAAO,CAAC,MAAM,CAAC,oCAAoC,CAAC,CAAC;CAmBvI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GetAttributesForRelationship.js","sourceRoot":"","sources":["../../../../src/useCases/transport/relationships/GetAttributesForRelationship.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAA0D;AAC1D,gDAAiF;AACjF,mDAAwC;AAExC,yCAA+G;AAC/G,mDAAoD;
|
|
1
|
+
{"version":3,"file":"GetAttributesForRelationship.js","sourceRoot":"","sources":["../../../../src/useCases/transport/relationships/GetAttributesForRelationship.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAA2C;AAC3C,oDAA0D;AAC1D,gDAAiF;AACjF,mDAAwC;AAExC,yCAA+G;AAC/G,mDAAoD;AAapD,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,wBAAoD;I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CACJ,CAAA;AA5BY,kFAAmC;8CAAnC,mCAAmC;IAEvC,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;IACN,WAAA,uBAAM,CAAA;qCAF2C,mCAAuB;QAC1B,kCAAoB;QAChD,SAAS;GAJvB,mCAAmC,CA4B/C"}
|
package/lib-web/nmshd.runtime.js
CHANGED
|
@@ -45718,11 +45718,11 @@ const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
|
|
|
45718
45718
|
const crypto_1 = __webpack_require__(/*! @nmshd/crypto */ "@nmshd/crypto");
|
|
45719
45719
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
45720
45720
|
exports.buildInformation = {
|
|
45721
|
-
version: "4.
|
|
45722
|
-
build: "
|
|
45723
|
-
date: "2024-
|
|
45724
|
-
commit: "
|
|
45725
|
-
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.9.5","@nmshd/content":"2.8.7","@nmshd/crypto":"2.0.6","@nmshd/transport":"2.3.
|
|
45721
|
+
version: "4.3.0",
|
|
45722
|
+
build: "37",
|
|
45723
|
+
date: "2024-03-05T07:33:44+00:00",
|
|
45724
|
+
commit: "4189c922aafef4f9530c86b5deeba13685d2e99b",
|
|
45725
|
+
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.9.5","@nmshd/content":"2.8.7","@nmshd/crypto":"2.0.6","@nmshd/transport":"2.3.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.2.1","ts-simple-nameof":"^1.3.1","typescript-ioc":"3.2.2"},
|
|
45726
45726
|
libraries: {
|
|
45727
45727
|
serval: ts_serval_1.buildInformation,
|
|
45728
45728
|
consumption: consumption_1.buildInformation,
|
|
@@ -68399,7 +68399,8 @@ exports.GetOwnSharedAttributesRequest = {
|
|
|
68399
68399
|
"type": "boolean"
|
|
68400
68400
|
},
|
|
68401
68401
|
"onlyLatestVersions": {
|
|
68402
|
-
"type": "boolean"
|
|
68402
|
+
"type": "boolean",
|
|
68403
|
+
"description": "default: true"
|
|
68403
68404
|
}
|
|
68404
68405
|
},
|
|
68405
68406
|
"required": [
|
|
@@ -68598,7 +68599,8 @@ exports.GetPeerSharedAttributesRequest = {
|
|
|
68598
68599
|
"type": "boolean"
|
|
68599
68600
|
},
|
|
68600
68601
|
"onlyLatestVersions": {
|
|
68601
|
-
"type": "boolean"
|
|
68602
|
+
"type": "boolean",
|
|
68603
|
+
"description": "default: true"
|
|
68602
68604
|
}
|
|
68603
68605
|
},
|
|
68604
68606
|
"required": [
|
|
@@ -68772,7 +68774,72 @@ exports.GetRepositoryAttributesRequest = {
|
|
|
68772
68774
|
"type": "object",
|
|
68773
68775
|
"properties": {
|
|
68774
68776
|
"onlyLatestVersions": {
|
|
68775
|
-
"type": "boolean"
|
|
68777
|
+
"type": "boolean",
|
|
68778
|
+
"description": "default: true"
|
|
68779
|
+
},
|
|
68780
|
+
"query": {
|
|
68781
|
+
"$ref": "#/definitions/GetRepositoryAttributesRequestQuery"
|
|
68782
|
+
}
|
|
68783
|
+
},
|
|
68784
|
+
"additionalProperties": false
|
|
68785
|
+
},
|
|
68786
|
+
"GetRepositoryAttributesRequestQuery": {
|
|
68787
|
+
"type": "object",
|
|
68788
|
+
"properties": {
|
|
68789
|
+
"createdAt": {
|
|
68790
|
+
"type": "string"
|
|
68791
|
+
},
|
|
68792
|
+
"content.tags": {
|
|
68793
|
+
"anyOf": [
|
|
68794
|
+
{
|
|
68795
|
+
"type": "string"
|
|
68796
|
+
},
|
|
68797
|
+
{
|
|
68798
|
+
"type": "array",
|
|
68799
|
+
"items": {
|
|
68800
|
+
"type": "string"
|
|
68801
|
+
}
|
|
68802
|
+
}
|
|
68803
|
+
]
|
|
68804
|
+
},
|
|
68805
|
+
"content.validFrom": {
|
|
68806
|
+
"anyOf": [
|
|
68807
|
+
{
|
|
68808
|
+
"type": "string"
|
|
68809
|
+
},
|
|
68810
|
+
{
|
|
68811
|
+
"type": "array",
|
|
68812
|
+
"items": {
|
|
68813
|
+
"type": "string"
|
|
68814
|
+
}
|
|
68815
|
+
}
|
|
68816
|
+
]
|
|
68817
|
+
},
|
|
68818
|
+
"content.validTo": {
|
|
68819
|
+
"anyOf": [
|
|
68820
|
+
{
|
|
68821
|
+
"type": "string"
|
|
68822
|
+
},
|
|
68823
|
+
{
|
|
68824
|
+
"type": "array",
|
|
68825
|
+
"items": {
|
|
68826
|
+
"type": "string"
|
|
68827
|
+
}
|
|
68828
|
+
}
|
|
68829
|
+
]
|
|
68830
|
+
},
|
|
68831
|
+
"content.value.@type": {
|
|
68832
|
+
"anyOf": [
|
|
68833
|
+
{
|
|
68834
|
+
"type": "string"
|
|
68835
|
+
},
|
|
68836
|
+
{
|
|
68837
|
+
"type": "array",
|
|
68838
|
+
"items": {
|
|
68839
|
+
"type": "string"
|
|
68840
|
+
}
|
|
68841
|
+
}
|
|
68842
|
+
]
|
|
68776
68843
|
}
|
|
68777
68844
|
},
|
|
68778
68845
|
"additionalProperties": false
|
|
@@ -68796,7 +68863,8 @@ exports.GetSharedVersionsOfRepositoryAttributeRequest = {
|
|
|
68796
68863
|
}
|
|
68797
68864
|
},
|
|
68798
68865
|
"onlyLatestVersions": {
|
|
68799
|
-
"type": "boolean"
|
|
68866
|
+
"type": "boolean",
|
|
68867
|
+
"description": "default: true"
|
|
68800
68868
|
}
|
|
68801
68869
|
},
|
|
68802
68870
|
"required": [
|
|
@@ -72822,7 +72890,8 @@ exports.GetAttributesForRelationshipRequest = {
|
|
|
72822
72890
|
"type": "boolean"
|
|
72823
72891
|
},
|
|
72824
72892
|
"onlyLatestVersions": {
|
|
72825
|
-
"type": "boolean"
|
|
72893
|
+
"type": "boolean",
|
|
72894
|
+
"description": "default: true"
|
|
72826
72895
|
}
|
|
72827
72896
|
},
|
|
72828
72897
|
"required": [
|
|
@@ -74886,13 +74955,14 @@ let GetRepositoryAttributesUseCase = class GetRepositoryAttributesUseCase extend
|
|
|
74886
74955
|
this.attributesController = attributesController;
|
|
74887
74956
|
}
|
|
74888
74957
|
async executeInternal(request) {
|
|
74889
|
-
const query = {
|
|
74890
|
-
|
|
74891
|
-
|
|
74958
|
+
const query = request.query ?? {};
|
|
74959
|
+
const flattenedQuery = (0, common_1.flattenObject)(query);
|
|
74960
|
+
const dbQuery = __1.GetAttributesUseCase.queryTranslator.parse(flattenedQuery);
|
|
74961
|
+
dbQuery.shareInfo = { $exists: false };
|
|
74892
74962
|
if (typeof request.onlyLatestVersions === "undefined" || request.onlyLatestVersions) {
|
|
74893
|
-
|
|
74963
|
+
dbQuery["succeededBy"] = { $exists: false };
|
|
74894
74964
|
}
|
|
74895
|
-
const attributes = await this.attributesController.getLocalAttributes(
|
|
74965
|
+
const attributes = await this.attributesController.getLocalAttributes(dbQuery);
|
|
74896
74966
|
return ts_utils_1.Result.ok(__1.AttributeMapper.toAttributeDTOList(attributes));
|
|
74897
74967
|
}
|
|
74898
74968
|
};
|
|
@@ -81010,10 +81080,17 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
81010
81080
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
81011
81081
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
81012
81082
|
};
|
|
81083
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
81084
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
81085
|
+
};
|
|
81013
81086
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
81014
81087
|
exports.SendMessageUseCase = void 0;
|
|
81088
|
+
const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
|
|
81015
81089
|
const ts_utils_1 = __webpack_require__(/*! @js-soft/ts-utils */ "../../node_modules/@js-soft/ts-utils/dist/index.js");
|
|
81090
|
+
const consumption_1 = __webpack_require__(/*! @nmshd/consumption */ "@nmshd/consumption");
|
|
81091
|
+
const content_1 = __webpack_require__(/*! @nmshd/content */ "@nmshd/content");
|
|
81016
81092
|
const transport_1 = __webpack_require__(/*! @nmshd/transport */ "@nmshd/transport");
|
|
81093
|
+
const lodash_1 = __importDefault(__webpack_require__(/*! lodash */ "../../node_modules/lodash/lodash.js"));
|
|
81017
81094
|
const typescript_ioc_1 = __webpack_require__(/*! typescript-ioc */ "../../node_modules/typescript-ioc/dist/typescript-ioc.js");
|
|
81018
81095
|
const common_1 = __webpack_require__(/*! ../../common */ "./dist/useCases/common/index.js");
|
|
81019
81096
|
const MessageMapper_1 = __webpack_require__(/*! ./MessageMapper */ "./dist/useCases/transport/messages/MessageMapper.js");
|
|
@@ -81027,13 +81104,17 @@ Validator = __decorate([
|
|
|
81027
81104
|
__metadata("design:paramtypes", [common_1.SchemaRepository])
|
|
81028
81105
|
], Validator);
|
|
81029
81106
|
let SendMessageUseCase = class SendMessageUseCase extends common_1.UseCase {
|
|
81030
|
-
constructor(messageController, fileController, accountController, validator) {
|
|
81107
|
+
constructor(messageController, fileController, accountController, outgoingRequestsController, validator) {
|
|
81031
81108
|
super(validator);
|
|
81032
81109
|
this.messageController = messageController;
|
|
81033
81110
|
this.fileController = fileController;
|
|
81034
81111
|
this.accountController = accountController;
|
|
81112
|
+
this.outgoingRequestsController = outgoingRequestsController;
|
|
81035
81113
|
}
|
|
81036
81114
|
async executeInternal(request) {
|
|
81115
|
+
const validationError = await this.validateMessageContent(request.content, request.recipients);
|
|
81116
|
+
if (validationError)
|
|
81117
|
+
return ts_utils_1.Result.fail(validationError);
|
|
81037
81118
|
const transformAttachmentsResult = await this.transformAttachments(request.attachments);
|
|
81038
81119
|
if (transformAttachmentsResult.isError) {
|
|
81039
81120
|
return ts_utils_1.Result.fail(transformAttachmentsResult.error);
|
|
@@ -81046,6 +81127,26 @@ let SendMessageUseCase = class SendMessageUseCase extends common_1.UseCase {
|
|
|
81046
81127
|
await this.accountController.syncDatawallet();
|
|
81047
81128
|
return ts_utils_1.Result.ok(MessageMapper_1.MessageMapper.toMessageDTO(result));
|
|
81048
81129
|
}
|
|
81130
|
+
async validateMessageContent(content, recipients) {
|
|
81131
|
+
const transformedContent = ts_serval_1.Serializable.fromUnknown(content);
|
|
81132
|
+
if (!(transformedContent instanceof content_1.Request))
|
|
81133
|
+
return;
|
|
81134
|
+
if (typeof transformedContent.id === "undefined") {
|
|
81135
|
+
return common_1.RuntimeErrors.general.invalidPropertyValue("The Request must have an id.");
|
|
81136
|
+
}
|
|
81137
|
+
const localRequest = await this.outgoingRequestsController.getOutgoingRequest(transformedContent.id);
|
|
81138
|
+
if (!localRequest)
|
|
81139
|
+
return common_1.RuntimeErrors.general.recordNotFound(content_1.Request);
|
|
81140
|
+
if (!lodash_1.default.isEqual(transformedContent.toJSON(), localRequest.content.toJSON())) {
|
|
81141
|
+
return common_1.RuntimeErrors.general.invalidPropertyValue("The sent Request must have the same content as the LocalRequest.");
|
|
81142
|
+
}
|
|
81143
|
+
if (recipients.length > 1)
|
|
81144
|
+
return common_1.RuntimeErrors.general.invalidPropertyValue("Only one recipient is allowed for sending Requests.");
|
|
81145
|
+
const recipient = transport_1.CoreAddress.from(recipients[0]);
|
|
81146
|
+
if (!recipient.equals(localRequest.peer))
|
|
81147
|
+
return common_1.RuntimeErrors.general.invalidPropertyValue("The recipient does not match the Request's peer.");
|
|
81148
|
+
return;
|
|
81149
|
+
}
|
|
81049
81150
|
async transformAttachments(attachmentsIds) {
|
|
81050
81151
|
if (!attachmentsIds || attachmentsIds.length === 0) {
|
|
81051
81152
|
return ts_utils_1.Result.ok([]);
|
|
@@ -81067,9 +81168,11 @@ exports.SendMessageUseCase = SendMessageUseCase = __decorate([
|
|
|
81067
81168
|
__param(1, typescript_ioc_1.Inject),
|
|
81068
81169
|
__param(2, typescript_ioc_1.Inject),
|
|
81069
81170
|
__param(3, typescript_ioc_1.Inject),
|
|
81171
|
+
__param(4, typescript_ioc_1.Inject),
|
|
81070
81172
|
__metadata("design:paramtypes", [transport_1.MessageController,
|
|
81071
81173
|
transport_1.FileController,
|
|
81072
81174
|
transport_1.AccountController,
|
|
81175
|
+
consumption_1.OutgoingRequestsController,
|
|
81073
81176
|
Validator])
|
|
81074
81177
|
], SendMessageUseCase);
|
|
81075
81178
|
//# sourceMappingURL=SendMessage.js.map
|