basyx-typescript-sdk 0.2.1 → 0.9.0

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.
Files changed (155) hide show
  1. package/README.md +5 -3
  2. package/bundle/index.js +17522 -841
  3. package/bundle/index.js.map +1 -1
  4. package/dist/clients/AasDiscoveryClient.d.ts +67 -0
  5. package/dist/clients/AasDiscoveryClient.js +115 -0
  6. package/dist/clients/AasRegistryClient.d.ts +163 -0
  7. package/dist/clients/AasRegistryClient.js +287 -0
  8. package/dist/clients/AasRepositoryClient.d.ts +790 -103
  9. package/dist/clients/AasRepositoryClient.js +1323 -211
  10. package/dist/clients/AasxFileClient.d.ts +81 -0
  11. package/dist/clients/AasxFileClient.js +148 -0
  12. package/dist/clients/ConceptDescriptionRepositoryClient.d.ts +83 -0
  13. package/dist/clients/ConceptDescriptionRepositoryClient.js +143 -0
  14. package/dist/clients/SubmodelRegistryClient.d.ts +77 -0
  15. package/dist/clients/SubmodelRegistryClient.js +138 -0
  16. package/dist/clients/SubmodelRepositoryClient.d.ts +354 -0
  17. package/dist/clients/SubmodelRepositoryClient.js +585 -0
  18. package/dist/clients/index.d.ts +6 -0
  19. package/dist/clients/index.js +6 -0
  20. package/dist/generated/AasDiscoveryService/apis/AssetAdministrationShellBasicDiscoveryAPIApi.d.ts +80 -0
  21. package/dist/generated/AasDiscoveryService/apis/AssetAdministrationShellBasicDiscoveryAPIApi.js +156 -0
  22. package/dist/generated/AasDiscoveryService/apis/DescriptionAPIApi.d.ts +26 -0
  23. package/dist/generated/AasDiscoveryService/apis/DescriptionAPIApi.js +40 -0
  24. package/dist/generated/AasDiscoveryService/apis/index.d.ts +2 -0
  25. package/dist/generated/AasDiscoveryService/apis/index.js +4 -0
  26. package/dist/generated/AasDiscoveryService/index.d.ts +3 -0
  27. package/dist/generated/AasDiscoveryService/index.js +5 -0
  28. package/dist/generated/AasDiscoveryService/models/index.d.ts +297 -0
  29. package/dist/generated/AasDiscoveryService/models/index.js +48 -0
  30. package/dist/generated/AasDiscoveryService/runtime.d.ts +181 -0
  31. package/dist/generated/AasDiscoveryService/runtime.js +326 -0
  32. package/dist/generated/AasRegistryService/apis/AssetAdministrationShellRegistryAPIApi.d.ts +139 -0
  33. package/dist/generated/AasRegistryService/apis/AssetAdministrationShellRegistryAPIApi.js +312 -0
  34. package/dist/generated/AasRegistryService/apis/DescriptionAPIApi.d.ts +26 -0
  35. package/dist/generated/AasRegistryService/apis/DescriptionAPIApi.js +40 -0
  36. package/dist/generated/AasRegistryService/apis/index.d.ts +2 -0
  37. package/dist/generated/AasRegistryService/apis/index.js +4 -0
  38. package/dist/generated/AasRegistryService/index.d.ts +3 -0
  39. package/dist/generated/AasRegistryService/index.js +5 -0
  40. package/dist/generated/AasRegistryService/models/index.d.ts +1070 -0
  41. package/dist/generated/AasRegistryService/models/index.js +151 -0
  42. package/dist/generated/AasRegistryService/runtime.d.ts +181 -0
  43. package/dist/generated/AasRegistryService/runtime.js +326 -0
  44. package/dist/generated/AasRepositoryService/apis/AssetAdministrationShellRepositoryAPIApi.d.ts +870 -0
  45. package/dist/generated/AasRepositoryService/apis/AssetAdministrationShellRepositoryAPIApi.js +1842 -0
  46. package/dist/generated/AasRepositoryService/apis/DescriptionAPIApi.d.ts +26 -0
  47. package/dist/generated/AasRepositoryService/apis/DescriptionAPIApi.js +40 -0
  48. package/dist/generated/AasRepositoryService/apis/SerializationAPIApi.d.ts +30 -0
  49. package/dist/generated/AasRepositoryService/apis/SerializationAPIApi.js +49 -0
  50. package/dist/generated/AasRepositoryService/apis/index.d.ts +3 -0
  51. package/dist/generated/AasRepositoryService/apis/index.js +5 -0
  52. package/dist/generated/AasRepositoryService/index.d.ts +3 -0
  53. package/dist/generated/AasRepositoryService/index.js +5 -0
  54. package/dist/generated/AasRepositoryService/models/index.d.ts +4585 -0
  55. package/dist/generated/AasRepositoryService/models/index.js +221 -0
  56. package/dist/generated/AasRepositoryService/runtime.d.ts +181 -0
  57. package/dist/generated/AasRepositoryService/runtime.js +326 -0
  58. package/dist/generated/AasxFileService/apis/AASXFileServerAPIApi.d.ts +78 -0
  59. package/dist/generated/AasxFileService/apis/AASXFileServerAPIApi.js +184 -0
  60. package/dist/generated/AasxFileService/apis/index.d.ts +1 -0
  61. package/dist/generated/AasxFileService/apis/index.js +3 -0
  62. package/dist/generated/AasxFileService/index.d.ts +3 -0
  63. package/dist/generated/AasxFileService/index.js +5 -0
  64. package/dist/generated/AasxFileService/models/index.d.ts +80 -0
  65. package/dist/generated/AasxFileService/models/index.js +10 -0
  66. package/dist/generated/AasxFileService/runtime.d.ts +181 -0
  67. package/dist/generated/AasxFileService/runtime.js +326 -0
  68. package/dist/generated/ConceptDescriptionRepositoryService/apis/ConceptDescriptionRepositoryAPIApi.d.ts +78 -0
  69. package/dist/generated/ConceptDescriptionRepositoryService/apis/ConceptDescriptionRepositoryAPIApi.js +164 -0
  70. package/dist/generated/ConceptDescriptionRepositoryService/apis/DescriptionAPIApi.d.ts +26 -0
  71. package/dist/generated/ConceptDescriptionRepositoryService/apis/DescriptionAPIApi.js +40 -0
  72. package/dist/generated/ConceptDescriptionRepositoryService/apis/SerializationAPIApi.d.ts +30 -0
  73. package/dist/generated/ConceptDescriptionRepositoryService/apis/SerializationAPIApi.js +49 -0
  74. package/dist/generated/ConceptDescriptionRepositoryService/apis/index.d.ts +3 -0
  75. package/dist/generated/ConceptDescriptionRepositoryService/apis/index.js +5 -0
  76. package/dist/generated/ConceptDescriptionRepositoryService/index.d.ts +3 -0
  77. package/dist/generated/ConceptDescriptionRepositoryService/index.js +5 -0
  78. package/dist/generated/ConceptDescriptionRepositoryService/models/index.d.ts +2869 -0
  79. package/dist/generated/ConceptDescriptionRepositoryService/models/index.js +209 -0
  80. package/dist/generated/ConceptDescriptionRepositoryService/runtime.d.ts +181 -0
  81. package/dist/generated/ConceptDescriptionRepositoryService/runtime.js +326 -0
  82. package/dist/generated/SubmodelRegistryService/apis/DescriptionAPIApi.d.ts +26 -0
  83. package/dist/generated/SubmodelRegistryService/apis/DescriptionAPIApi.js +40 -0
  84. package/dist/generated/SubmodelRegistryService/apis/SubmodelRegistryAPIApi.d.ts +75 -0
  85. package/dist/generated/SubmodelRegistryService/apis/SubmodelRegistryAPIApi.js +155 -0
  86. package/dist/generated/SubmodelRegistryService/apis/index.d.ts +2 -0
  87. package/dist/generated/SubmodelRegistryService/apis/index.js +4 -0
  88. package/dist/generated/SubmodelRegistryService/index.d.ts +3 -0
  89. package/dist/generated/SubmodelRegistryService/index.js +5 -0
  90. package/dist/generated/SubmodelRegistryService/models/index.d.ts +924 -0
  91. package/dist/generated/SubmodelRegistryService/models/index.js +141 -0
  92. package/dist/generated/SubmodelRegistryService/runtime.d.ts +181 -0
  93. package/dist/generated/SubmodelRegistryService/runtime.js +326 -0
  94. package/dist/generated/SubmodelRepositoryService/apis/DescriptionAPIApi.d.ts +26 -0
  95. package/dist/generated/SubmodelRepositoryService/apis/DescriptionAPIApi.js +40 -0
  96. package/dist/generated/SubmodelRepositoryService/apis/SerializationAPIApi.d.ts +30 -0
  97. package/dist/generated/SubmodelRepositoryService/apis/SerializationAPIApi.js +49 -0
  98. package/dist/generated/SubmodelRepositoryService/apis/SubmodelRepositoryAPIApi.d.ts +802 -0
  99. package/dist/generated/SubmodelRepositoryService/apis/SubmodelRepositoryAPIApi.js +1572 -0
  100. package/dist/generated/SubmodelRepositoryService/apis/index.d.ts +3 -0
  101. package/dist/generated/SubmodelRepositoryService/apis/index.js +5 -0
  102. package/dist/generated/SubmodelRepositoryService/index.d.ts +3 -0
  103. package/dist/generated/SubmodelRepositoryService/index.js +5 -0
  104. package/dist/generated/SubmodelRepositoryService/models/index.d.ts +4623 -0
  105. package/dist/generated/SubmodelRepositoryService/models/index.js +221 -0
  106. package/dist/generated/SubmodelRepositoryService/runtime.d.ts +181 -0
  107. package/dist/generated/SubmodelRepositoryService/runtime.js +326 -0
  108. package/dist/generated/index.d.ts +8 -2
  109. package/dist/generated/index.js +8 -3
  110. package/dist/index.d.ts +1 -1
  111. package/dist/index.js +1 -1
  112. package/dist/lib/apiConfig.d.ts +2 -0
  113. package/dist/lib/apiConfig.js +41 -0
  114. package/dist/lib/base64Url.js +4 -0
  115. package/dist/lib/convertAasDescriptorTypes.d.ts +34 -0
  116. package/dist/lib/convertAasDescriptorTypes.js +76 -0
  117. package/dist/lib/convertAasDiscoveryTypes.d.ts +18 -0
  118. package/dist/lib/convertAasDiscoveryTypes.js +39 -0
  119. package/dist/lib/convertAasTypes.d.ts +7 -7
  120. package/dist/lib/convertAasTypes.js +5 -0
  121. package/dist/lib/convertConceptDescriptionTypes.d.ts +18 -0
  122. package/dist/lib/convertConceptDescriptionTypes.js +39 -0
  123. package/dist/lib/convertSubmodelTypes.d.ts +34 -0
  124. package/dist/lib/convertSubmodelTypes.js +69 -0
  125. package/dist/lib/descriptorJsonization.d.ts +12 -0
  126. package/dist/lib/descriptorJsonization.js +172 -0
  127. package/dist/lib/errorHandler.d.ts +9 -0
  128. package/dist/lib/errorHandler.js +113 -0
  129. package/dist/models/Descriptors.d.ts +51 -0
  130. package/dist/models/Descriptors.js +56 -0
  131. package/dist/models/index.d.ts +0 -1
  132. package/dist/models/index.js +0 -1
  133. package/dist/utils/DescriptorUtils.d.ts +9 -0
  134. package/dist/utils/DescriptorUtils.js +37 -0
  135. package/dist/utils/KeyTypesUtil.d.ts +24 -0
  136. package/dist/utils/KeyTypesUtil.js +55 -0
  137. package/dist/utils/MultiLanguagePropertyUtils.d.ts +24 -0
  138. package/dist/utils/MultiLanguagePropertyUtils.js +46 -0
  139. package/dist/utils/ReferableUtils.d.ts +69 -0
  140. package/dist/utils/ReferableUtils.js +220 -0
  141. package/dist/utils/ReferenceUtil.d.ts +9 -0
  142. package/dist/utils/ReferenceUtil.js +22 -0
  143. package/dist/utils/SemanticIdUtils.d.ts +119 -0
  144. package/dist/utils/SemanticIdUtils.js +363 -0
  145. package/package.json +14 -11
  146. package/dist/generated/schemas.gen.d.ts +0 -2357
  147. package/dist/generated/schemas.gen.js +0 -2789
  148. package/dist/generated/sdk.gen.d.ts +0 -822
  149. package/dist/generated/sdk.gen.js +0 -2225
  150. package/dist/generated/types.gen.d.ts +0 -10829
  151. package/dist/generated/types.gen.js +0 -2
  152. package/dist/lib/createAasRepoClient.d.ts +0 -9
  153. package/dist/lib/createAasRepoClient.js +0 -15
  154. package/dist/models/aas-repository.d.ts +0 -65
  155. package/dist/models/aas-repository.js +0 -1
