@stackfactor/client-api 1.0.3 → 1.0.5

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