@agility/management-sdk 0.1.1 → 0.1.3

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 (56) hide show
  1. package/README.md +395 -395
  2. package/dist/apiMethods/assetMethods.d.ts +14 -14
  3. package/dist/apiMethods/assetMethods.js +172 -95
  4. package/dist/apiMethods/batchMethods.d.ts +11 -11
  5. package/dist/apiMethods/batchMethods.js +117 -65
  6. package/dist/apiMethods/clientInstance.d.ts +8 -8
  7. package/dist/apiMethods/clientInstance.js +137 -77
  8. package/dist/apiMethods/containerMethods.d.ts +16 -16
  9. package/dist/apiMethods/containerMethods.js +189 -105
  10. package/dist/apiMethods/contentMethods.d.ts +20 -20
  11. package/dist/apiMethods/contentMethods.js +359 -175
  12. package/dist/apiMethods/instanceUserMethods.d.ts +13 -13
  13. package/dist/apiMethods/instanceUserMethods.js +111 -57
  14. package/dist/apiMethods/modelMethods.d.ts +13 -13
  15. package/dist/apiMethods/modelMethods.js +150 -81
  16. package/dist/apiMethods/pageMethods.d.ts +20 -20
  17. package/dist/apiMethods/pageMethods.js +323 -159
  18. package/dist/enums/batchOperationType.d.ts +19 -19
  19. package/dist/enums/batchOperationType.js +23 -23
  20. package/dist/enums/batchState..d.ts +7 -7
  21. package/dist/enums/batchState..js +11 -11
  22. package/dist/index.d.ts +21 -21
  23. package/dist/index.js +33 -37
  24. package/dist/models/batch.d.ts +29 -29
  25. package/dist/models/batch.js +9 -6
  26. package/dist/models/batchItem.d.ts +13 -13
  27. package/dist/models/batchItem.js +9 -6
  28. package/dist/models/container.d.ts +47 -47
  29. package/dist/models/container.js +9 -6
  30. package/dist/models/contentItem.d.ts +37 -37
  31. package/dist/models/contentItem.js +33 -18
  32. package/dist/models/contentViewColumn.d.ts +8 -8
  33. package/dist/models/contentViewColumn.js +9 -6
  34. package/dist/models/exception.d.ts +4 -4
  35. package/dist/models/exception.js +26 -10
  36. package/dist/models/instanceRole.d.ts +7 -7
  37. package/dist/models/instanceRole.js +9 -6
  38. package/dist/models/instanceUser.d.ts +14 -14
  39. package/dist/models/instanceUser.js +9 -6
  40. package/dist/models/media.d.ts +30 -30
  41. package/dist/models/media.js +15 -9
  42. package/dist/models/model.d.ts +30 -30
  43. package/dist/models/model.js +15 -9
  44. package/dist/models/notification.d.ts +13 -13
  45. package/dist/models/notification.js +9 -6
  46. package/dist/models/options.d.ts +10 -10
  47. package/dist/models/options.js +28 -25
  48. package/dist/models/pageItem.d.ts +56 -56
  49. package/dist/models/pageItem.js +39 -21
  50. package/dist/models/sitemap.d.ts +20 -20
  51. package/dist/models/sitemap.js +15 -9
  52. package/dist/models/websiteUser.d.ts +22 -22
  53. package/dist/models/websiteUser.js +15 -9
  54. package/license.txt +20 -20
  55. package/package.json +39 -39
  56. package/tsconfig.json +14 -14
