basyx-typescript-sdk 2.3.0 → 2.4.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.
- package/README.md +68 -1
- package/bundle/index.cjs +1421 -91
- package/bundle/index.cjs.map +1 -1
- package/bundle/index.mjs +1353 -92
- package/bundle/index.mjs.map +1 -1
- package/dist/clients/AasRegistryClient.d.ts +20 -0
- package/dist/clients/AasRegistryClient.js +40 -0
- package/dist/clients/AasRepositoryClient.d.ts +20 -0
- package/dist/clients/AasRepositoryClient.js +40 -0
- package/dist/clients/ConceptDescriptionRepositoryClient.d.ts +20 -0
- package/dist/clients/ConceptDescriptionRepositoryClient.js +40 -0
- package/dist/clients/SubmodelRegistryClient.d.ts +20 -0
- package/dist/clients/SubmodelRegistryClient.js +40 -0
- package/dist/clients/SubmodelRepositoryClient.d.ts +20 -0
- package/dist/clients/SubmodelRepositoryClient.js +40 -0
- package/dist/generated/AasRegistryService/apis/AssetAdministrationShellRegistryAPIApi.d.ts +14 -1
- package/dist/generated/AasRegistryService/apis/AssetAdministrationShellRegistryAPIApi.js +29 -0
- package/dist/generated/AasRegistryService/models/index.d.ts +374 -0
- package/dist/generated/AasRegistryService/models/index.js +6 -0
- package/dist/generated/AasRepositoryService/apis/AssetAdministrationShellRepositoryAPIApi.d.ts +14 -1
- package/dist/generated/AasRepositoryService/apis/AssetAdministrationShellRepositoryAPIApi.js +29 -0
- package/dist/generated/AasRepositoryService/models/index.d.ts +381 -0
- package/dist/generated/AasRepositoryService/models/index.js +7 -0
- package/dist/generated/ConceptDescriptionRepositoryService/apis/ConceptDescriptionRepositoryAPIApi.d.ts +14 -1
- package/dist/generated/ConceptDescriptionRepositoryService/apis/ConceptDescriptionRepositoryAPIApi.js +29 -0
- package/dist/generated/ConceptDescriptionRepositoryService/models/index.d.ts +381 -0
- package/dist/generated/ConceptDescriptionRepositoryService/models/index.js +7 -0
- package/dist/generated/SubmodelRegistryService/apis/SubmodelRegistryAPIApi.d.ts +14 -1
- package/dist/generated/SubmodelRegistryService/apis/SubmodelRegistryAPIApi.js +29 -0
- package/dist/generated/SubmodelRegistryService/models/index.d.ts +381 -0
- package/dist/generated/SubmodelRegistryService/models/index.js +7 -0
- package/dist/generated/SubmodelRepositoryService/apis/SubmodelRepositoryAPIApi.d.ts +14 -1
- package/dist/generated/SubmodelRepositoryService/apis/SubmodelRepositoryAPIApi.js +29 -0
- package/dist/generated/SubmodelRepositoryService/models/index.d.ts +381 -0
- package/dist/generated/SubmodelRepositoryService/models/index.js +7 -0
- package/dist/lib/endpointConfiguration.d.ts +71 -0
- package/dist/lib/endpointConfiguration.js +101 -0
- package/dist/lib/errorHandler.js +9 -4
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +2 -0
- package/dist/lib/queryJsonization.d.ts +17 -0
- package/dist/lib/queryJsonization.js +309 -0
- package/dist/lib/queryRequests.d.ts +24 -0
- package/dist/lib/queryRequests.js +44 -0
- package/dist/models/Query.d.ts +378 -0
- package/dist/models/Query.js +430 -0
- package/dist/models/QueryResult.d.ts +22 -0
- package/dist/models/QueryResult.js +1 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/dist/services/AasService.d.ts +15 -4
- package/dist/services/AasService.js +38 -40
- package/dist/services/SubmodelService.d.ts +9 -8
- package/dist/services/SubmodelService.js +17 -34
- package/dist/services/index.d.ts +1 -0
- package/dist/utils/DescriptorUtils.d.ts +27 -1
- package/dist/utils/DescriptorUtils.js +65 -27
- package/dist/utils/ServiceDescriptionUtils.d.ts +30 -0
- package/dist/utils/ServiceDescriptionUtils.js +43 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model of the AAS Query Language (IDTA-01002-3, `$condition`, `$filters` and `$select`).
|
|
3
|
+
*
|
|
4
|
+
* The names, property order and constructor signatures follow the query region of the aas-core-meta V3.2 meta-model,
|
|
5
|
+
* so that this model can be replaced by the classes aas-core-codegen generates for it. Properties carry the
|
|
6
|
+
* meta-model names (e.g. `strVal`, `andOperands`); {@link toJsonableQuery} and {@link queryFromJsonable} map them to the
|
|
7
|
+
* JSON names of the query language (e.g. `$strVal`, `$and`).
|
|
8
|
+
*
|
|
9
|
+
* See https://industrialdigitaltwin.io/aas-specifications/IDTA-01002/v3.2/query-language.html
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Enumerate the global attributes which can be used in a query.
|
|
13
|
+
*/
|
|
14
|
+
export var GlobalAttributeKind;
|
|
15
|
+
(function (GlobalAttributeKind) {
|
|
16
|
+
/** The current date and time in the local time zone of the server (`LOCALNOW`) */
|
|
17
|
+
GlobalAttributeKind[GlobalAttributeKind["LocalNow"] = 0] = "LocalNow";
|
|
18
|
+
/** The current date and time in UTC (`UTCNOW`) */
|
|
19
|
+
GlobalAttributeKind[GlobalAttributeKind["UtcNow"] = 1] = "UtcNow";
|
|
20
|
+
/** The current date and time of the client (`CLIENTNOW`) */
|
|
21
|
+
GlobalAttributeKind[GlobalAttributeKind["ClientNow"] = 2] = "ClientNow";
|
|
22
|
+
/** The anonymous user, i.e. a request without authentication (`ANONYMOUS`) */
|
|
23
|
+
GlobalAttributeKind[GlobalAttributeKind["Anonymous"] = 3] = "Anonymous";
|
|
24
|
+
})(GlobalAttributeKind || (GlobalAttributeKind = {}));
|
|
25
|
+
/**
|
|
26
|
+
* Enumerate the global attributes which can be used as a date-time operand in a query.
|
|
27
|
+
*
|
|
28
|
+
* This is a subset of {@link GlobalAttributeKind}.
|
|
29
|
+
*/
|
|
30
|
+
export var DateTimeGlobalAttributeKind;
|
|
31
|
+
(function (DateTimeGlobalAttributeKind) {
|
|
32
|
+
/** The current date and time in the local time zone of the server (`LOCALNOW`) */
|
|
33
|
+
DateTimeGlobalAttributeKind[DateTimeGlobalAttributeKind["LocalNow"] = 0] = "LocalNow";
|
|
34
|
+
/** The current date and time in UTC (`UTCNOW`) */
|
|
35
|
+
DateTimeGlobalAttributeKind[DateTimeGlobalAttributeKind["UtcNow"] = 1] = "UtcNow";
|
|
36
|
+
/** The current date and time of the client (`CLIENTNOW`) */
|
|
37
|
+
DateTimeGlobalAttributeKind[DateTimeGlobalAttributeKind["ClientNow"] = 2] = "ClientNow";
|
|
38
|
+
})(DateTimeGlobalAttributeKind || (DateTimeGlobalAttributeKind = {}));
|
|
39
|
+
/**
|
|
40
|
+
* Enumerate what a query returns instead of the full objects.
|
|
41
|
+
*/
|
|
42
|
+
export var QuerySelect;
|
|
43
|
+
(function (QuerySelect) {
|
|
44
|
+
/** Return only the identifiers of the matching objects (`id`) */
|
|
45
|
+
QuerySelect[QuerySelect["Id"] = 0] = "Id";
|
|
46
|
+
})(QuerySelect || (QuerySelect = {}));
|
|
47
|
+
/**
|
|
48
|
+
* Refer to a claim of the requester, e.g. from an access token (`CLAIM`).
|
|
49
|
+
*/
|
|
50
|
+
export class ClaimAttribute {
|
|
51
|
+
claim;
|
|
52
|
+
constructor(
|
|
53
|
+
/** Name of the claim */
|
|
54
|
+
claim) {
|
|
55
|
+
this.claim = claim;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Refer to a global attribute (`GLOBAL`).
|
|
60
|
+
*/
|
|
61
|
+
export class GlobalAttribute {
|
|
62
|
+
kind;
|
|
63
|
+
constructor(
|
|
64
|
+
/** Kind of the global attribute */
|
|
65
|
+
kind) {
|
|
66
|
+
this.kind = kind;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Refer to an attribute of a referable (`REFERENCE`).
|
|
71
|
+
*/
|
|
72
|
+
export class ReferenceAttribute {
|
|
73
|
+
reference;
|
|
74
|
+
constructor(
|
|
75
|
+
/** Reference to the attribute, e.g. `(Submodel)*#idShort` */
|
|
76
|
+
reference) {
|
|
77
|
+
this.reference = reference;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Refer to a global attribute which gives a date and time (`GLOBAL`).
|
|
82
|
+
*/
|
|
83
|
+
export class DateTimeAttributeItem {
|
|
84
|
+
kind;
|
|
85
|
+
constructor(
|
|
86
|
+
/** Kind of the global attribute */
|
|
87
|
+
kind) {
|
|
88
|
+
this.kind = kind;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Refer to a field of the queried data (`$field`), e.g. `$aas#idShort` or `$sme.Temperature#value`.
|
|
93
|
+
*/
|
|
94
|
+
export class FieldOperand {
|
|
95
|
+
field;
|
|
96
|
+
constructor(
|
|
97
|
+
/** Path to the field */
|
|
98
|
+
field) {
|
|
99
|
+
this.field = field;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Represent a string literal (`$strVal`).
|
|
104
|
+
*/
|
|
105
|
+
export class StringLiteral {
|
|
106
|
+
strVal;
|
|
107
|
+
constructor(strVal) {
|
|
108
|
+
this.strVal = strVal;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Use an attribute as an operand (`$attribute`).
|
|
113
|
+
*/
|
|
114
|
+
export class AttributeOperand {
|
|
115
|
+
attribute;
|
|
116
|
+
constructor(attribute) {
|
|
117
|
+
this.attribute = attribute;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Represent a number literal (`$numVal`).
|
|
122
|
+
*/
|
|
123
|
+
export class NumberLiteral {
|
|
124
|
+
numVal;
|
|
125
|
+
constructor(numVal) {
|
|
126
|
+
this.numVal = numVal;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Represent a hexadecimal literal (`$hexVal`), e.g. `16#1F`.
|
|
131
|
+
*/
|
|
132
|
+
export class HexLiteral {
|
|
133
|
+
hexVal;
|
|
134
|
+
constructor(hexVal) {
|
|
135
|
+
this.hexVal = hexVal;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Represent a date-time literal (`$dateTimeVal`), e.g. `2025-01-01T00:00:00Z`.
|
|
140
|
+
*/
|
|
141
|
+
export class DateTimeLiteral {
|
|
142
|
+
dateTimeVal;
|
|
143
|
+
constructor(dateTimeVal) {
|
|
144
|
+
this.dateTimeVal = dateTimeVal;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Represent a time literal (`$timeVal`), e.g. `12:00` or `12:00:00`.
|
|
149
|
+
*/
|
|
150
|
+
export class TimeLiteral {
|
|
151
|
+
timeVal;
|
|
152
|
+
constructor(timeVal) {
|
|
153
|
+
this.timeVal = timeVal;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Represent a boolean literal (`$boolean`). It is both an operand and a logical expression.
|
|
158
|
+
*/
|
|
159
|
+
export class BooleanLiteral {
|
|
160
|
+
boolean;
|
|
161
|
+
constructor(boolean) {
|
|
162
|
+
this.boolean = boolean;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Cast the operand to a string (`$strCast`).
|
|
167
|
+
*/
|
|
168
|
+
export class StringCast {
|
|
169
|
+
strCast;
|
|
170
|
+
constructor(strCast) {
|
|
171
|
+
this.strCast = strCast;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Cast the operand to a number (`$numCast`).
|
|
176
|
+
*/
|
|
177
|
+
export class NumberCast {
|
|
178
|
+
numCast;
|
|
179
|
+
constructor(numCast) {
|
|
180
|
+
this.numCast = numCast;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Cast the operand to a hexadecimal (`$hexCast`).
|
|
185
|
+
*/
|
|
186
|
+
export class HexCast {
|
|
187
|
+
hexCast;
|
|
188
|
+
constructor(hexCast) {
|
|
189
|
+
this.hexCast = hexCast;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Cast the operand to a boolean (`$boolCast`).
|
|
194
|
+
*/
|
|
195
|
+
export class BooleanCast {
|
|
196
|
+
boolCast;
|
|
197
|
+
constructor(boolCast) {
|
|
198
|
+
this.boolCast = boolCast;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Cast the operand to a date-time (`$dateTimeCast`).
|
|
203
|
+
*/
|
|
204
|
+
export class DateTimeCast {
|
|
205
|
+
dateTimeCast;
|
|
206
|
+
constructor(dateTimeCast) {
|
|
207
|
+
this.dateTimeCast = dateTimeCast;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Cast the operand to a time (`$timeCast`).
|
|
212
|
+
*/
|
|
213
|
+
export class TimeCast {
|
|
214
|
+
timeCast;
|
|
215
|
+
constructor(timeCast) {
|
|
216
|
+
this.timeCast = timeCast;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Extract the day of the week from a date-time (`$dayOfWeek`).
|
|
221
|
+
*/
|
|
222
|
+
export class DayOfWeek {
|
|
223
|
+
dayOfWeek;
|
|
224
|
+
constructor(dayOfWeek) {
|
|
225
|
+
this.dayOfWeek = dayOfWeek;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Extract the day of the month from a date-time (`$dayOfMonth`).
|
|
230
|
+
*/
|
|
231
|
+
export class DayOfMonth {
|
|
232
|
+
dayOfMonth;
|
|
233
|
+
constructor(dayOfMonth) {
|
|
234
|
+
this.dayOfMonth = dayOfMonth;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Extract the month from a date-time (`$month`).
|
|
239
|
+
*/
|
|
240
|
+
export class Month {
|
|
241
|
+
month;
|
|
242
|
+
constructor(month) {
|
|
243
|
+
this.month = month;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Extract the year from a date-time (`$year`).
|
|
248
|
+
*/
|
|
249
|
+
export class Year {
|
|
250
|
+
year;
|
|
251
|
+
constructor(year) {
|
|
252
|
+
this.year = year;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Use a date-time global attribute as an operand (`$attribute`).
|
|
257
|
+
*/
|
|
258
|
+
export class DateTimeAttributeOperand {
|
|
259
|
+
attribute;
|
|
260
|
+
constructor(attribute) {
|
|
261
|
+
this.attribute = attribute;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Check whether the two operands are equal (`$eq`).
|
|
266
|
+
*/
|
|
267
|
+
export class EqualComparison {
|
|
268
|
+
eq;
|
|
269
|
+
constructor(eq) {
|
|
270
|
+
this.eq = eq;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Check whether the two operands are not equal (`$ne`).
|
|
275
|
+
*/
|
|
276
|
+
export class NotEqualComparison {
|
|
277
|
+
ne;
|
|
278
|
+
constructor(ne) {
|
|
279
|
+
this.ne = ne;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Check whether the first operand is greater than the second (`$gt`).
|
|
284
|
+
*/
|
|
285
|
+
export class GreaterThanComparison {
|
|
286
|
+
gt;
|
|
287
|
+
constructor(gt) {
|
|
288
|
+
this.gt = gt;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Check whether the first operand is greater than or equal to the second (`$ge`).
|
|
293
|
+
*/
|
|
294
|
+
export class GreaterThanOrEqualComparison {
|
|
295
|
+
ge;
|
|
296
|
+
constructor(ge) {
|
|
297
|
+
this.ge = ge;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Check whether the first operand is less than the second (`$lt`).
|
|
302
|
+
*/
|
|
303
|
+
export class LessThanComparison {
|
|
304
|
+
lt;
|
|
305
|
+
constructor(lt) {
|
|
306
|
+
this.lt = lt;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Check whether the first operand is less than or equal to the second (`$le`).
|
|
311
|
+
*/
|
|
312
|
+
export class LessThanOrEqualComparison {
|
|
313
|
+
le;
|
|
314
|
+
constructor(le) {
|
|
315
|
+
this.le = le;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Check whether the first operand contains the second (`$contains`).
|
|
320
|
+
*/
|
|
321
|
+
export class ContainsComparison {
|
|
322
|
+
contains;
|
|
323
|
+
constructor(contains) {
|
|
324
|
+
this.contains = contains;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Check whether the first operand starts with the second (`$starts-with`).
|
|
329
|
+
*/
|
|
330
|
+
export class StartsWithComparison {
|
|
331
|
+
startsWith;
|
|
332
|
+
constructor(startsWith) {
|
|
333
|
+
this.startsWith = startsWith;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Check whether the first operand ends with the second (`$ends-with`).
|
|
338
|
+
*/
|
|
339
|
+
export class EndsWithComparison {
|
|
340
|
+
endsWith;
|
|
341
|
+
constructor(endsWith) {
|
|
342
|
+
this.endsWith = endsWith;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Check whether the first operand matches the regular expression given by the second (`$regex`).
|
|
347
|
+
*/
|
|
348
|
+
export class RegexComparison {
|
|
349
|
+
regex;
|
|
350
|
+
constructor(regex) {
|
|
351
|
+
this.regex = regex;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Evaluate all the expressions against the same element of a list (`$match`), at least one.
|
|
356
|
+
*/
|
|
357
|
+
export class MatchClause {
|
|
358
|
+
matchOperands;
|
|
359
|
+
constructor(matchOperands) {
|
|
360
|
+
this.matchOperands = matchOperands;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Check whether all the operands hold (`$and`), at least two.
|
|
365
|
+
*/
|
|
366
|
+
export class AndExpression {
|
|
367
|
+
andOperands;
|
|
368
|
+
constructor(andOperands) {
|
|
369
|
+
this.andOperands = andOperands;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Check whether any of the operands holds (`$or`), at least two.
|
|
374
|
+
*/
|
|
375
|
+
export class OrExpression {
|
|
376
|
+
orOperands;
|
|
377
|
+
constructor(orOperands) {
|
|
378
|
+
this.orOperands = orOperands;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Negate the operand (`$not`).
|
|
383
|
+
*/
|
|
384
|
+
export class NotExpression {
|
|
385
|
+
notOperand;
|
|
386
|
+
constructor(notOperand) {
|
|
387
|
+
this.notOperand = notOperand;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Filter a fragment of the returned data by a condition (an entry of `$filters`).
|
|
392
|
+
*/
|
|
393
|
+
export class QueryFilter {
|
|
394
|
+
fragment;
|
|
395
|
+
condition;
|
|
396
|
+
constructor(
|
|
397
|
+
/** The fragment of the returned data to which the filter applies (`$fragment`) */
|
|
398
|
+
fragment,
|
|
399
|
+
/** The condition which the elements of the fragment need to fulfill (`$condition`) */
|
|
400
|
+
condition) {
|
|
401
|
+
this.fragment = fragment;
|
|
402
|
+
this.condition = condition;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* A query in the AAS Query Language.
|
|
407
|
+
*
|
|
408
|
+
* @example
|
|
409
|
+
* ```typescript
|
|
410
|
+
* const query = new Query(
|
|
411
|
+
* new EqualComparison([new FieldOperand('$aas#idShort'), new StringLiteral('Robot')])
|
|
412
|
+
* );
|
|
413
|
+
* ```
|
|
414
|
+
*/
|
|
415
|
+
export class Query {
|
|
416
|
+
condition;
|
|
417
|
+
select;
|
|
418
|
+
filters;
|
|
419
|
+
constructor(
|
|
420
|
+
/** The condition which the returned objects need to fulfill (`$condition`) */
|
|
421
|
+
condition,
|
|
422
|
+
/** What the query returns instead of the full objects (`$select`); full objects if `null` */
|
|
423
|
+
select = null,
|
|
424
|
+
/** Filters to reduce the returned data (`$filters`); at least one if set */
|
|
425
|
+
filters = null) {
|
|
426
|
+
this.condition = condition;
|
|
427
|
+
this.select = select;
|
|
428
|
+
this.filters = filters;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A page of query results.
|
|
3
|
+
*
|
|
4
|
+
* `resultType` tells the two shapes apart, as in `paging_metadata.resultType` of the AAS API: `'Identifier'` if the
|
|
5
|
+
* query selected only identifiers (`select: QuerySelect.Id`), otherwise the type of the returned objects.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* if (response.success && response.data.resultType === 'Identifier') {
|
|
10
|
+
* response.data.result; // string[]
|
|
11
|
+
* }
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export type QueryResult<T, ResultType extends string, PagingMetadata> = {
|
|
15
|
+
pagedResult: PagingMetadata | undefined;
|
|
16
|
+
resultType: ResultType;
|
|
17
|
+
result: T[];
|
|
18
|
+
} | {
|
|
19
|
+
pagedResult: PagingMetadata | undefined;
|
|
20
|
+
resultType: 'Identifier';
|
|
21
|
+
result: string[];
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/models/index.d.ts
CHANGED
package/dist/models/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ApiResult } from '../models/api';
|
|
2
2
|
import { AssetAdministrationShell, Reference, Submodel } from '@aas-core-works/aas-core3.1-typescript/types';
|
|
3
3
|
import { Configuration } from '../generated';
|
|
4
|
+
import { type EndpointConfigurationResolver } from '../lib/endpointConfiguration';
|
|
4
5
|
import { AssetId } from '../models/AssetId';
|
|
5
6
|
import { AssetAdministrationShellDescriptor } from '../models/Descriptors';
|
|
6
7
|
export interface AasServiceConfig {
|
|
@@ -10,6 +11,12 @@ export interface AasServiceConfig {
|
|
|
10
11
|
submodelRepositoryConfig?: Configuration;
|
|
11
12
|
conceptDescriptionRepositoryConfig?: Configuration;
|
|
12
13
|
discoveryConfig?: Configuration;
|
|
14
|
+
/**
|
|
15
|
+
* Returns the configuration for requests to a descriptor endpoint, or `null` to reject it.
|
|
16
|
+
* Used for AAS and Submodel endpoints. Without it, endpoint requests use the auth, fetch and middleware settings
|
|
17
|
+
* of the respective repository configuration.
|
|
18
|
+
*/
|
|
19
|
+
endpointConfiguration?: EndpointConfigurationResolver;
|
|
13
20
|
}
|
|
14
21
|
export interface AasListResolutionWarning {
|
|
15
22
|
descriptorId?: string;
|
|
@@ -34,6 +41,7 @@ export declare class AasService {
|
|
|
34
41
|
private aasRegistryConfig?;
|
|
35
42
|
private aasRepositoryConfig?;
|
|
36
43
|
private discoveryConfig?;
|
|
44
|
+
private endpointConfiguration?;
|
|
37
45
|
private submodelService;
|
|
38
46
|
constructor(config: AasServiceConfig);
|
|
39
47
|
/**
|
|
@@ -119,9 +127,10 @@ export declare class AasService {
|
|
|
119
127
|
*
|
|
120
128
|
* Extracts the base URL and base64url-encoded AAS identifier from the endpoint,
|
|
121
129
|
* decodes the identifier, and fetches the shell from the repository.
|
|
130
|
+
* If an `endpointConfiguration` hook is configured, it decides whether and how the endpoint is contacted.
|
|
122
131
|
*
|
|
123
132
|
* @param options Object containing:
|
|
124
|
-
* - endpoint: The endpoint URL (format: http://host/shells/{base64EncodedId})
|
|
133
|
+
* - endpoint: The endpoint URL (format: http://host[/basePath]/shells/{base64EncodedId})
|
|
125
134
|
* - includeSubmodels?: Whether to fetch submodels for the shell (default: false)
|
|
126
135
|
* - includeConceptDescriptions?: Whether to fetch concept descriptions (default: false)
|
|
127
136
|
*
|
|
@@ -244,12 +253,14 @@ export declare class AasService {
|
|
|
244
253
|
submodelElementPath?: string;
|
|
245
254
|
}, any>>;
|
|
246
255
|
/**
|
|
247
|
-
*
|
|
256
|
+
* Determines the configuration for a request to an AAS endpoint, using the `endpointConfiguration` hook if
|
|
257
|
+
* configured and the repository settings otherwise.
|
|
248
258
|
*
|
|
259
|
+
* @param href The full endpoint URL
|
|
249
260
|
* @param basePath The endpoint base path to target
|
|
250
|
-
* @returns
|
|
261
|
+
* @returns The configuration, or an `EndpointRejected` error
|
|
251
262
|
*/
|
|
252
|
-
private
|
|
263
|
+
private createEndpointConfiguration;
|
|
253
264
|
/**
|
|
254
265
|
* Helper method to create an AAS descriptor from an AssetAdministrationShell.
|
|
255
266
|
* Populates descriptor fields from the shell including metadata and endpoint configuration.
|