@@ -7,7 +7,6 @@ import { BasicDatasetInformation } from './@types/basicDataset'
77import { DatasetUtil } from './utils/datasetUtil'
88import request from 'request-promise'
99import { DatasetVersionUpgradeType } from './@types/datasetVersionUpgradeType'
10- import { DatasetVersionType } from './@types/datasetVersionType'
1110
1211export class DataverseClient {
1312 private readonly host : string
@@ -64,28 +63,14 @@ export class DataverseClient {
6463 return this . getRequest ( url )
6564 }
6665
67- public async getLatestPublishedDatasetInformation ( datasetId : string ) : Promise < AxiosResponse > {
68- return this . getDatasetVersion ( datasetId , DatasetVersionType . LATEST_PUBLISHED )
69- }
70-
7166 public async getLatestDatasetInformation ( datasetId : string ) : Promise < AxiosResponse > {
72- return this . getDatasetVersion ( datasetId , DatasetVersionType . LATEST )
73- }
74-
75- public async getDraftDatasetInformation ( datasetId : string ) : Promise < AxiosResponse > {
76- return this . getDatasetVersion ( datasetId , DatasetVersionType . DRAFT )
77- }
78-
79- public async getLatestPublishedDatasetInformationFromDOI ( doi : string ) : Promise < AxiosResponse > {
80- return this . getDatasetVersionFromDOI ( doi , DatasetVersionType . LATEST_PUBLISHED )
67+ const url = `${ this . host } /api/datasets/${ datasetId } `
68+ return this . getRequest ( url )
8169 }
8270
8371 public async getLatestDatasetInformationFromDOI ( doi : string ) : Promise < AxiosResponse > {
84- return this . getDatasetVersionFromDOI ( doi , DatasetVersionType . LATEST )
85- }
86-
87- public async getDraftDatasetInformationFromDOI ( doi : string ) : Promise < AxiosResponse > {
88- return this . getDatasetVersionFromDOI ( doi , DatasetVersionType . DRAFT )
72+ const url = `${ this . host } /api/datasets/:persistentId?persistentId=doi:${ doi } `
73+ return this . getRequest ( url )
8974 }
9075
9176 public async getDatasetVersions ( datasetId : string ) : Promise < AxiosResponse > {
@@ -98,11 +83,6 @@ export class DataverseClient {
9883 return this . getRequest ( url )
9984 }
10085
101- public async getDatasetVersionFromDOI ( doi : string , version : string ) : Promise < AxiosResponse > {
102- const url = `${ this . host } /api/datasets/:persistentId/versions/${ version } ?persistentId=doi:${ doi } `
103- return this . getRequest ( url )
104- }
105-
10686 public async getDatasetThumbnail ( datasetId : string ) : Promise < AxiosResponse > {
10787 const url = `${ this . host } /api/datasets/${ datasetId } /thumbnail`
10888 return this . getRequest ( url , {
0 commit comments