@azure/digital-twins-core 2.0.0-alpha.20240112.1 → 2.0.0-alpha.20240126.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +208 -146
- package/dist/index.js.map +1 -1
- package/dist-esm/src/digitalTwinsClient.js +47 -50
- package/dist-esm/src/digitalTwinsClient.js.map +1 -1
- package/dist-esm/src/generated/azureDigitalTwinsAPI.js +3 -7
- package/dist-esm/src/generated/azureDigitalTwinsAPI.js.map +1 -1
- package/dist-esm/src/generated/operations/digitalTwinModels.js +40 -22
- package/dist-esm/src/generated/operations/digitalTwinModels.js.map +1 -1
- package/dist-esm/src/generated/operations/digitalTwins.js +79 -44
- package/dist-esm/src/generated/operations/digitalTwins.js.map +1 -1
- package/dist-esm/src/generated/operations/eventRoutes.js +40 -22
- package/dist-esm/src/generated/operations/eventRoutes.js.map +1 -1
- package/dist-esm/src/generated/pagingHelper.js +4 -2
- package/dist-esm/src/generated/pagingHelper.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var tslib = require('tslib');
|
|
5
6
|
var uuid = require('uuid');
|
|
6
7
|
var coreClient = require('@azure/core-client');
|
|
7
8
|
var coreTracing = require('@azure/core-tracing');
|
|
@@ -35,10 +36,11 @@ var coreClient__namespace = /*#__PURE__*/_interopNamespaceDefault(coreClient);
|
|
|
35
36
|
*/
|
|
36
37
|
const pageMap = new WeakMap();
|
|
37
38
|
function setContinuationToken(page, continuationToken) {
|
|
39
|
+
var _a;
|
|
38
40
|
if (typeof page !== "object" || page === null || !continuationToken) {
|
|
39
41
|
return;
|
|
40
42
|
}
|
|
41
|
-
const pageInfo = pageMap.get(page)
|
|
43
|
+
const pageInfo = (_a = pageMap.get(page)) !== null && _a !== void 0 ? _a : {};
|
|
42
44
|
pageInfo.continuationToken = continuationToken;
|
|
43
45
|
pageMap.set(page, pageInfo);
|
|
44
46
|
}
|
|
@@ -854,35 +856,52 @@ class DigitalTwinModelsImpl {
|
|
|
854
856
|
return this;
|
|
855
857
|
},
|
|
856
858
|
byPage: (settings) => {
|
|
857
|
-
if (settings
|
|
859
|
+
if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
|
|
858
860
|
throw new Error("maxPageSize is not supported by this operation.");
|
|
859
861
|
}
|
|
860
862
|
return this.listPagingPage(options, settings);
|
|
861
863
|
}
|
|
862
864
|
};
|
|
863
865
|
}
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
866
|
+
listPagingPage(options, settings) {
|
|
867
|
+
return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
|
|
868
|
+
let result;
|
|
869
|
+
let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
|
|
870
|
+
if (!continuationToken) {
|
|
871
|
+
result = yield tslib.__await(this._list(options));
|
|
872
|
+
let page = result.value || [];
|
|
873
|
+
continuationToken = result.nextLink;
|
|
874
|
+
setContinuationToken(page, continuationToken);
|
|
875
|
+
yield yield tslib.__await(page);
|
|
876
|
+
}
|
|
877
|
+
while (continuationToken) {
|
|
878
|
+
result = yield tslib.__await(this._listNext(continuationToken, options));
|
|
879
|
+
continuationToken = result.nextLink;
|
|
880
|
+
let page = result.value || [];
|
|
881
|
+
setContinuationToken(page, continuationToken);
|
|
882
|
+
yield yield tslib.__await(page);
|
|
883
|
+
}
|
|
884
|
+
});
|
|
881
885
|
}
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
+
listPagingAll(options) {
|
|
887
|
+
return tslib.__asyncGenerator(this, arguments, function* listPagingAll_1() {
|
|
888
|
+
var _a, e_1, _b, _c;
|
|
889
|
+
try {
|
|
890
|
+
for (var _d = true, _e = tslib.__asyncValues(this.listPagingPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
891
|
+
_c = _f.value;
|
|
892
|
+
_d = false;
|
|
893
|
+
const page = _c;
|
|
894
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
898
|
+
finally {
|
|
899
|
+
try {
|
|
900
|
+
if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
|
|
901
|
+
}
|
|
902
|
+
finally { if (e_1) throw e_1.error; }
|
|
903
|
+
}
|
|
904
|
+
});
|
|
886
905
|
}
|
|
887
906
|
/**
|
|
888
907
|
* Uploads one or more models. When any error occurs, no models are uploaded.
|
|
@@ -1182,35 +1201,52 @@ class DigitalTwinsImpl {
|
|
|
1182
1201
|
return this;
|
|
1183
1202
|
},
|
|
1184
1203
|
byPage: (settings) => {
|
|
1185
|
-
if (settings
|
|
1204
|
+
if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
|
|
1186
1205
|
throw new Error("maxPageSize is not supported by this operation.");
|
|
1187
1206
|
}
|
|
1188
1207
|
return this.listRelationshipsPagingPage(id, options, settings);
|
|
1189
1208
|
}
|
|
1190
1209
|
};
|
|
1191
1210
|
}
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1211
|
+
listRelationshipsPagingPage(id, options, settings) {
|
|
1212
|
+
return tslib.__asyncGenerator(this, arguments, function* listRelationshipsPagingPage_1() {
|
|
1213
|
+
let result;
|
|
1214
|
+
let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
|
|
1215
|
+
if (!continuationToken) {
|
|
1216
|
+
result = yield tslib.__await(this._listRelationships(id, options));
|
|
1217
|
+
let page = result.value || [];
|
|
1218
|
+
continuationToken = result.nextLink;
|
|
1219
|
+
setContinuationToken(page, continuationToken);
|
|
1220
|
+
yield yield tslib.__await(page);
|
|
1221
|
+
}
|
|
1222
|
+
while (continuationToken) {
|
|
1223
|
+
result = yield tslib.__await(this._listRelationshipsNext(id, continuationToken, options));
|
|
1224
|
+
continuationToken = result.nextLink;
|
|
1225
|
+
let page = result.value || [];
|
|
1226
|
+
setContinuationToken(page, continuationToken);
|
|
1227
|
+
yield yield tslib.__await(page);
|
|
1228
|
+
}
|
|
1229
|
+
});
|
|
1209
1230
|
}
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1231
|
+
listRelationshipsPagingAll(id, options) {
|
|
1232
|
+
return tslib.__asyncGenerator(this, arguments, function* listRelationshipsPagingAll_1() {
|
|
1233
|
+
var _a, e_1, _b, _c;
|
|
1234
|
+
try {
|
|
1235
|
+
for (var _d = true, _e = tslib.__asyncValues(this.listRelationshipsPagingPage(id, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
1236
|
+
_c = _f.value;
|
|
1237
|
+
_d = false;
|
|
1238
|
+
const page = _c;
|
|
1239
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1243
|
+
finally {
|
|
1244
|
+
try {
|
|
1245
|
+
if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
|
|
1246
|
+
}
|
|
1247
|
+
finally { if (e_1) throw e_1.error; }
|
|
1248
|
+
}
|
|
1249
|
+
});
|
|
1214
1250
|
}
|
|
1215
1251
|
/**
|
|
1216
1252
|
* Retrieves all incoming relationship for a digital twin.
|
|
@@ -1233,35 +1269,52 @@ class DigitalTwinsImpl {
|
|
|
1233
1269
|
return this;
|
|
1234
1270
|
},
|
|
1235
1271
|
byPage: (settings) => {
|
|
1236
|
-
if (settings
|
|
1272
|
+
if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
|
|
1237
1273
|
throw new Error("maxPageSize is not supported by this operation.");
|
|
1238
1274
|
}
|
|
1239
1275
|
return this.listIncomingRelationshipsPagingPage(id, options, settings);
|
|
1240
1276
|
}
|
|
1241
1277
|
};
|
|
1242
1278
|
}
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1279
|
+
listIncomingRelationshipsPagingPage(id, options, settings) {
|
|
1280
|
+
return tslib.__asyncGenerator(this, arguments, function* listIncomingRelationshipsPagingPage_1() {
|
|
1281
|
+
let result;
|
|
1282
|
+
let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
|
|
1283
|
+
if (!continuationToken) {
|
|
1284
|
+
result = yield tslib.__await(this._listIncomingRelationships(id, options));
|
|
1285
|
+
let page = result.value || [];
|
|
1286
|
+
continuationToken = result.nextLink;
|
|
1287
|
+
setContinuationToken(page, continuationToken);
|
|
1288
|
+
yield yield tslib.__await(page);
|
|
1289
|
+
}
|
|
1290
|
+
while (continuationToken) {
|
|
1291
|
+
result = yield tslib.__await(this._listIncomingRelationshipsNext(id, continuationToken, options));
|
|
1292
|
+
continuationToken = result.nextLink;
|
|
1293
|
+
let page = result.value || [];
|
|
1294
|
+
setContinuationToken(page, continuationToken);
|
|
1295
|
+
yield yield tslib.__await(page);
|
|
1296
|
+
}
|
|
1297
|
+
});
|
|
1260
1298
|
}
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1299
|
+
listIncomingRelationshipsPagingAll(id, options) {
|
|
1300
|
+
return tslib.__asyncGenerator(this, arguments, function* listIncomingRelationshipsPagingAll_1() {
|
|
1301
|
+
var _a, e_2, _b, _c;
|
|
1302
|
+
try {
|
|
1303
|
+
for (var _d = true, _e = tslib.__asyncValues(this.listIncomingRelationshipsPagingPage(id, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
1304
|
+
_c = _f.value;
|
|
1305
|
+
_d = false;
|
|
1306
|
+
const page = _c;
|
|
1307
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
1311
|
+
finally {
|
|
1312
|
+
try {
|
|
1313
|
+
if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
|
|
1314
|
+
}
|
|
1315
|
+
finally { if (e_2) throw e_2.error; }
|
|
1316
|
+
}
|
|
1317
|
+
});
|
|
1265
1318
|
}
|
|
1266
1319
|
/**
|
|
1267
1320
|
* Retrieves a digital twin.
|
|
@@ -1883,35 +1936,52 @@ class EventRoutesImpl {
|
|
|
1883
1936
|
return this;
|
|
1884
1937
|
},
|
|
1885
1938
|
byPage: (settings) => {
|
|
1886
|
-
if (settings
|
|
1939
|
+
if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
|
|
1887
1940
|
throw new Error("maxPageSize is not supported by this operation.");
|
|
1888
1941
|
}
|
|
1889
1942
|
return this.listPagingPage(options, settings);
|
|
1890
1943
|
}
|
|
1891
1944
|
};
|
|
1892
1945
|
}
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1946
|
+
listPagingPage(options, settings) {
|
|
1947
|
+
return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
|
|
1948
|
+
let result;
|
|
1949
|
+
let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
|
|
1950
|
+
if (!continuationToken) {
|
|
1951
|
+
result = yield tslib.__await(this._list(options));
|
|
1952
|
+
let page = result.value || [];
|
|
1953
|
+
continuationToken = result.nextLink;
|
|
1954
|
+
setContinuationToken(page, continuationToken);
|
|
1955
|
+
yield yield tslib.__await(page);
|
|
1956
|
+
}
|
|
1957
|
+
while (continuationToken) {
|
|
1958
|
+
result = yield tslib.__await(this._listNext(continuationToken, options));
|
|
1959
|
+
continuationToken = result.nextLink;
|
|
1960
|
+
let page = result.value || [];
|
|
1961
|
+
setContinuationToken(page, continuationToken);
|
|
1962
|
+
yield yield tslib.__await(page);
|
|
1963
|
+
}
|
|
1964
|
+
});
|
|
1910
1965
|
}
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1966
|
+
listPagingAll(options) {
|
|
1967
|
+
return tslib.__asyncGenerator(this, arguments, function* listPagingAll_1() {
|
|
1968
|
+
var _a, e_1, _b, _c;
|
|
1969
|
+
try {
|
|
1970
|
+
for (var _d = true, _e = tslib.__asyncValues(this.listPagingPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
1971
|
+
_c = _f.value;
|
|
1972
|
+
_d = false;
|
|
1973
|
+
const page = _c;
|
|
1974
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
|
1975
|
+
}
|
|
1976
|
+
}
|
|
1977
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1978
|
+
finally {
|
|
1979
|
+
try {
|
|
1980
|
+
if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
|
|
1981
|
+
}
|
|
1982
|
+
finally { if (e_1) throw e_1.error; }
|
|
1983
|
+
}
|
|
1984
|
+
});
|
|
1915
1985
|
}
|
|
1916
1986
|
/**
|
|
1917
1987
|
* Retrieves all event routes.
|
|
@@ -2063,6 +2133,7 @@ class AzureDigitalTwinsAPI extends coreClient__namespace.ServiceClient {
|
|
|
2063
2133
|
* @param options The parameter options
|
|
2064
2134
|
*/
|
|
2065
2135
|
constructor(options) {
|
|
2136
|
+
var _a, _b;
|
|
2066
2137
|
// Initializing default values for options
|
|
2067
2138
|
if (!options) {
|
|
2068
2139
|
options = {};
|
|
@@ -2074,14 +2145,9 @@ class AzureDigitalTwinsAPI extends coreClient__namespace.ServiceClient {
|
|
|
2074
2145
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
2075
2146
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
2076
2147
|
: `${packageDetails}`;
|
|
2077
|
-
const optionsWithDefaults = {
|
|
2078
|
-
...defaults,
|
|
2079
|
-
...options,
|
|
2080
|
-
userAgentOptions: {
|
|
2148
|
+
const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
|
|
2081
2149
|
userAgentPrefix
|
|
2082
|
-
},
|
|
2083
|
-
endpoint: options.endpoint ?? options.baseUri ?? "https://digitaltwins-hostname"
|
|
2084
|
-
};
|
|
2150
|
+
}, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://digitaltwins-hostname" });
|
|
2085
2151
|
super(optionsWithDefaults);
|
|
2086
2152
|
// Assigning values to Constant parameters
|
|
2087
2153
|
this.$host = options.$host || "https://digitaltwins-hostname";
|
|
@@ -2166,19 +2232,11 @@ class DigitalTwinsClient {
|
|
|
2166
2232
|
* @param options - Used to configure the service client.
|
|
2167
2233
|
*/
|
|
2168
2234
|
constructor(endpointUrl, credential, options = {}) {
|
|
2169
|
-
const internalPipelineOptions = {
|
|
2170
|
-
...options,
|
|
2171
|
-
loggingOptions: {
|
|
2235
|
+
const internalPipelineOptions = Object.assign(Object.assign({}, options), { loggingOptions: {
|
|
2172
2236
|
logger: logger.info,
|
|
2173
2237
|
additionalAllowedHeaderNames: ["x-ms-request-id"],
|
|
2174
|
-
}
|
|
2175
|
-
};
|
|
2176
|
-
this.client = new AzureDigitalTwinsAPI({
|
|
2177
|
-
endpoint: endpointUrl,
|
|
2178
|
-
credential,
|
|
2179
|
-
credentialScopes: DEFAULT_DIGITALTWINS_SCOPE,
|
|
2180
|
-
...internalPipelineOptions,
|
|
2181
|
-
});
|
|
2238
|
+
} });
|
|
2239
|
+
this.client = new AzureDigitalTwinsAPI(Object.assign({ endpoint: endpointUrl, credential, credentialScopes: DEFAULT_DIGITALTWINS_SCOPE }, internalPipelineOptions));
|
|
2182
2240
|
}
|
|
2183
2241
|
/**
|
|
2184
2242
|
* Get a digital twin
|
|
@@ -2347,10 +2405,7 @@ class DigitalTwinsClient {
|
|
|
2347
2405
|
*/
|
|
2348
2406
|
publishTelemetry(digitalTwinId, payload, messageId, options = {}) {
|
|
2349
2407
|
return tracingClient.withSpan("DigitalTwinsClient.publishTelemetry", options, async (updatedOptions) => {
|
|
2350
|
-
return this.client.digitalTwins.sendTelemetry(digitalTwinId, messageId || uuid.v4(), payload, {
|
|
2351
|
-
...updatedOptions,
|
|
2352
|
-
telemetrySourceTime: new Date().toISOString(),
|
|
2353
|
-
});
|
|
2408
|
+
return this.client.digitalTwins.sendTelemetry(digitalTwinId, messageId || uuid.v4(), payload, Object.assign(Object.assign({}, updatedOptions), { telemetrySourceTime: new Date().toISOString() }));
|
|
2354
2409
|
});
|
|
2355
2410
|
}
|
|
2356
2411
|
/**
|
|
@@ -2365,7 +2420,7 @@ class DigitalTwinsClient {
|
|
|
2365
2420
|
*/
|
|
2366
2421
|
publishComponentTelemetry(digitalTwinId, componentName, payload, messageId, options = {}) {
|
|
2367
2422
|
return tracingClient.withSpan("DigitalTwinsClient.publishComponentTelemetry", options, async (updatedOptions) => {
|
|
2368
|
-
return this.client.digitalTwins.sendComponentTelemetry(digitalTwinId, componentName, messageId || uuid.v4(), payload, {
|
|
2423
|
+
return this.client.digitalTwins.sendComponentTelemetry(digitalTwinId, componentName, messageId || uuid.v4(), payload, Object.assign(Object.assign({}, updatedOptions), { telemetrySourceTime: new Date().toISOString() }));
|
|
2369
2424
|
});
|
|
2370
2425
|
}
|
|
2371
2426
|
/**
|
|
@@ -2376,10 +2431,8 @@ class DigitalTwinsClient {
|
|
|
2376
2431
|
* @returns The application/json model.
|
|
2377
2432
|
*/
|
|
2378
2433
|
getModel(modelId, options = {}) {
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
includeModelDefinition: options?.includeModelDefinition ?? false,
|
|
2382
|
-
}, async (updatedOptions) => {
|
|
2434
|
+
var _a;
|
|
2435
|
+
return tracingClient.withSpan("DigitalTwinsClient.getModel", Object.assign(Object.assign({}, options), { includeModelDefinition: (_a = options === null || options === void 0 ? void 0 : options.includeModelDefinition) !== null && _a !== void 0 ? _a : false }), async (updatedOptions) => {
|
|
2383
2436
|
return this.client.digitalTwinModels.getById(modelId, updatedOptions);
|
|
2384
2437
|
});
|
|
2385
2438
|
}
|
|
@@ -2390,10 +2443,8 @@ class DigitalTwinsClient {
|
|
|
2390
2443
|
* @returns A pageable set of application/json models.
|
|
2391
2444
|
*/
|
|
2392
2445
|
listModels(options = {}) {
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
includeModelDefinition: options?.includeModelDefinition ?? false,
|
|
2396
|
-
});
|
|
2446
|
+
var _a;
|
|
2447
|
+
return this.client.digitalTwinModels.list(Object.assign(Object.assign({}, options), { includeModelDefinition: (_a = options === null || options === void 0 ? void 0 : options.includeModelDefinition) !== null && _a !== void 0 ? _a : false }));
|
|
2397
2448
|
}
|
|
2398
2449
|
/**
|
|
2399
2450
|
* Create one or many
|
|
@@ -2403,10 +2454,7 @@ class DigitalTwinsClient {
|
|
|
2403
2454
|
* @returns The created application/json models.
|
|
2404
2455
|
*/
|
|
2405
2456
|
createModels(dtdlModels, options = {}) {
|
|
2406
|
-
return tracingClient.withSpan("DigitalTwinsClient.createModels", {
|
|
2407
|
-
...options,
|
|
2408
|
-
models: dtdlModels,
|
|
2409
|
-
}, async (updatedOptions) => {
|
|
2457
|
+
return tracingClient.withSpan("DigitalTwinsClient.createModels", Object.assign(Object.assign({}, options), { models: dtdlModels }), async (updatedOptions) => {
|
|
2410
2458
|
return this.client.digitalTwinModels.add(updatedOptions);
|
|
2411
2459
|
});
|
|
2412
2460
|
}
|
|
@@ -2471,13 +2519,10 @@ class DigitalTwinsClient {
|
|
|
2471
2519
|
|
|
2472
2520
|
*/
|
|
2473
2521
|
upsertEventRoute(eventRouteId, endpointId, filter, options = {}) {
|
|
2474
|
-
return tracingClient.withSpan("DigitalTwinsClient.upsertEventRoute", {
|
|
2475
|
-
eventRoute: {
|
|
2522
|
+
return tracingClient.withSpan("DigitalTwinsClient.upsertEventRoute", Object.assign({ eventRoute: {
|
|
2476
2523
|
endpointName: endpointId,
|
|
2477
2524
|
filter,
|
|
2478
|
-
},
|
|
2479
|
-
...options,
|
|
2480
|
-
}, async (updatedOptions) => {
|
|
2525
|
+
} }, options), async (updatedOptions) => {
|
|
2481
2526
|
return this.client.eventRoutes.add(eventRouteId, updatedOptions);
|
|
2482
2527
|
});
|
|
2483
2528
|
}
|
|
@@ -2501,30 +2546,47 @@ class DigitalTwinsClient {
|
|
|
2501
2546
|
* @param continuationState - An object that indicates the position of the paginated request.
|
|
2502
2547
|
*
|
|
2503
2548
|
*/
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2549
|
+
queryTwinsPage(query, options, continuationState) {
|
|
2550
|
+
return tslib.__asyncGenerator(this, arguments, function* queryTwinsPage_1() {
|
|
2551
|
+
let { continuationToken } = continuationState !== null && continuationState !== void 0 ? continuationState : {};
|
|
2552
|
+
if (!continuationToken) {
|
|
2553
|
+
const queryResult = yield tslib.__await(this.client.query.queryTwins({ query }, options));
|
|
2554
|
+
continuationToken = queryResult.continuationToken;
|
|
2555
|
+
yield yield tslib.__await(queryResult);
|
|
2556
|
+
}
|
|
2557
|
+
while (continuationToken) {
|
|
2558
|
+
const queryResult = yield tslib.__await(this.client.query.queryTwins({ query, continuationToken }, options));
|
|
2559
|
+
continuationToken = queryResult.continuationToken;
|
|
2560
|
+
yield yield tslib.__await(queryResult);
|
|
2561
|
+
}
|
|
2562
|
+
});
|
|
2516
2563
|
}
|
|
2517
2564
|
/**
|
|
2518
2565
|
* Deals with the iteration of all the available results of {@link query}.
|
|
2519
2566
|
* @param query - The query string, in SQL-like syntax.
|
|
2520
2567
|
* @param options - Common options for the iterative endpoints.
|
|
2521
2568
|
*/
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2569
|
+
queryTwinsAll(query, options) {
|
|
2570
|
+
return tslib.__asyncGenerator(this, arguments, function* queryTwinsAll_1() {
|
|
2571
|
+
var _a, e_1, _b, _c;
|
|
2572
|
+
try {
|
|
2573
|
+
for (var _d = true, _e = tslib.__asyncValues(this.queryTwinsPage(query, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
2574
|
+
_c = _f.value;
|
|
2575
|
+
_d = false;
|
|
2576
|
+
const page = _c;
|
|
2577
|
+
if (page.value) {
|
|
2578
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page.value)));
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2526
2581
|
}
|
|
2527
|
-
|
|
2582
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
2583
|
+
finally {
|
|
2584
|
+
try {
|
|
2585
|
+
if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
|
|
2586
|
+
}
|
|
2587
|
+
finally { if (e_1) throw e_1.error; }
|
|
2588
|
+
}
|
|
2589
|
+
});
|
|
2528
2590
|
}
|
|
2529
2591
|
/**
|
|
2530
2592
|
* Query for digital twins.
|