@nocobase/plugin-auth 0.11.1-alpha.4 → 0.12.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client.d.ts +2 -2
- package/client.js +1 -1
- package/dist/client/index.js +729 -0
- package/dist/index.js +20 -0
- package/dist/locale/zh-CN.js +20 -0
- package/dist/node_modules/cron/LICENSE +8 -0
- package/dist/node_modules/cron/lib/cron.js +1 -0
- package/dist/node_modules/cron/lib/job.js +215 -0
- package/dist/node_modules/cron/lib/time.js +817 -0
- package/dist/node_modules/cron/package.json +1 -0
- package/{lib → dist}/preset.d.ts +1 -1
- package/dist/preset.js +11 -0
- package/dist/server/actions/auth.js +22 -0
- package/dist/server/actions/authenticators.js +83 -0
- package/{src/server/basic-auth.ts → dist/server/basic-auth.js} +41 -42
- package/dist/server/collections/authenticators.js +97 -0
- package/dist/server/collections/token-blacklist.js +21 -0
- package/dist/server/collections/users-authenticators.js +71 -0
- package/dist/server/index.js +21 -0
- package/dist/server/locale/en-US.js +12 -0
- package/dist/server/locale/fr-FR.js +12 -0
- package/dist/server/locale/index.js +26 -0
- package/dist/server/locale/ja-JP.js +8 -0
- package/dist/server/locale/pt-BR.js +12 -0
- package/dist/server/locale/zh-CN.js +13 -0
- package/dist/server/migrations/20230506152253-basic-authenticator.js +26 -0
- package/dist/server/migrations/20230607174500-update-basic.js +29 -0
- package/{src/server/model/authenticator.ts → dist/server/model/authenticator.js} +19 -19
- package/dist/server/plugin.js +93 -0
- package/dist/server/token-blacklist.js +62 -0
- package/package.json +17 -28
- package/server.d.ts +2 -2
- package/server.js +1 -1
- package/lib/client/AuthProvider.js +0 -56
- package/lib/client/basic/Options.js +0 -51
- package/lib/client/basic/SigninPage.js +0 -100
- package/lib/client/basic/SignupPage.js +0 -131
- package/lib/client/index.js +0 -27
- package/lib/client/locale/index.js +0 -19
- package/lib/client/settings/Authenticator.js +0 -159
- package/lib/client/settings/Options.js +0 -56
- package/lib/client/settings/authType.js +0 -27
- package/lib/client/settings/schemas/authenticators.js +0 -438
- package/lib/index.js +0 -20
- package/lib/locale/zh-CN.js +0 -23
- package/lib/preset.js +0 -12
- package/lib/server/actions/auth.js +0 -51
- package/lib/server/actions/authenticators.js +0 -131
- package/lib/server/basic-auth.js +0 -183
- package/lib/server/collections/authenticators.js +0 -94
- package/lib/server/collections/token-blacklist.js +0 -21
- package/lib/server/collections/users-authenticators.js +0 -75
- package/lib/server/index.js +0 -20
- package/lib/server/locale/en-US.js +0 -15
- package/lib/server/locale/fr-FR.js +0 -15
- package/lib/server/locale/index.js +0 -27
- package/lib/server/locale/ja-JP.js +0 -11
- package/lib/server/locale/pt-BR.js +0 -15
- package/lib/server/locale/zh-CN.js +0 -16
- package/lib/server/migrations/20230506152253-basic-authenticator.js +0 -40
- package/lib/server/migrations/20230607174500-update-basic.js +0 -43
- package/lib/server/model/authenticator.js +0 -72
- package/lib/server/plugin.js +0 -129
- package/lib/server/token-blacklist.js +0 -82
- package/src/client/AuthProvider.tsx +0 -41
- package/src/client/basic/Options.tsx +0 -31
- package/src/client/basic/SigninPage.tsx +0 -65
- package/src/client/basic/SignupPage.tsx +0 -91
- package/src/client/index.tsx +0 -10
- package/src/client/locale/index.ts +0 -7
- package/src/client/settings/Authenticator.tsx +0 -95
- package/src/client/settings/Options.tsx +0 -34
- package/src/client/settings/authType.ts +0 -18
- package/src/client/settings/schemas/authenticators.ts +0 -402
- package/src/index.ts +0 -1
- package/src/locale/zh-CN.ts +0 -17
- package/src/preset.ts +0 -4
- package/src/server/__tests__/actions.test.ts +0 -142
- package/src/server/__tests__/token-blacklist.test.ts +0 -73
- package/src/server/actions/auth.ts +0 -20
- package/src/server/actions/authenticators.ts +0 -85
- package/src/server/collections/.gitkeep +0 -0
- package/src/server/collections/authenticators.ts +0 -98
- package/src/server/collections/token-blacklist.ts +0 -19
- package/src/server/collections/users-authenticators.ts +0 -73
- package/src/server/index.ts +0 -2
- package/src/server/locale/en-US.ts +0 -10
- package/src/server/locale/fr-FR.ts +0 -10
- package/src/server/locale/index.ts +0 -3
- package/src/server/locale/ja-JP.ts +0 -4
- package/src/server/locale/pt-BR.ts +0 -10
- package/src/server/locale/zh-CN.ts +0 -9
- package/src/server/migrations/20230506152253-basic-authenticator.ts +0 -22
- package/src/server/migrations/20230607174500-update-basic.ts +0 -25
- package/src/server/plugin.ts +0 -92
- package/src/server/token-blacklist.ts +0 -66
- /package/{lib → dist}/client/AuthProvider.d.ts +0 -0
- /package/{lib → dist}/client/basic/Options.d.ts +0 -0
- /package/{lib → dist}/client/basic/SigninPage.d.ts +0 -0
- /package/{lib → dist}/client/basic/SignupPage.d.ts +0 -0
- /package/{lib → dist}/client/index.d.ts +0 -0
- /package/{lib → dist}/client/locale/index.d.ts +0 -0
- /package/{lib → dist}/client/settings/Authenticator.d.ts +0 -0
- /package/{lib → dist}/client/settings/Options.d.ts +0 -0
- /package/{lib → dist}/client/settings/authType.d.ts +0 -0
- /package/{lib → dist}/client/settings/schemas/authenticators.d.ts +0 -0
- /package/{lib → dist}/index.d.ts +0 -0
- /package/{lib → dist}/locale/zh-CN.d.ts +0 -0
- /package/{lib → dist}/server/actions/auth.d.ts +0 -0
- /package/{lib → dist}/server/actions/authenticators.d.ts +0 -0
- /package/{lib → dist}/server/basic-auth.d.ts +0 -0
- /package/{lib → dist}/server/collections/authenticators.d.ts +0 -0
- /package/{lib → dist}/server/collections/token-blacklist.d.ts +0 -0
- /package/{lib → dist}/server/collections/users-authenticators.d.ts +0 -0
- /package/{lib → dist}/server/index.d.ts +0 -0
- /package/{lib → dist}/server/locale/en-US.d.ts +0 -0
- /package/{lib → dist}/server/locale/fr-FR.d.ts +0 -0
- /package/{lib → dist}/server/locale/index.d.ts +0 -0
- /package/{lib → dist}/server/locale/ja-JP.d.ts +0 -0
- /package/{lib → dist}/server/locale/pt-BR.d.ts +0 -0
- /package/{lib → dist}/server/locale/zh-CN.d.ts +0 -0
- /package/{lib → dist}/server/migrations/20230506152253-basic-authenticator.d.ts +0 -0
- /package/{lib → dist}/server/migrations/20230607174500-update-basic.d.ts +0 -0
- /package/{lib → dist}/server/model/authenticator.d.ts +0 -0
- /package/{lib → dist}/server/plugin.d.ts +0 -0
- /package/{lib → dist}/server/token-blacklist.d.ts +0 -0
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ActionContextProvider,
|
|
3
|
-
SchemaComponent,
|
|
4
|
-
useAPIClient,
|
|
5
|
-
useActionContext,
|
|
6
|
-
useAsyncData,
|
|
7
|
-
useRequest,
|
|
8
|
-
} from '@nocobase/client';
|
|
9
|
-
import { Card } from 'antd';
|
|
10
|
-
import React, { useState } from 'react';
|
|
11
|
-
import { authenticatorsSchema, createFormSchema } from './schemas/authenticators';
|
|
12
|
-
import { Button, Dropdown } from 'antd';
|
|
13
|
-
import { PlusOutlined, DownOutlined } from '@ant-design/icons';
|
|
14
|
-
import { AuthTypeContext, AuthTypesContext, useAuthTypes } from './authType';
|
|
15
|
-
import { useValuesFromOptions, Options } from './Options';
|
|
16
|
-
import { useTranslation } from 'react-i18next';
|
|
17
|
-
|
|
18
|
-
const useCloseAction = () => {
|
|
19
|
-
const { setVisible } = useActionContext();
|
|
20
|
-
return {
|
|
21
|
-
async run() {
|
|
22
|
-
setVisible(false);
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const AddNew = () => {
|
|
28
|
-
const { t } = useTranslation();
|
|
29
|
-
const [visible, setVisible] = useState(false);
|
|
30
|
-
const [type, setType] = useState('');
|
|
31
|
-
const types = useAuthTypes();
|
|
32
|
-
const items = types.map((item) => ({
|
|
33
|
-
...item,
|
|
34
|
-
onClick: () => {
|
|
35
|
-
setVisible(true);
|
|
36
|
-
setType(item.value);
|
|
37
|
-
},
|
|
38
|
-
}));
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<ActionContextProvider value={{ visible, setVisible }}>
|
|
42
|
-
<AuthTypeContext.Provider value={{ type }}>
|
|
43
|
-
<Dropdown menu={{ items }}>
|
|
44
|
-
<Button icon={<PlusOutlined />} type={'primary'}>
|
|
45
|
-
{t('Add new')} <DownOutlined />
|
|
46
|
-
</Button>
|
|
47
|
-
</Dropdown>
|
|
48
|
-
<SchemaComponent scope={{ useCloseAction, types, setType }} schema={createFormSchema} />
|
|
49
|
-
</AuthTypeContext.Provider>
|
|
50
|
-
</ActionContextProvider>
|
|
51
|
-
);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
// Disable delete button when there is only one authenticator
|
|
55
|
-
const useCanNotDelete = () => {
|
|
56
|
-
const { data } = useAsyncData();
|
|
57
|
-
// return data?.meta?.count === 1;
|
|
58
|
-
return false;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export const Authenticator = () => {
|
|
62
|
-
const [types, setTypes] = useState([]);
|
|
63
|
-
const api = useAPIClient();
|
|
64
|
-
useRequest(
|
|
65
|
-
() =>
|
|
66
|
-
api
|
|
67
|
-
.resource('authenticators')
|
|
68
|
-
.listTypes()
|
|
69
|
-
.then((res) => {
|
|
70
|
-
const types = res?.data?.data || [];
|
|
71
|
-
return types.map((type: string) => ({
|
|
72
|
-
key: type,
|
|
73
|
-
label: type,
|
|
74
|
-
value: type,
|
|
75
|
-
}));
|
|
76
|
-
}),
|
|
77
|
-
{
|
|
78
|
-
onSuccess: (types) => {
|
|
79
|
-
setTypes(types);
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
return (
|
|
85
|
-
<Card bordered={false}>
|
|
86
|
-
<AuthTypesContext.Provider value={{ types }}>
|
|
87
|
-
<SchemaComponent
|
|
88
|
-
schema={authenticatorsSchema}
|
|
89
|
-
components={{ AddNew, Options }}
|
|
90
|
-
scope={{ types, useValuesFromOptions, useCanNotDelete }}
|
|
91
|
-
/>
|
|
92
|
-
</AuthTypesContext.Provider>
|
|
93
|
-
</Card>
|
|
94
|
-
);
|
|
95
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { observer, useForm } from '@formily/react';
|
|
2
|
-
import { useActionContext, useOptionsComponent, useRecord, useRequest } from '@nocobase/client';
|
|
3
|
-
import { useEffect } from 'react';
|
|
4
|
-
|
|
5
|
-
export const useValuesFromOptions = (options) => {
|
|
6
|
-
const record = useRecord();
|
|
7
|
-
const result = useRequest(
|
|
8
|
-
() =>
|
|
9
|
-
Promise.resolve({
|
|
10
|
-
data: {
|
|
11
|
-
...record.options,
|
|
12
|
-
},
|
|
13
|
-
}),
|
|
14
|
-
{
|
|
15
|
-
...options,
|
|
16
|
-
manual: true,
|
|
17
|
-
},
|
|
18
|
-
);
|
|
19
|
-
const { run } = result;
|
|
20
|
-
const ctx = useActionContext();
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
if (ctx.visible) {
|
|
23
|
-
run();
|
|
24
|
-
}
|
|
25
|
-
}, [ctx.visible, run]);
|
|
26
|
-
return result;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const Options = observer(() => {
|
|
30
|
-
const form = useForm();
|
|
31
|
-
const record = useRecord();
|
|
32
|
-
const component = useOptionsComponent(form.values.authType || record.authType);
|
|
33
|
-
return component;
|
|
34
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { createContext, useContext } from 'react';
|
|
2
|
-
|
|
3
|
-
export const AuthTypeContext = createContext<{
|
|
4
|
-
type: string;
|
|
5
|
-
}>({ type: '' });
|
|
6
|
-
|
|
7
|
-
export const AuthTypesContext = createContext<{
|
|
8
|
-
types: {
|
|
9
|
-
key: string;
|
|
10
|
-
label: string;
|
|
11
|
-
value: string;
|
|
12
|
-
}[];
|
|
13
|
-
}>({ types: [] });
|
|
14
|
-
|
|
15
|
-
export const useAuthTypes = () => {
|
|
16
|
-
const { types } = useContext(AuthTypesContext);
|
|
17
|
-
return types;
|
|
18
|
-
};
|
|
@@ -1,402 +0,0 @@
|
|
|
1
|
-
import { ISchema } from '@formily/react';
|
|
2
|
-
import { uid } from '@formily/shared';
|
|
3
|
-
import { useAPIClient, useActionContext, useRequest } from '@nocobase/client';
|
|
4
|
-
import { message } from 'antd';
|
|
5
|
-
import { useContext } from 'react';
|
|
6
|
-
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import { AuthTypeContext } from '../authType';
|
|
8
|
-
|
|
9
|
-
const collection = {
|
|
10
|
-
name: 'authenticators',
|
|
11
|
-
sortable: true,
|
|
12
|
-
fields: [
|
|
13
|
-
{
|
|
14
|
-
name: 'id',
|
|
15
|
-
type: 'string',
|
|
16
|
-
interface: 'id',
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
interface: 'input',
|
|
20
|
-
type: 'string',
|
|
21
|
-
name: 'name',
|
|
22
|
-
uiSchema: {
|
|
23
|
-
type: 'string',
|
|
24
|
-
title: '{{t("Name")}}',
|
|
25
|
-
'x-component': 'Input',
|
|
26
|
-
required: true,
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
interface: 'input',
|
|
31
|
-
type: 'string',
|
|
32
|
-
name: 'authType',
|
|
33
|
-
uiSchema: {
|
|
34
|
-
type: 'string',
|
|
35
|
-
title: '{{t("Auth Type", {ns: "auth"})}}',
|
|
36
|
-
'x-component': 'Select',
|
|
37
|
-
required: true,
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
interface: 'input',
|
|
42
|
-
type: 'string',
|
|
43
|
-
name: 'title',
|
|
44
|
-
uiSchema: {
|
|
45
|
-
type: 'string',
|
|
46
|
-
title: '{{t("Title")}}',
|
|
47
|
-
'x-component': 'Input',
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
interface: 'textarea',
|
|
52
|
-
type: 'string',
|
|
53
|
-
name: 'description',
|
|
54
|
-
uiSchema: {
|
|
55
|
-
type: 'string',
|
|
56
|
-
title: '{{t("Description")}}',
|
|
57
|
-
'x-component': 'Input',
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
type: 'boolean',
|
|
62
|
-
name: 'enabled',
|
|
63
|
-
uiSchema: {
|
|
64
|
-
type: 'boolean',
|
|
65
|
-
title: '{{t("Enabled")}}',
|
|
66
|
-
'x-component': 'Checkbox',
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
],
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export const createFormSchema: ISchema = {
|
|
73
|
-
type: 'object',
|
|
74
|
-
properties: {
|
|
75
|
-
drawer: {
|
|
76
|
-
type: 'void',
|
|
77
|
-
'x-component': 'Action.Drawer',
|
|
78
|
-
'x-decorator': 'Form',
|
|
79
|
-
'x-decorator-props': {
|
|
80
|
-
useValues(options) {
|
|
81
|
-
const ctx = useActionContext();
|
|
82
|
-
const { type: authType } = useContext(AuthTypeContext);
|
|
83
|
-
return useRequest(
|
|
84
|
-
() =>
|
|
85
|
-
Promise.resolve({
|
|
86
|
-
data: {
|
|
87
|
-
name: `s_${uid()}`,
|
|
88
|
-
authType,
|
|
89
|
-
},
|
|
90
|
-
}),
|
|
91
|
-
{ ...options, refreshDeps: [ctx.visible] },
|
|
92
|
-
);
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
title: '{{t("Add new")}}',
|
|
96
|
-
properties: {
|
|
97
|
-
name: {
|
|
98
|
-
'x-component': 'CollectionField',
|
|
99
|
-
'x-decorator': 'FormItem',
|
|
100
|
-
},
|
|
101
|
-
authType: {
|
|
102
|
-
'x-component': 'CollectionField',
|
|
103
|
-
'x-decorator': 'FormItem',
|
|
104
|
-
'x-component-props': {
|
|
105
|
-
options: '{{ types }}',
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
title: {
|
|
109
|
-
'x-component': 'CollectionField',
|
|
110
|
-
'x-decorator': 'FormItem',
|
|
111
|
-
},
|
|
112
|
-
description: {
|
|
113
|
-
'x-component': 'CollectionField',
|
|
114
|
-
'x-decorator': 'FormItem',
|
|
115
|
-
},
|
|
116
|
-
enabled: {
|
|
117
|
-
'x-component': 'CollectionField',
|
|
118
|
-
'x-decorator': 'FormItem',
|
|
119
|
-
},
|
|
120
|
-
options: {
|
|
121
|
-
type: 'object',
|
|
122
|
-
'x-component': 'Options',
|
|
123
|
-
},
|
|
124
|
-
footer: {
|
|
125
|
-
type: 'void',
|
|
126
|
-
'x-component': 'Action.Drawer.Footer',
|
|
127
|
-
properties: {
|
|
128
|
-
cancel: {
|
|
129
|
-
title: '{{t("Cancel")}}',
|
|
130
|
-
'x-component': 'Action',
|
|
131
|
-
'x-component-props': {
|
|
132
|
-
useAction: '{{ cm.useCancelAction }}',
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
submit: {
|
|
136
|
-
title: '{{t("Submit")}}',
|
|
137
|
-
'x-component': 'Action',
|
|
138
|
-
'x-component-props': {
|
|
139
|
-
type: 'primary',
|
|
140
|
-
useAction: '{{ cm.useCreateAction }}',
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
export const authenticatorsSchema: ISchema = {
|
|
151
|
-
type: 'void',
|
|
152
|
-
name: 'authenticators',
|
|
153
|
-
'x-decorator': 'ResourceActionProvider',
|
|
154
|
-
'x-decorator-props': {
|
|
155
|
-
collection,
|
|
156
|
-
resourceName: 'authenticators',
|
|
157
|
-
dragSort: true,
|
|
158
|
-
request: {
|
|
159
|
-
resource: 'authenticators',
|
|
160
|
-
action: 'list',
|
|
161
|
-
params: {
|
|
162
|
-
pageSize: 50,
|
|
163
|
-
sort: 'sort',
|
|
164
|
-
appends: [],
|
|
165
|
-
},
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
'x-component': 'CollectionProvider',
|
|
169
|
-
'x-component-props': {
|
|
170
|
-
collection,
|
|
171
|
-
},
|
|
172
|
-
properties: {
|
|
173
|
-
actions: {
|
|
174
|
-
type: 'void',
|
|
175
|
-
'x-component': 'ActionBar',
|
|
176
|
-
'x-component-props': {
|
|
177
|
-
style: {
|
|
178
|
-
marginBottom: 16,
|
|
179
|
-
},
|
|
180
|
-
},
|
|
181
|
-
properties: {
|
|
182
|
-
delete: {
|
|
183
|
-
type: 'void',
|
|
184
|
-
title: '{{t("Delete")}}',
|
|
185
|
-
'x-component': 'Action',
|
|
186
|
-
'x-component-props': {
|
|
187
|
-
useAction: '{{ cm.useBulkDestroyAction }}',
|
|
188
|
-
confirm: {
|
|
189
|
-
title: "{{t('Delete')}}",
|
|
190
|
-
content: "{{t('Are you sure you want to delete it?')}}",
|
|
191
|
-
},
|
|
192
|
-
},
|
|
193
|
-
},
|
|
194
|
-
create: {
|
|
195
|
-
type: 'void',
|
|
196
|
-
title: '{{t("Add new")}}',
|
|
197
|
-
'x-component': 'AddNew',
|
|
198
|
-
'x-component-props': {
|
|
199
|
-
type: 'primary',
|
|
200
|
-
},
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
|
-
},
|
|
204
|
-
table: {
|
|
205
|
-
type: 'void',
|
|
206
|
-
'x-uid': 'input',
|
|
207
|
-
'x-component': 'Table.Void',
|
|
208
|
-
'x-component-props': {
|
|
209
|
-
rowKey: 'id',
|
|
210
|
-
rowSelection: {
|
|
211
|
-
type: 'checkbox',
|
|
212
|
-
},
|
|
213
|
-
useDataSource: '{{ cm.useDataSourceFromRAC }}',
|
|
214
|
-
useAction() {
|
|
215
|
-
const api = useAPIClient();
|
|
216
|
-
const { t } = useTranslation();
|
|
217
|
-
return {
|
|
218
|
-
async move(from, to) {
|
|
219
|
-
await api.resource('authenticators').move({
|
|
220
|
-
sourceId: from.id,
|
|
221
|
-
targetId: to.id,
|
|
222
|
-
});
|
|
223
|
-
message.success(t('Saved successfully'), 0.2);
|
|
224
|
-
},
|
|
225
|
-
};
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
properties: {
|
|
229
|
-
id: {
|
|
230
|
-
type: 'void',
|
|
231
|
-
'x-decorator': 'Table.Column.Decorator',
|
|
232
|
-
'x-component': 'Table.Column',
|
|
233
|
-
properties: {
|
|
234
|
-
id: {
|
|
235
|
-
type: 'number',
|
|
236
|
-
'x-component': 'CollectionField',
|
|
237
|
-
'x-read-pretty': true,
|
|
238
|
-
},
|
|
239
|
-
},
|
|
240
|
-
},
|
|
241
|
-
name: {
|
|
242
|
-
type: 'void',
|
|
243
|
-
'x-decorator': 'Table.Column.Decorator',
|
|
244
|
-
'x-component': 'Table.Column',
|
|
245
|
-
properties: {
|
|
246
|
-
name: {
|
|
247
|
-
type: 'string',
|
|
248
|
-
'x-component': 'CollectionField',
|
|
249
|
-
'x-read-pretty': true,
|
|
250
|
-
},
|
|
251
|
-
},
|
|
252
|
-
},
|
|
253
|
-
authType: {
|
|
254
|
-
type: 'void',
|
|
255
|
-
'x-decorator': 'Table.Column.Decorator',
|
|
256
|
-
'x-component': 'Table.Column',
|
|
257
|
-
properties: {
|
|
258
|
-
authType: {
|
|
259
|
-
type: 'string',
|
|
260
|
-
'x-component': 'CollectionField',
|
|
261
|
-
'x-read-pretty': true,
|
|
262
|
-
},
|
|
263
|
-
},
|
|
264
|
-
},
|
|
265
|
-
title: {
|
|
266
|
-
type: 'void',
|
|
267
|
-
'x-decorator': 'Table.Column.Decorator',
|
|
268
|
-
'x-component': 'Table.Column',
|
|
269
|
-
properties: {
|
|
270
|
-
title: {
|
|
271
|
-
type: 'string',
|
|
272
|
-
'x-component': 'CollectionField',
|
|
273
|
-
'x-read-pretty': true,
|
|
274
|
-
},
|
|
275
|
-
},
|
|
276
|
-
},
|
|
277
|
-
description: {
|
|
278
|
-
type: 'void',
|
|
279
|
-
'x-decorator': 'Table.Column.Decorator',
|
|
280
|
-
'x-component': 'Table.Column',
|
|
281
|
-
properties: {
|
|
282
|
-
description: {
|
|
283
|
-
type: 'boolean',
|
|
284
|
-
'x-component': 'CollectionField',
|
|
285
|
-
'x-read-pretty': true,
|
|
286
|
-
},
|
|
287
|
-
},
|
|
288
|
-
},
|
|
289
|
-
enabled: {
|
|
290
|
-
type: 'void',
|
|
291
|
-
'x-decorator': 'Table.Column.Decorator',
|
|
292
|
-
'x-component': 'Table.Column',
|
|
293
|
-
properties: {
|
|
294
|
-
enabled: {
|
|
295
|
-
type: 'boolean',
|
|
296
|
-
'x-component': 'CollectionField',
|
|
297
|
-
'x-read-pretty': true,
|
|
298
|
-
},
|
|
299
|
-
},
|
|
300
|
-
},
|
|
301
|
-
actions: {
|
|
302
|
-
type: 'void',
|
|
303
|
-
title: '{{t("Actions")}}',
|
|
304
|
-
'x-component': 'Table.Column',
|
|
305
|
-
properties: {
|
|
306
|
-
actions: {
|
|
307
|
-
type: 'void',
|
|
308
|
-
'x-component': 'Space',
|
|
309
|
-
'x-component-props': {
|
|
310
|
-
split: '|',
|
|
311
|
-
},
|
|
312
|
-
properties: {
|
|
313
|
-
update: {
|
|
314
|
-
type: 'void',
|
|
315
|
-
title: '{{t("Configure")}}',
|
|
316
|
-
'x-component': 'Action.Link',
|
|
317
|
-
'x-component-props': {
|
|
318
|
-
type: 'primary',
|
|
319
|
-
},
|
|
320
|
-
properties: {
|
|
321
|
-
drawer: {
|
|
322
|
-
type: 'void',
|
|
323
|
-
'x-component': 'Action.Drawer',
|
|
324
|
-
'x-decorator': 'Form',
|
|
325
|
-
'x-decorator-props': {
|
|
326
|
-
useValues: '{{ cm.useValuesFromRecord }}',
|
|
327
|
-
},
|
|
328
|
-
title: '{{t("Configure")}}',
|
|
329
|
-
properties: {
|
|
330
|
-
name: {
|
|
331
|
-
'x-component': 'CollectionField',
|
|
332
|
-
'x-decorator': 'FormItem',
|
|
333
|
-
},
|
|
334
|
-
authType: {
|
|
335
|
-
'x-component': 'CollectionField',
|
|
336
|
-
'x-decorator': 'FormItem',
|
|
337
|
-
'x-component-props': {
|
|
338
|
-
options: '{{ types }}',
|
|
339
|
-
},
|
|
340
|
-
},
|
|
341
|
-
title: {
|
|
342
|
-
'x-component': 'CollectionField',
|
|
343
|
-
'x-decorator': 'FormItem',
|
|
344
|
-
},
|
|
345
|
-
description: {
|
|
346
|
-
'x-component': 'CollectionField',
|
|
347
|
-
'x-decorator': 'FormItem',
|
|
348
|
-
},
|
|
349
|
-
enabled: {
|
|
350
|
-
'x-component': 'CollectionField',
|
|
351
|
-
'x-decorator': 'FormItem',
|
|
352
|
-
},
|
|
353
|
-
options: {
|
|
354
|
-
type: 'object',
|
|
355
|
-
'x-component': 'Options',
|
|
356
|
-
},
|
|
357
|
-
footer: {
|
|
358
|
-
type: 'void',
|
|
359
|
-
'x-component': 'Action.Drawer.Footer',
|
|
360
|
-
properties: {
|
|
361
|
-
cancel: {
|
|
362
|
-
title: '{{t("Cancel")}}',
|
|
363
|
-
'x-component': 'Action',
|
|
364
|
-
'x-component-props': {
|
|
365
|
-
useAction: '{{ cm.useCancelAction }}',
|
|
366
|
-
},
|
|
367
|
-
},
|
|
368
|
-
submit: {
|
|
369
|
-
title: '{{t("Submit")}}',
|
|
370
|
-
'x-component': 'Action',
|
|
371
|
-
'x-component-props': {
|
|
372
|
-
type: 'primary',
|
|
373
|
-
useAction: '{{ cm.useUpdateAction }}',
|
|
374
|
-
},
|
|
375
|
-
},
|
|
376
|
-
},
|
|
377
|
-
},
|
|
378
|
-
},
|
|
379
|
-
},
|
|
380
|
-
},
|
|
381
|
-
},
|
|
382
|
-
delete: {
|
|
383
|
-
type: 'void',
|
|
384
|
-
title: '{{ t("Delete") }}',
|
|
385
|
-
'x-component': 'Action.Link',
|
|
386
|
-
'x-component-props': {
|
|
387
|
-
confirm: {
|
|
388
|
-
title: "{{t('Delete record')}}",
|
|
389
|
-
content: "{{t('Are you sure you want to delete it?')}}",
|
|
390
|
-
},
|
|
391
|
-
useAction: '{{cm.useDestroyAction}}',
|
|
392
|
-
},
|
|
393
|
-
'x-disabled': '{{ useCanNotDelete() }}',
|
|
394
|
-
},
|
|
395
|
-
},
|
|
396
|
-
},
|
|
397
|
-
},
|
|
398
|
-
},
|
|
399
|
-
},
|
|
400
|
-
},
|
|
401
|
-
},
|
|
402
|
-
};
|
package/src/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default, AuthModel } from './server';
|
package/src/locale/zh-CN.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const locale = {
|
|
2
|
-
'Auth Type': '认证类型',
|
|
3
|
-
Authenticators: '认证器',
|
|
4
|
-
Authentication: '用户认证',
|
|
5
|
-
'Sign in via email': '邮箱登录',
|
|
6
|
-
'Not allowed to sign up': '禁止注册',
|
|
7
|
-
'Allow to sign up': '允许注册',
|
|
8
|
-
'The email is incorrect, please re-enter': '邮箱有误,请重新输入',
|
|
9
|
-
'Please fill in your email address': '请填写邮箱',
|
|
10
|
-
'The password is incorrect, please re-enter': '密码有误,请重新输入',
|
|
11
|
-
'Not a valid cellphone number, please re-enter': '不是有效的手机号,请重新输入',
|
|
12
|
-
'The phone number has been registered, please login directly': '手机号已注册,请直接登录',
|
|
13
|
-
'The phone number is not registered, please register first': '手机号未注册,请先注册',
|
|
14
|
-
'Please keep and enable at least one authenticator': '请至少保留并启用一个认证器',
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export default locale;
|
package/src/preset.ts
DELETED