Skip to content

Commit

Permalink
Merge branch 'main' into dropbox-integration
Browse files Browse the repository at this point in the history
  • Loading branch information
naelob authored Sep 13, 2024
2 parents c178763 + e73ef8e commit 74baa59
Show file tree
Hide file tree
Showing 8 changed files with 191 additions and 356 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import {
OnedriveFolderOutput,
} from '@filestorage/folder/services/onedrive/types';

import {
import {
OnedriveDriveInput,
OnedriveDriveOutput,
} from '@filestorage/drive/services/onedrive/types';
Expand Down Expand Up @@ -103,17 +103,13 @@ import {
BoxSharedLinkInput,
BoxSharedLinkOutput,
} from '@filestorage/sharedlink/services/box/types';
GoogleDriveFileInput,
GoogleDriveFileOutput,
} from '@filestorage/file/services/googledrive/types';
import {
GoogleDriveFolderInput,
GoogleDriveFolderOutput,
} from '@filestorage/folder/services/googledrive/types';

import {
GoogleDriveDriveInput,
GoogleDriveDriveOutput,
} from '@filestorage/drive/services/googledrive/types';
import { GoogleDriveFolderInput, GoogleDriveFolderOutput } from '@filestorage/folder/services/googledrive/types';
import { GoogleDriveFileInput, GoogleDriveFileOutput } from '@filestorage/file/services/googledrive/types';

/* file */

Expand All @@ -122,16 +118,18 @@ export type OriginalFileInput =
| BoxFileInput
| OnedriveFileInput
| SharepointFileInput;
| GoogleDriveFileInput
| DropboxFileInput;
| SharepointFileInput
| GoogleDriveFileInput;

/* folder */
export type OriginalFolderInput =
| BoxFolderInput
| OnedriveFolderInput
| SharepointFolderInput;
| GoogleDriveFolderInput
| DropboxFolderInput;
| SharepointFolderInput
| GoogleDriveFolderInput;

/* permission */
export type OriginalPermissionInput =
Expand Down Expand Up @@ -179,16 +177,18 @@ export type OriginalFileOutput =
| BoxFileOutput
| OnedriveFileOutput
| SharepointFileOutput;
| GoogleDriveFileOutput
| DropboxFileOutput;
| SharepointFileOutput
| GoogleDriveFileOutput;

/* folder */
export type OriginalFolderOutput =
| BoxFolderOutput
| OnedriveFolderOutput
| SharepointFolderOutput;
| GoogleDriveFolderOutput
| DropboxFolderOutput;
| SharepointFolderOutput
| GoogleDriveFolderOutput;

/* permission */
export type OriginalPermissionOutput =
Expand Down
10 changes: 3 additions & 7 deletions packages/api/src/filestorage/drive/drive.module.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
import { OnedriveDriveMapper } from './services/onedrive/mappers';
import { OnedriveService } from './services/onedrive';
import { SharepointDriveMapper } from './services/sharepoint/mappers';
import { SharepointService } from './services/sharepoint';
import { BullQueueModule } from '@@core/@core-services/queues/queue.module';
import { IngestDataService } from '@@core/@core-services/unification/ingest-data.service';
import { WebhookService } from '@@core/@core-services/webhooks/panora-webhooks/webhook.service';
import { Utils } from '@filestorage/@lib/@utils';
import { Module } from '@nestjs/common';
import { DriveController } from './drive.controller';
import { DriveService } from './services/drive.service';
import { GoogleDriveService } from './services/googledrive';
import { GoogleDriveMapper } from './services/googledrive/mappers';
import { OnedriveService } from './services/onedrive';
import { OnedriveDriveMapper } from './services/onedrive/mappers';
import { ServiceRegistry } from './services/registry.service';
import { SharepointService } from './services/sharepoint';
import { SharepointDriveMapper } from './services/sharepoint/mappers';
import { SyncService } from './sync/sync.service';

