@lowdefy/actions-core 6.1.0 → 7.1.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,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 ResetPassword({ methods: { resetPassword }, params }) {
16
+ return resetPassword(params);
17
+ }
18
+ export default ResetPassword;
@@ -0,0 +1,28 @@
1
+ export default {
2
+ type: 'object',
3
+ params: {
4
+ type: 'object',
5
+ description: 'Parameters passed to the reset-password method. Resets with the emailed token, or with the SMS otp when phoneNumber is set.',
6
+ required: [
7
+ 'newPassword'
8
+ ],
9
+ properties: {
10
+ newPassword: {
11
+ type: 'string',
12
+ description: 'The new password to set.'
13
+ },
14
+ token: {
15
+ type: 'string',
16
+ description: 'The reset token from the emailed password reset link.'
17
+ },
18
+ phoneNumber: {
19
+ type: 'string',
20
+ description: 'Phone number the reset otp was sent to, in E.164 format.'
21
+ },
22
+ otp: {
23
+ type: 'string',
24
+ description: 'The reset code received over SMS, used with phoneNumber instead of token.'
25
+ }
26
+ }
27
+ }
28
+ };
@@ -12,6 +12,48 @@ export default {
12
12
  type: 'string'
13
13
  },
14
14
  description: 'An array of blockIds to reset validation for.'
15
+ },
16
+ {
17
+ type: 'boolean',
18
+ description: 'true matches every block on the page.'
19
+ },
20
+ {
21
+ type: 'object',
22
+ additionalProperties: false,
23
+ properties: {
24
+ blockIds: {
25
+ description: 'A blockId, a list of blockIds, or true for every block.',
26
+ oneOf: [
27
+ {
28
+ type: 'string'
29
+ },
30
+ {
31
+ type: 'array',
32
+ items: {
33
+ type: 'string'
34
+ }
35
+ },
36
+ {
37
+ type: 'boolean'
38
+ }
39
+ ]
40
+ },
41
+ regex: {
42
+ description: 'A regular expression, or a list of them, matched against block ids.',
43
+ oneOf: [
44
+ {
45
+ type: 'string'
46
+ },
47
+ {
48
+ type: 'array',
49
+ items: {
50
+ type: 'string'
51
+ }
52
+ }
53
+ ]
54
+ }
55
+ },
56
+ description: 'Blocks to match by id and by regular expression.'
15
57
  }
16
58
  ]
17
59
  }
@@ -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
+ */ // Revokes every session except the current one. Per-session revoke is
16
+ // deliberately excluded - it would put session tokens in config reach.
17
+ function RevokeOtherSessions({ methods: { revokeOtherSessions } }) {
18
+ return revokeOtherSessions();
19
+ }
20
+ export default RevokeOtherSessions;
@@ -0,0 +1,6 @@
1
+ export default {
2
+ type: 'object',
3
+ params: {
4
+ description: 'RevokeOtherSessions takes no parameters.'
5
+ }
6
+ };
@@ -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
+ */ // Resends the verification email for an unverified account. Public - an
16
+ // unverified user holds no session.
17
+ function SendVerificationEmail({ methods: { sendVerificationEmail }, params }) {
18
+ return sendVerificationEmail(params);
19
+ }
20
+ export default SendVerificationEmail;
@@ -0,0 +1,60 @@
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 send-verification-email method.',
20
+ required: [
21
+ 'email'
22
+ ],
23
+ properties: {
24
+ email: {
25
+ type: 'string',
26
+ description: 'Email address of the unverified account to send the verification email to.'
27
+ },
28
+ callbackUrl: {
29
+ type: 'object',
30
+ description: 'Structured callback target for where the emailed verification link lands after verifying, basePath-prefixed. Defaults to the auth.authPages.verifyEmail page, which receives ?error= when the link is invalid or expired. A false value is not valid here: the destination belongs to a redirect hop this action cannot suppress.',
31
+ properties: {
32
+ home: {
33
+ type: 'boolean',
34
+ description: "Land on the app's home page."
35
+ },
36
+ pageId: {
37
+ type: 'string',
38
+ description: 'The pageId to land on.'
39
+ },
40
+ url: {
41
+ type: 'string',
42
+ description: 'The URL to land on. An absolute URL is not basePath-prefixed, so it can be an external landing page.'
43
+ },
44
+ urlQuery: {
45
+ type: 'object',
46
+ description: 'The urlQuery to set on the destination.'
47
+ },
48
+ pathParams: {
49
+ type: 'object',
50
+ description: "Values for the placeholders in the destination page's path, by placeholder name."
51
+ }
52
+ }
53
+ },
54
+ captchaToken: {
55
+ type: 'string',
56
+ 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.'
57
+ }
58
+ }
59
+ }
60
+ };
@@ -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
+ */ // Switches the session's active organization. Roles and attributes resolve
16
+ // from the new active membership server-side - chain UpdateSession after to
17
+ // re-sync the client.
18
+ function SetActiveOrganization({ methods: { setActiveOrganization }, params }) {
19
+ return setActiveOrganization(params);
20
+ }
21
+ export default SetActiveOrganization;
@@ -0,0 +1,17 @@
1
+ export default {
2
+ type: 'object',
3
+ params: {
4
+ type: 'object',
5
+ description: 'Parameters identifying the organization to set active. One of organizationId or organizationSlug is required.',
6
+ properties: {
7
+ organizationId: {
8
+ type: 'string',
9
+ description: 'Id of the organization to set as the active organization.'
10
+ },
11
+ organizationSlug: {
12
+ type: 'string',
13
+ description: 'Slug of the organization to set as the active organization.'
14
+ }
15
+ }
16
+ }
17
+ };
@@ -19,7 +19,8 @@
19
19
  };
