{"id":22779196,"url":"https://github.com/platzi-master-c8/ms-extensions","last_synced_at":"2025-03-30T14:14:02.258Z","repository":{"id":45136891,"uuid":"430575327","full_name":"Platzi-Master-C8/MS-Extensions","owner":"Platzi-Master-C8","description":null,"archived":false,"fork":false,"pushed_at":"2022-03-06T00:30:32.000Z","size":165,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-05T15:50:55.435Z","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/Platzi-Master-C8.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-11-22T05:31:11.000Z","updated_at":"2022-01-16T19:57:53.000Z","dependencies_parsed_at":"2022-07-21T06:32:21.360Z","dependency_job_id":null,"html_url":"https://github.com/Platzi-Master-C8/MS-Extensions","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/Platzi-Master-C8%2FMS-Extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Platzi-Master-C8%2FMS-Extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Platzi-Master-C8%2FMS-Extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Platzi-Master-C8%2FMS-Extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Platzi-Master-C8","download_url":"https://codeload.github.com/Platzi-Master-C8/MS-Extensions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246326791,"owners_count":20759439,"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-12-11T20:08:00.180Z","updated_at":"2025-03-30T14:14:02.237Z","avatar_url":"https://github.com/Platzi-Master-C8.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## **Microservice Extension Squad API**\r\nThis API was developed with this stack: NodeJS, Hapi.dev, Typescript and Sequelize, Postgres.\r\nAt first this API work as a CRUD where we are going to save our JobVacants in our DB.\r\n\r\nAnd we will use auth0 for the authentication/authorization. For this task we need to use this `endpoint` from auth0.\r\n\r\n    https://{domain}/authorize?response_type=token\u0026client_id={client_id}\u0026connection={red_social}\u0026redirect_uri={url_redirect}\u0026audience=https://{domain}/api/v2/\r\n\r\nNow we have to provide the fields: `domain`, `client_id` and `url_redirect`. At `red_social`we have to provide the social network that we want to use for the auth: `facebook`, `twitter`, `linkdin`.\r\n\r\nThis will return a `Bearer` token and you must have to provide with every single request in our `endpoints`\r\n\r\n    GET /api/job-vacancies\r\nThis endpoint with the method `GET` will return all the vacants the user have saved, al those in an `array`of `objects`.\r\n\r\n    [\r\n\t    {\r\n\t\t    \"id\":  1, //ID of the JobVacant\r\n\t\t    \"title\":  \"Dev Facebbok\",//Title\r\n\t\t    \"link\":  \"facebook/jobs\",//Link to the Vacant\r\n\t\t    \"company\":  \"Facebook\",//Company\r\n\t\t    \"date_application\":  TIMESTAMP,//Date of apply\r\n\t\t    \"interest\":  3,//Our interest in this vacant\r\n\t\t    \"notes\":  \"Quiero este trabajo\",//Some notes if we want\r\n\t\t\t \"salary_from\": 2222,\r\n\t\t\t \"salary_to\": 222222,\r\n\t\t\t \"currency\": \"USD\"\r\n\t\t    \"user_id\":  1,//User id\r\n\t\t    \"createdAt\":  \"2021-12-06T23:44:49.142Z\",//Create at\r\n\t\t    \"updatedAt\":  \"2021-12-06T23:44:49.142Z\"//Update\r\n\t    },\r\n    ]\r\n\r\n\r\n With the `POST` method we will create/save in our DB the Vacant\r\n\r\n      POST /api/job-vacancies\r\nand we have to receive in the `req.payload` the following `JSON`\r\n\r\n    {\r\n\t\t    \"id\":  1, //ID of the JobVacant\r\n\t\t    \"title\":  \"Dev Facebbok\",//Title\r\n\t\t    \"link\":  \"facebook/jobs\",//Link to the Vacant\r\n\t\t    \"company\":  \"Facebook\",//Company\r\n\t\t    \"date_application\":  null,//Date of apply\r\n\t\t    \"interest\":  3,//Our interest in this vacant\r\n\t\t    \"notes\":  \"Quiero este trabajo\",//Some notes if we want\r\n\t\t\t \"salary_from\": 2222,//salary_from and salary_to it would be the range\r\n\t\t\t \"salary_to\": 222222,\r\n\t\t\t \"currency\": \"USD\",\r\n\t\t    \"user_id\":  1,//User id\r\n\t\t    \"createdAt\":  \"2021-12-06T23:44:49.142Z\",//Create at\r\n\t\t    \"updatedAt\":  \"2021-12-06T23:44:49.142Z\"//Update\r\n    }\r\n    \r\n   For delete a register we will use the `DELETE` method\r\n\r\n     DELETE  /api/job-vacancies/{vacant_id}\r\nWe need to provide the `user_id` and the `id` of the vacant in the `req.params`, if exist this going to `DELETE` the register and return a `JSON`\r\n\r\n    {\r\n    \tcode:  200,\r\n    \tmessage:  'DELETE',\r\n    }\r\nIf the Vacant not exist, the `JSON` returned would be this:\r\n\r\n    {\r\n    \t\"code\":  400,\r\n    \t\"message\":  \"Not exist\"\r\n    }\r\n\r\n    \r\nWhen we want to get a single(Just one) Vacant we need to use a `GET` method.\r\n\r\n     GET  /api/job-vacancies/{vacant_id}\r\n\r\n the same way we use it with the `DELETE` method, in this case `JSON` it would be like this:\r\n\r\n    {\r\n    \t\"code\":  200,\r\n    \t\"vacant\":  {\r\n    \t\t\"id\":  9,\r\n    \t\t\"title\":  \"Dev 3\",\r\n    \t\t\"link\":  \"google/job 3\",\r\n    \t\t\"company\":  \"Google 3\",\r\n    \t\t\"date_application\":  null,\r\n    \t\t\"interest\":  3,\r\n    \t\t\"notes\":  \"Quiero este trabajo\",\r\n\t\t\t\"salary_from\": 2222,\r\n\t\t\t\"salary_to\": 222222,\r\n\t\t\t\"currency\": \"USD\"\r\n    \t\t\"user_id\":  3,\r\n    \t\t\"createdAt\":  \"2022-01-05T13:04:47.844Z\",\r\n    \t\t\"updatedAt\":  \"2022-01-05T13:04:47.844Z\"\r\n    \t},\r\n    \t\"message\":  \"OK\"\r\n    }\r\n\r\nIf the Vacant not exist, the `JSON` returned would be this:\r\n\r\n    {\r\n    \t\"code\":  400,\r\n    \t\"message\":  \"Not exist\"\r\n    }\r\n\r\nWhen we need to `update` one Vacant we have to use `PATCH` method. You must have to follow the rules when you create a Vacant with the `POST` method.\r\n\r\n     PATCH  /api/job-vacancies/{vacant_id}\r\n\r\nLike the two previus method. The `JSON` returned in here it would be like this.\r\n\r\n    {\r\n    \t\"code\":  200,\r\n    \t\"message\":  \"UPDATE\"\r\n    }\r\nIf the Vacant not exist, the `JSON` returned would be this:\r\n\r\n\t{\r\n\t\t\"code\":  400,\r\n\t\t\"message\":  \"Not exist\"\r\n\t}","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplatzi-master-c8%2Fms-extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplatzi-master-c8%2Fms-extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplatzi-master-c8%2Fms-extensions/lists"}