@agility/management-sdk 0.1.2 → 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.
- package/dist/apiMethods/assetMethods.js +150 -73
- package/dist/apiMethods/batchMethods.js +93 -41
- package/dist/apiMethods/clientInstance.js +116 -56
- package/dist/apiMethods/containerMethods.js +166 -82
- package/dist/apiMethods/contentMethods.js +332 -148
- package/dist/apiMethods/instanceUserMethods.js +92 -38
- package/dist/apiMethods/modelMethods.js +129 -60
- package/dist/apiMethods/pageMethods.js +297 -133
- package/dist/models/batch.js +5 -2
- package/dist/models/batchItem.js +5 -2
- package/dist/models/container.js +5 -2
- package/dist/models/contentItem.js +25 -10
- package/dist/models/contentViewColumn.js +5 -2
- package/dist/models/exception.js +21 -5
- package/dist/models/instanceRole.js +5 -2
- package/dist/models/instanceUser.js +5 -2
- package/dist/models/media.js +10 -4
- package/dist/models/model.js +10 -4
- package/dist/models/notification.js +5 -2
- package/dist/models/options.js +7 -4
- package/dist/models/pageItem.js +30 -12
- package/dist/models/sitemap.js +10 -4
- package/dist/models/websiteUser.js +10 -4
- package/package.json +1 -1
- package/tsconfig.json +1 -1
|
@@ -8,50 +8,104 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
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
|
+
};
|
|
11
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
39
|
exports.InstanceUserMethods = void 0;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
40
|
+
var clientInstance_1 = require("./clientInstance");
|
|
41
|
+
var exception_1 = require("../models/exception");
|
|
42
|
+
var InstanceUserMethods = /** @class */ (function () {
|
|
43
|
+
function InstanceUserMethods(options) {
|
|
17
44
|
this._options = options;
|
|
18
45
|
this._clientInstance = new clientInstance_1.ClientInstance();
|
|
19
46
|
}
|
|
20
|
-
getUsers() {
|
|
21
|
-
return __awaiter(this, void 0, void 0, function
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
47
|
+
InstanceUserMethods.prototype.getUsers = function () {
|
|
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 = "user/list";
|
|
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 users.", err_1);
|
|
62
|
+
case 3: return [2 /*return*/];
|
|
63
|
+
}
|
|
64
|
+
});
|
|
30
65
|
});
|
|
31
|
-
}
|
|
32
|
-
saveUser(emailAddress, roles, firstName
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
66
|
+
};
|
|
67
|
+
InstanceUserMethods.prototype.saveUser = function (emailAddress, roles, 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 () {
|
|
71
|
+
var apiPath, resp, err_2;
|
|
72
|
+
return __generator(this, function (_a) {
|
|
73
|
+
switch (_a.label) {
|
|
74
|
+
case 0:
|
|
75
|
+
_a.trys.push([0, 2, , 3]);
|
|
76
|
+
apiPath = "user/save?emailAddress=" + emailAddress + "&firstName=" + firstName + "&lastName=" + lastName;
|
|
77
|
+
return [4 /*yield*/, this._clientInstance.executePost(apiPath, this._options, roles)];
|
|
78
|
+
case 1:
|
|
79
|
+
resp = _a.sent();
|
|
80
|
+
return [2 /*return*/, resp.data];
|
|
81
|
+
case 2:
|
|
82
|
+
err_2 = _a.sent();
|
|
83
|
+
throw new exception_1.Exception("Unable to retreive users.", err_2);
|
|
84
|
+
case 3: return [2 /*return*/];
|
|
85
|
+
}
|
|
86
|
+
});
|
|
42
87
|
});
|
|
43
|
-
}
|
|
44
|
-
deleteUser(userId) {
|
|
45
|
-
return __awaiter(this, void 0, void 0, function
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
88
|
+
};
|
|
89
|
+
InstanceUserMethods.prototype.deleteUser = function (userId) {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
91
|
+
var apiPath, resp, err_3;
|
|
92
|
+
return __generator(this, function (_a) {
|
|
93
|
+
switch (_a.label) {
|
|
94
|
+
case 0:
|
|
95
|
+
_a.trys.push([0, 2, , 3]);
|
|
96
|
+
apiPath = "user/delete/" + userId;
|
|
97
|
+
return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, this._options)];
|
|
98
|
+
case 1:
|
|
99
|
+
resp = _a.sent();
|
|
100
|
+
return [2 /*return*/, resp.data];
|
|
101
|
+
case 2:
|
|
102
|
+
err_3 = _a.sent();
|
|
103
|
+
throw new exception_1.Exception("Unable to delete the user for id: " + userId, err_3);
|
|
104
|
+
case 3: return [2 /*return*/];
|
|
105
|
+
}
|
|
106
|
+
});
|
|
54
107
|
});
|
|
55
|
-
}
|
|
56
|
-
|
|
108
|
+
};
|
|
109
|
+
return InstanceUserMethods;
|
|
110
|
+
}());
|
|
57
111
|
exports.InstanceUserMethods = InstanceUserMethods;
|
|
@@ -8,74 +8,143 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
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
|
+
};
|
|
11
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
39
|
exports.ModelMethods = void 0;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
40
|
+
var clientInstance_1 = require("./clientInstance");
|
|
41
|
+
var exception_1 = require("../models/exception");
|
|
42
|
+
var ModelMethods = /** @class */ (function () {
|
|
43
|
+
function ModelMethods(options) {
|
|
17
44
|
this._options = options;
|
|
18
45
|
this._clientInstance = new clientInstance_1.ClientInstance();
|
|
19
46
|
}
|
|
20
|
-
getContentModel(id) {
|
|
21
|
-
return __awaiter(this, void 0, void 0, function
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
47
|
+
ModelMethods.prototype.getContentModel = 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 = "model/" + 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 model for id: " + id + ".", err_1);
|
|
62
|
+
case 3: return [2 /*return*/];
|
|
63
|
+
}
|
|
64
|
+
});
|
|
30
65
|
});
|
|
31
|
-
}
|
|
32
|
-
getContentModules(includeDefaults, includeModules
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
66
|
+
};
|
|
67
|
+
ModelMethods.prototype.getContentModules = function (includeDefaults, includeModules) {
|
|
68
|
+
if (includeModules === void 0) { includeModules = false; }
|
|
69
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
70
|
+
var apiPath, resp, err_2;
|
|
71
|
+
return __generator(this, function (_a) {
|
|
72
|
+
switch (_a.label) {
|
|
73
|
+
case 0:
|
|
74
|
+
_a.trys.push([0, 2, , 3]);
|
|
75
|
+
apiPath = "model/list/" + includeDefaults + "?includeModules=" + includeModules;
|
|
76
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, this._options)];
|
|
77
|
+
case 1:
|
|
78
|
+
resp = _a.sent();
|
|
79
|
+
return [2 /*return*/, resp.data];
|
|
80
|
+
case 2:
|
|
81
|
+
err_2 = _a.sent();
|
|
82
|
+
throw new exception_1.Exception("Unable to retreive content modules.", err_2);
|
|
83
|
+
case 3: return [2 /*return*/];
|
|
84
|
+
}
|
|
85
|
+
});
|
|
42
86
|
});
|
|
43
|
-
}
|
|
44
|
-
getPageModules(includeDefault) {
|
|
45
|
-
return __awaiter(this, void 0, void 0, function
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
87
|
+
};
|
|
88
|
+
ModelMethods.prototype.getPageModules = function (includeDefault) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
90
|
+
var apiPath, resp, err_3;
|
|
91
|
+
return __generator(this, function (_a) {
|
|
92
|
+
switch (_a.label) {
|
|
93
|
+
case 0:
|
|
94
|
+
_a.trys.push([0, 2, , 3]);
|
|
95
|
+
apiPath = "model/list-page-modules/" + includeDefault;
|
|
96
|
+
return [4 /*yield*/, this._clientInstance.executeGet(apiPath, this._options)];
|
|
97
|
+
case 1:
|
|
98
|
+
resp = _a.sent();
|
|
99
|
+
return [2 /*return*/, resp.data];
|
|
100
|
+
case 2:
|
|
101
|
+
err_3 = _a.sent();
|
|
102
|
+
throw new exception_1.Exception("Unable to retreive page modules.", err_3);
|
|
103
|
+
case 3: return [2 /*return*/];
|
|
104
|
+
}
|
|
105
|
+
});
|
|
54
106
|
});
|
|
55
|
-
}
|
|
56
|
-
saveModel(model) {
|
|
57
|
-
return __awaiter(this, void 0, void 0, function
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
107
|
+
};
|
|
108
|
+
ModelMethods.prototype.saveModel = function (model) {
|
|
109
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
110
|
+
var apiPath, resp, err_4;
|
|
111
|
+
return __generator(this, function (_a) {
|
|
112
|
+
switch (_a.label) {
|
|
113
|
+
case 0:
|
|
114
|
+
_a.trys.push([0, 2, , 3]);
|
|
115
|
+
apiPath = "model";
|
|
116
|
+
return [4 /*yield*/, this._clientInstance.executePost(apiPath, this._options, model)];
|
|
117
|
+
case 1:
|
|
118
|
+
resp = _a.sent();
|
|
119
|
+
return [2 /*return*/, resp.data];
|
|
120
|
+
case 2:
|
|
121
|
+
err_4 = _a.sent();
|
|
122
|
+
throw new exception_1.Exception("Unable to save the model.", err_4);
|
|
123
|
+
case 3: return [2 /*return*/];
|
|
124
|
+
}
|
|
125
|
+
});
|
|
66
126
|
});
|
|
67
|
-
}
|
|
68
|
-
deleteModel(id) {
|
|
69
|
-
return __awaiter(this, void 0, void 0, function
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
127
|
+
};
|
|
128
|
+
ModelMethods.prototype.deleteModel = function (id) {
|
|
129
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
130
|
+
var apiPath, resp, err_5;
|
|
131
|
+
return __generator(this, function (_a) {
|
|
132
|
+
switch (_a.label) {
|
|
133
|
+
case 0:
|
|
134
|
+
_a.trys.push([0, 2, , 3]);
|
|
135
|
+
apiPath = "model/" + id;
|
|
136
|
+
return [4 /*yield*/, this._clientInstance.executeDelete(apiPath, this._options)];
|
|
137
|
+
case 1:
|
|
138
|
+
resp = _a.sent();
|
|
139
|
+
return [2 /*return*/, resp.data];
|
|
140
|
+
case 2:
|
|
141
|
+
err_5 = _a.sent();
|
|
142
|
+
throw new exception_1.Exception("Unable to delete the model", err_5);
|
|
143
|
+
case 3: return [2 /*return*/];
|
|
144
|
+
}
|
|
145
|
+
});
|
|
78
146
|
});
|
|
79
|
-
}
|
|
80
|
-
|
|
147
|
+
};
|
|
148
|
+
return ModelMethods;
|
|
149
|
+
}());
|
|
81
150
|
exports.ModelMethods = ModelMethods;
|