{"id":21842050,"url":"https://github.com/sapfir0/axioswrapper","last_synced_at":"2025-03-21T16:12:52.232Z","repository":{"id":46201556,"uuid":"389175273","full_name":"Sapfir0/AxiosWrapper","owner":"Sapfir0","description":null,"archived":false,"fork":false,"pushed_at":"2022-11-13T08:30:09.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-26T11:24:05.394Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sapfir0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-24T18:42:01.000Z","updated_at":"2021-11-07T16:49:24.000Z","dependencies_parsed_at":"2023-01-23T00:00:30.530Z","dependency_job_id":null,"html_url":"https://github.com/Sapfir0/AxiosWrapper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sapfir0%2FAxiosWrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sapfir0%2FAxiosWrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sapfir0%2FAxiosWrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sapfir0%2FAxiosWrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sapfir0","download_url":"https://codeload.github.com/Sapfir0/AxiosWrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244825651,"owners_count":20516592,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-27T22:09:47.236Z","updated_at":"2025-03-21T16:12:52.205Z","avatar_url":"https://github.com/Sapfir0.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Api interaction services\n\n224kb\n\nAll services use `fp-ts` library, http methods wrapper return `fp-ts` either.\n## Simple api interaction class\n\n```ts\nimport { ApiInteractionService } from 'api_interaction_services';\n```\n\nSo you can use it like this:\n\n0.2x:\n\n```ts\nconst fetcher = new ApiInteractionService(\"http://localhost:3300\");\nfetcher.get('/');\n```\n\n0.3x:\n\n```ts\nconst fetcher = new ApiInteractionService(\"http://localhost:3300\");\nfetcher.get('/')();\n```\n\n\n## Indendity interaction service\n\nA more powerful tool that allows you to communicate with a closed API that requires access and refresh tokens.\n\n```ts\nimport { BearerApiInteractionService } from 'api_interaction_services';\n```\n\n\n## Inversify\n\nOr you can use this classes with inverisify in a few steps:\n\n1. Declare SERVICE_IDENTIFIER name for service\n```ts\nexport const SERVICE_IDENTIFIER = {\n    ApiInteractionService: Symbol.for(\"ApiInteractionService\"),\n};\n```\n\n2. Bind this name to class with url to your API\n```ts\ncontainer.bind\u003cApiInteractionService\u003e(SERVICE_IDENTIFIER.ApiInteractionService).toConstantValue(new ApiInteractionService(API_URL));\n```\n\n3. And now you can inject this service to your class\n\n```ts\nconstructor(@inject(SERVICE_IDENTIFIER.ApiInteractionService) protected _apiService: ApiInteractionService) {}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsapfir0%2Faxioswrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsapfir0%2Faxioswrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsapfir0%2Faxioswrapper/lists"}