Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
190 changes: 95 additions & 95 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"test:teardown": "docker compose -f .dev/compose.yml down -fsv"
},
"devDependencies": {
"@js-soft/eslint-config-ts": "^2.0.5",
"@js-soft/eslint-config-ts": "^2.0.6",
"@js-soft/license-check": "^1.0.10",
"@types/jest": "^30.0.0",
"@types/node": "^24.12.4",
Expand Down
5 changes: 1 addition & 4 deletions packages/app-runtime/src/AppRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { IUIBridge } from "./extensibility";
import { IAppLanguageProvider, INotificationAccess } from "./infrastructure";
import {
AppLanguageModule,
AppRuntimeModuleConfiguration,
AppSyncModule,
IAppRuntimeModuleConstructor,
IdentityDeletionProcessStatusChangedModule,
Expand Down Expand Up @@ -246,9 +245,7 @@ export class AppRuntime extends Runtime<AppConfig> {
return Promise.reject(error);
}

const connectorModuleConfiguration = moduleConfiguration as AppRuntimeModuleConfiguration;

const module = new moduleConstructor(this, connectorModuleConfiguration, this.loggerFactory.getLogger(moduleConstructor));
const module = new moduleConstructor(this, moduleConfiguration, this.loggerFactory.getLogger(moduleConstructor));

this.modules.add(module);

Expand Down
2 changes: 1 addition & 1 deletion packages/app-runtime/test/modules/AppLanguage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("AppLanguageModuleTest", function () {
afterEach(() => eventBus.reset());

test("should persist the app language via an AppLanguageChangedEvent", async function () {
runtime.eventBus.publish(new AppLanguageChangedEvent("de" as any));
runtime.eventBus.publish(new AppLanguageChangedEvent("de"));
await eventBus.waitForRunningEventHandlers();
let device = await devicesClient.getCurrentDevice();
expect(device.value.communicationLanguage).toBe(LanguageISO639.de);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ export class AttributesController extends ConsumptionBaseController {
private trimAttribute(attribute: IdentityAttribute): IdentityAttribute {
const trimmedAttribute = {
...attribute.toJSON(),
value: this.trimAttributeValue(attribute.value.toJSON() as AttributeValues.Identity.Json)
value: this.trimAttributeValue(attribute.value.toJSON())
};
return IdentityAttribute.from(trimmedAttribute);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { TransportLoggerFactory } from "@nmshd/transport";
import {
AcceptReadAttributeRequestItemParametersWithNewAttributeJSON,
ConsumptionIds,
DecideRequestItemGroupParametersJSON,
DecideRequestParametersJSON,
IncomingRequestReceivedEvent,
IncomingRequestStatusChangedEvent,
Expand Down Expand Up @@ -163,7 +162,7 @@ describe("IncomingRequestsController", function () {
shouldFailAtCheckPrerequisitesOfIncomingRequestItem: true
} as ITestRequestItem
]
} as IRequest
}
},
{
content: {
Expand All @@ -178,7 +177,7 @@ describe("IncomingRequestsController", function () {
shouldFailAtCheckPrerequisitesOfIncomingRequestItem: true
} as ITestRequestItem
]
} as IRequest
}
},
{
content: {
Expand All @@ -194,7 +193,7 @@ describe("IncomingRequestsController", function () {
]
} as IRequestItemGroup
]
} as IRequest
}
}
])("does not change the status when a RequestItemProcessor returns false", async function (testParams) {
await Given.anIncomingRequestWith({
Expand Down Expand Up @@ -271,14 +270,14 @@ describe("IncomingRequestsController", function () {
shouldFailAtCanAccept: true
} as ITestRequestItem
]
} as IRequest,
},
acceptParams: {
items: [
{
accept: true
}
]
} as Omit<DecideRequestParametersJSON, "requestId">
}
},

{
Expand All @@ -294,7 +293,7 @@ describe("IncomingRequestsController", function () {
shouldFailAtCanAccept: true
} as ITestRequestItem
]
} as IRequest,
},
acceptParams: {
items: [
{
Expand All @@ -304,7 +303,7 @@ describe("IncomingRequestsController", function () {
accept: true
}
]
} as Omit<DecideRequestParametersJSON, "requestId">
}
},

