@datagouv/components-next 0.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 (119) hide show
  1. package/README.md +150 -0
  2. package/assets/main.css +136 -0
  3. package/assets/placeholders/author.png +0 -0
  4. package/assets/placeholders/dataset.png +0 -0
  5. package/assets/placeholders/news.png +0 -0
  6. package/assets/placeholders/organization.png +0 -0
  7. package/assets/placeholders/reuse.png +0 -0
  8. package/assets/tailwind.config.js +24 -0
  9. package/dist/components.css +2 -0
  10. package/dist/locales/de.js +155 -0
  11. package/dist/locales/en.js +155 -0
  12. package/dist/locales/es.js +155 -0
  13. package/dist/locales/fr.js +155 -0
  14. package/dist/locales/it.js +155 -0
  15. package/dist/locales/pt.js +155 -0
  16. package/dist/locales/sr.js +155 -0
  17. package/package.json +72 -0
  18. package/src/components/AppLink.vue +51 -0
  19. package/src/components/Avatar.vue +27 -0
  20. package/src/components/AvatarWithName.vue +26 -0
  21. package/src/components/BannerAction.vue +39 -0
  22. package/src/components/BrandedButton.vue +170 -0
  23. package/src/components/CopyButton.vue +84 -0
  24. package/src/components/DataserviceCard.vue +184 -0
  25. package/src/components/DatasetCard.vue +198 -0
  26. package/src/components/DatasetInformationPanel.vue +210 -0
  27. package/src/components/DatasetQuality.vue +68 -0
  28. package/src/components/DatasetQualityInline.vue +32 -0
  29. package/src/components/DatasetQualityItem.vue +32 -0
  30. package/src/components/DatasetQualityItemWarning.vue +21 -0
  31. package/src/components/DatasetQualityScore.vue +35 -0
  32. package/src/components/DatasetQualityTooltipContent.vue +79 -0
  33. package/src/components/DescriptionDetails.vue +23 -0
  34. package/src/components/DescriptionList/DescriptionDetails.stories.ts +43 -0
  35. package/src/components/DescriptionList/DescriptionList.stories.ts +47 -0
  36. package/src/components/DescriptionList/DescriptionTerm.stories.ts +28 -0
  37. package/src/components/DescriptionList.vue +8 -0
  38. package/src/components/DescriptionTerm.vue +8 -0
  39. package/src/components/ExtraAccordion.vue +78 -0
  40. package/src/components/Icons/Archive.vue +21 -0
  41. package/src/components/Icons/Code.vue +21 -0
  42. package/src/components/Icons/Documentation.vue +21 -0
  43. package/src/components/Icons/File.vue +21 -0
  44. package/src/components/Icons/Image.vue +7 -0
  45. package/src/components/Icons/Link.vue +21 -0
  46. package/src/components/Icons/Table.vue +21 -0
  47. package/src/components/OrganizationCard.vue +68 -0
  48. package/src/components/OrganizationNameWithCertificate.vue +45 -0
  49. package/src/components/OwnerType.vue +43 -0
  50. package/src/components/OwnerTypeIcon.vue +18 -0
  51. package/src/components/Pagination.vue +205 -0
  52. package/src/components/Placeholder.vue +29 -0
  53. package/src/components/ReadMore.vue +107 -0
  54. package/src/components/ResourceAccordion/DataStructure.vue +87 -0
  55. package/src/components/ResourceAccordion/EditButton.vue +34 -0
  56. package/src/components/ResourceAccordion/Metadata.vue +171 -0
  57. package/src/components/ResourceAccordion/Preview.vue +229 -0
  58. package/src/components/ResourceAccordion/PreviewLoader.vue +148 -0
  59. package/src/components/ResourceAccordion/ResourceAccordion.vue +484 -0
  60. package/src/components/ResourceAccordion/ResourceIcon.vue +16 -0
  61. package/src/components/ResourceAccordion/SchemaBadge.vue +148 -0
  62. package/src/components/ResourceAccordion/SchemaLoader.vue +30 -0
  63. package/src/components/ResourceAccordion/Swagger.vue +46 -0
  64. package/src/components/ResourceAccordion/france.svg +1 -0
  65. package/src/components/ReuseCard.vue +106 -0
  66. package/src/components/ReuseDetails.vue +45 -0
  67. package/src/components/SimpleBanner.vue +24 -0
  68. package/src/components/SmallChart.vue +149 -0
  69. package/src/components/StatBox.vue +100 -0
  70. package/src/components/Tabs/Tab.vue +62 -0
  71. package/src/components/Tabs/TabGroup.vue +20 -0
  72. package/src/components/Tabs/TabList.vue +15 -0
  73. package/src/components/Tabs/TabPanel.vue +7 -0
  74. package/src/components/Tabs/TabPanels.vue +7 -0
  75. package/src/components/Toggletip.vue +62 -0
  76. package/src/components/ToggletipButton.vue +14 -0
  77. package/src/composables/useActiveDescendant.ts +103 -0
  78. package/src/composables/useReuseType.ts +14 -0
  79. package/src/config.ts +33 -0
  80. package/src/functions/api.ts +96 -0
  81. package/src/functions/api.types.ts +41 -0
  82. package/src/functions/config.ts +12 -0
  83. package/src/functions/datasets.ts +24 -0
  84. package/src/functions/dates.ts +85 -0
  85. package/src/functions/helpers.ts +38 -0
  86. package/src/functions/markdown.ts +47 -0
  87. package/src/functions/matomo.ts +3 -0
  88. package/src/functions/organizations.ts +85 -0
  89. package/src/functions/owned.ts +11 -0
  90. package/src/functions/resources.ts +99 -0
  91. package/src/functions/reuses.ts +28 -0
  92. package/src/functions/schemas.ts +96 -0
  93. package/src/functions/tabularApi.ts +27 -0
  94. package/src/functions/users.ts +7 -0
  95. package/src/locales/de.json +154 -0
  96. package/src/locales/en.json +154 -0
  97. package/src/locales/es.json +154 -0
  98. package/src/locales/fr.json +154 -0
  99. package/src/locales/it.json +154 -0
  100. package/src/locales/pt.json +154 -0
  101. package/src/locales/sr.json +154 -0
  102. package/src/main.ts +147 -0
  103. package/src/types/badges.ts +5 -0
  104. package/src/types/contact_point.ts +7 -0
  105. package/src/types/dataservices.ts +68 -0
  106. package/src/types/datasets.ts +80 -0
  107. package/src/types/frequency.ts +6 -0
  108. package/src/types/granularity.ts +6 -0
  109. package/src/types/harvest.ts +3 -0
  110. package/src/types/keyboard.ts +1 -0
  111. package/src/types/licenses.ts +9 -0
  112. package/src/types/organizations.ts +41 -0
  113. package/src/types/owned.ts +9 -0
  114. package/src/types/resources.ts +37 -0
  115. package/src/types/reuses.ts +49 -0
  116. package/src/types/site.ts +23 -0
  117. package/src/types/topics.ts +20 -0
  118. package/src/types/ui.ts +3 -0
  119. package/src/types/users.ts +10 -0
