{"_id":"@arfedulov/json-api-url-parser","_rev":"2-0c1b9b3d7158f27ca8de2d935c51c30a","name":"@arfedulov/json-api-url-parser","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@arfedulov/json-api-url-parser","version":"0.1.0","main":"dist/index.ts","author":{"name":"Artem Fedulov","email":"arfedulov@gmail.com"},"license":"MIT","private":false,"repository":{"type":"git","url":"git+https://github.com/arfedulov/json-api-url-parser.git"},"bugs":{"url":"https://github.com/arfedulov/json-api-url-parser/issues","email":"arfedulov@gmail.com"},"dependencies":{"query-string":"^6.8.3","url-parse":"^1.4.7"},"devDependencies":{"@types/jest":"^24.0.20","@types/lodash":"^4.14.144","@types/node":"^12.11.2","jest":"^24.9.0","lodash":"^4.17.15","ts-jest":"^24.1.0","ts-node":"^8.4.1","tslint":"^5.20.0","typescript":"^3.6.4"},"scripts":{"test":"jest","check":"npx tsc --noEmit","prebuild":"rm -rf dist && yarn test","build":"npx tsc && yarn run removeBuildTests","removeBuildTests":"rm -rf dist/__tests__ dist/**/__tests__","prepublish":"yarn build"},"gitHead":"32c2da9a999fa227063c67fc5135bdb931462eb2","description":"Parse jsonapi complient urls [specs](https://jsonapi.org/format/).","homepage":"https://github.com/arfedulov/json-api-url-parser#readme","_id":"@arfedulov/json-api-url-parser@0.1.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-OwYAbJmLQNHpZyvmt8DSZqZD6qNnjwarxzqkvSqV7GYJl9i2IEoWJRrR2RMvaSK+24ejtjZIH5G+SVdkU/WS+A==","shasum":"c621722ddc6a489d5d3ad1250f5bd21254716d05","tarball":"https://registry.npmjs.org/@arfedulov/json-api-url-parser/-/json-api-url-parser-0.1.0.tgz","fileCount":16,"unpackedSize":31824,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJduTOqCRA9TVsSAnZWagAAWxsP/04RvEIcd7c4qPAk47v1\nU4s6aZZ4By32JzWLNwNfKch75j/E5dE5UUJPg942RUaLibOJelLmebqQdERq\n7hwhLVMA9ZD7u7ARpAAGobq4ezNeR9rEKJn5wZ+i9OgEeWjjrkpv2aWnmP+D\n62vWUJnkZQAmaLAWuwtS18jabRkB3QtzL4ezqjr9i7AwbzyHP+gJFfqPZQRQ\nsbw+Pa8MHR81ojDANidZUfVitj/4NiXx/l6Hc0hyHz/o7igoFAedUHbzTMaD\npuSYuu67Z1AYNzrXZZHvC0D6+YESqBn6S3zPVlF2IlctaFX45VePVzsVRnOz\nd+Y+IMjV2AUozprzu02YEMzPCtJ81548B65ZY+WkFoaXX4qacLaZKAuUpk1K\nI++62tQCP3bJ13/ZaZksmKP1MMRyQ4UEyV7AoPu/bLXUpSQ8RNNnDqf0YJGq\nd+1gACh5psEaXMXtiFlF9tgts/a1tJNjWoP05nnL//dVjeuCKfsypkaT1VlI\nH0cgf3OZsxMwfI2EovuZxYfo7dcdV67vi7YBx6ZVz3xVZUIwxaIV2k7r0HKw\naDoqpEJ9xp88d5ZeiCExaK81k6VTAok0acIIMI+ZMprmDn04y4LP8iRj2u8q\nyK8VG7xJw5/ZS1Ah/C39RZJgkgGLaMRNh/MTV3ICeUiZc/inz0JR6x8DUUhv\n8CYw\r\n=a4WU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3/BJykDRL1f7oILYn6GrcTGNfKcqd6kmeABVONvWL3wIhAM5sjqv5ddkZnv9nDCgYEwZHZv5Aqk0AlZ3h1ISxewRo"}]},"maintainers":[{"name":"arfedulov","email":"arfedulov@gmail.com"}],"_npmUser":{"name":"arfedulov","email":"arfedulov@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-api-url-parser_0.1.0_1572418474062_0.36181232935632335"},"_hasShrinkwrap":false},"0.1.1":{"name":"@arfedulov/json-api-url-parser","version":"0.1.1","main":"dist/index.js","author":{"name":"Artem Fedulov","email":"arfedulov@gmail.com"},"license":"MIT","private":false,"repository":{"type":"git","url":"git+https://github.com/arfedulov/json-api-url-parser.git"},"bugs":{"url":"https://github.com/arfedulov/json-api-url-parser/issues","email":"arfedulov@gmail.com"},"dependencies":{"query-string":"^6.8.3","url-parse":"^1.4.7"},"devDependencies":{"@types/jest":"^24.0.20","@types/lodash":"^4.14.144","@types/node":"^12.11.2","jest":"^24.9.0","lodash":"^4.17.15","ts-jest":"^24.1.0","ts-node":"^8.4.1","tslint":"^5.20.0","typescript":"^3.6.4"},"scripts":{"test":"jest","check":"npx tsc --noEmit","prebuild":"rm -rf dist && yarn test","build":"npx tsc -p tsconfig.build.json --declaration","prepublish":"yarn build"},"gitHead":"73ce9f6962eb2816ff42539c6e1670e17c24d4ec","description":"Parse jsonapi complient urls [specs](https://jsonapi.org/format/).","homepage":"https://github.com/arfedulov/json-api-url-parser#readme","_id":"@arfedulov/json-api-url-parser@0.1.1","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-y/GALbskEmDZUc/UnfHx5J9tLUuCQgtyPjLX1sCIAejJ6BCGWMDSmJ/C8n1NiaGV07RcmO+fvEQZ3TYslxusVw==","shasum":"39afda2d4f6ace3d4fd40e40bebb5e76478e86ff","tarball":"https://registry.npmjs.org/@arfedulov/json-api-url-parser/-/json-api-url-parser-0.1.1.tgz","fileCount":17,"unpackedSize":31857,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdxkTACRA9TVsSAnZWagAAnm8P/1d+IODbswWrFsYgZ52r\ndDRzo4AM62HBD1Oensb2nYR1/IILCdHS6ajyCuw9DqHqHCVef/6oW+gWUhEo\na8G7UjvwFmlyXoqGjnQFCNh/2HAyyEJeuziwaK/dffFWc+D06T/UMW0UNY+W\nweZE3gTMYVVSUshm9q3MJQwOZN1GW+GDccEiRNQDQCS3kGZNKousaFngg2aJ\ngvV98MYECuTFlljMjbL3FJCUsfD0pN2/AFvijJeNLbzCA3yvIQQ4mneBwLwX\n1HaM7He8l3iRto3xx8HRmpnYxmOGJfMOnR5pDGG/ovVhHqMjsPFx32DIEV+9\nUX+PpKEEhBese7U4yAKk2F/ZJdt4BBbOuc/EnxvnNVuULx/IACDWlNu/UGg8\nI1kYWTJlBNUL1neHoV66vF2smYdIdwI5akL4516bFajSOMWEw7EY65Y6jBtd\nx9TNdkuHJDOhbbgFqWaN2qfbpxQBWuSxkyLPiAhq5/HCiy67T/r2YyTxzZf7\nYvinhOVyqf1PznHop96aRliF3zMTf/opBc+et5TgyWYIu9mHp0AFR2EJdy2M\nXoEt2QSa7FniEI4/MYWyykRvIvViyeG90D3zJqk2YG+aBCO/sFAoE5gEllvF\nASaJ/L6+K6DbfGFivoWCRVARF+E9en1ehUydSPoZe43gY4hkaRS96BnaWxoB\nJBB4\r\n=EXfS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrhbgfV7DvLEY6t6wl1n6AmbJKHES0kkjtQr6vJPRgGwIgeTFeejQWmf0U0hhjAttLDHb4drSrIHqLipndFGt8b0w="}]},"maintainers":[{"name":"arfedulov","email":"arfedulov@gmail.com"}],"_npmUser":{"name":"arfedulov","email":"arfedulov@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-api-url-parser_0.1.1_1573274815590_0.7144990103847506"},"_hasShrinkwrap":false}},"time":{"created":"2019-10-30T06:54:33.809Z","0.1.0":"2019-10-30T06:54:34.278Z","modified":"2022-04-04T15:24:09.350Z","0.1.1":"2019-11-09T04:46:55.767Z"},"maintainers":[{"name":"arfedulov","email":"arfedulov@gmail.com"}],"description":"Parse jsonapi complient urls [specs](https://jsonapi.org/format/).","homepage":"https://github.com/arfedulov/json-api-url-parser#readme","repository":{"type":"git","url":"git+https://github.com/arfedulov/json-api-url-parser.git"},"author":{"name":"Artem Fedulov","email":"arfedulov@gmail.com"},"bugs":{"url":"https://github.com/arfedulov/json-api-url-parser/issues","email":"arfedulov@gmail.com"},"license":"MIT","readme":"# json-api-url-parser\n\nParse jsonapi complient urls [specs](https://jsonapi.org/format/).\n\n\n```ts\nimport { parse } from '@arfedulov/json-api-url-parser';\n\n/** Parsed url parameters ( including those from url query string ). */\nexport interface JsonApiUrlParams {\n  resourceType: string;\n  resourceId?: string;\n  relationshipType?: string;\n  pageNumber?: number;\n  pageSize?: number;\n  filters?: Filter[];\n  sort?: Sort[];\n}\n\nexport interface Filter {\n  /** Field name to apply filtering to. */\n  fieldName: string;\n  /** A predicate expressed in textual form ( this module is unaware of semantics ). */\n  predicateString: string;\n}\n\nexport interface Sort {\n  /** Field name to apply sorting to. */\n  fieldName: string;\n  /** Sorting order. */\n  order: Order;\n}\n\n/**\n * Sorting order.\n *\n * `+` Means \"ascending\"\n * `-` Means \"descending\"\n */\nexport type Order = '+' | '-';\n\nconst parsed: JsonApiUrlParams = parse('https://abc.com/articles/12345/relationships/author?sort=-createdAt,title&page[number]=5&page[size]=10');\n\nconsole.log(parsed);\n/*\n{ resourceType: 'articles',\n  resourceId: '12345',\n  relationshipType: 'author',\n  filters: undefined,\n  sort:\n   [ { fieldName: 'createdAt', order: '-' },\n     { fieldName: 'title', order: '+' } ],\n  pageNumber: 5,\n  pageSize: 10 }\n*/\n```\n","readmeFilename":"README.md"}