From 57ccdaca74f68b7e221a43bce967e983ef4b0fcf Mon Sep 17 00:00:00 2001 From: box-sdk-build <94016436+box-sdk-build@users.noreply.github.com> Date: Thu, 4 Apr 2024 08:13:00 +0200 Subject: [PATCH] feat(transformers): determineIsType (box/box-codegen#148) (#129) --- .codegen.json | 2 +- docs/search.md | 2 +- src/test/auth.generated.test.ts | 4 ++-- src/test/files.generated.test.ts | 4 ++-- src/test/folders.generated.test.ts | 2 +- src/test/groups.generated.test.ts | 7 ++++++- src/test/invites.generated.test.ts | 2 +- src/test/search.generated.test.ts | 10 +++++----- 8 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.codegen.json b/.codegen.json index e879f1eb..588a7221 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "a8e8651", "specHash": "1698c95", "version": "0.5.2" } +{ "engineHash": "fd9728e", "specHash": "1698c95", "version": "0.5.2" } diff --git a/docs/search.md b/docs/search.md index eeca57c5..3126f101 100644 --- a/docs/search.md +++ b/docs/search.md @@ -57,7 +57,7 @@ See the endpoint docs at ```ts await client.search.searchForContent({ - ancestorFolderIds: ['0' as ''], + ancestorFolderIds: ['0' as string], mdfilters: [ { filters: { diff --git a/src/test/auth.generated.test.ts b/src/test/auth.generated.test.ts index 287ddb86..837068cb 100644 --- a/src/test/auth.generated.test.ts +++ b/src/test/auth.generated.test.ts @@ -83,7 +83,7 @@ test('test_jwt_auth', async function test_jwt_auth(): Promise { const enterpriseAuth: BoxJwtAuth = auth.withEnterpriseSubject(enterpriseId); const enterpriseClient: BoxClient = new BoxClient({ auth: enterpriseAuth }); const newUser: UserFull = await enterpriseClient.users.getUserMe({ - fields: ['enterprise' as ''], + fields: ['enterprise' as string], } satisfies GetUserMeQueryParams); if (!!(newUser.enterprise == void 0)) { throw new Error('Assertion failed'); @@ -186,7 +186,7 @@ test('test_ccg_auth', async function test_ccg_auth(): Promise { const enterpriseAuth: BoxCcgAuth = auth.withEnterpriseSubject(enterpriseId); const enterpriseClient: BoxClient = new BoxClient({ auth: enterpriseAuth }); const newUser: UserFull = await enterpriseClient.users.getUserMe({ - fields: ['enterprise' as ''], + fields: ['enterprise' as string], } satisfies GetUserMeQueryParams); if (!!(newUser.enterprise == void 0)) { throw new Error('Assertion failed'); diff --git a/src/test/files.generated.test.ts b/src/test/files.generated.test.ts index 326f0c92..d9abd122 100644 --- a/src/test/files.generated.test.ts +++ b/src/test/files.generated.test.ts @@ -86,7 +86,7 @@ test('testGetFileFullExtraFields', async function testGetFileFullExtraFields(): const fileStream: ByteStream = generateByteStream(1024 * 1024); const uploadedFile: FileFull = await uploadFile(newFileName, fileStream); const file: FileFull = await client.files.getFileById(uploadedFile.id, { - fields: ['is_externally_owned' as '', 'has_collaborations' as ''], + fields: ['is_externally_owned' as string, 'has_collaborations' as string], } satisfies GetFileByIdQueryParams); if (!(file.isExternallyOwned == false)) { throw new Error('Assertion failed'); @@ -107,7 +107,7 @@ test('testCreateGetAndDeleteFile', async function testCreateGetAndDeleteFile(): await expect(async () => { await client.files.getFileById( uploadedFile.id, - { fields: ['name' as ''] } satisfies GetFileByIdQueryParams, + { fields: ['name' as string] } satisfies GetFileByIdQueryParams, new GetFileByIdHeaders({ extraHeaders: { ['if-none-match']: file.etag } }) ); }).rejects.toThrow(); diff --git a/src/test/folders.generated.test.ts b/src/test/folders.generated.test.ts index 33003dac..50232df2 100644 --- a/src/test/folders.generated.test.ts +++ b/src/test/folders.generated.test.ts @@ -45,7 +45,7 @@ test('test_get_folder_info', async function test_get_folder_info(): Promise }); test('test_get_folder_full_info_with_extra_fields', async function test_get_folder_full_info_with_extra_fields(): Promise { const rootFolder: FolderFull = await client.folders.getFolderById('0', { - fields: ['has_collaborations' as '', 'tags' as ''], + fields: ['has_collaborations' as string, 'tags' as string], } satisfies GetFolderByIdQueryParams); if (!(rootFolder.id == '0')) { throw new Error('Assertion failed'); diff --git a/src/test/groups.generated.test.ts b/src/test/groups.generated.test.ts index 2e7fb3fc..4a9e8bf1 100644 --- a/src/test/groups.generated.test.ts +++ b/src/test/groups.generated.test.ts @@ -39,7 +39,12 @@ test('test_create_get_delete_group', async function test_create_get_delete_group throw new Error('Assertion failed'); } const groupById: GroupFull = await client.groups.getGroupById(group.id, { - fields: ['id' as '', 'name' as '', 'description' as '', 'group_type' as ''], + fields: [ + 'id' as string, + 'name' as string, + 'description' as string, + 'group_type' as string, + ], } satisfies GetGroupByIdQueryParams); if (!(groupById.id == group.id)) { throw new Error('Assertion failed'); diff --git a/src/test/invites.generated.test.ts b/src/test/invites.generated.test.ts index d715a131..689c42f2 100644 --- a/src/test/invites.generated.test.ts +++ b/src/test/invites.generated.test.ts @@ -31,7 +31,7 @@ test('testInvites', async function testInvites(): Promise { const userId: string = getEnvVar('USER_ID'); const client: BoxClient = getDefaultClientWithUserSubject(userId); const currentUser: UserFull = await client.users.getUserMe({ - fields: ['enterprise' as ''], + fields: ['enterprise' as string], } satisfies GetUserMeQueryParams); const email: string = getEnvVar('BOX_EXTERNAL_USER_EMAIL'); const invitation: Invite = await client.invites.createInvite({ diff --git a/src/test/search.generated.test.ts b/src/test/search.generated.test.ts index 3853574e..0d34e574 100644 --- a/src/test/search.generated.test.ts +++ b/src/test/search.generated.test.ts @@ -128,7 +128,7 @@ test('testCreateMetaDataQueryExecuteRead', async function testCreateMetaDataQuer test('testGetSearch', async function testGetSearch(): Promise { const keyword: any = 'test'; const search: any = await client.search.searchForContent({ - ancestorFolderIds: ['0' as ''], + ancestorFolderIds: ['0' as string], query: keyword, trashContent: 'non_trashed_only' as SearchForContentQueryParamsTrashContentField, @@ -140,7 +140,7 @@ test('testGetSearch', async function testGetSearch(): Promise { throw new Error('Assertion failed'); } const searchWithSharedLink: any = await client.search.searchForContent({ - ancestorFolderIds: ['0' as ''], + ancestorFolderIds: ['0' as string], query: keyword, trashContent: 'non_trashed_only' as SearchForContentQueryParamsTrashContentField, @@ -229,7 +229,7 @@ test('testMetadataFilters', async function testMetadataFilters(): Promise { } ); const stringQuery: any = await client.search.searchForContent({ - ancestorFolderIds: ['0' as ''], + ancestorFolderIds: ['0' as string], mdfilters: [ { filters: { ['stringField']: 'stringValue' }, @@ -242,7 +242,7 @@ test('testMetadataFilters', async function testMetadataFilters(): Promise { throw new Error('Assertion failed'); } const enumQuery: any = await client.search.searchForContent({ - ancestorFolderIds: ['0' as ''], + ancestorFolderIds: ['0' as string], mdfilters: [ { filters: { ['enumField']: 'enumValue2' }, @@ -255,7 +255,7 @@ test('testMetadataFilters', async function testMetadataFilters(): Promise { throw new Error('Assertion failed'); } const multiSelectQuery: any = await client.search.searchForContent({ - ancestorFolderIds: ['0' as ''], + ancestorFolderIds: ['0' as string], mdfilters: [ { filters: {