{"_id":"@atlassian-partner-engineering/sweethub","_rev":"8-37bc8a73ba4a6a4f4f144895b06eb39e","name":"@atlassian-partner-engineering/sweethub","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.4":{"name":"@atlassian-partner-engineering/sweethub","version":"1.0.4","keywords":["opshub"],"author":{"name":"Daniel Hreben","email":"daniel.hreben@gmail.com"},"license":"ISC","_id":"@atlassian-partner-engineering/sweethub@1.0.4","maintainers":[{"name":"daniel.hreben","email":"daniel.hreben@gmail.com"},{"name":"jsarafajr","email":"ev.baraniuk@gmail.com"},{"name":"kannonboy","email":"kannonboy@gmail.com"},{"name":"modestfake","email":"modestfake@gmail.com"},{"name":"myokha","email":"max.yokha@gmail.com"}],"homepage":"https://bitbucket.org/atlassian/sweethub#readme","dist":{"shasum":"53277cc1de78efc91ecc63cdd01b619082df4b80","tarball":"https://registry.npmjs.org/@atlassian-partner-engineering/sweethub/-/sweethub-1.0.4.tgz","fileCount":6,"integrity":"sha512-vRW7RvtdVX6nzFyGEVYtY5xLmKcUHVN8h3421OSf+CxBYmvBCn+2icC/cMSs9jwGhoxihkf03lY5WSUm3ZTLqw==","signatures":[{"sig":"MEYCIQDQzdoumOv80Js2ikLrAoEo5QeJO0u2SnOiIjUbxwbldwIhAP5VJO6KmT6RMXOaBS7D7p96TQwMkItP/wxPbf0pTEvV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbDs55CRA9TVsSAnZWagAAII4P/3A/5OdiSmtMJhlGusGm\nTauxNJ5l+mhzYHWLD0ZoBII7sVJib2reaHzLlxk5XX3EvbstXiVph6i1SL0K\nYITVx4rXWHMP17kWcFDO/zIl7Cc8Clv/0zuihSQs/tsiR1KGAmqs0o4OjWzI\nfg7v2WOCJfEsGZwnDXOGocRcztV2K+fQqfND5+7PT2PFaZ1EaYZFpWQxJz04\nePBYDLIJtFR7k+MPBNq9c6Mwcrdeuqv64c+TsexbaIw+DeQ7d3huc/ueGMrQ\njmZSW+0y5c3WCgXVxGzNMJaMFAzJ6Cakoh3iGV+paatkEOT/F6BB49oGytQN\nFOfAIXq1ufcFVOhBld/l4JfmSVRMaiTUNl3h5BHkAVJKjo5NlPMvh29j+MfC\npVKyqqOakzESPXuQDwc6mqoCYDzWZ4OaDxb3rkawHpqeTaUe0xhMuKfwgiFF\nx60mlTufwYeCD6mOnwnJRRb83wJeCBAQEJoZapXLhpkMn40c3aXBF/Xzorrt\nPa1PyBZV7LENavFbHYSMsYrRRHuCKaL27LfQ+zXhpzid4hN9RvyFN93ObBqa\ndxhAyf3W5sDmY7om6Oewy8X3KKhf0923oT3eZ7PppFXw2+t7kxsQTer2L0sN\nGc0YQNdatZiNoJAbnvKymS8PJvidNnGjMeElXElHsi0UL22+P+tJaX9/xhWe\nBWoB\r\n=zoj1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./lib/index.js","gitHead":"922aed8687879f330e50b24bab98e0b8ede43742","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"daniel.hreben","email":"daniel.hreben@gmail.com"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","repository":{"url":"git+https://bitbucket.org/atlassian/sweethub.git","type":"git"},"_npmVersion":"6.1.0","description":"Wrapper for OpsHub API. Allows you develop your panels locally. No more \"bittersweet\".","directories":{},"_nodeVersion":"10.1.0","_hasShrinkwrap":false,"devDependencies":{"eslint":"^4.6.1","eslint-plugin-node":"^5.1.1","eslint-plugin-import":"^2.7.0","eslint-plugin-promise":"^3.5.0","eslint-config-standard":"^10.2.1","eslint-plugin-standard":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/sweethub_1.0.4_1527697016497_0.11426057292163438","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@atlassian-partner-engineering/sweethub","version":"1.1.0","keywords":["opshub"],"author":{"name":"Daniel Hreben","email":"daniel.hreben@gmail.com"},"license":"ISC","_id":"@atlassian-partner-engineering/sweethub@1.1.0","maintainers":[{"name":"dan-kushnaryov","email":"dan.kushnaryov@gmail.com"},{"name":"daniel.hreben","email":"daniel.hreben@gmail.com"},{"name":"icheremskyi","email":"icheremskyi@atlassian.com"},{"name":"jsarafajr","email":"ev.baraniuk@gmail.com"},{"name":"kannonboy","email":"kannonboy@gmail.com"},{"name":"modestfake","email":"modestfake@gmail.com"},{"name":"myokha","email":"max.yokha@gmail.com"}],"homepage":"https://bitbucket.org/atlassian/sweethub#readme","dist":{"shasum":"6037e8cd077ba051e4ef6835332be83128ea5c99","tarball":"https://registry.npmjs.org/@atlassian-partner-engineering/sweethub/-/sweethub-1.1.0.tgz","fileCount":6,"integrity":"sha512-8WN4BJlGJy94i95j88fSAtW7oj4EKhu+DXdfUWWqKLeSlmT169nYvLgKBOcEB2FxzD6ibq8epGt/XXj+W2G/XA==","signatures":[{"sig":"MEUCIQDf0eEADlrMztTa4AjjYrKOvIi4XinfhZiCuA8Kd13iAwIgPWcstAKZAQ8SKf0noCiih1e6GK3n59j4ME8pPThrBdc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6912,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3kVxCRA9TVsSAnZWagAAJkUP+gM0+b4k2k5uP3kghz80\nepMwfBDgqhsCGlTzvvqXnt2ItjPSv8AGTPD/3g7lv7wQrEHIk+rH36dSr60y\n7puJIamP8m1JghrQ4jiJ1qnCdsMMNK3SthQYiEWSMdx/Ta0pwuQWbUON981b\nwq9a6LlSo1SNfGxpbiDVk7fn3VxUyBlNXpLZbs5ZQ1M/sz2Zs9c63DNW+aAo\n1uC+NPx/uesK5zY7Be079RLPUXySTmu9x4nmezxLndozFyKrw/ntJhzq4+oK\nFwjR53FRaRpLuVeDW98a7LNUFMzCfH9oqEwZBH2tZ2AivC2Dv9UKQrsmmWaG\nPX7g7FsFhpF079ItIY1ufMruj2Oy/EyYS3cD4gEjCqzhJgD74vIVSaZ+C6Up\nt1qzZMdliM2c0k2O7UctpJzdaxSPKDUhHIlclUzoUVvBMb3rUVnSzIFQ9JoJ\n1AAEDoOdzCH9dXFq5b2fdQBgrw5S/KsLfldIOJnRyHuIFXMaePkQ2ikQVS4b\ngA/d47yaV4c1yRuTnqjVnnT3Fl1xqbWMo66yp2w1JWciqkWlkR3u7W8zQ5A5\nyNdbV5B0Jk6Igi+6RMl31TlicLTGv280EDJjDDGsCmkc3MKOokZsFe6bLfH6\n12a4t8OlIEfwRT2MYZNihDKIlxQ2PWeW13w/FS/Y8IPiyEEDh60h+vF3zDKq\npwRG\r\n=XjOV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./lib/index.js","gitHead":"a8b63907fb94bacc1e707b0bb27238789f0bab30","scripts":{"lint":"eslint ."},"_npmUser":{"name":"modestfake","email":"modestfake@gmail.com"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","repository":{"url":"git+https://bitbucket.org/atlassian/sweethub.git","type":"git"},"_npmVersion":"6.12.1","description":"Wrapper for OpsHub API. Allows you develop your panels locally. No more \"bittersweet\".","directories":{},"_nodeVersion":"12.13.1","_hasShrinkwrap":false,"devDependencies":{"eslint":"^6.7.1","eslint-plugin-node":"^10.0.0","eslint-plugin-import":"^2.18.2","eslint-plugin-promise":"^4.2.1","eslint-config-standard":"^14.1.0","eslint-plugin-standard":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/sweethub_1.1.0_1574847856619_0.17739525566512393","host":"s3://npm-registry-packages"}}},"time":{"created":"2018-05-30T16:16:56.229Z","modified":"2024-07-16T14:41:56.414Z","1.0.4":"2018-05-30T16:16:56.580Z","1.1.0":"2019-11-27T09:44:16.738Z"},"author":{"name":"Daniel Hreben","email":"daniel.hreben@gmail.com"},"license":"ISC","homepage":"https://bitbucket.org/atlassian/sweethub#readme","keywords":["opshub"],"repository":{"url":"git+https://bitbucket.org/atlassian/sweethub.git","type":"git"},"description":"Wrapper for OpsHub API. Allows you develop your panels locally. No more \"bittersweet\".","maintainers":[{"email":"ev.baraniuk@gmail.com","name":"jsarafajr"},{"email":"daniel.hreben@gmail.com","name":"daniel.hreben"},{"email":"kannonboy@gmail.com","name":"kannonboy"},{"email":"modestfake@gmail.com","name":"modestfake"},{"email":"max.yokha@gmail.com","name":"myokha"}],"readme":"🍬 SWEET HUB ⚙\n==============\n## Wat?\n### So, you want to build an OpsHub panel...\n\n> What doesn't kill you, only makes you stronger\n\n*— Friedrich Nietzsche*\n\n> Right now the simplest form of a devloop for building a panel is bittersweet – bitter in that you need to push changes to your Bitbucket repo and then hit the \"Reload Panel\" button to refresh it, but sweet in that those two steps are a heck of a lot faster than redeploying a service to Micros.\n\n*— OpsHub documentation*\n\nSuch dev process makes me really, really angry after few iterations. (╯°□°）╯︵ ┻━┻\n\nIf you OK with that, or with [another solution by OpsHub team](https://extranet.atlassian.com/display/PSRV/Local+panel+development) - this lib is not for you.\n\nOtherwise, I have a good news...\n\n### YES, with this thing you can develop your panels locally, with react, webpack, hot-reload and whatever you want, like regular web app in 2017.\n\n## How?\n\n### Set-up `webpack`, `webpack-dev-server`, install your modules, etc.\nThen, install and import this lib:\n\n```javascript\nimport sweethub from '@atlassian-partner-engineering/sweethub'\n\nconst OpsHub = await sweethub.opsHub()\nconst destUrl = OpsHub.selectedService().proxyUrl('/api/admin/users')\n```\n\nSo, this `OpsHub` object will contain dummy mock with few methods if you run it locally, or just reference to `window.OpsHub` if you deploy it to OpsHub.\n\nBy the way, you don't need `OpsHub` object if you only want to perform requests to your admin api, it will require some code to deal with CSRF tokens, so here is ready to use request-like wrapper:\n\n```javascript\nimport sweethub from '@atlassian-partner-engineering/sweethub'\n\nconst request = sweethub.request()\nawait request.post('/api/admin/users', {name: 'John'}) // POST JSON body\nawait request.get('/api/admin/users', {sort: '-name'}) // GET with query-string params\n```\n\n### Setup `webpack-dev-server` to proxy your API requests:\n```javascript\n  devServer: {\n    contentBase: './',\n    port: 8000,\n\n    proxy: {\n      '/api/*': { target: 'http://localhost:8080/' }\n    },\n\n    staticOptions: {\n      index: 'panel.html'\n    },\n\n    inline: true\n  },\n```\n\n### Setup webpack to use your favorite large libs as externals in production:\n```javascript\n  externals: process.env['NODE_ENV'] === 'production' ? {\n    'react': 'React',\n    'react-dom': 'ReactDOM',\n    'graphiql': 'GraphiQL'\n  } : {},\n```\nThat way you will have development build of react and other libs while develop locally.\n\n### Include libs from CDN in your `panel.html`\n```html\n<!--\n  That's hack required for <script> tags, since they did not work when you have active requirejs.\n  See https://github.com/requirejs/requirejs/issues/947\n  Another option is to use requirejs instead or with webpack, but I think it will be much more painful\n  (requirejs in 2017? Srsly?).\n-->\n<script src=\"https://unpkg.com/requirejs-toggle\"></script>\n\n<script src=\"https://unpkg.com/react@15/dist/react.min.js\"></script>\n<script src=\"https://unpkg.com/react-dom@15/dist/react-dom.min.js\"></script>\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/graphiql/0.9.3/graphiql.min.js\"></script>\n\n<script src=\"https://unpkg.com/requirejs-toggle\"></script>\n\n<script src=\"public/bundle.js\"></script>\n```\n\n### Run server-side of your panel locally, turn off ASAP for dev environment:\n\n```javascript\nreturn function checkASAP(req, res, next) {\n  if (process.env.NODE_ENV === 'development') {\n    return next()\n  }\n  // perform ASAP check\n  // ...\n}\n```\n\nI think that's it.\nCheckout this repo for complete example\nhttps://bitbucket.org/atlassian/opshub-crm-admin-panel\n","readmeFilename":"README.md"}