@kineticdata/react 6.0.1 → 6.0.3

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 (258) hide show
  1. package/CHANGELOG.md +86 -0
  2. package/lib/apis/agent/adapters.js +2 -3
  3. package/lib/apis/agent/bridges.js +7 -13
  4. package/lib/apis/agent/handlers.js +7 -13
  5. package/lib/apis/core/activity.js +2 -3
  6. package/lib/apis/core/attributeDefinitions.js +6 -11
  7. package/lib/apis/core/attributeDefinitions.test.js +201 -213
  8. package/lib/apis/core/authentication.js +74 -84
  9. package/lib/apis/core/backgroundJobs.js +5 -9
  10. package/lib/apis/core/bridgeModelAttributeMappings.js +5 -10
  11. package/lib/apis/core/bridgeModelAttributes.js +6 -11
  12. package/lib/apis/core/bridgeModelMappings.js +5 -10
  13. package/lib/apis/core/bridgeModelQualificationMappings.js +5 -10
  14. package/lib/apis/core/bridgeModelQualifications.js +5 -10
  15. package/lib/apis/core/bridgeModels.js +7 -13
  16. package/lib/apis/core/bridgeModels.test.js +313 -333
  17. package/lib/apis/core/bridgedresources.js +7 -13
  18. package/lib/apis/core/categories.js +6 -11
  19. package/lib/apis/core/fileResources.js +5 -10
  20. package/lib/apis/core/filestores.js +5 -10
  21. package/lib/apis/core/formTypes.js +6 -11
  22. package/lib/apis/core/forms.js +6 -11
  23. package/lib/apis/core/forms.test.js +201 -213
  24. package/lib/apis/core/kapps.js +6 -11
  25. package/lib/apis/core/kapps.test.js +122 -130
  26. package/lib/apis/core/logs.js +3 -5
  27. package/lib/apis/core/memberships.js +3 -5
  28. package/lib/apis/core/meta.js +6 -11
  29. package/lib/apis/core/notices.js +2 -3
  30. package/lib/apis/core/oauthClients.js +6 -11
  31. package/lib/apis/core/platformComponents.js +10 -19
  32. package/lib/apis/core/platformItems.js +2 -3
  33. package/lib/apis/core/profile.js +3 -5
  34. package/lib/apis/core/securityPolicyDefinitions.js +6 -11
  35. package/lib/apis/core/securityPolicyDefinitions.test.js +254 -268
  36. package/lib/apis/core/space.js +3 -5
  37. package/lib/apis/core/space.test.js +106 -114
  38. package/lib/apis/core/submissions.js +19 -35
  39. package/lib/apis/core/teams.js +6 -11
  40. package/lib/apis/core/translations.js +18 -35
  41. package/lib/apis/core/translations.test.js +1343 -1437
  42. package/lib/apis/core/users.js +6 -11
  43. package/lib/apis/core/version.js +2 -3
  44. package/lib/apis/core/webApis.js +5 -10
  45. package/lib/apis/core/webhooks.js +6 -11
  46. package/lib/apis/core/webhooks.test.js +243 -257
  47. package/lib/apis/core/webhooksJobs.js +3 -5
  48. package/lib/apis/core/workflows.js +7 -13
  49. package/lib/apis/http.js +16 -31
  50. package/lib/apis/system/index.js +46 -91
  51. package/lib/apis/task/index.js +60 -119
  52. package/lib/components/agent/bridge/BridgeForm.js +1 -2
  53. package/lib/components/agent/bridge/BridgeTable.js +1 -2
  54. package/lib/components/agent/filestore/FilestoreForm.js +1 -2
  55. package/lib/components/agent/filestore/FilestoreTable.js +1 -2
  56. package/lib/components/agent/handler/AgentHandlerForm.js +1 -2
  57. package/lib/components/agent/handler/AgentHandlerTable.js +1 -2
  58. package/lib/components/common/AttributeSelect.js +2 -3
  59. package/lib/components/common/BridgeSelect.js +16 -17
  60. package/lib/components/common/ComponentConfigContext.js +1 -2
  61. package/lib/components/common/ContentEditable.js +23 -3
  62. package/lib/components/common/FormSelect.js +16 -17
  63. package/lib/components/common/NodeSelect.js +2 -3
  64. package/lib/components/common/Scroller.js +2 -3
  65. package/lib/components/common/StaticSelect.js +14 -15
  66. package/lib/components/common/TableInput.js +276 -63
  67. package/lib/components/common/TeamSelect.js +16 -17
  68. package/lib/components/common/ToastContainer.js +7 -12
  69. package/lib/components/common/Typeahead.js +15 -2
  70. package/lib/components/common/UserSelect.js +16 -17
  71. package/lib/components/common/authentication/AuthInterceptor.js +2 -3
  72. package/lib/components/common/authentication/AuthInterceptor.test.js +141 -153
  73. package/lib/components/common/authentication/AuthenticationContainer.js +332 -343
  74. package/lib/components/common/authentication/RequestInterceptor.js +2 -10
  75. package/lib/components/common/code_input/CodeInput.js +4 -9
  76. package/lib/components/common/code_input/draftHelpers.js +20 -37
  77. package/lib/components/common/code_input/languageHelpers.js +6 -12
  78. package/lib/components/common/code_input/languageHelpers.test.js +10 -8
  79. package/lib/components/common/defaults/Toast.js +1 -2
  80. package/lib/components/common/defaults/index.js +2 -3
  81. package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +1 -2
  82. package/lib/components/core/attribute_definition/AttributeDefinitionTable.js +1 -2
  83. package/lib/components/core/bridge_model/BridgeModelForm.js +52 -55
  84. package/lib/components/core/bridge_model/BridgeModelTable.js +1 -2
  85. package/lib/components/core/bridge_model_attribute/BridgeModelAttributeForm.js +1 -2
  86. package/lib/components/core/bridge_model_attribute/BridgeModelAttributeTable.js +1 -2
  87. package/lib/components/core/bridge_model_qualification/BridgeModelQualificationForm.js +1 -2
  88. package/lib/components/core/bridge_model_qualification/BridgeModelQualificationTable.js +1 -2
  89. package/lib/components/core/category/CategoryForm.js +1 -2
  90. package/lib/components/core/category/CategoryTable.js +1 -2
  91. package/lib/components/core/core_form/CoreForm.js +11 -22
  92. package/lib/components/core/core_form/defaults/index.js +11 -19
  93. package/lib/components/core/core_form/globals.js +3 -5
  94. package/lib/components/core/field_definition/FieldDefinitionForm.js +1 -2
  95. package/lib/components/core/field_definition/FieldDefinitionTable.js +2 -4
  96. package/lib/components/core/file_resource/FileResourceForm.js +1 -2
  97. package/lib/components/core/file_resource/FileResourceTable.js +1 -2
  98. package/lib/components/core/form/FormForm.js +4 -4
  99. package/lib/components/core/form/FormTable.js +1 -2
  100. package/lib/components/core/form_type/FormTypeForm.js +1 -2
  101. package/lib/components/core/form_type/FormTypeTable.js +1 -2
  102. package/lib/components/core/i18n/I18n.js +2 -4
  103. package/lib/components/core/i18n/I18nContext.js +1 -2
  104. package/lib/components/core/i18n/I18nProvider.js +2 -3
  105. package/lib/components/core/i18n/Moment.js +10 -9
  106. package/lib/components/core/index_definition/IndexDefinitionForm.js +1 -2
  107. package/lib/components/core/index_definition/IndexDefinitionTable.js +1 -2
  108. package/lib/components/core/index_job/IndexJobTable.js +1 -2
  109. package/lib/components/core/kapp/KappForm.js +1 -2
  110. package/lib/components/core/kapp/KappTable.js +1 -2
  111. package/lib/components/core/log/LogTable.js +2 -4
  112. package/lib/components/core/oauth_client/OAuthClientForm.js +1 -2
  113. package/lib/components/core/oauth_client/OAuthClientTable.js +1 -2
  114. package/lib/components/core/platform_component/AgentComponentForm.js +1 -2
  115. package/lib/components/core/platform_component/AgentComponentTable.js +1 -2
  116. package/lib/components/core/platform_component/TaskComponentForm.js +1 -2
  117. package/lib/components/core/profile/ProfileForm.js +1 -2
  118. package/lib/components/core/security_definition/SecurityDefinitionForm.js +3 -6
  119. package/lib/components/core/security_definition/SecurityDefinitionTable.js +1 -2
  120. package/lib/components/core/space/SpaceForm.js +1 -2
  121. package/lib/components/core/submission/DatastoreSubmissionFilters.js +3 -5
  122. package/lib/components/core/submission/DatastoreSubmissionTable.js +2 -4
  123. package/lib/components/core/submission/FormSubmissionFilters.js +4 -7
  124. package/lib/components/core/submission/FormSubmissionTable.js +2 -4
  125. package/lib/components/core/submission/KappSubmissionTable.js +2 -4
  126. package/lib/components/core/submission/SubmissionForm.js +1 -2
  127. package/lib/components/core/submission/SubmissionTable.js +2 -3
  128. package/lib/components/core/submission/helpers.js +4 -7
  129. package/lib/components/core/team/TeamForm.js +1 -2
  130. package/lib/components/core/team/TeamTable.js +1 -2
  131. package/lib/components/core/translation/ContextForm.js +1 -2
  132. package/lib/components/core/translation/ContextTable.js +1 -2
  133. package/lib/components/core/translation/EntryForm.js +1 -2
  134. package/lib/components/core/translation/EntryTable.js +1 -2
  135. package/lib/components/core/translation/LocaleForm.js +1 -2
  136. package/lib/components/core/translation/LocaleTable.js +1 -2
  137. package/lib/components/core/user/UserForm.js +1 -2
  138. package/lib/components/core/user/UserTable.js +1 -2
  139. package/lib/components/core/webapi/WebApiForm.js +97 -101
  140. package/lib/components/core/webapi/WebApiTable.js +1 -2
  141. package/lib/components/core/webhook/WebhookForm.js +1 -2
  142. package/lib/components/core/webhook/WebhookTable.js +1 -2
  143. package/lib/components/core/webhook_job/WebhookJobTable.js +1 -2
  144. package/lib/components/form/Form.helpers.js +10 -19
  145. package/lib/components/form/Form.js +312 -355
  146. package/lib/components/form/Form.models.js +6 -11
  147. package/lib/components/form/FormState.js +3 -3
  148. package/lib/components/form/KitchenSinkForm.js +23 -3
  149. package/lib/components/form/SimpleForm.helpers.js +262 -0
  150. package/lib/components/form/SimpleForm.js +462 -0
  151. package/lib/components/form/SimpleForm.models.js +62 -0
  152. package/lib/components/form/defaults/AttributesField.js +3 -4
  153. package/lib/components/form/defaults/CheckboxField.js +2 -3
  154. package/lib/components/form/defaults/CodeField.js +2 -3
  155. package/lib/components/form/defaults/FormButtons.js +2 -3
  156. package/lib/components/form/defaults/FormError.js +2 -3
  157. package/lib/components/form/defaults/FormField.js +2 -3
  158. package/lib/components/form/defaults/FormLayout.js +2 -3
  159. package/lib/components/form/defaults/FormMultiField.js +2 -3
  160. package/lib/components/form/defaults/PasswordField.js +2 -3
  161. package/lib/components/form/defaults/RadioField.js +2 -3
  162. package/lib/components/form/defaults/SampleTeamsRolesFIeld.js +2 -3
  163. package/lib/components/form/defaults/SelectField.js +2 -3
  164. package/lib/components/form/defaults/SelectMultiField.js +2 -3
  165. package/lib/components/form/defaults/TableField.js +2 -3
  166. package/lib/components/form/defaults/TeamField.js +2 -3
  167. package/lib/components/form/defaults/TeamMultiField.js +2 -3
  168. package/lib/components/form/defaults/TextField.js +2 -3
  169. package/lib/components/form/defaults/TextMultiField.js +2 -3
  170. package/lib/components/form/defaults/UserField.js +2 -3
  171. package/lib/components/form/defaults/UserMultiField.js +2 -3
  172. package/lib/components/form/defaults/index.js +2 -3
  173. package/lib/components/form/tests/Form.test.js +4354 -4508
  174. package/lib/components/form/tests/components.js +73 -64
  175. package/lib/components/index.js +7 -0
  176. package/lib/components/system/SystemBackgroundTasksTable.js +1 -2
  177. package/lib/components/system/SystemCassandraForm.js +1 -2
  178. package/lib/components/system/SystemElasticSearchForm.js +1 -2
  179. package/lib/components/system/SystemFilestoreForm.js +2 -3
  180. package/lib/components/system/SystemForm.js +1 -2
  181. package/lib/components/system/SystemIngressForm.js +1 -2
  182. package/lib/components/system/SystemSecurityForm.js +1 -2
  183. package/lib/components/system/SystemSmtpForm.js +1 -2
  184. package/lib/components/system/SystemTaskAdapterForm.js +1 -2
  185. package/lib/components/system/SystemTrustedCertificateForm.js +1 -2
  186. package/lib/components/system/SystemTrustedCertificatesTable.js +1 -2
  187. package/lib/components/system/SystemUserForm.js +1 -2
  188. package/lib/components/system/helpers.js +11 -21
  189. package/lib/components/system/spaces/SystemSpaceForm.js +2 -3
  190. package/lib/components/system/spaces/SystemTenantForm.js +2 -3
  191. package/lib/components/system/spaces/SystemTenantTable.js +1 -2
  192. package/lib/components/table/Table.js +48 -51
  193. package/lib/components/table/Table.redux.js +161 -188
  194. package/lib/components/table/Table.test.js +115 -123
  195. package/lib/components/table/defaults/BodyCell.js +1 -2
  196. package/lib/components/table/defaults/BodyRow.js +1 -2
  197. package/lib/components/table/defaults/BooleanFilter.js +1 -2
  198. package/lib/components/table/defaults/ColumnControl.js +1 -2
  199. package/lib/components/table/defaults/EmptyBodyRow.js +1 -2
  200. package/lib/components/table/defaults/FilterLayout.js +1 -2
  201. package/lib/components/table/defaults/Footer.js +1 -2
  202. package/lib/components/table/defaults/FooterCell.js +1 -2
  203. package/lib/components/table/defaults/FooterRow.js +1 -2
  204. package/lib/components/table/defaults/Header.js +1 -2
  205. package/lib/components/table/defaults/HeaderCell.js +1 -2
  206. package/lib/components/table/defaults/HeaderRow.js +1 -2
  207. package/lib/components/table/defaults/PaginationControl.js +2 -4
  208. package/lib/components/table/defaults/TableBody.js +1 -2
  209. package/lib/components/table/defaults/TableLayout.js +1 -2
  210. package/lib/components/table/defaults/TextFilter.js +1 -2
  211. package/lib/components/table/defaults/index.js +2 -3
  212. package/lib/components/table/tests/Table.redux.test.js +162 -0
  213. package/lib/components/table/tests/Table.test.js +767 -0
  214. package/lib/components/table/tests/components.js +182 -0
  215. package/lib/components/task/builder/Connector.js +26 -11
  216. package/lib/components/task/builder/ConnectorForm.js +1 -2
  217. package/lib/components/task/builder/Node.js +18 -9
  218. package/lib/components/task/builder/NodeForm.js +1 -2
  219. package/lib/components/task/builder/NodeParametersForm.js +1 -2
  220. package/lib/components/task/builder/SvgCanvas.js +2 -3
  221. package/lib/components/task/builder/SvgText.js +2 -3
  222. package/lib/components/task/builder/TaskDefinitionConfigForm.js +3 -6
  223. package/lib/components/task/builder/TreeBuilder.js +14 -5
  224. package/lib/components/task/builder/builder.redux.js +187 -186
  225. package/lib/components/task/builder/constants.js +38 -76
  226. package/lib/components/task/builder/helpers.js +23 -40
  227. package/lib/components/task/builder/models.js +24 -35
  228. package/lib/components/task/category/TaskCategoryForm.js +2 -3
  229. package/lib/components/task/category/TaskCategoryTable.js +1 -2
  230. package/lib/components/task/common/UsageTable.js +1 -2
  231. package/lib/components/task/engine/EngineSettingsForm.js +2 -3
  232. package/lib/components/task/errors/RunErrorTable.js +2 -3
  233. package/lib/components/task/errors/SystemErrorsTable.js +1 -2
  234. package/lib/components/task/handlers/HandlerForm.js +2 -3
  235. package/lib/components/task/handlers/HandlerTable.js +1 -2
  236. package/lib/components/task/handlers/MissingHandlerTable.js +1 -2
  237. package/lib/components/task/policy_rule/PolicyRuleForm.js +2 -3
  238. package/lib/components/task/policy_rule/PolicyRuleTable.js +1 -2
  239. package/lib/components/task/runs/CreateManualTriggerForm.js +1 -2
  240. package/lib/components/task/runs/RunTable.js +2 -3
  241. package/lib/components/task/runs/RunTaskTable.js +1 -2
  242. package/lib/components/task/sources/SourceForm.js +1 -2
  243. package/lib/components/task/sources/SourceTable.js +1 -2
  244. package/lib/components/task/triggers/TriggerTable.js +2 -3
  245. package/lib/components/task/workflows/LinkedWorkflowForm.js +3 -5
  246. package/lib/components/task/workflows/LinkedWorkflowTable.js +1 -2
  247. package/lib/components/task/workflows/MissingRoutineTable.js +1 -2
  248. package/lib/components/task/workflows/WorkflowForm.js +91 -41
  249. package/lib/components/task/workflows/WorkflowTable.js +1 -2
  250. package/lib/helpers/SearchBuilder.js +2 -4
  251. package/lib/helpers/index.js +13 -26
  252. package/lib/index.js +3 -6
  253. package/lib/reducer.js +3 -5
  254. package/lib/saga.js +32 -48
  255. package/lib/store.js +32 -42
  256. package/package.json +12 -15
  257. package/lib/components/core/CoreFormModal.js +0 -64
  258. package/lib/components/core/CoreModal.js +0 -114
