@lowdefy/actions-core 6.1.0 → 7.0.0

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 (69) hide show
  1. package/dist/actions/AcceptInvitation/AcceptInvitation.js +21 -0
  2. package/dist/actions/AcceptInvitation/schema.js +16 -0
  3. package/dist/actions/ChangePassword/ChangePassword.js +18 -0
  4. package/dist/actions/ChangePassword/schema.js +25 -0
  5. package/dist/actions/EmailOtpSend/EmailOtpSend.js +21 -0
  6. package/dist/actions/EmailOtpSend/schema.js +34 -0
  7. package/dist/actions/EmailOtpVerify/EmailOtpVerify.js +22 -0
  8. package/dist/actions/EmailOtpVerify/schema.js +71 -0
  9. package/dist/actions/GetLocalStorage/GetLocalStorage.js +45 -0
  10. package/dist/actions/GetLocalStorage/schema.js +35 -0
  11. package/dist/actions/LeaveOrganization/LeaveOrganization.js +22 -0
  12. package/dist/actions/LeaveOrganization/schema.js +3 -0
  13. package/dist/actions/Link/schema.js +19 -1
  14. package/dist/actions/ListOrganizations/ListOrganizations.js +21 -0
  15. package/dist/actions/ListOrganizations/schema.js +17 -0
  16. package/dist/actions/Login/schema.js +120 -2
  17. package/dist/actions/Logout/schema.js +45 -2
  18. package/dist/actions/MagicLinkVerify/MagicLinkVerify.js +24 -0
  19. package/dist/actions/MagicLinkVerify/schema.js +64 -0
  20. package/dist/actions/OAuthConsent/OAuthConsent.js +24 -0
  21. package/dist/actions/OAuthConsent/schema.js +38 -0
  22. package/dist/actions/OAuthContinue/OAuthContinue.js +27 -0
  23. package/dist/actions/OAuthContinue/schema.js +22 -0
  24. package/dist/actions/PasskeyDelete/PasskeyDelete.js +18 -0
  25. package/dist/actions/PasskeyDelete/schema.js +16 -0
  26. package/dist/actions/PasskeyRegister/PasskeyRegister.js +21 -0
  27. package/dist/actions/PasskeyRegister/schema.js +21 -0
  28. package/dist/actions/PasskeySignIn/PasskeySignIn.js +21 -0
  29. package/dist/actions/PasskeySignIn/schema.js +59 -0
  30. package/dist/actions/PasskeyUpdate/PasskeyUpdate.js +18 -0
  31. package/dist/actions/PasskeyUpdate/schema.js +21 -0
  32. package/dist/actions/PhoneNumberSendOtp/PhoneNumberSendOtp.js +20 -0
  33. package/dist/actions/PhoneNumberSendOtp/schema.js +20 -0
  34. package/dist/actions/PhoneNumberVerify/PhoneNumberVerify.js +22 -0
  35. package/dist/actions/PhoneNumberVerify/schema.js +79 -0
  36. package/dist/actions/RemoveLocalStorage/RemoveLocalStorage.js +38 -0
  37. package/dist/actions/RemoveLocalStorage/schema.js +32 -0
  38. package/dist/actions/RequestPasswordReset/RequestPasswordReset.js +18 -0
  39. package/dist/actions/RequestPasswordReset/schema.js +25 -0
  40. package/dist/actions/ResetPassword/ResetPassword.js +18 -0
  41. package/dist/actions/ResetPassword/schema.js +28 -0
  42. package/dist/actions/ResetValidation/schema.js +42 -0
  43. package/dist/actions/RevokeOtherSessions/RevokeOtherSessions.js +20 -0
  44. package/dist/actions/RevokeOtherSessions/schema.js +6 -0
  45. package/dist/actions/SendVerificationEmail/SendVerificationEmail.js +20 -0
  46. package/dist/actions/SendVerificationEmail/schema.js +60 -0
  47. package/dist/actions/SetActiveOrganization/SetActiveOrganization.js +21 -0
  48. package/dist/actions/SetActiveOrganization/schema.js +17 -0
  49. package/dist/actions/SetDarkMode/SetDarkMode.js +2 -1
  50. package/dist/actions/SetLocalStorage/SetLocalStorage.js +43 -0
  51. package/dist/actions/SetLocalStorage/schema.js +36 -0
  52. package/dist/actions/SignUp/SignUp.js +18 -0
  53. package/dist/actions/SignUp/schema.js +65 -0
  54. package/dist/actions/TwoFactorDisable/TwoFactorDisable.js +18 -0
  55. package/dist/actions/TwoFactorDisable/schema.js +16 -0
  56. package/dist/actions/TwoFactorEnable/TwoFactorEnable.js +21 -0
  57. package/dist/actions/TwoFactorEnable/schema.js +16 -0
  58. package/dist/actions/TwoFactorGenerateBackupCodes/TwoFactorGenerateBackupCodes.js +21 -0
  59. package/dist/actions/TwoFactorGenerateBackupCodes/schema.js +16 -0
  60. package/dist/actions/TwoFactorVerify/TwoFactorVerify.js +21 -0
  61. package/dist/actions/TwoFactorVerify/schema.js +71 -0
  62. package/dist/actions/Validate/schema.js +42 -0
  63. package/dist/actions.js +29 -1
  64. package/dist/localStorage/parseStoredValue.js +28 -0
  65. package/dist/localStorage/readAppStorageItem.js +35 -0
  66. package/dist/localStorage/validateStorageKey.js +30 -0
  67. package/dist/schemas.js +29 -1
  68. package/dist/types.js +28 -0
  69. package/package.json +8 -4