20
20
  function SetDarkMode({ globals, methods, params }) {
21
21
  const { window } = globals;
22
- const currentPreference = window.localStorage?.getItem('lowdefy_darkMode') ?? 'system';
22
+ // The client keeps the preference it reads from storage, under the app's key.
23
+ const currentPreference = window.__lowdefy_darkModePreference ?? 'system';
23
24
  const newPreference = params?.darkMode ?? cycleOrder[currentPreference] ?? 'light';
24
25
  window.__lowdefy_setDarkMode?.(newPreference);
25
26
  // Trigger engine update cascade so _media: darkMode re-evaluates in all blocks
@@ -0,0 +1,43 @@
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 { serializer, type } from '@lowdefy/helpers';
17
+ import validateStorageKey from '../../localStorage/validateStorageKey.js';
18
+ function SetLocalStorage({ globals, methods, params }) {
19
+ if (!type.isObject(params)) {
20
+ throw new Error('SetLocalStorage params should be an object.');
21
+ }
22
+ const { key, value } = params;
23
+ validateStorageKey({
24
+ actionType: 'SetLocalStorage',
25
+ key
26
+ });
27
+ if (type.isUndefined(value)) {
28
+ throw new Error('SetLocalStorage "value" is required.');
29
+ }
30
+ const serialized = serializer.serializeToString(value);
31
+ try {
32
+ globals.window.localStorage.setItem(methods.getAppStorageKey(key), serialized);
33
+ // A value set before keys were kept per app must not outlive the new one.
34
+ globals.window.localStorage.removeItem(key);
35
+ } catch (error) {
36
+ // Blocked storage (SecurityError) or a full quota (QuotaExceededError) comes from the
37
+ // user's browser, not the app config.
38
+ throw new UserError(`SetLocalStorage could not write "${key}" to local storage. Local storage is blocked or full in this browser.`, {
39
+ cause: error
40
+ });
41
+ }
42
+ }
43
+ export default SetLocalStorage;
@@ -0,0 +1,36 @@
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
+ 'value'
22
+ ],
23
+ properties: {
24
+ key: {
25
+ type: 'string',
26
+ minLength: 1,
27
+ pattern: '^(?!lowdefy_|lf-)',
28
+ description: 'The local storage key to write to. Keys starting with "lowdefy_" or "lf-" are reserved for Lowdefy.'
29
+ },
30
+ value: {
31
+ description: 'The value to store. Values are serialized, so dates are preserved when read back with GetLocalStorage.'
32
+ }
33
+ },
34
+ additionalProperties: false
35
+ }
36
+ };
@@ -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 SignUp({ methods: { signUp }, params }) {
16
+ return signUp(params);
17
+ }
18
+ export default SignUp;
@@ -0,0 +1,65 @@
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 sign-up method (email/password only).',
20
+ properties: {
21
+ email: {
22
+ type: 'string',
23
+ description: 'Email address of the account to create.'
24
+ },
25
+ password: {
26
+ type: 'string',
27
+ description: 'Password for the new account.'
28
+ },
29
+ name: {
30
+ type: 'string',
31
+ description: 'Name of the user.'
32
+ },
33
+ callbackUrl: {
34
+ type: 'object',
35
+ description: 'Structured callback target for where the new account lands - both where the emailed verification link goes and, when the response carries a session, where the browser navigates. basePath-prefixed. When omitted, the verification link lands on the auth.authPages.verifyEmail page (with ?error= when the link is invalid or expired), and a session-bearing response navigates to the ?callbackUrl= query, else the home page. A false value is not valid here: the same value is the emailed link destination, which SignUp cannot suppress.',
36
+ properties: {
37
+ home: {
38
+ type: 'boolean',
39
+ description: "Land on the app's home page."
40
+ },
41
+ pageId: {
42
+ type: 'string',
43
+ description: 'The pageId to land on.'
44
+ },
45
+ url: {
46
+ type: 'string',
47
+ description: 'The URL to land on. An absolute URL is not basePath-prefixed, so it can be an external landing page.'
48
+ },
49
+ urlQuery: {
50
+ type: 'object',
51
+ description: 'The urlQuery to set on the destination.'
52
+ },
53
+ pathParams: {
54
+ type: 'object',
55
+ description: "Values for the placeholders in the destination page's path, by placeholder name."
56
+ }
57
+ }
58
+ },
59
+ captchaToken: {
60
+ type: 'string',
61
+ 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.'
62
+ }
63
+ }
64
+ }
65
+ };
@@ -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 TwoFactorDisable({ methods: { twoFactorDisable }, params }) {
16
+ return twoFactorDisable(params);
17
+ }
18
+ export default TwoFactorDisable;
@@ -0,0 +1,16 @@
1
+ export default {
2
+ type: 'object',
3
+ params: {
4
+ type: 'object',
5
+ description: 'Parameters passed to the two-factor disable method.',
6
+ required: [
7
+ 'password'
8
+ ],
9
+ properties: {
10
+ password: {
11
+ type: 'string',
12
+ description: 'The password of the signed-in user - disabling two-factor is password-gated.'
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
+ */ // Returns the totpURI and backup codes the page must render once - read them
16
+ // via _actions.<id>.response later in the same event chain. Enrolment
17
+ // completes when TwoFactorVerify confirms a TOTP code.
18
+ function TwoFactorEnable({ methods: { twoFactorEnable }, params }) {
19
+ return twoFactorEnable(params);
20
+ }
21
+ export default TwoFactorEnable;
@@ -0,0 +1,16 @@
1
+ export default {
2
+ type: 'object',
3
+ params: {
4
+ type: 'object',
5
+ description: 'Parameters passed to the two-factor enable method.',
6
+ required: [
7
+ 'password'
8
+ ],
9
+ properties: {
10
+ password: {
11
+ type: 'string',
12
+ description: 'The password of the signed-in user - enabling two-factor is password-gated.'
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
+ */ // Returns the new backup codes the page must render once - read them via
16
+ // _actions.<id>.response later in the same event chain. Rotates recovery
17
+ // codes only; the TOTP secret and enrolment are untouched.
18
+ function TwoFactorGenerateBackupCodes({ methods: { twoFactorGenerateBackupCodes }, params }) {
19
+ return twoFactorGenerateBackupCodes(params);
20
+ }
21
+ export default TwoFactorGenerateBackupCodes;
@@ -0,0 +1,16 @@
1
+ export default {
2
+ type: 'object',
3
+ params: {
4
+ type: 'object',
5
+ description: 'Parameters passed to the two-factor generate-backup-codes method.',
6
+ required: [
7
+ 'password'
8
+ ],
9
+ properties: {
10
+ password: {
11
+ type: 'string',
12
+ description: 'The password of the signed-in user - generating backup codes is password-gated.'
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
+ */ // Verifies a TOTP code or a backup code - both the enrolment confirmation
16
+ // and the sign-in challenge. The sign-in challenge verify completes the
17
+ // session itself; navigation after is the app's business.
18
+ function TwoFactorVerify({ methods: { twoFactorVerify }, params }) {
19
+ return twoFactorVerify(params);
20
+ }
21
+ export default TwoFactorVerify;
@@ -0,0 +1,71 @@
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 two-factor verify method. One of code or backupCode is required.',
20
+ properties: {
21
+ code: {
22
+ type: 'string',
23
+ description: 'The TOTP code from the authenticator app.'
24
+ },
25
+ backupCode: {
26
+ type: 'string',
27
+ description: 'A backup code, used instead of a TOTP code.'
28
+ },
29
+ trustDevice: {
30
+ type: 'boolean',
31
+ description: 'Trust this device for 30 days - no two-factor challenge on sign-in.'
32
+ },
33
+ callbackUrl: {
34
+ oneOf: [
35
+ {
36
+ type: 'object',
37
+ description: "Structured callback target for where a successful challenge lands, basePath-prefixed. Defaults to the app's home page when omitted and no ?callbackUrl= query is present; the ?callbackUrl= query the sign-in method put on the challenge page wins over that default, and this param wins over both.",
38
+ properties: {
39
+ home: {
40
+ type: 'boolean',
41
+ description: "Land on the app's home page."
42
+ },
43
+ pageId: {
44
+ type: 'string',
45
+ description: 'The pageId to land on.'
46
+ },
47
+ url: {
48
+ type: 'string',
49
+ description: 'The URL to land on. An absolute URL is not basePath-prefixed, so it can be an external landing page.'
50
+ },
51
+ urlQuery: {
52
+ type: 'object',
53
+ description: 'The urlQuery to set on the destination.'
54
+ },
55
+ pathParams: {
56
+ type: 'object',
57
+ description: "Values for the placeholders in the destination page's path, by placeholder name."
58
+ }
59
+ }
60
+ },
61
+ {
62
+ enum: [
63
+ false
64
+ ],
65
+ description: 'Do not navigate - for a challenge page that renders its own post-challenge state instead.'
66
+ }
67
+ ]
68
+ }
69
+ }
70
+ }
71
+ };