{"_id":"@azure/communication-administration","_rev":"139-0018614c09f94f0aadaaf1c130e4f8bd","name":"@azure/communication-administration","dist-tags":{"latest":"1.0.0-beta.4","dev":"1.0.0-alpha.20210325.1"},"versions":{"1.0.0-beta.1":{"name":"@azure/communication-administration","version":"1.0.0-beta.1","keywords":["Azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-beta.1","maintainers":[{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/","dist":{"shasum":"df2427a57618df2b477e3694d5e5669eee2e3c03","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-beta.1.tgz","fileCount":40,"integrity":"sha512-byCNQ1MwQtSGvLL0VaWDLeQLC24v1BMRqD4io+a2qtx1Ga+yMCldKhtxxWvNrG04N/I7IQRJsJCQuU2PDpUxEw==","signatures":[{"sig":"MEYCIQCefnVDCWiqgnoNT7AkF8i/pA+VeLs4l8S7YxaNYHdMbgIhAJoT8RdyJ6FlFGHkrWxoEnzjx3EvjQxYFS8yR6Rnn2Wx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1137014,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfaZQqCRA9TVsSAnZWagAAEg0P/iPbGhQ93GwD8Fj5m8w0\nKB6k2g0nhfZJDLZN5xJVuhfJJXcVWZYs0T73lqGVH7Euxt7IJlLqkSQd7OVu\n/OIAHEr79z3Wv8T1K7Ap3Mlv06deqx1s+il+t8PO2cwPQwBj8CDVZDCdeQjt\nMWQQPX16yGBokKXjWJp8zyfBq/Dc3lWrrVV+1IPQH321XGyv6rGTAnqFLHOW\n+5TXquudWILfWKP8EbOP0D2ld7OGu4ngzWjjdbX9l/hvMUWG+D32jCnSpiS5\nMPOXop1pCBZV+gMyE1M4IX71nvRWIH6YvNwSeNlNZi4IM1pRLGo9jqZn7Ht8\nXA3u/H2LICkigURLJjjD0obXPmlvRQYm1klzTDU3frg31qCsndrjTF4OrB0q\n/aZ4McZh09I5IKVRQ2rTGq+Wd8EWjgUY21lHitcvnNMzUVq2f+VEW2hJ0k+7\njZAvyRSkHRQuK8mXWaTg8vLdxaJcIrNH8k+hIrVELyd2yzIfFHA8o3/ZGBcS\nhUl6ciEYVRPdW2pFpYM8DA6VN/mf4mJM7udAvkPcJ5/cPANd5As6y3uCX1+i\nwr5Rub1gCrdoBABnGK7Wfl4xF9g804dV3duArk9QLQkcDx3wEbDKeQwxn5jr\nx9vyZDf9YG6/5VIy4YeKL+/f8GpFvTpSMny1RvKiTPawUMz3/YTZar3+QNt4\n9wgm\r\n=GJJ2\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-beta.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","engines":{"node":">=8.0.0"},"scripts":{"lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"autorest --typescript --v3 ./swagger/CommunicationIdentity.md && rushx format","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && dev-tool samples run dist-samples/javascript dist-samples/typescript/dist/dist-samples/typescript/src/","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"echo integration-test:node skipped","integration-test:browser":"echo integration-test:browser skipped"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","_npmVersion":"6.14.8","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"12.18.3","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.1.6","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"1.0.0-preview.9","@azure/communication-common":"1.0.0-beta.1"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^6.1.0","rimraf":"^3.0.0","rollup":"^1.16.3","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","node-fetch":"^2.6.0","typescript":"~3.9.3","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","eslint-plugin-no-null":"^1.0.2","eslint-plugin-promise":"^4.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","eslint-config-prettier":"^6.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@typescript-eslint/parser":"^2.0.0","@azure/test-utils-recorder":"^1.0.0","@rollup/plugin-multi-entry":"^3.0.0","eslint-plugin-prefer-arrow":"~1.2.0","@rollup/plugin-node-resolve":"^8.0.0","eslint-plugin-no-only-tests":"^2.3.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0","@typescript-eslint/eslint-plugin":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-beta.1_1600754729450_0.127830166183156","host":"s3://npm-registry-packages"}},"1.0.0-beta.2":{"name":"@azure/communication-administration","version":"1.0.0-beta.2","keywords":["Azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-beta.2","maintainers":[{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/","dist":{"shasum":"ef756939e75c1a74d180732ec5b8dd0eeefb02f1","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-beta.2.tgz","fileCount":68,"integrity":"sha512-xj/+gB6OaJYNHTapANBK1RVljraII1jF7p1t7mJ0KmerwmKPIG5tFh9jEGpN5zjVqtyeztrQ5PVd0AiJ7MPPzg==","signatures":[{"sig":"MEQCIAs5lajzh7W2HH5nL1TOfj6ReGZlqPh92z7I130nr97MAiBG719RcvBl0pEDjkYv7pt9/amgRxeYOqwbwgqoIPIZsw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2000400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfe8JtCRA9TVsSAnZWagAAPuMP/AiJw/HhSD+EHEKBK7uB\nHeyOmsMwB2UOTZ78pKZNsMpxpvkNJu6wSxe9kOhkOHV0CJxeTcB2iERlHIlv\nDImIqFnv+jMcOFYk5HGQI2egDqLU8mRbnBcxS0ZESZ9hgraoVQNb3VfoLwdY\nWzAa1fH2VHNXiLOeUodo3IT9CPqHjIQ37dL92XqEgLpQgVxiBiL0F2jnpOkR\n2b0yB3Ae8rNHHl++nS78koLBp8TaP6h1Vjd2Nr6RWZidfm2EunDCBbju/2eE\nPikibqdw45rsJpzDWmjM1JOGGAGrbbuLN3ruab/XQyMChn+je+4vq8/E4CyI\nsm5NN903ODBIfKI5cQHlDbaHWiH3kItav31TEjjU2QTz/mhX0Rym1av3c8XZ\nw+xcR7z/EYV5OLFQkkkXIxX7C18yX3IRSm4HGXvV2dDS8sF72YVuO8zZF7E7\n00p62PRo5PXxt9XGGwKeUv04qPaH1FExGIPzvt0NPzyMupRJRzGbDnww6w5s\nVM2cZ45I80YFXIQRcx2NdaCPqL7jluNccJVy/k45tVWFRAei3EG+R9AjtnQN\nkfXkQBtS3vcVbDlwO//3VxqNqkJYaRtviK5wM0gn1Cjd4Mx7pHF//pX3TWoH\nRREVSzYTGTUIz/OzD6PmOYtHN3T3Wy6ZMnmz0NXTl/gvd4kTnEuaj6UaOEhm\ns7J5\r\n=wUJt\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-beta.2.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","engines":{"node":">=8.0.0"},"scripts":{"lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && dev-tool samples run dist-samples/javascript dist-samples/typescript/dist/dist-samples/typescript/src/","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","build:autorest-phone":"autorest --typescript --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","_npmVersion":"6.14.8","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"12.18.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.1.6","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"1.0.0-preview.9","@azure/communication-common":"1.0.0-beta.2"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^6.1.0","rimraf":"^3.0.0","rollup":"^1.16.3","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"~3.9.3","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-beta.2_1601946220947_0.23135382623282696","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20201013.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20201013.1","keywords":["Azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20201013.1","maintainers":[{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/","dist":{"shasum":"2a564024fcb203dcffc775d849f8a5a0c315ee9a","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20201013.1.tgz","fileCount":68,"integrity":"sha512-yh+/3Kk8ArEPf7W+qZg1DBClsLl2lcucY8SsUeEqMQH3q0otYGEYabuVNrM8nhD4LkbKdh9jJrtLcMMrROrqmg==","signatures":[{"sig":"MEQCICg1G/TGCOo9g7lHvpeY4YVMN+pIECvd8xAJqKVJFUeiAiAcfOFbJc28Ubh6U39RtnXBRLhirpGPvByPbFNZ8o/D9g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1998857,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhjPTCRA9TVsSAnZWagAA8IoP/izYNYYOZMM1zauRQEnG\noYUyxOwKp5r266zSI08PzANbOqIyDnlZpdPpBniBFilU4LgfikGMGKrD4iBe\nkoLbfbkJvldTeN1Hg1HFB8/HPOSvCGk5xmuXmzaNryDZciABRkdjWPEdMVMY\n1GgpGVq8t4wDCBgIKXZOsfMdeRi7lGJfWVHOSdO0k0Xcg+s43VRDksL/vFl7\nDBux2k3nL5s36GW05M/xa11aJCkeXs95kDaDGvXnyZLFBBXB//ZjXUCE9qDI\n8Cghet/ud50fhe0FO8fwHd/p9ZisANJQI2/X4hx8NTD0nSHJzcj3tKHfbG4I\n0m+Mdf66w1CFjNamZJlDg3fjslmHsbioPn4cNe4zkOIqz+NhHvVnAyVwa6It\nhXoCSonDXfqcxIeNKm9F2WXheBl3fl/pk7cJEYR4VJczOrx/n8lqUqJx4HBg\nyrPqSdIu7IKKoZYMPvhJIWaJ+V4jin08wRQIhck9h1i4/9En328FF22YnRkC\nPuechNsnpEdQcWa0aNSld+0mGCgSBtHzyKNZiv42bgg7feZAo+nM6hq7t9uF\nn++BB6aFwAhWRR3fVJ+4jioWV29FHoHWbDauJ8vN/IXMiX4eu9hW+AWgafe7\nRL9NCbwwblmj5QObikZd4zRJSmn5jjRi3SK6TfYkjAj+iw2DUHu7KGVol8sp\nD/dI\r\n=PQNT\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20201013.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes(\n  {\n    locationType: \"selection\",\n    countryCode: \"US\",\n    phonePlanId: \"phonePlanId\",\n    locationOptionsQueries\n  }\n);\n```\n\n#### Searching for phone numbers\n\nUse the `createSearch` method to search for phone numbers. This method returns a `searchId` which should be used to query the status of the search.\n\n```typescript\nconst { searchId } = await client.createSearch({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 1\n});\n```\n\nTo get the results of the search use the `searchId` to call the `getSearch` method.\n\n```typescript\nconst phoneNumberSearch = await client.getSearch(searchId);\n```\n\n#### Purchasing phone numbers from a search\n\nUse the `purchaseSearch` method to purchase the phone numbers from your search.\n\n```typescript\nawait client.purchaseSearch(searchId);\n```\n\nYou also need to call the `getSearch` method to get the results of your purchase.\n\n#### Cancel a phone number search\n\nPhone numbers are reserved for 10 minutes when you create a new search. To cancel a search, and make numbers available to other users, call the `cancelSearch` method with the `searchId` of the search.\n\n```typescript\nawait client.cancelSearch(searchId);\n```\n\nCall the `getSearch` method to get the results.\n\n**Currently, you need to implement your own poller with `getSearch` to know when the search, purchase and cancel operations have reached a terminal status.**\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && dev-tool samples run dist-samples/javascript dist-samples/typescript/dist/dist-samples/typescript/src/","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","build:autorest-phone":"autorest --typescript --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","_npmVersion":"6.14.8","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"12.18.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.1.6","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^6.1.0","rimraf":"^3.0.0","rollup":"^1.16.3","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"~3.9.3","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20201013.1_1602630610785_0.29422690728364187","host":"s3://npm-registry-packages"}},"1.0.0-beta.3":{"name":"@azure/communication-administration","version":"1.0.0-beta.3","keywords":["Azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-beta.3","maintainers":[{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","dist":{"shasum":"ee1561b19cde2ab9b41c0c2366a894ce7d13c444","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-beta.3.tgz","fileCount":86,"integrity":"sha512-JqGWH19PZKtW49Y4RfyOxmm+iPLOYZ5xP8bQ8ZhoAJ9aDzfY/UEEbmjaVPYFdso4UVKgPP6y0lOmy73xpwKTVg==","signatures":[{"sig":"MEUCIQCDLO9KEfZFShqG9KNJ8D3xXw+B5bZ4tCCx0iwTNsBYxgIgECrqq3FXul/BWX1pMeGxqSjsNmWGKpx6JlGTbrneBAA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2232694,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsvz1CRA9TVsSAnZWagAAJtUP+QGLvIVeV2ya6ARo1Og5\nqBZ8oiJz5Ip/zeG0YQM53m7GjHlPbQXShmJGoOcrz//V3C+14S0aH3RsBVxZ\nmU3AcT8aj2cePoXwqHD8VUleEX/l17qIRR4oJ2GDpeLniFd7LnwoAgIIsyF5\n2DMuJ/3sehEw004kddGf/HGnldoC/kcoDgGWareP6GjwoNhx43TgJJ6Kjf6D\nLHKQYJxYKorbIGugYHgt4vsv+aGSE36g0uaFJboobjoUx3arBVcKQwQyWdy7\nJOY+6aIgUtvRFAtiZOlnFf4YjUk9VIh6hUq5OpbPeW8aV0YdvWdVPCaGPqdo\nOmMEyF2mjhxSeC1pomczKj8X4lnR1rTWJIHlCFWSiVvYqOLmEPSUGb3hZpUM\nqNwzoC3zGkFnH3L68hTPGac31vwXSAeqtmLYM8veRPcOVQyjiCRvPbGjq7aU\nAQ7B3b2RoiLeuDAyRahV92OtVUMdpL6DMsrZtapAn0Pn5RZ2VbPMilhHT5xf\nJyTKNjBU2doLtp+Mzk/RO3XTPCTdJRQ37yUKMX1qi39GOfVtMGeOsyMqWBYY\nw3YcZR2C+6p5ebklh/hlgjw5g6bVPKQBKy0EPmvp1Lu7kKLlTkf7eF3S/eph\nKP2Qa5cYt/04VY0DtFmC8kKqPdS5Uwgm2C/qaNJ66vblE34oRhPCsP2zDOck\nQ/EM\r\n=7eTZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-beta.3.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","engines":{"node":">=8.0.0"},"scripts":{"lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && dev-tool samples run dist-samples/javascript dist-samples/typescript/dist/dist-samples/typescript/src/","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","build:autorest-phone":"autorest --typescript --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","_npmVersion":"6.14.8","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.0","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"1.0.0-preview.9","@azure/abort-controller":"^1.0.0","@azure/communication-common":"1.0.0-beta.3"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^6.1.0","rimraf":"^3.0.0","rollup":"^1.16.3","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"~3.9.3","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-beta.3_1605565684477_0.25402606326596033","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20201211.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20201211.1","keywords":["Azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20201211.1","maintainers":[{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","dist":{"shasum":"085f40c811ad3021eae9200a4332138e2cc2d838","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20201211.1.tgz","fileCount":82,"integrity":"sha512-Y7trysVSSCz66uidnVsK7RU/dlIF3wcnQ7SiIuxUeFvLKOxK4kauuafNaTR7+VJ3CuxImpz5Ilan8rJhRIxj0A==","signatures":[{"sig":"MEYCIQC9J4SKngJZeYrmQM69XwCD9iNQF5pUEnhcQNY6IV7M5AIhAJkXiear/v7izZmYmZUGxMdi8QcAhseIa0nJmHrikn51","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2226788,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf04wRCRA9TVsSAnZWagAAuE0P/3ZxLJsoVLq+OjauY93A\nOLDttHgbEaQcFh8uWjNmvTZr4Nk8FPmmP3tvkwUo3LnkT29ZK5O9GV8Hfp+k\njXd9g6Ciu+c3VkZQbmMrUW5+EFVbERq3GNd9AFkTPJNRuOG3cw9Rew6GA5YP\nD1/F3loaexTba5V5rC0dTI8zEve0phADtiX02tXOOapWOy1DqyNSygsOxoCx\nvcaTjd047bz2zEyL55IR6uDDIxRTNayhwRcMyI9yDR7XxGnVHi8X/n2RdCGa\nEujf8Sq3XOA87AgNn+6JGJleLjiLCLedpNbOjHYnpgh1e0nwP3oXOy9IO2/h\n4EP0X/fmCc9UmE7IjDH0ZN5wG4g+Xjsr3xYAixQY4+YbBBbd6C4B2qooOtv2\na0u82OvebLDzppDonk6+SGCfAKjgNKASiCVIRALpt1upBcJdd94s01v9fs0g\nWeHg12Uqvm82oeeVnWpo5Pb5rKUijknOMJRe/0YTQA9VKhaZZB3CdF7iOJ3L\nv7qFT1Qranleh26O1j62f/V92HT/4yJZKffJEm2d3bFTVT4wTnAq991Wyakq\nMkmJGbuOgeWz8jmf+4KolTaz1dgRLGPBxj46DkkI9KjnJxmUiC4yTZVF1Ppn\nYD397+QC0uYbxWQ+K0y+ujNIfc7vbLXVPxMhfeXoDLUYhEciJATypEh/NyW1\nsu9e\r\n=UAqI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20201211.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && dev-tool samples run dist-samples/javascript dist-samples/typescript/dist/dist-samples/typescript/src/","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","_npmVersion":"6.14.9","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.1","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^6.1.0","rimraf":"^3.0.0","rollup":"^1.16.3","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"~3.9.3","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20201211.1_1607699472735_0.14364225117728924","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20201214.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20201214.1","keywords":["Azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20201214.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","dist":{"shasum":"9245af25af267e8ed7b6a531bf4c955b83b75509","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20201214.1.tgz","fileCount":82,"integrity":"sha512-Zuj8UU2Q+8lkg0nRhiwHZvgFrT025ziOIJeEEkwJGJdTCxopeYgaRisckUdJtWy5FI/HkgiGQYgVccnFM58iVA==","signatures":[{"sig":"MEUCIBnQubmBUrnRpUQ99hT13Ai7dJsTx0bxSBdH4HTmZoffAiEAkxnO422kDaK1PkLP4/HcRTPedsUQjsh8fqN6qHJm60U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2226399,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf14FFCRA9TVsSAnZWagAABoYP+gKCW06B0D2JHuEY4L1p\ngodgoHx4gTnQemloT57q8Qgn19+6ttjZEb01dm0bSUiTXHR27BOdNWUguAeE\nBpYHmyIpGID4LYoAxVGWVScYDHn9AcLnrPLWUOaB7OSh/KeuA6lG9bnqcFzC\nQN6OOQqO8l4shbJLpzK4GB2HGwzMcKq07/4LribQT86PIZDwAwzIbABebl1T\n/x4e74iedO5zd5bsTcVaGAtxTkknFRKovav2R/N8pzBjiv3iPcHCTPE1Qyx/\nxHT1Nle/J578y1WA6HJfdmfyhleApPqBJ3XhAem+Q9tTy7wE9QQQVMlUly9/\n96Vqlddjy3LQ3eGvFFArvB+OfuRcuClbYDMPi4SHUQqP+017k36oAKmhW2vc\nnINfNVbkye1Ngg2rw+8w4Mbz6Biq0lKgahxrSmwXpvzqzPRuBAIL+PPcGrCE\nKcX9p1rbFQMD1aGCW7VT+7+2DyR5tgnFOEtTrMb7utlHjWUQY78TT+No1MpH\n5qRq6I2xqOzueaSuP/TilwccqSDiISupfe9CWvjYHG2WcUifhHtRxTvYQsai\nkEZyQKNTE4ZQBu+7K6/B0iWZSDmcpSX6FwAWmrNmYTjrfzF9VBioTFKsZ6Zq\na+ZaXIEXgAbMlUDwpEQ9YmjaXqNC0wr8ovaD9/VIS8lwnZVUKJNh18ra1xka\nphZU\r\n=H7S9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20201214.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && dev-tool samples run dist-samples/javascript dist-samples/typescript/dist/dist-samples/typescript/src/","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","_npmVersion":"6.14.9","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.1","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^6.1.0","rimraf":"^3.0.0","rollup":"^1.16.3","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"~3.9.3","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20201214.1_1607958852781_0.012258924882599942","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20201215.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20201215.1","keywords":["Azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20201215.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","dist":{"shasum":"04f2d92af81605278c4df60179bc83ec4dd9e176","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20201215.1.tgz","fileCount":82,"integrity":"sha512-nXS1GP5+cQVZfRfGZ6J12Yyx8PuN6GeZHl+hfEWnjVMJ/e4gbfTLDkQsFNEFXanXCJCzsMLU4ToNENV9MGybyQ==","signatures":[{"sig":"MEUCIQDYn/JYPFY2ahSg7MRpYeuvF1Kf5yuTY0667aZnOynLGgIgJBEP58JbGxczaX0kExz4ZU/1QITquh+mfuxwvpCbhWs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2231255,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2NLYCRA9TVsSAnZWagAAb4kP/Rg6rJ8+hUGpqRBkDrwD\nRNl94IXdOfcMYqPn8TxeYdSkvYXuiocexLUzWmCSTcJfYE0TUbWgGb8S62wi\n+/kqFCHxYPLQA0DZcIANWdw+fzchD8td4Zw4aTBMTLQLXAXz2K8l9CIuK5pJ\noGn6CujGKw/EEelsANdW1UNaE9SatbD3v/LOtGTuIwNNIiVf48uuu/K0FyUn\ny2/7uYdZ70RQ+77EbUeAFnVP4wDrXQvkWtM+Motbgi/P4jqZUkqGXMxzT8JS\nkgLrlrEt9XmxBthfqgqoceGelHmioZcDHo9XwWNsKReJAe8Z2Yj1C35L5kQo\nwuGFap0AUaaUjLMwiYXNOlbgLVpjV5d+HsUpoYu15ZoEtBBAQxpoCXV2hAXw\n5iQ+6yetRp7/wCOJIMTPmb4d6h9MHZlgPwTAPEn/a38AktSsF/KJXYP3z5IO\n0Ijog+5e5zU7D1yNd+lXGTUMqrEDqsK7RXMJS/GymaMUkWkYxH3JXSkqOEG0\nizcLIZ9/WBrE9w8Pba7hIoucbDQV0BkmCNUvyP0Jdh4Y8B1gPdn1SQv/Z3jo\n6BemrqdPxIn8xjLpOgUfrffnFgwqKwC5fTeLLIhCJErrzpLJ/4FtEErAFiW9\nlESMAB3x/zuRh9eKJgIplyPA+7fBSJ5fAJyANC7qLYJZLNZmXlOyovyPcyUi\nSwmY\r\n=C84j\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20201215.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","_npmVersion":"6.14.9","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.1","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^6.1.0","rimraf":"^3.0.0","rollup":"^1.16.3","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20201215.1_1608045272377_0.4690762161694486","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20201216.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20201216.1","keywords":["Azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20201216.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","dist":{"shasum":"3c6e4445107a20a478b9bceaf24652028d978587","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20201216.1.tgz","fileCount":82,"integrity":"sha512-nIUdXVpw8Wl84yWxkRD23FKu/7SM65LoS4pZ71bP9gjIIlqTztbqJz1eYHFb7R1tBq+wvsADNuHE3Oc+YxdouQ==","signatures":[{"sig":"MEYCIQC71AlozUpIDcNGhCQS5FL7igGsjFucdW6ElH8tm68T+wIhAJ8Xu377Vm4D9xnIxWd1dqiUdcrGjMujB7vnxoH1sWy+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2231256,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2iP+CRA9TVsSAnZWagAAjp4P/iyWq/mSsoQL0DBr8OGr\ndQD/rX2zNiQcIMri3DUrAfHqnb8oPLcA7PC/jZHyK+Gs3fEVX+45Rt3uTHrn\naRGvZZ38Vf0JM/WMUE8/oyzoYUqhcuWityK+PTDun7uSZjFohpfopcE2Wkyx\ntOBFJb/AH+H3O4qQu9HKZ4vyIaQLRw1YMP7h9oH/7qAo6pCGTrwg1zDHpWam\nx0F0taKMblNDo4BfwBf78dxhc/zmlz9fo0LXfTwqQPz/5DE3xVKUXSLyEl7B\nISNLIN5qk6QFJN9EHI9sGhOOJ7/v8++ThMV0jIKSUX6PObLiohge2ff8y6L8\nkCyobm6RooqAt3Hv2M1zbi2WmuR+EgPsCyz1S5y91bcpTXb44+mmRzfDtK+5\nTE1XLsTFcArh9AA486btEntTsvk4IKBZD6Rzs4Mx7DaIKqX4x7auGBO0TBfC\n7bsDBoyKadcTpJXWbAPES0122pzaGPpVki4wQJKlBSeygFhk3xZdhlgvCPvF\nFDrJfOJPeHz5G4TOaqEuZMbF5sQdt9jaP+ZxbopmRZsVhhQxdotba9b4Revh\n8c2c4s0GlxtZ962FyglNXfNdWhhrjJjkipJDgGTvEZK/kPEXou7/xIUP2MT9\nwy3lBq5K72G30iEZM3mG/2T/xKBV+1M3w5Zsr3fnoyA6pXrLap9Y1gPpJsA+\nMxOk\r\n=RWWo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20201216.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","_npmVersion":"6.14.9","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.1","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20201216.1_1608131582421_0.7557244803628467","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20201217.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20201217.1","keywords":["Azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20201217.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","dist":{"shasum":"ac121c2f6832d17f1755cfd3b0adc05d114ae803","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20201217.1.tgz","fileCount":82,"integrity":"sha512-fRK78h/vuakIaL0XEQoDCW5sEM9uiJtcFHjLE098uhxaz71eB/Zf1688cYjpLZWI0SzYy6qqN3qKwBYLRltJxw==","signatures":[{"sig":"MEQCIHWK9uVFw+Lu/OdQk4nJuZKEoqubFfKHEo1zB7xNOvTiAiBViVLl90321XVzaQJwoJjpyOpXPivd4mPIgzWaqbniqQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2226091,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf23WRCRA9TVsSAnZWagAAgZYP/iUljeC+TKudDJzC7lzg\nvDCwZSiFGI72I0dD+811CVw7QhYP5x51lOW+rFz6sWm66X4hKUJtyIdfg7NK\nw1UqzkKhmVE3MXDJ6UgtEK1W93RVwuZ4cnkHLqEbxg1RzZEdBQb1AQM7NKxW\nvbBU9Bi3hrlAXGhpftkUOre8aPNR4b5LQyYELgEX54H4QzGMsl/Holr8o5k8\ntec3nFGTEKJVfOV9XYX+L9Uo/nicnCHYi447L2DJoH61jfpZ5ZhSCI0YXdcN\nolmGb/TzcUP1YlYbN3N3KU/roKoxckUSrkxrUOOvQHVdbw/tNhYxZV4ApiN9\n1oEk7bSp5oJC3J74xR7Vh81LUWVagBEelxllEZu8cylr/Zv+me+fh5eGK8Bw\nt02CIa//JhTVCRK9f5q496s++FJwiGDW1cBJx2Qfc2aQKdxBWookT6dIXyHV\nGmOmtnSEnPHd0Iu7SH4V4W/YIPx10eDvt2u2VhQ54yKjDAfpcluYKe1aezQ3\ngbM8EqBjlM9U7G9TNpd25XQokAJTQLoThrObXxG/7f6ezuaKztXeJ/0eT53U\nOqGmQKI1m0FEAuyCd1dLGbdkPZE4TeodiyiqnNFpgq5tJYLRkvg0cm6YSFrj\nE7g5e0W9X7XHof7L7CdcUtUGUSnwUzsd3L83P5R8wFZl9RqsHrIyxiTFla+Q\nB/mu\r\n=XpQ8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20201217.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","_npmVersion":"6.14.9","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.1","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20201217.1_1608218000886_0.28900926396752724","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20201218.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20201218.1","keywords":["Azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20201218.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","dist":{"shasum":"145967ac4cd91cc6dd15f22af37b024ba83d2f48","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20201218.1.tgz","fileCount":82,"integrity":"sha512-z9FjTZOHjbqhtOBYvkjoQlgygO4buxHD+sws1aXGUgMQtfVs5XMGpQRz6KNsvCw+WhqDZ80dOPK4/kksewVbpQ==","signatures":[{"sig":"MEUCIBnKBABx6UNWnFwWlqXTH4t0JjemfKfV+cMJST0fsL+BAiEAkYCX2SCstOlkpEnLMSm3MZrnmKQ5yD2oxxM/Qz9mt2Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2225767,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf3MfrCRA9TVsSAnZWagAAor4P/32j7m/KnyBUWw7yczve\nP+RFdv19gztt33rM5nFtmpUELFoCOsq4N0DvNJoYKsLWycMx48pml/ml4Agg\nWfNqZw3jls5FU6q/+SyLFSnxstPcZLmb8G2cRkCY3T4qnZO0v21uVXIVtqdV\n3vXCzYcYT5dbI4rPi5f/Ho3SWpumn9k5tCdkXpZHygcqYaELY8nsZSFS8WEX\nSHY4Yrf6Bx/+IlcBJUQSd4Nt4BEl+2rIh3GEWjf+EpXpz3iJ2i8jsmvzfBoJ\nJF4Hq+1Y9PwdceOAW32EO4ikkJ7bdZrzDKPeY6EPa6Frhyi5ahMuoQVe9IPC\nn2X2AKhoRk/3CvwYB22gn5NwEYu/5aTdfQRT83JDVBfVDGA70QXiEYl6ggiC\nFTEMdWhed+sCho5eYm/4pCfIlGTxx1f81CxGmTNFH8aMtyoAvspYXbAQo6Vx\ngH7jNMOLBkbaN7g7aFd31FbAhJlZzqPjl+hJrA5+ctlnetLLeX8isYhzdr3e\n3SKVvoet79MSMYdO19MdeTqbivUf0dizMhL/2nGseXA96w/nmpXvuYzBdQxB\nWmJD3wPczpzK4AwhS37TVOwZgmNuWKCDs2F9aWeYv9o5EE82DyIi4UrTLxax\nzQ82LlrpwAi60tGLrZ5vec08GjJhoAueaIEJaeXeCX35Q96sAHmAL1zeLaDU\nN1yM\r\n=JucO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20201218.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","_npmVersion":"6.14.9","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.1","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.0","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20201218.1_1608304618427_0.05463922111233099","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20201221.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20201221.1","keywords":["Azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20201221.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","dist":{"shasum":"8129c914bf734218abec880e08ce700c60883a3d","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20201221.1.tgz","fileCount":82,"integrity":"sha512-PEFrHw5wfbh/COEITex97cZJrDR49A7pDoqXChWjhd4OhbCB6bL1h1o1d6BHOG96jGQ31BJAxHLQermcKIk+Iw==","signatures":[{"sig":"MEUCIFflzSeKbk1O5j6T9lpEzdRpMX39tw6kk2PAuAjcBoq5AiEAoqDZfmLgE7NKg9i8jJ9KDxc3yqRIDiFxthqlDuoGmds=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2225767,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4LtyCRA9TVsSAnZWagAA6lkQAKL8LGb57iaSSjo+2FbO\nZPiMKShU7txawH8NSDtjIob1IV+GIwAi/I2XRSjhFDBRegmXpEclhRefLApN\nI/vBHS76TEvJxL8EN0tCE0vtx6QgOMh201vGdk2gyCc2cI2th7P1fGXvO+AB\nCg/sr6BEDAR4ez/p7rH6F1XKPBlaFr9LUGcr9JXx8E5u4diz/Mr66KhBkqZM\n4IiHxuUMVTohtwTi8wpbnFjpGyynB4LYz3DM1gjf8PWK8JLAYv1lcIJmZ+1c\nXRnEoW5ytysAa4FwpuD/uQKS1z2qc8Al3uiflE4R6pVu7z9I/ZxTB9N7UdCe\nwNNi2S6KjWxkKKYV//J3RrprmuFPQFRASJ2U01/CoPiAzvx1Xf29h7OR1v4E\nacGvl2Gbx9AVkJKFnvTRQUvKIQqqS6V/pmLyAQNLhU0Nfi+9KkxIg9nXEDUU\nd86y/Nq0vnCrMlwivNJ+g7PVgMnMGgLqqxkih25zZbODQWFJoUoeLrDZaJJ1\n35OOs3pV6j83owZgzwbelUVe45l3C0qqZ5du1TyF+70GnOJIQtRL8JKiIB17\n1enuzG6YIGThjyGQjlPg29tZsJYlYv/okSZKqRKaCQCupayF6XxWjGdBMc1o\nheBbs8W6ylvvlmUj8p++mTV5Dgknu6fdhU/g7Mplc7st3+BSCttKUoaBzURm\nxUxB\r\n=xBjh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20201221.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","_npmVersion":"6.14.9","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.1","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.0","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20201221.1_1608563569977_0.15079420106876507","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20201222.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20201222.1","keywords":["Azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20201222.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","dist":{"shasum":"e6ab47690f7b8fa6c98675539a772012e19fc1db","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20201222.1.tgz","fileCount":82,"integrity":"sha512-SJSCFqFgnbVCJ/S+6FJvVN08iwjUSadbujL+Vor8f4Ia17fFvbXoWhTjSQnkpSV7BmSeD0rj62FiJYydcWYGzA==","signatures":[{"sig":"MEUCIAEd475sSC2h8OLReMhG+iYBEaYZB8EzDqyoirTAcsnYAiEAwBMddM0VTfNTPvrXdCJk9n9nrsP4R/pehQ4T7RJbYVM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2225767,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4gxOCRA9TVsSAnZWagAArNQP/0/iMHTKIZ7mF7xsdhRF\nEoakYA7zeuydIxVFjMCaCpraTwR33jpvwkrjCSEIIhVpgj9lDwa6aohVwNVn\nDeQxojnrEAUL2v0CEKU0u5+n7d9t9UtxAK6z76z0cUcKbEvFFV8k2fbIkY6H\nQU0lTdiA3n/Qdnar7CbKe+V2ZCkvfZhfKJ7G/ZPmNpikVLXOhapg/Pjbd2rl\nQlCFltsMPvhBBdznNWy1Kt9k9xU4OgG3Xuvziez+vfWYsITVVmm4+iEmJJLa\ncn4pHsvEYv9JvpzzpZ/THLoJnI15jhYDhzMvADcsCXG2th58XObeBH2p8Wrd\n9iVYKO0uLaQpmseL6/C/GoNeQ3rA1D0tvjRTY1Vq5M6YF3D+M3JVUMGOfGWy\nQRvjVR2Dthj5jy6u34W+QDUkwrQbOMFmKdGi24JxvtcrVZQaNAQdnWx8pxMA\ncY7JdnUzd9XHguqQSUgDeXBzZ8KI2Rr7u/7RXheBvjtAXAvbtK6QX6f5UZj3\nK85tDXfQPsuXT+k2KcteeiKSubtPYUjE4LreyXpB76HQ2o53natMqolMAp/K\nQVSUsIwk+j1zyET/y2GTF30C3RkZqCMDU0WPqt8NjxNfNQ060XqyyDRg36N7\n39nFCprR8LWpGEw2M8tGBzPlHvIXwkcYLqpyISdEDElzLsdWz+an0H8ih3Bb\nA0qf\r\n=VNvf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20201222.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","_npmVersion":"6.14.9","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.1","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.0","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20201222.1_1608649806111_0.8972334597011178","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20201223.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20201223.1","keywords":["Azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20201223.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","dist":{"shasum":"d91d58af9849c9403200c48b7b7bd6b55321d310","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20201223.1.tgz","fileCount":82,"integrity":"sha512-GAEJPwHXj51Mc2Cq+L6PvcBKNUS8jSoWTS0A/vl78GIKNBdlYKBIkW7VNO93GlMINJSW5NvY0wZFuEay4msbtA==","signatures":[{"sig":"MEQCIF56YkeK6jltLPijWcmBXlF954mNtlnwNKVGiOofWITyAiABTr1ta0uz6HNDESxp0Zg3rJ2mkQB1tA9znC6I0kqL3w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2226101,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf415pCRA9TVsSAnZWagAAm9IP/AuAss+e8K8ZWTRuIiWq\nurws9vVe8BIi5vhLlPtu/KXfritVgD16d/ANa7zPy0BQ3PD0aEgIQVV42JPH\nO7eMog1IBz3Uj2TZVmlQG8qMsTi2XJ1vO5BNWs5AJSHm3/PlqCnEY/w8AQfu\ngxYl8IhyWRCmavFrXku9YaXDd9bgfm37Rd9z4BbUaHEveYir4tdJf6qZaqcK\nYIfc9WUpx+vJjnkeT7amOj0Whci4hJAf7LCPziSM+f7V3Iy4OirjZ+ucDzLa\nzd1SxDIjS52NGSWPROxhvJBItTG/umhg5+pOAaXUuHXq+yeQJld5EN/FcDQL\ndJQDYoUioNJmw9FBgFVJjgwpCJ7TopWIvOGerZycEGHuagDcXU38Cdrvq0/K\nzf/Y6hJVbMluPhsxHD0CqdtgyaHzAMoOArhFaFHsXORsfvp4yHbo4DlPTLIU\nAyNUXHAHE5+Woq1ahC7i+C82VfFX23JfZIf9Ah+XgIudCip1iKIiakzbB4CW\ntPhTH5Y9bSxPeimexEjBfytqu4yXeVJvcToWvcPDlsHDwC6wqfkfLtSzthAR\naQlg19cdlK2Ktb/DIXyXuU6QxZVdP7iGao6fCLaQuMeX11aqFeD/9cttjSSG\n+8O/U7AOhv3Feki7hZTPAn6E9i8AgrsJ1fuga4WDxF8QpAP6KQmZC2mQASKt\naGsh\r\n=pD0T\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20201223.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","_npmVersion":"6.14.9","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.1","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.0","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20201223.1_1608736360634_0.7324877187884156","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20201224.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20201224.1","keywords":["Azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20201224.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","dist":{"shasum":"14e75b44b169228c476e8952334d8ebc5b5f7c7d","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20201224.1.tgz","fileCount":82,"integrity":"sha512-NrgcrOxXKyGjRUVWwGgMh1uzv5qQQ6SeW6+VyK25qOhIk0wvCijetbu76OLo4bPQi2aWsU0tjse+ZP9DusE3JA==","signatures":[{"sig":"MEQCIHS4jWrOhmSmiTKvh41a5MELK5HWqAztBliZquuE5SIyAiBeeF3TMGgMXx3np/nK5R8l6LrfN+ezUlYo8XUTkjkJjA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2226120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf5K9hCRA9TVsSAnZWagAARcYP/0bWRFdfRGdnBxASO2BQ\nupq1pp8BzIzNtmYvmGYJNQtY8Hi02cARwJtK4yiN7ROLQoiI8mOaeUToqODr\nJuhjQngJxDkbn9/rTXs5JeZRa9LIlMLEO7s8eMb775zyyj2tlkQSy8NXmT4V\nkbohtvMw2UnPBNfUMqF4rPHEvZaO9cFH/FBGbv3rJLKPuoFEFFe6SRB2e5SG\nUDH5rPufvzIszDAAQmRZzteerLwu5FDGE6DCNCC1OC7RRot+4uTVQIGsw0d9\nL8pATpA2P7WNyf/RQyO4FZPpS3v/Q3AJ8OJoE1+U6Sl0iKjQ1zcSU1eIp2eO\nmzXs4lpehgWU3kFtcc1AcGeaP16aZcRJzPMlXZM5Tlj62kJlCMABYlWuexCM\nsER6fn9/F48nSRlS6nBax282HgoO9PRBwHo55tRLk5Z6Hrpy8drH/HRhePWr\ncptKRQHPYqZa7vj5Kt+0srWnMCLoZ0onL8gPgcz0Vl9KrKCPNgAeHXjitj+P\nm2P9XphSHfXg4l5WwNeG9RNO/SYi5KwUN5NO9FRB6TpzSt30KxrI0Djmx3Ub\nK+j+YIV5ZeH8iyovLT18q+qn1zTLJov0ZhTkF3KgfqNZYnBw7YP/8Op8xM51\nHssCFt5qjDlcwihkvl0Oj01BY7xWBIttH2dWd9As2nGZmvdy21RgVrV4Lizs\ns2Uf\r\n=usvm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20201224.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","_npmVersion":"6.14.9","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.1","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.0","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20201224.1_1608822625230_0.42751013964677465","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20201228.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20201228.1","keywords":["Azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20201228.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","dist":{"shasum":"18d7c1b43a5c510477e11077b21abd16b37b2962","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20201228.1.tgz","fileCount":82,"integrity":"sha512-Yq5akkIZFAPmy1bOHNW1GUrT0mD17CDc/QXrmGRsmRP/tdhZLkJNPU8DEg04c0gCBRO5drw66JenuVTi1nHXAA==","signatures":[{"sig":"MEUCIQD+AkpbL/BTUfI08/Vm0j1dFW1H+c9MAM+c99+6A4986wIgN+TQ61WM8SZ8vgyfa6so7HfRsyiykOgWZ8sqt/nfhpk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2226120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6fVmCRA9TVsSAnZWagAAt18P/3w28Afby9qXuFcZXRw/\nAaKzJSzs8GL9JLWh3/+rhlbLgDCE1TKgQIZcLXmZi6QfpDRcjdPGQC+HI27b\nHCIRX0gzq3OwWoqr6QeE4YNq+OF2m85rYMnj/gffuZpS/6CBC76cPEbC0ZGF\np14+VYCS7ePiEnK5Utjo+GxLTujnA93YFsMS+0HnZqRS3Ne1PcUhyl1h6e1E\nejOeyRnDdlzNUzy3HS6uHxuPgW+OHpt0cQsLJccUVtGDGMSCYHpuakObysKr\nEg+X2rhfh2wsv8Vx0gIn2CFpk2aAeU4j4v7wKoGzhELW5gWs97EcYngN65LT\nFuEdUqWg/POs6OhvIlW1+uAM8IOhfELqlghP6i+j57JXZejeEMpde7J74pKj\nFYHsJzTKAjNANigYtG9WkoKpXnsQECU9KJPIZlPF/ughwz7KNPie6yAnOhpC\ntnFRfX/oybSjVUKctpf5BmTyDGQ1OB3bMnnk1JOSZuUb7XliAQrE3UJ+++XU\nOrCODzJOTEtGyKeqbZwxrJaQIU/88lHiOTMFCFBvyd3flXMqSbft7qyov+n5\nbFeKTALrU6mTXDCN2pzL01WMP07lHO8MYtAYhCCmh/pCm50tNSfDYsRkZL1L\nTTL1HCyVSza+cqYt9OywVi9Gio2+8D6kYzd+k/6whsJetQk+oeQFVey7EeP8\nCWYe\r\n=leZq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20201228.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","_npmVersion":"6.14.9","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.1","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.0","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20201228.1_1609168229912_0.7904323634803594","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20201229.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20201229.1","keywords":["Azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20201229.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","dist":{"shasum":"2f5531e42956d89337b0c7c1e995b26fbdd7b04e","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20201229.1.tgz","fileCount":82,"integrity":"sha512-WjuCIofi2iKYPCvbJm6UOGpx0G0x5Lyh1cFW+JJflcgSWzZqr/aH5oJvwHj6MqnlhjkcTHIfRb1f1ai4mK4xeg==","signatures":[{"sig":"MEYCIQDHnPKvSrBXLVtpCfsx/zcjI+w0TBf88JZChFCJr6BJNwIhALarNauWrpwin4yaP0qCS4YeHYOjcUwlPD5CSgpQnwHQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2226120,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf60bGCRA9TVsSAnZWagAANaYP/iclqiZkD+20XzmaLx6m\nlWN+DhWCTrqy51LSI1snAquoxOSuiHdx7cH01FkbncInclEC5+rHtYKyw4mK\npTgozKLFv5qIwCZzegc5fMZXjn+/rKmm55OZuDX0kdDcZlQvDRyJkfgJdieI\n+q0pnkv6o/kZoDSawDoNyOR24L/QRuA4QeGwKd7AFtseviLKl7P5oLFQ9xvD\nYI0lDVmHy3mwFfA1IFS8tPWfnYxRW7VqdJ6lS8JRaGuPhdiP1iFHdg0XzASY\nNrqwBQDVu56H3QmqriXNXIp0h43+I8Uqb0FbkD/OnI7122+po1IjzGLY6Pvo\nQUXs/nHrrvWGdh/0FiTIt5O87PFl6wLmOiikjprRRTT1Vabc3x9ZVjr7yD5Y\n7JHIAJ3UuiRa96iV+B7cIeVo/V7nJkpH7gG1Mf3+ym5r1V7YkoTYOt9RxXQ4\ngSRWvEd1ooiqfUIt0Si5bQie2piz5gbaClXNZInf1wF/cXGFDjlcsAEI5Gag\nbAdpsL70Vh6MfHqcvvFhnS4liHzcMweDYj9dZ5ELimdpOdAEtHImpgKuCDQc\n5qMsPOaRSIlwJ0HSfbApTJIo3MNj31T1yVGKShcqyJXHNeCi12E4CD7ZqC0V\nE90giShZtDKC75/m50fc7oRrK+jGovCwBHh1q7GCC3Vn+PKFlRfpIsu0jml5\nYFxQ\r\n=VePh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20201229.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","_npmVersion":"6.14.9","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.1","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.0","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20201229.1_1609254597686_0.4584337010482167","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210105.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210105.1","keywords":["Azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210105.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","dist":{"shasum":"054643115f74d63e9e4ee054702442220ca052f4","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210105.1.tgz","fileCount":82,"integrity":"sha512-6QeMBnYzHSEn+yaiqcRRCmAfNASYXk6J+PQX7Xpv5dTAJsRPBmahoQRWT6tELwxZFjuqDc3ZPuFu78TaghxjDw==","signatures":[{"sig":"MEUCIGMCW0Ww5qyid0GifILSRJOGcbibNJlpHR909qfs0YCMAiEAvX44Du6WVuvdp8FOeKyp8DuTMrBYG7VjFp0Q+qGUT8I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2227182,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9IH5CRA9TVsSAnZWagAA9QkP/1JeenaJ96uEQL109L3i\nMwtlSMqGMZgiBvTVLgO6YaznaOH3OM6KQ8lgf1lWJFK6MbMXx3F2hNlfnB7m\nZ5BmxqWgYMcZW0L3QjFWux4DjJ+O2+rcFpncaBE6arlv7YvCih7LdTBPWe9r\nUxwLod0+D8ssY6LHUMhHrJf4swxJXSurmZUCp29uxkzJ1WXfE6Tpt8vwJc26\nz4E4pXtUE/8ndxm5FOUGpwXzQPv04p/zWL5qq5KGHOb7a9y2OhrKzGuR3Pi5\nEyovjn6NJSaSfH4V5XZxPB5MGBNuXyLTsoCEFwlMKAc1jBf4aMrzHGtA3qYw\ns6gIcXopRa2GR3O85/HsqzGtd9bpP84KzZ1hL5nUOnXfJielnfNKmf/Lz2mG\nZceumPTxqPGvoNSuwt0UhQyweqoW3j1wDiGKqHOiKrHSE8AFRg26+GGaMHj+\ndnvSq6yxqC4pg8lqpE8UhOgPu6bN9Sg4FEDgf/VhEl86yKqjN3diV8Xk4345\nACgX1UV8yMiNJ3yfNhvNlfSG3LyXi32nMibqCNapPg0gdGLoJc+qwcqs+XaH\nnneug1A9Vqwmze9bvnYJ+vPZCPVXUr0Gj5n2bzClD868FMlWXnLCSmi3CvhR\nwVM9l76O+GoYMWdWZ3br7h4OoVFP/qbuiBDTolzyNZENRCNLoNxX2adBbEa3\nTCCc\r\n=apNy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20210105.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","_npmVersion":"6.14.9","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.1","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.0","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210105.1_1609859576185_0.5528594757804057","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210106.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210106.1","keywords":["Azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210106.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","dist":{"shasum":"6147c5e8cde247689c2c5d79689a3c568a289d44","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210106.1.tgz","fileCount":82,"integrity":"sha512-2QM+28Tb3Yg13GpeU8aAKkHxo/+ZIVE4b41fIupwJ4mP6/tYeeLwd2f/eydOcsrYmeXPwa78kw6UBxCjg6y58g==","signatures":[{"sig":"MEYCIQDHa6gIKnQVPnN3+BDlFL2+ubkmn6nTM9Ly9M08ay7DOAIhAP4q26oRABpks/9vM9tRmQNG9iz7UvVFPLkShkgpFWlj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2227172,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9dLWCRA9TVsSAnZWagAA9e0P/A/KmfyvBqDpggu9uUNo\noIrB/SqLfA4Y5YBVPOIxjALc9J0gyNMynEVuWORKq7cUvKBCVKcU/0CTbnSP\np6NV5HKqUhooB5+eWQDYAWV9S0936MONJLi/28ju5ynPYicow1MV/i9w3qW3\n3z13TXqZovK651wOackLyVEaobnwDRTWv+wFRbMymslBCh0PHHnfNDVv5kvf\nfd6LQRTkWvckOl1q3ECqAVjNaKl/K7GiOemrqMduBZS/9ntjzR2cPjGfJJsO\n4trx4hV197SKj4tvl2gPuX+aVv7ryJMFr0DtqC8+R+7BLc4+qeb9KNXroYtx\ngCd1Lkgvo/PcFzR8pec5LuIkPwGkVIXeNgWZxm1O52/nXYep1+QeRPTNCM2B\nESe63FVHFr/Oay8hRugJMu8tUgDGnAIr+CsYBSAoJKqaf5EGHWwYYG6q1O1G\nfDYIJmOBfgyZ+p3QrfSeauygh3FdFD0ptesdw6cGWz3aplSb6HZLNLJp1DTy\nXhJxg10WkgRstml+8+pdqHrD70cetB0LBXApx+nDnoa+xQAkpdcRnDsBk8I/\nMV/Sg3V26GgVJqAddZJZwKptHeTxQ+Q5RMqjYPG5b/SqMzP9z8eAylWQLOVi\nzVW+I0X8c6b3v8R+ceR58qpQM5bOfNO8j3udmIvXSKVO9O+BZb17px9Jrqdu\nLyNG\r\n=4cxM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20210106.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","_npmVersion":"6.14.9","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.1","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.0","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210106.1_1609945813666_0.21163075195570702","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210107.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210107.1","keywords":["Azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210107.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","dist":{"shasum":"9e5c9fdcac10e3947fe6f506c4c867ea3be9f40b","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210107.1.tgz","fileCount":82,"integrity":"sha512-bWjHKo9shuWoQ27Zo3TO/AyIDU/tGoxNcYLQTo8fsT03iDvya09zgrYxSHZHZFyfHkydFPXJNx6/D55wOf0oIw==","signatures":[{"sig":"MEYCIQCUd7ztHNVbUtoyzhQnFKEc6s82KJXm5VnqMZ3940pXcQIhAO+/pJ/O/DOCFgoRkQAdp9k8Qc2H1aqzxSMbmReSjBSs","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2227172,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9yVnCRA9TVsSAnZWagAAsi4QAIVnW2B3XW7+etH9K7BD\n1U9aRmk0XD6p4kyXwIQx02tVIn0pZAyQ7rnpK8k3PmpQwBsUnzfjLxMilBLB\nwiMfIqvZRXegLzJc8TMBvFIpzZv60BqQQtahJ4rPZ+1YAvZfnJiR9IJzmbRD\n5eBARmiktQjhRdHHHpNqzFoOnYQ41EW6gd/MpG8DtDp+i+uTwlChZzEQfIo+\ndBVhaFItqPorZqzQMb8Z6mv004pLqJaoN204fDnhXdCiRH5eH+e2RS3fTb4t\nieqqWPhRMWk/h0ZVsxClJLkzSvdhRFKKTXRx9XfZ+7uzxogbzWRwYrFO/hcF\nnsSN9l7M+LDOKoDwx9+uMhLoOmITBmITASIytypxbasDdXbu4V6WwyHP5NwB\nV+hlEhyNddgr2D7IH0rektUDLZABzinjY04cgsSoN86MYnzqhL7jzCgum6DF\nnYSLyzreMuiHgwcQzVd3sp1f8udDv6YX57d6XT71JhFGedMLNFBC7PQUfOYC\nADcWSlLIfmcoP+ZSM9nVbOU+QtGz0D7EhhfvG1PJsKOuFpgn6buwy6eZoY8p\nZXLC3EywUTi6i1SuW2kHnS4fChwHCy+tTotzrkmJbBBt091Fn0XjHYi5WGYo\nDmPn2NfmnX/X0rtNylgqpueMKvFjCHdkOKc3r2VzLquABUG07tjP1JAVYMeZ\nzxJt\r\n=AZaM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20210107.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","_npmVersion":"6.14.9","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.1","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.0","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210107.1_1610032486558_0.6036528049216676","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210108.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210108.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210108.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"92358f0868f6fa96825ad146cdc3108ed0b6a699","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210108.1.tgz","fileCount":82,"integrity":"sha512-v2KKIwhWsstsubyltMfEzOu7pxWsvosKWbuH8zibRpOdbGrTt0JDxmss1GL6zF5SJxlhgfZPjKmwz9m/JvvgVw==","signatures":[{"sig":"MEYCIQCRuHaLAP1kJn88GvXUSJ5S3Dh6euBSnd1wlCe7Ayf0fAIhAIB4Nch7IjTmD5Nk10kjx/b5fTH1s3UFdgB5Kemne48G","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2227300,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf+HaQCRA9TVsSAnZWagAAKvkQAJVlQaL8yc3EAdT9BTDi\nvmizybdHetWyBayI9yLVWz8+pYDq4J0FZuKXaMVzzgetb0TtTSqzMfB7ZHOd\nxiYKWpdOTh1wsvg/3ZhsEvl78XF2Br6P7nSQa4MGGahJrUMmRkpTB6fFyo9T\nVxpu3oZ2gRtcp7u9m1jHhXE0QzbMvY1w6odb+rxbHHRfjgBTQGZTkOKWVlac\n7BNpVM9ONdbTl9JkVQXec2wktFLCkN/tlbLbmtExIxDlHK8ftyXvvUWiCiPp\nckRYnLrcKaB6mEtq3QaQkFPdMAsqNH7pJJ398y5FKvDteHpb12KW50heQJ53\nFCdBMYVXT8k++ODkItMqLab4RxX+wFEszU/YuFQr1WjLWMZrBa++Ceoc3aae\nxZccYd6w3++eTF1EqHGOBmQbKHBjr4XYABc2vqMjDl11cewlgzncIZjKS3WG\nq9IKFFMUvlo6sDDTIA34ElIsycBfNOcTUFhE09mjXClUbdFA4H1HJ3nj3wM7\njMUdW6zCO523wI0TAlOPDfh9lZNNJkJy5G/ys1dyF3kypDDnmlgcWyRcAl+7\n9AGinTL5BLkrFnuVLFccDh1AJDezlEYthk7Qhd33EXagcV5KfshiHjVgWUCF\nM9WNKsVHN5FZjoQ7lIMoN9a0HhzoRWxM1xIeL09kr5A1wulQD8t7cvcr1OPt\n8m5i\r\n=GQrp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20210108.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.9","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.1","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.0","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210108.1_1610118800077_0.8889182824450541","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210111.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210111.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210111.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"5b13140e5d1eb81edb7847aa654b8c7cae5fdf2c","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210111.1.tgz","fileCount":82,"integrity":"sha512-dELV0VHwNgRdz0lvFXnPYubF2rvBeKi9qlDbgVz8MSnej6BUgnbhNFO+NFdGvT03gxoqhk68Qnbrp9m3Ddftmg==","signatures":[{"sig":"MEUCIQDZ6Ef9bPEHVCESGiWZE3LuGdjtb/+AVp5Ih99MMngBWgIgPE1Qm8JcEEnV/u52DN/MVm8Jw6AYIjS3LsymSSXftpc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2227300,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/GtwCRA9TVsSAnZWagAANbgQAJNUkZp+kBiPd19EOns+\nqad7SpseAnyVIwRyIX2FaxCGQqvAMWGXN5+IeJ5Mo8rMwCt2eFzqtMrHIE2W\n2IotKrPqZhFomLLf+9FfDEoeDLEpmR7IihJA0ph7bP6Hdx+yPlx4rdi5NdkY\nv0zA19MqpHtb2pcZyybpkeejqyzQhCiSfHHuFZ/HlPQJgSFUgZJNndCtJMnc\nw+vc3ZYgVYXLm3k9dXqmi5/V6wvgCaBpLs3g+AT4En4jgAuLqshNO3zMPiXV\n2e5DnzWFmsL9AS1D4Fg7PD+CXyVUk0jZhBDLGCA0mityrl8VSfErss1jRc/x\nl0ukh7b1UkvK6ZigcHWQDNiY8SYptf8RWoy5HD3tFXr5WvEvritx3SvSTI6V\nvd03R44+YzHJSYvRpKYhXvQ/33m6CC4o22pjDcyy9cZjsaTrJbQxiZ9wwzh4\nF34cQq8wFT6ZVgzsoUaXJehzNyUsAFq9o+ZdMx3efbf4Rf4J3fqypVLqEjZ+\nD4YkeWP5BeHG4fCs7b9g1sTay0Lsr3QupXSRZ6Ri3rVQMch3MrKMKia5bXtd\n4AiH95j8l1f8lCE2RKFKSEYhFi0t3CEP3ijGiVnFx18aSNekSIgjBzE5gcap\njDnXYWq0XpBkFXDwj6PQNF7QPlOctEm9XvpwruIonylLihyWpgfr+tftkFBa\nr/oU\r\n=158c\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20210111.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.9","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.1","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.0","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210111.1_1610378095450_0.32294340721126913","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210112.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210112.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210112.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"1aae1ef809bfd62eaf31b463f9861f5e782b4b83","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210112.1.tgz","fileCount":82,"integrity":"sha512-V/V/QkPBYNTY08z5/UgAN20iMBq9YvRwNdaaDr2o5KD1nXnl2jKUt6GR5RfZcyFcj2uWZ9lMZkkVKjDBiOyCkQ==","signatures":[{"sig":"MEYCIQCu3ubpPNlF6bKtX1Nt8nquJPx4p+FVBM9kCnwQ+/DetwIhAP01lcKlaPfI/yusHDKgXETAStTKquRj8GQGJhEZ8v9J","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2229472,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/bzuCRA9TVsSAnZWagAAQsgQAJmYHb9hx4+QRSGKlPkZ\nFMYCk+gEu6PrZnuFUmHBOV93sSQ0LBFGQ3SJBTGy8tZkzHP+Epbu57v0cQSb\nHMGCQRL58592Mp6ebwcbjMdu0EWYLHCcZOvqPlROXmVVqClt8nu5lv+h0Qte\n4d9NPdJG7TdaDrO89kyzN93NbE9ulAWTeljW/tYXb8lTSsARq0H2i46DQurs\naplijvteBRjm59gwnWjaFWI+CrR4FVpnIhHvHSsQvpVNbuwPo+8KTc/n4mWo\nIQgQU8lbIf6iuQbP+Eye9QCIjCMg3diZiH4yVHttcztsNX+b+bNBcT0F5l+h\niCLDbqKshJhNXjPwD2z9tcCcHHvHmJCYOB8qYCHQRCX/MiG4Oau1QEzonkDU\nS+RBQOCpoW1OvNqzAaYNajuAUkxmcrvw4/ntNyyPzbOhfzdcC1haiqK5MfEi\n8cs/HIDjVBLIy4+9X6cF6YAXr+0PywknuWG8ENwlykoq7AOjHHl7uQkLDztK\n2JequKvpf3mhhZwrdHBy3xRqxbDLZMN1JFlde/zDiHyXtPU1VyEmXs12MmCB\nZA6En62UamY5oUF13KuGPzaEpYutI96pMkZA98vYCAz2EJWxataR0TDhQz96\nfyT16fcUYOjSYmugqYKrn2O1nRC30wHVtNSCc1ClNWwRrW3tJgz9k0xPuDYq\nsNsr\r\n=iSTY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20210112.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal] or [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.9","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.1","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.0","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210112.1_1610464493708_0.997826084625578","host":"s3://npm-registry-packages"},"//smokeTestConfiguration":{"skip":["releasePhoneNumbers.js"]}},"1.0.0-alpha.20210113.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210113.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210113.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"bed875004141d23e1caced10d554ea26e6c6cad1","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210113.1.tgz","fileCount":82,"integrity":"sha512-DZ9g4SsfwGvr+ihb9qXMhs3lJthSwEl9JPWnpi7yKohU6q8jrDaijYNPGRS6HLADE4VzBPRbRAlp60teC9imJQ==","signatures":[{"sig":"MEUCIFZhm65ngOxQcvTuTUNFB0Ni6Pw4Apao95T0vqdZh8qcAiEA3PsELCUatbe7cFfovD3mEetEpLG3JpNqvi0CyyNbE/0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2229539,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/w3VCRA9TVsSAnZWagAA69UP/33ODOYU4g7GPkdcj7F3\nvJvMj29gnMzCutAPRBfqysFO6RNAYN95wvV6PNXbRQBC0lUQNwOjZThsErIc\nq3WxN9Sb9CCxGlrRwE8dRjgybYIN6kteFUr2db6N+xr2iEosP6zJK1eyDr15\nim3uM1HrB8acHJd6OmUk64nLrRA4t+wJlG1dtiKB5pQwdukpTO8w9tGCfKCJ\n6FasIAWLfaFisEN3vbOvghMorBnaZK4AuiXrCob93Zuwja9PZZA7Aex03NK4\nyI39cjV+PnWhLBErRSGscG5YAA+rfBDecSb5aEQFLALs+gdbiZRp0Bp5lwIt\nDixXFeN8KyfKPSpiDLKGPGZRx7dDljw2YevkkKKirFRNRpF3MhzX8a8xQSUA\nlh0eoy0FeXgep4IDSlPL9Z2o5V0O1agjOIaSmtF1d/X7hIDdZUPi1CHeCdZx\nyFt1i0PE6IIUqG8FAzUxBsiP5chldYevCvHYwks8+iouqk6lnZ0PH7fnyw3Z\noGQDe+5MoxE1Z7d6mDKkjPZzIAQDSKzXHJ8S+MvdyYZkRXj3gC5hVubfdsOM\nBI+TomjQMEn+uMvr28wDsZSdjRtgnAoC9sl+BSRTn7fSoMud1BiAulqCcnrP\nbpRb8FPxfkwCAFzpKFZik3e/EQUOyS3bcD4vq4lgZVReCNSdIYWHdTN3D0QX\nNOwh\r\n=nuzP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20210113.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.9","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.1","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.0","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210113.1_1610550741308_0.7391918655331562","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210114.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210114.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210114.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"6a4e1bc4aebd983ddea81f65904467991cacc88f","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210114.1.tgz","fileCount":82,"integrity":"sha512-JMzz/oA+kYGJv3GaqH6Fek6fwm3NZl2e8MC9/simq7cM8ejqt5TZpzkcFIgax980X9fq3CToZvVOXdeOZvPa6w==","signatures":[{"sig":"MEYCIQD6Qk8uL2KibTiFpoDrjKEVGI6y7W6qvuiSosU5IQYC8AIhAONTcTdQRvilSD4eJRiOI3+hVEXcADslj0cDSHo9j2/I","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2234819,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAF+3CRA9TVsSAnZWagAAbm4QAIAmah5o4I0qAG0VL6ii\nRxd/r23jhSjL3ZRKCPPmj1e0L6AgFsz46phILKC1eQg81O9ytwT5OjHN9s8t\nqWER2Adk0F17sPmMFcwduaAvFHt9kNHtdL3LTkFSIWM4kANWcBhxv5UGkvMM\nE9KUXUJzd/ZfUtqaBS9A1VDqtaCEgxI3fZrShI1efNDGPVdFbX0pi5Yt9fJH\nvwIwdDfdHsShHwJD6L20T/Bjp43HoeR/mUDxhk6IJDAn4I9N29R1/4DEEPWQ\nIQaiaTqIJS+UyhwpfPvTMARDQX+4htpHXQB3CbKvpZOqBiv1RC0KoIrgmNeY\nY64eOU3EErgoT8YbtdEWtP2phCAx/IzHIjOXK9UgofyWhOPhpmHPLAC/D7cC\nWRCvjuI5yIWEjU9FSEJcvYjV0nlRLwJQRLiLkJgRxDA8LQai/YyVhH10O6QX\nhoq7RMjTIMMtFfv1qw6VeXBK3J002ik5w4VoLbzeuTNHGNtVbSZY3J3N3GKK\ng556zFSmr38Kft1TgFq4jCTVGLfjpr8rxWjtyI0j9O9ThHQsPElsGXo7Za0E\nLTfYrvrmsmkg2MsNXvncfduMicCFW5AAwnmYbb4f1kKGWebN9WiRkqDRWLOe\nhE3XkyIx8YcSRnPqqB/99Pe067oLhtFDKRfY303rj55BwbwY2BxAnO5Na4Vr\nI8XL\r\n=tzk8\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20210114.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\n### Using a `TokenCredential`\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nlet credential = new DefaultAzureCredential();\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.0","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210114.1_1610637238590_0.13075304235803697","host":"s3://npm-registry-packages"},"//smokeTestConfiguration":{"skip":["purchasePhoneNumber.js"]}},"1.0.0-alpha.20210115.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210115.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210115.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"85158d35ca7cbbfc02d28f7fe5ad1e759e255a01","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210115.1.tgz","fileCount":82,"integrity":"sha512-TkT1WkRyWDWEnstMu+X4uRRwurOqmMfLikj313cS4PS7aY9+RGOzYIReDU9+o849zkwUhNFtWZ79kx4ZZVeHrA==","signatures":[{"sig":"MEUCIQCKH4r++VeEMtcqb/uMDwE7tdtrOea/1FXaE7pGHkB3CAIgRcCefkjM/Zf/aPl9kTABs9VReCARa3vc5MoPArsjytE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2235556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAbDaCRA9TVsSAnZWagAA9TUP/281RBjFBv/jeiYUMUzQ\nGYSmLKJnmYpxur3kaFi0tt3qJuWfHrRdQfCEASlpx9+1rjqHOML+gmv/3PjN\niAVw34O+yGRMAx3dxv6K+1dMyCpNQfcOF/KLQeBZzE6d0IjlRdxNQjbVQat/\n+vvLkJCL8zclfisNmoTjyD52Wk75KZhk7EN0u4YtPeWZ8soMXAqHTRNBeFB+\nb3QY6jkzF8ni0QebPrjI2VYiI9VIfRf0j9INa9GyZJwA6Y5MzVblzCcjT240\n5v2hulUrfKpO7fRO9qidy3HvYvunlSGLe4E8eQ8xcXFU5X/4YtxY2OTQopeJ\nFSQnly2IlKXTom1XeqbsR1Kc8Zx72ray8JwO9NjPzaUFe/C0BbLfiUNExsBt\nNfvxBkA9wgckEaNNdnWIvuz7FsM/dHucBBLHf7zMzMOBlxl1NTyzJgIjaEIT\nwNhoibi2F6eomf7LSQqmPheEYMGz7K35f02Kjf/PGIcEemGwHl+h/GUXHGwH\njfk7KtHgaHCWJvur/GuT1nH7z+1wekBsWx7m1D8ht5WozXXw2Sgn13aDxcXA\nd4ffobdyjFNw3TfcdiFHGcpG0uq5YOc+OEjNlpDRL4Zr8adf36bCfNAD87Qa\n5/iGeROrhNZBfTwYM5cwo83xqQftqf+DASjhxu5SoPtUCisBmL6XBlSS+EVJ\nyOfq\r\n=qzqP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20210115.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\n### Using a `TokenCredential`\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nlet credential = new DefaultAzureCredential();\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.0","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210115.1_1610723545972_0.6235128936194121","host":"s3://npm-registry-packages"},"//smokeTestConfiguration":{"skip":["purchasePhoneNumber.js"]}},"1.0.0-alpha.20210118.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210118.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210118.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"87e614cfecfe0ce8d596c66a11f70dcdf73f0617","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210118.1.tgz","fileCount":82,"integrity":"sha512-vXtRAWrhJFoTJGPv/ddTDtXFr8B5QvzKzo7Zptn9ZxsBsgDX4urZk9Z1zfoVsVwjy+0oUV6UD87R7AruOkWrgg==","signatures":[{"sig":"MEQCIHJin2Vp5CCEVzq+1aVsV1pcrpcXkrRm1aiBXOuZxQwQAiA6ZEXQwLpAXexyu+FHNwMvtP4akaRlzzHD06MZywzQ3Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2235651,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBaV2CRA9TVsSAnZWagAAeHsP+wc6NNJ/eXOMHS5wIH1l\npPxj4LfFY10gM2/yRjKUMdd7hLjzpMhFdf4PM4c9xBpYX7+oRpqHI0oXoX7a\nm5mHzCKxntf6cawX13wKjjJGElWv9pBMdfy5s1O7HsqapuAbMidAskQCH41b\nu15ZP7AOewUly3m5bx5fg3nHqTqQIsopRirQ4jV3EjoS6iAHqtDJ2d2NM+bk\na9SYazsk8YW6Fvgqm15S0FoxoH6WbD5QgThxK4eqdkABSaaR8L3Es9n37MCV\nc0oT79oy99kf0vaPD8NZYIj9DJxk+ySMCxG7eHAvfNoO+BpOzFpbR5Zfbehg\ndPpcnFPeoeGDsw9AMWOlpfQQnfCCm4oKd9mUs1pppqF5eK3fKk7iPHfWXYXm\nATfaFw0SFBX1xp/pntCSuQHj8b8w2VXHbLIOdnhPuuaVrGONZGaPSuCJ153u\nzB6sra0tC5xzU7p5c+QTJEP+UBvqbTvGGwSxOOgI8axzXN1id3nflHz+9xPm\nzrLh0l8zjj85OmpI2q/MVjuvkSzlYn41IbGZNPp+hflnYcOSHrqi72gBdMF/\nt5+NvB2C5y8H1cxuzlLoOm4HAMybrk5JC3Af8IxdkYuE/3gp5ZwSHEiKvAtl\nuaa7DwNPdFchw9pr+Q9wPg6u0fEGEjLlAtaHFeNZbRZFQqM3XSw5qfPNrgg5\nATRr\r\n=KEfx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20210118.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\n### Using a `TokenCredential`\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nlet credential = new DefaultAzureCredential();\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210118.1_1610982774143_0.5642263873328635","host":"s3://npm-registry-packages"},"//smokeTestConfiguration":{"skip":["purchasePhoneNumber.js"]}},"1.0.0-alpha.20210119.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210119.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210119.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"08333d26a69120421d6e46d62b5a543e306f33fc","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210119.1.tgz","fileCount":82,"integrity":"sha512-LSLRvh5gilPSuHIxC2Gf2M8WcSjESujAJpbWytuDKCaBGkcVnvJlzUR1uBGA81uRxGJ1z3Nd3KAkjSjbPvus2g==","signatures":[{"sig":"MEUCIHDDrr8rLQE0ztTnYfbghKe6UqaWs7Xhxe9cIaLqWPceAiEAqifX9E+EeH15ad49ycHtf4BH7HvmaxMOaZRedc4Zdf0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2235651,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBvdKCRA9TVsSAnZWagAAHQMQAJiUYSwV+JNysyEudsz8\nBgp2s8r515HKmzQHXJemPEePpPrQ92u8emx6Z/OqNZKDtuVmrYT8Cvorsk6I\nhD27DbYfiYdheIGLsJqDalzgy70L1Eh+MXDPitgo1iMs6noB/Dn8vqrnVaZc\nd971rusOuJE+yi8VQBZhGu0aE5lCibxdZK5kW1VXjgXl2rJjdXitDbma21r6\nwTCOFFt/43iA7XDPzYWWd2RuDIanvK+SDrR+6ShSJJ0f774Pq4f9Ttk/oeqS\nHPe+SJ6YAZ9aV1KK4ugHQFiE4ad++P8lwAj+MhsTKsJ819MGHLp71YRTbqMh\nQq7AdTD8E3uA2MA2VGDEx11GuNK4+qWVOxRZvvWqsRf5nk3Q5zpdMlvnthCk\n2O5w1RD1oLCRvptaQS/2tQcMfeXoYgFUkWYsQAzbscffWqmykBZQuhEdBnje\n5cqtTol7YuI8f2F/xN4UTLhcy529uuVpPpkYSj1gwG3N83c0eeEu9EfND6Uf\nBZ+mCWpGhfSXukaID0Mrc6c1P2lFrdHgVUr9LYDJX+zR+U1w3nKxu07TgcTf\nf+Nteq2m+kuaxFlmkJ8sN+nFTj++hpb66AlcP6HEZGwZy2+d+pka4xkQjULf\n7d7vnUelkMVkvSbhPv9nhC5zVDyA9SqRiqys0TdrsnBHTbSkyUX7WbVvbSYR\nI7MB\r\n=/jIp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20210119.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\n### Using a `TokenCredential`\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nlet credential = new DefaultAzureCredential();\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210119.1_1611069258253_0.7853977424899365","host":"s3://npm-registry-packages"},"//smokeTestConfiguration":{"skip":["purchasePhoneNumber.js"]}},"1.0.0-alpha.20210120.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210120.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210120.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"7521ff56ccc93a2057669bf55d03521c4f449f90","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210120.1.tgz","fileCount":82,"integrity":"sha512-mdx5J2dnVkdg3DzXKmooCeFLu+m3YR6lZPWd1GBA3603tqB+0qDr2xb9qDQJHdvhnYnvnKsYTQ4GZStCotXKjg==","signatures":[{"sig":"MEUCIQD5YSkcFTZacTnpO/7BEQvm34//YhZ/hJStgusA1JosYAIgSfVYsMIl0HT+eVUa8ZCsNZloMD82gqDn4a4GPkFYbRw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2235912,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCEhTCRA9TVsSAnZWagAAJB4P/2qdHa02YcInJQRjdCMp\nDanpv3WFYs/uTYlwJvwEUPh5S1oBA8IMqdoZg3ig808IGbDiWdngt3SVIjz5\n/7elQbuLo4UvShest6sIrq5EB5eewXO3ru+kArzhUregdUFIOhyb6aNGGopn\nsNHxmgLUB/IbcE0zr1qNQa13zAGwWxbhy1h4WLYvnz8lQ5ExGQMux0r/NsTE\num7L35i+QtbnwH016JMlE1WoVR1kiVmWxkHHQQy2zBP/bsbdcfGYgaiYtPf8\n1haahacsDOAbwyIuMsvn4+8mqppDzE5AkUV9VbVDHd6NBxUxFXb4Lb7vE/bB\nl3xTTN7sEIxP3ZqPtMBt5zVk+9ITfutPfbrdlXewaep6BfZ/UG1PU1jzyT8L\nWhKIvdIFeksLcZeOPUx9+OjUYCAAUhGKru9pGK+EfzEYWYWJLDEBTVkZRmev\n3Zn4Z4mEJLLc6alL/akzrQpCqlK7wUn/2ADjUlmckXCUMYhVIkzsYf4ySitq\nELT7TlGQhntcRcfrtzPdPSpOWDRHct6d/iCJahOdIl7gUgba2/zKgn9NY4KR\nsMLniqP1LTAP/wqdXWAJzB80VrJbvdRhU6hRhCjp8WKwKmk4PgJBktF3nOvW\nZjIxTOi3KFTfiXjmmylqxZ8FA/yndPOg1cFu5deHgeF+IzbFd0WMh3WeMjSr\nYpmi\r\n=5geI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20210120.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\n### Using a `TokenCredential`\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nlet credential = new DefaultAzureCredential();\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210120.1_1611155539222_0.0758979802464641","host":"s3://npm-registry-packages"},"//smokeTestConfiguration":{"skip":["purchasePhoneNumber.js"]}},"1.0.0-alpha.20210121.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210121.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210121.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"e1fb047150dd4b3f3c7ebe8f07dbf490a11e94fc","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210121.1.tgz","fileCount":82,"integrity":"sha512-dK1XimxCTtB/wu71YlwBo2i62TduK5P6MV7/YISr1rN6f6olgVWWsqE/rsDnDZmjk3cJyidJ7q/mgz9/zOBfkQ==","signatures":[{"sig":"MEUCIEPaZQyF6bB/Wb51zYRLMKERDjqpncpRXKio+0LRPcstAiEAradfD6mjFUfb5wEs6U9TNtShFm5+PdfHlys3W+Iqyrw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2236718,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCZo+CRA9TVsSAnZWagAAPzsP+QGdTMJeCJxoJLq39mbf\ndJbj7rpynfrM8rMzfxSkyPYvQnPxjPcJo73Dse3gbSf9lgiYsHEwNB7nq9x6\nXjbR0VvFFX0eN69yDG6lZDvMhVgcm0mldgBXEI+YGL1i85b9DDH+Jp7dG49v\nhpPyLI2N4+r8t7e6SgnvwbjS+8d2fKvQ7+ez4Rw5NxJBt6Pb2kgHzRqEC8CY\nE+jZhg8U+Vxe6chfDeulva95CaX3Mj06HCc2s91yszvAIoHfWv/9W5XACYUa\nG69B3AnIRwDit40q1vnAa66KHp+h8dyP5gxSMRtouPPSRXoza+GLttH4QVJ6\nxPyz97cYWkl44ZLyG7gzxWWx0qdaOVcsgK7O1kLEqKVUGdqzgeAvIOX8zAio\nEi5SV9ONll1qqK69OoqdJsVnmmB2y3gmDNbPejrOJRgO+0s9an+6RA/4n1a+\nU+qCn1V7s/rf5bttedMjL/AsA6KW50/uOLQ3/TI+81JLcLrj3U5CeZe5Ivu/\nK7yvcKh1B6FZpiAqbQJVacFYL3dQDkwoObOE+/LmFKhpa71OkaZmM0llX4FJ\nI5o6xM31PpbbqNwqweWJq5kVk5jtuW2USQDdbBMZf+aDwN2UpZCXUmTO3NAl\nrZKjrAFkHSfWU56etRWXcmDQhqMYk2lToJlmlAo13NI6brrRrtFDMoRNznNM\nnWNW\r\n=By0K\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20210121.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\n### Using a `TokenCredential`\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nlet credential = new DefaultAzureCredential();\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.9","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.1","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210121.1_1611242045982_0.731763536576711","host":"s3://npm-registry-packages"},"//smokeTestConfiguration":{"skip":["purchasePhoneNumber.js"]}},"1.0.0-alpha.20210122.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210122.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210122.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"165052e2482024709d6ff74c2b1d599bf3e4bbda","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210122.1.tgz","fileCount":82,"integrity":"sha512-ofeyC3Ao4zwnJFCCp7KHqZzrOxIwSxWZNm9oWzczqlwfM7v0PL9QK8lJFgp7U0TEmAQGKLo4sKuTl6SmjT/ijA==","signatures":[{"sig":"MEYCIQD+LNXWc81ggwe+jglZAyc6cJP/IE3spjWSBx5gNpuCNAIhAMZkk37d9hjqmxBJzbb2hfxJRXBxyB8j4TWzFdk7a4PS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2236718,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCuuMCRA9TVsSAnZWagAA/AQP/2v4tPo80A2qzfcUfyYQ\nb8cCMztyi1Xw034KT62gWtX+vcnk55Sf4llx8twWwAbdSqPlfyhYaNnAWC4d\nMBgiz2zcH6KVjY49w05uce8f53qf4u9SP9nV4Xv8qciCZIkG3wT4TdsS2cYu\nnC61oKJZ0d3kXyJxl1NBjnShgVjedBON9h1fLoQBDSX2om9ROFDRxa1R/OBp\nVWfPuIbntZkLRcMIPCBZZrJhPkdsjHQGv7Xygy3S8COmAbmQc9q3o6YtgMFh\nN5qdHvA48Q7RiT/F37ZXbCLoKXFqP2mapWiW6ef5Xodx7IAHji17jNNR2QV0\nGbM0OCpf8YqJhTA4Mb26Rg6OD+WaXlGQKQcRaiRYlexbZfYi1uJW5s2ccdxe\nNvbxzx5AJvesB/QgOjgJqJS0LP8y3NM68dS1teS211EkzvtP30TJ5aU/VNsl\ngJkcNrX0s8mxeAH6QcRNfy6k527Tl8dKx7dF98vMu3VaZeH/ht0koNbjOVEJ\ny/xbsuVxyE2eyzMiX0VRkGQ4vmt6ub11Qz3tXKD1TrVf2av+nWBzxDmEaMGJ\nW/cbz8DnOaE9JkWriK4GbtJzHwxDrYKU7CtZ6iriItHfIc/KYm/evnl+cwXu\nFFtqZHbr/eQ7sp/iUfGs3moZpcJzdAYyp2rgHmPCu1TiPrRbAmckqcanoYgX\nt4Zq\r\n=eR8S\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20210122.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\n### Using a `TokenCredential`\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nlet credential = new DefaultAzureCredential();\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.9","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.1","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-istanbul":"^0.6.0","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210122.1_1611328395657_0.850992179259425","host":"s3://npm-registry-packages"},"//smokeTestConfiguration":{"skip":["purchasePhoneNumber.js"]}},"1.0.0-beta.4":{"name":"@azure/communication-administration","version":"1.0.0-beta.4","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-beta.4","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"b66c2672becf9b10690c00b1bd78954764a51ff9","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-beta.4.tgz","fileCount":82,"integrity":"sha512-QyMj3mbR9lL3H9zf0+8xdZEfbNwLEQBvr/JORYmBVFGWxOCGYzdg9a4YjSUD7FuxB/QfdMmpCWQ+SnppONJmpg==","signatures":[{"sig":"MEYCIQDr6AjZijy5jyxCFho6meze7gEqQGO6ZnDFn/uYEfsiGgIhAMwknA1v9DX34VNNXk62kfgl5vMXsm9RbM2zOWTbz2/n","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2240703,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgD3aCCRA9TVsSAnZWagAAxS0P/3lPiXDhGFbL4ebfEdgw\nbjv8ZJfyJWvgz0YsYh8oJHuG7hzL/+nNp4rjv89Bjv+zcF6al9UiqSggy0Iq\nPhfaF+nohRWyS2a+3XCEjLELvui9nb2if1fFPUnXKWAUfZ6trnbvZ1Qe6889\nRAlmRvqR7NV41YO8RooEMGme5008ha6Kv4M5lWcFgBYufLKCFoBB61mV3tKP\nS9FcpgTukn8rhBo4iS8Xspv+FT+DJ41fONPxOC2GQlDJLpf3DTSWfI4WzQmi\nUydOvVx7A8qeW/GDv9LrVfPhNn74JiDtcn7Y07u4MUcqtOMU6FUT36aurH+L\nxXvV32+gZ1+VdWkJa6O0Mh1TkEy4Up69YEkAT3qTccwWw6kqbezWwVEIe1qn\n/SOyhL7PUuSq2zBj10e+EmrRWuwl15ha7KxghRb+pNdNm9OkEGij0HI0sQIM\nSk61gcv4eg70P4KKMyeK9FhDc/wkC1SSBT0ojx5vK+69t1P5EC8jZXQHy1pj\nLg6Elhz61+Sq4rS3rk/srQf2/muvADEr7P5Geg7UqTz/E80UJItMGhHsAhd2\n90z5gAiNbaIjTddJhtPBWo5H7dCAPMGxjWL5bedgapFKHhS+F+U8/4feXWh7\ntyIpi+9x5NSLFJnutBGZD7rb5qYVdMsx9PwgLUBdraMlq0XUf9CDKhQmHqlY\n1vNz\r\n=eWc+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-beta.4.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.9","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.1","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"1.0.0-preview.9","@azure/abort-controller":"^1.0.0","@azure/communication-common":"1.0.0-beta.4"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-beta.4_1611626113916_0.2488169279652046","host":"s3://npm-registry-packages"},"//smokeTestConfiguration":{"skip":["purchasePhoneNumber.js"]}},"1.0.0-alpha.20210126.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210126.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210126.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"960e1fb1e35554285ebf912ba7b515b27c447db1","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210126.1.tgz","fileCount":82,"integrity":"sha512-4SrKUZjAsWhrmYvLGJP+aym1eSs1/vlCLcTKX0PcUO+j/gxm1IK1O+BtA/Kbm3JVCttVfVFMcIuuvZpQh7aiFA==","signatures":[{"sig":"MEYCIQDM+sFmRQn3rnmN830RUUlTWQAhPAZGZPhY0Jkszjz+3wIhAIvJz1GEn2Zc7S+7cvkGCOrjiykiBvu6h7CQqFrqvoyw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2239194,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEDGeCRA9TVsSAnZWagAAqBsP/A0jiB5ahNrWsK/9PzKw\nhInfMEwp6iHRRvNK5EuBevEuFphlqnR+QMOS8/pUDiGnnrxmtjVWO6RLVvyv\n9FLBhIqJUToZcaX6I/bHCgMfE16kG2UbKlP0fhD0N7g9+4D+0JSsCw7wPVtG\ngxdG4218PQClLgFJQqFAIOz3W+/vfuszPylQVEyfOHbs3gXmoSm1OIfLfhv8\n7xLJv3wabxVOi2swypwMWE+1pazJMoeSX3tQc8wSdqZQcLohcyGlGiSx+z1J\nr6m9HjH8FKxr2WM6I2D+52CviNOudXpBc4DOqB1iQP0aRCH5qwx2t1oAkinL\nkA2Y8ITZQqGfC5Js8ezSkqrZEdlHnurSiexCUMUQ4BB6jjncyXhKkPQ5gGde\n5CajeFx6+wJMEvNsjmIiNxIBcSpDoEr1DbIIZmWwfQ/NExvgF135Ef2+y/jz\nNA3a800N0oy9rdCTShRtlDEjEJm0ncOMv+NWsMCKMXr4EFVD/i/a3/qOHJsS\nc8BiQ1eDrPzj/g4E3YWdblRHQ+/LYBjaKl1OrBth8h+/4a2i6ntqFRnRTyTd\nVXfDY/tTLl96sAGBbX8eO+t7iaxqnjguqYJnESIIqawzf7IkDrMSPS3powOH\nTet8IKFj1SueKVPgw6ghFamIVqM5vdKa5MbWtDldg598g8OobFrU/HyK8+Xz\nhcV3\r\n=1kDM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20210126.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library is used for managing users and tokens for Azure Communication Services. This library also provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe administration package exposes two clients. The `CommunicationIdentityClient` provides methods to manage users and their tokens. The `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `CommunicationIdentityClient` and `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new CommunicationIdentityClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new CommunicationIdentityClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### CommunicationIdentityClient\n\n### Creating an instance of CommunicationIdentityClient\n\n```typescript\nimport { CommunicationIdentityClient } from \"@azure/communication-administration\";\n\nconst client = new CommunicationIdentityClient(CONNECTION_STRING);\n```\n\n#### Creating a new user\n\nUse the `createUser` method to create a new user.\n\n```typescript\nconst user = await client.createUser();\n```\n\n#### Creating and refreshing a user token\n\nUse the `issueToken` method to issue or refresh a token for an existing user. The method also takes in a list of communication token scopes. Scope options include:\n\n- `chat` (Chat)\n- `pstn` (Public switched telephone network)\n- `voip` (Voice over IP)\n\n```typescript\nlet { token } = await client.issueToken(user, [\"chat\"]);\n```\n\nTo refresh the user token, issue another token with the same user.\n\n```typescript\n{ token } = await client.issueToken(user, [\"chat\"]);\n```\n\n#### Revoking tokens for a user\n\nUse the `revokeTokens` method to revoke all the issued tokens of a user.\n\n```typescript\nawait client.revokeTokens(user);\n```\n\n`revokeTokens` takes an optional second argument, `tokensValidFrom`. If this date is provided, `revokeTokens` will revoke all tokens issued before it. Otherwise, all tokens will be revoked.\n\n#### Deleting a user\n\nUse the `deleteUser` method to delete a user.\n\n```typescript\nawait client.deleteUser(user);\n```\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-identity && npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","build:autorest-identity":"autorest --typescript --version=3.0.6267  --v3 ./swagger/CommunicationIdentity.md && rushx format","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.9","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.1","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210126.1_1611674014309_0.10311017560878732","host":"s3://npm-registry-packages"},"//smokeTestConfiguration":{"skip":["purchasePhoneNumber.js"]}},"1.0.0-alpha.20210127.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210127.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210127.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"6789be2223b600370e394c425d87d708fd28d718","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210127.1.tgz","fileCount":62,"integrity":"sha512-PCxDMguGP/zMzY4E3zCTVFVCfwv9WCWF+O8JkCs2Q+ZidfsTHqJomvA4+oR3pr+OYoLJKu79N62CPxzX0Ea9Mw==","signatures":[{"sig":"MEYCIQD/Odbakbb8ooLg2630AlnGeN277y6FkKgnXdrkl79mDwIhAIgJQ1t5Sk2p34AmQPWAlS54PJCywzvmNSBqvpmz+ZLK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2081160,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEYNyCRA9TVsSAnZWagAA/fYP/R0HKZGe7ngWhT3thfzc\nJg1RgJggAbQsYp4n0iYOd9XMjbDG7ZZ7f5UGl/UTo05tkdrpSu61AxJ6WSQw\nG4J7t6TWcsgMAonwk3FIdpToZD8FJuz0wDuLINRlHE/hKEDlVdKPFAJYv+7g\nlF2Kw067JWt/QwoOuvaSKiluoSUBLH1pbvxa0xIyf9m3P4qCzvfnHCYyKi/c\n3iDM7crTesFcaVGLv1SNkRDqnnDyEfMHCbrDbfCrm9s3Kim8KEQmULk6X2HU\nDsZXZle1JyfW6EGIrC8xfNzBmYbfw2xfFx8BU0QMb/UG7WIP+fvkwcSD8dIJ\nWz/TELnM5GHswWATU6A4grjR0BKBD7eLAUOJzIqebOjylybO/FONve88m7+Q\niiaMSKKIl0QdJ5h3RfKxlKiKwIfRvkrqf3wbYxQtqRZ2JH2wE6ALDdn1viDS\nzH1ZX1bJoMicShKn/WIU3/nKqT+MoMpE16UIUQRrSpeJghWN9Rrj0s2T/Gkw\nLmN9d7xlhOz6BndKGlJCfazV1qw4RkreMeZTfLUjhaRwjAlkDfqjHkk6pLnt\nhr5H4eMdBsWXTNz3HIhlrH+0OrHHel5fwlrLrPZ5WiVv0bP9VGxQFtROqCKp\nmJJsOyKTBp/CXschKpA+t/SKaig+xmG/44fHHmIdaAu2t2um6+7lSBlNkZ3Z\npNVR\r\n=1F1U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20210127.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210127.1_1611760496518_0.20389147111296468","host":"s3://npm-registry-packages"},"//smokeTestConfiguration":{"skip":["purchasePhoneNumber.js"]}},"1.0.0-alpha.20210128.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210128.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210128.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"402b43e726ddcb75d46bb088d774b92714fc2fe7","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210128.1.tgz","fileCount":62,"integrity":"sha512-2sqa+tmVHfH4Cjp8zQDs2tUAPd75pTOntZpIUzOAFQlj0IuWtzq2VGPpvQFk+ClfdIsYM8J7LJR46N01KekGZA==","signatures":[{"sig":"MEYCIQD2jssXlZ+S+Q63GcK9vh9m34WlGkHa+NZbimS6avTIEAIhAOjwDRXvRhVS+JCGtMM3IVThDzlv46yLbfyHWgzAGsww","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2078957,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgEtT8CRA9TVsSAnZWagAANokQAJWl3b11Ti8gcVqdRKMS\ncSvHGmaMwosPi4A93jOI/JIzTsiPeqOfu2Rz3WFG4l37XalawPtpCmk+33x1\nkgOtX0qS9QQN32cidLhlaoQPKVdye1gi5c2DC1yHnGSDrcSrq+fT6VzbfvhK\n/AvbneMQa/krgNGYPjw0TuImtX15dcxtcAqis1FfmJn+YTN9vy7VLmiQ4dVD\nU/dIoNPHJrsj7IfkzgYk+HyOxUs4repSp3bQhe9LEQcxjeC0BlNdm+br7lo1\nv7bfykNDwWi7rDNQGL90oUYNE83FeEZke4R+MI4SzuVNLYEAhiRXRY/227sO\n2A9/SKjV7ttyqwOOfym6j0fjp+gBmSNMtxs87L1Mdf5u6fhpgtTAjdZn7m9v\nUk2uqrWeOk6GIZHjMUtD8guOoNoSTs8i8YxhvRYE6zE1wXCFqFfJtuBFPPh0\nqe6cnEDpOCI3QziVECq31vXskr+wLeMyhHCxtebIqNhm2DDOVaNQrkGSFI/Z\nnnbk6UKc11za+lJNNCVVFtPesC4MsBJCgHBcM2Zj/Be0aQqze7YTbOXbX97b\n86mcQkBvmgSQnWOiniB4iQ0ZoG44WENZWG1HLOd2DzqqKfnXhBEBoZ2Eb8Oc\nVPKXKcUPmLbSVUvw1zMhNykgLl6Z+mFqKLla2gM9V3PfEiY817eQe9tVquyP\nOMqr\r\n=erIE\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20210128.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210128.1_1611846907743_0.09760832621992943","host":"s3://npm-registry-packages"},"//smokeTestConfiguration":{"skip":["purchasePhoneNumber.js"]}},"1.0.0-alpha.20210129.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210129.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210129.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"d4b0ed7ad58108b54664cf7c5ee1d9cb168f0266","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210129.1.tgz","fileCount":62,"integrity":"sha512-20kmXMWnoU2sfz65T+nA8WGOfTe5cdKlcK0GuJGBrntI5xXjd6eKqNM1WARvykcrQsIgG2Ehs6NgUgEtNz+Zhg==","signatures":[{"sig":"MEYCIQDRxENgfEHcCrFU80Bgcg8795pfgCVRqOrD3qw3+6Cn1QIhALssY3eO0+2iJBRuyn3aUBVUOU5uQBohZ32K+4rlNdJ/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2087068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFCYQCRA9TVsSAnZWagAA6wMP/29Ry+aTs/8HHinTmIbd\n04P6W0KepwmOhwS3JhPEr2pw55PTYjaX10hyepjFWx3Y65K/d7uts9zST5Hr\n1vBNbTm7I58ggYG6idf2waFkR4nxw8lnlqeHCAdM9sC11OwyTERX5UlxkK26\nMRBg1DWvoRj+Qc/OnKVs8u3NgiZcGe6FzWsIF79VYv8MMLGdBvhn+wOvy0cO\nTznBH0CLOYbWyZE+2pthuvDqvVJv/wiFyF9S/PpeOsi8dp9kZzncf8ImdIa6\nztEvB6t3LcXh5Fk8LOLY4Pc9CVxdaYzxqcKmKDntCRXI8Vf8WJ5ccJmmtSS6\nwKmEtSwTOWqY+hOHFrcHk9fS3cWXGkN8qysrdSwdPGCtdtYfPXdKDG5gtd2l\nJ7z6a2Z0yikK0xxdvwitdzIb2tShu7k5KaWZ05ORu1i6DGt7z5Lsj3/FERaw\nooH7+nmrIoERyiZ1HuHN/03h1SHrydqo98TXq1Iep3vcZRaM/Pa9EYELrTET\n+EDvvgj5+pY2LqKBzBP2Vrbr/jh05TvOpMIiC4T3c7Rj/D/1/6ffIl4RiKFu\ng0lQmoIqYfiomsGM5Z+12ccyeZqWCneiP7djuTDi/7jaGH2QQztSDOuizYL+\nHxxYmtdkDeOTYvxa0awQVRf43lVXBHCi/GvltamXl2d9yNdGbD4IpPsGOHLJ\nku8F\r\n=en15\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-communication-administration-1.0.0-alpha.20210129.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210129.1_1611933200266_0.8930961402182309","host":"s3://npm-registry-packages"},"//smokeTestConfiguration":{"skip":["purchasePhoneNumber.js"]}},"1.0.0-alpha.20210201.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210201.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210201.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"17253e27a85c839fb92dfeb4e894663c4054d8b5","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210201.1.tgz","fileCount":62,"integrity":"sha512-3FgGeYizDWR2fkCnodE+rqLMElYfS2JBz9CPcrM2wx50kmUdvb6DgsxAi8EFooMBfYRN5ucU0MjKyWv1X5LYZg==","signatures":[{"sig":"MEYCIQDEfsDEEDXVhJ0t0YfZflO6HpUELG0kVFFXlHj1jaC+xAIhALYMlQdyx//O9JLLngo/3USumwpE7UEerSuNDb+initi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2087068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGBqdCRA9TVsSAnZWagAA2FIP/0/INdZNVEcWIrMsky+b\ne/iOd9l4667tbz0GaOq46PDIr1309Y7rkDgyC5gY7dwnZixXmqCCsMvC3eVU\n3Vr8DpJJKPKQHlLlnd9ZlZ7ZFGNvZcaogy+t5YkJ7hrH9I48Gl09b8JF9mXM\noyM0q4jS8p1/yW6qLunSRdgH15zM7IDx+Nj0tqH0Y805U2FR9nO4fhH+CSFg\nvuoaVcabe1GK6WGWxY07dLXD6WTTR4UHVkzvcbcpIMfU2lvSHTrjNv99/UQ+\n3HgjPJTnZiHo4UpSDPu5igArrYAJahHi12d2TUNRRhiLln2+q60t/Vfn48l4\nj6JIatQxFl1PM3JToWLNgOMZ2MBAijVDVcNHl+26YHhZ1Ym99GDemFwvbZ95\n6SeXOLOXTG+ywdgRHTxpARbOWL4tSyoYWmKBBV6N/qTWyXVsNmOnDRLek1jH\nu6N9B9RAYOfMjm1WLNiDcy56Y1D7BzYOF5VBzXz9JH0AWVvAo50DHkdcjW9V\npxeCeduIFCVr8keWEDCg/Udrib/Yqvwz/3h6z8Zs7GxuPxbYFc/1joCQUvgZ\nWklJz/kMNcnBAxMKpX6ZuXPcfahqYNQWWI7Z2Go/TxH5qqSOKSoFvrPBR7tR\n6EWo5hPBPdGKZ66gtBO1mZ9M8j7fUQFUr3T6h2hayVq+QvU6ooRXgXBS/hY5\nYgCK\r\n=atQF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss-agent-2.181.1/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210201.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210201.1_1612192412472_0.04562058910190636","host":"s3://npm-registry-packages"},"//smokeTestConfiguration":{"skip":["purchasePhoneNumber.js"]}},"1.0.0-alpha.20210202.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210202.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210202.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"1df897c173d548dfa48635cda2f5082f70baae6a","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210202.1.tgz","fileCount":62,"integrity":"sha512-HYqJAJia4QywbVL/ZvWu09fcJ71zNvY+SR/4wpaM20R9/jyrbQ/7OIw8FodoB0Ngp6qpTmmY245OQNlQvld+JQ==","signatures":[{"sig":"MEUCIHnTGWm5+iPIzwqTLqMgwtTiNNZkjztWH2/Jcw2xfmNyAiEAi4XQEYmjneSa5uoy+J+A2gICx64XOz0JDpub6Jj5/qI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2084148,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGW3ECRA9TVsSAnZWagAAhGcP/R6ROJohFyYgekMj1f6S\ninf4ifil3XDN1HnJEFvWvo2kyPwrKEGU96BlKWQpKKLI1YMeaHV7blf8fyL3\nah5+TKOGdkdrqI09TRDWGBAIJaVzkog1EqTOc431GsRtLLdZGynDAYwtooo+\ny3Y8SUiY9xmJg2IUIZw2i/PcNS/RXaXwG54HhjfgbZudxkL00y7RY8tHAN+a\nYuaJBW/4gDh57wTp4pJUxPpwWx5DeQ2O+Z5Gx1CfBwbf3A6V4fVsysW3fVgG\nbICottJ6X9b8QLHUBPbAhhL/VaaPIHPHug73A3I7y8+KOOsBaarJHFSdDcuZ\n3ett+N1nsKksYpIkpelR8j/fIwEdfM0c3VdVrIkGgsiRp2RR02JaeEZ80WbK\nYUsGR3h+C2ZOiMsTMm7tSWNGyOOCAWB3WfPc1DdmXxDbBJILeDoM3A5F6KTx\nNTM1z3A8UK2KrUGz/5to2Vsf4nEKgBZvbjX96XZ8itNwX+En95cPmAfOjiRG\nG+Cc3cO5fN/4WLiTipN/7ib9cSzTvgk9wsbYmOFlJVqv7+XB82QprLTb9mMj\nGRsRaJax0nn15I1FD6Ym5iV7HaKFjz7V3FGm4tARigI7Gmjl+3brMPdQ+8Ex\nToghj1y9w/AsvezD2hJLkOhk7VGZOx73yonSD+Q6B2UaW9+oLEm5VQ7oHJ2s\nkJY3\r\n=wNjQ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/1/packages/azure-communication-administration-1.0.0-alpha.20210202.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210202.1_1612279235587_0.055453118113586664","host":"s3://npm-registry-packages"},"//smokeTestConfiguration":{"skip":["purchasePhoneNumber.js"]}},"1.0.0-alpha.20210203.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210203.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210203.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"680c6c6b7f5e0bdebe0b00f64d3f164f3a12249c","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210203.1.tgz","fileCount":62,"integrity":"sha512-64ZGCpcqhWY5ycPmYaNlonCG6i5khjdPyaxHhBky1LFpO5bnCDhzrViXD3WmDxhDbEuPqGrN48kFgWhxGl7tgg==","signatures":[{"sig":"MEYCIQD9p6g8ZuIUdzE8H7djVQxEFEpqk8sQsAp7hUNKsIgzIQIhAJQ7Y1zLfVTg/vgmEADvmgT2K7BsLqKOYtfQJ1uARTYq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2085024,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgGsDbCRA9TVsSAnZWagAAsmcP/3SclAeorbqfu1OkeTKH\n0W+TfZ0tSlhxeJ7Ui9NaSPn7Nl/9v8XuEC6wxJyelLYR91QI6jBo5wO/Ao+3\nZUodd+JN68uyQIryazj431S/R8CQE50s73w/TqfyqYFDP0wtSjnjldghlUfR\nlzHPy8ckRMtF4F2t801RhJ3onp9Xt2RtN2N5XeoFlkQ48OtWsYvmzuC0sbDp\n7saSZWMUFia4Ix9BK4W7NkvcOvHzABiu1mEswfNnjbrVDq4zk49icKRGG8TH\nmZE3IoZY5VRr9F4ggS1SyfkzNSeoe12TaIOIc3qx98xK9PKJcNDnKG54W4bT\nCAsmJyHLGZ2DEJlcIQR7XZLLe+CjbZtRLhXDBIoJtBygjQdxX6IiWIpm+nJr\nbxv+2zF39G465rLJ3vQMeGk1GaxL5Drj67R6XXTfH6owLn+oIEKwYz2f9M+D\nfb2RXvrGWNTXm6njtLrEvYomZqkzbIUGF6I6EGlvIKEwUZe5EUyye8vHeGqc\n82vdve0e0dedAsLsE4OEDWCmrJKPgFIizCDtEEnwJUqDlwwxqnkl+eID6M6x\nNLJoYI3IVY8ZlijjPEZeENhiMLe98xt4W8u4ltReTJ8BFGLIjvryQSXJ0kx9\nBlm8TXDVgk9yTGQfgwb8JB7lC+Ta6LnEi45Vff3qpnkVhmRK1K62bZFpbTss\nzZmk\r\n=vbAX\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210203.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210203.1_1612366042530_0.434036396812816","host":"s3://npm-registry-packages"},"//smokeTestConfiguration":{"skip":["purchasePhoneNumber.js"]}},"1.0.0-alpha.20210204.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210204.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210204.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"f79194e624dcdd72b90759ca7ae94b11f5d0d1c9","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210204.1.tgz","fileCount":62,"integrity":"sha512-MijRmZpUumhU4Msp2zmWx4ddFsTsbzDG0m48FY2bAbqVOMuPnj/oLOnRp4oou2b64lKX4V3DH9IOL/S+MiGIfg==","signatures":[{"sig":"MEUCIHwxMtd2+guPPlSoKvu9m8WO0/GRtbuE59z6D8pi9THxAiEAnZgOMuVg30/xqj979dJdFzMkxw69qNvbyspQh0qWF/w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2085974,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHBGTCRA9TVsSAnZWagAAN00P/16sapiNFG8t/8TwvaUg\nbGG6q0Mk/bRduZuhg3jxM0Rtb8XbY3efy9XLR9vfrlRJW7N+b/5VJXjC+HAm\n2UAuHmL+pyDWgK9Kl8LYy2o1EAzDDZSdAbuX7HfhQYTWnfZdiaCwADMY1LOk\nv0xuas0WC6TWql05b8x9ODSA3Ps3bsv0+WsubXuW14MheaaVU5b5hLroRBsm\nAz8a+t0iRQrMPXhtVu307QfLhGtBDLAioFlHtokOHYkY0qBRTExzBnEnjJH6\nYWYwnfgFsU2SirOWKYTGJNJ8Dg6GFCXdWEIX5JEPn8QwH1AN2iUW6zZJbJJe\nMq5kqz/ogTubJ0IYDjmbx/TCCyYOR1zKB5CG2/cbgtzGvB5EvoTkMxa2R6W3\neumY+sjqUlmDZ47oiO1/oinAPXERlIJmkUTdCYGY3ZhwBSIYIozjiiZXQmEH\ndXZ+o3pH1hsuMHrW/pGcoGWKCsFV7nDi0cTuZFB3Ia79Q/xDZOx0jvIg9Gb2\nbYSlM3ua6mkhuToFiy4O7mFCfxvn8Q/uLSkrHGciFd7M7+3ocMpg/5pCqVVW\n8NiJYPBclW/JRWjxevd+IIx1RTtFyRsz9LO21LFXcQqsYu95r2NHRKMlfqG+\nhEMnuVFYPgQgxDRn2yUVexAyb+HY8hcTHnB4ekIt1QJv6X6aAf65p/Kaaybz\n0Evb\r\n=V81N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210204.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210204.1_1612452242565_0.2681440809577884","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210205.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210205.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210205.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"db41105d443d66bf3cdc9d162646006de215dce9","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210205.1.tgz","fileCount":62,"integrity":"sha512-I2ysIeJikAy/QgdwEJkiDZF1o/9oqGA+x4jceze42gZigwz0TjXiQ3eB347wcLyC+LFkTrLz2QitXU/M7C4c7Q==","signatures":[{"sig":"MEUCICmK+G+PyPr0b34dZ8Fdpp9792JG34MeHGg0h8Jm+wqpAiEA7BcW2Cua8fUiqf0rDxDmuqLbPUPv+zE5ydjINb41or0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2086014,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHWNqCRA9TVsSAnZWagAAWgAQAI75SQ8ajeCspmm5jXkz\n6CVCRMqmw/fYkWjIDkqAW7/OUHOapcTL6NR9druYsu3nHpOY1iCQMjMF7YeN\nm0ALzT6KWASpxx8a/2M/iHyZeQZA2KBwwQTRMD9uohWnqkrI0qhiX7jwsWCG\nRvmYXYKbGSNnIWVds3t0aUaAClYt8ufvsZynYMu7+M+xyCItMmb10498edk3\ndGKLztZq5CdQEGEinbDT9EEmDnWKeEH6cGVOQ+pPqFQgL6WYO+UUSwscs1Cp\nazSeMnh0D2k/n+ehGK6tTFDoL6wMyMaFDbLJQT3MIYglmTWZz+lAXhqJZit4\nnqEI2AzUk/NYf9vfmU7nFZQeUM5NeCAMO+Z5S67BATy/xlAleEQXULy+MHrx\n9YkA/yQ9vRB7PMWu/O0B6DgqUhO7YDuQ+H4R58/E7ScZyqdC3DValajVbRNX\nznPI8EoBGxRiRIlK0eHK6UwiF37X+6SdmxHZbAZ6cKXcRSodb//twlI14EDj\ngyamLKl1p/B7AxA8A9M9uMX4oiRiBhaRHGGdFw4CfaB3IEbuaoRuhfSNv4Gh\nkTYp0qck7cgEHWflfG5ZskMZ0KbyFVag1iQgttl0CE+DavWN6e/jypZdfKy4\nFsFH9KKMjPJR4GiOHmhYxzupKGHytCQh7P7lCoCJij0i0QhVHbR/1m5sFGGc\ncM5O\r\n=/27L\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210205.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210205.1_1612538729278_0.18209681390889876","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210208.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210208.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210208.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"9df4eb400462292cb5c194187ece110d801af5db","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210208.1.tgz","fileCount":62,"integrity":"sha512-a0yjUJ+PxNbxlGtDoGSLFd2F+mpFxdUkTyZHrQztEq+ODz2RnMh3Q/F/+4VZmgaimD/F6T58JosQDu8PnTdCLg==","signatures":[{"sig":"MEUCIQCLdHTimnaCAz7dpajgl0KjaVphqKAGdXU130e85o/dWQIgeB1o7tKUbKnL/twHi2JozkNuqb21r+2HHt/Qfk8GCGE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2086014,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIVizCRA9TVsSAnZWagAALaIP/1o6SqZOCi5td7Ops77z\nSIAljyamJsx2i15DuA4lDufRCKaZ5SYxfpiHqYzZvaxZ3j5Qo/7Y5iYLZ3Dy\nTiX0Ec8U4+UxPmPyXEGk5nOmoZqG6MQbrwGXL/gAaumKw7L+maQ3gWlVBUyw\nuQFxFD/A6XenhbXhGuTi2+U8Em+rjqfjjw1DyfSpPfY+3KntVYUcJkUa7fh+\nqXlqq4L9vpyoLyM49wA/NEVwR57JU81VjCp5SfmE6XiiHKevSU9ysMhjO9W3\nqSEj57B5Tw390MVVqK6d3BsyF3+1OZHB0dFtznHJcvBA6fa2pSXDxkEERJ5x\n1x+Y3HTPj0j12p5jEpkDrIflAq8qCay0yyT7ziJcK19V1GL/aCz7WpygQT3C\n4HBxAucN3RXOebyZtePqkFjPHCYYb3soe9iy647v1sg2W5kkTKEhliqWkeie\nPIeCPkbLWSRIICC/RtqoUhLU9l6pXfbQI3DOzPdKsA9+ui9voQarrwAzXcsN\nHXl09g81OSjyiv6qaAfEIudCAVQTexsFF/YmEdNH6e40C6w0yDux0kYx2TtR\nobOr8A33gC828KMfmnchQCYGfHrP4GeKYuNbcslRvs9CRUIZ5xB7BVCafLch\nsePHoeDrNgMs3NccXo3fZkdycSloUHIyFoPJiZls94YJCgSCIPbkSaglVpfl\n++7O\r\n=zXQL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210208.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210208.1_1612798130654_0.2694295153022741","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210209.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210209.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210209.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"c1f501aeb76112666630019eab342741f76b05d1","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210209.1.tgz","fileCount":62,"integrity":"sha512-MnWDq6moRhQt5dUkpVV5eurtdLcjqCvoxlFoDQsP0oKG1Zfi1d2qVZclXRrxLKO4x+1kfHM5DZfwgMc4Llq1YQ==","signatures":[{"sig":"MEUCIQDHxPvnj9TVd3xfGgo9yA6QuP3cgvc+IHrUnBLRAVhBEwIgbc8YfGvH1DDsIMvFOqwkmEJOd7Or2TZjnanYztVfPyo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2078087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIqcDCRA9TVsSAnZWagAAHTMP/2qmCudU7DwaKgUbg20P\nQG+SQfXkSP6GFzY8u4y49oOw55OMgyt6YxMISAsPPPFdiad1NSMD4wWAvRT4\nDglkeXhjmYxmfPNeMv4NI91nkiXeDEXuVZ+HCvObD53jSopn/jqsTZkIHPu2\nJAWbeHMQvT2Wj5kv3vTZO1uZMDHfRlkyZRZbSySTQh3LmeFaohmsF/ac4AVE\nWrm4vNWq+13fhaJDGLXg+bxL4ZjfWKI9yVxFZC13qKI/b9OCs7+Wcusqypnl\nSw5BIhEz25TFe+h1ZzTzMK1MjAJv2miYNAz5iE7b1hhzRtCj8sy9UCB0K7KC\nTgU+s8kiKsLKo89QBgEjf3tCjK7cFucrvYb5Tt50CPLRRoNu3aiH59w/LI8W\ndfVa/Wq0lNGXa9NRuAu+5CJ1O0YZPWmiHVQPQoqdgz0f61Rp80obDRXBiH/9\n8aDcL8EyH3u+iK1Q5+MxRSY7g0yk9MTHF2gjEXabB7H5kjAJdYccVhkKzWeh\nUiaVT4sA98RtkklszsVOQku/uXF9ApJ7WMaqqPjVD33MlVyZSci++OmcG8fS\nm7rR0vUHjmwK+BIRNn/++sB+ADpl2c+hRB4IBK+ncNqFAq7Qsialpfhm6Xkp\nWOe9rwIH9i0GvVoBej/0IdzcuPHefdJzCMxgD5GotXvaQN7LXlPCbomr5L76\n6HjG\r\n=T6Qj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210209.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.1.3","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210209.1_1612883715413_0.9053142553584257","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210210.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210210.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210210.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"35f7f9671ee8e32a7d3c31e96787bca7acd0e564","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210210.1.tgz","fileCount":62,"integrity":"sha512-LVZYQYzs09z9ClUcoqiEq05IU+P0c2ilCBE1Mo5XheAZXKQatLsD9mkGAFYsRRz8g50dj/KUMSpiqct4yyDSuA==","signatures":[{"sig":"MEUCIH3rwg3zxr+WfngXWhDRWmi5VQGME1jVIjYb62FrYrpKAiEAnPS+C7xRhfbWliDxfdEUWPynPb0d71Ohtx7nEnQA6fI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2078087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgI/jBCRA9TVsSAnZWagAAEwMP/RhG4DDo51MVAOs6HYnU\n6lEYi8pjGoOJ2GnmEsHYlz50bUZKxbCJTyUz7/vfnpge5geEPvfbMxc73rMF\nqVdap+Fuj5CQfXer68ahh9x+6z5oAug9HHebvGMvwwvzLKXl5xzLOK9MVdMO\nguM+1T+SNKznZN0ZWByIJI7CGRWN9VEJxtxbszPaImyzzvVSzDG39CAG6sWC\nZsAnbzAhDOuuQ1HIaheDf8ttTbRBml08ph5RzXIW0q4Erayl6T46oSBkrjMh\n3/GIkXY1eko0aJHX0ij2845STDFkl3ZPb1WAXUvZIBEotUhwzWL39ePh9oCe\nvR51WH9kyLAX3EWX/P4c9ZmzEg9i76DZ+ywrt9QJoQm2ic81MFMXDAnHWOZH\nmR+9v7OlDinxLkS9u+uFiAxo0hc8GweGm1MwCQHk10039Dazm1fzy9AqPoRZ\nGq/i0C4BVp5tMJ+9/1VXYSgkv6k//xBfQtcz1GEonKhpEBELnm2j9PTek9In\nOIROo2NJgEMCurc8rD5zE4+tLceczGAhVjNU42bpeRbhwMy2vXIyql6ypnFI\nB/vL0VPWeBd6pdvPukfUqsBDshnDeIVa+c/7hnHA9Ta05cPzUsEdNmAilKYN\niZSIuZ+EAcTSaOsxW3ZKqWe+UbqJ9mEBo7EbS9QEw3QNuHqMtS4PRpRyAS/0\nskJo\r\n=63H/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210210.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.10","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210210.1_1612970177194_0.44894589338146695","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210211.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210211.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210211.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"e8831478f5c8685d9de13ba47c14490bbdebcf8e","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210211.1.tgz","fileCount":62,"integrity":"sha512-Nwy3BOhdicIjUGbkzXeddoOs99l6evIrbyDEBUi+4wrwADa5Jk49bfEEpqSFLoGRx1adKeQ72DZtOvICcie1TQ==","signatures":[{"sig":"MEUCIQDimxlrVILG21ZeSpuzX/9eNYb2XMWyqifjgJGDxZJIRwIgGCpmZ3JnDnjKXvY/AyHLFK2aem0PzcPWx8nxJ2R3Wvs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2078087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJUlQCRA9TVsSAnZWagAAW4UP/3gpxI6AwXNeK8f9BBe5\nNVWja01d/lw07HPxZTeHMufD2eGGr5h3fvPX43nrDbsWHnS6TDHl/PMwCx3/\n7aMOlJkNArXl6jdR+NmZ70uhGMNTDB6oyqzthKn+o5aKPEkbbR3S+9BinjJO\nMCX3b/dpiGu2jKc+oaIywvLMQnCD2TehVCG7ODaU3KxYjJcqN7QYXj2KpuHb\ny9mbFSyhx6BdlV0sdQkKtT/bBhqfDplG3rsZDN3SQ2py45HQWSPvpEFYTbCP\nL/Wh1SVoKmzAwsYo/TEr2VdFGss6nf+TnRR/2Kk9w3fZHa5qBbdGZnJOIvL8\n0YY2gdKBSfo4MfHjJTcb8aDug75cTtYR9XRCfqIVvj1ZZxLvP4qnPU56l5Qr\nPqT2I3P0XPeHSycxoJk6Taa5YcWIWe7gpKVEW958128gYjzuHKNkyN3+wnk6\nQEbzcBoFkCXI1CwviCbrl+Lzg9l67mzI6SbrAs5AL9s0fm3bMs13lzsRTsro\njMt4b5WZDk1ucJja0FRy3Vc1G9MsT+AUk6exYedx6xmKiwe3cb6lQ1AiPks4\nSAl+CQHXe15EWqrMrjStgoQqzN8btSW5aYxdapljTPKRi6HkoxIY1RMhjlzM\niDRLooqiuSOscltQHSN4wN8b2uWKr74Y9asfAapBU2SCoaujfs0RzGzUyB86\nOdcN\r\n=iwN7\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210211.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.10","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210211.1_1613056335450_0.8227621643578065","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210212.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210212.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210212.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"54827d1bcef1a9aa6a3c76e09a990b639431894f","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210212.1.tgz","fileCount":62,"integrity":"sha512-mIanmbn/eTtlsfFyAhBsv12/exZiwTXQQ/Oileb1sDKzpZ4pHbxOD6rmInJrbgMtTrSVbSNw6PouVVMCDYsE+Q==","signatures":[{"sig":"MEUCIBc/EckiowEl5rbz+ryZIxvkw51VqjDM2EcwxJvpkqw3AiEA0OhZ/i7hNzEPySzH4426xVDgz00tafEcHrY6z7Tw3rk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2078087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgJp0MCRA9TVsSAnZWagAAk1wP/RPSpvrz9gm7/bKWHjFm\nhD1/T5ZkdaCSNajlMBzDo8m6fNEyRVwG5r71nrX64o2bP3yQJn6VfFtUpi78\n2cUaoScxnwrz4Ujrc8x42MIrAZtr1IM7bEubgEb7tdqTSCIYG1GGe28PJjyu\ncEUYOwCW+jkAa5w71ePYS5EDaejgxRjhI3F0vBKTZ1Fr8GLWT33QwneiXTXM\ni4yRcyn77yyLtpAtY+qm60FKFNHUjkwtcOc+WZDH33q94Poo2/d1+3Ijqr+6\nYKn6ZIO0VhTpjjJU/aU+Km9kcY2jeHKBKxtGdlZFr0DLUDwyn2Z8hky3ddpH\ntikgU905OteM1IiVPN/gWKqmPdOTxWQbSJsQvolrAgOoJUVLT+37KsUu+9ys\n6ftVY8xVlOC7iox3Oykg9WiS24bgp/RmbSb+EJpbI/XDUs/4HCqzlQt7JNeC\n6hISeLRX43bVVIq/gH7ttnrhNQU7B3Mn2Q4LSA/LB7+h7zteitiBAC3UmjUK\n2EdNomlKWsTnKHAyt3NJT+3X1A5tBcpuquqnAReH3mb0PUiRhNesUJzOT6QQ\nBgLjBSltstAHVVqjIB7d1V2+gy7Y0eaMLbg970z/CgNmMaO3d21NigTPvsc7\nO74V5sQC54zNibb41ZLoOJKBvCtpxXDxz7rYast//UC1/yq6nEanSCeLAwKt\njEX4\r\n=divu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210212.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.10","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210212.1_1613143307147_0.8607270552482418","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210215.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210215.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210215.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"b9080fbdf59b74d66b789f9724ed17d96849fb35","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210215.1.tgz","fileCount":62,"integrity":"sha512-E+6VToBH/71iDcNA+iZ+/Hg5iILGjfijtJLLxcnhSJFTbn3Ljst1Oer+lQl1usMszQF0CJmGmZHGAVn0NSO2pQ==","signatures":[{"sig":"MEQCIFGMm8Z+CgKoivVSiim/h8mnXAnGj5Kkj3luQIPvu4AUAiA6qRWcRiC1zinbWQ80uAnEOvbn/le1/d36H3Uakn4l6A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2078087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgKo/dCRA9TVsSAnZWagAAKkAP/2OcM/7AsWJxXpmBZWXw\ndtH1cHxzddeod9L05LF5h9Gbgz7/yop9zjeAQPfzcelb0BGOkohBop01wAJw\nHSJttmB4pBkmOByUyB74O73CGZ/3QHChLUBH4rLwCI/s2riONAjotDzIrijW\nnpgACJFAMifJS2oZPt8UNpm5yeHiqRmp4GXZdgkCoAs5FRrFkC+aOqAPSMVc\nECiv5le8pLtDUKNWgweZd/Nl2Py/Rtqiw8xPiaWaKslfxy9RWd3h14aNX4bf\nJ8OENN1hmDgJW54+IaskCXPOgi33JCqEB2DiEMgn2GTulvKMjNx03qTdyqpB\nASFFCMrfJGPzPL+Q0ybtPYzTuy+6yjY2HfbMbPfZ08Pdycq8zyH53ewB5b5f\n3fTpihgnfLSp1F8mX+sybOZ02xhbnLEIc+ylkB9t9eA0avnvMhA+7I0vfckN\n065qEpnwjKDPCiTjGRfIYZ5wRjyDZI8WPU1EbDrplGhFTE5aV4kpEqo9sB6P\nUBrW1ZTZXG0NYWrXEhPCVySJ3FpfBtYfZ4iLeJl3IRrzk03qInzDice6LN6c\nMH85o3ZUy/Fh9+JsDnFuQj/26WsFwaOoQLPLtsHv+ewOy+o1Sc+zMUKM/8Ez\nM2V4tAPjXvRszhbQpEsewq1SP0y+RPrMW73edAa0Zl65H6OEZ1sHBvm+506P\nXZHb\r\n=Q/HS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210215.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.10","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210215.1_1613402076978_0.1370506053037459","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210216.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210216.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210216.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"e37d368dcf69b1bb60f7b6fe028fc241b28e5594","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210216.1.tgz","fileCount":62,"integrity":"sha512-V6RdxTTtIK2wO/JzCaiGNGv6wxDgq0G8nSElxyd+pDNYVUHW7AdHRLqaEvz0fzcwyaPlA6De5WLoB+MuZUWkSA==","signatures":[{"sig":"MEUCIQDVQkcAYGCrPYW1xaEioruS9CE+6MMBUaUM71ULTDauTwIgLXxxvt6G8KDvhkEbcbWxQXylVTv93Llw2EJ0z0aY3BU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2078087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgK+O4CRA9TVsSAnZWagAAyJEP/jMuPA7s2D3giphIhOZY\nOyQlOyHAc2Pj2qkUFV7gDLJA9+R19/MEEJG7g6NM9m/kimhkurb/Gy4QHRIb\n2EFS8WdUuempAkoJJ4myRphsYQ3K0B5sU+uaqCSbHTzrTe0nRmLGtFGbzcpO\npba/BrIqQX4A8iE20/asNotNx/gCxZ54mM0OwgisVjT1uOetmQXYFphVTr4B\n/uQwtJxqzeOp6PYkPtO94oJDy2Zv4GV39/MgwChH2hWAblcXCrbEiux7vtCh\nmgi2SZMXfwHvStJSfv5DYDCOOlIqTmJW6l3GTQoyNBNJPWcImqwhB529H6wC\nKkcS1fqOu1paLGstoTF+LJ3PXMOKymWL5SrybnZ5U3D503FySyf53CtbIKdL\n/mvVktiLqS9PauvFKKvNAmqbT6BqwzDKyik82MRjooZINMXhLhVTJ7DJ8Pjn\nZor6t39mOicpgJGWLWkG7RZSXOomfDkN6Pzi38li4QuUu4okujHaLuoxhMHN\nQ8CCSkWk3bKcVJIbYxBvgv2jUdjWctyTN8xzqAvIITCLamFrBBy8CcrpBJZJ\nT/9pLLKQ0rsg3w3wDsLP0/UVkeUAB3Jh1Ynyx6Hau0SSSeVKuLVssJ38UEA3\n5Ke6MHuaTmhQJ0lJMIYpLqX3D9hrONW2DFg5sFS1BcDB5yied4lI8kJ8vX00\nR1wp\r\n=5G12\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210216.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.10","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210216.1_1613489079625_0.03821125247693402","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210217.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210217.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210217.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"2ded9fa8136fc44f76315f28032a112aec0b60f6","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210217.1.tgz","fileCount":62,"integrity":"sha512-zfrbESsi3SjHLdhhlfiw3Sloie9WQvKobII/f/Gdj0Ho3Us4Q610ik5Lg8bWPB/aTbwrSnsgebeiaWqXkk8+Uw==","signatures":[{"sig":"MEYCIQCetibRLD+zU2974LwxMyg1kAxRNNd9rtWl/axgvhLhNwIhAJgg0cb01gSprYi8+EEe2ar+P90UvxsFB+ePJTe5YI0m","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2078087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLTIQCRA9TVsSAnZWagAAh3MQAIRCGpc0BDjA3XmhVYpR\nufxKFI1Acsk4JJz32r8yM1U8sKiFbNHJ2/lg8ZoU3UHMft3xxa7ZoNCXZ1Rg\nKgP9r2avpa9jsUfqvoljCjP2n5pC0P0Z0Rb3xhhNu8GiRhstY/IuQ57m3iEe\nKLrZXQ/vR8VYDAwkUhby4lakjqIySMJT+cffA/lmGmO96vUBcHZbXwWhyljV\ntHGJyHYs2DR6asKz/8VYvorFfXwDnmPUvz8wUFt/G5tIJGLecmgKRIMUmc3B\nuCuy/uCR2ArBHB858dqGzc0Fz6YNPyk4tIazlH6Sr8oTOiMvSZAZCPGTF9ZK\nzaFuQWq+0ic7jQq/nj8PFRb4o/pLl2VNGnEN6UEAiT4aWWswRr62g8glyync\n3gevwmn22QgUwNzHmHAQzOg5eLmj2FumrNm6tezZo+wM8d+G+AHuRwLml2qK\nb6cYjqhuOemSYTbmj0qRLWEpYY6gdCheB47RG14eTHNMljRF/bDlJFxMZnSu\n5+OZex1W6QIJdf2wStLSkOIYHkARyRjVm6wcbzfi410+UqfV410AZe6+HLMX\n7zfNqp+N0nGISZM2T7AiIL9vynWNYsQvoNUi8tiCCK5iV8g7LFW4cqyb37PI\niM7eDo63DzCVFqRt33QDFPlc7sXoUcxNlbJVvD/Z6Aqn87G3LzfiUPGhGUBD\nRk92\r\n=E8qR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210217.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.10","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210217.1_1613574671936_0.39199058517609386","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210218.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210218.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210218.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"2617f6be7e48a7fae7aef33fe50fcd41a94e4cf3","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210218.1.tgz","fileCount":62,"integrity":"sha512-wEf6tBi+7p7mZRooYwlHM+cd5rFp2xN6zzIwl1ce+BUmfc0ZEHTlPyyv9x/yPSt9pHcOtD5LvKHfTj9SlGOLbA==","signatures":[{"sig":"MEYCIQCt5hKr+ZJBGQLTCaaES1fHSyyJ9/Li+5EJTCmyVkFSvQIhAMQlWjaXQ5HP4aj2ECyvJ6nbrtUlH/jNB5kbuCjnI/Df","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2077427,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLoQvCRA9TVsSAnZWagAAMNMP/ifjiaFHu7XoCmLPPeow\nQamb6bnJkhjTQjLajEcUdxSz6B1vGTuZAdH+/yyqQpJIEpS2eLrYnFGXGqWI\nXwZOd8nxUfISJik9xbzx0zcEIQT/U4ORbeseJMfE4LYj0B99N3DuzQK63kHq\neQ1BHKIqxhN5pfldTtiFbADpWduR2pPmxaUoCjUVj5CWKVlLznLLV8ZThDUn\n9UStmt0XEQb6KDYDVWZ7LuTmKsZ70xkjNj9r5uh63uHM+d3Y/xmj1MceciEl\nZ+r7mAFaIxaKOozZUuurqXCD5l3YKiZlNrG1OtpkSl1LwZ6eNzMVMwq/+7ql\nGRtGhzBgCePFlXQZky0sjbl6L/2HJr/WAJs3xGzGI+6JZqbOc5uP3X8P1w9p\nHMW5uCQWbW+nmLAqyuu3b0WqyYnyIkw7yVI823jnr2kaR1aVpPaaTxE5yF6e\ns766Z7WHs32eQYedXW3NQ0z7RM5NJrkpTI3AuR11GQynYK1cLY6fBa/4J0Qr\n8pWjtGkd/LYr8UVQTwLb8iYpkaCvtm/xjTWM4kraqbcIDCGNu7b3KXx0NHVb\nw4oVpdLfXo3+PcFUhXpTHSCfNUoaHAiaNvcOJGYkbQoZoQkGB+mWIZL07JEU\nd5C5emkmwZaAMkGVNGfBVlj3lqSKl+byHsg6HaJNvAFS/81jfLT4vgiDX3iH\nHvwZ\r\n=RQvh\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210218.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.10","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210218.1_1613661231357_0.11524763712311925","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210219.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210219.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210219.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"67eddc77dd15f4f8c55b6db908680fd8bca2f086","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210219.1.tgz","fileCount":62,"integrity":"sha512-exiOKpCXdKsJE7/WKrFItMfdbjbzY30eBXjOjwE6mZX3Ipy/P/81LMXxfXSE2elEdPXVEJqQ4uFTZbsgnyU+CA==","signatures":[{"sig":"MEUCIQDebJXTgzhfQdZFrVCC/u6U63cNCkl2HfEVUndqFqmXpgIgCLjKW9Ax+cL5rxERGov6W4kEMAwl8wMOUnAWY3dMqR8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2075639,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgL9VuCRA9TVsSAnZWagAAekgP/RrtNC+BS6bmYQFFqQTQ\nB15noK+KMTDoRRV3fsHY0AlvFwOamCbS1dYWoYCv6O4I2Tb9ZXDXtjn87oFa\nfOWPth0JnoR6Cmemq+S21CMSkV1RUzJpTT1Sy4v9dXWylFergpu5Tls87Wr3\n1McC8ELDmbfMqWFJN6Tu91UrFie1Zi/23RJQhIgmF2GAy8ETsBEoslhETcRj\n/rACnsOpa4fQH+Q+hhBNdrtc1BdsBZw5WrBPQ5vIjVKxaYD25ulVqQ84+RgR\nPgePlJVYMUJiF7MCzQU9q9ZHfey/i6K2jhhMnmaFA6a8XPBZpGAWN77Y1B6W\noXKhIwQNzf1taVlCtVZV1W2djP+v0lcO3ufLggIuVioLBXiWRzp6/qPfc3BP\nRLayheG0Wtothk91iVoeZv74iMUfLR948i0wLDKymDcz9U23BFOGDuiOvawh\nun8DrfGKtS3zaQjDg606FD6vx/boJxHDyhivWwtmZzgseN++4UoxCNTl4AKj\nBXQvcRCehZR/2JxpmOBOzS8w2Blu59xQDqMtCzzUTUuxh9vZpwRFN8fok5jE\nM17k/FD+4EeR3GlppSPfLAZoiVt7es1tL4/tWnd66pwvggnKElOUDVuQ8c2b\n1YDX1BeSgJaQ6kqfBRuxjDzy9iY1odZNzSkzwDIDhSrCISgm245lQ1olT0V7\nhYt2\r\n=xw4A\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210219.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.10","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210219.1_1613747566045_0.00655420765580339","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210222.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210222.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210222.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"1e121975e962c864d54e992e2d7aa3b8182bc11f","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210222.1.tgz","fileCount":62,"integrity":"sha512-TeisYUQknsWyTuPAJUf1Dr8jga8SOZvG+XqZqTDBHqdUJ+HeBaFJDK7Nl0pwY6fLzX4imxw50w+TIdZoUNgegg==","signatures":[{"sig":"MEUCIQDeexcKLJ71F1DJT1zvK5SKIt8z0Sh89JWBmotZfl2otgIgf146cG76Uqt6c0F+UqrJOSQ4hy6wQ9ir8iXB2p7T1KQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2075635,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgM8m1CRA9TVsSAnZWagAAtxUP/0VNQkHNZ7j5LNXRq3z0\nXSP0Ea8z7Yefnt4sKtcfGhQKQPtbbcDr5+NFzuDrvsM5Q20wfz58KtaIt1K6\nTg91TDPJfD6+RC3P6ex0KvPD7/w/cQC98zrpr0u073IHcZjHFPNSBr9Ep2Xd\nvHlatCfuhWZx6NYWsyMkBEsCnsvCYgC3PWQ1ZA+vnumXkWegJXc3mtGO7xmQ\npr8vOGuzH2YaKlSaXFf0Ot+pSDS9zjQHFVx72uCYlXKSKc3LCHqCZjRT0lcu\nbBYaUFnI1GRGjPxektFpAupGLsxVgh1Cg3BQ6buj2uBb9AW3dZgriJZ4cMck\nAl5q7d1AYPNU8ZxCmCNwODqVKf1QIqWvbTB4b48rXzU3yi/rbN646EjYabVz\naUE7uOYreHGzLnyHVS0nx0Wgr9Ir9f9gipn3aRExLW1HYy135PyuSQLzbqD/\nq2H9wM3LTaCUIiRuhNmDDn3QcVuoULiinXA68RO3n/Srb/2e9Ezy/Zfvo5FM\n7hjU6lsrszgHr8id/I099deqZ6ZFHop5nNY14psQue5oEH1E1nOS/5Pp/URj\ncjAbOTrXTl+HrP0pYGHKxMaOtyWHLW9vCtbtGrw84UHknZv/rjZgQcm5k2FY\ntezWTXUZaBb7B96EON1axqie6novEJLMVDN2hP1peha8/iPwnAa8maV1JFoh\nQuhe\r\n=42T9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210222.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.5","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210222.1_1614006708818_0.29366888446863104","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210223.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210223.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210223.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"565a0d272602fa256702af2a6342f546a91767a9","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210223.1.tgz","fileCount":62,"integrity":"sha512-FF2arh8kBJeew/WeEXwYtc+M6Ow6cHs7edPc+ofNy6DpwzSD4uNM/0MpU+Es0sOYuDeMT6rEfr9XQrKDwpkS9g==","signatures":[{"sig":"MEQCIFBVFlSjm9MSAiVKvtYWcEd4iKBN/NuLvun7sR6ln7YSAiAITDQ8zC2mDCdndlmTTTUdTdxzsPqRnznjUpqvV84uXw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2075635,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNRweCRA9TVsSAnZWagAAN4EP/1plb+eSXVGtS6bFS2No\nOAAGW9JKM/5WUaLbxenUCs6SCYtf9SSf0YBQFL6c3qKFdycDk6wIG6wuUnHJ\nDJ7id4pfTeFAAm4LR+2B/xGz9Yv0J2jVvU09x7LLk2EvrBHdAu48CCu6RtcZ\nQzNGdpGrRrU2Ptdpsalq206uD0ePQhSYpMdIg39sJy4gIMLFfUYnxP6PmLKT\nZHGiWm3Oi3QntY/IkxLAw9z4mv8WHcNmmxhoMVVJohcMug4jJMKzGSSXclB8\nOqf3NPzQzowhvYc0sVQ1r0CXGpgb30GS6sMIx6C72oEmMwFE5le/zgY2qkqq\nT90alCCD1wen+SvFoLyL1S3R0pouRmLfkI02CkNW7xwuUHjBFWBGq24mNWqv\nckQ8jVgC2mo1btWbkVmgxPqXYMJ4SY3YTjWiupIhmsggrqYDWQDz3qcMY1nY\nYoWuzMdmpnc0duhy9JcE2UYcIWZ2dA9z/D0SvUyS6py2LemBNTBIveaypTlb\nouxNwd7dEO7GpvFzz85apGSHsMuSZUoNE/t8y2jJvdeM4ByDoBiFV14j89rN\nrLp8GukKXkeDIlb0LCVP/AhiyTMLSx4fWeQuoXwbHegBizkTG4dkxwf68ZY1\nmDMghuWRtKrrv1jEzsLMdLp6+WxiibACRGgisIxZlUUReE3SkD8REXFzTfFt\ncGtJ\r\n=MGqo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210223.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.5","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210223.1_1614093342313_0.6387231251518033","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210225.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210225.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210225.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"110e6f649081dc9044a68a0b6985a4376948ee40","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210225.1.tgz","fileCount":62,"integrity":"sha512-4D5xtJTqAq9qD1MER2tUODvkJb3N6YltgN/diywrhkCUXkK66Ra13jQyhbSTtC1fvFqJZmbsdZGkdpNKGVvbIg==","signatures":[{"sig":"MEYCIQDNu7Ha7odxwQ8RwCIyTDIhCtApyWzX5PDO8Lr+kP8wkAIhAL405uGeZ/N0QEpniZqE83SSYo9+a0FpGQlZNjWs8lE3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2075924,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgN75tCRA9TVsSAnZWagAA95EQAJxF71IUIQrBoEejztzU\nZP1LOvVlueFWNNn5gRMTgGp5UB1AFx2wZ8IZexljBttOiSDkXW2ABdrYI/X3\nnxhfKXuQUKFbHesVPRaVYyTK4yOn4vCrhHg+XKfYX7sulFRuJ9PteKisxl1m\nNRWywzYRueODez/c/e1TX2K2vjpJmav3tfkquHBv9yzQuUS3F860i53M5oAx\nNT7NNAf269EvV/idr3JPVB8XnQlYrXaSKhqv39H0k8NqJ3UQLF8+tAn+/p5W\nxALM1r6H5XtEcLfwJzZdmgwWVB0+9Vagvi1/1e7Q61J5rRWfsufo71QbLevA\nvBeNIwZl2gfS9jWH+tjtqtPGZZb+n9Fg8UQZo3Y2PqjRQ23dLBBMjEBA34p6\nCrVLyXSn6v6UzYp6llv6G/3DjoErLtQgLaviEhUMFScljg2grd22B07LC6lr\nU3b6cKKiEi+6d/SOiodvsusOf0NB/FPP4IM+F+x1Hi4AZMq4PiN6lITjAjW1\naei4KSuM1EDVTJ8g5A3rCIYMM286dff93FzBLLLgPOjlJ/27hxcM+9zDFbwl\nu0MKcrEkpKBq2qylHEOECv4Kdpr4smDq40doJNZDyO3QDDhzdMNlQm2/HPUr\n0VWuYwwO+OABOgjNblZaXq9oTH4jwU4nAJ7Y5Nil60riauFAbVoph6/Xcdwn\niy/q\r\n=Mi7i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210225.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.5","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210225.1_1614265964618_0.027970664554916258","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210226.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210226.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210226.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"d0faf990f7e8d346c387e9a8804485f3c32c84c0","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210226.1.tgz","fileCount":62,"integrity":"sha512-zw2Kw47FCde9TEv8WEqN6PyyE9mLXqWqU7N3CMs+P/Ju/TQnKSifjYlGkhBuQ0jEfFnV8cPhN5lXUQJNktnjAA==","signatures":[{"sig":"MEUCIAR7q6zQDbB5+geT7JoRDR0kmLQuqBWeVyKKm2fhkJUZAiEAlZQZHCqYZ/skaqZ4m3YMPQy5P95etYKUOkNrwbF3w7o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2072111,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgORAZCRA9TVsSAnZWagAAVsgP/j6Q1Du0Pdw4QEyVSgs1\nvVRhwdwFsqE7mHuQNymC6vFRe3s0lAS+gCrHtUOTSyrKh77pKdqdPqbEDuX0\n6Rw3zKGhsb7joZHP3NuwT/bU5I45877aa/cXmhT/BBF0nI2ZlMeJlf+Gn85u\nquV4LFYnF6jjOu6QhM1/gQqRjM07ln8luRX1LgHWbw4coa2hcOjjghCp7zu6\npf+ajLwRrDQUSrcxdoaWGjM0qAHxThF6irzsCkBLUzvCpVyWR7U4ESN/1dd4\njFm2gNjK+JMHhYATaNIfhZGYqs0FE4Mq2mtwT+ytvsFjjb734bnR9yM092Gm\nTS9iZOTBuwttJJVmjNofvwyLHjFMi9Tmz0Uj1PKNzf3oi1T3sbxE8luLmJeu\njClkiiJIPDeuBx2HAW9VeMrI8JliEHfPXiuxDvK4zoDWrK9YY0u4OlFmbk0g\nvwVUcbzagyYrUIeL7DGZBW8DcM1qcEumcODCcYThWmhnKjiXk077tkB0C+n1\nRfZBBpZnCMdzCRYXVWu6MwlhX6ckF0EiJ4mVM7kLTTjQJM/u24ZPRnzcpqJ5\n2gLqjT5y0VgyfO9BOAl+nstm2DfHXHdzE7fxXU3qISQUq2f79p/sekmdTp1I\nmXw4BGn6YpeP7fB0WFzeSUyRP+HhDMdMMNc049WgKe8+NNV12CcFETYhlxuf\nCfvK\r\n=PnL5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210226.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.5","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210226.1_1614352408832_0.5312475581881488","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210301.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210301.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210301.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"769293eadfde6c438b805ba692d61d2f24edbeb9","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210301.1.tgz","fileCount":62,"integrity":"sha512-yGoHOTB7PWcpOAwNC3yrO5iZzF4Ond23gS0vLbR+z3Oy/kIHn6LZoA7zz4+9kLaK2Jxx0N+A4xObkMMjkfs+TQ==","signatures":[{"sig":"MEYCIQDs6dSvz1VpacrbyBl3Y0gDDtykZQHjg4g9TmpSlZUb6AIhAID2T/E23YeFNflsBf7XcTg+cKOjuhhxT1CV8yORrIzu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2072293,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPQSmCRA9TVsSAnZWagAAMvYP/iv4KGBrZk32e36EmiVF\nsJgFwGnBTXhCJcAIt5ydRmcfqYFFIAY1cj03TbDfDkvrEOHxqLh+zUTkPpt0\nSCIN4HvMTDci/9KNF2IyNamUhcfvlbz9t/awyOF9UFHqkmJRL8MmFmXIna6M\n2URQaZK5MYGej6SE8h/3gH3XW01cv1elcHigdDdWPBSP8CTVqd3jp8YCeFdB\nLwJ/VpL5lvITy1q3wBcnXh1qUQ5AXYUPENT+kfGGD/8ZPm4xKwv3Qt8ltycY\nfJR3BcnbeVx7d2TSY89Agf112M42jMb8CpDjYOv8fjcVY4p9s8yaftJLnxgF\n0CvCa9hdmdrklcYvAlu2Qmj3x/WxqMt5hRSUTEQniLhZEEKT5+/As9/09fMx\nf9Jq7LqWosD7tf/xdsSPOIv0BPWyvqW0ud6Rwv2xZMP6qJtR00lworWr5Sgg\ner41OQ3vXYC4tXeAMJU5XrMzKDKKeEA3zKkoccRCPuZgLBkJ4TlhEclfoakm\n8GoXEIYTNSYcomP9YXmg6Bz1aE8epDaq2xbTSQA/LI+ZCLa1+4NxuRhS0J6W\n5B06cavgNKFBTJ+c1zmL9Vv9/91Q7vi09xy6BHbNgiDObE8EOC705fzEVOU9\n4mr6WkSYs6ypVi9jL8yILZrRS+TkH9gBJUnGtEkJqgprtl7e0/s6kGXSSoPN\ndSbi\r\n=gWT+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210301.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.5","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210301.1_1614611621473_0.8694513043883565","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210302.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210302.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210302.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"9af66a62d9b4bdba9047da7a132a16bb6fa19416","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210302.1.tgz","fileCount":62,"integrity":"sha512-TgyfV5LDLR6pPf5HLMwK6gz5KGXaSaGSC5WJ6gI1UZuz5sAQiBxmM6vdh5eBO723qoKGSEmp/wjuIG5OrNHZTg==","signatures":[{"sig":"MEQCICt732FEX4UytcmFdctr2UXcamd9hR7kdLEJKJxysgAaAiBK3HnB6Ost+GB58b8Kzmmstkgs2XW1ps+9AXfUc4KHPQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2069743,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPlZwCRA9TVsSAnZWagAA4V8QAJIR7DWbkxcSTq302SaE\n9pXE9aox3BcA8vwPEb2nT3S5S+a8fv3wkMwuW2aGnmnFfdiPu7JgjI3Pqd/z\nN9SBA0SOEv6lYUosdQSPyxU5/IfORna1JvMMUlioYw78zhUVwTTZhPx44p1O\nOcX2ZMph9SqNTCuYxt7gY/OkKnqVFNkuPB/VGoB5aOUWKwUD1xYT9m7DsRRL\ncFPinFlOD+9jYHinshyzMXd5EtSX9aNREu6W00zgSxchRtCEMBRcPmoW25KN\nZL5YoNHjae8psKLLiefc+kib3R6aJrDIqsoendrFnn8K89WAmDIxCfrgh2C9\niIWQLZH9Y8y2hGJbezZuSjz515NH1b2AyejyZsiXzRR4VMV6Hoh2DpOktp/Z\npLtkq7jNmDd2pTlKh4KxXwHV8Yl1MJ2NAyehPwpOJ8oT6swy2tm4wzc/3GaY\nCo9P4nvFeAaaeUS/RKhBc0Gs1ZjYf+wwgGEeYL9KMiUZ6SgrCRxbdumy+77y\n6zkNCu1XXVlf/TTG0sIgj476h9V622e3hMyEI2Zh5jZBr3w7j5H4OW3QMuni\nl5hJ5ESsSmvx6QNLr7L/TeVD86ntOj38z1k6rqjQj4PJ38h/ybaUxFJ0AwfJ\nT0yU4zqyk5qplqkETAHavPIKFkjDJYEe/l6dqArijOtq9d2Y349Q6+FkJPZl\n0Fx3\r\n=AY7u\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210302.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.15.5","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210302.1_1614698095767_0.9730235265877729","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210303.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210303.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210303.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"2202e7cb1bb0a1e01521b310b29801a1d9de8bd4","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210303.1.tgz","fileCount":62,"integrity":"sha512-gzcbSR7LTzbeGa6UdkvlkQwcBhpDgmylgPYLn/j6qvWDHMPizqFsjBF10RBA9ms4HnshWPGb6TPtPJoyuTudvA==","signatures":[{"sig":"MEYCIQDArlP5zsmLdv0xuhQfg5kPmNe93wnPZfk7kmwjqNVXbAIhAIROQiCdoPsWJpjECwI7iiiOowaP4AXHufbzYfcasFsu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2069912,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgP6cYCRA9TVsSAnZWagAAb0IP/jzYF5U2Zs4fvA5QgpBE\nIe8GQg5yNc8XV4GtXqjL3uIqLVnlDPBrOhdS7ipG+Nu4uhzgRO/dhZEwPe2h\nSqfYjOXVh2MZJKEPxodaC4At3t3nfCHvAEFP36WJAmQVR4xa6bLDQ6Sun6OB\na/xvJztSaefrhzAyxvkDHiSinuVaSyjCGHIYsrT11M7dIjqUlHFUYXUWdHB8\nku4uHGeEarljSPq9oK77RyHfWpgr1E+BQtgUHQbFr4g+ki/PzfZ6Pl2nQswa\nlDRg3p29L4HnbByevUiBc15r2/YK5KOwnUMdnnWZH5H9l80Pdj8oZC/DdptJ\nQgW6CnF7DfiB37MyY8K6PodkPbOVf2kNa1t1Er3C0kj9mkCS3Z/UxY2KV5aE\nknn33VL1HuGCVbLYDXAmyISPmnVNB4ay91aFdtNCdiE9F25QxvRvYFr/WkuM\nr0xZ83QHlOt+ikHXPHaT42xv+p0mCfMrR1kavyYwpKfS4q/YoOyXoHATy6Uv\n2VD87eZXwVz99+bDnJWk6PvG0ApT/6QgaPXsZqrBYNmPYkdgtjsfXN1VN1K0\nLXzYO+mkGImk3rcOK4LsfqeUm7f5IjUBt5dSvXGAHFi92tnwppd0ceY5DE7A\nDJ1bhP9M3VIGFP4DDsEty3ht9Q3zglh2hrRF+OPu7AVsWVd2egIOA6UiiVpI\nz6yy\r\n=8SpF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210303.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210303.1_1614784280105_0.23290683558661063","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210316.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210316.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210316.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"465187d715d005e9d2508c019e2234d368f41028","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210316.1.tgz","fileCount":62,"integrity":"sha512-Z3AdVluvZ2p6GiFB2Z9rMq7tmrNwbqbarNvmm901Es0PnBaZMYdrQgnvJUkA3NQ0+BpWKAGhYCmKrfISUPLo5Q==","signatures":[{"sig":"MEUCID01oPh8HD0vgm35LwVXnnAUepITss2CbC2IpMOAhGGuAiEAvXbxBdJ0wDQC2OvtCFudUd0bvi6h20n3buLqtW9jt8o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2074522,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUMFVCRA9TVsSAnZWagAAKxgP/jM8ihwNssE1R36vVbSm\njWXTvUTeKl1j/HG4vsJ4Rhn9bNe7HPGHRxmbSH7aZJdviKxdDL9+7Jq2ekhr\nSh7+Jp1yQQQM2uhWx4cQRokzpaVcAVXBIdaGTaYmALVz47BrJzhvSnNTucfo\nEHfpYnfey166HPrjfC1TdKkoWLAOhLzl7brzpRK0w6CXfjIfLW+5WUaS2ntl\nJxaWulPXwmYbFUiqRScmANv/EsOjABu+jkcg0AHqdTRqQR/iAf4EV4kC5MnC\nyHwMikOLbGYwBtreyqi6RT+hwzAYKK+5G7LY6W6dV41OHaMFqK5i/620m1lF\nk6NCUOJXngatDaqx8sSR6YmMj9d/JaC7mFo4gpnabZGm1DPJLfVHlj6g90JQ\nhu5rfOOmx/vXetN7GaPkDD5+6oGYvqcwilyQiEYji7jIxbBtprGISwDhWrej\nf3ztpdHvAwJ7bMwCaiymzoGgNbjsifBCCu3Zo1jEHG7FIDNyBu0vXzEzJjG2\nUnUWlHfVrLzcUf96dqkJjULEkMijH83/3v8JxrSPwl7WVK4ZXGsbYFhaoMmD\nLkUEBU/BjdbIgS6rOFX7NAOmNfNrWXzDiSzdunoUgiIgvLSqxO5wGr4coArD\n7YEdZ9thPlPdbgtQRWxQFOpOxzOBEqgY6TariSuuiNXd9MgS+xBMIQSmgdsH\n6mUi\r\n=vhca\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210316.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^6.2.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210316.1_1615905108826_0.3282388170675512","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210317.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210317.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210317.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"097983c112a4276ae7abb187304aa2efa5aa7570","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210317.1.tgz","fileCount":62,"integrity":"sha512-HebvK/QrocoSw5YZCi3KDIDT/Dj9+Ur/HoH6cKykE7DMKP1jju0oIIGhwbOsQPnkLD5Px+rABVM08xx8xxATkA==","signatures":[{"sig":"MEYCIQCp7Lev3r5XtgUjfOMy2gUfZaUw8J1cui/bQYuyHVvO6AIhAIwnLuhgUkAsqmUpL47FKywHYCZjANCD/shLmAmn4bvn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2074522,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUhDQCRA9TVsSAnZWagAAZ74P/iMe4Ly/+RQ5mbX3p/Zc\nwemnL6wxNMAZSi+TNM1dOmihIykCQ+WZSSlCncBaM/hjMaJH7PzehZLvcTaN\n3jZLLutA+u15uX0gG0LlDThiixZnf8g3niLNPwc7mxK5UznLDbUjQ8tRtz49\nCfY3iSeKhPf01O+Jf8QTYgr2vSGoX//gBUrarV98AlJ7ZTg3okrmaz+j35iX\nvQpwlsnkfM4DYuBpE+M1pU8jF6+dgToayriOP/PVmfwfRShvVekiCX94/Oi0\n0777wSvLtAKyU0ahYl7/247YNMEANRiHss4EYdaCM4akVhXCdgKP1zSKeI5a\nY9EywXJWMXeSsKGL2cglJ+ryHNQjbIKc22kJ56s10qxS3vb0mTzpPQvx3Iss\n8MPbH4G1IEVgpFHcvG7xNwPeV/mswrvp1SI3bh8ObGF4xRXstIYqi8GFvHp+\nUSqXElm7xaBAd6Y3M/f8MTm3sstfHPxHWoYY8lfeesh5NO53j8l4odE85x+6\nmRS4wzOhOKJD4pRYCmEfamQZEOVl8Vcfbejs1bh0HKksrfYngDL4ahcCvK6C\nFaoXgIF2azKphg5fuNKuLyvNeqahshtu4wP29pz9kWq8AAK29tQhycvZC5x/\nm6rnfhfNyIES/4frg6jVAAWBp8AHKmUjaGiXDv2vLKc+yw4D2lJsKvhs5QMi\nZGeh\r\n=YK2r\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210317.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"recordings/**/*.{js,json}\" \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^6.2.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210317.1_1615990991728_0.02554861559762389","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210318.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210318.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210318.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"1c2f0abc97825865fe3be04877925c22baaf1f38","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210318.1.tgz","fileCount":62,"integrity":"sha512-E5qbMHummyewbh4+oRGg1SjsVPJ/H0P+7DszgJByU8cbdEgQdKW5LSG3fBmbva+VIfnxLpTXLRUz+fCfLYfR1w==","signatures":[{"sig":"MEYCIQDSLjmDGpqBgtPsjq/udOvxHVDCjLSUdH1RFnmrSSQuegIhAM4WJItmWbRLVblLbIW2UdZvYOaB6YLUbzIcZhL8K8P8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2074640,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgU2D6CRA9TVsSAnZWagAAQIcP/1C3OURHf+gvuVzGX73O\nIiWKx5q42QpE3jCRkO8YpeduWKPlNu8CeWfWYR+OnRNcPRsiDPRV0B+0G9ZE\nVG9PxTdMG+2pVFm8KjOz4AvIZd2UadEcCNLI21u7SMSJ1wNW6AH8JrzQIl0l\nCbUQ+CQgpEhTL16vvrUFtMc6DTgnmeZoxFELvY75KvvRut9RbgEuyEEb5lLP\noDXx5XZMCJCV7iHtIavdozEk5yeZRy2erkF1d5zjjhYZp910C/ihZUH79Vf+\n8g/YFZUwDiagh3tSCnRwa6J947nAf2YP5A3UGcLKgmR0kSEDI+l/JewQBg8U\npqgPFqNLFjq70f/i5GCygbikrPkNlCE+CuoB6mntt94P1bbVypGst3jWFNZJ\nLlaSskBnfqktFLV1XHGIR9s7LP8ObeNXpXndZHSd9wgT56zq78BJnRuLDX0v\n58hSMkdZ2RiXxPjubpWnHoYrKSUbE84+0iSnOhEZoWt6FibsPziTukWm6ASg\nvgnsrKmH6C9ezX6Yng5Jr822ENlMX6Pqv5JINl1w2OqSrlXr0p+ITKNt9Adm\nNjixd+cryYfWWFAlJPepBrD/qaH3AuwRgOKd2j4gMVEmClZ6JA4x7PsLn21X\nmRVrXdTKh7dIrDd+K3jl0WCKQ2fwd+fNBdNumbmcMVdsi/d7CneP1mwbhNW3\n+yWO\r\n=sX+m\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210318.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^6.2.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210318.1_1616077050022_0.8314275557085298","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210319.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210319.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210319.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"0d7cc81415e4dd3d865ffd55b9641efcdac6caf4","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210319.1.tgz","fileCount":62,"integrity":"sha512-MmsM5gi3qf61fCvSSYxwmlRdQBBwkaTtB0CNdWDTpSz5ZA16T035lgViAKrXRz4ufO9V228bt37qduH6JWBelQ==","signatures":[{"sig":"MEUCIDBwPKRqM0QDseNPotoHQhM/U+6Hmqv0SHx361h18K6AAiEAhxDYV1dA9URN4RbOpAu6ilRO03cD8mLrXzMUlY9E2ww=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2074640,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgVLrpCRA9TVsSAnZWagAAntIP/3KKCd6YAUjD2CWiTueI\nvfL2oZIdnlz15ikL8k/yTuiUmAmi0j4lTDNRcXLnW1UatZ06o8U/ykCmlpWi\nIjw4AhmAWQyioWxrijaGtGefpCCaoHaayJLXEH96z343e0C7l0uY0xO4Gfft\n8sU1Yq/vpWX+HBGPamCTTC9jQF/6IRlVDo52jmn0yraW2W61qAqJOfgJXD2l\nWOOJalSGGvYfGEnLd04o57xM8G4XNURCHGEYY3vjZps+cvEZLwt/6X+zulOB\nwtb7WpjlEob/9kSEs1tVdLtRfNJMkkC6Sq1se0ioMjXpTPVOU1GvSGJLKVw5\n+lJCMqFLW1bvgnIIYL5Enbt8vFY4fZYU2MqEa/o+rpxPiNx+ibVV7BomBFaE\nJKU114hJcfkDsBlc+cbvHOYafC47++wzZBVyRe9hnUJb4LgiPDOCdeUv36g8\nD56cE+/AcwrTK5Kt/iBmVccu186XmmlkJ+GOgu8TsTl3VHGHiHSUHuacCGrF\nkcx/NPuvmnyslCdkN+pWc/c2snxvG88sKkRcVDk8F9gk8RT3rNqvhRZkl2UE\nPa0OyPJLYMy68P8sNLT3NIDQOivtUsi1JToe3fCOVWWZEL/WT1UrXpS27A84\nnaWHdQGjUVKYIsDgrgwc1Su1RdrngSAh2yImXbMTjnMDYuN+ertfzzr4bHlH\nA3zv\r\n=MZx0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210319.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^6.2.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210319.1_1616165608993_0.8468536279326773","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210322.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210322.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210322.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"98bc02de9525726404330ce7b14b14fbb22a40bf","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210322.1.tgz","fileCount":62,"integrity":"sha512-TXxpibkZNl6NaXWqU0G7nrUH59c5QqisdmP7s2sdGtanPINyyK1Gcc5aLJRRXf7y506TeurYi1npqTiMDBC8fg==","signatures":[{"sig":"MEQCICLBDXgWJGqXIG0qAj2oTcDuVdwpsKlUUc7G7iK5jScUAiBr/C4vhUjzbegxiFAs2Ijc5+HMUz9pROwVe5KUv3YNgQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2074838,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWKYvCRA9TVsSAnZWagAA6HsP/1lhmUSX/FYsDo2Jf3Px\n9vS41oyQ8/HA7s9XfrbBF+yyju5RjOE2eOMK+HxN/1B7p4TZ971Sh7EXwE5Q\nZKmEPeLSDdximhyqGsCyanBAS0csGn2d3j7SvqY316yG3uLRfcxrMIh0yx8q\n2Wqq/TZ1FInXxV+jTrVdg79nXiRWNKfxmS/Jg9qQTfntlIfWecCld/TgHZ4/\nvd7KhVwGCMM6L+pGm0yVONW/w2dSzkswE4qkBO3HdbnwzlkFWMzS4Y5WIROP\n3KpCte4R5MXcbK3eN8NXX26cd/Uzjwf3m6jH8WPrbIbrZMpNC6c/Ca637HbY\nIDkpMayV5TgZF2dor9yIpKK4vN/4CQBEh7L+ltqBSod/1/9eGpDTkpzfVgbF\nv6v/Ca9DJAl/X7Mh/khqo1V689dnDVjQdGbLxcQ0zrLMnQZ9YRJ4+0MOBqQG\nyQGvmsExhdPcMoDgHUhVWEbBjh8XgqYS6YrwIifUFw8LVuV6PouJnQ/H+4TD\nA/678W/Fkg8dy7dGsAxxnqKiy+CvlbUQB1xORjLcKw09NmtMB2vNALZo5uGt\nxJw+tsGr6uTOqTz5rzvByTBgFEwrk7HKFrt1HGavcGKcTv9jm2q0y76FnaQi\nchw5lrViDhdoe55aH2fsCf+7TbFdVrJhGl0uwdHIV+CLy2w+4Vet6eVRxMFp\nz6Wo\r\n=CQ9p\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210322.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^6.2.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"~4.1.2","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210322.1_1616422446469_0.349908842549425","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210323.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210323.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210323.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"077a7eea184ee87ecb1bbc07cb73ba946cc00a73","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210323.1.tgz","fileCount":62,"integrity":"sha512-t4KGL3bFMgSLabYBhM3Duwr28NZZLYBCfLNhTCorMKEzAZgGlO5eobspN4HjjKIfkKM2xHXTyWIIOe0rTd2OqA==","signatures":[{"sig":"MEYCIQC0PLbxSQKBS1Vt16zn8OKN2XkAywT6vJtW7E1ZyERvEwIhAMGKB8ovPu82pmU3xXiVFcxFGkNjREzwH3uxIF68yZh0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2075665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgWffdCRA9TVsSAnZWagAAd2kQAJnG/RSRpuIPPJn1OHI7\nBJxAR7GncvTwVzTDJKWe5W+j1qfq7CXaedOOwHhO+SJAhkhH/I6y91oTtzvF\nW/p9h1PXKy5Eub4bSYOAVf8TceR/drF86uzM8GfiGrJM4HW+08fw9LNJhl5A\njO90A1pr3q0WwhOnwsC8XTCc3mlCp0iwF0++In/5Hex4hPSqhqDYACtRHXxy\nd+swx2RW1k9wZil3kWua7IdGGJi4agjwggWTx6nmPQiKEatTnEDCfnCiY3cV\nAjh2KW9JckXOw9vn9hnv/NHGtD2vcWKfjEzeZ4JBY0C9T6EWn/2yq188pRkU\nmqwi7+GIHrYI7LvNjAa4e94shzIYiYaF0jvweLwNYkYcIhdqiL42Fx2oSVec\nefwR+hzbOEUcws3RGnNuI4SyNvBDyVAeyfhrvex6qvX6DDkH+ff67qVaZXr4\n+gq2CEtV5GM1N/P6OLk8bqNPjXnSLUihRGAN+Vq85suH8VU/laKdbOeblnLn\nMYjbIqDSxd4g3aWhJslwiOQ77HprwyILiHHDdFCG37qBqtX0YHp1dGYQCv5I\nBBRaM9towm398Fx9q4TYafQiqeHnk6gVOX4FlkiIEeZIUPQP+REwGcIJ7SVa\n9BuO1Rz8OoKH0fu8sz/Mob8dOcXV4i6Ch9nRI7qx8zSi5GS6CJFBsDxAzO4q\nrHYM\r\n=/sG0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210323.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js \"dist-test/index.node.js\"","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  \"dist-esm/test/*.spec.js\" \"dist-esm/test/node/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^6.2.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"~4.2.0","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210323.1_1616508893015_0.548256728774924","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210324.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210324.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210324.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"4d7b827e1dc4cec0674eda6d21704dc413064bde","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210324.1.tgz","fileCount":62,"integrity":"sha512-KRttSzEW7FgpLRrNrpaWCQ3VoLtkKrzUfjCiMQNK7uSyWvDGk5yNAGDQhjUM+S3YU/0Q/u9bO/Gt4hSaNPHcMQ==","signatures":[{"sig":"MEYCIQCP1w2LJxT5ZVjIAiu0108LnNffavkl6c5Ay0hK5cBsTQIhAItjjpG1yuLsPIwZj9XdIrsS43b9asU1NBS/sGmwA7zq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2075657,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgW0l2CRA9TVsSAnZWagAAW4cP/ipXrUbdBjYTPP+UolYE\nnlGwZ/SPQoTpxrdEvDbokojgQvYOFBh1hfmqzBif3awoyA9AlsAQzjno+SJa\nmPII78TlNkVb4/jV27J8R9KgCJaVpNFMQFRxsXU6i+1sGdN8Iwb/H8NVWNKz\njvF56oXwl27YeMeoe3GiUo6T5xrUxaee0o9J0BAQn/r+RflbstvCnLGph3ER\nAxnVh0BKiRV4/5bS2fCqORgGYJrMkpMNm1bfW0eC4OZkM4x1GIZuRE/01KSJ\nx/YBluxSw0QmIXmwLkKCWqAk1esjhKbBp8qhHw3MuWfnUWyy62Y2VrT1yCMj\nNKF11LzZevMfxMkObGNJK48XG2mlPJ/015JXNlmM/djMG/XwYAlVLhsUPh4j\npx8LeH0zwl3zKejYAG0V+oC+51iyHe6VIwU7RVOvtUdOVSZMekuauU6Qa0M8\nPgCaU8pvYanp/uLN+uBkO0PnTj47uaVGInxKDlfDgoTL1OJsoN5ubed4GMyh\nZE9048KxcEtC4hKpFL6GoxST9VslkSPxlRN2+vGl8ZtNGxZAFdc23MoIV0m6\nB+R7XQEDU4qnJ8dOgCnuqJAMzZgS4M8LBmvJL2kPysw56bw1aV210hE9DQF/\nDz/MdWmW6pmmISG25U1wGdGakrOFw5K0x00zFbXenZtiKSoVga9fObZUkQ4z\nf/Zy\r\n=VeCZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210324.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","generate-doc":"api-documenter markdown -i temp -o docGen","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js \"dist-test/index.node.js\"","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  \"dist-esm/test/*.spec.js\" \"dist-esm/test/node/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^6.2.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"~4.2.0","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@microsoft/api-documenter":"~7.8.17","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210324.1_1616595317966_0.9661836480519543","host":"s3://npm-registry-packages"}},"1.0.0-alpha.20210325.1":{"name":"@azure/communication-administration","version":"1.0.0-alpha.20210325.1","keywords":["azure","cloud","communication"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/communication-administration@1.0.0-alpha.20210325.1","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"0ed1312c95b75534bb91d3bd57abe42dd866e793","tarball":"https://registry.npmjs.org/@azure/communication-administration/-/communication-administration-1.0.0-alpha.20210325.1.tgz","fileCount":62,"integrity":"sha512-Amr32b/otlwf2/BMTLm0UNexD2zXoX52m/MblczMwDNkKiEcE09l33xjUCkHRgcY3dzx/COeGOx23LTJX5JX3g==","signatures":[{"sig":"MEYCIQC4UK7j104RV9BRq7vYfg5lvwtkikEEinC1jGpuPOdf4gIhAJThstSPmM23sKTib3TDDQIk6J3s7qro0uYEXMLZc5hW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2075526,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXJr6CRA9TVsSAnZWagAAZ7AP/jw8qv/Bc5CPpKzDnZXr\nyYi6/zUKH1vBgwK4v0IPHqnJ8vocQc6Qd/lh43Wy7+XBuqh9PeP45wzfspK7\nKoLSGNS8M/nePCGZYXnLooBppBiFsuKKdXjh+XTYXAw7pinomfALR4rCyQ2B\nBKK98NzX+hzUvbjM1k+Jhzec0EUd4WWSIqdog7pUsfll3YG3h+pICjLD+NGA\n1YDqXpM9/lxf8oYTEsakMvRZEM9zvVKazQy38AYeLyDAQCpuqaJeu94ZpbUd\n4SqgjmHqJ9N+GO4Q5l980UBjJK+LKQoxhbD1pog8piN2I1St7bfOwK9V9mVz\nT7iHeHtvHBJWYdH/SuKpidfKg/KwOlqK62g1dmTouruREgp8CmH57m7Fg5KM\nlFjNHiF9NFoBhVrk3VFsKN3vlfcHzFaQxfsZ0OEUqH0oPmHlvWatcgTBwKpq\nTXDwC+2mc84B5LJyF7qL1fxgtQALqFLJrqqn82ofT8W05u5D5L0dn65O9KlF\nWhKll/QSbfIwoXlZiK3HO63TqSHW+aKm7l/gPY7m6kGVABFlhHjxIgAidHWg\n9F+ZciwCEtg6DqFsKiRpAeJnOxdCyXcRaCqCmbQKNDO4KFjS9UVPr7ASv8mP\nxiO12m0jX0EaLEwawqhjWg9YABCwgRIvJVLPEK+Q/MQFZx+pV/qY9LEYnVO7\nqX2k\r\n=fX/l\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-communication-administration-1.0.0-alpha.20210325.1.tgz","types":"types/communication-administration.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Communication Administration client library for JavaScript\n\nThe administration library provides capabilities for phone number administration.\n\nAcquired phone numbers can come with many capabilities, depending on the country, number type and phone plan. Examples of capabilities are SMS inbound and outbound usage, PSTN inbound and outbound usage. Phone numbers can also be assigned to a bot via a webhook URL.\n\n## Getting started\n\n### Prerequisites\n\n- An [Azure subscription][azure_sub].\n- An existing Communication Services resource. If you need to create the resource, you can use the [Azure Portal][azure_portal], the[Azure PowerShell][azure_powershell], or the [Azure CLI][azure_cli].\n\n### Installing\n\n```bash\nnpm install @azure/communication-administration\n```\n\n## Key concepts\n\n### Clients\n\nThe `PhoneNumberAdministrationClient` provides methods to manage phone plans and numbers.\n\n### Phone plans overview\n\nPhone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888.\n\nAll geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group.\n\n### Searching and acquiring numbers\n\nPhone numbers can be search through the search creation API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This search of phone numbers can either be cancelled or purchased. If the search is cancelled, then the phone numbers will become available to others. If the search is purchased, then the phone numbers are acquired for the Azure resources.\n\n### Configuring and assigning numbers\n\nPhone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id.\n\n## Examples\n\n## Authentication\n\nYou can get a key and/or connection string from your Communication Services resource in [Azure Portal][azure_portal]. Once you have a key, you can authenticate the `PhoneNumberAdministrationClient` with any of the following methods:\n\n### Create `KeyCredential` with `AzureKeyCredential` before initializing the client\n\n```typescript\nimport { AzureKeyCredential } from \"@azure/core-auth\";\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst credential = new AzureKeyCredential(KEY);\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n### Using a connection string\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst connectionString = `endpoint=HOST;accessKey=KEY`;\nconst client = new PhoneNumberAdministrationClient(connectionString);\n```\n\n### Using Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\nIf you use a key to initialize the client you will also need to provide the appropriate endpoint. You can get this endpoint from your Communication Services resource in [Azure Portal][azure_portal].\n\n## Usage\n\n### PhoneNumberAdministrationClient\n\n#### Creating an instance of PhoneNumberAdministrationClient\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\n\nconst client = new PhoneNumberAdministrationClient(CONNECTION_STRING);\n```\n\n#### Creating an instance of PhoneNumberAdministrationClient with Azure Active Directory Authentication\n\n```typescript\nimport { PhoneNumberAdministrationClient } from \"@azure/communication-administration\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\n\nconst credential = new DefaultAzureCredential();\nconst client = new PhoneNumberAdministrationClient(HOST, credential);\n```\n\n#### Getting countries\n\nUse the `listSupportedCountries` method to get a list of the supported countries.\n\n```typescript\nconst countries = await client.listSupportedCountries();\n\nfor await (const country of countries) {\n  console.log(`Country code: ${country.countryCode}`);\n  console.log(`Country name: ${country.localizedName}`);\n}\n```\n\n#### Getting phone plan groups\n\nPhone plan groups come in two types, Geographic and Toll-Free. Use the `listPhonePlanGroups` method to get them.\n\n```typescript\nconst countryCode = \"US\";\nconst phonePlanGroups = await client.listPhonePlanGroups(countryCode);\n\nfor await (const phonePlanGroup of phonePlanGroups) {\n  console.log(`Phone plan group id: ${phonePlanGroup.phonePlanGroupId}`);\n}\n```\n\n#### Getting location options\n\nFor Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities.\n\nUse the `getPhonePlanLocationOptions` method to get the options for a location.\n\n```typescript\nconst { locationOptions } = await client.getPhonePlanLocationOptions({\n  countryCode: \"US\",\n  phonePlanGroupId: \"phonePlanGroupId\",\n  phonePlanId: \"phonePlanId\"\n});\n\nconsole.log(`Got location options for: ${locationOptions.labelId}`);\n```\n\n#### Getting area codes\n\nFetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the `getPhonePlanLocationOptions`.\n\nUse the `getAreaCodes` method to get the area codes for geographic phone plans.\n\n```typescript\nconst { primaryAreaCodes } = await client.getAreaCodes({\n  locationType: \"selection\",\n  countryCode: \"US\",\n  phonePlanId: \"phonePlanId\",\n  locationOptionsQueries\n});\n```\n\n#### Reserving phone numbers for purchase\n\nUse the `beginReservePhoneNumbers` method to search for phone numbers and reserve them. This is a long running operation.\n\n```typescript\nconst reservePoller = await client.beginReservePhoneNumbers({\n    name: \"Phone number search 800\",\n    description: \"Search for 800 phone numbers\"\n    phonePlanIds: [\"phone-plan-id-1\"],\n    areaCode: \"800\",\n    quantity: 3\n});\n```\n\nTo get the results of the reservation, use the `pollUntilDone` method on the poller you created.\n\n```typescript\nconst phoneNumberReservation = await reservePoller.pollUntilDone();\n```\n\nYou can cancel the the polling and reservation by calling the `cancelOperation` method on the poller you created.\n\n```typescript\nawait reservePoller.cancelOperation();\n```\n\n#### Purchasing phone numbers from a reservation\n\nUse the `beginPurchasePhoneNumbers` method to purchase the phone numbers from your reservation. The `reservationId` returned from `beginReservePhoneNumbers` is required. `beginPurchasePhoneNumbers` is also a long running operation.\n\n```typescript\nconst { reservationId } = phoneNumberReservation;\nconst purchasePoller = await client.beginPurchasePhoneNumbers(reservationId);\n```\n\nTo get the results of the purchase, use the `pollUntilDone` method on the purchase poller you created.\n\n```typescript\nconst results = await purchasePoller.pollUntilDone();\n```\n\n## Troubleshooting\n\n## Next steps\n\nPlease take a look at the\n[samples](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/communication/communication-administration/samples)\ndirectory for detailed examples on how to use this library.\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n[azure_cli]: https://docs.microsoft.com/cli/azure\n[azure_sub]: https://azure.microsoft.com/free/\n[azure_portal]: https://portal.azure.com\n[azure_powershell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcommunication%2Fcommunication-administration%2FREADME.png)\n","engines":{"node":">=8.0.0"},"scripts":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","lint":"eslint package.json api-extractor.json src test --ext .ts -f html -o communication-administration-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"tsc -p . && rollup -c rollup.test.config.js 2>&1","test:watch":"npm run test -- --watch --reporter min","build:clean":"rush update --recheck && rush rebuild && npm run build","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:browser":"tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"dev-tool samples prep && cd dist-samples && tsc -p .","build:autorest":"npm run build:autorest-phone","unit-test:node":"mocha --reporter ../../../common/tools/mocha-multi-reporter.js \"dist-test/index.node.js\"","execute:samples":"npm run build:samples && npm run execute:js-samples && npm run execute:ts-samples","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","execute:js-samples":"dev-tool samples run dist-samples/javascript","execute:ts-samples":"dev-tool samples run dist-samples/typescript/dist/dist-samples/typescript/src/","build:autorest-phone":"autorest --typescript --version=3.0.6267 --v3 ./swagger/PhoneNumber.md && rushx format","integration-test:node":"nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000  \"dist-esm/test/*.spec.js\" \"dist-esm/test/node/*.spec.js\"","integration-test:browser":"karma start --single-run"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","_integrity":"","deprecated":"This package has been deprecated. Please use @azure/communication-identity and @azure/communication-phone-numbers instead.","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"SDK for Azure Communication service which facilitates user token administration.","directories":{},"sideEffects":false,"_nodeVersion":"14.16.0","dependencies":{"tslib":"^2.0.0","events":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-lro":"^1.0.2","@azure/core-auth":"^1.2.0","@azure/core-http":"^1.2.0","@azure/core-paging":"^1.1.1","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0","@azure/communication-common":"^1.0.0-alpha"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^6.2.0","mocha":"^7.1.1","sinon":"^9.0.2","assert":"^1.4.1","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","typedoc":"0.15.2","inherits":"^2.0.3","prettier":"^1.16.4","cross-env":"^7.0.2","typescript":"~4.2.0","@types/chai":"^4.1.6","@types/node":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0-alpha","@azure/identity":"^1.1.0","karma-ie-launcher":"^1.0.0","rollup-plugin-shim":"^1.0.0","@rollup/plugin-json":"^4.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@rollup/plugin-commonjs":"11.0.2","karma-json-preprocessor":"^0.3.3","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@azure/test-utils-recorder":"^1.0.0-alpha","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","karma-json-to-file-reporter":"^1.0.1","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"//sampleConfiguration":{"skip":["purchasePhoneNumber.js"]},"_npmOperationalInternal":{"tmp":"tmp/communication-administration_1.0.0-alpha.20210325.1_1616681721527_0.5422219047393173","host":"s3://npm-registry-packages"}}},"time":{"created":"2020-09-22T06:05:29.142Z","modified":"2026-03-19T19:50:27.288Z","1.0.0-beta.1":"2020-09-22T06:05:29.657Z","1.0.0-beta.2":"2020-10-06T01:03:41.176Z","1.0.0-alpha.20201013.1":"2020-10-13T23:10:11.005Z","1.0.0-beta.3":"2020-11-16T22:28:04.645Z","1.0.0-alpha.20201211.1":"2020-12-11T15:11:12.981Z","1.0.0-alpha.20201214.1":"2020-12-14T15:14:13.062Z","1.0.0-alpha.20201215.1":"2020-12-15T15:14:32.542Z","1.0.0-alpha.20201216.1":"2020-12-16T15:13:02.610Z","1.0.0-alpha.20201217.1":"2020-12-17T15:13:21.195Z","1.0.0-alpha.20201218.1":"2020-12-18T15:16:58.610Z","1.0.0-alpha.20201221.1":"2020-12-21T15:12:50.146Z","1.0.0-alpha.20201222.1":"2020-12-22T15:10:06.380Z","1.0.0-alpha.20201223.1":"2020-12-23T15:12:40.851Z","1.0.0-alpha.20201224.1":"2020-12-24T15:10:25.413Z","1.0.0-alpha.20201228.1":"2020-12-28T15:10:30.086Z","1.0.0-alpha.20201229.1":"2020-12-29T15:09:57.834Z","1.0.0-alpha.20210105.1":"2021-01-05T15:12:56.400Z","1.0.0-alpha.20210106.1":"2021-01-06T15:10:13.921Z","1.0.0-alpha.20210107.1":"2021-01-07T15:14:46.725Z","1.0.0-alpha.20210108.1":"2021-01-08T15:13:20.271Z","1.0.0-alpha.20210111.1":"2021-01-11T15:14:55.669Z","1.0.0-alpha.20210112.1":"2021-01-12T15:14:53.927Z","1.0.0-alpha.20210113.1":"2021-01-13T15:12:21.507Z","1.0.0-alpha.20210114.1":"2021-01-14T15:13:58.823Z","1.0.0-alpha.20210115.1":"2021-01-15T15:12:26.152Z","1.0.0-alpha.20210118.1":"2021-01-18T15:12:54.386Z","1.0.0-alpha.20210119.1":"2021-01-19T15:14:18.501Z","1.0.0-alpha.20210120.1":"2021-01-20T15:12:19.363Z","1.0.0-alpha.20210121.1":"2021-01-21T15:14:06.256Z","1.0.0-alpha.20210122.1":"2021-01-22T15:13:15.886Z","1.0.0-beta.4":"2021-01-26T01:55:14.129Z","1.0.0-alpha.20210126.1":"2021-01-26T15:13:34.505Z","1.0.0-alpha.20210127.1":"2021-01-27T15:14:56.694Z","1.0.0-alpha.20210128.1":"2021-01-28T15:15:07.978Z","1.0.0-alpha.20210129.1":"2021-01-29T15:13:20.436Z","1.0.0-alpha.20210201.1":"2021-02-01T15:13:32.631Z","1.0.0-alpha.20210202.1":"2021-02-02T15:20:35.733Z","1.0.0-alpha.20210203.1":"2021-02-03T15:27:22.683Z","1.0.0-alpha.20210204.1":"2021-02-04T15:24:02.823Z","1.0.0-alpha.20210205.1":"2021-02-05T15:25:29.713Z","1.0.0-alpha.20210208.1":"2021-02-08T15:28:50.860Z","1.0.0-alpha.20210209.1":"2021-02-09T15:15:15.618Z","1.0.0-alpha.20210210.1":"2021-02-10T15:16:17.402Z","1.0.0-alpha.20210211.1":"2021-02-11T15:12:15.642Z","1.0.0-alpha.20210212.1":"2021-02-12T15:21:47.389Z","1.0.0-alpha.20210215.1":"2021-02-15T15:14:37.215Z","1.0.0-alpha.20210216.1":"2021-02-16T15:24:39.791Z","1.0.0-alpha.20210217.1":"2021-02-17T15:11:12.174Z","1.0.0-alpha.20210218.1":"2021-02-18T15:13:51.572Z","1.0.0-alpha.20210219.1":"2021-02-19T15:12:46.323Z","1.0.0-alpha.20210222.1":"2021-02-22T15:11:49.234Z","1.0.0-alpha.20210223.1":"2021-02-23T15:15:42.497Z","1.0.0-alpha.20210225.1":"2021-02-25T15:12:44.863Z","1.0.0-alpha.20210226.1":"2021-02-26T15:13:29.055Z","1.0.0-alpha.20210301.1":"2021-03-01T15:13:41.604Z","1.0.0-alpha.20210302.1":"2021-03-02T15:14:55.999Z","1.0.0-alpha.20210303.1":"2021-03-03T15:11:20.475Z","1.0.0-alpha.20210316.1":"2021-03-16T14:31:49.036Z","1.0.0-alpha.20210317.1":"2021-03-17T14:23:11.931Z","1.0.0-alpha.20210318.1":"2021-03-18T14:17:30.185Z","1.0.0-alpha.20210319.1":"2021-03-19T14:53:29.297Z","1.0.0-alpha.20210322.1":"2021-03-22T14:14:06.697Z","1.0.0-alpha.20210323.1":"2021-03-23T14:14:53.204Z","1.0.0-alpha.20210324.1":"2021-03-24T14:15:18.262Z","1.0.0-alpha.20210325.1":"2021-03-25T14:15:21.872Z"},"bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"author":{"name":"Microsoft Corporation"},"license":"MIT","homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/communication-administration/","keywords":["azure","cloud","communication"],"repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"description":"SDK for Azure Communication service which facilitates user token administration.","maintainers":[{"email":"azure-sdk-npmjs@microsoft.com","name":"azure-sdk"},{"email":"npmjs@microsoft.com","name":"microsoft1es"},{"email":"microsoft-oss-publishing@microsoft.com","name":"microsoft-oss-releases"}],"readme":"","readmeFilename":""}