Skip to content

Commit e2d5e63

Browse files
committed
adding dev-v0.25.1 tag to this commit to ensure building
1 parent 030d7ce commit e2d5e63

File tree

7 files changed

+155
-15
lines changed

7 files changed

+155
-15
lines changed

html/supertokens_python/constants.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ <h1 class="title">Module <code>supertokens_python.constants</code></h1>
4343
from __future__ import annotations
4444

4545
SUPPORTED_CDI_VERSIONS = [&#34;5.1&#34;]
46-
VERSION = &#34;0.25.0&#34;
46+
VERSION = &#34;0.25.1&#34;
4747
TELEMETRY = &#34;/telemetry&#34;
4848
USER_COUNT = &#34;/users/count&#34;
4949
USER_DELETE = &#34;/user/remove&#34;

html/supertokens_python/recipe/dashboard/api/index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,9 @@ <h2 class="section-title" id="header-functions">Functions</h2>
881881
user_context,
882882
)
883883

884+
if isinstance(email_update_response, EmailChangeNotAllowedErrorResponse):
885+
return EmailChangeNotAllowedErrorResponse(email_update_response.error)
886+
884887
if not isinstance(email_update_response, OkResponse):
885888
return email_update_response
886889

@@ -892,6 +895,9 @@ <h2 class="section-title" id="header-functions">Functions</h2>
892895
user_context,
893896
)
894897

898+
if isinstance(phone_update_response, PhoneNumberChangeNotAllowedErrorResponse):
899+
return PhoneNumberChangeNotAllowedErrorResponse(phone_update_response.error)
900+
895901
if not isinstance(phone_update_response, OkResponse):
896902
return phone_update_response
897903

html/supertokens_python/recipe/dashboard/api/userdetails/user_put.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,9 @@ <h1 class="title">Module <code>supertokens_python.recipe.dashboard.api.userdetai
367367
user_context,
368368
)
369369

370+
if isinstance(email_update_response, EmailChangeNotAllowedErrorResponse):
371+
return EmailChangeNotAllowedErrorResponse(email_update_response.error)
372+
370373
if not isinstance(email_update_response, OkResponse):
371374
return email_update_response
372375

@@ -378,6 +381,9 @@ <h1 class="title">Module <code>supertokens_python.recipe.dashboard.api.userdetai
378381
user_context,
379382
)
380383

384+
if isinstance(phone_update_response, PhoneNumberChangeNotAllowedErrorResponse):
385+
return PhoneNumberChangeNotAllowedErrorResponse(phone_update_response.error)
386+
381387
if not isinstance(phone_update_response, OkResponse):
382388
return phone_update_response
383389

@@ -491,6 +497,9 @@ <h2 class="section-title" id="header-functions">Functions</h2>
491497
user_context,
492498
)
493499

500+
if isinstance(email_update_response, EmailChangeNotAllowedErrorResponse):
501+
return EmailChangeNotAllowedErrorResponse(email_update_response.error)
502+
494503
if not isinstance(email_update_response, OkResponse):
495504
return email_update_response
496505

@@ -502,6 +511,9 @@ <h2 class="section-title" id="header-functions">Functions</h2>
502511
user_context,
503512
)
504513

514+
if isinstance(phone_update_response, PhoneNumberChangeNotAllowedErrorResponse):
515+
return PhoneNumberChangeNotAllowedErrorResponse(phone_update_response.error)
516+
505517
if not isinstance(phone_update_response, OkResponse):
506518
return phone_update_response
507519

html/supertokens_python/recipe/dashboard/constants.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ <h1 class="title">Module <code>supertokens_python.recipe.dashboard.constants</co
4949
CREATE_EMAIL_PASSWORD_USER = &#34;/api/user/emailpassword&#34;
5050
CREATE_PASSWORDLESS_USER = &#34;/api/user/passwordless&#34;
5151
UNLINK_USER = &#34;/api/user/unlink&#34;
52+
53+
USERROLES_LIST_API = &#34;/api/userroles/roles&#34;
5254
USERROLES_PERMISSIONS_API = &#34;/api/userroles/role/permissions&#34;
5355
USERROLES_REMOVE_PERMISSIONS_API = &#34;/api/userroles/role/permissions/remove&#34;
5456
USERROLES_ROLE_API = &#34;/api/userroles/role&#34;

