@stackfactor/client-api 1.0.18 → 1.0.21

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 (3) hide show
  1. package/index.js +25 -16
  2. package/lib/axios.js +139 -0
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -1,26 +1,29 @@
1
1
  const actionNotifications = require("./lib/actionNotifications");
2
+ const axios = require("./lib/axios");
2
3
  const address = require("./lib/address");
3
4
  const config = require("./lib/config");
4
5
  const constants = require("./lib/constants");
5
6
  const dashboard = require("./lib/dashboard");
6
7
  const departmentTraingPlans = require("./lib/departmentTrainingPlans");
7
8
  const integration = require("./lib/integration");
8
- const integrationsConfiguration = require("./lib/integrationConfiguration");
9
+ const integrationConfiguration = require("./lib/integrationConfiguration");
9
10
  const groups = require("./lib/groups");
10
11
  const learningContent = require("./lib/learningContent");
12
+ const logger = require("./lib/logger");
11
13
  const role = require("./lib/role");
12
14
  const roleTemplate = require("./lib/roleTemplate");
13
15
  const skill = require("./lib/skill");
14
- const skillAssessments = require("./lib/skillAssessments");
16
+ const skillAssessment = require("./lib/skillAssessments");
17
+ const skillAssessmentTestingSession = require("./lib/skillAssessmentTestingSession");
15
18
  const skillTemplate = require("./lib/skillTemplate");
16
- const teams = require("./lib/teams");
17
- const templateDocument = require("./lib/templateDocument");
18
- const templatePhase = require("./lib/templatePhase");
19
- const templateRelease = require("./lib/templateRelease");
19
+ const team = require("./lib/teams");
20
+ // const templateDocument = require("./lib/templateDocument");
21
+ // const templatePhase = require("./lib/templatePhase");
22
+ // const templateRelease = require("./lib/templateRelease");
20
23
  const templates = require("./lib/templates");
21
- const tenants = require("./lib/tenants");
24
+ const tenant = require("./lib/tenants");
22
25
  const trainingPlanTemplate = require("./lib/trainingPlanTemplate");
23
- const trainingPlans = require("./lib/trainingPlans");
26
+ const trainingPlan = require("./lib/trainingPlans");
24
27
  const userInformation = require("./lib/userInformation");
25
28
  const users = require("./lib/users");
26
29
 
@@ -29,26 +32,32 @@ module.exports = {
29
32
  address,
30
33
  config,
31
34
  dashboard,
35
+ errorToString: axios.errorToString,
36
+ getErrorType: axios.getErrorType,
32
37
  DOCUMENT_VERSION: constants.DOCUMENT_VERSION,
33
38
  integration,
34
- integrationsConfiguration,
39
+ integrationConfiguration,
35
40
  departmentTraingPlans,
36
41
  groups,
37
42
  learningContent,
43
+ logger,
38
44
  RESONSE_TYPE: constants.RESONSE_TYPE,
45
+ responseType: axios.responseType,
39
46
  role,
40
47
  roleTemplate,
48
+ shouldReturnError: axios.shouldReturnError,
41
49
  skill,
42
- skillAssessments,
50
+ skillAssessment,
51
+ skillAssessmentTestingSession,
43
52
  skillTemplate,
44
- teams,
45
- templateDocument,
46
- templatePhase,
47
- templateRelease,
53
+ team,
54
+ // templateDocument,
55
+ // templatePhase,
56
+ // templateRelease,
48
57
  templates,
49
- tenants,
58
+ tenant,
50
59
  trainingPlanTemplate,
51
- trainingPlans,
60
+ trainingPlan,
52
61
  userInformation,
53
62
  users,
54
63
  };
package/lib/axios.js CHANGED
@@ -67,6 +67,145 @@ module.exports = {
67
67
  };
68
68
  },
69
69
 
