{"_id":"@batimentb/okimmo-redirect","_rev":"6-c538477daed0837aa6342d67f1fc353b","name":"@batimentb/okimmo-redirect","description":"### What is it ? ###","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@batimentb/okimmo-redirect","version":"1.0.0","description":"### What is it ? ###","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+ssh://git@bitbucket.org/batimentb/okimmo-redirect.git"},"author":{"name":"batimentb"},"license":"ISC","homepage":"https://bitbucket.org/batimentb/okimmo-redirect#readme","dependencies":{"lodash":"^4.17.4"},"gitHead":"d86d6922c126e24760ec050f52cd011a74f23a83","_id":"@batimentb/okimmo-redirect@1.0.0","_npmVersion":"5.3.0","_nodeVersion":"7.7.1","_npmUser":{"name":"batimentb","email":"hellobatb@gmail.com"},"dist":{"integrity":"sha512-pEOA8cca922Pi4sQW4Y6TuxWkMBkvJZPzoJSX/OmLMwObVOjlrIUMwkDNbiJndhXVSrcsPHpcQFEUDLh1aiQWQ==","shasum":"4598e25ff061d7abdb315455affddca7b94d50ed","tarball":"https://registry.npmjs.org/@batimentb/okimmo-redirect/-/okimmo-redirect-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDC4S7Z43IJmIR+vgpXT5z9ayhtBBDA2hfrSLIin9Y2MAIhALaYkdcRuAxlWPZBE9Hcy7lA7hKa03geE0HuBBgXkhQx"}]},"maintainers":[{"name":"batimentb","email":"hellobatb@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/okimmo-redirect-1.0.0.tgz_1500542223618_0.990422151517123"}},"1.0.1":{"name":"@batimentb/okimmo-redirect","version":"1.0.1","description":"### What is it ? ###","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+ssh://git@bitbucket.org/batimentb/okimmo-redirect.git"},"author":{"name":"batimentb"},"license":"ISC","homepage":"https://bitbucket.org/batimentb/okimmo-redirect#readme","dependencies":{"lodash":"^4.17.4"},"gitHead":"3a2e3d9025948209b98096e11aa995b593872c36","_id":"@batimentb/okimmo-redirect@1.0.1","_npmVersion":"5.3.0","_nodeVersion":"7.7.1","_npmUser":{"name":"batimentb","email":"hellobatb@gmail.com"},"dist":{"integrity":"sha512-yf748I9t33iiAbZiD5EFreFPpX7lIL1ZBWJNOyRxLmRePSC+IoXnvj8bPvFVcfjpVjhElDDzLEf+ZB04bQm2VQ==","shasum":"a17d0abdb98b80928749448513fa94765b63477b","tarball":"https://registry.npmjs.org/@batimentb/okimmo-redirect/-/okimmo-redirect-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1xV8i+gPDZrkJUQ2D11dziY/a050Fb68RYzCG2gfYhwIhAITvBV2TmEltxuJL6UvcaSQkYe2j6+wJVJ4FqAo7C36R"}]},"maintainers":[{"email":"joan.brugaya@gmail.com","name":"joanb"},{"email":"hellobatb@gmail.com","name":"batimentb"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/okimmo-redirect-1.0.1.tgz_1504771105599_0.6810388462617993"}}},"readme":"# OKIMMO-REDIRECT #\n\n### What is it ? ###\n\nokimmo-redirect is is Vue component that can be used to redirect in your beautiful app.\nUsing query parameters, you can define a configuration to specify what route to use and what action to do with parameters.\n\n### Usage ###\n\n```javascript\nimport Vue from 'vue'\nimport Router from 'vue-router'\n\nconst config = require('./configRedirect')\nimport redirectBuilder from '../services/okimmo-redirect'\nconst OkimmoRedirect = redirectBuilder(config)\n\nVue.use(Router)\n\nconst router = new Router({\n  routes: [{\n      ...\n    },\n    // REDIRECTION HANDLER\n    {\n      path: '/redirect',\n      name: 'redirect',\n      component: OkimmoRedirect\n    }\n```\n\n### Config definition ###\n\nConfig given to the component is an Array that contains definitions of redirections.\n\n#### Example ####\n\n```javascript\nconst config = [\n  {\n    resource: 'home',\n    routeName: 'myHomePageDefinedInTheRouter'\n  }\n]\n```\nURL: /redirect?resource=home\n\nIn this example, this okimmo-redirect will find the resource variable in query parameters and then, redirect to the route 'myHomePageDefinedInTheRouter' that is the name that must be defined in your router definition.\n### Give some parameters ###\n\nWhat if you need to give some parameters to your route (myBeautifulRoute/:param1/:param2) ?\n\nThis is simple, you can add a property to the config object:\n```javascript\nconst config = [\n  {\n    resource: 'home',\n    routeName: 'myHomePageDefinedInTheRouter'\n  },\n  {\n    resource: 'example',\n    routeName: 'myBeautifulRoute',\n    needParams: [\n      'param1', // will search for \"param1\" in query parameters and add it to the route params for redirection\n      ['parameterWithBadName', 'param2'] // will search for \"parameterWithBadName\" in query parameters and put its value to the route params with \"param2\" as name for redirection\n    ]\n  }\n]\n```\nURL: /redirect?resource=example&param1=value1&parameterWithBadName=value2\n\n### Multiple definition for one resource ###\nThere is some case that we need multiple actions for one resource.\nFor example, a book resource can have: \"create, edit, vue and list\" actions.\n\n```javascript\nconst config = [\n  {\n    resource: 'book',\n    actions: [\n        {\n            name: 'edit',\n            routeName: 'book-edit',\n            needParam: [\n                ['id', 'bookId']\n            ]\n        },\n        {\n            name: 'list',\n            routeName: 'books'\n        },\n        {\n            name: 'create',\n            routeName: 'book-create'\n        },\n        {\n            name: 'vue',\n            routeName: 'book-vue',\n            ['id', 'bookId']\n        }\n    ]\n  },\n  ...\n]\n```","maintainers":[{"email":"joan.brugaya@gmail.com","name":"joanb"},{"email":"hellobatb@gmail.com","name":"batimentb"}],"time":{"modified":"2022-04-04T17:47:37.410Z","created":"2017-07-20T09:17:04.544Z","1.0.0":"2017-07-20T09:17:04.544Z","1.0.1":"2017-09-07T07:58:26.448Z"},"homepage":"https://bitbucket.org/batimentb/okimmo-redirect#readme","repository":{"type":"git","url":"git+ssh://git@bitbucket.org/batimentb/okimmo-redirect.git"},"author":{"name":"batimentb"},"license":"ISC","readmeFilename":"README.md"}