# Class JDriveApi

#### Hierarchy (View Summary)

- JBaseApi
  - JDriveApi

- Defined in jamespot-user-api/src/apis/drive/drive.ts:23

##### Index

### Constructors

constructor

### Properties

jApi
network

### Methods

checkAccountToken
dropboxDocuments
getAccount
getDocument
groups
isAccountLogged
listAccount
logout
msDocuments
setDefaultAccount
sites
tenants

## Constructors

### constructor

- new JDriveApi(jApi: JamespotUserApi): JDriveApi

  #### Parameters

  - jApi: JamespotUserApi

  #### Returns JDriveApi

  Inherited from JBaseApi.constructor

  - Defined in jamespot-user-api/src/apis/base.ts:8

## Properties

### jApi

jApi: JamespotUserApi

Inherited from JBaseApi.jApi

- Defined in jamespot-user-api/src/apis/base.ts:5

### network

network: Network

Inherited from JBaseApi.network

- Defined in jamespot-user-api/src/apis/base.ts:6

## Methods

### checkAccountToken

- checkAccountToken(
  service: string,
  options?: { signal?: AbortSignal },
  ): Promise<ApiWrapper<boolean, BaseMessages>>

  #### Parameters

  - service: string
  - `Optional` options: { signal?: AbortSignal }

  #### Returns Promise<ApiWrapper<boolean, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/drive/drive.ts:107

### dropboxDocuments

- dropboxDocuments(
  params: {
  documentParams: { path_lower: string; query?: string | null };
  id: string;
  },
  options?: { signal?: AbortSignal },
  ): Promise<
  ApiWrapper<
  {
  _extend: { path: string };
  id: string;
  mimetype?: string;
  size?: number;
  title: string;
  type: string;
  webUrl?: string;
  }[],
  BaseMessages,
  >,
  >

  #### Parameters

  - params: { documentParams: { path_lower: string; query?: string | null }; id: string }
  - `Optional` options: { signal?: AbortSignal }

  #### Returns Promise<
  ApiWrapper<
  {
  _extend: { path: string };
  id: string;
  mimetype?: string;
  size?: number;
  title: string;
  type: string;
  webUrl?: string;
  }[],
  BaseMessages,
  >,
  >

  - Defined in jamespot-user-api/src/apis/drive/drive.ts:135

### getAccount

- getAccount(
  params: { id: string; service: string },
  options?: { signal?: AbortSignal },
  ): Promise<
  ApiWrapper<
  {
  account: {
  default?: boolean;
  id: string;
  mail: string;
  title: string;
  };
  },
  BaseMessages,
  >,
  >

  #### Parameters

  - params: { id: string; service: string }
  - `Optional` options: { signal?: AbortSignal }

  #### Returns Promise<
  ApiWrapper<
  {
  account: {
  default?: boolean;
  id: string;
  mail: string;
  title: string;
  };
  },
  BaseMessages,
  >,
  >

  - Defined in jamespot-user-api/src/apis/drive/drive.ts:181

### getDocument

- getDocument<T extends jFileLittle = jFileLittle>(
  params: {
  attrName: string;
  file: {
  _document: {
  id: string;
  mimetype?: string;
  size?: number;
  title: string;
  type: string;
  webUrl?: string;
  };
  account: string;
  mimetype?: string;
  service: string;
  title: string;
  };
  token?: string;
  },
  options?: {
  format?: "raw-little" | "raw-list" | "raw-view";
  signal?: AbortSignal;
  },
  ): Promise<ApiWrapper<T, BaseMessages>>

  #### Type Parameters

  - T extends jFileLittle = jFileLittle

  #### Parameters

  - params: {
    attrName: string;
    file: {
    _document: {
    id: string;
    mimetype?: string;
    size?: number;
    title: string;
    type: string;
    webUrl?: string;
    };
    account: string;
    mimetype?: string;
    service: string;
    title: string;
    };
    token?: string;
    }
  - `Optional` options: { format?: "raw-little" | "raw-list" | "raw-view"; signal?: AbortSignal }

  #### Returns Promise<ApiWrapper<T, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/drive/drive.ts:152

### groups

- groups(
  params: { filter?: string; id: string; query?: string },
  options?: { signal?: AbortSignal },
  ): Promise<
  ApiWrapper<
  {
  id: string;
  title: string;
  type: string;
  visibility?: "public"
  | "private";
  }[],
  BaseMessages,
  >,
  >

  Microsoft graph only

  #### Parameters

  - params: { filter?: string; id: string; query?: string }
  - `Optional` options: { signal?: AbortSignal }

  #### Returns Promise<
  ApiWrapper<
  {
  id: string;
  title: string;
  type: string;
  visibility?: "public"
  | "private";
  }[],
  BaseMessages,
  >,
  >

  - Defined in jamespot-user-api/src/apis/drive/drive.ts:48