@@ -26,37 +26,12 @@ describe('attributeDefinitions api', function () {
26
26
  test('success space scoped attribute', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee() {
27
27
  var result;
28
28
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee$(_context) {
29
- while (1) {
30
- switch (_context.prev = _context.next) {
31
- case 0:
32
- _axios["default"].get.mockResolvedValue({
33
- status: 200,
34
- data: {
35
- spaceAttributeDefinitions: [{
36
- allowsMultiple: false,
37
- description: 'Slug of this spaces Admin Kapp (typically admin)',
38
- name: 'Admin Kapp Slug'
39
- }, {
40
- allowsMultiple: false,
41
- description: null,
42
- name: 'Bundle Package Version'
43
- }]
44
- }
45
- });
46
- _context.next = 3;
47
- return (0, _attributeDefinitions.fetchAttributeDefinitions)({
48
- attributeType: 'spaceAttributeDefinitions'
49
- });
50
- case 3:
51
- result = _context.sent;
52
- expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/spaceAttributeDefinitions', {
53
- params: {},
54
- headers: {
55
- 'X-Kinetic-AuthAssumed': 'true'
56
- }
57
- }]]);
58
- expect(result).toEqual({
59
- attributeDefinitions: [{
29
+ while (1) switch (_context.prev = _context.next) {
30
+ case 0:
31
+ _axios["default"].get.mockResolvedValue({
32
+ status: 200,
33
+ data: {
34
+ spaceAttributeDefinitions: [{
60
35
  allowsMultiple: false,
61
36
  description: 'Slug of this spaces Admin Kapp (typically admin)',
62
37
  name: 'Admin Kapp Slug'
@@ -65,49 +40,46 @@ describe('attributeDefinitions api', function () {
65
40
  description: null,
66
41
  name: 'Bundle Package Version'
67
42
  }]
68
- });
69
- case 6:
70
- case "end":
71
- return _context.stop();
72
- }
43
+ }
44
+ });
45
+ _context.next = 3;
46
+ return (0, _attributeDefinitions.fetchAttributeDefinitions)({
47
+ attributeType: 'spaceAttributeDefinitions'
48
+ });
49
+ case 3:
50
+ result = _context.sent;
51
+ expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/spaceAttributeDefinitions', {
52
+ params: {},
53
+ headers: {
54
+ 'X-Kinetic-AuthAssumed': 'true'
55
+ }
56
+ }]]);
57
+ expect(result).toEqual({
58
+ attributeDefinitions: [{
59
+ allowsMultiple: false,
60
+ description: 'Slug of this spaces Admin Kapp (typically admin)',
61
+ name: 'Admin Kapp Slug'
62
+ }, {
63
+ allowsMultiple: false,
64
+ description: null,
65
+ name: 'Bundle Package Version'
66
+ }]
67
+ });
68
+ case 6:
69
+ case "end":
70
+ return _context.stop();
73
71
  }
74
72
  }, _callee);
