@stackfactor/client-api 1.1.152 → 1.1.153
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/cjs/actionNotifications.js.map +1 -1
- package/dist/cjs/address.js.map +1 -1
- package/dist/cjs/aiAssistant.js.map +1 -1
- package/dist/cjs/avatar.js.map +1 -1
- package/dist/cjs/axiosClient.js.map +1 -1
- package/dist/cjs/config.js.map +1 -1
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/dashboard.js.map +1 -1
- package/dist/cjs/departmentTrainingPlans.d.ts +4 -4
- package/dist/cjs/departmentTrainingPlans.js +2 -2
- package/dist/cjs/departmentTrainingPlans.js.map +1 -1
- package/dist/cjs/groups.js.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/integration.d.ts +2 -2
- package/dist/cjs/integration.d.ts.map +1 -1
- package/dist/cjs/integration.js +1 -1
- package/dist/cjs/integration.js.map +1 -1
- package/dist/cjs/integrationConfiguration.d.ts +2 -2
- package/dist/cjs/integrationConfiguration.js +1 -1
- package/dist/cjs/integrationConfiguration.js.map +1 -1
- package/dist/cjs/integrations/contentGenerator.js.map +1 -1
- package/dist/cjs/learningContent.js.map +1 -1
- package/dist/cjs/learningPath.js.map +1 -1
- package/dist/cjs/logger.js.map +1 -1
- package/dist/cjs/microSkillsQuizes.js.map +1 -1
- package/dist/cjs/quotas.js.map +1 -1
- package/dist/cjs/role.js.map +1 -1
- package/dist/cjs/roleTemplate.js.map +1 -1
- package/dist/cjs/security.js.map +1 -1
- package/dist/cjs/skill.js.map +1 -1
- package/dist/cjs/skillAssessmentTestingSession.d.ts +2 -2
- package/dist/cjs/skillAssessmentTestingSession.d.ts.map +1 -1
- package/dist/cjs/skillAssessmentTestingSession.js +1 -1
- package/dist/cjs/skillAssessmentTestingSession.js.map +1 -1
- package/dist/cjs/skillAssessments.d.ts +2 -2
- package/dist/cjs/skillAssessments.js +1 -1
- package/dist/cjs/skillAssessments.js.map +1 -1
- package/dist/cjs/skillTemplate.js.map +1 -1
- package/dist/cjs/talentTransfromation.js.map +1 -1
- package/dist/cjs/teams.js.map +1 -1
- package/dist/cjs/tenants.d.ts +2 -2
- package/dist/cjs/tenants.d.ts.map +1 -1
- package/dist/cjs/tenants.js +1 -1
- package/dist/cjs/tenants.js.map +1 -1
- package/dist/cjs/trainingPlans.js.map +1 -1
- package/dist/cjs/trainingPlansProficiencyLevels.js.map +1 -1
- package/dist/cjs/userInformation.js.map +1 -1
- package/dist/cjs/users.d.ts +1 -1
- package/dist/cjs/users.d.ts.map +1 -1
- package/dist/cjs/users.js.map +1 -1
- package/dist/cjs/utils.js.map +1 -1
- package/dist/esm/actionNotifications.js.map +1 -1
- package/dist/esm/address.js.map +1 -1
- package/dist/esm/aiAssistant.js.map +1 -1
- package/dist/esm/avatar.js.map +1 -1
- package/dist/esm/axiosClient.js.map +1 -1
- package/dist/esm/config.js.map +1 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/dashboard.js.map +1 -1
- package/dist/esm/departmentTrainingPlans.d.ts +4 -4
- package/dist/esm/departmentTrainingPlans.js +2 -2
- package/dist/esm/departmentTrainingPlans.js.map +1 -1
- package/dist/esm/groups.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/integration.d.ts +2 -2
- package/dist/esm/integration.d.ts.map +1 -1
- package/dist/esm/integration.js +1 -1
- package/dist/esm/integration.js.map +1 -1
- package/dist/esm/integrationConfiguration.d.ts +2 -2
- package/dist/esm/integrationConfiguration.js +1 -1
- package/dist/esm/integrationConfiguration.js.map +1 -1
- package/dist/esm/integrations/contentGenerator.js.map +1 -1
- package/dist/esm/learningContent.js.map +1 -1
- package/dist/esm/learningPath.js.map +1 -1
- package/dist/esm/logger.js.map +1 -1
- package/dist/esm/microSkillsQuizes.js.map +1 -1
- package/dist/esm/quotas.js.map +1 -1
- package/dist/esm/role.js.map +1 -1
- package/dist/esm/roleTemplate.js.map +1 -1
- package/dist/esm/security.js.map +1 -1
- package/dist/esm/skill.js.map +1 -1
- package/dist/esm/skillAssessmentTestingSession.d.ts +2 -2
- package/dist/esm/skillAssessmentTestingSession.d.ts.map +1 -1
- package/dist/esm/skillAssessmentTestingSession.js +1 -1
- package/dist/esm/skillAssessmentTestingSession.js.map +1 -1
- package/dist/esm/skillAssessments.d.ts +2 -2
- package/dist/esm/skillAssessments.js +1 -1
- package/dist/esm/skillAssessments.js.map +1 -1
- package/dist/esm/skillTemplate.js.map +1 -1
- package/dist/esm/talentTransfromation.js.map +1 -1
- package/dist/esm/teams.js.map +1 -1
- package/dist/esm/tenants.d.ts +2 -2
- package/dist/esm/tenants.d.ts.map +1 -1
- package/dist/esm/tenants.js +1 -1
- package/dist/esm/tenants.js.map +1 -1
- package/dist/esm/trainingPlans.js.map +1 -1
- package/dist/esm/trainingPlansProficiencyLevels.js.map +1 -1
- package/dist/esm/userInformation.js.map +1 -1
- package/dist/esm/users.d.ts +1 -1
- package/dist/esm/users.d.ts.map +1 -1
- package/dist/esm/users.js.map +1 -1
- package/dist/esm/utils.js.map +1 -1
- package/package.json +1 -1
- package/dist/actionNotifications.js +0 -73
- package/dist/address.js +0 -22
- package/dist/aiAssistant.js +0 -134
- package/dist/avatar.js +0 -32
- package/dist/axiosClient.js +0 -89
- package/dist/config.js +0 -63
- package/dist/constants.js +0 -94
- package/dist/dashboard.js +0 -74
- package/dist/departmentTrainingPlans.js +0 -154
- package/dist/exports.js +0 -77
- package/dist/groups.js +0 -273
- package/dist/index.js +0 -77
- package/dist/integration.js +0 -319
- package/dist/integrationConfiguration.js +0 -86
- package/dist/integrations/contentGenerator.js +0 -70
- package/dist/learningContent.js +0 -394
- package/dist/learningPath.js +0 -205
- package/dist/logger.js +0 -57
- package/dist/microSkillsQuizes.js +0 -53
- package/dist/quotas.js +0 -50
- package/dist/role.js +0 -363
- package/dist/roleTemplate.js +0 -236
- package/dist/security.js +0 -79
- package/dist/skill.js +0 -439
- package/dist/skillAssessmentTestingSession.js +0 -156
- package/dist/skillAssessments.js +0 -156
- package/dist/skillTemplate.js +0 -281
- package/dist/talentTransfromation.js +0 -100
- package/dist/teams.js +0 -252
- package/dist/tenants.js +0 -52
- package/dist/trainingPlans.js +0 -308
- package/dist/trainingPlansProficiencyLevels.js +0 -98
- package/dist/userInformation.js +0 -81
- package/dist/users.js +0 -694
- package/dist/utils.js +0 -65
package/dist/integration.js
DELETED
|
@@ -1,319 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.setDefaultIntegration = exports.setIntegrationInformation = exports.publishIntegration = exports.getEnabledContentProviders = exports.getContentInformationByUrlFromBrowser = exports.getContentInformationByUrl = exports.getIntegrationsList = exports.getIntegrationInformationById = exports.discardIntegrationChanges = exports.deleteIntegration = exports.createIntegration = void 0;
|
|
7
|
-
const axiosClient_1 = require("./axiosClient");
|
|
8
|
-
const axios_1 = __importDefault(require("axios"));
|
|
9
|
-
const node_html_parser_1 = __importDefault(require("node-html-parser"));
|
|
10
|
-
const html2plaintext_1 = __importDefault(require("html2plaintext"));
|
|
11
|
-
/**
|
|
12
|
-
* Create integration and set information
|
|
13
|
-
* @param {Object} data The new integration information
|
|
14
|
-
* @param {String} token Authorization token
|
|
15
|
-
*/
|
|
16
|
-
const createIntegration = (data, token) => {
|
|
17
|
-
return new Promise((resolve, reject) => {
|
|
18
|
-
const requestData = {
|
|
19
|
-
data: data,
|
|
20
|
-
};
|
|
21
|
-
let confirmationRequest = axiosClient_1.client.put("api/v1/integrations/", requestData, {
|
|
22
|
-
headers: { authorization: token },
|
|
23
|
-
});
|
|
24
|
-
confirmationRequest
|
|
25
|
-
.then((response) => {
|
|
26
|
-
resolve(response.data);
|
|
27
|
-
})
|
|
28
|
-
.catch((error) => {
|
|
29
|
-
reject(error);
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
exports.createIntegration = createIntegration;
|
|
34
|
-
/**
|
|
35
|
-
* Delete integration
|
|
36
|
-
* @param {String} id The id of the integration to be deleted
|
|
37
|
-
* @param {String} token Authorization token
|
|
38
|
-
*/
|
|
39
|
-
const deleteIntegration = (id, token) => {
|
|
40
|
-
return new Promise((resolve, reject) => {
|
|
41
|
-
const request = axiosClient_1.client.delete(`api/v1/integrations/`, {
|
|
42
|
-
headers: { authorization: token },
|
|
43
|
-
data: {
|
|
44
|
-
id: id,
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
|
-
request
|
|
48
|
-
.then((response) => {
|
|
49
|
-
resolve(response.data);
|
|
50
|
-
})
|
|
51
|
-
.catch((error) => {
|
|
52
|
-
reject(error);
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
exports.deleteIntegration = deleteIntegration;
|
|
57
|
-
/**
|
|
58
|
-
* Discard the integration draft changes
|
|
59
|
-
* @param {String} id The id of the role template to be deleted
|
|
60
|
-
* @param {String} token Authorization token
|
|
61
|
-
*/
|
|
62
|
-
const discardIntegrationChanges = (id, token) => {
|
|
63
|
-
return new Promise((resolve, reject) => {
|
|
64
|
-
const data = {};
|
|
65
|
-
const request = axiosClient_1.client.get(`api/v1/integrations/discard/${id}`, {
|
|
66
|
-
headers: { authorization: token },
|
|
67
|
-
data: data,
|
|
68
|
-
});
|
|
69
|
-
request
|
|
70
|
-
.then((response) => {
|
|
71
|
-
resolve(response.data);
|
|
72
|
-
})
|
|
73
|
-
.catch((error) => {
|
|
74
|
-
reject(error);
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
exports.discardIntegrationChanges = discardIntegrationChanges;
|
|
79
|
-
/**
|
|
80
|
-
* Get integration information
|
|
81
|
-
* @param {String} id The id of the integration
|
|
82
|
-
* @param {String} version The version of the integration to be received
|
|
83
|
-
* @param {String} token Authorization token
|
|
84
|
-
*/
|
|
85
|
-
const getIntegrationInformationById = (id, version, token) => {
|
|
86
|
-
return new Promise((resolve, reject) => {
|
|
87
|
-
let confirmationRequest = axiosClient_1.client.get(`api/v1/integrations/${id}/${version}`, {
|
|
88
|
-
headers: { authorization: token },
|
|
89
|
-
});
|
|
90
|
-
confirmationRequest
|
|
91
|
-
.then((response) => {
|
|
92
|
-
resolve(response.data);
|
|
93
|
-
})
|
|
94
|
-
.catch((error) => {
|
|
95
|
-
reject(error);
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
};
|
|
99
|
-
exports.getIntegrationInformationById = getIntegrationInformationById;
|
|
100
|
-
/**
|
|
101
|
-
* Get integrations list
|
|
102
|
-
* @param {Array<String>} filter The filter used to select the integration
|
|
103
|
-
* @param {String} type The type of the integration
|
|
104
|
-
* @param {String} version The version to be retrieved
|
|
105
|
-
* @param {Boolean} includeSupportedCapabilities If true, the supported capabilities will be included in the response
|
|
106
|
-
* @param {String} token Authorization token
|
|
107
|
-
*/
|
|
108
|
-
const getIntegrationsList = (filter, type, version, includeSupportedCapabilities, token) => {
|
|
109
|
-
return new Promise((resolve, reject) => {
|
|
110
|
-
const requestData = {
|
|
111
|
-
includeSupportedCapabilities: includeSupportedCapabilities,
|
|
112
|
-
version: version,
|
|
113
|
-
};
|
|
114
|
-
if (filter)
|
|
115
|
-
requestData.filter = filter;
|
|
116
|
-
if (type)
|
|
117
|
-
requestData.type = type;
|
|
118
|
-
let confirmationRequest = axiosClient_1.client.post(`api/v1/integrations`, requestData, {
|
|
119
|
-
headers: { authorization: token },
|
|
120
|
-
});
|
|
121
|
-
confirmationRequest
|
|
122
|
-
.then((response) => {
|
|
123
|
-
resolve(response.data);
|
|
124
|
-
})
|
|
125
|
-
.catch((error) => {
|
|
126
|
-
reject(error);
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
};
|
|
130
|
-
exports.getIntegrationsList = getIntegrationsList;
|
|
131
|
-
/**
|
|
132
|
-
* Get content information by Url
|
|
133
|
-
* @param {String} url The training url
|
|
134
|
-
* @param {String} verb The verb
|
|
135
|
-
* @param {String} token Authorization token
|
|
136
|
-
*/
|
|
137
|
-
const getContentInformationByUrl = (url, verb, token) => {
|
|
138
|
-
return new Promise((resolve, reject) => {
|
|
139
|
-
const requestData = {
|
|
140
|
-
url: url,
|
|
141
|
-
verb: verb,
|
|
142
|
-
};
|
|
143
|
-
let confirmationRequest = axiosClient_1.client.post(`api/v1/contentproviders/getcontentinformationbyurl`, requestData, {
|
|
144
|
-
headers: { authorization: token },
|
|
145
|
-
});
|
|
146
|
-
confirmationRequest
|
|
147
|
-
.then((response) => {
|
|
148
|
-
resolve(response.data);
|
|
149
|
-
})
|
|
150
|
-
.catch((error) => {
|
|
151
|
-
reject(error);
|
|
152
|
-
});
|
|
153
|
-
});
|
|
154
|
-
};
|
|
155
|
-
exports.getContentInformationByUrl = getContentInformationByUrl;
|
|
156
|
-
/**
|
|
157
|
-
* Get content information by url from the browser instead of the backend
|
|
158
|
-
* @param {String} url
|
|
159
|
-
* @returns {Promise<ContentInformationResponse>}
|
|
160
|
-
*/
|
|
161
|
-
const getContentInformationByUrlFromBrowser = (url) => {
|
|
162
|
-
return new Promise((resolve, reject) => {
|
|
163
|
-
let domain = new URL(url);
|
|
164
|
-
let instance = axios_1.default.create({
|
|
165
|
-
baseURL: domain.origin,
|
|
166
|
-
});
|
|
167
|
-
let confirmationRequest = instance.get(domain.pathname, {
|
|
168
|
-
headers: {
|
|
169
|
-
"Access-Control-Allow-Origin": "*",
|
|
170
|
-
"Access-Control-Allow-Headers": "Authorization, Origin, X-Requested-With, Content-Type, Accept",
|
|
171
|
-
Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
|
172
|
-
"Accept-Encoding": "gzip, deflate, br",
|
|
173
|
-
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE",
|
|
174
|
-
"User-Agent": "Mozilla/5.0",
|
|
175
|
-
},
|
|
176
|
-
});
|
|
177
|
-
confirmationRequest
|
|
178
|
-
.then((response) => {
|
|
179
|
-
//get the reading time
|
|
180
|
-
const getReadingTime = (text) => {
|
|
181
|
-
const wpm = 225;
|
|
182
|
-
const words = text.trim().split(/\s+/).length;
|
|
183
|
-
return Math.ceil(words / wpm);
|
|
184
|
-
};
|
|
185
|
-
let document = node_html_parser_1.default.parse(response.data);
|
|
186
|
-
let duration = getReadingTime((0, html2plaintext_1.default)(response.data));
|
|
187
|
-
let titleTag = document.querySelector("title");
|
|
188
|
-
let title = titleTag ? titleTag.rawText : "";
|
|
189
|
-
let description = "";
|
|
190
|
-
const descriptionEl = document.querySelector("meta");
|
|
191
|
-
try {
|
|
192
|
-
if (descriptionEl) {
|
|
193
|
-
const descriptionParentNode = descriptionEl.parentNode;
|
|
194
|
-
if (descriptionParentNode) {
|
|
195
|
-
const descriptionChildNodes = descriptionParentNode.childNodes;
|
|
196
|
-
if (descriptionChildNodes) {
|
|
197
|
-
const descriptionRawAttr = descriptionChildNodes.find((item) => item.rawAttrs.includes("description"));
|
|
198
|
-
if (descriptionRawAttr) {
|
|
199
|
-
const descriptionContent = descriptionRawAttr.rawAttrs.substring(descriptionRawAttr.rawAttrs.indexOf("content=") + 9);
|
|
200
|
-
description = descriptionContent.substring(0, descriptionContent.length - 1);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
finally {
|
|
207
|
-
resolve({
|
|
208
|
-
description: description,
|
|
209
|
-
duration: duration,
|
|
210
|
-
icon: `http://www.google.com/s2/favicons?sz=128&domain_url=${domain.hostname}`,
|
|
211
|
-
title: title ? title.trim() : url,
|
|
212
|
-
type: 0,
|
|
213
|
-
internal: true,
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
})
|
|
217
|
-
.catch((error) => {
|
|
218
|
-
reject(new Error((0, axiosClient_1.errorToString)(error)));
|
|
219
|
-
});
|
|
220
|
-
});
|
|
221
|
-
};
|
|
222
|
-
exports.getContentInformationByUrlFromBrowser = getContentInformationByUrlFromBrowser;
|
|
223
|
-
/**
|
|
224
|
-
* Get enabled content providers
|
|
225
|
-
* @param {String} userId
|
|
226
|
-
* @param {String} token Authorization token
|
|
227
|
-
*/
|
|
228
|
-
const getEnabledContentProviders = (userId, token) => {
|
|
229
|
-
return new Promise((resolve, reject) => {
|
|
230
|
-
let confirmationRequest = axiosClient_1.client.get(`api/v1/contentproviders/getenabledcontentproviders/${userId}`, {
|
|
231
|
-
headers: { authorization: token },
|
|
232
|
-
});
|
|
233
|
-
confirmationRequest
|
|
234
|
-
.then((response) => {
|
|
235
|
-
resolve(response.data);
|
|
236
|
-
})
|
|
237
|
-
.catch((error) => {
|
|
238
|
-
reject(error);
|
|
239
|
-
});
|
|
240
|
-
});
|
|
241
|
-
};
|
|
242
|
-
exports.getEnabledContentProviders = getEnabledContentProviders;
|
|
243
|
-
/**
|
|
244
|
-
* Publish integration
|
|
245
|
-
* @param {String} id The id of the integration to be published
|
|
246
|
-
* @param {String} token Authorization token
|
|
247
|
-
*/
|
|
248
|
-
const publishIntegration = (id, token) => {
|
|
249
|
-
return new Promise((resolve, reject) => {
|
|
250
|
-
let confirmationRequest = axiosClient_1.client.post(`api/v1/integrations/publish/${id}`, {}, {
|
|
251
|
-
headers: { authorization: token },
|
|
252
|
-
});
|
|
253
|
-
confirmationRequest
|
|
254
|
-
.then((response) => {
|
|
255
|
-
resolve(response.data);
|
|
256
|
-
})
|
|
257
|
-
.catch((error) => {
|
|
258
|
-
reject(error);
|
|
259
|
-
});
|
|
260
|
-
});
|
|
261
|
-
};
|
|
262
|
-
exports.publishIntegration = publishIntegration;
|
|
263
|
-
/**
|
|
264
|
-
* Set integration information
|
|
265
|
-
* @param {String} id The id of the integration to be updated
|
|
266
|
-
* @param {Object} data Data used to update the integration
|
|
267
|
-
* @param {String} token Authorization token
|
|
268
|
-
*/
|
|
269
|
-
const setIntegrationInformation = (id, data, token) => {
|
|
270
|
-
return new Promise((resolve, reject) => {
|
|
271
|
-
const requestData = {
|
|
272
|
-
data: data,
|
|
273
|
-
};
|
|
274
|
-
let confirmationRequest = axiosClient_1.client.post(`api/v1/integrations/${id}`, requestData, {
|
|
275
|
-
headers: { authorization: token },
|
|
276
|
-
});
|
|
277
|
-
confirmationRequest
|
|
278
|
-
.then((response) => {
|
|
279
|
-
resolve(response.data);
|
|
280
|
-
})
|
|
281
|
-
.catch((error) => {
|
|
282
|
-
reject(error);
|
|
283
|
-
});
|
|
284
|
-
});
|
|
285
|
-
};
|
|
286
|
-
exports.setIntegrationInformation = setIntegrationInformation;
|
|
287
|
-
/**
|
|
288
|
-
* Set default integration
|
|
289
|
-
* @param {String} id The id of the integration to be set as default
|
|
290
|
-
* @param {String} token Authorization token
|
|
291
|
-
*/
|
|
292
|
-
const setDefaultIntegration = (id, token) => {
|
|
293
|
-
return new Promise((resolve, reject) => {
|
|
294
|
-
let confirmationRequest = axiosClient_1.client.post(`api/v1/integrations/${id}/default`, "", {
|
|
295
|
-
headers: { authorization: token },
|
|
296
|
-
});
|
|
297
|
-
confirmationRequest
|
|
298
|
-
.then((response) => {
|
|
299
|
-
resolve(response.data);
|
|
300
|
-
})
|
|
301
|
-
.catch((error) => {
|
|
302
|
-
reject(error);
|
|
303
|
-
});
|
|
304
|
-
});
|
|
305
|
-
};
|
|
306
|
-
exports.setDefaultIntegration = setDefaultIntegration;
|
|
307
|
-
exports.default = {
|
|
308
|
-
createIntegration: exports.createIntegration,
|
|
309
|
-
deleteIntegration: exports.deleteIntegration,
|
|
310
|
-
discardIntegrationChanges: exports.discardIntegrationChanges,
|
|
311
|
-
getContentInformationByUrl: exports.getContentInformationByUrl,
|
|
312
|
-
getContentInformationByUrlFromBrowser: exports.getContentInformationByUrlFromBrowser,
|
|
313
|
-
getEnabledContentProviders: exports.getEnabledContentProviders,
|
|
314
|
-
getIntegrationInformationById: exports.getIntegrationInformationById,
|
|
315
|
-
getIntegrationsList: exports.getIntegrationsList,
|
|
316
|
-
publishIntegration: exports.publishIntegration,
|
|
317
|
-
setDefaultIntegration: exports.setDefaultIntegration,
|
|
318
|
-
setIntegrationInformation: exports.setIntegrationInformation,
|
|
319
|
-
};
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const axiosClient_1 = require("./axiosClient");
|
|
4
|
-
/**
|
|
5
|
-
* Get the integration configuration
|
|
6
|
-
* @param {Array<String>} ids
|
|
7
|
-
* @param {Number} type
|
|
8
|
-
* @param {String} token Authorization token
|
|
9
|
-
* @returns {Promise<Object>}
|
|
10
|
-
*/
|
|
11
|
-
const getIntegrationsConfiguration = (ids, type, token) => {
|
|
12
|
-
return new Promise((resolve, reject) => {
|
|
13
|
-
let requestData = { type: type };
|
|
14
|
-
if (ids)
|
|
15
|
-
requestData.ids = ids;
|
|
16
|
-
let confirmationRequest = axiosClient_1.client.post("api/v1/integrationsconfiguration", requestData, {
|
|
17
|
-
headers: { authorization: token },
|
|
18
|
-
});
|
|
19
|
-
confirmationRequest
|
|
20
|
-
.then((response) => {
|
|
21
|
-
resolve(response.data);
|
|
22
|
-
})
|
|
23
|
-
.catch((error) => {
|
|
24
|
-
reject(error);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Save integration configuration
|
|
30
|
-
* @param {String} id The id of the integration configuration to be updated
|
|
31
|
-
* @param {Number} type The type of configuration
|
|
32
|
-
* @param {Object} configuration Data used to update the integration configuration
|
|
33
|
-
* @param {String} token Authorization token
|
|
34
|
-
* @returns {Promise<Object>}
|
|
35
|
-
*/
|
|
36
|
-
const saveIntegrationConfiguration = (id, type, configuration, token) => {
|
|
37
|
-
return new Promise((resolve, reject) => {
|
|
38
|
-
const requestData = {
|
|
39
|
-
id: id,
|
|
40
|
-
configuration: configuration,
|
|
41
|
-
type: type,
|
|
42
|
-
};
|
|
43
|
-
let confirmationRequest = axiosClient_1.client.put(`api/v1/integrationsconfiguration`, requestData, {
|
|
44
|
-
headers: { authorization: token },
|
|
45
|
-
});
|
|
46
|
-
confirmationRequest
|
|
47
|
-
.then((response) => {
|
|
48
|
-
resolve(response.data);
|
|
49
|
-
})
|
|
50
|
-
.catch((error) => {
|
|
51
|
-
reject(error);
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* Test integration configuration
|
|
57
|
-
* @param {String} id The id of the integration to be updated
|
|
58
|
-
* @param {String} type The type of configuration
|
|
59
|
-
* @param {Object} configuration Configuration to be tested
|
|
60
|
-
* @param {String} token Authorization token
|
|
61
|
-
* @returns {Promise<Object>}
|
|
62
|
-
*/
|
|
63
|
-
const testIntegrationConfiguration = (id, type, configuration, token) => {
|
|
64
|
-
return new Promise((resolve, reject) => {
|
|
65
|
-
const requestData = {
|
|
66
|
-
id: id,
|
|
67
|
-
configuration: configuration,
|
|
68
|
-
type: type,
|
|
69
|
-
};
|
|
70
|
-
let confirmationRequest = axiosClient_1.client.post(`api/v1/integrationsconfiguration/testConfiguration`, requestData, {
|
|
71
|
-
headers: { authorization: token },
|
|
72
|
-
});
|
|
73
|
-
confirmationRequest
|
|
74
|
-
.then((response) => {
|
|
75
|
-
resolve(response.data);
|
|
76
|
-
})
|
|
77
|
-
.catch((error) => {
|
|
78
|
-
reject(error);
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
};
|
|
82
|
-
exports.default = {
|
|
83
|
-
getIntegrationsConfiguration,
|
|
84
|
-
saveIntegrationConfiguration,
|
|
85
|
-
testIntegrationConfiguration,
|
|
86
|
-
};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateContentAsync = exports.generateContent = void 0;
|
|
4
|
-
const axiosClient_1 = require("../axiosClient");
|
|
5
|
-
/**
|
|
6
|
-
* Generate content
|
|
7
|
-
* @param {Array<String>} data
|
|
8
|
-
* @param {String} contentType
|
|
9
|
-
* @param {String} integrationId
|
|
10
|
-
* @param {String} token
|
|
11
|
-
* @returns {Promise<Object>}
|
|
12
|
-
*/
|
|
13
|
-
const generateContent = (data, contentType, integrationId, token) => {
|
|
14
|
-
return new Promise((resolve, reject) => {
|
|
15
|
-
let data_ = {
|
|
16
|
-
data: data,
|
|
17
|
-
contentType: contentType,
|
|
18
|
-
};
|
|
19
|
-
if (integrationId)
|
|
20
|
-
data_.integrationId = integrationId;
|
|
21
|
-
const request = axiosClient_1.client.post(`api/v1/contentgenerators/generate`, data_, {
|
|
22
|
-
headers: { authorization: token },
|
|
23
|
-
});
|
|
24
|
-
request
|
|
25
|
-
.then((response) => {
|
|
26
|
-
resolve(response.data);
|
|
27
|
-
})
|
|
28
|
-
.catch((error) => {
|
|
29
|
-
reject(error);
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
exports.generateContent = generateContent;
|
|
34
|
-
/**
|
|
35
|
-
* Generate content async
|
|
36
|
-
* @param {String} id
|
|
37
|
-
* @param {Object} data
|
|
38
|
-
* @param {String} contentType
|
|
39
|
-
* @param {String} elementType
|
|
40
|
-
* @param {String} integrationId
|
|
41
|
-
* @param {String} comments
|
|
42
|
-
* @param {String} token
|
|
43
|
-
* @returns {Promise<Object>}
|
|
44
|
-
*/
|
|
45
|
-
const generateContentAsync = (id, data, contentType, elementType, integrationId, comments, token) => {
|
|
46
|
-
return new Promise((resolve, reject) => {
|
|
47
|
-
let data_ = {
|
|
48
|
-
id: id,
|
|
49
|
-
data: data,
|
|
50
|
-
comments: comments,
|
|
51
|
-
contentType: contentType,
|
|
52
|
-
elementType: elementType,
|
|
53
|
-
};
|
|
54
|
-
if (integrationId)
|
|
55
|
-
data_.integrationId = integrationId;
|
|
56
|
-
const request = axiosClient_1.client.post(`api/v1/contentgenerators/generateasync`, data_, {
|
|
57
|
-
headers: { authorization: token },
|
|
58
|
-
});
|
|
59
|
-
request
|
|
60
|
-
.then((response) => {
|
|
61
|
-
resolve(response.data);
|
|
62
|
-
})
|
|
63
|
-
.catch((error) => {
|
|
64
|
-
reject(error);
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
exports.generateContentAsync = generateContentAsync;
|
|
69
|
-
const contentGenerator = { generateContent: exports.generateContent, generateContentAsync: exports.generateContentAsync };
|
|
70
|
-
exports.default = contentGenerator;
|