basyx-typescript-sdk 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/index.cjs +94 -94
- package/bundle/index.cjs.map +1 -1
- package/bundle/index.mjs +94 -94
- package/bundle/index.mjs.map +1 -1
- package/dist/services/AasService.d.ts +6 -6
- package/dist/services/AasService.js +49 -49
- package/dist/services/SubmodelService.d.ts +6 -6
- package/dist/services/SubmodelService.js +45 -45
- package/package.json +1 -1
package/bundle/index.mjs
CHANGED
|
@@ -15647,18 +15647,18 @@ var DescriptorUtils = /*#__PURE__*/Object.freeze({
|
|
|
15647
15647
|
* Submodel Repository, and Concept Description Repository.
|
|
15648
15648
|
*/
|
|
15649
15649
|
class SubmodelService {
|
|
15650
|
-
|
|
15651
|
-
|
|
15650
|
+
submodelRegistryClient;
|
|
15651
|
+
submodelRepositoryClient;
|
|
15652
15652
|
conceptDescriptionClient;
|
|
15653
|
-
|
|
15654
|
-
|
|
15653
|
+
submodelRegistryConfig;
|
|
15654
|
+
submodelRepositoryConfig;
|
|
15655
15655
|
conceptDescriptionRepositoryConfig;
|
|
15656
15656
|
constructor(config) {
|
|
15657
|
-
this.
|
|
15658
|
-
this.
|
|
15657
|
+
this.submodelRegistryClient = new SubmodelRegistryClient();
|
|
15658
|
+
this.submodelRepositoryClient = new SubmodelRepositoryClient();
|
|
15659
15659
|
this.conceptDescriptionClient = new ConceptDescriptionRepositoryClient();
|
|
15660
|
-
this.
|
|
15661
|
-
this.
|
|
15660
|
+
this.submodelRegistryConfig = config.submodelRegistryConfig;
|
|
15661
|
+
this.submodelRepositoryConfig = config.submodelRepositoryConfig;
|
|
15662
15662
|
this.conceptDescriptionRepositoryConfig = config.conceptDescriptionRepositoryConfig;
|
|
15663
15663
|
}
|
|
15664
15664
|
/**
|
|
@@ -15681,9 +15681,9 @@ class SubmodelService {
|
|
|
15681
15681
|
const preferRegistry = options?.preferRegistry ?? true;
|
|
15682
15682
|
const includeConceptDescriptions = options?.includeConceptDescriptions ?? false;
|
|
15683
15683
|
// Try registry first if configured and preferred
|
|
15684
|
-
if (preferRegistry && this.
|
|
15685
|
-
const registryResult = await this.
|
|
15686
|
-
configuration: this.
|
|
15684
|
+
if (preferRegistry && this.submodelRegistryConfig) {
|
|
15685
|
+
const registryResult = await this.submodelRegistryClient.getAllSubmodelDescriptors({
|
|
15686
|
+
configuration: this.submodelRegistryConfig,
|
|
15687
15687
|
limit: options?.limit,
|
|
15688
15688
|
cursor: options?.cursor,
|
|
15689
15689
|
});
|
|
@@ -15715,9 +15715,9 @@ class SubmodelService {
|
|
|
15715
15715
|
}
|
|
15716
15716
|
}
|
|
15717
15717
|
// Fall back to repository if registry failed or not configured
|
|
15718
|
-
if (this.
|
|
15719
|
-
const repositoryResult = await this.
|
|
15720
|
-
configuration: this.
|
|
15718
|
+
if (this.submodelRepositoryConfig) {
|
|
15719
|
+
const repositoryResult = await this.submodelRepositoryClient.getAllSubmodels({
|
|
15720
|
+
configuration: this.submodelRepositoryConfig,
|
|
15721
15721
|
limit: options?.limit,
|
|
15722
15722
|
cursor: options?.cursor,
|
|
15723
15723
|
});
|
|
@@ -15764,9 +15764,9 @@ class SubmodelService {
|
|
|
15764
15764
|
async getSubmodelById(options) {
|
|
15765
15765
|
const { submodelIdentifier, useRegistryEndpoint = true, includeConceptDescriptions = false } = options;
|
|
15766
15766
|
// Try registry-based flow first
|
|
15767
|
-
if (useRegistryEndpoint && this.
|
|
15768
|
-
const descriptorResult = await this.
|
|
15769
|
-
configuration: this.
|
|
15767
|
+
if (useRegistryEndpoint && this.submodelRegistryConfig) {
|
|
15768
|
+
const descriptorResult = await this.submodelRegistryClient.getSubmodelDescriptorById({
|
|
15769
|
+
configuration: this.submodelRegistryConfig,
|
|
15770
15770
|
submodelIdentifier,
|
|
15771
15771
|
});
|
|
15772
15772
|
if (descriptorResult.success) {
|
|
@@ -15794,7 +15794,7 @@ class SubmodelService {
|
|
|
15794
15794
|
}
|
|
15795
15795
|
}
|
|
15796
15796
|
// Fall back to repository
|
|
15797
|
-
if (!this.
|
|
15797
|
+
if (!this.submodelRepositoryConfig) {
|
|
15798
15798
|
return {
|
|
15799
15799
|
success: false,
|
|
15800
15800
|
error: {
|
|
@@ -15803,8 +15803,8 @@ class SubmodelService {
|
|
|
15803
15803
|
},
|
|
15804
15804
|
};
|
|
15805
15805
|
}
|
|
15806
|
-
const submodelResult = await this.
|
|
15807
|
-
configuration: this.
|
|
15806
|
+
const submodelResult = await this.submodelRepositoryClient.getSubmodelById({
|
|
15807
|
+
configuration: this.submodelRepositoryConfig,
|
|
15808
15808
|
submodelIdentifier,
|
|
15809
15809
|
});
|
|
15810
15810
|
if (submodelResult.success) {
|
|
@@ -15841,9 +15841,9 @@ class SubmodelService {
|
|
|
15841
15841
|
async getSubmodelEndpointById(options) {
|
|
15842
15842
|
const { submodelIdentifier, useRegistry = true } = options;
|
|
15843
15843
|
// Try registry first if configured and requested
|
|
15844
|
-
if (useRegistry && this.
|
|
15845
|
-
const descriptorResult = await this.
|
|
15846
|
-
configuration: this.
|
|
15844
|
+
if (useRegistry && this.submodelRegistryConfig) {
|
|
15845
|
+
const descriptorResult = await this.submodelRegistryClient.getSubmodelDescriptorById({
|
|
15846
|
+
configuration: this.submodelRegistryConfig,
|
|
15847
15847
|
submodelIdentifier,
|
|
15848
15848
|
});
|
|
15849
15849
|
if (descriptorResult.success) {
|
|
@@ -15854,7 +15854,7 @@ class SubmodelService {
|
|
|
15854
15854
|
}
|
|
15855
15855
|
}
|
|
15856
15856
|
// Fall back to constructing from repository base
|
|
15857
|
-
if (!this.
|
|
15857
|
+
if (!this.submodelRepositoryConfig) {
|
|
15858
15858
|
return {
|
|
15859
15859
|
success: false,
|
|
15860
15860
|
error: {
|
|
@@ -15863,7 +15863,7 @@ class SubmodelService {
|
|
|
15863
15863
|
},
|
|
15864
15864
|
};
|
|
15865
15865
|
}
|
|
15866
|
-
const repositoryBasePath = this.
|
|
15866
|
+
const repositoryBasePath = this.submodelRepositoryConfig.basePath || 'http://localhost:8082';
|
|
15867
15867
|
const encodedId = base64Encode$1(submodelIdentifier);
|
|
15868
15868
|
const endpoint = `${repositoryBasePath}/submodels/${encodedId}`;
|
|
15869
15869
|
return { success: true, data: endpoint };
|
|
@@ -15900,7 +15900,7 @@ class SubmodelService {
|
|
|
15900
15900
|
// Create configuration for the endpoint
|
|
15901
15901
|
const config = new Configuration({ basePath: baseUrl });
|
|
15902
15902
|
// Fetch the submodel
|
|
15903
|
-
const submodelResult = await this.
|
|
15903
|
+
const submodelResult = await this.submodelRepositoryClient.getSubmodelById({
|
|
15904
15904
|
configuration: config,
|
|
15905
15905
|
submodelIdentifier,
|
|
15906
15906
|
});
|
|
@@ -15936,7 +15936,7 @@ class SubmodelService {
|
|
|
15936
15936
|
*/
|
|
15937
15937
|
async createSubmodel(options) {
|
|
15938
15938
|
const { submodel, registerInRegistry = true } = options;
|
|
15939
|
-
if (!this.
|
|
15939
|
+
if (!this.submodelRepositoryConfig) {
|
|
15940
15940
|
return {
|
|
15941
15941
|
success: false,
|
|
15942
15942
|
error: {
|
|
@@ -15946,18 +15946,18 @@ class SubmodelService {
|
|
|
15946
15946
|
};
|
|
15947
15947
|
}
|
|
15948
15948
|
// Create Submodel in repository
|
|
15949
|
-
const submodelResult = await this.
|
|
15950
|
-
configuration: this.
|
|
15949
|
+
const submodelResult = await this.submodelRepositoryClient.postSubmodel({
|
|
15950
|
+
configuration: this.submodelRepositoryConfig,
|
|
15951
15951
|
submodel: submodel,
|
|
15952
15952
|
});
|
|
15953
15953
|
if (!submodelResult.success) {
|
|
15954
15954
|
return { success: false, error: submodelResult.error };
|
|
15955
15955
|
}
|
|
15956
15956
|
// Register descriptor in registry if configured and requested
|
|
15957
|
-
if (registerInRegistry && this.
|
|
15957
|
+
if (registerInRegistry && this.submodelRegistryConfig) {
|
|
15958
15958
|
const descriptor = this.createDescriptorFromSubmodel(submodel);
|
|
15959
|
-
const descriptorResult = await this.
|
|
15960
|
-
configuration: this.
|
|
15959
|
+
const descriptorResult = await this.submodelRegistryClient.postSubmodelDescriptor({
|
|
15960
|
+
configuration: this.submodelRegistryConfig,
|
|
15961
15961
|
submodelDescriptor: descriptor,
|
|
15962
15962
|
});
|
|
15963
15963
|
if (!descriptorResult.success) {
|
|
@@ -15996,7 +15996,7 @@ class SubmodelService {
|
|
|
15996
15996
|
*/
|
|
15997
15997
|
async updateSubmodel(options) {
|
|
15998
15998
|
const { submodel, updateInRegistry = true } = options;
|
|
15999
|
-
if (!this.
|
|
15999
|
+
if (!this.submodelRepositoryConfig) {
|
|
16000
16000
|
return {
|
|
16001
16001
|
success: false,
|
|
16002
16002
|
error: {
|
|
@@ -16006,8 +16006,8 @@ class SubmodelService {
|
|
|
16006
16006
|
};
|
|
16007
16007
|
}
|
|
16008
16008
|
// Update Submodel in repository
|
|
16009
|
-
const submodelResult = await this.
|
|
16010
|
-
configuration: this.
|
|
16009
|
+
const submodelResult = await this.submodelRepositoryClient.putSubmodelById({
|
|
16010
|
+
configuration: this.submodelRepositoryConfig,
|
|
16011
16011
|
submodelIdentifier: submodel.id,
|
|
16012
16012
|
submodel: submodel,
|
|
16013
16013
|
});
|
|
@@ -16017,10 +16017,10 @@ class SubmodelService {
|
|
|
16017
16017
|
// Use the returned submodel if available, otherwise use the input submodel
|
|
16018
16018
|
const updatedSubmodel = submodelResult.data || submodel;
|
|
16019
16019
|
// Update descriptor in registry if configured and requested
|
|
16020
|
-
if (updateInRegistry && this.
|
|
16020
|
+
if (updateInRegistry && this.submodelRegistryConfig) {
|
|
16021
16021
|
const descriptor = this.createDescriptorFromSubmodel(submodel);
|
|
16022
|
-
const descriptorResult = await this.
|
|
16023
|
-
configuration: this.
|
|
16022
|
+
const descriptorResult = await this.submodelRegistryClient.putSubmodelDescriptorById({
|
|
16023
|
+
configuration: this.submodelRegistryConfig,
|
|
16024
16024
|
submodelIdentifier: submodel.id,
|
|
16025
16025
|
submodelDescriptor: descriptor,
|
|
16026
16026
|
});
|
|
@@ -16060,9 +16060,9 @@ class SubmodelService {
|
|
|
16060
16060
|
async deleteSubmodel(options) {
|
|
16061
16061
|
const { submodelIdentifier, deleteFromRegistry = true } = options;
|
|
16062
16062
|
// Remove from registry first if configured and requested
|
|
16063
|
-
if (deleteFromRegistry && this.
|
|
16064
|
-
const registryResult = await this.
|
|
16065
|
-
configuration: this.
|
|
16063
|
+
if (deleteFromRegistry && this.submodelRegistryConfig) {
|
|
16064
|
+
const registryResult = await this.submodelRegistryClient.deleteSubmodelDescriptorById({
|
|
16065
|
+
configuration: this.submodelRegistryConfig,
|
|
16066
16066
|
submodelIdentifier,
|
|
16067
16067
|
});
|
|
16068
16068
|
if (!registryResult.success) {
|
|
@@ -16070,9 +16070,9 @@ class SubmodelService {
|
|
|
16070
16070
|
}
|
|
16071
16071
|
}
|
|
16072
16072
|
// Remove from repository
|
|
16073
|
-
if (this.
|
|
16074
|
-
const repositoryResult = await this.
|
|
16075
|
-
configuration: this.
|
|
16073
|
+
if (this.submodelRepositoryConfig) {
|
|
16074
|
+
const repositoryResult = await this.submodelRepositoryClient.deleteSubmodelById({
|
|
16075
|
+
configuration: this.submodelRepositoryConfig,
|
|
16076
16076
|
submodelIdentifier,
|
|
16077
16077
|
});
|
|
16078
16078
|
if (!repositoryResult.success) {
|
|
@@ -16090,7 +16090,7 @@ class SubmodelService {
|
|
|
16090
16090
|
*/
|
|
16091
16091
|
createDescriptorFromSubmodel(submodel) {
|
|
16092
16092
|
// Set endpoint using repository base path
|
|
16093
|
-
const repositoryBasePath = this.
|
|
16093
|
+
const repositoryBasePath = this.submodelRepositoryConfig.basePath || 'http://localhost:8082';
|
|
16094
16094
|
const encodedId = base64Encode$1(submodel.id);
|
|
16095
16095
|
const endpoints = [
|
|
16096
16096
|
{
|
|
@@ -16217,24 +16217,24 @@ class SubmodelService {
|
|
|
16217
16217
|
* by coordinating operations across these BaSyx components, demonstrating the multi-client pattern.
|
|
16218
16218
|
*/
|
|
16219
16219
|
class AasService {
|
|
16220
|
-
|
|
16221
|
-
|
|
16220
|
+
aasRegistryClient;
|
|
16221
|
+
aasRepositoryClient;
|
|
16222
16222
|
discoveryClient;
|
|
16223
|
-
|
|
16224
|
-
|
|
16223
|
+
aasRegistryConfig;
|
|
16224
|
+
aasRepositoryConfig;
|
|
16225
16225
|
discoveryConfig;
|
|
16226
16226
|
submodelService;
|
|
16227
16227
|
constructor(config) {
|
|
16228
|
-
this.
|
|
16229
|
-
this.
|
|
16228
|
+
this.aasRegistryClient = new AasRegistryClient();
|
|
16229
|
+
this.aasRepositoryClient = new AasRepositoryClient();
|
|
16230
16230
|
this.discoveryClient = new AasDiscoveryClient();
|
|
16231
|
-
this.
|
|
16232
|
-
this.
|
|
16231
|
+
this.aasRegistryConfig = config.aasRegistryConfig;
|
|
16232
|
+
this.aasRepositoryConfig = config.aasRepositoryConfig;
|
|
16233
16233
|
this.discoveryConfig = config.discoveryConfig;
|
|
16234
16234
|
// Use separate submodel configs if provided, otherwise fall back to AAS configs
|
|
16235
16235
|
this.submodelService = new SubmodelService({
|
|
16236
|
-
|
|
16237
|
-
|
|
16236
|
+
submodelRegistryConfig: config.submodelRegistryConfig ?? config.aasRegistryConfig,
|
|
16237
|
+
submodelRepositoryConfig: config.submodelRepositoryConfig ?? config.aasRepositoryConfig,
|
|
16238
16238
|
conceptDescriptionRepositoryConfig: config.conceptDescriptionRepositoryConfig,
|
|
16239
16239
|
});
|
|
16240
16240
|
}
|
|
@@ -16259,9 +16259,9 @@ class AasService {
|
|
|
16259
16259
|
const preferRegistry = options?.preferRegistry ?? true;
|
|
16260
16260
|
const includeSubmodels = options?.includeSubmodels ?? false;
|
|
16261
16261
|
// Try registry first if configured and preferred
|
|
16262
|
-
if (preferRegistry && this.
|
|
16263
|
-
const registryResult = await this.
|
|
16264
|
-
configuration: this.
|
|
16262
|
+
if (preferRegistry && this.aasRegistryConfig) {
|
|
16263
|
+
const registryResult = await this.aasRegistryClient.getAllAssetAdministrationShellDescriptors({
|
|
16264
|
+
configuration: this.aasRegistryConfig,
|
|
16265
16265
|
limit: options?.limit,
|
|
16266
16266
|
cursor: options?.cursor,
|
|
16267
16267
|
});
|
|
@@ -16274,7 +16274,7 @@ class AasService {
|
|
|
16274
16274
|
// Extract base URL from endpoint (remove /shells/{id} part)
|
|
16275
16275
|
const baseUrl = endpoint.match(/^(https?:\/\/[^/]+(?::\d+)?)/)?.[1] || endpoint;
|
|
16276
16276
|
const config = new Configuration({ basePath: baseUrl });
|
|
16277
|
-
const shellResult = await this.
|
|
16277
|
+
const shellResult = await this.aasRepositoryClient.getAssetAdministrationShellById({
|
|
16278
16278
|
configuration: config,
|
|
16279
16279
|
aasIdentifier: descriptor.id,
|
|
16280
16280
|
});
|
|
@@ -16299,9 +16299,9 @@ class AasService {
|
|
|
16299
16299
|
}
|
|
16300
16300
|
}
|
|
16301
16301
|
// Fall back to repository if registry failed or not configured
|
|
16302
|
-
if (this.
|
|
16303
|
-
const repositoryResult = await this.
|
|
16304
|
-
configuration: this.
|
|
16302
|
+
if (this.aasRepositoryConfig) {
|
|
16303
|
+
const repositoryResult = await this.aasRepositoryClient.getAllAssetAdministrationShells({
|
|
16304
|
+
configuration: this.aasRepositoryConfig,
|
|
16305
16305
|
limit: options?.limit,
|
|
16306
16306
|
cursor: options?.cursor,
|
|
16307
16307
|
});
|
|
@@ -16349,9 +16349,9 @@ class AasService {
|
|
|
16349
16349
|
async getAasById(options) {
|
|
16350
16350
|
const { aasIdentifier, useRegistryEndpoint = true, includeSubmodels = false } = options;
|
|
16351
16351
|
// Try registry-based flow first
|
|
16352
|
-
if (useRegistryEndpoint && this.
|
|
16353
|
-
const descriptorResult = await this.
|
|
16354
|
-
configuration: this.
|
|
16352
|
+
if (useRegistryEndpoint && this.aasRegistryConfig) {
|
|
16353
|
+
const descriptorResult = await this.aasRegistryClient.getAssetAdministrationShellDescriptorById({
|
|
16354
|
+
configuration: this.aasRegistryConfig,
|
|
16355
16355
|
aasIdentifier,
|
|
16356
16356
|
});
|
|
16357
16357
|
if (descriptorResult.success) {
|
|
@@ -16362,7 +16362,7 @@ class AasService {
|
|
|
16362
16362
|
const baseUrl = endpoint.match(/^(https?:\/\/[^/]+(?::\d+)?)/)?.[1] || endpoint;
|
|
16363
16363
|
// Try to fetch from descriptor endpoint
|
|
16364
16364
|
const config = new Configuration({ basePath: baseUrl });
|
|
16365
|
-
const shellResult = await this.
|
|
16365
|
+
const shellResult = await this.aasRepositoryClient.getAssetAdministrationShellById({
|
|
16366
16366
|
configuration: config,
|
|
16367
16367
|
aasIdentifier,
|
|
16368
16368
|
});
|
|
@@ -16387,7 +16387,7 @@ class AasService {
|
|
|
16387
16387
|
}
|
|
16388
16388
|
}
|
|
16389
16389
|
// Fall back to repository
|
|
16390
|
-
if (!this.
|
|
16390
|
+
if (!this.aasRepositoryConfig) {
|
|
16391
16391
|
return {
|
|
16392
16392
|
success: false,
|
|
16393
16393
|
error: {
|
|
@@ -16396,8 +16396,8 @@ class AasService {
|
|
|
16396
16396
|
},
|
|
16397
16397
|
};
|
|
16398
16398
|
}
|
|
16399
|
-
const shellResult = await this.
|
|
16400
|
-
configuration: this.
|
|
16399
|
+
const shellResult = await this.aasRepositoryClient.getAssetAdministrationShellById({
|
|
16400
|
+
configuration: this.aasRepositoryConfig,
|
|
16401
16401
|
aasIdentifier,
|
|
16402
16402
|
});
|
|
16403
16403
|
if (shellResult.success) {
|
|
@@ -16435,9 +16435,9 @@ class AasService {
|
|
|
16435
16435
|
async getAasEndpointById(options) {
|
|
16436
16436
|
const { aasIdentifier, useRegistry = true } = options;
|
|
16437
16437
|
// Try registry first if configured and requested
|
|
16438
|
-
if (useRegistry && this.
|
|
16439
|
-
const descriptorResult = await this.
|
|
16440
|
-
configuration: this.
|
|
16438
|
+
if (useRegistry && this.aasRegistryConfig) {
|
|
16439
|
+
const descriptorResult = await this.aasRegistryClient.getAssetAdministrationShellDescriptorById({
|
|
16440
|
+
configuration: this.aasRegistryConfig,
|
|
16441
16441
|
aasIdentifier,
|
|
16442
16442
|
});
|
|
16443
16443
|
if (descriptorResult.success) {
|
|
@@ -16448,7 +16448,7 @@ class AasService {
|
|
|
16448
16448
|
}
|
|
16449
16449
|
}
|
|
16450
16450
|
// Fall back to constructing from repository base
|
|
16451
|
-
if (!this.
|
|
16451
|
+
if (!this.aasRepositoryConfig) {
|
|
16452
16452
|
return {
|
|
16453
16453
|
success: false,
|
|
16454
16454
|
error: {
|
|
@@ -16457,7 +16457,7 @@ class AasService {
|
|
|
16457
16457
|
},
|
|
16458
16458
|
};
|
|
16459
16459
|
}
|
|
16460
|
-
const repositoryBasePath = this.
|
|
16460
|
+
const repositoryBasePath = this.aasRepositoryConfig.basePath || 'http://localhost:8081';
|
|
16461
16461
|
const encodedId = base64Encode$1(aasIdentifier);
|
|
16462
16462
|
const endpoint = `${repositoryBasePath}/shells/${encodedId}`;
|
|
16463
16463
|
return { success: true, data: endpoint };
|
|
@@ -16495,7 +16495,7 @@ class AasService {
|
|
|
16495
16495
|
// Create configuration for the endpoint
|
|
16496
16496
|
const config = new Configuration({ basePath: baseUrl });
|
|
16497
16497
|
// Fetch the shell
|
|
16498
|
-
const shellResult = await this.
|
|
16498
|
+
const shellResult = await this.aasRepositoryClient.getAssetAdministrationShellById({
|
|
16499
16499
|
configuration: config,
|
|
16500
16500
|
aasIdentifier,
|
|
16501
16501
|
});
|
|
@@ -16532,7 +16532,7 @@ class AasService {
|
|
|
16532
16532
|
*/
|
|
16533
16533
|
async createAas(options) {
|
|
16534
16534
|
const { shell, registerInRegistry = true } = options;
|
|
16535
|
-
if (!this.
|
|
16535
|
+
if (!this.aasRepositoryConfig) {
|
|
16536
16536
|
return {
|
|
16537
16537
|
success: false,
|
|
16538
16538
|
error: {
|
|
@@ -16542,18 +16542,18 @@ class AasService {
|
|
|
16542
16542
|
};
|
|
16543
16543
|
}
|
|
16544
16544
|
// Create AAS in repository
|
|
16545
|
-
const shellResult = await this.
|
|
16546
|
-
configuration: this.
|
|
16545
|
+
const shellResult = await this.aasRepositoryClient.postAssetAdministrationShell({
|
|
16546
|
+
configuration: this.aasRepositoryConfig,
|
|
16547
16547
|
assetAdministrationShell: shell,
|
|
16548
16548
|
});
|
|
16549
16549
|
if (!shellResult.success) {
|
|
16550
16550
|
return { success: false, error: shellResult.error };
|
|
16551
16551
|
}
|
|
16552
16552
|
// Register descriptor in registry if configured and requested
|
|
16553
|
-
if (registerInRegistry && this.
|
|
16553
|
+
if (registerInRegistry && this.aasRegistryConfig) {
|
|
16554
16554
|
const descriptor = this.createDescriptorFromAas(shell);
|
|
16555
|
-
const descriptorResult = await this.
|
|
16556
|
-
configuration: this.
|
|
16555
|
+
const descriptorResult = await this.aasRegistryClient.postAssetAdministrationShellDescriptor({
|
|
16556
|
+
configuration: this.aasRegistryConfig,
|
|
16557
16557
|
assetAdministrationShellDescriptor: descriptor,
|
|
16558
16558
|
});
|
|
16559
16559
|
if (!descriptorResult.success) {
|
|
@@ -16592,7 +16592,7 @@ class AasService {
|
|
|
16592
16592
|
*/
|
|
16593
16593
|
async updateAas(options) {
|
|
16594
16594
|
const { shell, updateInRegistry = true } = options;
|
|
16595
|
-
if (!this.
|
|
16595
|
+
if (!this.aasRepositoryConfig) {
|
|
16596
16596
|
return {
|
|
16597
16597
|
success: false,
|
|
16598
16598
|
error: {
|
|
@@ -16602,8 +16602,8 @@ class AasService {
|
|
|
16602
16602
|
};
|
|
16603
16603
|
}
|
|
16604
16604
|
// Update AAS in repository
|
|
16605
|
-
const shellResult = await this.
|
|
16606
|
-
configuration: this.
|
|
16605
|
+
const shellResult = await this.aasRepositoryClient.putAssetAdministrationShellById({
|
|
16606
|
+
configuration: this.aasRepositoryConfig,
|
|
16607
16607
|
aasIdentifier: shell.id,
|
|
16608
16608
|
assetAdministrationShell: shell,
|
|
16609
16609
|
});
|
|
@@ -16613,10 +16613,10 @@ class AasService {
|
|
|
16613
16613
|
// Use the returned shell if available, otherwise use the input shell
|
|
16614
16614
|
const updatedShell = shellResult.data || shell;
|
|
16615
16615
|
// Update descriptor in registry if configured and requested
|
|
16616
|
-
if (updateInRegistry && this.
|
|
16616
|
+
if (updateInRegistry && this.aasRegistryConfig) {
|
|
16617
16617
|
const descriptor = this.createDescriptorFromAas(shell);
|
|
16618
|
-
const descriptorResult = await this.
|
|
16619
|
-
configuration: this.
|
|
16618
|
+
const descriptorResult = await this.aasRegistryClient.putAssetAdministrationShellDescriptorById({
|
|
16619
|
+
configuration: this.aasRegistryConfig,
|
|
16620
16620
|
aasIdentifier: shell.id,
|
|
16621
16621
|
assetAdministrationShellDescriptor: descriptor,
|
|
16622
16622
|
});
|
|
@@ -16658,9 +16658,9 @@ class AasService {
|
|
|
16658
16658
|
async deleteAas(options) {
|
|
16659
16659
|
const { aasIdentifier, deleteFromRegistry = true } = options;
|
|
16660
16660
|
// Remove from registry first if configured and requested
|
|
16661
|
-
if (deleteFromRegistry && this.
|
|
16662
|
-
const registryResult = await this.
|
|
16663
|
-
configuration: this.
|
|
16661
|
+
if (deleteFromRegistry && this.aasRegistryConfig) {
|
|
16662
|
+
const registryResult = await this.aasRegistryClient.deleteAssetAdministrationShellDescriptorById({
|
|
16663
|
+
configuration: this.aasRegistryConfig,
|
|
16664
16664
|
aasIdentifier,
|
|
16665
16665
|
});
|
|
16666
16666
|
if (!registryResult.success) {
|
|
@@ -16668,9 +16668,9 @@ class AasService {
|
|
|
16668
16668
|
}
|
|
16669
16669
|
}
|
|
16670
16670
|
// Remove from repository
|
|
16671
|
-
if (this.
|
|
16672
|
-
const repoResult = await this.
|
|
16673
|
-
configuration: this.
|
|
16671
|
+
if (this.aasRepositoryConfig) {
|
|
16672
|
+
const repoResult = await this.aasRepositoryClient.deleteAssetAdministrationShellById({
|
|
16673
|
+
configuration: this.aasRepositoryConfig,
|
|
16674
16674
|
aasIdentifier,
|
|
16675
16675
|
});
|
|
16676
16676
|
if (!repoResult.success) {
|
|
@@ -16872,7 +16872,7 @@ class AasService {
|
|
|
16872
16872
|
null // endpoints set below
|
|
16873
16873
|
);
|
|
16874
16874
|
// Set endpoint using repository base path
|
|
16875
|
-
const repositoryBasePath = this.
|
|
16875
|
+
const repositoryBasePath = this.aasRepositoryConfig.basePath || 'http://localhost:8081';
|
|
16876
16876
|
const encodedId = base64Encode$1(shell.id);
|
|
16877
16877
|
descriptor.endpoints = [
|
|
16878
16878
|
{
|