Skip to content

Commit ae6dcaf

Browse files
committed
Fixed file param bug
1 parent abef666 commit ae6dcaf

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

docs/examples/functions/create-tag.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ client
1212
;
1313

1414

15-
let promise = functions.createTag('[FUNCTION_ID]', '[COMMAND]', '');
15+
let promise = functions.createTag('[FUNCTION_ID]', '[COMMAND]', new File([fileBlob], 'file.png'));
1616

1717
promise.then(function (response) {
1818
console.log(response);

docs/examples/storage/create-file.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ client
1212
;
1313

1414

15-
let promise = storage.createFile('');
15+
let promise = storage.createFile(new File([fileBlob], 'file.png'));
1616

1717
promise.then(function (response) {
1818
console.log(response);

src/services/functions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,11 @@ export class Functions extends Service {
274274
*
275275
* @param string functionId
276276
* @param string command
277-
* @param string code
277+
* @param File | Blob code
278278
* @throws Exception
279279
* @return Promise<string>
280280
*/
281-
async createTag(functionId: string, command: string, code: string): Promise<string> {
281+
async createTag(functionId: string, command: string, code: File | Blob): Promise<string> {
282282
let path = '/functions/{functionId}/tags'.replace(new RegExp('{functionId}', 'g'), functionId);
283283

284284
return await this.client.call('post', path, {

src/services/storage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ export class Storage extends Service {
3838
* assigned to read and write access unless he has passed custom values for
3939
* read and write arguments.
4040
*
41-
* @param string file
41+
* @param File | Blob file
4242
* @param Array<any> read
4343
* @param Array<any> write
4444
* @throws Exception
4545
* @return Promise<string>
4646
*/
47-
async createFile(file: string, read: Array<any> = [], write: Array<any> = []): Promise<string> {
47+
async createFile(file: File | Blob, read: Array<any> = [], write: Array<any> = []): Promise<string> {
4848
let path = '/storage/files';
4949

5050
return await this.client.call('post', path, {

0 commit comments

Comments
 (0)