@azure/communication-phone-numbers 1.5.0-beta.1 → 1.5.0-beta.2
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 +20 -1
- package/dist/browser/generated/src/phoneNumbersClient.js +1 -1
- package/dist/browser/generated/src/phoneNumbersClient.js.map +1 -1
- package/dist/browser/generated/src/siprouting/index.d.ts +0 -1
- package/dist/browser/generated/src/siprouting/index.d.ts.map +1 -1
- package/dist/browser/generated/src/siprouting/index.js +0 -1
- package/dist/browser/generated/src/siprouting/index.js.map +1 -1
- package/dist/browser/generated/src/siprouting/models/index.d.ts +141 -2
- package/dist/browser/generated/src/siprouting/models/index.d.ts.map +1 -1
- package/dist/browser/generated/src/siprouting/models/index.js +6 -1
- package/dist/browser/generated/src/siprouting/models/index.js.map +1 -1
- package/dist/browser/generated/src/siprouting/models/mappers.d.ts +7 -0
- package/dist/browser/generated/src/siprouting/models/mappers.d.ts.map +1 -1
- package/dist/browser/generated/src/siprouting/models/mappers.js +284 -77
- package/dist/browser/generated/src/siprouting/models/mappers.js.map +1 -1
- package/dist/browser/generated/src/siprouting/models/parameters.d.ts +7 -0
- package/dist/browser/generated/src/siprouting/models/parameters.d.ts.map +1 -1
- package/dist/browser/generated/src/siprouting/models/parameters.js +62 -16
- package/dist/browser/generated/src/siprouting/models/parameters.js.map +1 -1
- package/dist/browser/generated/src/siprouting/operations/sipRouting.d.ts +9 -3
- package/dist/browser/generated/src/siprouting/operations/sipRouting.d.ts.map +1 -1
- package/dist/browser/generated/src/siprouting/operations/sipRouting.js +45 -11
- package/dist/browser/generated/src/siprouting/operations/sipRouting.js.map +1 -1
- package/dist/browser/generated/src/siprouting/operationsInterfaces/sipRouting.d.ts +7 -1
- package/dist/browser/generated/src/siprouting/operationsInterfaces/sipRouting.d.ts.map +1 -1
- package/dist/browser/generated/src/siprouting/operationsInterfaces/sipRouting.js.map +1 -1
- package/dist/browser/generated/src/siprouting/sipRoutingClient.d.ts +6 -2
- package/dist/browser/generated/src/siprouting/sipRoutingClient.d.ts.map +1 -1
- package/dist/browser/generated/src/siprouting/sipRoutingClient.js +51 -3
- package/dist/browser/generated/src/siprouting/sipRoutingClient.js.map +1 -1
- package/dist/browser/generated/src/siprouting/sipRoutingClientContext.js +1 -1
- package/dist/browser/generated/src/siprouting/sipRoutingClientContext.js.map +1 -1
- package/dist/browser/generated/src/tracing.js +1 -1
- package/dist/browser/generated/src/tracing.js.map +1 -1
- package/dist/browser/mappers.d.ts +17 -3
- package/dist/browser/mappers.d.ts.map +1 -1
- package/dist/browser/mappers.js +51 -2
- package/dist/browser/mappers.js.map +1 -1
- package/dist/browser/models.d.ts +60 -1
- package/dist/browser/models.d.ts.map +1 -1
- package/dist/browser/models.js.map +1 -1
- package/dist/browser/sipRoutingClient.d.ts +41 -1
- package/dist/browser/sipRoutingClient.d.ts.map +1 -1
- package/dist/browser/sipRoutingClient.js +158 -2
- package/dist/browser/sipRoutingClient.js.map +1 -1
- package/dist/browser/utils/constants.js +1 -1
- package/dist/browser/utils/constants.js.map +1 -1
- package/dist/commonjs/generated/src/phoneNumbersClient.js +1 -1
- package/dist/commonjs/generated/src/phoneNumbersClient.js.map +1 -1
- package/dist/commonjs/generated/src/siprouting/index.d.ts +0 -1
- package/dist/commonjs/generated/src/siprouting/index.d.ts.map +1 -1
- package/dist/commonjs/generated/src/siprouting/index.js +1 -3
- package/dist/commonjs/generated/src/siprouting/index.js.map +1 -1
- package/dist/commonjs/generated/src/siprouting/models/index.d.ts +141 -2
- package/dist/commonjs/generated/src/siprouting/models/index.d.ts.map +1 -1
- package/dist/commonjs/generated/src/siprouting/models/index.js +7 -0
- package/dist/commonjs/generated/src/siprouting/models/index.js.map +1 -1
- package/dist/commonjs/generated/src/siprouting/models/mappers.d.ts +7 -0
- package/dist/commonjs/generated/src/siprouting/models/mappers.d.ts.map +1 -1
- package/dist/commonjs/generated/src/siprouting/models/mappers.js +285 -78
- package/dist/commonjs/generated/src/siprouting/models/mappers.js.map +1 -1
- package/dist/commonjs/generated/src/siprouting/models/parameters.d.ts +7 -0
- package/dist/commonjs/generated/src/siprouting/models/parameters.d.ts.map +1 -1
- package/dist/commonjs/generated/src/siprouting/models/parameters.js +62 -16
- package/dist/commonjs/generated/src/siprouting/models/parameters.js.map +1 -1
- package/dist/commonjs/generated/src/siprouting/operations/sipRouting.d.ts +9 -3
- package/dist/commonjs/generated/src/siprouting/operations/sipRouting.d.ts.map +1 -1
- package/dist/commonjs/generated/src/siprouting/operations/sipRouting.js +45 -11
- package/dist/commonjs/generated/src/siprouting/operations/sipRouting.js.map +1 -1
- package/dist/commonjs/generated/src/siprouting/operationsInterfaces/sipRouting.d.ts +7 -1
- package/dist/commonjs/generated/src/siprouting/operationsInterfaces/sipRouting.d.ts.map +1 -1
- package/dist/commonjs/generated/src/siprouting/operationsInterfaces/sipRouting.js.map +1 -1
- package/dist/commonjs/generated/src/siprouting/sipRoutingClient.d.ts +6 -2
- package/dist/commonjs/generated/src/siprouting/sipRoutingClient.d.ts.map +1 -1
- package/dist/commonjs/generated/src/siprouting/sipRoutingClient.js +52 -3
- package/dist/commonjs/generated/src/siprouting/sipRoutingClient.js.map +1 -1
- package/dist/commonjs/generated/src/siprouting/sipRoutingClientContext.js +1 -1
- package/dist/commonjs/generated/src/siprouting/sipRoutingClientContext.js.map +1 -1
- package/dist/commonjs/generated/src/tracing.js +1 -1
- package/dist/commonjs/generated/src/tracing.js.map +1 -1
- package/dist/commonjs/mappers.d.ts +17 -3
- package/dist/commonjs/mappers.d.ts.map +1 -1
- package/dist/commonjs/mappers.js +53 -2
- package/dist/commonjs/mappers.js.map +1 -1
- package/dist/commonjs/models.d.ts +60 -1
- package/dist/commonjs/models.d.ts.map +1 -1
- package/dist/commonjs/models.js.map +1 -1
- package/dist/commonjs/sipRoutingClient.d.ts +41 -1
- package/dist/commonjs/sipRoutingClient.d.ts.map +1 -1
- package/dist/commonjs/sipRoutingClient.js +157 -1
- package/dist/commonjs/sipRoutingClient.js.map +1 -1
- package/dist/commonjs/utils/constants.js +1 -1
- package/dist/commonjs/utils/constants.js.map +1 -1
- package/dist/esm/generated/src/phoneNumbersClient.js +1 -1
- package/dist/esm/generated/src/phoneNumbersClient.js.map +1 -1
- package/dist/esm/generated/src/siprouting/index.d.ts +0 -1
- package/dist/esm/generated/src/siprouting/index.d.ts.map +1 -1
- package/dist/esm/generated/src/siprouting/index.js +0 -1
- package/dist/esm/generated/src/siprouting/index.js.map +1 -1
- package/dist/esm/generated/src/siprouting/models/index.d.ts +141 -2
- package/dist/esm/generated/src/siprouting/models/index.d.ts.map +1 -1
- package/dist/esm/generated/src/siprouting/models/index.js +6 -1
- package/dist/esm/generated/src/siprouting/models/index.js.map +1 -1
- package/dist/esm/generated/src/siprouting/models/mappers.d.ts +7 -0
- package/dist/esm/generated/src/siprouting/models/mappers.d.ts.map +1 -1
- package/dist/esm/generated/src/siprouting/models/mappers.js +284 -77
- package/dist/esm/generated/src/siprouting/models/mappers.js.map +1 -1
- package/dist/esm/generated/src/siprouting/models/parameters.d.ts +7 -0
- package/dist/esm/generated/src/siprouting/models/parameters.d.ts.map +1 -1
- package/dist/esm/generated/src/siprouting/models/parameters.js +62 -16
- package/dist/esm/generated/src/siprouting/models/parameters.js.map +1 -1
- package/dist/esm/generated/src/siprouting/operations/sipRouting.d.ts +9 -3
- package/dist/esm/generated/src/siprouting/operations/sipRouting.d.ts.map +1 -1
- package/dist/esm/generated/src/siprouting/operations/sipRouting.js +45 -11
- package/dist/esm/generated/src/siprouting/operations/sipRouting.js.map +1 -1
- package/dist/esm/generated/src/siprouting/operationsInterfaces/sipRouting.d.ts +7 -1
- package/dist/esm/generated/src/siprouting/operationsInterfaces/sipRouting.d.ts.map +1 -1
- package/dist/esm/generated/src/siprouting/operationsInterfaces/sipRouting.js.map +1 -1
- package/dist/esm/generated/src/siprouting/sipRoutingClient.d.ts +6 -2
- package/dist/esm/generated/src/siprouting/sipRoutingClient.d.ts.map +1 -1
- package/dist/esm/generated/src/siprouting/sipRoutingClient.js +51 -3
- package/dist/esm/generated/src/siprouting/sipRoutingClient.js.map +1 -1
- package/dist/esm/generated/src/siprouting/sipRoutingClientContext.js +1 -1
- package/dist/esm/generated/src/siprouting/sipRoutingClientContext.js.map +1 -1
- package/dist/esm/generated/src/tracing.js +1 -1
- package/dist/esm/generated/src/tracing.js.map +1 -1
- package/dist/esm/mappers.d.ts +17 -3
- package/dist/esm/mappers.d.ts.map +1 -1
- package/dist/esm/mappers.js +51 -2
- package/dist/esm/mappers.js.map +1 -1
- package/dist/esm/models.d.ts +60 -1
- package/dist/esm/models.d.ts.map +1 -1
- package/dist/esm/models.js.map +1 -1
- package/dist/esm/sipRoutingClient.d.ts +41 -1
- package/dist/esm/sipRoutingClient.d.ts.map +1 -1
- package/dist/esm/sipRoutingClient.js +158 -2
- package/dist/esm/sipRoutingClient.js.map +1 -1
- package/dist/esm/utils/constants.js +1 -1
- package/dist/esm/utils/constants.js.map +1 -1
- package/dist/react-native/generated/src/phoneNumbersClient.js +1 -1
- package/dist/react-native/generated/src/phoneNumbersClient.js.map +1 -1
- package/dist/react-native/generated/src/siprouting/index.d.ts +0 -1
- package/dist/react-native/generated/src/siprouting/index.d.ts.map +1 -1
- package/dist/react-native/generated/src/siprouting/index.js +0 -1
- package/dist/react-native/generated/src/siprouting/index.js.map +1 -1
- package/dist/react-native/generated/src/siprouting/models/index.d.ts +141 -2
- package/dist/react-native/generated/src/siprouting/models/index.d.ts.map +1 -1
- package/dist/react-native/generated/src/siprouting/models/index.js +6 -1
- package/dist/react-native/generated/src/siprouting/models/index.js.map +1 -1
- package/dist/react-native/generated/src/siprouting/models/mappers.d.ts +7 -0
- package/dist/react-native/generated/src/siprouting/models/mappers.d.ts.map +1 -1
- package/dist/react-native/generated/src/siprouting/models/mappers.js +284 -77
- package/dist/react-native/generated/src/siprouting/models/mappers.js.map +1 -1
- package/dist/react-native/generated/src/siprouting/models/parameters.d.ts +7 -0
- package/dist/react-native/generated/src/siprouting/models/parameters.d.ts.map +1 -1
- package/dist/react-native/generated/src/siprouting/models/parameters.js +62 -16
- package/dist/react-native/generated/src/siprouting/models/parameters.js.map +1 -1
- package/dist/react-native/generated/src/siprouting/operations/sipRouting.d.ts +9 -3
- package/dist/react-native/generated/src/siprouting/operations/sipRouting.d.ts.map +1 -1
- package/dist/react-native/generated/src/siprouting/operations/sipRouting.js +45 -11
- package/dist/react-native/generated/src/siprouting/operations/sipRouting.js.map +1 -1
- package/dist/react-native/generated/src/siprouting/operationsInterfaces/sipRouting.d.ts +7 -1
- package/dist/react-native/generated/src/siprouting/operationsInterfaces/sipRouting.d.ts.map +1 -1
- package/dist/react-native/generated/src/siprouting/operationsInterfaces/sipRouting.js.map +1 -1
- package/dist/react-native/generated/src/siprouting/sipRoutingClient.d.ts +6 -2
- package/dist/react-native/generated/src/siprouting/sipRoutingClient.d.ts.map +1 -1
- package/dist/react-native/generated/src/siprouting/sipRoutingClient.js +51 -3
- package/dist/react-native/generated/src/siprouting/sipRoutingClient.js.map +1 -1
- package/dist/react-native/generated/src/siprouting/sipRoutingClientContext.js +1 -1
- package/dist/react-native/generated/src/siprouting/sipRoutingClientContext.js.map +1 -1
- package/dist/react-native/generated/src/tracing.js +1 -1
- package/dist/react-native/generated/src/tracing.js.map +1 -1
- package/dist/react-native/mappers.d.ts +17 -3
- package/dist/react-native/mappers.d.ts.map +1 -1
- package/dist/react-native/mappers.js +51 -2
- package/dist/react-native/mappers.js.map +1 -1
- package/dist/react-native/models.d.ts +60 -1
- package/dist/react-native/models.d.ts.map +1 -1
- package/dist/react-native/models.js.map +1 -1
- package/dist/react-native/sipRoutingClient.d.ts +41 -1
- package/dist/react-native/sipRoutingClient.d.ts.map +1 -1
- package/dist/react-native/sipRoutingClient.js +158 -2
- package/dist/react-native/sipRoutingClient.js.map +1 -1
- package/dist/react-native/utils/constants.js +1 -1
- package/dist/react-native/utils/constants.js.map +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mappers.js","sourceRoot":"","sources":["../../src/mappers.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;
|
|
1
|
+
{"version":3,"file":"mappers.js","sourceRoot":"","sources":["../../src/mappers.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAclC,wDA0BC;AAMD,sEAgBC;AAMD,wDAgBC;AAMD,sEAYC;AA5FD;;;GAGG;AACH,SAAgB,sBAAsB,CACpC,MAA4D;IAE5D,MAAM,MAAM,GAAe,EAAE,CAAC;IAE9B,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,IAAY,EAAE,EAAE;YAC3C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC;YAC3C,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;YACrC,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;YACnC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC;YACnD,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC;YACjD,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC;YACvD,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,IAAI;gBACV,gBAAgB,EAAE,IAAI;gBACtB,OAAO,EAAE,OAAO;gBAChB,MAAM,EAAE,MAAM;gBACd,cAAc,EAAE,cAAc;gBAC9B,aAAa,EAAE,aAAa;gBAC5B,gBAAgB,EAAE,gBAAgB;aACvB,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,SAAgB,6BAA6B,CAC3C,OAA8D;IAE9D,MAAM,MAAM,GAAgB,EAAE,CAAC;IAE/B,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,IAAY,EAAE,EAAE;YAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;YACtC,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,IAAI;gBACV,OAAO,EAAE,OAAO;aACJ,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,SAAgB,sBAAsB,CAAC,MAAkB;IAGvD,MAAM,MAAM,GAAgD,EAAE,CAAC;IAE/D,MAAM,CAAC,OAAO,CAAC,CAAC,KAAe,EAAE,EAAE;QACjC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG;YACnB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;YACxC,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,cAAc,EAAE,KAAK,CAAC,cAAc;YACpC,aAAa,EAAE,KAAK,CAAC,aAAa;YAClC,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;SACtB,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,SAAgB,6BAA6B,CAAC,OAAoB;IAGhE,MAAM,MAAM,GAAiD,EAAE,CAAC;IAEhE,OAAO,CAAC,OAAO,CAAC,CAAC,MAAiB,EAAE,EAAE;QACpC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG;YACpB,OAAO,EAAE,MAAM,CAAC,OAAO;SACJ,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { SipTrunk, SipDomain } from \"./models.js\";\nimport type {\n SipTrunk as RestSipTrunk,\n SipDomain as RestSipDomain,\n TrunkUpdate as RestTrunkUpdate,\n DomainPatch as RestDomainUpdate,\n} from \"./generated/src/siprouting/models/index.js\";\n\n/**\n * @internal\n * Transforming SIP trunks REST model to SDK model\n */\nexport function transformFromRestModel(\n trunks: { [propertyName: string]: RestSipTrunk } | undefined,\n): SipTrunk[] {\n const result: SipTrunk[] = [];\n\n if (trunks) {\n Object.keys(trunks).forEach((fqdn: string) => {\n const port = trunks[fqdn].sipSignalingPort;\n const enabled = trunks[fqdn].enabled;\n const health = trunks[fqdn].health;\n const directTransfer = trunks[fqdn].directTransfer;\n const privacyHeader = trunks[fqdn].privacyHeader;\n const ipAddressVersion = trunks[fqdn].ipAddressVersion;\n result.push({\n fqdn: fqdn,\n sipSignalingPort: port,\n enabled: enabled,\n health: health,\n directTransfer: directTransfer,\n privacyHeader: privacyHeader,\n ipAddressVersion: ipAddressVersion,\n } as SipTrunk);\n });\n }\n\n return result;\n}\n\n/**\n * @internal\n * Transforming SIP domains REST model to SDK model\n */\nexport function transformDomainsFromRestModel(\n domains: { [propertyName: string]: RestSipDomain } | undefined,\n): SipDomain[] {\n const result: SipDomain[] = [];\n\n if (domains) {\n Object.keys(domains).forEach((fqdn: string) => {\n const enabled = domains[fqdn].enabled;\n result.push({\n fqdn: fqdn,\n enabled: enabled,\n } as SipDomain);\n });\n }\n\n return result;\n}\n\n/**\n * @internal\n * Transforming SIP trunks SDK model to REST model\n */\nexport function transformIntoRestModel(trunks: SipTrunk[]): {\n [propertyName: string]: RestTrunkUpdate;\n} {\n const result: { [propertyName: string]: RestTrunkUpdate } = {};\n\n trunks.forEach((trunk: SipTrunk) => {\n result[trunk.fqdn] = {\n sipSignalingPort: trunk.sipSignalingPort,\n enabled: trunk.enabled,\n directTransfer: trunk.directTransfer,\n privacyHeader: trunk.privacyHeader,\n ipAddressVersion: trunk.ipAddressVersion,\n } as RestTrunkUpdate;\n });\n\n return result;\n}\n\n/**\n * @internal\n * Transforming SIP domains SDK model to REST model\n */\nexport function transformDomainsIntoRestModel(domains: SipDomain[]): {\n [propertyName: string]: RestDomainUpdate;\n} {\n const result: { [propertyName: string]: RestDomainUpdate } = {};\n\n domains.forEach((domain: SipDomain) => {\n result[domain.fqdn] = {\n enabled: domain.enabled,\n } as RestDomainUpdate;\n });\n\n return result;\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { OperationOptions } from "@azure/core-client";
|
|
2
2
|
import type * as coreClient from "@azure/core-client";
|
|
3
3
|
import type { AvailablePhoneNumber, PhoneNumberAssignmentType, PhoneNumberCapabilitiesRequest, PhoneNumberSearchRequest, PhoneNumbersListAreaCodesOptionalParams, PhoneNumbersPurchaseReservationHeaders, PhoneNumberType } from "./generated/src/models/index.js";
|
|
4
|
+
import type { TlsHealth, PingHealth, IpAddressVersion, PrivacyHeader, HealthStatusReason } from "./generated/src/siprouting/models/index.js";
|
|
4
5
|
/**
|
|
5
6
|
* The result of the phone numbers purchase operation.
|
|
6
7
|
*/
|
|
@@ -77,11 +78,21 @@ export interface SearchOperatorInformationOptions extends OperationOptions {
|
|
|
77
78
|
*/
|
|
78
79
|
export interface ListSipRoutesOptions extends OperationOptions {
|
|
79
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Additional options that can be passed to list SIP domains.
|
|
83
|
+
*/
|
|
84
|
+
export interface ListSipDomainsOptions extends OperationOptions {
|
|
85
|
+
}
|
|
80
86
|
/**
|
|
81
87
|
* Additional options that can be passed to list SIP trunks.
|
|
82
88
|
*/
|
|
83
89
|
export interface ListSipTrunksOptions extends OperationOptions {
|
|
84
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Additional options that can be passed to get SIP domains.
|
|
93
|
+
*/
|
|
94
|
+
export interface GetSipDomainsOptions extends OperationOptions {
|
|
95
|
+
}
|
|
85
96
|
/**
|
|
86
97
|
* Additional options that can be passed to the available offerings request.
|
|
87
98
|
*/
|
|
@@ -142,7 +153,7 @@ export interface BrowseAvailableNumbersOptions extends coreClient.OperationOptio
|
|
|
142
153
|
*/
|
|
143
154
|
export type PurchaseReservationResult = PhoneNumbersPurchaseReservationHeaders;
|
|
144
155
|
export { AvailablePhoneNumber, CommunicationError, PhoneNumberAdministrativeDivision, PhoneNumberAssignmentType, PhoneNumberAreaCode, PhoneNumberAvailabilityStatus, PhoneNumbersBrowseResult, PhoneNumberCapabilities, PhoneNumberCapabilitiesRequest, PhoneNumberCapabilityType, PhoneNumberCost, PhoneNumberCountry, PhoneNumbersListAreaCodesOptionalParams, PhoneNumberLocality, PhoneNumberOffering, PhoneNumberSearchRequest, PhoneNumberSearchResult, PhoneNumberSearchResultError, PhoneNumbersPurchaseReservationHeaders, PhoneNumbersPurchaseReservationResponse, PhoneNumbersReservation, PhoneNumberType, PurchasedPhoneNumber, OperatorDetails, OperatorInformation, OperatorInformationOptions, OperatorInformationResult, OperatorNumberType, ReservationStatus, } from "./generated/src/models/index.js";
|
|
145
|
-
export { SipRoutingError, SipTrunkRoute } from "./generated/src/siprouting/models/index.js";
|
|
156
|
+
export { SipRoutingError, SipTrunkRoute, TlsHealth, PingHealth, TlsStatus, PingStatus, HealthStatusReason, PrivacyHeader, IpAddressVersion, } from "./generated/src/siprouting/models/index.js";
|
|
146
157
|
/**
|
|
147
158
|
* Represents a SIP trunk for routing calls. See RFC 4904.
|
|
148
159
|
*/
|
|
@@ -155,5 +166,53 @@ export interface SipTrunk {
|
|
|
155
166
|
* Gets or sets SIP signaling port of the trunk.
|
|
156
167
|
*/
|
|
157
168
|
sipSignalingPort: number;
|
|
169
|
+
/**
|
|
170
|
+
* Enabled flag
|
|
171
|
+
*/
|
|
172
|
+
enabled?: boolean;
|
|
173
|
+
/**
|
|
174
|
+
* Represents health state of a SIP trunk for routing calls.
|
|
175
|
+
*/
|
|
176
|
+
health?: TrunkHealth;
|
|
177
|
+
/**
|
|
178
|
+
* When enabled, removes Azure Communication Services from the signaling path on call transfer and sets the SIP Refer-To header to the trunk's FQDN. By default false.
|
|
179
|
+
*/
|
|
180
|
+
directTransfer?: boolean;
|
|
181
|
+
/**
|
|
182
|
+
* SIP Privacy header. Default value is id.
|
|
183
|
+
*/
|
|
184
|
+
privacyHeader?: PrivacyHeader;
|
|
185
|
+
/**
|
|
186
|
+
* IP address version used by the trunk. The default value is ipv4.
|
|
187
|
+
*/
|
|
188
|
+
ipAddressVersion?: IpAddressVersion;
|
|
189
|
+
}
|
|
190
|
+
/** Represents health state of a SIP trunk for routing calls. */
|
|
191
|
+
export interface TrunkHealth {
|
|
192
|
+
/** The status of the TLS connections of the Trunk. */
|
|
193
|
+
tls: TlsHealth;
|
|
194
|
+
/** The status of SIP OPTIONS message sent by Trunk. */
|
|
195
|
+
ping: PingHealth;
|
|
196
|
+
/** The overall health status of Trunk. */
|
|
197
|
+
overall: OverallHealth;
|
|
158
198
|
}
|
|
199
|
+
/**
|
|
200
|
+
* Represents a DNS domain for SIP trunk.
|
|
201
|
+
*/
|
|
202
|
+
export interface SipDomain {
|
|
203
|
+
/**
|
|
204
|
+
* Gets or sets FQDN of the domain.
|
|
205
|
+
*/
|
|
206
|
+
fqdn: string;
|
|
207
|
+
/**
|
|
208
|
+
* Enabled flag
|
|
209
|
+
*/
|
|
210
|
+
enabled: boolean;
|
|
211
|
+
}
|
|
212
|
+
export type OverallHealth = {
|
|
213
|
+
status: "unknown" | "active";
|
|
214
|
+
} | {
|
|
215
|
+
status: "inactive";
|
|
216
|
+
reason: HealthStatusReason;
|
|
217
|
+
};
|
|
159
218
|
//# sourceMappingURL=models.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EACV,oBAAoB,EACpB,yBAAyB,EACzB,8BAA8B,EAC9B,wBAAwB,EACxB,uCAAu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AC;IACf,uDAAuD;IACvD,IAAI,EAAE,UAAU,CAAC;IACjB,0CAA0C;IAC1C,OAAO,EAAE,aAAa,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAGD,MAAM,MAAM,aAAa,GACrB;IAAE,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAA;CAAE,GAChC;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,kBAAkB,CAAA;CAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationOptions } from \"@azure/core-client\";\nimport type * as coreClient from \"@azure/core-client\";\nimport type {\n AvailablePhoneNumber,\n PhoneNumberAssignmentType,\n PhoneNumberCapabilitiesRequest,\n PhoneNumberSearchRequest,\n PhoneNumbersListAreaCodesOptionalParams,\n PhoneNumbersPurchaseReservationHeaders,\n PhoneNumberType,\n} from \"./generated/src/models/index.js\";\n\n/**\n * The result of the phone numbers purchase operation.\n */\nexport interface PurchasePhoneNumbersResult {}\n\n/**\n * The result of the phone number release operation.\n */\nexport interface ReleasePhoneNumberResult {}\n\n/**\n * Additional options for the get phone number request.\n */\nexport type GetPurchasedPhoneNumberOptions = OperationOptions;\n\n/**\n * Additional options that can be passed to the list phone numbers request.\n */\nexport interface ListPurchasedPhoneNumbersOptions extends OperationOptions {}\n\n/**\n * Represents a phone number search request to find phone numbers.\n * Found phone numbers are temporarily held for a following purchase.\n */\nexport interface SearchAvailablePhoneNumbersRequest extends PhoneNumberSearchRequest {\n /**\n * The ISO 3166-2 country code, e.g. US, representing the location of the search.\n */\n countryCode: string;\n}\n\n/**\n * Represents mandatory fields for a phone number browse request.\n */\nexport interface BrowseAvailableNumbersRequest {\n /** Represents the number type of the offering. */\n phoneNumberType: PhoneNumberType;\n /** The ISO 3166-2 country code, e.g. US, representing the location of the search. */\n countryCode: string;\n}\n\n/**\n * Additional options that can be passed to the available countries request.\n */\nexport interface ListAvailableCountriesOptions extends OperationOptions {}\n\n/**\n * Additional options that can be passed to the Toll-Free area codes request.\n */\nexport interface ListTollFreeAreaCodesOptions\n extends Omit<\n PhoneNumbersListAreaCodesOptionalParams,\n \"assignmentType\" | \"locality\" | \"administrativeDivision\"\n > {}\n\n/**\n * Additional options that can be passed to the Geographic area codes request.\n */\nexport interface ListGeographicAreaCodesOptions extends PhoneNumbersListAreaCodesOptionalParams {}\n\n/**\n * Additional options that can be passed to the Mobile area codes request.\n */\nexport interface ListMobileAreaCodesOptions\n extends Omit<PhoneNumbersListAreaCodesOptionalParams, \"locality\" | \"administrativeDivision\"> {}\n\n/**\n * Additional options that can be passed to the available localities request.\n */\nexport interface ListLocalitiesOptions extends OperationOptions {\n administrativeDivision?: string;\n phoneNumberType?: PhoneNumberType;\n}\n\n/**\n * Additional options for the search operator information request.\n */\nexport interface SearchOperatorInformationOptions extends OperationOptions {\n includeAdditionalOperatorDetails?: boolean;\n}\n\n/**\n * Additional options that can be passed to list SIP routes.\n */\nexport interface ListSipRoutesOptions extends OperationOptions {}\n\n/**\n * Additional options that can be passed to list SIP trunks.\n */\nexport interface ListSipTrunksOptions extends OperationOptions {}\n\n/**\n * Additional options that can be passed to the available offerings request.\n */\nexport interface ListOfferingsOptions extends OperationOptions {\n phoneNumberType?: PhoneNumberType;\n assignmentType?: PhoneNumberAssignmentType;\n}\n\n/**\n * Required fields for create or update a phone numbers reservation.\n */\nexport interface CreateOrUpdateReservationRequest extends OperationOptions {\n /**\n * The id of the reservation.\n */\n reservationId: string;\n}\n\n/**\n * Additional options for updating a phone numbers reservation.\n */\nexport interface CreateOrUpdateReservationOptions extends OperationOptions {\n /**\n * The phone numbers to be added or updated in the reservation.\n */\n add?: AvailablePhoneNumber[];\n\n /**\n * The phone number ids to be removed from the reservation.\n */\n remove?: string[];\n}\n\n/**\n * Additional options for deleting a phone numbers reservation.\n */\nexport interface DeleteReservationOptions extends OperationOptions {}\n\n/**\n * Additional options for getting a phone numbers reservation.\n */\nexport interface GetReservationOptions extends OperationOptions {}\n\n/**\n * Additional options for listing all phone numbers reservations.\n */\nexport interface ListReservationOptions extends OperationOptions {}\n\n/**\n * Additional options for browse available phone numbers request.\n */\nexport interface BrowseAvailableNumbersOptions extends coreClient.OperationOptions {\n /** The minimum desired capabilities for the browse operation request. */\n capabilities?: PhoneNumberCapabilitiesRequest;\n /** Represents the assignment type of the offering. Also known as the use case. */\n assignmentType?: PhoneNumberAssignmentType;\n /** The phone number prefix to match. If specified, the search will be limited to phone numbers that start with the any of the given prefixes. */\n phoneNumberPrefixes?: string[];\n}\n\n/**\n * The result of the purchase reservation operation.\n */\nexport type PurchaseReservationResult = PhoneNumbersPurchaseReservationHeaders;\n\nexport {\n AvailablePhoneNumber,\n CommunicationError,\n PhoneNumberAdministrativeDivision,\n PhoneNumberAssignmentType,\n PhoneNumberAreaCode,\n PhoneNumberAvailabilityStatus,\n PhoneNumbersBrowseResult,\n PhoneNumberCapabilities,\n PhoneNumberCapabilitiesRequest,\n PhoneNumberCapabilityType,\n PhoneNumberCost,\n PhoneNumberCountry,\n PhoneNumbersListAreaCodesOptionalParams,\n PhoneNumberLocality,\n PhoneNumberOffering,\n PhoneNumberSearchRequest,\n PhoneNumberSearchResult,\n PhoneNumberSearchResultError,\n PhoneNumbersPurchaseReservationHeaders,\n PhoneNumbersPurchaseReservationResponse,\n PhoneNumbersReservation,\n PhoneNumberType,\n PurchasedPhoneNumber,\n OperatorDetails,\n OperatorInformation,\n OperatorInformationOptions,\n OperatorInformationResult,\n OperatorNumberType,\n ReservationStatus,\n} from \"./generated/src/models/index.js\";\n\nexport {
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationOptions } from \"@azure/core-client\";\nimport type * as coreClient from \"@azure/core-client\";\nimport type {\n AvailablePhoneNumber,\n PhoneNumberAssignmentType,\n PhoneNumberCapabilitiesRequest,\n PhoneNumberSearchRequest,\n PhoneNumbersListAreaCodesOptionalParams,\n PhoneNumbersPurchaseReservationHeaders,\n PhoneNumberType,\n} from \"./generated/src/models/index.js\";\nimport type {\n TlsHealth,\n PingHealth,\n IpAddressVersion,\n PrivacyHeader,\n HealthStatusReason,\n} from \"./generated/src/siprouting/models/index.js\";\n\n/**\n * The result of the phone numbers purchase operation.\n */\nexport interface PurchasePhoneNumbersResult {}\n\n/**\n * The result of the phone number release operation.\n */\nexport interface ReleasePhoneNumberResult {}\n\n/**\n * Additional options for the get phone number request.\n */\nexport type GetPurchasedPhoneNumberOptions = OperationOptions;\n\n/**\n * Additional options that can be passed to the list phone numbers request.\n */\nexport interface ListPurchasedPhoneNumbersOptions extends OperationOptions {}\n\n/**\n * Represents a phone number search request to find phone numbers.\n * Found phone numbers are temporarily held for a following purchase.\n */\nexport interface SearchAvailablePhoneNumbersRequest extends PhoneNumberSearchRequest {\n /**\n * The ISO 3166-2 country code, e.g. US, representing the location of the search.\n */\n countryCode: string;\n}\n\n/**\n * Represents mandatory fields for a phone number browse request.\n */\nexport interface BrowseAvailableNumbersRequest {\n /** Represents the number type of the offering. */\n phoneNumberType: PhoneNumberType;\n /** The ISO 3166-2 country code, e.g. US, representing the location of the search. */\n countryCode: string;\n}\n\n/**\n * Additional options that can be passed to the available countries request.\n */\nexport interface ListAvailableCountriesOptions extends OperationOptions {}\n\n/**\n * Additional options that can be passed to the Toll-Free area codes request.\n */\nexport interface ListTollFreeAreaCodesOptions\n extends Omit<\n PhoneNumbersListAreaCodesOptionalParams,\n \"assignmentType\" | \"locality\" | \"administrativeDivision\"\n > {}\n\n/**\n * Additional options that can be passed to the Geographic area codes request.\n */\nexport interface ListGeographicAreaCodesOptions extends PhoneNumbersListAreaCodesOptionalParams {}\n\n/**\n * Additional options that can be passed to the Mobile area codes request.\n */\nexport interface ListMobileAreaCodesOptions\n extends Omit<PhoneNumbersListAreaCodesOptionalParams, \"locality\" | \"administrativeDivision\"> {}\n\n/**\n * Additional options that can be passed to the available localities request.\n */\nexport interface ListLocalitiesOptions extends OperationOptions {\n administrativeDivision?: string;\n phoneNumberType?: PhoneNumberType;\n}\n\n/**\n * Additional options for the search operator information request.\n */\nexport interface SearchOperatorInformationOptions extends OperationOptions {\n includeAdditionalOperatorDetails?: boolean;\n}\n\n/**\n * Additional options that can be passed to list SIP routes.\n */\nexport interface ListSipRoutesOptions extends OperationOptions {}\n\n/**\n * Additional options that can be passed to list SIP domains.\n */\nexport interface ListSipDomainsOptions extends OperationOptions {}\n\n/**\n * Additional options that can be passed to list SIP trunks.\n */\nexport interface ListSipTrunksOptions extends OperationOptions {}\n\n/**\n * Additional options that can be passed to get SIP domains.\n */\nexport interface GetSipDomainsOptions extends OperationOptions {}\n\n/**\n * Additional options that can be passed to the available offerings request.\n */\nexport interface ListOfferingsOptions extends OperationOptions {\n phoneNumberType?: PhoneNumberType;\n assignmentType?: PhoneNumberAssignmentType;\n}\n\n/**\n * Required fields for create or update a phone numbers reservation.\n */\nexport interface CreateOrUpdateReservationRequest extends OperationOptions {\n /**\n * The id of the reservation.\n */\n reservationId: string;\n}\n\n/**\n * Additional options for updating a phone numbers reservation.\n */\nexport interface CreateOrUpdateReservationOptions extends OperationOptions {\n /**\n * The phone numbers to be added or updated in the reservation.\n */\n add?: AvailablePhoneNumber[];\n\n /**\n * The phone number ids to be removed from the reservation.\n */\n remove?: string[];\n}\n\n/**\n * Additional options for deleting a phone numbers reservation.\n */\nexport interface DeleteReservationOptions extends OperationOptions {}\n\n/**\n * Additional options for getting a phone numbers reservation.\n */\nexport interface GetReservationOptions extends OperationOptions {}\n\n/**\n * Additional options for listing all phone numbers reservations.\n */\nexport interface ListReservationOptions extends OperationOptions {}\n\n/**\n * Additional options for browse available phone numbers request.\n */\nexport interface BrowseAvailableNumbersOptions extends coreClient.OperationOptions {\n /** The minimum desired capabilities for the browse operation request. */\n capabilities?: PhoneNumberCapabilitiesRequest;\n /** Represents the assignment type of the offering. Also known as the use case. */\n assignmentType?: PhoneNumberAssignmentType;\n /** The phone number prefix to match. If specified, the search will be limited to phone numbers that start with the any of the given prefixes. */\n phoneNumberPrefixes?: string[];\n}\n\n/**\n * The result of the purchase reservation operation.\n */\nexport type PurchaseReservationResult = PhoneNumbersPurchaseReservationHeaders;\n\nexport {\n AvailablePhoneNumber,\n CommunicationError,\n PhoneNumberAdministrativeDivision,\n PhoneNumberAssignmentType,\n PhoneNumberAreaCode,\n PhoneNumberAvailabilityStatus,\n PhoneNumbersBrowseResult,\n PhoneNumberCapabilities,\n PhoneNumberCapabilitiesRequest,\n PhoneNumberCapabilityType,\n PhoneNumberCost,\n PhoneNumberCountry,\n PhoneNumbersListAreaCodesOptionalParams,\n PhoneNumberLocality,\n PhoneNumberOffering,\n PhoneNumberSearchRequest,\n PhoneNumberSearchResult,\n PhoneNumberSearchResultError,\n PhoneNumbersPurchaseReservationHeaders,\n PhoneNumbersPurchaseReservationResponse,\n PhoneNumbersReservation,\n PhoneNumberType,\n PurchasedPhoneNumber,\n OperatorDetails,\n OperatorInformation,\n OperatorInformationOptions,\n OperatorInformationResult,\n OperatorNumberType,\n ReservationStatus,\n} from \"./generated/src/models/index.js\";\n\nexport {\n SipRoutingError,\n SipTrunkRoute,\n TlsHealth,\n PingHealth,\n TlsStatus,\n PingStatus,\n HealthStatusReason,\n PrivacyHeader,\n IpAddressVersion,\n} from \"./generated/src/siprouting/models/index.js\";\n\n/**\n * Represents a SIP trunk for routing calls. See RFC 4904.\n */\nexport interface SipTrunk {\n /**\n * Gets or sets FQDN of the trunk.\n */\n fqdn: string;\n /**\n * Gets or sets SIP signaling port of the trunk.\n */\n sipSignalingPort: number;\n /**\n * Enabled flag\n */\n enabled?: boolean;\n /**\n * Represents health state of a SIP trunk for routing calls.\n */\n health?: TrunkHealth;\n /**\n * When enabled, removes Azure Communication Services from the signaling path on call transfer and sets the SIP Refer-To header to the trunk's FQDN. By default false.\n */\n directTransfer?: boolean;\n /**\n * SIP Privacy header. Default value is id.\n */\n privacyHeader?: PrivacyHeader;\n /**\n * IP address version used by the trunk. The default value is ipv4.\n */\n ipAddressVersion?: IpAddressVersion;\n}\n\n/** Represents health state of a SIP trunk for routing calls. */\nexport interface TrunkHealth {\n /** The status of the TLS connections of the Trunk. */\n tls: TlsHealth;\n /** The status of SIP OPTIONS message sent by Trunk. */\n ping: PingHealth;\n /** The overall health status of Trunk. */\n overall: OverallHealth;\n}\n\n/**\n * Represents a DNS domain for SIP trunk.\n */\nexport interface SipDomain {\n /**\n * Gets or sets FQDN of the domain.\n */\n fqdn: string;\n /**\n * Enabled flag\n */\n enabled: boolean;\n}\n\n// This assumes that _only_ inactive status has a reason and that _every_ inactive status has a reason\nexport type OverallHealth =\n | { status: \"unknown\" | \"active\" }\n | { status: \"inactive\"; reason: HealthStatusReason };\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { KeyCredential, TokenCredential } from "@azure/core-auth";
|
|
2
|
-
import type { ListSipRoutesOptions, ListSipTrunksOptions, SipTrunk, SipTrunkRoute } from "./models.js";
|
|
2
|
+
import type { GetSipDomainsOptions, ListSipDomainsOptions, ListSipRoutesOptions, ListSipTrunksOptions, SipTrunk, SipTrunkRoute, SipDomain } from "./models.js";
|
|
3
3
|
import type { CommonClientOptions, OperationOptions } from "@azure/core-client";
|
|
4
4
|
import type { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
5
5
|
export * from "./models.js";
|
|
@@ -43,12 +43,23 @@ export declare class SipRoutingClient {
|
|
|
43
43
|
* @param options - The options parameters.
|
|
44
44
|
*/
|
|
45
45
|
listTrunks(options?: ListSipTrunksOptions): PagedAsyncIterableIterator<SipTrunk>;
|
|
46
|
+
/**
|
|
47
|
+
* Lists the SIP domains.
|
|
48
|
+
* @param options - The options parameters.
|
|
49
|
+
*/
|
|
50
|
+
listDomains(options?: ListSipDomainsOptions): PagedAsyncIterableIterator<SipDomain>;
|
|
46
51
|
/**
|
|
47
52
|
* Gets the SIP trunk.
|
|
48
53
|
* @param fqdn - The trunk's FQDN.
|
|
49
54
|
* @param options - The options parameters.
|
|
50
55
|
*/
|
|
51
56
|
getTrunk(fqdn: string, options?: OperationOptions): Promise<SipTrunk>;
|
|
57
|
+
/**
|
|
58
|
+
* Gets the SIP domain.
|
|
59
|
+
* @param fqdn - The domain's FQDN.
|
|
60
|
+
* @param options - The options parameters.
|
|
61
|
+
*/
|
|
62
|
+
getDomain(fqdn: string, options?: GetSipDomainsOptions): Promise<SipDomain>;
|
|
52
63
|
/**
|
|
53
64
|
* Lists the SIP trunk routes.
|
|
54
65
|
* @param options - The options parameters.
|
|
@@ -66,6 +77,18 @@ export declare class SipRoutingClient {
|
|
|
66
77
|
* @param options - The options parameters.
|
|
67
78
|
*/
|
|
68
79
|
setTrunk(trunk: SipTrunk, options?: OperationOptions): Promise<SipTrunk>;
|
|
80
|
+
/**
|
|
81
|
+
* Sets the SIP domains.
|
|
82
|
+
* @param domains - The SIP domains to be set.
|
|
83
|
+
* @param options - The options parameters.
|
|
84
|
+
*/
|
|
85
|
+
setDomains(domains: SipDomain[], options?: OperationOptions): Promise<SipDomain[]>;
|
|
86
|
+
/**
|
|
87
|
+
* Sets the SIP domain.
|
|
88
|
+
* @param domain - The SIP domain to be set.
|
|
89
|
+
* @param options - The options parameters.
|
|
90
|
+
*/
|
|
91
|
+
setDomain(domain: SipDomain, options?: OperationOptions): Promise<SipDomain>;
|
|
69
92
|
/**
|
|
70
93
|
* Sets the SIP trunk routes.
|
|
71
94
|
* @param routes - The SIP trunk routes to be set.
|
|
@@ -78,11 +101,28 @@ export declare class SipRoutingClient {
|
|
|
78
101
|
* @param options - The options parameters.
|
|
79
102
|
*/
|
|
80
103
|
deleteTrunk(fqdn: string, options?: OperationOptions): Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* Deletes the SIP domain.
|
|
106
|
+
* @param fqdn - The domain's FQDN.
|
|
107
|
+
* @param options - The options parameters.
|
|
108
|
+
*/
|
|
109
|
+
deleteDomain(fqdn: string, options?: OperationOptions): Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* Test routes with number.
|
|
112
|
+
* @param targetPhoneNumber - target phone number to test routes.
|
|
113
|
+
* @param routes - sip trunk routes.
|
|
114
|
+
* @param options - The options parameters for routes.
|
|
115
|
+
*/
|
|
116
|
+
getRoutesForNumber(targetPhoneNumber: string, routes: SipTrunkRoute[], options?: OperationOptions): Promise<SipTrunkRoute[]>;
|
|
117
|
+
private getRoutesForNumberInternal;
|
|
81
118
|
private getRoutesInternal;
|
|
82
119
|
private getTrunksInternal;
|
|
120
|
+
private getDomainsInternal;
|
|
83
121
|
private listRoutesPagingAll;
|
|
84
122
|
private listTrunksPagingAll;
|
|
85
123
|
private listTrunksPagingPage;
|
|
124
|
+
private listDomainsPagingAll;
|
|
125
|
+
private listDomainsPagingPage;
|
|
86
126
|
private listRoutesPagingPage;
|
|
87
127
|
}
|
|
88
128
|
//# sourceMappingURL=sipRoutingClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sipRoutingClient.d.ts","sourceRoot":"","sources":["../../src/sipRoutingClient.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AASvE,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACpB,QAAQ,EACR,aAAa,
|
|
1
|
+
{"version":3,"file":"sipRoutingClient.d.ts","sourceRoot":"","sources":["../../src/sipRoutingClient.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;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domains.
|
|
70
|
+
* @param options - The options parameters.
|
|
71
|
+
*/
|
|
72
|
+
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
73
|
+
listDomains(options = {}) {
|
|
74
|
+
const { span, updatedOptions } = tracing_js_1.tracingClient.startSpan("SipRoutingClient-listDomains", options);
|
|
75
|
+
try {
|
|
76
|
+
const iter = this.listDomainsPagingAll(Object.assign({}, updatedOptions));
|
|
77
|
+
return {
|
|
78
|
+
next() {
|
|
79
|
+
return iter.next();
|
|
80
|
+
},
|
|
81
|
+
[Symbol.asyncIterator]() {
|
|
82
|
+
return this;
|
|
83
|
+
},
|
|
84
|
+
byPage: () => {
|
|
85
|
+
return this.listDomainsPagingPage(Object.assign({}, updatedOptions));
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
catch (e) {
|
|
90
|
+
span.setStatus({
|
|
91
|
+
status: "error",
|
|
92
|
+
error: e,
|
|
93
|
+
});
|
|
94
|
+
throw e;
|
|
95
|
+
}
|
|
96
|
+
finally {
|
|
97
|
+
span.end();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
68
100
|
/**
|
|
69
101
|
* Gets the SIP trunk.
|
|
70
102
|
* @param fqdn - The trunk's FQDN.
|
|
@@ -80,6 +112,22 @@ class SipRoutingClient {
|
|
|
80
112
|
throw { code: "NotFound", message: "Not Found" };
|
|
81
113
|
});
|
|
82
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* Gets the SIP domain.
|
|
117
|
+
* @param fqdn - The domain's FQDN.
|
|
118
|
+
* @param options - The options parameters.
|
|
119
|
+
*/
|
|
120
|
+
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
121
|
+
async getDomain(fqdn, options = {}) {
|
|
122
|
+
return tracing_js_1.tracingClient.withSpan("SipRoutingClient-getDomain", options, async (updatedOptions) => {
|
|
123
|
+
const domains = await this.getDomainsInternal(updatedOptions);
|
|
124
|
+
const domain = domains.find((value) => value.fqdn === fqdn);
|
|
125
|
+
if (domain) {
|
|
126
|
+
return domain;
|
|
127
|
+
}
|
|
128
|
+
throw { code: "NotFound", message: "Not Found" };
|
|
129
|
+
});
|
|
130
|
+
}
|
|
83
131
|
/**
|
|
84
132
|
* Lists the SIP trunk routes.
|
|
85
133
|
* @param options - The options parameters.
|
|
@@ -156,6 +204,50 @@ class SipRoutingClient {
|
|
|
156
204
|
throw { code: "NotFound", message: "Not Found" };
|
|
157
205
|
});
|
|
158
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* Sets the SIP domains.
|
|
209
|
+
* @param domains - The SIP domains to be set.
|
|
210
|
+
* @param options - The options parameters.
|
|
211
|
+
*/
|
|
212
|
+
async setDomains(domains, options = {}) {
|
|
213
|
+
return tracing_js_1.tracingClient.withSpan("SipRoutingClient-setTrunks", options, async (updatedOptions) => {
|
|
214
|
+
const patch = { domains: (0, mappers_js_1.transformDomainsIntoRestModel)(domains) };
|
|
215
|
+
let config = await this.client.sipRouting.get(updatedOptions);
|
|
216
|
+
const storedFqdns = (0, mappers_js_1.transformDomainsFromRestModel)(config.domains).map((domain) => domain.fqdn);
|
|
217
|
+
const setFqdns = domains.map((domain) => domain.fqdn);
|
|
218
|
+
storedFqdns.forEach((storedFqdn) => {
|
|
219
|
+
const shouldDeleteStoredTrunk = !setFqdns.find((value) => value === storedFqdn);
|
|
220
|
+
if (shouldDeleteStoredTrunk) {
|
|
221
|
+
patch.domains[storedFqdn] = null;
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
const isPatchNeeded = Object.keys(patch.domains).length > 0;
|
|
225
|
+
if (isPatchNeeded) {
|
|
226
|
+
const payload = Object.assign(Object.assign({}, updatedOptions), patch);
|
|
227
|
+
config = await this.client.sipRouting.update(payload);
|
|
228
|
+
}
|
|
229
|
+
return (0, mappers_js_1.transformDomainsFromRestModel)(config.domains);
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Sets the SIP domain.
|
|
234
|
+
* @param domain - The SIP domain to be set.
|
|
235
|
+
* @param options - The options parameters.
|
|
236
|
+
*/
|
|
237
|
+
async setDomain(domain, options = {}) {
|
|
238
|
+
return tracing_js_1.tracingClient.withSpan("SipRoutingClient-setDomain", options, async (updatedOptions) => {
|
|
239
|
+
const patch = {
|
|
240
|
+
domains: (0, mappers_js_1.transformDomainsIntoRestModel)([domain]),
|
|
241
|
+
};
|
|
242
|
+
const payload = Object.assign(Object.assign({}, updatedOptions), patch);
|
|
243
|
+
const config = await this.client.sipRouting.update(payload);
|
|
244
|
+
const storedDomain = (0, mappers_js_1.transformDomainsFromRestModel)(config.domains).find((value) => value.fqdn === domain.fqdn);
|
|
245
|
+
if (storedDomain) {
|
|
246
|
+
return storedDomain;
|
|
247
|
+
}
|
|
248
|
+
throw { code: "NotFound", message: "Not Found" };
|
|
249
|
+
});
|
|
250
|
+
}
|
|
159
251
|
/**
|
|
160
252
|
* Sets the SIP trunk routes.
|
|
161
253
|
* @param routes - The SIP trunk routes to be set.
|
|
@@ -188,14 +280,52 @@ class SipRoutingClient {
|
|
|
188
280
|
await this.client.sipRouting.update(payload);
|
|
189
281
|
});
|
|
190
282
|
}
|
|
283
|
+
/**
|
|
284
|
+
* Deletes the SIP domain.
|
|
285
|
+
* @param fqdn - The domain's FQDN.
|
|
286
|
+
* @param options - The options parameters.
|
|
287
|
+
*/
|
|
288
|
+
async deleteDomain(fqdn, options = {}) {
|
|
289
|
+
return tracing_js_1.tracingClient.withSpan("SipRoutingClient-deleteDomain", options, async (updatedOptions) => {
|
|
290
|
+
const domains = {};
|
|
291
|
+
domains[fqdn] = null;
|
|
292
|
+
const patch = {
|
|
293
|
+
domains: domains,
|
|
294
|
+
};
|
|
295
|
+
const payload = Object.assign(Object.assign({}, updatedOptions), patch);
|
|
296
|
+
await this.client.sipRouting.update(payload);
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Test routes with number.
|
|
301
|
+
* @param targetPhoneNumber - target phone number to test routes.
|
|
302
|
+
* @param routes - sip trunk routes.
|
|
303
|
+
* @param options - The options parameters for routes.
|
|
304
|
+
*/
|
|
305
|
+
async getRoutesForNumber(targetPhoneNumber, routes, options = {}) {
|
|
306
|
+
return tracing_js_1.tracingClient.withSpan("SipRoutingClient-getRoutesWithNumber", options, async (updatedOptions) => {
|
|
307
|
+
return this.getRoutesForNumberInternal(targetPhoneNumber, routes, updatedOptions);
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
async getRoutesForNumberInternal(targetPhoneNumber, routes, options) {
|
|
311
|
+
const optionalParams = Object.assign({ routes: routes }, options);
|
|
312
|
+
const response = await this.client.sipRouting.testRoutesWithNumber(targetPhoneNumber, optionalParams);
|
|
313
|
+
return response.matchingRoutes ? response.matchingRoutes : [];
|
|
314
|
+
}
|
|
191
315
|
async getRoutesInternal(options) {
|
|
192
316
|
const config = await this.client.sipRouting.get(options);
|
|
193
317
|
return config.routes || [];
|
|
194
318
|
}
|
|
195
319
|
async getTrunksInternal(options) {
|
|
196
|
-
const
|
|
320
|
+
const optionalParams = Object.assign({}, options);
|
|
321
|
+
const config = await this.client.sipRouting.get(Object.assign(Object.assign({}, optionalParams), { expand: "trunks/health" }));
|
|
197
322
|
return (0, mappers_js_1.transformFromRestModel)(config.trunks);
|
|
198
323
|
}
|
|
324
|
+
async getDomainsInternal(options) {
|
|
325
|
+
const optionalParams = Object.assign({}, options);
|
|
326
|
+
const config = await this.client.sipRouting.get(optionalParams);
|
|
327
|
+
return (0, mappers_js_1.transformDomainsFromRestModel)(config.domains);
|
|
328
|
+
}
|
|
199
329
|
listRoutesPagingAll(options) {
|
|
200
330
|
return tslib_1.__asyncGenerator(this, arguments, function* listRoutesPagingAll_1() {
|
|
201
331
|
var _a, e_1, _b, _c;
|
|
@@ -242,6 +372,32 @@ class SipRoutingClient {
|
|
|
242
372
|
yield yield tslib_1.__await(apiResult);
|
|
243
373
|
});
|
|
244
374
|
}
|
|
375
|
+
listDomainsPagingAll(options) {
|
|
376
|
+
return tslib_1.__asyncGenerator(this, arguments, function* listDomainsPagingAll_1() {
|
|
377
|
+
var _a, e_3, _b, _c;
|
|
378
|
+
try {
|
|
379
|
+
for (var _d = true, _e = tslib_1.__asyncValues(this.listDomainsPagingPage(options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
380
|
+
_c = _f.value;
|
|
381
|
+
_d = false;
|
|
382
|
+
const page = _c;
|
|
383
|
+
yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
387
|
+
finally {
|
|
388
|
+
try {
|
|
389
|
+
if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
|
|
390
|
+
}
|
|
391
|
+
finally { if (e_3) throw e_3.error; }
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
listDomainsPagingPage() {
|
|
396
|
+
return tslib_1.__asyncGenerator(this, arguments, function* listDomainsPagingPage_1(options = {}) {
|
|
397
|
+
const apiResult = yield tslib_1.__await(this.getDomainsInternal(options));
|
|
398
|
+
yield yield tslib_1.__await(apiResult);
|
|
399
|
+
});
|
|
400
|
+
}
|
|
245
401
|
listRoutesPagingPage() {
|
|
246
402
|
return tslib_1.__asyncGenerator(this, arguments, function* listRoutesPagingPage_1(options = {}) {
|
|
247
403
|
const apiResult = yield tslib_1.__await(this.getRoutesInternal(options));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sipRoutingClient.js","sourceRoot":"","sources":["../../src/sipRoutingClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC,sEAIqC;AAErC,gDAAqD;AAErD,+CAA0C;AAC1C,wFAA+G;AAW/G,6CAA8E;AAE9E,2DAA2D;AAG3D,sDAA4B;AAO5B;;;;GAIG;AACH,MAAM,kBAAkB,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n createCommunicationAuthPolicy,\n isKeyCredential,\n parseClientArguments,\n} from \"@azure/communication-common\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport type { InternalPipelineOptions } from \"@azure/core-rest-pipeline\";\nimport { logger } from \"./utils/index.js\";\nimport { SipRoutingClient as SipRoutingGeneratedClient } from \"./generated/src/siprouting/sipRoutingClient.js\";\nimport type {\n SipConfigurationUpdate,\n SipRoutingError,\n} from \"./generated/src/siprouting/models/index.js\";\nimport type {\n ListSipRoutesOptions,\n ListSipTrunksOptions,\n SipTrunk,\n SipTrunkRoute,\n} from \"./models.js\";\nimport { transformFromRestModel, transformIntoRestModel } from \"./mappers.js\";\nimport type { CommonClientOptions, OperationOptions } from \"@azure/core-client\";\nimport { tracingClient } from \"./generated/src/tracing.js\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\n\nexport * from \"./models.js\";\n\n/**\n * Client options used to configure the SipRoutingClient API requests.\n */\nexport interface SipRoutingClientOptions extends CommonClientOptions {}\n\n/**\n * Checks whether the type of a value is SipClientOptions or not.\n *\n * @param options - The value being checked.\n */\nconst isSipClientOptions = (options: any): options is SipRoutingClientOptions =>\n options && !isKeyCredential(options) && !isTokenCredential(options);\n\n/**\n * Client class for interacting with Azure Communication Services SIP Routing Administration.\n */\nexport class SipRoutingClient {\n /**\n * A reference to the auto-generated SipRouting HTTP client.\n */\n private readonly client: SipRoutingGeneratedClient;\n\n /**\n * Initializes a new instance of the SipRoutingClient class using a connection string.\n *\n * @param connectionString - Connection string to connect to an Azure Communication Service resource. (eg: endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret)\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(connectionString: string, options?: SipRoutingClientOptions);\n\n /**\n * Initializes a new instance of the SipRoutingClient class using an Azure KeyCredential.\n *\n * @param endpoint - The endpoint of the service (eg: https://contoso.eastus.communications.azure.net).\n * @param credential - An object that is used to authenticate requests to the service. Use the Azure KeyCredential or `@azure/identity` to create a credential.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(\n endpoint: string,\n credential: KeyCredential,\n options?: SipRoutingClientOptions,\n );\n\n /**\n * Initializes a new instance of the SipRoutingClient class using a TokenCredential.\n * @param endpoint - The endpoint of the service (ex: https://contoso.eastus.communications.azure.net).\n * @param credential - TokenCredential that is used to authenticate requests to the service.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(\n endpoint: string,\n credential: TokenCredential,\n options?: SipRoutingClientOptions,\n );\n\n public constructor(\n connectionStringOrUrl: string,\n credentialOrOptions?: KeyCredential | TokenCredential | SipRoutingClientOptions,\n maybeOptions: SipRoutingClientOptions = {},\n ) {\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n const options = isSipClientOptions(credentialOrOptions) ? credentialOrOptions : maybeOptions;\n\n const internalPipelineOptions: InternalPipelineOptions = {\n ...options,\n ...{\n loggingOptions: {\n logger: logger.info,\n },\n },\n };\n\n this.client = new SipRoutingGeneratedClient(url, {\n endpoint: url,\n ...internalPipelineOptions,\n });\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.client.pipeline.addPolicy(authPolicy);\n }\n\n /**\n * Lists the SIP trunks.\n * @param options - The options parameters.\n */\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n public listTrunks(options: ListSipTrunksOptions = {}): PagedAsyncIterableIterator<SipTrunk> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"SipRoutingClient-listTrunks\",\n options,\n );\n\n try {\n const iter = this.listTrunksPagingAll({ ...updatedOptions });\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return this.listTrunksPagingPage({ ...updatedOptions });\n },\n };\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Gets the SIP trunk.\n * @param fqdn - The trunk's FQDN.\n * @param options - The options parameters.\n */\n public async getTrunk(fqdn: string, options: OperationOptions = {}): Promise<SipTrunk> {\n return tracingClient.withSpan(\"SipRoutingClient-getTrunk\", options, async (updatedOptions) => {\n const trunks = await this.getTrunksInternal(updatedOptions);\n const trunk = trunks.find((value: SipTrunk) => value.fqdn === fqdn);\n if (trunk) {\n return trunk;\n }\n throw { code: \"NotFound\", message: \"Not Found\" } as SipRoutingError;\n });\n }\n\n /**\n * Lists the SIP trunk routes.\n * @param options - The options parameters.\n */\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n public listRoutes(options: ListSipRoutesOptions = {}): PagedAsyncIterableIterator<SipTrunkRoute> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"SipRoutingClient-listRoutes\",\n options,\n );\n\n try {\n const iter = this.listRoutesPagingAll({ ...updatedOptions });\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return this.listRoutesPagingPage({ ...updatedOptions });\n },\n };\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Sets the SIP trunks.\n * @param trunks - The SIP trunks to be set.\n * @param options - The options parameters.\n */\n public async setTrunks(trunks: SipTrunk[], options: OperationOptions = {}): Promise<SipTrunk[]> {\n return tracingClient.withSpan(\"SipRoutingClient-setTrunks\", options, async (updatedOptions) => {\n const patch: SipConfigurationUpdate = { trunks: transformIntoRestModel(trunks) };\n let config = await this.client.sipRouting.get(updatedOptions);\n const storedFqdns = transformFromRestModel(config.trunks).map((trunk) => trunk.fqdn);\n const setFqdns = trunks.map((trunk) => trunk.fqdn);\n storedFqdns.forEach((storedFqdn) => {\n const shouldDeleteStoredTrunk = !setFqdns.find((value) => value === storedFqdn);\n if (shouldDeleteStoredTrunk) {\n patch.trunks![storedFqdn] = null;\n }\n });\n\n const isPatchNeeded = Object.keys(patch.trunks!).length > 0;\n if (isPatchNeeded) {\n const payload = {\n ...updatedOptions,\n ...patch,\n };\n config = await this.client.sipRouting.update(payload);\n }\n\n return transformFromRestModel(config.trunks);\n });\n }\n\n /**\n * Sets the SIP trunk.\n * @param trunk - The SIP trunk to be set.\n * @param options - The options parameters.\n */\n public async setTrunk(trunk: SipTrunk, options: OperationOptions = {}): Promise<SipTrunk> {\n return tracingClient.withSpan(\"SipRoutingClient-setTrunk\", options, async (updatedOptions) => {\n const patch: SipConfigurationUpdate = {\n trunks: transformIntoRestModel([trunk]),\n };\n const payload = {\n ...updatedOptions,\n ...patch,\n };\n const config = await this.client.sipRouting.update(payload);\n const storedTrunk = transformFromRestModel(config.trunks).find(\n (value: SipTrunk) => value.fqdn === trunk.fqdn,\n );\n if (storedTrunk) {\n return storedTrunk;\n }\n\n throw { code: \"NotFound\", message: \"Not Found\" } as SipRoutingError;\n });\n }\n\n /**\n * Sets the SIP trunk routes.\n * @param routes - The SIP trunk routes to be set.\n * @param options - The options parameters.\n */\n public async setRoutes(\n routes: SipTrunkRoute[],\n options: OperationOptions = {},\n ): Promise<SipTrunkRoute[]> {\n return tracingClient.withSpan(\"SipRoutingClient-setRoutes\", options, async (updatedOptions) => {\n const patch: SipConfigurationUpdate = {\n routes: routes,\n };\n const payload = {\n ...updatedOptions,\n ...patch,\n };\n const config = await this.client.sipRouting.update(payload);\n const storedRoutes = config.routes || (await this.getRoutesInternal(updatedOptions));\n return storedRoutes;\n });\n }\n\n /**\n * Deletes the SIP trunk.\n * @param fqdn - The trunk's FQDN.\n * @param options - The options parameters.\n */\n public async deleteTrunk(fqdn: string, options: OperationOptions = {}): Promise<void> {\n return tracingClient.withSpan(\n \"SipRoutingClient-deleteTrunk\",\n options,\n async (updatedOptions) => {\n const trunks: any = {};\n trunks[fqdn] = null;\n const patch: SipConfigurationUpdate = {\n trunks: trunks,\n };\n\n const payload = {\n ...updatedOptions,\n ...patch,\n };\n await this.client.sipRouting.update(payload);\n },\n );\n }\n\n private async getRoutesInternal(options: OperationOptions): Promise<SipTrunkRoute[]> {\n const config = await this.client.sipRouting.get(options);\n return config.routes || [];\n }\n\n private async getTrunksInternal(options: OperationOptions): Promise<SipTrunk[]> {\n const config = await this.client.sipRouting.get(options);\n return transformFromRestModel(config.trunks);\n }\n\n private async *listRoutesPagingAll(\n options?: ListSipRoutesOptions,\n ): AsyncIterableIterator<SipTrunkRoute> {\n for await (const page of this.listRoutesPagingPage(options)) {\n yield* page;\n }\n }\n\n private async *listTrunksPagingAll(\n options?: ListSipTrunksOptions,\n ): AsyncIterableIterator<SipTrunk> {\n for await (const page of this.listTrunksPagingPage(options)) {\n yield* page;\n }\n }\n\n private async *listTrunksPagingPage(\n options: ListSipTrunksOptions = {},\n ): AsyncIterableIterator<SipTrunk[]> {\n const apiResult = await this.getTrunksInternal(options as OperationOptions);\n yield apiResult;\n }\n\n private async *listRoutesPagingPage(\n options: ListSipRoutesOptions = {},\n ): AsyncIterableIterator<SipTrunkRoute[]> {\n const apiResult = await this.getRoutesInternal(options as OperationOptions);\n yield apiResult;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sipRoutingClient.js","sourceRoot":"","sources":["../../src/sipRoutingClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC,sEAIqC;AAErC,gDAAqD;AAErD,+CAA0C;AAC1C,wFAA+G;AAc/G,6CAKsB;AAEtB,2DAA2D;AAG3D,sDAA4B;AAO5B;;;;GAIG;AACH,MAAM,kBAAkB,GAAG,CAAC,OAAY,EAAsC,EAAE,CAC9E,OAAO,IAAI,CAAC,IAAA,sCAAe,EAAC,OAAO,CAAC,IAAI,CAAC,IAAA,6BAAiB,EAAC,OAAO,CAAC,CAAC;AAEtE;;GAEG;AACH,MAAa,gBAAgB;IAuC3B,YACE,qBAA6B,EAC7B,mBAA+E,EAC/E,eAAwC,EAAE;QAE1C,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,IAAA,2CAAoB,EAAC,qBAAqB,EAAE,mBAAmB,CAAC,CAAC;QAC7F,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.\n// Licensed under the MIT License.\n\nimport {\n createCommunicationAuthPolicy,\n isKeyCredential,\n parseClientArguments,\n} from \"@azure/communication-common\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport type { InternalPipelineOptions } from \"@azure/core-rest-pipeline\";\nimport { logger } from \"./utils/index.js\";\nimport { SipRoutingClient as SipRoutingGeneratedClient } from \"./generated/src/siprouting/sipRoutingClient.js\";\nimport type {\n SipConfigurationUpdate,\n SipRoutingError,\n} from \"./generated/src/siprouting/models/index.js\";\nimport type {\n GetSipDomainsOptions,\n ListSipDomainsOptions,\n ListSipRoutesOptions,\n ListSipTrunksOptions,\n SipTrunk,\n SipTrunkRoute,\n SipDomain,\n} from \"./models.js\";\nimport {\n transformFromRestModel,\n transformDomainsFromRestModel,\n transformIntoRestModel,\n transformDomainsIntoRestModel,\n} from \"./mappers.js\";\nimport type { CommonClientOptions, OperationOptions } from \"@azure/core-client\";\nimport { tracingClient } from \"./generated/src/tracing.js\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\n\nexport * from \"./models.js\";\n\n/**\n * Client options used to configure the SipRoutingClient API requests.\n */\nexport interface SipRoutingClientOptions extends CommonClientOptions {}\n\n/**\n * Checks whether the type of a value is SipClientOptions or not.\n *\n * @param options - The value being checked.\n */\nconst isSipClientOptions = (options: any): options is SipRoutingClientOptions =>\n options && !isKeyCredential(options) && !isTokenCredential(options);\n\n/**\n * Client class for interacting with Azure Communication Services SIP Routing Administration.\n */\nexport class SipRoutingClient {\n /**\n * A reference to the auto-generated SipRouting HTTP client.\n */\n private readonly client: SipRoutingGeneratedClient;\n\n /**\n * Initializes a new instance of the SipRoutingClient class using a connection string.\n *\n * @param connectionString - Connection string to connect to an Azure Communication Service resource. (eg: endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret)\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(connectionString: string, options?: SipRoutingClientOptions);\n\n /**\n * Initializes a new instance of the SipRoutingClient class using an Azure KeyCredential.\n *\n * @param endpoint - The endpoint of the service (eg: https://contoso.eastus.communications.azure.net).\n * @param credential - An object that is used to authenticate requests to the service. Use the Azure KeyCredential or `@azure/identity` to create a credential.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(\n endpoint: string,\n credential: KeyCredential,\n options?: SipRoutingClientOptions,\n );\n\n /**\n * Initializes a new instance of the SipRoutingClient class using a TokenCredential.\n * @param endpoint - The endpoint of the service (ex: https://contoso.eastus.communications.azure.net).\n * @param credential - TokenCredential that is used to authenticate requests to the service.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(\n endpoint: string,\n credential: TokenCredential,\n options?: SipRoutingClientOptions,\n );\n\n public constructor(\n connectionStringOrUrl: string,\n credentialOrOptions?: KeyCredential | TokenCredential | SipRoutingClientOptions,\n maybeOptions: SipRoutingClientOptions = {},\n ) {\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n const options = isSipClientOptions(credentialOrOptions) ? credentialOrOptions : maybeOptions;\n\n const internalPipelineOptions: InternalPipelineOptions = {\n ...options,\n ...{\n loggingOptions: {\n logger: logger.info,\n },\n },\n };\n\n this.client = new SipRoutingGeneratedClient(url, {\n endpoint: url,\n ...internalPipelineOptions,\n });\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.client.pipeline.addPolicy(authPolicy);\n }\n\n /**\n * Lists the SIP trunks.\n * @param options - The options parameters.\n */\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n public listTrunks(options: ListSipTrunksOptions = {}): PagedAsyncIterableIterator<SipTrunk> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"SipRoutingClient-listTrunks\",\n options,\n );\n\n try {\n const iter = this.listTrunksPagingAll({ ...updatedOptions });\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return this.listTrunksPagingPage({ ...updatedOptions });\n },\n };\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Lists the SIP domains.\n * @param options - The options parameters.\n */\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n public listDomains(options: ListSipDomainsOptions = {}): PagedAsyncIterableIterator<SipDomain> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"SipRoutingClient-listDomains\",\n options,\n );\n\n try {\n const iter = this.listDomainsPagingAll({ ...updatedOptions });\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return this.listDomainsPagingPage({ ...updatedOptions });\n },\n };\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Gets the SIP trunk.\n * @param fqdn - The trunk's FQDN.\n * @param options - The options parameters.\n */\n public async getTrunk(fqdn: string, options: OperationOptions = {}): Promise<SipTrunk> {\n return tracingClient.withSpan(\"SipRoutingClient-getTrunk\", options, async (updatedOptions) => {\n const trunks = await this.getTrunksInternal(updatedOptions);\n const trunk = trunks.find((value: SipTrunk) => value.fqdn === fqdn);\n if (trunk) {\n return trunk;\n }\n throw { code: \"NotFound\", message: \"Not Found\" } as SipRoutingError;\n });\n }\n\n /**\n * Gets the SIP domain.\n * @param fqdn - The domain's FQDN.\n * @param options - The options parameters.\n */\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n public async getDomain(fqdn: string, options: GetSipDomainsOptions = {}): Promise<SipDomain> {\n return tracingClient.withSpan(\"SipRoutingClient-getDomain\", options, async (updatedOptions) => {\n const domains = await this.getDomainsInternal(updatedOptions);\n const domain = domains.find((value: SipDomain) => value.fqdn === fqdn);\n if (domain) {\n return domain;\n }\n throw { code: \"NotFound\", message: \"Not Found\" } as SipRoutingError;\n });\n }\n\n /**\n * Lists the SIP trunk routes.\n * @param options - The options parameters.\n */\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n public listRoutes(options: ListSipRoutesOptions = {}): PagedAsyncIterableIterator<SipTrunkRoute> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"SipRoutingClient-listRoutes\",\n options,\n );\n\n try {\n const iter = this.listRoutesPagingAll({ ...updatedOptions });\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return this.listRoutesPagingPage({ ...updatedOptions });\n },\n };\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Sets the SIP trunks.\n * @param trunks - The SIP trunks to be set.\n * @param options - The options parameters.\n */\n public async setTrunks(trunks: SipTrunk[], options: OperationOptions = {}): Promise<SipTrunk[]> {\n return tracingClient.withSpan(\"SipRoutingClient-setTrunks\", options, async (updatedOptions) => {\n const patch: SipConfigurationUpdate = { trunks: transformIntoRestModel(trunks) };\n let config = await this.client.sipRouting.get(updatedOptions);\n const storedFqdns = transformFromRestModel(config.trunks).map((trunk) => trunk.fqdn);\n const setFqdns = trunks.map((trunk) => trunk.fqdn);\n storedFqdns.forEach((storedFqdn) => {\n const shouldDeleteStoredTrunk = !setFqdns.find((value) => value === storedFqdn);\n if (shouldDeleteStoredTrunk) {\n patch.trunks![storedFqdn] = null;\n }\n });\n\n const isPatchNeeded = Object.keys(patch.trunks!).length > 0;\n if (isPatchNeeded) {\n const payload = {\n ...updatedOptions,\n ...patch,\n };\n config = await this.client.sipRouting.update(payload);\n }\n\n return transformFromRestModel(config.trunks);\n });\n }\n\n /**\n * Sets the SIP trunk.\n * @param trunk - The SIP trunk to be set.\n * @param options - The options parameters.\n */\n public async setTrunk(trunk: SipTrunk, options: OperationOptions = {}): Promise<SipTrunk> {\n return tracingClient.withSpan(\"SipRoutingClient-setTrunk\", options, async (updatedOptions) => {\n const patch: SipConfigurationUpdate = {\n trunks: transformIntoRestModel([trunk]),\n };\n const payload = {\n ...updatedOptions,\n ...patch,\n };\n const config = await this.client.sipRouting.update(payload);\n const storedTrunk = transformFromRestModel(config.trunks).find(\n (value: SipTrunk) => value.fqdn === trunk.fqdn,\n );\n if (storedTrunk) {\n return storedTrunk;\n }\n\n throw { code: \"NotFound\", message: \"Not Found\" } as SipRoutingError;\n });\n }\n\n /**\n * Sets the SIP domains.\n * @param domains - The SIP domains to be set.\n * @param options - The options parameters.\n */\n public async setDomains(\n domains: SipDomain[],\n options: OperationOptions = {},\n ): Promise<SipDomain[]> {\n return tracingClient.withSpan(\"SipRoutingClient-setTrunks\", options, async (updatedOptions) => {\n const patch: SipConfigurationUpdate = { domains: transformDomainsIntoRestModel(domains) };\n let config = await this.client.sipRouting.get(updatedOptions);\n const storedFqdns = transformDomainsFromRestModel(config.domains).map(\n (domain) => domain.fqdn,\n );\n const setFqdns = domains.map((domain) => domain.fqdn);\n storedFqdns.forEach((storedFqdn) => {\n const shouldDeleteStoredTrunk = !setFqdns.find((value) => value === storedFqdn);\n if (shouldDeleteStoredTrunk) {\n patch.domains![storedFqdn] = null;\n }\n });\n\n const isPatchNeeded = Object.keys(patch.domains!).length > 0;\n if (isPatchNeeded) {\n const payload = {\n ...updatedOptions,\n ...patch,\n };\n config = await this.client.sipRouting.update(payload);\n }\n\n return transformDomainsFromRestModel(config.domains);\n });\n }\n\n /**\n * Sets the SIP domain.\n * @param domain - The SIP domain to be set.\n * @param options - The options parameters.\n */\n public async setDomain(domain: SipDomain, options: OperationOptions = {}): Promise<SipDomain> {\n return tracingClient.withSpan(\"SipRoutingClient-setDomain\", options, async (updatedOptions) => {\n const patch: SipConfigurationUpdate = {\n domains: transformDomainsIntoRestModel([domain]),\n };\n const payload = {\n ...updatedOptions,\n ...patch,\n };\n const config = await this.client.sipRouting.update(payload);\n const storedDomain = transformDomainsFromRestModel(config.domains).find(\n (value: SipDomain) => value.fqdn === domain.fqdn,\n );\n if (storedDomain) {\n return storedDomain;\n }\n\n throw { code: \"NotFound\", message: \"Not Found\" } as SipRoutingError;\n });\n }\n\n /**\n * Sets the SIP trunk routes.\n * @param routes - The SIP trunk routes to be set.\n * @param options - The options parameters.\n */\n public async setRoutes(\n routes: SipTrunkRoute[],\n options: OperationOptions = {},\n ): Promise<SipTrunkRoute[]> {\n return tracingClient.withSpan(\"SipRoutingClient-setRoutes\", options, async (updatedOptions) => {\n const patch: SipConfigurationUpdate = {\n routes: routes,\n };\n const payload = {\n ...updatedOptions,\n ...patch,\n };\n const config = await this.client.sipRouting.update(payload);\n const storedRoutes = config.routes || (await this.getRoutesInternal(updatedOptions));\n return storedRoutes;\n });\n }\n\n /**\n * Deletes the SIP trunk.\n * @param fqdn - The trunk's FQDN.\n * @param options - The options parameters.\n */\n public async deleteTrunk(fqdn: string, options: OperationOptions = {}): Promise<void> {\n return tracingClient.withSpan(\n \"SipRoutingClient-deleteTrunk\",\n options,\n async (updatedOptions) => {\n const trunks: any = {};\n trunks[fqdn] = null;\n const patch: SipConfigurationUpdate = {\n trunks: trunks,\n };\n\n const payload = {\n ...updatedOptions,\n ...patch,\n };\n await this.client.sipRouting.update(payload);\n },\n );\n }\n\n /**\n * Deletes the SIP domain.\n * @param fqdn - The domain's FQDN.\n * @param options - The options parameters.\n */\n public async deleteDomain(fqdn: string, options: OperationOptions = {}): Promise<void> {\n return tracingClient.withSpan(\n \"SipRoutingClient-deleteDomain\",\n options,\n async (updatedOptions) => {\n const domains: any = {};\n domains[fqdn] = null;\n const patch: SipConfigurationUpdate = {\n domains: domains,\n };\n\n const payload = {\n ...updatedOptions,\n ...patch,\n };\n await this.client.sipRouting.update(payload);\n },\n );\n }\n\n /**\n * Test routes with number.\n * @param targetPhoneNumber - target phone number to test routes.\n * @param routes - sip trunk routes.\n * @param options - The options parameters for routes.\n */\n public async getRoutesForNumber(\n targetPhoneNumber: string,\n routes: SipTrunkRoute[],\n options: OperationOptions = {},\n ): Promise<SipTrunkRoute[]> {\n return tracingClient.withSpan(\n \"SipRoutingClient-getRoutesWithNumber\",\n options,\n async (updatedOptions) => {\n return this.getRoutesForNumberInternal(targetPhoneNumber, routes, updatedOptions);\n },\n );\n }\n\n private async getRoutesForNumberInternal(\n targetPhoneNumber: string,\n routes: SipTrunkRoute[],\n options?: OperationOptions,\n ): Promise<SipTrunkRoute[]> {\n const optionalParams = {\n routes: routes,\n ...options,\n };\n const response = await this.client.sipRouting.testRoutesWithNumber(\n targetPhoneNumber,\n optionalParams,\n );\n\n return response.matchingRoutes ? response.matchingRoutes : [];\n }\n\n private async getRoutesInternal(options: OperationOptions): Promise<SipTrunkRoute[]> {\n const config = await this.client.sipRouting.get(options);\n return config.routes || [];\n }\n\n private async getTrunksInternal(options: ListSipTrunksOptions): Promise<SipTrunk[]> {\n const optionalParams = {\n ...options,\n };\n const config = await this.client.sipRouting.get({ ...optionalParams, expand: \"trunks/health\" });\n return transformFromRestModel(config.trunks);\n }\n\n private async getDomainsInternal(options: ListSipDomainsOptions): Promise<SipDomain[]> {\n const optionalParams = {\n ...options,\n };\n const config = await this.client.sipRouting.get(optionalParams);\n return transformDomainsFromRestModel(config.domains);\n }\n\n private async *listRoutesPagingAll(\n options?: ListSipRoutesOptions,\n ): AsyncIterableIterator<SipTrunkRoute> {\n for await (const page of this.listRoutesPagingPage(options)) {\n yield* page;\n }\n }\n\n private async *listTrunksPagingAll(\n options?: ListSipTrunksOptions,\n ): AsyncIterableIterator<SipTrunk> {\n for await (const page of this.listTrunksPagingPage(options)) {\n yield* page;\n }\n }\n\n private async *listTrunksPagingPage(\n options: ListSipTrunksOptions = {},\n ): AsyncIterableIterator<SipTrunk[]> {\n const apiResult = await this.getTrunksInternal(options);\n yield apiResult;\n }\n\n private async *listDomainsPagingAll(\n options?: ListSipDomainsOptions,\n ): AsyncIterableIterator<SipDomain> {\n for await (const page of this.listDomainsPagingPage(options)) {\n yield* page;\n }\n }\n\n private async *listDomainsPagingPage(\n options: ListSipDomainsOptions = {},\n ): AsyncIterableIterator<SipDomain[]> {\n const apiResult = await this.getDomainsInternal(options);\n yield apiResult;\n }\n\n private async *listRoutesPagingPage(\n options: ListSipRoutesOptions = {},\n ): AsyncIterableIterator<SipTrunkRoute[]> {\n const apiResult = await this.getRoutesInternal(options as OperationOptions);\n yield apiResult;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAErB,QAAA,WAAW,GAAW,cAAc,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const SDK_VERSION: string = \"1.5.0-beta.
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAErB,QAAA,WAAW,GAAW,cAAc,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const SDK_VERSION: string = \"1.5.0-beta.2\";\n"]}
|
|
@@ -25,7 +25,7 @@ export class PhoneNumbersClient extends coreClient.ServiceClient {
|
|
|
25
25
|
const defaults = {
|
|
26
26
|
requestContentType: "application/json; charset=utf-8",
|
|
27
27
|
};
|
|
28
|
-
const packageDetails = `azsdk-js-communication-phone-numbers/1.5.0-beta.
|
|
28
|
+
const packageDetails = `azsdk-js-communication-phone-numbers/1.5.0-beta.2`;
|
|
29
29
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
30
30
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
31
31
|
: `${packageDetails}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phoneNumbersClient.js","sourceRoot":"","sources":["../../../../src/generated/src/phoneNumbersClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAMjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAIzD,MAAM,OAAO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AAI,EAAE,wBAAwB;YAC9B,KAAK,CAAC,WAAW,CACf,OAAwB,EACxB,IAAiB;gBAEjB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACrC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACrB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;wBACjD,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;4BACrC,OAAO,cAAc,GAAG,UAAU,CAAC;wBACrC,CAAC;6BAAM,CAAC;4BACN,OAAO,IAAI,CAAC;wBACd,CAAC;oBACH,CAAC,CAAC,CAAC;oBACH,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrD,CAAC;gBACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;CAGF","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport { PhoneNumbersImpl } from \"./operations/index.js\";\nimport { PhoneNumbers } from \"./operationsInterfaces/index.js\";\nimport { PhoneNumbersClientOptionalParams } from \"./models/index.js\";\n\nexport class PhoneNumbersClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the PhoneNumbersClient class.\n * @param endpoint The communication resource, for example https://resourcename.communication.azure.com\n * @param options The parameter options\n */\n constructor(endpoint: string, options?: PhoneNumbersClientOptionalParams) {\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: PhoneNumbersClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n };\n\n const packageDetails = `azsdk-js-communication-phone-numbers/1.5.0-beta.
|
|
1
|
+
{"version":3,"file":"phoneNumbersClient.js","sourceRoot":"","sources":["../../../../src/generated/src/phoneNumbersClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAMjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAIzD,MAAM,OAAO,kBAAmB,SAAQ,UAAU,CAAC,aAAa;IAI9D;;;;OAIG;IACH,YAAY,QAAgB,EAAE,OAA0C;;QACtE,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC/C,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAAqC;YACjD,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,mDAAmD,CAAC;QAC3E,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,MAAM,mBAAmB,iDACpB,QAAQ,GACR,OAAO,KACV,gBAAgB,EAAE;gBAChB,eAAe;aAChB,EACD,QAAQ,EAAE,MAAA,MAAA,OA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CAAC;SACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;CAGF","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport { PhoneNumbersImpl } from \"./operations/index.js\";\nimport { PhoneNumbers } from \"./operationsInterfaces/index.js\";\nimport { PhoneNumbersClientOptionalParams } from \"./models/index.js\";\n\nexport class PhoneNumbersClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the PhoneNumbersClient class.\n * @param endpoint The communication resource, for example https://resourcename.communication.azure.com\n * @param options The parameter options\n */\n constructor(endpoint: string, options?: PhoneNumbersClientOptionalParams) {\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: PhoneNumbersClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n };\n\n const packageDetails = `azsdk-js-communication-phone-numbers/1.5.0-beta.2`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n endpoint: options.endpoint ?? options.baseUri ?? \"{endpoint}\",\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2025-06-01\";\n this.phoneNumbers = new PhoneNumbersImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(\n request: PipelineRequest,\n next: SendRequest,\n ): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n },\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n phoneNumbers: PhoneNumbers;\n}\n"]}
|