@edraj/tsdmart 4.0.3 → 4.1.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.
package/dmart.model.ts
CHANGED
|
@@ -248,6 +248,7 @@ export enum ContentType {
|
|
|
248
248
|
audio = "audio",
|
|
249
249
|
video = "video",
|
|
250
250
|
jsonl = "jsonl",
|
|
251
|
+
apk = "apk",
|
|
251
252
|
csv = "csv",
|
|
252
253
|
sqlite = "sqlite",
|
|
253
254
|
parquet = "parquet",
|
|
@@ -353,6 +354,7 @@ export type ApiQueryResponse = ApiResponse & {
|
|
|
353
354
|
export interface ResourcesFromCSVRequest {
|
|
354
355
|
space_name: string,
|
|
355
356
|
subpath: string,
|
|
357
|
+
isUpdate?: boolean,
|
|
356
358
|
resourceType: ResourceType,
|
|
357
359
|
schema: string,
|
|
358
360
|
payload: File,
|
package/dmart.service.ts
CHANGED
|
@@ -303,7 +303,7 @@ export class Dmart {
|
|
|
303
303
|
) {
|
|
304
304
|
try {
|
|
305
305
|
let csvUrl = `/managed/resources_from_csv/${request.resourceType}/${request.space_name}/${request.subpath}`;
|
|
306
|
-
|
|
306
|
+
const params: any = {};
|
|
307
307
|
if (request.schema) {
|
|
308
308
|
csvUrl += `/${request.schema}`;
|
|
309
309
|
}
|
|
@@ -311,12 +311,16 @@ export class Dmart {
|
|
|
311
311
|
let formdata = new FormData();
|
|
312
312
|
formdata.append("resources_file", request.payload);
|
|
313
313
|
|
|
314
|
+
if(request.isUpdate){
|
|
315
|
+
params['is_update'] = request.isUpdate;
|
|
316
|
+
}
|
|
317
|
+
|
|
314
318
|
const headers = {"Content-Type": "multipart/form-data"};
|
|
315
319
|
|
|
316
320
|
const {data} = await Dmart.axiosDmartInstance.post<ApiResponse>(
|
|
317
321
|
csvUrl,
|
|
318
322
|
formdata,
|
|
319
|
-
{headers}
|
|
323
|
+
{headers, params}
|
|
320
324
|
);
|
|
321
325
|
|
|
322
326
|
return data;
|