mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-04 20:26:35 +00:00
* fix: get rid of barrel files * chore: get rid of explicit imports * fix: use explicit import for classes and enums * fix: use explicit import for enum & class & aliases * fix: build issues
26 lines
673 B
TypeScript
26 lines
673 B
TypeScript
import type { Api } from 'nocodb-sdk'
|
|
import JSONTemplateAdapter from './JSONTemplateAdapter'
|
|
|
|
export default class JSONUrlTemplateAdapter extends JSONTemplateAdapter {
|
|
url: string
|
|
$api: any
|
|
|
|
constructor(url: string, parserConfig: Record<string, any>, api: Api<any>, progressCallback?: (msg: string) => void) {
|
|
// const { $api } = useNuxtApp()
|
|
super({}, parserConfig, progressCallback)
|
|
this.url = url
|
|
this.$api = api
|
|
}
|
|
|
|
async init() {
|
|
this.progress('Downloading json file')
|
|
const data = await this.$api.utils.axiosRequestMake({
|
|
apiMeta: {
|
|
url: this.url,
|
|
},
|
|
})
|
|
this._jsonData = data
|
|
await super.init()
|
|
}
|
|
}
|