@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]) {
@@ -64,16 +64,16 @@ var InstanceUserMethods = /** @class */ (function () {
64
64
  });
65
65
  });
66
66
  };
67
- InstanceUserMethods.prototype.saveUser = function (emailAddress_1, roles_1, guid_1) {
68
- return __awaiter(this, arguments, void 0, function (emailAddress, roles, guid, firstName, lastName) {
67
+ InstanceUserMethods.prototype.saveUser = function (emailAddress, roles, guid, firstName, lastName) {
68
+ if (firstName === void 0) { firstName = null; }
69
+ if (lastName === void 0) { lastName = null; }
70
+ return __awaiter(this, void 0, void 0, function () {
69
71
  var apiPath, resp, err_2;
70
- if (firstName === void 0) { firstName = null; }
71
- if (lastName === void 0) { lastName = null; }
72
72
  return __generator(this, function (_a) {
73
73
  switch (_a.label) {
74
74
  case 0:
75
75
  _a.trys.push([0, 2, , 3]);
76
- apiPath = "user/save?emailAddress=".concat(emailAddress, "&firstName=").concat(firstName, "&lastName=").concat(lastName);
76
+ apiPath = "user/save?emailAddress=" + emailAddress + "&firstName=" + firstName + "&lastName=" + lastName;
77
77
  return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, roles)];
78
78
  case 1:
79
79
  resp = _a.sent();
@@ -93,14 +93,14 @@ var InstanceUserMethods = /** @class */ (function () {
93
93
  switch (_a.label) {
94
94
  case 0:
95
95
  _a.trys.push([0, 2, , 3]);
96
- apiPath = "user/delete/".concat(userId);
96
+ apiPath = "user/delete/" + userId;
97
97
  return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)];
98
98
  case 1:
99
99
  resp = _a.sent();
100
100
  return [2 /*return*/, resp.data];
101
101
  case 2:
102
102
  err_3 = _a.sent();
103
- throw new exception_1.Exception("Unable to delete the user for id: ".concat(userId), err_3);
103
+ throw new exception_1.Exception("Unable to delete the user for id: " + userId, err_3);
104
104
  case 3: return [2 /*return*/];
105
105
  }
106
106
  });
@@ -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 ModelMethods = /** @class */ (function () {
51
51
  switch (_a.label) {
52
52
  case 0:
53
53
  _a.trys.push([0, 2, , 3]);
54
- apiPath = "model/".concat(id);
54
+ apiPath = "model/" + 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 retrieve model for id: ".concat(id, "."), err_1);
61
+ throw new exception_1.Exception("Unable to retrieve model for id: " + id + ".", err_1);
62
62
  case 3: return [2 /*return*/];
63
63
  }
64
64
  });
@@ -71,28 +71,28 @@ var ModelMethods = /** @class */ (function () {
71
71
  switch (_a.label) {
72
72
  case 0:
73
73
  _a.trys.push([0, 2, , 3]);
74
- apiPath = "model/".concat(referenceName);
74
+ apiPath = "model/" + referenceName;
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 retrieve model for referenceName: ".concat(referenceName, "."), err_2);
81
+ throw new exception_1.Exception("Unable to retrieve model for referenceName: " + referenceName + ".", err_2);
82
82
  case 3: return [2 /*return*/];
83
83
  }
84
84
  });
85
85
  });
86
86
  };
87
- ModelMethods.prototype.getContentModules = function (includeDefaults_1, guid_1) {
88
- return __awaiter(this, arguments, void 0, function (includeDefaults, guid, includeModules) {
87
+ ModelMethods.prototype.getContentModules = function (includeDefaults, guid, includeModules) {
88
+ if (includeModules === void 0) { includeModules = false; }
89
+ return __awaiter(this, void 0, void 0, function () {
89
90
  var apiPath, resp, err_3;
90
- if (includeModules === void 0) { includeModules = false; }
91
91
  return __generator(this, function (_a) {
92
92
  switch (_a.label) {
93
93
  case 0:
94
94
  _a.trys.push([0, 2, , 3]);
95
- apiPath = "model/list/".concat(includeDefaults, "?includeModules=").concat(includeModules);
95
+ apiPath = "model/list/" + includeDefaults + "?includeModules=" + includeModules;
96
96
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
97
97
  case 1:
98
98
  resp = _a.sent();
@@ -112,7 +112,7 @@ var ModelMethods = /** @class */ (function () {
112
112
  switch (_a.label) {
113
113
  case 0:
114
114
  _a.trys.push([0, 2, , 3]);
115
- apiPath = "model/list-page-modules/".concat(includeDefault);
115
+ apiPath = "model/list-page-modules/" + includeDefault;
116
116
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
117
117
  case 1:
118
118
  resp = _a.sent();
@@ -152,7 +152,7 @@ var ModelMethods = /** @class */ (function () {
152
152
  switch (_a.label) {
153
153
  case 0:
154
154
  _a.trys.push([0, 2, , 3]);
155
- apiPath = "model/".concat(id);
155
+ apiPath = "model/" + id;
156
156
  return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)];
157
157
  case 1:
158
158
  resp = _a.sent();
@@ -26,7 +26,19 @@ export declare class PageMethods {
26
26
  approvePage(pageID: number, guid: string, locale: string, comments?: string, returnBatchId?: boolean): Promise<number[]>;
27
27
  declinePage(pageID: number, guid: string, locale: string, comments?: string, returnBatchId?: boolean): Promise<number[]>;
28
28
  deletePage(pageID: number, guid: string, locale: string, comments?: string, returnBatchId?: boolean): Promise<number[]>;
29
- savePage(pageItem: PageItem, guid: string, locale: string, parentPageID?: number, placeBeforePageItemID?: number, returnBatchId?: boolean): Promise<number[]>;
29
+ /**
30
+ * Save a new page or update an existing page.
31
+ * @param pageItem The PageItem to save
32
+ * @param guid The GUID of the user making the request
33
+ * @param locale The locale of the page
34
+ * @param parentPageID The ID of the parent page
35
+ * @param placeBeforePageItemID The ID of the page item to place this page before
36
+ * @param returnBatchId Whether to return the batch ID immediately
37
+ * @param pageIDInOtherLocale The ID of the page in the other locale if you need to link it up.
38
+ * @param otherLocale The other locale to link the page to.
39
+ * @returns The IDs of the created or updated pages
40
+ */
41
+ savePage(pageItem: PageItem, guid: string, locale: string, parentPageID?: number, placeBeforePageItemID?: number, returnBatchId?: boolean, pageIDInOtherLocale?: number, otherLocale?: string): Promise<number[]>;
30
42
  getPageHistory(locale: string, guid: string, pageID: number, take?: number, skip?: number): Promise<PageHistory>;
31
43
  getPageComments(locale: string, guid: string, pageID: number, take?: number, skip?: number): Promise<ItemComments>;
32
44
  }
@@ -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]) {
@@ -53,7 +53,7 @@ var PageMethods = /** @class */ (function () {
53
53
  switch (_a.label) {
54
54
  case 0:
55
55
  _a.trys.push([0, 2, , 3]);
56
- apiPath = "".concat(locale, "/sitemap");
56
+ apiPath = locale + "/sitemap";
57
57
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
58
58
  case 1:
59
59
  resp = _a.sent();
@@ -66,17 +66,17 @@ var PageMethods = /** @class */ (function () {
66
66
  });
67
67
  });
68
68
  };
69
- PageMethods.prototype.getPageTemplates = function (guid_1, locale_1, includeModuleZones_1) {
70
- return __awaiter(this, arguments, void 0, function (guid, locale, includeModuleZones, searchFilter) {
69
+ PageMethods.prototype.getPageTemplates = function (guid, locale, includeModuleZones, searchFilter) {
70
+ if (searchFilter === void 0) { searchFilter = null; }
71
+ return __awaiter(this, void 0, void 0, function () {
71
72
  var apiPath, resp, err_2;
72
- if (searchFilter === void 0) { searchFilter = null; }
73
73
  return __generator(this, function (_a) {
74
74
  switch (_a.label) {
75
75
  case 0:
76
76
  _a.trys.push([0, 2, , 3]);
77
77
  if (!searchFilter)
78
78
  searchFilter = '';
79
- apiPath = "".concat(locale, "/page/templates?includeModuleZones=").concat(includeModuleZones, "&searchFilter=").concat(searchFilter);
79
+ apiPath = locale + "/page/templates?includeModuleZones=" + includeModuleZones + "&searchFilter=" + searchFilter;
80
80
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
81
81
  case 1:
82
82
  resp = _a.sent();
@@ -96,7 +96,7 @@ var PageMethods = /** @class */ (function () {
96
96
  switch (_a.label) {
97
97
  case 0:
98
98
  _a.trys.push([0, 2, , 3]);
99
- apiPath = "".concat(locale, "/page/template/").concat(pageTemplateId);
99
+ apiPath = locale + "/page/template/" + pageTemplateId;
100
100
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
101
101
  case 1:
102
102
  resp = _a.sent();
@@ -116,7 +116,7 @@ var PageMethods = /** @class */ (function () {
116
116
  switch (_a.label) {
117
117
  case 0:
118
118
  _a.trys.push([0, 2, , 3]);
119
- apiPath = "".concat(locale, "/page/template/").concat(templateName);
119
+ apiPath = locale + "/page/template/" + templateName;
120
120
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
121
121
  case 1:
122
122
  resp = _a.sent();
@@ -136,7 +136,7 @@ var PageMethods = /** @class */ (function () {
136
136
  switch (_a.label) {
137
137
  case 0:
138
138
  _a.trys.push([0, 2, , 3]);
139
- apiPath = "".concat(locale, "/page/template/").concat(pageTemplateId);
139
+ apiPath = locale + "/page/template/" + pageTemplateId;
140
140
  return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)];
141
141
  case 1:
142
142
  resp = _a.sent();
@@ -156,7 +156,7 @@ var PageMethods = /** @class */ (function () {
156
156
  switch (_a.label) {
157
157
  case 0:
158
158
  _a.trys.push([0, 2, , 3]);
159
- apiPath = "".concat(locale, "/page/template/items/").concat(id);
159
+ apiPath = locale + "/page/template/items/" + id;
160
160
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
161
161
  case 1:
162
162
  resp = _a.sent();
@@ -176,7 +176,7 @@ var PageMethods = /** @class */ (function () {
176
176
  switch (_a.label) {
177
177
  case 0:
178
178
  _a.trys.push([0, 2, , 3]);
179
- apiPath = "".concat(locale, "/page/template");
179
+ apiPath = locale + "/page/template";
180
180
  return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, pageModel)];
181
181
  case 1:
182
182
  resp = _a.sent();
@@ -196,30 +196,30 @@ var PageMethods = /** @class */ (function () {
196
196
  switch (_a.label) {
197
197
  case 0:
198
198
  _a.trys.push([0, 2, , 3]);
199
- apiPath = "".concat(locale, "/page/").concat(pageID);
199
+ apiPath = locale + "/page/" + pageID;
200
200
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
201
201
  case 1:
202
202
  resp = _a.sent();
203
203
  return [2 /*return*/, resp.data];
204
204
  case 2:
205
205
  err_8 = _a.sent();
206
- throw new exception_1.Exception("Unable to retrieve page for id ".concat(pageID, "."), err_8);
206
+ throw new exception_1.Exception("Unable to retrieve page for id " + pageID + ".", err_8);
207
207
  case 3: return [2 /*return*/];
208
208
  }
209
209
  });
210
210
  });
211
211
  };
212
- PageMethods.prototype.publishPage = function (pageID_1, guid_1, locale_1) {
213
- return __awaiter(this, arguments, void 0, function (pageID, guid, locale, comments, returnBatchId) {
212
+ PageMethods.prototype.publishPage = function (pageID, guid, locale, comments, returnBatchId) {
213
+ if (comments === void 0) { comments = null; }
214
+ if (returnBatchId === void 0) { returnBatchId = false; }
215
+ return __awaiter(this, void 0, void 0, function () {
214
216
  var apiPath, resp, batchID_1, batch, pageIDs_1, err_9;
215
217
  var _this = this;
216
- if (comments === void 0) { comments = null; }
217
- if (returnBatchId === void 0) { returnBatchId = false; }
218
218
  return __generator(this, function (_a) {
219
219
  switch (_a.label) {
220
220
  case 0:
221
221
  _a.trys.push([0, 3, , 4]);
222
- apiPath = "".concat(locale, "/page/").concat(pageID, "/publish?comments=").concat(comments);
222
+ apiPath = locale + "/page/" + pageID + "/publish?comments=" + comments;
223
223
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
224
224
  case 1:
225
225
  resp = _a.sent();
@@ -241,23 +241,23 @@ var PageMethods = /** @class */ (function () {
241
241
  return [2 /*return*/, pageIDs_1];
242
242
  case 3:
243
243
  err_9 = _a.sent();
244
- throw new exception_1.Exception("Unable to publish the page for id: ".concat(pageID), err_9);
244
+ throw new exception_1.Exception("Unable to publish the page for id: " + pageID, err_9);
245
245
  case 4: return [2 /*return*/];
246
246
  }
247
247
  });
248
248
  });
249
249
  };
250
- PageMethods.prototype.unPublishPage = function (pageID_1, guid_1, locale_1) {
251
- return __awaiter(this, arguments, void 0, function (pageID, guid, locale, comments, returnBatchId) {
250
+ PageMethods.prototype.unPublishPage = function (pageID, guid, locale, comments, returnBatchId) {
251
+ if (comments === void 0) { comments = null; }
252
+ if (returnBatchId === void 0) { returnBatchId = false; }
253
+ return __awaiter(this, void 0, void 0, function () {
252
254
  var apiPath, resp, batchID_2, batch, pageIDs_2, err_10;
253
255
  var _this = this;
254
- if (comments === void 0) { comments = null; }
255
- if (returnBatchId === void 0) { returnBatchId = false; }
256
256
  return __generator(this, function (_a) {
257
257
  switch (_a.label) {
258
258
  case 0:
259
259
  _a.trys.push([0, 3, , 4]);
260
- apiPath = "".concat(locale, "/page/").concat(pageID, "/unpublish?comments=").concat(comments);
260
+ apiPath = locale + "/page/" + pageID + "/unpublish?comments=" + comments;
261
261
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
262
262
  case 1:
263
263
  resp = _a.sent();
@@ -279,23 +279,23 @@ var PageMethods = /** @class */ (function () {
279
279
  return [2 /*return*/, pageIDs_2];
280
280
  case 3:
281
281
  err_10 = _a.sent();
282
- throw new exception_1.Exception("Unable to un-publish the page for id: ".concat(pageID), err_10);
282
+ throw new exception_1.Exception("Unable to un-publish the page for id: " + pageID, err_10);
283
283
  case 4: return [2 /*return*/];
284
284
  }
285
285
  });
286
286
  });
287
287
  };
288
- PageMethods.prototype.pageRequestApproval = function (pageID_1, guid_1, locale_1) {
289
- return __awaiter(this, arguments, void 0, function (pageID, guid, locale, comments, returnBatchId) {
288
+ PageMethods.prototype.pageRequestApproval = function (pageID, guid, locale, comments, returnBatchId) {
289
+ if (comments === void 0) { comments = null; }
290
+ if (returnBatchId === void 0) { returnBatchId = false; }
291
+ return __awaiter(this, void 0, void 0, function () {
290
292
  var apiPath, resp, batchID_3, batch, pageIDs_3, err_11;
291
293
  var _this = this;
292
- if (comments === void 0) { comments = null; }
293
- if (returnBatchId === void 0) { returnBatchId = false; }
294
294
  return __generator(this, function (_a) {
295
295
  switch (_a.label) {
296
296
  case 0:
297
297
  _a.trys.push([0, 3, , 4]);
298
- apiPath = "".concat(locale, "/page/").concat(pageID, "/request-approval?comments=").concat(comments);
298
+ apiPath = locale + "/page/" + pageID + "/request-approval?comments=" + comments;
299
299
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
300
300
  case 1:
301
301
  resp = _a.sent();
@@ -317,23 +317,23 @@ var PageMethods = /** @class */ (function () {
317
317
  return [2 /*return*/, pageIDs_3];
318
318
  case 3:
319
319
  err_11 = _a.sent();
320
- throw new exception_1.Exception("Unable to request approval the page for id: ".concat(pageID), err_11);
320
+ throw new exception_1.Exception("Unable to request approval the page for id: " + pageID, err_11);
321
321
  case 4: return [2 /*return*/];
322
322
  }
323
323
  });
324
324
  });
325
325
  };
326
- PageMethods.prototype.approvePage = function (pageID_1, guid_1, locale_1) {
327
- return __awaiter(this, arguments, void 0, function (pageID, guid, locale, comments, returnBatchId) {
326
+ PageMethods.prototype.approvePage = function (pageID, guid, locale, comments, returnBatchId) {
327
+ if (comments === void 0) { comments = null; }
328
+ if (returnBatchId === void 0) { returnBatchId = false; }
329
+ return __awaiter(this, void 0, void 0, function () {
328
330
  var apiPath, resp, batchID_4, batch, pageIDs_4, err_12;
329
331
  var _this = this;
330
- if (comments === void 0) { comments = null; }
331
- if (returnBatchId === void 0) { returnBatchId = false; }
332
332
  return __generator(this, function (_a) {
333
333
  switch (_a.label) {
334
334
  case 0:
335
335
  _a.trys.push([0, 3, , 4]);
336
- apiPath = "".concat(locale, "/page/").concat(pageID, "/approve?comments=").concat(comments);
336
+ apiPath = locale + "/page/" + pageID + "/approve?comments=" + comments;
337
337
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
338
338
  case 1:
339
339
  resp = _a.sent();
@@ -355,23 +355,23 @@ var PageMethods = /** @class */ (function () {
355
355
  return [2 /*return*/, pageIDs_4];
356
356
  case 3:
357
357
  err_12 = _a.sent();
358
- throw new exception_1.Exception("Unable to approve the page for id: ".concat(pageID), err_12);
358
+ throw new exception_1.Exception("Unable to approve the page for id: " + pageID, err_12);
359
359
  case 4: return [2 /*return*/];
360
360
  }
361
361
  });
362
362
  });
363
363
  };
364
- PageMethods.prototype.declinePage = function (pageID_1, guid_1, locale_1) {
365
- return __awaiter(this, arguments, void 0, function (pageID, guid, locale, comments, returnBatchId) {
364
+ PageMethods.prototype.declinePage = function (pageID, guid, locale, comments, returnBatchId) {
365
+ if (comments === void 0) { comments = null; }
366
+ if (returnBatchId === void 0) { returnBatchId = false; }
367
+ return __awaiter(this, void 0, void 0, function () {
366
368
  var apiPath, resp, batchID_5, batch, pageIDs_5, err_13;
367
369
  var _this = this;
368
- if (comments === void 0) { comments = null; }
369
- if (returnBatchId === void 0) { returnBatchId = false; }
370
370
  return __generator(this, function (_a) {
371
371
  switch (_a.label) {
372
372
  case 0:
373
373
  _a.trys.push([0, 3, , 4]);
374
- apiPath = "".concat(locale, "/page/").concat(pageID, "/decline?comments=").concat(comments);
374
+ apiPath = locale + "/page/" + pageID + "/decline?comments=" + comments;
375
375
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
376
376
  case 1:
377
377
  resp = _a.sent();
@@ -393,23 +393,23 @@ var PageMethods = /** @class */ (function () {
393
393
  return [2 /*return*/, pageIDs_5];
394
394
  case 3:
395
395
  err_13 = _a.sent();
396
- throw new exception_1.Exception("Unable to decline the page for id: ".concat(pageID), err_13);
396
+ throw new exception_1.Exception("Unable to decline the page for id: " + pageID, err_13);
397
397
  case 4: return [2 /*return*/];
398
398
  }
399
399
  });
400
400
  });
401
401
  };
402
- PageMethods.prototype.deletePage = function (pageID_1, guid_1, locale_1) {
403
- return __awaiter(this, arguments, void 0, function (pageID, guid, locale, comments, returnBatchId) {
402
+ PageMethods.prototype.deletePage = function (pageID, guid, locale, comments, returnBatchId) {
403
+ if (comments === void 0) { comments = null; }
404
+ if (returnBatchId === void 0) { returnBatchId = false; }
405
+ return __awaiter(this, void 0, void 0, function () {
404
406
  var apiPath, resp, batchID_6, batch, pageIDs_6, err_14;
405
407
  var _this = this;
406
- if (comments === void 0) { comments = null; }
407
- if (returnBatchId === void 0) { returnBatchId = false; }
408
408
  return __generator(this, function (_a) {
409
409
  switch (_a.label) {
410
410
  case 0:
411
411
  _a.trys.push([0, 3, , 4]);
412
- apiPath = "".concat(locale, "/page/").concat(pageID, "?comments=").concat(comments);
412
+ apiPath = locale + "/page/" + pageID + "?comments=" + comments;
413
413
  return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, guid, this._options.token)];
414
414
  case 1:
415
415
  resp = _a.sent();
@@ -431,24 +431,42 @@ var PageMethods = /** @class */ (function () {
431
431
  return [2 /*return*/, pageIDs_6];
432
432
  case 3:
433
433
  err_14 = _a.sent();
434
- throw new exception_1.Exception("Unable to delete the page for id: ".concat(pageID), err_14);
434
+ throw new exception_1.Exception("Unable to delete the page for id: " + pageID, err_14);
435
435
  case 4: return [2 /*return*/];
436
436
  }
437
437
  });
438
438
  });
439
439
  };
440
- PageMethods.prototype.savePage = function (pageItem_1, guid_1, locale_1) {
441
- return __awaiter(this, arguments, void 0, function (pageItem, guid, locale, parentPageID, placeBeforePageItemID, returnBatchId) {
440
+ /**
441
+ * Save a new page or update an existing page.
442
+ * @param pageItem The PageItem to save
443
+ * @param guid The GUID of the user making the request
444
+ * @param locale The locale of the page
445
+ * @param parentPageID The ID of the parent page
446
+ * @param placeBeforePageItemID The ID of the page item to place this page before
447
+ * @param returnBatchId Whether to return the batch ID immediately
448
+ * @param pageIDInOtherLocale The ID of the page in the other locale if you need to link it up.
449
+ * @param otherLocale The other locale to link the page to.
450
+ * @returns The IDs of the created or updated pages
451
+ */
452
+ PageMethods.prototype.savePage = function (pageItem, guid, locale, parentPageID, placeBeforePageItemID, returnBatchId, pageIDInOtherLocale, otherLocale) {
453
+ if (parentPageID === void 0) { parentPageID = -1; }
454
+ if (placeBeforePageItemID === void 0) { placeBeforePageItemID = -1; }
455
+ if (returnBatchId === void 0) { returnBatchId = false; }
456
+ if (pageIDInOtherLocale === void 0) { pageIDInOtherLocale = -1; }
457
+ if (otherLocale === void 0) { otherLocale = null; }
458
+ return __awaiter(this, void 0, void 0, function () {
442
459
  var apiPath, resp, batchID_7, batch, pageIDs_7, err_15;
443
460
  var _this = this;
444
- if (parentPageID === void 0) { parentPageID = -1; }
445
- if (placeBeforePageItemID === void 0) { placeBeforePageItemID = -1; }
446
- if (returnBatchId === void 0) { returnBatchId = false; }
447
461
  return __generator(this, function (_a) {
448
462
  switch (_a.label) {
449
463
  case 0:
450
464
  _a.trys.push([0, 3, , 4]);
451
- apiPath = "".concat(locale, "/page?parentPageID=").concat(parentPageID, "&placeBeforePageItemID=").concat(placeBeforePageItemID);
465
+ apiPath = locale + "/page?parentPageID=" + parentPageID + "&placeBeforePageItemID=" + placeBeforePageItemID;
466
+ if (pageIDInOtherLocale > -1 && otherLocale) {
467
+ // If we have the other locale and the pageID in that locale, we need to link it up.
468
+ apiPath += "&pageIDInOtherLocale=" + pageIDInOtherLocale + "&otherLocale=" + otherLocale;
469
+ }
452
470
  return [4 /*yield*/, this._clientInstance.executePost(apiPath, guid, this._options.token, pageItem)];
453
471
  case 1:
454
472
  resp = _a.sent();
@@ -470,51 +488,51 @@ var PageMethods = /** @class */ (function () {
470
488
  return [2 /*return*/, pageIDs_7];
471
489
  case 3:
472
490
  err_15 = _a.sent();
473
- throw new exception_1.Exception("Unable to create page. ".concat(err_15), err_15);
491
+ throw new exception_1.Exception("Unable to create page. " + err_15, err_15);
474
492
  case 4: return [2 /*return*/];
475
493
  }
476
494
  });
477
495
  });
478
496
  };
479
- PageMethods.prototype.getPageHistory = function (locale_1, guid_1, pageID_1) {
480
- return __awaiter(this, arguments, void 0, function (locale, guid, pageID, take, skip) {
497
+ PageMethods.prototype.getPageHistory = function (locale, guid, pageID, take, skip) {
498
+ if (take === void 0) { take = 50; }
499
+ if (skip === void 0) { skip = 0; }
500
+ return __awaiter(this, void 0, void 0, function () {
481
501
  var apiPath, resp, err_16;
482
- if (take === void 0) { take = 50; }
483
- if (skip === void 0) { skip = 0; }
484
502
  return __generator(this, function (_a) {
485
503
  switch (_a.label) {
486
504
  case 0:
487
505
  _a.trys.push([0, 2, , 3]);
488
- apiPath = "".concat(locale, "/item/").concat(pageID, "/history?take=").concat(take, "&skip=").concat(skip);
506
+ apiPath = locale + "/item/" + pageID + "/history?take=" + take + "&skip=" + skip;
489
507
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
490
508
  case 1:
491
509
  resp = _a.sent();
492
510
  return [2 /*return*/, resp.data];
493
511
  case 2:
494
512
  err_16 = _a.sent();
495
- throw new exception_1.Exception("Unable to retrieve history for pageID: ".concat(pageID));
513
+ throw new exception_1.Exception("Unable to retrieve history for pageID: " + pageID);
496
514
  case 3: return [2 /*return*/];
497
515
  }
498
516
  });
499
517
  });
500
518
  };
501
- PageMethods.prototype.getPageComments = function (locale_1, guid_1, pageID_1) {
502
- return __awaiter(this, arguments, void 0, function (locale, guid, pageID, take, skip) {
519
+ PageMethods.prototype.getPageComments = function (locale, guid, pageID, take, skip) {
520
+ if (take === void 0) { take = 50; }
521
+ if (skip === void 0) { skip = 0; }
522
+ return __awaiter(this, void 0, void 0, function () {
503
523
  var apiPath, resp, err_17;
504
- if (take === void 0) { take = 50; }
505
- if (skip === void 0) { skip = 0; }
506
524
  return __generator(this, function (_a) {
507
525
  switch (_a.label) {
508
526
  case 0:
509
527
  _a.trys.push([0, 2, , 3]);
510
- apiPath = "".concat(locale, "/item/").concat(pageID, "/history?take=").concat(take, "&skip=").concat(skip);
528
+ apiPath = locale + "/item/" + pageID + "/history?take=" + take + "&skip=" + skip;
511
529
  return [4 /*yield*/, this._clientInstance.executeGet(apiPath, guid, this._options.token)];
512
530
  case 1:
513
531
  resp = _a.sent();
514
532
  return [2 /*return*/, resp.data];
515
533
  case 2:
516
534
  err_17 = _a.sent();
517
- throw new exception_1.Exception("Unable to retrieve history for pageID: ".concat(pageID));
535
+ throw new exception_1.Exception("Unable to retrieve history for pageID: " + pageID);
518
536
  case 3: return [2 /*return*/];
519
537
  }
520
538
  });
@@ -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]) {
@@ -71,7 +71,7 @@ var ServerUserMethods = /** @class */ (function () {
71
71
  switch (_a.label) {
72
72
  case 0:
73
73
  _a.trys.push([0, 2, , 3]);
74
- apiPath = "users/you?srvUserID=".concat(serverUserID);
74
+ apiPath = "users/you?srvUserID=" + serverUserID;
75
75
  return [4 /*yield*/, this._clientInstance.executeServerGet(apiPath, guid, this._options.token)];
76
76
  case 1:
77
77
  resp = _a.sent();