mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-22 20:37:48 +00:00
dataset inheritance permission (#2151)
* refactor: dataset create and update api * chore: defaultpermission & resume fe * refactor: database auth * fix(ts): add inheritPermission into default data types * chore: adjust the code * fix: list api type filter * fix: query condition
This commit is contained in:
@@ -8,8 +8,8 @@ export enum DatasetErrEnum {
|
||||
unAuthDatasetCollection = 'unAuthDatasetCollection',
|
||||
unAuthDatasetData = 'unAuthDatasetData',
|
||||
unAuthDatasetFile = 'unAuthDatasetFile',
|
||||
|
||||
unLinkCollection = 'unLinkCollection'
|
||||
unLinkCollection = 'unLinkCollection',
|
||||
invalidVectorModelOrQAModel = 'invalidVectorModelOrQAModel'
|
||||
}
|
||||
const datasetErr = [
|
||||
{
|
||||
@@ -39,6 +39,10 @@ const datasetErr = [
|
||||
{
|
||||
statusText: DatasetErrEnum.unLinkCollection,
|
||||
message: 'core.dataset.error.unLinkCollection'
|
||||
},
|
||||
{
|
||||
statusText: DatasetErrEnum.invalidVectorModelOrQAModel,
|
||||
message: 'core.dataset.error.invalidVectorModelOrQAModel'
|
||||
}
|
||||
];
|
||||
export default datasetErr.reduce((acc, cur, index) => {
|
||||
|
1
packages/global/core/dataset/api.d.ts
vendored
1
packages/global/core/dataset/api.d.ts
vendored
@@ -10,7 +10,6 @@ export type DatasetUpdateBody = {
|
||||
name?: string;
|
||||
avatar?: string;
|
||||
intro?: string;
|
||||
permission?: DatasetSchemaType['permission']; // TODO: Should be deleted.
|
||||
agentModel?: LLMModelItemType;
|
||||
status?: DatasetSchemaType['status'];
|
||||
|
||||
|
21
packages/global/core/dataset/type.d.ts
vendored
21
packages/global/core/dataset/type.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
import { PermissionValueType } from 'support/permission/type';
|
||||
import { PermissionSchemaType } from '../../support/permission/type';
|
||||
import type { LLMModelItemType, VectorModelItemType } from '../../core/ai/model.d';
|
||||
import { PermissionTypeEnum } from '../../support/permission/constant';
|
||||
import { PushDatasetDataChunkProps } from './api';
|
||||
@@ -12,31 +12,28 @@ import {
|
||||
import { DatasetPermission } from '../../support/permission/dataset/controller';
|
||||
import { Permission } from '../../support/permission/controller';
|
||||
|
||||
/* schema */
|
||||
export type DatasetSchemaType = {
|
||||
_id: string;
|
||||
parentId: string;
|
||||
parentId?: string;
|
||||
userId: string;
|
||||
teamId: string;
|
||||
tmbId: string;
|
||||
updateTime: Date;
|
||||
|
||||
avatar: string;
|
||||
name: string;
|
||||
vectorModel: string;
|
||||
agentModel: string;
|
||||
intro: string;
|
||||
type: DatasetTypeEnum;
|
||||
type: `${DatasetTypeEnum}`;
|
||||
status: `${DatasetStatusEnum}`;
|
||||
// permission: DatasetPermission;
|
||||
|
||||
// metadata
|
||||
websiteConfig?: {
|
||||
url: string;
|
||||
selector: string;
|
||||
};
|
||||
externalReadUrl?: string;
|
||||
defaultPermission: PermissionValueType;
|
||||
};
|
||||
} & PermissionSchemaType;
|
||||
// } & PermissionSchemaType;
|
||||
|
||||
export type DatasetCollectionSchemaType = {
|
||||
_id: string;
|
||||
@@ -133,15 +130,13 @@ export type DatasetSimpleItemType = {
|
||||
};
|
||||
export type DatasetListItemType = {
|
||||
_id: string;
|
||||
parentId: string;
|
||||
avatar: string;
|
||||
name: string;
|
||||
intro: string;
|
||||
type: DatasetTypeEnum;
|
||||
type: `${DatasetTypeEnum}`;
|
||||
permission: DatasetPermission;
|
||||
vectorModel: VectorModelItemType;
|
||||
defaultPermission: PermissionValueType;
|
||||
};
|
||||
} & PermissionSchemaType;
|
||||
|
||||
export type DatasetItemType = Omit<DatasetSchemaType, 'vectorModel' | 'agentModel'> & {
|
||||
vectorModel: VectorModelItemType;
|
||||
|
Reference in New Issue
Block a user