Родитель
17847391f9
Коммит
308d0cade8
|
@ -31,7 +31,7 @@
|
|||
"integration-test:node": "npm run build:test:node && nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 180000 --full-trace \"dist-esm/test/*.spec.js\" \"dist-esm/test/**/*.spec.js\" --harmony",
|
||||
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
|
||||
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
|
||||
"lint": "eslint package.json api-extractor.json src test --ext .ts -f html -o digital-twins-lintReport.html || exit 0",
|
||||
"lint": "eslint package.json api-extractor.json src test --ext .ts",
|
||||
"pack": "npm pack 2>&1",
|
||||
"prebuild": "npm run clean",
|
||||
"test:node": "npm run clean && npm run build:test:node && npm run unit-test:node",
|
||||
|
|
|
@ -196,6 +196,7 @@ export class DigitalTwinsClient {
|
|||
*/
|
||||
public updateDigitalTwin(
|
||||
digitalTwinId: string,
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -- changing the type any would be a breaking change
|
||||
jsonPatch: any,
|
||||
options: DigitalTwinsUpdateOptionalParams = {}
|
||||
): Promise<DigitalTwinsUpdateResponse> {
|
||||
|
@ -345,6 +346,7 @@ export class DigitalTwinsClient {
|
|||
public upsertRelationship(
|
||||
digitalTwinId: string,
|
||||
relationshipId: string,
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -- changing the type any would be a breaking change
|
||||
relationship: any,
|
||||
options: DigitalTwinsAddRelationshipOptionalParams = {}
|
||||
): Promise<DigitalTwinsAddRelationshipResponse> {
|
||||
|
@ -621,6 +623,7 @@ export class DigitalTwinsClient {
|
|||
*/
|
||||
public publishTelemetry(
|
||||
digitalTwinId: string,
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -- changing the type any would be a breaking change
|
||||
payload: any,
|
||||
messageId: string,
|
||||
options: OperationOptions = {}
|
||||
|
|
|
@ -71,7 +71,7 @@ describe("DigitalTwins Components - read, update and delete operations", () => {
|
|||
let client: DigitalTwinsClient;
|
||||
let recorder: Recorder;
|
||||
|
||||
beforeEach(async function() {
|
||||
beforeEach(async function(this: Mocha.Context) {
|
||||
const authentication = await authenticate(this);
|
||||
client = authentication.client;
|
||||
recorder = authentication.recorder;
|
||||
|
@ -84,11 +84,15 @@ describe("DigitalTwins Components - read, update and delete operations", () => {
|
|||
async function deleteModels(): Promise<void> {
|
||||
try {
|
||||
await client.deleteModel(MODEL_ID);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteModel failed during test setup or cleanup");
|
||||
}
|
||||
|
||||
try {
|
||||
await client.deleteModel(COMPONENT_ID);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteModel failed during test setup or cleanup");
|
||||
}
|
||||
}
|
||||
|
||||
async function createModel(): Promise<void> {
|
||||
|
@ -104,7 +108,9 @@ describe("DigitalTwins Components - read, update and delete operations", () => {
|
|||
async function deleteDigitalTwin(digitalTwinId: string): Promise<void> {
|
||||
try {
|
||||
await client.deleteDigitalTwin(digitalTwinId);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteDigitalTwin failure during test setup or cleanup");
|
||||
}
|
||||
}
|
||||
|
||||
async function createDigitalTwin(digitalTwinId: string): Promise<void> {
|
||||
|
|
|
@ -39,7 +39,7 @@ describe("DigitalTwins - create, read, update, delete and telemetry operations",
|
|||
let client: DigitalTwinsClient;
|
||||
let recorder: Recorder;
|
||||
|
||||
beforeEach(async function() {
|
||||
beforeEach(async function(this: Mocha.Context) {
|
||||
const authentication = await authenticate(this);
|
||||
client = authentication.client;
|
||||
recorder = authentication.recorder;
|
||||
|
@ -52,7 +52,9 @@ describe("DigitalTwins - create, read, update, delete and telemetry operations",
|
|||
async function deleteModels(): Promise<void> {
|
||||
try {
|
||||
await client.deleteModel(BUILDING_MODEL_ID);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteModel failure during test setup or cleanup");
|
||||
}
|
||||
}
|
||||
|
||||
async function createModel(): Promise<void> {
|
||||
|
@ -68,7 +70,9 @@ describe("DigitalTwins - create, read, update, delete and telemetry operations",
|
|||
async function deleteDigitalTwin(digitalTwinId: string): Promise<void> {
|
||||
try {
|
||||
await client.deleteDigitalTwin(digitalTwinId);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteDigitalTwin failure during test setup or cleanup");
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteDigitalTwins(): Promise<void> {
|
||||
|
@ -77,7 +81,9 @@ describe("DigitalTwins - create, read, update, delete and telemetry operations",
|
|||
for await (const item of queryResult) {
|
||||
await client.deleteDigitalTwin(item.$dtId);
|
||||
}
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteDigitalTwin failure during test setup or cleanup");
|
||||
}
|
||||
}
|
||||
|
||||
it("create a simple digital twin", async function() {
|
||||
|
@ -891,6 +897,7 @@ describe("DigitalTwins - create, read, update, delete and telemetry operations",
|
|||
const query = "foo";
|
||||
const queryResult = client.queryTwins(query);
|
||||
for await (const _ of queryResult) {
|
||||
/* ignored */
|
||||
}
|
||||
} catch (error) {
|
||||
errorWasThrown = true;
|
||||
|
|
|
@ -13,7 +13,7 @@ describe("DigitalTwins EventRoutes - create, read, list and delete operations",
|
|||
let client: DigitalTwinsClient;
|
||||
let recorder: Recorder;
|
||||
|
||||
beforeEach(async function() {
|
||||
beforeEach(async function(this: Mocha.Context) {
|
||||
const authentication = await authenticate(this);
|
||||
client = authentication.client;
|
||||
recorder = authentication.recorder;
|
||||
|
|
|
@ -60,7 +60,7 @@ describe("DigitalTwins Models - create, read, list, delete operations", () => {
|
|||
let client: DigitalTwinsClient;
|
||||
let recorder: Recorder;
|
||||
|
||||
beforeEach(async function() {
|
||||
beforeEach(async function(this: Mocha.Context) {
|
||||
const authentication = await authenticate(this);
|
||||
client = authentication.client;
|
||||
recorder = authentication.recorder;
|
||||
|
@ -73,11 +73,15 @@ describe("DigitalTwins Models - create, read, list, delete operations", () => {
|
|||
async function deleteModels(): Promise<void> {
|
||||
try {
|
||||
await client.deleteModel(MODEL_ID);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteModel failure during test setup or cleanup");
|
||||
}
|
||||
|
||||
try {
|
||||
await client.deleteModel(COMPONENT_ID);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteModel failure during test setup or cleanup");
|
||||
}
|
||||
}
|
||||
|
||||
async function createModel(): Promise<void> {
|
||||
|
|
|
@ -84,7 +84,7 @@ describe("DigitalTwins Relationships - create, read, list, delete operations", (
|
|||
let client: DigitalTwinsClient;
|
||||
let recorder: Recorder;
|
||||
|
||||
beforeEach(async function() {
|
||||
beforeEach(async function(this: Mocha.Context) {
|
||||
const authentication = await authenticate(this);
|
||||
client = authentication.client;
|
||||
recorder = authentication.recorder;
|
||||
|
@ -97,15 +97,21 @@ describe("DigitalTwins Relationships - create, read, list, delete operations", (
|
|||
async function deleteModels(): Promise<void> {
|
||||
try {
|
||||
await client.deleteModel(BUILDING_MODEL_ID);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteModel failure during test setup or cleanup");
|
||||
}
|
||||
|
||||
try {
|
||||
await client.deleteModel(FLOOR_MODEL_ID);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteModel failure during test setup or cleanup");
|
||||
}
|
||||
|
||||
try {
|
||||
await client.deleteModel(ROOM_MODEL_ID);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteModel failure during test setup or cleanup");
|
||||
}
|
||||
}
|
||||
|
||||
async function createModel(): Promise<void> {
|
||||
|
@ -121,13 +127,19 @@ describe("DigitalTwins Relationships - create, read, list, delete operations", (
|
|||
async function deleteDigitalTwins(): Promise<void> {
|
||||
try {
|
||||
await client.deleteDigitalTwin(BUILDING_DIGITAL_TWIN_ID);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteDigitalTwin failure during test setup or cleanup");
|
||||
}
|
||||
try {
|
||||
await client.deleteDigitalTwin(FLOOR_DIGITAL_TWIN_ID);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteDigitalTwin failure during test setup or cleanup");
|
||||
}
|
||||
try {
|
||||
await client.deleteDigitalTwin(ROOM_DIGITAL_TWIN_ID);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteDigitalTwin failure during test setup or cleanup");
|
||||
}
|
||||
}
|
||||
|
||||
async function createDigitalTwins(): Promise<void> {
|
||||
|
@ -202,7 +214,9 @@ describe("DigitalTwins Relationships - create, read, list, delete operations", (
|
|||
} finally {
|
||||
try {
|
||||
await client.deleteRelationship(FLOOR_DIGITAL_TWIN_ID, relationshipId);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteRelationship failure during test setup or cleanup");
|
||||
}
|
||||
await deleteDigitalTwins();
|
||||
await deleteModels();
|
||||
}
|
||||
|
@ -229,7 +243,9 @@ describe("DigitalTwins Relationships - create, read, list, delete operations", (
|
|||
} finally {
|
||||
try {
|
||||
await client.deleteRelationship(FLOOR_DIGITAL_TWIN_ID, relationshipId);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteRelationship failure during test setup or cleanup");
|
||||
}
|
||||
await deleteDigitalTwins();
|
||||
await deleteModels();
|
||||
}
|
||||
|
@ -257,7 +273,9 @@ describe("DigitalTwins Relationships - create, read, list, delete operations", (
|
|||
} finally {
|
||||
try {
|
||||
await client.deleteRelationship(FLOOR_DIGITAL_TWIN_ID, relationshipId);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteRelationship failure during test setup or cleanup");
|
||||
}
|
||||
await deleteDigitalTwins();
|
||||
await deleteModels();
|
||||
}
|
||||
|
@ -321,7 +339,9 @@ describe("DigitalTwins Relationships - create, read, list, delete operations", (
|
|||
} finally {
|
||||
try {
|
||||
await client.deleteRelationship(FLOOR_DIGITAL_TWIN_ID, relationshipId);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteRelationship failure during test setup or cleanup");
|
||||
}
|
||||
await deleteDigitalTwins();
|
||||
await deleteModels();
|
||||
}
|
||||
|
@ -404,7 +424,9 @@ describe("DigitalTwins Relationships - create, read, list, delete operations", (
|
|||
} finally {
|
||||
try {
|
||||
await client.deleteRelationship(BUILDING_DIGITAL_TWIN_ID, relationshipId);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteRelationship failure during test setup or cleanup");
|
||||
}
|
||||
await deleteDigitalTwins();
|
||||
await deleteModels();
|
||||
}
|
||||
|
@ -486,7 +508,9 @@ describe("DigitalTwins Relationships - create, read, list, delete operations", (
|
|||
} finally {
|
||||
try {
|
||||
await client.deleteRelationship(BUILDING_DIGITAL_TWIN_ID, relationshipId);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteRelationship failure during test setup or cleanup");
|
||||
}
|
||||
await deleteDigitalTwins();
|
||||
await deleteModels();
|
||||
}
|
||||
|
@ -511,7 +535,9 @@ describe("DigitalTwins Relationships - create, read, list, delete operations", (
|
|||
} finally {
|
||||
try {
|
||||
await client.deleteRelationship(BUILDING_DIGITAL_TWIN_ID, relationshipId);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteRelationship failure during test setup or cleanup");
|
||||
}
|
||||
await deleteDigitalTwins();
|
||||
await deleteModels();
|
||||
}
|
||||
|
@ -576,7 +602,9 @@ describe("DigitalTwins Relationships - create, read, list, delete operations", (
|
|||
} finally {
|
||||
try {
|
||||
await client.deleteRelationship(BUILDING_DIGITAL_TWIN_ID, relationshipId);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteRelationship failure during test setup or cleanup");
|
||||
}
|
||||
await deleteDigitalTwins();
|
||||
await deleteModels();
|
||||
}
|
||||
|
@ -601,7 +629,9 @@ describe("DigitalTwins Relationships - create, read, list, delete operations", (
|
|||
} finally {
|
||||
try {
|
||||
await client.deleteRelationship(BUILDING_DIGITAL_TWIN_ID, relationshipId);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteRelationship failure during test setup or cleanup");
|
||||
}
|
||||
await deleteDigitalTwins();
|
||||
await deleteModels();
|
||||
}
|
||||
|
@ -685,7 +715,9 @@ describe("DigitalTwins Relationships - create, read, list, delete operations", (
|
|||
} finally {
|
||||
try {
|
||||
await client.deleteRelationship(BUILDING_DIGITAL_TWIN_ID, relationshipId);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteRelationship failure during test setup or cleanup");
|
||||
}
|
||||
await deleteDigitalTwins();
|
||||
await deleteModels();
|
||||
}
|
||||
|
@ -767,7 +799,9 @@ describe("DigitalTwins Relationships - create, read, list, delete operations", (
|
|||
} finally {
|
||||
try {
|
||||
await client.deleteRelationship(BUILDING_DIGITAL_TWIN_ID, relationshipId);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteRelationship failure during test setup or cleanup");
|
||||
}
|
||||
await deleteDigitalTwins();
|
||||
await deleteModels();
|
||||
}
|
||||
|
@ -859,7 +893,9 @@ describe("DigitalTwins Relationships - create, read, list, delete operations", (
|
|||
} finally {
|
||||
try {
|
||||
await client.deleteRelationship(BUILDING_DIGITAL_TWIN_ID, relationshipId);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteRelationship failure during test setup or cleanup");
|
||||
}
|
||||
await deleteDigitalTwins();
|
||||
await deleteModels();
|
||||
}
|
||||
|
@ -946,7 +982,9 @@ describe("DigitalTwins Relationships - create, read, list, delete operations", (
|
|||
} finally {
|
||||
try {
|
||||
await client.deleteRelationship(BUILDING_DIGITAL_TWIN_ID, relationshipId);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteRelationship failure during test setup or cleanup");
|
||||
}
|
||||
await deleteDigitalTwins();
|
||||
await deleteModels();
|
||||
}
|
||||
|
@ -1055,7 +1093,9 @@ describe("DigitalTwins Relationships - create, read, list, delete operations", (
|
|||
} finally {
|
||||
try {
|
||||
await client.deleteRelationship(BUILDING_DIGITAL_TWIN_ID, relationshipId);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteRelationship failure during test setup or cleanup");
|
||||
}
|
||||
await deleteDigitalTwins();
|
||||
await deleteModels();
|
||||
}
|
||||
|
@ -1142,7 +1182,9 @@ describe("DigitalTwins Relationships - create, read, list, delete operations", (
|
|||
} finally {
|
||||
try {
|
||||
await client.deleteRelationship(BUILDING_DIGITAL_TWIN_ID, relationshipId);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteRelationship failure during test setup or cleanup");
|
||||
}
|
||||
await deleteDigitalTwins();
|
||||
await deleteModels();
|
||||
}
|
||||
|
@ -1171,7 +1213,9 @@ describe("DigitalTwins Relationships - create, read, list, delete operations", (
|
|||
} finally {
|
||||
try {
|
||||
await client.deleteRelationship(BUILDING_DIGITAL_TWIN_ID, relationshipId);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteRelationship failure during test setup or cleanup");
|
||||
}
|
||||
await deleteDigitalTwins();
|
||||
await deleteModels();
|
||||
}
|
||||
|
@ -1230,7 +1274,9 @@ describe("DigitalTwins Relationships - create, read, list, delete operations", (
|
|||
} finally {
|
||||
try {
|
||||
await client.deleteRelationship(BUILDING_DIGITAL_TWIN_ID, relationshipId);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteRelationship failure during test setup or cleanup");
|
||||
}
|
||||
await deleteDigitalTwins();
|
||||
await deleteModels();
|
||||
}
|
||||
|
@ -1289,7 +1335,9 @@ describe("DigitalTwins Relationships - create, read, list, delete operations", (
|
|||
} finally {
|
||||
try {
|
||||
await client.deleteRelationship(BUILDING_DIGITAL_TWIN_ID, relationshipId);
|
||||
} catch (Exception) {}
|
||||
} catch (Exception) {
|
||||
console.error("deleteRelationship failure during test setup or cleanup");
|
||||
}
|
||||
await deleteDigitalTwins();
|
||||
await deleteModels();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче