@azure/communication-phone-numbers 1.3.0-beta.1 → 1.3.0-beta.2
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +38 -31
- package/dist/index.js +84 -92
- package/dist/index.js.map +1 -1
- package/dist-esm/src/generated/src/models/index.js.map +1 -1
- package/dist-esm/src/generated/src/models/mappers.js +12 -0
- package/dist-esm/src/generated/src/models/mappers.js.map +1 -1
- package/dist-esm/src/generated/src/models/parameters.js +9 -0
- package/dist-esm/src/generated/src/models/parameters.js.map +1 -1
- package/dist-esm/src/generated/src/operations/phoneNumbers.js +17 -42
- package/dist-esm/src/generated/src/operations/phoneNumbers.js.map +1 -1
- package/dist-esm/src/generated/src/operationsInterfaces/phoneNumbers.js.map +1 -1
- package/dist-esm/src/models.js.map +1 -1
- package/dist-esm/src/phoneNumbersClient.js +4 -1
- package/dist-esm/src/phoneNumbersClient.js.map +1 -1
- package/dist-esm/src/sipRoutingClient.js +6 -16
- package/dist-esm/src/sipRoutingClient.js.map +1 -1
- package/package.json +14 -11
- package/types/communication-phone-numbers.d.ts +6 -1
package/README.md
CHANGED
@@ -135,6 +135,7 @@ const client = new SipRoutingClient("<endpoint-from-resource>", credential);
|
|
135
135
|
The following sections provide code snippets that cover some of the common tasks using the Azure Communication Services Phone Numbers client. The scenarios that are covered here consist of:
|
136
136
|
|
137
137
|
PhoneNumbersClient
|
138
|
+
|
138
139
|
- [Search for available phone numbers](#search-for-available-phone-numbers)
|
139
140
|
- [Purchase phone numbers from a search](#purchase-phone-numbers-from-a-search)
|
140
141
|
- [Release a purchased phone number](#release-a-purchased-phone-number)
|
@@ -143,6 +144,7 @@ PhoneNumbersClient
|
|
143
144
|
- [List purchased phone numbers](#list-purchased-phone-numbers)
|
144
145
|
|
145
146
|
SipRoutingClient
|
147
|
+
|
146
148
|
- [Retrieve SIP trunks and routes](#retrieve-sip-trunks-and-routes)
|
147
149
|
- [Replace SIP trunks and routes](#replace-sip-trunks-and-routes)
|
148
150
|
- [Retrieve single trunk](#retrieve-single-trunk)
|
@@ -160,7 +162,7 @@ Use the `beginSearchAvailablePhoneNumbers` method to search for phone numbers an
|
|
160
162
|
```typescript
|
161
163
|
import {
|
162
164
|
PhoneNumbersClient,
|
163
|
-
SearchAvailablePhoneNumbersRequest
|
165
|
+
SearchAvailablePhoneNumbersRequest,
|
164
166
|
} from "@azure/communication-phone-numbers";
|
165
167
|
|
166
168
|
const connectionString = "endpoint=<endpoint>;accessKey=<accessKey>";
|
@@ -173,9 +175,9 @@ async function main() {
|
|
173
175
|
assignmentType: "application",
|
174
176
|
capabilities: {
|
175
177
|
sms: "outbound",
|
176
|
-
calling: "none"
|
178
|
+
calling: "none",
|
177
179
|
},
|
178
|
-
quantity: 1
|
180
|
+
quantity: 1,
|
179
181
|
};
|
180
182
|
|
181
183
|
const searchPoller = await client.beginSearchAvailablePhoneNumbers(searchRequest);
|
@@ -196,27 +198,30 @@ Use the `beginPurchasePhoneNumbers` method to purchase the phone numbers from yo
|
|
196
198
|
`beginPurchasePhoneNumbers` is a long running operation and returns a poller.
|
197
199
|
|
198
200
|
```typescript
|
199
|
-
import {
|
201
|
+
import {
|
202
|
+
PhoneNumbersClient,
|
203
|
+
SearchAvailablePhoneNumbersRequest,
|
204
|
+
} from "@azure/communication-phone-numbers";
|
200
205
|
|
201
206
|
const connectionString = "endpoint=<endpoint>;accessKey=<accessKey>";
|
202
207
|
const client = new PhoneNumbersClient(connectionString);
|
203
208
|
|
204
209
|
async function main() {
|
205
|
-
const searchRequest = {
|
210
|
+
const searchRequest: SearchAvailablePhoneNumbersRequest = {
|
206
211
|
countryCode: "US",
|
207
212
|
phoneNumberType: "tollFree",
|
208
213
|
assignmentType: "application",
|
209
214
|
capabilities: {
|
210
215
|
sms: "outbound",
|
211
|
-
calling: "none"
|
216
|
+
calling: "none",
|
212
217
|
},
|
213
|
-
quantity: 1
|
218
|
+
quantity: 1,
|
214
219
|
};
|
215
220
|
|
216
221
|
const searchPoller = await client.beginSearchAvailablePhoneNumbers(searchRequest);
|
217
222
|
|
218
223
|
// The search is underway. Wait to receive searchId.
|
219
|
-
const { searchId, phoneNumbers } = searchPoller.pollUntilDone();
|
224
|
+
const { searchId, phoneNumbers } = await searchPoller.pollUntilDone();
|
220
225
|
|
221
226
|
const purchasePoller = await client.beginPurchasePhoneNumbers(searchId);
|
222
227
|
|
@@ -262,7 +267,7 @@ Use the `beginUpdatePhoneNumberCapabilities` method to update the capabilities o
|
|
262
267
|
```typescript
|
263
268
|
import {
|
264
269
|
PhoneNumbersClient,
|
265
|
-
PhoneNumberCapabilitiesRequest
|
270
|
+
PhoneNumberCapabilitiesRequest,
|
266
271
|
} from "@azure/communication-phone-numbers";
|
267
272
|
|
268
273
|
const connectionString = "endpoint=<endpoint>;accessKey=<accessKey>";
|
@@ -274,7 +279,7 @@ async function main() {
|
|
274
279
|
// This will update phone number to send and receive sms, but only send calls.
|
275
280
|
const updateRequest: PhoneNumberCapabilitiesRequest = {
|
276
281
|
sms: "inbound+outbound",
|
277
|
-
calling: "outbound"
|
282
|
+
calling: "outbound",
|
278
283
|
};
|
279
284
|
|
280
285
|
const updatePoller = await client.beginUpdatePhoneNumberCapabilities(
|
@@ -300,7 +305,7 @@ import { PhoneNumbersClient } from "@azure/communication-phone-numbers";
|
|
300
305
|
const connectionString = "endpoint=<endpoint>;accessKey=<accessKey>";
|
301
306
|
const client = new PhoneNumbersClient(connectionString);
|
302
307
|
|
303
|
-
async main
|
308
|
+
async function main() {
|
304
309
|
const phoneNumberToGet = "<phone-number-to-get>";
|
305
310
|
|
306
311
|
const phoneNumber = await client.getPurchasedPhoneNumber(phoneNumberToGet);
|
@@ -322,7 +327,7 @@ import { PhoneNumbersClient } from "@azure/communication-phone-numbers";
|
|
322
327
|
const connectionString = "endpoint=<endpoint>;accessKey=<accessKey>";
|
323
328
|
const client = new PhoneNumbersClient(connectionString);
|
324
329
|
|
325
|
-
async main
|
330
|
+
async function main() {
|
326
331
|
const phoneNumbers = await client.listPurchasedPhoneNumbers();
|
327
332
|
|
328
333
|
for await (const phoneNumber of phoneNumbers) {
|
@@ -349,11 +354,11 @@ const client = new SipRoutingClient(connectionString);
|
|
349
354
|
async function main() {
|
350
355
|
const trunks = await client.listTrunks();
|
351
356
|
const routes = await client.listRoutes();
|
352
|
-
for await(const trunk of trunks) {
|
357
|
+
for await (const trunk of trunks) {
|
353
358
|
console.log(`Trunk ${trunk.fqdn}:${trunk.sipSignalingPort}`);
|
354
359
|
}
|
355
|
-
|
356
|
-
for await(const route of routes) {
|
360
|
+
|
361
|
+
for await (const route of routes) {
|
357
362
|
console.log(`Route ${route.name} with pattern ${route.numberPattern}`);
|
358
363
|
console.log(`Route's trunks: ${route.trunks?.join()}`);
|
359
364
|
}
|
@@ -375,26 +380,28 @@ const client = new SipRoutingClient(connectionString);
|
|
375
380
|
async function main() {
|
376
381
|
await client.setTrunks([
|
377
382
|
{
|
378
|
-
fqdn:
|
379
|
-
sipSignalingPort: 1234
|
380
|
-
},
|
381
|
-
|
382
|
-
|
383
|
-
|
383
|
+
fqdn: "sbc.one.domain.com",
|
384
|
+
sipSignalingPort: 1234,
|
385
|
+
},
|
386
|
+
{
|
387
|
+
fqdn: "sbc.two.domain.com",
|
388
|
+
sipSignalingPort: 1234,
|
389
|
+
},
|
384
390
|
]);
|
385
391
|
|
386
392
|
await client.setRoutes([
|
387
393
|
{
|
388
394
|
name: "First Route",
|
389
395
|
description: "route's description",
|
390
|
-
numberPattern: "
|
391
|
-
trunks: [
|
392
|
-
},
|
396
|
+
numberPattern: "^+[1-9][0-9]{3,23}$",
|
397
|
+
trunks: ["sbc.one.domain.com"],
|
398
|
+
},
|
399
|
+
{
|
393
400
|
name: "Second Route",
|
394
401
|
description: "route's description",
|
395
402
|
numberPattern: "^.*$",
|
396
|
-
trunks: [
|
397
|
-
}
|
403
|
+
trunks: ["sbc.two.domain.com", "sbc.one.domain.com"],
|
404
|
+
},
|
398
405
|
]);
|
399
406
|
}
|
400
407
|
|
@@ -410,11 +417,11 @@ const connectionString = "endpoint=<endpoint>;accessKey=<accessKey>";
|
|
410
417
|
const client = new SipRoutingClient(connectionString);
|
411
418
|
|
412
419
|
async function main() {
|
413
|
-
const trunk = await client.getTrunk(
|
420
|
+
const trunk = await client.getTrunk("sbc.one.domain.com");
|
414
421
|
if (trunk) {
|
415
422
|
console.log(`Trunk ${trunk.fqdn}:${trunk.sipSignalingPort}`);
|
416
423
|
} else {
|
417
|
-
|
424
|
+
console.log("Trunk not found");
|
418
425
|
}
|
419
426
|
}
|
420
427
|
|
@@ -431,8 +438,8 @@ const client = new SipRoutingClient(connectionString);
|
|
431
438
|
|
432
439
|
async function main() {
|
433
440
|
await client.setTrunk({
|
434
|
-
fqdn:
|
435
|
-
sipSignalingPort: 4321
|
441
|
+
fqdn: "sbc.one.domain.com",
|
442
|
+
sipSignalingPort: 4321,
|
436
443
|
});
|
437
444
|
}
|
438
445
|
|
@@ -448,7 +455,7 @@ const connectionString = "endpoint=<endpoint>;accessKey=<accessKey>";
|
|
448
455
|
const client = new SipRoutingClient(connectionString);
|
449
456
|
|
450
457
|
async function main() {
|
451
|
-
await client.deleteTrunk(
|
458
|
+
await client.deleteTrunk("sbc.one.domain.com");
|
452
459
|
}
|
453
460
|
|
454
461
|
main();
|
package/dist/index.js
CHANGED
@@ -10,8 +10,7 @@ var logger$1 = require('@azure/logger');
|
|
10
10
|
var coreClient = require('@azure/core-client');
|
11
11
|
var coreLro = require('@azure/core-lro');
|
12
12
|
|
13
|
-
function
|
14
|
-
if (e && e.__esModule) return e;
|
13
|
+
function _interopNamespaceDefault(e) {
|
15
14
|
var n = Object.create(null);
|
16
15
|
if (e) {
|
17
16
|
Object.keys(e).forEach(function (k) {
|
@@ -24,11 +23,11 @@ function _interopNamespace(e) {
|
|
24
23
|
}
|
25
24
|
});
|
26
25
|
}
|
27
|
-
n
|
26
|
+
n.default = e;
|
28
27
|
return Object.freeze(n);
|
29
28
|
}
|
30
29
|
|
31
|
-
var coreClient__namespace = /*#__PURE__*/
|
30
|
+
var coreClient__namespace = /*#__PURE__*/_interopNamespaceDefault(coreClient);
|
32
31
|
|
33
32
|
/*
|
34
33
|
* Copyright (c) Microsoft Corporation.
|
@@ -754,6 +753,18 @@ const OperatorInformation = {
|
|
754
753
|
name: "String"
|
755
754
|
}
|
756
755
|
},
|
756
|
+
nationalFormat: {
|
757
|
+
serializedName: "nationalFormat",
|
758
|
+
type: {
|
759
|
+
name: "String"
|
760
|
+
}
|
761
|
+
},
|
762
|
+
internationalFormat: {
|
763
|
+
serializedName: "internationalFormat",
|
764
|
+
type: {
|
765
|
+
name: "String"
|
766
|
+
}
|
767
|
+
},
|
757
768
|
numberType: {
|
758
769
|
serializedName: "numberType",
|
759
770
|
type: {
|
@@ -935,35 +946,35 @@ const PhoneNumbersReleasePhoneNumberHeaders = {
|
|
935
946
|
|
936
947
|
var Mappers$1 = /*#__PURE__*/Object.freeze({
|
937
948
|
__proto__: null,
|
938
|
-
PhoneNumberAreaCodes: PhoneNumberAreaCodes,
|
939
|
-
PhoneNumberAreaCode: PhoneNumberAreaCode,
|
940
|
-
CommunicationErrorResponse: CommunicationErrorResponse$1,
|
941
949
|
CommunicationError: CommunicationError,
|
950
|
+
CommunicationErrorResponse: CommunicationErrorResponse$1,
|
951
|
+
OfferingsResponse: OfferingsResponse,
|
952
|
+
OperatorDetails: OperatorDetails,
|
953
|
+
OperatorInformation: OperatorInformation,
|
954
|
+
OperatorInformationRequest: OperatorInformationRequest,
|
955
|
+
OperatorInformationResult: OperatorInformationResult,
|
956
|
+
PhoneNumberAdministrativeDivision: PhoneNumberAdministrativeDivision,
|
957
|
+
PhoneNumberAreaCode: PhoneNumberAreaCode,
|
958
|
+
PhoneNumberAreaCodes: PhoneNumberAreaCodes,
|
959
|
+
PhoneNumberCapabilities: PhoneNumberCapabilities,
|
960
|
+
PhoneNumberCapabilitiesRequest: PhoneNumberCapabilitiesRequest,
|
961
|
+
PhoneNumberCost: PhoneNumberCost,
|
942
962
|
PhoneNumberCountries: PhoneNumberCountries,
|
943
963
|
PhoneNumberCountry: PhoneNumberCountry,
|
944
964
|
PhoneNumberLocalities: PhoneNumberLocalities,
|
945
965
|
PhoneNumberLocality: PhoneNumberLocality,
|
946
|
-
PhoneNumberAdministrativeDivision: PhoneNumberAdministrativeDivision,
|
947
|
-
OfferingsResponse: OfferingsResponse,
|
948
966
|
PhoneNumberOffering: PhoneNumberOffering,
|
949
|
-
|
950
|
-
|
967
|
+
PhoneNumberOperation: PhoneNumberOperation,
|
968
|
+
PhoneNumberPurchaseRequest: PhoneNumberPurchaseRequest,
|
951
969
|
PhoneNumberSearchRequest: PhoneNumberSearchRequest,
|
952
970
|
PhoneNumberSearchResult: PhoneNumberSearchResult,
|
953
|
-
PhoneNumberPurchaseRequest: PhoneNumberPurchaseRequest,
|
954
|
-
PhoneNumberOperation: PhoneNumberOperation,
|
955
|
-
PhoneNumberCapabilitiesRequest: PhoneNumberCapabilitiesRequest,
|
956
|
-
PurchasedPhoneNumber: PurchasedPhoneNumber,
|
957
|
-
PurchasedPhoneNumbers: PurchasedPhoneNumbers,
|
958
|
-
OperatorInformationRequest: OperatorInformationRequest,
|
959
|
-
OperatorInformationResult: OperatorInformationResult,
|
960
|
-
OperatorInformation: OperatorInformation,
|
961
|
-
OperatorDetails: OperatorDetails,
|
962
|
-
PhoneNumbersSearchAvailablePhoneNumbersHeaders: PhoneNumbersSearchAvailablePhoneNumbersHeaders,
|
963
|
-
PhoneNumbersPurchasePhoneNumbersHeaders: PhoneNumbersPurchasePhoneNumbersHeaders,
|
964
971
|
PhoneNumbersGetOperationHeaders: PhoneNumbersGetOperationHeaders,
|
972
|
+
PhoneNumbersPurchasePhoneNumbersHeaders: PhoneNumbersPurchasePhoneNumbersHeaders,
|
973
|
+
PhoneNumbersReleasePhoneNumberHeaders: PhoneNumbersReleasePhoneNumberHeaders,
|
974
|
+
PhoneNumbersSearchAvailablePhoneNumbersHeaders: PhoneNumbersSearchAvailablePhoneNumbersHeaders,
|
965
975
|
PhoneNumbersUpdateCapabilitiesHeaders: PhoneNumbersUpdateCapabilitiesHeaders,
|
966
|
-
|
976
|
+
PurchasedPhoneNumber: PurchasedPhoneNumber,
|
977
|
+
PurchasedPhoneNumbers: PurchasedPhoneNumbers
|
967
978
|
});
|
968
979
|
|
969
980
|
/*
|
@@ -1156,6 +1167,15 @@ const top = {
|
|
1156
1167
|
}
|
1157
1168
|
}
|
1158
1169
|
};
|
1170
|
+
const options = {
|
1171
|
+
parameterPath: ["options", "options"],
|
1172
|
+
mapper: {
|
1173
|
+
serializedName: "options",
|
1174
|
+
type: {
|
1175
|
+
name: "String"
|
1176
|
+
}
|
1177
|
+
}
|
1178
|
+
};
|
1159
1179
|
const nextLink = {
|
1160
1180
|
parameterPath: "nextLink",
|
1161
1181
|
mapper: {
|
@@ -1252,16 +1272,11 @@ class PhoneNumbersImpl {
|
|
1252
1272
|
return tslib.__asyncGenerator(this, arguments, function* listAreaCodesPagingAll_1() {
|
1253
1273
|
var _a, e_1, _b, _c;
|
1254
1274
|
try {
|
1255
|
-
for (var _d = true, _e = tslib.__asyncValues(this.listAreaCodesPagingPage(countryCode, phoneNumberType, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
|
1275
|
+
for (var _d = true, _e = tslib.__asyncValues(this.listAreaCodesPagingPage(countryCode, phoneNumberType, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
|
1256
1276
|
_c = _f.value;
|
1257
1277
|
_d = false;
|
1258
|
-
|
1259
|
-
|
1260
|
-
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
1261
|
-
}
|
1262
|
-
finally {
|
1263
|
-
_d = true;
|
1264
|
-
}
|
1278
|
+
const page = _c;
|
1279
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
1265
1280
|
}
|
1266
1281
|
}
|
1267
1282
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
@@ -1318,16 +1333,11 @@ class PhoneNumbersImpl {
|
|
1318
1333
|
return tslib.__asyncGenerator(this, arguments, function* listAvailableCountriesPagingAll_1() {
|
1319
1334
|
var _a, e_2, _b, _c;
|
1320
1335
|
try {
|
1321
|
-
for (var _d = true, _e = tslib.__asyncValues(this.listAvailableCountriesPagingPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
|
1336
|
+
for (var _d = true, _e = tslib.__asyncValues(this.listAvailableCountriesPagingPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
|
1322
1337
|
_c = _f.value;
|
1323
1338
|
_d = false;
|
1324
|
-
|
1325
|
-
|
1326
|
-
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
1327
|
-
}
|
1328
|
-
finally {
|
1329
|
-
_d = true;
|
1330
|
-
}
|
1339
|
+
const page = _c;
|
1340
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
1331
1341
|
}
|
1332
1342
|
}
|
1333
1343
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
@@ -1385,16 +1395,11 @@ class PhoneNumbersImpl {
|
|
1385
1395
|
return tslib.__asyncGenerator(this, arguments, function* listAvailableLocalitiesPagingAll_1() {
|
1386
1396
|
var _a, e_3, _b, _c;
|
1387
1397
|
try {
|
1388
|
-
for (var _d = true, _e = tslib.__asyncValues(this.listAvailableLocalitiesPagingPage(countryCode, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
|
1398
|
+
for (var _d = true, _e = tslib.__asyncValues(this.listAvailableLocalitiesPagingPage(countryCode, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
|
1389
1399
|
_c = _f.value;
|
1390
1400
|
_d = false;
|
1391
|
-
|
1392
|
-
|
1393
|
-
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
1394
|
-
}
|
1395
|
-
finally {
|
1396
|
-
_d = true;
|
1397
|
-
}
|
1401
|
+
const page = _c;
|
1402
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
1398
1403
|
}
|
1399
1404
|
}
|
1400
1405
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
@@ -1452,16 +1457,11 @@ class PhoneNumbersImpl {
|
|
1452
1457
|
return tslib.__asyncGenerator(this, arguments, function* listOfferingsPagingAll_1() {
|
1453
1458
|
var _a, e_4, _b, _c;
|
1454
1459
|
try {
|
1455
|
-
for (var _d = true, _e = tslib.__asyncValues(this.listOfferingsPagingPage(countryCode, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
|
1460
|
+
for (var _d = true, _e = tslib.__asyncValues(this.listOfferingsPagingPage(countryCode, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
|
1456
1461
|
_c = _f.value;
|
1457
1462
|
_d = false;
|
1458
|
-
|
1459
|
-
|
1460
|
-
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
1461
|
-
}
|
1462
|
-
finally {
|
1463
|
-
_d = true;
|
1464
|
-
}
|
1463
|
+
const page = _c;
|
1464
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
1465
1465
|
}
|
1466
1466
|
}
|
1467
1467
|
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
@@ -1518,16 +1518,11 @@ class PhoneNumbersImpl {
|
|
1518
1518
|
return tslib.__asyncGenerator(this, arguments, function* listPhoneNumbersPagingAll_1() {
|
1519
1519
|
var _a, e_5, _b, _c;
|
1520
1520
|
try {
|
1521
|
-
for (var _d = true, _e = tslib.__asyncValues(this.listPhoneNumbersPagingPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
|
1521
|
+
for (var _d = true, _e = tslib.__asyncValues(this.listPhoneNumbersPagingPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
|
1522
1522
|
_c = _f.value;
|
1523
1523
|
_d = false;
|
1524
|
-
|
1525
|
-
|
1526
|
-
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
1527
|
-
}
|
1528
|
-
finally {
|
1529
|
-
_d = true;
|
1530
|
-
}
|
1524
|
+
const page = _c;
|
1525
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
1531
1526
|
}
|
1532
1527
|
}
|
1533
1528
|
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
@@ -1850,7 +1845,7 @@ class PhoneNumbersImpl {
|
|
1850
1845
|
});
|
1851
1846
|
}
|
1852
1847
|
/**
|
1853
|
-
* Searches for operator information for a given list of phone numbers.
|
1848
|
+
* Searches for number format and operator information for a given list of phone numbers.
|
1854
1849
|
* @param options The options parameters.
|
1855
1850
|
*/
|
1856
1851
|
async operatorInformationSearch(options) {
|
@@ -2225,7 +2220,7 @@ const operatorInformationSearchOperationSpec = {
|
|
2225
2220
|
parameterPath: { phoneNumbers: ["options", "phoneNumbers"] },
|
2226
2221
|
mapper: Object.assign(Object.assign({}, OperatorInformationRequest), { required: true })
|
2227
2222
|
},
|
2228
|
-
queryParameters: [apiVersion$1],
|
2223
|
+
queryParameters: [apiVersion$1, options],
|
2229
2224
|
urlParameters: [endpoint$1],
|
2230
2225
|
headerParameters: [accept$1, contentType$1],
|
2231
2226
|
mediaType: "json",
|
@@ -2326,7 +2321,7 @@ const listPhoneNumbersNextOperationSpec = {
|
|
2326
2321
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
2327
2322
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
2328
2323
|
*/
|
2329
|
-
|
2324
|
+
let PhoneNumbersClient$1 = class PhoneNumbersClient extends coreClient__namespace.ServiceClient {
|
2330
2325
|
/**
|
2331
2326
|
* Initializes a new instance of the PhoneNumbersClient class.
|
2332
2327
|
* @param endpoint The communication resource, for example https://resourcename.communication.azure.com
|
@@ -2384,7 +2379,7 @@ class PhoneNumbersClient$1 extends coreClient__namespace.ServiceClient {
|
|
2384
2379
|
};
|
2385
2380
|
this.pipeline.addPolicy(apiVersionPolicy);
|
2386
2381
|
}
|
2387
|
-
}
|
2382
|
+
};
|
2388
2383
|
|
2389
2384
|
// Copyright (c) Microsoft Corporation.
|
2390
2385
|
// Licensed under the MIT license.
|
@@ -2414,12 +2409,15 @@ function createPhoneNumbersPagingPolicy(host) {
|
|
2414
2409
|
}
|
2415
2410
|
|
2416
2411
|
// Copyright (c) Microsoft Corporation.
|
2412
|
+
// Licensed under the MIT license.
|
2417
2413
|
/**
|
2418
2414
|
* The \@azure\/logger configuration for this package.
|
2419
2415
|
*/
|
2420
2416
|
const logger = logger$1.createClientLogger("communication-phone-numbers");
|
2421
2417
|
|
2422
2418
|
// Copyright (c) Microsoft Corporation.
|
2419
|
+
// Licensed under the MIT license.
|
2420
|
+
/// <reference lib="esnext.asynciterable" />
|
2423
2421
|
const isPhoneNumbersClientOptions = (options) => options && !communicationCommon.isKeyCredential(options) && !coreAuth.isTokenCredential(options);
|
2424
2422
|
/**
|
2425
2423
|
* Client class for interacting with Azure Communication Services Phone Number Administration.
|
@@ -2748,10 +2746,13 @@ class PhoneNumbersClient {
|
|
2748
2746
|
* @param phoneNumbers - The phone numbers to search.
|
2749
2747
|
* @param options - Additional request options.
|
2750
2748
|
*/
|
2751
|
-
searchOperatorInformation(phoneNumbers, options = {}) {
|
2749
|
+
searchOperatorInformation(phoneNumbers, options = { formatOnly: false }) {
|
2752
2750
|
return tracingClient.withSpan("PhoneNumbersClient-searchOperatorInformation", options, (updatedOptions) => {
|
2753
2751
|
const params = updatedOptions;
|
2754
2752
|
params.phoneNumbers = phoneNumbers;
|
2753
|
+
if (options.formatOnly) {
|
2754
|
+
params.options = "FormatOnly";
|
2755
|
+
}
|
2755
2756
|
return this.client.phoneNumbers.operatorInformationSearch(params);
|
2756
2757
|
});
|
2757
2758
|
}
|
@@ -2999,15 +3000,15 @@ const SipRoutingUpdateExceptionHeaders = {
|
|
2999
3000
|
|
3000
3001
|
var Mappers = /*#__PURE__*/Object.freeze({
|
3001
3002
|
__proto__: null,
|
3002
|
-
SipConfiguration: SipConfiguration,
|
3003
|
-
SipTrunk: SipTrunk,
|
3004
|
-
SipTrunkRoute: SipTrunkRoute,
|
3005
3003
|
CommunicationErrorResponse: CommunicationErrorResponse,
|
3006
|
-
|
3004
|
+
SipConfiguration: SipConfiguration,
|
3007
3005
|
SipConfigurationUpdate: SipConfigurationUpdate,
|
3008
|
-
|
3006
|
+
SipRoutingError: SipRoutingError,
|
3009
3007
|
SipRoutingGetExceptionHeaders: SipRoutingGetExceptionHeaders,
|
3010
|
-
SipRoutingUpdateExceptionHeaders: SipRoutingUpdateExceptionHeaders
|
3008
|
+
SipRoutingUpdateExceptionHeaders: SipRoutingUpdateExceptionHeaders,
|
3009
|
+
SipTrunk: SipTrunk,
|
3010
|
+
SipTrunkRoute: SipTrunkRoute,
|
3011
|
+
TrunkUpdate: TrunkUpdate
|
3011
3012
|
});
|
3012
3013
|
|
3013
3014
|
/*
|
@@ -3184,7 +3185,7 @@ class SipRoutingClientContext extends coreClient__namespace.ServiceClient {
|
|
3184
3185
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
3185
3186
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
3186
3187
|
*/
|
3187
|
-
|
3188
|
+
let SipRoutingClient$1 = class SipRoutingClient extends SipRoutingClientContext {
|
3188
3189
|
/**
|
3189
3190
|
* Initializes a new instance of the SipRoutingClient class.
|
3190
3191
|
* @param endpoint The communication resource, for example https://resourcename.communication.azure.com
|
@@ -3194,7 +3195,7 @@ class SipRoutingClient$1 extends SipRoutingClientContext {
|
|
3194
3195
|
super(endpoint, options);
|
3195
3196
|
this.sipRouting = new SipRoutingImpl(this);
|
3196
3197
|
}
|
3197
|
-
}
|
3198
|
+
};
|
3198
3199
|
|
3199
3200
|
// Copyright (c) Microsoft Corporation.
|
3200
3201
|
// Licensed under the MIT license.
|
@@ -3225,6 +3226,7 @@ function transformIntoRestModel(trunks) {
|
|
3225
3226
|
}
|
3226
3227
|
|
3227
3228
|
// Copyright (c) Microsoft Corporation.
|
3229
|
+
// Licensed under the MIT license.
|
3228
3230
|
/**
|
3229
3231
|
* Checks whether the type of a value is SipClientOptions or not.
|
3230
3232
|
*
|
@@ -3412,16 +3414,11 @@ class SipRoutingClient {
|
|
3412
3414
|
return tslib.__asyncGenerator(this, arguments, function* listRoutesPagingAll_1() {
|
3413
3415
|
var _a, e_1, _b, _c;
|
3414
3416
|
try {
|
3415
|
-
for (var _d = true, _e = tslib.__asyncValues(this.listRoutesPagingPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
|
3417
|
+
for (var _d = true, _e = tslib.__asyncValues(this.listRoutesPagingPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
|
3416
3418
|
_c = _f.value;
|
3417
3419
|
_d = false;
|
3418
|
-
|
3419
|
-
|
3420
|
-
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
3421
|
-
}
|
3422
|
-
finally {
|
3423
|
-
_d = true;
|
3424
|
-
}
|
3420
|
+
const page = _c;
|
3421
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
3425
3422
|
}
|
3426
3423
|
}
|
3427
3424
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
@@ -3437,16 +3434,11 @@ class SipRoutingClient {
|
|
3437
3434
|
return tslib.__asyncGenerator(this, arguments, function* listTrunksPagingAll_1() {
|
3438
3435
|
var _a, e_2, _b, _c;
|
3439
3436
|
try {
|
3440
|
-
for (var _d = true, _e = tslib.__asyncValues(this.listTrunksPagingPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
|
3437
|
+
for (var _d = true, _e = tslib.__asyncValues(this.listTrunksPagingPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
|
3441
3438
|
_c = _f.value;
|
3442
3439
|
_d = false;
|
3443
|
-
|
3444
|
-
|
3445
|
-
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
3446
|
-
}
|
3447
|
-
finally {
|
3448
|
-
_d = true;
|
3449
|
-
}
|
3440
|
+
const page = _c;
|
3441
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
3450
3442
|
}
|
3451
3443
|
}
|
3452
3444
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|