npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@leisoft/aas-client

v0.2.4

Published

TypeScript / JavaScript AAS metamodel and client library by Leisoft for both browser and Node.js.

Readme

Leisoft AAS Client Library

TypeScript / JavaScript AAS metamodel and client library by Leisoft for both browser and Node.js.

License

Table of Contents

Introduction

const assetId = new LeisoftAasId();
assetId.idType = 'asset';
const shellId = LeisoftAasId.from(assetId);
shellId.idType = 'shell';
const shell: AssetAdministrationShell = {
    id: shellId.toUrl('https'),
    assetInformation: {
        assetKind: AssetKind.Instance,
        globalAssetId: assetId.toUrn(),
    },
    modelType: ModelType.AssetAdministrationShell,
    idShort: 'leisoftServer',
    displayName: [
        { language: 'en', text: 'Leisoft Server' },
    ],
};
const aasRepoClient = new AasRepoClient({
    protocol: AAS_REPO_PROTOCOL,
    host: AAS_REPO_SERVER,
    port: AAS_REPO_PORT,
});
try {
    await aasRepoClient.createShell(shell);
    console.log('AAS created successfully');
}
catch (error) {
    console.error('Error creating AAS:', (error as AasRequestError).messages);
}

Features Overview

  • AAS metamodel, descriptors, metadata, value only and REST specific types
  • AAS client interfaces
    • AAS repository client
    • Submodel repository client
    • AAS registry client
    • Submodel registry client
    • Concept description repository client
    • Discovery API
    • Description API
  • AAS tree model
  • AAS compliant ID creation
  • IdShortPath calculation

Metamodel

TypeScript types for the entire AAS metamodel and the API specific types

const smId = new LeisoftAasId();
smId.idType = 'submodel';
const sm: Submodel = {
    id: smId.toUrn(),
    modelType: ModelType.Submodel,
    idShort: 'City',
    kind: ModellingKind.Instance,
    description: [
        { language: 'en', text: 'City of Tanna' },
        { language: 'de', text: 'Stadt Tanna' },
    ],
    submodelElements: [
        {
            modelType: ModelType.Property,
            idShort: 'CityName',
            value: 'Tanna',
            valueType: DataTypeDefXsd.String
        } as Property
    ]
};
console.log(JSON.parse(JSON.stringify(sm)));

Client

All clients share the same base class and implement a specific service of the AAS API.

const smRepoClient = new SubmodelRepoClient({
    host: 'api.leisoft.de',
    port: 443,
    protocol: 'https',
    auth: {
        token: oidcClient.jwt
    } as TokenAuthParams
});
const streetNumber = await smRepoClient.getSubmodelElementValue(
    smId, 'address.street.number'
) as Property;
console.log(streetNumber.value);

Treemodel

Using the AAS treemodel submodels and submodel element trees can be used like arrays and maps. IdShortPaths are calculated automatically and searches in the element tree are possible.

const smModel = new SubmodelTree(sm);
if (smModel.has('ManufacturerName')) {
    smModel.delete('ManufacturerName');
}
const sensorRange: Range = {
    idShort: 'SensorRange',
    modelType: ModelType.Range,
    min: String(8.5),
    max: String(31.2),
    valueType: DataTypeDefXsd.Decimal
};
smModel.set(sensorRange);

const phones = smModel.deepSearch(
    (element: SubmodelElement) => {
        return /^Leisoft-Car-.*$/i.test(element.idShort);
    },
    (element: SubmodelElement) => {
        const dm = langStringsToMap(element.description!);
        dm.set('en', translate(dm.get('de')!, 'en'));
        element.description = mapToLangStrings(dm);
    },
    4 // max depth
);
console.log(phones);

ID Creation

Standard compliant ID creation for all identifiables in the AAS metamodel and beyond

  • Sensible defaults
  • Hierarchical structure for all use cases
  • URL and URN generation
const id = new LeisoftAasId();
console.log(id.toUrn());
// urn:client.leisoft.de:entities:ids:88d0c3f7-e82e-4735-ac16-9237050d71b3

id.domain = 'project-x.leisoft.de';
id.idType = 'shell';
id.units = ['tanna', 'central', 'engineering'];
id.id = 'Leisoft-Tanna-Server-1';
console.log(id.toUrl('https'));
// https://project-x.leisoft.de/tanna/central/engineering/shells/ids/Leisoft-Tanna-Server-1

Version

  • (upcoming) 1.0.x first planned stable major release
  • (current) 0.2.x initial preliminary release
  • 0.1.0 test release

AAS Compatibility

  • AAS 3.0.x

License

This project is licensed under the Leisoft License.

Credits

Developers: