basyx-typescript-sdk 0.2.0 → 0.2.2
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/README.md +1 -1
- package/bundle/index.js +237 -230
- package/bundle/index.js.map +1 -1
- package/dist/clients/AasRepositoryClient.d.ts +198 -128
- package/dist/clients/AasRepositoryClient.js +235 -228
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/models/AssetId.d.ts +11 -0
- package/dist/models/AssetId.js +1 -0
- package/dist/models/api.d.ts +12 -0
- package/dist/models/api.js +1 -0
- package/dist/models/index.d.ts +3 -0
- package/dist/models/index.js +3 -0
- package/package.json +1 -1
|
@@ -1,157 +1,227 @@
|
|
|
1
1
|
import type { AssetAdministrationShell, AssetInformation, Reference } from '@aas-core-works/aas-core3.0-typescript/types';
|
|
2
|
-
import {
|
|
2
|
+
import type { ApiResult } from '../models/api';
|
|
3
|
+
import type { AssetId } from '../models/AssetId';
|
|
4
|
+
import * as AasRepository from '../generated';
|
|
3
5
|
export declare class AasRepositoryClient {
|
|
4
6
|
/**
|
|
5
|
-
* Returns all Asset Administration Shells
|
|
6
|
-
*
|
|
7
|
-
* @
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* @returns {
|
|
7
|
+
* Returns all Asset Administration Shells.
|
|
8
|
+
*
|
|
9
|
+
* @param options Object containing:
|
|
10
|
+
* - baseUrl: The API base URL
|
|
11
|
+
* - headers?: Optional Request headers
|
|
12
|
+
* - assetIds?: A list of asset identifiers
|
|
13
|
+
* - idShort?: The AAS's idShort
|
|
14
|
+
* - limit?: Max number of elements to return
|
|
15
|
+
* - cursor?: A paging cursor from previous responses
|
|
16
|
+
*
|
|
17
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
16
18
|
*/
|
|
17
|
-
getAllAssetAdministrationShells(
|
|
19
|
+
getAllAssetAdministrationShells(options: {
|
|
20
|
+
baseUrl: string;
|
|
21
|
+
headers?: Headers;
|
|
22
|
+
assetIds?: AssetId[];
|
|
23
|
+
idShort?: string;
|
|
24
|
+
limit?: number;
|
|
25
|
+
cursor?: string;
|
|
26
|
+
}): Promise<ApiResult<{
|
|
27
|
+
pagedResult: AasRepository.PagedResultPagingMetadata | undefined;
|
|
28
|
+
result: AssetAdministrationShell[];
|
|
29
|
+
}, AasRepository.GetAllAssetAdministrationShellsError | Error>>;
|
|
18
30
|
/**
|
|
19
|
-
* Creates a new Asset Administration Shell
|
|
20
|
-
*
|
|
21
|
-
* @
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* @returns {
|
|
31
|
+
* Creates a new Asset Administration Shell.
|
|
32
|
+
*
|
|
33
|
+
* @param options Object containing:
|
|
34
|
+
* - baseUrl: The API base URL
|
|
35
|
+
* - assetAdministrationShell: The AAS to create
|
|
36
|
+
* - headers?: Optional request headers
|
|
37
|
+
*
|
|
38
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
27
39
|
*/
|
|
28
|
-
postAssetAdministrationShell(
|
|
40
|
+
postAssetAdministrationShell(options: {
|
|
41
|
+
baseUrl: string;
|
|
42
|
+
headers?: Headers;
|
|
43
|
+
assetAdministrationShell: AssetAdministrationShell;
|
|
44
|
+
}): Promise<ApiResult<AssetAdministrationShell, AasRepository.PostAssetAdministrationShellError | Error>>;
|
|
29
45
|
/**
|
|
30
|
-
* Deletes an Asset Administration Shell
|
|
31
|
-
*
|
|
32
|
-
* @
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* @returns {
|
|
46
|
+
* Deletes an Asset Administration Shell by its unique identifier.
|
|
47
|
+
*
|
|
48
|
+
* @param options Object containing:
|
|
49
|
+
* - baseUrl: The API base URL
|
|
50
|
+
* - aasIdentifier: The unique ID for the AAS
|
|
51
|
+
* - headers?: Optional request headers
|
|
52
|
+
*
|
|
53
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
38
54
|
*/
|
|
39
|
-
deleteAssetAdministrationShellById(
|
|
55
|
+
deleteAssetAdministrationShellById(options: {
|
|
56
|
+
baseUrl: string;
|
|
57
|
+
aasIdentifier: string;
|
|
58
|
+
headers?: Headers;
|
|
59
|
+
}): Promise<ApiResult<AasRepository.DeleteAssetAdministrationShellByIdResponse, AasRepository.DeleteAssetAdministrationShellByIdError | Error>>;
|
|
40
60
|
/**
|
|
41
|
-
* Returns a specific Asset Administration Shell
|
|
42
|
-
*
|
|
43
|
-
* @
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* @returns {
|
|
61
|
+
* Returns a specific Asset Administration Shell by its unique identifier.
|
|
62
|
+
*
|
|
63
|
+
* @param options Object containing:
|
|
64
|
+
* - baseUrl: The API base URL
|
|
65
|
+
* - aasIdentifier: The unique ID
|
|
66
|
+
* - headers?: Optional request headers
|
|
67
|
+
*
|
|
68
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
49
69
|
*/
|
|
50
|
-
getAssetAdministrationShellById(
|
|
70
|
+
getAssetAdministrationShellById(options: {
|
|
71
|
+
baseUrl: string;
|
|
72
|
+
aasIdentifier: string;
|
|
73
|
+
headers?: Headers;
|
|
74
|
+
}): Promise<ApiResult<AssetAdministrationShell, AasRepository.GetAssetAdministrationShellByIdError | Error>>;
|
|
51
75
|
/**
|
|
52
|
-
* Updates an existing Asset Administration Shell
|
|
53
|
-
*
|
|
54
|
-
* @
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* @returns {
|
|
76
|
+
* Updates an existing Asset Administration Shell by ID (PUT).
|
|
77
|
+
*
|
|
78
|
+
* @param options Object containing:
|
|
79
|
+
* - baseUrl: The API base URL
|
|
80
|
+
* - aasIdentifier: The unique ID
|
|
81
|
+
* - assetAdministrationShell: The updated AAS object
|
|
82
|
+
* - headers?: Optional request headers
|
|
83
|
+
*
|
|
84
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
61
85
|
*/
|
|
62
|
-
putAssetAdministrationShellById(
|
|
86
|
+
putAssetAdministrationShellById(options: {
|
|
87
|
+
baseUrl: string;
|
|
88
|
+
aasIdentifier: string;
|
|
89
|
+
assetAdministrationShell: AssetAdministrationShell;
|
|
90
|
+
headers?: Headers;
|
|
91
|
+
}): Promise<ApiResult<AasRepository.PutAssetAdministrationShellByIdResponse, AasRepository.PutAssetAdministrationShellByIdError | Error>>;
|
|
63
92
|
/**
|
|
64
|
-
* Returns the
|
|
65
|
-
*
|
|
66
|
-
* @
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* @returns {
|
|
93
|
+
* Returns the AssetInformation for the given AAS.
|
|
94
|
+
*
|
|
95
|
+
* @param options Object containing:
|
|
96
|
+
* - baseUrl: The API base URL
|
|
97
|
+
* - aasIdentifier: The unique ID
|
|
98
|
+
* - headers?: Optional request headers
|
|
99
|
+
*
|
|
100
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
72
101
|
*/
|
|
73
|
-
getAssetInformation(
|
|
102
|
+
getAssetInformation(options: {
|
|
103
|
+
baseUrl: string;
|
|
104
|
+
aasIdentifier: string;
|
|
105
|
+
headers?: Headers;
|
|
106
|
+
}): Promise<ApiResult<AssetInformation, AasRepository.GetAssetInformationAasRepositoryError | Error>>;
|
|
74
107
|
/**
|
|
75
|
-
* Updates the
|
|
76
|
-
*
|
|
77
|
-
* @
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
* @returns {
|
|
108
|
+
* Updates the AssetInformation for the given AAS.
|
|
109
|
+
*
|
|
110
|
+
* @param options Object containing:
|
|
111
|
+
* - baseUrl: The API base URL
|
|
112
|
+
* - aasIdentifier: The unique ID
|
|
113
|
+
* - assetInformation: The updated AssetInformation object
|
|
114
|
+
* - headers?: Optional request headers
|
|
115
|
+
*
|
|
116
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
84
117
|
*/
|
|
85
|
-
putAssetInformation(
|
|
118
|
+
putAssetInformation(options: {
|
|
119
|
+
baseUrl: string;
|
|
120
|
+
aasIdentifier: string;
|
|
121
|
+
assetInformation: AssetInformation;
|
|
122
|
+
headers?: Headers;
|
|
123
|
+
}): Promise<ApiResult<AasRepository.PutAssetInformationAasRepositoryResponse, AasRepository.PutAssetInformationAasRepositoryError | Error>>;
|
|
86
124
|
/**
|
|
87
|
-
* Deletes the Thumbnail
|
|
88
|
-
*
|
|
89
|
-
* @
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* @returns {
|
|
125
|
+
* Deletes the Thumbnail associated with the given AAS.
|
|
126
|
+
*
|
|
127
|
+
* @param options Object containing:
|
|
128
|
+
* - baseUrl: The API base URL
|
|
129
|
+
* - aasIdentifier: The unique ID
|
|
130
|
+
* - headers?: Optional request headers
|
|
131
|
+
*
|
|
132
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
95
133
|
*/
|
|
96
|
-
deleteThumbnail(
|
|
134
|
+
deleteThumbnail(options: {
|
|
135
|
+
baseUrl: string;
|
|
136
|
+
aasIdentifier: string;
|
|
137
|
+
headers?: Headers;
|
|
138
|
+
}): Promise<ApiResult<AasRepository.DeleteThumbnailAasRepositoryResponses, AasRepository.DeleteThumbnailAasRepositoryError | Error>>;
|
|
97
139
|
/**
|
|
98
|
-
* Returns the Thumbnail
|
|
99
|
-
*
|
|
100
|
-
* @
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
* @returns {
|
|
140
|
+
* Returns the Thumbnail associated with an AAS, if any.
|
|
141
|
+
*
|
|
142
|
+
* @param options Object containing:
|
|
143
|
+
* - baseUrl: The API base URL
|
|
144
|
+
* - aasIdentifier: The unique ID
|
|
145
|
+
* - headers?: Optional request headers
|
|
146
|
+
*
|
|
147
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
106
148
|
*/
|
|
107
|
-
getThumbnail(
|
|
149
|
+
getThumbnail(options: {
|
|
150
|
+
baseUrl: string;
|
|
151
|
+
aasIdentifier: string;
|
|
152
|
+
headers?: Headers;
|
|
153
|
+
}): Promise<ApiResult<Blob | File, AasRepository.GetThumbnailAasRepositoryError | Error>>;
|
|
108
154
|
/**
|
|
109
|
-
* Updates the Thumbnail
|
|
110
|
-
*
|
|
111
|
-
* @
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
* @returns {
|
|
155
|
+
* Updates (or creates) the Thumbnail for the given AAS.
|
|
156
|
+
*
|
|
157
|
+
* @param options Object containing:
|
|
158
|
+
* - baseUrl: The API base URL
|
|
159
|
+
* - aasIdentifier: The unique ID
|
|
160
|
+
* - thumbnail: The thumbnail data to upload
|
|
161
|
+
* - headers?: Optional request headers
|
|
162
|
+
*
|
|
163
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
118
164
|
*/
|
|
119
|
-
putThumbnail(
|
|
165
|
+
putThumbnail(options: {
|
|
166
|
+
baseUrl: string;
|
|
167
|
+
aasIdentifier: string;
|
|
168
|
+
thumbnail: AasRepository.AssetinformationThumbnailBody;
|
|
169
|
+
headers?: Headers;
|
|
170
|
+
}): Promise<ApiResult<AasRepository.PutThumbnailAasRepositoryResponse, AasRepository.PutThumbnailAasRepositoryError | Error>>;
|
|
120
171
|
/**
|
|
121
|
-
* Returns all submodel references
|
|
122
|
-
*
|
|
123
|
-
* @
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
* @returns {
|
|
172
|
+
* Returns all submodel references for the given AAS.
|
|
173
|
+
*
|
|
174
|
+
* @param options Object containing:
|
|
175
|
+
* - baseUrl: The API base URL
|
|
176
|
+
* - aasIdentifier: The unique ID
|
|
177
|
+
* - headers?: Optional request headers
|
|
178
|
+
* - limit?: Max number of elements
|
|
179
|
+
* - cursor?: Paging cursor
|
|
180
|
+
*
|
|
181
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
131
182
|
*/
|
|
132
|
-
getAllSubmodelReferences(
|
|
183
|
+
getAllSubmodelReferences(options: {
|
|
184
|
+
baseUrl: string;
|
|
185
|
+
aasIdentifier: string;
|
|
186
|
+
headers?: Headers;
|
|
187
|
+
limit?: number;
|
|
188
|
+
cursor?: string;
|
|
189
|
+
}): Promise<ApiResult<{
|
|
190
|
+
pagedResult: AasRepository.PagedResultPagingMetadata | undefined;
|
|
191
|
+
result: Reference[];
|
|
192
|
+
}, AasRepository.GetAllSubmodelReferencesAasRepositoryError | Error>>;
|
|
133
193
|
/**
|
|
134
|
-
* Creates a submodel reference at the
|
|
135
|
-
*
|
|
136
|
-
* @
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
* @returns {
|
|
194
|
+
* Creates a submodel reference at the given AAS.
|
|
195
|
+
*
|
|
196
|
+
* @param options Object containing:
|
|
197
|
+
* - baseUrl: The API base URL
|
|
198
|
+
* - aasIdentifier: The unique ID of the AAS
|
|
199
|
+
* - submodelReference: The Reference to the submodel
|
|
200
|
+
* - headers?: Optional request headers
|
|
201
|
+
*
|
|
202
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
143
203
|
*/
|
|
144
|
-
postSubmodelReference(
|
|
204
|
+
postSubmodelReference(options: {
|
|
205
|
+
baseUrl: string;
|
|
206
|
+
aasIdentifier: string;
|
|
207
|
+
submodelReference: Reference;
|
|
208
|
+
headers?: Headers;
|
|
209
|
+
}): Promise<ApiResult<Reference, AasRepository.PostSubmodelReferenceAasRepositoryError | Error>>;
|
|
145
210
|
/**
|
|
146
|
-
* Deletes
|
|
147
|
-
*
|
|
148
|
-
* @
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
* @returns {
|
|
211
|
+
* Deletes a submodel reference from the given AAS (does not delete the submodel itself).
|
|
212
|
+
*
|
|
213
|
+
* @param options Object containing:
|
|
214
|
+
* - baseUrl: The API base URL
|
|
215
|
+
* - aasIdentifier: Unique ID of the AAS
|
|
216
|
+
* - submodelIdentifier: The submodel's unique ID
|
|
217
|
+
* - headers?: Optional request headers
|
|
218
|
+
*
|
|
219
|
+
* @returns Either `{ success: true; data: ... }` or `{ success: false; error: ... }`.
|
|
155
220
|
*/
|
|
156
|
-
deleteSubmodelReferenceById(
|
|
221
|
+
deleteSubmodelReferenceById(options: {
|
|
222
|
+
baseUrl: string;
|
|
223
|
+
aasIdentifier: string;
|
|
224
|
+
submodelIdentifier: string;
|
|
225
|
+
headers?: Headers;
|
|
226
|
+
}): Promise<ApiResult<AasRepository.DeleteSubmodelReferenceByIdAasRepositoryResponse, AasRepository.DeleteSubmodelReferenceByIdAasRepositoryError | Error>>;
|
|
157
227
|
}
|