@@ -0,0 +1,326 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * DotAAS Part 2 | HTTP/REST | Submodel Repository Service Specification
5
+ * The entire Submodel Repository Service Specification as part of the [Specification of the Asset Administration Shell: Part 2](https://industrialdigitaltwin.org/en/content-hub/aasspecifications). Copyright: Industrial Digital Twin Association (IDTA) 2025
6
+ *
7
+ * The version of the OpenAPI document: V3.1.0_SSP-001
8
+ * Contact: info@idtwin.org
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ export const BASE_PATH = "https://admin-shell.io/api/v3".replace(/\/+$/, "");
15
+ export class Configuration {
16
+ configuration;
17
+ constructor(configuration = {}) {
18
+ this.configuration = configuration;
19
+ }
20
+ set config(configuration) {
21
+ this.configuration = configuration;
22
+ }
23
+ get basePath() {
24
+ return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
25
+ }
26
+ get fetchApi() {
27
+ return this.configuration.fetchApi;
28
+ }
29
+ get middleware() {
30
+ return this.configuration.middleware || [];
31
+ }
32
+ get queryParamsStringify() {
33
+ return this.configuration.queryParamsStringify || querystring;
34
+ }
35
+ get username() {
36
+ return this.configuration.username;
37
+ }
38
+ get password() {
39
+ return this.configuration.password;
40
+ }
41
+ get apiKey() {
42
+ const apiKey = this.configuration.apiKey;
43
+ if (apiKey) {
44
+ return typeof apiKey === 'function' ? apiKey : () => apiKey;
45
+ }
46
+ return undefined;
47
+ }
48
+ get accessToken() {
49
+ const accessToken = this.configuration.accessToken;
50
+ if (accessToken) {
51
+ return typeof accessToken === 'function' ? accessToken : async () => accessToken;
52
+ }
53
+ return undefined;
54
+ }
55
+ get headers() {
56
+ return this.configuration.headers;
57
+ }
58
+ get credentials() {
59
+ return this.configuration.credentials;
60
+ }
61
+ }
62
+ export const DefaultConfig = new Configuration();
63
+ /**
64
+ * This is the base class for all generated API classes.
65
+ */
66
+ export class BaseAPI {
67
+ configuration;
68
+ static jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i');
69
+ middleware;
70
+ constructor(configuration = DefaultConfig) {
71
+ this.configuration = configuration;
72
+ this.middleware = configuration.middleware;
73
+ }
74
+ withMiddleware(...middlewares) {
75
+ const next = this.clone();
76
+ next.middleware = next.middleware.concat(...middlewares);
77
+ return next;
78
+ }
79
+ withPreMiddleware(...preMiddlewares) {
80
+ const middlewares = preMiddlewares.map((pre) => ({ pre }));
81
+ return this.withMiddleware(...middlewares);
82
+ }
83
+ withPostMiddleware(...postMiddlewares) {
84
+ const middlewares = postMiddlewares.map((post) => ({ post }));
85
+ return this.withMiddleware(...middlewares);
86
+ }
87
+ /**
88
+ * Check if the given MIME is a JSON MIME.
89
+ * JSON MIME examples:
90
+ * application/json
91
+ * application/json; charset=UTF8
92
+ * APPLICATION/JSON
93
+ * application/vnd.company+json
94
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
95
+ * @return True if the given MIME is JSON, false otherwise.
96
+ */
97
+ isJsonMime(mime) {
98
+ if (!mime) {
99
+ return false;
100
+ }
101
+ return BaseAPI.jsonRegex.test(mime);
102
+ }
103
+ async request(context, initOverrides) {
104
+ const { url, init } = await this.createFetchParams(context, initOverrides);
105
+ const response = await this.fetchApi(url, init);
106
+ if (response && (response.status >= 200 && response.status < 300)) {
107
+ return response;
108
+ }
109
+ throw new ResponseError(response, 'Response returned an error code');
110
+ }
111
+ async createFetchParams(context, initOverrides) {
112
+ let url = this.configuration.basePath + context.path;
113
+ if (context.query !== undefined && Object.keys(context.query).length !== 0) {
114
+ // only add the querystring to the URL if there are query parameters.
115
+ // this is done to avoid urls ending with a "?" character which buggy webservers
116
+ // do not handle correctly sometimes.
117
+ url += '?' + this.configuration.queryParamsStringify(context.query);
118
+ }
119
+ const headers = Object.assign({}, this.configuration.headers, context.headers);
120
+ Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});
121
+ const initOverrideFn = typeof initOverrides === "function"
122
+ ? initOverrides
123
+ : async () => initOverrides;
124
+ const initParams = {
125
+ method: context.method,
126
+ headers,
127
+ body: context.body,
128
+ credentials: this.configuration.credentials,
129
+ };
130
+ const overriddenInit = {
131
+ ...initParams,
132
+ ...(await initOverrideFn({
133
+ init: initParams,
134
+ context,
135
+ }))
136
+ };
137
+ let body;
138
+ if (isFormData(overriddenInit.body)
139
+ || (overriddenInit.body instanceof URLSearchParams)
140
+ || isBlob(overriddenInit.body)) {
141
+ body = overriddenInit.body;
142
+ }
143
+ else if (this.isJsonMime(headers['Content-Type'])) {
144
+ body = JSON.stringify(overriddenInit.body);
145
+ }
146
+ else {
147
+ body = overriddenInit.body;
148
+ }
149
+ const init = {
150
+ ...overriddenInit,
151
+ body
152
+ };
153
+ return { url, init };
154
+ }
155
+ fetchApi = async (url, init) => {
156
+ let fetchParams = { url, init };
157
+ for (const middleware of this.middleware) {
158
+ if (middleware.pre) {
159
+ fetchParams = await middleware.pre({
160
+ fetch: this.fetchApi,
161
+ ...fetchParams,
162
+ }) || fetchParams;
163
+ }
164
+ }
165
+ let response = undefined;
166
+ try {
167
+ response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
168
+ }
169
+ catch (e) {
170
+ for (const middleware of this.middleware) {
171
+ if (middleware.onError) {
172
+ response = await middleware.onError({
173
+ fetch: this.fetchApi,
174
+ url: fetchParams.url,
175
+ init: fetchParams.init,
176
+ error: e,
177
+ response: response ? response.clone() : undefined,
178
+ }) || response;
179
+ }
180
+ }
181
+ if (response === undefined) {
182
+ if (e instanceof Error) {
183
+ throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response');
184
+ }
185
+ else {
186
+ throw e;
187
+ }
188
+ }
189
+ }
190
+ for (const middleware of this.middleware) {
191
+ if (middleware.post) {
192
+ response = await middleware.post({
193
+ fetch: this.fetchApi,
194
+ url: fetchParams.url,
195
+ init: fetchParams.init,
196
+ response: response.clone(),
197
+ }) || response;
198
+ }
199
+ }
200
+ return response;
201
+ };
202
+ /**
203
+ * Create a shallow clone of `this` by constructing a new instance
204
+ * and then shallow cloning data members.
205
+ */
206
+ clone() {
207
+ const constructor = this.constructor;
208
+ const next = new constructor(this.configuration);
209
+ next.middleware = this.middleware.slice();
210
+ return next;
211
+ }
212
+ }
213
+ ;
214
+ function isBlob(value) {
215
+ return typeof Blob !== 'undefined' && value instanceof Blob;
216
+ }
217
+ function isFormData(value) {
218
+ return typeof FormData !== "undefined" && value instanceof FormData;
219
+ }
220
+ export class ResponseError extends Error {
221
+ response;
222
+ name = "ResponseError";
223
+ constructor(response, msg) {
224
+ super(msg);
225
+ this.response = response;
226
+ }
227
+ }
228
+ export class FetchError extends Error {
229
+ cause;
230
+ name = "FetchError";
231
+ constructor(cause, msg) {
232
+ super(msg);
233
+ this.cause = cause;
234
+ }
235
+ }
236
+ export class RequiredError extends Error {
237
+ field;
238
+ name = "RequiredError";
239
+ constructor(field, msg) {
240
+ super(msg);
241
+ this.field = field;
242
+ }
243
+ }
244
+ export const COLLECTION_FORMATS = {
245
+ csv: ",",
246
+ ssv: " ",
247
+ tsv: "\t",
248
+ pipes: "|",
249
+ };
250
+ export function querystring(params, prefix = '') {
251
+ return Object.keys(params)
252
+ .map(key => querystringSingleKey(key, params[key], prefix))
253
+ .filter(part => part.length > 0)
254
+ .join('&');
255
+ }
256
+ function querystringSingleKey(key, value, keyPrefix = '') {
257
+ const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
258
+ if (value instanceof Array) {
259
+ const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue)))
260
+ .join(`&${encodeURIComponent(fullKey)}=`);
261
+ return `${encodeURIComponent(fullKey)}=${multiValue}`;
262
+ }
263
+ if (value instanceof Set) {
264
+ const valueAsArray = Array.from(value);
265
+ return querystringSingleKey(key, valueAsArray, keyPrefix);
266
+ }
267
+ if (value instanceof Date) {
268
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
269
+ }
270
+ if (value instanceof Object) {
271
+ return querystring(value, fullKey);
272
+ }
273
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
274
+ }
275
+ export function exists(json, key) {
276
+ const value = json[key];
277
+ return value !== null && value !== undefined;
278
+ }
279
+ export function canConsumeForm(consumes) {
280
+ for (const consume of consumes) {
281
+ if ('multipart/form-data' === consume.contentType) {
282
+ return true;
283
+ }
284
+ }
285
+ return false;
286
+ }
287
+ export class JSONApiResponse {
288
+ raw;
289
+ transformer;
290
+ constructor(raw, transformer = (jsonValue) => jsonValue) {
291
+ this.raw = raw;
292
+ this.transformer = transformer;
293
+ }
294
+ async value() {
295
+ return this.transformer(await this.raw.json());
296
+ }
297
+ }
298
+ export class VoidApiResponse {
299
+ raw;
300
+ constructor(raw) {
301
+ this.raw = raw;
302
+ }
303
+ async value() {
304
+ return undefined;
305
+ }
306
+ }
307
+ export class BlobApiResponse {
308
+ raw;
309
+ constructor(raw) {
310
+ this.raw = raw;
311
+ }
312
+ async value() {
313
+ return await this.raw.blob();
314
+ }
315
+ ;
316
+ }
317
+ export class TextApiResponse {
318
+ raw;
319
+ constructor(raw) {
320
+ this.raw = raw;
321
+ }
322
+ async value() {
323
+ return await this.raw.text();
324
+ }
325
+ ;
326
+ }
@@ -1,2 +1,8 @@
1
- export * from './types.gen';
2
- export * from './sdk.gen';
1
+ import * as AasRepositoryService from './AasRepositoryService';
2
+ import * as SubmodelRepositoryService from './SubmodelRepositoryService';
3
+ import * as ConceptDescriptionRepositoryService from './ConceptDescriptionRepositoryService';
4
+ import * as AasRegistryService from './AasRegistryService';
5
+ import * as SubmodelRegistryService from './SubmodelRegistryService';
6
+ import * as AasDiscoveryService from './AasDiscoveryService';
7
+ import * as AasxFileService from './AasxFileService';
8
+ export { AasRepositoryService, SubmodelRepositoryService, ConceptDescriptionRepositoryService, AasRegistryService, SubmodelRegistryService, AasDiscoveryService, AasxFileService };
@@ -1,3 +1,8 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
- export * from './types.gen';
3
- export * from './sdk.gen';
1
+ import * as AasRepositoryService from './AasRepositoryService';
2
+ import * as SubmodelRepositoryService from './SubmodelRepositoryService';
3
+ import * as ConceptDescriptionRepositoryService from './ConceptDescriptionRepositoryService';
4
+ import * as AasRegistryService from './AasRegistryService';
5
+ import * as SubmodelRegistryService from './SubmodelRegistryService';
6
+ import * as AasDiscoveryService from './AasDiscoveryService';
7
+ import * as AasxFileService from './AasxFileService';
8
+ export { AasRepositoryService, SubmodelRepositoryService, ConceptDescriptionRepositoryService, AasRegistryService, SubmodelRegistryService, AasDiscoveryService, AasxFileService };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export * from './clients';
2
- export * as AasTypes from './generated/types.gen';
2
+ export * from './generated';
3
3
  export * as Models from './models';
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export * from './clients';
2
- export * as AasTypes from './generated/types.gen';
2
+ export * from './generated';
3
3
  export * as Models from './models';