{
Expand All @@ -321,7 +320,7 @@ describe("IncomingRequestsController", function () {
]
} as IRequestItemGroup
]
} as IRequest,
},
acceptParams: {
items: [
{
Expand All @@ -330,9 +329,9 @@ describe("IncomingRequestsController", function () {
accept: true
}
]
} as DecideRequestItemGroupParametersJSON
}
]
} as Omit<DecideRequestParametersJSON, "requestId">
}
}
])("returns 'error' when at least one RequestItem is invalid", async function (testParams) {
await Given.anIncomingRequestWith({
Expand Down Expand Up @@ -715,14 +714,14 @@ describe("IncomingRequestsController", function () {
shouldFailAtCanReject: true
} as ITestRequestItem
]
} as IRequest,
},
rejectParams: {
items: [
{
accept: false
}
]
} as Omit<DecideRequestParametersJSON, "requestId">
}
},

{
Expand All @@ -738,7 +737,7 @@ describe("IncomingRequestsController", function () {
shouldFailAtCanReject: true
} as ITestRequestItem
]
} as IRequest,
},
rejectParams: {
items: [
{
Expand All @@ -748,7 +747,7 @@ describe("IncomingRequestsController", function () {
accept: false
}
]
} as Omit<DecideRequestParametersJSON, "requestId">
}
},

{
Expand All @@ -765,7 +764,7 @@ describe("IncomingRequestsController", function () {
]
} as IRequestItemGroup
]
} as IRequest,
},
rejectParams: {
items: [
{
Expand All @@ -776,7 +775,7 @@ describe("IncomingRequestsController", function () {
]
}
]
} as Omit<DecideRequestParametersJSON, "requestId">
}
}
])("returns 'error' when at least one RequestItem is invalid", async function (testParams) {
await Given.anIncomingRequestWith({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { ApplicationError, sleep } from "@js-soft/ts-utils";
import {
CreateAttributeRequestItem,
IAcceptResponseItem,
IRequest,
IRequestItemGroup,
IResponse,
IResponseItemGroup,
Expand Down Expand Up @@ -106,7 +105,7 @@ describe("OutgoingRequestsController", function () {
shouldFailAtCanCreateOutgoingRequestItem: true
} as ITestRequestItem
]
} as IRequest,
},
{
items: [
{
Expand All @@ -119,7 +118,7 @@ describe("OutgoingRequestsController", function () {
shouldFailAtCanCreateOutgoingRequestItem: true
} as ITestRequestItem
]
} as IRequest,
},
{
items: [
{
Expand All @@ -133,7 +132,7 @@ describe("OutgoingRequestsController", function () {
]
} as IRequestItemGroup
]
} as IRequest
}
])("returns 'error' when at least one RequestItem is invalid", async function (request: IRequestWithoutId) {
await When.iCallCanCreateForAnOutgoingRequest({
content: request
Expand Down Expand Up @@ -263,8 +262,7 @@ describe("OutgoingRequestsController", function () {
value: ProprietaryString.from({ title: "aTitle", value: "aStringValue" }).toJSON()
})
}),
{
"@type": "RequestItemGroup",
RequestItemGroup.from({
items: [
ProposeAttributeRequestItem.from({
mustBeAccepted: true,
Expand All @@ -286,7 +284,7 @@ describe("OutgoingRequestsController", function () {
})
})
]
} as IRequestItemGroup
})
]
},
peer: "did:e:a-domain:dids:anidentity"
Expand Down Expand Up @@ -587,7 +585,7 @@ describe("OutgoingRequestsController", function () {
mustBeAccepted: false
} as ITestRequestItem
]
} as IRequest,
},
response: {
result: ResponseResult.Accepted,
items: [
Expand All @@ -612,7 +610,7 @@ describe("OutgoingRequestsController", function () {
mustBeAccepted: false
} as ITestRequestItem
]
} as IRequest,
},
response: {
result: ResponseResult.Accepted,
items: [
Expand Down Expand Up @@ -646,7 +644,7 @@ describe("OutgoingRequestsController", function () {
]
} as IRequestItemGroup
]
} as IRequest,
},
response: {
result: ResponseResult.Accepted,
items: [
Expand Down Expand Up @@ -690,7 +688,7 @@ describe("OutgoingRequestsController", function () {
shouldFailAtCanApplyIncomingResponseItem: true
} as ITestRequestItem
]
} as IRequest,
},
response: {
result: ResponseResult.Accepted,
items: [
Expand All @@ -716,7 +714,7 @@ describe("OutgoingRequestsController", function () {
]
} as IRequestItemGroup
]
} as IRequest,
},
response: {
result: ResponseResult.Accepted,
items: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ export class RequestsWhen {

public iTryToCheckPrerequisitesWith(params: Partial<ICheckPrerequisitesOfIncomingRequestParameters>): Promise<void> {
this.context.actionToTry = async () => {
await this.iCheckPrerequisitesWith(params as ICheckPrerequisitesOfIncomingRequestParameters);
await this.iCheckPrerequisitesWith(params);
};
return Promise.resolve();
}
Expand Down Expand Up @@ -955,7 +955,7 @@ export class RequestsWhen {
};

this.context.actionToTry = async () => {
await this.context.outgoingRequestsController.create(params as any);
await this.context.outgoingRequestsController.create(params);
};

return Promise.resolve();
Expand Down Expand Up @@ -991,7 +991,7 @@ export class RequestsWhen {
};

this.context.actionToTry = async () => {
await this.context.outgoingRequestsController.create(params as any);
await this.context.outgoingRequestsController.create(params);
};

return Promise.resolve();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,13 +506,12 @@ export class TestObjectFactory {
result: ResponseResult.Accepted,
items: [
{
// @ts-expect-error
"@type": "AcceptResponseItem",
result: ResponseItemResult.Accepted
}
],
requestId: CoreId.from(requestId)
} as IResponse);
});
}

