@datagouv/components-next 0.0.13 → 0.0.15

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datagouv/components-next",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./src/main.ts",
@@ -63,7 +63,6 @@
63
63
  "@tsconfig/node22": "^22.0.0",
64
64
  "@types/geojson": "^7946.0.16",
65
65
  "@types/node": "^22.13.1",
66
- "@types/swagger-ui": "^3.52.4",
67
66
  "@vitejs/plugin-vue": "^5.2.1",
68
67
  "@vue/eslint-config-prettier": "^10.2.0",
69
68
  "@vue/eslint-config-typescript": "^14.3.0",
@@ -4,10 +4,11 @@
4
4
 
5
5
  <script setup lang="ts">
6
6
  import { onMounted } from 'vue'
7
- import { SwaggerUIBundle } from 'swagger-ui-dist'
8
- import 'swagger-ui/dist/swagger-ui.css'
7
+ import SwaggerUiDist from 'swagger-ui-dist'
8
+ import 'swagger-ui-dist/swagger-ui.css'
9
9
  import '../../../assets/swagger-themes/newspaper.css'
10
10
 
11
+ const { SwaggerUIBundle } = SwaggerUiDist
11
12
  const props = defineProps<{
12
13
  url: string
13
14
  }>()
@@ -1,4 +1,3 @@
1
- import type { AxiosResponse } from 'axios'
2
1
  import { ofetch } from 'ofetch'
3
2
  import type { Resource } from '../types/resources'
4
3
  import { useComponentsConfig } from '../config'
@@ -43,7 +42,6 @@ export interface ValidataError {
43
42
  tags: Array<string>
44
43
  }
45
44
  export type SchemaResponseData = Array<RegisteredSchema>
46
- export type SchemaResponse = AxiosResponse<SchemaResponseData>
47
45
 
48
46
  type SchemaPath = { schema_name: string } | { schema_url: string }
49
47
 
@@ -1,4 +1,4 @@
1
- import axios from 'axios'
1
+ import { ofetch } from 'ofetch'
2
2
  import { useComponentsConfig, type PluginConfig } from '../config'
3
3
 
4
4
  export type SortConfig = {
@@ -9,19 +9,19 @@ export type SortConfig = {
9
9
  /**
10
10
  * Call Tabular-api to get table content
11
11
  */
12
- export function getData(config: PluginConfig, id: string, page: number, sortConfig?: SortConfig) {
12
+ export async function getData(config: PluginConfig, id: string, page: number, sortConfig?: SortConfig) {
13
13
  let url = `${config.tabularApiUrl}/api/resources/${id}/data/?page=${page}&page_size=${config.tabularApiPageSize || 15}`
14
14
  if (sortConfig) {
15
15
  url = url + `&${sortConfig.column}__sort=${sortConfig.type}`
16
16
  }
17
- return axios.get(url)
17
+ return await ofetch(url)
18
18
  }
19
19
 
20
20
  /**
21
21
  * Call Tabular-api to get table profile
22
22
  */
23
- export function getProfile(id: string) {
23
+ export async function getProfile(id: string) {
24
24
  const config = useComponentsConfig()
25
25
 
26
- return axios.get(`${config.tabularApiUrl}/api/resources/${id}/profile/`)
26
+ return await ofetch(`${config.tabularApiUrl}/api/resources/${id}/profile/`)
27
27
  }
@@ -1,4 +0,0 @@
1
- import { _ as f } from "./main-BpD9swJ2.js";
2
- export {
3
- f as default
4
- };