html/supertokens_python/recipe/dashboard/recipe.html

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ <h1 class="title">Module <code>supertokens_python.recipe.dashboard.recipe</code>
170170
CREATE_EMAIL_PASSWORD_USER,
171171
CREATE_PASSWORDLESS_USER,
172172
UNLINK_USER,
173+
USERROLES_LIST_API,
173174
USERROLES_PERMISSIONS_API,
174175
USERROLES_REMOVE_PERMISSIONS_API,
175176
USERROLES_ROLE_API,
@@ -226,6 +227,18 @@ <h1 class="title">Module <code>supertokens_python.recipe.dashboard.recipe</code>
226227
DASHBOARD_API,
227228
False,
228229
),
230+
APIHandled(
231+
NormalisedURLPath(get_api_path_with_dashboard_base(&#34;/roles&#34;)),
232+
&#34;get&#34;,
233+
DASHBOARD_API,
234+
False,
235+
),
236+
APIHandled(
237+
NormalisedURLPath(get_api_path_with_dashboard_base(&#34;/tenants&#34;)),
238+
&#34;get&#34;,
239+
DASHBOARD_API,
240+
False,
241+
),
229242
APIHandled(
230243
NormalisedURLPath(get_api_path_with_dashboard_base(SIGN_IN_API)),
231244
&#34;post&#34;,
@@ -470,6 +483,12 @@ <h1 class="title">Module <code>supertokens_python.recipe.dashboard.recipe</code>
470483
USERROLES_REMOVE_PERMISSIONS_API,
471484
False,
472485
),
486+
APIHandled(
487+
NormalisedURLPath(get_api_path_with_dashboard_base(USERROLES_LIST_API)),
488+
&#34;get&#34;,
489+
USERROLES_LIST_API,
490+
False,
491+
),
473492
APIHandled(
474493
NormalisedURLPath(get_api_path_with_dashboard_base(USERROLES_ROLE_API)),
475494
&#34;put&#34;,
@@ -611,6 +630,8 @@ <h1 class="title">Module <code>supertokens_python.recipe.dashboard.recipe</code>
611630
api_function = create_passwordless_user
612631
elif request_id == UNLINK_USER:
613632
api_function = handle_user_unlink_get
633+
elif request_id == USERROLES_LIST_API:
634+
api_function = get_all_roles_api
614635
elif request_id == USERROLES_PERMISSIONS_API:
615636
api_function = get_permissions_for_role_api
616637
elif request_id == USERROLES_REMOVE_PERMISSIONS_API:
@@ -758,6 +779,18 @@ <h2 class="section-title" id="header-classes">Classes</h2>
758779
DASHBOARD_API,
759780
False,
760781
),
782+
APIHandled(
783+
NormalisedURLPath(get_api_path_with_dashboard_base(&#34;/roles&#34;)),
784+
&#34;get&#34;,
785+
DASHBOARD_API,
786+
False,
787+
),
788+
APIHandled(
789+
NormalisedURLPath(get_api_path_with_dashboard_base(&#34;/tenants&#34;)),
790+
&#34;get&#34;,
791+
DASHBOARD_API,
792+
False,
793+
),
761794
APIHandled(
762795
NormalisedURLPath(get_api_path_with_dashboard_base(SIGN_IN_API)),
763796
&#34;post&#34;,
@@ -1002,6 +1035,12 @@ <h2 class="section-title" id="header-classes">Classes</h2>
10021035
USERROLES_REMOVE_PERMISSIONS_API,
10031036
False,
10041037
),
1038+
APIHandled(
1039+
NormalisedURLPath(get_api_path_with_dashboard_base(USERROLES_LIST_API)),
1040+
&#34;get&#34;,
1041+
USERROLES_LIST_API,
1042+
False,
1043+
),
10051044
APIHandled(
10061045
NormalisedURLPath(get_api_path_with_dashboard_base(USERROLES_ROLE_API)),
10071046
&#34;put&#34;,
@@ -1143,6 +1182,8 @@ <h2 class="section-title" id="header-classes">Classes</h2>
11431182
api_function = create_passwordless_user
11441183
elif request_id == UNLINK_USER:
11451184
api_function = handle_user_unlink_get
1185+
elif request_id == USERROLES_LIST_API:
1186+
api_function = get_all_roles_api
11461187
elif request_id == USERROLES_PERMISSIONS_API:
11471188
api_function = get_permissions_for_role_api
11481189
elif request_id == USERROLES_REMOVE_PERMISSIONS_API:
@@ -1344,6 +1385,18 @@ <h3>Methods</h3>
13441385
DASHBOARD_API,
13451386
False,
13461387
),
1388+
APIHandled(
1389+
NormalisedURLPath(get_api_path_with_dashboard_base(&#34;/roles&#34;)),
1390+
&#34;get&#34;,
1391+
DASHBOARD_API,
1392+
False,
1393+
),
1394+
APIHandled(
1395+
NormalisedURLPath(get_api_path_with_dashboard_base(&#34;/tenants&#34;)),
1396+
&#34;get&#34;,
1397+
DASHBOARD_API,
1398+
False,
1399+
),
13471400
APIHandled(
13481401
NormalisedURLPath(get_api_path_with_dashboard_base(SIGN_IN_API)),
13491402
&#34;post&#34;,
@@ -1588,6 +1641,12 @@ <h3>Methods</h3>
15881641
USERROLES_REMOVE_PERMISSIONS_API,
15891642
False,
15901643
),
1644+
APIHandled(
1645+
NormalisedURLPath(get_api_path_with_dashboard_base(USERROLES_LIST_API)),
1646+
&#34;get&#34;,
1647+
USERROLES_LIST_API,
1648+
False,
1649+
),
15911650
APIHandled(
15921651
NormalisedURLPath(get_api_path_with_dashboard_base(USERROLES_ROLE_API)),
15931652
&#34;put&#34;,
@@ -1739,6 +1798,8 @@ <h3>Methods</h3>
17391798
api_function = create_passwordless_user
17401799
elif request_id == UNLINK_USER:
17411800
api_function = handle_user_unlink_get
1801+
elif request_id == USERROLES_LIST_API:
1802+
api_function = get_all_roles_api
17421803
elif request_id == USERROLES_PERMISSIONS_API:
17431804
api_function = get_permissions_for_role_api
17441805
elif request_id == USERROLES_REMOVE_PERMISSIONS_API:

html/supertokens_python/recipe/multitenancy/interfaces.html

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,17 @@ <h1 class="title">Module <code>supertokens_python.recipe.multitenancy.interfaces
8484
required_secondary_factors=json.get(&#34;requiredSecondaryFactors&#34;, []),
8585
)
8686

87+
def to_json(self) -&gt; Dict[str, Any]:
88+
res: Dict[str, Any] = {}
89+
res[&#34;tenantId&#34;] = self.tenant_id
90+
res[&#34;thirdPartyProviders&#34;] = [
91+
provider.to_json() for provider in self.third_party_providers
92+
]
93+
res[&#34;firstFactors&#34;] = self.first_factors
94+
res[&#34;requiredSecondaryFactors&#34;] = self.required_secondary_factors
95+
res[&#34;coreConfig&#34;] = self.core_config
96+
return res
97+
8798

8899
class TenantConfigCreateOrUpdate:
89100
# pylint: disable=dangerous-default-value
@@ -1261,7 +1272,18 @@ <h3>Methods</h3>
12611272
core_config=json.get(&#34;coreConfig&#34;, {}),
12621273
first_factors=json.get(&#34;firstFactors&#34;, []),
12631274
required_secondary_factors=json.get(&#34;requiredSecondaryFactors&#34;, []),
1264-
)</code></pre>
1275+
)
1276+
1277+
def to_json(self) -&gt; Dict[str, Any]:
1278+
res: Dict[str, Any] = {}
1279+
res[&#34;tenantId&#34;] = self.tenant_id
1280+
res[&#34;thirdPartyProviders&#34;] = [
1281+
provider.to_json() for provider in self.third_party_providers
1282+
]
1283+
res[&#34;firstFactors&#34;] = self.first_factors
1284+
res[&#34;requiredSecondaryFactors&#34;] = self.required_secondary_factors
1285+
res[&#34;coreConfig&#34;] = self.core_config
1286+
return res</code></pre>
12651287
</details>
12661288
<h3>Static methods</h3>
12671289
<dl>
@@ -1289,6 +1311,30 @@ <h3>Static methods</h3>
12891311
</details>
12901312
</dd>
12911313
</dl>
1314+
<h3>Methods</h3>
1315+
<dl>
1316+
<dt id="supertokens_python.recipe.multitenancy.interfaces.TenantConfig.to_json"><code class="name flex">
1317+
<span>def <span class="ident">to_json</span></span>(<span>self) ‑> Dict[str, Any]</span>
1318+
</code></dt>
1319+
<dd>
1320+
<div class="desc"></div>
1321+
<details class="source">
1322+
<summary>
1323+
<span>Expand source code</span>
1324+
</summary>
1325+
<pre><code class="python">def to_json(self) -&gt; Dict[str, Any]:
1326+
res: Dict[str, Any] = {}
1327+
res[&#34;tenantId&#34;] = self.tenant_id
1328+
res[&#34;thirdPartyProviders&#34;] = [
1329+
provider.to_json() for provider in self.third_party_providers
1330+
]
1331+
res[&#34;firstFactors&#34;] = self.first_factors
1332+
res[&#34;requiredSecondaryFactors&#34;] = self.required_secondary_factors
1333+
res[&#34;coreConfig&#34;] = self.core_config
1334+
return res</code></pre>
1335+
</details>
1336+
</dd>
1337+
</dl>
12921338
</dd>
12931339
<dt id="supertokens_python.recipe.multitenancy.interfaces.TenantConfigCreateOrUpdate"><code class="flex name class">
12941340
<span>class <span class="ident">TenantConfigCreateOrUpdate</span></span>
@@ -1617,6 +1663,7 @@ <h4><code><a title="supertokens_python.recipe.multitenancy.interfaces.RecipeInte
16171663
<h4><code><a title="supertokens_python.recipe.multitenancy.interfaces.TenantConfig" href="#supertokens_python.recipe.multitenancy.interfaces.TenantConfig">TenantConfig</a></code></h4>
16181664
<ul class="">
16191665
<li><code><a title="supertokens_python.recipe.multitenancy.interfaces.TenantConfig.from_json" href="#supertokens_python.recipe.multitenancy.interfaces.TenantConfig.from_json">from_json</a></code></li>
1666+
<li><code><a title="supertokens_python.recipe.multitenancy.interfaces.TenantConfig.to_json" href="#supertokens_python.recipe.multitenancy.interfaces.TenantConfig.to_json">to_json</a></code></li>
16201667
</ul>
16211668
</li>
16221669
<li>

html/supertokens_python/types.html

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,20 @@ <h1 class="title">Module <code>supertokens_python.types</code></h1>
159159
)
160160

161161
def to_json(self) -&gt; Dict[str, Any]:
162-
return {
162+
result: Dict[str, Any] = {
163163
&#34;recipeId&#34;: self.recipe_id,
164164
&#34;recipeUserId&#34;: self.recipe_user_id.get_as_string(),
165165
&#34;tenantIds&#34;: self.tenant_ids,
166-
&#34;email&#34;: self.email,
167-
&#34;phoneNumber&#34;: self.phone_number,
168-
&#34;thirdParty&#34;: self.third_party.to_json() if self.third_party else None,
169166
&#34;timeJoined&#34;: self.time_joined,
170167
&#34;verified&#34;: self.verified,
171168
}
169+
if self.email is not None:
170+
result[&#34;email&#34;] = self.email
171+
if self.phone_number is not None:
172+
result[&#34;phoneNumber&#34;] = self.phone_number
173+
if self.third_party is not None:
174+
result[&#34;thirdParty&#34;] = self.third_party.to_json()
175+
return result
172176

173177
@staticmethod
174178
def from_json(json: Dict[str, Any]) -&gt; &#34;LoginMethod&#34;:
@@ -646,16 +650,20 @@ <h3>Methods</h3>
646650
)
647651

648652
def to_json(self) -&gt; Dict[str, Any]:
649-
return {
653+
result: Dict[str, Any] = {
650654
&#34;recipeId&#34;: self.recipe_id,
651655
&#34;recipeUserId&#34;: self.recipe_user_id.get_as_string(),
652656
&#34;tenantIds&#34;: self.tenant_ids,
653-
&#34;email&#34;: self.email,
654-
&#34;phoneNumber&#34;: self.phone_number,
655-
&#34;thirdParty&#34;: self.third_party.to_json() if self.third_party else None,
656657
&#34;timeJoined&#34;: self.time_joined,
657658
&#34;verified&#34;: self.verified,
658659
}
660+
if self.email is not None:
661+
result[&#34;email&#34;] = self.email
662+
if self.phone_number is not None:
663+
result[&#34;phoneNumber&#34;] = self.phone_number
664+
if self.third_party is not None:
665+
result[&#34;thirdParty&#34;] = self.third_party.to_json()
666+
return result
659667

660668
@staticmethod
661669
def from_json(json: Dict[str, Any]) -&gt; &#34;LoginMethod&#34;:
@@ -803,16 +811,20 @@ <h3>Methods</h3>
803811
<span>Expand source code</span>
804812
</summary>
805813
<pre><code class="python">def to_json(self) -&gt; Dict[str, Any]:
806-
return {
814+
result: Dict[str, Any] = {
807815
&#34;recipeId&#34;: self.recipe_id,
808816
&#34;recipeUserId&#34;: self.recipe_user_id.get_as_string(),
809817
&#34;tenantIds&#34;: self.tenant_ids,
810-
&#34;email&#34;: self.email,
811-
&#34;phoneNumber&#34;: self.phone_number,
812-
&#34;thirdParty&#34;: self.third_party.to_json() if self.third_party else None,
813818
&#34;timeJoined&#34;: self.time_joined,
814819
&#34;verified&#34;: self.verified,
815-
}</code></pre>
820+
}
821+
if self.email is not None:
822+
result[&#34;email&#34;] = self.email
823+
if self.phone_number is not None:
824+
result[&#34;phoneNumber&#34;] = self.phone_number
825+
if self.third_party is not None:
826+
result[&#34;thirdParty&#34;] = self.third_party.to_json()
827+
return result</code></pre>
816828
</details>
817829
</dd>
818830
</dl>

0 commit comments

Comments
 (0)