ibm-cloud-sdk-core 2.17.15 → 3.1.0

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.
Files changed (36) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/auth/authenticators/authenticator-interface.d.ts +1 -1
  3. package/auth/authenticators/authenticator.d.ts +1 -1
  4. package/auth/authenticators/basic-authenticator.d.ts +1 -1
  5. package/auth/authenticators/token-request-based-authenticator.d.ts +1 -1
  6. package/build/docs/ibm-cloud-sdk-core.authenticator.authenticate.md +2 -2
  7. package/build/docs/ibm-cloud-sdk-core.authenticatorinterface.authenticate.md +2 -2
  8. package/build/docs/ibm-cloud-sdk-core.baseservice.md +1 -0
  9. package/build/docs/ibm-cloud-sdk-core.baseservice.setdefaultheaders.md +24 -0
  10. package/build/docs/ibm-cloud-sdk-core.basicauthenticator.authenticate.md +2 -2
  11. package/build/docs/ibm-cloud-sdk-core.buildrequestfileobject.md +2 -2
  12. package/build/docs/ibm-cloud-sdk-core.contenttype.md +1 -1
  13. package/build/docs/ibm-cloud-sdk-core.getcontenttype.md +2 -2
  14. package/build/docs/ibm-cloud-sdk-core.tokenrequestbasedauthenticator.authenticate.md +2 -2
  15. package/docs/ibm-cloud-sdk-core.api.json +80 -51
  16. package/es/auth/authenticators/authenticator-interface.d.ts +1 -1
  17. package/es/auth/authenticators/authenticator.d.ts +1 -1
  18. package/es/auth/authenticators/basic-authenticator.d.ts +1 -1
  19. package/es/auth/authenticators/token-request-based-authenticator.d.ts +1 -1
  20. package/es/lib/base-service.d.ts +6 -0
  21. package/es/lib/base-service.js +12 -0
  22. package/es/lib/content-type.d.ts +1 -1
  23. package/es/lib/helper.d.ts +2 -2
  24. package/es/lib/helper.js +62 -48
  25. package/es/lib/request-wrapper.js +3 -3
  26. package/etc/ibm-cloud-sdk-core.api.md +8 -7
  27. package/ibm-cloud-sdk-core.d.ts +13 -7
  28. package/lib/base-service.d.ts +6 -0
  29. package/lib/base-service.js +12 -0
  30. package/lib/content-type.d.ts +1 -1
  31. package/lib/helper.d.ts +2 -2
  32. package/lib/helper.js +104 -50
  33. package/lib/request-wrapper.js +25 -16
  34. package/package.json +2 -2
  35. package/temp/ibm-cloud-sdk-core.api.json +80 -51
  36. package/temp/ibm-cloud-sdk-core.api.md +8 -7