@@ -0,0 +1,64 @@
1
+ /*
2
+ Copyright 2020-2026 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ const callbackTargetProperties = {
16
+ home: {
17
+ type: 'boolean',
18
+ description: "Land on the app's home page."
19
+ },
20
+ pageId: {
21
+ type: 'string',
22
+ description: 'The pageId to land on.'
23
+ },
24
+ url: {
25
+ type: 'string',
26
+ description: 'The URL to land on. An absolute URL is not basePath-prefixed, so it can be an external landing page.'
27
+ },
28
+ urlQuery: {
29
+ type: 'object',
30
+ description: 'The urlQuery to set on the destination.'
31
+ },
32
+ pathParams: {
33
+ type: 'object',
34
+ description: "Values for the placeholders in the destination page's path, by placeholder name."
35
+ }
36
+ };
37
+ export default {
38
+ type: 'object',
39
+ params: {
40
+ type: 'object',
41
+ description: 'Parameters for spending the magic-link token. All are optional: the sign-in email links to the landing page named by "auth.authPages.magicLink" with the token and the callback destinations already on its URL query, and this action reads its defaults from there. Set a parameter only to override what the email carried.',
42
+ properties: {
43
+ token: {
44
+ type: 'string',
45
+ description: 'The single-use magic-link token. Defaults to the "token" URL query parameter of the landing page. The action fails when neither is a string, because there is nothing to verify.'
46
+ },
47
+ callbackUrl: {
48
+ type: 'object',
49
+ description: 'Where a successful sign-in lands. Defaults to the "callbackURL" URL query parameter the sign-in email carried onto the landing page, and to BetterAuth\'s own default when that is absent too. "false" is not valid here - verification redirects through a hop the app does not control, so there is no staying put.',
50
+ properties: callbackTargetProperties
51
+ },
52
+ newUserCallbackUrl: {
53
+ type: 'object',
54
+ description: 'Where a sign-in that creates a new account lands, for a first-run or onboarding page. Defaults to the "newUserCallbackURL" URL query parameter, and to callbackUrl when neither is set.',
55
+ properties: callbackTargetProperties
56
+ },
57
+ errorCallbackUrl: {
58
+ type: 'object',
59
+ description: 'Where a failed verification lands, with the reason in "?error=". Defaults to the "errorCallbackURL" URL query parameter, then to the app\'s "auth.authPages.error" page.',
60
+ properties: callbackTargetProperties
61
+ }
62
+ }
63
+ }
64
+ };
@@ -0,0 +1,24 @@
1
+ /*
2
+ Copyright 2020-2026 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ // Approves or denies the pending OAuth authorization request. The signed
16
+ // authorization query the consent page arrived with is not passed as params
17
+ // - the auth client lifts it from the page URL, so the action must run
18
+ // before any navigation drops that query. Returns the OAuth client's
19
+ // redirect URI (carrying a code on accept, error=access_denied on deny) for
20
+ // page config to navigate to.
21
+ function OAuthConsent({ methods: { oauth2Consent }, params }) {
22
+ return oauth2Consent(params);
23
+ }
24
+ export default OAuthConsent;
@@ -0,0 +1,38 @@
1
+ /*
2
+ Copyright 2020-2026 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ export default {
16
+ type: 'object',
17
+ params: {
18
+ type: 'object',
19
+ description: 'Parameters for responding to the pending OAuth authorization request. The signed authorization query the consent page was redirected with is read from the page URL automatically, so the action must be called while the page still holds it.',
20
+ required: [
21
+ 'accept'
22
+ ],
23
+ properties: {
24
+ accept: {
25
+ type: 'boolean',
26
+ description: 'Approve (true) or deny (false) the authorization request. On deny the returned redirect URI carries the access_denied OAuth error.'
27
+ },
28
+ scope: {
29
+ type: 'string',
30
+ description: 'Space-separated subset of the requested scopes to grant. When omitted, all requested scopes are granted.'
31
+ },
32
+ claims: {
33
+ type: 'object',
34
+ description: 'Subset of the requested OIDC claims to grant. When omitted, all requested claims are granted.'
35
+ }
36
+ }
37
+ }
38
+ };
@@ -0,0 +1,27 @@
1
+ /*
2
+ Copyright 2020-2026 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ // Resumes the pending OAuth authorization after the post-login choice - the
16
+ // organization the grant acts in. The page runs SetActiveOrganization for the
17
+ // chosen organization first, then this: the authorization server reads the
18
+ // choice from the session's active organization and proceeds to consent (or
19
+ // straight to the client when consent for that organization already stands).
20
+ // The signed authorization query the page arrived with is not passed as
21
+ // params - the auth client lifts it from the page URL, so the action must run
22
+ // before any navigation drops that query. Returns the next URL for page
23
+ // config to navigate to.
24
+ function OAuthContinue({ methods: { oauth2Continue }, params }) {
25
+ return oauth2Continue(params);
26
+ }
27
+ export default OAuthContinue;
@@ -0,0 +1,22 @@
1
+ /*
2
+ Copyright 2020-2026 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ export default {
16
+ type: 'object',
17
+ params: {
18
+ type: 'object',
19
+ description: 'Parameters for resuming the pending OAuth authorization after the post-login organization choice. The signed authorization query the page was redirected with is read from the page URL automatically, so the action must be called while the page still holds it. Run SetActiveOrganization for the chosen organization first.',
20
+ properties: {}
21
+ }
22
+ };
@@ -0,0 +1,18 @@
1
+ /*
2
+ Copyright 2020-2026 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ function PasskeyDelete({ methods: { passkeyDelete }, params }) {
16
+ return passkeyDelete(params);
17
+ }
18
+ export default PasskeyDelete;
@@ -0,0 +1,16 @@
1
+ export default {
2
+ type: 'object',
3
+ params: {
4
+ type: 'object',
5
+ description: 'Parameters identifying the passkey to delete.',
6
+ required: [
7
+ 'passkeyId'
8
+ ],
9
+ properties: {
10
+ passkeyId: {
11
+ type: 'string',
12
+ description: 'Id of the passkey to delete.'
13
+ }
14
+ }
15
+ }
16
+ };
@@ -0,0 +1,21 @@
1
+ /*
2
+ Copyright 2020-2026 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ // The WebAuthn browser ceremony runs inside the action - the method fetches
16
+ // the registration options, prompts the authenticator and verifies the
17
+ // result. Returns the registered passkey as confirmation.
18
+ function PasskeyRegister({ methods: { passkeyRegister }, params }) {
19
+ return passkeyRegister(params);
20
+ }
21
+ export default PasskeyRegister;
@@ -0,0 +1,21 @@
1
+ export default {
2
+ type: 'object',
3
+ params: {
4
+ type: 'object',
5
+ description: 'Parameters passed to the passkey register method.',
6
+ properties: {
7
+ name: {
8
+ type: 'string',
9
+ description: 'A display name for the passkey.'
10
+ },
11
+ authenticatorAttachment: {
12
+ type: 'string',
13
+ enum: [
14
+ 'platform',
15
+ 'cross-platform'
16
+ ],
17
+ description: 'Restrict the authenticator type used for registration.'
18
+ }
19
+ }
20
+ }
21
+ };
@@ -0,0 +1,21 @@
1
+ /*
2
+ Copyright 2020-2026 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ // Passkey sign-in - public. The WebAuthn assertion ceremony runs inside the
16
+ // action (options fetch, navigator.credentials.get(), verification); the
17
+ // method navigates to callbackUrl on the session-bearing success.
18
+ function PasskeySignIn({ methods: { passkeySignIn }, params }) {
19
+ return passkeySignIn(params);
20
+ }
21
+ export default PasskeySignIn;
@@ -0,0 +1,59 @@
1
+ /*
2
+ Copyright 2020-2026 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ export default {
16
+ type: 'object',
17
+ params: {
18
+ type: 'object',
19
+ description: 'Parameters passed to the passkey sign-in method.',
20
+ properties: {
21
+ callbackUrl: {
22
+ oneOf: [
23
+ {
24
+ type: 'object',
25
+ description: "Structured callback target for where a successful passkey sign-in lands, basePath-prefixed. Defaults to the app's home page when omitted and no ?callbackUrl= query is present; a ?callbackUrl= query set by the unauthenticated-page redirect wins over that default, and this param wins over both.",
26
+ properties: {
27
+ home: {
28
+ type: 'boolean',
29
+ description: "Land on the app's home page."
30
+ },
31
+ pageId: {
32
+ type: 'string',
33
+ description: 'The pageId to land on.'
34
+ },
35
+ url: {
36
+ type: 'string',
37
+ description: 'The URL to land on. An absolute URL is not basePath-prefixed, so it can be an external landing page.'
38
+ },
39
+ urlQuery: {
40
+ type: 'object',
41
+ description: 'The urlQuery to set on the destination.'
42
+ },
43
+ pathParams: {
44
+ type: 'object',
45
+ description: "Values for the placeholders in the destination page's path, by placeholder name."
46
+ }
47
+ }
48
+ },
49
+ {
50
+ enum: [
51
+ false
52
+ ],
53
+ description: 'Do not navigate - the session store re-renders the page with the new user in place, for a re-authentication prompt in a modal or an embedded panel.'
54
+ }
55
+ ]
56
+ }
57
+ }
58
+ }
59
+ };
@@ -0,0 +1,18 @@
1
+ /*
2
+ Copyright 2020-2026 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ function PasskeyUpdate({ methods: { passkeyUpdate }, params }) {
16
+ return passkeyUpdate(params);
17
+ }
18
+ export default PasskeyUpdate;
@@ -0,0 +1,21 @@
1
+ export default {
2
+ type: 'object',
3
+ params: {
4
+ type: 'object',
5
+ description: 'Parameters identifying the passkey to rename and its new name.',
6
+ required: [
7
+ 'passkeyId',
8
+ 'name'
9
+ ],
10
+ properties: {
11
+ passkeyId: {
12
+ type: 'string',
13
+ description: 'Id of the passkey to rename.'
14
+ },
15
+ name: {
16
+ type: 'string',
17
+ description: 'New name for the passkey.'
18
+ }
19
+ }
20
+ }
21
+ };
@@ -0,0 +1,20 @@
1
+ /*
2
+ Copyright 2020-2026 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ // Sends a sign-in/verification OTP to the phone number over SMS, dispatched
16
+ // through the app's "phone.otp.send" auth hook binding.
17
+ function PhoneNumberSendOtp({ methods: { phoneNumberSendOtp }, params }) {
18
+ return phoneNumberSendOtp(params);
19
+ }
20
+ export default PhoneNumberSendOtp;
@@ -0,0 +1,20 @@
1
+ export default {
2
+ type: 'object',
3
+ params: {
4
+ type: 'object',
5
+ description: 'Parameters passed to the phone-number send-OTP method.',
6
+ required: [
7
+ 'phoneNumber'
8
+ ],
9
+ properties: {
10
+ phoneNumber: {
11
+ type: 'string',
12
+ description: 'Phone number to send the OTP to, in E.164 format (e.g. "+27831234567").'
13
+ },
14
+ captchaToken: {
15
+ type: 'string',
16
+ description: 'Captcha token minted by a Captcha block, sent as the x-captcha-response header when auth.captcha is enabled. Tokens are single-use - reset the Captcha block in onError for retries.'
17
+ }
18
+ }
19
+ }
20
+ };
@@ -0,0 +1,22 @@
1
+ /*
2
+ Copyright 2020-2026 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ // Verifies a phone OTP - the OTP sign-in. On success the session cookie is
16
+ // set (and the account is created under signUpOnVerification). Like
17
+ // TwoFactorVerify it does not auto-navigate - verify serves sign-in, sign-up
18
+ // and phone-change confirmation, so navigation after is the app's business.
19
+ function PhoneNumberVerify({ methods: { phoneNumberVerify }, params }) {
20
+ return phoneNumberVerify(params);
21
+ }
22
+ export default PhoneNumberVerify;
@@ -0,0 +1,79 @@
1
+ /*
2
+ Copyright 2020-2026 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ export default {
16
+ type: 'object',
17
+ params: {
18
+ type: 'object',
19
+ description: 'Parameters passed to the phone-number verify method.',
20
+ required: [
21
+ 'phoneNumber',
22
+ 'code'
23
+ ],
24
+ properties: {
25
+ phoneNumber: {
26
+ type: 'string',
27
+ description: 'Phone number the OTP was sent to, in E.164 format.'
28
+ },
29
+ code: {
30
+ type: 'string',
31
+ description: 'The OTP code received over SMS.'
32
+ },
33
+ disableSession: {
34
+ type: 'boolean',
35
+ description: 'Verify without creating a session.'
36
+ },
37
+ updatePhoneNumber: {
38
+ type: 'boolean',
39
+ description: 'Update the signed-in user to this phone number on verify - the phone change confirmation flow.'
40
+ },
41
+ callbackUrl: {
42
+ oneOf: [
43
+ {
44
+ type: 'object',
45
+ description: "Structured callback target for where a successful verification lands, basePath-prefixed. Defaults to the app's home page when omitted and no ?callbackUrl= query is present; a ?callbackUrl= query set by the unauthenticated-page redirect wins over that default, and this param wins over both. Ignored when the verification creates no session: with disableSession: true, and with updatePhoneNumber: true, where a signed-in user is confirming a new number and stays where they are.",
46
+ properties: {
47
+ home: {
48
+ type: 'boolean',
49
+ description: "Land on the app's home page."
50
+ },
51
+ pageId: {
52
+ type: 'string',
53
+ description: 'The pageId to land on.'
54
+ },
55
+ url: {
56
+ type: 'string',
57
+ description: 'The URL to land on. An absolute URL is not basePath-prefixed, so it can be an external landing page.'
58
+ },
59
+ urlQuery: {
60
+ type: 'object',
61
+ description: 'The urlQuery to set on the destination.'
62
+ },
63
+ pathParams: {
64
+ type: 'object',
65
+ description: "Values for the placeholders in the destination page's path, by placeholder name."
66
+ }
67
+ }
68
+ },
69
+ {
70
+ enum: [
71
+ false
72
+ ],
73
+ description: 'Do not navigate - the session store re-renders the page with the new user in place, for a verify form in a modal or an embedded panel.'
74
+ }
75
+ ]
76
+ }
77
+ }
78
+ }
79
+ };
@@ -0,0 +1,38 @@
1
+ /*
2
+ Copyright 2020-2026 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import { UserError } from '@lowdefy/errors';
16
+ import { type } from '@lowdefy/helpers';
17
+ import validateStorageKey from '../../localStorage/validateStorageKey.js';
18
+ function RemoveLocalStorage({ globals, methods, params }) {
19
+ if (!type.isObject(params)) {
20
+ throw new Error('RemoveLocalStorage params should be an object.');
21
+ }
22
+ const { key } = params;
23
+ validateStorageKey({
24
+ actionType: 'RemoveLocalStorage',
25
+ key
26
+ });
27
+ try {
28
+ globals.window.localStorage.removeItem(methods.getAppStorageKey(key));
29
+ // A value set before keys were kept per app would otherwise be moved back on the next read.
30
+ globals.window.localStorage.removeItem(key);
31
+ } catch (error) {
32
+ // Blocked storage (SecurityError) comes from the user's browser, not the app config.
33
+ throw new UserError(`RemoveLocalStorage could not remove "${key}" from local storage. Local storage is blocked in this browser.`, {
34
+ cause: error
35
+ });
36
+ }
37
+ }
38
+ export default RemoveLocalStorage;
@@ -0,0 +1,32 @@
1
+ /*
2
+ Copyright 2020-2026 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ export default {
16
+ type: 'object',
17
+ params: {
18
+ type: 'object',
19
+ required: [
20
+ 'key'
21
+ ],
22
+ properties: {
23
+ key: {
24
+ type: 'string',
25
+ minLength: 1,
26
+ pattern: '^(?!lowdefy_|lf-)',
27
+ description: 'The local storage key to remove. Keys starting with "lowdefy_" or "lf-" are reserved for Lowdefy.'
28
+ }
29
+ },
30
+ additionalProperties: false
31
+ }
32
+ };
@@ -0,0 +1,18 @@
1
+ /*
2
+ Copyright 2020-2026 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ function RequestPasswordReset({ methods: { requestPasswordReset }, params }) {
16
+ return requestPasswordReset(params);
17
+ }
18
+ export default RequestPasswordReset;
@@ -0,0 +1,25 @@
1
+ export default {
2
+ type: 'object',
3
+ params: {
4
+ type: 'object',
5
+ description: 'Parameters passed to the request-password-reset method. One of email or phoneNumber is required.',
6
+ properties: {
7
+ email: {
8
+ type: 'string',
9
+ description: 'Email address of the account to send the password reset email to.'
10
+ },
11
+ phoneNumber: {
12
+ type: 'string',
13
+ description: 'Phone number of the account to send the password reset otp to over SMS, in E.164 format.'
14
+ },
15
+ redirectTo: {
16
+ type: 'string',
17
+ description: 'URL of the app page where the user resets their password - the emailed link redirects here with the reset token as a query parameter (?token=), or with ?error=INVALID_TOKEN when the link is invalid or expired. Defaults to the auth.authPages.resetPassword page.'
18
+ },
19
+ captchaToken: {
20
+ type: 'string',
21
+ description: 'Captcha token minted by a Captcha block, sent as the x-captcha-response header when auth.captcha is enabled. Tokens are single-use - reset the Captcha block in onError for retries.'
22
+ }
23
+ }
24
+ }
25
+ };