@in.pulse-crm/sdk 1.2.1 → 1.2.2

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.
package/dist/file.d.ts CHANGED
@@ -81,6 +81,12 @@ declare class FileSDK {
81
81
  * @returns {Promise<Buffer>} Um buffer contendo os dados do arquivo.
82
82
  */
83
83
  fetchFile(id: number): Promise<Buffer>;
84
+ /**
85
+ * Obtém a URL de download de um arquivo.
86
+ * @param {number} id - ID do arquivo.
87
+ * @returns {string} URL de download do arquivo.
88
+ */
89
+ getFileDownloadUrl(id: number): String;
84
90
  /**
85
91
  * Faz o upload de um arquivo.
86
92
  * @param {UploadFileOptions} props - Opções para o upload do arquivo.
package/dist/file.js CHANGED
@@ -37,6 +37,14 @@ class FileSDK {
37
37
  const buffer = Buffer.from(response.data, "binary");
38
38
  return buffer;
39
39
  }
40
+ /**
41
+ * Obtém a URL de download de um arquivo.
42
+ * @param {number} id - ID do arquivo.
43
+ * @returns {string} URL de download do arquivo.
44
+ */
45
+ getFileDownloadUrl(id) {
46
+ return this.httpClient.defaults.baseURL + `/files/${id}`;
47
+ }
40
48
  /**
41
49
  * Faz o upload de um arquivo.
42
50
  * @param {UploadFileOptions} props - Opções para o upload do arquivo.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@in.pulse-crm/sdk",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
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",
package/src/file.ts CHANGED
@@ -106,6 +106,15 @@ class FileSDK {
106
106
  return buffer;
107
107
  }
108
108
 
109
+ /**
110
+ * Obtém a URL de download de um arquivo.
111
+ * @param {number} id - ID do arquivo.
112
+ * @returns {string} URL de download do arquivo.
113
+ */
114
+ public getFileDownloadUrl(id: number): String {
115
+ return this.httpClient.defaults.baseURL + `/files/${id}`;
116
+ }
117
+
109
118
  /**
110
119
  * Faz o upload de um arquivo.
111
120
  * @param {UploadFileOptions} props - Opções para o upload do arquivo.