@anvil-works/anvil-pyright 0.0.1 → 0.0.2-canary

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/dist/anvil-typeshed/TODOS.md +70 -0
  2. package/dist/anvil-typeshed/client/anvil/__init__.pyi +1291 -0
  3. package/dist/anvil-typeshed/client/anvil/__pycache__/server.cpython-39.pyc +0 -0
  4. package/dist/anvil-typeshed/client/anvil/email.pyi +152 -0
  5. package/dist/anvil-typeshed/client/anvil/facebook/__init__.pyi +8 -0
  6. package/dist/anvil-typeshed/client/anvil/facebook/auth.pyi +30 -0
  7. package/dist/anvil-typeshed/client/anvil/google/__init__.pyi +11 -0
  8. package/dist/anvil-typeshed/client/anvil/google/auth.pyi +37 -0
  9. package/dist/anvil-typeshed/client/anvil/google/drive.pyi +98 -0
  10. package/dist/anvil-typeshed/client/anvil/google/sheets.pyi +98 -0
  11. package/dist/anvil-typeshed/client/anvil/http.pyi +66 -0
  12. package/dist/anvil-typeshed/client/anvil/image.pyi +30 -0
  13. package/dist/anvil-typeshed/client/anvil/js/__init__.pyi +143 -0
  14. package/dist/anvil-typeshed/client/anvil/js/window/__init__.pyi +2935 -0
  15. package/dist/anvil-typeshed/client/anvil/media.pyi +46 -0
  16. package/dist/anvil-typeshed/client/anvil/microsoft/__init__.pyi +8 -0
  17. package/dist/anvil-typeshed/client/anvil/microsoft/auth.pyi +34 -0
  18. package/dist/anvil-typeshed/client/anvil/mpl_util.pyi +29 -0
  19. package/dist/anvil-typeshed/client/anvil/plotly_templates.pyi +15 -0
  20. package/dist/anvil-typeshed/client/anvil/saml/__init__.pyi +8 -0
  21. package/dist/anvil-typeshed/client/anvil/saml/auth.pyi +24 -0
  22. package/dist/anvil-typeshed/client/anvil/secrets.pyi +22 -0
  23. package/dist/anvil-typeshed/client/anvil/server.pyi +376 -0
  24. package/dist/anvil-typeshed/client/anvil/stripe.pyi +23 -0
  25. package/dist/anvil-typeshed/client/anvil/tables/__init__.pyi +297 -0
  26. package/dist/anvil-typeshed/client/anvil/tables/query.pyi +88 -0
  27. package/dist/anvil-typeshed/client/anvil/tz.pyi +92 -0
  28. package/dist/anvil-typeshed/client/anvil/users/__init__.pyi +191 -0
  29. package/dist/anvil-typeshed/client/anvil/users/mfa.pyi +76 -0
  30. package/dist/anvil-typeshed/client/stripe/__init__.pyi +8 -0
  31. package/dist/anvil-typeshed/client/stripe/checkout.pyi +67 -0
  32. package/dist/anvil-typeshed/server/anvil/__init__.pyi +148 -0
  33. package/dist/anvil-typeshed/server/anvil/email.pyi +188 -0
  34. package/dist/anvil-typeshed/server/anvil/facebook/__init__.pyi +8 -0
  35. package/dist/anvil-typeshed/server/anvil/facebook/auth.pyi +27 -0
  36. package/dist/anvil-typeshed/server/anvil/files.pyi +53 -0
  37. package/dist/anvil-typeshed/server/anvil/google/__init__.pyi +11 -0
  38. package/dist/anvil-typeshed/server/anvil/google/auth.pyi +31 -0
  39. package/dist/anvil-typeshed/server/anvil/google/drive.pyi +98 -0
  40. package/dist/anvil-typeshed/server/anvil/google/mail.pyi +24 -0
  41. package/dist/anvil-typeshed/server/anvil/google/sheets.pyi +98 -0
  42. package/dist/anvil-typeshed/server/anvil/http.pyi +66 -0
  43. package/dist/anvil-typeshed/server/anvil/image.pyi +30 -0
  44. package/dist/anvil-typeshed/server/anvil/media.pyi +32 -0
  45. package/dist/anvil-typeshed/server/anvil/microsoft/__init__.pyi +8 -0
  46. package/dist/anvil-typeshed/server/anvil/microsoft/auth.pyi +31 -0
  47. package/dist/anvil-typeshed/server/anvil/mpl_util.pyi +29 -0
  48. package/dist/anvil-typeshed/server/anvil/pdf.pyi +61 -0
  49. package/dist/anvil-typeshed/server/anvil/plotly_templates.pyi +15 -0
  50. package/dist/anvil-typeshed/server/anvil/saml/__init__.pyi +8 -0
  51. package/dist/anvil-typeshed/server/anvil/saml/auth.pyi +21 -0
  52. package/dist/anvil-typeshed/server/anvil/secrets.pyi +22 -0
  53. package/dist/anvil-typeshed/server/anvil/server.pyi +470 -0
  54. package/dist/anvil-typeshed/server/anvil/stripe.pyi +23 -0
  55. package/dist/anvil-typeshed/server/anvil/tables/__init__.pyi +319 -0
  56. package/dist/anvil-typeshed/server/anvil/tables/query.pyi +88 -0
  57. package/dist/anvil-typeshed/server/anvil/tz.pyi +92 -0
  58. package/dist/anvil-typeshed/server/anvil/users/__init__.pyi +83 -0
  59. package/dist/anvil-typeshed/server/anvil/users/mfa.pyi +65 -0
  60. package/dist/anvil-typeshed/server/stripe/__init__.pyi +8 -0
  61. package/dist/anvil-typeshed/server/stripe/checkout.pyi +9 -0
  62. package/dist/anvil-typeshed/source/anvil/__init__.pyi +1306 -0
  63. package/dist/anvil-typeshed/source/anvil/email.pyi +188 -0
  64. package/dist/anvil-typeshed/source/anvil/facebook/__init__.pyi +4 -0
  65. package/dist/anvil-typeshed/source/anvil/facebook/auth.pyi +28 -0
  66. package/dist/anvil-typeshed/source/anvil/files.pyi +50 -0
  67. package/dist/anvil-typeshed/source/anvil/google/__init__.pyi +7 -0
  68. package/dist/anvil-typeshed/source/anvil/google/auth.pyi +35 -0
  69. package/dist/anvil-typeshed/source/anvil/google/drive.pyi +94 -0
  70. package/dist/anvil-typeshed/source/anvil/google/mail.pyi +21 -0
  71. package/dist/anvil-typeshed/source/anvil/google/sheets.pyi +94 -0
  72. package/dist/anvil-typeshed/source/anvil/http.pyi +62 -0
  73. package/dist/anvil-typeshed/source/anvil/image.pyi +26 -0
  74. package/dist/anvil-typeshed/source/anvil/js/__init__.pyi +140 -0
  75. package/dist/anvil-typeshed/source/anvil/js/window/__init__.pyi +2932 -0
  76. package/dist/anvil-typeshed/source/anvil/media.pyi +62 -0
  77. package/dist/anvil-typeshed/source/anvil/microsoft/__init__.pyi +4 -0
  78. package/dist/anvil-typeshed/source/anvil/microsoft/auth.pyi +32 -0
  79. package/dist/anvil-typeshed/source/anvil/mpl_util.pyi +25 -0
  80. package/dist/anvil-typeshed/source/anvil/pdf.pyi +58 -0
  81. package/dist/anvil-typeshed/source/anvil/plotly_templates.pyi +11 -0
  82. package/dist/anvil-typeshed/source/anvil/saml/__init__.pyi +4 -0
  83. package/dist/anvil-typeshed/source/anvil/saml/auth.pyi +22 -0
  84. package/dist/anvil-typeshed/source/anvil/secrets.pyi +18 -0
  85. package/dist/anvil-typeshed/source/anvil/server.pyi +511 -0
  86. package/dist/anvil-typeshed/source/anvil/stripe.pyi +19 -0
  87. package/dist/anvil-typeshed/source/anvil/tables/__init__.pyi +319 -0
  88. package/dist/anvil-typeshed/source/anvil/tables/query.pyi +84 -0
  89. package/dist/anvil-typeshed/source/anvil/tz.pyi +88 -0
  90. package/dist/anvil-typeshed/source/anvil/users/__init__.pyi +196 -0
  91. package/dist/anvil-typeshed/source/anvil/users/mfa.pyi +74 -0
  92. package/dist/anvil-typeshed/source/stripe/__init__.pyi +4 -0
  93. package/dist/anvil-typeshed/source/stripe/checkout.pyi +65 -0
  94. package/dist/pyright-langserver.js +1 -1
  95. package/dist/pyright-langserver.js.map +1 -1
  96. package/dist/pyright.js +1 -1
  97. package/dist/pyright.js.map +1 -1
  98. package/package.json +1 -1
