@nocobase/plugin-auth-sms 2.1.0-alpha.4 → 2.1.0-alpha.40
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.
- package/LICENSE +201 -661
- package/README.md +79 -10
- package/client-v2.d.ts +2 -0
- package/client-v2.js +1 -0
- package/dist/client/index.js +1 -1
- package/dist/client-v2/200.0189344f18513f41.js +10 -0
- package/dist/client-v2/710.a7c751a5d4b2a91f.js +10 -0
- package/dist/client-v2/forms/SmsAdminSettings.d.ts +18 -0
- package/dist/client-v2/forms/SmsSignInForm.d.ts +38 -0
- package/dist/client-v2/index.d.ts +9 -0
- package/dist/client-v2/index.js +10 -0
- package/dist/client-v2/locale.d.ts +16 -0
- package/dist/client-v2/plugin.d.ts +13 -0
- package/dist/externalVersion.js +11 -8
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
# NocoBase
|
|
2
2
|
|
|
3
3
|
<video width="100%" controls>
|
|
4
|
-
|
|
4
|
+
<source src="https://github.com/user-attachments/assets/4d11a87b-00e2-48f3-9bf7-389d21072d13" type="video/mp4">
|
|
5
5
|
</video>
|
|
6
6
|
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://trendshift.io/repositories/4112" target="_blank"><img src="https://trendshift.io/api/badge/repositories/4112" alt="nocobase%2Fnocobase | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
|
9
|
+
<a href="https://www.producthunt.com/posts/nocobase?embed=true&utm_source=badge-top-post-topic-badge&utm_medium=badge&utm_souce=badge-nocobase" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/top-post-topic-badge.svg?post_id=456520&theme=light&period=weekly&topic_id=267" alt="NocoBase - Scalability-first, open-source no-code platform | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
|
|
10
|
+
</p>
|
|
7
11
|
|
|
8
12
|
## What is NocoBase
|
|
9
13
|
|
|
10
|
-
NocoBase is
|
|
11
|
-
|
|
14
|
+
NocoBase is the most extensible AI-powered no-code platform.
|
|
15
|
+
Total control. Infinite extensibility. AI collaboration.
|
|
16
|
+
Enable your team to adapt quickly and cut costs dramatically.
|
|
17
|
+
No years of development. No millions wasted.
|
|
18
|
+
Deploy NocoBase in minutes — and take control of everything.
|
|
12
19
|
|
|
13
20
|
Homepage:
|
|
14
|
-
https://www.nocobase.com/
|
|
21
|
+
https://www.nocobase.com/
|
|
15
22
|
|
|
16
23
|
Online Demo:
|
|
17
24
|
https://demo.nocobase.com/new
|
|
@@ -19,12 +26,74 @@ https://demo.nocobase.com/new
|
|
|
19
26
|
Documents:
|
|
20
27
|
https://docs.nocobase.com/
|
|
21
28
|
|
|
22
|
-
|
|
23
|
-
https://
|
|
29
|
+
Forum:
|
|
30
|
+
https://forum.nocobase.com/
|
|
24
31
|
|
|
25
|
-
|
|
26
|
-
https://www.nocobase.com/en/
|
|
32
|
+
Use Cases:
|
|
33
|
+
https://www.nocobase.com/en/blog/tags/customer-stories
|
|
27
34
|
|
|
35
|
+
## Release Notes
|
|
28
36
|
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
Our [blog](https://www.nocobase.com/en/blog/timeline) is regularly updated with release notes and provides a weekly summary.
|
|
38
|
+
|
|
39
|
+
## Distinctive features
|
|
40
|
+
|
|
41
|
+
### 1. Data model-driven, not form/table–driven
|
|
42
|
+
|
|
43
|
+
Instead of being constrained by forms or tables, NocoBase adopts a data model–driven approach, separating data structure from user interface to unlock unlimited possibilities.
|
|
44
|
+
|
|
45
|
+
- UI and data structure are fully decoupled
|
|
46
|
+
- Multiple blocks and actions can be created for the same table or record in any quantity or form
|
|
47
|
+
- Supports the main database, external databases, and third-party APIs as data sources
|
|
48
|
+
|
|
49
|
+

|
|
50
|
+
|
|
51
|
+
### 2. AI employees, integrated into your business systems
|
|
52
|
+
Unlike standalone AI demos, NocoBase allows you to embed AI capabilities seamlessly into your interfaces, workflows, and data context, making AI truly useful in real business scenarios.
|
|
53
|
+
|
|
54
|
+
- Define AI employees for roles such as translator, analyst, researcher, or assistant
|
|
55
|
+
- Seamless AI–human collaboration in interfaces and workflows
|
|
56
|
+
- Ensure AI usage is secure, transparent, and customizable for your business needs
|
|
57
|
+
|
|
58
|
+

|
|
59
|
+
|
|
60
|
+
### 3. What you see is what you get, incredibly easy to use
|
|
61
|
+
|
|
62
|
+
While enabling the development of complex business systems, NocoBase keeps the experience simple and intuitive.
|
|
63
|
+
|
|
64
|
+
- One-click switch between usage mode and configuration mode
|
|
65
|
+
- Pages serve as a canvas to arrange blocks and actions, similar to Notion
|
|
66
|
+
- Configuration mode is designed for ordinary users, not just programmers
|
|
67
|
+
|
|
68
|
+

|
|
69
|
+
|
|
70
|
+
### 4. Everything is a plugin, designed for extension
|
|
71
|
+
Adding more no-code features will never cover every business case. NocoBase is built for extension through its plugin-based microkernel architecture.
|
|
72
|
+
|
|
73
|
+
- All functionalities are plugins, similar to WordPress
|
|
74
|
+
- Plugins are ready to use upon installation
|
|
75
|
+
- Pages, blocks, actions, APIs, and data sources can all be extended through custom plugins
|
|
76
|
+
|
|
77
|
+

|
|
78
|
+
|
|
79
|
+
## Installation
|
|
80
|
+
|
|
81
|
+
NocoBase supports three installation methods:
|
|
82
|
+
|
|
83
|
+
- <a target="_blank" href="https://docs.nocobase.com/welcome/getting-started/installation/docker-compose">Installing With Docker (👍Recommended)</a>
|
|
84
|
+
|
|
85
|
+
Suitable for no-code scenarios, no code to write. When upgrading, just download the latest image and reboot.
|
|
86
|
+
|
|
87
|
+
- <a target="_blank" href="https://docs.nocobase.com/welcome/getting-started/installation/create-nocobase-app">Installing from create-nocobase-app CLI</a>
|
|
88
|
+
|
|
89
|
+
The business code of the project is completely independent and supports low-code development.
|
|
90
|
+
|
|
91
|
+
- <a target="_blank" href="https://docs.nocobase.com/welcome/getting-started/installation/git-clone">Installing from Git source code</a>
|
|
92
|
+
|
|
93
|
+
If you want to experience the latest unreleased version, or want to participate in the contribution, you need to make changes and debug on the source code, it is recommended to choose this installation method, which requires a high level of development skills, and if the code has been updated, you can git pull the latest code.
|
|
94
|
+
|
|
95
|
+
## How NocoBase works
|
|
96
|
+
|
|
97
|
+
<video width="100%" controls>
|
|
98
|
+
<source src="https://github.com/user-attachments/assets/8d183b44-9bb5-4792-b08f-bc08fe8dfaaf" type="video/mp4">
|
|
99
|
+
</video>
|
package/client-v2.d.ts
ADDED
package/client-v2.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/client-v2/index.js');
|
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("@nocobase/plugin-auth/client"),require("@formily/react"),require("@nocobase/client"),require("@nocobase/plugin-verification/client"),require("react-i18next")):"function"==typeof define&&define.amd?define("@nocobase/plugin-auth-sms",["react","@nocobase/plugin-auth/client","@formily/react","@nocobase/client","@nocobase/plugin-verification/client","react-i18next"],t):"object"==typeof exports?exports["@nocobase/plugin-auth-sms"]=t(require("react"),require("@nocobase/plugin-auth/client"),require("@formily/react"),require("@nocobase/client"),require("@nocobase/plugin-verification/client"),require("react-i18next")):e["@nocobase/plugin-auth-sms"]=t(e.react,e["@nocobase/plugin-auth/client"],e["@formily/react"],e["@nocobase/client"],e["@nocobase/plugin-verification/client"],e["react-i18next"])}(self,function(e,t,n,r,o,i){return function(){"use strict";var u={505:function(e){e.exports=n},772:function(e){e.exports=r},689:function(e){e.exports=t},697:function(e){e.exports=o},156:function(t){t.exports=e},238:function(e){e.exports=i}},c={};function a(e){var t=c[e];if(void 0!==t)return t.exports;var n=c[e]={exports:{}};return u[e](n,n.exports,a),n.exports}a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},a.d=function(e,t){for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return!function(){a.r(l),a.d(l,{PluginAuthSMSClient:function(){return w},default:function(){return P}});var e=a(772),t=a(689),n=a.n(t),r=a(505),o=a(156),i=a.n(o),u=a(697),c=a(238);function s(){return(0,c.useTranslation)(["auth-sms","client"],{nsMode:"fallback"})}function p(e,t,n,r,o,i,u){try{var c=e[i](u),a=c.value}catch(e){n(e);return}c.done?t(a):Promise.resolve(a).then(r,o)}var f={type:"object",name:"phoneForm","x-component":"FormV2",properties:{form:{type:"void","x-component":"VerificationForm","x-component-props":{actionType:"auth:signIn",verifier:"{{ verifier }}"}},actions:{type:"void",title:'{{t("Sign in")}}',"x-component":"Action","x-use-component-props":"useVerifyActionProps","x-component-props":{htmlType:"submit",block:!0,type:"primary",style:{width:"100%"}}},tip:{type:"void","x-component":"div","x-content":'{{t("User will be registered automatically if not exists.", {ns: "auth-sms"})}}',"x-component-props":{style:{color:"#ccc"}},"x-visible":"{{ autoSignup }}"}}},y=function(n){var o=(0,r.useForm)(),i=(0,e.useAPIClient)(),u=(0,t.useRedirect)(),c=(0,e.useCurrentUserContext)().refreshAsync;return{title:(0,s().t)("Sign in"),onClick:function(){var e;return(e=function(){return function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){var a=[i,c];if(n)throw TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}(this,function(e){switch(e.label){case 0:return[4,o.submit()];case 1:return e.sent(),[4,i.auth.signIn(o.values,n)];case 2:return e.sent(),[4,c()];case 3:return e.sent(),u(),[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function u(e){p(i,r,o,u,c,"next",e)}function c(e){p(i,r,o,u,c,"throw",e)}u(void 0)})})()}}},b=function(t){var n=t.authenticator,r=n.name,o=n.options,c=!!(null==o?void 0:o.autoSignup),a=(0,e.usePlugin)("verification").verificationManager.getVerification(u.SMS_OTP_VERIFICATION_TYPE),l=null==a?void 0:a.components.VerificationForm;return i().createElement(e.SchemaComponent,{schema:f,scope:{useVerifyActionProps:function(){return y(r)},autoSignup:c,verifier:null==o?void 0:o.verifier},components:{VerificationForm:l}})},v=function(){var t=s().t;return i().createElement(e.SchemaComponent,{scope:{t:t},schema:{type:"object",properties:{sms:{type:"void",properties:{public:{type:"object",properties:{verifier:{type:"string","x-component":"VerifierSelect","x-component-props":{title:'{{t("Verifier")}}',scene:"auth-sms"}},autoSignup:{"x-decorator":"FormItem",type:"boolean",title:'{{t("Sign up automatically when the user does not exist")}}',"x-component":"Checkbox"}}}}}}}})};function h(e,t,n,r,o,i,u){try{var c=e[i](u),a=c.value}catch(e){n(e);return}c.done?t(a):Promise.resolve(a).then(r,o)}function m(e,t,n){return(m=S()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&g(o,n.prototype),o}).apply(null,arguments)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function x(e){var t="function"==typeof Map?new Map:void 0;return(x=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return m(e,arguments,d(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),g(n,e)})(e)}function S(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(S=function(){return!!e})()}var w=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=d(e),function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,S()?Reflect.construct(e,t||[],d(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&g(r,e),t=[{key:"load",value:function(){var e,t=this;return(e=function(){return function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){var a=[i,c];if(n)throw TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}(this,function(e){return t.app.pm.get(n()).registerType("SMS",{components:{SignInForm:b,AdminSettingsForm:v}}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function u(e){h(i,r,o,u,c,"next",e)}function c(e){h(i,r,o,u,c,"throw",e)}u(void 0)})})()}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,t),r}(x(e.Plugin)),P=w}(),l}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-i18next"),require("@nocobase/plugin-auth/client"),require("@nocobase/client"),require("@formily/react"),require("@nocobase/plugin-verification/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-auth-sms",["react","react-i18next","@nocobase/plugin-auth/client","@nocobase/client","@formily/react","@nocobase/plugin-verification/client"],t):"object"==typeof exports?exports["@nocobase/plugin-auth-sms"]=t(require("react"),require("react-i18next"),require("@nocobase/plugin-auth/client"),require("@nocobase/client"),require("@formily/react"),require("@nocobase/plugin-verification/client")):e["@nocobase/plugin-auth-sms"]=t(e.react,e["react-i18next"],e["@nocobase/plugin-auth/client"],e["@nocobase/client"],e["@formily/react"],e["@nocobase/plugin-verification/client"])}(self,function(e,t,n,r,o,i){return function(){"use strict";var c={230:function(e){e.exports=o},342:function(e){e.exports=r},123:function(e){e.exports=n},636:function(e){e.exports=i},155:function(t){t.exports=e},953:function(e){e.exports=t}},u={};function a(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={exports:{}};return c[e](n,n.exports,a),n.exports}a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},a.d=function(e,t){for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.g.importScripts&&(l=a.g.location+"");var l,p=a.g.document;if(!l&&p&&(p.currentScript&&"SCRIPT"===p.currentScript.tagName.toUpperCase()&&(l=p.currentScript.src),!l)){var s=p.getElementsByTagName("script");if(s.length)for(var f=s.length-1;f>-1&&(!l||!/^http(s?):/.test(l));)l=s[f--].src}if(!l)throw Error("Automatic publicPath is not supported in this browser");a.p=l.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var b={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/@nocobase/plugin-auth-sms/dist/client/")}if(!e){if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var r=window.location.pathname||"/",o=r.indexOf("/v2/");e=o>=0?r.slice(0,o+1):"/"}e&&(e=e.replace(/\/v2\/?$/,"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-auth-sms/dist/client/"}a.p=e}(),!function(){a.r(b),a.d(b,{default:function(){return _},PluginAuthSMSClient:function(){return S}});var e=a(342),t=a(123),n=a.n(t),r=a(230),o=a(155),i=a.n(o),c=a(636),u=a(953);function l(){return(0,u.useTranslation)(["auth-sms","client"],{nsMode:"fallback"})}function p(e,t,n,r,o,i,c){try{var u=e[i](c),a=u.value}catch(e){n(e);return}u.done?t(a):Promise.resolve(a).then(r,o)}var s={type:"object",name:"phoneForm","x-component":"FormV2",properties:{form:{type:"void","x-component":"VerificationForm","x-component-props":{actionType:"auth:signIn",verifier:"{{ verifier }}"}},actions:{type:"void",title:'{{t("Sign in")}}',"x-component":"Action","x-use-component-props":"useVerifyActionProps","x-component-props":{htmlType:"submit",block:!0,type:"primary",style:{width:"100%"}}},tip:{type:"void","x-component":"div","x-content":'{{t("User will be registered automatically if not exists.", {ns: "auth-sms"})}}',"x-component-props":{style:{color:"#ccc"}},"x-visible":"{{ autoSignup }}"}}},f=function(n){var o=(0,r.useForm)(),i=(0,e.useAPIClient)(),c=(0,t.useRedirect)(),u=(0,e.useCurrentUserContext)().refreshAsync;return{title:(0,l().t)("Sign in"),onClick:function(){var e;return(e=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(c,"next",{value:a(0)}),u(c,"throw",{value:a(1)}),u(c,"return",{value:a(2)}),"function"==typeof Symbol&&u(c,Symbol.iterator,{value:function(){return this}}),c;function a(u){return function(a){var l=[u,a];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(e){switch(e.label){case 0:return[4,o.submit()];case 1:return e.sent(),[4,i.auth.signIn(o.values,n)];case 2:return e.sent(),[4,u()];case 3:return e.sent(),c(),[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function c(e){p(i,r,o,c,u,"next",e)}function u(e){p(i,r,o,c,u,"throw",e)}c(void 0)})})()}}},y=function(t){var n=t.authenticator,r=n.name,o=n.options,u=!!(null==o?void 0:o.autoSignup),a=(0,e.usePlugin)("verification").verificationManager.getVerification(c.SMS_OTP_VERIFICATION_TYPE),l=null==a?void 0:a.components.VerificationForm;return i().createElement(e.SchemaComponent,{schema:s,scope:{useVerifyActionProps:function(){return f(r)},autoSignup:u,verifier:null==o?void 0:o.verifier},components:{VerificationForm:l}})},h=function(){var t=l().t;return i().createElement(e.SchemaComponent,{scope:{t:t},schema:{type:"object",properties:{sms:{type:"void",properties:{public:{type:"object",properties:{verifier:{type:"string","x-component":"VerifierSelect","x-component-props":{title:'{{t("Verifier")}}',scene:"auth-sms"}},autoSignup:{"x-decorator":"FormItem",type:"boolean",title:'{{t("Sign up automatically when the user does not exist")}}',"x-component":"Checkbox"}}}}}}}})};function v(e,t,n,r,o,i,c){try{var u=e[i](c),a=u.value}catch(e){n(e);return}u.done?t(a):Promise.resolve(a).then(r,o)}function m(e,t,n){return(m=w()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&g(o,n.prototype),o}).apply(null,arguments)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function x(e){var t="function"==typeof Map?new Map:void 0;return(x=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return m(e,arguments,d(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),g(n,e)})(e)}function w(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(w=function(){return!!e})()}var S=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=d(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,w()?Reflect.construct(e,t||[],d(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&g(r,e),t=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(c,"next",{value:a(0)}),u(c,"throw",{value:a(1)}),u(c,"return",{value:a(2)}),"function"==typeof Symbol&&u(c,Symbol.iterator,{value:function(){return this}}),c;function a(u){return function(a){var l=[u,a];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(e){return this.app.pm.get(n()).registerType("SMS",{components:{SignInForm:y,AdminSettingsForm:h}}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function c(e){v(i,r,o,c,u,"next",e)}function u(e){v(i,r,o,c,u,"throw",e)}c(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,t),r}(x(e.Plugin)),_=S}(),b}()});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_auth_sms_client_v2=self.webpackChunk_nocobase_plugin_auth_sms_client_v2||[]).push([["200"],{315:function(e,t,r){r.r(t),r.d(t,{default:function(){return m},pickSmsPublicOptions:function(){return p}});var n=r(726),o=r(335),a=r(59),u=r(155),l=r.n(u),i=r(488);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function s(e,t,r,n,o,a,u){try{var l=e[a](u),i=l.value}catch(e){r(e);return}l.done?t(i):Promise.resolve(i).then(n,o)}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],u=!0,l=!1;try{for(o=o.call(e);!(u=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);u=!0);}catch(e){l=!0,n=e}finally{try{u||null==o.return||o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return c(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e){var t,r;return{verifier:null==e||null==(t=e.options)?void 0:t.verifier,autoSignup:!!(null==e||null==(r=e.options)?void 0:r.autoSignup)}}function m(e){var t=e.authenticator,r=(0,i.ep)().t,c=f(a.Form.useForm(),1)[0],m=f((0,u.useState)(""),2),y=m[0],h=m[1],v=f((0,u.useState)(!1),2),b=v[0],d=v[1],g=(0,n.useSignIn)(t.name),S=p(t),w=S.autoSignup,I=S.verifier,_=a.Form.useWatch("uuid",c);return l().createElement(a.Form,{form:c,layout:"vertical",onFinish:function(e){var t;return(t=function(){var t,r,n,o,a;return function(e,t){var r,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(u,"next",{value:i(0)}),l(u,"throw",{value:i(1)}),l(u,"return",{value:i(2)}),"function"==typeof Symbol&&l(u,Symbol.iterator,{value:function(){return this}}),u;function i(l){return function(i){var c=[l,i];if(r)throw TypeError("Generator is already executing.");for(;u&&(u=0,c[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(u){switch(u.label){case 0:h(""),d(!0),u.label=1;case 1:return u.trys.push([1,3,4,5]),[4,g.run(e)];case 2:return u.sent(),[3,5];case 3:return h((null==(t=u.sent())||null==(a=t.response)||null==(o=a.data)||null==(n=o.errors)||null==(r=n[0])?void 0:r.message)||(null==t?void 0:t.message)||String(t)),[3,5];case 4:return d(!1),[7];case 5:return[2]}})},function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function u(e){s(a,n,o,u,l,"next",e)}function l(e){s(a,n,o,u,l,"throw",e)}u(void 0)})})()}},y?l().createElement(a.Alert,{style:{marginBottom:16},type:"error",showIcon:!0,message:y}):null,l().createElement(a.Form.Item,{name:"uuid",rules:[{required:!0,message:r("Please enter a phone number")}]},l().createElement(a.Input,{autoComplete:"tel",placeholder:r("Phone")})),l().createElement(a.Form.Item,{name:"code",rules:[{required:!0,message:r("Please enter the verification code")}]},l().createElement(o.VerificationCode,{actionType:"auth:signIn",verifier:null!=I?I:"",phone:_,placeholder:r("Verification code")})),l().createElement(a.Form.Item,{style:{marginBottom:12}},l().createElement(a.Button,{loading:b,htmlType:"submit",type:"primary",block:!0},r("Sign in"))),w?l().createElement(a.Typography.Text,{type:"secondary"},r("User will be registered automatically if not exists.")):null)}},488:function(e,t,r){r.d(t,{ep:function(){return o}}),r(694);var n=r(953);function o(){return(0,n.useTranslation)(["auth-sms","client"],{nsMode:"fallback"})}}}]);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_auth_sms_client_v2=self.webpackChunk_nocobase_plugin_auth_sms_client_v2||[]).push([["710"],{357:function(e,n,t){t.r(n),t.d(n,{default:function(){return c}});var a=t(335),r=t(59),u=t(155),l=t.n(u),i=t(488);function c(){var e=(0,i.ep)().t;return l().createElement(l().Fragment,null,l().createElement(r.Form.Item,{name:["options","public","verifier"],label:e("Verifier"),rules:[{required:!0,message:e("Please select a verifier")}]},l().createElement(a.VerifierSelect,{scene:"auth-sms"})),l().createElement(r.Form.Item,{name:["options","public","autoSignup"],label:e("Sign up automatically when the user does not exist"),valuePropName:"checked"},l().createElement(r.Checkbox,null)))}},488:function(e,n,t){t.d(n,{ep:function(){return r}}),t(694);var a=t(953);function r(){return(0,a.useTranslation)(["auth-sms","client"],{nsMode:"fallback"})}}}]);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
/**
|
|
11
|
+
* Admin-side configuration for an SMS authenticator. Rendered inside the
|
|
12
|
+
* Authenticators page drawer below the common fields (`name`, `authType`,
|
|
13
|
+
* `title`, `description`, `enabled`). Persists to
|
|
14
|
+
* `options.public.verifier` / `options.public.autoSignup`, matching the
|
|
15
|
+
* server-side reads in `sms-auth.ts` (`this.options.public?.verifier` /
|
|
16
|
+
* `this.authenticator.options?.public?.autoSignup`).
|
|
17
|
+
*/
|
|
18
|
+
export default function SmsAdminSettings(): React.JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { type Authenticator } from '@nocobase/plugin-auth/client-v2';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
export type SmsPublicOptions = {
|
|
12
|
+
verifier?: string;
|
|
13
|
+
autoSignup: boolean;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Extract sign-in–facing options from an authenticator returned by
|
|
17
|
+
* `/authenticators:publicList`. That endpoint already flattens server-side
|
|
18
|
+
* `options.public.*` into `options.*` (see plugin-auth server
|
|
19
|
+
* actions/authenticators.ts `publicList`), so reading
|
|
20
|
+
* `authenticator.options.public.verifier` always yields `undefined` and silently
|
|
21
|
+
* sends `verifier: ''` to `smsOTP:publicCreate`. Centralising the unpacking
|
|
22
|
+
* here lets tests pin the contract.
|
|
23
|
+
*/
|
|
24
|
+
export declare function pickSmsPublicOptions(authenticator: Authenticator | null | undefined): SmsPublicOptions;
|
|
25
|
+
/**
|
|
26
|
+
* SMS sign-in form rendered on the v2 `/signin` page when the user picks
|
|
27
|
+
* an SMS authenticator tab. Two fields — phone number + OTP code — paired
|
|
28
|
+
* with `<VerificationCode>` from `@nocobase/plugin-verification/client-v2`,
|
|
29
|
+
* which owns the "send code / countdown" button and talks to the
|
|
30
|
+
* `smsOTP:publicCreate` endpoint.
|
|
31
|
+
*
|
|
32
|
+
* Submission goes through `useSignIn` from `plugin-auth/client-v2`, the
|
|
33
|
+
* same hook the password sign-in form uses — `auth:signIn` plus the
|
|
34
|
+
* standard post-login redirect.
|
|
35
|
+
*/
|
|
36
|
+
export default function SmsSignInForm({ authenticator }: {
|
|
37
|
+
authenticator: Authenticator;
|
|
38
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export { default, PluginAuthSMSClientV2 } from './plugin';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/plugin-verification/client-v2"),require("@nocobase/plugin-auth/client-v2"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-auth-sms/client-v2",["react-i18next","@nocobase/client-v2","react","antd","@nocobase/plugin-verification/client-v2","@nocobase/plugin-auth/client-v2","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-auth-sms/client-v2"]=t(require("react-i18next"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/plugin-verification/client-v2"),require("@nocobase/plugin-auth/client-v2"),require("@nocobase/flow-engine")):e["@nocobase/plugin-auth-sms/client-v2"]=t(e["react-i18next"],e["@nocobase/client-v2"],e.react,e.antd,e["@nocobase/plugin-verification/client-v2"],e["@nocobase/plugin-auth/client-v2"],e["@nocobase/flow-engine"])}(self,function(e,t,n,r,o,i,u){return function(){"use strict";var c,a,l,s={485:function(e){e.exports=t},694:function(e){e.exports=u},726:function(e){e.exports=i},335:function(e){e.exports=o},59:function(e){e.exports=r},155:function(e){e.exports=n},953:function(t){t.exports=e}},f={};function p(e){var t=f[e];if(void 0!==t)return t.exports;var n=f[e]={exports:{}};return s[e](n,n.exports,p),n.exports}p.m=s,p.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(t,{a:t}),t},p.d=function(e,t){for(var n in t)p.o(t,n)&&!p.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},p.f={},p.e=function(e){return Promise.all(Object.keys(p.f).reduce(function(t,n){return p.f[n](e,t),t},[]))},p.u=function(e){return""+e+"."+({200:"0189344f18513f41",710:"a7c751a5d4b2a91f"})[e]+".js"},p.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),p.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},b={},p.l=function(e,t,n,r){if(b[e])return void b[e].push(t);if(void 0!==n)for(var o,i,u=document.getElementsByTagName("script"),c=0;c<u.length;c++){var a=u[c];if(a.getAttribute("src")==e||a.getAttribute("data-rspack")=="@nocobase/plugin-auth-sms/client-v2:"+n){o=a;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,p.nc&&o.setAttribute("nonce",p.nc),o.setAttribute("data-rspack","@nocobase/plugin-auth-sms/client-v2:"+n),o.src=e),b[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=b[e];if(delete b[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),i&&document.head.appendChild(o)},p.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},p.g.importScripts&&(v=p.g.location+"");var b,v,d=p.g.document;if(!v&&d&&(d.currentScript&&"SCRIPT"===d.currentScript.tagName.toUpperCase()&&(v=d.currentScript.src),!v)){var h=d.getElementsByTagName("script");if(h.length)for(var y=h.length-1;y>-1&&(!v||!/^http(s?):/.test(v));)v=h[y--].src}if(!v)throw Error("Automatic publicPath is not supported in this browser");p.p=v.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),c={889:0},p.f.j=function(e,t){var n=p.o(c,e)?c[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=c[e]=[t,r]});t.push(n[2]=r);var o=p.p+p.u(e),i=Error();p.l(o,function(t){if(p.o(c,e)&&(0!==(n=c[e])&&(c[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},a=function(e,t){var n,r,o=t[0],i=t[1],u=t[2],a=0;if(o.some(function(e){return 0!==c[e]})){for(n in i)p.o(i,n)&&(p.m[n]=i[n]);u&&u(p)}for(e&&e(t);a<o.length;a++)r=o[a],p.o(c,r)&&c[r]&&c[r][0](),c[r]=0},(l=self.webpackChunk_nocobase_plugin_auth_sms_client_v2=self.webpackChunk_nocobase_plugin_auth_sms_client_v2||[]).forEach(a.bind(null,0)),l.push=a.bind(null,l.push.bind(l));var g={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/@nocobase/plugin-auth-sms/dist/client-v2/")}if(!e){if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var r=window.location.pathname||"/",o=r.indexOf("/v2/");e=o>=0?r.slice(0,o+1):"/"}e&&(e=e.replace(/\/v2\/?$/,"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-auth-sms/dist/client-v2/"}p.p=e}(),!function(){p.r(g),p.d(g,{PluginAuthSMSClientV2:function(){return l},default:function(){return s}});var e=p(485),t=p(726),n=p.n(t);function r(e,t,n,r,o,i,u){try{var c=e[i](u),a=c.value}catch(e){n(e);return}c.done?t(a):Promise.resolve(a).then(r,o)}function o(e,t,n){return(o=a()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&u(o,n.prototype),o}).apply(null,arguments)}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){var t="function"==typeof Map?new Map:void 0;return(c=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return o(e,arguments,i(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),u(n,e)})(e)}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(a=function(){return!!e})()}var l=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function o(){var e,t;if(!(this instanceof o))throw TypeError("Cannot call a class as a function");return e=o,t=arguments,e=i(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,a()?Reflect.construct(e,t||[],i(this).constructor):e.apply(this,t))}return o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),e&&u(o,e),t=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(u,"next",{value:a(0)}),c(u,"throw",{value:a(1)}),c(u,"return",{value:a(2)}),"function"==typeof Symbol&&c(u,Symbol.iterator,{value:function(){return this}}),u;function a(c){return function(a){var l=[c,a];if(n)throw TypeError("Generator is already executing.");for(;u&&(u=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(e){return this.app.pm.get(n()).registerType("SMS",{signInFormLoader:function(){return p.e("200").then(p.bind(p,315))},adminSettingsFormLoader:function(){return p.e("710").then(p.bind(p,357))}}),[2]})},function(){var t=this,n=arguments;return new Promise(function(o,i){var u=e.apply(t,n);function c(e){r(u,o,i,c,a,"next",e)}function a(e){r(u,o,i,c,a,"throw",e)}c(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(o.prototype,t),o}(c(e.Plugin)),s=l}(),g}()});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export declare const NAMESPACE = "auth-sms";
|
|
10
|
+
export declare function useAuthSMSTranslation(): import("react-i18next").UseTranslationResponse<("auth-sms" | "client")[], undefined>;
|
|
11
|
+
/**
|
|
12
|
+
* v2-style translator. Routes through `flowEngine.context.t`, which natively
|
|
13
|
+
* expands legacy `{{t("…")}}` Schema templates and falls back to the `client`
|
|
14
|
+
* namespace if a key is not defined in `auth-sms`.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useT(): (key: string) => string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { Plugin } from '@nocobase/client-v2';
|
|
10
|
+
export declare class PluginAuthSMSClientV2 extends Plugin {
|
|
11
|
+
load(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export default PluginAuthSMSClientV2;
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,15 +8,18 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.1.0-alpha.
|
|
11
|
+
"@nocobase/client": "2.1.0-alpha.40",
|
|
12
12
|
"react": "18.2.0",
|
|
13
13
|
"@formily/react": "2.3.7",
|
|
14
|
-
"@nocobase/plugin-auth": "2.1.0-alpha.
|
|
15
|
-
"@nocobase/plugin-verification": "2.1.0-alpha.
|
|
16
|
-
"@nocobase/
|
|
17
|
-
"@nocobase/utils": "2.1.0-alpha.4",
|
|
18
|
-
"@nocobase/auth": "2.1.0-alpha.4",
|
|
19
|
-
"@nocobase/database": "2.1.0-alpha.4",
|
|
14
|
+
"@nocobase/plugin-auth": "2.1.0-alpha.40",
|
|
15
|
+
"@nocobase/plugin-verification": "2.1.0-alpha.40",
|
|
16
|
+
"@nocobase/flow-engine": "2.1.0-alpha.40",
|
|
20
17
|
"react-i18next": "11.18.6",
|
|
21
|
-
"
|
|
18
|
+
"@nocobase/client-v2": "2.1.0-alpha.40",
|
|
19
|
+
"@nocobase/server": "2.1.0-alpha.40",
|
|
20
|
+
"@nocobase/utils": "2.1.0-alpha.40",
|
|
21
|
+
"@nocobase/auth": "2.1.0-alpha.40",
|
|
22
|
+
"@nocobase/database": "2.1.0-alpha.40",
|
|
23
|
+
"antd": "5.24.2",
|
|
24
|
+
"lodash": "4.18.1"
|
|
22
25
|
};
|
package/package.json
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"description": "SMS authentication.",
|
|
7
7
|
"description.ru-RU": "Аутентификация по SMS.",
|
|
8
8
|
"description.zh-CN": "通过短信验证码认证身份。",
|
|
9
|
-
"version": "2.1.0-alpha.
|
|
9
|
+
"version": "2.1.0-alpha.40",
|
|
10
10
|
"main": "./dist/server/index.js",
|
|
11
11
|
"homepage": "https://docs.nocobase.com/handbook/auth-sms",
|
|
12
12
|
"homepage.ru-RU": "https://docs-ru.nocobase.com/handbook/auth-sms",
|
|
13
13
|
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/auth-sms",
|
|
14
|
-
"license": "
|
|
14
|
+
"license": "Apache-2.0",
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@formily/react": "2.x",
|
|
17
17
|
"antd": "5.x",
|
|
@@ -22,13 +22,15 @@
|
|
|
22
22
|
"@nocobase/actions": "2.x",
|
|
23
23
|
"@nocobase/auth": "2.x",
|
|
24
24
|
"@nocobase/client": "2.x",
|
|
25
|
+
"@nocobase/client-v2": "2.x",
|
|
25
26
|
"@nocobase/database": "2.x",
|
|
27
|
+
"@nocobase/flow-engine": "2.x",
|
|
26
28
|
"@nocobase/plugin-auth": ">=0.17.0-alpha.7",
|
|
27
29
|
"@nocobase/plugin-verification": "2.x",
|
|
28
30
|
"@nocobase/server": "2.x",
|
|
29
31
|
"@nocobase/test": "2.x"
|
|
30
32
|
},
|
|
31
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "e73f99dd0abefe847f2e50ff0fea1f41a82fd048",
|
|
32
34
|
"keywords": [
|
|
33
35
|
"Authentication"
|
|
34
36
|
]
|