{"bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"a25e2e371ab36803ed85d1b37735af62dfc49c59","tarball":"https://registry.npmjs.org/@azure/core-https/-/core-https-1.0.0-alpha.20210209.1.tgz","fileCount":246,"integrity":"sha512-thBojYAtpUSrZcqRQ+zri8Tb1XbqZv/tY3wOsfU5fr4g6lDRHUtfXpexw2T2DLW49pxGcCPazc31s4JHVCHwWw==","signatures":[{"sig":"MEUCIQDBzk5yJe10iDRhNySWcgqs4Cfngap/1HR9FTOXCnop6QIgUIXDQCa4/68YxOGyIkkO4HCxgHPlQIXvbPh9dLsH0LM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":574781,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIuHGCRA9TVsSAnZWagAATbIP/0KMQR7Hs5NSRwgGysAS\nNdY3KvFTXuCCXM2FV0DUaq6U8N5vs8xVFcDKAvTykqn+9zN1ZvwCGQPFrQOp\nSXqKu2A9+F/EGW8qhaKRv0TfBmNq/Ny0ZCfoQEiN4hpYL8d/JhuA0YvLtu8W\nJ5FvUwUhxO8XhTCPuIAz2oAO7Q3ouKytGHPPiq/6Y+LlC245QeeXGtJN8csV\n5VfY344AI60W+0lg2sPtSTfdltGXR/KpWgb9WBrFaK751jhMuL8k92WoPM8b\ngu3hlor2aw29ldCMTuiyFS5soOoNpZEifuAcxG1zlSadVULNXuLZB44TGkrD\ny8YVtAYbq4r2VGf70uOIlzoW8w9Rnt6mYXaOBo3UjP9Sk7qD4rsutCUjn/r6\nw3RkM9vwwhtkJu1Gcfx1RTI1N1hai7C9FkSAxhilvOWLGpnIKiTGREBqpX5y\neTrveUtr/DLGPk9FnrqFS83UZQssNKvT8RuocJQi5k/has+8TJzgjO61DoTk\nyAsUosUHEE4A1EnQH+rwOIfeApbPl/rRPNOK7mYt5CGB+CwLgW4VeY9K6g+I\n05x434Oh96Adak6mItfQXK7mr+Q6mHH3SeYqUOLantYHQlQiIGgu6IutUroy\ny4DTlDtEI14dqBqNo8183R8v/rDnKVEkN16MFRQXhXzeO4MTnVfYhbNrShgf\neFzA\r\n=q9pd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","name":"@azure/core-https","_from":"file:/mnt/vss/_work/1/packages/azure-core-https-1.0.0-alpha.20210209.1.tgz","types":"types/latest/core-https.d.ts","author":{"name":"Microsoft Corporation"},"module":"dist-esm/src/index.js","readme":"# Azure Core HTTP client library for JavaScript (Experimental)\n\nThis is the core HTTP pipeline for Azure SDK JavaScript libraries which work in the browser and Node.js. This library is primarily intended to be used in code generated by [AutoRest](https://github.com/Azure/Autorest) and [`autorest.typescript`](https://github.com/Azure/autorest.typescript).\n\n## Getting started\n\n### Requirements\n\n- [Node.js](https://nodejs.org) version > 8.x\n\n### Installation\n\nThis package is primarily used in generated code and not meant to be consumed directly by end users.\n\n## Key concepts\n\n### PipelineRequest\n\nA `PipelineRequest` describes all the information necessary to make a request to an HTTP REST endpoint.\n\n### PipelineResponse\n\nA `PipelineResponse` describes the HTTP response (body, headers, and status code) from a REST endpoint that was returned after making an HTTP request.\n\n### SendRequest\n\nA `SendRequest` method is a method that given a `PipelineRequest` can asynchronously return a `PipelineResponse`.\n\n```ts\nexport type SendRequest = (request: PipelineRequest) => Promise<PipelineResponse>;\n```\n\n### HttpsClient\n\nAn `HttpsClient` is any object that satisfies the following interface to implement a `SendRequest` method:\n\n```ts\nexport interface HttpsClient {\n  /**\n   * The method that makes the request and returns a response.\n   */\n  sendRequest: SendRequest;\n}\n```\n\n`HttpsClient`s are expected to actually make the HTTP request to a server endpoint, using some platform-specific mechanism for doing so.\n\n### Pipeline Policies\n\nA `PipelinePolicy` is a simple object that implements the following interface:\n\n```ts\nexport interface PipelinePolicy {\n  /**\n   * The policy name. Must be a unique string in the pipeline.\n   */\n  name: string;\n  /**\n   * The main method to implement that manipulates a request/response.\n   * @param request The request being performed.\n   * @param next The next policy in the pipeline. Must be called to continue the pipeline.\n   */\n  sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse>;\n}\n```\n\nIt is similar in shape to `HttpsClient`, but includes a policy name as well as a slightly modified `SendRequest` signature that allows it to conditionally call the next policy in the pipeline.\n\nOne can view the role of policies as that of `middleware`, a concept that is familiar to NodeJS developers who have worked with frameworks such as [Express](https://expressjs.com/).\n\nThe `sendRequest` implementation can both transform the outgoing request as well as the incoming response:\n\n```ts\nconst customPolicy = {\n  name: \"My wonderful policy\",\n  async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n    // Change the outgoing request by adding a new header\n    request.headers.set(\"X-Cool-Header\", 42);\n    const result = await next(request);\n    if (response.status === 403) {\n      // Do something special if this policy sees Forbidden\n    }\n    return result;\n  }\n};\n```\n\nMost policies only concern themselves with either the request or the response, but there are some exceptions such as the [LogPolicy](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/core/core-https/src/policies/logPolicy.ts) which logs information from each.\n\n### Pipelines\n\nA `Pipeline` is an object that manages a set of `PipelinePolicy` objects. Its main function is to ensure that policies are executed in a consistent and predictable order.\n\nYou can think of policies being applied like a stack (first-in/last-out.) The first `PipelinePolicy` is able to modify the `PipelineRequest` before any other policies, and it is also the last to modify the `PipelineResponse`, making it the closest to the caller. The final policy is the last able to modify the outgoing request, and the first to handle the response, making it the closest to the network.\n\nA `Pipeline` satisfies the following interface:\n\n```ts\nexport interface Pipeline {\n  addPolicy(policy: PipelinePolicy, options?: AddPolicyOptions): void;\n  removePolicy(options: { name?: string; phase?: PipelinePhase }): PipelinePolicy[];\n  sendRequest(httpsClient: HttpsClient, request: PipelineRequest): Promise<PipelineResponse>;\n  getOrderedPolicies(): PipelinePolicy[];\n  clone(): Pipeline;\n}\n```\n\nAs you can see it allows for policies to be added or removed and it is loosely coupled with `HttpsClient` to perform the real request to the server endpoint.\n\nOne important concept for `Pipeline`s is that they group policies into ordered phases:\n\n1. Serialize Phase\n2. Policies not in a phase\n3. Deserialize Phase\n4. Retry Phase\n\nPhases occur in the above order, with serialization policies being applied first and retry policies being applied last. Most custom policies fall into the second bucket and are not given a phase name.\n\nWhen adding a policy to the pipeline you can specify not only what phase a policy is in, but also if it has any dependencies:\n\n```ts\nexport interface AddPolicyOptions {\n  beforePolicies?: string[];\n  afterPolicies?: string[];\n  afterPhase?: PipelinePhase;\n  phase?: PipelinePhase;\n}\n```\n\n`beforePolicies` are policies that the new policy must execute before and `afterPolicies` are policies that the new policy must happen after. Similarly, `afterPhase` means the policy must only execute after the specified phase has occurred.\n\nThis syntax allows custom policy authors to express any necessary relationships between their own policies and the built-in policies provided by `@azure/core-https` when creating a pipeline using `createPipelineFromOptions`.\n\nImplementers are also able to remove policies by name or phase, in the case that they wish to modify an existing `Pipeline` without having to create a new one using `createEmptyPipeline`. The `clone` method is particularly useful when recreating a `Pipeline` without modifying the original.\n\nAfter all other constraints have been satisfied, policies are applied in the order which they were added.\n\n## Examples\n\nExamples can be found in the `samples` folder.\n\n## Next steps\n\nYou can build and run the tests locally by executing `rushx test`. Explore the `test` folder to see advanced usage and behavior of the public classes.\n\n## Troubleshooting\n\nIf you run into issues while using this library, please feel free to [file an issue](https://github.com/Azure/azure-sdk-for-js/issues/new).\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![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcore%2Fcore-https%2FREADME.png)\n","browser":{"./dist-esm/src/util/url.js":"./dist-esm/src/util/url.browser.js","./dist-esm/src/util/inspect.js":"./dist-esm/src/util/inspect.browser.js","./dist-esm/src/defaultHttpsClient.js":"./dist-esm/src/defaultHttpsClient.browser.js","./dist-esm/src/policies/proxyPolicy.js":"./dist-esm/src/policies/proxyPolicy.browser.js","./dist-esm/src/util/userAgentPlatform.js":"./dist-esm/src/util/userAgentPlatform.browser.js","./dist-esm/src/policies/formDataPolicy.js":"./dist-esm/src/policies/formDataPolicy.browser.js","./dist-esm/src/policies/decompressResponsePolicy.js":"./dist-esm/src/policies/decompressResponsePolicy.browser.js"},"engines":{"node":">=8.0.0"},"license":"MIT","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 coreHttps-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run clean && npm run build:ts && npm run bundle:test:node && npm run unit-test:node && npm run bundle:test:browser && npm run unit-test:browser && npm run integration-test:node && npm run integration-test:browser","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"npm run build:ts && rollup -c 2>&1 && api-extractor run --local && npm run build:types","clean":"rimraf dist dist-* types *.tgz *.log","format":"prettier --write \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","build:ts":"tsc -p .","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:node && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:node":"npm run build:ts && cross-env ONLY_NODE=true rollup -c 2>&1","build:test":"npm run build:ts && npm run bundle:test","build:types":"downlevel-dts types/latest/ types/3.1/","bundle:test":"rollup -c rollup.test.config.js 2>&1","extract-api":"npm run build:ts && api-extractor run --local","check-format":"prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test:browser && npm run unit-test:browser && npm run integration-test:browser","build:browser":"npm run build:ts && cross-env ONLY_BROWSER=true rollup -c 2>&1","build:samples":"echo Skipped.","unit-test:node":"mocha --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js","build:test:node":"npm run build:ts && npm run bundle:test:node","execute:samples":"echo skipped","bundle:test:node":"cross-env ONLY_NODE=true rollup -c rollup.test.config.js 2>&1","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","build:test:browser":"npm run build:ts && npm run bundle:test:browser","bundle:test:browser":"cross-env ONLY_BROWSER=true rollup -c rollup.test.config.js 2>&1","integration-test:node":"echo skipped","integration-test:browser":"echo skipped"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"homepage":"https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/core/core-https/","keywords":["azure","cloud"],"prettier":"@azure/eslint-plugin-azure-sdk/prettier.json","sdk-type":"client","_resolved":"","//metadata":{"constantPaths":[{"path":"src/constants.ts","prefix":"SDK_VERSION"}]},"_integrity":"","deprecated":"This package has been replaced by @azure/core-rest-pipeline","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.11","description":"Isomorphic client library for making HTTPS requests in node.js and browser.","directories":{},"maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"sideEffects":false,"_nodeVersion":"14.15.4","dependencies":{"uuid":"^8.3.0","tslib":"^2.0.0","form-data":"^3.0.0","@azure/logger":"^1.0.0","@azure/core-auth":"^1.1.3","https-proxy-agent":"^5.0.0","@opentelemetry/api":"^0.10.2","@azure/core-tracing":"^1.0.0-alpha","@azure/abort-controller":"^1.0.0"},"typesVersions":{"<3.6":{"types/latest/src/*":["types/3.1/src/*"]}},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","util":"^0.12.1","karma":"^5.1.0","mocha":"^7.1.1","sinon":"^9.0.2","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","@types/uuid":"^8.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","downlevel-dts":"~0.4.0","karma-coverage":"^2.0.0","karma-ie-launcher":"^1.0.0","source-map-support":"^0.5.9","@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","@microsoft/api-extractor":"7.7.11","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-visualizer":"^4.0.4","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^8.0.0","@azure/eslint-plugin-azure-sdk":"^3.0.0-alpha"},"_npmOperationalInternal":{"tmp":"tmp/core-https_1.0.0-alpha.20210209.1_1612898758033_0.34404068031621593","host":"s3://npm-registry-packages"},"_id":"@azure/core-https@1.0.0-alpha.20210209.1","version":"1.0.0-alpha.20210209.1"}