@kineticdata/react 6.1.0 → 6.1.6

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 (97) hide show
  1. package/README.md +110 -110
  2. package/assets/task/icons/defer.svg +12 -12
  3. package/assets/task/icons/drag-handle.svg +3 -3
  4. package/assets/task/icons/filter.svg +11 -11
  5. package/assets/task/icons/loop.svg +10 -10
  6. package/assets/task/icons/plus_small.svg +5 -5
  7. package/assets/task/icons/routine.svg +9 -9
  8. package/assets/task/icons/scale-minus.svg +11 -11
  9. package/assets/task/icons/scale-plus.svg +13 -13
  10. package/assets/task/icons/start.svg +11 -11
  11. package/assets/task/icons/stop.svg +8 -8
  12. package/lib/apis/core/activity.js +4 -4
  13. package/lib/apis/core/attributeDefinitions.js +55 -0
  14. package/lib/apis/core/attributeDefinitions.test.js +7 -4
  15. package/lib/apis/core/authentication.js +12 -1
  16. package/lib/apis/core/bridgeModels.test.js +46 -23
  17. package/lib/apis/core/bridgedresources.js +41 -41
  18. package/lib/apis/core/fileResources.js +2 -6
  19. package/lib/apis/core/forms.js +51 -2
  20. package/lib/apis/core/forms.test.js +32 -19
  21. package/lib/apis/core/kapps.js +49 -0
  22. package/lib/apis/core/kapps.test.js +16 -10
  23. package/lib/apis/core/notices.js +7 -0
  24. package/lib/apis/core/securityPolicyDefinitions.test.js +7 -4
  25. package/lib/apis/core/space.js +18 -0
  26. package/lib/apis/core/space.test.js +16 -10
  27. package/lib/apis/core/submissionActivities.js +38 -0
  28. package/lib/apis/core/submissions.js +62 -0
  29. package/lib/apis/core/translations.test.js +126 -55
  30. package/lib/apis/core/userPreferences.js +59 -0
  31. package/lib/apis/core/webApis.js +32 -2
  32. package/lib/apis/core/webhooks.test.js +7 -4
  33. package/lib/apis/http.js +22 -11
  34. package/lib/apis/index.js +24 -0
  35. package/lib/apis/integrator/index.js +95 -20
  36. package/lib/apis/system/index.js +16 -1
  37. package/lib/apis/task/index.js +1 -1
  38. package/lib/components/common/AttributeSelect.js +1 -0
  39. package/lib/components/common/BridgeSelect.js +1 -0
  40. package/lib/components/common/ConnectionSelect.js +2 -1
  41. package/lib/components/common/FormSelect.js +1 -0
  42. package/lib/components/common/NodeSelect.js +1 -0
  43. package/lib/components/common/StaticSelect.js +1 -0
  44. package/lib/components/common/TeamSelect.js +1 -0
  45. package/lib/components/common/ToastContainer.js +3 -3
  46. package/lib/components/common/Typeahead.js +3 -0
  47. package/lib/components/common/UserSelect.js +1 -0
  48. package/lib/components/common/authentication/AuthenticationContainer.js +121 -55
  49. package/lib/components/common/preferences/PreferencesProvider.js +461 -0
  50. package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +7 -7
  51. package/lib/components/core/field_definition/FieldDefinitionForm.js +3 -3
  52. package/lib/components/core/form/FormTable.js +0 -1
  53. package/lib/components/core/integration/IntegrationTable.js +3 -0
  54. package/lib/components/core/space/SpaceForm.js +14 -14
  55. package/lib/components/core/submission/SubmissionActivityForm.js +79 -0
  56. package/lib/components/core/submission/SubmissionForm.js +12 -2
  57. package/lib/components/core/translation/EntryTable.js +8 -7
  58. package/lib/components/core/user/UserForm.js +2 -0
  59. package/lib/components/core/user/UserTable.js +4 -4
  60. package/lib/components/form/Form.js +14 -3
  61. package/lib/components/form/FormState.js +1 -1
  62. package/lib/components/form/SimpleForm.js +2 -2
  63. package/lib/components/index.js +68 -0
  64. package/lib/components/integrator/connection/ConnectionForm.js +62 -18
  65. package/lib/components/integrator/connection/ConnectionTable.js +5 -3
  66. package/lib/components/integrator/connection/config_fields/http.js +19 -19
  67. package/lib/components/integrator/connection/config_fields/sql.js +123 -0
  68. package/lib/components/integrator/integrationTypes.js +27 -5
  69. package/lib/components/integrator/operation/OperationForm.js +24 -4
  70. package/lib/components/integrator/operation/OperationTable.js +3 -5
  71. package/lib/components/integrator/operation/config_fields/http.js +4 -3
  72. package/lib/components/integrator/operation/config_fields/sql.js +81 -0
  73. package/lib/components/system/SystemUserForm.js +2 -0
  74. package/lib/components/table/Table.js +75 -15
  75. package/lib/components/table/Table.redux.js +296 -72
  76. package/lib/components/table/defaults/FilterControl.js +24 -0
  77. package/lib/components/table/defaults/index.js +2 -0
  78. package/lib/components/table/tests/Table.test.js +22 -22
  79. package/lib/components/table/tests/components.js +9 -2
  80. package/lib/components/task/builder/Connector.js +51 -41
  81. package/lib/components/task/builder/Node.js +25 -38
  82. package/lib/components/task/builder/SvgCanvas.js +3 -17
  83. package/lib/components/task/builder/TreeBuilder.js +1 -2
  84. package/lib/components/task/builder/builder.redux.js +52 -32
  85. package/lib/components/task/builder/helpers.js +38 -7
  86. package/lib/components/task/common/UsageTable.js +8 -1
  87. package/lib/components/task/handlers/HandlerTable.js +9 -18
  88. package/lib/components/task/runs/RunTable.js +6 -10
  89. package/lib/components/task/workflows/LinkedWorkflowTable.js +14 -9
  90. package/lib/components/task/workflows/WorkflowTable.js +25 -24
  91. package/lib/helpers/index.js +18 -2
  92. package/lib/index.js +2 -1
  93. package/lib/saga.js +4 -4
  94. package/lib/store.js +2 -1
  95. package/package.json +5 -6
  96. package/proxyhelper.js +201 -201
  97. package/CHANGELOG.md +0 -116
