@agility/management-sdk 0.1.30 → 0.1.32

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.
Files changed (165) hide show
  1. package/README.md +238 -471
  2. package/dist/apiMethods/assetMethods.js +38 -38
  3. package/dist/apiMethods/batchMethods.d.ts +32 -1
  4. package/dist/apiMethods/batchMethods.js +238 -8
  5. package/dist/apiMethods/clientInstance.d.ts +1 -1
  6. package/dist/apiMethods/clientInstance.js +12 -11
  7. package/dist/apiMethods/containerMethods.js +20 -20
  8. package/dist/apiMethods/contentMethods.js +68 -68
  9. package/dist/apiMethods/instanceMethods.js +3 -3
  10. package/dist/apiMethods/instanceUserMethods.js +10 -10
  11. package/dist/apiMethods/modelMethods.js +13 -13
  12. package/dist/apiMethods/pageMethods.d.ts +13 -1
  13. package/dist/apiMethods/pageMethods.js +88 -70
  14. package/dist/apiMethods/serverUserMethods.js +4 -4
  15. package/dist/apiMethods/webhookMethods.js +11 -11
  16. package/dist/enums/assetGroupingType.js +1 -1
  17. package/dist/enums/batchItemType.d.ts +7 -0
  18. package/dist/enums/batchItemType.js +11 -0
  19. package/dist/enums/batchOperationType.js +1 -1
  20. package/dist/enums/batchState..js +1 -1
  21. package/dist/enums/pageItemTemplateType.js +1 -1
  22. package/dist/enums/workflowOperationType.d.ts +26 -0
  23. package/dist/enums/workflowOperationType.js +30 -0
  24. package/dist/index.d.ts +6 -0
  25. package/dist/index.js +7 -5
  26. package/dist/models/batchItem.d.ts +1 -0
  27. package/dist/models/batchTypes.d.ts +34 -0
  28. package/dist/{types/media.js → models/batchTypes.js} +0 -1
  29. package/dist/models/container.d.ts +2 -1
  30. package/dist/models/contentDefinitionTypeID.d.ts +17 -0
  31. package/dist/models/contentDefinitionTypeID.js +21 -0
  32. package/dist/models/exception.js +0 -2
  33. package/dist/models/locales.js +0 -2
  34. package/package.json +1 -1
  35. package/.cursor/manifest.md +0 -98
  36. package/.env +0 -92
  37. package/dist/apiClient.js.map +0 -1
  38. package/dist/apiMethods/assetMethods.js.map +0 -1
  39. package/dist/apiMethods/batchMethods.js.map +0 -1
  40. package/dist/apiMethods/clientInstance.js.map +0 -1
  41. package/dist/apiMethods/containerMethods.js.map +0 -1
  42. package/dist/apiMethods/contentMethods.js.map +0 -1
  43. package/dist/apiMethods/instanceMethods.js.map +0 -1
  44. package/dist/apiMethods/instanceUserMethods.js.map +0 -1
  45. package/dist/apiMethods/modelMethods.js.map +0 -1
  46. package/dist/apiMethods/pageMethods.js.map +0 -1
  47. package/dist/apiMethods/serverUserMethods.js.map +0 -1
  48. package/dist/apiMethods/webhookMethods.js.map +0 -1
  49. package/dist/enums/assetGroupingType.js.map +0 -1
  50. package/dist/enums/batchOperationType.js.map +0 -1
  51. package/dist/enums/batchState.d.ts +0 -7
  52. package/dist/enums/batchState.js +0 -12
  53. package/dist/enums/batchState.js.map +0 -1
  54. package/dist/enums/pageItemTemplateType.js.map +0 -1
  55. package/dist/errors/exception.d.ts +0 -4
  56. package/dist/errors/exception.js +0 -11
  57. package/dist/errors/exception.js.map +0 -1
  58. package/dist/index.js.map +0 -1
  59. package/dist/tests/authHelper.d.ts +0 -2
  60. package/dist/tests/authHelper.js +0 -14
  61. package/dist/tests/authHelper.js.map +0 -1
  62. package/dist/tests/config/apiClient.config.d.ts +0 -16
  63. package/dist/tests/config/apiClient.config.js +0 -84
  64. package/dist/tests/config/apiClient.config.js.map +0 -1
  65. package/dist/tests/config/test.config.d.ts +0 -24
  66. package/dist/tests/config/test.config.js +0 -47
  67. package/dist/tests/config/test.config.js.map +0 -1
  68. package/dist/types/apiResponse.d.ts +0 -13
  69. package/dist/types/apiResponse.js +0 -3
  70. package/dist/types/apiResponse.js.map +0 -1
  71. package/dist/types/assetContainer.d.ts +0 -7
  72. package/dist/types/assetContainer.js +0 -3
  73. package/dist/types/assetContainer.js.map +0 -1
  74. package/dist/types/assetGalleries.d.ts +0 -5
  75. package/dist/types/assetGalleries.js +0 -3
  76. package/dist/types/assetGalleries.js.map +0 -1
  77. package/dist/types/assetMediaGrouping.d.ts +0 -17
  78. package/dist/types/assetMediaGrouping.js +0 -3
  79. package/dist/types/assetMediaGrouping.js.map +0 -1
  80. package/dist/types/assetMediaGroupingMetaData.d.ts +0 -4
  81. package/dist/types/assetMediaGroupingMetaData.js +0 -3
  82. package/dist/types/assetMediaGroupingMetaData.js.map +0 -1
  83. package/dist/types/batch.d.ts +0 -29
  84. package/dist/types/batch.js +0 -3
  85. package/dist/types/batch.js.map +0 -1
  86. package/dist/types/batchItem.d.ts +0 -13
  87. package/dist/types/batchItem.js +0 -3
  88. package/dist/types/batchItem.js.map +0 -1
  89. package/dist/types/container.d.ts +0 -47
  90. package/dist/types/container.js +0 -3
  91. package/dist/types/container.js.map +0 -1
  92. package/dist/types/contentItem.d.ts +0 -37
  93. package/dist/types/contentItem.js +0 -3
  94. package/dist/types/contentItem.js.map +0 -1
  95. package/dist/types/contentItemHistory.d.ts +0 -20
  96. package/dist/types/contentItemHistory.js +0 -3
  97. package/dist/types/contentItemHistory.js.map +0 -1
  98. package/dist/types/contentListFilterModel.d.ts +0 -26
  99. package/dist/types/contentListFilterModel.js +0 -3
  100. package/dist/types/contentListFilterModel.js.map +0 -1
  101. package/dist/types/contentSectionDefaultModule.d.ts +0 -7
  102. package/dist/types/contentSectionDefaultModule.js +0 -3
  103. package/dist/types/contentSectionDefaultModule.js.map +0 -1
  104. package/dist/types/contentSectionDefinition.d.ts +0 -35
  105. package/dist/types/contentSectionDefinition.js +0 -3
  106. package/dist/types/contentSectionDefinition.js.map +0 -1
  107. package/dist/types/contentViewColumn.d.ts +0 -8
  108. package/dist/types/contentViewColumn.js +0 -3
  109. package/dist/types/contentViewColumn.js.map +0 -1
  110. package/dist/types/instanceRole.d.ts +0 -7
  111. package/dist/types/instanceRole.js +0 -3
  112. package/dist/types/instanceRole.js.map +0 -1
  113. package/dist/types/instanceUser.d.ts +0 -14
  114. package/dist/types/instanceUser.js +0 -3
  115. package/dist/types/instanceUser.js.map +0 -1
  116. package/dist/types/itemComments.d.ts +0 -14
  117. package/dist/types/itemComments.js +0 -3
  118. package/dist/types/itemComments.js.map +0 -1
  119. package/dist/types/listParams.d.ts +0 -9
  120. package/dist/types/listParams.js +0 -3
  121. package/dist/types/listParams.js.map +0 -1
  122. package/dist/types/locales.d.ts +0 -1
  123. package/dist/types/locales.js +0 -3
  124. package/dist/types/locales.js.map +0 -1
  125. package/dist/types/media.d.ts +0 -30
  126. package/dist/types/media.js.map +0 -1
  127. package/dist/types/model.d.ts +0 -30
  128. package/dist/types/model.js +0 -3
  129. package/dist/types/model.js.map +0 -1
  130. package/dist/types/notification.d.ts +0 -13
  131. package/dist/types/notification.js +0 -3
  132. package/dist/types/notification.js.map +0 -1
  133. package/dist/types/options.d.ts +0 -7
  134. package/dist/types/options.js +0 -3
  135. package/dist/types/options.js.map +0 -1
  136. package/dist/types/pageHistory.d.ts +0 -21
  137. package/dist/types/pageHistory.js +0 -3
  138. package/dist/types/pageHistory.js.map +0 -1
  139. package/dist/types/pageItem.d.ts +0 -56
  140. package/dist/types/pageItem.js +0 -3
  141. package/dist/types/pageItem.js.map +0 -1
  142. package/dist/types/pageModel.d.ts +0 -14
  143. package/dist/types/pageModel.js +0 -3
  144. package/dist/types/pageModel.js.map +0 -1
  145. package/dist/types/serverUser.d.ts +0 -21
  146. package/dist/types/serverUser.js +0 -3
  147. package/dist/types/serverUser.js.map +0 -1
  148. package/dist/types/sharedModule.d.ts +0 -7
  149. package/dist/types/sharedModule.js +0 -3
  150. package/dist/types/sharedModule.js.map +0 -1
  151. package/dist/types/sitemap.d.ts +0 -20
  152. package/dist/types/sitemap.js +0 -3
  153. package/dist/types/sitemap.js.map +0 -1
  154. package/dist/types/tokenResponseData.d.ts +0 -10
  155. package/dist/types/tokenResponseData.js +0 -3
  156. package/dist/types/tokenResponseData.js.map +0 -1
  157. package/dist/types/webhook.d.ts +0 -9
  158. package/dist/types/webhook.js +0 -3
  159. package/dist/types/webhook.js.map +0 -1
  160. package/dist/types/websiteListing.d.ts +0 -16
  161. package/dist/types/websiteListing.js +0 -3
  162. package/dist/types/websiteListing.js.map +0 -1
  163. package/dist/types/websiteUser.d.ts +0 -22
  164. package/dist/types/websiteUser.js +0 -3
  165. package/dist/types/websiteUser.js.map +0 -1
