@nocobase/app-plugin-verification 0.0.0-stage → 0.1.0-beta.1

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 (66) hide show
  1. package/LICENSE.txt +127 -0
  2. package/README.md +6 -2
  3. package/dist/client/api.d.ts +18 -0
  4. package/dist/client/api.d.ts.map +1 -0
  5. package/dist/client/api.js +44 -0
  6. package/dist/client/api.js.map +1 -0
  7. package/dist/client/hooks.d.ts +17 -0
  8. package/dist/client/hooks.d.ts.map +1 -0
  9. package/dist/client/hooks.js +91 -0
  10. package/dist/client/hooks.js.map +1 -0
  11. package/dist/client/index.d.ts +4 -0
  12. package/dist/client/index.d.ts.map +1 -0
  13. package/dist/client/index.js +4 -0
  14. package/dist/client/index.js.map +1 -0
  15. package/dist/database/migrations/.manifest.json +9 -0
  16. package/dist/database/migrations/202611250001_verification_create_tables.d.ts +4 -0
  17. package/dist/database/migrations/202611250001_verification_create_tables.d.ts.map +1 -0
  18. package/dist/database/migrations/202611250001_verification_create_tables.js +68 -0
  19. package/dist/database/migrations/202611250001_verification_create_tables.js.map +1 -0
  20. package/dist/server/config.d.ts +27 -0
  21. package/dist/server/config.d.ts.map +1 -0
  22. package/dist/server/config.js +38 -0
  23. package/dist/server/config.js.map +1 -0
  24. package/dist/server/contracts.d.ts +71 -0
  25. package/dist/server/contracts.d.ts.map +1 -0
  26. package/dist/server/contracts.js +2 -0
  27. package/dist/server/contracts.js.map +1 -0
  28. package/dist/server/index.d.ts +6 -0
  29. package/dist/server/index.d.ts.map +1 -0
  30. package/dist/server/index.js +5 -0
  31. package/dist/server/index.js.map +1 -0
  32. package/dist/server/plugin.d.ts +4 -0
  33. package/dist/server/plugin.d.ts.map +1 -0
  34. package/dist/server/plugin.js +15 -0
  35. package/dist/server/plugin.js.map +1 -0
  36. package/dist/server/providers/index.d.ts +4 -0
  37. package/dist/server/providers/index.d.ts.map +1 -0
  38. package/dist/server/providers/index.js +6 -0
  39. package/dist/server/providers/index.js.map +1 -0
  40. package/dist/server/providers/verification.d.ts +7 -0
  41. package/dist/server/providers/verification.d.ts.map +1 -0
  42. package/dist/server/providers/verification.js +59 -0
  43. package/dist/server/providers/verification.js.map +1 -0
  44. package/dist/server/routes/index.d.ts +5 -0
  45. package/dist/server/routes/index.d.ts.map +1 -0
  46. package/dist/server/routes/index.js +123 -0
  47. package/dist/server/routes/index.js.map +1 -0
  48. package/dist/server/routes/schemas.d.ts +9 -0
  49. package/dist/server/routes/schemas.d.ts.map +1 -0
  50. package/dist/server/routes/schemas.js +38 -0
  51. package/dist/server/routes/schemas.js.map +1 -0
  52. package/dist/server/services/verification.d.ts +64 -0
  53. package/dist/server/services/verification.d.ts.map +1 -0
  54. package/dist/server/services/verification.js +467 -0
  55. package/dist/server/services/verification.js.map +1 -0
  56. package/dist/server/tokens.d.ts +4 -0
  57. package/dist/server/tokens.d.ts.map +1 -0
  58. package/dist/server/tokens.js +3 -0
  59. package/dist/server/tokens.js.map +1 -0
  60. package/dist/shared/contracts.d.ts +27 -0
  61. package/dist/shared/contracts.d.ts.map +1 -0
  62. package/dist/shared/contracts.js +2 -0
  63. package/dist/shared/contracts.js.map +1 -0
  64. package/package.json +86 -3
  65. package/skills/nocobase-app-plugin-verification/SKILL.md +87 -0
  66. package/skills/nocobase-app-plugin-verification/references/client.md +115 -0
