{"_id":"@a4sex/api-resource","_rev":"3-3376ad363e3b024b8809cd911b473e02","name":"@a4sex/api-resource","dist-tags":{"latest":"2.6.1"},"versions":{"2.5.0":{"name":"@a4sex/api-resource","description":"Api Resource mixin for freedomsex project.","type":"module","main":"index.vue","publishConfig":{"access":"public"},"dependencies":{"@a4sex/params-pruner":"^1.0.0","@a4sex/cache-service":"^1.0.0"},"optionalDependencies":{"@a4sex/cache-service":"^1.0.0"},"repository":{"type":"git","url":"git+ssh://git@gitlab.com/a4sex/npm/library/rest-api/api-resource.git"},"author":{"name":"tebaly","email":"support@freedomsex.net"},"license":"GPL-3.0-or-later","version":"2.5.0","gitHead":"aeecbc90ae269ee716a137c590b37e08fd27e53f","bugs":{"url":"https://gitlab.com/a4sex/npm/library/rest-api/api-resource/issues"},"homepage":"https://gitlab.com/a4sex/npm/library/rest-api/api-resource#readme","_id":"@a4sex/api-resource@2.5.0","_nodeVersion":"18.15.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-/+3zgn2r2CIMfzdmoYymX8O3bSEOm8DGtHDhbj0sXF36CxoU0S0Vf3/ehTP/x4rrqh2vsrT10aaJPlvy0pgdNg==","shasum":"d4ba49630cf1ebe05b82ce24b02196c9cf7a6bf5","tarball":"https://registry.npmjs.org/@a4sex/api-resource/-/api-resource-2.5.0.tgz","fileCount":9,"unpackedSize":17619,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2BpD+8rsRZnzfcEnQ4+mR1T0W9faLFnvlnDtlvjNDvAIhAKMu+cQ8M0Q2X892vwTaPwREIaIBNMNh436UFhUqHWcQ"}]},"_npmUser":{"name":"tebaly","email":"support@freedomsex.net"},"directories":{},"maintainers":[{"name":"tebaly","email":"support@freedomsex.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/api-resource_2.5.0_1688898680440_0.07137234415605831"},"_hasShrinkwrap":false},"2.5.1":{"name":"@a4sex/api-resource","description":"Api Resource mixin for freedomsex project.","type":"module","main":"index.vue","publishConfig":{"access":"public"},"dependencies":{"@a4sex/params-pruner":"^1.0.0","@a4sex/cache-service":"^1.0.0"},"optionalDependencies":{"@a4sex/cache-service":"^1.0.0"},"repository":{"type":"git","url":"git+ssh://git@gitlab.com/a4sex/npm/library/rest-api/api-resource.git"},"author":{"name":"tebaly","email":"support@freedomsex.net"},"license":"GPL-3.0-or-later","version":"2.5.1","gitHead":"9aa4496c1433913d9ede48dc1e6e7647e10db747","bugs":{"url":"https://gitlab.com/a4sex/npm/library/rest-api/api-resource/issues"},"homepage":"https://gitlab.com/a4sex/npm/library/rest-api/api-resource#readme","_id":"@a4sex/api-resource@2.5.1","_nodeVersion":"18.15.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-L9YtHSe/HidX6Di42bwwTRUOiVyE7yJSLGDCY6sV6DUCp83RYT4s/SunWPujgv1IKemS+tLozsNEypv2LkO1Zw==","shasum":"64c461b69709ab275f151ba22ee0b3f686d7c250","tarball":"https://registry.npmjs.org/@a4sex/api-resource/-/api-resource-2.5.1.tgz","fileCount":9,"unpackedSize":17614,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBW1jorTBHTEr7yuPsSKZujHTD8ChfJlX65Un3zHL7/QAiBTJALUxEDmRs45HviBFY/LOx8vlkSBppxv7SnKr7f1uQ=="}]},"_npmUser":{"name":"tebaly","email":"support@freedomsex.net"},"directories":{},"maintainers":[{"name":"tebaly","email":"support@freedomsex.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/api-resource_2.5.1_1688902823751_0.13855877112794523"},"_hasShrinkwrap":false},"2.6.0":{"name":"@a4sex/api-resource","description":"Api Resource mixin for freedomsex project.","type":"module","main":"index.vue","publishConfig":{"access":"public"},"dependencies":{"@a4sex/params-pruner":"^1.0.0","@a4sex/cache-service":"^1.0.0"},"optionalDependencies":{"@a4sex/cache-service":"^1.0.0"},"repository":{"type":"git","url":"git+ssh://git@gitlab.com/a4sex/npm/library/rest-api/api-resource.git"},"author":{"name":"tebaly","email":"support@freedomsex.net"},"license":"GPL-3.0-or-later","version":"2.6.0","gitHead":"12801f32b6457d9b3d4201cbbc5051f5ff1eea9e","bugs":{"url":"https://gitlab.com/a4sex/npm/library/rest-api/api-resource/issues"},"homepage":"https://gitlab.com/a4sex/npm/library/rest-api/api-resource#readme","_id":"@a4sex/api-resource@2.6.0","_nodeVersion":"18.15.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-G25y0zgRxIcJ1/V8TWxzVlmQykOEmdI2tdXvJRuAbydV2EeUH6bu6bPwmbM8YyFeLnAn6I3MenVMt3ztP7zKLA==","shasum":"52a5e813e2675a39c0584b1bc4dbc7d4c5f1c6b3","tarball":"https://registry.npmjs.org/@a4sex/api-resource/-/api-resource-2.6.0.tgz","fileCount":9,"unpackedSize":17626,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrLYqnHW/kIfvWu3X5XmvsJlfR2PizIG9ExWZIIJcz6QIgBdEIUxjkOJGRpNEDkcWxSbXCzMOsEdbAHAFyV5+W4S8="}]},"_npmUser":{"name":"tebaly","email":"support@freedomsex.net"},"directories":{},"maintainers":[{"name":"tebaly","email":"support@freedomsex.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/api-resource_2.6.0_1688904234971_0.12525558496901645"},"_hasShrinkwrap":false},"2.6.1":{"name":"@a4sex/api-resource","description":"Api Resource mixin for freedomsex project.","type":"module","main":"index.vue","publishConfig":{"access":"public"},"dependencies":{"@a4sex/params-pruner":"^1.0.0","@a4sex/cache-service":"^1.0.0"},"optionalDependencies":{"@a4sex/cache-service":"^1.0.0"},"repository":{"type":"git","url":"git+ssh://git@gitlab.com/a4sex/npm/library/rest-api/api-resource.git"},"author":{"name":"tebaly","email":"support@freedomsex.net"},"license":"GPL-3.0-or-later","version":"2.6.1","gitHead":"02a9ff897fb530b296f79094b366051b6c4753cd","bugs":{"url":"https://gitlab.com/a4sex/npm/library/rest-api/api-resource/issues"},"homepage":"https://gitlab.com/a4sex/npm/library/rest-api/api-resource#readme","_id":"@a4sex/api-resource@2.6.1","_nodeVersion":"18.15.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-YxhmVnn1cFUeVv5aA0DZcWvms4XV4Oom5tl75zAeOmAzu6hnG/kQPXCGGy3iLKBpXkhts+XXqOkPt/5GhWwoyA==","shasum":"6ce98840843212fa0d425ff2810d60043e87773a","tarball":"https://registry.npmjs.org/@a4sex/api-resource/-/api-resource-2.6.1.tgz","fileCount":9,"unpackedSize":17598,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtR3i/ng7yQg5+uQAGoTFbU0b6/mImeIMO3naYG6zjngIhAOqM44oHE5xv7GneVkAT8WMHjXfsRN4jVD8uBXMI+lnG"}]},"_npmUser":{"name":"tebaly","email":"support@freedomsex.net"},"directories":{},"maintainers":[{"name":"tebaly","email":"support@freedomsex.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/api-resource_2.6.1_1688904663701_0.8744639564552563"},"_hasShrinkwrap":false}},"time":{"created":"2023-07-09T10:31:20.314Z","2.5.0":"2023-07-09T10:31:20.606Z","modified":"2023-07-09T12:11:03.993Z","2.5.1":"2023-07-09T11:40:23.927Z","2.6.0":"2023-07-09T12:03:55.215Z","2.6.1":"2023-07-09T12:11:03.883Z"},"maintainers":[{"name":"tebaly","email":"support@freedomsex.net"}],"description":"Api Resource mixin for freedomsex project.","homepage":"https://gitlab.com/a4sex/npm/library/rest-api/api-resource#readme","repository":{"type":"git","url":"git+ssh://git@gitlab.com/a4sex/npm/library/rest-api/api-resource.git"},"author":{"name":"tebaly","email":"support@freedomsex.net"},"bugs":{"url":"https://gitlab.com/a4sex/npm/library/rest-api/api-resource/issues"},"license":"GPL-3.0-or-later","readme":"# Api Resource\n\nApi Resource mixin for freedomsex project. Depend _axios_, _axios-rest-api_\n\n## Настройка\n\nПутем указания параметров DATA расширяемого компонетна.\n\n```js\n    resource: {\n      name: 'users', // Имя ресурса\n      isPublic: true, // Нужна ли авторизация\n      params: {\n        id: null // Идентификатор ресурса\n      },\n    },\n    subresource: {\n      name: 'invites' \n      // Суб ресурс (/api/resurce_name/10/sub_resurce_name)\n      // Пример /api/users/10/likes\n    },\n```\n\n`resource.name` - если указвн, можно не указывать `name` в методах\n`resource.params.id` - если указан, можно не указывать `id` в методах\n\n## Методы\n\n### Общие\n\nЕсли указан ID получает объект, иначе список. Онисание в методах далее\n\n**restoreData**([name]) - restoreItem|restoreList\n\n**storeCached**([name]) - storeCachedItem|storeCachedList\n\n**restoreCached**([name]) - restoreCachedItem|restoreCachedList\n\n**reloadCached**([id], [name]) - reloadCachedItem|reloadCachedList\n\n**refreshCached**([id], [name], [hard]) - refreshCachedItem|refreshCachedList\n\n### Ресурс\n\n_async_ **loadCached**([id], [name], [force]) - получить объект по ID из кэша или загрузить если отсутствует. `force` - загрузить несмотря ни на что\n\n**loadCachedItem**([id], [name], [force]) - получить объект по ID из кэша, если отсутствует или шаблонный\n\n_async_ **restoreItem**([name]) - получить объект из кэша несмотря ни на что\n\n**restoreCachedItem**([name]) - сохранить список в кэш при условии, если есть и не шаблонный  \n\n_async_ **refreshCachedItem**([id], [name], [hard]) - загрузить несмотря ни на что и сохранить. `hard` - игнорировать существующие данные\n\n### Список\n\n_async_ **cachedList**(name, force) - получить список из кэша или загрузить если список отсутствует или пустой. `force` - загрузить несмотря ни на что\n\n**loadCachedList**([name], [force]) - получить список из кэша, если список пустой или шаблонный\n\n**reloadCachedList**([name]) - сохранить список в кэш при условии, если есть и не шаблонный, и получить список из кэша, если список пустой или шаблонный\n\n_async_ **restoreList**([name]) - получить список из кэша несмотря ни на что\n\n**storeCachedList**([name]) - сохранить список в кэш как есть  \n\n**restoreCachedList**([name]) - сохранить список в кэш при условии, если есть и не шаблонный  \n\n_async_ **refreshCachedList**([name], [hard]) - загрузить несмотря ни на что и сохранить. `hard` - игнорировать существующие данные\n\n## Костыли\n\n**handleResource**() - метод загрузки по умолчанию. Default: `load` - не кэширующая загрузка. Можно заменить на `refreshCached`\n\n**onWatchQuery**() - метод вызываемый при изменении строки адреса. Default: `handleResource`\n\n```\n      isPublic: false,\n      getPublic: false,\n      putPublic: false,\n      postPublic: false,\n      deletePublic: false,\n```\n","readmeFilename":"README.md"}