@datagouv/components-next 0.2.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/README.md +1 -1
  2. package/assets/main.css +49 -22
  3. package/dist/Control-BNCDn-8E.js +148 -0
  4. package/dist/{Datafair.client-x39O4yfF.js → Datafair.client-B5lBpOl8.js} +2 -2
  5. package/dist/Event-BOgJUhNR.js +738 -0
  6. package/dist/Image-BN-4XkIn.js +247 -0
  7. package/dist/{JsonPreview.client-BMsC5JcY.js → JsonPreview.client-Doz1Z0BS.js} +23 -23
  8. package/dist/Map-BdT3i2C4.js +7609 -0
  9. package/dist/MapContainer.client-oiieO8H-.js +105 -0
  10. package/dist/OSM-CamriM9b.js +71 -0
  11. package/dist/PdfPreview.client-CdAhkDFJ.js +14513 -0
  12. package/dist/{Pmtiles.client-BaiIo4VZ.js → Pmtiles.client-B0v8tGJQ.js} +3 -3
  13. package/dist/ScaleLine-BiesrgOv.js +165 -0
  14. package/dist/Swagger.client-CsK65JnG.js +4 -0
  15. package/dist/Tile-DCuqwNOI.js +1206 -0
  16. package/dist/TileImage-CmZf8EdU.js +1067 -0
  17. package/dist/View-DcDc7N2K.js +2858 -0
  18. package/dist/{XmlPreview.client-CAdN0w_Y.js → XmlPreview.client-CrjHf74q.js} +17 -17
  19. package/dist/common-C4rDcQpp.js +243 -0
  20. package/dist/components-next.css +1 -1
  21. package/dist/components-next.js +158 -117
  22. package/dist/components.css +1 -1
  23. package/dist/{MapContainer.client-DeSo8EvG.js → index-Bbu9rOHt.js} +4975 -21416
  24. package/dist/leaflet-src-7m1mB8LI.js +6338 -0
  25. package/dist/{main-Dgri3TQL.js → main-CiH8ZmBI.js} +56973 -51462
  26. package/dist/proj-CKwYjU38.js +1569 -0
  27. package/dist/tilecoord-YW3qEH_j.js +884 -0
  28. package/dist/{vue3-xml-viewer.common-D6skc_Ai.js → vue3-xml-viewer.common-Bi_bsV6C.js} +1 -1
  29. package/package.json +6 -2
  30. package/src/components/ActivityList/ActivityList.vue +6 -2
  31. package/src/components/AppLink.vue +4 -1
  32. package/src/components/Avatar.vue +2 -2
  33. package/src/components/AvatarWithName.vue +8 -4
  34. package/src/components/BouncingDots.vue +21 -0
  35. package/src/components/BrandedButton.vue +2 -0
  36. package/src/components/CopyButton.vue +19 -7
  37. package/src/components/DataserviceCard.vue +85 -120
  38. package/src/components/DatasetCard.vue +110 -171
  39. package/src/components/DatasetInformation/DatasetEmbedSection.vue +43 -0
  40. package/src/components/DatasetInformation/DatasetInformationSection.vue +73 -0
  41. package/src/components/DatasetInformation/DatasetSchemaSection.vue +74 -0
  42. package/src/components/DatasetInformation/DatasetSpatialSection.vue +59 -0
  43. package/src/components/DatasetInformation/DatasetTemporalitySection.vue +45 -0
  44. package/src/components/DatasetInformation/index.ts +5 -0
  45. package/src/components/DatasetQuality.vue +23 -16
  46. package/src/components/DatasetQualityInline.vue +13 -17
  47. package/src/components/DatasetQualityScore.vue +12 -15
  48. package/src/components/DatasetQualityTooltipContent.vue +3 -3
  49. package/src/components/DescriptionList.vue +1 -4
  50. package/src/components/DescriptionListDetails.vue +5 -0
  51. package/src/components/DescriptionListTerm.vue +5 -0
  52. package/src/components/DiscussionMessageCard.vue +63 -0
  53. package/src/components/ExtraAccordion.vue +4 -4
  54. package/src/components/Form/BadgeSelect.vue +35 -0
  55. package/src/components/Form/FormatSelect.vue +28 -0
  56. package/src/components/Form/GeozoneSelect.vue +52 -0
  57. package/src/components/Form/GranularitySelect.vue +29 -0
  58. package/src/components/Form/LicenseSelect.vue +30 -0
  59. package/src/components/Form/OrganizationSelect.vue +62 -0
  60. package/src/components/Form/OrganizationTypeSelect.vue +34 -0
  61. package/src/components/Form/ReuseTopicSelect.vue +29 -0
  62. package/src/components/Form/SchemaSelect.vue +30 -0
  63. package/src/components/Form/SearchableSelect.vue +334 -0
  64. package/src/components/Form/SelectGroup.vue +132 -0
  65. package/src/components/Form/TagSelect.vue +38 -0
  66. package/src/components/LeafletMap.vue +31 -0
  67. package/src/components/LicenseBadge.vue +24 -0
  68. package/src/components/LoadingBlock.vue +23 -2
  69. package/src/components/MarkdownViewer.vue +3 -1
  70. package/src/components/ObjectCard.vue +42 -0
  71. package/src/components/ObjectCardBadge.vue +22 -0
  72. package/src/components/ObjectCardHeader.vue +35 -0
  73. package/src/components/ObjectCardOwner.vue +43 -0
  74. package/src/components/ObjectCardShortDescription.vue +28 -0
  75. package/src/components/OrganizationCard.vue +35 -20
  76. package/src/components/OrganizationHorizontalCard.vue +87 -0
  77. package/src/components/OrganizationLogo.vue +1 -1
  78. package/src/components/OrganizationNameWithCertificate.vue +12 -6
  79. package/src/components/OwnerTypeIcon.vue +1 -0
  80. package/src/components/Pagination.vue +1 -1
  81. package/src/components/Placeholder.vue +5 -2
  82. package/src/components/PostCard.vue +62 -0
  83. package/src/components/ProgressBar.vue +31 -0
  84. package/src/components/RadioGroup.vue +32 -0
  85. package/src/components/RadioInput.vue +64 -0
  86. package/src/components/ResourceAccordion/Datafair.client.vue +1 -1
  87. package/src/components/ResourceAccordion/EditButton.vue +2 -3
  88. package/src/components/ResourceAccordion/JsonPreview.client.vue +3 -3
  89. package/src/components/ResourceAccordion/MapContainer.client.vue +21 -17
  90. package/src/components/ResourceAccordion/Metadata.vue +11 -24
  91. package/src/components/ResourceAccordion/PdfPreview.client.vue +70 -74
  92. package/src/components/ResourceAccordion/Pmtiles.client.vue +2 -2
  93. package/src/components/ResourceAccordion/Preview.vue +2 -2
  94. package/src/components/ResourceAccordion/ResourceAccordion.vue +35 -28
  95. package/src/components/ResourceAccordion/ResourceIcon.vue +1 -0
  96. package/src/components/ResourceAccordion/SchemaBadge.vue +2 -2
  97. package/src/components/ResourceAccordion/XmlPreview.client.vue +3 -3
  98. package/src/components/ResourceExplorer/ResourceExplorer.vue +243 -0
  99. package/src/components/ResourceExplorer/ResourceExplorerSidebar.vue +116 -0
  100. package/src/components/ResourceExplorer/ResourceExplorerViewer.vue +410 -0
  101. package/src/components/ReuseCard.vue +8 -28
  102. package/src/components/ReuseHorizontalCard.vue +80 -0
  103. package/src/components/Search/BasicAndAdvancedFilters.vue +49 -0
  104. package/src/components/Search/Filter/AccessTypeFilter.vue +37 -0
  105. package/src/components/Search/Filter/DatasetBadgeFilter.vue +40 -0
  106. package/src/components/Search/Filter/FilterButtonGroup.vue +78 -0
  107. package/src/components/Search/Filter/FormatFamilyFilter.vue +39 -0
  108. package/src/components/Search/Filter/LastUpdateRangeFilter.vue +37 -0
  109. package/src/components/Search/Filter/ProducerTypeFilter.vue +49 -0
  110. package/src/components/Search/Filter/ReuseTypeFilter.vue +42 -0
  111. package/src/components/Search/GlobalSearch.vue +707 -0
  112. package/src/components/Search/SearchInput.vue +63 -0
  113. package/src/components/Search/Sidemenu.vue +38 -0
  114. package/src/components/StatBox.vue +5 -5
  115. package/src/components/Tag.vue +30 -0
  116. package/src/components/Toggletip.vue +11 -4
  117. package/src/components/Tooltip.vue +2 -3
  118. package/src/components/TopicCard.vue +134 -0
  119. package/src/components/radioGroupContext.ts +9 -0
  120. package/src/composables/useDebouncedRef.ts +31 -0
  121. package/src/composables/useHasTabularData.ts +15 -0
  122. package/src/composables/useMetrics.ts +4 -3
  123. package/src/composables/useResourceCapabilities.ts +131 -0
  124. package/src/composables/useRouteQueryBoolean.ts +10 -0
  125. package/src/composables/useSelectModelSync.ts +89 -0
  126. package/src/composables/useStableQueryParams.ts +84 -0
  127. package/src/composables/useTranslation.ts +2 -1
  128. package/src/config.ts +4 -0
  129. package/src/functions/api.ts +25 -6
  130. package/src/functions/api.types.ts +5 -3
  131. package/src/functions/datasets.ts +1 -29
  132. package/src/functions/description.ts +33 -0
  133. package/src/functions/helpers.ts +11 -0
  134. package/src/functions/markdown.ts +60 -16
  135. package/src/functions/metrics.ts +33 -0
  136. package/src/functions/organizations.ts +5 -5
  137. package/src/functions/resourceCapabilities.ts +55 -0
  138. package/src/main.ts +96 -7
  139. package/src/types/dataservices.ts +14 -12
  140. package/src/types/datasets.ts +20 -7
  141. package/src/types/discussions.ts +20 -0
  142. package/src/types/licenses.ts +3 -3
  143. package/src/types/organizations.ts +13 -1
  144. package/src/types/owned.ts +4 -2
  145. package/src/types/pages.ts +70 -0
  146. package/src/types/posts.ts +27 -0
  147. package/src/types/resources.ts +16 -0
  148. package/src/types/reuses.ts +14 -5
  149. package/src/types/search.ts +407 -0
  150. package/src/types/users.ts +12 -3
  151. package/dist/PdfPreview.client-COOkEkRA.js +0 -107
  152. package/dist/Swagger.client-CpLgaLg6.js +0 -4
  153. package/dist/pdf-vue3-IkJO65RH.js +0 -273
  154. package/dist/pdf.min-f72cfa08-CdgJTooZ.js +0 -9501
  155. package/src/components/DatasetInformationPanel.vue +0 -211
