@agility/management-sdk 0.1.23 → 0.1.25

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 (38) hide show
  1. package/dist/apiMethods/assetMethods.js +38 -38
  2. package/dist/apiMethods/batchMethods.js +5 -5
  3. package/dist/apiMethods/clientInstance.js +9 -9
  4. package/dist/apiMethods/containerMethods.js +24 -21
  5. package/dist/apiMethods/contentMethods.js +56 -56
  6. package/dist/apiMethods/instanceMethods.js +3 -3
  7. package/dist/apiMethods/instanceUserMethods.js +12 -12
  8. package/dist/apiMethods/modelMethods.js +15 -15
  9. package/dist/apiMethods/pageMethods.js +68 -68
  10. package/dist/apiMethods/serverUserMethods.js +4 -4
  11. package/dist/apiMethods/webhookMethods.js +11 -11
  12. package/dist/enums/assetGroupingType.js +1 -1
  13. package/dist/enums/batchOperationType.js +1 -1
  14. package/dist/enums/batchState..js +1 -1
  15. package/dist/enums/pageItemTemplateType.js +1 -1
  16. package/dist/index.js +1 -5
  17. package/dist/models/exception.js +0 -2
  18. package/dist/models/locales.js +0 -2
  19. package/package.json +2 -2
  20. package/.cursor/manifest.md +0 -65
  21. package/.cursor/rules/agility_cms_sdk_rules.mdc +0 -155
  22. package/.cursor/rules/asset_management.mdc +0 -97
  23. package/.cursor/rules/common_patterns.mdc +0 -5
  24. package/.cursor/rules/configuration.mdc +0 -5
  25. package/.cursor/rules/content_management.mdc +0 -5
  26. package/.cursor/rules/page_management.mdc +0 -5
  27. package/.cursor/rules/security.mdc +0 -5
  28. package/.cursor/rules/setup_and_auth.mdc +0 -5
  29. package/.cursor/rules/testing_and_debugging.mdc +0 -5
  30. package/.cursor/rules/webhook_management.mdc +0 -61
  31. package/.env +0 -11
  32. package/dist/models/tokenResponseData.d.ts +0 -11
  33. package/dist/models/tokenResponseData.js +0 -13
  34. package/dist/tests/instance.test.d.ts +0 -1
  35. package/dist/tests/instance.test.js +0 -99
  36. package/dist/tests/sdk.test.d.ts +0 -1
  37. package/dist/tests/sdk.test.js +0 -78
  38. package/environment.example +0 -12
