@in.pulse-crm/sdk 2.14.6 → 2.14.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import ApiClient from "./api-client";
2
- import { File, UploadFileOptions } from "./types/files.types";
2
+ import { File, FileExistsByHashResponse, UploadFileOptions } from "./types/files.types";
3
3
  declare class FilesClient extends ApiClient {
4
4
  /**
5
5
  * Busca um arquivo pelo ID.
@@ -21,7 +21,7 @@ declare class FilesClient extends ApiClient {
21
21
  * @returns {string} URL de download do arquivo.
22
22
  */
23
23
  getFileDownloadUrl(id: number, baseUrl?: string): string;
24
- getFileByHash(instance: string, hash: string): Promise<File>;
24
+ getFileByHash(instance: string, hash: string): Promise<FileExistsByHashResponse["data"]>;
25
25
  /**
26
26
  * Faz o upload de um arquivo.
27
27
  * @param {UploadFileOptions} props - Opções para o upload do arquivo.
@@ -1,4 +1,5 @@
1
- export interface FileExistsByHashResponse {
1
+ import { DataResponse } from "./response.types";
2
+ export type FileExistsByHashResponse = DataResponse<{
2
3
  /**
3
4
  * Indica se um arquivo com o hash especificado existe.
4
5
  */
@@ -7,7 +8,7 @@ export interface FileExistsByHashResponse {
7
8
  * Os dados do arquivo encontrado, caso exista.
8
9
  */
9
10
  file?: File;
10
- }
11
+ }>;
11
12
  export interface UploadFileOptions {
12
13
  /**
13
14
  * Nome da instância onde o arquivo está armazenado.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@in.pulse-crm/sdk",
3
- "version": "2.14.6",
3
+ "version": "2.14.7",
4
4
  "description": "SDKs for abstraction of api consumption of in.pulse-crm application",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -1,6 +1,6 @@
1
1
  import FormData from "form-data";
2
2
  import ApiClient from "./api-client";
3
- import { File, UploadFileOptions } from "./types/files.types";
3
+ import { File, FileExistsByHashResponse, UploadFileOptions } from "./types/files.types";
4
4
  import { DataResponse } from "./types/response.types";
5
5
 
6
6
  class FilesClient extends ApiClient {
@@ -42,8 +42,8 @@ class FilesClient extends ApiClient {
42
42
  return (baseUrl || this.ax.defaults.baseURL) + `/api/files/${id}`;
43
43
  }
44
44
 
45
- public async getFileByHash(instance: string, hash: string): Promise<File> {
46
- const { data: res } = await this.ax.get<DataResponse<File>>(
45
+ public async getFileByHash(instance: string, hash: string): Promise<FileExistsByHashResponse["data"]> {
46
+ const { data: res } = await this.ax.get<FileExistsByHashResponse>(
47
47
  `/api/files/exists?instance=${instance}&hash=${hash}`,
48
48
  );
49
49
 
@@ -1,4 +1,6 @@
1
- export interface FileExistsByHashResponse {
1
+ import { DataResponse } from "./response.types";
2
+
3
+ export type FileExistsByHashResponse = DataResponse<{
2
4
  /**
3
5
  * Indica se um arquivo com o hash especificado existe.
4
6
  */
@@ -7,7 +9,7 @@ export interface FileExistsByHashResponse {
7
9
  * Os dados do arquivo encontrado, caso exista.
8
10
  */
9
11
  file?: File;
10
- }
12
+ }>;
11
13
 
12
14
  export interface UploadFileOptions {
13
15
  /**