@leisoft/aas-client
Version:
TypeScript / JavaScript AAS metamodel and client library by Leisoft for both browser and Node.js.
1,015 lines (893 loc) • 41.1 kB
text/typescript
declare enum AssetKind {
Instance = "Instance",
NotApplicable = "NotApplicable",
Type = "Type"
}
declare enum DataTypeIec61360 {
BLOB = "BLOB",
BOOLEAN = "BOOLEAN",
DATE = "DATE",
FILE = "FILE",
HTML = "HTML",
INTEGERCOUNT = "INTEGER_COUNT",
INTEGERCURRENCY = "INTEGER_CURRENCY",
INTEGERMEASURE = "INTEGER_MEASURE",
IRDI = "IRDI",
IRI = "IRI",
RATIONAL = "RATIONAL",
RATIONALMEASURE = "RATIONAL_MEASURE",
REALCOUNT = "REAL_COUNT",
REALCURRENCY = "REAL_CURRENCY",
REALMEASURE = "REAL_MEASURE",
STRING = "STRING",
STRINGTRANSLATABLE = "STRING_TRANSLATABLE",
TIME = "TIME",
TIMESTAMP = "TIMESTAMP"
}
type LangString = {
language: string;
text: string;
};
declare enum ModelType {
AnnotatedRelationshipElement = "AnnotatedRelationshipElement",
AssetAdministrationShell = "AssetAdministrationShell",
BasicEventElement = "BasicEventElement",
Blob = "Blob",
Capability = "Capability",
ConceptDescription = "ConceptDescription",
DataSpecificationIec61360 = "DataSpecificationIec61360",
Entity = "Entity",
File = "File",
MultiLanguageProperty = "MultiLanguageProperty",
Operation = "Operation",
Property = "Property",
Range = "Range",
ReferenceElement = "ReferenceElement",
RelationshipElement = "RelationshipElement",
Submodel = "Submodel",
SubmodelElementCollection = "SubmodelElementCollection",
SubmodelElementList = "SubmodelElementList"
}
type DataSpecificationContent = {
modelType: ModelType;
};
type LevelType = {
min: boolean;
nom: boolean;
typ: boolean;
max: boolean;
};
declare enum ReferenceTypes {
ExternalReference = "ExternalReference",
ModelReference = "ModelReference"
}
declare enum KeyTypes {
AnnotatedRelationshipElement = "AnnotatedRelationshipElement",
AssetAdministrationShell = "AssetAdministrationShell",
BasicEventElement = "BasicEventElement",
Blob = "Blob",
Capability = "Capability",
ConceptDescription = "ConceptDescription",
DataElement = "DataElement",
Entity = "Entity",
EventElement = "EventElement",
File = "File",
FragmentReference = "FragmentReference",
GlobalReference = "GlobalReference",
Identifiable = "Identifiable",
MultiLanguageProperty = "MultiLanguageProperty",
Operation = "Operation",
Property = "Property",
Range = "Range",
Referable = "Referable",
ReferenceElement = "ReferenceElement",
RelationshipElement = "RelationshipElement",
Submodel = "Submodel",
SubmodelElement = "SubmodelElement",
SubmodelElementCollection = "SubmodelElementCollection",
SubmodelElementList = "SubmodelElementList"
}
type Key = {
type: KeyTypes;
value: string;
};
type Reference = {
referredSemanticId?: Reference;
type: ReferenceTypes;
keys: Array<Key>;
};
type ValueReferencePair = {
value: string;
valueId: Reference;
};
type ValueList = {
valueReferencePairs: Array<ValueReferencePair>;
};
type DataSpecificationIec61360 = {
preferredName: Array<LangString>;
shortName?: Array<LangString>;
unit?: string;
unitId?: Reference;
sourceOfDefinition?: string;
symbol?: string;
dataType?: DataTypeIec61360;
definition?: Array<LangString>;
valueFormat?: string;
valueList?: ValueList;
value?: string;
levelType?: LevelType;
modelType?: string;
} & DataSpecificationContent;
type EmbeddedDataSpecification = {
dataSpecification: Reference;
dataSpecificationContent: DataSpecificationIec61360;
};
type HasDataSpecification = {
embeddedDataSpecifications?: Array<EmbeddedDataSpecification>;
};
type AdministrativeInformation = {
version?: any;
revision?: any;
creator?: Reference;
templateId?: string;
} & HasDataSpecification;
type HasSemantics = {
semanticId?: Reference;
supplementalSemanticIds?: Array<Reference>;
};
type SpecificAssetId = HasSemantics & {
name: string;
value: string;
externalSubjectId?: Reference;
};
declare enum DataTypeDefXsd {
AnyURI = "xs:anyURI",
Base64Binary = "xs:base64Binary",
Boolean = "xs:boolean",
Byte = "xs:byte",
Date = "xs:date",
DateTime = "xs:dateTime",
Decimal = "xs:decimal",
Double = "xs:double",
Duration = "xs:duration",
Float = "xs:float",
GDay = "xs:gDay",
GMonth = "xs:gMonth",
GMonthDay = "xs:gMonthDay",
GYear = "xs:gYear",
GYearMonth = "xs:gYearMonth",
HexBinary = "xs:hexBinary",
Int = "xs:int",
Integer = "xs:integer",
Long = "xs:long",
NegativeInteger = "xs:negativeInteger",
NonNegativeInteger = "xs:nonNegativeInteger",
NonPositiveInteger = "xs:nonPositiveInteger",
PositiveInteger = "xs:positiveInteger",
Short = "xs:short",
String = "xs:string",
Time = "xs:time",
UnsignedByte = "xs:unsignedByte",
UnsignedInt = "xs:unsignedInt",
UnsignedLong = "xs:unsignedLong",
UnsignedShort = "xs:unsignedShort"
}
type Extension = HasSemantics & {
name: string;
valueType?: DataTypeDefXsd;
value?: string;
refersTo?: Array<Reference>;
};
type Descriptor = {
description?: Array<LangString>;
displayName?: Array<LangString>;
extensions?: Array<Extension>;
};
type ProtocolInformation = {
href: string;
endpointProtocol?: string;
endpointProtocolVersion?: Array<string>;
subprotocol?: string;
subprotocolBody?: string;
subprotocolBodyEncoding?: string;
securityAttributes?: Array<ProtocolInformationSecurityAttributes>;
};
type ProtocolInformationSecurityAttributes = {
type: ProtocolInformationSecurityAttributeTypes;
key: string;
value: string;
};
declare enum ProtocolInformationSecurityAttributeTypes {
NONE = "NONE",
RFCTLSA = "RFC_TLSA",
W3CDID = "W3C_DID"
}
type Endpoint = {
interface: string;
protocolInformation: ProtocolInformation;
};
type SubmodelDescriptor = {
administration?: AdministrativeInformation;
endpoints: Array<Endpoint>;
idShort?: string;
id: string;
semanticId?: Reference;
supplementalSemanticId?: Array<Reference>;
} & Descriptor;
type AssetAdministrationShellDescriptor = {
administration?: AdministrativeInformation;
assetKind?: AssetKind;
assetType?: string;
endpoints?: Array<Endpoint>;
globalAssetId?: string;
idShort?: string;
id: string;
specificAssetIds?: Array<SpecificAssetId>;
submodelDescriptors?: Array<SubmodelDescriptor>;
} & Descriptor;
type ServiceDescription = {
profiles?: Array<ServiceProfiles>;
};
declare enum ServiceProfiles {
AssetAdministrationShellServiceSpecificationSSP001 = "https://admin-shell.io/aas/API/3/0/AssetAdministrationShellServiceSpecification/SSP-001",
AssetAdministrationShellServiceSpecificationSSP002 = "https://admin-shell.io/aas/API/3/0/AssetAdministrationShellServiceSpecification/SSP-002",
SubmodelServiceSpecificationSSP001 = "https://admin-shell.io/aas/API/3/0/SubmodelServiceSpecification/SSP-001",
SubmodelServiceSpecificationSSP002 = "https://admin-shell.io/aas/API/3/0/SubmodelServiceSpecification/SSP-002",
SubmodelServiceSpecificationSSP003 = "https://admin-shell.io/aas/API/3/0/SubmodelServiceSpecification/SSP-003",
AasxFileServerServiceSpecificationSSP001 = "https://admin-shell.io/aas/API/3/0/AasxFileServerServiceSpecification/SSP-001",
AssetAdministrationShellRegistryServiceSpecificationSSP001 = "https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRegistryServiceSpecification/SSP-001",
AssetAdministrationShellRegistryServiceSpecificationSSP002 = "https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRegistryServiceSpecification/SSP-002",
SubmodelRegistryServiceSpecificationSSP001 = "https://admin-shell.io/aas/API/3/0/SubmodelRegistryServiceSpecification/SSP-001",
SubmodelRegistryServiceSpecificationSSP002 = "https://admin-shell.io/aas/API/3/0/SubmodelRegistryServiceSpecification/SSP-002",
DiscoveryServiceSpecificationSSP001 = "https://admin-shell.io/aas/API/3/0/DiscoveryServiceSpecification/SSP-001",
AssetAdministrationShellRepositoryServiceSpecificationSSP001 = "https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRepositoryServiceSpecification/SSP-001",
AssetAdministrationShellRepositoryServiceSpecificationSSP002 = "https://admin-shell.io/aas/API/3/0/AssetAdministrationShellRepositoryServiceSpecification/SSP-002",
SubmodelRepositoryServiceSpecificationSSP001 = "https://admin-shell.io/aas/API/3/0/SubmodelRepositoryServiceSpecification/SSP-001",
SubmodelRepositoryServiceSpecificationSSP002 = "https://admin-shell.io/aas/API/3/0/SubmodelRepositoryServiceSpecification/SSP-002",
SubmodelRepositoryServiceSpecificationSSP003 = "https://admin-shell.io/aas/API/3/0/SubmodelRepositoryServiceSpecification/SSP-003",
SubmodelRepositoryServiceSpecificationSSP004 = "https://admin-shell.io/aas/API/3/0/SubmodelRepositoryServiceSpecification/SSP-004",
ConceptDescriptionServiceSpecificationSSP001 = "https://admin-shell.io/aas/API/3/0/ConceptDescriptionServiceSpecification/SSP-001"
}
type HasExtensions = {
extensions?: Array<Extension>;
};
type Referable = {
category?: string;
idShort?: any;
displayName?: Array<LangString>;
description?: Array<LangString>;
modelType: ModelType;
} & HasExtensions;
declare enum ModellingKind {
Instance = "Instance",
Template = "Template"
}
declare enum QualifierKind {
ConceptQualifier = "ConceptQualifier",
TemplateQualifier = "TemplateQualifier",
ValueQualifier = "ValueQualifier"
}
type Qualifier = {
kind?: QualifierKind;
type: string;
valueType: DataTypeDefXsd;
value?: string;
valueId?: Reference;
} & HasSemantics;
type SubmodelElementMetadata = {
embeddedDataSpecifications?: Array<EmbeddedDataSpecification>;
semanticId?: Reference;
supplementalSemanticIds?: Array<Reference>;
qualifiers?: Array<Qualifier>;
modelType: ModelType;
kind?: ModellingKind;
} & Referable;
type AnnotatedRelationshipElementMetadata = {} & SubmodelElementMetadata;
declare enum Direction {
Input = "input",
Output = "output"
}
declare enum StateOfEvent {
Off = "off",
On = "on"
}
type BasicEventElementMetadata = {
direction?: Direction;
state?: StateOfEvent;
messageTopic?: string;
messageBroker?: Reference;
lastUpdate?: string;
minInterval?: string;
maxInterval?: string;
} & SubmodelElementMetadata;
type BlobMetadata = {} & SubmodelElementMetadata;
type CapabilityMetadata = {} & SubmodelElementMetadata;
type EntityMetadata = {} & SubmodelElementMetadata;
type FileMetadata = {} & SubmodelElementMetadata;
type MultiLanguagePropertyMetadata = {} & SubmodelElementMetadata;
type OperationMetadata = {} & SubmodelElementMetadata;
type PropertyMetadata = {
valueType?: DataTypeDefXsd;
} & SubmodelElementMetadata;
type RangeMetadata = {
valueType?: DataTypeDefXsd;
} & SubmodelElementMetadata;
type ReferenceElementMetadata = {} & SubmodelElementMetadata;
type RelationshipElementMetadata = {} & SubmodelElementMetadata;
type SubmodelElementCollectionMetadata = {} & SubmodelElementMetadata;
type SubmodelElementListMetadata = {
orderRelevant?: boolean;
semanticIdListElement?: Reference;
typeValueListElement?: ModelType;
valueTypeListElement?: DataTypeDefXsd;
} & SubmodelElementMetadata;
type Identifiable = {
administration?: AdministrativeInformation;
id: string;
} & Referable;
type SubmodelMetadata = {
embeddedDataSpecifications?: Array<EmbeddedDataSpecification>;
qualifiers?: Array<Qualifier>;
modelType: ModelType;
semanticId?: Reference;
supplementalSemanticIds?: Array<Reference>;
kind?: ModellingKind;
} & Identifiable;
type HasKind = {
kind?: ModellingKind;
};
type Resource = {
path: any;
contentType?: any;
};
type AssetInformation = {
assetKind: AssetKind;
globalAssetId?: string;
specificAssetIds?: Array<SpecificAssetId>;
assetType?: string;
defaultThumbnail?: Resource;
};
type AssetAdministrationShell = {
embeddedDataSpecifications?: Array<EmbeddedDataSpecification>;
derivedFrom?: Reference;
assetInformation: AssetInformation;
submodels?: Array<Reference>;
modelType?: string;
} & Identifiable;
type ConceptDescription = {
embeddedDataSpecifications?: Array<EmbeddedDataSpecification>;
isCaseOf?: Array<Reference>;
modelType?: string;
} & Identifiable;
declare enum AasSubmodelElements {
AnnotatedRelationshipElement = "AnnotatedRelationshipElement",
BasicEventElement = "BasicEventElement",
Blob = "Blob",
Capability = "Capability",
DataElement = "DataElement",
Entity = "Entity",
EventElement = "EventElement",
File = "File",
MultiLanguageProperty = "MultiLanguageProperty",
Operation = "Operation",
Property = "Property",
Range = "Range",
ReferenceElement = "ReferenceElement",
RelationshipElement = "RelationshipElement",
SubmodelElement = "SubmodelElement",
SubmodelElementCollection = "SubmodelElementCollection",
SubmodelElementList = "SubmodelElementList"
}
declare enum EntityType {
CoManagedEntity = "CoManagedEntity",
SelfManagedEntity = "SelfManagedEntity"
}
type SubmodelElement = {
semanticId?: Reference;
supplementalSemanticIds?: Array<Reference>;
qualifiers?: Array<Qualifier>;
modelType: ModelType;
embeddedDataSpecifications?: Array<EmbeddedDataSpecification>;
} & Referable;
type Submodel = {
kind?: ModellingKind;
semanticId?: Reference;
supplementalSemanticIds?: Array<Reference>;
qualifiers?: Array<Qualifier>;
modelType: string;
embeddedDataSpecifications?: Array<EmbeddedDataSpecification>;
submodelElements?: Array<SubmodelElement>;
} & Identifiable;
type Environment = {
assetAdministrationShells?: Array<AssetAdministrationShell>;
submodels?: Array<Submodel>;
conceptDescriptions?: Array<ConceptDescription>;
};
type DataElement = {} & SubmodelElement;
type RelationshipElement = {
first: Reference;
second: Reference;
} & SubmodelElement;
type AnnotatedRelationshipElement = {
annotations?: Array<DataElement>;
} & RelationshipElement;
type EventElement = {} & SubmodelElement;
type BasicEventElement = {
observed: Reference;
direction: Direction;
state: StateOfEvent;
messageTopic?: string;
messageBroker?: Reference;
lastUpdate?: string;
minInterval?: string;
maxInterval?: string;
} & EventElement;
type Blob$1 = {
value?: string;
contentType: any;
} & DataElement;
type Capability = {
modelType?: string;
} & SubmodelElement;
type Entity = {
statements?: Array<SubmodelElement>;
entityType: EntityType;
globalAssetId?: string;
specificAssetIds?: Array<SpecificAssetId>;
} & SubmodelElement;
type File = {
value?: string;
contentType: any;
} & DataElement;
type MultiLanguageProperty = {
value?: Array<LangString>;
valueId?: Reference;
} & DataElement;
type OperationVariable = {
value: SubmodelElement;
};
type Operation = {
inputVariables?: Array<OperationVariable>;
outputVariables?: Array<OperationVariable>;
inoutputVariables?: Array<OperationVariable>;
} & SubmodelElement;
type Property = {
valueType: DataTypeDefXsd;
value?: string;
valueId?: Reference;
} & DataElement;
type Range = {
valueType: DataTypeDefXsd;
min?: string;
max?: string;
} & DataElement;
type ReferenceElement = {
value?: Reference;
modelType?: string;
} & DataElement;
type SubmodelElementCollection = {
value?: Array<SubmodelElement>;
} & SubmodelElement;
type SubmodelElementList = {
orderRelevant?: boolean;
semanticIdListElement?: Reference;
typeValueListElement: AasSubmodelElements;
valueTypeListElement?: DataTypeDefXsd;
value?: Array<SubmodelElement>;
modelType?: string;
} & SubmodelElement;
type PagingMetadata = {
cursor?: string;
};
type PagedResult<T> = {
result: T[];
paging_metadata?: PagingMetadata;
};
type PagingParams = {
limit?: number;
cursor?: string;
};
/**
* Bearer Token Authentication
*/
type TokenAuthParams = {
type: 'token';
token: string;
};
/**
* HTTP Basic Authentication
*/
type BasicAuthParams = {
type: 'basic';
username: string;
password: string;
};
/**
* x509 Client Certificate Authentication
*/
type CertAuthParams = {
type: 'cert';
cert: string;
key: string;
};
type AuthConfigParams = TokenAuthParams | BasicAuthParams | CertAuthParams;
type ClientConfigParams = {
host: string;
port?: number;
protocol?: 'http' | 'https';
basePath?: string;
auth?: AuthConfigParams;
};
type HttpVerb = 'get' | 'post' | 'put' | 'patch' | 'delete' | 'head';
declare abstract class ClientBase {
protected readonly configParams: ClientConfigParams;
readonly baseUrl: URL;
protected headers: Headers;
constructor(configParams: ClientConfigParams);
request(method: HttpVerb, path: string, params?: URLSearchParams, body?: BodyInit, signal?: AbortSignal): Promise<[Request, Response]>;
protected getHeaders(): Headers;
getServiceDescription(signal?: AbortSignal): Promise<ServiceDescription>;
}
declare class AasRegistryClient extends ClientBase {
getShellDescriptors(assetKind?: AssetKind, assetType?: string, pagingParams?: PagingParams, signal?: AbortSignal): Promise<PagedResult<AssetAdministrationShellDescriptor>>;
createShellDescriptor(descriptor: AssetAdministrationShellDescriptor, signal?: AbortSignal): Promise<AssetAdministrationShellDescriptor>;
getShellDescriptor(id: string, signal?: AbortSignal): Promise<AssetAdministrationShellDescriptor>;
replaceShellDescriptor(id: string, descriptor: AssetAdministrationShellDescriptor, signal?: AbortSignal): Promise<void>;
deleteShellDescriptor(id: string, signal?: AbortSignal): Promise<void>;
}
declare class AasRepoClient extends ClientBase {
getShells(assetIds?: SpecificAssetId[], idShort?: string, pagingParams?: PagingParams, signal?: AbortSignal): Promise<PagedResult<AssetAdministrationShell>>;
createShell(shell: AssetAdministrationShell, signal?: AbortSignal): Promise<AssetAdministrationShell>;
getShell(id: string, signal?: AbortSignal): Promise<AssetAdministrationShell>;
deleteShell(id: string, signal?: AbortSignal): Promise<void>;
replaceShell(id: string, shell: AssetAdministrationShell, signal?: AbortSignal): Promise<AssetAdministrationShell>;
getShellReferences(assetIds?: SpecificAssetId[], idShort?: string, pagingParams?: PagingParams, signal?: AbortSignal): Promise<PagedResult<Reference>>;
getShellReference(id: string, signal?: AbortSignal): Promise<Reference>;
getAssetInformation(id: string, signal?: AbortSignal): Promise<AssetInformation>;
replaceAssetInformation(id: string, assetInformation: AssetInformation, signal?: AbortSignal): Promise<AssetInformation>;
getShellThumbnail(id: string, signal?: AbortSignal): Promise<Blob>;
replaceShellThumbnail(id: string, thumbnail: Blob, signal?: AbortSignal): Promise<void>;
deleteShellThumbnail(id: string, signal?: AbortSignal): Promise<void>;
getShellSubmodelRefs(id: string, pagingParams?: PagingParams, signal?: AbortSignal): Promise<PagedResult<Reference>>;
createShellSubmodelRef(id: string, submodelRef: Reference, signal?: AbortSignal): Promise<Reference>;
deleteShellSubmodelRef(id: string, submodelRefId: string, signal?: AbortSignal): Promise<void>;
}
type MessageType = 'Undefined' | 'Info' | 'Warning' | 'Error' | 'Exception';
type Message = {
code?: string;
correlationId?: string;
messageType?: MessageType;
text?: string;
timestamp?: string;
};
declare class AasRequestError extends Error {
readonly request: Request;
readonly response: Response;
readonly messages?: Message[] | undefined;
constructor(request: Request, response: Response, messages?: Message[] | undefined);
}
declare class ConceptDescriptionClient extends ClientBase {
getConceptDescriptions(idShort?: string, isCaseOf?: Reference, dataSpecificationRef?: Reference, pagingParams?: PagingParams, signal?: AbortSignal): Promise<PagedResult<ConceptDescription>>;
createConceptDescription(conceptDescription: ConceptDescription, signal?: AbortSignal): Promise<ConceptDescription>;
getConceptDescription(id: string, signal?: AbortSignal): Promise<ConceptDescription>;
replaceConceptDescription(id: string, conceptDescription: ConceptDescription, signal?: AbortSignal): Promise<void>;
deleteConceptDescription(id: string, signal?: AbortSignal): Promise<void>;
}
declare class DiscoveryClient extends ClientBase {
lookupShells(assetIds?: SpecificAssetId[], pagingParams?: PagingParams, signal?: AbortSignal): Promise<PagedResult<string>>;
lookupAssetIds(id: string, signal?: AbortSignal): Promise<SpecificAssetId[]>;
createAssetLink(id: string, assetIds: SpecificAssetId[], signal?: AbortSignal): Promise<SpecificAssetId[]>;
deleteAssetLink(id: string, signal?: AbortSignal): Promise<void>;
}
declare class SubmodelRegistryClient extends ClientBase {
getSubmodelDescriptors(pagingParams?: PagingParams, signal?: AbortSignal): Promise<PagedResult<SubmodelDescriptor>>;
createSubmodelDescriptor(descriptor: SubmodelDescriptor, signal?: AbortSignal): Promise<SubmodelDescriptor>;
getSubmodelDescriptor(id: string, signal?: AbortSignal): Promise<SubmodelDescriptor>;
replaceSubmodelDescriptor(id: string, descriptor: SubmodelDescriptor, signal?: AbortSignal): Promise<void>;
deleteSubmodelDescriptor(id: string, signal?: AbortSignal): Promise<void>;
}
type ReferenceValue = {
type?: ReferenceTypes;
keys?: Array<Key>;
};
type AnnotatedRelationshipElementValue = {
first: ReferenceValue;
second: ReferenceValue;
annotations?: Array<ValueOnly>;
};
type BasicEventElementValue = {
observed: ReferenceValue;
};
type BlobValue = {
contentType: string;
value: string;
};
/**
* Since patternProperties and propertyNames are not supported by OpenApi yet, the ValueOnly serialization for this elements works with the key-attribute as the JSON-property name and the value-attribute as the corresponding value.
*/
type SpecificAssetIdValue = {
[key: string]: string;
};
type EntityValue = {
entityType: EntityType;
globalAssetId?: string;
specificAssetIds?: Array<SpecificAssetIdValue>;
statements: Array<ValueOnly>;
};
type FileValue = {
contentType: string;
value: string;
};
type LangStringValue = {
[languageCode: string]: string;
};
type MultiLanguagePropertyValue = LangStringValue[];
type PropertyValue = string | number | boolean;
type RangeValue = {
max: number;
min: number;
};
type ReferenceElementValue = {
type?: ReferenceTypes;
keys?: Array<Key>;
};
type RelationshipElementValue = {
first: ReferenceValue;
second: ReferenceValue;
};
type SubmodelElementCollectionValue = ValueOnly;
type SubmodelElementListValue = Array<SubmodelElementValue>;
type SubmodelElementValue = BasicEventElementValue | RangeValue | MultiLanguagePropertyValue | FileValue | BlobValue | ReferenceElementValue | RelationshipElementValue | AnnotatedRelationshipElementValue | EntityValue | PropertyValue | SubmodelElementCollectionValue | SubmodelElementListValue;
type ValueOnly = {
[idShort: string]: SubmodelElementValue;
};
type OperationRequestValue = {
inoutputArguments?: ValueOnly;
inputArguments?: ValueOnly;
clientTimeoutDuration: string;
};
declare enum ExecutionState {
Initiated = "Initiated",
Running = "Running",
Completed = "Completed",
Canceled = "Canceled",
Failed = "Failed",
Timeout = "Timeout"
}
type Result = {
messages?: Array<Message>;
};
type BaseOperationResult = {
executionState?: ExecutionState;
success?: boolean;
} & Result;
type OperationResultValue = {
inoutputArguments?: ValueOnly;
outputArguments?: ValueOnly;
} & BaseOperationResult;
type OperationRequest = {
inoutputArguments?: Array<OperationVariable>;
inputArguments?: Array<OperationVariable>;
clientTimeoutDuration?: string;
};
type OperationResult = {
inoutputArguments?: Array<OperationVariable>;
outputArguments?: Array<OperationVariable>;
} & BaseOperationResult;
type SerializationModifiers = {
level?: 'deep' | 'core';
extent?: 'withBlobValue' | 'withoutBlobValue';
};
declare class SubmodelRepoClient extends ClientBase {
getSubmodels(semanticId?: Reference, idShort?: string, pagingParams?: PagingParams, serializationModifiers?: SerializationModifiers, signal?: AbortSignal): Promise<PagedResult<Submodel>>;
createSubmodel(submodel: Submodel, signal?: AbortSignal): Promise<Submodel>;
getSubmodelsMetadata(semanticId?: Reference, idShort?: string, pagingParams?: PagingParams, serializationModifiers?: SerializationModifiers, signal?: AbortSignal): Promise<PagedResult<SubmodelMetadata>>;
getSubmodelsValue(semanticId?: Reference, idShort?: string, pagingParams?: PagingParams, serializationModifiers?: SerializationModifiers, signal?: AbortSignal): Promise<PagedResult<ValueOnly>>;
getSubmodelReferences(semanticId?: Reference, idShort?: string, pagingParams?: PagingParams, serializationModifiers?: SerializationModifiers, signal?: AbortSignal): Promise<PagedResult<Reference>>;
getSubmodelsPaths(semanticId?: Reference, idShort?: string, pagingParams?: PagingParams, serializationModifiers?: SerializationModifiers, signal?: AbortSignal): Promise<PagedResult<string[]>>;
getSubmodel(id: string, serializationModifiers?: SerializationModifiers, signal?: AbortSignal): Promise<Submodel>;
replaceSubmodel(id: string, submodel: Submodel, signal?: AbortSignal): Promise<void>;
updateSubmodel(id: string, submodel: Submodel, level?: string, signal?: AbortSignal): Promise<void>;
deleteSubmodel(id: string, signal?: AbortSignal): Promise<void>;
getSubmodelMetadata(id: string, level?: string, signal?: AbortSignal): Promise<SubmodelMetadata>;
updateSubmodelMetadata(id: string, metadata: SubmodelMetadata, level?: string, signal?: AbortSignal): Promise<void>;
getSubmodelValue(id: string, serializationModifiers?: SerializationModifiers, signal?: AbortSignal): Promise<ValueOnly>;
getSubmodelReference(id: string, signal?: AbortSignal): Promise<Reference>;
getSubmodelPaths(id: string, level?: string, signal?: AbortSignal): Promise<string[]>;
getSubmodelElements(submodelId: string, pagingParams?: PagingParams, serializationModifiers?: SerializationModifiers, signal?: AbortSignal): Promise<PagedResult<SubmodelElement>>;
createSubmodelElement(submodelId: string, element: SubmodelElement, signal?: AbortSignal): Promise<SubmodelElement>;
getSubmodelElementsMetadata(submodelId: string, pagingParams?: PagingParams, level?: string, signal?: AbortSignal): Promise<PagedResult<SubmodelElementMetadata>>;
getSubmodelElementsValue(submodelId: string, pagingParams?: PagingParams, serializationModifiers?: SerializationModifiers, signal?: AbortSignal): Promise<PagedResult<SubmodelElementValue>>;
getSubmodelElementReferences(submodelId: string, pagingParams?: PagingParams, signal?: AbortSignal): Promise<PagedResult<Reference>>;
getSubmodelElementsPaths(submodelId: string, pagingParams?: PagingParams, level?: string, signal?: AbortSignal): Promise<PagedResult<string[]>>;
getSubmodelElement(submodelId: string, idShortPath: string, serializationModifiers?: SerializationModifiers, signal?: AbortSignal): Promise<SubmodelElement>;
createSubmodelElementAtPath(submodelId: string, idShortPath: string, element: SubmodelElement, signal?: AbortSignal): Promise<SubmodelElement>;
replaceSubmodelElement(submodelId: string, idShortPath: string, element: SubmodelElement, level?: string, signal?: AbortSignal): Promise<void>;
updateSubmodelElement(submodelId: string, idShortPath: string, element: SubmodelElement, level?: string, signal?: AbortSignal): Promise<void>;
deleteSubmodelElement(submodelId: string, idShortPath: string, signal?: AbortSignal): Promise<void>;
getSubmodelElementMetadata(submodelId: string, idShortPath: string, level?: string, signal?: AbortSignal): Promise<SubmodelElementMetadata>;
updateSubmodelElementMetadata(submodelId: string, idShortPath: string, metadata: SubmodelElementMetadata, level?: string, signal?: AbortSignal): Promise<void>;
getSubmodelElementValue(submodelId: string, idShortPath: string, serializationModifiers?: SerializationModifiers, signal?: AbortSignal): Promise<SubmodelElementValue>;
getSubmodelElementReference(submodelId: string, idShortPath: string, signal?: AbortSignal): Promise<Reference>;
getSubmodelElementPaths(submodelId: string, idShortPath: string, level?: string, signal?: AbortSignal): Promise<string[]>;
getSubmodelElementFile(submodelId: string, idShortPath: string, signal?: AbortSignal): Promise<Blob>;
setSubmodelElementFile(submodelId: string, idShortPath: string, file: Blob, fileName: string, signal?: AbortSignal): Promise<void>;
deleteSubmodelElementFile(submodelId: string, idShortPath: string, signal?: AbortSignal): Promise<void>;
invokeOperation(submodelId: string, idShortPath: string, operationRequest: OperationRequest, invokeAsync?: boolean, signal?: AbortSignal): Promise<OperationResult>;
invokeOperationValue(submodelId: string, idShortPath: string, operationRequest: OperationRequestValue, invokeAsync?: boolean, signal?: AbortSignal): Promise<OperationResultValue>;
invokeOperationAsync(submodelId: string, idShortPath: string, operationRequest: OperationRequest, signal?: AbortSignal): Promise<string>;
invokeOperationAsyncValue(submodelId: string, idShortPath: string, operationRequest: OperationRequestValue, signal?: AbortSignal): Promise<string>;
getOperationStatus(submodelId: string, idShortPath: string, handleId: string, signal?: AbortSignal): Promise<BaseOperationResult>;
getOperationResults(submodelId: string, idShortPath: string, handleId: string, signal?: AbortSignal): Promise<OperationResult>;
getOperationResultsValue(submodelId: string, idShortPath: string, handleId: string, signal?: AbortSignal): Promise<OperationResultValue>;
}
declare class SubmodelTree {
submodel: Submodel;
private _elementMap;
constructor(submodel: Submodel);
delete(idShort: string): SubmodelElementNode | undefined;
set(element: SubmodelElement): SubmodelTree;
has(idShort: string): boolean;
get(idShort: string): SubmodelElement | undefined;
clear(): void;
keys(): string[];
values(): SubmodelElement[];
entries(): [string, SubmodelElement][];
forEach(callback: (element: SubmodelElement, idShort: string) => void): void;
get size(): number;
[Symbol.iterator](): IterableIterator<[string, SubmodelElement]>;
deepSearch(predicate?: (element: SubmodelElement) => boolean, action?: (element: SubmodelElement) => void, maxDepth?: number): SubmodelElementNode[];
breadthFirstSearch(predicate?: (element: SubmodelElement) => boolean, action?: (element: SubmodelElement) => void, maxDepth?: number): SubmodelElementNode[];
toSubmodel(): Submodel;
}
declare class SubmodelElementNode {
element: SubmodelElement;
protected _submodel?: SubmodelTree;
protected _parent?: SubmodelElementNode;
constructor(element: SubmodelElement);
get submodel(): SubmodelTree | undefined;
get parent(): SubmodelElementNode | undefined;
addToSubmodel(submodel: SubmodelTree): void;
removeFromSubmodel(): void;
get isList(): boolean;
get isCollection(): boolean;
get idShortPath(): string;
indexOf(_child: SubmodelElement): number;
/**
* Must be static because child class can't access protected _parent field
* for other instance
*/
protected static setParent(parent: SubmodelElementNode, child: SubmodelElementNode): void;
protected static removeParent(child: SubmodelElementNode): void;
static from(element: SubmodelElement): SubmodelElementNode;
get children(): SubmodelElementNode[];
deepSearch(predicate?: (element: SubmodelElement) => boolean, action?: (element: SubmodelElement) => void, maxDepth?: number): SubmodelElementNode[];
breadthFirstSearch(predicate?: (element: SubmodelElement) => boolean, action?: (element: SubmodelElement) => void, maxDepth?: number): SubmodelElementNode[];
toSubmodelElement(): SubmodelElement;
}
declare class SubmodelElementNodeList extends SubmodelElementNode {
element: SubmodelElementList;
private _elements;
private _elementNodeMap;
constructor(element: SubmodelElementList);
get isList(): boolean;
indexOf(child: SubmodelElement): number;
includes(element: SubmodelElement): boolean;
private addElementToMap;
add(element: SubmodelElement): void;
replaceAt(index: number, element: SubmodelElement): void;
removeAt(index: number): void;
remove(element: SubmodelElement): boolean;
clear(): void;
get length(): number;
values(): SubmodelElement[];
entries(): [number, SubmodelElement][];
get(index: number): SubmodelElement;
[Symbol.iterator](): Iterator<SubmodelElement>;
get children(): SubmodelElementNode[];
toSubmodelElement(): SubmodelElement;
}
declare class SubmodelElementCollectionNode extends SubmodelElementNode {
element: SubmodelElementCollection | AnnotatedRelationshipElement | Entity;
private _elementMap;
constructor(element: SubmodelElementCollection | AnnotatedRelationshipElement | Entity);
get isCollection(): boolean;
set(element: SubmodelElement): SubmodelElementCollectionNode;
get(idShort: string): SubmodelElement | undefined;
delete(idShort: string): boolean;
has(idShort: string): boolean;
clear(): void;
keys(): string[];
values(): SubmodelElement[];
entries(): [string, SubmodelElement][];
forEach(callback: (element: SubmodelElement, idShort: string) => void): void;
get size(): number;
[Symbol.iterator](): Iterator<[string, SubmodelElement]>;
get children(): SubmodelElementNode[];
toSubmodelElement(): SubmodelElement;
}
/**
* Represents an IdShort pattern somewhere in a
* string and contains the group "idShort".
*/
declare const ID_SHORT_REGEX: RegExp;
/**
* Pattern to test whether a string is a valid IdShort.
* It applies to the full string.
*/
declare const JUST_ID_SHORT_REGEX: RegExp;
/**
* Represents an index pattern somewhere in a string and contains the
* group "index".
*/
declare const INDEX_REGEX: RegExp;
/**
* Represents an index pattern at the end of a string and contains the
* group "index".
*/
declare const LAST_INDEX_REGEX: RegExp;
declare const langStringsToMap: (langString: LangString[]) => Map<string, string>;
declare const mapToLangStrings: (map: Map<string, string>) => LangString[];
declare const modelTypeToKeyType: (modelType: ModelType) => KeyTypes;
declare const referenceFrom: (data: AssetAdministrationShell | Submodel | ConceptDescription | SubmodelElement) => Reference;
/**
* Pattern for a valid IdShortPath. It applies to the full string.
*/
declare const ID_SHORT_PATH_REGEX: RegExp;
/**
* Pattern for a valid IdShortPath segment. It is used to find the segments in
* a string and contains the group "segment".
*/
declare const ID_SHORT_PATH_SEGMENT_REGEX: RegExp;
/**
* Utility class for working with IdShortPaths.
*/
declare class IdShortPath {
private _path;
static validatePath(path: string): boolean;
static validatePathOrThrow(path: string): void;
constructor(path: string);
get path(): string;
isValid(): boolean;
isListItem(): boolean;
hasIdShort(): boolean;
hasParent(): boolean;
isRoot(): boolean;
joinPath(path: string): void;
joinIdShort(idShort: string): void;
joinIndex(index: number): void;
get index(): number;
get segments(): string[];
get lastSegment(): string;
get firstSegment(): string;
get idShort(): string;
get parent(): IdShortPath;
get root(): string;
changeIndex(newIndex: number): void;
changeIdShort(newIdShort: string): void;
get allIdShorts(): string[];
removeIndex(): void;
get allIdShortPaths(): string[];
}
declare const VALID_ID_SEGMENT_REGEX: RegExp;
declare const validateIdSegmentOrThrow: (idSegment: string) => void;
declare const uuidv4: () => string;
declare class LeisoftAasId {
domain?: string;
idType?: 'asset' | 'shell' | 'submodel' | 'concept-description';
id?: string;
units?: string[];
toUrn(): string;
toUrl(protocol: 'http' | 'https' | 'ftp' | 'ftps' | 'sftp' | 'file'): string;
static from(other: LeisoftAasId): LeisoftAasId;
}
declare const assignSearchParams: (params: URLSearchParams, assign: Record<string, string | string[] | undefined>) => void;
declare const assignPagingParams: (params: URLSearchParams, pagingParams?: PagingParams) => void;
declare const assignSerializationModifiers: (params: URLSearchParams, serializationModifiers?: SerializationModifiers) => void;
declare const base64Url: (str: string) => string;
declare const encodeSpecificAssetId: (id: SpecificAssetId) => string;
declare const encodeReference: (ref: Reference) => string;
declare const assignSemanticId: (params: URLSearchParams, semanticId?: Reference) => void;
declare const assertValidAasResponse: <T>(request: Request, response: Response, converserionType?: "json" | "blob" | "text" | "void") => Promise<T>;
declare const assignAssetParams: (params: URLSearchParams, assetIds?: SpecificAssetId[], idShort?: string) => void;
export { AasRegistryClient, AasRepoClient, AasRequestError, AasSubmodelElements, type AdministrativeInformation, type AnnotatedRelationshipElement, type AnnotatedRelationshipElementMetadata, type AnnotatedRelationshipElementValue, type AssetAdministrationShell, type AssetAdministrationShellDescriptor, type AssetInformation, AssetKind, type AuthConfigParams, type BaseOperationResult, type BasicAuthParams, type BasicEventElement, type BasicEventElementMetadata, type BasicEventElementValue, type Blob$1 as Blob, type BlobMetadata, type BlobValue, type Capability, type CapabilityMetadata, type CertAuthParams, ClientBase, type ClientConfigParams, type ConceptDescription, ConceptDescriptionClient, type DataElement, type DataSpecificationContent, type DataSpecificationIec61360, DataTypeDefXsd, DataTypeIec61360, type Descriptor, Direction, DiscoveryClient, type EmbeddedDataSpecification, type Endpoint, type Entity, type EntityMetadata, EntityType, type EntityValue, type Environment, type EventElement, ExecutionState, type Extension, type File, type FileMetadata, type FileValue, type HasDataSpecification, type HasExtensions, type HasKind, type HasSemantics, type HttpVerb, ID_SHORT_PATH_REGEX, ID_SHORT_PATH_SEGMENT_REGEX, ID_SHORT_REGEX, INDEX_REGEX, IdShortPath, type Identifiable, JUST_ID_SHORT_REGEX, type Key, KeyTypes, LAST_INDEX_REGEX, type LangString, type LangStringValue, LeisoftAasId, type LevelType, type Message, type MessageType, ModelType, ModellingKind, type MultiLanguageProperty, type MultiLanguagePropertyMetadata, type MultiLanguagePropertyValue, type Operation, type OperationMetadata, type OperationRequest, type OperationRequestValue, type OperationResult, type OperationResultValue, type OperationVariable, type PagedResult, type PagingParams, type Property, type PropertyMetadata, type PropertyValue, type ProtocolInformation, ProtocolInformationSecurityAttributeTypes, type ProtocolInformationSecurityAttributes, type Qualifier, QualifierKind, type Range, type RangeMetadata, type RangeValue, type Referable, type Reference, type ReferenceElement, type ReferenceElementMetadata, type ReferenceElementValue, ReferenceTypes, type RelationshipElement, type RelationshipElementMetadata, type RelationshipElementValue, type Resource, type Result, type SerializationModifiers, type ServiceDescription, ServiceProfiles, type SpecificAssetId, type SpecificAssetIdValue, StateOfEvent, type Submodel, type SubmodelDescriptor, type SubmodelElement, type SubmodelElementCollection, type SubmodelElementCollectionMetadata, SubmodelElementCollectionNode, type SubmodelElementCollectionValue, type SubmodelElementList, type SubmodelElementListMetadata, type SubmodelElementListValue, type SubmodelElementMetadata, SubmodelElementNode, SubmodelElementNodeList, type SubmodelElementValue, type SubmodelMetadata, SubmodelRegistryClient, SubmodelRepoClient, SubmodelTree, type TokenAuthParams, VALID_ID_SEGMENT_REGEX, type ValueList, type ValueOnly, type ValueReferencePair, assertValidAasResponse, assignAssetParams, assignPagingParams, assignSearchParams, assignSemanticId, assignSerializationModifiers, base64Url, encodeReference, encodeSpecificAssetId, langStringsToMap, mapToLangStrings, modelTypeToKeyType, referenceFrom, uuidv4, validateIdSegmentOrThrow };