feat: Sync collection (#3368)

* feat: sync collection

* feat: sync collection

* perf: website selector

* update doc
This commit is contained in:
Archer
2024-12-11 15:03:41 +08:00
committed by GitHub
parent 048f5a2d53
commit d5752ddbaa
40 changed files with 365 additions and 191 deletions

View File

@@ -17,6 +17,9 @@ export type DatasetUpdateBody = {
externalReadUrl?: DatasetSchemaType['externalReadUrl'];
defaultPermission?: DatasetSchemaType['defaultPermission'];
apiServer?: DatasetSchemaType['apiServer'];
// sync schedule
autoSync?: boolean;
};
/* ================= collection ===================== */
@@ -47,6 +50,8 @@ export type CreateDatasetCollectionParams = DatasetCollectionChunkMetadataType &
tags?: string[];
createTime?: Date;
updateTime?: Date;
nextSyncTime?: Date;
};
export type ApiCreateDatasetCollectionParams = DatasetCollectionChunkMetadataType & {

View File

@@ -82,7 +82,8 @@ export const DatasetCollectionTypeMap = {
export enum DatasetCollectionSyncResultEnum {
sameRaw = 'sameRaw',
success = 'success'
success = 'success',
failed = 'failed'
}
export const DatasetCollectionSyncResultMap = {
[DatasetCollectionSyncResultEnum.sameRaw]: {
@@ -90,6 +91,9 @@ export const DatasetCollectionSyncResultMap = {
},
[DatasetCollectionSyncResultEnum.success]: {
label: i18nT('common:core.dataset.collection.sync.result.success')
},
[DatasetCollectionSyncResultEnum.failed]: {
label: i18nT('dataset:sync_collection_failed')
}
};

View File

@@ -34,8 +34,7 @@ export type DatasetSchemaType = {
inheritPermission: boolean;
apiServer?: APIFileServer;
syncSchedule?: { cronString: string; timezone: string };
syncNextTime?: Date;
autoSync?: boolean;
// abandon
externalReadUrl?: string;
@@ -65,11 +64,13 @@ export type DatasetCollectionSchemaType = {
fileId?: string; // local file id
rawLink?: string; // link url
externalFileId?: string; //external file id
apiFileId?: string; // api file id
externalFileUrl?: string; // external import url
nextSyncTime?: Date;
rawTextLength?: number;
hashRawText?: string;
externalFileUrl?: string; // external import url
apiFileId?: string; // api file id
metadata?: {
webPageSelector?: string;
relatedImgId?: string; // The id of the associated image collections