@stackfactor/client-api 1.1.148 → 1.1.150
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/actionNotifications.js +73 -0
- package/dist/address.js +22 -0
- package/dist/aiAssistant.js +134 -0
- package/dist/avatar.js +32 -0
- package/dist/axiosClient.js +89 -0
- 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/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/config.js +63 -0
- package/dist/constants.js +94 -0
- package/dist/dashboard.js +74 -0
- package/dist/departmentTrainingPlans.js +154 -0
- 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/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/exports.js +77 -0
- package/dist/groups.js +273 -0
- package/dist/index.js +77 -0
- package/dist/integration.js +319 -0
- package/dist/integrationConfiguration.js +86 -0
- package/dist/integrations/contentGenerator.js +70 -0
- package/dist/learningContent.js +394 -0
- package/dist/learningPath.js +205 -0
- package/dist/logger.js +57 -0
- package/dist/microSkillsQuizes.js +53 -0
- package/dist/quotas.js +50 -0
- package/dist/role.js +363 -0
- package/dist/roleTemplate.js +236 -0
- package/dist/security.js +79 -0
- package/dist/skill.js +439 -0
- package/dist/skillAssessmentTestingSession.js +156 -0
- package/dist/skillAssessments.js +156 -0
- package/dist/skillTemplate.js +281 -0
- package/dist/talentTransfromation.js +100 -0
- package/dist/teams.js +252 -0
- package/dist/tenants.js +52 -0
- package/dist/trainingPlans.js +308 -0
- package/dist/trainingPlansProficiencyLevels.js +98 -0
- package/dist/userInformation.js +81 -0
- package/dist/users.js +694 -0
- package/dist/utils.js +65 -0
- package/package.json +1 -1
package/dist/utils.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable no-undef */
|
|
3
|
+
//import dotenv from "dotenv";
|
|
4
|
+
// Load environment variables from .env file
|
|
5
|
+
//dotenv.config();
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
/**
|
|
8
|
+
* Convert object to array
|
|
9
|
+
* @param {Object} data
|
|
10
|
+
* @returns {Array}
|
|
11
|
+
*/
|
|
12
|
+
const objectToArray = (data) => {
|
|
13
|
+
if (typeof data === "object") {
|
|
14
|
+
return [...Object.values(data)];
|
|
15
|
+
}
|
|
16
|
+
else
|
|
17
|
+
throw new Error("Invalid type");
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Returns the backend base API URL
|
|
21
|
+
* @returns {String}
|
|
22
|
+
*/
|
|
23
|
+
const getBaseUrl = () => {
|
|
24
|
+
if (process.env.REACT_APP_BACKEND_URL) {
|
|
25
|
+
return process.env.REACT_APP_BACKEND_URL;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
switch (process.env.REACT_APP_NODE_ENV) {
|
|
29
|
+
case "development":
|
|
30
|
+
case null:
|
|
31
|
+
case undefined:
|
|
32
|
+
return "https://localhost/";
|
|
33
|
+
case "testing":
|
|
34
|
+
return "https://qaapi.stackfactor.ai/";
|
|
35
|
+
case "nonprod":
|
|
36
|
+
return "https://apiqa.stackfactor.ai/";
|
|
37
|
+
case "production":
|
|
38
|
+
return "https://api.stackfactor.ai/";
|
|
39
|
+
case "security":
|
|
40
|
+
return "https://csapi.stackfactor.ai/";
|
|
41
|
+
default:
|
|
42
|
+
throw new Error("Invalid environment");
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Remove null properties
|
|
48
|
+
* @param {Object} object
|
|
49
|
+
* @returns {Object}
|
|
50
|
+
*/
|
|
51
|
+
const removeNullProperties = (object) => {
|
|
52
|
+
Object.keys(object).forEach((key) => {
|
|
53
|
+
let value = object[key];
|
|
54
|
+
let hasProperties = value && Object.keys(value).length > 0;
|
|
55
|
+
if (value === null) {
|
|
56
|
+
delete object[key];
|
|
57
|
+
}
|
|
58
|
+
else if (typeof value !== "string" && hasProperties) {
|
|
59
|
+
removeNullProperties(value);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
return object;
|
|
63
|
+
};
|
|
64
|
+
const utils = { getBaseUrl, objectToArray, removeNullProperties };
|
|
65
|
+
exports.default = utils;
|