basyx-typescript-sdk 0.1.11 → 0.2.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.
@@ -1,158 +1,227 @@
1
1
  import type { AssetAdministrationShell, AssetInformation, Reference } from '@aas-core-works/aas-core3.0-typescript/types';
2
- import { AssetinformationThumbnailBody } from '../generated/types.gen';
3
- import { GetAllAssetAdministrationShellsResponse, getAllSubmodelReferencesResponse } from '../models/aas-repository';
2
+ import type { ApiResult } from '../models/api';
3
+ import type { AssetId } from '../models/AssetId';
4
+ import * as AasRepository from '../generated';
4
5
  export declare class AasRepositoryClient {
5
6
  /**
6
- * Returns all Asset Administration Shells
7
- *
8
- * @async
9
- * @function getAllAssetAdministrationShells
10
- * @param baseURL The API base URL
11
- * @param headers Request headers
12
- * @param assetIds A list of specific Asset identifiers. Every single value asset identifier is a base64-url-encoded
13
- * @param idShort The Asset Administration Shell’s IdShort
14
- * @param limit The maximum number of elements in the response array
15
- * @param cursor A server-generated identifier retrieved from pagingMetadata that specifies from which position the result listing should continue
16
- * @returns {Promise<GetAllAssetAdministrationShellsResponse>} Requested Asset Administration Shells
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: ... }`.
17
18
  */
18
- getAllAssetAdministrationShells(baseURL: string, headers?: Headers, assetIds?: string[], idShort?: string, limit?: number, cursor?: string): Promise<GetAllAssetAdministrationShellsResponse>;
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>>;
19
30
  /**
20
- * Creates a new Asset Administration Shell
21
- *
22
- * @async
23
- * @function postAssetAdministrationShell
24
- * @param baseURL The API base URL
25
- * @param assetAdministrationShell Asset Administration Shell object
26
- * @param headers Request headers
27
- * @returns {Promise<AssetAdministrationShell>} Asset Administration Shell created successfully
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: ... }`.
28
39
  */
29
- postAssetAdministrationShell(baseURL: string, assetAdministrationShell: AssetAdministrationShell, headers?: Headers): Promise<AssetAdministrationShell>;
40
+ postAssetAdministrationShell(options: {
41
+ baseUrl: string;
42
+ headers?: Headers;
43
+ assetAdministrationShell: AssetAdministrationShell;
44
+ }): Promise<ApiResult<AssetAdministrationShell, AasRepository.PostAssetAdministrationShellError | Error>>;
30
45
  /**
31
- * Deletes an Asset Administration Shell
32
- *
33
- * @async
34
- * @function deleteAssetAdministrationShellById
35
- * @param baseURL The API base URL
36
- * @param aasIdentifier The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
37
- * @param headers Request headers
38
- * @returns {Promise<void>} Asset Administration Shell deleted successfully
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: ... }`.
39
54
  */
40
- deleteAssetAdministrationShellById(baseURL: string, aasIdentifier: string, headers?: Headers): Promise<void>;
55
+ deleteAssetAdministrationShellById(options: {
56
+ baseUrl: string;
57
+ aasIdentifier: string;
58
+ headers?: Headers;
59
+ }): Promise<ApiResult<AasRepository.DeleteAssetAdministrationShellByIdResponse, AasRepository.DeleteAssetAdministrationShellByIdError | Error>>;
41
60
  /**
42
- * Returns a specific Asset Administration Shell
43
- *
44
- * @async
45
- * @function getAssetAdministrationShellById
46
- * @param baseURL The API base URL
47
- * @param aasIdentifier The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
48
- * @param headers Request headers
49
- * @returns {Promise<AssetAdministrationShell>} Requested Asset Administration Shell
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: ... }`.
50
69
  */
51
- getAssetAdministrationShellById(baseURL: string, aasIdentifier: string, headers?: Headers): Promise<AssetAdministrationShell>;
70
+ getAssetAdministrationShellById(options: {
71
+ baseUrl: string;
72
+ aasIdentifier: string;
73
+ headers?: Headers;
74
+ }): Promise<ApiResult<AssetAdministrationShell, AasRepository.GetAssetAdministrationShellByIdError | Error>>;
52
75
  /**
53
- * Updates an existing Asset Administration Shell
54
- *
55
- * @async
56
- * @function putAssetAdministrationShellById
57
- * @param baseURL The API base URL
58
- * @param aasIdentifier The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
59
- * @param assetAdministrationShell Asset Administration Shell object
60
- * @param headers Request headers
61
- * @returns {Promise<void>} Asset Administration Shell updated successfully
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: ... }`.
62
85
  */
63
- putAssetAdministrationShellById(baseURL: string, aasIdentifier: string, assetAdministrationShell: AssetAdministrationShell, headers?: Headers): Promise<void>;
86
+ putAssetAdministrationShellById(options: {
87
+ baseUrl: string;
88
+ aasIdentifier: string;
89
+ assetAdministrationShell: AssetAdministrationShell;
90
+ headers?: Headers;
91
+ }): Promise<ApiResult<AasRepository.PutAssetAdministrationShellByIdResponse, AasRepository.PutAssetAdministrationShellByIdError | Error>>;
64
92
  /**
65
- * Returns the Asset Information
66
- *
67
- * @async
68
- * @function getAssetInformation
69
- * @param baseURL The API base URL
70
- * @param aasIdentifier The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
71
- * @param headers Request headers
72
- * @returns {Promise<AssetInformation>} Requested Asset Information
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: ... }`.
73
101
  */
74
- getAssetInformation(baseURL: string, aasIdentifier: string, headers?: Headers): Promise<AssetInformation>;
102
+ getAssetInformation(options: {
103
+ baseUrl: string;
104
+ aasIdentifier: string;
105
+ headers?: Headers;
106
+ }): Promise<ApiResult<AssetInformation, AasRepository.GetAssetInformationAasRepositoryError | Error>>;
75
107
  /**
76
- * Updates the Asset Information
77
- *
78
- * @async
79
- * @function putAssetInformation
80
- * @param baseURL The API base URL
81
- * @param aasIdentifier The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
82
- * @param assetInformation Asset Information object
83
- * @param headers Request headers
84
- * @returns {Promise<void>} Asset Information updated successfully
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: ... }`.
85
117
  */
86
- putAssetInformation(baseURL: string, aasIdentifier: string, assetInformation: AssetInformation, headers?: Headers): Promise<void>;
118
+ putAssetInformation(options: {
119
+ baseUrl: string;
120
+ aasIdentifier: string;
121
+ assetInformation: AssetInformation;
122
+ headers?: Headers;
123
+ }): Promise<ApiResult<AasRepository.PutAssetInformationAasRepositoryResponse, AasRepository.PutAssetInformationAasRepositoryError | Error>>;
87
124
  /**
88
- * Deletes the Thumbnail
89
- *
90
- * @async
91
- * @function deleteThumbnail
92
- * @param baseURL The API base URL
93
- * @param aasIdentifier The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
94
- * @param headers Request headers
95
- * @returns {Promise<void>} Thumbnail deletion successful
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: ... }`.
96
133
  */
97
- deleteThumbnail(baseURL: string, aasIdentifier: string, headers?: Headers): Promise<void>;
134
+ deleteThumbnail(options: {
135
+ baseUrl: string;
136
+ aasIdentifier: string;
137
+ headers?: Headers;
138
+ }): Promise<ApiResult<AasRepository.DeleteThumbnailAasRepositoryResponses, AasRepository.DeleteThumbnailAasRepositoryError | Error>>;
98
139
  /**
99
- * Returns the Thumbnail
100
- *
101
- * @async
102
- * @function getThumbnail
103
- * @param baseURL The API base URL
104
- * @param aasIdentifier The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
105
- * @param headers Request headers
106
- * @returns {Promise<Blob | File>} The thumbnail of the Asset Information.
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: ... }`.
107
148
  */
108
- getThumbnail(baseURL: string, aasIdentifier: string, headers?: Headers): Promise<Blob | File>;
149
+ getThumbnail(options: {
150
+ baseUrl: string;
151
+ aasIdentifier: string;
152
+ headers?: Headers;
153
+ }): Promise<ApiResult<Blob | File, AasRepository.GetThumbnailAasRepositoryError | Error>>;
109
154
  /**
110
- * Updates the Thumbnail
111
- *
112
- * @async
113
- * @function putThumbnail
114
- * @param baseURL The API base URL
115
- * @param aasIdentifier The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
116
- * @param thumbnail Thumbnail to upload
117
- * @param headers Request headers
118
- * @returns {Promise<void>} Thumbnail updated successfully
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: ... }`.
119
164
  */
120
- putThumbnail(baseURL: string, aasIdentifier: string, thumbnail: AssetinformationThumbnailBody, headers?: Headers): Promise<void>;
165
+ putThumbnail(options: {
166
+ baseUrl: string;
167
+ aasIdentifier: string;
168
+ thumbnail: AasRepository.AssetinformationThumbnailBody;
169
+ headers?: Headers;
170
+ }): Promise<ApiResult<AasRepository.PutThumbnailAasRepositoryResponse, AasRepository.PutThumbnailAasRepositoryError | Error>>;
121
171
  /**
122
- * Returns all submodel references
123
- *
124
- * @async
125
- * @function getAllSubmodelReferences
126
- * @param baseURL The API base URL
127
- * @param aasIdentifier The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
128
- * @param headers Request headers
129
- * @param limit The maximum number of elements in the response array
130
- * @param cursor A server-generated identifier retrieved from pagingMetadata that specifies from which position the result listing should continue
131
- * @returns {Promise<getAllSubmodelReferencesResponse>} Requested submodel references
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: ... }`.
132
182
  */
133
- getAllSubmodelReferences(baseURL: string, aasIdentifier: string, headers?: Headers, limit?: number, cursor?: string): Promise<getAllSubmodelReferencesResponse>;
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>>;
134
193
  /**
135
- * Creates a submodel reference at the Asset Administration Shell
136
- *
137
- * @async
138
- * @function postSubmodelReference
139
- * @param baseURL The API base URL
140
- * @param aasIdentifier The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
141
- * @param submodelReference Reference to the Submodel
142
- * @param headers Request headers
143
- * @returns {promise<Reference>} Submodel reference created successfully
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: ... }`.
144
203
  */
145
- postSubmodelReference(baseURL: string, aasIdentifier: string, submodelReference: Reference, headers?: Headers): Promise<Reference>;
204
+ postSubmodelReference(options: {
205
+ baseUrl: string;
206
+ aasIdentifier: string;
207
+ submodelReference: Reference;
208
+ headers?: Headers;
209
+ }): Promise<ApiResult<Reference, AasRepository.PostSubmodelReferenceAasRepositoryError | Error>>;
146
210
  /**
147
- * Deletes the submodel reference from the Asset Administration Shell. Does not delete the submodel itself!
148
- *
149
- * @async
150
- * @function deleteSubmodelReferenceById
151
- * @param baseURL The API base URL
152
- * @param aasIdentifier The Asset Administration Shell’s unique id (UTF8-BASE64-URL-encoded)
153
- * @param submodelIdentifier The Submodel’s unique id (UTF8-BASE64-URL-encoded)
154
- * @param headers Request headers
155
- * @returns {Promise<void>} Submodel reference deleted successfully
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: ... }`.
156
220
  */
157
- deleteSubmodelReferenceById(baseURL: string, aasIdentifier: string, submodelIdentifier: string, headers?: Headers): Promise<void>;
221
+ deleteSubmodelReferenceById(options: {
222
+ baseUrl: string;
223
+ aasIdentifier: string;
224
+ submodelIdentifier: string;
225
+ headers?: Headers;
226
+ }): Promise<ApiResult<AasRepository.DeleteSubmodelReferenceByIdAasRepositoryResponse, AasRepository.DeleteSubmodelReferenceByIdAasRepositoryError | Error>>;
158
227
  }