@@ -0,0 +1,2 @@
1
+ import { AasDiscoveryService, AasRegistryService, AasRepositoryService, AasxFileService, ConceptDescriptionRepositoryService, SubmodelRegistryService, SubmodelRepositoryService } from '../generated';
2
+ export declare function applyDefaults<T extends AasRepositoryService.Configuration | SubmodelRepositoryService.Configuration | ConceptDescriptionRepositoryService.Configuration | AasRegistryService.Configuration | SubmodelRegistryService.Configuration | AasDiscoveryService.Configuration | AasxFileService.Configuration>(configuration: T): T;
@@ -0,0 +1,41 @@
1
+ //import { Configuration } from '../generated';
2
+ import { AasDiscoveryService, AasRegistryService, AasRepositoryService, AasxFileService, ConceptDescriptionRepositoryService, SubmodelRegistryService, SubmodelRepositoryService, } from '../generated';
3
+ //export function applyDefaults(configuration: AAS.Configuration): AAS.Configuration {
4
+ export function applyDefaults(configuration) {
5
+ // Extract configuration properties
6
+ const options = {
7
+ basePath: configuration.basePath || undefined,
8
+ fetchApi: configuration.fetchApi || getDefaultFetchApi(),
9
+ middleware: configuration.middleware || undefined,
10
+ queryParamsStringify: configuration.queryParamsStringify || undefined,
11
+ username: configuration.username || undefined,
12
+ password: configuration.password || undefined,
13
+ apiKey: configuration.apiKey || undefined,
14
+ accessToken: configuration.accessToken || undefined,
15
+ headers: configuration.headers || undefined,
16
+ credentials: configuration.credentials || undefined,
17
+ };
18
+ // Create the appropriate configuration type
19
+ switch (configuration.constructor) {
20
+ case AasRepositoryService.Configuration:
21
+ return new AasRepositoryService.Configuration(options);
22
+ case SubmodelRepositoryService.Configuration:
23
+ return new SubmodelRepositoryService.Configuration(options);
24
+ case ConceptDescriptionRepositoryService.Configuration:
25
+ return new ConceptDescriptionRepositoryService.Configuration(options);
26
+ case AasRegistryService.Configuration:
27
+ return new AasRegistryService.Configuration(options);
28
+ case SubmodelRegistryService.Configuration:
29
+ return new SubmodelRegistryService.Configuration(options);
30
+ case AasDiscoveryService.Configuration:
31
+ return new AasDiscoveryService.Configuration(options);
32
+ case AasxFileService.Configuration:
33
+ return new AasxFileService.Configuration(options);
34
+ default:
35
+ throw new Error('None of the configuration types match');
36
+ }
37
+ }
38
+ function getDefaultFetchApi() {
39
+ // In Node (>=18) or browser, global fetch is available.
40
+ return fetch.bind(globalThis);
41
+ }
@@ -15,6 +15,8 @@
15
15
  * @returns {string} The Base64 encoded string, converted to URL-safe format if requested.