package/src/main.ts CHANGED
@@ -3,23 +3,28 @@ import type { Activity, ActivityKey } from './types/activity.js'
3
3
  import type { PaginatedArray } from './types/api.js'
4
4
  import type { ContactPoint, ContactPointRole } from './types/contact_point.js'
5
5
  import type { Badge, Badges, TranslatedBadge } from './types/badges'
6
- import type { Dataset, DatasetV2, DatasetV2WithFullObject, NewDataset, Quality, Rel } from './types/datasets'
7
- import type { NewDataservice, Dataservice } from './types/dataservices'
6
+ import type { DatasetReference, Dataset, DatasetV2, DatasetV2WithFullObject, NewDataset, Quality, Rel } from './types/datasets'
7
+ import type { DataserviceReference, NewDataservice, Dataservice } from './types/dataservices'
8
8
  import type { AccessType, AccessAudience, AccessAudienceCondition, AccessAudienceType, WithAccessType, AccessTypeForm } from './types/access_types'
9
9
  import type { Frequency, Frequencies } from './types/frequency'
10
10
  import type { Granularity, Granularities, SpatialZone } from './types/granularity'
11
11
  import type { Harvest } from './types/harvest'
12
12
  import type { License } from './types/licenses'
13
13
  import type { Member, MemberRole, NewOrganization, Organization, OrganizationOrSuggest, OrganizationReference, OrganizationSuggest } from './types/organizations'
