@tachybase/module-auth 0.23.41 → 0.23.48
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/dist/client/index.js +4 -4
- package/dist/externalVersion.js +9 -9
- package/dist/node_modules/cron/package.json +1 -1
- package/dist/server/collections/users-authenticators.js +7 -0
- package/dist/server/migrations/20230506152253-basic-authenticator.js +4 -1
- package/dist/server/migrations/20230607174500-update-basic.js +4 -1
- package/dist/server/migrations/20231218132032-fix-allow-signup.js +4 -1
- package/dist/server/plugin.js +0 -1
- package/dist/server/storer.js +1 -3
- package/dist/server/token-blacklist.js +1 -4
- package/package.json +10 -10
package/dist/client/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
(function(p,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("@tachybase/client"),require("@tachybase/utils/client"),require("react/jsx-runtime"),require("react"),require("react-router-dom"),require("@tachybase/schema"),require("react-i18next"),require("antd"),require("@ant-design/icons")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","@tachybase/utils/client","react/jsx-runtime","react","react-router-dom","@tachybase/schema","react-i18next","antd","@ant-design/icons"],e):(p=typeof globalThis!="undefined"?globalThis:p||self,e(p["@tachybase/module-auth"]={},p["@tachybase/client"],p["@tachybase/utils"],p.jsxRuntime,p.react,p["react-router-dom"],p["@tachybase/schema"],p["react-i18next"],p.antd,p["@ant-design/icons"]))})(this,function(p,e,
|
|
1
|
+
(function(p,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("@tachybase/client"),require("@tachybase/utils/client"),require("react/jsx-runtime"),require("react"),require("react-router-dom"),require("@tachybase/schema"),require("react-i18next"),require("antd"),require("@ant-design/icons")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","@tachybase/utils/client","react/jsx-runtime","react","react-router-dom","@tachybase/schema","react-i18next","antd","@ant-design/icons"],e):(p=typeof globalThis!="undefined"?globalThis:p||self,e(p["@tachybase/module-auth"]={},p["@tachybase/client"],p["@tachybase/utils"],p.jsxRuntime,p.react,p["react-router-dom"],p["@tachybase/schema"],p["react-i18next"],p.antd,p["@ant-design/icons"]))})(this,function(p,e,m,a,u,y,x,h,d,b){"use strict";var le=Object.defineProperty,me=Object.defineProperties;var de=Object.getOwnPropertyDescriptors;var B=Object.getOwnPropertySymbols;var ye=Object.prototype.hasOwnProperty,xe=Object.prototype.propertyIsEnumerable;var U=(p,e,m)=>e in p?le(p,e,{enumerable:!0,configurable:!0,writable:!0,value:m}):p[e]=m,v=(p,e)=>{for(var m in e||(e={}))ye.call(e,m)&&U(p,m,e[m]);if(B)for(var m of B(e))xe.call(e,m)&&U(p,m,e[m]);return p},S=(p,e)=>me(p,de(e));var T=(p,e,m)=>new Promise((a,u)=>{var y=d=>{try{h(m.next(d))}catch(b){u(b)}},x=d=>{try{h(m.throw(d))}catch(b){u(b)}},h=d=>d.done?a(d.value):Promise.resolve(d.value).then(y,x);h((m=m.apply(p,e)).next())});const D="Email/Password",$=t=>{const n=y.useLocation(),o=e.useAPIClient();return u.useEffect(()=>{const s=new URLSearchParams(n.search),r=s.get("authenticator"),i=s.get("token");i&&(o.auth.setToken(i),o.auth.setAuthenticator(r))}),a.jsx(a.Fragment,{children:t.children})},f="auth";function C(){return h.useTranslation([f,"core"],{nsMode:"fallback"})}const A=u.createContext([]);A.displayName="AuthenticatorsContext";const F=t=>u.useContext(A).find(o=>o.name===t);function E(t){var i;const{data:n}=e.useSystemSettings(),o=e.useAPIClient(),{data:s=[],error:r}=e.useRequest(()=>o.resource("authenticators").publicList().then(c=>{var l;return((l=c==null?void 0:c.data)==null?void 0:l.data)||[]}));if(r)throw r;return a.jsxs("div",{style:{maxWidth:320,margin:"0 auto",paddingTop:"20vh"},children:[a.jsx("h1",{children:(i=n==null?void 0:n.data)==null?void 0:i.title}),a.jsx(A.Provider,{value:s,children:a.jsx(y.Outlet,{})}),a.jsx("div",{className:e.css`
|
|
2
2
|
position: absolute;
|
|
3
3
|
bottom: 24px;
|
|
4
4
|
width: 100%;
|
|
5
5
|
left: 0;
|
|
6
6
|
text-align: center;
|
|
7
|
-
`,children:a.jsx(e.PoweredBy,{})})]})}const
|
|
7
|
+
`,children:a.jsx(e.PoweredBy,{})})]})}const N=()=>{var s;const n=e.usePlugin(g).authTypes.getEntities(),o={};for(const[r,i]of n)(s=i.components)!=null&&s.SignInForm&&(o[r]=i.components.SignInForm);return o},q=(t=[])=>{var i;const o=e.usePlugin(g).authTypes.getEntities(),s={};for(const[c,l]of o)(i=l.components)!=null&&i.SignInButton&&(s[c]=l.components.SignInButton);const r=Object.keys(s);return t.filter(c=>r.includes(c.authType)).map((c,l)=>u.createElement(s[c.authType],{key:l,authenticator:c}))},L=()=>{const{t}=C();e.useCurrentDocumentTitle("Signin"),e.useViewport();const n=N(),o=u.useContext(A),s=q(o);if(!o.length)return a.jsx("div",{style:{color:"#ccc"},children:t("No authentication methods available.")});const r=o.map(i=>{const c=n[i.authType];if(!c)return;const l=`${t("Sign-in")} (${t(i.authTypeTitle||i.authType)})`;return v({component:u.createElement(c,{authenticator:i}),tabTitle:i.title||l},i)}).filter(i=>i);return a.jsxs(d.Space,{direction:"vertical",className:e.css`
|
|
8
8
|
display: flex;
|
|
9
9
|
`,children:[r.length>1?a.jsx(d.Tabs,{items:r.map(i=>({label:i.tabTitle,key:i.name,children:i.component}))}):r.length?a.jsx("div",{children:r[0].component}):a.jsx(a.Fragment,{}),a.jsx(d.Space,{direction:"vertical",className:e.css`
|
|
10
10
|
display: flex;
|
|
11
|
-
`,children:s})]})},
|
|
11
|
+
`,children:s})]})},O=u.createContext({});O.displayName="SignupPageContext";const I=()=>{var s;const n=e.usePlugin(g).authTypes.getEntities(),o={};for(const[r,i]of n)(s=i.components)!=null&&s.SignUpForm&&(o[r]=i.components.SignUpForm);return o},j=()=>{e.useViewport(),e.useCurrentDocumentTitle("Signup");const t=I(),[n]=y.useSearchParams(),o=n.get("name"),s=F(o),{authType:r}=s||{};return t[r]?u.createElement(t[r],{authenticatorName:o}):a.jsx(y.Navigate,{to:"/not-found",replace:!0})};function M(t="/admin"){const n=y.useNavigate(),[o]=y.useSearchParams();return u.useCallback(()=>{n(o.get("redirect")||"/admin",{replace:!0})},[n,o])}const k=t=>{const n=x.useForm(),o=e.useAPIClient(),s=M(),{refreshAsync:r}=e.useCurrentUserContext();return{run(){return T(this,null,function*(){yield n.submit(),yield o.auth.signIn(n.values,t),yield r(),s()})}}},_={type:"object",name:"passwordForm","x-component":"FormV2",properties:{account:{type:"string","x-component":"Input","x-validator":`{{(value) => {
|
|
12
12
|
if (!value) {
|
|
13
13
|
return t("Please enter your username or email");
|
|
14
14
|
}
|
|
@@ -19,4 +19,4 @@
|
|
|
19
19
|
} else {
|
|
20
20
|
return /^[^@.<>"'/]{2,16}$/.test(value) || t("Please enter a valid username");
|
|
21
21
|
}
|
|
22
|
-
}}}`,"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:{}}},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%"}}}}},signUp:{type:"void","x-component":"Link","x-component-props":{to:"{{ signUpLink }}"},"x-content":'{{t("Create an account")}}',"x-visible":"{{ allowSignUp }}"}}},K=t=>{const{t:n}=C(),o=t.authenticator,{authType:s,name:r,options:i}=o,m=!!k()[s]&&(i==null?void 0:i.allowSignUp),ue=`/signup?name=${r}`,le=()=>V(r);return a.jsx(e.SchemaComponent,{schema:z,scope:{useBasicSignIn:le,allowSignUp:m,signUpLink:ue,t:n}})},Z=t=>{const n=y.useNavigate(),o=x.useForm(),s=e.useAPIClient(),{t:r}=h.useTranslation();return{run(){return T(this,null,function*(){var c;yield o.submit(),yield s.auth.signUp(o.values,t==null?void 0:t.authenticator),d.message.success(((c=t==null?void 0:t.message)==null?void 0:c.success)||r("Sign up successfully, and automatically jump to the sign in page")),setTimeout(()=>{n("/signin")},2e3)})}}},W={type:"object",name:x.uid(),"x-component":"FormV2",properties:{username:{type:"string",required:!0,"x-component":"Input","x-validator":{username:!0},"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Username")}}',style:{}}},password:{type:"string",required:!0,"x-component":"Password","x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Password")}}',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","x-component-props":{placeholder:'{{t("Confirm password")}}',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")}}'}}}}},G=({authenticatorName:t})=>{const{t:n}=C(),o=()=>Z({authenticator:t}),s=F(t),{options:r}=s;return r!=null&&r.allowSignUp?a.jsx(e.SchemaComponent,{schema:W,scope:{useBasicSignUp:o,t:n}}):a.jsx(y.Navigate,{to:"/not-found",replace:!0})},H=()=>{const{t}=C();return a.jsx(e.SchemaComponent,{scope:{t},components:{Alert:d.Alert},schema:{type:"object",properties:{public:{type:"object",properties:{allowSignUp:{"x-decorator":"FormItem",type:"boolean",title:'{{t("Allow to sign up")}}',"x-component":"Checkbox","x-component-props":{defaultChecked:!0}}}},notice:{type:"void","x-component":"Alert","x-component-props":{showIcon:!0,message:'{{t("The authentication allows users to sign in via username or email.")}}'}}}}})},J=()=>{var s;const n=e.usePlugin(g).authTypes.getEntities(),o={};for(const[r,i]of n)(s=i.components)!=null&&s.BindForm&&(o[r]=i.components.BindForm);return o},Q=()=>{const t=e.useRecord(),o=J()[t.authType];return u.createElement(o,{authenticator:t})},X={type:"void",name:"authenticatorBind","x-decorator":"TableBlockProvider","x-decorator-props":{collection:{name:"authenticators",sortable:!1,fields:[{interface:"input",type:"string",name:"authType"},{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:"bind",uiSchema:{type:"boolean",title:'{{t("Bind")}}',"x-component":"Checkbox"}},{type:"string",name:"nickname",uiSchema:{type:"string",title:'{{t("Nickname")}}',"x-component":"Input"}}]},resource:"authenticators",action:"bindTypes",params:{sort:["sort"]},rowKey:"name",showIndex:!0},"x-component":"div",properties:{table:{type:"array","x-component":"TableV2","x-use-component-props":"useTableBlockProps","x-component-props":{rowKey:"name"},properties:{authType:{title:'{{t("Auth Type")}}',type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{authType:{type:"string","x-component":"Select","x-read-pretty":!0}}},title:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{title:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},description:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{description:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},bind:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{bind:{type:"boolean","x-component":"CollectionField","x-read-pretty":!0}}},nickname:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{nickname:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{t("Actions")}}',"x-component":"TableV2.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{unbind:{"x-visible":'{{ $self.query(".bind").value() }}',type:"void",title:'{{ t("Unbind") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:"{{t('Unbind')}}",content:"{{t('Are you sure to unbind this authenticator?')}}"},useAction:"{{ useUnbindAction }}"}},bind:{"x-visible":'{{ !$self.query(".bind").value() }}',type:"void",title:"{{ t('Bind') }}","x-component":"Action.Link",properties:{modal:{type:"void","x-decorator":"Form",title:"{{ t('Bind') }}","x-component":"Action.Modal","x-component-props":{width:800},properties:{form:{type:"void","x-component":"BindForm"}}}}}}}}}}}}},Y=()=>{const{refreshCM:t}=e.useCollectionManager_deprecated(),n=e.useAPIClient(),o=e.useRecord();return{run(){return T(this,null,function*(){yield n.resource("authenticators").unbind({authenticator:o.name}),t()})}}},R=()=>{const{t}=C();return a.jsx(d.Card,{bordered:!1,children:a.jsx(e.SchemaComponent,{schema:X,components:{BindForm:Q},scope:{t,useUnbindAction:Y}})})},w=u.createContext({type:""});w.displayName="AuthTypeContext";const P=u.createContext({types:[]});P.displayName="AuthTypesContext";const ee=()=>{const{types:t}=u.useContext(P);return t},te=t=>{const n=e.useRecord(),o=e.useRequest(()=>Promise.resolve({data:v({},n.options)}),S(v({},t),{manual:!0})),{run:s}=o,r=e.useActionContext();return u.useEffect(()=>{r.visible&&s()},[r.visible,s]),o},oe=t=>{var s;const o=e.usePlugin(g).authTypes.get(t);return(s=o==null?void 0:o.components)==null?void 0:s.AdminSettingsForm},ne=x.observer(()=>{const t=x.useForm(),n=e.useRecord(),o=oe(t.values.authType||n.authType);return o?a.jsx(o,{}):null},{displayName:"Options"}),B={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":t=>/^[a-zA-Z0-9_-]+$/.test(t)?"":e.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"}}]},re={type:"object",properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues(t){const n=e.useActionContext(),{type:o}=u.useContext(w);return e.useRequest(()=>Promise.resolve({data:{name:`s_${x.uid()}`,authType:o}}),S(v({},t),{refreshDeps:[n.visible]}))}},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-use-component-props":"useCancelActionProps"},create:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"useCreateDatabaseConnectionAction","x-component-props":{type:"primary"}}}}}}}},se={type:"void",name:"authenticators","x-decorator":"TableBlockProvider","x-decorator-props":{collection:B,dragSort:!0,action:"list",params:{pageSize:50,sort:"sort",appends:[]}},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{delete:{type:"void",title:'{{t("Delete")}}',"x-action":"destroy","x-decorator":"ACLActionProvider","x-component":"Action","x-use-component-props":"useBulkDestroyActionProps","x-component-props":{icon:"DeleteOutlined",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:"array","x-uid":"input","x-component":"TableV2","x-use-component-props":"useTableBlockProps","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"}},properties:{id:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{id:{type:"number","x-component":"CollectionField","x-read-pretty":!0}}},name:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{name:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},authType:{title:'{{t("Auth Type")}}',type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{authType:{type:"string","x-component":"Select","x-read-pretty":!0,enum:"{{ types }}"}}},title:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{title:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},description:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{description:{type:"boolean","x-component":"CollectionField","x-read-pretty":!0}}},enabled:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{enabled:{type:"boolean","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{t("Actions")}}',"x-component":"TableV2.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{updateAuthenticator:{type:"void",title:'{{ t("Edit") }}',"x-action":"update","x-component":"Action.Link","x-component-props":{openMode:"drawer",icon:"EditOutlined"},"x-decorator":"ACLActionProvider",properties:{drawer:{type:"void",title:'{{ t("Edit record") }}',"x-component":"Action.Container","x-component-props":{className:"tb-action-popup"},properties:{card:{type:"void","x-acl-action-props":{skipScopeCheck:!1},"x-acl-action":"authenticators:update","x-decorator":"FormBlockProvider","x-use-decorator-props":"useEditFormBlockDecoratorProps","x-decorator-props":{action:"get",dataSource:"main",collection:B},"x-component":"CardItem",properties:{form:{type:"void","x-component":"FormV2","x-use-component-props":"useEditFormBlockProps",properties:{actionBar:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:24}},properties:{cancel:{title:'{{ t("Cancel") }}',"x-component":"Action","x-use-component-props":"useCancelActionProps"},submit:{title:'{{ t("Submit") }}',"x-component":"Action","x-use-component-props":"useUpdateActionProps","x-component-props":{type:"primary"}}}},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"}}}}}}}}},delete:{type:"void",title:'{{ t("Delete") }}',"x-action":"destroy","x-component":"Action.Link","x-use-component-props":"useDestroyActionProps","x-component-props":{confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"}},"x-disabled":"{{ useCanNotDelete() }}"}}}}}}}}},ie=()=>{const{setVisible:t}=e.useActionContext();return{run(){return T(this,null,function*(){t(!1)})}}},ae=()=>{const{t}=h.useTranslation(),[n,o]=u.useState(!1),[s,r]=u.useState(""),i=ee(),c=i.map(m=>S(v({},m),{onClick:()=>{o(!0),r(m.value)}}));return a.jsx(e.ActionContextProvider,{value:{visible:n,setVisible:o},children:a.jsxs(w.Provider,{value:{type:s},children:[a.jsx(d.Dropdown,{menu:{items:c},children:a.jsxs(d.Button,{icon:a.jsx(b.PlusOutlined,{}),type:"primary",children:[t("Add new")," ",a.jsx(b.DownOutlined,{})]})}),a.jsx(e.SchemaComponent,{scope:{useCloseAction:ie,types:i,setType:r},schema:re})]})})},pe=()=>(e.useAsyncData(),!1),ce=()=>{const{t}=C(),[n,o]=u.useState([]),s=e.useAPIClient();return e.useRequest(()=>s.resource("authenticators").listTypes().then(r=>{var c;return(((c=r==null?void 0:r.data)==null?void 0:c.data)||[]).map(m=>({key:m.name,label:t(m.title||m.name),value:m.name}))}),{onSuccess:r=>{o(r)}}),a.jsx(d.Card,{bordered:!1,children:a.jsx(P.Provider,{value:{types:n},children:a.jsx(e.SchemaComponent,{schema:se,components:{AddNew:ae,Options:ne},scope:{types:n,useValuesFromOptions:te,useCanNotDelete:pe,t}})})})};class g extends e.Plugin{constructor(){super(...arguments);D(this,"authTypes",new l.Registry)}registerType(o,s){this.authTypes.register(o,s)}load(){return T(this,null,function*(){this.app.systemSettingsManager.add("system-services."+f,{icon:"LoginOutlined",title:`{{t("Authentication", { ns: "${f}" })}}`,Component:ce,aclSnippet:"pm.auth.authenticators"}),this.app.userSettingsManager.add(f,{icon:"LoginOutlined",title:`{{t("Authentication login bind", { ns: "${f}" })}}`,Component:R,aclSnippet:"pm.auth.authenticators"}),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.app.addComponents({AuthLayout:N,SignInPage:O,SignUpPage:M}),this.app.providers.unshift([E,{}]),this.registerType($,{components:{SignInForm:K,SignUpForm:G,AdminSettingsForm:H}})})}}p.AuthenticatorsContext=A,p.PluginAuthClient=g,p.default=g,p.useAuthenticator=F,p.useSignIn=V,Object.defineProperties(p,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
22
|
+
}}}`,"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:{}}},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%"}}}}},signUp:{type:"void","x-component":"Link","x-component-props":{to:"{{ signUpLink }}"},"x-content":'{{t("Create an account")}}',"x-visible":"{{ allowSignUp }}"}}},z=t=>{const{t:n}=C(),o=t.authenticator,{authType:s,name:r,options:i}=o,l=!!I()[s]&&(i==null?void 0:i.allowSignUp),ce=`/signup?name=${r}`,ue=()=>k(r);return a.jsx(e.SchemaComponent,{schema:_,scope:{useBasicSignIn:ue,allowSignUp:l,signUpLink:ce,t:n}})},K=t=>{const n=y.useNavigate(),o=x.useForm(),s=e.useAPIClient(),{t:r}=h.useTranslation();return{run(){return T(this,null,function*(){var c;yield o.submit(),yield s.auth.signUp(o.values,t==null?void 0:t.authenticator),d.message.success(((c=t==null?void 0:t.message)==null?void 0:c.success)||r("Sign up successfully, and automatically jump to the sign in page")),setTimeout(()=>{n("/signin")},2e3)})}}},Z={type:"object",name:x.uid(),"x-component":"FormV2",properties:{username:{type:"string",required:!0,"x-component":"Input","x-validator":{username:!0},"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Username")}}',style:{}}},password:{type:"string",required:!0,"x-component":"Password","x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Password")}}',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","x-component-props":{placeholder:'{{t("Confirm password")}}',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")}}'}}}}},W=({authenticatorName:t})=>{const{t:n}=C(),o=()=>K({authenticator:t}),s=F(t),{options:r}=s;return r!=null&&r.allowSignUp?a.jsx(e.SchemaComponent,{schema:Z,scope:{useBasicSignUp:o,t:n}}):a.jsx(y.Navigate,{to:"/not-found",replace:!0})},G=()=>{const{t}=C();return a.jsx(e.SchemaComponent,{scope:{t},components:{Alert:d.Alert},schema:{type:"object",properties:{public:{type:"object",properties:{allowSignUp:{"x-decorator":"FormItem",type:"boolean",title:'{{t("Allow to sign up")}}',"x-component":"Checkbox","x-component-props":{defaultChecked:!0}}}},notice:{type:"void","x-component":"Alert","x-component-props":{showIcon:!0,message:'{{t("The authentication allows users to sign in via username or email.")}}'}}}}})},H=()=>{var s;const n=e.usePlugin(g).authTypes.getEntities(),o={};for(const[r,i]of n)(s=i.components)!=null&&s.BindForm&&(o[r]=i.components.BindForm);return o},J=()=>{const t=e.useRecord(),o=H()[t.authType];return u.createElement(o,{authenticator:t})},Q={type:"void",name:"authenticatorBind","x-decorator":"TableBlockProvider","x-decorator-props":{collection:{name:"authenticators",sortable:!1,fields:[{interface:"input",type:"string",name:"authType"},{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:"bind",uiSchema:{type:"boolean",title:'{{t("Bind")}}',"x-component":"Checkbox"}},{type:"string",name:"nickname",uiSchema:{type:"string",title:'{{t("Nickname")}}',"x-component":"Input"}}]},resource:"authenticators",action:"bindTypes",params:{sort:["sort"]},rowKey:"name",showIndex:!0},"x-component":"div",properties:{table:{type:"array","x-component":"TableV2","x-use-component-props":"useTableBlockProps","x-component-props":{rowKey:"name"},properties:{authType:{title:'{{t("Auth Type")}}',type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{authType:{type:"string","x-component":"Select","x-read-pretty":!0}}},title:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{title:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},description:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{description:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},bind:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{bind:{type:"boolean","x-component":"CollectionField","x-read-pretty":!0}}},nickname:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{nickname:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{t("Actions")}}',"x-component":"TableV2.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{unbind:{"x-visible":'{{ $self.query(".bind").value() }}',type:"void",title:'{{ t("Unbind") }}',"x-component":"Action.Link","x-component-props":{confirm:{title:"{{t('Unbind')}}",content:"{{t('Are you sure to unbind this authenticator?')}}"},useAction:"{{ useUnbindAction }}"}},bind:{"x-visible":'{{ !$self.query(".bind").value() }}',type:"void",title:"{{ t('Bind') }}","x-component":"Action.Link",properties:{modal:{type:"void","x-decorator":"Form",title:"{{ t('Bind') }}","x-component":"Action.Modal","x-component-props":{width:800},properties:{form:{type:"void","x-component":"BindForm"}}}}}}}}}}}}},X=()=>{const{refreshCM:t}=e.useCollectionManager_deprecated(),n=e.useAPIClient(),o=e.useRecord();return{run(){return T(this,null,function*(){yield n.resource("authenticators").unbind({authenticator:o.name}),t()})}}},Y=()=>{const{t}=C();return a.jsx(d.Card,{bordered:!1,children:a.jsx(e.SchemaComponent,{schema:Q,components:{BindForm:J},scope:{t,useUnbindAction:X}})})},w=u.createContext({type:""});w.displayName="AuthTypeContext";const P=u.createContext({types:[]});P.displayName="AuthTypesContext";const R=()=>{const{types:t}=u.useContext(P);return t},ee=t=>{const n=e.useRecord(),o=e.useRequest(()=>Promise.resolve({data:v({},n.options)}),S(v({},t),{manual:!0})),{run:s}=o,r=e.useActionContext();return u.useEffect(()=>{r.visible&&s()},[r.visible,s]),o},te=t=>{var s;const o=e.usePlugin(g).authTypes.get(t);return(s=o==null?void 0:o.components)==null?void 0:s.AdminSettingsForm},oe=x.observer(()=>{const t=x.useForm(),n=e.useRecord(),o=te(t.values.authType||n.authType);return o?a.jsx(o,{}):null},{displayName:"Options"}),V={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":t=>/^[a-zA-Z0-9_-]+$/.test(t)?"":e.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"}}]},ne={type:"object",properties:{drawer:{type:"void","x-component":"Action.Drawer","x-decorator":"Form","x-decorator-props":{useValues(t){const n=e.useActionContext(),{type:o}=u.useContext(w);return e.useRequest(()=>Promise.resolve({data:{name:`s_${x.uid()}`,authType:o}}),S(v({},t),{refreshDeps:[n.visible]}))}},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-use-component-props":"useCancelActionProps"},create:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"useCreateDatabaseConnectionAction","x-component-props":{type:"primary"}}}}}}}},re={type:"void",name:"authenticators","x-decorator":"TableBlockProvider","x-decorator-props":{collection:V,dragSort:!0,action:"list",params:{pageSize:50,sort:"sort",appends:[]}},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{delete:{type:"void",title:'{{t("Delete")}}',"x-action":"destroy","x-decorator":"ACLActionProvider","x-component":"Action","x-use-component-props":"useBulkDestroyActionProps","x-component-props":{icon:"DeleteOutlined",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:"array","x-uid":"input","x-component":"TableV2","x-use-component-props":"useTableBlockProps","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"}},properties:{id:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{id:{type:"number","x-component":"CollectionField","x-read-pretty":!0}}},name:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{name:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},authType:{title:'{{t("Auth Type")}}',type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{authType:{type:"string","x-component":"Select","x-read-pretty":!0,enum:"{{ types }}"}}},title:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{title:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},description:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{description:{type:"boolean","x-component":"CollectionField","x-read-pretty":!0}}},enabled:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{enabled:{type:"boolean","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{t("Actions")}}',"x-component":"TableV2.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{updateAuthenticator:{type:"void",title:'{{ t("Edit") }}',"x-action":"update","x-component":"Action.Link","x-component-props":{openMode:"drawer",icon:"EditOutlined"},"x-decorator":"ACLActionProvider",properties:{drawer:{type:"void",title:'{{ t("Edit record") }}',"x-component":"Action.Container","x-component-props":{className:"tb-action-popup"},properties:{card:{type:"void","x-acl-action-props":{skipScopeCheck:!1},"x-acl-action":"authenticators:update","x-decorator":"FormBlockProvider","x-use-decorator-props":"useEditFormBlockDecoratorProps","x-decorator-props":{action:"get",dataSource:"main",collection:V},"x-component":"CardItem",properties:{form:{type:"void","x-component":"FormV2","x-use-component-props":"useEditFormBlockProps",properties:{actionBar:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:24}},properties:{cancel:{title:'{{ t("Cancel") }}',"x-component":"Action","x-use-component-props":"useCancelActionProps"},submit:{title:'{{ t("Submit") }}',"x-component":"Action","x-use-component-props":"useUpdateActionProps","x-component-props":{type:"primary"}}}},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"}}}}}}}}},delete:{type:"void",title:'{{ t("Delete") }}',"x-action":"destroy","x-component":"Action.Link","x-use-component-props":"useDestroyActionProps","x-component-props":{confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"}},"x-disabled":"{{ useCanNotDelete() }}"}}}}}}}}},se=()=>{const{setVisible:t}=e.useActionContext();return{run(){return T(this,null,function*(){t(!1)})}}},ie=()=>{const{t}=h.useTranslation(),[n,o]=u.useState(!1),[s,r]=u.useState(""),i=R(),c=i.map(l=>S(v({},l),{onClick:()=>{o(!0),r(l.value)}}));return a.jsx(e.ActionContextProvider,{value:{visible:n,setVisible:o},children:a.jsxs(w.Provider,{value:{type:s},children:[a.jsx(d.Dropdown,{menu:{items:c},children:a.jsxs(d.Button,{icon:a.jsx(b.PlusOutlined,{}),type:"primary",children:[t("Add new")," ",a.jsx(b.DownOutlined,{})]})}),a.jsx(e.SchemaComponent,{scope:{useCloseAction:se,types:i,setType:r},schema:ne})]})})},ae=()=>(e.useAsyncData(),!1),pe=()=>{const{t}=C(),[n,o]=u.useState([]),s=e.useAPIClient();return e.useRequest(()=>s.resource("authenticators").listTypes().then(r=>{var c;return(((c=r==null?void 0:r.data)==null?void 0:c.data)||[]).map(l=>({key:l.name,label:t(l.title||l.name),value:l.name}))}),{onSuccess:r=>{o(r)}}),a.jsx(d.Card,{bordered:!1,children:a.jsx(P.Provider,{value:{types:n},children:a.jsx(e.SchemaComponent,{schema:re,components:{AddNew:ie,Options:oe},scope:{types:n,useValuesFromOptions:ee,useCanNotDelete:ae,t}})})})};class g extends e.Plugin{constructor(){super(...arguments),this.authTypes=new m.Registry}registerType(n,o){this.authTypes.register(n,o)}load(){return T(this,null,function*(){this.app.systemSettingsManager.add("system-services."+f,{icon:"LoginOutlined",title:`{{t("Authentication", { ns: "${f}" })}}`,Component:pe,aclSnippet:"pm.auth.authenticators"}),this.app.userSettingsManager.add(f,{icon:"LoginOutlined",title:`{{t("Authentication login bind", { ns: "${f}" })}}`,Component:Y,aclSnippet:"pm.auth.authenticators"}),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.app.addComponents({AuthLayout:E,SignInPage:L,SignUpPage:j}),this.app.providers.unshift([$,{}]),this.registerType(D,{components:{SignInForm:z,SignUpForm:W,AdminSettingsForm:G}})})}}p.AuthenticatorsContext=A,p.PluginAuthClient=g,p.default=g,p.useAuthenticator=F,p.useSignIn=k,Object.defineProperties(p,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/externalVersion.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
"react": "18.3.1",
|
|
3
|
-
"@tachybase/client": "0.23.
|
|
3
|
+
"@tachybase/client": "0.23.48",
|
|
4
4
|
"react-router-dom": "6.28.1",
|
|
5
|
-
"@tachybase/utils": "0.23.
|
|
6
|
-
"@tachybase/auth": "0.23.
|
|
7
|
-
"@tachybase/database": "0.23.
|
|
8
|
-
"@tachybase/cache": "0.23.
|
|
9
|
-
"@tachybase/server": "0.23.
|
|
10
|
-
"@tachybase/test": "0.23.
|
|
5
|
+
"@tachybase/utils": "0.23.48",
|
|
6
|
+
"@tachybase/auth": "0.23.48",
|
|
7
|
+
"@tachybase/database": "0.23.48",
|
|
8
|
+
"@tachybase/cache": "0.23.48",
|
|
9
|
+
"@tachybase/server": "0.23.48",
|
|
10
|
+
"@tachybase/test": "0.23.48",
|
|
11
11
|
"antd": "5.22.5",
|
|
12
|
-
"@tachybase/schema": "0.23.
|
|
12
|
+
"@tachybase/schema": "0.23.48",
|
|
13
13
|
"react-i18next": "15.2.0",
|
|
14
14
|
"@ant-design/icons": "5.3.7",
|
|
15
|
-
"@tachybase/actions": "0.23.
|
|
15
|
+
"@tachybase/actions": "0.23.48"
|
|
16
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"cron","description":"Cron jobs for your node","version":"3.3.1","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":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc -b tsconfig.build.json","lint:eslint":"eslint src/ tests/","lint:prettier":"prettier ./**/*.{json,md,yml} --check","lint":"npm run lint:eslint && npm run lint:prettier","lint:fix":"npm run lint:eslint -- --fix && npm run lint:prettier -- --write","test":"jest --coverage","test:watch":"jest --watch --coverage","test:fuzz":"jest --testMatch='**/*.fuzz.ts' --coverage=false --testTimeout=120000","prepare":"husky"},"dependencies":{"@types/luxon":"~3.4.0","luxon":"~3.5.0"},"devDependencies":{"@commitlint/cli":"19.6.0","@eslint/js":"^9.14.0","@fast-check/jest":"2.0.3","@insurgent/commitlint-config":"20.0.0","@insurgent/conventional-changelog-preset":"10.0.0","@semantic-release/changelog":"6.0.3","@semantic-release/commit-analyzer":"13.0.0","@semantic-release/git":"10.0.1","@semantic-release/github":"11.0.1","@semantic-release/npm":"12.0.1","@semantic-release/release-notes-generator":"14.0.1","@types/jest":"29.5.14","@types/node":"20.17.9","@types/sinon":"17.0.3","chai":"4.5.0","eslint":"8.57.1","eslint-config-prettier":"9.1.0","eslint-plugin-jest":"27.9.0","eslint-plugin-prettier":"5.2.1","husky":"9.1.7","jest":"29.7.0","lint-staged":"15.2.10","prettier":"3.3.3","semantic-release":"24.2.0","sinon":"17.0.2","ts-jest":"29.2.5","typescript":"5.7.2","typescript-eslint":"^7.2.0"},"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)","Pierre Cavin <me@sherlox.io> (https://github.com/sheerlox)","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)"],"files":["dist/**/*.js","dist/**/*.d.ts","CHANGELOG.md","LICENSE","README.md"],"lint-staged":{"*.ts":"eslint src/ tests/ --fix","*.{json,md,yml}":"prettier ./**/*.{json,md,yml} --check --write"},"_lastModified":"2025-02-
|
|
1
|
+
{"name":"cron","description":"Cron jobs for your node","version":"3.3.1","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":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc -b tsconfig.build.json","lint:eslint":"eslint src/ tests/","lint:prettier":"prettier ./**/*.{json,md,yml} --check","lint":"npm run lint:eslint && npm run lint:prettier","lint:fix":"npm run lint:eslint -- --fix && npm run lint:prettier -- --write","test":"jest --coverage","test:watch":"jest --watch --coverage","test:fuzz":"jest --testMatch='**/*.fuzz.ts' --coverage=false --testTimeout=120000","prepare":"husky"},"dependencies":{"@types/luxon":"~3.4.0","luxon":"~3.5.0"},"devDependencies":{"@commitlint/cli":"19.6.0","@eslint/js":"^9.14.0","@fast-check/jest":"2.0.3","@insurgent/commitlint-config":"20.0.0","@insurgent/conventional-changelog-preset":"10.0.0","@semantic-release/changelog":"6.0.3","@semantic-release/commit-analyzer":"13.0.0","@semantic-release/git":"10.0.1","@semantic-release/github":"11.0.1","@semantic-release/npm":"12.0.1","@semantic-release/release-notes-generator":"14.0.1","@types/jest":"29.5.14","@types/node":"20.17.9","@types/sinon":"17.0.3","chai":"4.5.0","eslint":"8.57.1","eslint-config-prettier":"9.1.0","eslint-plugin-jest":"27.9.0","eslint-plugin-prettier":"5.2.1","husky":"9.1.7","jest":"29.7.0","lint-staged":"15.2.10","prettier":"3.3.3","semantic-release":"24.2.0","sinon":"17.0.2","ts-jest":"29.2.5","typescript":"5.7.2","typescript-eslint":"^7.2.0"},"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)","Pierre Cavin <me@sherlox.io> (https://github.com/sheerlox)","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)"],"files":["dist/**/*.js","dist/**/*.d.ts","CHANGELOG.md","LICENSE","README.md"],"lint-staged":{"*.ts":"eslint src/ tests/ --fix","*.{json,md,yml}":"prettier ./**/*.{json,md,yml} --check --write"},"_lastModified":"2025-02-21T11:00:38.146Z"}
|
|
@@ -32,6 +32,13 @@ var users_authenticators_default = (0, import_database.defineCollection)({
|
|
|
32
32
|
updatedBy: true,
|
|
33
33
|
logging: true,
|
|
34
34
|
fields: [
|
|
35
|
+
{
|
|
36
|
+
name: "id",
|
|
37
|
+
type: "bigInt",
|
|
38
|
+
autoIncrement: true,
|
|
39
|
+
primaryKey: true,
|
|
40
|
+
allowNull: false
|
|
41
|
+
},
|
|
35
42
|
/**
|
|
36
43
|
* uuid:
|
|
37
44
|
* Unique user id of the authentication method, such as wechat openid, phone number, etc.
|
|
@@ -23,7 +23,10 @@ module.exports = __toCommonJS(basic_authenticator_exports);
|
|
|
23
23
|
var import_server = require("@tachybase/server");
|
|
24
24
|
var import_preset = require("../../preset");
|
|
25
25
|
class AddBasicAuthMigration extends import_server.Migration {
|
|
26
|
-
|
|
26
|
+
constructor() {
|
|
27
|
+
super(...arguments);
|
|
28
|
+
this.appVersion = "<0.14.0-alpha.1";
|
|
29
|
+
}
|
|
27
30
|
async up() {
|
|
28
31
|
const repo = this.context.db.getRepository("authenticators");
|
|
29
32
|
const existed = await repo.count();
|
|
@@ -23,7 +23,10 @@ module.exports = __toCommonJS(update_basic_exports);
|
|
|
23
23
|
var import_server = require("@tachybase/server");
|
|
24
24
|
var import_preset = require("../../preset");
|
|
25
25
|
class UpdateBasicAuthMigration extends import_server.Migration {
|
|
26
|
-
|
|
26
|
+
constructor() {
|
|
27
|
+
super(...arguments);
|
|
28
|
+
this.appVersion = "<0.14.0-alpha.1";
|
|
29
|
+
}
|
|
27
30
|
async up() {
|
|
28
31
|
const SystemSetting = this.context.db.getRepository("systemSettings");
|
|
29
32
|
const setting = await SystemSetting.findOne();
|
|
@@ -23,7 +23,10 @@ module.exports = __toCommonJS(fix_allow_signup_exports);
|
|
|
23
23
|
var import_server = require("@tachybase/server");
|
|
24
24
|
var import_preset = require("../../preset");
|
|
25
25
|
class FixAllowSignUpMigration extends import_server.Migration {
|
|
26
|
-
|
|
26
|
+
constructor() {
|
|
27
|
+
super(...arguments);
|
|
28
|
+
this.appVersion = "<0.18.0-alpha.1";
|
|
29
|
+
}
|
|
27
30
|
async up() {
|
|
28
31
|
var _a;
|
|
29
32
|
const repo = this.context.db.getRepository("authenticators");
|
package/dist/server/plugin.js
CHANGED
|
@@ -42,7 +42,6 @@ var import_authenticator = require("./model/authenticator");
|
|
|
42
42
|
var import_storer = require("./storer");
|
|
43
43
|
var import_token_blacklist = require("./token-blacklist");
|
|
44
44
|
class PluginAuthServer extends import_server.Plugin {
|
|
45
|
-
cache;
|
|
46
45
|
afterAdd() {
|
|
47
46
|
}
|
|
48
47
|
async beforeLoad() {
|
package/dist/server/storer.js
CHANGED
|
@@ -21,10 +21,8 @@ __export(storer_exports, {
|
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(storer_exports);
|
|
23
23
|
class Storer {
|
|
24
|
-
db;
|
|
25
|
-
cache;
|
|
26
|
-
key = "authenticators";
|
|
27
24
|
constructor({ db, cache }) {
|
|
25
|
+
this.key = "authenticators";
|
|
28
26
|
this.db = db;
|
|
29
27
|
this.cache = cache;
|
|
30
28
|
this.db.on("authenticators.afterSave", async (model) => {
|
|
@@ -23,6 +23,7 @@ module.exports = __toCommonJS(token_blacklist_exports);
|
|
|
23
23
|
class TokenBlacklistService {
|
|
24
24
|
constructor(plugin) {
|
|
25
25
|
this.plugin = plugin;
|
|
26
|
+
this.cacheKey = "token-black-list";
|
|
26
27
|
this.repo = plugin.db.getRepository("tokenBlacklist");
|
|
27
28
|
plugin.app.on("beforeStart", async () => {
|
|
28
29
|
try {
|
|
@@ -37,10 +38,6 @@ class TokenBlacklistService {
|
|
|
37
38
|
}
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
|
-
repo;
|
|
41
|
-
cronJob;
|
|
42
|
-
bloomFilter;
|
|
43
|
-
cacheKey = "token-black-list";
|
|
44
41
|
get app() {
|
|
45
42
|
return this.plugin.app;
|
|
46
43
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/module-auth",
|
|
3
3
|
"displayName": "Authentication",
|
|
4
|
-
"version": "0.23.
|
|
4
|
+
"version": "0.23.48",
|
|
5
5
|
"description": "User authentication management, including password, SMS, and support for Single Sign-On (SSO) protocols, with extensibility.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"Authentication"
|
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
"react": "^18.3.1",
|
|
16
16
|
"react-i18next": "^15.2.0",
|
|
17
17
|
"react-router-dom": "6.28.1",
|
|
18
|
-
"@tachybase/schema": "0.23.
|
|
18
|
+
"@tachybase/schema": "0.23.48"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@tachybase/actions": "0.23.
|
|
22
|
-
"@tachybase/auth": "0.23.
|
|
23
|
-
"@tachybase/client": "0.23.
|
|
24
|
-
"@tachybase/cache": "0.23.
|
|
25
|
-
"@tachybase/
|
|
26
|
-
"@tachybase/
|
|
27
|
-
"@tachybase/
|
|
28
|
-
"@tachybase/
|
|
21
|
+
"@tachybase/actions": "0.23.48",
|
|
22
|
+
"@tachybase/auth": "0.23.48",
|
|
23
|
+
"@tachybase/client": "0.23.48",
|
|
24
|
+
"@tachybase/cache": "0.23.48",
|
|
25
|
+
"@tachybase/database": "0.23.48",
|
|
26
|
+
"@tachybase/utils": "0.23.48",
|
|
27
|
+
"@tachybase/test": "0.23.48",
|
|
28
|
+
"@tachybase/server": "0.23.48"
|
|
29
29
|
},
|
|
30
30
|
"description.zh-CN": "用户认证管理,包括基础的密码认证、短信认证、SSO 协议的认证等,可扩展。",
|
|
31
31
|
"displayName.zh-CN": "用户认证",
|