@edraj/tsdmart 2.8.0 → 3.0.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 +16 -18
- package/package.json +1 -1
package/dmart.service.ts
CHANGED
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
ApiQueryResponse,
|
|
6
6
|
ApiResponse,
|
|
7
7
|
ConfirmOTPRequest,
|
|
8
|
-
ContentType,
|
|
9
8
|
headers,
|
|
10
9
|
LoginResponse,
|
|
11
10
|
PasswordResetRequest,
|
|
@@ -275,29 +274,28 @@ export class Dmart {
|
|
|
275
274
|
}
|
|
276
275
|
|
|
277
276
|
|
|
278
|
-
|
|
279
277
|
public static async upload_with_payload(
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
): Promise<ApiResponse> {
|
|
278
|
+
space_name: string,
|
|
279
|
+
subpath: string,
|
|
280
|
+
shortname: string,
|
|
281
|
+
resource_type: ResourceType,
|
|
282
|
+
payload_file: File,
|
|
283
|
+
attributes?: Record<string, any>|null,
|
|
284
|
+
scope: string = "managed"
|
|
285
|
+
) {
|
|
289
286
|
const request_record_body: any = {
|
|
290
287
|
resource_type,
|
|
291
288
|
subpath,
|
|
292
289
|
shortname,
|
|
293
|
-
attributes:
|
|
290
|
+
attributes: attributes,
|
|
294
291
|
};
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
292
|
+
|
|
293
|
+
if (attributes !== null && Object.keys(attributes!).length === 0) {
|
|
294
|
+
request_record_body.attributes = {is_active: true, payload: { body: {} }};
|
|
295
|
+
} else {
|
|
296
|
+
if(!Object.keys(attributes!).includes('is_active')){
|
|
297
|
+
request_record_body.attributes.is_active = true;
|
|
298
|
+
}
|
|
301
299
|
}
|
|
302
300
|
|
|
303
301
|
const request_record = new Blob([JSON.stringify(request_record_body)], {
|