14
- import type { Owned, OwnedWithId } from './types/owned'
15
- import type { NewReuse, Reuse, ReuseTopic, ReuseType } from './types/reuses'
14
+ import type { Owned, OwnedWithFullObject, OwnedWithId } from './types/owned'
15
+ import type { Comment, Thread } from './types/discussions'
16
+ import type { Page, PageBloc, ContentBloc, BlocWithTitle, DatasetsListBloc, DataservicesListBloc, ReusesListBloc, LinkInBloc, LinksListBloc, MarkdownBloc, AccordionItemBloc, AccordionListBloc, HeroBloc } from './types/pages'
17
+ import type { Post } from './types/posts'
18
+ import type { ReuseReference, NewReuse, Reuse, ReuseTopic, ReuseType } from './types/reuses'
16
19
  import type { RegisteredSchema, Schema, SchemaDetails, SchemaField, SchemaPath, SchemaPublicationMode, SchemaResponseData, SchemaVersion, ValidataError } from './types/schemas'
17
20
  import type { TopicV2, TopicElement, TopicElementClass, TopicElementRel } from './types/topics'
18
- import type { CommunityResource, FileResourceFileType, RemoteResourceFileType, ResourceFileType, ResourceType, Resource } from './types/resources'
21
+ import type { CommunityResource, FileResourceFileType, RemoteResourceFileType, ResourceFileType, ResourceGroup, ResourceType, Resource } from './types/resources'
19
22
  import type { Site } from './types/site'
20
23
  import type { Weight, WellType } from './types/ui'
21
24
  import type { User, UserReference } from './types/users'
22
25
  import type { Report, ReportSubject, ReportReason } from './types/reports'
