@nocobase/plugin-verification 1.7.0-beta.2 → 1.7.0-beta.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/client/3a77d3f9954a0a50.js +10 -0
  2. package/dist/client/{providerTypes/index.d.ts → VerificationMenu.d.ts} +5 -4
  3. package/dist/client/c88007c6800b52fb.js +10 -0
  4. package/dist/client/index.d.ts +7 -0
  5. package/dist/client/index.js +1 -1
  6. package/dist/client/locale/index.d.ts +1 -1
  7. package/dist/client/otp-verification/VerificationCode.d.ts +16 -0
  8. package/dist/client/otp-verification/sms/AdminSettingsForm.d.ts +12 -0
  9. package/dist/client/otp-verification/sms/BindForm.d.ts +11 -0
  10. package/dist/client/otp-verification/sms/VerificationForm.d.ts +11 -0
  11. package/dist/client/otp-verification/sms/index.d.ts +26 -0
  12. package/dist/client/otp-verification/sms/provider-manager.d.ts +19 -0
  13. package/dist/client/{VerificationProviders.d.ts → otp-verification/sms/providers/AliyunSettings.d.ts} +1 -1
  14. package/dist/{server/actions/index.d.ts → client/otp-verification/sms/providers/TencentSettings.d.ts} +2 -3
  15. package/dist/client/schemas/verificators.d.ts +66 -0
  16. package/dist/client/verification-manager/index.d.ts +32 -0
  17. package/dist/client/{ProviderOptions.d.ts → verificators/VerificatorSelect.d.ts} +1 -2
  18. package/dist/client/verificators/Verificators.d.ts +12 -0
  19. package/dist/client/verificators/verification-types.d.ts +24 -0
  20. package/dist/collections/verificators.d.ts +50 -0
  21. package/dist/collections/verificators.js +70 -0
  22. package/dist/constants.d.ts +11 -0
  23. package/dist/constants.js +42 -0
  24. package/dist/externalVersion.js +13 -13
  25. package/dist/locale/en-US.json +17 -1
  26. package/dist/locale/nl-NL.json +12 -12
  27. package/dist/locale/zh-CN.json +19 -2
  28. package/dist/node_modules/@alicloud/dysmsapi20170525/dist/client.js +2 -2
  29. package/dist/node_modules/@alicloud/dysmsapi20170525/package.json +1 -1
  30. package/dist/node_modules/@alicloud/openapi-client/dist/client.js +2 -2
  31. package/dist/node_modules/@alicloud/openapi-client/package.json +1 -1
  32. package/dist/node_modules/@alicloud/tea-util/dist/client.js +1 -1
  33. package/dist/node_modules/@alicloud/tea-util/package.json +1 -1
  34. package/dist/node_modules/tencentcloud-sdk-nodejs/package.json +1 -1
  35. package/dist/node_modules/tencentcloud-sdk-nodejs/tencentcloud/index.js +2 -2
  36. package/dist/server/Plugin.d.ts +5 -16
  37. package/dist/server/Plugin.js +57 -72
  38. package/dist/server/actions/verificators.d.ts +18 -0
  39. package/dist/server/actions/verificators.js +175 -0
  40. package/dist/server/{actions/verifications.d.ts → collections/otp-records.d.ts} +2 -2
  41. package/dist/server/collections/otp-records.js +75 -0
  42. package/dist/server/collections/users-verificators.d.ts +14 -0
  43. package/dist/server/collections/users-verificators.js +58 -0
  44. package/dist/server/collections/verificators.d.ts +10 -0
  45. package/dist/server/{actions/index.js → collections/verificators.js} +10 -19
  46. package/dist/server/constants.d.ts +0 -2
  47. package/dist/server/constants.js +2 -8
  48. package/dist/server/index.d.ts +5 -2
  49. package/dist/server/index.js +12 -5
  50. package/dist/server/migrations/20250111192640-providers2verificators.d.ts +14 -0
  51. package/dist/server/migrations/20250111192640-providers2verificators.js +83 -0
  52. package/dist/server/otp-verification/index.d.ts +25 -0
  53. package/dist/server/otp-verification/index.js +94 -0
  54. package/dist/server/otp-verification/sms/index.d.ts +37 -0
  55. package/dist/server/otp-verification/sms/index.js +87 -0
  56. package/dist/server/{providers/Provider.d.ts → otp-verification/sms/providers/index.d.ts} +2 -4
  57. package/dist/server/{providers/Provider.js → otp-verification/sms/providers/index.js} +8 -10
  58. package/dist/server/{providers → otp-verification/sms/providers}/sms-aliyun.d.ts +3 -3
  59. package/dist/server/{providers → otp-verification/sms/providers}/sms-aliyun.js +4 -4
  60. package/dist/server/{providers → otp-verification/sms/providers}/sms-tencent.d.ts +3 -3
  61. package/dist/server/{providers → otp-verification/sms/providers}/sms-tencent.js +4 -4
  62. package/dist/server/otp-verification/sms/resource/sms-otp-providers.d.ts +16 -0
  63. package/dist/server/otp-verification/sms/resource/sms-otp-providers.js +41 -0
  64. package/dist/server/otp-verification/sms/resource/sms-otp.d.ts +18 -0
  65. package/dist/server/otp-verification/sms/resource/sms-otp.js +141 -0
  66. package/dist/server/verification-manager.d.ts +68 -0
  67. package/dist/server/verification-manager.js +223 -0
  68. package/dist/server/verification.d.ts +70 -0
  69. package/dist/server/verification.js +70 -0
  70. package/package.json +8 -6
  71. package/dist/client/7551e1f2e04bca2f.js +0 -10
  72. package/dist/client/providerTypes/sms-aliyun.d.ts +0 -66
  73. package/dist/client/providerTypes/sms-tencent.d.ts +0 -66
  74. package/dist/server/actions/verifications.js +0 -146
  75. package/dist/server/providers/index.d.ts +0 -15
  76. package/dist/server/providers/index.js +0 -52
