@nocobase/plugin-auth-sms 2.1.0-beta.35 → 2.1.0-beta.36
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/client-v2.d.ts +2 -0
- package/client-v2.js +1 -0
- 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 +10 -7
- package/package.json +4 -2
package/client-v2.d.ts
ADDED
package/client-v2.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/client-v2/index.js');
|
|
@@ -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-beta.
|
|
11
|
+
"@nocobase/client": "2.1.0-beta.36",
|
|
12
12
|
"react": "18.2.0",
|
|
13
13
|
"@formily/react": "2.3.7",
|
|
14
|
-
"@nocobase/plugin-auth": "2.1.0-beta.
|
|
15
|
-
"@nocobase/plugin-verification": "2.1.0-beta.
|
|
16
|
-
"@nocobase/
|
|
17
|
-
"@nocobase/utils": "2.1.0-beta.35",
|
|
18
|
-
"@nocobase/auth": "2.1.0-beta.35",
|
|
19
|
-
"@nocobase/database": "2.1.0-beta.35",
|
|
14
|
+
"@nocobase/plugin-auth": "2.1.0-beta.36",
|
|
15
|
+
"@nocobase/plugin-verification": "2.1.0-beta.36",
|
|
16
|
+
"@nocobase/flow-engine": "2.1.0-beta.36",
|
|
20
17
|
"react-i18next": "11.18.6",
|
|
18
|
+
"@nocobase/client-v2": "2.1.0-beta.36",
|
|
19
|
+
"@nocobase/server": "2.1.0-beta.36",
|
|
20
|
+
"@nocobase/utils": "2.1.0-beta.36",
|
|
21
|
+
"@nocobase/auth": "2.1.0-beta.36",
|
|
22
|
+
"@nocobase/database": "2.1.0-beta.36",
|
|
23
|
+
"antd": "5.24.2",
|
|
21
24
|
"lodash": "4.18.1"
|
|
22
25
|
};
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "SMS authentication.",
|
|
7
7
|
"description.ru-RU": "Аутентификация по SMS.",
|
|
8
8
|
"description.zh-CN": "通过短信验证码认证身份。",
|
|
9
|
-
"version": "2.1.0-beta.
|
|
9
|
+
"version": "2.1.0-beta.36",
|
|
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",
|
|
@@ -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": "397d45c744f6eb48b3a0cd785c87cbf1257c3513",
|
|
32
34
|
"keywords": [
|
|
33
35
|
"Authentication"
|
|
34
36
|
]
|