@@ -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();
@@ -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]) {
@@ -52,14 +52,14 @@ var BatchMethods = /** @class */ (function () {
52
52
  switch (_a.label) {
53
53
  case 0:
54
54
  _a.trys.push([0, 2, , 3]);
55
- apiPath = "batch/".concat(batchID);
55
+ apiPath = "batch/" + batchID;
56
56
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
57
57
  case 1:
58
58
  resp = _a.sent();
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 retreive the batch for id: ".concat(batchID), err_1);
62
+ throw new exception_1.Exception("Unable to retrieve the batch for id: " + batchID, err_1);
63
63
  case 3: return [2 /*return*/];
64
64
  }
65
65
  });
@@ -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]) {
@@ -78,7 +78,7 @@ var ClientInstance = /** @class */ (function () {
78
78
  ClientInstance.prototype.getInstance = function (guid) {
79
79
  var baseUrl = this.determineBaseUrl(guid);
80
80
  var instance = axios_1.default.create({
81
- baseURL: "".concat(baseUrl, "/api/v1/instance/").concat(guid),
81
+ baseURL: baseUrl + "/api/v1/instance/" + guid,
82
82
  maxContentLength: Infinity,
83
83
  maxBodyLength: Infinity
84
84
  });
@@ -87,7 +87,7 @@ var ClientInstance = /** @class */ (function () {
87
87
  ClientInstance.prototype.getAxiosInstance = function (guid) {
88
88
  var baseUrl = this.determineBaseUrl(guid);
89
89
  var instance = axios_1.default.create({
90
- baseURL: "".concat(baseUrl, "/api/v1"),
90
+ baseURL: baseUrl + "/api/v1",
91
91
  maxContentLength: Infinity,
92
92
  maxBodyLength: Infinity
93
93
  });
@@ -105,7 +105,7 @@ var ClientInstance = /** @class */ (function () {
105
105
  _a.trys.push([1, 3, , 4]);
106
106
  return [4 /*yield*/, instance.get(apiPath, {
107
107
  headers: {
108
- 'Authorization': "Bearer ".concat(token),
108
+ 'Authorization': "Bearer " + token,
109
109
  'Cache-Control': 'no-cache'
110
110
  }
111
111
  })];
@@ -132,7 +132,7 @@ var ClientInstance = /** @class */ (function () {
132
132
  _a.trys.push([1, 3, , 4]);
133
133
  return [4 /*yield*/, instance.get(apiPath, {
134
134
  headers: {
135
- 'Authorization': "Bearer ".concat(token),
135
+ 'Authorization': "Bearer " + token,
136
136
  'Cache-Control': 'no-cache'
137
137
  }
138
138
  })];
@@ -159,7 +159,7 @@ var ClientInstance = /** @class */ (function () {
159
159
  _a.trys.push([1, 3, , 4]);
160
160
  return [4 /*yield*/, instance.delete(apiPath, {
161
161
  headers: {
162
- 'Authorization': "Bearer ".concat(token),
162
+ 'Authorization': "Bearer " + token,
163
163
  'Cache-Control': 'no-cache'
164
164
  }
165
165
  })];
@@ -186,7 +186,7 @@ var ClientInstance = /** @class */ (function () {
186
186
  _a.trys.push([1, 3, , 4]);
187
187
  return [4 /*yield*/, instance.post(apiPath, data, {
188
188
  headers: {
189
- 'Authorization': "Bearer ".concat(token),
189
+ 'Authorization': "Bearer " + token,
190
190
  'Cache-Control': 'no-cache'
191
191
  }
192
192
  })];
@@ -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,14 +51,14 @@ var ContainerMethods = /** @class */ (function () {
51
51
  switch (_a.label) {
52
52
  case 0:
53
53
  _a.trys.push([0, 2, , 3]);
54
- apiPath = "container/".concat(id);
54
+ apiPath = "container/" + id;
55
55
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
56
56
  case 1:
57
57
  resp = _a.sent();
58
58
  return [2 /*return*/, resp.data];
59
59
  case 2:
60
60
  err_1 = _a.sent();
61
- throw new exception_1.Exception("Unable to retreive the contianer for id: ".concat(id), err_1);
61
+ throw new exception_1.Exception("Unable to retrieve the container for id: " + id, err_1);
62
62
  case 3: return [2 /*return*/];
63
63
  }
64
64
  });
@@ -71,14 +71,14 @@ var ContainerMethods = /** @class */ (function () {
71
71
  switch (_a.label) {
72
72
  case 0:
73
73
  _a.trys.push([0, 2, , 3]);
74
- apiPath = "container/model/".concat(modelId);
74
+ apiPath = "container/model/" + modelId;
75
75
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
76
76
  case 1:
77
77
  resp = _a.sent();
78
78
  return [2 /*return*/, resp.data];
79
79
  case 2:
80
80
  err_2 = _a.sent();
81
- throw new exception_1.Exception("Unable to retreive the containers for id: ".concat(modelId), err_2);
81
+ throw new exception_1.Exception("Unable to retrieve the containers for id: " + modelId, err_2);
82
82
  case 3: return [2 /*return*/];
83
83
  }
84
84
  });
@@ -91,14 +91,17 @@ var ContainerMethods = /** @class */ (function () {
91
91
  switch (_a.label) {
92
92
  case 0:
93
93
  _a.trys.push([0, 2, , 3]);
94
- apiPath = "container/".concat(referenceName);
94
+ apiPath = "container/" + referenceName;
95
95
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
96
96
  case 1:
97
97
  resp = _a.sent();
98
+ if (resp.status === 404) {
99
+ return [2 /*return*/, null]; // If the container is not found, return null
100
+ }
98
101
  return [2 /*return*/, resp.data];
99
102
  case 2:
100
103
  err_3 = _a.sent();
101
- throw new exception_1.Exception("Unable to retreive the contianer for referenceName: ".concat(referenceName), err_3);
104
+ throw new exception_1.Exception("Unable to retrieve the container for referenceName: " + referenceName, err_3);
102
105
  case 3: return [2 /*return*/];
103
106
  }
104
107
  });
@@ -111,14 +114,14 @@ var ContainerMethods = /** @class */ (function () {
111
114
  switch (_a.label) {
112
115
  case 0:
113
116
  _a.trys.push([0, 2, , 3]);
114
- apiPath = "container/".concat(id, "/security");
117
+ apiPath = "container/" + id + "/security";
115
118
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
116
119
  case 1:
117
120
  resp = _a.sent();
118
121
  return [2 /*return*/, resp.data];
119
122
  case 2:
120
123
  err_4 = _a.sent();
121
- throw new exception_1.Exception("Unable to retreive the contianer for id: ".concat(id), err_4);
124
+ throw new exception_1.Exception("Unable to retrieve the container for id: " + id, err_4);
122
125
  case 3: return [2 /*return*/];
123
126
  }
124
127
  });
@@ -138,7 +141,7 @@ var ContainerMethods = /** @class */ (function () {
138
141
  return [2 /*return*/, resp.data];
139
142
  case 2:
140
143
  err_5 = _a.sent();
141
- throw new exception_1.Exception("Unable to retreive the contianer list", err_5);
144
+ throw new exception_1.Exception("Unable to retrieve the container list", err_5);
142
145
  case 3: return [2 /*return*/];
143
146
  }
144
147
  });
@@ -151,35 +154,35 @@ var ContainerMethods = /** @class */ (function () {
151
154
  switch (_a.label) {
152
155
  case 0:
153
156
  _a.trys.push([0, 2, , 3]);
154
- apiPath = "container/".concat(id, "/notifications");
157
+ apiPath = "container/" + id + "/notifications";
155
158
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
156
159
  case 1:
157
160
  resp = _a.sent();
158
161
  return [2 /*return*/, resp.data];
159
162
  case 2:
160
163
  err_6 = _a.sent();
161
- throw new exception_1.Exception("Unable to retreive the notifications for contianer id: ".concat(id), err_6);
164
+ throw new exception_1.Exception("Unable to retrieve the notifications for container id: " + id, err_6);
162
165
  case 3: return [2 /*return*/];
163
166
  }
164
167
  });
165
168
  });
166
169
  };
167
- ContainerMethods.prototype.saveContainer = function (container_1, guid_1) {
168
- return __awaiter(this, arguments, void 0, function (container, guid, forceReferenceName) {
170
+ ContainerMethods.prototype.saveContainer = function (container, guid, forceReferenceName) {
171
+ if (forceReferenceName === void 0) { forceReferenceName = false; }
172
+ return __awaiter(this, void 0, void 0, function () {
169
173
  var apiPath, resp, err_7;
170
- if (forceReferenceName === void 0) { forceReferenceName = false; }
171
174
  return __generator(this, function (_a) {
172
175
  switch (_a.label) {
173
176
  case 0:
174
177
  _a.trys.push([0, 2, , 3]);
175
- apiPath = "container".concat(forceReferenceName ? '?forceReferenceName=true' : '');
178
+ apiPath = "container" + (forceReferenceName ? '?forceReferenceName=true' : '');
176
179
  return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, container)];
177
180
  case 1:
178
181
  resp = _a.sent();
179
182
  return [2 /*return*/, resp.data];
180
183
  case 2:
181
184
  err_7 = _a.sent();
182
- throw new exception_1.Exception("Unable to save the contianer", err_7);
185
+ throw new exception_1.Exception("Unable to save the container", err_7);
183
186
  case 3: return [2 /*return*/];
184
187
  }
185
188
  });
@@ -192,14 +195,14 @@ var ContainerMethods = /** @class */ (function () {
192
195
  switch (_a.label) {
193
196
  case 0:
194
197
  _a.trys.push([0, 2, , 3]);
195
- apiPath = "container/".concat(id);
198
+ apiPath = "container/" + id;
196
199
  return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)];
197
200
  case 1:
198
201
  resp = _a.sent();
199
202
  return [2 /*return*/, resp.data];
200
203
  case 2:
201
204
  err_8 = _a.sent();
202
- throw new exception_1.Exception("Unable to delete the contianer for id: ".concat(id), err_8);
205
+ throw new exception_1.Exception("Unable to delete the container for id: " + id, err_8);
203
206
  case 3: return [2 /*return*/];
204
207
  }
205
208
  });