70
+ responseType: {
71
+ /**
72
+ * The requested resource corresponds to any one of a set of representations, each with its own specific location.
73
+ */
74
+ MULTIPLE_CHOICES: 300,
75
+ /**
76
+ * The resource has moved permanently. Please refer to the documentation.
77
+ */
78
+ MOVED_PERMANENTLY: 301,
79
+ /**
80
+ * The resource has moved temporarily. Please refer to the documentation.
81
+ */
82
+ FOUND: 302,
83
+ /**
84
+ * The resource can be found under a different URI.
85
+ */
86
+ SEE_OTHER: 303,
87
+ /**
88
+ * The resource is available and not modified.
89
+ */
90
+ NOT_MODIFIED: 304,
91
+ /**
92
+ * The requested resource must be accessed through the proxy given by the Location field.
93
+ */
94
+ USE_PROXY: 305,
95
+ /**
96
+ * The resource resides temporarily under a different URI.
97
+ */
98
+ TEMPORARY_REDIRECT: 307,
99
+ /**
100
+ * Invalid syntax for this request was provided.
101
+ */
102
+ BAD_REQUEST: 400,
103
+ /**
104
+ * You are unauthorized to access the requested resource. Please log in.
105
+ */
106
+ UNAUTHORIZED: 401,
107
+ /**
108
+ * Your account is not authorized to access the requested resource.
109
+ */
110
+ FORBIDDEN: 403,
111
+ /**
112
+ * We could not find the resource you requested. Please refer to the documentation for the list of resources.
113
+ */
114
+ NOT_FOUND: 404,
115
+ /**
116
+ * This method type is not currently supported.
117
+ */
118
+ METHOD_NOT_ALLOWED: 405,
119
+ /**
120
+ * Acceptance header is invalid for this endpoint resource.
121
+ */
122
+ NOT_ACCEPTABLE: 406,
123
+ /**
124
+ * Authentication with proxy is required.
125
+ */
126
+ PROXY_AUTHENTICATION_REQUIRED: 407,
127
+ /**
128
+ * Client did not produce a request within the time that the server was prepared to wait.
129
+ */
130
+ REQUEST_TIMEOUT: 408,
131
+ /**
132
+ * The request could not be completed due to a conflict with the current state of the resource.
133
+ */
134
+ CONFLICT: 409,
135
+ /**
136
+ * The requested resource is no longer available and has been permanently removed.
137
+ */
138
+ GONE: 410,
139
+ /**
140
+ * Length of the content is required, please include it with the request.
141
+ */
142
+ LENGTH_REQUIRED: 411,
143
+ /**
144
+ * The request did not match the pre-conditions of the requested resource.
145
+ */
146
+ PRECONDITION_FAILED: 412,
147
+ /**
148
+ * The request entity is larger than the server is willing or able to process.
149
+ */
150
+ REQUEST_ENTITY_TOO_LARGE: 413,
151
+ /**
152
+ * The request URI is longer than the server is willing to interpret.
153
+ */
154
+ REQUEST_URI_TOO_LONG: 414,
155
+ /**
156
+ * The requested resource does not support the media type provided.
157
+ */
158
+ UNSUPPORTED_MEDIA_TYPE: 415,
159
+ /**
160
+ * The requested range for the resource is not available.
161
+ */
162
+ REQUESTED_RANGE_NOT_SATISFIABLE: 416,
163
+ /**
164
+ * Unable to meet the expectation given in the Expect request header.
165
+ */
166
+ EXPECTATION_FAILED: 417,
167
+ /**
168
+ * The requested resource is missing required arguments.
169
+ */
170
+ MISSING_ARGUMENTS: 419,
171
+ /**
172
+ * The requested resource does not support one or more of the given parameters.
173
+ */
174
+ INVALID_ARGUMENTS: 420,
175
+ /**
176
+ * The request was well-formed but was unable to be followed due to semantic errors.
177
+ */
178
+ UNPROCESSABLE_ENTITY: 422,
179
+ /**
180
+ * Unexpected internal server error.
181
+ */
182
+ INTERNAL_SERVER_ERROR: 500,
183
+ /**
184
+ * The requested resource is recognized but not implemented.
185
+ */
186
+ NOT_IMPLEMENTED: 501,
187
+ /**
188
+ * Invalid response received when acting as a proxy or gateway.
189
+ */
190
+ BAD_GATEWAY: 502,
191
+ /**
192
+ * The server is currently unavailable.
193
+ */
194
+ SERVICE_UNAVAILABLE: 503,
195
+ /**
196
+ * Did not receive a timely response from upstream server while acting as a gateway or proxy.
197
+ */
198
+ GATEWAY_TIMEOUT: 504,
199
+ /**
200
+ * The HTTP protocol version used in the request message is not supported.
201
+ */
202
+ HTTP_VERSION_NOT_SUPPORTED: 505,
203
+ /**
204
+ * A failure occurred during initialization of services. API will be unavailable.
205
+ */
206
+ INITIALIZATION_FAILURE: 550,
207
+ },
208
+
70
209
  /**
71
210
  * Returns true if an exception should be handled to the business and presentation layer
72
211
  * @param {Boolean} returnAllExceptions - If set true all exceptions will be passed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackfactor/client-api",
3
- "version": "1.0.18",
3
+ "version": "1.0.21",
4
4
  "description": "Node.js library for the StackFactor API",
5
5
  "main": "index.js",
6
6
  "exports": {