@@ -0,0 +1,154 @@
1
+ {
2
+ "Copy": "Copy",
3
+ "The identity of this public service is certified by {certifier}": "The identity of this public service is certified by {certifier}",
4
+ "Edit file": "Edit file",
5
+ "Nameless file": "Nameless file",
6
+ "schema:": "schema:",
7
+ "Invalid": "Invalid",
8
+ "Updated {date}": "Updated {date}",
9
+ "{n} downloads": "{n} downloads",
10
+ "From": "From",
11
+ "Unavailable": "Unavailable",
12
+ "Close details": "Close details",
13
+ "See data": "See data",
14
+ "See metadata": "See metadata",
15
+ "File link - opens a new window": "File link - opens a new window",
16
+ "Download file": "Download file",
17
+ "File menu": "File menu",
18
+ "Preview": "Preview",
19
+ "Data structure": "Data structure",
20
+ "Metadata": "Metadata",
21
+ "Data schema": "Data schema",
22
+ "This file is following a schema: ": "This file is following a schema: ",
23
+ "See validation report": "See validation report",
24
+ "URL": "URL",
25
+ "MIME Type": "MIME Type",
26
+ "Created on": "Created on",
27
+ "Modified on": "Modified on",
28
+ "Size": "Size",
29
+ "Explore data": "Explore data",
30
+ "B": "B",
31
+ "today": "today",
32
+ "on {date}": "on {date}",
33
+ "Informations": "Informations",
34
+ "License": "License",
35
+ "Temporality": "Temporality",
36
+ "Creation": "Creation",
37
+ "Frequency": "Frequency",
38
+ "Last update": "Last update",
39
+ "Spatial coverage": "Spatial coverage",
40
+ "Territorial coverage": "Territorial coverage",
41
+ "Granularity of territorial coverage": "Granularity of territorial coverage",
42
+ "Integrate on your website": "Integrate on your website",
43
+ "Extras": "Extras",
44
+ "See extras": "See extras",
45
+ "Harvest": "Harvest",
46
+ "See harvest": "See harvest",
47
+ "Pagination": "Pagination",
48
+ "First page": "First page",
49
+ "Previous page": "Previous page",
50
+ "Page {nb}": "Page {nb}",
51
+ "Next page": "Next page",
52
+ "Last page": "Last page",
53
+ "Metadata quality:": "Metadata quality:",
54
+ "Data description filled": "Data description filled",
55
+ "Data description empty": "Data description empty",
56
+ "Files documented": "Files documented",
57
+ "Files documentation missing": "Files documentation missing",
58
+ "License filled": "License filled",
59
+ "No license set": "No license set",
60
+ "Update frequency followed": "Update frequency followed",
61
+ "Update frequency not followed": "Update frequency not followed",
62
+ "Update frequency not set": "Update frequency not set",
63
+ "File formats are open": "File formats are open",
64
+ "File formats are closed": "File formats are closed",
65
+ "Temporal coverage filled": "Temporal coverage filled",
66
+ "Temporal coverage not set": "Temporal coverage not set",
67
+ "Spatial coverage filled": "Spatial coverage filled",
68
+ "Spatial coverage not set": "Spatial coverage not set",
69
+ "All files are available": "All files are available",
70
+ "Some files are unavailable": "Some files are unavailable",
71
+ "Learn more about this indicator - opens a new window": "Learn more about this indicator - opens a new window",
72
+ "Learn more about this indicator": "Learn more about this indicator",
73
+ "Read less": "Read less",
74
+ "Read more": "Read more",
75
+ "Archived": "Archived",
76
+ "Metadata :": "Metadata :",
77
+ "Availability :": "Availability :",
78
+ "Local authority": "Local authority",
79
+ "Association": "Association",
80
+ "Company": "Company",
81
+ "User": "User",
82
+ "The data structure of this file failed to load.": "The data structure of this file failed to load.",
83
+ "No data structure found for this file.": "No data structure found for this file.",
84
+ "The preview of this file failed to load.": "The preview of this file failed to load.",
85
+ "Explore data in detail": "Explore data in detail",
86
+ "Use our tool to get an overview of data, learn about different columns or perform filters and sorts.": "Use our tool to get an overview of data, learn about different columns or perform filters and sorts.",
87
+ "Preview updated on {date}": "Preview updated on {date}",
88
+ "Preview of {name}": "Preview of {name}",
89
+ "Sort ascending": "Sort ascending",
90
+ "Sort descending": "Sort descending",
91
+ "{count} columns": "{count} columns",
92
+ "{count} rows": "{count} rows",
93
+ "Resource Extras": "Resource Extras",
94
+ "Public service": "Public service",
95
+ "published {date}": "published {date}",
96
+ "{n}%": "{n}%",
97
+ "Restricted access": "Restricted access",
98
+ "Other": "Other",
99
+ "{n} views": "{n} views",
100
+ "{n} followers": "{n} followers",
101
+ "unknown": "unknown",
102
+ "Link copied!": "Link copied!",
103
+ "Copy link": "Copy link",
104
+ "Original format": "Original format",
105
+ "Format {format}": "Format {format}",
106
+ "Data": "Data",
107
+ "Description": "Description",
108
+ "Downloads": "Downloads",
109
+ "Schema:": "Schema",
110
+ "Copy embed": "Copy embed",
111
+ "Embed copied": "Embed copied",
112
+ "Stable URL": "Stable URL",
113
+ "Identifier": "Identifier",
114
+ "Copy ID": "Copy ID",
115
+ "ID copied!": "ID copied!",
116
+ "Copy checksum": "Copy checksum",
117
+ "Checksum copied!": "Checksum copied!",
118
+ "Type": "Type",
119
+ "Format": "Format",
120
+ "downloads": "downloads",
121
+ "Visit": "Visit",
122
+ "Original URL": "Original URL",
123
+ "File": "File",
124
+ "This file is valid for the shema:": "This file is valid for the shema:",
125
+ "But its compliance could be improved.": "But its compliance could be improved.",
126
+ "This file indicates to follow the schema:": "This file indicates to follow the schema:",
127
+ "But is not compliant.": "But is not compliant.",
128
+ "advices": "advices",
129
+ "structure errors": "structure errors",
130
+ "body errors": "body errors",
131
+ "Main file": "Main file",
132
+ "Documentation": "Documentation",
133
+ "Update": "Update",
134
+ "API": "API",
135
+ "Source code": "Source code",
136
+ "{n} resources downloads": "{n} resources downloads",
137
+ "{n} reuses": "{n} reuses",
138
+ "Close": "Close",
139
+ " in ": " in ",
140
+ "Auto-generated formats from {platform}": "Auto-generated formats from {platform}",
141
+ "Draft": "Draft",
142
+ "API documentation": "API documentation",
143
+ "Technical Documentation": "Technical Documentation",
144
+ "Business documentation": "Business documentation",
145
+ "Swagger": "Swagger",
146
+ "Swagger automatically generated by data.gouv.fr. This swagger allows you to query data by API by filtering it by column value.": "Swagger automatically generated by data.gouv.fr. This swagger allows you to query data by API by filtering it by column value.",
147
+ "Good": "Good",
148
+ "To improve": "To improve",
149
+ "Copy URL": "Copy URL",
150
+ "URL copied!": "URL copied!",
151
+ "Copy stable URL": "Copy stable URL",
152
+ "Stable URL copied!": "Stable URL copied!",
153
+ "Download file as ": "Download file as "
154
+ }
package/src/main.ts ADDED
@@ -0,0 +1,147 @@
1
+ import type { App, Plugin } from 'vue'
2
+ import type { Badge, Badges } from './types/badges'
3
+ import type { Dataset, DatasetV2, NewDataset, Quality, Rel } from './types/datasets'
4
+ import type { NewDataservice, Dataservice } from './types/dataservices'
5
+ import type { Frequency, Frequencies } from './types/frequency'
6
+ import type { Granularity, Granularities } from './types/granularity'
7
+ import type { Harvest } from './types/harvest'
8
+ import type { License } from './types/licenses'
9
+ import type { Member, MemberRole, NewOrganization, Organization } from './types/organizations'
10
+ import type { Owned, OwnedWithId } from './types/owned'
11
+ import type { NewReuse, Reuse, ReuseTopic, ReuseType } from './types/reuses'
12
+ import type { TopicV2 } from './types/topics'
13
+ import type { CommunityResource, FileResourceFileType, RemoteResourceFileType, ResourceFileType, ResourceType, Resource } from './types/resources'
14
+ import type { Site } from './types/site'
15
+ import type { Weight, WellType } from './types/ui'
16
+ import type { User } from './types/users'
17
+
18
+ import Avatar from './components/Avatar.vue'
19
+ import AvatarWithName from './components/AvatarWithName.vue'
20
+ import BannerAction from './components/BannerAction.vue'
21
+ import BrandedButton from './components/BrandedButton.vue'
22
+ import CopyButton from './components/CopyButton.vue'
23
+ import DataserviceCard from './components/DataserviceCard.vue'
24
+ import DatasetCard from './components/DatasetCard.vue'
25
+ import DatasetInformationPanel from './components/DatasetInformationPanel.vue'
26
+ import DatasetQuality from './components/DatasetQuality.vue'
27
+ import DatasetQualityInline from './components/DatasetQualityInline.vue'
28
+ import DatasetQualityItem from './components/DatasetQualityItem.vue'
29
+ import DatasetQualityScore from './components/DatasetQualityScore.vue'
30
+ import DatasetQualityTooltipContent from './components/DatasetQualityTooltipContent.vue'
31
+ import OrganizationCard from './components/OrganizationCard.vue'
32
+ import OrganizationNameWithCertificate from './components/OrganizationNameWithCertificate.vue'
33
+ import OwnerType from './components/OwnerType.vue'
34
+ import OwnerTypeIcon from './components/OwnerTypeIcon.vue'
35
+ import Pagination from './components/Pagination.vue'
36
+ import Placeholder from './components/Placeholder.vue'
37
+ import ReadMore from './components/ReadMore.vue'
38
+ import ResourceAccordion from './components/ResourceAccordion/ResourceAccordion.vue'
39
+ import ResourceIcon from './components/ResourceAccordion/ResourceIcon.vue'
40
+ import ReuseCard from './components/ReuseCard.vue'
41
+ import SimpleBanner from './components/SimpleBanner.vue'
42
+ import StatBox from './components/StatBox.vue'
43
+ import type { UseFetchFunction } from './functions/api.types'
44
+ import { configKey, useComponentsConfig, type PluginConfig } from './config.js'
45
+
46
+ export * from './composables/useReuseType'
47
+
48
+ export * from './functions/dates'
49
+ export * from './functions/organizations'
50
+ export * from './functions/resources'
51
+ export * from './functions/users'
52
+ export * from './functions/datasets'
53
+ export * from './functions/owned'
54
+ export * from './functions/helpers'
55
+ export * from './functions/matomo'
56
+ export * from './functions/schemas'
57
+ export * from './functions/markdown'
58
+
59
+ export type {
60
+ UseFetchFunction,
61
+ Badge,
62
+ Badges,
63
+ CommunityResource,
64
+ Dataset,
65
+ DatasetV2,
66
+ Dataservice,
67
+ NewDataservice,
68
+ FileResourceFileType,
69
+ Frequency,
70
+ Frequencies,
71
+ Granularity,
72
+ Granularities,
73
+ Harvest,
74
+ License,
75
+ Member,
76
+ MemberRole,
77
+ NewDataset,
78
+ NewOrganization,
79
+ NewReuse,
80
+ Organization,
81
+ Owned,
82
+ OwnedWithId,
83
+ Quality,
84
+ Rel,
85
+ RemoteResourceFileType,
86
+ Resource,
87
+ ResourceFileType,
88
+ ResourceType,
89
+ Reuse,
90
+ ReuseTopic,
91
+ ReuseType,
92
+ Site,
93
+ TopicV2,
94
+ User,
95
+ Weight,
96
+ WellType,
97
+ }
98
+
99
+ // Vue Plugin
100
+ const datagouv: Plugin<PluginConfig> = {
101
+ async install(app: App, options) {
102
+ if (!options.textClamp) {
103
+ const textClamp = await import('vue3-text-clamp')
104
+ options.textClamp = textClamp.default
105
+ }
106
+
107
+ if (options.i18n) {
108
+ const frMessages = await import('../dist/locales/fr.js')
109
+ const enMessages = await import('../dist/locales/en.js')
110
+
111
+ options.i18n.global.mergeLocaleMessage('en', enMessages.default)
112
+ options.i18n.global.mergeLocaleMessage('fr', frMessages.default)
113
+ }
114
+
115
+ app.provide(configKey, options)
116
+ },
117
+ }
118
+
119
+ export {
120
+ datagouv,
121
+ useComponentsConfig,
122
+ Avatar,
123
+ AvatarWithName,
124
+ BannerAction,
125
+ BrandedButton,
126
+ CopyButton,
127
+ DataserviceCard,
128
+ DatasetCard,
129
+ DatasetInformationPanel,
130
+ DatasetQuality,
131
+ DatasetQualityInline,
132
+ DatasetQualityItem,
133
+ DatasetQualityScore,
134
+ DatasetQualityTooltipContent,
135
+ OrganizationCard,
136
+ OrganizationNameWithCertificate,
137
+ OwnerType,
138
+ OwnerTypeIcon,
139
+ Pagination,
140
+ Placeholder,
141
+ ReadMore,
142
+ ResourceAccordion,
143
+ ResourceIcon,
144
+ ReuseCard,
145
+ SimpleBanner,
146
+ StatBox,
147
+ }
@@ -0,0 +1,5 @@
1
+ export type Badge = {
2
+ kind: string;
3
+ };
4
+
5
+ export type Badges = Array<Badge>;
@@ -0,0 +1,7 @@
1
+ export type ContactPoint = {
2
+ id: string;
3
+ name: string;
4
+ contact_form?: string;
5
+ email?: string;
6
+ role: string;
7
+ }
@@ -0,0 +1,68 @@
1
+ import type { Harvest } from './harvest'
2
+ import type { Owned, OwnedWithId } from './owned'
3
+ import type { ContactPoint } from './contact_point'
4
+
5
+ export type BaseDataservice = Owned & {
6
+ acronym: string
7
+ authorization_request_url: string | null
8
+ availability: number | null
9
+ 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
+ }>
18
+ description: string
19
+ machine_documentation_url: string | null
20
+ technical_documentation_url: string | null
21
+ business_documentation_url: string | null
22
+ access_type: 'open' | 'restricted' | 'open_with_account'
23
+ license: string | null
24
+ private: boolean
25
+ rate_limiting: string
26
+ title: string
27
+ contact_points: Array<ContactPoint>
28
+ }
29
+
30
+ export type NewDataservice = Omit<BaseDataservice, keyof OwnedWithId> & OwnedWithId
31
+
32
+ export type Dataservice = Owned & {
33
+ acronym: string
34
+ archived_at: string | null
35
+ authorization_request_url: string | null
36
+ availability: number | null
37
+ base_api_url: string | null
38
+ contact_points: Array<ContactPoint>
39
+ created_at: string
40
+ datasets: Array<{
41
+ class: string
42
+ id: string
43
+ acronym: string
44
+ page: string
45
+ title: string
46
+ uri: string
47
+ }>
48
+ deleted_at: string | null
49
+ description: string
50
+ machine_documentation_url: string | null
51
+ technical_documentation_url: string | null
52
+ business_documentation_url: string | null
53
+ extras: Record<string, any>
54
+ format: string
55
+ harvest: Harvest
56
+ id: string
57
+ access_type: 'open' | 'restricted' | 'open_with_account'
58
+ license: string | null
59
+ metadata_modified_at: string
60
+ metrics: { discussions: number, followers: number, reuses: number, views: number }
61
+ private: boolean
62
+ rate_limiting: string
63
+ self_api_url: string
64
+ self_web_url: string
65
+ slug: string
66
+ tags: Array<string>
67
+ title: string
68
+ }
@@ -0,0 +1,80 @@
1
+ import type { Badges } from './badges'
2
+ import type { Harvest } from './harvest'
3
+ import type { Owned, OwnedWithId } from './owned'
4
+ import type { Resource } from './resources'
5
+ import type { ContactPoint } from './contact_point'
6
+
7
+ export type Quality = {
8
+ all_resources_available: boolean
9
+ dataset_description_quality: boolean
10
+ has_open_format: boolean
11
+ has_resources: boolean
12
+ license: boolean
13
+ resources_documentation: boolean
14
+ score: number
15
+ spatial: boolean
16
+ temporal_coverage: boolean
17
+ update_frequency: boolean
18
+ update_fulfilled_in_time: boolean
19
+ }
20
+
21
+ export type BaseDataset = Owned & {
22
+ title: string
23
+ acronym: string
24
+ archived: boolean
25
+ description: string
26
+ tags: Array<string> | null
27
+ license: string
28
+ frequency: string
29
+ temporal_coverage: {
30
+ start: string
31
+ end: string
32
+ } | null
33
+ frequency_date: string | null
34
+ page: string
35
+ private: boolean
36
+ quality?: Quality
37
+ spatial: {
38
+ zones?: Array<string>
39
+ granularity?: string
40
+ } | null
41
+ contact_points: Array<ContactPoint>
42
+ }
43
+
44
+ export type NewDataset = Omit<BaseDataset, keyof OwnedWithId> & OwnedWithId
45
+
46
+ export type Rel = {
47
+ rel: string
48
+ href: string
49
+ total: number
50
+ type: string
51
+ }
52
+
53
+ export type Dataset = BaseDataset & {
54
+ id: string
55
+ badges: Badges
56
+ deleted: string | null
57
+ page: string
58
+ resources: Array<Resource>
59
+ community_resources: Array<Resource>
60
+ created_at: string
61
+ last_modified: string
62
+ last_update: string
63
+ uri: string
64
+ slug: string
65
+ quality: Quality
66
+ metrics: {
67
+ discussions: number
68
+ followers: number
69
+ resources_downloads: number
70
+ reuses: number
71
+ views: number
72
+ }
73
+ harvest: Harvest
74
+ extras: Record<string, any>
75
+ }
76
+
77
+ export type DatasetV2 = Owned & Omit<Dataset, 'resources' | 'community_resources'> & {
78
+ resources: Rel
79
+ community_resources: Rel
80
+ }
@@ -0,0 +1,6 @@
1
+ export type Frequency = {
2
+ id: string;
3
+ label: string;
4
+ };
5
+
6
+ export type Frequencies = Array<Frequency>;
@@ -0,0 +1,6 @@
1
+ export type Granularity = {
2
+ id: string;
3
+ name: string;
4
+ };
5
+
6
+ export type Granularities = Array<Granularity>;
@@ -0,0 +1,3 @@
1
+ export type Harvest = Record<string, any> & {
2
+ backend?: string;
3
+ } | null;
@@ -0,0 +1 @@
1
+ export type CommonKeyboardKeys = 'Alt' | 'Control' | 'Shift' | 'CapsLock' | 'Tab' | 'Escape' | 'End' | 'Home' | 'ArrowLeft' | 'ArrowUp' | 'ArrowRight' | 'ArrowDown'
@@ -0,0 +1,9 @@
1
+ export type License = {
2
+ alternate_titles: Array<string>;
3
+ alternate_urls: Array<string>;
4
+ flags: Array<string>;
5
+ id: string;
6
+ maintainer: string | null;
7
+ title: string;
8
+ url: string;
9
+ };
@@ -0,0 +1,41 @@
1
+ import type { User } from './users'
2
+ import type { Badges } from './badges'
3
+
4
+ export type MemberRole = 'admin' | 'editor'
5
+
6
+ export type Member = {
7
+ role: MemberRole
8
+ user: User
9
+ }
10
+
11
+ export type NewOrganization = {
12
+ acronym: string | null
13
+ name: string
14
+ business_number_id: string | null
15
+ description: string
16
+ url: string | null
17
+ logo: string
18
+ }
19
+
20
+ export type Organization = NewOrganization & {
21
+ id: string
22
+ created_at: string
23
+ last_modified: string
24
+ last_update: string
25
+ deleted: string | null
26
+ extras: Record<string, any>
27
+ logo_thumbnail: string
28
+ members: Array<Member>
29
+ metrics: {
30
+ dataservices: number
31
+ datasets: number
32
+ followers: number
33
+ members: number
34
+ reuses: number
35
+ views: number
36
+ }
37
+ page: string
38
+ slug: string
39
+ uri: string
40
+ badges: Badges
41
+ }
@@ -0,0 +1,9 @@
1
+ import type { Organization } from './organizations'
2
+ import type { User } from './users'
3
+
4
+ /**
5
+ * A resource, dataset, reuse or any other object owned by an organization or a user.
6
+ */
7
+ export type Owned = { organization: Organization, owner: never | null } | { organization: never | null, owner: User }
8
+
9
+ export type OwnedWithId = { organization: string, owner: never | null } | { organization: never | null, owner: string }
@@ -0,0 +1,37 @@
1
+ import type { Schema } from '../functions/schemas'
2
+ import type { RESOURCE_TYPE } from '../functions/resources'
3
+ import type { Dataset } from './datasets'
4
+ import type { Harvest } from './harvest'
5
+ import type { Owned } from './owned'
6
+
7
+ export type ResourceType = typeof RESOURCE_TYPE[number]
8
+
9
+ export type RemoteResourceFileType = 'remote'
10
+
11
+ export type FileResourceFileType = 'file'
12
+
13
+ export type ResourceFileType = RemoteResourceFileType | FileResourceFileType
14
+
15
+ export type Resource = {
16
+ id: string
17
+ title: string
18
+ type: ResourceType
19
+ checksum: { type: string, value: string } | null
20
+ created_at: string
21
+ description: string | null
22
+ extras: Record<string, unknown>
23
+ metrics: { views: number }
24
+ harvest: Harvest
25
+ filesize: number | null
26
+ filetype: ResourceFileType
27
+ format: string
28
+ mime: string
29
+ internal: Record<string, unknown>
30
+ last_modified: string
31
+ latest: string
32
+ preview_url: string
33
+ schema: Schema
34
+ url: string
35
+ }
36
+
37
+ export type CommunityResource = Owned & Resource & { dataset: Omit<Dataset, 'resources' | 'community_resources'> }
@@ -0,0 +1,49 @@
1
+ import type { Owned, OwnedWithId } from './owned'
2
+ import type { Dataset } from './datasets'
3
+ import type { Badges } from './badges'
4
+
5
+ export type BaseReuse = Owned & {
6
+ title: string
7
+ description: string
8
+ tags: Array<string> | null
9
+ datasets: Array<Dataset | string>
10
+ topic: string
11
+ type: string
12
+ url: string
13
+ private: boolean
14
+ }
15
+
16
+ export type NewReuse = Omit<BaseReuse, keyof OwnedWithId> & OwnedWithId
17
+
18
+ export type Reuse = BaseReuse & {
19
+ badges: Badges
20
+ created_at: string
21
+ datasets: Array<Dataset>
22
+ archived: string | null
23
+ deleted: string | null
24
+ extras: Record<string, any>
25
+ featured: boolean
26
+ id: string
27
+ image: string | null
28
+ image_thumbnail: string | null
29
+ last_modified: string
30
+ metrics: {
31
+ datasets: number
32
+ discussions: number
33
+ followers: number
34
+ views: number
35
+ }
36
+ slug: string
37
+ page: string
38
+ uri: string
39
+ }
40
+
41
+ export type ReuseType = {
42
+ id: string
43
+ label: string
44
+ }
45
+
46
+ export type ReuseTopic = {
47
+ id: string
48
+ label: string
49
+ }
@@ -0,0 +1,23 @@
1
+ export type Site = {
2
+ id: string
3
+ title: string
4
+ metrics: {
5
+ 'dataservices': number
6
+ 'datasets': number
7
+ 'discussions': number
8
+ 'followers': number
9
+ 'harvesters': number
10
+ 'max_dataset_followers': number
11
+ 'max_dataset_reuses': number
12
+ 'max_org_datasets': number
13
+ 'max_org_followers': number
14
+ 'max_org_reuses': number
15
+ 'max_reuse_datasets': number
16
+ 'max_reuse_followers': number
17
+ 'organizations': number
18
+ 'public-service': number
19
+ 'resources': number
20
+ 'reuses': number
21
+ 'users': number
22
+ }
23
+ }
@@ -0,0 +1,20 @@
1
+ import type { Rel } from './datasets'
2
+ import type { Owned } from './owned'
3
+
4
+ export type TopicV2 = Owned & {
5
+ id: string
6
+ name: string
7
+ slug: string
8
+ description: string
9
+ tags: Array<string>
10
+ datasets: Rel
11
+ reuses: Rel
12
+ featured: boolean
13
+ private: boolean
14
+ created_at: string
15
+ last_modified: string
16
+
17
+ uri: string
18
+ page: string
19
+ extras: Record<string, unknown>
20
+ }