@Module({
controllers: [DriveController],
providers: [
DriveService,
SyncService,
Expand Down
12 changes: 6 additions & 6 deletions packages/api/src/filestorage/file/file.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ import { SharepointService } from './services/sharepoint';
import { OnedriveFileMapper } from './services/onedrive/mappers';
import { OnedriveService } from './services/onedrive';
import { BullQueueModule } from '@@core/@core-services/queues/queue.module';
import { IngestDataService } from '@@core/@core-services/unification/ingest-data.service';
import { WebhookService } from '@@core/@core-services/webhooks/panora-webhooks/webhook.service';
import { Utils } from '@filestorage/@lib/@utils';
import { Module } from '@nestjs/common';
import { FileController } from './file.controller';
import { BoxService } from './services/box';
import { BoxFileMapper } from './services/box/mappers';
import { FileService } from './services/file.service';
import { OnedriveService } from './services/onedrive';
import { OnedriveFileMapper } from './services/onedrive/mappers';
import { ServiceRegistry } from './services/registry.service';
import { SyncService } from './sync/sync.service';
import { IngestDataService } from '@@core/@core-services/unification/ingest-data.service';
import { Utils } from '@filestorage/@lib/@utils';
import { GoogleDriveService } from './services/googledrive';
import { GoogleDriveFileMapper } from './services/googledrive/mappers';
import { ServiceRegistry } from './services/registry.service';
import { SharepointService } from './services/sharepoint';
import { SharepointFileMapper } from './services/sharepoint/mappers';
import { SyncService } from './sync/sync.service';

@Module({
controllers: [FileController],
Expand Down
17 changes: 8 additions & 9 deletions packages/api/src/filestorage/file/services/googledrive/index.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
import { EncryptionService } from '@@core/@core-services/encryption/encryption.service';
import { LoggerService } from '@@core/@core-services/logger/logger.service';
import { PrismaService } from '@@core/@core-services/prisma/prisma.service';
import { BUCKET_NAME } from '@@core/s3/constants';
import { ApiResponse } from '@@core/utils/types';
import { SyncParam } from '@@core/utils/types/interface';
import { S3Client } from '@aws-sdk/client-s3';
import { Upload } from '@aws-sdk/lib-storage';
import { FileStorageObject } from '@filestorage/@lib/@types';
import { IFileService } from '@filestorage/file/types';
import { Injectable } from '@nestjs/common';
import { ServiceRegistry } from '../registry.service';
import { GoogleDriveFileOutput } from './types';
import { S3Client } from '@aws-sdk/client-s3';
import { Readable } from 'stream';
import { Upload } from '@aws-sdk/lib-storage';
import { google } from 'googleapis';
import { OAuth2Client } from 'google-auth-library';
import { BUCKET_NAME } from '@@core/s3/constants';
import * as XLSX from 'xlsx';
import * as csv from 'csv-parse';
import { google } from 'googleapis';
import * as mammoth from 'mammoth';
import * as marked from 'marked';
import { Readable } from 'stream';
import * as XLSX from 'xlsx';
import { ServiceRegistry } from '../registry.service';
import { GoogleDriveFileOutput } from './types';

@Injectable()
export class GoogleDriveService implements IFileService {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
export interface GoogleDriveFileInput {
name: string;
mimeType?: string;
parents?: string[];
}
export type GoogleDriveFileInput = Partial<GoogleDriveFileOutput>

export interface GoogleDriveFileOutput {
kind?: string;
Expand Down
2 changes: 0 additions & 2 deletions packages/api/src/filestorage/folder/folder.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { DropboxFolderMapper } from './services/dropbox/mappers';
import { DropboxService } from './services/dropbox';
import { SharepointFolderMapper } from './services/sharepoint/mappers';
import { SharepointService } from './services/sharepoint';
import { OnedriveFolderMapper } from './services/onedrive/mappers';
import { OnedriveService } from './services/onedrive';
import { BullQueueModule } from '@@core/@core-services/queues/queue.module';
import { CoreUnification } from '@@core/@core-services/unification/core-unification.service';
import { IngestDataService } from '@@core/@core-services/unification/ingest-data.service';
Expand Down
Loading

0 comments on commit 74baa59

Please sign in to comment.