75
73
  })));
76
74
  test('success kapp scoped attribute', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee2() {
77
75
  var result;
78
76
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee2$(_context2) {
79
- while (1) {
80
- switch (_context2.prev = _context2.next) {
81
- case 0:
82
- _axios["default"].get.mockResolvedValue({
83
- status: 200,
84
- data: {
85
- categoryAttributeDefinitions: [{
86
- allowsMultiple: false,
87
- description: 'Slug of this spaces Admin Kapp (typically admin)',
88
- name: 'Admin Kapp Slug'
89
- }, {
90
- allowsMultiple: false,
91
- description: null,
92
- name: 'Bundle Package Version'
93
- }]
94
- }
95
- });
96
- _context2.next = 3;
97
- return (0, _attributeDefinitions.fetchAttributeDefinitions)({
98
- attributeType: 'categoryAttributeDefinitions',
99
- kappSlug: 'services'
100
- });
101
- case 3:
102
- result = _context2.sent;
103
- expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/kapps/services/categoryAttributeDefinitions', {
104
- params: {},
105
- headers: {
106
- 'X-Kinetic-AuthAssumed': 'true'
107
- }
108
- }]]);
109
- expect(result).toEqual({
110
- attributeDefinitions: [{
77
+ while (1) switch (_context2.prev = _context2.next) {
78
+ case 0:
79
+ _axios["default"].get.mockResolvedValue({
80
+ status: 200,
81
+ data: {
82
+ categoryAttributeDefinitions: [{
111
83
  allowsMultiple: false,
112
84
  description: 'Slug of this spaces Admin Kapp (typically admin)',
113
85
  name: 'Admin Kapp Slug'
@@ -116,11 +88,35 @@ describe('attributeDefinitions api', function () {
116
88
  description: null,
117
89
  name: 'Bundle Package Version'
118
90
  }]
119
- });
120
- case 6:
121
- case "end":
122
- return _context2.stop();
123
- }
91
+ }
92
+ });
93
+ _context2.next = 3;
94
+ return (0, _attributeDefinitions.fetchAttributeDefinitions)({
95
+ attributeType: 'categoryAttributeDefinitions',
96
+ kappSlug: 'services'
97
+ });
98
+ case 3:
99
+ result = _context2.sent;
100
+ expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/kapps/services/categoryAttributeDefinitions', {
101
+ params: {},
102
+ headers: {
103
+ 'X-Kinetic-AuthAssumed': 'true'
104
+ }
105
+ }]]);
106
+ expect(result).toEqual({
107
+ attributeDefinitions: [{
108
+ allowsMultiple: false,
109
+ description: 'Slug of this spaces Admin Kapp (typically admin)',
110
+ name: 'Admin Kapp Slug'
111
+ }, {
112
+ allowsMultiple: false,
113
+ description: null,
114
+ name: 'Bundle Package Version'
115
+ }]
116
+ });
117
+ case 6:
118
+ case "end":
119
+ return _context2.stop();
124
120
  }
