forked from IQSS/dataverse-client-javascript
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDataset.ts
190 lines (164 loc) · 5 KB
/
Dataset.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
import { DvObjectOwnerNode } from '../../../core/domain/models/DvObjectOwnerNode'
export interface Dataset {
id: number
persistentId: string
versionId: number
versionInfo: DatasetVersionInfo
license?: DatasetLicense
alternativePersistentId?: string
publicationDate?: string
citationDate?: string
metadataBlocks: DatasetMetadataBlocks
isPartOf: DvObjectOwnerNode
}
export interface DatasetVersionInfo {
majorNumber: number
minorNumber: number
state: DatasetVersionState
createTime: Date
lastUpdateTime: Date
releaseTime?: Date
}
export enum DatasetVersionState {
DRAFT = 'DRAFT',
RELEASED = 'RELEASED',
ARCHIVED = 'ARCHIVED',
DEACCESSIONED = 'DEACCESSIONED'
}
export interface DatasetLicense {
name: string
uri: string
iconUri?: string
}
export type DatasetMetadataBlocks = [CitationMetadataBlock, ...DatasetMetadataBlock[]]
export interface DatasetMetadataBlock {
name: string
fields: DatasetMetadataFields
}
export const ANONYMIZED_FIELD_VALUE = 'withheld'
type AnonymizedField = typeof ANONYMIZED_FIELD_VALUE
export type DatasetMetadataFields = Record<string, DatasetMetadataFieldValue>
export type DatasetMetadataFieldValue =
| string
| string[]
| DatasetMetadataSubField
| DatasetMetadataSubField[]
| AnonymizedField
export type DatasetMetadataSubField = Record<string, string>
export interface CitationMetadataBlock extends DatasetMetadataBlock {
name: 'citation'
fields: {
title: string
author: Author[] | AnonymizedField
datasetContact: DatasetContact[] | AnonymizedField
dsDescription: DatasetDescription[] | AnonymizedField
subject: string[] | AnonymizedField
subtitle?: string
alternativeTitle?: string
alternativeURL?: string
otherId?: OtherId[] | AnonymizedField
keyword?: Keyword[] | AnonymizedField
topicClassification?: TopicClassification[] | AnonymizedField
publication?: Publication[] | AnonymizedField
notesText?: string
language?: string[] | AnonymizedField
producer?: Producer[] | AnonymizedField
productionDate?: string
productionPlace?: string[] | AnonymizedField
contributor?: Contributor[] | AnonymizedField
grantNumber?: GrantNumber[] | AnonymizedField
distributor?: Distributor[] | AnonymizedField
distributionDate?: string
depositor?: string
dateOfDeposit?: string
timePeriodCovered?: TimePeriodCovered[] | AnonymizedField
dateOfCollection?: DateOfCollection[] | AnonymizedField
kindOfData?: string[] | AnonymizedField
series?: Series[] | AnonymizedField
software?: Software[] | AnonymizedField
relatedMaterial?: string[] | AnonymizedField
relatedDatasets?: string[] | AnonymizedField
otherReferences?: string[] | AnonymizedField
dataSources?: string[] | AnonymizedField
originOfSources?: string
characteristicOfSources?: string
accessToSources?: string
}
}
interface OtherId extends DatasetMetadataSubField {
otherIdAgency?: string
otherIdValue?: string
}
export interface Author extends DatasetMetadataSubField {
authorName: string
authorAffiliation: string
authorIdentifierScheme?: string
authorIdentifier?: string
}
export interface DatasetContact extends DatasetMetadataSubField {
datasetContactName: string
datasetContactEmail: string
datasetContactAffiliation?: string
}
export interface DatasetDescription extends DatasetMetadataSubField {
dsDescriptionValue: string
dsDescriptionDate?: string
}
interface Keyword extends DatasetMetadataSubField {
keywordValue?: string
keywordVocabulary?: string
keywordVocabularyURI?: string
}
interface TopicClassification extends DatasetMetadataSubField {
topicClassValue?: string
topicClassVocab?: string
topicClassVocabURI?: string
}
interface Publication extends DatasetMetadataSubField {
publicationCitation?: string
publicationIDType?: string
publicationIDNumber?: string
publicationURL?: string
}
interface Producer extends DatasetMetadataSubField {
producerName?: string
producerAffiliation?: string
producerAbbreviation?: string
producerURL?: string
producerLogoURL?: string
}
interface Contributor extends DatasetMetadataSubField {
contributorType?: string
contributorName?: string
}
interface GrantNumber extends DatasetMetadataSubField {
grantNumberAgency?: string
grantNumberValue?: string
}
interface Distributor extends DatasetMetadataSubField {
distributorName?: string
distributorAffiliation?: string
distributorAbbreviation?: string
distributorURL?: string
distributorLogoURL?: string
}
interface TimePeriodCovered extends DatasetMetadataSubField {
timePeriodCoveredStart?: string
timePeriodCoveredEnd?: string
}
interface DateOfCollection extends DatasetMetadataSubField {
dateOfCollectionStart?: string
dateOfCollectionEnd?: string
}
interface Series extends DatasetMetadataSubField {
seriesName?: string
seriesInformation?: string
}
interface Software extends DatasetMetadataSubField {
softwareName?: string
softwareVersion?: string
}
export enum VersionUpdateType {
MAJOR = 'major',
MINOR = 'minor'
}