@stackfactor/client-api 1.1.222 → 1.1.223
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/LICENSE +21 -21
- package/README.md +138 -138
- package/declarations/axios.d.ts +1 -1
- package/package.json +57 -55
- package/dist/esm/src/lib/actionNotifications.d.ts +0 -24
- package/dist/esm/src/lib/actionNotifications.d.ts.map +0 -1
- package/dist/esm/src/lib/actionNotifications.js +0 -67
- package/dist/esm/src/lib/actionNotifications.js.map +0 -1
- package/dist/esm/src/lib/address.d.ts +0 -8
- package/dist/esm/src/lib/address.d.ts.map +0 -1
- package/dist/esm/src/lib/address.js +0 -20
- package/dist/esm/src/lib/address.js.map +0 -1
- package/dist/esm/src/lib/aiAssistant.d.ts +0 -42
- package/dist/esm/src/lib/aiAssistant.d.ts.map +0 -1
- package/dist/esm/src/lib/aiAssistant.js +0 -126
- package/dist/esm/src/lib/aiAssistant.js.map +0 -1
- package/dist/esm/src/lib/avatar.d.ts +0 -12
- package/dist/esm/src/lib/avatar.d.ts.map +0 -1
- package/dist/esm/src/lib/avatar.js +0 -29
- package/dist/esm/src/lib/avatar.js.map +0 -1
- package/dist/esm/src/lib/axiosClient.d.ts +0 -30
- package/dist/esm/src/lib/axiosClient.d.ts.map +0 -1
- package/dist/esm/src/lib/axiosClient.js +0 -88
- package/dist/esm/src/lib/axiosClient.js.map +0 -1
- package/dist/esm/src/lib/config.d.ts +0 -23
- package/dist/esm/src/lib/config.d.ts.map +0 -1
- package/dist/esm/src/lib/config.js +0 -57
- package/dist/esm/src/lib/config.js.map +0 -1
- package/dist/esm/src/lib/constants.d.ts +0 -69
- package/dist/esm/src/lib/constants.d.ts.map +0 -1
- package/dist/esm/src/lib/constants.js +0 -89
- package/dist/esm/src/lib/constants.js.map +0 -1
- package/dist/esm/src/lib/control.d.ts +0 -103
- package/dist/esm/src/lib/control.d.ts.map +0 -1
- package/dist/esm/src/lib/control.js +0 -308
- package/dist/esm/src/lib/control.js.map +0 -1
- package/dist/esm/src/lib/controlTemplate.d.ts +0 -66
- package/dist/esm/src/lib/controlTemplate.d.ts.map +0 -1
- package/dist/esm/src/lib/controlTemplate.js +0 -200
- package/dist/esm/src/lib/controlTemplate.js.map +0 -1
- package/dist/esm/src/lib/customFields.d.ts +0 -9
- package/dist/esm/src/lib/customFields.d.ts.map +0 -1
- package/dist/esm/src/lib/customFields.js +0 -22
- package/dist/esm/src/lib/customFields.js.map +0 -1
- package/dist/esm/src/lib/dashboard.d.ts +0 -23
- package/dist/esm/src/lib/dashboard.d.ts.map +0 -1
- package/dist/esm/src/lib/dashboard.js +0 -68
- package/dist/esm/src/lib/dashboard.js.map +0 -1
- package/dist/esm/src/lib/departmentTrainingPlans.d.ts +0 -53
- package/dist/esm/src/lib/departmentTrainingPlans.d.ts.map +0 -1
- package/dist/esm/src/lib/departmentTrainingPlans.js +0 -144
- package/dist/esm/src/lib/departmentTrainingPlans.js.map +0 -1
- package/dist/esm/src/lib/groups.d.ts +0 -90
- package/dist/esm/src/lib/groups.d.ts.map +0 -1
- package/dist/esm/src/lib/groups.js +0 -258
- package/dist/esm/src/lib/groups.js.map +0 -1
- package/dist/esm/src/lib/index.d.ts +0 -46
- package/dist/esm/src/lib/index.d.ts.map +0 -1
- package/dist/esm/src/lib/index.js +0 -45
- package/dist/esm/src/lib/index.js.map +0 -1
- package/dist/esm/src/lib/integration.d.ts +0 -83
- package/dist/esm/src/lib/integration.d.ts.map +0 -1
- package/dist/esm/src/lib/integration.js +0 -300
- package/dist/esm/src/lib/integration.js.map +0 -1
- package/dist/esm/src/lib/integrationConfiguration.d.ts +0 -27
- package/dist/esm/src/lib/integrationConfiguration.d.ts.map +0 -1
- package/dist/esm/src/lib/integrationConfiguration.js +0 -80
- package/dist/esm/src/lib/integrationConfiguration.js.map +0 -1
- package/dist/esm/src/lib/integrations/contentGenerator.d.ts +0 -26
- package/dist/esm/src/lib/integrations/contentGenerator.d.ts.map +0 -1
- package/dist/esm/src/lib/integrations/contentGenerator.js +0 -88
- package/dist/esm/src/lib/integrations/contentGenerator.js.map +0 -1
- package/dist/esm/src/lib/labSessions.d.ts +0 -54
- package/dist/esm/src/lib/labSessions.d.ts.map +0 -1
- package/dist/esm/src/lib/labSessions.js +0 -168
- package/dist/esm/src/lib/labSessions.js.map +0 -1
- package/dist/esm/src/lib/learningContent.d.ts +0 -213
- package/dist/esm/src/lib/learningContent.d.ts.map +0 -1
- package/dist/esm/src/lib/learningContent.js +0 -690
- package/dist/esm/src/lib/learningContent.js.map +0 -1
- package/dist/esm/src/lib/learningPath.d.ts +0 -64
- package/dist/esm/src/lib/learningPath.d.ts.map +0 -1
- package/dist/esm/src/lib/learningPath.js +0 -194
- package/dist/esm/src/lib/learningPath.js.map +0 -1
- package/dist/esm/src/lib/logger.d.ts +0 -19
- package/dist/esm/src/lib/logger.d.ts.map +0 -1
- package/dist/esm/src/lib/logger.js +0 -55
- package/dist/esm/src/lib/logger.js.map +0 -1
- package/dist/esm/src/lib/microSkillsQuizes.d.ts +0 -18
- package/dist/esm/src/lib/microSkillsQuizes.d.ts.map +0 -1
- package/dist/esm/src/lib/microSkillsQuizes.js +0 -48
- package/dist/esm/src/lib/microSkillsQuizes.js.map +0 -1
- package/dist/esm/src/lib/policy.d.ts +0 -103
- package/dist/esm/src/lib/policy.d.ts.map +0 -1
- package/dist/esm/src/lib/policy.js +0 -308
- package/dist/esm/src/lib/policy.js.map +0 -1
- package/dist/esm/src/lib/policyTemplate.d.ts +0 -66
- package/dist/esm/src/lib/policyTemplate.d.ts.map +0 -1
- package/dist/esm/src/lib/policyTemplate.js +0 -200
- package/dist/esm/src/lib/policyTemplate.js.map +0 -1
- package/dist/esm/src/lib/quotas.d.ts +0 -15
- package/dist/esm/src/lib/quotas.d.ts.map +0 -1
- package/dist/esm/src/lib/quotas.js +0 -45
- package/dist/esm/src/lib/quotas.js.map +0 -1
- package/dist/esm/src/lib/reports.d.ts +0 -47
- package/dist/esm/src/lib/reports.d.ts.map +0 -1
- package/dist/esm/src/lib/reports.js +0 -87
- package/dist/esm/src/lib/reports.js.map +0 -1
- package/dist/esm/src/lib/requirement.d.ts +0 -103
- package/dist/esm/src/lib/requirement.d.ts.map +0 -1
- package/dist/esm/src/lib/requirement.js +0 -308
- package/dist/esm/src/lib/requirement.js.map +0 -1
- package/dist/esm/src/lib/requirementTemplate.d.ts +0 -66
- package/dist/esm/src/lib/requirementTemplate.d.ts.map +0 -1
- package/dist/esm/src/lib/requirementTemplate.js +0 -200
- package/dist/esm/src/lib/requirementTemplate.js.map +0 -1
- package/dist/esm/src/lib/role.d.ts +0 -119
- package/dist/esm/src/lib/role.d.ts.map +0 -1
- package/dist/esm/src/lib/role.js +0 -393
- package/dist/esm/src/lib/role.js.map +0 -1
- package/dist/esm/src/lib/roleTemplate.d.ts +0 -73
- package/dist/esm/src/lib/roleTemplate.d.ts.map +0 -1
- package/dist/esm/src/lib/roleTemplate.js +0 -224
- package/dist/esm/src/lib/roleTemplate.js.map +0 -1
- package/dist/esm/src/lib/security.d.ts +0 -27
- package/dist/esm/src/lib/security.d.ts.map +0 -1
- package/dist/esm/src/lib/security.js +0 -72
- package/dist/esm/src/lib/security.js.map +0 -1
- package/dist/esm/src/lib/skill.d.ts +0 -141
- package/dist/esm/src/lib/skill.d.ts.map +0 -1
- package/dist/esm/src/lib/skill.js +0 -418
- package/dist/esm/src/lib/skill.js.map +0 -1
- package/dist/esm/src/lib/skillAssessmentTestingSession.d.ts +0 -85
- package/dist/esm/src/lib/skillAssessmentTestingSession.d.ts.map +0 -1
- package/dist/esm/src/lib/skillAssessmentTestingSession.js +0 -261
- package/dist/esm/src/lib/skillAssessmentTestingSession.js.map +0 -1
- package/dist/esm/src/lib/skillAssessments.d.ts +0 -49
- package/dist/esm/src/lib/skillAssessments.d.ts.map +0 -1
- package/dist/esm/src/lib/skillAssessments.js +0 -147
- package/dist/esm/src/lib/skillAssessments.js.map +0 -1
- package/dist/esm/src/lib/skillTemplate.d.ts +0 -87
- package/dist/esm/src/lib/skillTemplate.d.ts.map +0 -1
- package/dist/esm/src/lib/skillTemplate.js +0 -267
- package/dist/esm/src/lib/skillTemplate.js.map +0 -1
- package/dist/esm/src/lib/socketError.d.ts +0 -22
- package/dist/esm/src/lib/socketError.d.ts.map +0 -1
- package/dist/esm/src/lib/socketError.js +0 -12
- package/dist/esm/src/lib/socketError.js.map +0 -1
- package/dist/esm/src/lib/standard.d.ts +0 -103
- package/dist/esm/src/lib/standard.d.ts.map +0 -1
- package/dist/esm/src/lib/standard.js +0 -308
- package/dist/esm/src/lib/standard.js.map +0 -1
- package/dist/esm/src/lib/standardTemplate.d.ts +0 -66
- package/dist/esm/src/lib/standardTemplate.d.ts.map +0 -1
- package/dist/esm/src/lib/standardTemplate.js +0 -200
- package/dist/esm/src/lib/standardTemplate.js.map +0 -1
- package/dist/esm/src/lib/talentTransfromation.d.ts +0 -29
- package/dist/esm/src/lib/talentTransfromation.d.ts.map +0 -1
- package/dist/esm/src/lib/talentTransfromation.js +0 -93
- package/dist/esm/src/lib/talentTransfromation.js.map +0 -1
- package/dist/esm/src/lib/teams.d.ts +0 -92
- package/dist/esm/src/lib/teams.d.ts.map +0 -1
- package/dist/esm/src/lib/teams.js +0 -258
- package/dist/esm/src/lib/teams.js.map +0 -1
- package/dist/esm/src/lib/tenants.d.ts +0 -22
- package/dist/esm/src/lib/tenants.d.ts.map +0 -1
- package/dist/esm/src/lib/tenants.js +0 -67
- package/dist/esm/src/lib/tenants.js.map +0 -1
- package/dist/esm/src/lib/trainingPlans.d.ts +0 -96
- package/dist/esm/src/lib/trainingPlans.d.ts.map +0 -1
- package/dist/esm/src/lib/trainingPlans.js +0 -315
- package/dist/esm/src/lib/trainingPlans.js.map +0 -1
- package/dist/esm/src/lib/trainingPlansProficiencyLevels.d.ts +0 -32
- package/dist/esm/src/lib/trainingPlansProficiencyLevels.d.ts.map +0 -1
- package/dist/esm/src/lib/trainingPlansProficiencyLevels.js +0 -90
- package/dist/esm/src/lib/trainingPlansProficiencyLevels.js.map +0 -1
- package/dist/esm/src/lib/userInformation.d.ts +0 -29
- package/dist/esm/src/lib/userInformation.d.ts.map +0 -1
- package/dist/esm/src/lib/userInformation.js +0 -75
- package/dist/esm/src/lib/userInformation.js.map +0 -1
- package/dist/esm/src/lib/users.d.ts +0 -206
- package/dist/esm/src/lib/users.d.ts.map +0 -1
- package/dist/esm/src/lib/users.js +0 -663
- package/dist/esm/src/lib/users.js.map +0 -1
- package/dist/esm/src/lib/utils.d.ts +0 -14
- package/dist/esm/src/lib/utils.d.ts.map +0 -1
- package/dist/esm/src/lib/utils.js +0 -51
- package/dist/esm/src/lib/utils.js.map +0 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
Creative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)
|
|
2
|
-
|
|
3
|
-
You are free to:
|
|
4
|
-
|
|
5
|
-
Share — copy and redistribute the material in any medium or format
|
|
6
|
-
for any purpose, even commercially.
|
|
7
|
-
|
|
8
|
-
Under the following terms:
|
|
9
|
-
|
|
10
|
-
Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
|
|
11
|
-
|
|
12
|
-
NoDerivatives — If you remix, transform, or build upon the material, you may not distribute the modified material.
|
|
13
|
-
|
|
14
|
-
No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
|
|
15
|
-
|
|
16
|
-
Notices:
|
|
17
|
-
You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation.
|
|
18
|
-
No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.
|
|
19
|
-
|
|
20
|
-
For the full license text, see:
|
|
21
|
-
https://creativecommons.org/licenses/by-nd/4.0/legalcode
|
|
1
|
+
Creative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)
|
|
2
|
+
|
|
3
|
+
You are free to:
|
|
4
|
+
|
|
5
|
+
Share — copy and redistribute the material in any medium or format
|
|
6
|
+
for any purpose, even commercially.
|
|
7
|
+
|
|
8
|
+
Under the following terms:
|
|
9
|
+
|
|
10
|
+
Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
|
|
11
|
+
|
|
12
|
+
NoDerivatives — If you remix, transform, or build upon the material, you may not distribute the modified material.
|
|
13
|
+
|
|
14
|
+
No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
|
|
15
|
+
|
|
16
|
+
Notices:
|
|
17
|
+
You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation.
|
|
18
|
+
No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.
|
|
19
|
+
|
|
20
|
+
For the full license text, see:
|
|
21
|
+
https://creativecommons.org/licenses/by-nd/4.0/legalcode
|
package/README.md
CHANGED
|
@@ -1,138 +1,138 @@
|
|
|
1
|
-
# @stackfactor/client-api
|
|
2
|
-
|
|
3
|
-
A TypeScript/JavaScript client library for interacting with the StackFactor API. This package provides a comprehensive set of modules for managing users, skills, roles, teams, training plans, assessments, and more — designed for use in web and Node.js applications.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- **User Management** — account creation, authentication (login, logout, token refresh), API tokens, invitations, email/phone confirmation, password reset
|
|
8
|
-
- **Skills & Roles** — create, publish, import from templates, assign to users
|
|
9
|
-
- **Teams & Groups** — create and manage organizational structures
|
|
10
|
-
- **Training Plans** — create, publish, archive, manage proficiency levels and activities
|
|
11
|
-
- **Skill Assessments** — create assessments, manage testing sessions
|
|
12
|
-
- **AI Assistant** — start conversations, ask questions, voice assistant
|
|
13
|
-
- **Content Generation** — synchronous and asynchronous AI-powered content generation
|
|
14
|
-
- **Learning Content & Paths** — author and manage learning materials
|
|
15
|
-
- **Dashboard, Notifications, Security** — configurable dashboard cards, action notifications, auth connections and MFA
|
|
16
|
-
|
|
17
|
-
## Installation
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
npm install @stackfactor/client-api
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Usage
|
|
24
|
-
|
|
25
|
-
Import the modules you need from the library:
|
|
26
|
-
|
|
27
|
-
```typescript
|
|
28
|
-
import { users, skill, role, team, address } from "@stackfactor/client-api";
|
|
29
|
-
|
|
30
|
-
// Login
|
|
31
|
-
users
|
|
32
|
-
.login("user@example.com", "password")
|
|
33
|
-
.then((data) => console.log(data))
|
|
34
|
-
.catch((err) => console.error(err));
|
|
35
|
-
|
|
36
|
-
// Create a skill
|
|
37
|
-
skill
|
|
38
|
-
.createSkill({ name: "TypeScript" }, authToken)
|
|
39
|
-
.then((result) => console.log(result));
|
|
40
|
-
|
|
41
|
-
// Address autocomplete
|
|
42
|
-
address
|
|
43
|
-
.autoComplete("123 Main St", authToken)
|
|
44
|
-
.then((result) => console.log(result));
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Available Modules
|
|
48
|
-
|
|
49
|
-
| Import Name | Description |
|
|
50
|
-
| ------------------------------- | ------------------------------------- |
|
|
51
|
-
| `actionNotifications` | User action notifications |
|
|
52
|
-
| `address` | Address validation and autocomplete |
|
|
53
|
-
| `aiAssistant` | AI assistant conversations and voice |
|
|
54
|
-
| `avatar` | User and element avatars |
|
|
55
|
-
| `client` | Configured Axios HTTP client instance |
|
|
56
|
-
| `config` | Platform configuration |
|
|
57
|
-
| `contentGenerator` | AI-powered content generation |
|
|
58
|
-
| `customFields` | Custom field definitions |
|
|
59
|
-
| `dashboard` | Dashboard card management |
|
|
60
|
-
| `departmentTraingPlans` | Department training plans |
|
|
61
|
-
| `groups` | User group management |
|
|
62
|
-
| `integration` | Integration management |
|
|
63
|
-
| `integrationConfiguration` | Integration configuration |
|
|
64
|
-
| `learningContent` | Learning content authoring |
|
|
65
|
-
| `learningPath` | Learning path management |
|
|
66
|
-
| `logger` | Logging utilities |
|
|
67
|
-
| `microSkillsQuizes` | Micro-skill quiz management |
|
|
68
|
-
| `quotas` | Usage quotas |
|
|
69
|
-
| `role` | Role management |
|
|
70
|
-
| `roleTemplate` | Role template management |
|
|
71
|
-
| `security` | Auth connections, MFA, Auth0 sync |
|
|
72
|
-
| `skill` | Skill management |
|
|
73
|
-
| `skillAssessment` | Skill assessment management |
|
|
74
|
-
| `skillAssessmentTestingSession` | Assessment testing sessions |
|
|
75
|
-
| `skillTemplate` | Skill template management |
|
|
76
|
-
| `talentTransfromation` | Talent transformation tracking |
|
|
77
|
-
| `team` | Team management |
|
|
78
|
-
| `tenant` | Tenant settings |
|
|
79
|
-
| `trainingPlan` | Training plan management |
|
|
80
|
-
| `trainingPlanProficiencyLevel` | Training plan proficiency levels |
|
|
81
|
-
| `userInformation` | User business profile properties |
|
|
82
|
-
| `users` | User accounts and authentication |
|
|
83
|
-
|
|
84
|
-
Constants `DOCUMENT_VERSION`, `RESPONSE_TYPE`, `PERMISSIONS`, and `PERMISSION_DESCRIPTIONS` are also exported directly.
|
|
85
|
-
|
|
86
|
-
Utility functions `errorToString`, `getErrorType`, `getErrorInformation`, and `shouldReturnError` are exported at the top level for Axios error handling.
|
|
87
|
-
|
|
88
|
-
## Documentation
|
|
89
|
-
|
|
90
|
-
Full method-level documentation for each module is available in the [doc/](doc/) folder:
|
|
91
|
-
|
|
92
|
-
- [Action Notifications](doc/actionNotifications.md)
|
|
93
|
-
- [Address](doc/address.md)
|
|
94
|
-
- [AI Assistant](doc/aiAssistant.md)
|
|
95
|
-
- [Avatar](doc/avatar.md)
|
|
96
|
-
- [Axios Client](doc/axiosClient.md)
|
|
97
|
-
- [Config](doc/config.md)
|
|
98
|
-
- [Constants](doc/constants.md)
|
|
99
|
-
- [Content Generator](doc/contentGenerator.md)
|
|
100
|
-
- [Custom Fields](doc/customFields.md)
|
|
101
|
-
- [Dashboard](doc/dashboard.md)
|
|
102
|
-
- [Department Training Plans](doc/departmentTrainingPlans.md)
|
|
103
|
-
- [Groups](doc/groups.md)
|
|
104
|
-
- [Integration](doc/integration.md)
|
|
105
|
-
- [Integration Configuration](doc/integrationConfiguration.md)
|
|
106
|
-
- [Learning Content](doc/learningContent.md)
|
|
107
|
-
- [Learning Path](doc/learningPath.md)
|
|
108
|
-
- [Logger](doc/logger.md)
|
|
109
|
-
- [Micro Skills Quizzes](doc/microSkillsQuizes.md)
|
|
110
|
-
- [Quotas](doc/quotas.md)
|
|
111
|
-
- [Role](doc/role.md)
|
|
112
|
-
- [Role Template](doc/roleTemplate.md)
|
|
113
|
-
- [Security](doc/security.md)
|
|
114
|
-
- [Skill](doc/skill.md)
|
|
115
|
-
- [Skill Assessments](doc/skillAssessments.md)
|
|
116
|
-
- [Skill Assessment Testing Session](doc/skillAssessmentTestingSession.md)
|
|
117
|
-
- [Skill Template](doc/skillTemplate.md)
|
|
118
|
-
- [Talent Transformation](doc/talentTransfromation.md)
|
|
119
|
-
- [Teams](doc/teams.md)
|
|
120
|
-
- [Tenants](doc/tenants.md)
|
|
121
|
-
- [Training Plans](doc/trainingPlans.md)
|
|
122
|
-
- [Training Plans Proficiency Levels](doc/trainingPlansProficiencyLevels.md)
|
|
123
|
-
- [User Information](doc/userInformation.md)
|
|
124
|
-
- [Users](doc/users.md)
|
|
125
|
-
- [Utils](doc/utils.md)
|
|
126
|
-
|
|
127
|
-
## License
|
|
128
|
-
|
|
129
|
-
This package is licensed under the [Creative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)](https://creativecommons.org/licenses/by-nd/4.0/legalcode). See the [LICENSE](LICENSE) file for details.
|
|
130
|
-
|
|
131
|
-
## Support
|
|
132
|
-
|
|
133
|
-
For questions or support, open an issue in the [GitHub repository](https://github.com/StackFactor/stackfactor-client-api).
|
|
134
|
-
|
|
135
|
-
## Links
|
|
136
|
-
|
|
137
|
-
- [StackFactor Developer Resources](https://stackfactor.ai/resources/developers)
|
|
138
|
-
- [CC BY-ND 4.0 License](https://creativecommons.org/licenses/by-nd/4.0/legalcode)
|
|
1
|
+
# @stackfactor/client-api
|
|
2
|
+
|
|
3
|
+
A TypeScript/JavaScript client library for interacting with the StackFactor API. This package provides a comprehensive set of modules for managing users, skills, roles, teams, training plans, assessments, and more — designed for use in web and Node.js applications.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **User Management** — account creation, authentication (login, logout, token refresh), API tokens, invitations, email/phone confirmation, password reset
|
|
8
|
+
- **Skills & Roles** — create, publish, import from templates, assign to users
|
|
9
|
+
- **Teams & Groups** — create and manage organizational structures
|
|
10
|
+
- **Training Plans** — create, publish, archive, manage proficiency levels and activities
|
|
11
|
+
- **Skill Assessments** — create assessments, manage testing sessions
|
|
12
|
+
- **AI Assistant** — start conversations, ask questions, voice assistant
|
|
13
|
+
- **Content Generation** — synchronous and asynchronous AI-powered content generation
|
|
14
|
+
- **Learning Content & Paths** — author and manage learning materials
|
|
15
|
+
- **Dashboard, Notifications, Security** — configurable dashboard cards, action notifications, auth connections and MFA
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
npm install @stackfactor/client-api
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
Import the modules you need from the library:
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import { users, skill, role, team, address } from "@stackfactor/client-api";
|
|
29
|
+
|
|
30
|
+
// Login
|
|
31
|
+
users
|
|
32
|
+
.login("user@example.com", "password")
|
|
33
|
+
.then((data) => console.log(data))
|
|
34
|
+
.catch((err) => console.error(err));
|
|
35
|
+
|
|
36
|
+
// Create a skill
|
|
37
|
+
skill
|
|
38
|
+
.createSkill({ name: "TypeScript" }, authToken)
|
|
39
|
+
.then((result) => console.log(result));
|
|
40
|
+
|
|
41
|
+
// Address autocomplete
|
|
42
|
+
address
|
|
43
|
+
.autoComplete("123 Main St", authToken)
|
|
44
|
+
.then((result) => console.log(result));
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Available Modules
|
|
48
|
+
|
|
49
|
+
| Import Name | Description |
|
|
50
|
+
| ------------------------------- | ------------------------------------- |
|
|
51
|
+
| `actionNotifications` | User action notifications |
|
|
52
|
+
| `address` | Address validation and autocomplete |
|
|
53
|
+
| `aiAssistant` | AI assistant conversations and voice |
|
|
54
|
+
| `avatar` | User and element avatars |
|
|
55
|
+
| `client` | Configured Axios HTTP client instance |
|
|
56
|
+
| `config` | Platform configuration |
|
|
57
|
+
| `contentGenerator` | AI-powered content generation |
|
|
58
|
+
| `customFields` | Custom field definitions |
|
|
59
|
+
| `dashboard` | Dashboard card management |
|
|
60
|
+
| `departmentTraingPlans` | Department training plans |
|
|
61
|
+
| `groups` | User group management |
|
|
62
|
+
| `integration` | Integration management |
|
|
63
|
+
| `integrationConfiguration` | Integration configuration |
|
|
64
|
+
| `learningContent` | Learning content authoring |
|
|
65
|
+
| `learningPath` | Learning path management |
|
|
66
|
+
| `logger` | Logging utilities |
|
|
67
|
+
| `microSkillsQuizes` | Micro-skill quiz management |
|
|
68
|
+
| `quotas` | Usage quotas |
|
|
69
|
+
| `role` | Role management |
|
|
70
|
+
| `roleTemplate` | Role template management |
|
|
71
|
+
| `security` | Auth connections, MFA, Auth0 sync |
|
|
72
|
+
| `skill` | Skill management |
|
|
73
|
+
| `skillAssessment` | Skill assessment management |
|
|
74
|
+
| `skillAssessmentTestingSession` | Assessment testing sessions |
|
|
75
|
+
| `skillTemplate` | Skill template management |
|
|
76
|
+
| `talentTransfromation` | Talent transformation tracking |
|
|
77
|
+
| `team` | Team management |
|
|
78
|
+
| `tenant` | Tenant settings |
|
|
79
|
+
| `trainingPlan` | Training plan management |
|
|
80
|
+
| `trainingPlanProficiencyLevel` | Training plan proficiency levels |
|
|
81
|
+
| `userInformation` | User business profile properties |
|
|
82
|
+
| `users` | User accounts and authentication |
|
|
83
|
+
|
|
84
|
+
Constants `DOCUMENT_VERSION`, `RESPONSE_TYPE`, `PERMISSIONS`, and `PERMISSION_DESCRIPTIONS` are also exported directly.
|
|
85
|
+
|
|
86
|
+
Utility functions `errorToString`, `getErrorType`, `getErrorInformation`, and `shouldReturnError` are exported at the top level for Axios error handling.
|
|
87
|
+
|
|
88
|
+
## Documentation
|
|
89
|
+
|
|
90
|
+
Full method-level documentation for each module is available in the [doc/](doc/) folder:
|
|
91
|
+
|
|
92
|
+
- [Action Notifications](doc/actionNotifications.md)
|
|
93
|
+
- [Address](doc/address.md)
|
|
94
|
+
- [AI Assistant](doc/aiAssistant.md)
|
|
95
|
+
- [Avatar](doc/avatar.md)
|
|
96
|
+
- [Axios Client](doc/axiosClient.md)
|
|
97
|
+
- [Config](doc/config.md)
|
|
98
|
+
- [Constants](doc/constants.md)
|
|
99
|
+
- [Content Generator](doc/contentGenerator.md)
|
|
100
|
+
- [Custom Fields](doc/customFields.md)
|
|
101
|
+
- [Dashboard](doc/dashboard.md)
|
|
102
|
+
- [Department Training Plans](doc/departmentTrainingPlans.md)
|
|
103
|
+
- [Groups](doc/groups.md)
|
|
104
|
+
- [Integration](doc/integration.md)
|
|
105
|
+
- [Integration Configuration](doc/integrationConfiguration.md)
|
|
106
|
+
- [Learning Content](doc/learningContent.md)
|
|
107
|
+
- [Learning Path](doc/learningPath.md)
|
|
108
|
+
- [Logger](doc/logger.md)
|
|
109
|
+
- [Micro Skills Quizzes](doc/microSkillsQuizes.md)
|
|
110
|
+
- [Quotas](doc/quotas.md)
|
|
111
|
+
- [Role](doc/role.md)
|
|
112
|
+
- [Role Template](doc/roleTemplate.md)
|
|
113
|
+
- [Security](doc/security.md)
|
|
114
|
+
- [Skill](doc/skill.md)
|
|
115
|
+
- [Skill Assessments](doc/skillAssessments.md)
|
|
116
|
+
- [Skill Assessment Testing Session](doc/skillAssessmentTestingSession.md)
|
|
117
|
+
- [Skill Template](doc/skillTemplate.md)
|
|
118
|
+
- [Talent Transformation](doc/talentTransfromation.md)
|
|
119
|
+
- [Teams](doc/teams.md)
|
|
120
|
+
- [Tenants](doc/tenants.md)
|
|
121
|
+
- [Training Plans](doc/trainingPlans.md)
|
|
122
|
+
- [Training Plans Proficiency Levels](doc/trainingPlansProficiencyLevels.md)
|
|
123
|
+
- [User Information](doc/userInformation.md)
|
|
124
|
+
- [Users](doc/users.md)
|
|
125
|
+
- [Utils](doc/utils.md)
|
|
126
|
+
|
|
127
|
+
## License
|
|
128
|
+
|
|
129
|
+
This package is licensed under the [Creative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)](https://creativecommons.org/licenses/by-nd/4.0/legalcode). See the [LICENSE](LICENSE) file for details.
|
|
130
|
+
|
|
131
|
+
## Support
|
|
132
|
+
|
|
133
|
+
For questions or support, open an issue in the [GitHub repository](https://github.com/StackFactor/stackfactor-client-api).
|
|
134
|
+
|
|
135
|
+
## Links
|
|
136
|
+
|
|
137
|
+
- [StackFactor Developer Resources](https://stackfactor.ai/resources/developers)
|
|
138
|
+
- [CC BY-ND 4.0 License](https://creativecommons.org/licenses/by-nd/4.0/legalcode)
|
package/declarations/axios.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
// axios provides its own type definitions
|
|
1
|
+
// axios provides its own type definitions
|
package/package.json
CHANGED
|
@@ -1,55 +1,57 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@stackfactor/client-api",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "Node.js library for the StackFactor API",
|
|
5
|
-
"main": "./dist/cjs/index.js",
|
|
6
|
-
"module": "./dist/esm/index.js",
|
|
7
|
-
"types": "./dist/esm/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"build
|
|
24
|
-
"build:
|
|
25
|
-
"build:
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"@
|
|
51
|
-
"@
|
|
52
|
-
"eslint": "^8.
|
|
53
|
-
"typescript": "^
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@stackfactor/client-api",
|
|
3
|
+
"version": "1.1.223",
|
|
4
|
+
"description": "Node.js library for the StackFactor API",
|
|
5
|
+
"main": "./dist/cjs/lib/index.js",
|
|
6
|
+
"module": "./dist/esm/lib/index.js",
|
|
7
|
+
"types": "./dist/esm/lib/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/esm/lib/index.d.ts",
|
|
11
|
+
"import": "./dist/esm/lib/index.js",
|
|
12
|
+
"require": "./dist/cjs/lib/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"declarations",
|
|
17
|
+
"dist",
|
|
18
|
+
"package.json",
|
|
19
|
+
"README.md",
|
|
20
|
+
"LICENSE"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "npm run build:esm && npm run build:cjs",
|
|
24
|
+
"build:esm": "tsc --project tsconfig.esm.json",
|
|
25
|
+
"build:cjs": "tsc --project tsconfig.cjs.json",
|
|
26
|
+
"build:watch": "tsc --watch",
|
|
27
|
+
"prepublishOnly": "npm run build",
|
|
28
|
+
"test": "jest",
|
|
29
|
+
"lint": "eslint 'src/**/*.{ts,tsx}'"
|
|
30
|
+
},
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "git+https://github.com/StackFactor/stackfactor-client-api.git"
|
|
34
|
+
},
|
|
35
|
+
"author": "StackFactor Inc",
|
|
36
|
+
"license": "ISC",
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/StackFactor/stackfactor-client-api/issues"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://github.com/StackFactor/stackfactor-client-api#readme",
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"axios": "^1.8.1",
|
|
43
|
+
"dotenv": "^16.4.7",
|
|
44
|
+
"html2plaintext": "^2.1.4",
|
|
45
|
+
"https": "latest",
|
|
46
|
+
"node-html-parser": "^7.0.1",
|
|
47
|
+
"socket.io-client": "^4.8.1"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@types/axios": "^0.14.4",
|
|
51
|
+
"@types/node": "^22.13.5",
|
|
52
|
+
"@typescript-eslint/eslint-plugin": "^8.25.0",
|
|
53
|
+
"@typescript-eslint/parser": "^8.25.0",
|
|
54
|
+
"eslint": "^8.57.1",
|
|
55
|
+
"typescript": "^5.7.3"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get all permissions
|
|
3
|
-
* @param {String} token The authentication token
|
|
4
|
-
* @returns {Promise<object>}
|
|
5
|
-
*/
|
|
6
|
-
export declare const getAllUserNotifications: (token: string) => Promise<object>;
|
|
7
|
-
/**
|
|
8
|
-
* Mark notifications as open or viewed
|
|
9
|
-
* @param {Array<String>} ids The id of the notifications to be marked
|
|
10
|
-
* @param {String} status The new status
|
|
11
|
-
* @param {String} authToken The authentication token
|
|
12
|
-
* @returns {Promise<object>}
|
|
13
|
-
*/
|
|
14
|
-
export declare const markNotifications: (ids: string[], status: string, authToken: string) => Promise<object>;
|
|
15
|
-
/**
|
|
16
|
-
* Process a notification
|
|
17
|
-
* @param {String} id The notification id
|
|
18
|
-
* @param {String} action The action to be executed
|
|
19
|
-
* @param {String} comments The comments to be saved in the notification
|
|
20
|
-
* @param {String} authToken The authentication token
|
|
21
|
-
* @returns {Promise<object>}
|
|
22
|
-
*/
|
|
23
|
-
export declare const processNotification: (id: string, action: string, comments: string, authToken: string) => Promise<object>;
|
|
24
|
-
//# sourceMappingURL=actionNotifications.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"actionNotifications.d.ts","sourceRoot":"","sources":["../../../../src/lib/actionNotifications.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAAI,OAAO,MAAM,KAAG,OAAO,CAAC,MAAM,CAarE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAC5B,KAAK,MAAM,EAAE,EACb,QAAQ,MAAM,EACd,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAkBhB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,GAC9B,IAAI,MAAM,EACV,QAAQ,MAAM,EACd,UAAU,MAAM,EAChB,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAmBhB,CAAC"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { client } from "./axiosClient.js";
|
|
2
|
-
/**
|
|
3
|
-
* Get all permissions
|
|
4
|
-
* @param {String} token The authentication token
|
|
5
|
-
* @returns {Promise<object>}
|
|
6
|
-
*/
|
|
7
|
-
export const getAllUserNotifications = (token) => {
|
|
8
|
-
return new Promise((resolve, reject) => {
|
|
9
|
-
const request = client.get(`/api/v1/actionnotifications`, {
|
|
10
|
-
headers: { authorization: token },
|
|
11
|
-
});
|
|
12
|
-
request
|
|
13
|
-
.then((response) => {
|
|
14
|
-
resolve(response.data);
|
|
15
|
-
})
|
|
16
|
-
.catch((error) => {
|
|
17
|
-
reject(error);
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Mark notifications as open or viewed
|
|
23
|
-
* @param {Array<String>} ids The id of the notifications to be marked
|
|
24
|
-
* @param {String} status The new status
|
|
25
|
-
* @param {String} authToken The authentication token
|
|
26
|
-
* @returns {Promise<object>}
|
|
27
|
-
*/
|
|
28
|
-
export const markNotifications = (ids, status, authToken) => {
|
|
29
|
-
return new Promise((resolve, reject) => {
|
|
30
|
-
const request = client.put(`/api/v1/actionnotifications/mark`, {
|
|
31
|
-
ids: ids,
|
|
32
|
-
status: status,
|
|
33
|
-
}, { headers: { authorization: authToken } });
|
|
34
|
-
request
|
|
35
|
-
.then((response) => {
|
|
36
|
-
resolve(response.data);
|
|
37
|
-
})
|
|
38
|
-
.catch((error) => {
|
|
39
|
-
reject(error);
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Process a notification
|
|
45
|
-
* @param {String} id The notification id
|
|
46
|
-
* @param {String} action The action to be executed
|
|
47
|
-
* @param {String} comments The comments to be saved in the notification
|
|
48
|
-
* @param {String} authToken The authentication token
|
|
49
|
-
* @returns {Promise<object>}
|
|
50
|
-
*/
|
|
51
|
-
export const processNotification = (id, action, comments, authToken) => {
|
|
52
|
-
return new Promise((resolve, reject) => {
|
|
53
|
-
const request = client.put(`/api/v1/actionnotifications/process`, {
|
|
54
|
-
id: id,
|
|
55
|
-
action: action,
|
|
56
|
-
comments: comments,
|
|
57
|
-
}, { headers: { authorization: authToken } });
|
|
58
|
-
request
|
|
59
|
-
.then((response) => {
|
|
60
|
-
resolve(response.data);
|
|
61
|
-
})
|
|
62
|
-
.catch((error) => {
|
|
63
|
-
reject(error);
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
//# sourceMappingURL=actionNotifications.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"actionNotifications.js","sourceRoot":"","sources":["../../../../src/lib/actionNotifications.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,KAAa,EAAmB,EAAE;IACxE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,6BAA6B,EAAE;YACxD,OAAO,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE;SAClC,CAAC,CAAC;QACH,OAAO;aACJ,IAAI,CAAC,CAAC,QAAuB,EAAE,EAAE;YAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAiB,EAAE,EAAE;YAC3B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,GAAa,EACb,MAAc,EACd,SAAiB,EACA,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CACxB,kCAAkC,EAClC;YACE,GAAG,EAAE,GAAG;YACR,MAAM,EAAE,MAAM;SACf,EACD,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,CAC1C,CAAC;QACF,OAAO;aACJ,IAAI,CAAC,CAAC,QAAuB,EAAE,EAAE;YAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAiB,EAAE,EAAE;YAC3B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,EAAU,EACV,MAAc,EACd,QAAgB,EAChB,SAAiB,EACA,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CACxB,qCAAqC,EACrC;YACE,EAAE,EAAE,EAAE;YACN,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,QAAQ;SACnB,EACD,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,CAC1C,CAAC;QACF,OAAO;aACJ,IAAI,CAAC,CAAC,QAAuB,EAAE,EAAE;YAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAiB,EAAE,EAAE;YAC3B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Validate Address
|
|
3
|
-
* @param {String} input - the address in raw format
|
|
4
|
-
* @param {String} authToken - Authorization token
|
|
5
|
-
* @returns {Promise<object>}
|
|
6
|
-
*/
|
|
7
|
-
export declare const autoComplete: (input: string, authToken: string) => Promise<object>;
|
|
8
|
-
//# sourceMappingURL=address.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../../../src/lib/address.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GACvB,OAAO,MAAM,EACb,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAehB,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { client } from "./axiosClient.js";
|
|
2
|
-
/**
|
|
3
|
-
* Validate Address
|
|
4
|
-
* @param {String} input - the address in raw format
|
|
5
|
-
* @param {String} authToken - Authorization token
|
|
6
|
-
* @returns {Promise<object>}
|
|
7
|
-
*/
|
|
8
|
-
export const autoComplete = (input, authToken) => {
|
|
9
|
-
return new Promise((resolve, reject) => {
|
|
10
|
-
const getAddressesRequest = client.post(`/api/v1/address/autocomplete/`, { input: input }, { headers: { authorization: authToken } });
|
|
11
|
-
getAddressesRequest
|
|
12
|
-
.then((response) => {
|
|
13
|
-
resolve(response.data);
|
|
14
|
-
})
|
|
15
|
-
.catch((error) => {
|
|
16
|
-
reject(error);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=address.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../../../src/lib/address.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,KAAa,EACb,SAAiB,EACA,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,mBAAmB,GAAG,MAAM,CAAC,IAAI,CACrC,+BAA+B,EAC/B,EAAE,KAAK,EAAE,KAAK,EAAE,EAChB,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,CAC1C,CAAC;QACF,mBAAmB;aAChB,IAAI,CAAC,CAAC,QAAuB,EAAE,EAAE;YAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAiB,EAAE,EAAE;YAC3B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ask Question to the AI
|
|
3
|
-
* @param {String} conversationId
|
|
4
|
-
* @param {String} question
|
|
5
|
-
* @param {String} updatedContext
|
|
6
|
-
* @param {String} token Authorization token
|
|
7
|
-
* @returns {Promise<object>}
|
|
8
|
-
*/
|
|
9
|
-
export declare const askQuestion: (conversationId: string, question: string, updatedContext: string, token: string) => Promise<object>;
|
|
10
|
-
/**
|
|
11
|
-
* End conversation with the AI
|
|
12
|
-
* @param {String} conversationId
|
|
13
|
-
* @param {String} token Authorization token
|
|
14
|
-
* @returns {Promise<object>}
|
|
15
|
-
*/
|
|
16
|
-
export declare const endConversation: (conversationId: string, token: string) => Promise<object>;
|
|
17
|
-
/**
|
|
18
|
-
* Get conversation by elementId
|
|
19
|
-
* @param {String} elementId
|
|
20
|
-
* @param {String} token
|
|
21
|
-
* @returns {Promise<object>}
|
|
22
|
-
*/
|
|
23
|
-
export declare const getConversationByElementId: (elementId: string, token: string) => Promise<object>;
|
|
24
|
-
/**
|
|
25
|
-
* Get the voice assistant URL
|
|
26
|
-
* @param {String} language
|
|
27
|
-
* @param {String} token
|
|
28
|
-
* @returns {Promise<object>}
|
|
29
|
-
*/
|
|
30
|
-
export declare const getVoiceAssistantUrl: (language: string, token: string) => Promise<object>;
|
|
31
|
-
/**
|
|
32
|
-
* Start conversation with the AI
|
|
33
|
-
* @param {String} elementId
|
|
34
|
-
* @param {String} elementType
|
|
35
|
-
* @param {String} context
|
|
36
|
-
* @param {Boolean} autoContextRefresh
|
|
37
|
-
* @param {String} token
|
|
38
|
-
* @param {String} conversationId Optional
|
|
39
|
-
* @returns {Promise<object>}
|
|
40
|
-
*/
|
|
41
|
-
export declare const startConversation: (elementId: string, elementType: string, question: string, context: string, autoContextRefresh: boolean, token: string, conversationId?: string | null) => Promise<object>;
|
|
42
|
-
//# sourceMappingURL=aiAssistant.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"aiAssistant.d.ts","sourceRoot":"","sources":["../../../../src/lib/aiAssistant.ts"],"names":[],"mappings":"AAsBA;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,GACtB,gBAAgB,MAAM,EACtB,UAAU,MAAM,EAChB,gBAAgB,MAAM,EACtB,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAsBhB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAC1B,gBAAgB,MAAM,EACtB,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAoBhB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,GACrC,WAAW,MAAM,EACjB,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAgBhB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAC/B,UAAU,MAAM,EAChB,OAAO,MAAM,KACZ,OAAO,CAAC,MAAM,CAgBhB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,GAC5B,WAAW,MAAM,EACjB,aAAa,MAAM,EACnB,UAAU,MAAM,EAChB,SAAS,MAAM,EACf,oBAAoB,OAAO,EAC3B,OAAO,MAAM,EACb,iBAAgB,MAAM,GAAG,IAAW,KACnC,OAAO,CAAC,MAAM,CA2BhB,CAAC"}
|