125
121
  }, _callee2);
126
122
  })));
@@ -134,37 +130,35 @@ describe('attributeDefinitions api', function () {
134
130
  test('forbidden', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee3() {
135
131
  var result;
136
132
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee3$(_context3) {
137
- while (1) {
138
- switch (_context3.prev = _context3.next) {
139
- case 0:
140
- _axios["default"].get.mockRejectedValue((0, _createError["default"])('Request failed with status code 403', null, 403, null, {
141
- status: 403,
142
- statusText: 'Forbidden'
143
- }));
144
- _context3.next = 3;
145
- return (0, _attributeDefinitions.fetchAttributeDefinitions)({
146
- attributeType: 'spaceAttributeDefinitions'
147
- });
148
- case 3:
149
- result = _context3.sent;
150
- expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/spaceAttributeDefinitions', {
151
- params: {},
152
- headers: {
153
- 'X-Kinetic-AuthAssumed': 'true'
154
- }
155
- }]]);
156
- expect(result).toEqual({
157
- error: {
158
- statusCode: 403,
159
- key: null,
160
- forbidden: true,
161
- message: 'Forbidden'
162
- }
163
- });
164
- case 6:
165
- case "end":
166
- return _context3.stop();
167
- }
133
+ while (1) switch (_context3.prev = _context3.next) {
134
+ case 0:
135
+ _axios["default"].get.mockRejectedValue((0, _createError["default"])('Request failed with status code 403', null, 403, null, {
136
+ status: 403,
137
+ statusText: 'Forbidden'
138
+ }));
139
+ _context3.next = 3;
140
+ return (0, _attributeDefinitions.fetchAttributeDefinitions)({
141
+ attributeType: 'spaceAttributeDefinitions'
142
+ });
143
+ case 3:
144
+ result = _context3.sent;
145
+ expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/spaceAttributeDefinitions', {
146
+ params: {},
147
+ headers: {
148
+ 'X-Kinetic-AuthAssumed': 'true'
149
+ }
150
+ }]]);
151
+ expect(result).toEqual({
152
+ error: {
153
+ statusCode: 403,
154
+ key: null,
155
+ forbidden: true,
156
+ message: 'Forbidden'
157
+ }
158
+ });
159
+ case 6:
160
+ case "end":
161
+ return _context3.stop();
168
162
  }