@@ -4,7 +4,6 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/regeneratorRuntime"));
5
5
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
6
6
  var _axios = _interopRequireDefault(require("axios"));
7
- var _createError = _interopRequireDefault(require("axios/lib/core/createError"));
8
7
  var _bridgeModels = require("./bridgeModels");
9
8
  jest.mock('axios');
10
9
 
@@ -70,9 +69,13 @@ describe('bridgeModels api', function () {
70
69
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee2$(_context2) {
71
70
  while (1) switch (_context2.prev = _context2.next) {
72
71
  case 0:
73
- _axios["default"].get.mockRejectedValue((0, _createError["default"])('Request failed with status code 403', null, 403, null, {
74
- status: 403,
75
- statusText: 'Forbidden'
72
+ _axios["default"].get.mockRejectedValue(Object.assign(new Error('Request failed with status code 403'), {
73
+ name: 'AxiosError',
74
+ isAxiosError: true,
75
+ response: {
76
+ status: 403,
77
+ statusText: 'Forbidden'
78
+ }
76
79
  }));
77
80
  _context2.next = 3;
78
81
  return (0, _bridgeModels.fetchBridgeModels)({
@@ -158,9 +161,13 @@ describe('bridgeModels api', function () {
158
161
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee4$(_context4) {
159
162
  while (1) switch (_context4.prev = _context4.next) {
160
163
  case 0:
161
- _axios["default"].get.mockRejectedValue((0, _createError["default"])('Request failed with status code 403', null, 403, null, {
162
- status: 403,
163
- statusText: 'Forbidden'
164
+ _axios["default"].get.mockRejectedValue(Object.assign(new Error('Request failed with status code 403'), {
165
+ name: 'AxiosError',
166
+ isAxiosError: true,
167
+ response: {
168
+ status: 403,
169
+ statusText: 'Forbidden'
170
+ }
164
171
  }));
165
172
  _context4.next = 3;
166
173
  return (0, _bridgeModels.fetchBridgeModel)({
@@ -253,11 +260,15 @@ describe('bridgeModels api', function () {
253
260
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee6$(_context6) {
254
261
  while (1) switch (_context6.prev = _context6.next) {
255
262
  case 0:
256
- _axios["default"].post.mockRejectedValue((0, _createError["default"])('Request failed with status code 400', null, 400, null, {
257
- status: 400,
258
- statusText: 'Bad Request',
259
- data: {
260
- error: 'Invalid Bridge Model'
263
+ _axios["default"].post.mockRejectedValue(Object.assign(new Error('Request failed with status code 400'), {
264
+ name: 'AxiosError',
265
+ isAxiosError: true,
266
+ response: {
267
+ status: 400,
268
+ statusText: 'Bad Request',
269
+ data: {
270
+ error: 'Invalid Bridge Model'
271
+ }
261
272
  }
262
273
  }));
263
274
  _context6.next = 3;
@@ -289,9 +300,13 @@ describe('bridgeModels api', function () {
289
300
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee7$(_context7) {
290
301
  while (1) switch (_context7.prev = _context7.next) {
291
302
  case 0:
292
- _axios["default"].post.mockRejectedValue((0, _createError["default"])('Request failed with status code 403', null, 403, null, {
293
- status: 403,
294
- statusText: 'Forbidden'
303
+ _axios["default"].post.mockRejectedValue(Object.assign(new Error('Request failed with status code 403'), {
304
+ name: 'AxiosError',
305
+ isAxiosError: true,
306
+ response: {
307
+ status: 403,
308
+ statusText: 'Forbidden'
309
+ }
295
310
  }));
296
311
  _context7.next = 3;
297
312
  return (0, _bridgeModels.createBridgeModel)({
@@ -389,11 +404,15 @@ describe('bridgeModels api', function () {
389
404
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee9$(_context9) {
390
405
  while (1) switch (_context9.prev = _context9.next) {
391
406
  case 0:
392
- _axios["default"].put.mockRejectedValue((0, _createError["default"])('Request failed with status code 400', null, 400, null, {
393
- status: 400,
394
- statusText: 'Bad Request',
395
- data: {
396
- error: 'Invalid Bridge Model'
407
+ _axios["default"].put.mockRejectedValue(Object.assign(new Error('Request failed with status code 400'), {
408
+ name: 'AxiosError',
409
+ isAxiosError: true,
410
+ response: {
411
+ status: 400,
412
+ statusText: 'Bad Request',
413
+ data: {
414
+ error: 'Invalid Bridge Model'
415
+ }
397
416
  }
398
417
  }));
399
418
  _context9.next = 3;
@@ -426,9 +445,13 @@ describe('bridgeModels api', function () {
426
445
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee10$(_context10) {
427
446
  while (1) switch (_context10.prev = _context10.next) {
428
447
  case 0:
429
- _axios["default"].put.mockRejectedValue((0, _createError["default"])('Request failed with status code 403', null, 403, null, {
430
- status: 403,
431
- statusText: 'Forbidden'
448
+ _axios["default"].put.mockRejectedValue(Object.assign(new Error('Request failed with status code 403'), {
449
+ name: 'AxiosError',
450
+ isAxiosError: true,
451
+ response: {
452
+ status: 403,
453
+ statusText: 'Forbidden'
454
+ }
432
455
  }));
433
456
  _context10.next = 3;
434
457
  return (0, _bridgeModels.updateBridgeModel)({
@@ -10,18 +10,18 @@ var _axios = _interopRequireDefault(require("axios"));
10
10
  var _qs = _interopRequireDefault(require("qs"));
11
11
  var _helpers = require("../../helpers");
12
12
  var _http = require("../http");
13
- /**
14
- * Returns the URL to a bridged resource.
15
- *
16
- * Note: custom sorting is currently not available in this function because the BridgedResource
17
- * API doesn't support it.
18
- *
19
- * @param {*} options - properties to build the bridged resource url
20
- * @param {string} options.bridgedResourceName - name of the bridged resource
21
- * @param {string} options.formSlug - form slug where the bridged resource is defined
22
- * @param {string} options.kappSlug - kapp slug where the bridged resource is defined
23
- * @param {string} options.datastore - flag if the bridged resource is defined on a datastore form
24
- * @returns {string}
13
+ /**
14
+ * Returns the URL to a bridged resource.
15
+ *
16
+ * Note: custom sorting is currently not available in this function because the BridgedResource
17
+ * API doesn't support it.
18
+ *
19
+ * @param {*} options - properties to build the bridged resource url
20
+ * @param {string} options.bridgedResourceName - name of the bridged resource
21
+ * @param {string} options.formSlug - form slug where the bridged resource is defined
22
+ * @param {string} options.kappSlug - kapp slug where the bridged resource is defined
23
+ * @param {string} options.datastore - flag if the bridged resource is defined on a datastore form
24
+ * @returns {string}
25
25
  */
26
26
  var bridgedResourceUrl = exports.bridgedResourceUrl = function bridgedResourceUrl(options) {
27
27
  var counting = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
@@ -48,16 +48,16 @@ var bridgedResourceUrl = exports.bridgedResourceUrl = function bridgedResourceUr
48
48
  return url;
49
49
  };
50
50
 
51
- /**
52
- * Returns the url encoded data to a bridged resource.
53
- *
54
- * @param {*} options - properties to build the bridged resource url
55
- * @param {string[]=} options.attributes - array of attributes (fields) to return
56
- * @param {number=} options.limit - maximum number of records to retrieve
57
- * @param {number=} options.offset - offset to retrieve as first record
58
- * @param {object=} options.values - hash of value names to values
59
- * @param {object=} options.metadata - hash of metadata names to values
60
- * @returns {string}
51
+ /**
52
+ * Returns the url encoded data to a bridged resource.
53
+ *
54
+ * @param {*} options - properties to build the bridged resource url
55
+ * @param {string[]=} options.attributes - array of attributes (fields) to return
56
+ * @param {number=} options.limit - maximum number of records to retrieve
57
+ * @param {number=} options.offset - offset to retrieve as first record
58
+ * @param {object=} options.values - hash of value names to values
59
+ * @param {object=} options.metadata - hash of metadata names to values
60
+ * @returns {string}
61
61
  */
62
62
  var bridgedResourceData = exports.bridgedResourceData = function bridgedResourceData(options) {
63
63
  var data = {};
@@ -105,13 +105,13 @@ var bridgedResourceData = exports.bridgedResourceData = function bridgedResource
105
105
  return _qs["default"].stringify(data);
106
106
  };
107
107
 
108
- /**
109
- * Combines the field names array with the records array to produce an array of objects
110
- * linking the field name to the field value for each record.
111
- *
112
- * @param {String[]} keys - Array of field names to use as object keys
113
- * @param {Array[]} values - Array of records, which are themselves an array of string values
114
- * @returns {Object[]} Array of objects linking the field name to the field value of each record.
108
+ /**
109
+ * Combines the field names array with the records array to produce an array of objects
110
+ * linking the field name to the field value for each record.
111
+ *
112
+ * @param {String[]} keys - Array of field names to use as object keys
113
+ * @param {Array[]} values - Array of records, which are themselves an array of string values
114
+ * @returns {Object[]} Array of objects linking the field name to the field value of each record.
115
115
  */
116
116
  var arraysToObject = exports.arraysToObject = function arraysToObject(keys, values) {
117
117
  return values.map(function (value) {
@@ -123,18 +123,18 @@ var arraysToObject = exports.arraysToObject = function arraysToObject(keys, valu
123
123
  });
124
124
  };
125
125
 
126
- /**
127
- * Converts the results from a Bridged Resource response that contains multiple records.
128
- *
129
- * A bridged resource that is configured to return multiple results separates the field names
130
- * from the record data. This is done to reduce the amount of bandwidth the response uses, but
131
- * it is not the ideal format to work with.
132
- *
133
- * This function combines the field names array with the records array to produce an array of
134
- * objects linking the field name to the field value for each record.
135
- *
136
- * @param {Object} responseJsonRecords - Kinetic Core bridge response parsed from JSON
137
- * @returns {Object[]} Array of objects linking the field name to the field value of each record.
126
+ /**
127
+ * Converts the results from a Bridged Resource response that contains multiple records.
128
+ *
129
+ * A bridged resource that is configured to return multiple results separates the field names
130
+ * from the record data. This is done to reduce the amount of bandwidth the response uses, but
131
+ * it is not the ideal format to work with.
132
+ *
133
+ * This function combines the field names array with the records array to produce an array of
134
+ * objects linking the field name to the field value for each record.
135
+ *
136
+ * @param {Object} responseJsonRecords - Kinetic Core bridge response parsed from JSON
137
+ * @returns {Object[]} Array of objects linking the field name to the field value of each record.
138
138
  */
139
139
  var convertMultipleBridgeRecords = exports.convertMultipleBridgeRecords = function convertMultipleBridgeRecords(responseJsonRecords) {
140
140
  return arraysToObject(responseJsonRecords.fields, responseJsonRecords.records);
@@ -14,9 +14,7 @@ var _apiGroup = (0, _http.apiGroup)({
14
14
  return '/fileResources';
15
15
  },
16
16
  transform: function transform(response) {
17
- return {
18
- fileResources: response.data.fileResources
19
- };
17
+ return response.data;
20
18
  }
21
19
  },
22
20
  singular: {
@@ -26,9 +24,7 @@ var _apiGroup = (0, _http.apiGroup)({
26
24
  return "/fileResources/".concat(fileResourceSlug);
27
25
  },
28
26
  transform: function transform(response) {
29
- return {
30
- fileResource: response.data.fileResource
31
- };
27
+ return response.data;
32
28
  }
33
29
  }
34
30
  }),
@@ -10,10 +10,18 @@ var _helpers = require("../../helpers");
10
10
  var _http = require("../http");
11
11
  var getPath = function getPath(kappSlug, formSlug) {
12
12
  var formSuffix = formSlug ? "/".concat(formSlug) : '';
13
- return kappSlug ? "".concat(_helpers.bundle.apiLocation(), "/kapps/").concat(kappSlug, "/forms").concat(formSuffix) // Default kapp to 'datastore' if not provided to support deprecated datastore functionality
14
- : "".concat(_helpers.bundle.apiLocation(), "/kapps/datastore/forms").concat(formSuffix);
13
+ return kappSlug ? "".concat(_helpers.bundle.apiLocation(), "/kapps/").concat(kappSlug, "/forms").concat(formSuffix) : // Default kapp to 'datastore' if not provided to support deprecated datastore functionality
14
+ "".concat(_helpers.bundle.apiLocation(), "/kapps/datastore/forms").concat(formSuffix);
15
15
  };
16
16
 
17
+ /**
18
+ * Retrieves all forms in the specified kapp.
19
+ *
20
+ * @param {Object} [options] - Options for the request.
21
+ * @param {string} [options.kappSlug] - The slug of the kapp. Defaults to 'datastore'.
22
+ * @returns {Promise<{forms: *, count: number, nextPageToken: string}>}
23
+ */
24
+
17
25
  // TODO: datastore is deprecated, remove datastore routes from paths.
18
26
  var fetchForms = exports.fetchForms = function fetchForms() {
19
27
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -32,6 +40,16 @@ var fetchForms = exports.fetchForms = function fetchForms() {
32
40
  };
33
41
  })["catch"](_http.handleErrors);
34
42
  };
43
+
44
+ /**
45
+ * Retrieves a single form by slug from the specified kapp.
46
+ *
47
+ * @param {Object} options - Options for the request.
48
+ * @param {string} options.formSlug - The slug of the form to retrieve.
49
+ * @param {string} [options.kappSlug] - The slug of the kapp. Defaults to 'datastore'.
50
+ * @returns {Promise<{form: *}>}
51
+ */
52
+
35
53
  var fetchForm = exports.fetchForm = function fetchForm() {
36
54
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
37
55
  var kappSlug = options.kappSlug,
@@ -51,6 +69,16 @@ var fetchForm = exports.fetchForm = function fetchForm() {
51
69
  };
52
70
  })["catch"](_http.handleErrors);
53
71
  };
72
+
73
+ /**
74
+ * Creates a new form in the specified kapp.
75
+ *
76
+ * @param {Object} options - Options for the request.
77
+ * @param {Object} options.form - The form definition to create.
78
+ * @param {string} [options.kappSlug] - The slug of the kapp. Defaults to 'datastore'.
79
+ * @returns {Promise<{form: *}>}
80
+ */
81
+
54
82
  var createForm = exports.createForm = function createForm() {
55
83
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
56
84
  var kappSlug = options.kappSlug,
@@ -68,6 +96,17 @@ var createForm = exports.createForm = function createForm() {
68
96
  };
69
97
  })["catch"](_http.handleErrors);
70
98
  };
99
+
100
+ /**
101
+ * Updates an existing form in the specified kapp.
102
+ *
103
+ * @param {Object} options - Options for the request.
104
+ * @param {string} options.formSlug - The slug of the form to update.
105
+ * @param {Object} options.form - The form object with updated values.
106
+ * @param {string} [options.kappSlug] - The slug of the kapp. Defaults to 'datastore'.
107
+ * @returns {Promise<{form: *}>}
108
+ */
109
+
71
110
  var updateForm = exports.updateForm = function updateForm() {
72
111
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
73
112
  var kappSlug = options.kappSlug,
@@ -89,6 +128,16 @@ var updateForm = exports.updateForm = function updateForm() {
89
128
  };
90
129
  })["catch"](_http.handleErrors);
91
130
  };
131
+
132
+ /**
133
+ * Deletes a form by slug from the specified kapp.
134
+ *
135
+ * @param {Object} options - Options for the request.
136
+ * @param {string} options.formSlug - The slug of the form to delete.
137
+ * @param {string} [options.kappSlug] - The slug of the kapp. Defaults to 'datastore'.
138
+ * @returns {Promise<{form: *}>}
139
+ */
140
+
92
141
  var deleteForm = exports.deleteForm = function deleteForm() {
93
142
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
94
143
  var kappSlug = options.kappSlug,
@@ -4,7 +4,6 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/regeneratorRuntime"));
5
5
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
6
6
  var _axios = _interopRequireDefault(require("axios"));
7
- var _createError = _interopRequireDefault(require("axios/lib/core/createError"));
8
7
  var _forms = require("./forms");
9
8
  var _form_builder = require("../../../tests/utils/form_builder");
10
9
  var _promises = require("../../../tests/utils/promises");
@@ -238,11 +237,15 @@ describe('forms api', function () {
238
237
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee2$(_context2) {
239
238
  while (1) switch (_context2.prev = _context2.next) {
240
239
  case 0:
241
- _axios["default"].post.mockRejectedValue((0, _createError["default"])('Request failed with status code 400', null, 400, null, {
242
- status: 400,
243
- statusText: 'Bad Request',
244
- data: {
245
- error: 'Invalid form'
240
+ _axios["default"].post.mockRejectedValue(Object.assign(new Error('Request failed with status code 400'), {
241
+ name: 'AxiosError',
242
+ isAxiosError: true,
243
+ response: {
244
+ status: 400,
245
+ statusText: 'Bad Request',
246
+ data: {
247
+ error: 'Invalid form'
248
+ }
246
249
  }
247
250
  }));
248
251
  _context2.next = 3;
@@ -273,10 +276,13 @@ describe('forms api', function () {
273
276
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee3$(_context3) {
274
277
  while (1) switch (_context3.prev = _context3.next) {
275
278
  case 0:
276
- _axios["default"].post.mockRejectedValue((0, _createError["default"])('Request failed with status code 403', null, 403, null, {
277
- status: 403,
278
- statusText: 'Forbidden',
279
- data: {}
279
+ _axios["default"].post.mockRejectedValue(Object.assign(new Error('Request failed with status code 403'), {
280
+ name: 'AxiosError',
281
+ isAxiosError: true,
282
+ response: {
283
+ status: 403,
284
+ statusText: 'Forbidden'
285
+ }
280
286
  }));
281
287
  _context3.next = 3;
282
288
  return (0, _forms.createForm)({
@@ -400,11 +406,15 @@ describe('forms api', function () {
400
406
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee5$(_context5) {
401
407
  while (1) switch (_context5.prev = _context5.next) {
402
408
  case 0:
403
- _axios["default"].put.mockRejectedValue((0, _createError["default"])('Request failed with status code 400', null, 400, null, {
404
- status: 400,
405
- statusText: 'Bad Request',
406
- data: {
407
- error: 'Invalid form'
409
+ _axios["default"].put.mockRejectedValue(Object.assign(new Error('Request failed with status code 400'), {
410
+ name: 'AxiosError',
411
+ isAxiosError: true,
412
+ response: {
413
+ status: 400,
414
+ statusText: 'Bad Request',
415
+ data: {
416
+ error: 'Invalid form'
417
+ }
408
418
  }
409
419
  }));
410
420
  _context5.next = 3;
@@ -436,10 +446,13 @@ describe('forms api', function () {
436
446
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee6$(_context6) {
437
447
  while (1) switch (_context6.prev = _context6.next) {
438
448
  case 0:
439
- _axios["default"].put.mockRejectedValue((0, _createError["default"])('Request failed with status code 403', null, 403, null, {
440
- status: 403,
441
- statusText: 'Forbidden',
442
- data: {}
449
+ _axios["default"].put.mockRejectedValue(Object.assign(new Error('Request failed with status code 403'), {
450
+ name: 'AxiosError',
451
+ isAxiosError: true,
452
+ response: {
453
+ status: 403,
454
+ statusText: 'Forbidden'
455
+ }
443
456
  }));
444
457
  _context6.next = 3;
445
458
  return (0, _forms.updateForm)({
@@ -8,6 +8,16 @@ exports.updateKapp = exports.fetchKapps = exports.fetchKapp = exports.deleteKapp
8
8
  var _axios = _interopRequireDefault(require("axios"));
9
9
  var _helpers = require("../../helpers");
10
10
  var _http = require("../http");
11
+ /**
12
+ * Fetch a list of kapps.
13
+ *
14
+ * @param {object} options - Options to configure the call to fetch kapps
15
+ * @param {string} options.kappSlug - The kapp slug to retrieve, defaults to the bundle kapp slug.
16
+ * @param {string} options.include - Additional data to include in the response
17
+ * @param {boolean} options.public - When true, do not send X-Kinetic-AuthAssumed header.
18
+ * @returns {Promise<{kapp: *}>}
19
+ */
20
+
11
21
  var fetchKapps = exports.fetchKapps = function fetchKapps() {
12
22
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
13
23
  // Build URL and fetch the space.
@@ -22,6 +32,17 @@ var fetchKapps = exports.fetchKapps = function fetchKapps() {
22
32
  };
23
33
  })["catch"](_http.handleErrors);
24
34
  };
35
+
36
+ /**
37
+ * Fetch a single kapp.
38
+ *
39
+ * @param {object} options - Options to configure the call to fetch kapps
40
+ * @param {string} options.kappSlug - The kapp slug to retrieve, defaults to the bundle kapp slug.
41
+ * @param {string} options.include - Additional data to include in the response
42
+ * @param {boolean} options.public - When true, do not send X-Kinetic-AuthAssumed header.
43
+ * @returns {Promise<{kapp: *}>}
44
+ */
45
+
25
46
  var fetchKapp = exports.fetchKapp = function fetchKapp() {
26
47
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
27
48
  var _options$kappSlug = options.kappSlug,
@@ -37,6 +58,16 @@ var fetchKapp = exports.fetchKapp = function fetchKapp() {
37
58
  };
38
59
  })["catch"](_http.handleErrors);
39
60
  };
61
+
62
+ /**
63
+ * Updates an existing kapp.
64
+ *
65
+ * @param {Object} options - Options for updating the kapp.
66
+ * @param {string} [options.kappSlug] - The slug of the kapp to update. Defaults to the bundle kapp slug.
67
+ * @param {Object} options.kapp - The kapp object containing updated values.
68
+ * @returns {Promise<{kapp: *}>}
69
+ */
70
+
40
71
  var updateKapp = exports.updateKapp = function updateKapp() {
41
72
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
42
73
  var _options$kappSlug2 = options.kappSlug,
@@ -57,6 +88,15 @@ var updateKapp = exports.updateKapp = function updateKapp() {
57
88
  };
58
89
  })["catch"](_http.handleErrors);
59
90
  };
91
+
92
+ /**
93
+ * Creates a new kapp.
94
+ *
95
+ * @param {Object} options - Options for creating the kapp.
96
+ * @param {Object} options.kapp - The kapp object to be created.
97
+ * @returns {Promise<{kapp: *}>}
98
+ */
99
+
60
100
  var createKapp = exports.createKapp = function createKapp() {
61
101
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
62
102
  var kapp = options.kapp;
@@ -72,6 +112,15 @@ var createKapp = exports.createKapp = function createKapp() {
72
112
  };
73
113
  })["catch"](_http.handleErrors);
74
114
  };
115
+
116
+ /**
117
+ * Deletes a kapp.
118
+ *
119
+ * @param {Object} options - Options for deleting the kapp.
120
+ * @param {string} options.kappSlug - The slug of the kapp to delete.
121
+ * @returns {Promise<{kapp: *}>}
122
+ */
123
+
75
124
  var deleteKapp = exports.deleteKapp = function deleteKapp() {
76
125
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
77
126
  var kappSlug = options.kappSlug;
@@ -4,7 +4,6 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/regeneratorRuntime"));
5
5
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
6
6
  var _axios = _interopRequireDefault(require("axios"));
7
- var _createError = _interopRequireDefault(require("axios/lib/core/createError"));
8
7
  var _kapps = require("./kapps");
9
8
  var _kapp_builder = require("../../../tests/utils/kapp_builder");
10
9
  var _promises = require("../../../tests/utils/promises");
@@ -249,11 +248,15 @@ describe('kapps api', function () {
249
248
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee3$(_context3) {
250
249
  while (1) switch (_context3.prev = _context3.next) {
251
250
  case 0:
252
- _axios["default"].put.mockRejectedValue((0, _createError["default"])('Request failed with status code 400', null, 400, null, {
253
- status: 400,
254
- statusText: 'Bad Request',
255
- data: {
256
- error: 'Invalid kapp'
251
+ _axios["default"].put.mockRejectedValue(Object.assign(new Error('Request failed with status code 400'), {
252
+ name: 'AxiosError',
253
+ isAxiosError: true,
254
+ response: {
255
+ status: 400,
256
+ statusText: 'Bad Request',
257
+ data: {
258
+ error: 'Invalid kapp'
259
+ }
257
260
  }
258
261
  }));
259
262
  _context3.next = 3;
@@ -284,10 +287,13 @@ describe('kapps api', function () {
284
287
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee4$(_context4) {
285
288
  while (1) switch (_context4.prev = _context4.next) {
286
289
  case 0:
287
- _axios["default"].put.mockRejectedValue((0, _createError["default"])('Request failed with status code 403', null, 403, null, {
288
- status: 403,
289
- statusText: 'Forbidden',
290
- data: {}
290
+ _axios["default"].put.mockRejectedValue(Object.assign(new Error('Request failed with status code 403'), {
291
+ name: 'AxiosError',
292
+ isAxiosError: true,
293
+ response: {
294
+ status: 403,
295
+ statusText: 'Forbidden'
296
+ }
291
297
  }));
292
298
  _context4.next = 3;
293
299
  return (0, _kapps.updateKapp)({
@@ -8,6 +8,13 @@ exports.fetchNotices = void 0;
8
8
  var _axios = _interopRequireDefault(require("axios"));
9
9
  var _helpers = require("../../helpers");
10
10
  var _http = require("../http");
11
+ /**
12
+ * Fetches a list of notices.
13
+ *
14
+ * @param {Object} [options] - Options to configure the request.
15
+ * @returns {Promise<{notices: *}>}
16
+ */
17
+
11
18
  var fetchNotices = exports.fetchNotices = function fetchNotices() {
12
19
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
13
20
  return _axios["default"].get(_helpers.bundle.apiLocation() + '/notices', {
@@ -4,7 +4,6 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/regeneratorRuntime"));
5
5
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
6
6
  var _axios = _interopRequireDefault(require("axios"));
7
- var _createError = _interopRequireDefault(require("axios/lib/core/createError"));
8
7
  var _securityPolicyDefinitions = require("./securityPolicyDefinitions");
9
8
  jest.mock('axios');
10
9
 
@@ -160,9 +159,13 @@ describe('securityPolicyDefinitions api', function () {
160
159
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee3$(_context3) {
161
160
  while (1) switch (_context3.prev = _context3.next) {
162
161
  case 0:
163
- _axios["default"].get.mockRejectedValue((0, _createError["default"])('Request failed with status code 403', null, 403, null, {
164
- status: 403,
165
- statusText: 'Forbidden'
162
+ _axios["default"].get.mockRejectedValue(Object.assign(new Error('Request failed with status code 403'), {
163
+ name: 'AxiosError',
164
+ isAxiosError: true,
165
+ response: {
166
+ status: 403,
167
+ statusText: 'Forbidden'
168
+ }
166
169
  }));
167
170
  _context3.next = 3;
168
171
  return (0, _securityPolicyDefinitions.fetchSecurityPolicyDefinitions)();
@@ -8,6 +8,14 @@ exports.updateSpace = exports.fetchSpace = void 0;
8
8
  var _axios = _interopRequireDefault(require("axios"));
9
9
  var _helpers = require("../../helpers");
10
10
  var _http = require("../http");
11
+ /**
12
+ * Fetches the current space or a specific space by slug.
13
+ *
14
+ * @param {Object} options - Options for fetching the space.
15
+ * @param {string} [options.slug] - The space slug to retrieve, defaults to the bundle kapp slug.
16
+ * @returns {Promise<{space: Object}>} Resolves with the fetched space object.
17
+ */
18
+
11
19
  var fetchSpace = exports.fetchSpace = function fetchSpace() {
12
20
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
13
21
  // Build URL and fetch the space.
@@ -20,6 +28,16 @@ var fetchSpace = exports.fetchSpace = function fetchSpace() {
20
28
  };
21
29
  })["catch"](_http.handleErrors);
22
30
  };
31
+
32
+ /**
33
+ * Updates a space with the provided space object.
34
+ *
35
+ * @param {Object} options - Options for updating the space.
36
+ * @param {Object} options.space - The space object containing updated values.
37
+ * @param {string} [options.slug] - The space slug to retrieve, defaults to the bundle kapp slug.
38
+ * @returns {Promise<{space: Object}>}
39
+ */
40
+
23
41
  var updateSpace = exports.updateSpace = function updateSpace() {
24
42
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
25
43
  var space = options.space;