@edraj/tsdmart 2.4.0 → 2.5.0
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.service.ts +13 -5
- package/package.json +1 -1
package/dmart.service.ts
CHANGED
|
@@ -224,6 +224,8 @@ export class Dmart {
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
+
|
|
228
|
+
|
|
227
229
|
public static async upload_with_payload(
|
|
228
230
|
space_name: string,
|
|
229
231
|
subpath: string,
|
|
@@ -343,7 +345,7 @@ export class Dmart {
|
|
|
343
345
|
return `/${scope}/payload/${resource_type}/${space_name}/${subpath.replace(
|
|
344
346
|
/\/+$/,
|
|
345
347
|
""
|
|
346
|
-
)}/${parent_shortname}/${shortname}${ext === null ? "" : ext}`;
|
|
348
|
+
)}/${parent_shortname}/${shortname}${ext === null ? "" : `.${ext}`}`;
|
|
347
349
|
}
|
|
348
350
|
|
|
349
351
|
public static async get_space_health(space_name: string) {
|
|
@@ -363,14 +365,20 @@ export class Dmart {
|
|
|
363
365
|
space_name: string,
|
|
364
366
|
subpath: string,
|
|
365
367
|
shortname: string,
|
|
366
|
-
schemaShortname: string =
|
|
367
|
-
ext: string = "
|
|
368
|
+
schemaShortname: string|null = null,
|
|
369
|
+
ext: string = "json",
|
|
368
370
|
scope: string = "managed"
|
|
369
371
|
) {
|
|
370
372
|
try {
|
|
373
|
+
let url = `${scope}/payload/${resource_type}/${space_name}/${subpath}/${shortname}`;
|
|
374
|
+
|
|
375
|
+
if(schemaShortname){
|
|
376
|
+
url += `.${schemaShortname}`
|
|
377
|
+
}
|
|
378
|
+
url += `.${ext}`
|
|
371
379
|
const { data } = await axios.get<any>(
|
|
372
|
-
|
|
373
|
-
|
|
380
|
+
url,
|
|
381
|
+
{ headers }
|
|
374
382
|
);
|
|
375
383
|
return data;
|
|
376
384
|
} catch (error: any) {
|