@@ -1,77 +1,137 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.ClientInstance = void 0;
16
- const axios_1 = __importDefault(require("axios"));
17
- class ClientInstance {
18
- getInstance(options) {
19
- let baseUrl = options.determineBaseUrl(options.guid);
20
- let instance = axios_1.default.create({
21
- baseURL: `${baseUrl}/api/v1/instance/${options.guid}`
22
- });
23
- return instance;
24
- }
25
- executeGet(apiPath, options) {
26
- return __awaiter(this, void 0, void 0, function* () {
27
- let instance = this.getInstance(options);
28
- try {
29
- const resp = yield instance.get(apiPath, {
30
- headers: {
31
- 'Authorization': `Bearer ${options.token}`,
32
- 'Cache-Control': 'no-cache'
33
- }
34
- });
35
- return resp;
36
- }
37
- catch (err) {
38
- throw err;
39
- }
40
- });
41
- }
42
- executeDelete(apiPath, options) {
43
- return __awaiter(this, void 0, void 0, function* () {
44
- let instance = this.getInstance(options);
45
- try {
46
- const resp = yield instance.delete(apiPath, {
47
- headers: {
48
- 'Authorization': `Bearer ${options.token}`,
49
- 'Cache-Control': 'no-cache'
50
- }
51
- });
52
- return resp;
53
- }
54
- catch (err) {
55
- throw err;
56
- }
57
- });
58
- }
59
- executePost(apiPath, options, data) {
60
- return __awaiter(this, void 0, void 0, function* () {
61
- let instance = this.getInstance(options);
62
- try {
63
- const resp = yield instance.post(apiPath, data, {
64
- headers: {
65
- 'Authorization': `Bearer ${options.token}`,
66
- 'Cache-Control': 'no-cache'
67
- }
68
- });
69
- return resp;
70
- }
71
- catch (err) {
72
- throw err;
73
- }
74
- });
75
- }
76
- }
77
- exports.ClientInstance = ClientInstance;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
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;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
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
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ exports.ClientInstance = void 0;
43
+ var axios_1 = __importDefault(require("axios"));
44
+ var ClientInstance = /** @class */ (function () {
45
+ function ClientInstance() {
46
+ }
47
+ ClientInstance.prototype.getInstance = function (options) {
48
+ var baseUrl = options.determineBaseUrl(options.guid);
49
+ var instance = axios_1.default.create({
50
+ baseURL: baseUrl + "/api/v1/instance/" + options.guid
51
+ });
52
+ return instance;
53
+ };
54
+ ClientInstance.prototype.executeGet = function (apiPath, options) {
55
+ return __awaiter(this, void 0, void 0, function () {
56
+ var instance, resp, err_1;
57
+ return __generator(this, function (_a) {
58
+ switch (_a.label) {
59
+ case 0:
60
+ instance = this.getInstance(options);
61
+ _a.label = 1;
62
+ case 1:
63
+ _a.trys.push([1, 3, , 4]);
64
+ return [4 /*yield*/, instance.get(apiPath, {
65
+ headers: {
66
+ 'Authorization': "Bearer " + options.token,
67
+ 'Cache-Control': 'no-cache'
68
+ }
69
+ })];
70
+ case 2:
71
+ resp = _a.sent();
72
+ return [2 /*return*/, resp];
73
+ case 3:
74
+ err_1 = _a.sent();
75
+ throw err_1;
76
+ case 4: return [2 /*return*/];
77
+ }
78
+ });
79
+ });
80
+ };
81
+ ClientInstance.prototype.executeDelete = function (apiPath, options) {
82
+ return __awaiter(this, void 0, void 0, function () {
83
+ var instance, resp, err_2;
84
+ return __generator(this, function (_a) {
85
+ switch (_a.label) {
86
+ case 0:
87
+ instance = this.getInstance(options);
88
+ _a.label = 1;
89
+ case 1:
90
+ _a.trys.push([1, 3, , 4]);
91
+ return [4 /*yield*/, instance.delete(apiPath, {
92
+ headers: {
93
+ 'Authorization': "Bearer " + options.token,
94
+ 'Cache-Control': 'no-cache'
95
+ }
96
+ })];
97
+ case 2:
98
+ resp = _a.sent();
99
+ return [2 /*return*/, resp];
100
+ case 3:
101
+ err_2 = _a.sent();
102
+ throw err_2;
103
+ case 4: return [2 /*return*/];
104
+ }
105
+ });
106
+ });
107
+ };
108
+ ClientInstance.prototype.executePost = function (apiPath, options, data) {
109
+ return __awaiter(this, void 0, void 0, function () {
110
+ var instance, resp, err_3;
111
+ return __generator(this, function (_a) {
112
+ switch (_a.label) {
113
+ case 0:
114
+ instance = this.getInstance(options);
115
+ _a.label = 1;
116
+ case 1:
117
+ _a.trys.push([1, 3, , 4]);
118
+ return [4 /*yield*/, instance.post(apiPath, data, {
119
+ headers: {
120
+ 'Authorization': "Bearer " + options.token,
121
+ 'Cache-Control': 'no-cache'
122
+ }
123
+ })];
124
+ case 2:
125
+ resp = _a.sent();
126
+ return [2 /*return*/, resp];
127
+ case 3:
128
+ err_3 = _a.sent();
129
+ throw err_3;
130
+ case 4: return [2 /*return*/];
131
+ }
132
+ });
133
+ });
134
+ };
135
+ return ClientInstance;
136
+ }());
137
+ exports.ClientInstance = ClientInstance;
@@ -1,16 +1,16 @@
1
- import { Options } from "../models/options";
2
- import { ClientInstance } from "./clientInstance";
3
- import { Container } from "../models/container";
4
- import { Notification } from "../models/notification";
5
- export declare class ContainerMethods {
6
- _options: Options;
7
- _clientInstance: ClientInstance;
8
- constructor(options: Options);
9
- getContainerByID(id: number): Promise<Container>;
10
- getContainerByReferenceName(referenceName: string): Promise<Container>;
11
- getContainerSecurity(id: number): Promise<Container>;
12
- getContainerList(): Promise<Container[]>;
13
- getNotificationList(id: number): Promise<Notification[]>;
14
- saveContainer(container: Container): Promise<Container>;
15
- deleteContainer(id: number): Promise<string>;
16
- }
1
+ import { Options } from "../models/options";
2
+ import { ClientInstance } from "./clientInstance";
3
+ import { Container } from "../models/container";
4
+ import { Notification } from "../models/notification";
5
+ export declare class ContainerMethods {
6
+ _options: Options;
7
+ _clientInstance: ClientInstance;
8
+ constructor(options: Options);
9
+ getContainerByID(id: number): Promise<Container>;
10
+ getContainerByReferenceName(referenceName: string): Promise<Container>;
11
+ getContainerSecurity(id: number): Promise<Container>;
12
+ getContainerList(): Promise<Container[]>;
13
+ getNotificationList(id: number): Promise<Notification[]>;
14
+ saveContainer(container: Container): Promise<Container>;
15
+ deleteContainer(id: number): Promise<string>;
16
+ }
@@ -1,105 +1,189 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ContainerMethods = void 0;
13
- const clientInstance_1 = require("./clientInstance");
14
- const exception_1 = require("../models/exception");
15
- class ContainerMethods {
16
- constructor(options) {
17
- this._options = options;
18
- this._clientInstance = new clientInstance_1.ClientInstance();
19
- }
20
- getContainerByID(id) {
21
- return __awaiter(this, void 0, void 0, function* () {
22
- try {
23
- let apiPath = `container/${id}`;
24
- const resp = yield this._clientInstance.executeGet(apiPath, this._options);
25
- return resp.data;
26
- }
27
- catch (err) {
28
- throw new exception_1.Exception(`Unable to retreive the contianer for id: ${id}`, err);
29
- }
30
- });
31
- }
32
- getContainerByReferenceName(referenceName) {
33
- return __awaiter(this, void 0, void 0, function* () {
34
- try {
35
- let apiPath = `container/${referenceName}`;
36
- const resp = yield this._clientInstance.executeGet(apiPath, this._options);
37
- return resp.data;
38
- }
39
- catch (err) {
40
- throw new exception_1.Exception(`Unable to retreive the contianer for referenceName: ${referenceName}`, err);
41
- }
42
- });
43
- }
44
- getContainerSecurity(id) {
45
- return __awaiter(this, void 0, void 0, function* () {
46
- try {
47
- let apiPath = `container/${id}/security`;
48
- const resp = yield this._clientInstance.executeGet(apiPath, this._options);
49
- return resp.data;
50
- }
51
- catch (err) {
52
- throw new exception_1.Exception(`Unable to retreive the contianer for id: ${id}`, err);
53
- }
54
- });
55
- }
56
- getContainerList() {
57
- return __awaiter(this, void 0, void 0, function* () {
58
- try {
59
- let apiPath = `container/list`;
60
- const resp = yield this._clientInstance.executeGet(apiPath, this._options);
61
- return resp.data;
62
- }
63
- catch (err) {
64
- throw new exception_1.Exception(`Unable to retreive the contianer list`, err);
65
- }
66
- });
67
- }
68
- getNotificationList(id) {
69
- return __awaiter(this, void 0, void 0, function* () {
70
- try {
71
- let apiPath = `container/${id}/notifications`;
72
- const resp = yield this._clientInstance.executeGet(apiPath, this._options);
73
- return resp.data;
74
- }
75
- catch (err) {
76
- throw new exception_1.Exception(`Unable to retreive the notifications for contianer id: ${id}`, err);
77
- }
78
- });
79
- }
80
- saveContainer(container) {
81
- return __awaiter(this, void 0, void 0, function* () {
82
- try {
83
- let apiPath = `container`;
84
- const resp = yield this._clientInstance.executePost(apiPath, this._options, container);
85
- return resp.data;
86
- }
87
- catch (err) {
88
- throw new exception_1.Exception(`Unable to save the contianer`, err);
89
- }
90
- });
91
- }
92
- deleteContainer(id) {
93
- return __awaiter(this, void 0, void 0, function* () {
94
- try {
95
- let apiPath = `container/${id}`;
96
- const resp = yield this._clientInstance.executeDelete(apiPath, this._options);
97
- return resp.data;
98
- }
99
- catch (err) {
100
- throw new exception_1.Exception(`Unable to delete the contianer for id: ${id}`, err);
101
- }
102
- });
103
- }
104
- }
105
- exports.ContainerMethods = ContainerMethods;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
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;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
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
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.ContainerMethods = void 0;
40
+ var clientInstance_1 = require("./clientInstance");
41
+ var exception_1 = require("../models/exception");
42
+ var ContainerMethods = /** @class */ (function () {
43
+ function ContainerMethods(options) {
44
+ this._options = options;
45
+ this._clientInstance = new clientInstance_1.ClientInstance();
46
+ }
47
+ ContainerMethods.prototype.getContainerByID = function (id) {
48
+ return __awaiter(this, void 0, void 0, function () {
49
+ var apiPath, resp, err_1;
50
+ return __generator(this, function (_a) {
51
+ switch (_a.label) {
52
+ case 0:
53
+ _a.trys.push([0, 2, , 3]);
54
+ apiPath = "container/" + id;
55
+ return [4 /*yield*/, this._clientInstance.executeGet(apiPath, this._options)];
56
+ case 1:
57
+ resp = _a.sent();
58
+ return [2 /*return*/, resp.data];
59
+ case 2:
60
+ err_1 = _a.sent();
61
+ throw new exception_1.Exception("Unable to retreive the contianer for id: " + id, err_1);
62
+ case 3: return [2 /*return*/];
63
+ }
64
+ });
65
+ });
66
+ };
67
+ ContainerMethods.prototype.getContainerByReferenceName = function (referenceName) {
68
+ return __awaiter(this, void 0, void 0, function () {
69
+ var apiPath, resp, err_2;
70
+ return __generator(this, function (_a) {
71
+ switch (_a.label) {
72
+ case 0:
73
+ _a.trys.push([0, 2, , 3]);
74
+ apiPath = "container/" + referenceName;
75
+ return [4 /*yield*/, this._clientInstance.executeGet(apiPath, this._options)];
76
+ case 1:
77
+ resp = _a.sent();
78
+ return [2 /*return*/, resp.data];
79
+ case 2:
80
+ err_2 = _a.sent();
81
+ throw new exception_1.Exception("Unable to retreive the contianer for referenceName: " + referenceName, err_2);
82
+ case 3: return [2 /*return*/];
83
+ }
84
+ });
85
+ });
86
+ };
87
+ ContainerMethods.prototype.getContainerSecurity = function (id) {
88
+ return __awaiter(this, void 0, void 0, function () {
89
+ var apiPath, resp, err_3;
90
+ return __generator(this, function (_a) {
91
+ switch (_a.label) {
92
+ case 0:
93
+ _a.trys.push([0, 2, , 3]);
94
+ apiPath = "container/" + id + "/security";
95
+ return [4 /*yield*/, this._clientInstance.executeGet(apiPath, this._options)];
96
+ case 1:
97
+ resp = _a.sent();
98
+ return [2 /*return*/, resp.data];
99
+ case 2:
100
+ err_3 = _a.sent();
101
+ throw new exception_1.Exception("Unable to retreive the contianer for id: " + id, err_3);
102
+ case 3: return [2 /*return*/];
103
+ }
104
+ });
105
+ });
106
+ };
107
+ ContainerMethods.prototype.getContainerList = function () {
108
+ return __awaiter(this, void 0, void 0, function () {
109
+ var apiPath, resp, err_4;
110
+ return __generator(this, function (_a) {
111
+ switch (_a.label) {
112
+ case 0:
113
+ _a.trys.push([0, 2, , 3]);
114
+ apiPath = "container/list";
115
+ return [4 /*yield*/, this._clientInstance.executeGet(apiPath, this._options)];
116
+ case 1:
117
+ resp = _a.sent();
118
+ return [2 /*return*/, resp.data];
119
+ case 2:
120
+ err_4 = _a.sent();
121
+ throw new exception_1.Exception("Unable to retreive the contianer list", err_4);
122
+ case 3: return [2 /*return*/];
123
+ }
124
+ });
125
+ });
126
+ };
127
+ ContainerMethods.prototype.getNotificationList = function (id) {
128
+ return __awaiter(this, void 0, void 0, function () {
129
+ var apiPath, resp, err_5;
130
+ return __generator(this, function (_a) {
131
+ switch (_a.label) {
132
+ case 0:
133
+ _a.trys.push([0, 2, , 3]);
134
+ apiPath = "container/" + id + "/notifications";
135
+ return [4 /*yield*/, this._clientInstance.executeGet(apiPath, this._options)];
136
+ case 1:
137
+ resp = _a.sent();
138
+ return [2 /*return*/, resp.data];
139
+ case 2:
140
+ err_5 = _a.sent();
141
+ throw new exception_1.Exception("Unable to retreive the notifications for contianer id: " + id, err_5);
142
+ case 3: return [2 /*return*/];
143
+ }
144
+ });
145
+ });
146
+ };
147
+ ContainerMethods.prototype.saveContainer = function (container) {
148
+ return __awaiter(this, void 0, void 0, function () {
149
+ var apiPath, resp, err_6;
150
+ return __generator(this, function (_a) {
151
+ switch (_a.label) {
152
+ case 0:
153
+ _a.trys.push([0, 2, , 3]);
154
+ apiPath = "container";
155
+ return [4 /*yield*/, this._clientInstance.executePost(apiPath, this._options, container)];
156
+ case 1:
157
+ resp = _a.sent();
158
+ return [2 /*return*/, resp.data];
159
+ case 2:
160
+ err_6 = _a.sent();
161
+ throw new exception_1.Exception("Unable to save the contianer", err_6);
162
+ case 3: return [2 /*return*/];
163
+ }
164
+ });
165
+ });
166
+ };
167
+ ContainerMethods.prototype.deleteContainer = function (id) {
168
+ return __awaiter(this, void 0, void 0, function () {
169
+ var apiPath, resp, err_7;
170
+ return __generator(this, function (_a) {
171
+ switch (_a.label) {
172
+ case 0:
173
+ _a.trys.push([0, 2, , 3]);
174
+ apiPath = "container/" + id;
175
+ return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, this._options)];
176
+ case 1:
177
+ resp = _a.sent();
178
+ return [2 /*return*/, resp.data];
179
+ case 2:
180
+ err_7 = _a.sent();
181
+ throw new exception_1.Exception("Unable to delete the contianer for id: " + id, err_7);
182
+ case 3: return [2 /*return*/];
183
+ }
184
+ });
185
+ });
186
+ };
187
+ return ContainerMethods;
188
+ }());
189
+ exports.ContainerMethods = ContainerMethods;
@@ -1,20 +1,20 @@
1
- import { Options } from "../models/options";
2
- import { ClientInstance } from "./clientInstance";
3
- import { ContentItem, ContentList } from "../models/contentItem";
4
- import { BatchMethods } from "./batchMethods";
5
- export declare class ContentMethods {
6
- _options: Options;
7
- _clientInstance: ClientInstance;
8
- _batchMethods: BatchMethods;
9
- constructor(options: Options);
10
- getContentItem(contentID: number): Promise<ContentItem>;
11
- publishContent(contentID: number, comments?: string): Promise<number[]>;
12
- unPublishContent(contentID: number, comments?: string): Promise<number[]>;
13
- contentRequestApproval(contentID: number, comments?: string): Promise<number[]>;
14
- approveContent(contentID: number, comments?: string): Promise<number[]>;
15
- declineContent(contentID: number, comments?: string): Promise<number[]>;
16
- deleteContent(contentID: number, comments?: string): Promise<number[]>;
17
- saveContentItem(contentItem: ContentItem): Promise<number[]>;
18
- saveContentItems(contentItems: ContentItem[]): Promise<number[]>;
19
- getContentItems(referenceName: string, filter?: string, fields?: string, sortDirection?: string, sortField?: string, take?: number, skip?: number): Promise<ContentList>;
20
- }
1
+ import { Options } from "../models/options";
2
+ import { ClientInstance } from "./clientInstance";
3
+ import { ContentItem, ContentList } from "../models/contentItem";
4
+ import { BatchMethods } from "./batchMethods";
5
+ export declare class ContentMethods {
6
+ _options: Options;
7
+ _clientInstance: ClientInstance;
8
+ _batchMethods: BatchMethods;
9
+ constructor(options: Options);
10
+ getContentItem(contentID: number): Promise<ContentItem>;
11
+ publishContent(contentID: number, comments?: string): Promise<number[]>;
12
+ unPublishContent(contentID: number, comments?: string): Promise<number[]>;
13
+ contentRequestApproval(contentID: number, comments?: string): Promise<number[]>;
14
+ approveContent(contentID: number, comments?: string): Promise<number[]>;
15
+ declineContent(contentID: number, comments?: string): Promise<number[]>;
16
+ deleteContent(contentID: number, comments?: string): Promise<number[]>;
17
+ saveContentItem(contentItem: ContentItem): Promise<number[]>;
18
+ saveContentItems(contentItems: ContentItem[]): Promise<number[]>;
19
+ getContentItems(referenceName: string, filter?: string, fields?: string, sortDirection?: string, sortField?: string, take?: number, skip?: number): Promise<ContentList>;
20
+ }