@@ -9,12 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ while (_) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -51,7 +51,7 @@ var AssetMethods = /** @class */ (function () {
51
51
  switch (_a.label) {
52
52
  case 0:
53
53
  _a.trys.push([0, 2, , 3]);
54
- apiPath = "asset/delete/".concat(mediaID);
54
+ apiPath = "asset/delete/" + mediaID;
55
55
  return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)];
56
56
  case 1:
57
57
  resp = _a.sent();
@@ -59,7 +59,7 @@ var AssetMethods = /** @class */ (function () {
59
59
  return [2 /*return*/, resp.data];
60
60
  case 2:
61
61
  err_1 = _a.sent();
62
- throw new exception_1.Exception("Unable to delete the media for mediaID: ".concat(mediaID), err_1);
62
+ throw new exception_1.Exception("Unable to delete the media for mediaID: " + mediaID, err_1);
63
63
  case 3: return [2 /*return*/];
64
64
  }
65
65
  });
@@ -73,14 +73,14 @@ var AssetMethods = /** @class */ (function () {
73
73
  case 0:
74
74
  _a.trys.push([0, 2, , 3]);
75
75
  folder = encodeURIComponent(newFolder);
76
- apiPath = "asset/move/".concat(mediaID, "?newFolder=").concat(folder);
76
+ apiPath = "asset/move/" + mediaID + "?newFolder=" + folder;
77
77
  return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, null)];
