Skip to content

Commit

Permalink
fix: ts errors (#1916)
Browse files Browse the repository at this point in the history
  • Loading branch information
FinleyGe authored and c121914yu committed Jul 2, 2024
1 parent 4e8239d commit 0918b8a
Show file tree
Hide file tree
Showing 7 changed files with 1,903 additions and 1,249 deletions.
3 changes: 2 additions & 1 deletion packages/global/core/dataset/type.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export type DatasetSchemaType = {
intro: string;
type: DatasetTypeEnum;
status: `${DatasetStatusEnum}`;
permission: DatasetPermission;
// permission: DatasetPermission;

// metadata
websiteConfig?: {
Expand Down Expand Up @@ -146,6 +146,7 @@ export type DatasetListItemType = {
export type DatasetItemType = Omit<DatasetSchemaType, 'vectorModel' | 'agentModel'> & {
vectorModel: VectorModelItemType;
agentModel: LLMModelItemType;
permission: DatasetPermission;
};

/* ================= collection ===================== */
Expand Down
2 changes: 1 addition & 1 deletion packages/service/core/dataset/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export async function findDatasetAndAllChildren({
return datasets;
};
const [dataset, childDatasets] = await Promise.all([
MongoDataset.findById(datasetId),
MongoDataset.findById(datasetId).lean(),
find(datasetId)
]);

Expand Down
5 changes: 0 additions & 5 deletions packages/service/core/dataset/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,6 @@ const DatasetSchema = new Schema({
type: String,
default: ''
},
permission: {
type: String,
enum: Object.keys(PermissionTypeMap),
default: PermissionTypeEnum.private
},
websiteConfig: {
type: {
url: {
Expand Down
2 changes: 1 addition & 1 deletion packages/service/support/permission/inheritPermission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export async function syncChildrenPermission({
},
'_id parentId'
)
.lean()
.lean<ResourceType[]>()
.session(session);

// bfs to get all children
Expand Down
3,137 changes: 1,898 additions & 1,239 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion projects/app/src/service/support/permission/auth/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export async function autChatCrud({
// auth team space chat
if (spaceTeamId && teamToken) {
const { uid } = await authTeamSpaceToken({ teamId: spaceTeamId, teamToken });
addLog.debug('Auth team token', { uid, spaceTeamId, teamToken, chatUid: chat.outLinkUid });
addLog.debug('Auth team token', { uid, spaceTeamId, teamToken, chatUid: chat?.outLinkUid });
if (!chat || (String(chat.teamId) === String(spaceTeamId) && chat.outLinkUid === uid)) {
return { uid };
}
Expand Down
1 change: 0 additions & 1 deletion projects/app/src/web/core/dataset/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export const defaultCollectionDetail: DatasetCollectionItemType = {
name: '',
intro: '',
status: 'active',
permission: new DatasetPermission(),
vectorModel: defaultVectorModels[0].model,
agentModel: defaultQAModels[0].model,
defaultPermission: DatasetDefaultPermissionVal
Expand Down

0 comments on commit 0918b8a

Please sign in to comment.