{"_id":"@avvocatoflash/avvocatoflash-sdk","_rev":"1-4fbbfd19604b33d3cd9224080a6348fc","name":"@avvocatoflash/avvocatoflash-sdk","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@avvocatoflash/avvocatoflash-sdk","version":"1.0.0","description":"This SDK is a set of common utilities used in various part of AvvocatoFlash projects.","main":"./lib/index.js","directories":{"lib":"lib"},"scripts":{"pretest":"eslint --ignore-path .gitignore .","lint":"eslint .","lint:fix":"eslint . --fix","test":"mocha ./test/test.config.js ./test/unit --recursive --timeout 90000"},"repository":{"type":"git","url":"git+https://github.com/AvvocatoFlash/avvocatoflash-sdk.git"},"author":{"name":"AvvocatoFlash"},"license":"ISC","bugs":{"url":"https://github.com/AvvocatoFlash/avvocatoflash-sdk/issues"},"homepage":"https://github.com/AvvocatoFlash/avvocatoflash-sdk/blob/master/README.md","dependencies":{"chai":"^4.2.0","chai-as-promised":"^7.1.1","mocha":"^7.0.1","request":"^2.88.2","request-promise":"^4.2.5","sinon":"^8.1.1"},"devDependencies":{"eslint":"^6.8.0","eslint-config-strongloop":"^2.1.0","eslint-plugin-node":"^11.0.0","eslint-plugin-promise":"^4.2.1"},"gitHead":"2c925bcf5919dc2e938701314510b219a2a1e11c","_id":"@avvocatoflash/avvocatoflash-sdk@1.0.0","_nodeVersion":"12.14.1","_npmVersion":"6.13.7","dist":{"integrity":"sha512-qeJmwXWNg79J2NNgaMTOBvT+46GCijhMTSZUPABBV2UPnXpWkzriwF3LLXQLe/F9L9oq2ekWyy/VY2jXCNoR3g==","shasum":"29f0897d0dd26cf67e1d3d633e445e0786883938","tarball":"https://registry.npmjs.org/@avvocatoflash/avvocatoflash-sdk/-/avvocatoflash-sdk-1.0.0.tgz","fileCount":13,"unpackedSize":28076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeSx7HCRA9TVsSAnZWagAA/ekP/i/x/Jq9ISep0BazwAUU\nX2ScNyU10VhZuhsnh3fhLDq3XLBXKmxgEesZi7MsLLCbKE7MpdsS523LBKtW\nw40ukxP9mBQYsG9jBfEP+UzN1tHvChDqKqvPeVfLRiuFroI6gqM1OBjuWg/M\n/aO95QWfdQOeu0tZ2HNecpXXwNQjiL/hBKlJhrpCpYxd4C791YrnJUf7yVje\nnetvuC3xEwPrZLW1O6o2P/sJWmOCRXzphQQTG9Cmo+raIH3QCDTPwwcvXrjE\n1owpCMNlmU+g0uwaL/uT8iCI365ldIWtJ5FGoZkm645AKYo5IzxsMjZC9qLT\ng8/VW/+P9sl3/70UO0irlIGXYpV0BKcMLYF4xcvG3GQRj38jy+WxVLe3wOUl\njmxAc72MbvrX7xmrvFIuaxomJCZUa2YTx2l4eP1qkxX/3c78ED/zZ7FXXKxI\nBAbHY3MEm85wcm8Y7zl4ISwIm9T6RcddOJuaHQWbYR4wNvv6pAx0BhiVPvrZ\nbknoanrSbAn2vZtvqNbXASg+xVKvxOmdHHbP5x5nUvhG8tKkoUSaPaIrzanw\nBoiqxVMfisuQtmqplM8vgmj0T8YRWMj3Qp2Ixlf/R0Lk/xxLsHCfvyUGJMJQ\nTjT+0gc6Vcd7DZkiNfrp4Vt0+qNsi/cH06F/sPC7xxXmtsBVbJhn7zbKBPJ7\neGMS\r\n=MYcD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDs+gN3ZqSahR5Tmh9HSuIvkwm+De9aA0pIcbSJCZST6AIgL/1gsbmXS0qXEY5OJ0/aAPVC78uJ/j7y8zHcsPmcDnY="}]},"maintainers":[{"name":"cristianizzo","email":"cris@amon.tech"}],"_npmUser":{"name":"cristianizzo","email":"cris@amon.tech"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/avvocatoflash-sdk_1.0.0_1581981382682_0.1434666707632175"},"_hasShrinkwrap":false}},"time":{"created":"2020-02-17T23:16:22.448Z","1.0.0":"2020-02-17T23:16:22.809Z","modified":"2022-04-04T16:49:07.487Z"},"maintainers":[{"name":"cristianizzo","email":"cris@amon.tech"}],"description":"This SDK is a set of common utilities used in various part of AvvocatoFlash projects.","homepage":"https://github.com/AvvocatoFlash/avvocatoflash-sdk/blob/master/README.md","repository":{"type":"git","url":"git+https://github.com/AvvocatoFlash/avvocatoflash-sdk.git"},"author":{"name":"AvvocatoFlash"},"bugs":{"url":"https://github.com/AvvocatoFlash/avvocatoflash-sdk/issues"},"license":"ISC","readme":" # AvvocatoFlash SDK\n\n[![CircleCI](https://circleci.com/gh/AvvocatoFlash/avvocatoflash-sdk.svg?style=svg)](https://circleci.com/gh/AvvocatoFlash/avvocatoflash-sdk)\n\nThis SDK is a set of common utilities used in various part of AvvocatoFlash projects.\n\n## Publish on NPM\n- update the package version \n- npm publish\n\n## Install\n\nInstall via npm\n```bash\nnpm i -S @avvocatoflash/avvocatoflash-sdk\n```\n\nImport in your project\n```javascript\nconst AvvocatoFlashSdk = require('avvocatoflash-sdk');\nimport AvvocatoFlashSdk from 'avvocatoflash-sdk';\n```\n\n## Examples\n\nFirst you need to get an instance of AvvocatoFlashSdk. This instance is useful to use the SDK on different environments.\n\n```javascript\nconst afSdk = new AvvocatoFlashSdk({ env: 'development', apiKey: 'your-key' });\n```\n\n`env` can be either `development` or `production`\\\n`apiKey` please contact [team@avvocatoflash.it](mailto:team@avvocatoflash.it?subject=[GitHub]%20APIKEY%20Request) \n\n### Get Councils\n\nYou can get the list of the italian councils from the `getCouncils` method, you need the council uuid before you can post a new legal case.\n\nSearch by council name : `napoli`, `milano`, `roma` ext...\\\nSearch by council postCode : `81100`, `20019`, `00127` ext...\n\nparams : `search`, `postCode`, `limit`, `offset`\n\n- Get Council with all params\n```javascript\nconst resp = afSdk.getCouncils({ search: 'alba', limit: 1, offset: 1});\n//  {\n//    councils: [\n//      {\n//        _id: '58f8403bbe7bc800044ba91e',\n//        name: 'Alba',\n//        code: '004003',\n//        sigle: 'CN',\n//        postCode: '12051',\n//        Region: '5d5a110d29ab354952b0cd1e',\n//        Province: '5d5a111b29ab354952b15432',\n//        label: 'Alba - 12051'\n//      }\n//  ],\n//  currentPage: 1,\n//  totPages: 87,\n//  totRecords: 8645\n//  }\n```\n\n- Get Council by name\n```javascript\nconst resp = afSdk.getCouncils({ search: 'alba', limit: 1});\n//  {\n//    councils: [\n//      {\n//        _id: '58f8403bbe7bc800044ba91e',\n//        name: 'Alba',\n//        code: '004003',\n//        sigle: 'CN',\n//        postCode: '12051',\n//        Region: '5d5a110d29ab354952b0cd1e',\n//        Province: '5d5a111b29ab354952b15432',\n//        label: 'Alba - 12051'\n//      }\n//  ],\n//  currentPage: 1,\n//  totPages: 87,\n//  totRecords: 8645\n//  }\n```\n\n- Get Council by postCode\n```javascript\nconst resp = afSdk.getCouncils({ postCode: '12051', limit: 1});\n//  {\n//    councils: [\n//      {\n//        _id: '58f8403bbe7bc800044ba91e',\n//        name: 'Alba',\n//        code: '004003',\n//        sigle: 'CN',\n//        postCode: '12051',\n//        Region: '5d5a110d29ab354952b0cd1e',\n//        Province: '5d5a111b29ab354952b15432',\n//        label: 'Alba - 12051'\n//      }\n//  ],\n//  currentPage: 1,\n//  totPages: 87,\n//  totRecords: 8645\n//  }\n```\n\n\n### Post Legal Case\nYou can post a new legal case using the `postLegalCase` method\n                        \n- Post LegalCase\n```javascript\nconst resp = afSdk.postLegalCase({\n  fullName: 'Mark Helber', \n  email:'test@avvocatoflash.it', \n  mobile: '3388002000', \n  description: 'some description', \n  councilId: '58f8403bbe7bc800044ba91e'\n});\n// {legalCaseId: '5e4ae3b782609900174773e4'}\n```\n\nparams : \\\n`fullName`\\\n`email`\\\n`mobile` can be either with prefix `+443388002000` or `3388002000` by defualt italian prefix will be attached `+39`\\\n`description` min length 30 chars\\\n`councilId` council uuid\n\n\n## Credits\n\nAvvocatoFlash, 2020\n\nCheers ;)\n","readmeFilename":"README.md"}