16
16
  */
17
17
  export function base64Encode(string, urlSafe = true) {
18
+ if (string === null || string === undefined)
19
+ return '';
18
20
  string = string.trim();
19
21
  if (string === '')
20
22
  return '';
@@ -44,6 +46,8 @@ export function base64Encode(string, urlSafe = true) {
44
46
  * @returns {string} The decoded string.
45
47
  */
46
48
  export function base64Decode(urlSafeBase64String) {
49
+ if (urlSafeBase64String === null || urlSafeBase64String === undefined)
50
+ return '';
47
51
  urlSafeBase64String = urlSafeBase64String.trim();
48
52
  if (urlSafeBase64String === '')
49
53
  return '';
@@ -0,0 +1,34 @@
1
+ import { AasRegistryService } from '../generated';
2
+ import { AssetAdministrationShellDescriptor as CoreAssetAdministrationShellDescriptor, SubmodelDescriptor as CoreSubmodelDescriptor } from '../models/Descriptors';
3
+ /**
4
+ * Convert an API AssetAdministrationShellDescriptor to a Core Works equivalent AssetAdministrationShellDescriptor
5
+ *
6
+ * @function convertApiAasDescriptorToCoreAasDescriptor
7
+ * @param {ApiAssetAdministrationShellDescriptor} aasDescriptor - The API AssetAdministrationShellDescriptor to convert
8
+ * @returns {CoreAssetAdministrationShellDescriptor} The Core Works AssetAdministrationShellDescriptor
9
+ */
10
+ export declare function convertApiAasDescriptorToCoreAasDescriptor(aasDescriptor: AasRegistryService.AssetAdministrationShellDescriptor): CoreAssetAdministrationShellDescriptor;
11
+ /**
12
+ * Convert a Core Works equivalent AssetAdministrationShellDescriptor to an API AssetAdministrationShellDescriptor
13
+ *
14
+ * @function convertCoreAasDescriptorToApiAasDescriptor
15
+ * @param {CoreAssetAdministrationShellDescriptor} aasDescriptor - The Core Works AssetAdministrationShellDescriptor to convert
16
+ * @returns {ApiAssetAdministrationShellDescriptor} The API AssetAdministrationShellDescriptor
17
+ */
18
+ export declare function convertCoreAasDescriptorToApiAasDescriptor(aasDescriptor: CoreAssetAdministrationShellDescriptor): AasRegistryService.AssetAdministrationShellDescriptor;
19
+ /**
20
+ * Convert an API SubmodelDescriptor to a Core Works equivalent SubmodelDescriptor
21
+ *
22
+ * @function convertApiSubmodelDescriptorToCoreSubmodelDescriptor
23
+ * @param {ApiSubmodelDescriptor} submodelDescriptor - The API SubmodelDescriptor to convert
24
+ * @returns {CoreSubmodelDescriptor} The Core Works SubmodelDescriptor
25
+ */
26
+ export declare function convertApiSubmodelDescriptorToCoreSubmodelDescriptor(submodelDescriptor: AasRegistryService.SubmodelDescriptor): CoreSubmodelDescriptor;
27
+ /**
28
+ * Convert a Core Works equivalent SubmodelDescriptor to an API SubmodelDescriptor
29
+ *
30
+ * @function convertCoreSubmodelDescriptorToApiSubmodelDescriptor
31
+ * @param {CoreSubmodelDescriptor} submodelDescriptor - The Core Works SubmodelDescriptor to convert
32
+ * @returns {ApiSubmodelDescriptor} The API SubmodelDescriptor
33
+ */
34
+ export declare function convertCoreSubmodelDescriptorToApiSubmodelDescriptor(submodelDescriptor: CoreSubmodelDescriptor): AasRegistryService.SubmodelDescriptor;
@@ -0,0 +1,76 @@
1
+ import { assetAdministrationShellDescriptorFromJsonable, submodelDescriptorFromJsonable, toJsonableAssetAdministrationShellDescriptor, toJsonableSubmodelDescriptor, } from '../lib/descriptorJsonization';
2
+ import { AssetAdministrationShellDescriptor as CoreAssetAdministrationShellDescriptor, SubmodelDescriptor as CoreSubmodelDescriptor, } from '../models/Descriptors';
3
+ /**
4
+ * Convert an API AssetAdministrationShellDescriptor to a Core Works equivalent AssetAdministrationShellDescriptor
5
+ *
6
+ * @function convertApiAasDescriptorToCoreAasDescriptor
7
+ * @param {ApiAssetAdministrationShellDescriptor} aasDescriptor - The API AssetAdministrationShellDescriptor to convert
8
+ * @returns {CoreAssetAdministrationShellDescriptor} The Core Works AssetAdministrationShellDescriptor
9
+ */
10
+ export function convertApiAasDescriptorToCoreAasDescriptor(aasDescriptor) {
11
+ // first stringify
12
+ let shellDescriptor = JSON.stringify(aasDescriptor);
13
+ // then parse
14
+ shellDescriptor = JSON.parse(shellDescriptor);
15
+ // then jsonize
16
+ const instanceOrError = assetAdministrationShellDescriptorFromJsonable(shellDescriptor);
17
+ if (instanceOrError.error !== null) {
18
+ throw instanceOrError.error;
19
+ }
20
+ const instance = instanceOrError.mustValue();
21
+ // set the prototype
22
+ Object.setPrototypeOf(instance, CoreAssetAdministrationShellDescriptor.prototype);
23
+ return instance;
24
+ }
25
+ /**
26
+ * Convert a Core Works equivalent AssetAdministrationShellDescriptor to an API AssetAdministrationShellDescriptor
27
+ *
28
+ * @function convertCoreAasDescriptorToApiAasDescriptor
29
+ * @param {CoreAssetAdministrationShellDescriptor} aasDescriptor - The Core Works AssetAdministrationShellDescriptor to convert
30
+ * @returns {ApiAssetAdministrationShellDescriptor} The API AssetAdministrationShellDescriptor
31
+ */
32
+ export function convertCoreAasDescriptorToApiAasDescriptor(aasDescriptor) {
33
+ // first jsonize
34
+ const jsonableAasDescriptor = toJsonableAssetAdministrationShellDescriptor(aasDescriptor);
35
+ // then stringify
36
+ const shellDescriptor = JSON.stringify(jsonableAasDescriptor);
37
+ // then parse
38
+ return JSON.parse(shellDescriptor);
39
+ }
40
+ /**
41
+ * Convert an API SubmodelDescriptor to a Core Works equivalent SubmodelDescriptor
42
+ *
43
+ * @function convertApiSubmodelDescriptorToCoreSubmodelDescriptor
44
+ * @param {ApiSubmodelDescriptor} submodelDescriptor - The API SubmodelDescriptor to convert
45
+ * @returns {CoreSubmodelDescriptor} The Core Works SubmodelDescriptor
46
+ */
47
+ export function convertApiSubmodelDescriptorToCoreSubmodelDescriptor(submodelDescriptor) {
48
+ // first stringify
49
+ let submodelDescriptorStr = JSON.stringify(submodelDescriptor);
50
+ // then parse
51
+ submodelDescriptorStr = JSON.parse(submodelDescriptorStr);
52
+ // then jsonize
53
+ const instanceOrError = submodelDescriptorFromJsonable(submodelDescriptorStr);
54
+ if (instanceOrError.error !== null) {
55
+ throw instanceOrError.error;
56
+ }
57
+ const instance = instanceOrError.mustValue();
58
+ // set the prototype
59
+ Object.setPrototypeOf(instance, CoreSubmodelDescriptor.prototype);
60
+ return instance;
61
+ }
62
+ /**
63
+ * Convert a Core Works equivalent SubmodelDescriptor to an API SubmodelDescriptor
64
+ *
65
+ * @function convertCoreSubmodelDescriptorToApiSubmodelDescriptor
66
+ * @param {CoreSubmodelDescriptor} submodelDescriptor - The Core Works SubmodelDescriptor to convert
67
+ * @returns {ApiSubmodelDescriptor} The API SubmodelDescriptor
68
+ */
69
+ export function convertCoreSubmodelDescriptorToApiSubmodelDescriptor(submodelDescriptor) {
70
+ // first jsonize
71
+ const jsonableSubmodelDescriptor = toJsonableSubmodelDescriptor(submodelDescriptor);
72
+ // then stringify
73
+ const submodelDescriptorStr = JSON.stringify(jsonableSubmodelDescriptor);
74
+ // then parse
75
+ return JSON.parse(submodelDescriptorStr);
76
+ }
@@ -0,0 +1,18 @@
1
+ import { SpecificAssetId as CoreSpecificAssetId } from '@aas-core-works/aas-core3.0-typescript/types';
2
+ import { AasDiscoveryService } from '../generated';
3
+ /**
4
+ * Convert an API SpecificAssetId to a Core Works SpecificAssetId
5
+ *
6
+ * @function convertApiAssetIdToCoreAssetId
7
+ * @param {ApiSpecificAssetId} assetId - The API SpecificAssetId to convert
8
+ * @returns {CoreSpecificAssetId} The Core Works SpecificAssetId
9
+ */
10
+ export declare function convertApiAssetIdToCoreAssetId(assetId: AasDiscoveryService.SpecificAssetId): CoreSpecificAssetId;
11
+ /**
12
+ * Convert a Core Works SpecificAssetId to an API SpecificAssetId
13
+ *
14
+ * @function convertCoreAssetIdToApiAssetId
15
+ * @param {CoreSpecificAssetId} assetId - The Core Works SpecificAssetId to convert
16
+ * @returns {ApiSpecificAssetId} The API SpecificAssetId
17
+ */
18
+ export declare function convertCoreAssetIdToApiAssetId(assetId: CoreSpecificAssetId): AasDiscoveryService.SpecificAssetId;
@@ -0,0 +1,39 @@
1
+ import { jsonization } from '@aas-core-works/aas-core3.0-typescript';
2
+ import { SpecificAssetId as CoreSpecificAssetId } from '@aas-core-works/aas-core3.0-typescript/types';
3
+ /**
4
+ * Convert an API SpecificAssetId to a Core Works SpecificAssetId
5
+ *
6
+ * @function convertApiAssetIdToCoreAssetId
7
+ * @param {ApiSpecificAssetId} assetId - The API SpecificAssetId to convert
8
+ * @returns {CoreSpecificAssetId} The Core Works SpecificAssetId
9
+ */
10
+ export function convertApiAssetIdToCoreAssetId(assetId) {
11
+ // first stringify
12
+ let assetIdStr = JSON.stringify(assetId);
13
+ // then parse
14
+ assetIdStr = JSON.parse(assetIdStr);
15
+ // then jsonize
16
+ const instanceOrError = jsonization.specificAssetIdFromJsonable(assetIdStr);
17
+ if (instanceOrError.error !== null) {
18
+ throw instanceOrError.error;
19
+ }
20
+ const instance = instanceOrError.mustValue();
21
+ // set the prototype
22
+ Object.setPrototypeOf(instance, CoreSpecificAssetId.prototype);
23
+ return instance;
24
+ }
25
+ /**
26
+ * Convert a Core Works SpecificAssetId to an API SpecificAssetId
27
+ *
28
+ * @function convertCoreAssetIdToApiAssetId
29
+ * @param {CoreSpecificAssetId} assetId - The Core Works SpecificAssetId to convert
30
+ * @returns {ApiSpecificAssetId} The API SpecificAssetId
31
+ */
32
+ export function convertCoreAssetIdToApiAssetId(assetId) {
33
+ // first jsonize
34
+ const jsonableAssetId = jsonization.toJsonable(assetId);
35
+ // then stringify
36
+ const assetIdStr = JSON.stringify(jsonableAssetId);
37
+ // then parse
38
+ return JSON.parse(assetIdStr);
39
+ }
@@ -1,5 +1,5 @@
1
1
  import { AssetAdministrationShell as CoreAssetAdministrationShell, AssetInformation as CoreAssetInformation, Reference as CoreReference } from '@aas-core-works/aas-core3.0-typescript/types';
2
- import { AssetAdministrationShell as ApiAssetAdministrationShell, AssetInformation as ApiAssetInformation, Reference as ApiReference } from '../generated/types.gen';
2
+ import { AasRepositoryService } from '../generated';
3
3
  /**
4
4
  * Convert an API AssetAdministrationShell to a Core Works AssetAdministrationShell
5
5
  *
@@ -7,7 +7,7 @@ import { AssetAdministrationShell as ApiAssetAdministrationShell, AssetInformati
7
7
  * @param {ApiAssetAdministrationShell} aas - The API AssetAdministrationShell to convert
8
8
  * @returns {CoreAssetAdministrationShell} The Core Works AssetAdministrationShell
9
9
  */
10
- export declare function convertApiAasToCoreAas(aas: ApiAssetAdministrationShell): CoreAssetAdministrationShell;
10
+ export declare function convertApiAasToCoreAas(aas: AasRepositoryService.AssetAdministrationShell): CoreAssetAdministrationShell;
11
11
  /**
12
12
  * Convert a Core Works AssetAdministrationShell to an API AssetAdministrationShell
13
13
  *
@@ -15,7 +15,7 @@ export declare function convertApiAasToCoreAas(aas: ApiAssetAdministrationShell)
15
15
  * @param {CoreAssetAdministrationShell} aas - The Core Works AssetAdministrationShell to convert
16
16
  * @returns {ApiAssetAdministrationShell} The API AssetAdministrationShell
17
17
  */
18
- export declare function convertCoreAasToApiAas(aas: CoreAssetAdministrationShell): ApiAssetAdministrationShell;
18
+ export declare function convertCoreAasToApiAas(aas: CoreAssetAdministrationShell): AasRepositoryService.AssetAdministrationShell;
19
19
  /**
20
20
  * Convert an API AssetInformation to a Core Works AssetInformation
21
21
  *
@@ -23,7 +23,7 @@ export declare function convertCoreAasToApiAas(aas: CoreAssetAdministrationShell
23
23
  * @param {ApiAssetInformation} assetInformation - The API AssetInformation to convert
24
24
  * @returns {CoreAssetInformation} The Core Works AssetInformation
25
25
  */
26
- export declare function convertApiAssetInformationToCoreAssetInformation(assetInformation: ApiAssetInformation): CoreAssetInformation;
26
+ export declare function convertApiAssetInformationToCoreAssetInformation(assetInformation: AasRepositoryService.AssetInformation): CoreAssetInformation;
27
27
  /**
28
28
  * Convert a Core Works AssetInformation to an API AssetInformation
29
29
  *
@@ -31,7 +31,7 @@ export declare function convertApiAssetInformationToCoreAssetInformation(assetIn
31
31
  * @param {CoreAssetInformation} assetInformation - The Core Works AssetInformation to convert
32
32
  * @returns {ApiAssetInformation} The API AssetInformation
33
33
  */
34
- export declare function convertCoreAssetInformationToApiAssetInformation(assetInformation: CoreAssetInformation): ApiAssetInformation;
34
+ export declare function convertCoreAssetInformationToApiAssetInformation(assetInformation: CoreAssetInformation): AasRepositoryService.AssetInformation;
35
35
  /**
36
36
  * Convert an API Reference to a Core Works Reference
37
37
  *
@@ -39,7 +39,7 @@ export declare function convertCoreAssetInformationToApiAssetInformation(assetIn
39
39
  * @param {ApiReference} reference - The API Reference to convert
40
40
  * @returns {CoreReference} The Core Works Reference
41
41
  */
42
- export declare function convertApiReferenceToCoreReference(reference: ApiReference): CoreReference;
42
+ export declare function convertApiReferenceToCoreReference(reference: AasRepositoryService.Reference): CoreReference;
43
43
  /**
44
44
  * Convert a Core Works Reference to an API Reference
45
45
  *
@@ -47,4 +47,4 @@ export declare function convertApiReferenceToCoreReference(reference: ApiReferen
47
47
  * @param {CoreReference} reference - The Core Works Reference to convert
48
48
  * @returns {ApiReference} The API Reference
49
49
  */
50
- export declare function convertCoreReferenceToApiReference(reference: CoreReference): ApiReference;
50
+ export declare function convertCoreReferenceToApiReference(reference: CoreReference): AasRepositoryService.Reference;
@@ -1,5 +1,10 @@
1
1
  import { jsonization } from '@aas-core-works/aas-core3.0-typescript';
2
2
  import { AssetAdministrationShell as CoreAssetAdministrationShell, AssetInformation as CoreAssetInformation, Reference as CoreReference, } from '@aas-core-works/aas-core3.0-typescript/types';
3
+ // import {
4
+ // AssetAdministrationShell as ApiAssetAdministrationShell,
5
+ // AssetInformation as ApiAssetInformation,
6
+ // Reference as ApiReference,
7
+ // } from '../generated';
3
8
  /**
4
9
  * Convert an API AssetAdministrationShell to a Core Works AssetAdministrationShell
5
10
  *