📝 OO connector technical documentation (#547)

This commit is contained in:
Eric Doughty-Papassideris
2024-06-14 12:27:30 +02:00
committed by ericlinagora
parent 5e1ac7b010
commit 6534f23cc2
4 changed files with 33 additions and 1 deletions
@@ -7,6 +7,8 @@ import {
import axios, { Axios, AxiosRequestConfig, AxiosResponse } from 'axios';
import { CREDENTIALS_ENDPOINT, CREDENTIALS_ID, CREDENTIALS_SECRET, ONLY_OFFICE_SERVER } from '@config';
import loggerService from './logger.service';
/** Client for the Twake Drive backend API on behalf of the plugin (or provided token in parameters) */
class ApiService implements IApiService {
private axios: Axios;
private initialized: Promise<string>;
@@ -20,7 +22,7 @@ class ApiService implements IApiService {
setInterval(() => {
this.initialized = this.refreshToken();
loggerService.info('Refreshing token 🪙');
}, 1000 * 60); //Every 10 minutes
}, 1000 * 60); //TODO: should be Every 10 minutes
}
public get = async <T>(params: IApiServiceRequestParams<T>): Promise<T> => {
@@ -2,6 +2,7 @@ import { DriveFileType, IDriveService } from '@/interfaces/drive.interface';
import apiService from './api.service';
import loggerService from './logger.service';
/** Client for the Twake Drive backend API dealing with `DriveItem`s */
class DriveService implements IDriveService {
public get = async (params: { company_id: string; drive_file_id: string; user_token?: string }): Promise<DriveFileType> => {
try {