@stackfactor/client-api 1.1.129 → 1.1.131
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/config.js +63 -0
- package/dist/constants.js +94 -0
- package/dist/dashboard.js +74 -0
- package/dist/departmentTrainingPlans.js +154 -0
- package/dist/groups.js +273 -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/exports.ts +32 -32
- package/index.d.ts +1 -0
- package/index.ts +1 -1
- package/package.json +12 -8
- package/tsconfig.json +12 -0
- /package/{lib → src/lib}/actionNotifications.ts +0 -0
- /package/{lib → src/lib}/address.ts +0 -0
- /package/{lib → src/lib}/aiAssistant.ts +0 -0
- /package/{lib → src/lib}/avatar.ts +0 -0
- /package/{lib → src/lib}/axiosClient.ts +0 -0
- /package/{lib → src/lib}/config.ts +0 -0
- /package/{lib → src/lib}/constants.ts +0 -0
- /package/{lib → src/lib}/dashboard.ts +0 -0
- /package/{lib → src/lib}/departmentTrainingPlans.ts +0 -0
- /package/{lib → src/lib}/groups.ts +0 -0
- /package/{lib → src/lib}/integration.ts +0 -0
- /package/{lib → src/lib}/integrationConfiguration.ts +0 -0
- /package/{lib → src/lib}/integrations/contentGenerator.ts +0 -0
- /package/{lib → src/lib}/learningContent.ts +0 -0
- /package/{lib → src/lib}/learningPath.ts +0 -0
- /package/{lib → src/lib}/logger.ts +0 -0
- /package/{lib → src/lib}/microSkillsQuizes.ts +0 -0
- /package/{lib → src/lib}/quotas.ts +0 -0
- /package/{lib → src/lib}/role.ts +0 -0
- /package/{lib → src/lib}/roleTemplate.ts +0 -0
- /package/{lib → src/lib}/security.ts +0 -0
- /package/{lib → src/lib}/skill.ts +0 -0
- /package/{lib → src/lib}/skillAssessmentTestingSession.ts +0 -0
- /package/{lib → src/lib}/skillAssessments.ts +0 -0
- /package/{lib → src/lib}/skillTemplate.ts +0 -0
- /package/{lib → src/lib}/talentTransfromation.ts +0 -0
- /package/{lib → src/lib}/teams.ts +0 -0
- /package/{lib → src/lib}/tenants.ts +0 -0
- /package/{lib → src/lib}/trainingPlans.ts +0 -0
- /package/{lib → src/lib}/trainingPlansProficiencyLevels.ts +0 -0
- /package/{lib → src/lib}/userInformation.ts +0 -0
- /package/{lib → src/lib}/users.ts +0 -0
- /package/{lib → src/lib}/utils.ts +0 -0
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;
|
package/exports.ts
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import actionNotifications from "./lib/actionNotifications.
|
|
1
|
+
import actionNotifications from "./src/lib/actionNotifications.ts";
|
|
2
2
|
import {
|
|
3
3
|
client,
|
|
4
4
|
errorToString,
|
|
5
5
|
getErrorInformation,
|
|
6
6
|
getErrorType,
|
|
7
7
|
shouldReturnError,
|
|
8
|
-
} from "./lib/axiosClient.
|
|
9
|
-
import aiAssistant from "./lib/aiAssistant.
|
|
10
|
-
import avatar from "./lib/avatar.
|
|
11
|
-
import address from "./lib/address.
|
|
12
|
-
import config from "./lib/config.
|
|
8
|
+
} from "./src/lib/axiosClient.ts";
|
|
9
|
+
import aiAssistant from "./src/lib/aiAssistant.ts";
|
|
10
|
+
import avatar from "./src/lib/avatar.ts";
|
|
11
|
+
import address from "./src/lib/address.ts";
|
|
12
|
+
import config from "./src/lib/config.ts";
|
|
13
13
|
import {
|
|
14
14
|
DOCUMENT_VERSION,
|
|
15
15
|
PERMISSIONS,
|
|
16
16
|
PERMISSION_DESCRIPTIONS,
|
|
17
17
|
RESPONSE_TYPE,
|
|
18
|
-
} from "./lib/constants.
|
|
19
|
-
import contentGenerator from "./lib/integrations/contentGenerator.
|
|
20
|
-
import dashboard from "./lib/dashboard.
|
|
21
|
-
import departmentTraingPlans from "./lib/departmentTrainingPlans.
|
|
22
|
-
import integration from "./lib/integration.
|
|
23
|
-
import integrationConfiguration from "./lib/integrationConfiguration.
|
|
24
|
-
import groups from "./lib/groups.
|
|
25
|
-
import learningContent from "./lib/learningContent.
|
|
26
|
-
import learningPath from "./lib/learningPath.
|
|
27
|
-
import logger from "./lib/logger.
|
|
28
|
-
import microSkillsQuizes from "./lib/microSkillsQuizes.
|
|
29
|
-
import quotas from "./lib/quotas.
|
|
30
|
-
import role from "./lib/role.
|
|
31
|
-
import roleTemplate from "./lib/roleTemplate.
|
|
32
|
-
import security from "./lib/security.
|
|
33
|
-
import skill from "./lib/skill.
|
|
34
|
-
import skillAssessment from "./lib/skillAssessments.
|
|
35
|
-
import skillAssessmentTestingSession from "./lib/skillAssessmentTestingSession.
|
|
36
|
-
import skillTemplate from "./lib/skillTemplate.
|
|
37
|
-
import talentTransfromation from "./lib/talentTransfromation.
|
|
38
|
-
import team from "./lib/teams.
|
|
39
|
-
import tenant from "./lib/tenants.
|
|
40
|
-
import trainingPlan from "./lib/trainingPlans.
|
|
41
|
-
import trainingPlanProficiencyLevel from "./lib/trainingPlansProficiencyLevels.
|
|
42
|
-
import userInformation from "./lib/userInformation.
|
|
43
|
-
import users from "./lib/users.
|
|
18
|
+
} from "./src/lib/constants.ts";
|
|
19
|
+
import contentGenerator from "./src/lib/integrations/contentGenerator.ts";
|
|
20
|
+
import dashboard from "./src/lib/dashboard.ts";
|
|
21
|
+
import departmentTraingPlans from "./src/lib/departmentTrainingPlans.ts";
|
|
22
|
+
import integration from "./src/lib/integration.ts";
|
|
23
|
+
import integrationConfiguration from "./src/lib/integrationConfiguration.ts";
|
|
24
|
+
import groups from "./src/lib/groups.ts";
|
|
25
|
+
import learningContent from "./src/lib/learningContent.ts";
|
|
26
|
+
import learningPath from "./src/lib/learningPath.ts";
|
|
27
|
+
import logger from "./src/lib/logger.ts";
|
|
28
|
+
import microSkillsQuizes from "./src/lib/microSkillsQuizes.ts";
|
|
29
|
+
import quotas from "./src/lib/quotas.ts";
|
|
30
|
+
import role from "./src/lib/role.ts";
|
|
31
|
+
import roleTemplate from "./src/lib/roleTemplate.ts";
|
|
32
|
+
import security from "./src/lib/security.ts";
|
|
33
|
+
import skill from "./src/lib/skill.ts";
|
|
34
|
+
import skillAssessment from "./src/lib/skillAssessments.ts";
|
|
35
|
+
import skillAssessmentTestingSession from "./src/lib/skillAssessmentTestingSession.ts";
|
|
36
|
+
import skillTemplate from "./src/lib/skillTemplate.ts";
|
|
37
|
+
import talentTransfromation from "./src/lib/talentTransfromation.ts";
|
|
38
|
+
import team from "./src/lib/teams.ts";
|
|
39
|
+
import tenant from "./src/lib/tenants.ts";
|
|
40
|
+
import trainingPlan from "./src/lib/trainingPlans.ts";
|
|
41
|
+
import trainingPlanProficiencyLevel from "./src/lib/trainingPlansProficiencyLevels.ts";
|
|
42
|
+
import userInformation from "./src/lib/userInformation.ts";
|
|
43
|
+
import users from "./src/lib/users.ts";
|
|
44
44
|
|
|
45
45
|
export {
|
|
46
46
|
actionNotifications,
|
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module "html2plaintext";
|
package/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./exports.
|
|
1
|
+
export * from "./exports.ts";
|
package/package.json
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackfactor/client-api",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.131",
|
|
4
4
|
"description": "Node.js library for the StackFactor API",
|
|
5
|
-
"main": "index.js",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
6
7
|
"exports": {
|
|
7
8
|
".": {
|
|
8
|
-
"require": "./index.
|
|
9
|
-
"import": "./index.
|
|
10
|
-
"default": "./index.
|
|
9
|
+
"require": "./index.ts",
|
|
10
|
+
"import": "./index.ts",
|
|
11
|
+
"default": "./index.ts"
|
|
11
12
|
}
|
|
12
13
|
},
|
|
13
14
|
"type": "module",
|
|
14
15
|
"scripts": {
|
|
15
|
-
"lint": "eslint lib/**/*.
|
|
16
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
16
|
+
"lint": "eslint lib/**/*.ts",
|
|
17
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
18
|
+
"build": "tsc",
|
|
19
|
+
"prepublishOnly": "npm run build"
|
|
17
20
|
},
|
|
18
21
|
"repository": {
|
|
19
22
|
"type": "git",
|
|
@@ -36,6 +39,7 @@
|
|
|
36
39
|
"@types/axios": "^0.14.4",
|
|
37
40
|
"@types/node": "^22.13.5",
|
|
38
41
|
"eslint": "^8.57.0",
|
|
39
|
-
"eslint-plugin-react": "^7.34.0"
|
|
42
|
+
"eslint-plugin-react": "^7.34.0",
|
|
43
|
+
"typescript": "^5.7.3"
|
|
40
44
|
}
|
|
41
45
|
}
|
package/tsconfig.json
ADDED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{lib → src/lib}/role.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|