26 lines
833 B
JavaScript
26 lines
833 B
JavaScript
import { Feature } from "../types/Feature";
|
|
export class Port extends Feature {
|
|
cache;
|
|
constructor(cache) {
|
|
super();
|
|
this.cache = cache;
|
|
}
|
|
importEntity(entity, id, file, option, s2jOpts) {
|
|
const formData = new FormData();
|
|
formData.set('entity', entity);
|
|
formData.set('id', id);
|
|
formData.set('file', file);
|
|
formData.set('option', JSON.stringify(option));
|
|
if (s2jOpts) {
|
|
formData.set('s2jOpts', JSON.stringify(s2jOpts));
|
|
}
|
|
return this.cache.exec('importEntity', formData);
|
|
}
|
|
exportEntity(entity, id, filter, properties) {
|
|
return this.cache.exec('exportEntity', { entity, id, filter, properties });
|
|
}
|
|
getImportationTemplate(id) {
|
|
return this.cache.exec('getImportationTemplate', { id });
|
|
}
|
|
}
|