From 1186f63e5fc8d3eefca5d492f444338be356ee54 Mon Sep 17 00:00:00 2001 From: Eason Kang Date: Thu, 16 Apr 2020 07:20:01 +0800 Subject: [PATCH] fix field defs for both CreateStorageData object and CreateStorageDataAttributes object (#43890) --- types/forge-apis/forge-apis-tests.ts | 21 ++++++++++++++++++++- types/forge-apis/index.d.ts | 3 ++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/types/forge-apis/forge-apis-tests.ts b/types/forge-apis/forge-apis-tests.ts index 3163abde37..047b365733 100644 --- a/types/forge-apis/forge-apis-tests.ts +++ b/types/forge-apis/forge-apis-tests.ts @@ -286,8 +286,27 @@ projectsApi.getProject('', '', authClientTwoLegged, authToken); projectsApi.getProjectHub('', '', authClientTwoLegged, authToken); // $ExpectType Promise projectsApi.getProjectTopFolders('', '', authClientTwoLegged, authToken); + // $ExpectType Promise -projectsApi.postStorage('', {}, authClientTwoLegged, authToken); +projectsApi.postStorage('', { + jsonapi: { + version: '1.0' + }, + data: { + type: 'objects', + attributes: { + name: '{{Filename}}' + }, + relationships: { + target: { + data: { + type: 'folders', + id: '{{FolderId}}' + } + } + } + } + }, authClientTwoLegged, authToken); // $ExpectType UserProfileApi const userProfileApi = new UserProfileApi(); diff --git a/types/forge-apis/index.d.ts b/types/forge-apis/index.d.ts index 7b7f40a29e..fda15e37e9 100644 --- a/types/forge-apis/index.d.ts +++ b/types/forge-apis/index.d.ts @@ -723,7 +723,7 @@ export class HubsApi { export interface CreateStorageDataAttributes { name: string; - extension: BaseAttributesExtensionObject; + extension?: BaseAttributesExtensionObject; } export interface CreateItemDataRelationshipsTipData { @@ -1047,6 +1047,7 @@ export interface CreateStorageDataRelationships { } export interface CreateStorageData { + type: string; attributes?: CreateStorageDataAttributes; relationships?: CreateStorageDataRelationships; }