26
+ import type { GlobalSearchConfig, SearchType, SortOption } from './types/search'
27
+ import { getDefaultDatasetConfig, getDefaultDataserviceConfig, getDefaultReuseConfig, getDefaultOrganizationConfig, getDefaultGlobalSearchConfig, defaultDatasetSortOptions, defaultDataserviceSortOptions, defaultReuseSortOptions, defaultOrganizationSortOptions } from './types/search'
23
28
 
24
29
  import ActivityList from './components/ActivityList/ActivityList.vue'
25
30
  import UserActivityList from './components/ActivityList/UserActivityList.vue'
@@ -32,18 +37,26 @@ import BrandedButton from './components/BrandedButton.vue'
32
37
  import CopyButton from './components/CopyButton.vue'
33
38
  import DataserviceCard from './components/DataserviceCard.vue'
34
39
  import DatasetCard from './components/DatasetCard.vue'
40
+ import DescriptionListTerm from './components/DescriptionListTerm.vue'
41
+ import DescriptionListDetails from './components/DescriptionListDetails.vue'
42
+ import DiscussionMessageCard from './components/DiscussionMessageCard.vue'
35
43
  import DateRangeDetails from './components/DateRangeDetails.vue'
36
- import DatasetInformationPanel from './components/DatasetInformationPanel.vue'
44
+ import { DatasetInformationSection, DatasetTemporalitySection, DatasetSpatialSection, DatasetSchemaSection, DatasetEmbedSection } from './components/DatasetInformation'
45
+ import LeafletMap from './components/LeafletMap.vue'
46
+ import LicenseBadge from './components/LicenseBadge.vue'
47
+ import Tag from './components/Tag.vue'
37
48
  import DatasetQuality from './components/DatasetQuality.vue'
38
49
  import DatasetQualityInline from './components/DatasetQualityInline.vue'
39
50
  import DatasetQualityItem from './components/DatasetQualityItem.vue'
40
51
  import DatasetQualityScore from './components/DatasetQualityScore.vue'
52
+ import ProgressBar from './components/ProgressBar.vue'
41
53
  import DatasetQualityTooltipContent from './components/DatasetQualityTooltipContent.vue'
42
54
  import ExtraAccordion from './components/ExtraAccordion.vue'
43
55
  import LabelTag from './components/DatasetLabelTag.vue'
44
56
  import LoadingBlock from './components/LoadingBlock.vue'
45
57
  import MarkdownViewer from './components/MarkdownViewer.vue'
46
58
  import OrganizationCard from './components/OrganizationCard.vue'
59
+ import OrganizationHorizontalCard from './components/OrganizationHorizontalCard.vue'
47
60
  import OrganizationLogo from './components/OrganizationLogo.vue'
48
61
  import OrganizationNameWithCertificate from './components/OrganizationNameWithCertificate.vue'
49
62
  import OwnerType from './components/OwnerType.vue'
@@ -51,11 +64,18 @@ import OwnerTypeIcon from './components/OwnerTypeIcon.vue'
51
64
  import PaddedContainer from './components/PaddedContainer.vue'
52
65
  import Pagination from './components/Pagination.vue'
53
66
  import Placeholder from './components/Placeholder.vue'
67
+ import RadioGroup from './components/RadioGroup.vue'
68
+ import RadioInput from './components/RadioInput.vue'
69
+ import PostCard from './components/PostCard.vue'
54
70
  import ReadMore from './components/ReadMore.vue'
55
71
  import ResourceAccordion from './components/ResourceAccordion/ResourceAccordion.vue'
56
72
  import ResourceIcon from './components/ResourceAccordion/ResourceIcon.vue'
73
+ import ResourceExplorer from './components/ResourceExplorer/ResourceExplorer.vue'
74
+ import ResourceExplorerSidebar from './components/ResourceExplorer/ResourceExplorerSidebar.vue'
75
+ import ResourceExplorerViewer from './components/ResourceExplorer/ResourceExplorerViewer.vue'
57
76
  import Swagger from './components/ResourceAccordion/Swagger.client.vue'
58
77
  import ReuseCard from './components/ReuseCard.vue'
78
+ import ReuseHorizontalCard from './components/ReuseHorizontalCard.vue'
59
79
  import ReuseDetails from './components/ReuseDetails.vue'
60
80
  import SchemaCard from './components/SchemaCard.vue'
61
81
  import SimpleBanner from './components/SimpleBanner.vue'
@@ -68,18 +88,27 @@ import TabPanel from './components/Tabs/TabPanel.vue'
68
88
  import TabPanels from './components/Tabs/TabPanels.vue'
69
89
  import Tooltip from './components/Tooltip.vue'
70
90
  import Toggletip from './components/Toggletip.vue'
91
+ import TopicCard from './components/TopicCard.vue'
71
92
  import TranslationT from './components/TranslationT.vue'
