Segment.service.ts 681 B

123456789101112131415161718192021222324252627
  1. import BaseModel from './BaseModel';
  2. import type {
  3. QuerySegmentObjects,
  4. PersistentSegmentObjects,
  5. } from '@server/types';
  6. export class SegmentService extends BaseModel {
  7. static getQSegments(collectionName: string) {
  8. return super.search<QuerySegmentObjects>({
  9. path: `/collections/${collectionName}/qsegments`,
  10. params: {},
  11. });
  12. }
  13. static getPSegments(collectionName: string) {
  14. return super.search<PersistentSegmentObjects>({
  15. path: `/collections/${collectionName}/psegments`,
  16. params: {},
  17. });
  18. }
  19. static compact(collectionName: string) {
  20. return super.update({
  21. path: `/collections/${collectionName}/compact`,
  22. });
  23. }
  24. }