{"_id":"@advanced-rest-client/anypoint","_rev":"8-80fe0e4fca31013459ebfa9161e824b8","name":"@advanced-rest-client/anypoint","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@advanced-rest-client/anypoint","version":"1.0.0","keywords":["advanced-rest-client","settings"],"author":{"name":"Pawel Uchida-Psztyc","email":"pawel.psztyc@gmail.com"},"license":"Apache-2.0","_id":"@advanced-rest-client/anypoint@1.0.0","maintainers":[{"name":"jarrodek","email":"jarrodek@gmail.com"},{"name":"twoplustwoone","email":"francisco.digiandomenico@gmail.com"},{"name":"lbauret","email":"leandro.bauret@mulesoft.com"},{"name":"carowright","email":"carolina.wright@mulesoft.com"}],"contributors":[{"name":"Your name can be here!"}],"homepage":"https://github.com/advanced-rest-client/anypoint#readme","bugs":{"url":"https://github.com/advanced-rest-client/anypoint/issues","email":"arc@mulesoft.com"},"dist":{"shasum":"9eae85cab354aab3cf4c7f2e8f47bd0e1f79c069","tarball":"https://registry.npmjs.org/@advanced-rest-client/anypoint/-/anypoint-1.0.0.tgz","fileCount":16,"integrity":"sha512-S2xT60x+LVQNMCWmXQDLDvih9S/1KGboLpIWRcdlrlCBYtluD4lA2eKG5WWs39UxB+umFxNX5UCYcpGkeO/BMw==","signatures":[{"sig":"MEUCIQCIHa5MSwTOOjrKiAbIGRsyiYhVl5qpam1X3fYWl/MH6wIgbLAV9CN/yAVKZKI+OSIXJQBm0ZwiBdtX09DRmIt3I84=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83104},"main":"index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"module":"index.js","gitHead":"18cb74be8fe75bf5c4d2133879e15152a40a5247","scripts":{"lint":"npm run lint:eslint","test":"web-test-runner test/**/*.test.js --coverage --node-resolve --playwright --browsers chromium firefox webkit","start":"web-dev-server --app-index demo/index.html --node-resolve --open --watch --root-dir .","format":"npm run format:eslint","gen:wc":"wca analyze \"*.js\" --outFile custom-elements.json","lint:types":"tsc","test:watch":"web-test-runner test/**/*.test.js --node-resolve --watch --playwright --browsers chromium","lint:eslint":"eslint --ext .js,.html . --ignore-path .gitignore","format:eslint":"eslint --ext .js,.html . --fix --ignore-path .gitignore"},"_npmUser":{"name":"jarrodek","email":"jarrodek@gmail.com"},"repository":{"url":"git://github.com/advanced-rest-client/anypoint.git","type":"git"},"_npmVersion":"6.14.15","description":"A package for ARC with libraries to work with Anypoint Platform","directories":{},"lint-staged":{"*.js":["eslint --fix"]},"_nodeVersion":"14.18.1","dependencies":{"lit-html":"^1.4.1","lit-element":"^2.5.1","@advanced-rest-client/icons":"^4.0.0","@anypoint-web-components/awc":"^1.0.7","@anypoint-web-components/anypoint-signin":"^8.0.0"},"eslintConfig":{"extends":["@open-wc/eslint-config","eslint-config-prettier"],"overrides":[{"files":["demo/**/*.js","test/**/*.js","**/demo/**/*.html"],"rules":{"no-console":"off","no-plusplus":"off","no-param-reassing":"off","no-unused-expressions":"off","class-methods-use-this":"off","import/no-extraneous-dependencies":"off"}}]},"_hasShrinkwrap":false,"devDependencies":{"chalk":"^4.1.2","sinon":"^11.1.2","eslint":"^8.1.0","get-port":"^6.0.0","typescript":"^4.4.4","@web/dev-server":"^0.1.25","@open-wc/testing":"^3.0.1","@web/test-runner":"^0.13.20","@open-wc/eslint-config":"^7.0.0","eslint-config-prettier":"^8.3.0","typescript-lit-html-plugin":"^0.9.0","@web/test-runner-playwright":"^0.8.8","@advanced-rest-client/arc-mock":"^5.0.0","@advanced-rest-client/arc-demo-helper":"^5.0.2"},"_npmOperationalInternal":{"tmp":"tmp/anypoint_1.0.0_1635275504572_0.8901129215620904","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@advanced-rest-client/anypoint","version":"1.0.1","keywords":["advanced-rest-client","settings"],"author":{"name":"Pawel Uchida-Psztyc","email":"pawel.psztyc@gmail.com"},"license":"Apache-2.0","_id":"@advanced-rest-client/anypoint@1.0.1","maintainers":[{"name":"jarrodek","email":"jarrodek@gmail.com"},{"name":"twoplustwoone","email":"francisco.digiandomenico@gmail.com"},{"name":"lbauret","email":"leandro.bauret@mulesoft.com"},{"name":"carowright","email":"carolina.wright@mulesoft.com"}],"contributors":[{"name":"Your name can be here!"}],"homepage":"https://github.com/advanced-rest-client/anypoint#readme","bugs":{"url":"https://github.com/advanced-rest-client/anypoint/issues","email":"arc@mulesoft.com"},"dist":{"shasum":"d2238371a1ec5b957ef694defded0d201fae68df","tarball":"https://registry.npmjs.org/@advanced-rest-client/anypoint/-/anypoint-1.0.1.tgz","fileCount":16,"integrity":"sha512-opYbBlrpyJ0+eLTro2PeBmVtoYjInvCtXesM9W13R1vTijWAsUCEx5jL3AzGFOiQjkYIpdanpuqFsPWLVML+LQ==","signatures":[{"sig":"MEYCIQC0a4rndHkHDMmZfWPkzN1vBuc9sItEpmUAUpETdY+ZJgIhAKlF7PPk2ACDYSUhgsfnX8k16btnfWA51I/O0Loqt/R0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83104,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhwtWJCRA9TVsSAnZWagAA8ZIQAIai2c4xMbcZORqWhN+y\nl8csNnXTBK/6ctG9ohyP8b0MHjMerst86pfGSSEfXaEzaPqLCFA3J4ZYXqFa\nlF/SP7MOBS7zXAtgieiNWsozCTkkl+XuCZZZBTZMq56kXDJneHoXGLM5gVDU\nxOS2rZUVs/jOtw+9isox+dwZ6peHV5RegOfl8dRMYGB5BO/I+cQEjH2xv3k7\nd5tsTvSSOlEGknuv2Ru0LZ74LSmVkTA3OvpTTB8WvF4KRRsID4t78+mD9JFn\nUgZYfjja+MDsucuPxez2zSvLJUzpOSUNjn+q7TMjGsQKAI9F/rFp0iz7GcJB\nH6kd0Tzg7SHustzR+OejQiu5PFjFgoyPAxZgS8fWtf2k4Zx1cIa0vQ8abD09\nnpwjKDqIPo1puUMuaRqmHVNSbTeJtSUg5JYDyYtR34r1uo06QkzWBdHh045m\nNqGESf/oNNbWZ19gFc4iBSEUMdDonGne7Ptd+zgsw3DpLxaYUO6bELHBCMWS\nqmES2Tea+aNa+KXBeY5UW6bh/UrcRRM+wQBlhVYFF1D7OzFn8dEerjnTDtIz\nO73de7JSfwi1GmiyjNx9ipAjppkJuChV7ygmz/DLvj+lY/7XaksNGhCGqlnJ\noxkRyHTKulp8z4MNfsH7UGUaEGz56Jam/OnKPqjLLoy0aJUJhmv3iPBkCgUp\nFoe3\r\n=AHRa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"module":"index.js","gitHead":"b524f1f383a16ccb31fb6ff71aaa9f6df7fb20ff","scripts":{"lint":"npm run lint:eslint","test":"web-test-runner test/**/*.test.js --coverage --node-resolve --playwright --browsers chromium firefox webkit","start":"web-dev-server --app-index demo/index.html --node-resolve --open --watch --root-dir .","format":"npm run format:eslint","gen:wc":"wca analyze \"*.js\" --outFile custom-elements.json","lint:types":"tsc","test:watch":"web-test-runner test/**/*.test.js --node-resolve --watch --playwright --browsers chromium","lint:eslint":"eslint --ext .js,.html . --ignore-path .gitignore","format:eslint":"eslint --ext .js,.html . --fix --ignore-path .gitignore"},"_npmUser":{"name":"jarrodek","email":"jarrodek@gmail.com"},"repository":{"url":"git://github.com/advanced-rest-client/anypoint.git","type":"git"},"_npmVersion":"6.14.15","description":"A package for ARC with libraries to work with Anypoint Platform","directories":{},"lint-staged":{"*.js":["eslint --fix"]},"_nodeVersion":"14.18.1","dependencies":{"lit-html":"^1.4.1","lit-element":"^2.5.1","@advanced-rest-client/icons":"^4.0.0","@anypoint-web-components/awc":"^1.0.7","@anypoint-web-components/anypoint-signin":"^8.0.1"},"eslintConfig":{"extends":["@open-wc/eslint-config","eslint-config-prettier"],"overrides":[{"files":["demo/**/*.js","test/**/*.js","**/demo/**/*.html"],"rules":{"no-console":"off","no-plusplus":"off","no-param-reassing":"off","no-unused-expressions":"off","class-methods-use-this":"off","import/no-extraneous-dependencies":"off"}}]},"_hasShrinkwrap":false,"devDependencies":{"chalk":"^4.1.2","sinon":"^11.1.2","eslint":"^8.1.0","get-port":"^6.0.0","typescript":"^4.4.4","@web/dev-server":"^0.1.26","@open-wc/testing":"^3.0.2","@web/test-runner":"^0.13.20","@open-wc/eslint-config":"^7.0.0","eslint-config-prettier":"^8.3.0","typescript-lit-html-plugin":"^0.9.0","@web/test-runner-playwright":"^0.8.8","@advanced-rest-client/arc-mock":"^5.0.0","@advanced-rest-client/arc-demo-helper":"^5.0.2"},"_npmOperationalInternal":{"tmp":"tmp/anypoint_1.0.1_1635867161500_0.7616322783969429","host":"s3://npm-registry-packages"}}},"time":{"created":"2021-10-26T19:11:44.525Z","modified":"2026-04-07T19:23:55.122Z","1.0.0":"2021-10-26T19:11:44.749Z","1.0.1":"2021-11-02T15:32:41.650Z"},"bugs":{"url":"https://github.com/advanced-rest-client/anypoint/issues","email":"arc@mulesoft.com"},"author":{"name":"Pawel Uchida-Psztyc","email":"pawel.psztyc@gmail.com"},"license":"Apache-2.0","homepage":"https://github.com/advanced-rest-client/anypoint#readme","keywords":["advanced-rest-client","settings"],"repository":{"url":"git://github.com/advanced-rest-client/anypoint.git","type":"git"},"description":"A package for ARC with libraries to work with Anypoint Platform","contributors":[{"name":"Your name can be here!"}],"maintainers":[{"email":"jarrodek@gmail.com","name":"jarrodek"},{"email":"alexperez@mulesoft.com","name":"alexperez_march_2024"},{"email":"elmellidiego@gmail.com","name":"dmacias"}],"readme":"# Anypoint for ARC\n\nAn element that renders an UI to search Anypoint Exchange for available assets.\n\n## Usage\n\n### Installation\n\n```sh\nnpm install --save @advanced-rest-client/anypoint\n```\n\n### In an html file\n\n```html\n<html>\n  <head>\n    <script type=\"module\">\n      import '@advanced-rest-client/anypoint/define/exchange-search.js';\n    </script>\n  </head>\n  <body>\n    <exchange-search></exchange-search>\n  </body>\n</html>\n```\n\n### In a LitElement template\n\n```js\nimport { LitElement, html } from 'lit-element';\nimport '@advanced-rest-client/anypoint/define/exchange-search.js';\n\nclass SampleElement extends LitElement {\n  render() {\n    return html`\n    <exchange-search\n      .columns=\"${columns}\"\n      @selected=\"${this._assetHandler}\"\n    ></exchange-search>\n    `;\n  }\n\n  _assetHandler(e) {\n    console.log(e.detail);\n  }\n}\ncustomElements.define('sample-element', SampleElement);\n```\n\n### Authorization\n\nThe element uses `@anypoint-web-components/anypoint-signin` to sing a user in.\nSet `anypointAuth`, `exchangeRedirectUri`, and `exchangeClientId` attributes to enable the authorization button.\n\n```html\n<exchange-search\n  anypointAuth\n  exchangeRedirectUri=\"${redirectUrl}\"\n  exchangeClientId=\"${clientId}\"\n  @anypointcodeexchange=\"${this._processCodeExchange}\"\n></exchange-search>\n```\n\nNote, that currently the Anypoint authorization server only support \"code\" oauth flow. This means you have to handle code response and exchange the code for access token. To do so, handle the `anypointcodeexchange` event dispatched by the `anypoint-signin` element.\n\n```javascript\n\n/**\n * @param {AnypointCodeExchangeEvent} e\n */\n_handleTokenExchange(e) {\n  const { code } = e;\n  e.detail.result = this.exchangeCode(code);\n}\n\n/**\n * @param {string} code\n * @returns {Promise<TokenInfo>}\n */\nasync exchangeCode(code) {\n  const init = {\n    method: 'POST',\n    body: code,\n  };\n  const response = await fetch('YOUR SERVER URL', init);\n  const info = await response.json();\n  return {\n    accessToken: info.accessToken,\n    expiresAt: Date.now() + info.expiresIn,\n    expiresIn: info.expiresIn,\n    expiresAssumed: false,\n    state: '0', // this is required by the types definition but can be anything. State is checked before this function is called\n  };\n  }));\n}\n```\n\n## Development\n\n```sh\ngit clone https://github.com/advanced-rest-client/anypoint\ncd anypoint\nnpm install\n```\n\n### Running the demo locally\n\n```sh\nnpm start\n```\n\n### Running the tests\n\n```sh\nnpm test\n```\n","readmeFilename":"README.md"}