@@ -0,0 +1,74 @@
1
+ # Type stubs for anvil.users.mfa module
2
+ # Generated files: client/anvil/users/mfa.pyi, server/anvil/users/mfa.pyi
3
+
4
+ from typing import Any, Literal
5
+
6
+ from anvil.tables import Row
7
+
8
+ def create_fido_mfa_method(email_address: str) -> Any:
9
+ """Generate a WebAuthn challenge that can be used to register a new hardware token for two-factor authentication."""
10
+ ...
11
+
12
+ def get_fido_mfa_login(email_address: str, password: str) -> Any:
13
+ """Generate a WebAuthn challenge that the given user can use to log in with a previously registered hardware token."""
14
+ ...
15
+
16
+ def get_totp_mfa_login(code: str) -> Any:
17
+ """Get an MFA login object representing a TOTP login code.
18
+
19
+ This can be passed to the login_with_email function as the mfa argument."""
20
+ ...
21
+
22
+ def get_twilio_mfa_login(code: str) -> Any:
23
+ """Get an MFA login object representing a Twilio Verify token.
24
+
25
+ This can be passed to the login_with_email function as the mfa argument."""
26
+ ...
27
+
28
+ def generate_totp_secret(email_address: str) -> dict[str, Any]:
29
+ """Generate a TOTP secret that can be added as two-factor authentication for the current user."""
30
+ ...
31
+
32
+ def validate_totp_code(mfa_method: Any, code: str) -> bool:
33
+ """Validate the given TOTP code against the given MFA method from a User row."""
34
+ ...
35
+
36
+ def generate_twilio_mfa_method(phone: str) -> Any:
37
+ """Generate a Twilio MFA method from the provided phone number."""
38
+ ...
39
+
40
+ def send_twilio_token(mfa_method: Any, channel: Literal["sms", "call"]) -> None:
41
+ """Send a Twilio Verify token using the given MFA method from a User row."""
42
+ ...
43
+
44
+ def check_twilio_token(mfa_method: Any, token: str) -> bool:
45
+ """Validate the given Twilio Verify token against the given MFA method from a User row."""
46
+ ...
47
+
48
+ def add_mfa_method(password: str, mfa_method: Any, *, clear_existing: bool = False) -> None:
49
+ """Add an MFA method to the current user by passing the user's password and the mfa method.
50
+
51
+ Optionally clearing all existing methods."""
52
+ ...
53
+
54
+ def get_available_mfa_types(email_address: str, password: str) -> list[str]:
55
+ """Get the available MFA types for the given user by passing their email and password."""
56
+ ...
57
+
58
+ def get_enabled_mfa_types() -> list[str]:
59
+ """Get all the enabled MFA types for this app."""
60
+ ...
61
+
62
+ # @client-only
63
+ def mfa_login_with_form(email_address: str, password: str) -> Row | None:
64
+ """Display a form to collect two-factor authentication credentials from the user currently logging in.
65
+
66
+ Pass the function their email and password."""
67
+ ...
68
+
69
+ def configure_mfa_with_form(*, allow_cancel: bool = False) -> None:
70
+ """Display a form for the user to configure 2-factor authentication.
71
+
72
+ allow_cancel: if True, the signup form has a Cancel button that the user can use to dismiss the form."""
73
+ ...
74
+ # @end-client-only
@@ -0,0 +1,4 @@
1
+ # Type stubs for stripe module
2
+ # Generated files: client/stripe/__init__.pyi, server/stripe/__init__.pyi
3
+
4
+ from stripe import checkout as checkout
@@ -0,0 +1,65 @@
1
+ # Type stubs for stripe.checkout module
2
+ # Generated files: client/stripe/checkout.pyi, server/stripe/checkout.pyi
3
+
4
+ from typing import Any
5
+
6
+ # @client-only
7
+ def get_token(
8
+ *,
9
+ amount: int,
10
+ currency: str,
11
+ title: str | None = None,
12
+ description: str | None = None,
13
+ icon_url: str | None = None,
14
+ billing_address: bool = False,
15
+ zipcode: bool = False,
16
+ raw: bool = False,
17
+ ) -> tuple[str, dict[str, Any]]:
18
+ """Show the Stripe checkout form and return a raw (token, user_details) tuple.
19
+
20
+ The token can be used to place charges from server modules.
21
+ The user_details are a dictionary of user-supplied data (eg 'email').
22
+
23
+ Args:
24
+ amount: A number, in least units of currency (eg cents or pennies).
25
+ currency: A three-letter currency code (eg 'USD').
26
+ title: Configures the checkout dialog title.
27
+ description: Configures the checkout dialog description.
28
+ icon_url: Path to an image to be used on the checkout form.
29
+ zipcode: Setting to True requires the user to enter their postal code.
30
+ billing_address: Setting to True requires the user to enter a billing address.
31
+ raw: Setting to True returns a token for your own API key.
32
+
33
+ [Anvil Docs](https://anvil.works/docs/integrations/stripe)"""
34
+ ...
35
+
36
+
37
+ def charge(
38
+ *,
39
+ amount: int,
40
+ currency: str,
41
+ title: str | None = None,
42
+ description: str | None = None,
43
+ icon_url: str | None = None,
44
+ billing_address: bool = False,
45
+ shipping_address: bool = False,
46
+ zipcode: bool = False,
47
+ ) -> dict[str, Any]:
48
+ """Charge the user for a one-off payment by showing a Stripe checkout form.
49
+
50
+ Returns a dictionary of information about the transaction on success.
51
+
52
+ Args:
53
+ amount: A number, in least units of currency (eg cents or pennies).
54
+ currency: A three-letter currency code (eg 'USD').
55
+ title: Configures the checkout dialog title.
56
+ description: Configures the checkout dialog description.
57
+ icon_url: Path to an image to be used on the checkout form
58
+ (eg anvil.server.get_app_origin() + '/_/theme/icon.png').
59
+ billing_address: Setting to True requires the user to enter a billing address.
60
+ shipping_address: Setting to True requires the user to enter a shipping and billing address.
61
+ zipcode: Setting to True requires the user to enter their zipcode/postal code.
62
+
63
+ [Anvil Docs](https://anvil.works/docs/integrations/stripe)"""
64
+ ...
65
+ # @end-client-only