tachybase_todo/packages/plugins/users/src/collections/users.ts
chenos e5e503fe87
feat: add namespace and duplicator parameters for collection options (#1449)
* feat: add namespace and duplicator parameters for collection options

* fix: duplicator:getDict
2023-02-13 09:57:03 +08:00

82 lines
1.7 KiB
TypeScript

import { CollectionOptions } from '@nocobase/database';
export default {
namespace: 'users',
duplicator: 'optional',
name: 'users',
title: '{{t("Users")}}',
sortable: 'sort',
model: 'UserModel',
createdBy: true,
updatedBy: true,
logging: true,
fields: [
{
name: 'id',
type: 'bigInt',
autoIncrement: true,
primaryKey: true,
allowNull: false,
uiSchema: { type: 'number', title: '{{t("ID")}}', 'x-component': 'InputNumber', 'x-read-pretty': true },
interface: 'id',
},
{
interface: 'input',
type: 'string',
name: 'nickname',
uiSchema: {
type: 'string',
title: '{{t("Nickname")}}',
'x-component': 'Input',
},
},
{
interface: 'email',
type: 'string',
name: 'email',
unique: true,
uiSchema: {
type: 'string',
title: '{{t("Email")}}',
'x-component': 'Input',
'x-validator': 'email',
required: true,
},
},
{
interface: 'phone',
type: 'string',
name: 'phone',
unique: true,
uiSchema: {
type: 'string',
title: '{{t("Phone")}}',
'x-component': 'Input',
'x-validator': 'phone',
required: true,
},
},
{
interface: 'password',
type: 'password',
name: 'password',
hidden: true,
uiSchema: {
type: 'string',
title: '{{t("Password")}}',
'x-component': 'Password',
},
},
{
type: 'string',
name: 'appLang',
},
{
type: 'string',
name: 'resetToken',
unique: true,
hidden: true,
},
],
} as CollectionOptions;