@@ -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_verification=self.webpackChunk_nocobase_plugin_verification||[]).push([["995"],{252:function(e,t,n){n.r(t),n.d(t,{useAdminSettingsForm:function(){return T},Verificators:function(){return E},Settings:function(){return k}});var o=n(156),r=n.n(o),i=n(772),c={type:"void",properties:{drawer:{type:"void",title:'{{ t("Add new") }}',"x-component":"Action.Drawer","x-decorator":"FormV2","x-use-decorator-props":"useCreateFormProps",properties:{name:{type:"string","x-decorator":"FormItem",title:'{{ t("UID") }}',"x-component":"Input","x-validator":function(e){return/^[a-zA-Z0-9_-]+$/.test(e)?"":"a-z, A-Z, 0-9, _, -"}},title:{type:"string","x-decorator":"FormItem",title:'{{ t("Title") }}',"x-component":"Input"},description:{"x-decorator":"FormItem",type:"string",title:'{{ t("Description") }}',"x-component":"Input.TextArea"},options:{type:"object","x-component":"Settings"},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{ t("Cancel") }}',"x-component":"Action","x-use-component-props":"useCancelActionProps"},submit:{title:'{{ t("Submit") }}',"x-component":"Action","x-component-props":{type:"primary"},"x-use-component-props":"useCreateActionProps"}}}}}}},s={type:"void",properties:{card:{type:"void","x-component":"CardItem","x-component-props":{heightMode:"fullHeight"},"x-decorator":"TableBlockProvider","x-decorator-props":{collection:"verificators",action:"list"},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:20}},properties:{refresh:{title:"{{t('Refresh')}}","x-component":"Action","x-use-component-props":"useRefreshActionProps","x-component-props":{icon:"ReloadOutlined"}},bulkDelete:{title:"{{t('Delete')}}","x-action":"destroy","x-component":"Action","x-use-component-props":"useBulkDestroyActionProps","x-component-props":{icon:"DeleteOutlined",confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"}}},add:{type:"void","x-component":"AddNew",title:"{{t('Add new')}}","x-align":"right"}}},table:{type:"array","x-component":"TableV2","x-use-component-props":"useTableBlockProps","x-component-props":{rowKey:"name",rowSelection:{type:"checkbox"}},properties:{column1:{type:"void",title:'{{ t("UID") }}',"x-component":"TableV2.Column",properties:{name:{type:"string","x-component":"Input","x-read-pretty":!0}}},column2:{type:"void",title:'{{ t("Title") }}',"x-component":"TableV2.Column",properties:{title:{type:"string","x-component":"Input","x-read-pretty":!0}}},column3:{type:"void",title:'{{ t("Verification type") }}',"x-component":"TableV2.Column",properties:{verificationType:{type:"string","x-component":"Select","x-read-pretty":!0,enum:"{{ types }}"}}},column4:{type:"void",title:'{{ t("Description") }}',"x-component":"TableV2.Column",properties:{description:{type:"string","x-component":"Input.TextArea","x-component-props":{ellipsis:!0},"x-pattern":"readPretty"}}},column5:{type:"void",title:'{{ t("Actions") }}',"x-decorator":"TableV2.Column.ActionBar","x-component":"TableV2.Column",properties:{actions:{type:"void","x-component":"Space","x-component-props":{split:"|"},properties:{edit:{type:"void",title:'{{ t("Edit") }}',"x-action":"update","x-component":"Action.Link","x-component-props":{openMode:"drawer",icon:"EditOutlined"},properties:{drawer:{type:"void",title:'{{ t("Edit record") }}',"x-component":"Action.Drawer","x-decorator":"FormV2","x-use-decorator-props":"useEditFormProps",properties:{title:{type:"string","x-decorator":"FormItem",title:'{{ t("Title") }}',"x-component":"Input"},description:{"x-decorator":"FormItem",type:"string",title:'{{ t("Description") }}',"x-component":"Input.TextArea"},options:{type:"object","x-component":"Settings"},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{cancel:{title:'{{ t("Cancel") }}',"x-component":"Action","x-use-component-props":"useCancelActionProps"},submit:{title:'{{ t("Submit") }}',"x-component":"Action","x-component-props":{type:"primary"},"x-use-component-props":"useEditActionProps"}}}}}}},destroy:{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?')}}"}}}}}}}}}}}}},p={name:"verificators",autoGenId:!1,fields:[{type:"uid",name:"name",primaryKey:!0},{type:"string",name:"title"},{type:"string",name:"verificationType"},{type:"string",name:"description"},{type:"jsonb",name:"options"},{interface:"m2m",type:"belongsToMany",name:"users",target:"users",foreignKey:"verificator",otherKey:"userId",onDelete:"CASCADE",sourceKey:"name",targetKey:"id",through:"usersVerificators"}]},a=n(573),u=n(721),l=n(482),m=(0,o.createContext)({type:""});m.displayName="VerificationTypeContext";var y=(0,o.createContext)({types:[]});y.displayName="VerificationTypesContext";var f=n(505),d=n(563),v=n(875);function x(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 b(e,t,n,o,r,i,c){try{var s=e[i](c),p=s.value}catch(e){n(e);return}s.done?t(p):Promise.resolve(p).then(o,r)}function g(e){return function(){var t=this,n=arguments;return new Promise(function(o,r){var i=e.apply(t,n);function c(e){b(i,o,r,c,s,"next",e)}function s(e){b(i,o,r,c,s,"throw",e)}c(void 0)})}}function A(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,o,r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],c=!0,s=!1;try{for(r=r.call(e);!(c=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{c||null==r.return||r.return()}finally{if(s)throw o}}return i}}(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.")}()}function h(e,t){var n,o,r,i,c={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){var p=[i,s];if(n)throw TypeError("Generator is already executing.");for(;c;)try{if(n=1,o&&(r=2&p[0]?o.return:p[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,p[1])).done)return r;switch(o=0,r&&(p=[2&p[0],r.value]),p[0]){case 0:case 1:r=p;break;case 4:return c.label++,{value:p[1],done:!1};case 5:c.label++,o=p[1],p=[0];continue;case 7:p=c.ops.pop(),c.trys.pop();continue;default:if(!(r=(r=c.trys).length>0&&r[r.length-1])&&(6===p[0]||2===p[0])){c=0;continue}if(3===p[0]&&(!r||p[1]>r[0]&&p[1]<r[3])){c.label=p[1];break}if(6===p[0]&&c.label<r[1]){c.label=r[1],r=p;break}if(r&&c.label<r[2]){c.label=r[2],c.ops.push(p);break}r[2]&&c.ops.pop(),c.trys.pop();continue}p=t.call(e,c)}catch(e){p=[6,e],o=0}finally{n=r=0}if(5&p[0])throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}}var C=function(){var e=(0,o.useContext)(m).type;return{form:(0,o.useMemo)(function(){return(0,d.createForm)({initialValues:{name:"v_".concat((0,v.uid)()),verificationType:e}})},[e])}},w=function(){var e=(0,i.useCollectionRecordData)();return{form:(0,o.useMemo)(function(){return(0,d.createForm)({initialValues:e})},[e])}},P=function(){var e=(0,i.useActionContext)().setVisible,t=(0,f.useForm)();return{type:"default",onClick:function(){e(!1),t.reset()}}},S=function(){var e=(0,i.useActionContext)().setVisible,t=u.App.useApp().message,n=(0,f.useForm)(),o=(0,i.useDataBlockResource)(),r=(0,i.useDataBlockRequest)().refresh,c=(0,a.SD)().t;return{type:"primary",onClick:function(){return g(function(){var i;return h(this,function(s){switch(s.label){case 0:return[4,n.submit()];case 1:return s.sent(),i=n.values,[4,o.create({values:i})];case 2:return s.sent(),r(),t.success(c("Saved successfully")),e(!1),n.reset(),[2]}})})()}}},D=function(){var e=(0,i.useActionContext)().setVisible,t=u.App.useApp().message,n=(0,f.useForm)(),o=(0,i.useDataBlockResource)(),r=(0,i.useDataBlockRequest)().refresh,c=(0,i.useCollection)().getFilterTargetKey(),s=(0,a.SD)().t;return{type:"primary",onClick:function(){return g(function(){var i;return h(this,function(p){switch(p.label){case 0:return[4,n.submit()];case 1:return p.sent(),i=n.values,[4,o.update({values:i,filterByTk:i[c]})];case 2:return p.sent(),r(),t.success(s("Saved successfully")),e(!1),n.reset(),[2]}})})()}}},O=function(){var e=(0,a.SD)().t,t=A((0,o.useState)(!1),2),n=t[0],s=t[1],p=A((0,o.useState)(""),2),f=p[0],d=p[1],v=(0,o.useContext)(y).types.map(function(e){var t,n;return 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={onClick:function(){s(!0),d(e.value)}},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t});return r().createElement(i.ActionContextProvider,{value:{visible:n,setVisible:s}},r().createElement(m.Provider,{value:{type:f}},r().createElement(u.Dropdown,{menu:{items:v}},r().createElement(u.Button,{icon:r().createElement(l.PlusOutlined,null),type:"primary"},e("Add new")," ",r().createElement(l.DownOutlined,null))),r().createElement(i.SchemaComponent,{scope:{setType:d,useCreateFormProps:C},schema:c})))},T=function(e){var t,n=(0,i.usePlugin)("verification").verificationManager.getVerification(e);return null==n||null==(t=n.components)?void 0:t.AdminSettingsForm},k=(0,f.observer)(function(){var e=(0,f.useForm)(),t=(0,i.useCollectionRecordData)(),n=T(e.values.verificationType||t.verificationType);return n?r().createElement(n,null):null},{displayName:"VerificationSettings"}),E=function(){var e=(0,a.SD)().t,t=A((0,o.useState)([]),2),n=t[0],c=t[1],u=(0,i.useAPIClient)();return(0,i.useRequest)(function(){return u.resource("verificators").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:f.Schema.compile(t.title||t.name,{t:e}),value:t.name}})})},{onSuccess:function(e){c(e)}}),r().createElement(y.Provider,{value:{types:n}},r().createElement(i.ExtendCollectionsProvider,{collections:[p]},r().createElement(i.SchemaComponent,{schema:s,components:{AddNew:O,Settings:k},scope:{types:n,useEditFormProps:w,useCancelActionProps:P,useCreateActionProps:S,useEditActionProps:D}})))}}}]);
@@ -6,7 +6,8 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- import { ISchema } from '@formily/react';
10
- import { Registry } from '@nocobase/utils/client';
11
- declare const providerTypes: Registry<ISchema>;
12
- export default providerTypes;
9
+ import React from 'react';
10
+ export declare const UserVerificatorsContext: React.Context<{
11
+ refresh: () => void;
12
+ }>;
13
+ export declare const Verification: () => React.JSX.Element;
@@ -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_verification=self.webpackChunk_nocobase_plugin_verification||[]).push([["835"],{564:function(e,t,n){n.r(t),n.d(t,{VerificatorSelect:function(){return v}});var i=n(156),a=n.n(i),l=n(505),r=n(721),o=n(772),u=n(573),c=n(128),s=n(632),v=(0,l.connect)(function(e){var t=(0,u.SD)().t,n=e.scene,v=e.value,f=e.title,m=e.onChange,p=e.multiple;p=p?"multiple":void 0;var d=(0,o.useAPIClient)(),h=(0,o.useRequest)(function(){return d.resource("verificators").listByScene({scene:n}).then(function(e){var t;return null==e||null==(t=e.data)?void 0:t.data})}).data||{},g=h.verificators,b=void 0===g?[]:g,E=h.availableTypes,k=(0,i.useMemo)(function(){return null==b?void 0:b.map(function(e){return{label:e.title,value:e.name}})},[b]);return a().createElement(s.FormItem,{label:f||t("Verificators"),extra:a().createElement(a().Fragment,null,t("The following types of verificators are available:"),(void 0===E?[]:E).map(function(e){return l.Schema.compile(e.title,{t:t})}).join(", "),". ",t("Go to")," ",a().createElement(c.Link,{to:"/admin/settings/verification"},t("create verificators")))},a().createElement(r.Select,{allowClear:!0,options:k,value:v,mode:p,onChange:m}))},(0,l.mapReadPretty)(function(){var e,t=(0,l.useField)();return(null==(e=t.value)?void 0:e.length)?a().createElement(o.EllipsisWithTooltip,{ellipsis:!0},t.value.map(function(e){return a().createElement(r.Tag,{key:e.name},e.title)})):null}))}}]);
@@ -7,7 +7,14 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import { Plugin } from '@nocobase/client';
10
+ import { SMS_OTP_VERIFICATION_TYPE } from '../constants';
11
+ import { VerificationManager } from './verification-manager';
12
+ import { SMSOTPProviderManager } from './otp-verification/sms/provider-manager';
10
13
  export declare class PluginVerificationClient extends Plugin {
14
+ verificationManager: VerificationManager;
15
+ smsOTPProviderManager: SMSOTPProviderManager;
11
16
  load(): Promise<void>;
12
17
  }
