@agility/management-sdk 0.1.17 → 0.1.18

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/README.md CHANGED
@@ -59,6 +59,21 @@ Returns: A collection of ```Media``` class Object.
59
59
 
60
60
  Returns: A collection of ```Media``` class Object.
61
61
 
62
+ ### deleteFolder
63
+ | Parameter | Type | Description |
64
+ | :-------- | :------- | :------------------------- |
65
+ | `originKey` | `string` | The origin key of the requested folder. |
66
+ | `guid` | `string` | Current website guid.|
67
+ | `mediaID` | `number` | The mediaID of the folder that needs to be deleted.|
68
+
69
+ ### renameFolder
70
+ | Parameter | Type | Description |
71
+ | :-------- | :------- | :------------------------- |
72
+ | `folderName` | `string` | The original folder name. |
73
+ | `newFolderName` | `string` | The new folder name. |
74
+ | `guid` | `string` | Current website guid.|
75
+ | `mediaID` | `number` | The mediaID of the folder that needs to be renamed.|
76
+
62
77
  ### deleteFile
63
78
  | Parameter | Type | Description |
64
79
  | :-------- | :------- | :------------------------- |
@@ -31,4 +31,6 @@ export declare class AssetMethods {
31
31
  */
32
32
  upload(formData: any, agilityFolderPath: string, guid: string, groupingID?: number): Promise<Media[]>;
33
33
  createFolder(originKey: string, guid: string): Promise<Media>;
34
+ deleteFolder(originKey: string, guid: string, mediaID?: number): Promise<void>;
35
+ renameFolder(folderName: string, newFolderName: string, guid: string, mediaID?: number): Promise<void>;
34
36
  }
@@ -320,6 +320,48 @@ var AssetMethods = /** @class */ (function () {
320
320
  });
321
321
  });
322
322
  };
323
+ AssetMethods.prototype.deleteFolder = function (originKey, guid, mediaID) {
324
+ if (mediaID === void 0) { mediaID = 0; }
325
+ return __awaiter(this, void 0, void 0, function () {
326
+ var apiPath, err_14;
327
+ return __generator(this, function (_a) {
328
+ switch (_a.label) {
329
+ case 0:
330
+ _a.trys.push([0, 2, , 3]);
331
+ apiPath = "asset/folder/delete?originKey=".concat(originKey, "&mediaID=").concat(mediaID);
332
+ return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, null)];
333
+ case 1:
334
+ _a.sent();
335
+ return [3 /*break*/, 3];
336
+ case 2:
337
+ err_14 = _a.sent();
338
+ throw new exception_1.Exception('Unable to delete folder.', err_14);
339
+ case 3: return [2 /*return*/];
340
+ }
341
+ });
342
+ });
343
+ };
344
+ AssetMethods.prototype.renameFolder = function (folderName, newFolderName, guid, mediaID) {
345
+ if (mediaID === void 0) { mediaID = 0; }
346
+ return __awaiter(this, void 0, void 0, function () {
347
+ var apiPath, err_15;
348
+ return __generator(this, function (_a) {
349
+ switch (_a.label) {
350
+ case 0:
351
+ _a.trys.push([0, 2, , 3]);
352
+ apiPath = "asset/folder/rename?folderName=".concat(folderName, "&newFolderName=").concat(newFolderName, "&mediaID=").concat(mediaID);
353
+ return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, null)];
354
+ case 1:
355
+ _a.sent();
356
+ return [3 /*break*/, 3];
357
+ case 2:
358
+ err_15 = _a.sent();
359
+ throw new exception_1.Exception('Unable to rename folder.', err_15);
360
+ case 3: return [2 /*return*/];
361
+ }
362
+ });
363
+ });
364
+ };
323
365
  return AssetMethods;
324
366
  }());
325
367
  exports.AssetMethods = AssetMethods;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agility/management-sdk",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "Agility CMS Tyescript SDK for Management API.",
5
5
  "repository": {
6
6
  "type": "git",