{"name":"@azure/core-lro","version":"2.2.2","keywords":["isomorphic","browser","javascript","node","microsoft","lro","polling","azure","cloud"],"author":"Microsoft Corporation","license":"MIT","_id":"@azure/core-lro@2.2.2","homepage":"https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-lro/README.md","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"nyc":{"all":true,"exclude":["coverage/**/*","**/*.d.ts","**/*.js"],"reporter":["text","html","cobertura"],"extension":[".ts"]},"dist":{"shasum":"1f81a712d6bea6912918c5157553e6c7883e08d9","tarball":"http://registry-npm.ywwl.com/@azure/core-lro/download/@azure/core-lro-2.2.2.tgz","fileCount":35,"integrity":"sha512-pn30b+HyJHg0+G4ZRgpL3BJa6LQnKdKl1X4JDMpuVsX+kPxs2FNoweNqD3Li199ROroIvFbi6pE29y0J2vvyIg==","signatures":[{"sig":"MEQCIESyS6vJVK12aPGTX83GGEuKLXuO/CLCSlU7XbVFWlMdAiA7qeewsMHD4D7PY+g+TPBD+0cjBJJ688Mga6KpXDky+A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":214930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhqP29CRA9TVsSAnZWagAAogIP/iSJTAQb/C3Z477uFqPw\neF5VikVg+seYIy7mXhx2YfOYKlMFw08k6cTbm0AuqXi5GaIIqE0cCsekDliz\nEN2/tmF1kHH8E7qqtDKVxnc9wEhbJ7dvd1yV2MIO9wVN5Rn96dLAadBaB80Z\nNequhRK4WwXzs2GvvbnKbjHXxNsJVDF7qj4JYIhK0aOq8d4SeAF7PrMAWqU7\nuPLcRTztvAiFIwFRtGoiQy4i8VYRwZ29BJqN2Z724q9Kg5ann4r+5XCAgUa5\nZBCliAGaA8B/ih/nFzbjjWABMLdFA+mxHcYxkuITUVhqTd8qd7mIPmhCakbt\nGeHV7lOJl+dsaekm60k8HkKB/6gi9ute6+pE7dQIaI0VBqYArHj9SZBHZOFD\nYJzT6lnds0+/mBW5sU+8qVSMoVFoOYJv7oDNoIL3tjAaVglB2yfJNpl17ee5\ngMd3KfRYdUIFa1Lo8Ho9370FIWUIcecFmW5dFyOE/79pEq1dc7aA8uUj9lZN\nACBMhI7Yb9ypu3USehrrIkbkntRZwgqHtWHCTkE6sjd/pwzNq1gI8JhUBrQz\nQ6RnLT3KGbe1ibrpytAh+Pv8M3P3ukkIR70++aGXWYfauIHtsd+c/IlVC5R7\nCCEF2AsAfvSz41geHbwwmN+kUV4u+dwW7N6xdOGWk0RmmnPmFYh629z/LfcH\nMVZA\r\n=TBsV\r\n-----END PGP SIGNATURE-----\r\n","size":48439,"noattachment":false,"key":"/@azure/core-lro/-/@azure/core-lro-2.2.2.tgz"},"main":"./dist/index.js","tags":["isomorphic","browser","javascript","node","microsoft","lro","polling"],"_from":"file:/mnt/vss/_work/1/packages/azure-core-lro/azure-core-lro-2.2.2.tgz","types":"./types/core-lro.d.ts","module":"dist-esm/src/index.js","browser":{"os":false,"process":false},"engines":{"node":">=12.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","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test","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 clean && tsc -p . && rollup -c 2>&1 && api-extractor run --local","clean":"rimraf dist dist-* types *.log browser statistics.html coverage src/**/*.js test/**/*.js","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"","lint:fix":"eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","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:test":"tsc -p . && rollup -c 2>&1","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:samples":"echo Obsolete","unit-test:node":"cross-env TS_NODE_FILES=true TS_NODE_COMPILER_OPTIONS=\"{\\\"module\\\":\\\"commonjs\\\"}\" nyc mocha -r ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace  --exclude \"test/**/browser/*.spec.ts\" \"test/**/*.spec.ts\"","execute:samples":"echo skipped","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"echo skipped","integration-test:browser":"echo skipped"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"sdk-type":"client","_resolved":"/mnt/vss/_work/1/packages/azure-core-lro/azure-core-lro-2.2.2.tgz","_integrity":"sha512-pn30b+HyJHg0+G4ZRgpL3BJa6LQnKdKl1X4JDMpuVsX+kPxs2FNoweNqD3Li199ROroIvFbi6pE29y0J2vvyIg==","repository":"github:Azure/azure-sdk-for-js","_npmVersion":"8.1.0","description":"Isomorphic client library for supporting long-running operations in node.js and browser.","directories":{},"sideEffects":false,"_nodeVersion":"16.13.0","dependencies":{"tslib":"^2.2.0","@azure/logger":"^1.0.0","@azure/core-tracing":"1.0.0-preview.13","@azure/abort-controller":"^1.0.0"},"react-native":{"./dist/index.js":"./dist-esm/src/index.js"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","karma":"^6.2.0","mocha":"^7.1.1","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","ts-node":"^10.0.0","typedoc":"0.15.2","prettier":"^1.16.4","cross-env":"^7.0.2","uglify-js":"^3.4.9","typescript":"~4.2.0","@types/chai":"^4.1.6","@types/node":"^12.0.0","karma-mocha":"^2.0.1","npm-run-all":"^4.1.5","@types/mocha":"^7.0.2","karma-coverage":"^2.0.0","@azure/dev-tool":"^1.0.0","@azure/core-http":"^2.0.0","karma-ie-launcher":"^1.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","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@microsoft/api-extractor":"^7.18.11","@azure/core-rest-pipeline":"^1.1.0","@azure/eslint-plugin-azure-sdk":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/core-lro_2.2.2_1638464957659_0.8374149876433894","host":"s3://npm-registry-packages"},"readme":"# Azure Core LRO client library for JavaScript\n\nThis is the default implementation of long running operations in Azure SDK JavaScript client libraries which work in both the browser and NodeJS. This library is primarily intended to be used in code generated by the [TypeSpec](https://typespec.io) [`@azure-tools/typespec-ts`](https://github.com/Azure/typespec-azure/tree/main/packages/typespec-ts) emitter.\n\n`@azure/core-lro` follows [The Azure SDK Design Guidelines for Long Running Operations](https://azure.github.io/azure-sdk/typescript_design.html#ts-lro)\n\nKey links:\n\n- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-lro)\n- [Package (npm)](https://www.npmjs.com/package/@azure/core-lro)\n- [API Reference Documentation](https://learn.microsoft.com/javascript/api/@azure/core-lro)\n- [Samples](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-lro/samples)\n\n## Getting started\n\n### Currently supported environments\n\n- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)\n- Latest versions of Safari, Chrome, Edge, and Firefox.\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### `PollerLike`\n\nA poller is an object that can poll the long running operation on the server for its state until it reaches a terminal state. It also extends `Promise<TResult>`, so you can `await` it directly to get the final result. It provides the following:\n\n- `operationState`: a property that returns the current state of the operation, typed as a type that extends `OperationState`. It is `undefined` if the poller has not been submitted yet.\n- `result`: a property that returns the result of the operation when it completes and `undefined` otherwise\n- `isDone`: a property that returns whether the operation is in a terminal state\n- `onProgress`: registers callback functions to be called every time a polling response is received\n- `poll`: sends a single polling request\n- `pollUntilDone`: returns a promise that will resolve with the result of the operation\n- `serialize`: returns a promise that resolves to a serialized representation of the poller's state\n- `submitted`: returns a promise that resolves when the poller has been submitted successfully\n\n### `OperationState`\n\nA type for the operation state. It contains a `status` field with the following possible values: `notStarted`, `running`, `succeeded`, `failed`, and `canceled`. It can be accessed as follows:\n\n```typescript snippet:OperationStateExample\nswitch (poller.operationState?.status) {\n  case \"succeeded\": // return poller.result;\n  case \"failed\": // throw poller.operationState?.error;\n  case \"canceled\": // throw new Error(\"Operation was canceled\");\n  case \"running\": // ...\n  case \"notStarted\": // ...\n}\n```\n\n### `createHttpPoller`\n\nA function that returns an object of type `PollerLike`. This poller behaves as follows in the presence of errors:\n\n- calls to `poll` and `pollUntilDone` will throw an error in case the operation has failed or canceled unless the `resolveOnUnsuccessful` option was set to true.\n- `poller.operationState?.status` will be set to `\"failed\"` or `\"canceled\"` when either the operation fails or it returns an error response.\n\n## Examples\n\nExamples can be found in the `samples` folder.\n\n## Troubleshooting\n\n### Logging\n\nLogs can be added at the discretion of the library implementing the Long Running Operation poller.\nPackages inside of [azure-sdk-for-js](https://github.com/Azure/azure-sdk-for-js) use\n[@azure/logger](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).\n\n## Next steps\n\nPlease take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-lro/samples) directory 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/main/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n### Testing\n\nTo run our tests, first install the dependencies (with `pnpm install`),\nthen run the unit tests with: `pnpm run test:node`.\n\n### Code of Conduct\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n","publish_time":1638464957788,"maintainers":[{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},{"name":"microsoft1es","email":"npmjs@microsoft.com"}],"_cnpm_publish_time":1638464957788,"dist-tags":{"dev":"3.3.2-alpha.20260311.2","latest":"3.4.1"}}