@stackfactor/client-api 1.0.16 → 1.0.18

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
@@ -2,6 +2,7 @@ const actionNotifications = require("./lib/actionNotifications");
2
2
  const address = require("./lib/address");
3
3
  const config = require("./lib/config");
4
4
  const constants = require("./lib/constants");
5
+ const dashboard = require("./lib/dashboard");
5
6
  const departmentTraingPlans = require("./lib/departmentTrainingPlans");
6
7
  const integration = require("./lib/integration");
7
8
  const integrationsConfiguration = require("./lib/integrationConfiguration");
@@ -27,6 +28,7 @@ module.exports = {
27
28
  actionNotifications,
28
29
  address,
29
30
  config,
31
+ dashboard,
30
32
  DOCUMENT_VERSION: constants.DOCUMENT_VERSION,
31
33
  integration,
32
34
  integrationsConfiguration,
@@ -127,6 +127,35 @@ module.exports = {
127
127
  });
128
128
  },
129
129
 
130
+ /**
131
+ * Import role templates
132
+ * @param {Array<String>} data The list of role templates to be imported
133
+ * @param {String} token
134
+ * @returns
135
+ */
136
+ importRoleTemplates: (data, token) => {
137
+ return new Promise(function (resolve, reject) {
138
+ const requestData = {
139
+ data: data,
140
+ };
141
+ let confirmationRequest = axios.post(
142
+ `api/v1/roletemplates/import`,
143
+ requestData,
144
+ {
145
+ headers: { authorization: token },
146
+ }
147
+ );
148
+ confirmationRequest
149
+
150
+ .then((response) => {
151
+ resolve(response.data);
152
+ })
153
+ .catch((error) => {
154
+ reject(error);
155
+ });
156
+ });
157
+ },
158
+
130
159
  /**
131
160
  * Publish template
132
161
  * @param {number} id The id of the template to be published
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackfactor/client-api",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "description": "Node.js library for the StackFactor API",
5
5
  "main": "index.js",
6
6
  "exports": {