@nocobase/plugin-auth 2.1.0-alpha.1 → 2.1.0-alpha.10
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/dist/client/{8f805ee5814fd9b4.js → 1336785024b1a2f0.js} +1 -1
- package/dist/client/4091c71e2c30f057.js +10 -0
- package/dist/client/7bbaa6548c22ea0d.js +10 -0
- package/dist/client/ad1a67c0b8048d9f.js +10 -0
- package/dist/client/fb85fd4894c573a1.js +10 -0
- package/dist/client/index.js +1 -1
- package/dist/externalVersion.js +9 -9
- package/dist/node_modules/cron/package.json +1 -1
- package/dist/node_modules/ms/package.json +1 -1
- package/package.json +4 -3
- package/dist/client/250783b43257256a.js +0 -10
- package/dist/client/95a0e31032d919ee.js +0 -10
- package/dist/client/bc33cbbb266ce917.js +0 -10
- package/dist/client/d451b9556071e997.js +0 -10
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>
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";(self.webpackChunk_nocobase_plugin_auth=self.webpackChunk_nocobase_plugin_auth||[]).push([["
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_auth=self.webpackChunk_nocobase_plugin_auth||[]).push([["339"],{854:function(e,t,a){a.r(t),a.d(t,{AuthProvider:function(){return i}});var n=a(342),r=a(155),u=a.n(r),c=a(442),i=function(e){var t=(0,n.useApp)(),a=(0,c.useNavigate)(),i=(0,c.useLocation)();return(0,r.useEffect)(function(){var e=new URLSearchParams(i.search),n=e.get("authenticator"),r=e.get("token");if(r){t.apiClient.auth.setToken(r),t.apiClient.auth.setAuthenticator(n),e.delete("token");var u=e.toString();a({pathname:i.pathname,search:u?"?".concat(u):""},{replace:!0})}},[i.search,t,a,i.pathname]),u().createElement(u().Fragment,null,e.children)}}}]);
|
|
@@ -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
|
+
(self.webpackChunk_nocobase_plugin_auth=self.webpackChunk_nocobase_plugin_auth||[]).push([["576"],{195:function(e,t,r){"use strict";r.r(t),r.d(t,{TokenPolicySettings:function(){return C}});var n,o=r(155),i=r.n(o),a=r(342),s=r(59),c=r(166),u=r(768),l=r(404),f=r(230),p=r(452),m=r(688),d=r.n(m),y="token-policy-config",h="tokenControlConfig";function b(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){r(e);return}s.done?t(c):Promise.resolve(c).then(n,o)}function v(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){b(i,n,o,a,s,"next",e)}function s(e){b(i,n,o,a,s,"throw",e)}a(void 0)})}}function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(a,"next",{value:c(0)}),s(a,"throw",{value:c(1)}),s(a,"return",{value:c(2)}),"function"==typeof Symbol&&s(a,Symbol.iterator,{value:function(){return this}}),a;function c(s){return function(c){var u=[s,c];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,n=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var O="useSubmitActionProps",k="useEditForm",x=(g(n={},k,function(){var e=(0,a.useAPIClient)(),t=(0,o.useMemo)(function(){return(0,p.createForm)()},[]);return(0,o.useEffect)(function(){v(function(){var r,n;return w(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e.resource(h).get({filterByTk:y})];case 1:return(null==(n=o.sent().data)||null==(r=n.data)?void 0:r.config)&&t.setValues(n.data.config),[3,3];case 2:return console.error(o.sent()),[3,3];case 3:return[2]}})})()},[t,e]),{form:t}}),g(n,O,function(){var e=s.App.useApp().message,t=(0,a.useAPIClient)(),r=(0,f.useForm)(),n=(0,l.dE)().t;return{type:"primary",onClick:function(){return v(function(){var o,i,a,s;return w(this,function(c){switch(c.label){case 0:if(r.clearErrors("*"),i=(o=r.values).tokenExpirationTime,a=o.sessionExpirationTime,o.expiredTokenRenewLimit,d()(i)>=d()(a))return r.setFieldState("tokenExpirationTime",function(e){e.feedbacks=[{type:"error",code:"ValidateError",messages:[n("Token validity period must be less than session validity period!")]}]}),[2];return[4,r.submit()];case 1:return c.sent(),[4,t.resource(h).update({values:{config:r.values},filterByTk:y})];case 2:return(s=c.sent())&&200===s.status&&e.success(n("Saved successfully!")),[2]}})})()}}}),n);function E(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 j(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var S=s.Select.Option,T=(0,f.connect)(function(e){var t,r=(0,l.dE)().t,n=e.value,a=e.onChange,c=e.minNum,u=function(e,t){if(null==e)return{};var r,n,o,i={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,r=Reflect.ownKeys(Object(e));o<r.length;o++)n=r[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n]);return i}if(i=function(e,t){if(null==e)return{};var r,n,o={},i=Object.getOwnPropertyNames(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)n=r[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n]);return i}(e,["value","onChange","minNum"]),f=n?n.match(/^(\d*)([a-zA-Z]*)$/):null;(0,o.useEffect)(function(){f||a("10m")},[f,a]);var p=function(e){if(Array.isArray(e))return e}(t=f?[parseInt(f[1]),f[2]]:[10,"m"])||function(e){var t,r,n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o=[],i=!0,a=!1;try{for(n=n.call(e);!(i=(t=n.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,r=e}finally{try{i||null==n.return||n.return()}finally{if(a)throw r}}return o}}(t)||function(e){if(e){if("string"==typeof e)return E(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return E(e,2)}}(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.")}(),m=p[0],d=p[1],y=i().createElement(s.Select,{value:d,onChange:function(e){return a("".concat(m).concat(e))},style:{width:120}},i().createElement(S,{value:"m"},r("Minutes")),i().createElement(S,{value:"h"},r("Hours")),i().createElement(S,{value:"d"},r("Days")));return i().createElement(s.InputNumber,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){j(e,t,r[t])})}return e}({value:m,addonAfter:y,min:void 0===c?1:c,onChange:function(e){return a("".concat(null!=e?e:1).concat(d))}},u))},(0,f.mapProps)({onInput:"onChange"})),P="InputTime",A=j({},P,T),I={name:(0,c.uid)(),"x-component":"FormV2","x-use-component-props":k,type:"object",properties:{sessionExpirationTime:{type:"string",title:"{{t('Session validity period')}}","x-decorator":"FormItem","x-component":P,required:!0,description:(0,u.tval)("The maximum valid time for each user login. During the session validity, the Token will be automatically updated. After the timeout, the user is required to log in again.")},tokenExpirationTime:{type:"string",title:"{{t('Token validity period')}}","x-decorator":"FormItem","x-component":P,required:!0,description:(0,u.tval)("The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)")},expiredTokenRenewLimit:{type:"string",title:"{{t('Expired token refresh limit')}}","x-decorator":"FormItem","x-component":P,"x-component-props":{minNum:0},required:!0,description:(0,u.tval)("The maximum time limit allowed for refreshing a Token after it expires. After this time limit, the token cannot be automatically renewed, and the user needs to log in again.")},footer:{type:"void","x-component":"ActionBar","x-component-props":{layout:"one-column"},properties:{submit:{title:'{{t("Submit")}}',"x-component":"Action","x-use-component-props":O}}}}},C=function(){var e=(0,l.dE)().t;return i().createElement(s.Card,{bordered:!1},i().createElement(a.SchemaComponent,{schema:I,scope:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({t:e},x),components:A}))}},688:function(e){function t(e,t,r,n){return Math.round(e/r)+" "+n+(t>=1.5*r?"s":"")}e.exports=function(e,r){r=r||{};var n,o,i,a,s=typeof e;if("string"===s&&e.length>0){var c=e;if(!((c=String(c)).length>100)){var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(c);if(u){var l=parseFloat(u[1]);switch((u[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*l;case"weeks":case"week":case"w":return 6048e5*l;case"days":case"day":case"d":return 864e5*l;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*l;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*l;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*l;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:break}}}return}if("number"===s&&isFinite(e)){return r.long?(o=Math.abs(n=e))>=864e5?t(n,o,864e5,"day"):o>=36e5?t(n,o,36e5,"hour"):o>=6e4?t(n,o,6e4,"minute"):o>=1e3?t(n,o,1e3,"second"):n+" ms":(a=Math.abs(i=e))>=864e5?Math.round(i/864e5)+"d":a>=36e5?Math.round(i/36e5)+"h":a>=6e4?Math.round(i/6e4)+"m":a>=1e3?Math.round(i/1e3)+"s":i+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}}]);
|
|
@@ -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=self.webpackChunk_nocobase_plugin_auth||[]).push([["159"],{434:function(e,t,n){n.r(t),n.d(t,{AuthLayout:function(){return p},useSignInButtons:function(){return P},SignUpPage:function(){return I},useSignInForms:function(){return T},useSignUpForms:function(){return C},SignupPageContext:function(){return j},AuthenticatorsContextProvider:function(){return m},SignupPageProvider:function(){return A},SignInPage:function(){return w}});var r=n(477),a=n(342),o=n(59),u=n(155),i=n.n(u),l=n(442),c=n(953),f=n(542);function s(){var e,t,n=(e=["\n position: absolute;\n bottom: 0;\n width: 100%;\n left: 0;\n text-align: center;\n padding-bottom: 24px;\n background-color: ",";\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return s=function(){return n},n}var m=function(e){var t=e.children,n=(0,a.useAPIClient)(),r=(0,a.useRequest)(function(){return n.resource("authenticators").publicList().then(function(e){var t;return(null==e||null==(t=e.data)?void 0:t.data)||[]})}),u=r.data,l=r.error;if(r.loading)return i().createElement("div",{style:{textAlign:"center",marginTop:20}},i().createElement(o.Spin,null));if(l)throw l;return i().createElement(f.m.Provider,{value:void 0===u?[]:u},t)};function p(){var e,t=((0,a.useSystemSettings)()||{}).data,n=(0,a.useToken)().token,o=(0,c.useTranslation)("lm-collections").t;return i().createElement("div",{style:{maxWidth:320,margin:"0 auto",paddingTop:"20vh",paddingBottom:"20vh"}},i().createElement("div",{style:{position:"fixed",top:"2em",right:"2em"}},i().createElement(a.SwitchLanguage,null)),i().createElement("h1",{style:{textAlign:"center"}},i().createElement(a.ReadPretty.TextArea,{value:o(null==t||null==(e=t.data)?void 0:e.title)})),i().createElement(m,null,i().createElement(l.Outlet,null)),i().createElement("div",{className:(0,r.css)(s(),n.colorBgContainer)},i().createElement(a.PoweredBy,null)))}var y=n(574),v=n(404),d=n(230);function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],u=!0,i=!1;try{for(a=a.call(e);!(u=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);u=!0);}catch(e){i=!0,r=e}finally{try{u||null==a.return||a.return()}finally{if(i)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(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 b(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function S(){var e=b(["\n display: flex;\n "]);return S=function(){return e},e}function E(){var e=b(["\n display: flex;\n "]);return E=function(){return e},e}var T=function(){var e=(0,a.usePlugin)(y.default).authTypes.getEntities(),t={},n=!0,r=!1,o=void 0;try{for(var u,i=e[Symbol.iterator]();!(n=(u=i.next()).done);n=!0){var l,c=h(u.value,2),f=c[0],s=c[1];(null==(l=s.components)?void 0:l.SignInForm)&&(t[f]=s.components.SignInForm)}}catch(e){r=!0,o=e}finally{try{n||null==i.return||i.return()}finally{if(r)throw o}}return t},P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=(0,a.usePlugin)(y.default).authTypes.getEntities(),n={},r=!0,o=!1,u=void 0;try{for(var l,c=t[Symbol.iterator]();!(r=(l=c.next()).done);r=!0){var f,s=h(l.value,2),m=s[0],p=s[1];(null==(f=p.components)?void 0:f.SignInButton)&&(n[m]=p.components.SignInButton)}}catch(e){o=!0,u=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw u}}var v=Object.keys(n);return e.filter(function(e){return v.includes(e.authType)}).map(function(e,t){return i().createElement(n[e.authType],{key:t,authenticator:e})})},w=function(){var e=(0,v.dE)().t;(0,a.useCurrentDocumentTitle)("Signin"),(0,a.useViewport)();var t=T(),n=(0,u.useContext)(f.m),l=P(n);if(!n.length)return i().createElement("div",{style:{color:"#ccc"}},e("No authentication methods available."));var c=n.map(function(n){var r=t[n.authType];if(r){var a="".concat(e("Sign-in")," (").concat(d.Schema.compile(n.authTypeTitle||n.authType,{t:e}),")");return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({component:(0,u.createElement)(r,{authenticator:n}),tabTitle:n.title||a},n)}}).filter(function(e){return e});return i().createElement(o.Space,{direction:"vertical",className:(0,r.css)(S())},c.length>1?i().createElement(o.Tabs,{items:c.map(function(e){return{label:e.tabTitle,key:e.name,children:e.component}})}):c.length?i().createElement("div",null,c[0].component):i().createElement(i().Fragment,null),i().createElement(o.Space,{direction:"vertical",className:(0,r.css)(E())},l))};function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function O(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],u=!0,i=!1;try{for(a=a.call(e);!(u=(n=a.next()).done)&&(o.push(n.value),!t||o.length!==t);u=!0);}catch(e){i=!0,r=e}finally{try{u||null==a.return||a.return()}finally{if(i)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x(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.")}()}var j=(0,u.createContext)({});j.displayName="SignupPageContext";var A=function(e){var t=(0,u.useContext)(j);return t[e.authType]={component:e.component},i().createElement(j.Provider,{value:t},e.children)},C=function(){var e=(0,a.usePlugin)(y.default).authTypes.getEntities(),t={},n=!0,r=!1,o=void 0;try{for(var u,i=e[Symbol.iterator]();!(n=(u=i.next()).done);n=!0){var l,c=O(u.value,2),f=c[0],s=c[1];(null==(l=s.components)?void 0:l.SignUpForm)&&(t[f]=s.components.SignUpForm)}}catch(e){r=!0,o=e}finally{try{n||null==i.return||i.return()}finally{if(r)throw o}}return t},I=function(){(0,a.useViewport)(),(0,a.useCurrentDocumentTitle)("Signup");var e=C(),t=O((0,l.useSearchParams)(),1)[0].get("name"),n=((0,f.p)(t)||{}).authType;return e[n]?(0,u.createElement)(e[n],{authenticatorName:t}):i().createElement(l.Navigate,{to:"/not-found",replace:!0})}}}]);
|
|
@@ -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=self.webpackChunk_nocobase_plugin_auth||[]).push([["168"],{323:function(e,t,n){n.r(t),n.d(t,{Options:function(){return $},SignInForm:function(){return b},SignUpForm:function(){return O},useRedirect:function(){return m},useSignUp:function(){return P},useSignIn:function(){return d}});var r=n(342),o=n(155),i=n.n(o),a=n(404),s=n(442),l=n(230),u=n(631);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){n(e);return}s.done?t(l):Promise.resolve(l).then(r,o)}function m(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];var e,t=(0,s.useNavigate)(),n=(function(e){if(Array.isArray(e))return e}(e=(0,s.useSearchParams)())||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),1!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return c(e,1);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return c(e,1)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];return(0,o.useCallback)(function(){t(n.get("redirect")||"/admin",{replace:!0})},[t,n])}var d=function(e){var t=(0,l.useForm)(),n=(0,r.useAPIClient)(),o=m(),i=(0,r.useCurrentUserContext)().refreshAsync;return{run:function(){var r;return(r=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:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(a,"next",{value:l(0)}),s(a,"throw",{value:l(1)}),s(a,"return",{value:l(2)}),"function"==typeof Symbol&&s(a,Symbol.iterator,{value:function(){return this}}),a;function l(s){return function(l){var u=[s,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:return[4,t.submit()];case 1:return r.sent(),[4,n.auth.signIn(t.values,e)];case 2:return r.sent(),[4,i()];case 3:return r.sent(),o(),[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){p(i,n,o,a,s,"next",e)}function s(e){p(i,n,o,a,s,"throw",e)}a(void 0)})})()}}},f=function(e){var t=e.showForgotPassword;return{type:"object",name:"passwordForm","x-component":"FormV2",properties:{account:{type:"string","x-component":"Input","x-validator":'{{(value) => {\n if (!value) {\n return t("Please enter your username or email");\n }\n if (value.includes(\'@\')) {\n if (!/^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$/.test(value)) {\n return t("Please enter a valid email");\n }\n } else {\n return /^[^@<>"\'/]{1,50}$/.test(value) || t("Please enter a valid username");\n }\n }}}',"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Username/Email")}}',style:{}}},password:{type:"string","x-component":"Password",required:!0,"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Password")}}',style:{},showForgotPassword:t}},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Sign in")}}',type:"void","x-component":"Action","x-component-props":{htmlType:"submit",block:!0,type:"primary",useAction:"{{ useBasicSignIn }}",style:{width:"100%"}}}}},links:{type:"void","x-component":"div","x-component-props":{style:{display:"flex",justifyContent:"space-between"}},properties:{signUp:{type:"void","x-component":"Link","x-component-props":{to:"{{ signUpLink }}"},"x-content":'{{t("Create an account")}}',"x-visible":"{{ allowSignUp }}"},forgotPassword:{type:"void","x-component":"Link","x-component-props":{to:'{{"/forgot-password?name=" + authenticator.name}}'},"x-content":'{{t("Forgot password")}}',"x-visible":t}}}}}},b=function(e){var t=(0,a.dE)().t,o=e.authenticator,s=o.authType,l=o.name,c=o.options,p=!!(0,r.useLazy)(function(){return u("imported_-1ja1ffa_component",n.e("159").then(n.bind(n,434)))},"useSignUpForms")()[s]&&null!=c&&!!c.allowSignUp,m="/signup?name=".concat(l);return i().createElement(r.SchemaComponent,{schema:f({showForgotPassword:!!(null==c?void 0:c.enableResetPassword)}),scope:{useBasicSignIn:function(){return d(l)},allowSignUp:p,signUpLink:m,t:t,authenticator:o}})},y=n(166),v=n(59),h=n(953),x=n(542);function g(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){n(e);return}s.done?t(l):Promise.resolve(l).then(r,o)}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function S(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}var P=function(e){var t=(0,s.useNavigate)(),n=(0,l.useForm)(),o=(0,r.useAPIClient)(),i=(0,h.useTranslation)().t;return{run:function(){var r;return(r=function(){var r;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:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(a,"next",{value:l(0)}),s(a,"throw",{value:l(1)}),s(a,"return",{value:l(2)}),"function"==typeof Symbol&&s(a,Symbol.iterator,{value:function(){return this}}),a;function l(s){return function(l){var u=[s,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(a){switch(a.label){case 0:return[4,n.submit()];case 1:return a.sent(),[4,o.auth.signUp(n.values,null==e?void 0:e.authenticator)];case 2:return a.sent(),v.message.success((null==e||null==(r=e.message)?void 0:r.success)||i("Sign up successfully, and automatically jump to the sign in page")),setTimeout(function(){t("/signin")},2e3),[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){g(i,n,o,a,s,"next",e)}function s(e){g(i,n,o,a,s,"throw",e)}a(void 0)})})()}}},O=function(e){var t=e.authenticatorName,n=(0,a.dE)().t,u=(0,h.useTranslation)("lm-collections").t,c=(0,x.p)(t).options,p=c.signupForm,m=(0,o.useMemo)(function(){return p.filter(function(e){return e.show}).reduce(function(e,t){var r=S(w({},t.uiSchema),{title:t.uiSchema.title?u(l.Schema.compile(t.uiSchema.title,{t:n})):""});return e[t.field]=S(w({},r),{required:t.required,"x-decorator":"FormItem"}),e},{})},[p]);if(!(null==c?void 0:c.allowSignUp))return i().createElement(s.Navigate,{to:"/not-found",replace:!0});var d={type:"object",name:(0,y.uid)(),"x-component":"FormV2",properties:S(w({},m),{password:{type:"string",required:!0,title:'{{t("Password")}}',"x-component":"Password","x-decorator":"FormItem","x-validator":{password:!0},"x-component-props":{checkStrength:!0,style:{}},"x-reactions":[{dependencies:[".confirm_password"],fulfill:{state:{selfErrors:'{{$deps[0] && $self.value && $self.value !== $deps[0] ? t("Password mismatch") : ""}}'}}}]},confirm_password:{type:"string",required:!0,"x-component":"Password","x-decorator":"FormItem",title:'{{t("Confirm password")}}',"x-validator":{password:!0},"x-component-props":{style:{}},"x-reactions":[{dependencies:[".password"],fulfill:{state:{selfErrors:'{{$deps[0] && $self.value && $self.value !== $deps[0] ? t("Password mismatch") : ""}}'}}}]},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Sign up")}}',type:"void","x-component":"Action","x-component-props":{block:!0,type:"primary",htmlType:"submit",useAction:"{{ useBasicSignUp }}",style:{width:"100%"}}}}},link:{type:"void","x-component":"div",properties:{link:{type:"void","x-component":"Link","x-component-props":{to:"/signin"},"x-content":'{{t("Log in with an existing account")}}'}}}})};return i().createElement(r.SchemaComponent,{schema:d,scope:{useBasicSignUp:function(){return P({authenticator:t})},t:n}})},j=n(418);function F(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){C(e,t,n[t])})}return e}function k(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function I(e){return function(e){if(Array.isArray(e))return F(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return F(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return F(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var A=function(){var e=(0,r.useRecord)(),t=(0,r.useCollectionManager)().getCollection("users").fields.filter(function(e){var t;return!e.hidden&&!e.target&&e.interface&&!(null==(t=e.uiSchema)?void 0:t["x-read-pretty"])}),n=t.map(function(e){var t;return{value:e.name,label:null==(t=e.uiSchema)?void 0:t.title}}),s=(0,o.useMemo)(function(){var n=((null==(s=e.options)||null==(a=s.public)?void 0:a.signupForm)||[]).filter(function(e){return t.find(function(t){return t.name===e.field})}),r=!0,o=!1,i=void 0;try{for(var a,s,l,u=t[Symbol.iterator]();!(r=(l=u.next()).done);r=!0)!function(){var e=l.value;n.find(function(t){return t.field===e.name})||n.push({field:e.name,show:"username"===e.name,required:"username"===e.name})}()}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n},[t,e]);return(0,o.useEffect)(function(){var t;e.options=k(T({},e.options),{public:k(T({},null==(t=e.options)?void 0:t.public),{signupForm:s})})},[e,s]),i().createElement(r.SchemaComponent,{components:{ArrayTable:j.ArrayTable},schema:{type:"void",properties:{"public.signupForm":{title:'{{t("Sign up form")}}',type:"array","x-decorator":"FormItem","x-component":"ArrayTable","x-component-props":{bordered:!1},"x-validator":"{{ (value) => {\n const check = value?.some((item) => ['username', 'email'].includes(item.field) && item.show && item.required);\n if (!check) {\n return t('At least one of the username or email fields is required');\n }\n} }}",default:s,items:{type:"object","x-decorator":"ArrayItems.Item",properties:{column0:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:20,align:"center"},properties:{sort:{type:"void","x-component":"ArrayTable.SortHandle"}}},column1:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:100,title:(0,a.vV)("Field")},properties:{field:{type:"string","x-decorator":"FormItem","x-component":"Select",enum:n,"x-read-pretty":!0}}},column2:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:80,title:(0,a.vV)("Show")},properties:{show:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-reactions":{dependencies:[".required"],fulfill:{state:{value:"{{ $deps[0] || $self.value }}"}}}}}},column3:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:80,title:(0,a.vV)("Required")},properties:{required:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-reactions":{dependencies:[".show"],fulfill:{state:{value:"{{ !$deps[0] ? false : $self.value }}"}}}}}}}}}}}})},E=function(){var e=(0,a.dE)().t;return[(0,r.useGlobalVariable)("$env"),(0,r.useCurrentUserVariable)({maxDepth:1}).currentUserSettings,(0,r.useSystemSettingsVariable)().systemSettings,{value:"$resetLink",label:e("Reset password link")},{value:"$resetLinkExpiration",label:e("Reset link expiration (minutes)")}].filter(Boolean)},$=function(){var e=(0,a.dE)().t,t=E(),n=i().createElement("span",null,e("No notification channels found. Please "),i().createElement(s.Link,{to:"/admin/settings/notification-manager/channels"},e("add one first")),".");return i().createElement(r.SchemaComponent,{scope:{t:e},components:{Alert:v.Alert,SignupFormSettings:A,FormTab:j.FormTab},schema:{type:"object",properties:{notice:{type:"void","x-decorator":"FormItem","x-component":"Alert","x-component-props":{showIcon:!0,message:'{{t("The authentication allows users to sign in via username or email.")}}'}},collapse:{type:"void","x-component":"FormTab",properties:{basic:{type:"void","x-component":"FormTab.TabPane","x-component-props":{tab:(0,a.vV)("Sign up settings")},properties:C({"public.allowSignUp":{"x-decorator":"FormItem",type:"boolean",title:'{{t("Allow to sign up")}}',"x-component":"Checkbox",default:!0}},(0,y.uid)(),{type:"void","x-component":"SignupFormSettings"})},forgetPassword:{type:"void","x-component":"FormTab.TabPane","x-component-props":{tab:(0,a.vV)("Forgot password")},properties:{"public.enableResetPassword":{"x-decorator":"FormItem",type:"boolean",title:'{{t("Enable forget password")}}',"x-component":"Checkbox",default:!1},divider1:{type:"void","x-component":function(){return i().createElement(v.Divider,{orientation:"left",orientationMargin:"0"},e("1. Select notification channel"))},"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}"}}}]},notificationChannel:{type:"string",title:'{{t("Notification channel (Email)")}}',required:!0,"x-decorator":"FormItem","x-component":"RemoteSelect","x-component-props":{multiple:!1,manual:!1,fieldNames:{label:"title",value:"name"},service:{resource:"notificationChannels",action:"list",params:{filter:{notificationType:"email"}}},notFoundContent:n},"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}"}}}],description:'{{t("The notification channel used to send the reset password email, only support email channel")}}'},divider2:{type:"void","x-component":function(){return i().createElement(v.Divider,{orientation:"left",orientationMargin:"0"},e("2. Configure reset email"))},"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}"}}}]},emailSubject:{type:"string",required:!0,title:'{{t("Subject")}}',"x-decorator":"FormItem","x-component":"Variable.TextArea","x-component-props":{scope:I(t)},"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}",initialValue:'{{t("defaultResetPasswordEmailSubject")}}'}}}],default:'{{t("defaultResetPasswordEmailSubject")}}'},emailContentType:{type:"string",title:'{{t("Content type")}}',required:!0,"x-decorator":"FormItem","x-component":"Radio.Group",enum:[{label:"HTML",value:"html"},{label:'{{t("Plain text")}}',value:"text"}],default:"html","x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}",initialValue:"html"}}}]},emailContentHTML:{type:"string",required:!0,title:'{{t("Content")}}',"x-decorator":"FormItem","x-component":"Variable.RawTextArea","x-component-props":{scope:I(t),placeholder:"Hi,",autoSize:{minRows:10}},"x-reactions":[{dependencies:[".public.enableResetPassword",".emailContentType"],fulfill:{state:{visible:'{{$deps[0] && $deps[1] === "html"}}',initialValue:'{{t("defaultResetPasswordEmailContentHTML")}}'}}}],default:'{{t("defaultResetPasswordEmailContentHTML")}}'},emailContentText:{type:"string",required:!0,title:'{{t("Content")}}',"x-decorator":"FormItem","x-component":"Variable.RawTextArea","x-component-props":{scope:I(t),autoSize:{minRows:10}},"x-reactions":[{dependencies:[".public.enableResetPassword",".emailContentType"],fulfill:{state:{visible:'{{$deps[0] && $deps[1] === "text"}}',initialValue:'{{t("defaultResetPasswordEmailContentText")}}'}}}],default:'{{t("defaultResetPasswordEmailContentText")}}'},resetTokenExpiresIn:{type:"number",title:'{{t("Reset link expiration")}}',"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{suffix:e("Minutes"),style:{width:"100%"}},default:120,required:!0,"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}",initialValue:120}}}]}}}}}}}})}}}]);
|
|
@@ -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=self.webpackChunk_nocobase_plugin_auth||[]).push([["3"],{334:function(e,t,n){n.r(t),n.d(t,{useCreateAction:function(){return R},Authenticator:function(){return V},useUpdateAction:function(){return _}});var o=n(342),r=n(59),c=n(155),i=n.n(c),a=n(166),u=n(953),l=(0,c.createContext)({type:""});l.displayName="AuthTypeContext";var s=(0,c.createContext)({types:[]});function p(e,t,n,o,r,c,i){try{var a=e[c](i),u=a.value}catch(e){n(e);return}a.done?t(u):Promise.resolve(u).then(o,r)}s.displayName="AuthTypesContext";var m={name:"authenticators",sortable:!0,fields:[{name:"id",type:"string",interface:"id"},{interface:"input",type:"string",name:"name",uiSchema:{type:"string",title:'{{t("Auth UID")}}',"x-component":"Input","x-validator":function(e){return/^[a-zA-Z0-9_-]+$/.test(e)?"":o.i18n.t("a-z, A-Z, 0-9, _, -")},required:!0}},{interface:"input",type:"string",name:"authType",uiSchema:{type:"string",title:'{{t("Auth Type")}}',"x-component":"Select",dataSource:"{{ types }}",required:!0}},{interface:"input",type:"string",name:"title",uiSchema:{type:"string",title:'{{t("Title")}}',"x-component":"Input"}},{interface:"textarea",type:"string",name:"description",uiSchema:{type:"string",title:'{{t("Description")}}',"x-component":"Input"}},{type:"boolean",name:"enabled",uiSchema:{type:"boolean",title:'{{t("Enabled")}}',"x-component":"Checkbox"}}]},y={type:"object",properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues:function(e){var t,n,r=(0,o.useActionContext)(),i=(0,c.useContext)(l).type;return(0,o.useRequest)(function(){return Promise.resolve({data:{name:"s_".concat((0,a.uid)()),authType:i}})},(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o;o=n[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}({},e),n=n={refreshDeps:[r.visible]},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))}},title:'{{t("Add new")}}',properties:{name:{"x-component":"CollectionField","x-decorator":"FormItem"},authType:{"x-component":"CollectionField","x-decorator":"FormItem","x-component-props":{options:"{{ types }}"}},title:{"x-component":"CollectionField","x-decorator":"FormItem"},description:{"x-component":"CollectionField","x-decorator":"FormItem"},enabled:{"x-component":"CollectionField","x-decorator":"FormItem"},options:{type:"object","x-component":"Options"},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useCreateAction }}"}}}}}}}},d={type:"void",name:"authenticators","x-decorator":"ResourceActionProvider","x-decorator-props":{collection:m,resourceName:"authenticators",dragSort:!0,request:{resource:"authenticators",action:"list",params:{pageSize:50,sort:"sort",appends:[]}}},"x-component":"CollectionProvider_deprecated","x-component-props":{collection:m},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{delete:{type:"void",title:'{{t("Delete")}}',"x-component":"Action","x-component-props":{icon:"DeleteOutlined",useAction:"{{ cm.useBulkDestroyAction }}",confirm:{title:"{{t('Delete')}}",content:"{{t('Are you sure you want to delete it?')}}"}}},create:{type:"void",title:'{{t("Add new")}}',"x-component":"AddNew","x-component-props":{type:"primary"}}}},table:{type:"void","x-uid":"input","x-component":"Table.Void","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},useDataSource:"{{ cm.useDataSourceFromRAC }}",useAction:function(){var e=(0,o.useAPIClient)(),t=(0,u.useTranslation)().t;return{move:function(n,o){var c;return(c=function(){return function(e,t){var n,o,r,c={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(i,"next",{value:u(0)}),a(i,"throw",{value:u(1)}),a(i,"return",{value:u(2)}),"function"==typeof Symbol&&a(i,Symbol.iterator,{value:function(){return this}}),i;function u(a){return function(u){var l=[a,u];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(c=0)),c;)try{if(n=1,o&&(r=2&l[0]?o.return:l[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,l[1])).done)return r;switch(o=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return c.label++,{value:l[1],done:!1};case 5:c.label++,o=l[1],l=[0];continue;case 7:l=c.ops.pop(),c.trys.pop();continue;default:if(!(r=(r=c.trys).length>0&&r[r.length-1])&&(6===l[0]||2===l[0])){c=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){c.label=l[1];break}if(6===l[0]&&c.label<r[1]){c.label=r[1],r=l;break}if(r&&c.label<r[2]){c.label=r[2],c.ops.push(l);break}r[2]&&c.ops.pop(),c.trys.pop();continue}l=t.call(e,c)}catch(e){l=[6,e],o=0}finally{n=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(c){switch(c.label){case 0:return[4,e.resource("authenticators").move({sourceId:n.id,targetId:o.id})];case 1:return c.sent(),r.message.success(t("Saved successfully"),.2),[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var r=c.apply(e,t);function i(e){p(r,n,o,i,a,"next",e)}function a(e){p(r,n,o,i,a,"throw",e)}i(void 0)})})()}}}},properties:{id:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{id:{type:"number","x-component":"CollectionField","x-read-pretty":!0}}},name:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{name:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},authType:{title:'{{t("Auth Type")}}',type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{authType:{type:"string","x-component":"Select","x-read-pretty":!0,enum:"{{ types }}"}}},title:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{title:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},description:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{description:{type:"boolean","x-component":"CollectionField","x-read-pretty":!0}}},enabled:{type:"void","x-decorator":"Table.Column.Decorator","x-component":"Table.Column",properties:{enabled:{type:"boolean","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{t("Actions")}}',"x-component":"Table.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{update:{type:"void",title:'{{t("Configure")}}',"x-component":"Action.Link","x-component-props":{type:"primary"},properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues:"{{ cm.useValuesFromRecord }}"},title:'{{t("Configure")}}',properties:{name:{"x-component":"CollectionField","x-decorator":"FormItem","x-disabled":!0},authType:{"x-component":"CollectionField","x-decorator":"FormItem","x-component-props":{options:"{{ types }}"}},title:{"x-component":"CollectionField","x-decorator":"FormItem"},description:{"x-component":"CollectionField","x-decorator":"FormItem"},enabled:{"x-component":"CollectionField","x-decorator":"FormItem"},options:{type:"object","x-component":"Options"},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{t("Cancel")}}',"x-component":"Action","x-component-props":{useAction:"{{ cm.useCancelAction }}"}},submit:{title:'{{t("Submit")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useUpdateAction }}"}}}}}}}},delete:{type:"void",title:'{{ t("Delete") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"},useAction:"{{cm.useDestroyAction}}"},"x-disabled":"{{ useCanNotDelete() }}"}}}}}}}}},f=n(375),b=n(230),v=n(574);function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o;o=n[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}var h=function(e){var t,n,r=(0,o.useRecord)(),i=(0,o.useRequest)(function(){return Promise.resolve({data:x({},r.options)})},(t=x({},e),n=n={manual:!0},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t)),a=i.run,u=(0,o.useActionContext)();return(0,c.useEffect)(function(){u.visible&&a()},[u.visible,a]),i},O=function(e){var t,n=(0,o.usePlugin)(v.default).authTypes.get(e);return null==n||null==(t=n.components)?void 0:t.AdminSettingsForm},g=(0,b.observer)(function(){var e=(0,b.useForm)(),t=(0,o.useRecord)(),n=O(e.values.authType||t.authType);return n?i().createElement(n,null):null},{displayName:"Options"}),A=n(404);function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function w(e,t,n,o,r,c,i){try{var a=e[c](i),u=a.value}catch(e){n(e);return}a.done?t(u):Promise.resolve(u).then(o,r)}function j(e){return function(){var t=this,n=arguments;return new Promise(function(o,r){var c=e.apply(t,n);function i(e){w(c,o,r,i,a,"next",e)}function a(e){w(c,o,r,i,a,"throw",e)}i(void 0)})}}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(t){var o;o=n[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}function S(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function D(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,o,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var c=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(c.push(n.value),!t||c.length!==t);i=!0);}catch(e){a=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))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 F(e,t){var n,o,r,c={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(i,"next",{value:u(0)}),a(i,"throw",{value:u(1)}),a(i,"return",{value:u(2)}),"function"==typeof Symbol&&a(i,Symbol.iterator,{value:function(){return this}}),i;function u(a){return function(u){var l=[a,u];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(c=0)),c;)try{if(n=1,o&&(r=2&l[0]?o.return:l[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,l[1])).done)return r;switch(o=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return c.label++,{value:l[1],done:!1};case 5:c.label++,o=l[1],l=[0];continue;case 7:l=c.ops.pop(),c.trys.pop();continue;default:if(!(r=(r=c.trys).length>0&&r[r.length-1])&&(6===l[0]||2===l[0])){c=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){c.label=l[1];break}if(6===l[0]&&c.label<r[1]){c.label=r[1],r=l;break}if(r&&c.label<r[2]){c.label=r[2],c.ops.push(l);break}r[2]&&c.ops.pop(),c.trys.pop();continue}l=t.call(e,c)}catch(e){l=[6,e],o=0}finally{n=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}function T(e){return"string"==typeof e?e.trim():Array.isArray(e)?e.map(function(e){return T(e)}):(void 0===e?"undefined":e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)=="object"&&null!==e?Object.fromEntries(Object.entries(e).map(function(e){var t=D(e,2);return[t[0],T(t[1])]})):e}var k=function(){var e=(0,o.useActionContext)().setVisible;return{run:function(){return j(function(){return F(this,function(t){return e(!1),[2]})})()}}},I=function(){var e=(0,u.useTranslation)().t,t=D((0,c.useState)(!1),2),n=t[0],a=t[1],p=D((0,c.useState)(""),2),m=p[0],d=p[1],b=(0,c.useContext)(s).types,v=b.map(function(e){return S(P({},e),{onClick:function(){a(!0),d(e.value)}})});return i().createElement(o.ActionContextProvider,{value:{visible:n,setVisible:a}},i().createElement(l.Provider,{value:{type:m}},i().createElement(r.Dropdown,{menu:{items:v}},i().createElement(r.Button,{icon:i().createElement(f.PlusOutlined,null),type:"primary"},e("Add new")," ",i().createElement(f.DownOutlined,null))),i().createElement(o.SchemaComponent,{scope:{useCloseAction:k,types:b,setType:d,useCreateAction:R},schema:y})))},E=function(){return(0,o.useAsyncData)().data,!1},R=function(){var e=(0,b.useForm)(),t=(0,b.useField)(),n=(0,o.useActionContext)(),r=(0,o.useResourceActionContext)().refresh,c=(0,o.useResourceContext)().resource;return{run:function(){return j(function(){var o;return F(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,e.submit()];case 1:return i.sent(),t.data=t.data||{},t.data.loading=!0,o=e.values.options||{},[4,c.create({values:S(P({},e.values),{options:T(o)})})];case 2:return i.sent(),n.setVisible(!1),t.data.loading=!1,r(),[3,4];case 3:return i.sent(),t.data&&(t.data.loading=!1),[3,4];case 4:return[2]}})})()}}},_=function(){var e=(0,b.useField)(),t=(0,b.useForm)(),n=(0,o.useActionContext)(),r=(0,o.useResourceActionContext)().refresh,c=(0,o.useResourceContext)(),i=c.resource,a=c.targetKey,u=(0,o.useRecord)()[a];return{run:function(){return j(function(){var o;return F(this,function(c){switch(c.label){case 0:return[4,t.submit()];case 1:c.sent(),e.data=e.data||{},e.data.loading=!0,c.label=2;case 2:return c.trys.push([2,4,5,6]),o=t.values.options||{},[4,i.update({filterByTk:u,values:S(P({},t.values),{options:T(o)})})];case 3:return c.sent(),n.setVisible(!1),r(),[3,6];case 4:return console.log(c.sent()),[3,6];case 5:return e.data.loading=!1,[7];case 6:return[2]}})})()}}},V=function(){var e=(0,A.dE)().t,t=D((0,c.useState)([]),2),n=t[0],a=t[1],u=(0,o.useAPIClient)();return(0,o.useRequest)(function(){return u.resource("authenticators").listTypes().then(function(t){var n;return((null==t||null==(n=t.data)?void 0:n.data)||[]).map(function(t){return{key:t.name,label:b.Schema.compile(t.title||t.name,{t:e}),value:t.name}})})},{onSuccess:function(e){a(e)}}),i().createElement(r.Card,{bordered:!1},i().createElement(s.Provider,{value:{types:n}},i().createElement(o.SchemaComponent,{schema:d,components:{AddNew:I,Options:g},scope:{types:n,useValuesFromOptions:h,useCanNotDelete:E,t:e,useUpdateAction:_}})))}}}]);
|
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(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@formily/core"),require("@formily/antd-v5"),require("react"),require("@emotion/css"),require("@nocobase/client"),require("react-router-dom"),require("@formily/shared"),require("@formily/react"),require("@nocobase/utils/client"),require("@ant-design/icons"),require("antd"),require("react-i18next")):"function"==typeof define&&define.amd?define("@nocobase/plugin-auth",["@formily/core","@formily/antd-v5","react","@emotion/css","@nocobase/client","react-router-dom","@formily/shared","@formily/react","@nocobase/utils/client","@ant-design/icons","antd","react-i18next"],e):"object"==typeof exports?exports["@nocobase/plugin-auth"]=e(require("@formily/core"),require("@formily/antd-v5"),require("react"),require("@emotion/css"),require("@nocobase/client"),require("react-router-dom"),require("@formily/shared"),require("@formily/react"),require("@nocobase/utils/client"),require("@ant-design/icons"),require("antd"),require("react-i18next")):t["@nocobase/plugin-auth"]=e(t["@formily/core"],t["@formily/antd-v5"],t.react,t["@emotion/css"],t["@nocobase/client"],t["react-router-dom"],t["@formily/shared"],t["@formily/react"],t["@nocobase/utils/client"],t["@ant-design/icons"],t.antd,t["react-i18next"])}(self,function(t,e,n,r,o,i,u,a,c,s,l,f){return function(){var p,d,y,h,m,b,v={239:function(t,e,n){"use strict";n.r(e),n.d(e,{PluginAuthClient:function(){return H},AuthLayout:function(){return B},useAuthenticator:function(){return h.u},useSignIn:function(){return X},AuthenticatorsContext:function(){return h.H},AuthenticatorsContextProvider:function(){return W},useRedirect:function(){return G},default:function(){return V}});var r=n(772),o=n(584),i=n(741),u=n.n(i),a={EMPTY_TOKEN:"EMPTY_TOKEN",EXPIRED_TOKEN:"EXPIRED_TOKEN",INVALID_TOKEN:"INVALID_TOKEN",TOKEN_RENEW_FAILED:"TOKEN_RENEW_FAILED",BLOCKED_TOKEN:"BLOCKED_TOKEN",EXPIRED_SESSION:"EXPIRED_SESSION",NOT_EXIST_USER:"NOT_EXIST_USER",SKIP_TOKEN_RENEW:"SKIP_TOKEN_RENEW",USER_HAS_NO_ROLES_ERR:"USER_HAS_NO_ROLES_ERR"},c=u()(function(t){t()},3e3,{leading:!0,trailing:!1}),s=n(551),l=n(505),f=n(156),p=n.n(f),d=n(721),y=n(128),h=n(827);function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function b(t,e,n,r,o,i,u){try{var a=t[i](u),c=a.value}catch(t){n(t);return}a.done?e(c):Promise.resolve(c).then(r,o)}function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n,r,o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=o){var i=[],u=!0,a=!1;try{for(o=o.call(t);!(u=(n=o.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){a=!0,r=t}finally{try{u||null==o.return||o.return()}finally{if(a)throw r}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return m(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(t,e)}}(t,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var g=function(){var t,e=(0,s.o$)().t,n=v((0,y.useSearchParams)(),1)[0].get("name"),o=(0,h.u)(n);return(null==o||null==(t=o.options)?void 0:t.enableResetPassword)?p().createElement(r.SchemaComponent,{schema:{type:"object",name:"forgotPasswordForm","x-component":"FormV2",properties:{email:{type:"string","x-component":"Input",title:'{{t("Reset password")}}',required:!0,"x-validator":"{{(value) => {\n if (!value) {\n return '';\n }\n if (!/^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$/.test(value)) {\n return t(\"Please enter a valid email\");\n }\n }}}","x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Please enter your email")}}',style:{}}},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Send reset email")}}',type:"void","x-component":"Action","x-component-props":{htmlType:"submit",block:!0,type:"primary",useAction:function(){var t=(0,l.useForm)(),e=(0,r.useAPIClient)(),n=(0,s.o$)().t,o=v(p().useState(!1),2),i=o[0],u=o[1];return{run:function(){var r;return(r=function(){return function(t,e){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:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){var c=[i,a];if(n)throw TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return u.label++,{value:c[1],done:!1};case 5:u.label++,r=c[1],c=[0];continue;case 7:c=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){u=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){u.label=c[1];break}if(6===c[0]&&u.label<o[1]){u.label=o[1],o=c;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(c);break}o[2]&&u.ops.pop(),u.trys.pop();continue}c=e.call(t,u)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:return[4,t.submit()];case 1:r.sent(),u(!0),r.label=2;case 2:return r.trys.push([2,,4,5]),[4,e.auth.lostPassword(t.values)];case 3:return r.sent(),[3,5];case 4:return u(!1),[7];case 5:return d.message.success(n("Reset email sent successfully")),t.reset(),[2]}})},function(){var t=this,e=arguments;return new Promise(function(n,o){var i=r.apply(t,e);function u(t){b(i,n,o,u,a,"next",t)}function a(t){b(i,n,o,u,a,"throw",t)}u(void 0)})})()},loading:i}}}}}},signUp:{type:"void","x-component":"Link","x-component-props":{to:"/signin"},"x-content":'{{t("Back to login")}}'}}},scope:{t:e}}):p().createElement(y.Navigate,{to:"/not-found",replace:!0})};function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function x(t,e,n,r,o,i,u){try{var a=t[i](u),c=a.value}catch(t){n(t);return}a.done?e(c):Promise.resolve(c).then(r,o)}function S(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n,r,o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=o){var i=[],u=!0,a=!1;try{for(o=o.call(t);!(u=(n=o.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){a=!0,r=t}finally{try{u||null==o.return||o.return()}finally{if(a)throw r}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return w(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(t,e)}}(t,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var O=function(){var t,e=(0,s.o$)().t,n=(0,r.useAPIClient)(),o=S((0,y.useSearchParams)(),1)[0],i=o.get("resetToken"),u=(0,r.useNavigateNoUpdate)(),a=S(p().useState(!1),2),c=a[0],m=a[1],b=o.get("name"),v=(0,h.u)(b);return((0,f.useEffect)(function(){n.auth.checkResetToken({resetToken:i}).then(function(){m(!1)}).catch(function(t){m(!0)})},[]),null==v||null==(t=v.options)?void 0:t.enableResetPassword)?!i||c?p().createElement(d.Result,{status:"403",title:e("Reset link has expired"),extra:p().createElement(d.Button,{type:"primary",onClick:function(){return u("/signin")}},e("Go to login"))}):p().createElement(r.SchemaComponent,{schema:{type:"object",name:"resetPasswordForm","x-component":"FormV2",properties:{password:{type:"string","x-component":"Password",title:'{{t("New password")}}',required:!0,"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Please enter new password")}}'}},confirmPassword:{type:"string","x-component":"Password",title:'{{t("Confirm password")}}',required:!0,"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Please enter the same password again")}}'},"x-validator":"{{(value, rules, {form}) => {\n if (!value) {\n return '';\n }\n if (value !== form.values.password) {\n return t(\"The passwords entered twice are inconsistent\");\n }\n }}}"},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Confirm")}}',type:"void","x-component":"Action","x-component-props":{htmlType:"submit",block:!0,type:"primary",useAction:function(){var t=(0,l.useForm)(),e=(0,r.useAPIClient)(),n=(0,s.o$)().t,o=new URLSearchParams(window.location.search).get("resetToken"),i=S(p().useState(!1),2),u=i[0],a=i[1];return{run:function(){var r;return(r=function(){return function(t,e){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:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){var c=[i,a];if(n)throw TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return u.label++,{value:c[1],done:!1};case 5:u.label++,r=c[1],c=[0];continue;case 7:c=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){u=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){u.label=c[1];break}if(6===c[0]&&u.label<o[1]){u.label=o[1],o=c;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(c);break}o[2]&&u.ops.pop(),u.trys.pop();continue}c=e.call(t,u)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:return[4,t.submit()];case 1:r.sent(),a(!0),r.label=2;case 2:var i,u;return r.trys.push([2,,4,5]),[4,e.auth.resetPassword((i=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(e){var r;r=n[e],e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r})}return t}({},t.values),u=u={resetToken:o},Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(u)):(function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n.push.apply(n,r)}return n})(Object(u)).forEach(function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(u,t))}),i))];case 3:return r.sent(),[3,5];case 4:return a(!1),[7];case 5:return d.message.success(n("Password reset successful")),setTimeout(function(){window.location.href="/signin"},1e3),[2]}})},function(){var t=this,e=arguments;return new Promise(function(n,o){var i=r.apply(t,e);function u(t){x(i,n,o,u,a,"next",t)}function a(t){x(i,n,o,u,a,"throw",t)}u(void 0)})})()},loading:u}}}}}},signUp:{type:"void","x-component":"Link","x-component-props":{to:"/signin"},"x-content":'{{t("Go to login")}}'}}},scope:{t:e}}):p().createElement(y.Navigate,{to:"/not-found",replace:!0})},P=n(581);function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function E(t,e,n,r,o,i,u){try{var a=t[i](u),c=a.value}catch(t){n(t);return}a.done?e(c):Promise.resolve(c).then(r,o)}function A(t,e,n){return(A=I()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&k(o,n.prototype),o}).apply(null,arguments)}function T(t){return(T=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function k(t,e){return(k=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function j(t){var e="function"==typeof Map?new Map:void 0;return(j=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return A(t,arguments,T(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),k(n,t)})(t)}function I(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(I=function(){return!!t})()}var C=(0,r.lazy)(function(){return P("imported_gs6osn_component",n.e("249").then(n.bind(n,209)))},"AuthProvider").AuthProvider,R=(0,r.lazy)(function(){return P("imported_kl5khg_component",n.e("678").then(n.bind(n,215)))},"Options","SignInForm","SignUpForm"),N=R.Options,q=R.SignInForm,L=R.SignUpForm,F=(0,r.lazy)(function(){return P("imported_-1ja1ffa_component",n.e("757").then(n.bind(n,247)))},"AuthLayout","SignInPage","SignUpPage"),K=F.AuthLayout,U=F.SignInPage,M=F.SignUpPage,$=(0,r.lazy)(function(){return P("imported_10vpsc8_component",n.e("230").then(n.bind(n,189)))},"Authenticator").Authenticator,D=(0,r.lazy)(function(){return P("imported_-1q5gcq5_component",n.e("157").then(n.bind(n,262)))},"TokenPolicySettings").TokenPolicySettings,z=(0,r.lazy)(function(){return P("imported_-1ja1ffa_component",n.e("757").then(n.bind(n,247)))},"AuthenticatorsContextProvider","AuthLayout"),W=z.AuthenticatorsContextProvider,B=z.AuthLayout,H=function(t){var e;if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");function n(){var t,e,r,i,u,a;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,r=arguments,e=T(e),i=t=function(t,e){var n;if(e&&("object"==((n=e)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof e))return e;if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,I()?Reflect.construct(e,r||[],T(this).constructor):e.apply(this,r)),u="authTypes",a=new o.Registry,u in i?Object.defineProperty(i,u,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[u]=a,t}return n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),t&&k(n,t),e=[{key:"registerType",value:function(t,e){this.authTypes.register(t,e)}},{key:"load",value:function(){var t,e=this;return(t=function(){var t,n,r;return function(t,e){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:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){var c=[i,a];if(n)throw TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return u.label++,{value:c[1],done:!1};case 5:u.label++,r=c[1],c=[0];continue;case 7:c=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){u=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){u.label=c[1];break}if(6===c[0]&&u.label<o[1]){u.label=o[1],o=c;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(c);break}o[2]&&u.ops.pop(),u.trys.pop();continue}c=e.call(t,u)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(o){var i,u;return e.app.pluginSettingsManager.add(s.A7,{icon:"LoginOutlined",title:'{{t("Authentication", { ns: "'.concat(s.A7,'" })}}'),aclSnippet:"pm.auth"}),e.app.pluginSettingsManager.add("auth.authenticators",{icon:"LoginOutlined",title:'{{t("Authenticators", { ns: "'.concat(s.A7,'" })}}'),Component:$,aclSnippet:"pm.auth.authenticators",sort:1}),e.router.add("auth",{Component:"AuthLayout"}),e.router.add("auth.signin",{path:"/signin",Component:"SignInPage"}),e.router.add("auth.signup",{path:"/signup",Component:"SignUpPage"}),e.router.add("auth.forgotPassword",{path:"/forgot-password",Component:"ForgotPasswordPage"}),e.router.add("auth.resetPassword",{path:"/reset-password",Component:"ResetPasswordPage"}),e.app.addComponents({AuthLayout:K,SignInPage:U,SignUpPage:M,ForgotPasswordPage:g,ResetPasswordPage:O}),e.app.providers.unshift([C,{}]),e.registerType("Email/Password",{components:{SignInForm:q,SignUpForm:L,AdminSettingsForm:N}}),e.app.pluginSettingsManager.add("security.token-policy",{title:'{{t("Token policy", { ns: "'.concat(s.A7,'" })}}'),Component:D,aclSnippet:"pm.security.token-policy",icon:"ApiOutlined",sort:0}),(i=({app:e.app}).app).apiClient.axios,n=(t=function(t){if(Array.isArray(t))return t}(u=[function(t){var e,n=null==t||null==(e=t.headers)?void 0:e["x-new-token"];return n&&i.apiClient.auth.setToken(n),t},function(t){var e,n,r,o,u,s=null==t||null==(n=t.response)||null==(e=n.headers)?void 0:e["x-new-token"],l=null==t||null==(o=t.response)||null==(r=o.data)?void 0:r.errors,f=Array.isArray(l)?l[0]:null,p=i.router.state.location,d=p.pathname,y=p.search,h=i.router.basename;if(s&&i.apiClient.auth.setToken(s),401===t.status&&(null==f?void 0:f.code)&&a[f.code]&&(i.apiClient.auth.setToken(""),d===i.getHref("signin")&&(null==f?void 0:f.code)!==a.EMPTY_TOKEN&&t.config&&(t.config.skipNotify=!1),(null==f?void 0:f.code)==="USER_HAS_NO_ROLES_ERR"&&(t.config.skipNotify=!0,i.error=f)),401===t.status&&!(null==(u=t.config)?void 0:u.skipAuth)&&(null==f?void 0:f.code)&&a[f.code]){if(!f||(null==f?void 0:f.code)===a.SKIP_TOKEN_RENEW)throw t;var m=i.router.isSkippedAuthCheckRoute(d);if(m&&(t.config.skipNotify=!0),d!==i.getHref("signin")&&!m){var b,v,g=(b=h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),v=new RegExp("^".concat(b.replace(/\/?$/,""),"(\\/|$)")),d.replace(v,"/")||d);c(function(){i.apiClient.auth.setToken(null),i.router.navigate("/signin?redirect=".concat(g).concat(y),{replace:!0})})}}throw t}])||function(t,e){var n,r,o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=o){var i=[],u=!0,a=!1;try{for(o=o.call(t);!(u=(n=o.next()).done)&&(i.push(n.value),i.length!==e);u=!0);}catch(t){a=!0,r=t}finally{try{u||null==o.return||o.return()}finally{if(a)throw r}}return i}}(u,2)||function(t,e){if(t){if("string"==typeof t)return _(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _(t,e)}}(u,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],r=t[1],e.app.apiClient.axios.interceptors.response.handlers.unshift({fulfilled:n,rejected:r,synchronous:!1,runWhen:null}),[2]})},function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function u(t){E(i,r,o,u,a,"next",t)}function a(t){E(i,r,o,u,a,"throw",t)}u(void 0)})})()}}],function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(n.prototype,e),n}(j(r.Plugin)),X=function(t){return(0,r.useLazy)(function(){return P("imported_kl5khg_component",n.e("678").then(n.bind(n,215)))},"useSignIn")(t)},G=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/admin";return(0,r.useLazy)(function(){return P("imported_kl5khg_component",n.e("678").then(n.bind(n,215)))},"useRedirect")(t)},V=H},827:function(t,e,n){"use strict";n.d(e,{H:function(){return o},u:function(){return i}});var r=n(156),o=(0,r.createContext)([]);o.displayName="AuthenticatorsContext";var i=function(t){return(0,r.useContext)(o).find(function(e){return e.name===t})}},551:function(t,e,n){"use strict";n.d(e,{A7:function(){return i},KQ:function(){return a},o$:function(){return u}});var r=n(238),o=n(772),i="auth";function u(){return(0,r.useTranslation)([i,"client"],{nsMode:"fallback"})}function a(t){return o.i18n.t(t,{ns:[i,"client"],nsMode:"fallback"})}},869:function(t,e,n){t.exports=n(31).Symbol},365:function(t,e,n){var r=n(869),o=n(43),i=n(283),u=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":u&&u in Object(t)?o(t):i(t)}},527:function(t,e,n){var r=n(670),o=/^\s+/;t.exports=function(t){return t?t.slice(0,r(t)+1).replace(o,""):t}},274:function(t,e,n){t.exports="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g},43:function(t,e,n){var r=n(869),o=Object.prototype,i=o.hasOwnProperty,u=o.toString,a=r?r.toStringTag:void 0;t.exports=function(t){var e=i.call(t,a),n=t[a];try{t[a]=void 0;var r=!0}catch(t){}var o=u.call(t);return r&&(e?t[a]=n:delete t[a]),o}},283:function(t){var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},31:function(t,e,n){var r=n(274),o="object"==typeof self&&self&&self.Object===Object&&self;t.exports=r||o||Function("return this")()},670:function(t){var e=/\s/;t.exports=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}},741:function(t,e,n){var r=n(917),o=n(860),i=n(640),u=Math.max,a=Math.min;t.exports=function(t,e,n){var c,s,l,f,p,d,y=0,h=!1,m=!1,b=!0;if("function"!=typeof t)throw TypeError("Expected a function");function v(e){var n=c,r=s;return c=s=void 0,y=e,f=t.apply(r,n)}function g(t){var n=t-d,r=t-y;return void 0===d||n>=e||n<0||m&&r>=l}function w(){var t,n,r,i=o();if(g(i))return x(i);p=setTimeout(w,(t=i-d,n=i-y,r=e-t,m?a(r,l-n):r))}function x(t){return(p=void 0,b&&c)?v(t):(c=s=void 0,f)}function S(){var t,n=o(),r=g(n);if(c=arguments,s=this,d=n,r){if(void 0===p)return y=t=d,p=setTimeout(w,e),h?v(t):f;if(m)return clearTimeout(p),p=setTimeout(w,e),v(d)}return void 0===p&&(p=setTimeout(w,e)),f}return e=i(e)||0,r(n)&&(h=!!n.leading,l=(m="maxWait"in n)?u(i(n.maxWait)||0,e):l,b="trailing"in n?!!n.trailing:b),S.cancel=function(){void 0!==p&&clearTimeout(p),y=0,c=d=s=p=void 0},S.flush=function(){return void 0===p?f:x(o())},S}},917:function(t){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},620:function(t){t.exports=function(t){return null!=t&&"object"==typeof t}},528:function(t,e,n){var r=n(365),o=n(620);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==r(t)}},860:function(t,e,n){var r=n(31);t.exports=function(){return r.Date.now()}},640:function(t,e,n){var r=n(527),o=n(917),i=n(528),u=0/0,a=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return u;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var n=c.test(t);return n||s.test(t)?l(t.slice(2),n?2:8):a.test(t)?u:+t}},581:function(t){t.exports=function(t,e){return"undefined"!=typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(t,e),e}},482:function(t){"use strict";t.exports=s},964:function(t){"use strict";t.exports=r},632:function(t){"use strict";t.exports=e},563:function(e){"use strict";e.exports=t},505:function(t){"use strict";t.exports=a},875:function(t){"use strict";t.exports=u},772:function(t){"use strict";t.exports=o},584:function(t){"use strict";t.exports=c},721:function(t){"use strict";t.exports=l},156:function(t){"use strict";t.exports=n},238:function(t){"use strict";t.exports=f},128:function(t){"use strict";t.exports=i}},g={};function w(t){var e=g[t];if(void 0!==e)return e.exports;var n=g[t]={exports:{}};return v[t](n,n.exports,w),n.exports}return w.m=v,w.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return w.d(e,{a:e}),e},w.d=function(t,e){for(var n in e)w.o(e,n)&&!w.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},w.f={},w.e=function(t){return Promise.all(Object.keys(w.f).reduce(function(e,n){return w.f[n](t,e),e},[]))},w.u=function(t){return""+({157:"d451b9556071e997",230:"95a0e31032d919ee",249:"8f805ee5814fd9b4",678:"250783b43257256a",757:"bc33cbbb266ce917"})[t]+".js"},w.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}}(),w.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},p={},d="@nocobase/plugin-auth:",w.l=function(t,e,n,r){if(p[t])return void p[t].push(e);if(void 0!==n)for(var o,i,u=document.getElementsByTagName("script"),a=0;a<u.length;a++){var c=u[a];if(c.getAttribute("src")==t||c.getAttribute("data-webpack")==d+n){o=c;break}}o||(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,w.nc&&o.setAttribute("nonce",w.nc),o.setAttribute("data-webpack",d+n),o.src=t),p[t]=[e];var s=function(e,n){o.onerror=o.onload=null,clearTimeout(l);var r=p[t];if(delete p[t],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(t){return t(n)}),e)return e(n)},l=setTimeout(s.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=s.bind(null,o.onerror),o.onload=s.bind(null,o.onload),i&&document.head.appendChild(o)},w.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(y=window.__nocobase_public_path__||"/").endsWith("/")||(y+="/"),w.p=y+"static/plugins/@nocobase/plugin-auth/dist/client/",h={909:0},w.f.j=function(t,e){var n=w.o(h,t)?h[t]:void 0;if(0!==n)if(n)e.push(n[2]);else{var r=new Promise(function(e,r){n=h[t]=[e,r]});e.push(n[2]=r);var o=w.p+w.u(t),i=Error();w.l(o,function(e){if(w.o(h,t)&&(0!==(n=h[t])&&(h[t]=void 0),n)){var r=e&&("load"===e.type?"missing":e.type),o=e&&e.target&&e.target.src;i.message="Loading chunk "+t+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+t,t)}},m=function(t,e){var n,r,o=e[0],i=e[1],u=e[2],a=0;if(o.some(function(t){return 0!==h[t]})){for(n in i)w.o(i,n)&&(w.m[n]=i[n]);u&&u(w)}for(t&&t(e);a<o.length;a++)r=o[a],w.o(h,r)&&h[r]&&h[r][0](),h[r]=0},(b=self.webpackChunk_nocobase_plugin_auth=self.webpackChunk_nocobase_plugin_auth||[]).forEach(m.bind(null,0)),b.push=m.bind(null,b.push.bind(b)),w(239)}()});
|
|
10
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react-i18next"),require("@emotion/css"),require("react-router-dom"),require("@formily/antd-v5"),require("@formily/react"),require("@ant-design/icons"),require("@formily/core"),require("@formily/shared"),require("react"),require("antd"),require("@nocobase/client"),require("@nocobase/utils/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-auth",["react-i18next","@emotion/css","react-router-dom","@formily/antd-v5","@formily/react","@ant-design/icons","@formily/core","@formily/shared","react","antd","@nocobase/client","@nocobase/utils/client"],e):"object"==typeof exports?exports["@nocobase/plugin-auth"]=e(require("react-i18next"),require("@emotion/css"),require("react-router-dom"),require("@formily/antd-v5"),require("@formily/react"),require("@ant-design/icons"),require("@formily/core"),require("@formily/shared"),require("react"),require("antd"),require("@nocobase/client"),require("@nocobase/utils/client")):t["@nocobase/plugin-auth"]=e(t["react-i18next"],t["@emotion/css"],t["react-router-dom"],t["@formily/antd-v5"],t["@formily/react"],t["@ant-design/icons"],t["@formily/core"],t["@formily/shared"],t.react,t.antd,t["@nocobase/client"],t["@nocobase/utils/client"])}(self,function(t,e,n,r,o,i,u,a,c,s,l,f){return function(){var p,d,y,h={574:function(t,e,n){"use strict";n.r(e),n.d(e,{AuthLayout:function(){return W},default:function(){return V},useRedirect:function(){return H},PluginAuthClient:function(){return X},AuthenticatorsContext:function(){return h.m},useAuthenticator:function(){return h.p},AuthenticatorsContextProvider:function(){return B},useSignIn:function(){return G}});var r=n(342),o=n(768),i=n(738),u=n.n(i),a={EMPTY_TOKEN:"EMPTY_TOKEN",EXPIRED_TOKEN:"EXPIRED_TOKEN",INVALID_TOKEN:"INVALID_TOKEN",TOKEN_RENEW_FAILED:"TOKEN_RENEW_FAILED",BLOCKED_TOKEN:"BLOCKED_TOKEN",EXPIRED_SESSION:"EXPIRED_SESSION",NOT_EXIST_USER:"NOT_EXIST_USER",SKIP_TOKEN_RENEW:"SKIP_TOKEN_RENEW",USER_HAS_NO_ROLES_ERR:"USER_HAS_NO_ROLES_ERR"},c=u()(function(t){t()},3e3,{leading:!0,trailing:!1}),s=n(404),l=n(230),f=n(155),p=n.n(f),d=n(59),y=n(442),h=n(542);function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function b(t,e,n,r,o,i,u){try{var a=t[i](u),c=a.value}catch(t){n(t);return}a.done?e(c):Promise.resolve(c).then(r,o)}function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n,r,o=null==t?null:"u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=o){var i=[],u=!0,a=!1;try{for(o=o.call(t);!(u=(n=o.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){a=!0,r=t}finally{try{u||null==o.return||o.return()}finally{if(a)throw r}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return m(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(t,e)}}(t,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var g=function(){var t,e=(0,s.dE)().t,n=v((0,y.useSearchParams)(),1)[0].get("name"),o=(0,h.p)(n);return(null==o||null==(t=o.options)?void 0:t.enableResetPassword)?p().createElement(r.SchemaComponent,{schema:{type:"object",name:"forgotPasswordForm","x-component":"FormV2",properties:{email:{type:"string","x-component":"Input",title:'{{t("Reset password")}}',required:!0,"x-validator":"{{(value) => {\n if (!value) {\n return '';\n }\n if (!/^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$/.test(value)) {\n return t(\"Please enter a valid email\");\n }\n }}}","x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Please enter your email")}}',style:{}}},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Send reset email")}}',type:"void","x-component":"Action","x-component-props":{htmlType:"submit",block:!0,type:"primary",useAction:function(){var t=(0,l.useForm)(),e=(0,r.useAPIClient)(),n=(0,s.dE)().t,o=v(p().useState(!1),2),i=o[0],u=o[1];return{run:function(){var r;return(r=function(){return function(t,e){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),a=Object.defineProperty;return a(u,"next",{value:c(0)}),a(u,"throw",{value:c(1)}),a(u,"return",{value:c(2)}),"function"==typeof Symbol&&a(u,Symbol.iterator,{value:function(){return this}}),u;function c(a){return function(c){var s=[a,c];if(n)throw TypeError("Generator is already executing.");for(;u&&(u=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=e.call(t,i)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:return[4,t.submit()];case 1:r.sent(),u(!0),r.label=2;case 2:return r.trys.push([2,,4,5]),[4,e.auth.lostPassword(t.values)];case 3:return r.sent(),[3,5];case 4:return u(!1),[7];case 5:return d.message.success(n("Reset email sent successfully")),t.reset(),[2]}})},function(){var t=this,e=arguments;return new Promise(function(n,o){var i=r.apply(t,e);function u(t){b(i,n,o,u,a,"next",t)}function a(t){b(i,n,o,u,a,"throw",t)}u(void 0)})})()},loading:i}}}}}},signUp:{type:"void","x-component":"Link","x-component-props":{to:"/signin"},"x-content":'{{t("Back to login")}}'}}},scope:{t:e}}):p().createElement(y.Navigate,{to:"/not-found",replace:!0})};function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function S(t,e,n,r,o,i,u){try{var a=t[i](u),c=a.value}catch(t){n(t);return}a.done?e(c):Promise.resolve(c).then(r,o)}function x(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n,r,o=null==t?null:"u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=o){var i=[],u=!0,a=!1;try{for(o=o.call(t);!(u=(n=o.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){a=!0,r=t}finally{try{u||null==o.return||o.return()}finally{if(a)throw r}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return w(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(t,e)}}(t,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var O=function(){var t,e=(0,s.dE)().t,n=(0,r.useAPIClient)(),o=x((0,y.useSearchParams)(),1)[0],i=o.get("resetToken"),u=(0,r.useNavigateNoUpdate)(),a=x(p().useState(!1),2),c=a[0],m=a[1],b=o.get("name"),v=(0,h.p)(b);return((0,f.useEffect)(function(){n.auth.checkResetToken({resetToken:i}).then(function(){m(!1)}).catch(function(t){m(!0)})},[]),null==v||null==(t=v.options)?void 0:t.enableResetPassword)?!i||c?p().createElement(d.Result,{status:"403",title:e("Reset link has expired"),extra:p().createElement(d.Button,{type:"primary",onClick:function(){return u("/signin")}},e("Go to login"))}):p().createElement(r.SchemaComponent,{schema:{type:"object",name:"resetPasswordForm","x-component":"FormV2",properties:{password:{type:"string","x-component":"Password",title:'{{t("New password")}}',required:!0,"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Please enter new password")}}'}},confirmPassword:{type:"string","x-component":"Password",title:'{{t("Confirm password")}}',required:!0,"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Please enter the same password again")}}'},"x-validator":"{{(value, rules, {form}) => {\n if (!value) {\n return '';\n }\n if (value !== form.values.password) {\n return t(\"The passwords entered twice are inconsistent\");\n }\n }}}"},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Confirm")}}',type:"void","x-component":"Action","x-component-props":{htmlType:"submit",block:!0,type:"primary",useAction:function(){var t=(0,l.useForm)(),e=(0,r.useAPIClient)(),n=(0,s.dE)().t,o=new URLSearchParams(window.location.search).get("resetToken"),i=x(p().useState(!1),2),u=i[0],a=i[1];return{run:function(){var r;return(r=function(){return function(t,e){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),a=Object.defineProperty;return a(u,"next",{value:c(0)}),a(u,"throw",{value:c(1)}),a(u,"return",{value:c(2)}),"function"==typeof Symbol&&a(u,Symbol.iterator,{value:function(){return this}}),u;function c(a){return function(c){var s=[a,c];if(n)throw TypeError("Generator is already executing.");for(;u&&(u=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=e.call(t,i)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:return[4,t.submit()];case 1:r.sent(),a(!0),r.label=2;case 2:var i,u;return r.trys.push([2,,4,5]),[4,e.auth.resetPassword((i=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(e){var r;r=n[e],e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r})}return t}({},t.values),u=u={resetToken:o},Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(u)):(function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e.push.apply(e,n)}return e})(Object(u)).forEach(function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(u,t))}),i))];case 3:return r.sent(),[3,5];case 4:return a(!1),[7];case 5:return d.message.success(n("Password reset successful")),setTimeout(function(){window.location.href="/signin"},1e3),[2]}})},function(){var t=this,e=arguments;return new Promise(function(n,o){var i=r.apply(t,e);function u(t){S(i,n,o,u,a,"next",t)}function a(t){S(i,n,o,u,a,"throw",t)}u(void 0)})})()},loading:u}}}}}},signUp:{type:"void","x-component":"Link","x-component-props":{to:"/signin"},"x-content":'{{t("Go to login")}}'}}},scope:{t:e}}):p().createElement(y.Navigate,{to:"/not-found",replace:!0})},P=n(631);function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function _(t,e,n,r,o,i,u){try{var a=t[i](u),c=a.value}catch(t){n(t);return}a.done?e(c):Promise.resolve(c).then(r,o)}function j(t,e,n){return(j=I()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&k(o,n.prototype),o}).apply(null,arguments)}function T(t){return(T=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function k(t,e){return(k=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function A(t){var e="function"==typeof Map?new Map:void 0;return(A=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return j(t,arguments,T(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),k(n,t)})(t)}function I(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(I=function(){return!!t})()}var C=(0,r.lazy)(function(){return P("imported_gs6osn_component",n.e("339").then(n.bind(n,854)))},"AuthProvider").AuthProvider,N=(0,r.lazy)(function(){return P("imported_kl5khg_component",n.e("168").then(n.bind(n,323)))},"Options","SignInForm","SignUpForm"),R=N.Options,q=N.SignInForm,U=N.SignUpForm,L=(0,r.lazy)(function(){return P("imported_-1ja1ffa_component",n.e("159").then(n.bind(n,434)))},"AuthLayout","SignInPage","SignUpPage"),F=L.AuthLayout,K=L.SignInPage,M=L.SignUpPage,D=(0,r.lazy)(function(){return P("imported_10vpsc8_component",n.e("3").then(n.bind(n,334)))},"Authenticator").Authenticator,$=(0,r.lazy)(function(){return P("imported_-1q5gcq5_component",n.e("576").then(n.bind(n,195)))},"TokenPolicySettings").TokenPolicySettings,z=(0,r.lazy)(function(){return P("imported_-1ja1ffa_component",n.e("159").then(n.bind(n,434)))},"AuthenticatorsContextProvider","AuthLayout"),B=z.AuthenticatorsContextProvider,W=z.AuthLayout,X=function(t){var e;if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");function n(){var t,e,r,i,u,a;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,r=arguments,e=T(e),i=t=function(t,e){var n;if(e&&("object"==((n=e)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof e))return e;if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(this,I()?Reflect.construct(e,r||[],T(this).constructor):e.apply(this,r)),u="authTypes",a=new o.Registry,u in i?Object.defineProperty(i,u,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[u]=a,t}return n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),t&&k(n,t),e=[{key:"registerType",value:function(t,e){this.authTypes.register(t,e)}},{key:"load",value:function(){var t;return(t=function(){var t,e,n;return function(t,e){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),a=Object.defineProperty;return a(u,"next",{value:c(0)}),a(u,"throw",{value:c(1)}),a(u,"return",{value:c(2)}),"function"==typeof Symbol&&a(u,Symbol.iterator,{value:function(){return this}}),u;function c(a){return function(c){var s=[a,c];if(n)throw TypeError("Generator is already executing.");for(;u&&(u=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=e.call(t,i)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}(this,function(r){var o,i;return this.app.pluginSettingsManager.add(s.CU,{icon:"LoginOutlined",title:'{{t("Authentication", { ns: "'.concat(s.CU,'" })}}'),aclSnippet:"pm.auth"}),this.app.pluginSettingsManager.add("auth.authenticators",{icon:"LoginOutlined",title:'{{t("Authenticators", { ns: "'.concat(s.CU,'" })}}'),Component:D,aclSnippet:"pm.auth.authenticators",sort:1}),this.router.add("auth",{Component:"AuthLayout"}),this.router.add("auth.signin",{path:"/signin",Component:"SignInPage"}),this.router.add("auth.signup",{path:"/signup",Component:"SignUpPage"}),this.router.add("auth.forgotPassword",{path:"/forgot-password",Component:"ForgotPasswordPage"}),this.router.add("auth.resetPassword",{path:"/reset-password",Component:"ResetPasswordPage"}),this.app.addComponents({AuthLayout:F,SignInPage:K,SignUpPage:M,ForgotPasswordPage:g,ResetPasswordPage:O}),this.app.providers.unshift([C,{}]),this.registerType("Email/Password",{components:{SignInForm:q,SignUpForm:U,AdminSettingsForm:R}}),this.app.pluginSettingsManager.add("security.token-policy",{title:'{{t("Token policy", { ns: "'.concat(s.CU,'" })}}'),Component:$,aclSnippet:"pm.security.token-policy",icon:"ApiOutlined",sort:0}),e=(t=function(t){if(Array.isArray(t))return t}(((o=({app:this.app}).app).apiClient.axios,i=[function(t){var e,n=null==t||null==(e=t.headers)?void 0:e["x-new-token"];return n&&o.apiClient.auth.setToken(n),t},function(t){var e,n,r,i,u,s=null==t||null==(n=t.response)||null==(e=n.headers)?void 0:e["x-new-token"],l=null==t||null==(i=t.response)||null==(r=i.data)?void 0:r.errors,f=Array.isArray(l)?l[0]:null,p=o.router.state.location,d=p.pathname,y=p.search,h=o.router.basename;if(s&&o.apiClient.auth.setToken(s),401===t.status&&(null==f?void 0:f.code)&&a[f.code]&&(o.apiClient.auth.setToken(""),d===o.getHref("signin")&&(null==f?void 0:f.code)!==a.EMPTY_TOKEN&&t.config&&(t.config.skipNotify=!1),(null==f?void 0:f.code)==="USER_HAS_NO_ROLES_ERR"&&(t.config.skipNotify=!0,o.error=f)),401===t.status&&!(null==(u=t.config)?void 0:u.skipAuth)&&(null==f?void 0:f.code)&&a[f.code]){if(!f||(null==f?void 0:f.code)===a.SKIP_TOKEN_RENEW)throw t;var m=o.router.isSkippedAuthCheckRoute(d);if(m&&(t.config.skipNotify=!0),d!==o.getHref("signin")&&!m){var b,v,g=(b=h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),v=new RegExp("^".concat(b.replace(/\/?$/,""),"(\\/|$)")),d.replace(v,"/")||d);c(function(){o.apiClient.auth.setToken(null),o.router.navigate("/signin?redirect=".concat(g).concat(y),{replace:!0})})}}throw t}]))||function(t){var e,n,r=null==t?null:"u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var o=[],i=!0,u=!1;try{for(r=r.call(t);!(i=(e=r.next()).done)&&(o.push(e.value),2!==o.length);i=!0);}catch(t){u=!0,n=t}finally{try{i||null==r.return||r.return()}finally{if(u)throw n}}return o}}(i)||function(t){if(t){if("string"==typeof t)return E(t,2);var e=Object.prototype.toString.call(t).slice(8,-1);if("Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e)return Array.from(e);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return E(t,2)}}(i)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],n=t[1],this.app.apiClient.axios.interceptors.response.handlers.unshift({fulfilled:e,rejected:n,synchronous:!1,runWhen:null}),[2]})},function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function u(t){_(i,r,o,u,a,"next",t)}function a(t){_(i,r,o,u,a,"throw",t)}u(void 0)})}).call(this)}}],function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(n.prototype,e),n}(A(r.Plugin)),G=function(t){return(0,r.useLazy)(function(){return P("imported_kl5khg_component",n.e("168").then(n.bind(n,323)))},"useSignIn")(t)},H=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/admin";return(0,r.useLazy)(function(){return P("imported_kl5khg_component",n.e("168").then(n.bind(n,323)))},"useRedirect")(t)},V=X},542:function(t,e,n){"use strict";n.d(e,{m:function(){return o},p:function(){return i}});var r=n(155),o=(0,r.createContext)([]);o.displayName="AuthenticatorsContext";var i=function(t){return(0,r.useContext)(o).find(function(e){return e.name===t})}},404:function(t,e,n){"use strict";n.d(e,{CU:function(){return i},dE:function(){return u},vV:function(){return a}});var r=n(953),o=n(342),i="auth";function u(){return(0,r.useTranslation)([i,"client"],{nsMode:"fallback"})}function a(t){return o.i18n.t(t,{ns:[i,"client"],nsMode:"fallback"})}},432:function(t,e,n){t.exports=n(36).Symbol},77:function(t,e,n){var r=n(432),o=n(444),i=n(371),u=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":u&&u in Object(t)?o(t):i(t)}},625:function(t,e,n){var r=n(531),o=/^\s+/;t.exports=function(t){return t?t.slice(0,r(t)+1).replace(o,""):t}},565:function(t,e,n){t.exports="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g},444:function(t,e,n){var r=n(432),o=Object.prototype,i=o.hasOwnProperty,u=o.toString,a=r?r.toStringTag:void 0;t.exports=function(t){var e=i.call(t,a),n=t[a];try{t[a]=void 0;var r=!0}catch(t){}var o=u.call(t);return r&&(e?t[a]=n:delete t[a]),o}},371:function(t){var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},36:function(t,e,n){var r=n(565),o="object"==typeof self&&self&&self.Object===Object&&self;t.exports=r||o||Function("return this")()},531:function(t){var e=/\s/;t.exports=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}},738:function(t,e,n){var r=n(130),o=n(593),i=n(909),u=Math.max,a=Math.min;t.exports=function(t,e,n){var c,s,l,f,p,d,y=0,h=!1,m=!1,b=!0;if("function"!=typeof t)throw TypeError("Expected a function");function v(e){var n=c,r=s;return c=s=void 0,y=e,f=t.apply(r,n)}function g(t){var n=t-d,r=t-y;return void 0===d||n>=e||n<0||m&&r>=l}function w(){var t,n,r,i=o();if(g(i))return S(i);p=setTimeout(w,(t=i-d,n=i-y,r=e-t,m?a(r,l-n):r))}function S(t){return(p=void 0,b&&c)?v(t):(c=s=void 0,f)}function x(){var t,n=o(),r=g(n);if(c=arguments,s=this,d=n,r){if(void 0===p)return y=t=d,p=setTimeout(w,e),h?v(t):f;if(m)return clearTimeout(p),p=setTimeout(w,e),v(d)}return void 0===p&&(p=setTimeout(w,e)),f}return e=i(e)||0,r(n)&&(h=!!n.leading,l=(m="maxWait"in n)?u(i(n.maxWait)||0,e):l,b="trailing"in n?!!n.trailing:b),x.cancel=function(){void 0!==p&&clearTimeout(p),y=0,c=d=s=p=void 0},x.flush=function(){return void 0===p?f:S(o())},x}},130:function(t){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},189:function(t){t.exports=function(t){return null!=t&&"object"==typeof t}},733:function(t,e,n){var r=n(77),o=n(189);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==r(t)}},593:function(t,e,n){var r=n(36);t.exports=function(){return r.Date.now()}},909:function(t,e,n){var r=n(625),o=n(130),i=n(733),u=0/0,a=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return u;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var n=c.test(t);return n||s.test(t)?l(t.slice(2),n?2:8):a.test(t)?u:+t}},631:function(t){t.exports=function(t,e){return"u">typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(t,e),e}},375:function(t){"use strict";t.exports=i},477:function(t){"use strict";t.exports=e},418:function(t){"use strict";t.exports=r},452:function(t){"use strict";t.exports=u},230:function(t){"use strict";t.exports=o},166:function(t){"use strict";t.exports=a},342:function(t){"use strict";t.exports=l},768:function(t){"use strict";t.exports=f},59:function(t){"use strict";t.exports=s},155:function(t){"use strict";t.exports=c},953:function(e){"use strict";e.exports=t},442:function(t){"use strict";t.exports=n},923:function(t,e,n){"use strict";var r=window.__webpack_public_path__||"/";"/"!==r.charAt(r.length-1)&&(r+="/"),n.p=r+"static/plugins/@nocobase/plugin-auth/dist/client/"}},m={};function b(t){var e=m[t];if(void 0!==e)return e.exports;var n=m[t]={exports:{}};return h[t](n,n.exports,b),n.exports}b.m=h,b.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return b.d(e,{a:e}),e},b.d=function(t,e){for(var n in e)b.o(e,n)&&!b.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},b.f={},b.e=function(t){return Promise.all(Object.keys(b.f).reduce(function(e,n){return b.f[n](t,e),e},[]))},b.u=function(t){return""+({159:"7bbaa6548c22ea0d",168:"ad1a67c0b8048d9f",3:"fb85fd4894c573a1",339:"1336785024b1a2f0",576:"4091c71e2c30f057"})[t]+".js"},b.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}}(),b.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},v={},b.l=function(t,e,n,r){if(v[t])return void v[t].push(e);if(void 0!==n)for(var o,i,u=document.getElementsByTagName("script"),a=0;a<u.length;a++){var c=u[a];if(c.getAttribute("src")==t||c.getAttribute("data-rspack")=="@nocobase/plugin-auth:"+n){o=c;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,b.nc&&o.setAttribute("nonce",b.nc),o.setAttribute("data-rspack","@nocobase/plugin-auth:"+n),o.src=t),v[t]=[e];var s=function(e,n){o.onerror=o.onload=null,clearTimeout(l);var r=v[t];if(delete v[t],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(t){return t(n)}),e)return e(n)},l=setTimeout(s.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=s.bind(null,o.onerror),o.onload=s.bind(null,o.onload),i&&document.head.appendChild(o)},b.r=function(t){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},b.g.importScripts&&(g=b.g.location+"");var v,g,w=b.g.document;if(!g&&w&&(w.currentScript&&"SCRIPT"===w.currentScript.tagName.toUpperCase()&&(g=w.currentScript.src),!g)){var S=w.getElementsByTagName("script");if(S.length)for(var x=S.length-1;x>-1&&(!g||!/^http(s?):/.test(g));)g=S[x--].src}if(!g)throw Error("Automatic publicPath is not supported in this browser");return b.p=g.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),p={889:0},b.f.j=function(t,e){var n=b.o(p,t)?p[t]:void 0;if(0!==n)if(n)e.push(n[2]);else{var r=new Promise(function(e,r){n=p[t]=[e,r]});e.push(n[2]=r);var o=b.p+b.u(t),i=Error();b.l(o,function(e){if(b.o(p,t)&&(0!==(n=p[t])&&(p[t]=void 0),n)){var r=e&&("load"===e.type?"missing":e.type),o=e&&e.target&&e.target.src;i.message="Loading chunk "+t+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+t,t)}},d=function(t,e){var n,r,o=e[0],i=e[1],u=e[2],a=0;if(o.some(function(t){return 0!==p[t]})){for(n in i)b.o(i,n)&&(b.m[n]=i[n]);u&&u(b)}for(t&&t(e);a<o.length;a++)r=o[a],b.o(p,r)&&p[r]&&p[r][0](),p[r]=0},(y=self.webpackChunk_nocobase_plugin_auth=self.webpackChunk_nocobase_plugin_auth||[]).forEach(d.bind(null,0)),y.push=d.bind(null,y.push.bind(y)),b(923),b(574)}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,18 +8,18 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.1.0-alpha.
|
|
11
|
+
"@nocobase/client": "2.1.0-alpha.10",
|
|
12
12
|
"react": "18.2.0",
|
|
13
13
|
"react-router-dom": "6.30.1",
|
|
14
|
-
"@nocobase/utils": "2.1.0-alpha.
|
|
14
|
+
"@nocobase/utils": "2.1.0-alpha.10",
|
|
15
15
|
"axios": "1.7.7",
|
|
16
16
|
"lodash": "4.17.21",
|
|
17
|
-
"@nocobase/auth": "2.1.0-alpha.
|
|
18
|
-
"@nocobase/database": "2.1.0-alpha.
|
|
19
|
-
"@nocobase/cache": "2.1.0-alpha.
|
|
20
|
-
"@nocobase/server": "2.1.0-alpha.
|
|
21
|
-
"@nocobase/logger": "2.1.0-alpha.
|
|
22
|
-
"@nocobase/test": "2.1.0-alpha.
|
|
17
|
+
"@nocobase/auth": "2.1.0-alpha.10",
|
|
18
|
+
"@nocobase/database": "2.1.0-alpha.10",
|
|
19
|
+
"@nocobase/cache": "2.1.0-alpha.10",
|
|
20
|
+
"@nocobase/server": "2.1.0-alpha.10",
|
|
21
|
+
"@nocobase/logger": "2.1.0-alpha.10",
|
|
22
|
+
"@nocobase/test": "2.1.0-alpha.10",
|
|
23
23
|
"@formily/antd-v5": "1.2.3",
|
|
24
24
|
"antd": "5.24.2",
|
|
25
25
|
"@formily/shared": "2.3.7",
|
|
@@ -27,6 +27,6 @@ module.exports = {
|
|
|
27
27
|
"react-i18next": "11.18.6",
|
|
28
28
|
"@emotion/css": "11.13.0",
|
|
29
29
|
"@ant-design/icons": "5.6.1",
|
|
30
|
-
"@nocobase/actions": "2.1.0-alpha.
|
|
30
|
+
"@nocobase/actions": "2.1.0-alpha.10",
|
|
31
31
|
"@formily/core": "2.3.7"
|
|
32
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"cron","description":"Cron jobs for your node","version":"2.4.4","author":"Nick Campbell <nicholas.j.campbell@gmail.com> (https://github.com/ncb000gt)","bugs":{"url":"https://github.com/kelektiv/node-cron/issues"},"repository":{"type":"git","url":"https://github.com/kelektiv/node-cron.git"},"main":"lib/cron","scripts":{"lint":"eslint {lib,tests}/*.js","test":"jest --coverage","test:watch":"jest --watch --coverage","test:types":"tsd","prepare":"husky install","release":"semantic-release"},"types":"types/index.d.ts","dependencies":{"@types/luxon":"~3.3.0","luxon":"~3.3.0"},"devDependencies":{"@commitlint/cli":"~17.6.6","@insurgentlab/commitlint-config":"^18.1.0","@insurgentlab/conventional-changelog-preset":"~6.0.3","@semantic-release/changelog":"~6.0.x","@semantic-release/commit-analyzer":"~9.0.x","@semantic-release/git":"~10.0.x","@semantic-release/github":"~8.1.x","@semantic-release/npm":"~10.0.x","@semantic-release/release-notes-generator":"~11.0.x","chai":"~4.2.x","eslint":"~8.36.x","eslint-config-prettier":"^8.7.x","eslint-config-standard":"~17.0.x","eslint-plugin-import":"~2.27.x","eslint-plugin-jest":"~27.2.x","eslint-plugin-n":"~15.6.x","eslint-plugin-prettier":"~4.2.x","eslint-plugin-promise":"~6.1.x","husky":"^8.0.3","jest":"~29.5.x","prettier":"~2.8.x","semantic-release":"~21.0.x","sinon":"^15.0.x","tsd":"^0.28.1"},"keywords":["cron","node cron","node-cron","schedule","scheduler","cronjob","cron job"],"license":"MIT","contributors":["Brandon der Blätter <https://interlucid.com/contact/> (https://github.com/intcreator)","Romain Beauxis <toots@rastageeks.org> (https://github.com/toots)","James Padolsey <> (https://github.com/jamespadolsey)","Finn Herpich <fh@three-heads.de> (https://github.com/ErrorProne)","Clifton Cunningham <clifton.cunningham@gmail.com> (https://github.com/cliftonc)","Eric Abouaf <eric.abouaf@gmail.com> (https://github.com/neyric)","humanchimp <morphcham@gmail.com> (https://github.com/humanchimp)","Craig Condon <craig@spiceapps.com> (https://github.com/spiceapps)","Dan Bear <daniel@hulu.com> (https://github.com/danhbear)","Vadim Baryshev <vadimbaryshev@gmail.com> (https://github.com/baryshev)","Leandro Ferrari <lfthomaz@gmail.com> (https://github.com/lfthomaz)","Gregg Zigler <greggzigler@gmail.com> (https://github.com/greggzigler)","Jordan Abderrachid <jabderrachid@gmail.com> (https://github.com/jordanabderrachid)","Masakazu Matsushita <matsukaz@gmail.com> (matsukaz)","Christopher Lunt <me@kirisu.co.uk> (https://github.com/kirisu)"],"jest":{"collectCoverage":true,"collectCoverageFrom":["lib/*.js"],"coverageThreshold":{"global":{"statements":80,"branches":80,"functions":70,"lines":80}}},"files":["lib","types","CHANGELOG.md","LICENSE","README.md"],"_lastModified":"
|
|
1
|
+
{"name":"cron","description":"Cron jobs for your node","version":"2.4.4","author":"Nick Campbell <nicholas.j.campbell@gmail.com> (https://github.com/ncb000gt)","bugs":{"url":"https://github.com/kelektiv/node-cron/issues"},"repository":{"type":"git","url":"https://github.com/kelektiv/node-cron.git"},"main":"lib/cron","scripts":{"lint":"eslint {lib,tests}/*.js","test":"jest --coverage","test:watch":"jest --watch --coverage","test:types":"tsd","prepare":"husky install","release":"semantic-release"},"types":"types/index.d.ts","dependencies":{"@types/luxon":"~3.3.0","luxon":"~3.3.0"},"devDependencies":{"@commitlint/cli":"~17.6.6","@insurgentlab/commitlint-config":"^18.1.0","@insurgentlab/conventional-changelog-preset":"~6.0.3","@semantic-release/changelog":"~6.0.x","@semantic-release/commit-analyzer":"~9.0.x","@semantic-release/git":"~10.0.x","@semantic-release/github":"~8.1.x","@semantic-release/npm":"~10.0.x","@semantic-release/release-notes-generator":"~11.0.x","chai":"~4.2.x","eslint":"~8.36.x","eslint-config-prettier":"^8.7.x","eslint-config-standard":"~17.0.x","eslint-plugin-import":"~2.27.x","eslint-plugin-jest":"~27.2.x","eslint-plugin-n":"~15.6.x","eslint-plugin-prettier":"~4.2.x","eslint-plugin-promise":"~6.1.x","husky":"^8.0.3","jest":"~29.5.x","prettier":"~2.8.x","semantic-release":"~21.0.x","sinon":"^15.0.x","tsd":"^0.28.1"},"keywords":["cron","node cron","node-cron","schedule","scheduler","cronjob","cron job"],"license":"MIT","contributors":["Brandon der Blätter <https://interlucid.com/contact/> (https://github.com/intcreator)","Romain Beauxis <toots@rastageeks.org> (https://github.com/toots)","James Padolsey <> (https://github.com/jamespadolsey)","Finn Herpich <fh@three-heads.de> (https://github.com/ErrorProne)","Clifton Cunningham <clifton.cunningham@gmail.com> (https://github.com/cliftonc)","Eric Abouaf <eric.abouaf@gmail.com> (https://github.com/neyric)","humanchimp <morphcham@gmail.com> (https://github.com/humanchimp)","Craig Condon <craig@spiceapps.com> (https://github.com/spiceapps)","Dan Bear <daniel@hulu.com> (https://github.com/danhbear)","Vadim Baryshev <vadimbaryshev@gmail.com> (https://github.com/baryshev)","Leandro Ferrari <lfthomaz@gmail.com> (https://github.com/lfthomaz)","Gregg Zigler <greggzigler@gmail.com> (https://github.com/greggzigler)","Jordan Abderrachid <jabderrachid@gmail.com> (https://github.com/jordanabderrachid)","Masakazu Matsushita <matsukaz@gmail.com> (matsukaz)","Christopher Lunt <me@kirisu.co.uk> (https://github.com/kirisu)"],"jest":{"collectCoverage":true,"collectCoverageFrom":["lib/*.js"],"coverageThreshold":{"global":{"statements":80,"branches":80,"functions":70,"lines":80}}},"files":["lib","types","CHANGELOG.md","LICENSE","README.md"],"_lastModified":"2026-03-20T09:02:36.944Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"ms","version":"2.1.3","description":"Tiny millisecond conversion utility","repository":"vercel/ms","main":"./index","files":["index.js"],"scripts":{"precommit":"lint-staged","lint":"eslint lib/* bin/*","test":"mocha tests.js"},"eslintConfig":{"extends":"eslint:recommended","env":{"node":true,"es6":true}},"lint-staged":{"*.js":["npm run lint","prettier --single-quote --write","git add"]},"license":"MIT","devDependencies":{"eslint":"4.18.2","expect.js":"0.3.1","husky":"0.14.3","lint-staged":"5.0.0","mocha":"4.0.1","prettier":"2.0.5"},"_lastModified":"
|
|
1
|
+
{"name":"ms","version":"2.1.3","description":"Tiny millisecond conversion utility","repository":"vercel/ms","main":"./index","files":["index.js"],"scripts":{"precommit":"lint-staged","lint":"eslint lib/* bin/*","test":"mocha tests.js"},"eslintConfig":{"extends":"eslint:recommended","env":{"node":true,"es6":true}},"lint-staged":{"*.js":["npm run lint","prettier --single-quote --write","git add"]},"license":"MIT","devDependencies":{"eslint":"4.18.2","expect.js":"0.3.1","husky":"0.14.3","lint-staged":"5.0.0","mocha":"4.0.1","prettier":"2.0.5"},"_lastModified":"2026-03-20T09:02:37.038Z"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-auth",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.10",
|
|
4
4
|
"main": "./dist/server/index.js",
|
|
5
5
|
"homepage": "https://docs.nocobase.com/handbook/auth",
|
|
6
6
|
"homepage.ru-RU": "https://docs-ru.nocobase.com/handbook/auth",
|
|
@@ -30,9 +30,10 @@
|
|
|
30
30
|
"description": "User authentication management, including password, SMS, and support for Single Sign-On (SSO) protocols, with extensibility.",
|
|
31
31
|
"description.ru-RU": "Управление аутентификацией пользователей: пароли, SMS, поддержка протоколов единого входа (SSO) и возможность расширения.",
|
|
32
32
|
"description.zh-CN": "用户认证管理,包括基础的密码认证、短信认证、SSO 协议的认证等,可扩展。",
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "ce790d46c0a5768ca9618c7d0d77ab8300de75c8",
|
|
34
34
|
"keywords": [
|
|
35
35
|
"Authentication",
|
|
36
36
|
"Security"
|
|
37
|
-
]
|
|
37
|
+
],
|
|
38
|
+
"license": "Apache-2.0"
|
|
38
39
|
}
|