@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.
Files changed (71) hide show
  1. package/dist/actionNotifications.js +73 -0
  2. package/dist/address.js +22 -0
  3. package/dist/aiAssistant.js +134 -0
  4. package/dist/avatar.js +32 -0
  5. package/dist/axiosClient.js +89 -0
  6. package/dist/config.js +63 -0
  7. package/dist/constants.js +94 -0
  8. package/dist/dashboard.js +74 -0
  9. package/dist/departmentTrainingPlans.js +154 -0
  10. package/dist/groups.js +273 -0
  11. package/dist/integration.js +319 -0
  12. package/dist/integrationConfiguration.js +86 -0
  13. package/dist/integrations/contentGenerator.js +70 -0
  14. package/dist/learningContent.js +394 -0
  15. package/dist/learningPath.js +205 -0
  16. package/dist/logger.js +57 -0
  17. package/dist/microSkillsQuizes.js +53 -0
  18. package/dist/quotas.js +50 -0
  19. package/dist/role.js +363 -0
  20. package/dist/roleTemplate.js +236 -0
  21. package/dist/security.js +79 -0
  22. package/dist/skill.js +439 -0
  23. package/dist/skillAssessmentTestingSession.js +156 -0
  24. package/dist/skillAssessments.js +156 -0
  25. package/dist/skillTemplate.js +281 -0
  26. package/dist/talentTransfromation.js +100 -0
  27. package/dist/teams.js +252 -0
  28. package/dist/tenants.js +52 -0
  29. package/dist/trainingPlans.js +308 -0
  30. package/dist/trainingPlansProficiencyLevels.js +98 -0
  31. package/dist/userInformation.js +81 -0
  32. package/dist/users.js +694 -0
  33. package/dist/utils.js +65 -0
  34. package/exports.ts +32 -32
  35. package/index.d.ts +1 -0
  36. package/index.ts +1 -1
  37. package/package.json +12 -8
  38. package/tsconfig.json +12 -0
  39. /package/{lib → src/lib}/actionNotifications.ts +0 -0
  40. /package/{lib → src/lib}/address.ts +0 -0
  41. /package/{lib → src/lib}/aiAssistant.ts +0 -0
  42. /package/{lib → src/lib}/avatar.ts +0 -0
  43. /package/{lib → src/lib}/axiosClient.ts +0 -0
  44. /package/{lib → src/lib}/config.ts +0 -0
  45. /package/{lib → src/lib}/constants.ts +0 -0
  46. /package/{lib → src/lib}/dashboard.ts +0 -0
  47. /package/{lib → src/lib}/departmentTrainingPlans.ts +0 -0
  48. /package/{lib → src/lib}/groups.ts +0 -0
  49. /package/{lib → src/lib}/integration.ts +0 -0
  50. /package/{lib → src/lib}/integrationConfiguration.ts +0 -0
  51. /package/{lib → src/lib}/integrations/contentGenerator.ts +0 -0
  52. /package/{lib → src/lib}/learningContent.ts +0 -0
  53. /package/{lib → src/lib}/learningPath.ts +0 -0
  54. /package/{lib → src/lib}/logger.ts +0 -0
  55. /package/{lib → src/lib}/microSkillsQuizes.ts +0 -0
  56. /package/{lib → src/lib}/quotas.ts +0 -0
  57. /package/{lib → src/lib}/role.ts +0 -0
  58. /package/{lib → src/lib}/roleTemplate.ts +0 -0
  59. /package/{lib → src/lib}/security.ts +0 -0
  60. /package/{lib → src/lib}/skill.ts +0 -0
  61. /package/{lib → src/lib}/skillAssessmentTestingSession.ts +0 -0
  62. /package/{lib → src/lib}/skillAssessments.ts +0 -0
  63. /package/{lib → src/lib}/skillTemplate.ts +0 -0
  64. /package/{lib → src/lib}/talentTransfromation.ts +0 -0
  65. /package/{lib → src/lib}/teams.ts +0 -0
  66. /package/{lib → src/lib}/tenants.ts +0 -0
  67. /package/{lib → src/lib}/trainingPlans.ts +0 -0
  68. /package/{lib → src/lib}/trainingPlansProficiencyLevels.ts +0 -0
  69. /package/{lib → src/lib}/userInformation.ts +0 -0
  70. /package/{lib → src/lib}/users.ts +0 -0
  71. /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.js";
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.js";
9
- import aiAssistant from "./lib/aiAssistant.js";
10
- import avatar from "./lib/avatar.js";
11
- import address from "./lib/address.js";
12
- import config from "./lib/config.js";
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.js";
19
- import contentGenerator from "./lib/integrations/contentGenerator.js";
20
- import dashboard from "./lib/dashboard.js";
21
- import departmentTraingPlans from "./lib/departmentTrainingPlans.js";
22
- import integration from "./lib/integration.js";
23
- import integrationConfiguration from "./lib/integrationConfiguration.js";
24
- import groups from "./lib/groups.js";
25
- import learningContent from "./lib/learningContent.js";
26
- import learningPath from "./lib/learningPath.js";
27
- import logger from "./lib/logger.js";
28
- import microSkillsQuizes from "./lib/microSkillsQuizes.js";
29
- import quotas from "./lib/quotas.js";
30
- import role from "./lib/role.js";
31
- import roleTemplate from "./lib/roleTemplate.js";
32
- import security from "./lib/security.js";
33
- import skill from "./lib/skill.js";
34
- import skillAssessment from "./lib/skillAssessments.js";
35
- import skillAssessmentTestingSession from "./lib/skillAssessmentTestingSession.js";
36
- import skillTemplate from "./lib/skillTemplate.js";
37
- import talentTransfromation from "./lib/talentTransfromation.js";
38
- import team from "./lib/teams.js";
39
- import tenant from "./lib/tenants.js";
40
- import trainingPlan from "./lib/trainingPlans.js";
41
- import trainingPlanProficiencyLevel from "./lib/trainingPlansProficiencyLevels.js";
42
- import userInformation from "./lib/userInformation.js";
43
- import users from "./lib/users.js";
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.js";
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.129",
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.js",
9
- "import": "./index.js",
10
- "default": "./index.js"
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/**/*.js",
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
@@ -0,0 +1,12 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES6",
4
+ "module": "commonjs",
5
+ "strict": true,
6
+ "esModuleInterop": true,
7
+ "skipLibCheck": true,
8
+ "forceConsistentCasingInFileNames": true,
9
+ "outDir": "./dist"
10
+ },
11
+ "include": ["src/**/*", "index.d.ts"]
12
+ }
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
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