169
163
  }, _callee3);
170
164
  })));
@@ -176,41 +170,39 @@ describe('attributeDefinitions api', function () {
176
170
  test('success', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee4() {
177
171
  var result;
178
172
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee4$(_context4) {
179
- while (1) {
180
- switch (_context4.prev = _context4.next) {
181
- case 0:
182
- _axios["default"].get.mockResolvedValue({
183
- status: 200,
184
- data: {
185
- spaceAttributeDefinition: {
186
- allowsMultiple: false,
187
- name: 'Foo'
188
- }
189
- }
190
- });
191
- _context4.next = 3;
192
- return (0, _attributeDefinitions.fetchAttributeDefinition)({
193
- attributeType: 'spaceAttributeDefinitions',
194
- attributeName: 'Foo'
195
- });
196
- case 3:
197
- result = _context4.sent;
198
- expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/spaceAttributeDefinitions/Foo', {
199
- params: {},
200
- headers: {
201
- 'X-Kinetic-AuthAssumed': 'true'
202
- }
203
- }]]);
204
- expect(result).toEqual({
205
- attributeDefinition: {
173
+ while (1) switch (_context4.prev = _context4.next) {
174
+ case 0:
175
+ _axios["default"].get.mockResolvedValue({
176
+ status: 200,
177
+ data: {
178
+ spaceAttributeDefinition: {
206
179
  allowsMultiple: false,
207
180
  name: 'Foo'
208
181
  }
209
- });
210
- case 6:
211
- case "end":
212
- return _context4.stop();
213
- }
182
+ }
183
+ });
184
+ _context4.next = 3;
185
+ return (0, _attributeDefinitions.fetchAttributeDefinition)({
186
+ attributeType: 'spaceAttributeDefinitions',
187
+ attributeName: 'Foo'
188
+ });
189
+ case 3:
190
+ result = _context4.sent;
191
+ expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/spaceAttributeDefinitions/Foo', {
192
+ params: {},
193
+ headers: {
194
+ 'X-Kinetic-AuthAssumed': 'true'
195
+ }
196
+ }]]);
197
+ expect(result).toEqual({
198
+ attributeDefinition: {
199
+ allowsMultiple: false,
200
+ name: 'Foo'
201
+ }
202
+ });
203
+ case 6:
204
+ case "end":
205
+ return _context4.stop();
214
206
  }