### isAccountLogged

- isAccountLogged(
  service: string,
  id: string,
  options?: { signal?: AbortSignal },
  ): Promise<ApiWrapper<boolean, BaseMessages>>

  #### Parameters

  - service: string
  - id: string
  - `Optional` options: { signal?: AbortSignal }

  #### Returns Promise<ApiWrapper<boolean, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/drive/drive.ts:89

### listAccount

- listAccount(
  service: string,
  options?: { signal?: AbortSignal },
  ): Promise<
  ApiWrapper<
  { default?: boolean; id: string; mail: string; title: string }[],
  BaseMessages,
  >,
  >

  #### Parameters

  - service: string
  - `Optional` options: { signal?: AbortSignal }

  #### Returns Promise<
  ApiWrapper<
  { default?: boolean; id: string; mail: string; title: string }[],
  BaseMessages,
  >,
  >

  - Defined in jamespot-user-api/src/apis/drive/drive.ts:78

### logout

- logout(
  params: { id: string; service: string },
  options?: { signal?: AbortSignal },
  ): Promise<ApiWrapper<boolean, BaseMessages>>

  #### Parameters

  - params: { id: string; service: string }
  - `Optional` options: { signal?: AbortSignal }

  #### Returns Promise<ApiWrapper<boolean, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/drive/drive.ts:170

### msDocuments

- msDocuments(
  params: {
  documentParams: {
  idFolder?: string;
  limit: number;
  msId?: string;
  msTenant?: "group" | "groups" | "sites" | "onedrive" | "documents" | "me";
  page: number;
  query?: string | null;
  };
  id: string;
  },
  options?: { signal?: AbortSignal },
  ): Promise<
  ApiWrapper<
  {
  id: string;
  mimetype?: string;
  size?: number;
  title: string;
  type: string;
  webUrl?: string;
  }[],
  BaseMessages,
  >,
  >

  #### Parameters

  - params: {
    documentParams: {
    idFolder?: string;
    limit: number;
    msId?: string;
    msTenant?: "group" | "groups" | "sites" | "onedrive" | "documents" | "me";
    page: number;
    query?: string | null;
    };
    id: string;
    }
  - `Optional` options: { signal?: AbortSignal }

  #### Returns Promise<
  ApiWrapper<
  {
  id: string;
  mimetype?: string;
  size?: number;
  title: string;
  type: string;
  webUrl?: string;
  }[],
  BaseMessages,
  >,
  >

  - Defined in jamespot-user-api/src/apis/drive/drive.ts:118

### setDefaultAccount

- setDefaultAccount(
  params: { account: string; service: string },
  options?: { signal?: AbortSignal },
  ): Promise<ApiWrapper<boolean, BaseMessages>>

  #### Parameters

  - params: { account: string; service: string }
  - `Optional` options: { signal?: AbortSignal }

  #### Returns Promise<ApiWrapper<boolean, BaseMessages>>

  - Defined in jamespot-user-api/src/apis/drive/drive.ts:195

### sites

- sites(
  options?: { signal?: AbortSignal },
  ): Promise<ApiWrapper<BaseEntity[], BaseMessages>>

  Microsoft graph only

  #### Parameters

  - `Optional` options: { signal?: AbortSignal }

  #### Returns Promise<ApiWrapper<BaseEntity[], BaseMessages>>

  - Defined in jamespot-user-api/src/apis/drive/drive.ts:68

### tenants

- tenants(
  params?: { allow?: ("groups" | "me")[]; id: string },
  options?: { signal?: AbortSignal },
  ): Promise<
  ApiWrapper<
  {
  name?: "group"
  | "groups"
  | "sites"
  | "onedrive"
  | "documents"
  | "me";
  title: string;
  type: string;
  }[],
  BaseMessages,
  >,
  >

  Microsoft graph only

  #### Parameters

  - `Optional` params: { allow?: ("groups" | "me")[]; id: string }
  - `Optional` options: { signal?: AbortSignal }

  #### Returns Promise<
  ApiWrapper<
  {
  name?: "group"
  | "groups"
  | "sites"
  | "onedrive"
  | "documents"
  | "me";
  title: string;
  type: string;
  }[],
  BaseMessages,
  >,
  >

  - Defined in jamespot-user-api/src/apis/drive/drive.ts:28