78
78
  case 1:
79
79
  resp = _a.sent();
80
80
  return [2 /*return*/, resp.data];
81
81
  case 2:
82
82
  err_2 = _a.sent();
83
- throw new exception_1.Exception("Unable to move the media for mediaID: ".concat(mediaID), err_2);
83
+ throw new exception_1.Exception("Unable to move the media for mediaID: " + mediaID, err_2);
84
84
  case 3: return [2 /*return*/];
85
85
  }
86
86
  });
@@ -93,7 +93,7 @@ var AssetMethods = /** @class */ (function () {
93
93
  switch (_a.label) {
94
94
  case 0:
95
95
  _a.trys.push([0, 2, , 3]);
96
- apiPath = "asset/list?pageSize=".concat(pageSize, "&recordOffset=").concat(recordOffset);
96
+ apiPath = "asset/list?pageSize=" + pageSize + "&recordOffset=" + recordOffset;
97
97
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
98
98
  case 1:
99
99
  resp = _a.sent();
@@ -106,17 +106,17 @@ var AssetMethods = /** @class */ (function () {
106
106
  });
107
107
  });
108
108
  };
109
- AssetMethods.prototype.getGalleries = function (guid_1) {
110
- return __awaiter(this, arguments, void 0, function (guid, search, pageSize, rowIndex) {
109
+ AssetMethods.prototype.getGalleries = function (guid, search, pageSize, rowIndex) {
110
+ if (search === void 0) { search = null; }
111
+ if (pageSize === void 0) { pageSize = null; }
112
+ if (rowIndex === void 0) { rowIndex = null; }
113
+ return __awaiter(this, void 0, void 0, function () {
111
114
  var apiPath, resp, err_4;
112
- if (search === void 0) { search = null; }
113
- if (pageSize === void 0) { pageSize = null; }
114
- if (rowIndex === void 0) { rowIndex = null; }
115
115
  return __generator(this, function (_a) {
116
116
  switch (_a.label) {
117
117
  case 0:
118
118
  _a.trys.push([0, 2, , 3]);
119
- apiPath = "asset/galleries?search=".concat(search, "&pageSize=").concat(pageSize, "&rowIndex=").concat(rowIndex);
119
+ apiPath = "asset/galleries?search=" + search + "&pageSize=" + pageSize + "&rowIndex=" + rowIndex;
120
120
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
121
121
  case 1:
122
122
  resp = _a.sent();
@@ -136,14 +136,14 @@ var AssetMethods = /** @class */ (function () {
136
136
  switch (_a.label) {
137
137
  case 0:
138
138
  _a.trys.push([0, 2, , 3]);
139
- apiPath = "/asset/gallery/".concat(id);
139
+ apiPath = "/asset/gallery/" + id;
140
140
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
141
141
  case 1:
142
142
  resp = _a.sent();
143
143
  return [2 /*return*/, resp.data];
144
144
  case 2:
145
145
  err_5 = _a.sent();
146
- throw new exception_1.Exception("Unable to retrieve gallery for id ".concat(id), err_5);
146
+ throw new exception_1.Exception("Unable to retrieve gallery for id " + id, err_5);
147
147
  case 3: return [2 /*return*/];
148
148
  }
149
149
  });
@@ -156,14 +156,14 @@ var AssetMethods = /** @class */ (function () {
156
156
  switch (_a.label) {
157
157
  case 0:
158
158
  _a.trys.push([0, 2, , 3]);
159
- apiPath = "/asset/gallery?galleryName=".concat(galleryName);
159
+ apiPath = "/asset/gallery?galleryName=" + galleryName;
160
160
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
161
161
  case 1:
162
162
  resp = _a.sent();
163
163
  return [2 /*return*/, resp.data];
164
164
  case 2:
165
165
  err_6 = _a.sent();
166
- throw new exception_1.Exception("Unable to retrieve gallery for name ".concat(galleryName), err_6);
166
+ throw new exception_1.Exception("Unable to retrieve gallery for name " + galleryName, err_6);
167
167
  case 3: return [2 /*return*/];
168
168
  }
169
169
  });
@@ -183,7 +183,7 @@ var AssetMethods = /** @class */ (function () {
183
183
  return [2 /*return*/, resp.data];
184
184
  case 2:
185
185
  err_7 = _a.sent();
186
- throw new exception_1.Exception("Unable to retrieve container for guid ".concat(guid), err_7);
186
+ throw new exception_1.Exception("Unable to retrieve container for guid " + guid, err_7);
187
187
  case 3: return [2 /*return*/];
188
188
  }
189
189
  });
@@ -216,14 +216,14 @@ var AssetMethods = /** @class */ (function () {
216
216
  switch (_a.label) {
217
217
  case 0:
218
218
  _a.trys.push([0, 2, , 3]);
219
- apiPath = "/asset/gallery/".concat(id);
219
+ apiPath = "/asset/gallery/" + id;
220
220
  return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)];
221
221
  case 1:
222
222
  resp = _a.sent();
223
223
  return [2 /*return*/, resp.data];
224
224
  case 2:
225
225
  err_9 = _a.sent();
226
- throw new exception_1.Exception("Unable to delete gallery for id ".concat(id), err_9);
226
+ throw new exception_1.Exception("Unable to delete gallery for id " + id, err_9);
227
227
  case 3: return [2 /*return*/];
228
228
  }
229
229
  });
@@ -236,14 +236,14 @@ var AssetMethods = /** @class */ (function () {
236
236
  switch (_a.label) {
237
237
  case 0:
238
238
  _a.trys.push([0, 2, , 3]);
239
- apiPath = "asset/".concat(mediaID);
239
+ apiPath = "asset/" + mediaID;
240
240
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
241
241
  case 1:
242
242
  resp = _a.sent();
243
243
  return [2 /*return*/, resp.data];
244
244
  case 2:
245
245
  err_10 = _a.sent();
246
- throw new exception_1.Exception("Unable to retrieve asset for mediaID ".concat(mediaID), err_10);
246
+ throw new exception_1.Exception("Unable to retrieve asset for mediaID " + mediaID, err_10);
247
247
  case 3: return [2 /*return*/];
248
248
  }
249
249
  });
@@ -256,14 +256,14 @@ var AssetMethods = /** @class */ (function () {
256
256
  switch (_a.label) {
257
257
  case 0:
258
258
  _a.trys.push([0, 2, , 3]);
259
- apiPath = "asset?url=".concat(url);
259
+ apiPath = "asset?url=" + url;
260
260
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
261
261
  case 1:
262
262
  resp = _a.sent();
263
263
  return [2 /*return*/, resp.data];
264
264
  case 2:
265
265
  err_11 = _a.sent();
266
- throw new exception_1.Exception("Unable to retrieve asset for url ".concat(url), err_11);
266
+ throw new exception_1.Exception("Unable to retrieve asset for url " + url, err_11);
267
267
  case 3: return [2 /*return*/];
268
268
  }
269
269
  });
@@ -279,15 +279,15 @@ var AssetMethods = /** @class */ (function () {
279
279
  * @returns
280
280
  * @memberof AssetMethods
281
281
  */
282
- AssetMethods.prototype.upload = function (formData_1, agilityFolderPath_1, guid_1) {
283
- return __awaiter(this, arguments, void 0, function (formData, agilityFolderPath, guid, groupingID) {
282
+ AssetMethods.prototype.upload = function (formData, agilityFolderPath, guid, groupingID) {
283
+ if (groupingID === void 0) { groupingID = -1; }
284
+ return __awaiter(this, void 0, void 0, function () {
284
285
  var apiPath, resp, err_12;
285
- if (groupingID === void 0) { groupingID = -1; }
286
286
  return __generator(this, function (_a) {
287
287
  switch (_a.label) {
288
288
  case 0:
289
289
  _a.trys.push([0, 2, , 3]);
290
- apiPath = "asset/upload?folderPath=".concat(agilityFolderPath, "&groupingID=").concat(groupingID);
290
+ apiPath = "asset/upload?folderPath=" + agilityFolderPath + "&groupingID=" + groupingID;
291
291
  return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, formData)];
292
292
  case 1:
293
293
  resp = _a.sent();
@@ -307,7 +307,7 @@ var AssetMethods = /** @class */ (function () {
307
307
  switch (_a.label) {
308
308
  case 0:
309
309
  _a.trys.push([0, 2, , 3]);
310
- apiPath = "asset/folder?originKey=".concat(originKey);
310
+ apiPath = "asset/folder?originKey=" + originKey;
311
311
  return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, null)];
312
312
  case 1:
313
313
  resp = _a.sent();
@@ -320,15 +320,15 @@ var AssetMethods = /** @class */ (function () {
320
320
  });
321
321
  });
322
322
  };
323
- AssetMethods.prototype.deleteFolder = function (originKey_1, guid_1) {
324
- return __awaiter(this, arguments, void 0, function (originKey, guid, mediaID) {
323
+ AssetMethods.prototype.deleteFolder = function (originKey, guid, mediaID) {
324
+ if (mediaID === void 0) { mediaID = 0; }
325
+ return __awaiter(this, void 0, void 0, function () {
325
326
  var apiPath, err_14;
326
- if (mediaID === void 0) { mediaID = 0; }
327
327
  return __generator(this, function (_a) {
328
328
  switch (_a.label) {
329
329
  case 0:
330
330
  _a.trys.push([0, 2, , 3]);
331
- apiPath = "asset/folder/delete?originKey=".concat(originKey, "&mediaID=").concat(mediaID);
331
+ apiPath = "asset/folder/delete?originKey=" + originKey + "&mediaID=" + mediaID;
332
332
  return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, null)];
333
333
  case 1:
334
334
  _a.sent();
@@ -341,15 +341,15 @@ var AssetMethods = /** @class */ (function () {
341
341
  });
342
342
  });
343
343
  };
344
- AssetMethods.prototype.renameFolder = function (folderName_1, newFolderName_1, guid_1) {
345
- return __awaiter(this, arguments, void 0, function (folderName, newFolderName, guid, mediaID) {
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 () {
346
347
  var apiPath, err_15;
347
- if (mediaID === void 0) { mediaID = 0; }
348
348
  return __generator(this, function (_a) {
349
349
  switch (_a.label) {
350
350
  case 0:
351
351
  _a.trys.push([0, 2, , 3]);
352
- apiPath = "asset/folder/rename?folderName=".concat(folderName, "&newFolderName=").concat(newFolderName, "&mediaID=").concat(mediaID);
352
+ apiPath = "asset/folder/rename?folderName=" + folderName + "&newFolderName=" + newFolderName + "&mediaID=" + mediaID;
353
353
  return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, null)];
354
354
  case 1:
355
355
  _a.sent();
@@ -1,11 +1,42 @@
1
1
  import { Options } from "../models/options";
2
2
  import { ClientInstance } from "./clientInstance";
3
3
  import { Batch } from "../models/batch";
4
+ import { BatchTypesResponse } from "../models/batchTypes";
4
5
  export declare class BatchMethods {
5
6
  _options: Options;
6
7
  _clientInstance: ClientInstance;
7
8
  constructor(options: Options);
8
- getBatch(batchID: number, guid: string): Promise<Batch>;
9
+ getBatch(batchID: number, guid: string, expandItems?: boolean): Promise<Batch>;
10
+ publishBatch(batchID: number, guid: string, returnBatchId?: boolean): Promise<number>;
11
+ unpublishBatch(batchID: number, guid: string, returnBatchId?: boolean): Promise<number>;
12
+ approveBatch(batchID: number, guid: string, returnBatchId?: boolean): Promise<number>;
13
+ declineBatch(batchID: number, guid: string, returnBatchId?: boolean): Promise<number>;
14
+ requestApprovalBatch(batchID: number, guid: string, returnBatchId?: boolean): Promise<number>;
15
+ /**
16
+ * Retrieves all batch-related enum types for developer discovery.
17
+ * This method provides all available enum values with their names,
18
+ * enabling dynamic UI population and client-side validation.
19
+ *
20
+ * @param guid - Current website guid
21
+ * @returns Promise containing all batch enum types
22
+ *
23
+ * @example
24
+ * ```typescript
25
+ * // Get all batch types for UI population
26
+ * const types = await client.batchMethods.getBatchTypes(guid);
27
+ *
28
+ * // Create dropdown options for item types
29
+ * const itemTypeOptions = types.itemTypes.map(type => ({
30
+ * label: type.name,
31
+ * value: type.value
32
+ * }));
33
+ *
34
+ * // Validate operation type
35
+ * const isValidOperation = (value: number) =>
36
+ * types.workflowOperations.some(op => op.value === value);
37
+ * ```
38
+ */
39
+ getBatchTypes(guid: string): Promise<BatchTypesResponse>;
9
40
  Retry(method: Function): Promise<Batch>;
10
41
  delay(ms: number): Promise<unknown>;
11
42
  }
@@ -9,12 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ while (_) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -45,21 +45,251 @@ var BatchMethods = /** @class */ (function () {
45
45
  this._options = options;
46
46
  this._clientInstance = new clientInstance_1.ClientInstance(this._options);
47
47
  }
48
- BatchMethods.prototype.getBatch = function (batchID, guid) {
48
+ BatchMethods.prototype.getBatch = function (batchID, guid, expandItems) {
49
+ if (expandItems === void 0) { expandItems = true; }
49
50
  return __awaiter(this, void 0, void 0, function () {
50
51
  var apiPath, resp, err_1;
51
52
  return __generator(this, function (_a) {
52
53
  switch (_a.label) {
53
54
  case 0:
54
55
  _a.trys.push([0, 2, , 3]);
55
- apiPath = "batch/".concat(batchID);
56
+ apiPath = "batch/" + batchID + "?expandItems=" + expandItems;
56
57
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
57
58
  case 1:
58
59
  resp = _a.sent();
59
60
  return [2 /*return*/, resp.data];
60
61
  case 2:
61
62
  err_1 = _a.sent();
62
- throw new exception_1.Exception("Unable to retrieve the batch for id: ".concat(batchID), err_1);
63
+ throw new exception_1.Exception("Unable to retrieve the batch for id: " + batchID, err_1);
64
+ case 3: return [2 /*return*/];
65
+ }
66
+ });
67
+ });
68
+ };
69
+ BatchMethods.prototype.publishBatch = function (batchID, guid, returnBatchId) {
70
+ if (returnBatchId === void 0) { returnBatchId = false; }
71
+ return __awaiter(this, void 0, void 0, function () {
72
+ var apiPath, resp, resultBatchID_1, err_2;
73
+ var _this = this;
74
+ return __generator(this, function (_a) {
75
+ switch (_a.label) {
76
+ case 0:
77
+ _a.trys.push([0, 3, , 4]);
78
+ apiPath = "batch/" + batchID + "/publish";
79
+ return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, null)];
80
+ case 1:
81
+ resp = _a.sent();
82
+ resultBatchID_1 = resp.data;
83
+ // If user wants batchID immediately, return it for custom polling
84
+ if (returnBatchId) {
85
+ return [2 /*return*/, resultBatchID_1];
86
+ }
87
+ // Default behavior: wait for completion and return batch ID
88
+ return [4 /*yield*/, this.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
89
+ switch (_a.label) {
90
+ case 0: return [4 /*yield*/, this.getBatch(resultBatchID_1, guid)];
91
+ case 1: return [2 /*return*/, _a.sent()];
92
+ }
93
+ }); }); })];
94
+ case 2:
95
+ // Default behavior: wait for completion and return batch ID
96
+ _a.sent();
97
+ return [2 /*return*/, resultBatchID_1];
98
+ case 3:
99
+ err_2 = _a.sent();
100
+ throw new exception_1.Exception("Unable to publish the batch with id: " + batchID, err_2);
101
+ case 4: return [2 /*return*/];
102
+ }
103
+ });
104
+ });
105
+ };
106
+ BatchMethods.prototype.unpublishBatch = function (batchID, guid, returnBatchId) {
107
+ if (returnBatchId === void 0) { returnBatchId = false; }
108
+ return __awaiter(this, void 0, void 0, function () {
109
+ var apiPath, resp, resultBatchID_2, err_3;
110
+ var _this = this;
111
+ return __generator(this, function (_a) {
112
+ switch (_a.label) {
113
+ case 0:
114
+ _a.trys.push([0, 3, , 4]);
115
+ apiPath = "batch/" + batchID + "/unpublish";
116
+ return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, null)];
117
+ case 1:
118
+ resp = _a.sent();
119
+ resultBatchID_2 = resp.data;
120
+ // If user wants batchID immediately, return it for custom polling
121
+ if (returnBatchId) {
122
+ return [2 /*return*/, resultBatchID_2];
123
+ }
124
+ // Default behavior: wait for completion and return batch ID
125
+ return [4 /*yield*/, this.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
126
+ switch (_a.label) {
127
+ case 0: return [4 /*yield*/, this.getBatch(resultBatchID_2, guid)];
128
+ case 1: return [2 /*return*/, _a.sent()];
129
+ }
130
+ }); }); })];
131
+ case 2:
132
+ // Default behavior: wait for completion and return batch ID
133
+ _a.sent();
134
+ return [2 /*return*/, resultBatchID_2];
135
+ case 3:
136
+ err_3 = _a.sent();
137
+ throw new exception_1.Exception("Unable to unpublish the batch with id: " + batchID, err_3);
138
+ case 4: return [2 /*return*/];
139
+ }
140
+ });
141
+ });
142
+ };
143
+ BatchMethods.prototype.approveBatch = function (batchID, guid, returnBatchId) {
144
+ if (returnBatchId === void 0) { returnBatchId = false; }
145
+ return __awaiter(this, void 0, void 0, function () {
146
+ var apiPath, resp, resultBatchID_3, err_4;
147
+ var _this = this;
148
+ return __generator(this, function (_a) {
149
+ switch (_a.label) {
150
+ case 0:
151
+ _a.trys.push([0, 3, , 4]);
152
+ apiPath = "batch/" + batchID + "/approve";
153
+ return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, null)];
154
+ case 1:
155
+ resp = _a.sent();
156
+ resultBatchID_3 = resp.data;
157
+ // If user wants batchID immediately, return it for custom polling
158
+ if (returnBatchId) {
159
+ return [2 /*return*/, resultBatchID_3];
160
+ }
161
+ // Default behavior: wait for completion and return batch ID
162
+ return [4 /*yield*/, this.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
163
+ switch (_a.label) {
164
+ case 0: return [4 /*yield*/, this.getBatch(resultBatchID_3, guid)];
165
+ case 1: return [2 /*return*/, _a.sent()];
166
+ }
167
+ }); }); })];
168
+ case 2:
169
+ // Default behavior: wait for completion and return batch ID
170
+ _a.sent();
171
+ return [2 /*return*/, resultBatchID_3];
172
+ case 3:
173
+ err_4 = _a.sent();
174
+ throw new exception_1.Exception("Unable to approve the batch with id: " + batchID, err_4);
175
+ case 4: return [2 /*return*/];
176
+ }
177
+ });
178
+ });
179
+ };
180
+ BatchMethods.prototype.declineBatch = function (batchID, guid, returnBatchId) {
181
+ if (returnBatchId === void 0) { returnBatchId = false; }
182
+ return __awaiter(this, void 0, void 0, function () {
183
+ var apiPath, resp, resultBatchID_4, err_5;
184
+ var _this = this;
185
+ return __generator(this, function (_a) {
186
+ switch (_a.label) {
187
+ case 0:
188
+ _a.trys.push([0, 3, , 4]);
189
+ apiPath = "batch/" + batchID + "/decline";
190
+ return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, null)];
191
+ case 1:
192
+ resp = _a.sent();
193
+ resultBatchID_4 = resp.data;
194
+ // If user wants batchID immediately, return it for custom polling
195
+ if (returnBatchId) {
196
+ return [2 /*return*/, resultBatchID_4];
197
+ }
198
+ // Default behavior: wait for completion and return batch ID
199
+ return [4 /*yield*/, this.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
200
+ switch (_a.label) {
201
+ case 0: return [4 /*yield*/, this.getBatch(resultBatchID_4, guid)];
202
+ case 1: return [2 /*return*/, _a.sent()];
203
+ }
204
+ }); }); })];
205
+ case 2:
206
+ // Default behavior: wait for completion and return batch ID
207
+ _a.sent();
208
+ return [2 /*return*/, resultBatchID_4];
209
+ case 3:
210
+ err_5 = _a.sent();
211
+ throw new exception_1.Exception("Unable to decline the batch with id: " + batchID, err_5);
212
+ case 4: return [2 /*return*/];
213
+ }
214
+ });
215
+ });
216
+ };
217
+ BatchMethods.prototype.requestApprovalBatch = function (batchID, guid, returnBatchId) {
218
+ if (returnBatchId === void 0) { returnBatchId = false; }
219
+ return __awaiter(this, void 0, void 0, function () {
220
+ var apiPath, resp, resultBatchID_5, err_6;
221
+ var _this = this;
222
+ return __generator(this, function (_a) {
223
+ switch (_a.label) {
224
+ case 0:
225
+ _a.trys.push([0, 3, , 4]);
226
+ apiPath = "batch/" + batchID + "/request-approval";
227
+ return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, null)];
228
+ case 1:
229
+ resp = _a.sent();
230
+ resultBatchID_5 = resp.data;
231
+ // If user wants batchID immediately, return it for custom polling
232
+ if (returnBatchId) {
233
+ return [2 /*return*/, resultBatchID_5];
234
+ }
235
+ // Default behavior: wait for completion and return batch ID
236
+ return [4 /*yield*/, this.Retry(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
237
+ switch (_a.label) {
238
+ case 0: return [4 /*yield*/, this.getBatch(resultBatchID_5, guid)];
239
+ case 1: return [2 /*return*/, _a.sent()];
240
+ }
241
+ }); }); })];
242
+ case 2:
243
+ // Default behavior: wait for completion and return batch ID
244
+ _a.sent();
245
+ return [2 /*return*/, resultBatchID_5];
246
+ case 3:
247
+ err_6 = _a.sent();
248
+ throw new exception_1.Exception("Unable to request approval for the batch with id: " + batchID, err_6);
249
+ case 4: return [2 /*return*/];
250
+ }
251
+ });
252
+ });
253
+ };
254
+ /**
255
+ * Retrieves all batch-related enum types for developer discovery.
256
+ * This method provides all available enum values with their names,
257
+ * enabling dynamic UI population and client-side validation.
258
+ *
259
+ * @param guid - Current website guid
260
+ * @returns Promise containing all batch enum types
261
+ *
262
+ * @example
263
+ * ```typescript
264
+ * // Get all batch types for UI population
265
+ * const types = await client.batchMethods.getBatchTypes(guid);
266
+ *
267
+ * // Create dropdown options for item types
268
+ * const itemTypeOptions = types.itemTypes.map(type => ({
269
+ * label: type.name,
270
+ * value: type.value
271
+ * }));
272
+ *
273
+ * // Validate operation type
274
+ * const isValidOperation = (value: number) =>
275
+ * types.workflowOperations.some(op => op.value === value);
276
+ * ```
277
+ */
278
+ BatchMethods.prototype.getBatchTypes = function (guid) {
279
+ return __awaiter(this, void 0, void 0, function () {
280
+ var apiPath, resp, err_7;
281
+ return __generator(this, function (_a) {
282
+ switch (_a.label) {
283
+ case 0:
284
+ _a.trys.push([0, 2, , 3]);
285
+ apiPath = "batch/types";
286
+ return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
287
+ case 1:
288
+ resp = _a.sent();
289
+ return [2 /*return*/, resp.data];
290
+ case 2:
291
+ err_7 = _a.sent();
292
+ throw new exception_1.Exception("Unable to retrieve batch types", err_7);
63
293
  case 3: return [2 /*return*/];
64
294
  }
65
295
  });
@@ -67,7 +297,7 @@ var BatchMethods = /** @class */ (function () {
67
297
  };
68
298
  BatchMethods.prototype.Retry = function (method) {
69
299
  return __awaiter(this, void 0, void 0, function () {
70
- var retryCount, duration, batch, err_2;
300
+ var retryCount, duration, batch, err_8;
71
301
  return __generator(this, function (_a) {
72
302
  switch (_a.label) {
73
303
  case 0:
@@ -97,7 +327,7 @@ var BatchMethods = /** @class */ (function () {
97
327
  _a.label = 6;
98
328
  case 6: return [3 /*break*/, 8];
99
329
  case 7:
100
- err_2 = _a.sent();
330
+ err_8 = _a.sent();
101
331
  throw new Error('Timeout exceeded but operation still in progress. Please check the Batches page in the Agility Content Manager app.');
102
332
  case 8: return [3 /*break*/, 1];
103
333
  case 9: return [2 /*return*/];
@@ -15,6 +15,6 @@ export declare class ClientInstance {
15
15
  getAxiosInstance(guid: string): AxiosInstance;
16
16
  executeServerGet(apiPath: string, guid: string, token: string): Promise<import("axios").AxiosResponse<any, any>>;
17
17
  executeGet(apiPath: string, guid: string, token: string): Promise<import("axios").AxiosResponse<any, any>>;
18
- executeDelete(apiPath: string, guid: string, token: string): Promise<import("axios").AxiosResponse<any, any>>;
18
+ executeDelete(apiPath: string, guid: string, token: string, data?: any): Promise<import("axios").AxiosResponse<any, any>>;
19
19
  executePost(apiPath: string, guid: string, token: string, data: any): Promise<import("axios").AxiosResponse<any, any>>;
20
20
  }