page-operation.ts 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { PageGrant } from '~/interfaces/page';
  2. import { ObjectIdLike } from '../../interfaces/mongoose-utils';
  3. export type IPageForResuming = {
  4. _id: ObjectIdLike,
  5. path: string,
  6. isEmpty: boolean,
  7. parent?: ObjectIdLike,
  8. grant?: number,
  9. grantedUsers?: ObjectIdLike[],
  10. grantedGroup?: ObjectIdLike,
  11. descendantCount: number,
  12. status?: number,
  13. revision?: ObjectIdLike,
  14. lastUpdateUser?: ObjectIdLike,
  15. creator?: ObjectIdLike,
  16. };
  17. export type IUserForResuming = {
  18. _id: ObjectIdLike,
  19. };
  20. export type IOptionsForUpdate = {
  21. grant?: PageGrant,
  22. grantUserGroupId?: ObjectIdLike,
  23. isSyncRevisionToHackmd?: boolean,
  24. overwriteScopesOfDescendants?: boolean,
  25. };
  26. export type IOptionsForCreate = {
  27. format?: string,
  28. grantUserGroupId?: ObjectIdLike,
  29. grant?: PageGrant,
  30. overwriteScopesOfDescendants?: boolean,
  31. isSynchronously?: boolean,
  32. };
  33. export type IOptionsForResuming = {
  34. updateMetadata?: boolean,
  35. createRedirectPage?: boolean,
  36. prevDescendantCount?: number,
  37. } & IOptionsForUpdate & IOptionsForCreate;