public static createOutgoingMessage(sender: CoreAddress): Message {
Expand Down
22 changes: 9 additions & 13 deletions packages/content/test/requests/Request.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { Serializable, type } from "@js-soft/ts-serval";
import { CoreDate, CoreId } from "@nmshd/core-types";
import { IRequest, IRequestItem, IRequestItemGroup, Request, RequestItem, RequestItemGroup, RequestItemGroupJSON, RequestItemJSON, RequestJSON } from "../../src";

interface TestRequestItemJSON extends RequestItemJSON {
"@type": "TestRequestItem";
}
import { IRequest, IRequestItem, IRequestItemGroup, Request, RequestItem, RequestItemGroup, RequestJSON } from "../../src";

interface ITestRequestItem extends IRequestItem {}

Expand All @@ -20,18 +16,18 @@ describe("Request", function () {
{
"@type": "TestRequestItem",
mustBeAccepted: true
} as TestRequestItemJSON,
},
{
"@type": "RequestItemGroup",
items: [
{
"@type": "TestRequestItem",
mustBeAccepted: true
} as TestRequestItemJSON
}
]
} as RequestItemGroupJSON
}
]
} as RequestJSON;
};

const request = Request.from(requestJSON);

Expand Down Expand Up @@ -95,7 +91,7 @@ describe("Request", function () {
metadata: {
aMetadataKey: "outer item - metadata value"
}
} as TestRequestItemJSON,
},
{
"@type": "RequestItemGroup",
title: "item group - title",
Expand All @@ -111,9 +107,9 @@ describe("Request", function () {
metadata: {
aMetadataKey: "inner item - metadata value"
}
} as TestRequestItemJSON
}
]
} as RequestItemGroupJSON
}
]
} as RequestJSON;

Expand Down Expand Up @@ -145,7 +141,7 @@ describe("Request", function () {
{
"@type": "RequestItemGroup",
items: []
} as RequestItemGroupJSON
}
]
} as RequestJSON;

Expand Down
Loading