diff --git a/packages/api/prisma/schema.prisma b/packages/api/prisma/schema.prisma index a44828b12..b3d897e11 100644 --- a/packages/api/prisma/schema.prisma +++ b/packages/api/prisma/schema.prisma @@ -1965,18 +1965,19 @@ model linked_users { /// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments model projects { - id_project String @id(map: "pk_projects") @db.Uuid - name String - sync_mode String - pull_frequency BigInt? - redirect_url String? - id_user String @db.Uuid - id_connector_set String @db.Uuid - api_keys api_keys[] - connections connections[] - linked_users linked_users[] - users users @relation(fields: [id_user], references: [id_user], onDelete: NoAction, onUpdate: NoAction, map: "fk_46_1") - connector_sets connector_sets @relation(fields: [id_connector_set], references: [id_connector_set], onDelete: NoAction, onUpdate: NoAction, map: "fk_project_connectorsetid") + id_project String @id(map: "pk_projects") @db.Uuid + name String + sync_mode String + pull_frequency BigInt? + redirect_url String? + id_user String @db.Uuid + id_connector_set String @db.Uuid + api_keys api_keys[] + connections connections[] + linked_users linked_users[] + users users @relation(fields: [id_user], references: [id_user], onDelete: NoAction, onUpdate: NoAction, map: "fk_46_1") + connector_sets connector_sets @relation(fields: [id_connector_set], references: [id_connector_set], onDelete: NoAction, onUpdate: NoAction, map: "fk_project_connectorsetid") + projects_pull_frequency projects_pull_frequency? @@index([id_connector_set], map: "fk_connectors_sets") } @@ -2128,3 +2129,18 @@ model webhook_delivery_attempts { @@index([id_event], map: "fk_webhook_delivery_attempt_eventid") @@index([id_webhooks_reponse], map: "fk_webhook_delivery_attempt_webhook_responseid") } + +model projects_pull_frequency { + id_projects_pull_frequency String @id(map: "pk_projects_pull_frequency") @db.Uuid + crm BigInt? + ats BigInt? + hris BigInt? + accounting BigInt? + filestorage BigInt? + ecommerce BigInt? + ticketing BigInt? + created_at DateTime @default(now()) @db.Timestamptz(6) + modified_at DateTime @default(now()) @db.Timestamptz(6) + id_project String @unique(map: "uq_projects_pull_frequency_project") @db.Uuid + projects projects @relation(fields: [id_project], references: [id_project], onDelete: NoAction, onUpdate: NoAction, map: "fk_projects_pull_frequency_project") +} diff --git a/packages/api/scripts/connectorUpdate.js b/packages/api/scripts/connectorUpdate.js index b8eb6f582..91a7803ce 100755 --- a/packages/api/scripts/connectorUpdate.js +++ b/packages/api/scripts/connectorUpdate.js @@ -265,7 +265,10 @@ function updateModuleFileForMapper(moduleFile, newServiceDirs, objectType) { // Generate and insert new service imports newServiceDirs.forEach((serviceName) => { const mapperClass = - serviceName.charAt(0).toUpperCase() + serviceName.slice(1) + objectType + 'Mapper'; + serviceName.charAt(0).toUpperCase() + + serviceName.slice(1) + + objectType + + 'Mapper'; const importStatement = `import { ${mapperClass} } from './services/${serviceName}/mappers';\n`; if (!moduleFileContent.includes(importStatement)) { moduleFileContent = importStatement + moduleFileContent; @@ -404,17 +407,20 @@ function updateSeedSQLFile(seedSQLFile, newServiceDirs, vertical) { fileContent = fileContent.replace(lastMatch[1], newColumnsSection); // Update each VALUES section - fileContent = fileContent.replace(/INSERT INTO connector_sets \(([^)]+)\) VALUES(.*?);/gs, (match) => { - return match - .replace(/\),\s*\(/g, '),\n (') // Fix line formatting - .replace(/\([^\)]+\)/g, (values, index) => { - if (values.startsWith('(id_connector_set')) { - return values - } - let newValues = newColumns.map(() => 'TRUE').join(', '); - return values.slice(0, -1) + ', ' + newValues + ')'; - }); - }); + fileContent = fileContent.replace( + /INSERT INTO connector_sets \(([^)]+)\) VALUES(.*?);/gs, + (match) => { + return match + .replace(/\),\s*\(/g, '),\n (') // Fix line formatting + .replace(/\([^\)]+\)/g, (values, index) => { + if (values.startsWith('(id_connector_set')) { + return values; + } + let newValues = newColumns.map(() => 'TRUE').join(', '); + return values.slice(0, -1) + ', ' + newValues + ')'; + }); + }, + ); } // Write the modified content back to the file console.log(fileContent); @@ -427,9 +433,10 @@ function updateSeedSQLFile(seedSQLFile, newServiceDirs, vertical) { function updateObjectTypes(baseDir, objectType, vertical) { const __dirname = path.dirname(fileURLToPath(import.meta.url)); const servicesDir = path.join(__dirname, baseDir); + const targetFilename = vertical == 'filestorage' ? 'file-storage' : vertical; const targetFile = path.join( __dirname, - `../src/@core/utils/types/original/original.${vertical}.ts`, + `../src/@core/utils/types/original/original.${targetFilename}.ts`, ); const newServiceDirs = scanDirectory(servicesDir); @@ -468,7 +475,7 @@ function updateObjectTypes(baseDir, objectType, vertical) { ); updateModuleFileForService(moduleFile, newServiceDirs); - updateModuleFileForMapper(moduleFile, newServiceDirs, objectType) + updateModuleFileForMapper(moduleFile, newServiceDirs, objectType); // Path to the mappings file // const mappingsFile = path.join( @@ -522,4 +529,4 @@ if (import.meta.url === process.argv[1]) { const argv = yargs(hideBin(process.argv)).argv; const baseDir = `../src/${argv.vertical.toLowerCase()}/${argv.objectType.toLowerCase()}/services`; -updateObjectTypes(baseDir, argv.objectType, argv.vertical); \ No newline at end of file +updateObjectTypes(baseDir, argv.objectType, argv.vertical); diff --git a/packages/api/src/@core/connections/filestorage/services/sharepoint/sharepoint.service.ts b/packages/api/src/@core/connections/filestorage/services/sharepoint/sharepoint.service.ts index 3ff6d03c6..e3a7211bd 100644 --- a/packages/api/src/@core/connections/filestorage/services/sharepoint/sharepoint.service.ts +++ b/packages/api/src/@core/connections/filestorage/services/sharepoint/sharepoint.service.ts @@ -122,7 +122,8 @@ export class SharepointConnectionService extends AbstractBaseConnectionService { grant_type: 'authorization_code', }); const res = await axios.post( - `https://app.sharepoint.com/oauth2/tokens`, + // `https://app.sharepoint.com/oauth2/tokens`, + `https://login.microsoftonline.com/common/oauth2/v2.0/token`, formData.toString(), { headers: { @@ -214,7 +215,8 @@ export class SharepointConnectionService extends AbstractBaseConnectionService { )) as OAuth2AuthData; const res = await axios.post( - `https://app.sharepoint.com/oauth2/tokens`, + // `https://app.sharepoint.com/oauth2/tokens`, + `https://login.microsoftonline.com/common/oauth2/v2.0/token`, formData.toString(), { headers: { diff --git a/packages/api/src/@core/sync/sync.service.ts b/packages/api/src/@core/sync/sync.service.ts index f3b870096..6a8ee2950 100644 --- a/packages/api/src/@core/sync/sync.service.ts +++ b/packages/api/src/@core/sync/sync.service.ts @@ -396,6 +396,7 @@ export class CoreSyncService { try { await task(); } catch (error) { + console.log(error); this.logger.error(`File Storage Task failed: ${error.message}`, error); } } diff --git a/packages/api/src/@core/utils/types/original/original.file-storage.ts b/packages/api/src/@core/utils/types/original/original.file-storage.ts index 725bf27a2..fb5658624 100644 --- a/packages/api/src/@core/utils/types/original/original.file-storage.ts +++ b/packages/api/src/@core/utils/types/original/original.file-storage.ts @@ -1,3 +1,5 @@ +import { SharepointDriveInput, SharepointDriveOutput } from '@filestorage/drive/services/sharepoint/types'; + /* INPUT */ import { @@ -30,7 +32,7 @@ export type OriginalPermissionInput = any; export type OriginalSharedLinkInput = any; /* drive */ -export type OriginalDriveInput = any; +export type OriginalDriveInput = any | SharepointDriveInput; /* group */ export type OriginalGroupInput = BoxGroupInput; @@ -62,7 +64,7 @@ export type OriginalPermissionOutput = any; export type OriginalSharedLinkOutput = any; /* drive */ -export type OriginalDriveOutput = any; +export type OriginalDriveOutput = any | SharepointDriveOutput; /* group */ export type OriginalGroupOutput = BoxGroupOutput; diff --git a/packages/api/src/filestorage/drive/drive.module.ts b/packages/api/src/filestorage/drive/drive.module.ts index b0fc715fe..9b10720b3 100644 --- a/packages/api/src/filestorage/drive/drive.module.ts +++ b/packages/api/src/filestorage/drive/drive.module.ts @@ -1,3 +1,5 @@ +import { SharepointDriveMapper } from './services/sharepoint/mappers'; +import { SharepointService } from './services/sharepoint'; import { BullQueueModule } from '@@core/@core-services/queues/queue.module'; import { WebhookService } from '@@core/@core-services/webhooks/panora-webhooks/webhook.service'; import { Module } from '@nestjs/common'; @@ -17,6 +19,8 @@ import { Utils } from '@filestorage/@lib/@utils'; ServiceRegistry, Utils, /* PROVIDERS SERVICES */ + SharepointService, + SharepointDriveMapper, ], exports: [SyncService], }) diff --git a/packages/api/src/filestorage/drive/services/sharepoint/index.ts b/packages/api/src/filestorage/drive/services/sharepoint/index.ts new file mode 100644 index 000000000..9fece13b1 --- /dev/null +++ b/packages/api/src/filestorage/drive/services/sharepoint/index.ts @@ -0,0 +1,71 @@ +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 { ApiResponse } from '@@core/utils/types'; +import { SyncParam } from '@@core/utils/types/interface'; +import { FileStorageObject } from '@filestorage/@lib/@types'; +import { IDriveService } from '@filestorage/drive/types'; +import { Injectable } from '@nestjs/common'; +import axios from 'axios'; +import { ServiceRegistry } from '../registry.service'; +import { SharepointDriveOutput } from './types'; +import { DesunifyReturnType } from '@@core/utils/types/desunify.input'; +import { OriginalDriveOutput } from '@@core/utils/types/original/original.file-storage'; + +@Injectable() +export class SharepointService implements IDriveService { + constructor( + private prisma: PrismaService, + private logger: LoggerService, + private cryptoService: EncryptionService, + private registry: ServiceRegistry, + ) { + this.logger.setContext( + `${FileStorageObject.file.toUpperCase()}:${SharepointService.name}`, + ); + this.registry.registerService('sharepoint', this); + } + + async addDrive( + driveData: DesunifyReturnType, + linkedUserId: string, + ): Promise> { + // No API to add drive in Sharepoint + return; + } + + async sync(data: SyncParam): Promise> { + try { + const { linkedUserId } = data; + + const connection = await this.prisma.connections.findFirst({ + where: { + id_linked_user: linkedUserId, + provider_slug: 'sharepoint', + vertical: 'filestorage', + }, + }); + + const resp = await axios.get(`${connection.account_url}/drives`, { + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${this.cryptoService.decrypt( + connection.access_token, + )}`, + }, + }); + + const drives: SharepointDriveOutput[] = resp.data.value; + this.logger.log(`Synced sharepoint drives !`); + + return { + data: drives, + message: 'Sharepoint drives retrived', + statusCode: 200, + }; + } catch (error) { + console.log(error.response); + throw error; + } + } +} diff --git a/packages/api/src/filestorage/drive/services/sharepoint/mappers.ts b/packages/api/src/filestorage/drive/services/sharepoint/mappers.ts new file mode 100644 index 000000000..4b11e0283 --- /dev/null +++ b/packages/api/src/filestorage/drive/services/sharepoint/mappers.ts @@ -0,0 +1,86 @@ +import { MappersRegistry } from '@@core/@core-services/registries/mappers.registry'; +import { CoreUnification } from '@@core/@core-services/unification/core-unification.service'; +import { Utils } from '@filestorage/@lib/@utils'; +import { + UnifiedFilestorageDriveInput, + UnifiedFilestorageDriveOutput, +} from '@filestorage/drive/types/model.unified'; +import { Injectable } from '@nestjs/common'; +import { SharepointDriveInput, SharepointDriveOutput } from './types'; +import { IDriveMapper } from '@filestorage/drive/types'; + +@Injectable() +export class SharepointDriveMapper implements IDriveMapper { + constructor( + private mappersRegistry: MappersRegistry, + private utils: Utils, + private coreUnificationService: CoreUnification, + ) { + this.mappersRegistry.registerService( + 'filestorage', + 'drive', + 'sharepoint', + this, + ); + } + + async desunify( + source: UnifiedFilestorageDriveInput, + customFieldMappings?: { + slug: string; + remote_id: string; + }[], + ): Promise { + return; + } + + async unify( + source: SharepointDriveOutput | SharepointDriveOutput[], + connectionId: string, + customFieldMappings?: { + slug: string; + remote_id: string; + }[], + ): Promise { + if (!Array.isArray(source)) { + return await this.mapSingleDriveToUnified( + source, + connectionId, + customFieldMappings, + ); + } + // Handling array of SharepointDriveOutput + return Promise.all( + source.map((drive) => + this.mapSingleDriveToUnified(drive, connectionId, customFieldMappings), + ), + ); + } + + private async mapSingleDriveToUnified( + drive: SharepointDriveOutput, + connectionId: string, + customFieldMappings?: { + slug: string; + remote_id: string; + }[], + ): Promise { + const field_mappings: { [key: string]: any } = {}; + if (customFieldMappings) { + for (const mapping of customFieldMappings) { + field_mappings[mapping.slug] = drive[mapping.remote_id]; + } + } + + const result: UnifiedFilestorageDriveOutput = { + remote_id: drive.id, + remote_data: drive, + name: drive.name, + remote_created_at: drive.createdDateTime, + drive_url: drive.webUrl, + field_mappings, + }; + + return result; + } +} diff --git a/packages/api/src/filestorage/drive/services/sharepoint/types.ts b/packages/api/src/filestorage/drive/services/sharepoint/types.ts new file mode 100644 index 000000000..8ce603089 --- /dev/null +++ b/packages/api/src/filestorage/drive/services/sharepoint/types.ts @@ -0,0 +1,130 @@ +/** + * Represents the response from the Sharepoint API for a specific drive. + * @see https://learn.microsoft.com/en-us/graph/api/resources/drive?view=graph-rest-1.0 + */ +export interface SharepointDriveOutput { + /** The date and time when the drive was created. */ + readonly createdDateTime: string; + /** A user-visible description of the drive. */ + description: string; + /** The unique identifier of the drive. */ + readonly id: string; + /** The date and time when the drive was last modified. */ + readonly lastModifiedDateTime: string; + /** The name of the drive. */ + name: string; + /** URL that displays the resource in the browser. */ + readonly webUrl: string; + /** Describes the type of drive represented by this resource. */ + readonly driveType: 'personal' | 'business' | 'documentLibrary'; + /** Identity of the user, device, or application which created the item. Read-only. */ + readonly createdBy: IdentitySet; + /** Identity of the user, device, and application which last modified the item. Read-only. */ + readonly lastModifiedBy: IdentitySet; + /** The user account that owns the drive. */ + readonly owner?: IdentitySet; + /** Information about the drive's storage space quota. */ + readonly quota?: Quota; + /** SharePoint identifiers for REST compatibility. */ + readonly sharepointIds?: SharepointIds; + /** Indicates that this is a system-managed drive. */ + readonly system?: SystemFacet; +} + +/** + * Represents a set of identities, such as user, device, or application identities. + * @see https://learn.microsoft.com/en-us/graph/api/resources/identityset?view=graph-rest-1.0 + */ +export interface IdentitySet { + /** Identity representing an application. */ + readonly application?: Identity; + /** Identity representing an application instance. */ + readonly applicationInstance?: Identity; + /** Identity representing a conversation. */ + readonly conversation?: Identity; + /** Identity representing a conversation identity type. */ + readonly conversationIdentityType?: Identity; + /** Identity representing a device. */ + readonly device?: Identity; + /** Identity representing encrypted identity information. */ + readonly encrypted?: Identity; + /** Identity representing an on-premises identity. */ + readonly onPremises?: Identity; + /** Identity representing a guest user. */ + readonly guest?: Identity; + /** Identity representing a phone identity. */ + readonly phone?: Identity; + /** Identity representing a user. */ + readonly user?: Identity; +} + +/** + * Represents a generic identity used in various identity sets. + * @see https://learn.microsoft.com/en-us/graph/api/resources/identity?view=graph-rest-1.0 + */ +export interface Identity { + /** The display name of the identity. */ + readonly displayName?: string; + /** The ID of the identity. */ + readonly id?: string; + /** The identity type (such as user, application, or device). */ + readonly identityType?: string; + /** The email address of the identity. */ + readonly email?: string; +} + +/** + * Represents the storage quota information of a drive. + */ +export interface Quota { + /** The total number of bytes deleted from the drive. */ + readonly deleted: number; + /** The total number of bytes remaining in the drive's quota. */ + readonly remaining: number; + /** The state of the drive's quota (e.g., normal, nearing, exceeded). */ + readonly state: 'normal' | 'nearing' | 'critical' | 'exceeded'; + /** The total number of bytes in the drive's quota. */ + readonly total: number; + /** The total number of bytes used in the drive. */ + readonly used: number; + /** Information about storage plan upgrades, if available. */ + readonly storagePlanInformation?: StoragePlanInformation; +} + +/** + * Represents storage plan upgrade information. + */ +export interface StoragePlanInformation { + /** Indicates whether an upgrade is available for the storage plan. */ + readonly upgradeAvailable: boolean; +} + +/** + * Represents SharePoint-specific identifiers for an item. + */ +export interface SharepointIds { + /** The unique identifier (GUID) for the item's list in SharePoint. */ + readonly listId: string; + /** An integer identifier for the item within the containing list. */ + readonly listItemId: string; + /** The unique identifier (GUID) for the item within OneDrive for Business or a SharePoint site. */ + readonly listItemUniqueId: string; + /** The unique identifier (GUID) for the item's site collection (SPSite). */ + readonly siteId: string; + /** The SharePoint URL for the site that contains the item. */ + readonly siteUrl: string; + /** The unique identifier (GUID) for the tenancy. */ + readonly tenantId: string; + /** The unique identifier (GUID) for the item's site (SPWeb). */ + readonly webId: string; +} + +/** + * Represents system-related metadata for the drive. + */ +export interface SystemFacet { + // Add properties specific to the system facet if needed. + readonly [key: string]: any; +} + +export type SharepointDriveInput = Partial; diff --git a/packages/api/swagger/swagger-spec.yaml b/packages/api/swagger/swagger-spec.yaml index 01549aaab..6a58b8106 100644 --- a/packages/api/swagger/swagger-spec.yaml +++ b/packages/api/swagger/swagger-spec.yaml @@ -107,6 +107,8 @@ paths: schema: type: string responses: + '200': + description: '' '201': description: '' content: @@ -127,6 +129,8 @@ paths: schema: type: string responses: + '200': + description: '' '201': description: '' content: @@ -181,6 +185,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -305,6 +310,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -396,6 +402,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -485,6 +492,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -620,6 +628,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -744,6 +753,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -868,6 +878,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -991,6 +1002,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -1115,6 +1127,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -1239,6 +1252,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -1330,6 +1344,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -1453,6 +1468,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -1544,6 +1560,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -1636,6 +1653,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -1763,6 +1781,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -1854,6 +1873,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -2153,11 +2173,15 @@ paths: required: false in: query schema: + minimum: 1 + default: 1 type: number - name: limit required: false in: query schema: + minimum: 1 + default: 10 type: number responses: '200': @@ -2193,6 +2217,12 @@ paths: application/json: schema: type: object + '201': + description: '' + content: + application/json: + schema: + type: object tags: &ref_21 - passthrough x-speakeasy-group: passthrough @@ -2238,6 +2268,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -2329,6 +2360,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -2420,6 +2452,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -2511,6 +2544,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -2602,6 +2636,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -2694,6 +2729,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -2817,6 +2853,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -2909,6 +2946,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -3000,6 +3038,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -3091,6 +3130,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -3182,6 +3222,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -3273,6 +3314,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -3364,6 +3406,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -3487,6 +3530,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -3578,6 +3622,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -3701,6 +3746,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -3830,6 +3876,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -3961,6 +4008,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -4090,6 +4138,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -4219,6 +4268,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -4313,6 +4363,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -4407,6 +4458,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -4535,6 +4587,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -4629,6 +4682,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -4757,6 +4811,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -4851,6 +4906,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -4975,6 +5031,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -5099,6 +5156,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -5223,6 +5281,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -5347,6 +5406,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -5438,6 +5498,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -5562,6 +5623,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -5654,6 +5716,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -5745,6 +5808,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -5836,6 +5900,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -5927,6 +5992,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -6018,6 +6084,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -6109,6 +6176,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -6200,6 +6268,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -6291,6 +6360,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -6380,6 +6450,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -6504,6 +6575,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -6595,6 +6667,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -6720,6 +6793,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -6812,6 +6886,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -6904,6 +6979,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -6996,6 +7072,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -7120,6 +7197,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -7212,6 +7290,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -7336,6 +7415,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -7428,6 +7508,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -7552,6 +7633,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -7643,6 +7725,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -7768,6 +7851,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -7892,6 +7976,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -7984,6 +8069,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -8109,6 +8195,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -8200,6 +8287,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -8292,6 +8380,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -8384,6 +8473,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -8476,6 +8566,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -8567,6 +8658,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -8691,6 +8783,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -8815,6 +8908,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -8906,6 +9000,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -8997,6 +9092,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -9119,6 +9215,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -9241,6 +9338,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -9330,6 +9428,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -9420,6 +9519,7 @@ paths: example: 10 description: Set to get the number of records. schema: + default: 50 type: number - name: cursor required: false @@ -9550,7 +9650,6 @@ components: password_hash: type: string required: - - id_user - email - password_hash Connection: @@ -9638,8 +9737,8 @@ components: description: The unique UUID of the webhook. endpoint_description: type: string - example: Webhook to receive connection events nullable: true + example: Webhook to receive connection events description: The description of the webhook. url: type: string @@ -9677,8 +9776,8 @@ components: last_update: format: date-time type: string - example: '2024-10-01T12:00:00Z' nullable: true + example: '2024-10-01T12:00:00Z' description: The last update date of the webhook. required: - id_webhook_endpoint @@ -9713,7 +9812,6 @@ components: type: string required: - url - - description - scope SignatureVerificationDto: type: object @@ -11653,8 +11751,6 @@ components: - id_project - name - sync_mode - - pull_frequency - - redirect_url - id_user - id_connector_set CreateProjectDto: @@ -12023,10 +12119,10 @@ components: type: object properties: method: - type: string enum: - GET - POST + type: string path: type: string nullable: true @@ -12045,12 +12141,11 @@ components: type: object additionalProperties: true nullable: true + headers: + type: object required: - method - path - - data - - request_format - - overrideBaseUrl UnifiedHrisBankinfoOutput: type: object properties: diff --git a/packages/shared/src/connectors/enum.ts b/packages/shared/src/connectors/enum.ts index 8067be7a8..bc9481d6f 100644 --- a/packages/shared/src/connectors/enum.ts +++ b/packages/shared/src/connectors/enum.ts @@ -1,30 +1,31 @@ export enum CrmConnectors { - ZOHO = 'zoho', - ZENDESK = 'zendesk', - HUBSPOT = 'hubspot', - PIPEDRIVE = 'pipedrive', - ATTIO = 'attio', - CLOSE = 'close', - MICROSOFTDYNAMICSSALES = 'microsoftdynamicssales' + ZOHO = 'zoho', + ZENDESK = 'zendesk', + HUBSPOT = 'hubspot', + PIPEDRIVE = 'pipedrive', + ATTIO = 'attio', + CLOSE = 'close', + MICROSOFTDYNAMICSSALES = 'microsoftdynamicssales', } export enum EcommerceConnectors { - SHOPIFY = 'shopify', - WOOCOMMERCE = 'woocommerce', - SQUARESPACE = 'squarespace', - AMAZON = 'amazon', - WEBFLOW = 'webflow' + SHOPIFY = 'shopify', + WOOCOMMERCE = 'woocommerce', + SQUARESPACE = 'squarespace', + AMAZON = 'amazon', + WEBFLOW = 'webflow', } export enum TicketingConnectors { - ZENDESK = 'zendesk', - FRONT = 'front', - JIRA = 'jira', - GITHUB = 'github', - GITLAB = 'gitlab', - LINEAR = 'linear' + ZENDESK = 'zendesk', + FRONT = 'front', + JIRA = 'jira', + GITHUB = 'github', + GITLAB = 'gitlab', + LINEAR = 'linear', } export enum FilestorageConnectors { - BOX = 'box' + BOX = 'box', + SHAREPOINT = 'sharepoint', } diff --git a/packages/shared/src/connectors/index.ts b/packages/shared/src/connectors/index.ts index d06c9a292..b0d6e188f 100644 --- a/packages/shared/src/connectors/index.ts +++ b/packages/shared/src/connectors/index.ts @@ -4,5 +4,5 @@ export const ATS_PROVIDERS = ['ashby']; export const ACCOUNTING_PROVIDERS = []; export const TICKETING_PROVIDERS = ['zendesk', 'front', 'jira', 'gorgias', 'gitlab', 'github', 'linear']; export const MARKETINGAUTOMATION_PROVIDERS = []; -export const FILESTORAGE_PROVIDERS = ['box']; +export const FILESTORAGE_PROVIDERS = ['box', 'sharepoint']; export const ECOMMERCE_PROVIDERS = ['shopify', 'woocommerce', 'squarespace', 'amazon', 'webflow'];