package/CHANGELOG.md CHANGED
@@ -1,3 +1,34 @@
1
+ # [3.1.0](https://github.com/IBM/node-sdk-core/compare/v3.0.1...v3.1.0) (2022-07-28)
2
+
3
+
4
+ ### Features
5
+
6
+ * add `setDefaultHeaders` method on base service class ([#207](https://github.com/IBM/node-sdk-core/issues/207)) ([29bec13](https://github.com/IBM/node-sdk-core/commit/29bec13b67ea08071be488af62b919899f21ec50))
7
+
8
+ ## [3.0.1](https://github.com/IBM/node-sdk-core/compare/v3.0.0...v3.0.1) (2022-07-28)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * correct AuthenticatorInterface type ([#206](https://github.com/IBM/node-sdk-core/issues/206)) ([31dc7bd](https://github.com/IBM/node-sdk-core/commit/31dc7bd1e744a071cdabc2b5bf1e9513024079ac)), closes [#176](https://github.com/IBM/node-sdk-core/issues/176)
14
+
15
+ # [3.0.0](https://github.com/IBM/node-sdk-core/compare/v2.17.15...v3.0.0) (2022-07-28)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * update file-type to resolve vulnerability ([#205](https://github.com/IBM/node-sdk-core/issues/205)) ([843e66d](https://github.com/IBM/node-sdk-core/commit/843e66d10aeb43dc5a0f7c9583f93ce6a5dbaa7e)), closes [#204](https://github.com/IBM/node-sdk-core/issues/204)
21
+
22
+
23
+ ### BREAKING CHANGES
24
+
25
+ * two synchronous public functions are now asynchronous
26
+
27
+ The function `getContentType` formerly returned a string but now returns a
28
+ Promise that resolves to a string. The function `buildRequestFileObject`
29
+ formerly returned a `FileObject` but now returns a Promise that resolves to
30
+ a `FileObject`.
31
+
1
32
  ## [2.17.15](https://github.com/IBM/node-sdk-core/compare/v2.17.14...v2.17.15) (2022-07-05)
2
33
 
3
34
 
@@ -38,7 +38,7 @@ export interface AuthenticatorInterface {
38
38
  * @param {object.<string, string>} requestOptions.headers The headers the
39
39
  * authentication information will be added to.
40
40
  */
41
- authenticate(requestOptions: AuthenticateOptions): Promise<void | Error>;
41
+ authenticate(requestOptions: AuthenticateOptions): Promise<void>;
42
42
  /**
43
43
  * Returns a string that indicates the authentication type.
44
44
  */
@@ -46,7 +46,7 @@ export declare class Authenticator implements AuthenticatorInterface {
46
46
  * @throws {Error} - The authenticate method was not implemented by a
47
47
  * subclass.
48
48
  */
49
- authenticate(requestOptions: AuthenticateOptions): Promise<void | Error>;
49
+ authenticate(requestOptions: AuthenticateOptions): Promise<void>;
50
50
  /**
51
51
  * Retrieves the authenticator's type.
52
52
  * The returned value will be the same string that is used
@@ -55,7 +55,7 @@ export declare class BasicAuthenticator extends Authenticator {
55
55
  * @param {object.<string, string>} requestOptions.headers - The headers the
56
56
  * authentication information will be added too.
57
57
  */
58
- authenticate(requestOptions: AuthenticateOptions): Promise<void | Error>;
58
+ authenticate(requestOptions: AuthenticateOptions): Promise<void>;
59
59
  /**
60
60
  * Returns the authenticator's type ('basic').
61
61
  *
@@ -87,5 +87,5 @@ export declare class TokenRequestBasedAuthenticator extends Authenticator {
87
87
  * authentication information will be added too. Overrides default headers
88
88
  * where there's conflict.
89
89
  */
90
- authenticate(requestOptions: AuthenticateOptions): Promise<void | Error>;
90
+ authenticate(requestOptions: AuthenticateOptions): Promise<void>;
91
91
  }
@@ -9,7 +9,7 @@ Augment the request with authentication information.
9
9
  <b>Signature:</b>
10
10
 
11
11
  ```typescript
12
- authenticate(requestOptions: AuthenticateOptions): Promise<void | Error>;
12
+ authenticate(requestOptions: AuthenticateOptions): Promise<void>;
13
13
  ```
14
14
 
15
15
  ## Parameters
@@ -20,7 +20,7 @@ authenticate(requestOptions: AuthenticateOptions): Promise<void | Error>;
20
20
 
21
21
  <b>Returns:</b>
22
22
 
23
- Promise&lt;void \| Error&gt;
23
+ Promise&lt;void&gt;
24
24
 
25
25
  ## Exceptions
26
26
 
@@ -9,7 +9,7 @@ Add authentication information to the specified request.
9
9
  <b>Signature:</b>
10
10
 
11
11
  ```typescript
12
- authenticate(requestOptions: AuthenticateOptions): Promise<void | Error>;
12
+ authenticate(requestOptions: AuthenticateOptions): Promise<void>;
13
13
  ```
14
14
 
15
15
  ## Parameters
@@ -20,5 +20,5 @@ authenticate(requestOptions: AuthenticateOptions): Promise<void | Error>;
20
20
 
21
21
  <b>Returns:</b>
22
22
 
23
- Promise&lt;void \| Error&gt;
23
+ Promise&lt;void&gt;
24
24
 
@@ -38,6 +38,7 @@ export declare class BaseService
38
38
  | [enableRetries(retryOptions)](./ibm-cloud-sdk-core.baseservice.enableretries.md) | | Enable retries for unfulfilled requests. |
39
39
  | [getAuthenticator()](./ibm-cloud-sdk-core.baseservice.getauthenticator.md) | | Get the instance of the authenticator set on the service. |
40
40
  | [getHttpClient()](./ibm-cloud-sdk-core.baseservice.gethttpclient.md) | | Get the Axios instance set on the service. All requests will be made using this instance. |
41
+ | [setDefaultHeaders(headers)](./ibm-cloud-sdk-core.baseservice.setdefaultheaders.md) | | Set the HTTP headers to be sent in every request. |
41
42
  | [setEnableGzipCompression(setting)](./ibm-cloud-sdk-core.baseservice.setenablegzipcompression.md) | | Turn request body compression on or off. |
42
43
  | [setServiceUrl(url)](./ibm-cloud-sdk-core.baseservice.setserviceurl.md) | | Set the service URL to send requests to. |
43
44
 
@@ -0,0 +1,24 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [ibm-cloud-sdk-core](./ibm-cloud-sdk-core.md) &gt; [BaseService](./ibm-cloud-sdk-core.baseservice.md) &gt; [setDefaultHeaders](./ibm-cloud-sdk-core.baseservice.setdefaultheaders.md)
4
+
5
+ ## BaseService.setDefaultHeaders() method
6
+
7
+ Set the HTTP headers to be sent in every request.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ setDefaultHeaders(headers: OutgoingHttpHeaders): void;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ | Parameter | Type | Description |
18
+ | --- | --- | --- |
19
+ | headers | OutgoingHttpHeaders | The map of headers to include in requests. |
20
+
21
+ <b>Returns:</b>
22
+
23
+ void
24
+
@@ -11,7 +11,7 @@ Authorization: Basic &lt;<!-- -->encoded username and password<!-- -->&gt;
11
11
  <b>Signature:</b>
12
12
 
13
13
  ```typescript
14
- authenticate(requestOptions: AuthenticateOptions): Promise<void | Error>;
14
+ authenticate(requestOptions: AuthenticateOptions): Promise<void>;
15
15
  ```
16
16
 
17
17
  ## Parameters
@@ -22,5 +22,5 @@ authenticate(requestOptions: AuthenticateOptions): Promise<void | Error>;
22
22
 
23
23
  <b>Returns:</b>
24
24
 
25
- Promise&lt;void \| Error&gt;
25
+ Promise&lt;void&gt;
26
26
 
@@ -9,7 +9,7 @@ This function builds a `form-data` object for each file parameter.
9
9
  <b>Signature:</b>
10
10
 
11
11
  ```typescript
12
- export declare function buildRequestFileObject(fileParam: FileWithMetadata): FileObject;
12
+ export declare function buildRequestFileObject(fileParam: FileWithMetadata): Promise<FileObject>;
13
13
  ```
14
14
 
15
15
  ## Parameters
@@ -20,7 +20,7 @@ export declare function buildRequestFileObject(fileParam: FileWithMetadata): Fil
20
20
 
21
21
  <b>Returns:</b>
22
22
 
23
- [FileObject](./ibm-cloud-sdk-core.fileobject.md)
23
+ Promise&lt;[FileObject](./ibm-cloud-sdk-core.fileobject.md)<!-- -->&gt;
24
24
 
25
25
  {<!-- -->FileObject<!-- -->}
26
26
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  ```typescript
10
10
  _default: {
11
- fromFilename: (file: String | File | Buffer | NodeJS.ReadableStream | FileObject) => string;
11
+ fromFilename: (file: String | File | FileObject | NodeJS.ReadableStream | Buffer) => string;
12
12
  fromHeader: (buffer: Buffer) => string;
13
13
  }
14
14
  ```
@@ -9,7 +9,7 @@ This function retrieves the content type of the input.
9
9
  <b>Signature:</b>
10
10
 
11
11
  ```typescript
12
- export declare function getContentType(inputData: NodeJS.ReadableStream | Buffer): string;
12
+ export declare function getContentType(inputData: NodeJS.ReadableStream | Buffer): Promise<string>;
13
13
  ```
14
14
 
15
15
  ## Parameters
@@ -20,7 +20,7 @@ export declare function getContentType(inputData: NodeJS.ReadableStream | Buffer
20
20
 
21
21
  <b>Returns:</b>
22
22
 
23
- string
23
+ Promise&lt;string&gt;
24
24
 
25
25
  {<!-- -->string<!-- -->} the content type of the input.
26
26
 
@@ -11,7 +11,7 @@ Authorization: Bearer <bearer-token>
11
11
  <b>Signature:</b>
12
12
 
13
13
  ```typescript
14
- authenticate(requestOptions: AuthenticateOptions): Promise<void | Error>;
14
+ authenticate(requestOptions: AuthenticateOptions): Promise<void>;
15
15
  ```
16
16
 
17
17
  ## Parameters
@@ -22,5 +22,5 @@ authenticate(requestOptions: AuthenticateOptions): Promise<void | Error>;
22
22
 
23
23
  <b>Returns:</b>
24
24
 
25
- Promise&lt;void \| Error&gt;
25
+ Promise&lt;void&gt;
26
26
 
@@ -350,16 +350,7 @@
350
350
  },
351
351
  {
352
352
  "kind": "Content",
353
- "text": "<void | "
354
- },
355
- {
356
- "kind": "Reference",
357
- "text": "Error",
358
- "canonicalReference": "!Error:interface"
359
- },
360
- {
361
- "kind": "Content",
362
- "text": ">"
353
+ "text": "<void>"
363
354
  },
364
355
  {
365
356
  "kind": "Content",
@@ -370,7 +361,7 @@
370
361
  "isStatic": false,
371
362
  "returnTypeTokenRange": {
372
363
  "startIndex": 3,
373
- "endIndex": 7
364
+ "endIndex": 5
374
365
  },
375
366
  "releaseTag": "Public",
376
367
  "overloadIndex": 1,
@@ -677,16 +668,7 @@
677
668
  },
678
669
  {
679
670
  "kind": "Content",
680
- "text": "<void | "
681
- },
682
- {
683
- "kind": "Reference",
684
- "text": "Error",
685
- "canonicalReference": "!Error:interface"
686
- },
687
- {
688
- "kind": "Content",
689
- "text": ">"
671
+ "text": "<void>"
690
672
  },
691
673
  {
692
674
  "kind": "Content",
@@ -696,7 +678,7 @@
696
678
  "isOptional": false,
697
679
  "returnTypeTokenRange": {
698
680
  "startIndex": 3,
699
- "endIndex": 7
681
+ "endIndex": 5
700
682
  },
701
683
  "releaseTag": "Public",
702
684
  "overloadIndex": 1,
@@ -1106,6 +1088,53 @@
1106
1088
  "parameters": [],
1107
1089
  "name": "getHttpClient"
1108
1090
  },
1091
+ {
1092
+ "kind": "Method",
1093
+ "canonicalReference": "ibm-cloud-sdk-core!BaseService#setDefaultHeaders:member(1)",
1094
+ "docComment": "/**\n * Set the HTTP headers to be sent in every request.\n *\n * @param headers - The map of headers to include in requests.\n */\n",
1095
+ "excerptTokens": [
1096
+ {
1097
+ "kind": "Content",
1098
+ "text": "setDefaultHeaders(headers: "
1099
+ },
1100
+ {
1101
+ "kind": "Reference",
1102
+ "text": "OutgoingHttpHeaders",
1103
+ "canonicalReference": "!\"\\\"http\\\"\".OutgoingHttpHeaders:interface"
1104
+ },
1105
+ {
1106
+ "kind": "Content",
1107
+ "text": "): "
1108
+ },
1109
+ {
1110
+ "kind": "Content",
1111
+ "text": "void"
1112
+ },
1113
+ {
1114
+ "kind": "Content",
1115
+ "text": ";"
1116
+ }
1117
+ ],
1118
+ "isOptional": false,
1119
+ "isStatic": false,
1120
+ "returnTypeTokenRange": {
1121
+ "startIndex": 3,
1122
+ "endIndex": 4
1123
+ },
1124
+ "releaseTag": "Public",
1125
+ "overloadIndex": 1,
1126
+ "parameters": [
1127
+ {
1128
+ "parameterName": "headers",
1129
+ "parameterTypeTokenRange": {
1130
+ "startIndex": 1,
1131
+ "endIndex": 2
1132
+ },
1133
+ "isOptional": false
1134
+ }
1135
+ ],
1136
+ "name": "setDefaultHeaders"
1137
+ },
1109
1138
  {
1110
1139
  "kind": "Method",
1111
1140
  "canonicalReference": "ibm-cloud-sdk-core!BaseService#setEnableGzipCompression:member(1)",
@@ -1280,16 +1309,7 @@
1280
1309
  },
1281
1310
  {
1282
1311
  "kind": "Content",
1283
- "text": "<void | "
1284
- },
1285
- {
1286
- "kind": "Reference",
1287
- "text": "Error",
1288
- "canonicalReference": "!Error:interface"
1289
- },
1290
- {
1291
- "kind": "Content",
1292
- "text": ">"
1312
+ "text": "<void>"
1293
1313
  },
1294
1314
  {
1295
1315
  "kind": "Content",
@@ -1300,7 +1320,7 @@
1300
1320
  "isStatic": false,
1301
1321
  "returnTypeTokenRange": {
1302
1322
  "startIndex": 3,
1303
- "endIndex": 7
1323
+ "endIndex": 5
1304
1324
  },
1305
1325
  "releaseTag": "Public",
1306
1326
  "overloadIndex": 1,
@@ -1639,11 +1659,24 @@
1639
1659
  "kind": "Content",
1640
1660
  "text": "): "
1641
1661
  },
1662
+ {
1663
+ "kind": "Reference",
1664
+ "text": "Promise",
1665
+ "canonicalReference": "!Promise:interface"
1666
+ },
1667
+ {
1668
+ "kind": "Content",
1669
+ "text": "<"
1670
+ },
1642
1671
  {
1643
1672
  "kind": "Reference",
1644
1673
  "text": "FileObject",
1645
1674
  "canonicalReference": "ibm-cloud-sdk-core!FileObject:interface"
1646
1675
  },
1676
+ {
1677
+ "kind": "Content",
1678
+ "text": ">"
1679
+ },
1647
1680
  {
1648
1681
  "kind": "Content",
1649
1682
  "text": ";"
@@ -1651,7 +1684,7 @@
1651
1684
  ],
1652
1685
  "returnTypeTokenRange": {
1653
1686
  "startIndex": 3,
1654
- "endIndex": 4
1687
+ "endIndex": 7
1655
1688
  },
1656
1689
  "releaseTag": "Public",
1657
1690
  "overloadIndex": 1,
@@ -2589,8 +2622,8 @@
2589
2622
  },
2590
2623
  {
2591
2624
  "kind": "Reference",
2592
- "text": "Buffer",
2593
- "canonicalReference": "!Buffer:interface"
2625
+ "text": "FileObject",
2626
+ "canonicalReference": "ibm-cloud-sdk-core!FileObject:interface"
2594
2627
  },
2595
2628
  {
2596
2629
  "kind": "Content",
@@ -2607,8 +2640,8 @@
2607
2640
  },
2608
2641
  {
2609
2642
  "kind": "Reference",
2610
- "text": "FileObject",
2611
- "canonicalReference": "ibm-cloud-sdk-core!FileObject:interface"
2643
+ "text": "Buffer",
2644
+ "canonicalReference": "!Buffer:interface"
2612
2645
  },
2613
2646
  {
2614
2647
  "kind": "Content",
@@ -3185,9 +3218,14 @@
3185
3218
  "kind": "Content",
3186
3219
  "text": "): "
3187
3220
  },
3221
+ {
3222
+ "kind": "Reference",
3223
+ "text": "Promise",
3224
+ "canonicalReference": "!Promise:interface"
3225
+ },
3188
3226
  {
3189
3227
  "kind": "Content",
3190
- "text": "string"
3228
+ "text": "<string>"
3191
3229
  },
3192
3230
  {
3193
3231
  "kind": "Content",
@@ -3196,7 +3234,7 @@
3196
3234
  ],
3197
3235
  "returnTypeTokenRange": {
3198
3236
  "startIndex": 5,
3199
- "endIndex": 6
3237
+ "endIndex": 7
3200
3238
  },
3201
3239
  "releaseTag": "Public",
3202
3240
  "overloadIndex": 1,
@@ -5892,16 +5930,7 @@
5892
5930
  },
5893
5931
  {
5894
5932
  "kind": "Content",
5895
- "text": "<void | "
5896
- },
5897
- {
5898
- "kind": "Reference",
5899
- "text": "Error",
5900
- "canonicalReference": "!Error:interface"
5901
- },
5902
- {
5903
- "kind": "Content",
5904
- "text": ">"
5933
+ "text": "<void>"
5905
5934
  },
5906
5935
  {
5907
5936
  "kind": "Content",
@@ -5912,7 +5941,7 @@
5912
5941
  "isStatic": false,
5913
5942
  "returnTypeTokenRange": {
5914
5943
  "startIndex": 3,
5915
- "endIndex": 7
5944
+ "endIndex": 5
5916
5945
  },
5917
5946
  "releaseTag": "Public",
5918
5947
  "overloadIndex": 1,
@@ -38,7 +38,7 @@ export interface AuthenticatorInterface {
38
38
  * @param {object.<string, string>} requestOptions.headers The headers the
39
39
  * authentication information will be added to.
40
40
  */
41
- authenticate(requestOptions: AuthenticateOptions): Promise<void | Error>;
41
+ authenticate(requestOptions: AuthenticateOptions): Promise<void>;
42
42
  /**
43
43
  * Returns a string that indicates the authentication type.
44
44
  */
@@ -46,7 +46,7 @@ export declare class Authenticator implements AuthenticatorInterface {
46
46
  * @throws {Error} - The authenticate method was not implemented by a
47
47
  * subclass.
48
48
  */
49
- authenticate(requestOptions: AuthenticateOptions): Promise<void | Error>;
49
+ authenticate(requestOptions: AuthenticateOptions): Promise<void>;
50
50
  /**
51
51
  * Retrieves the authenticator's type.
52
52
  * The returned value will be the same string that is used
@@ -55,7 +55,7 @@ export declare class BasicAuthenticator extends Authenticator {
55
55
  * @param {object.<string, string>} requestOptions.headers - The headers the
56
56
  * authentication information will be added too.
57
57
  */
58
- authenticate(requestOptions: AuthenticateOptions): Promise<void | Error>;
58
+ authenticate(requestOptions: AuthenticateOptions): Promise<void>;
59
59
  /**
60
60
  * Returns the authenticator's type ('basic').
61
61
  *
@@ -87,5 +87,5 @@ export declare class TokenRequestBasedAuthenticator extends Authenticator {
87
87
  * authentication information will be added too. Overrides default headers
88
88
  * where there's conflict.
89
89
  */
90
- authenticate(requestOptions: AuthenticateOptions): Promise<void | Error>;
90
+ authenticate(requestOptions: AuthenticateOptions): Promise<void>;
91
91
  }
@@ -87,6 +87,12 @@ export declare class BaseService {
87
87
  * @param {string} url The base URL for the service.
88
88
  */
89
89
  setServiceUrl(url: string): void;
90
+ /**
91
+ * Set the HTTP headers to be sent in every request.
92
+ *
93
+ * @param {OutgoingHttpHeaders} headers The map of headers to include in requests.
94
+ */
95
+ setDefaultHeaders(headers: OutgoingHttpHeaders): void;
90
96
  /**
91
97
  * Turn request body compression on or off.
92
98
  *
@@ -90,6 +90,18 @@ export class BaseService {
90
90
  this.baseOptions.serviceUrl = stripTrailingSlash(url);
91
91
  }
92
92
  }
93
+ /**
94
+ * Set the HTTP headers to be sent in every request.
95
+ *
96
+ * @param {OutgoingHttpHeaders} headers The map of headers to include in requests.
97
+ */
98
+ setDefaultHeaders(headers) {
99
+ if (typeof headers !== 'object') {
100
+ // do nothing, for now
101
+ return;
102
+ }
103
+ this.baseOptions.headers = headers;
104
+ }
93
105
  /**
94
106
  * Turn request body compression on or off.
95
107
  *
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { FileObject } from "./helper";
3
3
  declare const _default: {
4
- fromFilename: (file: String | File | Buffer | NodeJS.ReadableStream | FileObject) => string;
4
+ fromFilename: (file: String | File | FileObject | NodeJS.ReadableStream | Buffer) => string;
5
5
  fromHeader: (buffer: Buffer) => string;
6
6
  };
7
7
  export default _default;
@@ -38,7 +38,7 @@ export declare function isEmptyObject(obj: any): boolean;
38
38
  * @param {NodeJS.ReadableStream|Buffer} inputData - The data to retrieve content type for.
39
39
  * @returns {string} the content type of the input.
40
40
  */
41
- export declare function getContentType(inputData: NodeJS.ReadableStream | Buffer): string;
41
+ export declare function getContentType(inputData: NodeJS.ReadableStream | Buffer): Promise<string>;
42
42
  /**
43
43
  *
44
44
  * @param {string} url - the url string.
@@ -104,7 +104,7 @@ export declare function getFormat(params: {
104
104
  * @param {string} fileParam.contentType The content type of the file.
105
105
  * @returns {FileObject}
106
106
  */
107
- export declare function buildRequestFileObject(fileParam: FileWithMetadata): FileObject;
107
+ export declare function buildRequestFileObject(fileParam: FileWithMetadata): Promise<FileObject>;
108
108
  /**
109
109
  * This function converts an object's keys to lower case.
110
110
  * note: does not convert nested keys