215
207
  }, _callee4);
216
208
  })));
@@ -230,51 +222,49 @@ describe('attributeDefinitions api', function () {
230
222
  test('success create attribute definition', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee5() {
231
223
  var result;
232
224
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee5$(_context5) {
233
- while (1) {
234
- switch (_context5.prev = _context5.next) {
235
- case 0:
236
- _axios["default"].post.mockResolvedValue({
237
- status: 200,
238
- data: {
239
- spaceAttributeDefinition: {
240
- name: 'Test Attribute',
241
- description: 'Test Attr Desc',
242
- allowsMultiple: true
243
- }
244
- }
245
- });
246
- _context5.next = 3;
247
- return (0, _attributeDefinitions.createAttributeDefinition)({
248
- attributeType: 'spaceAttributeDefinitions',
249
- attributeDefinition: {
225
+ while (1) switch (_context5.prev = _context5.next) {
226
+ case 0:
227
+ _axios["default"].post.mockResolvedValue({
228
+ status: 200,
229
+ data: {
230
+ spaceAttributeDefinition: {
250
231
  name: 'Test Attribute',
251
232
  description: 'Test Attr Desc',
252
233
  allowsMultiple: true
253
234
  }
254
- });
255
- case 3:
256
- result = _context5.sent;
257
- expect(_axios["default"].post.mock.calls).toEqual([['space/app/api/v1/spaceAttributeDefinitions', {
235
+ }
236
+ });
237
+ _context5.next = 3;
238
+ return (0, _attributeDefinitions.createAttributeDefinition)({
239
+ attributeType: 'spaceAttributeDefinitions',
240
+ attributeDefinition: {
258
241
  name: 'Test Attribute',
259
242
  description: 'Test Attr Desc',
260
243
  allowsMultiple: true
261
- }, {
262
- params: {},
263
- headers: {
264
- 'X-Kinetic-AuthAssumed': 'true'
265
- }
266
- }]]);
267
- expect(result).toEqual({
268
- attributeDefinition: {
269
- name: 'Test Attribute',
270
- description: 'Test Attr Desc',
271
- allowsMultiple: true
272
- }
273
- });
274
- case 6:
275
- case "end":
276
- return _context5.stop();
277
- }
244
+ }
245
+ });
246
+ case 3:
247
+ result = _context5.sent;
248
+ expect(_axios["default"].post.mock.calls).toEqual([['space/app/api/v1/spaceAttributeDefinitions', {
249
+ name: 'Test Attribute',
250
+ description: 'Test Attr Desc',
251
+ allowsMultiple: true
252
+ }, {
253
+ params: {},
254
+ headers: {
255
+ 'X-Kinetic-AuthAssumed': 'true'
256
+ }
257
+ }]]);
258
+ expect(result).toEqual({
259
+ attributeDefinition: {
260
+ name: 'Test Attribute',
261
+ description: 'Test Attr Desc',
262
+ allowsMultiple: true
263
+ }
264
+ });
265
+ case 6:
266
+ case "end":
267
+ return _context5.stop();
278
268
  }
279
269
  }, _callee5);
280
270
  })));
@@ -293,52 +283,50 @@ describe('attributeDefinitions api', function () {
293
283
  test('success update attribute definition', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee6() {
294
284
  var result;
295
285
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee6$(_context6) {
296
- while (1) {
297
- switch (_context6.prev = _context6.next) {
298
- case 0:
299
- _axios["default"].put.mockResolvedValue({
300
- status: 200,
301
- data: {
302
- spaceAttributeDefinition: {
303
- name: 'Test Attribute',
304
- description: 'Test Attr Desc',
305
- allowsMultiple: true
306
- }
307
- }
308
- });
309
- _context6.next = 3;
310
- return (0, _attributeDefinitions.updateAttributeDefinition)({
311
- attributeType: 'spaceAttributeDefinitions',
312
- attributeName: 'Test Attribute',
313
- attributeDefinition: {
286
+ while (1) switch (_context6.prev = _context6.next) {
287
+ case 0:
288
+ _axios["default"].put.mockResolvedValue({
289
+ status: 200,
290
+ data: {
291
+ spaceAttributeDefinition: {
314
292
  name: 'Test Attribute',
315
293
  description: 'Test Attr Desc',
316
294
  allowsMultiple: true
317
295
  }
318
- });
319
- case 3:
320
- result = _context6.sent;
321
- expect(_axios["default"].put.mock.calls).toEqual([['space/app/api/v1/spaceAttributeDefinitions/Test%20Attribute', {
296
+ }
297
+ });
298
+ _context6.next = 3;
299
+ return (0, _attributeDefinitions.updateAttributeDefinition)({
300
+ attributeType: 'spaceAttributeDefinitions',
301
+ attributeName: 'Test Attribute',
302
+ attributeDefinition: {
322
303
  name: 'Test Attribute',
323
304
  description: 'Test Attr Desc',
324
305
  allowsMultiple: true
325
- }, {
326
- params: {},
327
- headers: {
328
- 'X-Kinetic-AuthAssumed': 'true'
329
- }
330
- }]]);
331
- expect(result).toEqual({
332
- attributeDefinition: {
333
- name: 'Test Attribute',
334
- description: 'Test Attr Desc',
335
- allowsMultiple: true
336
- }
337
- });
338
- case 6:
339
- case "end":
340
- return _context6.stop();
341
- }
306
+ }
307
+ });
308
+ case 3:
309
+ result = _context6.sent;
310
+ expect(_axios["default"].put.mock.calls).toEqual([['space/app/api/v1/spaceAttributeDefinitions/Test%20Attribute', {
311
+ name: 'Test Attribute',
312
+ description: 'Test Attr Desc',
313
+ allowsMultiple: true
314
+ }, {
315
+ params: {},
316
+ headers: {
317
+ 'X-Kinetic-AuthAssumed': 'true'
318
+ }
319
+ }]]);
320
+ expect(result).toEqual({
321
+ attributeDefinition: {
322
+ name: 'Test Attribute',
323
+ description: 'Test Attr Desc',
324
+ allowsMultiple: true
325
+ }
326
+ });
327
+ case 6:
328
+ case "end":
329
+ return _context6.stop();
342
330
  }
343
331
  }, _callee6);
344
332
  })));