18
+ export { SMS_OTP_VERIFICATION_TYPE };
19
+ export { UserVerificatorsContext } from './VerificationMenu';
13
20
  export default PluginVerificationClient;
@@ -7,4 +7,4 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@formily/shared"),require("@nocobase/utils/client"),require("@nocobase/client"),require("ahooks"),require("antd"),require("@formily/react"),require("react"),require("@formily/antd-v5")):"function"==typeof define&&define.amd?define("@nocobase/plugin-verification",["react-i18next","@formily/shared","@nocobase/utils/client","@nocobase/client","ahooks","antd","@formily/react","react","@formily/antd-v5"],t):"object"==typeof exports?exports["@nocobase/plugin-verification"]=t(require("react-i18next"),require("@formily/shared"),require("@nocobase/utils/client"),require("@nocobase/client"),require("ahooks"),require("antd"),require("@formily/react"),require("react"),require("@formily/antd-v5")):e["@nocobase/plugin-verification"]=t(e["react-i18next"],e["@formily/shared"],e["@nocobase/utils/client"],e["@nocobase/client"],e.ahooks,e.antd,e["@formily/react"],e.react,e["@formily/antd-v5"])}(self,function(e,t,n,r,o,i,u,c,a){return function(){var f,l,s,p,d,b,y={573:function(e,t,n){"use strict";n.d(t,{A7:function(){return r}}),n(772),n(238);var r="verification"},581:function(e){e.exports=function(e,t){return"undefined"!=typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(e,t),t}},632:function(e){"use strict";e.exports=a},505:function(e){"use strict";e.exports=u},875:function(e){"use strict";e.exports=t},772:function(e){"use strict";e.exports=r},584:function(e){"use strict";e.exports=n},749:function(e){"use strict";e.exports=o},721:function(e){"use strict";e.exports=i},156:function(e){"use strict";e.exports=c},238:function(t){"use strict";t.exports=e}},v={};function h(e){var t=v[e];if(void 0!==t)return t.exports;var n=v[e]={exports:{}};return y[e](n,n.exports,h),n.exports}h.m=y,h.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return h.d(t,{a:t}),t},h.d=function(e,t){for(var n in t)h.o(t,n)&&!h.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},h.f={},h.e=function(e){return Promise.all(Object.keys(h.f).reduce(function(t,n){return h.f[n](e,t),t},[]))},h.u=function(e){return"7551e1f2e04bca2f.js"},h.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),h.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f={},l="@nocobase/plugin-verification:",h.l=function(e,t,n,r){if(f[e]){f[e].push(t);return}if(void 0!==n){for(var o,i,u=document.getElementsByTagName("script"),c=0;c<u.length;c++){var a=u[c];if(a.getAttribute("src")==e||a.getAttribute("data-webpack")==l+n){o=a;break}}}!o&&(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,h.nc&&o.setAttribute("nonce",h.nc),o.setAttribute("data-webpack",l+n),o.src=e),f[e]=[t];var s=function(t,n){o.onerror=o.onload=null,clearTimeout(p);var r=f[e];if(delete f[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},p=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)},h.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},h.p=(!(s=window.__nocobase_public_path__||"/").endsWith("/")&&(s+="/"),s+"static/plugins/@nocobase/plugin-verification/dist/client/"),p={909:0},h.f.j=function(e,t){var n=h.o(p,e)?p[e]:void 0;if(0!==n){if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=p[e]=[t,r]});t.push(n[2]=r);var o=h.p+h.u(e),i=Error();h.l(o,function(t){if(h.o(p,e)&&(0!==(n=p[e])&&(p[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}}},d=function(e,t){var n=t[0],r=t[1],o=t[2],i,u,c=0;if(n.some(function(e){return 0!==p[e]})){for(i in r)h.o(r,i)&&(h.m[i]=r[i]);o&&o(h)}for(e&&e(t);c<n.length;c++)u=n[c],h.o(p,u)&&p[u]&&p[u][0](),p[u]=0},(b=self.webpackChunk_nocobase_plugin_verification=self.webpackChunk_nocobase_plugin_verification||[]).forEach(d.bind(null,0)),b.push=d.bind(null,b.push.bind(b));var m={};return!function(){"use strict";h.r(m),h.d(m,{PluginVerificationClient:function(){return s}});var e=h(772),t=h(573),n=h(581);function r(e,t,n,r,o,i,u){try{var c=e[i](u),a=c.value}catch(e){n(e);return}c.done?t(a):Promise.resolve(a).then(r,o)}function o(e,t,n){return(o=f()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&c(o,n.prototype),o}).apply(null,arguments)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e){var t="function"==typeof Map?new Map:void 0;return(a=function(e){var n;if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return o(e,arguments,u(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),c(r,e)})(e)}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}var l=(0,e.lazy)(function(){return n("imported_-73m02n_component",h.e("478").then(h.bind(h,178)))},"VerificationProviders").VerificationProviders,s=function(e){var n,o,a;function s(){var e,t,n;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,s),e=this,t=s,n=arguments,t=u(t),function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,f()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(s,e),n=s,o=[{key:"load",value:function(){var e,n=this;return(e=function(){return function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}(this,function(e){return n.app.pluginSettingsManager.add(t.A7,{icon:"CheckCircleOutlined",title:'{{t("Verification", { ns: "'.concat(t.A7,'" })}}'),Component:l,aclSnippet:"pm.verification.providers"}),[2]})},function(){var t=this,n=arguments;return new Promise(function(o,i){var u=e.apply(t,n);function c(e){r(u,o,i,c,a,"next",e)}function a(e){r(u,o,i,c,a,"throw",e)}c(void 0)})})()}}],i(n.prototype,o),s}(a(e.Plugin));m.default=s}(),m}()});
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@formily/core"),require("@nocobase/client"),require("@formily/shared"),require("react-router-dom"),require("@formily/antd-v5"),require("react"),require("@formily/react"),require("@nocobase/utils/client"),require("@ant-design/icons"),require("antd"),require("react-i18next")):"function"==typeof define&&define.amd?define("@nocobase/plugin-verification",["@formily/core","@nocobase/client","@formily/shared","react-router-dom","@formily/antd-v5","react","@formily/react","@nocobase/utils/client","@ant-design/icons","antd","react-i18next"],t):"object"==typeof exports?exports["@nocobase/plugin-verification"]=t(require("@formily/core"),require("@nocobase/client"),require("@formily/shared"),require("react-router-dom"),require("@formily/antd-v5"),require("react"),require("@formily/react"),require("@nocobase/utils/client"),require("@ant-design/icons"),require("antd"),require("react-i18next")):e["@nocobase/plugin-verification"]=t(e["@formily/core"],e["@nocobase/client"],e["@formily/shared"],e["react-router-dom"],e["@formily/antd-v5"],e.react,e["@formily/react"],e["@nocobase/utils/client"],e["@ant-design/icons"],e.antd,e["react-i18next"])}(self,function(e,t,n,r,o,i,c,a,u,s,l){return function(){var p,f,m,d,v,y,b={573:function(e,t,n){"use strict";n.d(t,{A7:function(){return o},SD:function(){return i}}),n(772);var r=n(238),o="verification";function i(){return(0,r.useTranslation)([o,"client"],{nsMode:"fallback"})}},581:function(e){e.exports=function(e,t){return"undefined"!=typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(e,t),t}},482:function(e){"use strict";e.exports=u},632:function(e){"use strict";e.exports=o},563:function(t){"use strict";t.exports=e},505:function(e){"use strict";e.exports=c},875:function(e){"use strict";e.exports=n},772:function(e){"use strict";e.exports=t},584:function(e){"use strict";e.exports=a},721:function(e){"use strict";e.exports=s},156:function(e){"use strict";e.exports=i},238:function(e){"use strict";e.exports=l},128:function(e){"use strict";e.exports=r}},h={};function g(e){var t=h[e];if(void 0!==t)return t.exports;var n=h[e]={exports:{}};return b[e](n,n.exports,g),n.exports}g.m=b,g.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return g.d(t,{a:t}),t},g.d=function(e,t){for(var n in t)g.o(t,n)&&!g.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},g.f={},g.e=function(e){return Promise.all(Object.keys(g.f).reduce(function(t,n){return g.f[n](e,t),t},[]))},g.u=function(e){return""+({835:"c88007c6800b52fb",995:"3a77d3f9954a0a50"})[e]+".js"},g.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),g.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},p={},f="@nocobase/plugin-verification:",g.l=function(e,t,n,r){if(p[e])return void p[e].push(t);if(void 0!==n)for(var o,i,c=document.getElementsByTagName("script"),a=0;a<c.length;a++){var u=c[a];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==f+n){o=u;break}}o||(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,g.nc&&o.setAttribute("nonce",g.nc),o.setAttribute("data-webpack",f+n),o.src=e),p[e]=[t];var s=function(t,n){o.onerror=o.onload=null,clearTimeout(l);var r=p[e];if(delete p[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(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)},g.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(m=window.__nocobase_public_path__||"/").endsWith("/")||(m+="/"),g.p=m+"static/plugins/@nocobase/plugin-verification/dist/client/",d={909:0},g.f.j=function(e,t){var n=g.o(d,e)?d[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=d[e]=[t,r]});t.push(n[2]=r);var o=g.p+g.u(e),i=Error();g.l(o,function(t){if(g.o(d,e)&&(0!==(n=d[e])&&(d[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},v=function(e,t){var n,r,o=t[0],i=t[1],c=t[2],a=0;if(o.some(function(e){return 0!==d[e]})){for(n in i)g.o(i,n)&&(g.m[n]=i[n]);c&&c(g)}for(e&&e(t);a<o.length;a++)r=o[a],g.o(d,r)&&d[r]&&d[r][0](),d[r]=0},(y=self.webpackChunk_nocobase_plugin_verification=self.webpackChunk_nocobase_plugin_verification||[]).forEach(v.bind(null,0)),y.push=v.bind(null,y.push.bind(y));var x={};return!function(){"use strict";g.r(x),g.d(x,{UserVerificatorsContext:function(){return q},default:function(){return et},PluginVerificationClient:function(){return ee},SMS_OTP_VERIFICATION_TYPE:function(){return n}});var e=g(772),t=g(573),n="sms-otp",r=g(584),o=function(){var e;function t(){var e,n;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");e="verifications",n=new r.Registry,e in this?Object.defineProperty(this,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):this[e]=n}return e=[{key:"registerVerificationType",value:function(e,t){this.verifications.register(e,t)}},{key:"getVerification",value:function(e){return this.verifications.get(e)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(t.prototype,e),t}(),i=g(156),c=g.n(i),a={type:"object",properties:{accessKeyId:{title:'{{t("Access Key ID", { ns: "'.concat(t.A7,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},accessKeySecret:{title:'{{t("Access Key Secret", { ns: "'.concat(t.A7,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0},required:!0},endpoint:{title:'{{t("Endpoint", { ns: "'.concat(t.A7,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},sign:{title:'{{t("Sign", { ns: "'.concat(t.A7,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},template:{title:'{{t("Template code", { ns: "'.concat(t.A7,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0}}},u={type:"object",properties:{secretId:{title:'{{t("Secret Id", { ns: "'.concat(t.A7,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},secretKey:{title:'{{t("Secret Key", { ns: "'.concat(t.A7,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope","x-component-props":{password:!0},required:!0},region:{title:'{{t("Region", { ns: "'.concat(t.A7,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},endpoint:{title:'{{t("Endpoint", { ns: "'.concat(t.A7,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",default:"sms.tencentcloudapi.com"},SignName:{title:'{{t("Sign name", { ns: "'.concat(t.A7,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope"},SmsSdkAppId:{title:'{{t("Sms sdk app id", { ns: "'.concat(t.A7,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0},TemplateId:{title:'{{t("Template Id", { ns: "'.concat(t.A7,'" })}}'),type:"string","x-decorator":"FormItem","x-component":"TextAreaWithGlobalScope",required:!0}}},s=g(505),l=g(721),p=g(238);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 m(e,t,n,r,o,i,c){try{var a=e[i](c),u=a.value}catch(e){n(e);return}a.done?t(u):Promise.resolve(u).then(r,o)}function d(){var e,t,n=(e=["\n display: flex;\n gap: 0.5em;\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return d=function(){return n},n}var v=(0,e.withDynamicSchemaProps)(function(t){var n,r=t.actionType,o=t.verificator,a=t.value,u=t.onChange,v=t.isLogged,y=(0,p.useTranslation)().t,b=(0,e.useAPIClient)(),h=(0,s.useForm)(),g=(n=(0,i.useState)(0),function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],c=!0,a=!1;try{for(o=o.call(e);!(c=(n=o.next()).done)&&(i.push(n.value),i.length!==t);c=!0);}catch(e){a=!0,r=e}finally{try{c||null==o.return||o.return()}finally{if(a)throw r}}return i}}(n,2)||function(e,t){if(e){if("string"==typeof e)return f(e,2);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 f(e,t)}}(n,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.")}()),x=g[0],S=g[1],P=(0,i.useRef)(null);function A(){var e;return e=function(){var e,t;return function(e,t){var n,r,o,i,c={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 u=[i,a];if(n)throw TypeError("Generator is already executing.");for(;c;)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 c.label++,{value:u[1],done:!1};case 5:c.label++,r=u[1],u=[0];continue;case 7:u=c.ops.pop(),c.trys.pop();continue;default:if(!(o=(o=c.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){c=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){c.label=u[1];break}if(6===u[0]&&c.label<o[1]){c.label=o[1],o=u;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(u);break}o[2]&&c.ops.pop(),c.trys.pop();continue}u=t.call(e,c)}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(n){switch(n.label){case 0:if(x>0)return[2];e=v?"create":"publicCreate",n.label=1;case 1:return n.trys.push([1,3,,4]),[4,b.resource("smsOTP")[e]({values: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}({action:r,verificator:o},h.values)})];case 2:return t=n.sent().data.data,l.message.success(y("Operation succeeded")),a&&u(""),S(t.expiresAt?Math.ceil((Date.parse(t.expiresAt)-Date.now())/1e3):60),P.current=setInterval(function(){S(function(e){return e-1})},1e3),[3,4];case 3:return console.error(n.sent()),[3,4];case 4:return[2]}})},(A=function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function c(e){m(i,r,o,c,a,"next",e)}function a(e){m(i,r,o,c,a,"throw",e)}c(void 0)})}).apply(this,arguments)}return(0,i.useEffect)(function(){x<=0&&P.current&&clearInterval(P.current)},[x]),c().createElement("fieldset",{className:(0,e.css)(d())},c().createElement(l.Input,{value:a,onChange:u}),c().createElement(l.Button,{onClick:function(){return A.apply(this,arguments)},disabled:x>0},x>0?y("Retry after {{count}} seconds",{count:x}):y("Send code")))},{displayName:"VerificationCode"}),y={type:"void",name:"sms-otp",properties:{uuid:{type:"string",required:!0,"x-component":"Input","x-decorator":"FormItem",title:'{{t("Phone")}}',"x-component-props":{style:{}},"x-read-pretty":"{{ phone ? true : false }}",default:"{{ phone }}"},code:{type:"string",required:!0,title:'{{t("Verification code")}}',"x-component":"VerificationCode","x-use-component-props":"useVerificationCodeProps","x-decorator":"FormItem"}}},b=function(t){var n,r=(0,e.usePlugin)("verification").smsOTPProviderManager.getProvider(t);return null==r||null==(n=r.components)?void 0:n.AdminSettingsForm},h=(0,s.observer)(function(){var e,t=b(null==(e=(0,s.useForm)().values.options)?void 0:e.provider);return t?c().createElement(t,null):null},{displayName:"SMSOTPVerificationSettings"}),S={type:"void",name:"sms-otp",properties:{uuid:{type:"string",required:!0,"x-component":"Input","x-decorator":"FormItem",title:'{{t("Phone")}}',"x-component-props":{style:{}}},code:{type:"string",required:!0,title:'{{t("Verification code")}}',"x-component":"VerificationCode","x-component-props":{targetFieldName:"phone",actionType:"{{ actionType }}",verificator:"{{ verificator }}"},"x-decorator":"FormItem"}}},P={components:{VerificationForm:function(t){var n=t.verificator,r=t.actionType,o=t.boundInfo,i=t.isLogged;return c().createElement(e.SchemaComponent,{schema:y,scope:{phone:null==o?void 0:o.publicInfo,useVerificationCodeProps:function(){return{actionType:r,verificator:n,isLogged:i}}},components:{VerificationCode:v}})},AdminSettingsForm:function(){return c().createElement(e.SchemaComponent,{components:{Settings:h},schema:{type:"void",properties:{provider:{title:(0,r.tval)("Provider",{ns:t.A7}),type:"string",required:!0,"x-decorator":"FormItem","x-component":"RemoteSelect","x-component-props":{manual:!1,fieldNames:{label:"title",value:"name"},service:{resource:"smsOTPProviders"}}},settings:{type:"object","x-component":"Settings"}}}})},BindForm:function(t){var n=t.verificator,r=t.actionType;return c().createElement(e.SchemaComponent,{scope:{verificator:n,actionType:r},schema:S,components:{VerificationCode:v}})}}},A={components:{AdminSettingsForm:function(){return c().createElement(e.SchemaComponent,{schema:a})}}},w={components:{AdminSettingsForm:function(){return c().createElement(e.SchemaComponent,{schema:u})}}},C=function(){var e;function t(){var e,n;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");e="providers",n=new r.Registry,e in this?Object.defineProperty(this,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):this[e]=n}return e=[{key:"registerProvider",value:function(e,t){this.providers.register(e,t)}},{key:"getProvider",value:function(e){return this.providers.get(e)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(t.prototype,e),t}(),T=g(875),E=g(563);function I(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,n,r,o,i,c){try{var a=e[i](c),u=a.value}catch(e){n(e);return}a.done?t(u):Promise.resolve(u).then(r,o)}function j(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function c(e){O(i,r,o,c,a,"next",e)}function a(e){O(i,r,o,c,a,"throw",e)}c(void 0)})}}function k(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V(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){k(e,t,n[t])})}return e}function F(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],c=!0,a=!1;try{for(o=o.call(e);!(c=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);c=!0);}catch(e){a=!0,r=e}finally{try{c||null==o.return||o.return()}finally{if(a)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return I(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 I(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 _(e,t){var n,r,o,i,c={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 u=[i,a];if(n)throw TypeError("Generator is already executing.");for(;c;)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 c.label++,{value:u[1],done:!1};case 5:c.label++,r=u[1],u=[0];continue;case 7:u=c.ops.pop(),c.trys.pop();continue;default:if(!(o=(o=c.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){c=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){c.label=u[1];break}if(6===u[0]&&c.label<o[1]){c.label=o[1],o=u;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(u);break}o[2]&&c.ops.pop(),c.trys.pop();continue}u=t.call(e,c)}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}}}}var q=(0,i.createContext)(null),M=function(n){var r=(0,s.useForm)(),o=(0,e.useAPIClient)(),c=(0,t.SD)().t,a=(0,i.useContext)(q).refresh,u=(0,e.useActionContext)().setVisible;return{type:"primary",htmlType:"submit",onClick:j(function(){return _(this,function(e){switch(e.label){case 0:return[4,r.submit()];case 1:return e.sent(),[4,o.resource("verificators").bind({values:V({verificator:n},r.values)})];case 2:return e.sent(),l.message.success(c("Bound successfully")),u(!1),a(),[2]}})})}},D=function(){var n=(0,s.useForm)(),r=(0,e.useAPIClient)(),o=(0,t.SD)().t,c=(0,i.useContext)(q).refresh,a=(0,e.useActionContext)().setVisible;return{type:"primary",htmlType:"submit",onClick:j(function(){return _(this,function(e){switch(e.label){case 0:return[4,n.submit()];case 1:return e.sent(),[4,r.resource("verificators").unbind({values:V({},n.values)})];case 2:return e.sent(),l.message.success(o("Unbound successfully")),a(!1),c(),[2]}})})}},G=function(){var t=(0,e.useActionContext)().setVisible;return{onClick:function(){t(!1)}}},B=function(n){var r,o=n.verificator,i=(0,t.SD)().t,a=(0,e.usePlugin)("verification");if(!o)return null;var u=a.verificationManager.getVerification(o.verificationType),s=null==u||null==(r=u.components)?void 0:r.BindForm;return c().createElement(e.SchemaComponent,{components:{C:s},scope:{useBindActionProps:function(){return M(o.name)},useCancelActionProps:G},schema:{type:"void",properties:k({},(0,T.uid)(),{type:"object","x-component":"Action.Modal","x-component-props":{width:520},title:i(o.title),"x-decorator":"FormV2",properties:{form:{type:"void","x-component":"C","x-component-props":{verificator:o.name,actionType:"verificators:bind",isLogged:!0}},footer:{type:"void","x-component":"Action.Modal.Footer",properties:{close:{title:i("Cancel"),"x-component":"Action","x-component-props":{type:"default"},"x-use-component-props":"useCancelActionProps"},submit:{title:i("Bind"),"x-component":"Action","x-use-component-props":"useBindActionProps"}}}}})}})},L=function(n){var r=n.verificators,o=n.unbindVerificator,a=(0,t.SD)().t,u=(0,e.usePlugin)("verification"),p=r.map(function(t){var n,r=u.verificationManager.getVerification(t.verificationType),l=null==r||null==(n=r.components)?void 0:n.VerificationForm;if(l){var p=s.Schema.compile(t.verificationTypeTitle||t.verificationType,{t:a});return V({component:c().createElement(e.SchemaComponent,{components:{C:l},scope:{useCancelActionProps:G,useUnbindActionProps:D,useFormProps:function(){var e;return e=t.name,{form:(0,i.useMemo)(function(){return(0,E.createForm)({initialValues:{verificator:e,unbindVerificator:o}})},[e,o])}}},schema:{type:"void",properties:{form:{type:"object","x-component":"FormV2","x-use-component-props":"useFormProps",properties:{bind:{type:"void","x-component":"C","x-component-props":{actionType:"verificators:unbind",verificator:t.name,boundInfo:t.boundInfo,isLogged:!0}},footer:{type:"void","x-component":"Action.Modal.FootBar",properties:{close:{title:a("Cancel"),"x-component":"Action","x-component-props":{type:"default"},"x-use-component-props":"useCancelActionProps"},submit:{title:a("Unbind"),"x-component":"Action","x-use-component-props":"useUnbindActionProps"}}}}}}}}),tabTitle:t.title||p},t)}}).filter(function(e){return e});return c().createElement(c().Fragment,null,p.length?c().createElement(l.Tabs,{destroyInactiveTabPane:!0,items:p.map(function(e){return{label:e.tabTitle,key:e.name,children:e.component}})}):null)},R=function(n){var r=n.verificator,o=(0,t.SD)().t,i=(0,e.useAPIClient)(),a=(0,e.useRequest)(function(){return i.resource("verificators").listForVerify({scene:"unbind-verificator"}).then(function(e){var t;return null==e||null==(t=e.data)?void 0:t.data})},{refreshDeps:[r]}),u=a.data,s=a.loading;return!r||s?null:c().createElement(e.SchemaComponent,{components:{UnbindForm:L},schema:{type:"void",properties:k({},(0,T.uid)(),{type:"object","x-component":"Action.Modal","x-component-props":{width:520},title:o("Unbind verificator"),properties:k({},(0,T.uid)(),{type:"void","x-component":"UnbindForm","x-component-props":{verificators:u,unbindVerificator:r.name}})})}})},U=function(){var n=(0,t.SD)().t,r=(0,e.useAPIClient)(),o=(0,e.useRequest)(function(){return r.resource("verificators").listByUser().then(function(e){var t;return null==e||null==(t=e.data)?void 0:t.data})}),a=o.data,u=o.refresh,p=F((0,i.useState)(!1),2),f=p[0],m=p[1],d=F((0,i.useState)(!1),2),v=d[0],y=d[1],b=F((0,i.useState)(null),2),h=b[0],g=b[1],x=function(e){m(!0),g(e)},S=function(e){y(!0),g(e)};return c().createElement(q.Provider,{value:{refresh:u}},c().createElement(l.List,{bordered:!0,dataSource:a,renderItem:function(e){var t,r,o;return c().createElement(l.List.Item,{actions:(null==(t=e.boundInfo)?void 0:t.bound)?[c().createElement("a",{key:"unbind",onClick:function(){return S(e)}},n("Unbind"))]:[c().createElement("a",{key:"bind",onClick:function(){return x(e)}},n("Bind"))]},c().createElement(l.List.Item.Meta,{title:c().createElement(c().Fragment,null,s.Schema.compile(e.title,{t:n}),(null==(r=e.boundInfo)?void 0:r.bound)?c().createElement(l.Tag,{color:"success",style:{marginLeft:"10px"}},n("Configured")):c().createElement(l.Tag,{color:"warning",style:{marginLeft:"10px"}},n("Not configured"))),description:s.Schema.compile(e.description,{t:n})}),c().createElement("div",{style:{marginLeft:"10px"}},null==(o=e.boundInfo)?void 0:o.publicInfo))}}),c().createElement(e.ActionContextProvider,{value:{visible:f,setVisible:m}},f?c().createElement(B,{verificator:h}):null),c().createElement(e.ActionContextProvider,{value:{visible:v,setVisible:y}},v?c().createElement(R,{verificator:h}):null))},W=function(){var n=(0,i.useContext)(e.DropdownVisibleContext),r=F((0,i.useState)(!1),2),o=r[0],a=r[1],u=(0,t.SD)().t,s=(0,e.useZIndexContext)()+10,l=(0,i.useCallback)(function(e){var t;e.stopPropagation(),null==n||null==(t=n.setVisible)||t.call(n,!1),a(function(e){return!e||e})},[n]),p=(0,i.useMemo)(function(){return c().createElement(e.SchemaComponent,{components:{Verificators:U},schema:{type:"object",properties:k({},(0,T.uid)(),{"x-component":"Action.Drawer","x-component-props":{zIndex:s},type:"void",title:'{{t("Verification")}}',properties:{form:{type:"void","x-component":"Verificators"}}})}})},[s]);return c().createElement(e.zIndexContext.Provider,{value:s},c().createElement(e.SchemaSettingsItem,{eventKey:"Verification",title:"Verification"},c().createElement("div",{onClick:l},u("Verification"))),c().createElement(e.ActionContextProvider,{value:{visible:o,setVisible:a}},o&&c().createElement("div",{onClick:function(e){return e.stopPropagation()}},p)))},N=g(581);function z(e,t,n,r,o,i,c){try{var a=e[i](c),u=a.value}catch(e){n(e);return}a.done?t(u):Promise.resolve(u).then(r,o)}function K(e,t,n){return(K=J()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&Z(o,n.prototype),o}).apply(null,arguments)}function $(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y(e){return(Y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Z(e,t){return(Z=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function H(e){var t="function"==typeof Map?new Map:void 0;return(H=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return K(e,arguments,Y(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Z(n,e)})(e)}function J(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(J=function(){return!!e})()}var Q=(0,e.lazy)(function(){return N("imported_4g78mb_component",g.e("995").then(g.bind(g,252)))},"Verificators").Verificators,X=(0,e.lazy)(function(){return N("imported_e2nirj_component",g.e("835").then(g.bind(g,564)))},"VerificatorSelect").VerificatorSelect,ee=function(e){var r;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function i(){var e,t,n;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");return t=i,n=arguments,t=Y(t),$(e=function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,J()?Reflect.construct(t,n||[],Y(this).constructor):t.apply(this,n)),"verificationManager",new o),$(e,"smsOTPProviderManager",new C),e}return i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),e&&Z(i,e),r=[{key:"load",value:function(){var e,r=this;return(e=function(){return function(e,t){var n,r,o,i,c={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 u=[i,a];if(n)throw TypeError("Generator is already executing.");for(;c;)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 c.label++,{value:u[1],done:!1};case 5:c.label++,r=u[1],u=[0];continue;case 7:u=c.ops.pop(),c.trys.pop();continue;default:if(!(o=(o=c.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){c=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){c.label=u[1];break}if(6===u[0]&&c.label<o[1]){c.label=o[1],o=u;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(u);break}o[2]&&c.ops.pop(),c.trys.pop();continue}u=t.call(e,c)}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(e){return r.app.pluginSettingsManager.add(t.A7,{icon:"CheckCircleOutlined",title:'{{t("Verification", { ns: "'.concat(t.A7,'" })}}'),Component:Q,aclSnippet:"pm.verification.verificators"}),r.app.addComponents({VerificatorSelect:X}),r.app.addUserCenterSettingsItem({name:"verification",Component:W,sort:150}),r.verificationManager.registerVerificationType(n,P),r.smsOTPProviderManager.registerProvider("sms-aliyun",A),r.smsOTPProviderManager.registerProvider("sms-tencent",w),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function c(e){z(i,r,o,c,a,"next",e)}function a(e){z(i,r,o,c,a,"throw",e)}c(void 0)})})()}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(i.prototype,r),i}(H(e.Plugin)),et=ee}(),x}()});
@@ -8,4 +8,4 @@
8
8
  */
9
9
  export declare const NAMESPACE = "verification";
10
10
  export declare function lang(key: string): string;
11
- export declare function useVerificationTranslation(): import("react-i18next").UseTranslationResponse<"verification", undefined>;
11
+ export declare function useVerificationTranslation(): import("react-i18next").UseTranslationResponse<("verification" | "client")[], undefined>;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ export declare const VerificationCode: React.FC<{
11
+ actionType: string;
12
+ verificator: string;
13
+ value: string;
14
+ onChange: (value: any) => void;
15
+ isLogged?: boolean;
16
+ }>;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ export declare const useAdminSettingsForm: (providerType: string) => any;
11
+ export declare const Settings: React.MemoExoticComponent<import("@formily/react").ReactFC<unknown>>;
12
+ export declare const AdminSettingsForm: React.FC;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ import { BindFormProps } from '../../verification-manager';
11
+ export declare const BindForm: (props: BindFormProps) => React.JSX.Element;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ import { VerificationFormProps } from '../../verification-manager';
11
+ export declare const VerificationForm: (props: VerificationFormProps) => React.JSX.Element;
@@ -0,0 +1,26 @@
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
+ /// <reference types="react" />
10
+ export declare const smsOTPVerificationOptions: {
11
+ components: {
12
+ VerificationForm: (props: import("../../verification-manager").VerificationFormProps) => import("react").JSX.Element;
13
+ AdminSettingsForm: import("react").FC<{}>;
14
+ BindForm: (props: import("../../verification-manager").BindFormProps) => import("react").JSX.Element;
15
+ };
16
+ };
17
+ export declare const smsAliyunProviderOptions: {
18
+ components: {
19
+ AdminSettingsForm: import("react").FC<{}>;
20
+ };
21
+ };
22
+ export declare const smsTencentProviderOptions: {
23
+ components: {
24
+ AdminSettingsForm: import("react").FC<{}>;
25
+ };
26
+ };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { ComponentType } from 'react';
10
+ export type SMSOTPProviderOptions = {
11
+ components: {
12
+ AdminSettingsForm: ComponentType;
13
+ };
14
+ };
15
+ export declare class SMSOTPProviderManager {
16
+ providers: any;
17
+ registerProvider(type: string, options: SMSOTPProviderOptions): void;
18
+ getProvider(type: string): any;
19
+ }
@@ -7,4 +7,4 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import React from 'react';
10
- export declare function VerificationProviders(): React.JSX.Element;
10
+ export declare const AliyunSettings: React.FC;
@@ -6,6 +6,5 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- export default function ({ app }: {
10
- app: any;
11
- }): void;
9
+ import React from 'react';
10
+ export declare const TencentSettings: React.FC;
@@ -0,0 +1,66 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { ISchema } from '@formily/react';
10
+ export declare const createVerificatorSchema: {
11
+ type: string;
12
+ properties: {
13
+ drawer: {
14
+ type: string;
15
+ title: string;
16
+ 'x-component': string;
17
+ 'x-decorator': string;
18
+ 'x-use-decorator-props': string;
19
+ properties: {
20
+ name: {
21
+ type: string;
22
+ 'x-decorator': string;
23
+ title: string;
24
+ 'x-component': string;
25
+ 'x-validator': (value: string) => "" | "a-z, A-Z, 0-9, _, -";
26
+ };
27
+ title: {
28
+ type: string;
29
+ 'x-decorator': string;
30
+ title: string;
31
+ 'x-component': string;
32
+ };
33
+ description: {
34
+ 'x-decorator': string;
35
+ type: string;
36
+ title: string;
37
+ 'x-component': string;
38
+ };
39
+ options: {
40
+ type: string;
41
+ 'x-component': string;
42
+ };
43
+ footer: {
44
+ type: string;
45
+ 'x-component': string;
46
+ properties: {
47
+ cancel: {
48
+ title: string;
49
+ 'x-component': string;
50
+ 'x-use-component-props': string;
51
+ };
52
+ submit: {
53
+ title: string;
54
+ 'x-component': string;
55
+ 'x-component-props': {
56
+ type: string;
57
+ };
58
+ 'x-use-component-props': string;
59
+ };
60
+ };
61
+ };
62
+ };
63
+ };
64
+ };
65
+ };
66
+ export declare const verficatorsSchema: ISchema;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { ComponentType } from 'react';
10
+ export type VerificationFormProps = {
11
+ verificator: string;
12
+ actionType: string;
13
+ boundInfo: any;
14
+ isLogged?: boolean;
15
+ };
16
+ export type BindFormProps = {
17
+ verificator: string;
18
+ actionType: string;
19
+ isLogged?: boolean;
20
+ };
21
+ export type VerificationTypeOptions = {
22
+ components: {
23
+ AdminSettingsForm?: ComponentType;
24
+ VerificationForm: ComponentType<VerificationFormProps>;
25
+ BindForm?: ComponentType<BindFormProps>;
26
+ };
27
+ };
28
+ export declare class VerificationManager {
29
+ verifications: any;
30
+ registerVerificationType(type: string, options: VerificationTypeOptions): void;
31
+ getVerification(type: string): any;
32
+ }
@@ -7,5 +7,4 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import React from 'react';
10
- declare const Verification: React.MemoExoticComponent<import("@formily/react").ReactFC<unknown>>;
11
- export default Verification;
10
+ export declare const VerificatorSelect: React.ForwardRefExoticComponent<Omit<Partial<any>, "ref"> & React.RefAttributes<unknown>>;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ export declare const useAdminSettingsForm: (verificationType: string) => any;
11
+ export declare const Settings: React.MemoExoticComponent<import("@formily/react").ReactFC<unknown>>;
12
+ export declare const Verificators: React.FC;
@@ -0,0 +1,24 @@
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
+ /// <reference types="react" />
10
+ export declare const VerificationTypeContext: import("react").Context<{
11
+ type: string;
12
+ }>;
13
+ export declare const VerificationTypesContext: import("react").Context<{
14
+ types: {
15
+ key: string;
16
+ label: string;
17
+ value: string;
18
+ }[];
19
+ }>;
20
+ export declare const useVerificationTypes: () => {
21
+ key: string;
22
+ label: string;
23
+ value: string;
24
+ }[];
@@ -0,0 +1,50 @@
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
+ declare const _default: {
10
+ name: string;
11
+ autoGenId: boolean;
12
+ fields: ({
13
+ type: string;
14
+ name: string;
15
+ primaryKey: boolean;
16
+ interface?: undefined;
17
+ target?: undefined;
18
+ foreignKey?: undefined;
19
+ otherKey?: undefined;
20
+ onDelete?: undefined;
21
+ sourceKey?: undefined;
22
+ targetKey?: undefined;
23
+ through?: undefined;
24
+ } | {
25
+ type: string;
26
+ name: string;
27
+ primaryKey?: undefined;
28
+ interface?: undefined;
29
+ target?: undefined;
30
+ foreignKey?: undefined;
31
+ otherKey?: undefined;
32
+ onDelete?: undefined;
33
+ sourceKey?: undefined;
34
+ targetKey?: undefined;
35
+ through?: undefined;
36
+ } | {
37
+ interface: string;
38
+ type: string;
39
+ name: string;
40
+ target: string;
41
+ foreignKey: string;
42
+ otherKey: string;
43
+ onDelete: string;
44
+ sourceKey: string;
45
+ targetKey: string;
46
+ through: string;
47
+ primaryKey?: undefined;
48
+ })[];
49
+ };
50
+ export default _default;
@@ -0,0 +1,70 @@
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
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var verificators_exports = {};
28
+ __export(verificators_exports, {
29
+ default: () => verificators_default
30
+ });
31
+ module.exports = __toCommonJS(verificators_exports);
32
+ var verificators_default = {
33
+ name: "verificators",
34
+ autoGenId: false,
35
+ fields: [
36
+ {
37
+ type: "uid",
38
+ name: "name",
39
+ primaryKey: true
40
+ },
41
+ {
42
+ type: "string",
43
+ name: "title"
44
+ },
45
+ {
46
+ type: "string",
47
+ name: "verificationType"
48
+ },
49
+ {
50
+ type: "string",
51
+ name: "description"
52
+ },
53
+ {
54
+ type: "jsonb",
55
+ name: "options"
56
+ },
57
+ {
58
+ interface: "m2m",
59
+ type: "belongsToMany",
60
+ name: "users",
61
+ target: "users",
62
+ foreignKey: "verificator",
63
+ otherKey: "userId",
64
+ onDelete: "CASCADE",
65
+ sourceKey: "name",
66
+ targetKey: "id",
67
+ through: "usersVerificators"
68
+ }
69
+ ]
70
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const SMS_OTP_VERIFICATION_TYPE = "sms-otp";
10
+ export declare const PROVIDER_TYPE_SMS_ALIYUN = "sms-aliyun";
11
+ export declare const PROVIDER_TYPE_SMS_TENCENT = "sms-tencent";
@@ -0,0 +1,42 @@
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
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var constants_exports = {};
28
+ __export(constants_exports, {
29
+ PROVIDER_TYPE_SMS_ALIYUN: () => PROVIDER_TYPE_SMS_ALIYUN,
30
+ PROVIDER_TYPE_SMS_TENCENT: () => PROVIDER_TYPE_SMS_TENCENT,
31
+ SMS_OTP_VERIFICATION_TYPE: () => SMS_OTP_VERIFICATION_TYPE
32
+ });
33
+ module.exports = __toCommonJS(constants_exports);
34
+ const SMS_OTP_VERIFICATION_TYPE = "sms-otp";
35
+ const PROVIDER_TYPE_SMS_ALIYUN = "sms-aliyun";
36
+ const PROVIDER_TYPE_SMS_TENCENT = "sms-tencent";
37
+ // Annotate the CommonJS export names for ESM import in node:
38
+ 0 && (module.exports = {
39
+ PROVIDER_TYPE_SMS_ALIYUN,
40
+ PROVIDER_TYPE_SMS_TENCENT,
41
+ SMS_OTP_VERIFICATION_TYPE
42
+ });