93
+ import GlobalSearch from './components/Search/GlobalSearch.vue'
94
+ import SearchInput from './components/Search/SearchInput.vue'
95
+ import SearchableSelect from './components/Form/SearchableSelect.vue'
96
+ import SelectGroup from './components/Form/SelectGroup.vue'
72
97
  import type { UseFetchFunction } from './functions/api.types'
73
98
  import { configKey, useComponentsConfig, type PluginConfig } from './config.js'
74
99
 
100
+ export { Toaster, toast } from 'vue-sonner'
101
+
75
102
  export * from './composables/useActiveDescendant'
76
103
  export * from './composables/useMetrics'
77
104
  export * from './composables/useReuseType'
78
105
  export * from './composables/useTranslation'
106
+ export * from './composables/useHasTabularData'
79
107
 
80
108
  export * from './functions/activities'
81
109
  export * from './functions/datasets'
82
110
  export * from './functions/dates'
111
+ export * from './functions/description'
83
112
  export * from './functions/helpers'
84
113
  export * from './functions/markdown'
85
114
  export * from './functions/matomo'
@@ -95,6 +124,9 @@ export * from './functions/users'
95
124
  export * from './types/access_types'
96
125
 
97
126
  export type {
127
+ GlobalSearchConfig,
128
+ SearchType,
129
+ SortOption,
98
130
  UseFetchFunction,
99
131
  AccessType,
100
132
  AccessAudience,
@@ -109,10 +141,13 @@ export type {
109
141
  CommunityResource,
110
142
  ContactPoint,
111
143
  ContactPointRole,
144
+ DatasetReference,
112
145
  Dataset,
113
146
  DatasetV2,
114
147
  DatasetV2WithFullObject,
148
+ DataserviceReference,
115
149
  Dataservice,
150
+ Comment,
116
151
  NewDataservice,
117
152
  FileResourceFileType,
118
153
  Frequency,
@@ -131,8 +166,24 @@ export type {
131
166
  OrganizationSuggest,
132
167
  OrganizationOrSuggest,
133
168
  Owned,
169
+ OwnedWithFullObject,
134
170
  OwnedWithId,
171
+ Page,
172
+ PageBloc,
173
+ ContentBloc,
174
+ BlocWithTitle,
175
+ DatasetsListBloc,
176
+ DataservicesListBloc,
177
+ ReusesListBloc,
178
+ LinkInBloc,
179
+ LinksListBloc,
180
+ MarkdownBloc,
181
+ AccordionItemBloc,
182
+ AccordionListBloc,
183
+ HeroBloc,
135
184
  PaginatedArray,
185
+ Post,
186
+ Thread,
136
187
  Quality,
137
188
  RegisteredSchema,
138
189
  Rel,
@@ -142,7 +193,9 @@ export type {
142
193
  ReportReason,
143
194
  Resource,
144
195
  ResourceFileType,
196
+ ResourceGroup,
145
197
  ResourceType,
198
+ ReuseReference,
146
199
  Reuse,
147
200
  ReuseTopic,
148
201
  ReuseType,
@@ -167,6 +220,18 @@ export type {
167
220
  WellType,
168
221
  }
169
222
 
223
+ export {
224
+ getDefaultDatasetConfig,
225
+ getDefaultDataserviceConfig,
226
+ getDefaultReuseConfig,
227
+ getDefaultOrganizationConfig,
228
+ getDefaultGlobalSearchConfig,
229
+ defaultDatasetSortOptions,
230
+ defaultDataserviceSortOptions,
231
+ defaultReuseSortOptions,
232
+ defaultOrganizationSortOptions,
233
+ }
234
+
170
235
  // Vue Plugin
171
236
  const datagouv: Plugin<PluginConfig> = {
172
237
  async install(app: App, options) {
@@ -191,7 +256,14 @@ export {
191
256
  CopyButton,
192
257
  DataserviceCard,
193
258
  DatasetCard,
194
- DatasetInformationPanel,
259
+ DatasetInformationSection,
260
+ DatasetTemporalitySection,
261
+ DatasetSpatialSection,
262
+ DatasetSchemaSection,
263
+ DatasetEmbedSection,
264
+ DescriptionListTerm,
265
+ DescriptionListDetails,
266
+ DiscussionMessageCard,
195
267
  DatasetQuality,
196
268
  DatasetQualityInline,
197
269
  DatasetQualityItem,
@@ -200,9 +272,13 @@ export {
200
272
  DateRangeDetails,
201
273
  ExtraAccordion,
202
274
  LabelTag,
275
+ LeafletMap,
276
+ LicenseBadge,
203
277
  LoadingBlock,
278
+ Tag,
204
279
  MarkdownViewer,
205
280
  OrganizationCard,
281
+ OrganizationHorizontalCard,
206
282
  OrganizationLogo,
207
283
  OrganizationNameWithCertificate,
208
284
  OwnerType,
@@ -210,11 +286,19 @@ export {
210
286
  PaddedContainer,
211
287
  Pagination,
212
288
  Placeholder,
289
+ ProgressBar,
290
+ PostCard,
291
+ RadioGroup,
292
+ RadioInput,
213
293
  ReadMore,
214
294
  ResourceAccordion,
295
+ ResourceExplorer,
296
+ ResourceExplorerSidebar,
297
+ ResourceExplorerViewer,
215
298
  ResourceIcon,
216
299
  ReuseCard,
217
300
  ReuseDetails,
301
+ ReuseHorizontalCard,
218
302
  SchemaCard,
219
303
  SimpleBanner,
220
304
  SmallChart,
@@ -227,6 +311,11 @@ export {
227
311
  TabPanels,
228
312
  Tooltip,
229
313
  Toggletip,
314
+ TopicCard,
230
315
  TranslationT,
231
316
  UserActivityList,
317
+ GlobalSearch,
318
+ SearchInput,
319
+ SearchableSelect,
320
+ SelectGroup,
232
321
  }
@@ -2,19 +2,21 @@ import type { Harvest } from './harvest'
2
2
  import type { Owned, OwnedWithId } from './owned'
3
3
  import type { ContactPoint } from './contact_point'
4
4
  import type { WithAccessType } from './access_types'
5
+ import type { DatasetReference } from './datasets'
6
+
7
+ export type DataserviceReference = {
8
+ class: 'Dataservice'
9
+ id: string
10
+ title: string
11
+ self_api_url: string
12
+ self_web_url: string
13
+ }
5
14
 
6
15
  export type BaseDataservice = Owned & WithAccessType & {
7
16
  acronym: string
8
17
  availability: number | null
9
18
  base_api_url: string | null
10
- datasets: Array<{
11
- class: string
12
- id: string
13
- acronym: string
14
- page: string
15
- title: string
16
- uri: string
17
- }>
19
+ datasets: Array<DatasetReference>
18
20
  description: string
19
21
  machine_documentation_url: string | null
20
22
  technical_documentation_url: string | null
@@ -22,7 +24,7 @@ export type BaseDataservice = Owned & WithAccessType & {
22
24
  license: string | null
23
25
  private: boolean
24
26
  rate_limiting: string
25
- title: string
27
+ title: DataserviceReference['title']
26
28
  contact_points: Array<ContactPoint>
27
29
  }
28
30
 
@@ -50,7 +52,7 @@ export type Dataservice = Owned & WithAccessType & {
50
52
  extras: Record<string, unknown>
51
53
  format: string
52
54
  harvest: Harvest
53
- id: string
55
+ id: DataserviceReference['id']
54
56
  license: string | null
55
57
  metadata_modified_at: string
56
58
  metrics: {
@@ -63,8 +65,8 @@ export type Dataservice = Owned & WithAccessType & {
63
65
  permissions: { edit: boolean, delete: boolean }
64
66
  private: boolean
65
67
  rate_limiting: string
66
- self_api_url: string
67
- self_web_url: string
68
+ self_api_url: DataserviceReference['self_api_url']
69
+ self_web_url: DataserviceReference['self_web_url']
68
70
  slug: string
69
71
  tags: Array<string>
70
72
  title: string
@@ -23,9 +23,18 @@ export type Quality = {
23
23
  update_fulfilled_in_time: boolean
24
24
  }
25
25
 
26
- export type BaseDataset = Owned & WithAccessType & {
27
- title: string
26
+ export type DatasetReference = {
27
+ class: 'Dataset'
28
+ id: string
28
29
  acronym: string
30
+ page: string
31
+ title: string
32
+ uri: string
33
+ }
34
+
35
+ export type BaseDataset = Owned & WithAccessType & {
36
+ title: DatasetReference['title']
37
+ acronym: DatasetReference['acronym']
29
38
  archived: boolean
30
39
  description: string
31
40
  description_short: string
@@ -58,10 +67,10 @@ export type Rel = {
58
67
  }
59
68
 
60
69
  export type Dataset = BaseDataset & {
61
- id: string
70
+ id: DatasetReference['id']
62
71
  badges: Badges
63
72
  deleted: string | null
64
- page: string
73
+ page: DatasetReference['page']
65
74
  resources: Array<Resource>
66
75
  community_resources: Array<Resource>
67
76
  created_at: string
@@ -71,7 +80,7 @@ export type Dataset = BaseDataset & {
71
80
  created_at_internal: string
72
81
  last_modified_internal: string
73
82
  }
74
- uri: string
83
+ uri: DatasetReference['uri']
75
84
  slug: string
76
85
  quality: Quality
77
86
  metrics: {
@@ -94,9 +103,13 @@ export type DatasetV2 = Owned & Omit<Dataset, 'resources' | 'community_resources
94
103
  community_resources: Rel
95
104
  }
96
105
 
106
+ /**
107
+ * Dataset with fully populated nested objects (license, frequency, spatial).
108
+ * Retrieve this version by adding the header `X-Get-Datasets-Full-Objects: True` to the request: GET /api/2/datasets/{id}/
109
+ */
97
110
  export type DatasetV2WithFullObject = Owned & Omit<DatasetV2, 'license' | 'frequency' | 'spatial'> & {
98
- license: License
99
- frequency: Frequency
111
+ license: License | null
112
+ frequency: Frequency | null
100
113
  spatial: {
101
114
  zones?: Array<SpatialZone>
102
115
  granularity?: Granularity
@@ -0,0 +1,20 @@
1
+ import type { OrganizationReference } from './organizations'
2
+ import type { UserReference } from './users'
3
+
4
+ export type Comment = {
5
+ content: string
6
+ posted_by: UserReference
7
+ posted_on: string
8
+ posted_by_organization: OrganizationReference | null
9
+ last_modified_at?: string | null
10
+ }
11
+
12
+ export interface Thread {
13
+ id: string
14
+ title: string
15
+ user: UserReference
16
+ organization: OrganizationReference | null
17
+ created: string
18
+ discussion: Array<Comment>
19
+ self_web_url?: string
20
+ }
@@ -1,9 +1,9 @@
1
1
  export type License = {
2
- alternate_titles: Array<string>
3
- alternate_urls: Array<string>
2
+ alternate_titles: Array<string> | null
3
+ alternate_urls: Array<string> | null
4
4
  flags: Array<string>
5
5
  id: string
6
6
  maintainer: string | null
7
7
  title: string
8
- url: string
8
+ url: string | null
9
9
  }
@@ -24,6 +24,7 @@ export type NewOrganization = {
24
24
  }
25
25
 
26
26
  export type OrganizationReference = {
27
+ class: 'Organization'
27
28
  id: string
28
29
  name: string
29
30
  acronym: string | null
@@ -33,9 +34,20 @@ export type OrganizationReference = {
33
34
  logo: string
34
35
  logo_thumbnail: string
35
36
  badges: Badges
37
+ permissions: { delete: boolean, edit: boolean, harvest: boolean, members: boolean, private: boolean }
36
38
  }
37
39
 
38
- export type Organization = OrganizationReference & {
40
+ export type Organization = {
41
+ id: OrganizationReference['id']
42
+ name: OrganizationReference['name']
43
+ acronym: OrganizationReference['acronym']
44
+ slug: OrganizationReference['slug']
45
+ uri: OrganizationReference['uri']
46
+ page: OrganizationReference['page']
47
+ logo: OrganizationReference['logo']
48
+ logo_thumbnail: OrganizationReference['logo_thumbnail']
49
+ badges: OrganizationReference['badges']
50
+ permissions: OrganizationReference['permissions']
39
51
  url: string // URL of the org website
40
52
  description: string
41
53
  business_number_id: string
@@ -1,5 +1,5 @@
1
- import type { OrganizationReference } from './organizations'
2
- import type { UserReference } from './users'
1
+ import type { Organization, OrganizationReference } from './organizations'
2
+ import type { User, UserReference } from './users'
3
3
 
4
4
  /**
5
5
  * A resource, dataset, reuse or any other object owned by an organization or a user.
@@ -7,3 +7,5 @@ import type { UserReference } from './users'
7
7
  export type Owned = { organization: OrganizationReference, owner: never | null } | { organization: never | null, owner: UserReference }
8
8
 
9
9
  export type OwnedWithId = { organization: string, owner: never | null } | { organization: never | null, owner: string }
10
+
11
+ export type OwnedWithFullObject = { organization: Organization, owner: never | null } | { organization: never | null, owner: User }
@@ -0,0 +1,70 @@
1
+ import type { DatasetV2 } from './datasets'
2
+ import type { Dataservice } from './dataservices'
3
+ import type { Reuse } from './reuses'
4
+
5
+ export type Page = {
6
+ id: string
7
+ blocs: Array<PageBloc>
8
+ }
9
+
10
+ export type BlocWithTitle = {
11
+ title: string
12
+ subtitle: string | null
13
+ }
14
+
15
+ export type DatasetsListBloc = {
16
+ class: 'DatasetsListBloc'
17
+ datasets: Array<DatasetV2>
18
+ } & BlocWithTitle & { id: string }
19
+ export type DataservicesListBloc = {
20
+ class: 'DataservicesListBloc'
21
+ dataservices: Array<Dataservice>
22
+ } & BlocWithTitle & { id: string }
23
+ export type ReusesListBloc = {
24
+ class: 'ReusesListBloc'
25
+ reuses: Array<Reuse>
26
+ } & BlocWithTitle & { id: string }
27
+
28
+ export type LinkInBloc = {
29
+ title: string
30
+ url: string
31
+ color: string | null
32
+ }
33
+
34
+ export type LinksListBloc = {
35
+ class: 'LinksListBloc'
36
+ paragraph: string | null
37
+ main_link_title: string | null
38
+ main_link_url: string | null
39
+ links: Array<LinkInBloc>
40
+ } & BlocWithTitle & { id: string }
41
+
42
+ export type MarkdownBloc = {
43
+ class: 'MarkdownBloc'
44
+ content: string
45
+ } & BlocWithTitle & { id: string }
46
+
47
+ export type ContentBloc = DatasetsListBloc | DataservicesListBloc | ReusesListBloc | LinksListBloc | MarkdownBloc
48
+
49
+ export type AccordionItemBloc = {
50
+ title: string
51
+ content: Array<ContentBloc>
52
+ }
53
+
54
+ export type AccordionListBloc = {
55
+ class: 'AccordionListBloc'
56
+ title: string | null
57
+ description: string | null
58
+ items: Array<AccordionItemBloc>
59
+ } & { id: string }
60
+
61
+ export type HeroBloc = {
62
+ class: 'HeroBloc'
63
+ title: string
64
+ description: string | null
65
+ color: 'primary' | 'green' | 'purple'
66
+ main_link_title: string | null
67
+ main_link_url: string | null
68
+ } & { id: string }
69
+
70
+ export type PageBloc = ContentBloc | AccordionListBloc | HeroBloc
@@ -0,0 +1,27 @@
1
+ import type { Dataset } from './datasets'
2
+ import type { Page } from './pages'
3
+ import type { Reuse } from './reuses'
4
+ import type { User } from './users'
5
+
6
+ export type Post = {
7
+ body_type: 'markdown' | 'html' | 'blocs'
8
+ content: string
9
+ content_as_page: Page | null
10
+ created_at: string
11
+ credit_to: string
12
+ credit_url: string
13
+ datasets: Array<Pick<Dataset, 'acronym' | 'id' | 'page' | 'title' | 'uri'>>
14
+ headline: string
15
+ id: string
16
+ image: string | null
17
+ kind: 'news' | 'page'
18
+ last_modified: string
19
+ name: string
20
+ owner: User
21
+ page: string
22
+ published: string | null
23
+ reuses: Array<Pick<Reuse, 'id' | 'image' | 'image_thumbnail' | 'page' | 'title' | 'uri'>>
24
+ slug: string
25
+ tags: Array<string>
26
+ url: string
27
+ }
@@ -35,3 +35,19 @@ export type Resource = {
35
35
  }
36
36
 
37
37
  export type CommunityResource = Owned & Resource & { dataset: Omit<Dataset, 'resources' | 'community_resources'>, permissions: { edit: boolean, delete: boolean } }
38
+
39
+ export interface ResourceGroup {
40
+ type: ResourceType
41
+ total: number
42
+ items: Resource[]
43
+ }
44
+
45
+ export type OgcLayerInfo = { name: string, default_crs: string | null }
46
+
47
+ export type WfsMetadata = {
48
+ format: string
49
+ layers: Array<OgcLayerInfo>
50
+ version: string
51
+ detected_layer: OgcLayerInfo | null
52
+ output_formats: Array<string>
53
+ }
@@ -3,8 +3,17 @@ import type { Dataset } from './datasets'
3
3
  import type { Badges } from './badges'
4
4
  import type { Dataservice } from './dataservices'
5
5
 
6
- export type BaseReuse = Owned & {
6
+ export type ReuseReference = {
7
+ class: 'Reuse'
8
+ id: string
7
9
  title: string
10
+ image: string | null
11
+ uri: string
12
+ page: string
13
+ }
14
+
15
+ export type BaseReuse = Owned & {
16
+ title: ReuseReference['title']
8
17
  description: string
9
18
  tags: Array<string> | null
10
19
  datasets: Array<Dataset | string>
@@ -25,8 +34,8 @@ export type Reuse = BaseReuse & {
25
34
  deleted: string | null
26
35
  extras: Record<string, unknown>
27
36
  featured: boolean
28
- id: string
29
- image: string | null
37
+ id: ReuseReference['id']
38
+ image: ReuseReference['image']
30
39
  image_thumbnail: string | null
31
40
  last_modified: string
32
41
  metrics: {
@@ -37,8 +46,8 @@ export type Reuse = BaseReuse & {
37
46
  views: number
38
47
  }
39
48
  slug: string
40
- page: string
41
- uri: string
49
+ page: ReuseReference['page']
50
+ uri: ReuseReference['uri']
42
51
  permissions: { edit: boolean, delete: boolean }
43
52
  }
44
53