Skip to content

Commit

Permalink
chore: removed billboard
Browse files Browse the repository at this point in the history
  • Loading branch information
sn0wcat committed Jun 10, 2024
1 parent 8213f77 commit 70f7f5d
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 30 deletions.
1 change: 1 addition & 0 deletions src/api/sdk/asset/asset-management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,7 @@ export class AssetManagementClient extends SdkClient {
* @returns {Promise<AssetManagementModels.BillboardResource>}
*
* @memberOf AssetManagementClient
*
*/
public async GetBillboard(): Promise<AssetManagementModels.BillboardResource> {
const result = await this.HttpAction({
Expand Down
1 change: 1 addition & 0 deletions src/api/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ export function printTree(treeItem: TreeItem, level: number, color: (x: string)

export function removeTrailingSlash(url: string): string {
// billboard ends with /
// console.log(url);
if (url === "/api/assetmanagement/v3/") return url;

if (url.includes("?")) {
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/markdown-help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Here are some examples of how to use the \`mdsp ${stripAnsi(name)}\` command:
${stripAnsi(examples)}
\`\`\`
See [MindSphere API documentation](https://documentation.mindsphere.io/MindSphere/apis/index.html) for more information about MindSphere APIs.
See [MindSphere API documentation](https://developer.siemens.com/insights-hub/overview.html) for more information about MindSphere APIs.
`;
};
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/mc-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ async function serve({ configPort, options }: { configPort?: number; options: an
console.log(
`example api call (list of assets): ${color("http://localhost:" + port + "/api/assetmanagement/v3/assets")}`
);
console.log(`API documentation: ${color("https://developer.mindsphere.io/apis/index.html")}`);
console.log(`API documentation: ${color("https://developer.siemens.com/insights-hub/overview.html")}`);
console.log(`press ${color("CTRL + C")} to exit`);
}

Expand Down
5 changes: 0 additions & 5 deletions test/asset-management-files.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ describe("[SDK] AssetManagementClient.Files", () => {

await am.DeleteFile(`${result.id}`, { ifMatch: `${updatedFile.etag}` });
});

it("should be able to Get Billboard", async () => {
const billboard = await am.GetBillboard();
billboard.should.not.be.undefined;
});
});
async function deleteFiles(am: AssetManagementClient) {
await sleep(2000);
Expand Down
4 changes: 2 additions & 2 deletions test/mindconnect-agent-3-rsa.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,8 @@ describe("MindConnectApi Version 3 Agent (RSA_3072)", () => {
}

const agentSdk = agent.Sdk();
const billboard = await retry(5, () => agentSdk.GetAssetManagementClient().GetBillboard());
billboard.should.not.be.undefined;
const assets = await retry(5, () => agentSdk.GetAssetManagementClient().GetAssets());
assets.should.not.be.undefined;
const assetTypes = await retry(5, () => agentSdk.GetAssetManagementClient().GetAspectTypes());
assetTypes.should.not.be.undefined;
});
Expand Down
4 changes: 2 additions & 2 deletions test/mindconnect-agent-3.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -799,8 +799,8 @@ describe("MindConnectApi Version 3 Agent (SHARED_SECRET)", () => {
}

const agentSdk = agent.Sdk();
const billboard = await retry(5, () => agentSdk.GetAssetManagementClient().GetBillboard());
billboard.should.not.be.undefined;
const assets = await retry(5, () => agentSdk.GetAssetManagementClient().GetAssets());
assets.should.not.be.undefined;
const assetTypes = await retry(5, () => agentSdk.GetAssetManagementClient().GetAspectTypes());
assetTypes.should.not.be.undefined;
});
Expand Down
24 changes: 5 additions & 19 deletions test/mindconnect-agent-autoconfig.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import * as chai from "chai";
import { it } from "mocha";
import "url-search-params-polyfill";
import { DataPointValue, DataSourceConfiguration, IMindConnectConfiguration, MindConnectAgent, retry } from "../src";
import { DataPointValue, DataSourceConfiguration, IMindConnectConfiguration, MindConnectAgent } from "../src";
import { AgentManagementModels, AssetManagementModels, MindConnectApiClient } from "../src/api/sdk";
import { MindSphereSdk } from "../src/api/sdk/";
import { decrypt, loadAuth, throwError } from "../src/api/utils";
Expand All @@ -22,8 +22,8 @@ describe("MindConnectApi Version 3 Agent (SHARED_SECRET) - automatic configurati
basicAuth: decrypt(auth, getPasskeyForUnitTest()),
});

let agentConfig: IMindConnectConfiguration = ({} as unknown) as IMindConnectConfiguration;
let unitTestConfiguration: AgentUnitTestConfiguration = ({} as unknown) as AgentUnitTestConfiguration;
let agentConfig: IMindConnectConfiguration = {} as unknown as IMindConnectConfiguration;
let unitTestConfiguration: AgentUnitTestConfiguration = {} as unknown as AgentUnitTestConfiguration;

let secondAsset: AssetManagementModels.AssetResourceWithHierarchyPath;

Expand Down Expand Up @@ -188,20 +188,6 @@ describe("MindConnectApi Version 3 Agent (SHARED_SECRET) - automatic configurati
mappings.length.should.equal(7);
});

it("should be able to use SDK with agent credentials", async () => {
const agent = new MindConnectAgent(agentConfig);

if (!agent.IsOnBoarded()) {
await agent.OnBoard();
}

const agentSdk = agent.Sdk();
const billboard = await retry(5, () => agentSdk.GetAssetManagementClient().GetBillboard());
billboard.should.not.be.undefined;
const assetTypes = await retry(5, () => agentSdk.GetAssetManagementClient().GetAspectTypes());
assetTypes.should.not.be.undefined;
});

it("should be able to fix double names", async () => {
const mcapi = new MindConnectApiClient();

Expand Down Expand Up @@ -311,8 +297,8 @@ describe("MindConnectApi Version 3 Agent (SHARED_SECRET) - automatic configurati
eTag: "2",
};

const fixedConfig = ((mcapi as unknown) as any).CreateUniqueDataPoints(
(testConfig as unknown) as DataSourceConfiguration
const fixedConfig = (mcapi as unknown as any).CreateUniqueDataPoints(
testConfig as unknown as DataSourceConfiguration
);
fixedConfig.dataSources[0].name.should.equal("DS-EnvironmentData00001");
fixedConfig.dataSources[1].name.should.equal("DS-EnvironmentData00002");
Expand Down

0 comments on commit 70f7f5d

Please sign in to comment.