package/LICENSE.txt ADDED
@@ -0,0 +1,127 @@
1
+ Updated Date: November 16, 2026
2
+
3
+ NocoBase License Agreement
4
+
5
+ NOCOBASE PTE. LTD., a Singaporean Exempt Private Company Limited by Shares with its principal place of business located at 112 ROBINSON ROAD, #03-01, SINGAPORE ("The Company") https://www.nocobase.com/ issues this License Agreement ("Agreement") to you. You, as an individual or a company ("The User"), will be deemed to voluntarily accept all terms of this Agreement by using NocoBase (including but not limited to obtaining NocoBase source code, installation package, or image in any form, installing and using NocoBase, developing Applications with NocoBase, purchasing NocoBase commercial license and services). If the User does not agree to any term of this Agreement, or cannot accurately understand our interpretation of the relevant terms, please stop using it immediately.
6
+
7
+ This Agreement applies to any use, quotation, contract, invoice, and all software delivered by the Company. The User and the Company or NocoBase's agents need not sign a separate license agreement for the sale and delivery of the software.
8
+
9
+ This Agreement applies to NocoBase 3 and later versions. NocoBase 2 and earlier versions are independent products and remain subject to their original license agreement. Where a NocoBase 2 Commercial Edition user uses NocoBase 3 or later versions under a policy announced by the Company, that use is subject to this Agreement.
10
+
11
+ The Company reserves the right to formulate and modify this Agreement from time to time as needed. If there are changes, the Company will announce them in the form of website announcements, without further individual notification. The changed Agreement will automatically take effect once it is announced, becoming part of this Agreement.
12
+
13
+ ==============
14
+ 1. Definitions
15
+ ==============
16
+
17
+ 1.1 "Software" refers to NocoBase, including its application foundation (Core), its workspace for people and agents building software together (Studio), and the application templates, development standards, and development skills that come with them, together with their source code, installation packages, images, and all their modifications, updates, and upgrades.
18
+
19
+ 1.2 "Community Edition" refers to the free version of the Software provided to the User as open source through public channels.
20
+
21
+ 1.3 "Commercial Edition" refers to the paid version of the Software purchased by the User from the Company or its agents, downloaded through exclusive channels, with additional features and benefits. It consists of two versions: Professional Edition and Enterprise Edition.
22
+
23
+ 1.4 "Application" refers to a specific business use case application serving internal or external customers of the User, developed based on the Software, such as ERP/CRM. Studio is a development tool and is not part of any Application.
24
+
25
+ 1.5 "Customer" refers to the clients who commission the User to develop Applications or purchase the User's Applications.
26
+
27
+ 1.6 "Agent" refers to an AI agent that works with the Software, including the coding agents the User uses to develop Applications and the business agents in Applications.
28
+
29
+ 1.7 "Third-Party Services" refers to the large models, coding agents, cloud services, and other third-party products and services that the User chooses to use with the Software.
30
+
31
+ 1.8 "Third-Party Open Source Software" refers to open source software provided with the Software. They are licensed through various published open source software licenses or copyright notices accompanying such software.
32
+
33
+ ===================================
34
+ 2. Intellectual Property Protection
35
+ ===================================
36
+
37
+ Except for Third-Party Open Source Software, the Company owns all copyrights, trademark rights, patent rights, trade secrets, and other intellectual property rights of the Software, and has registered and protected them in relevant countries and regions according to the "Paris Convention" or "TRIPS Agreement", ensuring that the intellectual property rights of the Software are internationally recognized and protected.
38
+
39
+ The Company claims no intellectual property rights in the business code written by the User or by Agents when developing Applications, or in the User's business data, skills, and knowledge bases. The parts of the Software contained in an Application remain the intellectual property of the Company and are subject to this Agreement.
40
+
41
+ =============
42
+ 3. Disclaimer
43
+ =============
44
+
45
+ 3.1 The User shall not use the Software to engage in activities that contravene applicable laws and regulations or offend against public order or religious prohibitions. All legal liabilities and consequences arising from the User's use shall be borne by the User.
46
+
47
+ 3.2 The Company shall not be liable for any direct, indirect, special, incidental, or consequential damages (including but not limited to loss of profits, business interruption, data loss, or business information disclosure) caused by the User's use of the Software, even if it has been previously informed of the possibility of such damages.
48
+
49
+ 3.3 Code written, content generated, and actions taken by Agents shall be reviewed and accepted by the User before being used in production. All consequences arising from the use of the work of Agents shall be borne by the User.
50
+
51
+ 3.4 Third-Party Services are chosen and paid for by the User and are subject to their own terms. The Company shall not be liable for the availability, output, or data handling of Third-Party Services.
52
+
53
+ ===============
54
+ 4. License Type
55
+ ===============
56
+
57
+ 4.1 This Agreement serves as the unified license agreement for NocoBase Software, applying to both the Community Edition and the Commercial Editions.
58
+
59
+ 4.2 The Community Edition is open source software. This Agreement incorporates and references the full text of the Apache License, Version 2.0 ("Apache-2.0", available at: https://www.apache.org/licenses/LICENSE-2.0 ). Users of the Community Edition must comply with the Apache-2.0 License as well as the supplementary terms set forth in this Agreement. In case of any inconsistency between Apache-2.0 and this Agreement, the supplementary terms of this Agreement shall prevail.
60
+
61
+ 4.3 The features that the Commercial Edition adds to the Community Edition are commercial software of the Company and are not licensed under Apache-2.0. They can only be used under the Commercial License and in accordance with this Agreement.
62
+
63
+ ================================================
64
+ 5. Rights and Obligations of Open Source License
65
+ ================================================
66
+
67
+ 5.1 The Community Edition can be used for commercial purposes, including developing Applications for Customers.
68
+
69
+ 5.2 It is not allowed to remove or change the NocoBase statement "AI + NocoBase" and "Build reliable business systems", or its link to https://www.nocobase.com/, at the bottom left of the interface of any Application, including Applications delivered to Customers, even though the code that displays the statement is part of the Application. If the default layout is replaced, the statement shall be kept at an equally visible position on the main interface of the Application. Pages that can be accessed without signing in and pages embedded in other systems are not subject to this requirement. When the sidebar is collapsed, showing the statement as an icon with a tooltip, as provided by default, meets this requirement. The main LOGO in the upper left corner of the page, the version number, and other information on the interface can be changed.
70
+
71
+ 5.3 It is not allowed to remove or change all intellectual property statements about NocoBase in the code.
72
+
73
+ 5.4 It is not allowed to provide to the public any form of AI application development platform or agent development platform SaaS/PaaS products using the original or modified Software, including Studio.
74
+
75
+ 5.5 It is not allowed to publicly release any plugin, skill, application template, or other extension that provides features identical or substantially similar to those of the Commercial Edition, whether free or paid and whether open source or not, including by publishing it to public code repositories, package registries, marketplaces, or websites, or by providing it to the public as a hosted service. The features of the Commercial Edition are as published on the Company's website. Developing and using such features for the User's own business, or providing them within Applications delivered to Customers, is not subject to this restriction.
76
+
77
+ ===============================
78
+ 6. Rights of Commercial License
79
+ ===============================
80
+
81
+ 6.1 Obtain a permanent commercial license of the Software.
82
+
83
+ 6.2 Can develop Applications for Customers, deploy the completed Applications, including the Commercial Edition features they use, on Customers' servers, or host them and provide them to Customers as a service.
84
+
85
+ 6.3 Customers can use the Commercial Edition features in the Applications delivered to them, within those Applications only, and can continue to develop those Applications on their own or through others.
86
+
87
+ 6.4 Get software upgrades and exclusive technical support during the upgrade validity period. Upgrades and technical support are provided to the User only, and the User can upgrade the Applications delivered to Customers during this period.
88
+
89
+ 6.5 The licensed Software can be used for commercial purposes with no restrictions on the number of Applications, Customers, users, and Agents.
90
+
91
+ 6.6 Can remove or change the NocoBase statement described in 5.2, and the brand, name, link, and other information about NocoBase on the interface of Applications.
92
+
93
+ 6.7 If there are other agreements in the contract for the above rights, the contract agreement shall prevail.
94
+
95
+ ====================================
96
+ 7. Obligations of Commercial License
97
+ ====================================
98
+
99
+ 7.1 It is not allowed to remove or change all intellectual property statements about NocoBase in the code.
100
+
101
+ 7.2 It is not allowed to sell, transfer, lease, share, gift, or distribute the Commercial License. Deploying Applications for Customers under 6.2 is not considered sharing the Commercial License, but the license key, access token, or other credentials of the Commercial License shall not be provided to Customers for any purpose other than deploying and running the Applications delivered to them.
102
+
103
+ 7.3 It is not allowed to sell, transfer, lease, share, or distribute any form of AI application development platform, agent development platform, or developer tools developed based on Software.
104
+
105
+ 7.4 It is not allowed to provide any form of AI application development platform or agent development platform SaaS/PaaS products to the public using the original or modified Software, including Studio.
106
+
107
+ 7.5 It is not allowed to publicly release any plugin, skill, application template, or other extension that provides features identical or substantially similar to those of the Commercial Edition, whether free or paid and whether open source or not, including by publishing it to public code repositories, package registries, marketplaces, or websites, or by providing it to the public as a hosted service. The features of the Commercial Edition are as published on the Company's website. Developing and using such features for the User's own business, or providing them within Applications delivered to Customers, is not subject to this restriction.
108
+
109
+ 7.6 The Commercial Edition can only be used by the User holding the Commercial License, on servers owned or rented by the User. Except for delivering Applications under 6.2, it is not allowed to deploy the Commercial Edition for Customers, or to provide it to Customers or any third party in any form, including as a hosted service. Customers that need the Commercial Edition shall purchase their own Commercial License.
110
+
111
+ 7.7 Customer personnel can take part in requirement confirmation, acceptance, and release approval in the User's Studio for the Applications the User develops for them. This is not considered providing the Commercial Edition to Customers, but it is not allowed to let Customers use the User's Studio to develop their own projects.
112
+
113
+ 7.8 If there is a violation of the above obligations or the terms of this Agreement, the rights owned by the User will be immediately terminated, the paid fees will not be refunded, and the Company reserves the right to pursue the User's legal responsibility.
114
+
115
+ 7.9 If there are other agreements in the contract for the above obligations, the contract agreement shall prevail.
116
+
117
+ =============================================================
118
+ 8. Legal Jurisdiction, Interpretation, and Dispute Resolution
119
+ =============================================================
120
+
121
+ 8.1 Except for Mainland China, the interpretation, application, and all matters related to this agreement are subject to the jurisdiction of Singapore law.
122
+
123
+ 8.2 Any dispute related to this Agreement should first be resolved through friendly negotiation. If the negotiation fails to resolve the dispute, the dispute should be submitted to the International Chamber of Commerce (ICC) for arbitration. The arbitration venue should be Singapore, conducted in English.
124
+
125
+ 8.3 All terms and conditions of this Agreement shall be deemed enforceable to the maximum extent permitted by applicable law. If any term of this Agreement is deemed invalid by any applicable law, the invalidity of that term does not affect the validity of any other term of this Agreement, and it should be deemed that the invalid term has been modified as much as possible to make it valid and enforceable, or if the term cannot be modified, it should be deemed to have been deleted from this Agreement.
126
+
127
+ 8.4 The arbitration award is final, binding on both parties, and can be enforced in any court with jurisdiction.
package/README.md CHANGED
@@ -1,3 +1,7 @@
1
- # Temporary Holding Version
1
+ # Verification App Plugin
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The Verification plugin sends one-time codes for application-defined scenarios, verifies phone ownership, and issues short-lived credentials for sensitive operations. It delivers SMS through the Notification plugin's transient send interface.
4
+
5
+ Install and register the Server entries for Authentication, Notification, Notification Providers, and Verification in the host application, along with Notification's dependencies. Apply the pending database migrations. Register application scenes and step-up purposes during provider boot. See the [integration Skill](skills/nocobase-app-plugin-verification/SKILL.md) for configuration, access policies, and a sub-application migration example.
6
+
7
+ Use the typed API and React hooks from `@nocobase/app-plugin-verification/client` in an application that provides the Authentication client and Verification server. Follow the [client integration guide](skills/nocobase-app-plugin-verification/references/client.md) for first-time binding, changing a verified phone, and protecting a business operation with step-up verification.
@@ -0,0 +1,18 @@
1
+ import { type ApiClient } from '@nocobase/app-client';
2
+ import type { BindPhoneInput, CodeTiming, IssueStepUpTokenInput, PhoneView, SendVerificationCodeInput, StepUpCredential } from '../shared/contracts.js';
3
+ export interface BindVerifiedPhoneInput extends BindPhoneInput {
4
+ /** Required when changing an existing phone. */
5
+ readonly token?: string;
6
+ }
7
+ export interface VerificationRateLimit {
8
+ /** The Retry-After response header. Verification sends a delay in seconds. */
9
+ readonly retryAfter?: string;
10
+ /** The server's next allowed send time, in ISO format. */
11
+ readonly retryAt?: string;
12
+ }
13
+ export declare function sendVerificationCode(api: ApiClient, { scene, phone, purpose }: SendVerificationCodeInput): Promise<CodeTiming>;
14
+ export declare function issueStepUpToken(api: ApiClient, { purpose, code }: IssueStepUpTokenInput): Promise<StepUpCredential>;
15
+ export declare function getMyVerifiedPhone(api: ApiClient, signal?: AbortSignal): Promise<PhoneView>;
16
+ export declare function bindPhone(api: ApiClient, { phone, code, token }: BindVerifiedPhoneInput): Promise<PhoneView>;
17
+ export declare function getVerificationRateLimit(error: unknown): VerificationRateLimit | undefined;
18
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../client/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtE,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,qBAAqB,EACrB,SAAS,EACT,yBAAyB,EACzB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC5D,gDAAgD;IAChD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,qBAAqB;IACpC,8EAA8E;IAC9E,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAMD,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,SAAS,EACd,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,yBAAyB,GACnD,OAAO,CAAC,UAAU,CAAC,CAOrB;AAED,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,SAAS,EACd,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,qBAAqB,GACvC,OAAO,CAAC,gBAAgB,CAAC,CAO3B;AAED,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,SAAS,EACd,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,SAAS,CAAC,CAMpB;AAED,wBAAsB,SAAS,CAC7B,GAAG,EAAE,SAAS,EACd,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,sBAAsB,GAC7C,OAAO,CAAC,SAAS,CAAC,CASpB;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,OAAO,GACb,qBAAqB,GAAG,SAAS,CAcnC"}
@@ -0,0 +1,44 @@
1
+ import { ApiClientError } from '@nocobase/app-client';
2
+ export async function sendVerificationCode(api, { scene, phone, purpose }) {
3
+ const { data } = await api.request({
4
+ method: 'POST',
5
+ path: 'verification/codes/send',
6
+ json: { scene, phone, purpose },
7
+ });
8
+ return data;
9
+ }
10
+ export async function issueStepUpToken(api, { purpose, code }) {
11
+ const { data } = await api.request({
12
+ method: 'POST',
13
+ path: 'verification/stepUpTokens',
14
+ json: { purpose, code },
15
+ });
16
+ return data;
17
+ }
18
+ export async function getMyVerifiedPhone(api, signal) {
19
+ const { data } = await api.request({
20
+ path: 'verification/me/phone',
21
+ signal,
22
+ });
23
+ return data;
24
+ }
25
+ export async function bindPhone(api, { phone, code, token }) {
26
+ const { data } = await api.request({
27
+ method: 'PUT',
28
+ path: 'verification/me/phone',
29
+ json: { phone, code },
30
+ headers: token === undefined ? undefined : { 'X-Verification-Token': token },
31
+ });
32
+ return data;
33
+ }
34
+ export function getVerificationRateLimit(error) {
35
+ if (!(error instanceof ApiClientError) || error.status !== 429)
36
+ return undefined;
37
+ const payload = error.payload;
38
+ const retryAt = payload?.error?.metadata?.retryAt;
39
+ return {
40
+ retryAfter: error.retryAfter,
41
+ retryAt: typeof retryAt === 'string' ? retryAt : undefined,
42
+ };
43
+ }
44
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../../client/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAkB,MAAM,sBAAsB,CAAC;AA2BtE,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,GAAc,EACd,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAA6B;I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AC,CAAC,KAAK,YAAY,cAAc,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,GAAG;QAC5D,OAAO,SAAS,CAAC;IAEnB,MAAM,OAAO,GAAG,KAAK,CAAC,OAIT,CAAC;IACd,MAAM,OAAO,GAAG,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC;IAClD,OAAO;QACL,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,OAAO,EAAE,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;KAC3D,CAAC;AACJ,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { type UseQueryResult } from '@tanstack/react-query';
2
+ import type { CodeTiming, IssueStepUpTokenInput, PhoneView, SendVerificationCodeInput, StepUpCredential } from '../shared/contracts.js';
3
+ import { type BindVerifiedPhoneInput } from './api.js';
4
+ export declare function useMyVerifiedPhone(): UseQueryResult<PhoneView, Error>;
5
+ export interface VerificationAction<Input, Result> {
6
+ readonly isPending: boolean;
7
+ readonly isSuccess: boolean;
8
+ readonly error: unknown;
9
+ /** Submit once and return the result. Rejects with the original request error. */
10
+ submit(input: Input): Promise<Result>;
11
+ /** Clear local status. An outstanding request may still complete on the server. */
12
+ reset(): void;
13
+ }
14
+ export declare function useSendVerificationCode(): VerificationAction<SendVerificationCodeInput, CodeTiming>;
15
+ export declare function useIssueStepUpToken(): VerificationAction<IssueStepUpTokenInput, StepUpCredential>;
16
+ export declare function useBindPhone(): VerificationAction<BindVerifiedPhoneInput, PhoneView>;
17
+ //# sourceMappingURL=hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../client/hooks.ts"],"names":[],"mappings":"AAMA,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,KAAK,EACV,UAAU,EACV,qBAAqB,EACrB,SAAS,EACT,yBAAyB,EACzB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAKL,KAAK,sBAAsB,EAC5B,MAAM,UAAU,CAAC;AAelB,wBAAgB,kBAAkB,IAAI,cAAc,CAAC,SAAS,EAAE,KAAK,CAAC,CA6BrE;AAED,MAAM,WAAW,kBAAkB,CAAC,KAAK,EAAE,MAAM;IAC/C,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,kFAAkF;IAClF,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACtC,mFAAmF;IACnF,KAAK,IAAI,IAAI,CAAC;CACf;AA+CD,wBAAgB,uBAAuB,IAAI,kBAAkB,CAC3D,yBAAyB,EACzB,UAAU,CACX,CAEA;AAED,wBAAgB,mBAAmB,IAAI,kBAAkB,CACvD,qBAAqB,EACrB,gBAAgB,CACjB,CAEA;AAED,wBAAgB,YAAY,IAAI,kBAAkB,CAChD,sBAAsB,EACtB,SAAS,CACV,CAYA"}
@@ -0,0 +1,91 @@
1
+ import { ApiClientError, useApiClient, } from '@nocobase/app-client';
2
+ import { useAuthentication } from '@nocobase/app-plugin-authentication/client';
3
+ import { isServer, skipToken, useQuery, useQueryClient, } from '@tanstack/react-query';
4
+ import { useMemo, useState } from 'react';
5
+ import { bindPhone, getMyVerifiedPhone, issueStepUpToken, sendVerificationCode, } from './api.js';
6
+ function useSessionKey() {
7
+ const { session, isPending } = useAuthentication();
8
+ return isPending || !session
9
+ ? null
10
+ : JSON.stringify([session.user.id, session.session.id]);
11
+ }
12
+ function phoneKey(sessionKey) {
13
+ return ['verification', 'myPhone', sessionKey];
14
+ }
15
+ export function useMyVerifiedPhone() {
16
+ const api = useApiClient();
17
+ const sessionKey = useSessionKey();
18
+ const queryKey = phoneKey(sessionKey);
19
+ const queryClient = useQueryClient();
20
+ const { retry = isServer ? 0 : 3 } = queryClient.defaultQueryOptions({
21
+ queryKey,
22
+ });
23
+ return useQuery({
24
+ queryKey,
25
+ queryFn: sessionKey === null
26
+ ? skipToken
27
+ : ({ signal }) => getMyVerifiedPhone(api, signal),
28
+ retry(failureCount, error) {
29
+ if (error instanceof ApiClientError &&
30
+ error.status >= 400 &&
31
+ error.status < 500)
32
+ return false;
33
+ if (typeof retry === 'function')
34
+ return retry(failureCount, error);
35
+ return typeof retry === 'number' ? failureCount < retry : retry;
36
+ },
37
+ // The application's default placeholder would display the former account's result.
38
+ placeholderData: undefined,
39
+ // Also discard inactive phone data in hosts that keep their query client across sessions.
40
+ gcTime: 0,
41
+ });
42
+ }
43
+ // As in the authentication actions, keep request status local to the mounted hook.
44
+ // Codes and credentials travel only through the request and the caller's promise.
45
+ function useVerificationAction(execute) {
46
+ const api = useApiClient();
47
+ const sessionKey = useSessionKey();
48
+ const scope = useMemo(() => ({ api, sessionKey }), [api, sessionKey]);
49
+ const [state, setState] = useState({ scope, status: 'idle' });
50
+ if (state.scope !== scope)
51
+ setState({ scope, status: 'idle' });
52
+ return {
53
+ isPending: state.status === 'pending',
54
+ isSuccess: state.status === 'success',
55
+ error: state.error,
56
+ async submit(input) {
57
+ const attempt = { scope, status: 'pending' };
58
+ setState(attempt);
59
+ try {
60
+ const result = await execute(api, input, sessionKey);
61
+ setState((current) => current === attempt ? { scope, status: 'success' } : current);
62
+ return result;
63
+ }
64
+ catch (error) {
65
+ setState((current) => current === attempt ? { scope, status: 'error', error } : current);
66
+ throw error;
67
+ }
68
+ },
69
+ reset: () => setState({ scope, status: 'idle' }),
70
+ };
71
+ }
72
+ export function useSendVerificationCode() {
73
+ return useVerificationAction(sendVerificationCode);
74
+ }
75
+ export function useIssueStepUpToken() {
76
+ return useVerificationAction(issueStepUpToken);
77
+ }
78
+ export function useBindPhone() {
79
+ const queryClient = useQueryClient();
80
+ return useVerificationAction(async (api, input, sessionKey) => {
81
+ const phone = await bindPhone(api, input);
82
+ if (sessionKey !== null) {
83
+ const filters = { queryKey: phoneKey(sessionKey), exact: true };
84
+ // A read started before the write may have seen the previous binding.
85
+ await queryClient.cancelQueries(filters);
86
+ void queryClient.invalidateQueries(filters);
87
+ }
88
+ return phone;
89
+ });
90
+ }
91
+ //# sourceMappingURL=hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../client/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,YAAY,GAEb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EACL,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,cAAc,GAEf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAS1C,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,GAErB,MAAM,UAAU,CAAC;AAElB,SAAS,aAAa;IACpB,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,iBAAiB,EAAE,CAAC;IACnD,OAAO,SAAS,IAAI,CAAC,OAAO;QAC1B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5D,CAAC;AAED,SAAS,QAAQ,CACf,UAAyB;IAEzB,OAAO,CAAC,cAAc,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,MAAM,GAAG,GAAG,YAAY,EAAE,CAAC;IAC3B,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IACnC,MAAM,QAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;IACtC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IACrC,MAAM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AAC;AACjD,CAAC;AAED,MAAM,UAAU,YAAY;IAI1B,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IACrC,OAAO,qBAAqB,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE;QAC5D,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC1C,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;YACxB,MAAM,OAAO,GAAG,EAAE,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;YAChE,sEAAsE;YACtE,MAAM,WAAW,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;YACzC,KAAK,WAAW,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC9C,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { changePhonePurpose, type CodeTiming, type IssueStepUpTokenInput, type PhoneView, type SendVerificationCodeInput, type StepUpCredential, } from '../shared/contracts.js';
2
+ export { bindPhone, getMyVerifiedPhone, getVerificationRateLimit, issueStepUpToken, sendVerificationCode, type BindVerifiedPhoneInput, type VerificationRateLimit, } from './api.js';
3
+ export { useBindPhone, useIssueStepUpToken, useMyVerifiedPhone, useSendVerificationCode, type VerificationAction, } from './hooks.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACd,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,GACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,EAChB,oBAAoB,EACpB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,GAC3B,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,KAAK,kBAAkB,GACxB,MAAM,YAAY,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { changePhonePurpose, } from '../shared/contracts.js';
2
+ export { bindPhone, getMyVerifiedPhone, getVerificationRateLimit, issueStepUpToken, sendVerificationCode, } from './api.js';
3
+ export { useBindPhone, useIssueStepUpToken, useMyVerifiedPhone, useSendVerificationCode, } from './hooks.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,GAMnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,EAChB,oBAAoB,GAGrB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,GAExB,MAAM,YAAY,CAAC"}
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 1,
3
+ "files": {
4
+ "202611250001_verification_create_tables.js": {
5
+ "sourceChecksum": "b6697c49628a939cd249ac292481df987f95c4f5488b042c12fad6dea4f45819",
6
+ "artifactChecksum": "5c662cc059d622fc86086b22850659402b1a18c6e193bad7b72ebc10bdef44e3"
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,4 @@
1
+ import { type MigrationDefinition } from '@nocobase/db';
2
+ declare const migration: MigrationDefinition;
3
+ export default migration;
4
+ //# sourceMappingURL=202611250001_verification_create_tables.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"202611250001_verification_create_tables.d.ts","sourceRoot":"","sources":["../../../database/migrations/202611250001_verification_create_tables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEzE,QAAA,MAAM,SAAS,EAAE,mBAoEf,CAAC;AAEH,eAAe,SAAS,CAAC"}
@@ -0,0 +1,68 @@
1
+ import { defineMigration } from '@nocobase/db';
2
+ const migration = defineMigration({
3
+ name: '202611250001_verification_create_tables',
4
+ async up({ builder }) {
5
+ await builder.createCollection('userPhones', (collection) => {
6
+ collection.string('userId', { length: 64 }).primary().notNull();
7
+ collection.string('phone', { length: 16 }).notNull();
8
+ collection.string('bindingId', { length: 36 }).notNull();
9
+ collection.datetimeTz('verifiedAt').notNull();
10
+ collection.integer('version').notNull().defaultTo(1);
11
+ collection.optimisticLock('version');
12
+ collection.unique('phone');
13
+ collection
14
+ .belongsTo('user', 'user')
15
+ .targetKey('id')
16
+ .foreignKey('userId')
17
+ .constraints(true)
18
+ .onDelete('cascade');
19
+ });
20
+ await builder.createCollection('verificationCodes', (collection) => {
21
+ collection.string('id', { length: 64 }).primary().notNull();
22
+ collection.string('challengeId', { length: 36 }).notNull();
23
+ collection.datetimeTz('sentAt').notNull();
24
+ collection.string('codeHash', { length: 64 }).nullable();
25
+ collection.integer('keyVersion').notNull();
26
+ collection.integer('attempts').notNull();
27
+ collection.datetimeTz('expiresAt').notNull();
28
+ collection.integer('version').notNull().defaultTo(1);
29
+ collection.optimisticLock('version');
30
+ collection.index('expiresAt');
31
+ });
32
+ await builder.createCollection('verificationNumberLimits', (collection) => {
33
+ collection.string('id', { length: 64 }).primary().notNull();
34
+ collection.datetimeTz('sentAt').notNull();
35
+ collection.datetimeTz('windowStartedAt').notNull();
36
+ collection.integer('windowCount').notNull();
37
+ collection.integer('version').notNull().defaultTo(1);
38
+ collection.optimisticLock('version');
39
+ collection.index('sentAt');
40
+ });
41
+ await builder.createCollection('verificationStepUpTokens', (collection) => {
42
+ collection.string('id', { length: 64 }).primary().notNull();
43
+ collection.string('userId', { length: 64 }).notNull();
44
+ collection.string('bindingId', { length: 36 }).notNull();
45
+ collection.string('tokenHash', { length: 64 }).nullable();
46
+ collection.datetimeTz('expiresAt').notNull();
47
+ collection.integer('version').notNull().defaultTo(1);
48
+ collection.optimisticLock('version');
49
+ collection.index('userId');
50
+ collection.index('expiresAt');
51
+ collection
52
+ .belongsTo('owner', 'user')
53
+ .targetKey('id')
54
+ .foreignKey('userId')
55
+ .constraints(true)
56
+ .onDelete('cascade');
57
+ });
58
+ },
59
+ async down({ builder }) {
60
+ await builder.dropCollection('verificationStepUpTokens');
61
+ await builder.dropCollection('verificationNumberLimits');
62
+ await builder.dropCollection('verificationCodes');
63
+ await builder.dropCollection('userPhones');
64
+ },
65
+ });
66
+ export default migration;
67
+ //# sourceMappingURL=202611250001_verification_create_tables.js.map
68
+ // @nocobase/task-manifest v1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"202611250001_verification_create_tables.js","sourceRoot":"","sources":["../../../database/migrations/202611250001_verification_create_tables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAA4B,MAAM,cAAc,CAAC;AAEzE,MAAM,SAAS,GAAwB,eAAe,CAAC;IACrD,IAAI,EAAE,yCAAyC;IAE/C,KAAK,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE;QAClB,MAAM,OAAO,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,EAAE;YAC1D,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,CAAC;YAChE,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;YACrD,UAAU,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;YACzD,UAAU,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;YAC9C,UAAU,CAAC,OAAO,CAAC,SAAS,CA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AU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;YACrD,UAAU,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;YACrC,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YAC3B,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YAC9B,UAAU;iBACP,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC;iBAC1B,SAAS,CAAC,IAAI,CAAC;iBACf,UAAU,CAAC,QAAQ,CAAC;iBACpB,WAAW,CAAC,IAAI,CAAC;iBACjB,QAAQ,CAAC,SAAS,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE;QACpB,MAAM,OAAO,CAAC,cAAc,CAAC,0BAA0B,CAAC,CAAC;QACzD,MAAM,OAAO,CAAC,cAAc,CAAC,0BAA0B,CAAC,CAAC;QACzD,MAAM,OAAO,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;QAClD,MAAM,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;IAC7C,CAAC;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { type AppConfigFactory } from '@nocobase/app-server/config';
2
+ import { z } from 'zod';
3
+ import type { CodePolicy } from './contracts.js';
4
+ interface SmsDestination {
5
+ readonly channel: string;
6
+ readonly template: string;
7
+ }
8
+ export interface VerificationConfig {
9
+ readonly defaults?: Partial<CodePolicy>;
10
+ readonly ipHourlyLimit?: number;
11
+ readonly userHourlyLimit?: number;
12
+ readonly stepUpTtlSeconds?: number;
13
+ readonly bindPhone?: SmsDestination;
14
+ readonly stepUp?: SmsDestination;
15
+ }
16
+ interface ResolvedVerificationConfig extends VerificationConfig {
17
+ readonly defaults: CodePolicy;
18
+ readonly ipHourlyLimit: number;
19
+ readonly userHourlyLimit: number;
20
+ readonly stepUpTtlSeconds: number;
21
+ }
22
+ export declare const policySchema: z.ZodType<CodePolicy>;
23
+ export declare const nameSchema: z.ZodString;
24
+ export declare const verificationConfigSchema: z.ZodType<ResolvedVerificationConfig>;
25
+ export declare function defineVerificationConfig(defaults?: VerificationConfig): AppConfigFactory<VerificationConfig>;
26
+ export {};
27
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,UAAU,cAAc;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACxC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,SAAS,CAAC,EAAE,cAAc,CAAC;IACpC,QAAQ,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC;CAClC;AAED,UAAU,0BAA2B,SAAQ,kBAAkB;IAC7D,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACnC;AAGD,eAAO,MAAM,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAK7C,CAAC;AACH,eAAO,MAAM,UAAU,EAAE,CAAC,CAAC,SAEe,CAAC;AAK3C,eAAO,MAAM,wBAAwB,EAAE,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAavE,CAAC;AAEL,wBAAgB,wBAAwB,CACtC,QAAQ,GAAE,kBAAuB,GAChC,gBAAgB,CAAC,kBAAkB,CAAC,CAOtC"}
@@ -0,0 +1,38 @@
1
+ import { defineAppConfig, } from '@nocobase/app-server/config';
2
+ import { z } from 'zod';
3
+ const seconds = z.number().int().min(1).max(3600);
4
+ export const policySchema = z.strictObject({
5
+ ttlSeconds: seconds.default(300),
6
+ resendSeconds: seconds.default(60),
7
+ hourlyLimit: z.number().int().min(1).max(1000).default(5),
8
+ maxAttempts: z.number().int().min(1).max(10).default(5),
9
+ });
10
+ export const nameSchema = z
11
+ .string()
12
+ .regex(/^[A-Za-z][A-Za-z0-9._-]{0,63}$/);
13
+ const destination = z.strictObject({
14
+ channel: z.string().min(1).max(128),
15
+ template: z.string().min(1).max(128),
16
+ });
17
+ export const verificationConfigSchema = z.strictObject({
18
+ defaults: policySchema.default({
19
+ ttlSeconds: 300,
20
+ resendSeconds: 60,
21
+ hourlyLimit: 5,
22
+ maxAttempts: 5,
23
+ }),
24
+ ipHourlyLimit: z.number().int().min(1).max(10000).default(20),
25
+ userHourlyLimit: z.number().int().min(1).max(10000).default(20),
26
+ stepUpTtlSeconds: seconds.default(300),
27
+ bindPhone: destination.optional(),
28
+ stepUp: destination.optional(),
29
+ });
30
+ export function defineVerificationConfig(defaults = {}) {
31
+ return defineAppConfig({
32
+ defaults,
33
+ validate: (value) => {
34
+ verificationConfigSchema.parse(value);
35
+ },
36
+ });
37
+ }
38
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,GAEhB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,CAA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F,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7D,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC/D,gBAAgB,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;IACtC,SAAS,EAAE,WAAW,CAAC,QAAQ,EAAE;IACjC,MAAM,EAAE,WAAW,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAEL,MAAM,UAAU,wBAAwB,CACtC,WAA+B,EAAE;IAEjC,OAAO,eAAe,CAAqB;QACzC,QAAQ;QACR,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;YAClB,wBAAwB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACxC,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,71 @@
1
+ import type { CodeTiming, PhoneView, StepUpCredential } from '../shared/contracts.js';
2
+ export { changePhonePurpose } from '../shared/contracts.js';
3
+ export type { CodeTiming, PhoneView, StepUpCredential, } from '../shared/contracts.js';
4
+ export interface CodePolicy {
5
+ readonly ttlSeconds: number;
6
+ readonly resendSeconds: number;
7
+ readonly hourlyLimit: number;
8
+ readonly maxAttempts: number;
9
+ }
10
+ export interface VerificationScene extends Partial<CodePolicy> {
11
+ readonly method: string;
12
+ readonly channel: string;
13
+ readonly template: string;
14
+ readonly audience: 'public' | 'signedIn' | 'verifiedPhone';
15
+ /** An optional eligibility check for public sends. Ineligible targets receive the same HTTP response. */
16
+ readonly shouldDeliver?: (target: string) => boolean | Promise<boolean>;
17
+ }
18
+ export interface VerificationMethod {
19
+ readonly id: string;
20
+ normalizeTarget(target: string): string | undefined;
21
+ /** Deliver once in memory. Never persist or log the code. */
22
+ deliver(input: {
23
+ channel: string;
24
+ template: string;
25
+ target: string;
26
+ code: string;
27
+ }): Promise<boolean>;
28
+ }
29
+ export interface SendCodeInput {
30
+ readonly scene: string;
31
+ readonly target?: string;
32
+ readonly userId?: string;
33
+ readonly purpose?: string;
34
+ /** An anonymous client address resolved from trusted connection metadata and proxy policy. */
35
+ readonly clientAddress?: string;
36
+ }
37
+ export interface VerifyCodeInput {
38
+ readonly scene: string;
39
+ readonly target?: string;
40
+ readonly userId?: string;
41
+ readonly code: string;
42
+ }
43
+ export interface StepUpScope {
44
+ readonly userId: string;
45
+ readonly purpose: string;
46
+ }
47
+ export interface VerificationService {
48
+ registerMethod(method: VerificationMethod): void;
49
+ registerScene(name: string, scene: VerificationScene): void;
50
+ registerStepUpPurpose(purpose: string, options?: {
51
+ ttlSeconds?: number;
52
+ }): void;
53
+ send(input: SendCodeInput): Promise<CodeTiming>;
54
+ /** For trusted server flows. Reserved account scenes are consumed by their owning operations. */
55
+ verify(input: VerifyCodeInput): Promise<void>;
56
+ issueStepUp(input: StepUpScope & {
57
+ code: string;
58
+ }): Promise<StepUpCredential>;
59
+ consumeStepUp(input: StepUpScope & {
60
+ token?: string;
61
+ }): Promise<void>;
62
+ getPhone(userId: string): Promise<PhoneView>;
63
+ bindPhone(input: {
64
+ userId: string;
65
+ phone: string;
66
+ code: string;
67
+ token?: string;
68
+ }): Promise<PhoneView>;
69
+ findUserIdByPhone(phone: string): Promise<string | undefined>;
70
+ }
71
+ //# sourceMappingURL=contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../server/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,YAAY,EACV,UAAU,EACV,SAAS,EACT,gBAA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