@kineticdata/react 6.0.1 → 6.0.2
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/lib/apis/agent/adapters.js +2 -3
- package/lib/apis/agent/bridges.js +7 -13
- package/lib/apis/agent/handlers.js +7 -13
- package/lib/apis/core/activity.js +2 -3
- package/lib/apis/core/attributeDefinitions.js +6 -11
- package/lib/apis/core/attributeDefinitions.test.js +201 -213
- package/lib/apis/core/authentication.js +74 -84
- package/lib/apis/core/backgroundJobs.js +5 -9
- package/lib/apis/core/bridgeModelAttributeMappings.js +5 -10
- package/lib/apis/core/bridgeModelAttributes.js +6 -11
- package/lib/apis/core/bridgeModelMappings.js +5 -10
- package/lib/apis/core/bridgeModelQualificationMappings.js +5 -10
- package/lib/apis/core/bridgeModelQualifications.js +5 -10
- package/lib/apis/core/bridgeModels.js +7 -13
- package/lib/apis/core/bridgeModels.test.js +313 -333
- package/lib/apis/core/bridgedresources.js +7 -13
- package/lib/apis/core/categories.js +6 -11
- package/lib/apis/core/fileResources.js +5 -10
- package/lib/apis/core/filestores.js +5 -10
- package/lib/apis/core/formTypes.js +6 -11
- package/lib/apis/core/forms.js +6 -11
- package/lib/apis/core/forms.test.js +201 -213
- package/lib/apis/core/kapps.js +6 -11
- package/lib/apis/core/kapps.test.js +122 -130
- package/lib/apis/core/logs.js +3 -5
- package/lib/apis/core/memberships.js +3 -5
- package/lib/apis/core/meta.js +6 -11
- package/lib/apis/core/notices.js +2 -3
- package/lib/apis/core/oauthClients.js +6 -11
- package/lib/apis/core/platformComponents.js +10 -19
- package/lib/apis/core/platformItems.js +2 -3
- package/lib/apis/core/profile.js +3 -5
- package/lib/apis/core/securityPolicyDefinitions.js +6 -11
- package/lib/apis/core/securityPolicyDefinitions.test.js +254 -268
- package/lib/apis/core/space.js +3 -5
- package/lib/apis/core/space.test.js +106 -114
- package/lib/apis/core/submissions.js +17 -33
- package/lib/apis/core/teams.js +6 -11
- package/lib/apis/core/translations.js +18 -35
- package/lib/apis/core/translations.test.js +1343 -1437
- package/lib/apis/core/users.js +6 -11
- package/lib/apis/core/version.js +2 -3
- package/lib/apis/core/webApis.js +5 -10
- package/lib/apis/core/webhooks.js +6 -11
- package/lib/apis/core/webhooks.test.js +243 -257
- package/lib/apis/core/webhooksJobs.js +3 -5
- package/lib/apis/core/workflows.js +7 -13
- package/lib/apis/http.js +16 -31
- package/lib/apis/system/index.js +46 -91
- package/lib/apis/task/index.js +60 -119
- package/lib/components/agent/bridge/BridgeForm.js +1 -2
- package/lib/components/agent/bridge/BridgeTable.js +1 -2
- package/lib/components/agent/filestore/FilestoreForm.js +1 -2
- package/lib/components/agent/filestore/FilestoreTable.js +1 -2
- package/lib/components/agent/handler/AgentHandlerForm.js +1 -2
- package/lib/components/agent/handler/AgentHandlerTable.js +1 -2
- package/lib/components/common/AttributeSelect.js +2 -3
- package/lib/components/common/BridgeSelect.js +16 -17
- package/lib/components/common/ComponentConfigContext.js +1 -2
- package/lib/components/common/ContentEditable.js +23 -3
- package/lib/components/common/FormSelect.js +16 -17
- package/lib/components/common/NodeSelect.js +2 -3
- package/lib/components/common/Scroller.js +2 -3
- package/lib/components/common/StaticSelect.js +14 -15
- package/lib/components/common/TableInput.js +276 -63
- package/lib/components/common/TeamSelect.js +16 -17
- package/lib/components/common/ToastContainer.js +7 -12
- package/lib/components/common/Typeahead.js +15 -2
- package/lib/components/common/UserSelect.js +16 -17
- package/lib/components/common/authentication/AuthInterceptor.js +2 -3
- package/lib/components/common/authentication/AuthInterceptor.test.js +141 -153
- package/lib/components/common/authentication/AuthenticationContainer.js +332 -343
- package/lib/components/common/authentication/RequestInterceptor.js +2 -10
- package/lib/components/common/code_input/CodeInput.js +4 -9
- package/lib/components/common/code_input/draftHelpers.js +20 -37
- package/lib/components/common/code_input/languageHelpers.js +6 -12
- package/lib/components/common/code_input/languageHelpers.test.js +10 -8
- package/lib/components/common/defaults/Toast.js +1 -2
- package/lib/components/common/defaults/index.js +2 -3
- package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +1 -2
- package/lib/components/core/attribute_definition/AttributeDefinitionTable.js +1 -2
- package/lib/components/core/bridge_model/BridgeModelForm.js +52 -55
- package/lib/components/core/bridge_model/BridgeModelTable.js +1 -2
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeForm.js +1 -2
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeTable.js +1 -2
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationForm.js +1 -2
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationTable.js +1 -2
- package/lib/components/core/category/CategoryForm.js +1 -2
- package/lib/components/core/category/CategoryTable.js +1 -2
- package/lib/components/core/core_form/CoreForm.js +11 -22
- package/lib/components/core/core_form/defaults/index.js +11 -19
- package/lib/components/core/core_form/globals.js +3 -5
- package/lib/components/core/field_definition/FieldDefinitionForm.js +1 -2
- package/lib/components/core/field_definition/FieldDefinitionTable.js +2 -4
- package/lib/components/core/file_resource/FileResourceForm.js +1 -2
- package/lib/components/core/file_resource/FileResourceTable.js +1 -2
- package/lib/components/core/form/FormForm.js +1 -2
- package/lib/components/core/form/FormTable.js +1 -2
- package/lib/components/core/form_type/FormTypeForm.js +1 -2
- package/lib/components/core/form_type/FormTypeTable.js +1 -2
- package/lib/components/core/i18n/I18n.js +2 -4
- package/lib/components/core/i18n/I18nContext.js +1 -2
- package/lib/components/core/i18n/I18nProvider.js +2 -3
- package/lib/components/core/i18n/Moment.js +10 -9
- package/lib/components/core/index_definition/IndexDefinitionForm.js +1 -2
- package/lib/components/core/index_definition/IndexDefinitionTable.js +1 -2
- package/lib/components/core/index_job/IndexJobTable.js +1 -2
- package/lib/components/core/kapp/KappForm.js +1 -2
- package/lib/components/core/kapp/KappTable.js +1 -2
- package/lib/components/core/log/LogTable.js +2 -4
- package/lib/components/core/oauth_client/OAuthClientForm.js +1 -2
- package/lib/components/core/oauth_client/OAuthClientTable.js +1 -2
- package/lib/components/core/platform_component/AgentComponentForm.js +1 -2
- package/lib/components/core/platform_component/AgentComponentTable.js +1 -2
- package/lib/components/core/platform_component/TaskComponentForm.js +1 -2
- package/lib/components/core/profile/ProfileForm.js +1 -2
- package/lib/components/core/security_definition/SecurityDefinitionForm.js +3 -6
- package/lib/components/core/security_definition/SecurityDefinitionTable.js +1 -2
- package/lib/components/core/space/SpaceForm.js +1 -2
- package/lib/components/core/submission/DatastoreSubmissionFilters.js +3 -5
- package/lib/components/core/submission/DatastoreSubmissionTable.js +2 -4
- package/lib/components/core/submission/FormSubmissionFilters.js +4 -7
- package/lib/components/core/submission/FormSubmissionTable.js +2 -4
- package/lib/components/core/submission/KappSubmissionTable.js +2 -4
- package/lib/components/core/submission/SubmissionForm.js +1 -2
- package/lib/components/core/submission/SubmissionTable.js +2 -3
- package/lib/components/core/submission/helpers.js +4 -7
- package/lib/components/core/team/TeamForm.js +1 -2
- package/lib/components/core/team/TeamTable.js +1 -2
- package/lib/components/core/translation/ContextForm.js +1 -2
- package/lib/components/core/translation/ContextTable.js +1 -2
- package/lib/components/core/translation/EntryForm.js +1 -2
- package/lib/components/core/translation/EntryTable.js +1 -2
- package/lib/components/core/translation/LocaleForm.js +1 -2
- package/lib/components/core/translation/LocaleTable.js +1 -2
- package/lib/components/core/user/UserForm.js +1 -2
- package/lib/components/core/user/UserTable.js +1 -2
- package/lib/components/core/webapi/WebApiForm.js +97 -101
- package/lib/components/core/webapi/WebApiTable.js +1 -2
- package/lib/components/core/webhook/WebhookForm.js +1 -2
- package/lib/components/core/webhook/WebhookTable.js +1 -2
- package/lib/components/core/webhook_job/WebhookJobTable.js +1 -2
- package/lib/components/form/Form.helpers.js +10 -19
- package/lib/components/form/Form.js +312 -355
- package/lib/components/form/Form.models.js +6 -11
- package/lib/components/form/FormState.js +1 -2
- package/lib/components/form/KitchenSinkForm.js +23 -3
- package/lib/components/form/SimpleForm.helpers.js +262 -0
- package/lib/components/form/SimpleForm.js +462 -0
- package/lib/components/form/SimpleForm.models.js +62 -0
- package/lib/components/form/defaults/AttributesField.js +3 -4
- package/lib/components/form/defaults/CheckboxField.js +2 -3
- package/lib/components/form/defaults/CodeField.js +2 -3
- package/lib/components/form/defaults/FormButtons.js +2 -3
- package/lib/components/form/defaults/FormError.js +2 -3
- package/lib/components/form/defaults/FormField.js +2 -3
- package/lib/components/form/defaults/FormLayout.js +2 -3
- package/lib/components/form/defaults/FormMultiField.js +2 -3
- package/lib/components/form/defaults/PasswordField.js +2 -3
- package/lib/components/form/defaults/RadioField.js +2 -3
- package/lib/components/form/defaults/SampleTeamsRolesFIeld.js +2 -3
- package/lib/components/form/defaults/SelectField.js +2 -3
- package/lib/components/form/defaults/SelectMultiField.js +2 -3
- package/lib/components/form/defaults/TableField.js +2 -3
- package/lib/components/form/defaults/TeamField.js +2 -3
- package/lib/components/form/defaults/TeamMultiField.js +2 -3
- package/lib/components/form/defaults/TextField.js +2 -3
- package/lib/components/form/defaults/TextMultiField.js +2 -3
- package/lib/components/form/defaults/UserField.js +2 -3
- package/lib/components/form/defaults/UserMultiField.js +2 -3
- package/lib/components/form/defaults/index.js +2 -3
- package/lib/components/form/tests/Form.test.js +3865 -4257
- package/lib/components/form/tests/components.js +2 -3
- package/lib/components/index.js +7 -0
- package/lib/components/system/SystemBackgroundTasksTable.js +1 -2
- package/lib/components/system/SystemCassandraForm.js +1 -2
- package/lib/components/system/SystemElasticSearchForm.js +1 -2
- package/lib/components/system/SystemFilestoreForm.js +2 -3
- package/lib/components/system/SystemForm.js +1 -2
- package/lib/components/system/SystemIngressForm.js +1 -2
- package/lib/components/system/SystemSecurityForm.js +1 -2
- package/lib/components/system/SystemSmtpForm.js +1 -2
- package/lib/components/system/SystemTaskAdapterForm.js +1 -2
- package/lib/components/system/SystemTrustedCertificateForm.js +1 -2
- package/lib/components/system/SystemTrustedCertificatesTable.js +1 -2
- package/lib/components/system/SystemUserForm.js +1 -2
- package/lib/components/system/helpers.js +11 -21
- package/lib/components/system/spaces/SystemSpaceForm.js +2 -3
- package/lib/components/system/spaces/SystemTenantForm.js +2 -3
- package/lib/components/system/spaces/SystemTenantTable.js +1 -2
- package/lib/components/table/Table.js +48 -51
- package/lib/components/table/Table.redux.js +161 -188
- package/lib/components/table/Table.test.js +115 -123
- package/lib/components/table/defaults/BodyCell.js +1 -2
- package/lib/components/table/defaults/BodyRow.js +1 -2
- package/lib/components/table/defaults/BooleanFilter.js +1 -2
- package/lib/components/table/defaults/ColumnControl.js +1 -2
- package/lib/components/table/defaults/EmptyBodyRow.js +1 -2
- package/lib/components/table/defaults/FilterLayout.js +1 -2
- package/lib/components/table/defaults/Footer.js +1 -2
- package/lib/components/table/defaults/FooterCell.js +1 -2
- package/lib/components/table/defaults/FooterRow.js +1 -2
- package/lib/components/table/defaults/Header.js +1 -2
- package/lib/components/table/defaults/HeaderCell.js +1 -2
- package/lib/components/table/defaults/HeaderRow.js +1 -2
- package/lib/components/table/defaults/PaginationControl.js +2 -4
- package/lib/components/table/defaults/TableBody.js +1 -2
- package/lib/components/table/defaults/TableLayout.js +1 -2
- package/lib/components/table/defaults/TextFilter.js +1 -2
- package/lib/components/table/defaults/index.js +2 -3
- package/lib/components/task/builder/Connector.js +26 -11
- package/lib/components/task/builder/ConnectorForm.js +1 -2
- package/lib/components/task/builder/Node.js +18 -9
- package/lib/components/task/builder/NodeForm.js +1 -2
- package/lib/components/task/builder/NodeParametersForm.js +1 -2
- package/lib/components/task/builder/SvgCanvas.js +2 -3
- package/lib/components/task/builder/SvgText.js +2 -3
- package/lib/components/task/builder/TaskDefinitionConfigForm.js +3 -6
- package/lib/components/task/builder/TreeBuilder.js +10 -4
- package/lib/components/task/builder/builder.redux.js +171 -182
- package/lib/components/task/builder/constants.js +38 -76
- package/lib/components/task/builder/helpers.js +23 -40
- package/lib/components/task/builder/models.js +19 -35
- package/lib/components/task/category/TaskCategoryForm.js +2 -3
- package/lib/components/task/category/TaskCategoryTable.js +1 -2
- package/lib/components/task/common/UsageTable.js +1 -2
- package/lib/components/task/engine/EngineSettingsForm.js +2 -3
- package/lib/components/task/errors/RunErrorTable.js +2 -3
- package/lib/components/task/errors/SystemErrorsTable.js +1 -2
- package/lib/components/task/handlers/HandlerForm.js +2 -3
- package/lib/components/task/handlers/HandlerTable.js +1 -2
- package/lib/components/task/handlers/MissingHandlerTable.js +1 -2
- package/lib/components/task/policy_rule/PolicyRuleForm.js +2 -3
- package/lib/components/task/policy_rule/PolicyRuleTable.js +1 -2
- package/lib/components/task/runs/CreateManualTriggerForm.js +1 -2
- package/lib/components/task/runs/RunTable.js +2 -3
- package/lib/components/task/runs/RunTaskTable.js +1 -2
- package/lib/components/task/sources/SourceForm.js +1 -2
- package/lib/components/task/sources/SourceTable.js +1 -2
- package/lib/components/task/triggers/TriggerTable.js +2 -3
- package/lib/components/task/workflows/LinkedWorkflowForm.js +3 -5
- package/lib/components/task/workflows/LinkedWorkflowTable.js +1 -2
- package/lib/components/task/workflows/MissingRoutineTable.js +1 -2
- package/lib/components/task/workflows/WorkflowForm.js +2 -3
- package/lib/components/task/workflows/WorkflowTable.js +1 -2
- package/lib/helpers/SearchBuilder.js +2 -4
- package/lib/helpers/index.js +13 -26
- package/lib/index.js +3 -6
- package/lib/reducer.js +3 -5
- package/lib/saga.js +32 -48
- package/lib/store.js +32 -42
- package/package.json +12 -15
- package/lib/components/core/CoreFormModal.js +0 -64
- package/lib/components/core/CoreModal.js +0 -114
|
@@ -26,83 +26,79 @@ describe('bridgeModels api', function () {
|
|
|
26
26
|
test('success', /*#__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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
models: [{
|
|
36
|
-
name: 'Person'
|
|
37
|
-
}, {
|
|
38
|
-
name: 'Building'
|
|
39
|
-
}]
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
_context.next = 3;
|
|
43
|
-
return (0, _bridgeModels.fetchBridgeModels)({
|
|
44
|
-
include: 'attributes'
|
|
45
|
-
});
|
|
46
|
-
case 3:
|
|
47
|
-
result = _context.sent;
|
|
48
|
-
expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/models', {
|
|
49
|
-
params: {
|
|
50
|
-
include: 'attributes'
|
|
51
|
-
},
|
|
52
|
-
headers: {
|
|
53
|
-
'X-Kinetic-AuthAssumed': 'true'
|
|
54
|
-
}
|
|
55
|
-
}]]);
|
|
56
|
-
expect(result).toEqual({
|
|
57
|
-
bridgeModels: [{
|
|
29
|
+
while (1) switch (_context.prev = _context.next) {
|
|
30
|
+
case 0:
|
|
31
|
+
_axios["default"].get.mockResolvedValue({
|
|
32
|
+
status: 200,
|
|
33
|
+
data: {
|
|
34
|
+
models: [{
|
|
58
35
|
name: 'Person'
|
|
59
36
|
}, {
|
|
60
37
|
name: 'Building'
|
|
61
38
|
}]
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
_context.next = 3;
|
|
42
|
+
return (0, _bridgeModels.fetchBridgeModels)({
|
|
43
|
+
include: 'attributes'
|
|
44
|
+
});
|
|
45
|
+
case 3:
|
|
46
|
+
result = _context.sent;
|
|
47
|
+
expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/models', {
|
|
48
|
+
params: {
|
|
49
|
+
include: 'attributes'
|
|
50
|
+
},
|
|
51
|
+
headers: {
|
|
52
|
+
'X-Kinetic-AuthAssumed': 'true'
|
|
53
|
+
}
|
|
54
|
+
}]]);
|
|
55
|
+
expect(result).toEqual({
|
|
56
|
+
bridgeModels: [{
|
|
57
|
+
name: 'Person'
|
|
58
|
+
}, {
|
|
59
|
+
name: 'Building'
|
|
60
|
+
}]
|
|
61
|
+
});
|
|
62
|
+
case 6:
|
|
63
|
+
case "end":
|
|
64
|
+
return _context.stop();
|
|
67
65
|
}
|
|
68
66
|
}, _callee);
|
|
69
67
|
})));
|
|
70
68
|
test('forbidden', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee2() {
|
|
71
69
|
var result;
|
|
72
70
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee2$(_context2) {
|
|
73
|
-
while (1) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
71
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
72
|
+
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'
|
|
76
|
+
}));
|
|
77
|
+
_context2.next = 3;
|
|
78
|
+
return (0, _bridgeModels.fetchBridgeModels)({
|
|
79
|
+
include: 'attributes'
|
|
80
|
+
});
|
|
81
|
+
case 3:
|
|
82
|
+
result = _context2.sent;
|
|
83
|
+
expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/models', {
|
|
84
|
+
params: {
|
|
82
85
|
include: 'attributes'
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
message: 'Forbidden'
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
case 6:
|
|
103
|
-
case "end":
|
|
104
|
-
return _context2.stop();
|
|
105
|
-
}
|
|
86
|
+
},
|
|
87
|
+
headers: {
|
|
88
|
+
'X-Kinetic-AuthAssumed': 'true'
|
|
89
|
+
}
|
|
90
|
+
}]]);
|
|
91
|
+
expect(result).toEqual({
|
|
92
|
+
error: {
|
|
93
|
+
forbidden: true,
|
|
94
|
+
statusCode: 403,
|
|
95
|
+
key: null,
|
|
96
|
+
message: 'Forbidden'
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
case 6:
|
|
100
|
+
case "end":
|
|
101
|
+
return _context2.stop();
|
|
106
102
|
}
|
|
107
103
|
}, _callee2);
|
|
108
104
|
})));
|
|
@@ -114,41 +110,39 @@ describe('bridgeModels api', function () {
|
|
|
114
110
|
test('success', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee3() {
|
|
115
111
|
var result;
|
|
116
112
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee3$(_context3) {
|
|
117
|
-
while (1) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
model: {
|
|
124
|
-
name: 'Person'
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
_context3.next = 3;
|
|
129
|
-
return (0, _bridgeModels.fetchBridgeModel)({
|
|
130
|
-
modelName: 'Person',
|
|
131
|
-
include: 'attributes'
|
|
132
|
-
});
|
|
133
|
-
case 3:
|
|
134
|
-
result = _context3.sent;
|
|
135
|
-
expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/models/Person', {
|
|
136
|
-
params: {
|
|
137
|
-
include: 'attributes'
|
|
138
|
-
},
|
|
139
|
-
headers: {
|
|
140
|
-
'X-Kinetic-AuthAssumed': 'true'
|
|
141
|
-
}
|
|
142
|
-
}]]);
|
|
143
|
-
expect(result).toEqual({
|
|
144
|
-
bridgeModel: {
|
|
113
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
114
|
+
case 0:
|
|
115
|
+
_axios["default"].get.mockResolvedValue({
|
|
116
|
+
status: 200,
|
|
117
|
+
data: {
|
|
118
|
+
model: {
|
|
145
119
|
name: 'Person'
|
|
146
120
|
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
_context3.next = 3;
|
|
124
|
+
return (0, _bridgeModels.fetchBridgeModel)({
|
|
125
|
+
modelName: 'Person',
|
|
126
|
+
include: 'attributes'
|
|
127
|
+
});
|
|
128
|
+
case 3:
|
|
129
|
+
result = _context3.sent;
|
|
130
|
+
expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/models/Person', {
|
|
131
|
+
params: {
|
|
132
|
+
include: 'attributes'
|
|
133
|
+
},
|
|
134
|
+
headers: {
|
|
135
|
+
'X-Kinetic-AuthAssumed': 'true'
|
|
136
|
+
}
|
|
137
|
+
}]]);
|
|
138
|
+
expect(result).toEqual({
|
|
139
|
+
bridgeModel: {
|
|
140
|
+
name: 'Person'
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
case 6:
|
|
144
|
+
case "end":
|
|
145
|
+
return _context3.stop();
|
|
152
146
|
}
|
|
153
147
|
}, _callee3);
|
|
154
148
|
})));
|
|
@@ -162,40 +156,38 @@ describe('bridgeModels api', function () {
|
|
|
162
156
|
test('forbidden', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee4() {
|
|
163
157
|
var result;
|
|
164
158
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee4$(_context4) {
|
|
165
|
-
while (1) {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
159
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
160
|
+
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
|
+
}));
|
|
165
|
+
_context4.next = 3;
|
|
166
|
+
return (0, _bridgeModels.fetchBridgeModel)({
|
|
167
|
+
modelName: 'Person',
|
|
168
|
+
include: 'attributes'
|
|
169
|
+
});
|
|
170
|
+
case 3:
|
|
171
|
+
result = _context4.sent;
|
|
172
|
+
expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/models/Person', {
|
|
173
|
+
params: {
|
|
175
174
|
include: 'attributes'
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
message: 'Forbidden'
|
|
193
|
-
}
|
|
194
|
-
});
|
|
195
|
-
case 6:
|
|
196
|
-
case "end":
|
|
197
|
-
return _context4.stop();
|
|
198
|
-
}
|
|
175
|
+
},
|
|
176
|
+
headers: {
|
|
177
|
+
'X-Kinetic-AuthAssumed': 'true'
|
|
178
|
+
}
|
|
179
|
+
}]]);
|
|
180
|
+
expect(result).toEqual({
|
|
181
|
+
error: {
|
|
182
|
+
forbidden: true,
|
|
183
|
+
statusCode: 403,
|
|
184
|
+
key: null,
|
|
185
|
+
message: 'Forbidden'
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
case 6:
|
|
189
|
+
case "end":
|
|
190
|
+
return _context4.stop();
|
|
199
191
|
}
|
|
200
192
|
}, _callee4);
|
|
201
193
|
})));
|
|
@@ -207,47 +199,45 @@ describe('bridgeModels api', function () {
|
|
|
207
199
|
test('success', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee5() {
|
|
208
200
|
var result;
|
|
209
201
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee5$(_context5) {
|
|
210
|
-
while (1) {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
name: 'Person'
|
|
218
|
-
}
|
|
202
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
203
|
+
case 0:
|
|
204
|
+
_axios["default"].post.mockResolvedValue({
|
|
205
|
+
status: 200,
|
|
206
|
+
data: {
|
|
207
|
+
model: {
|
|
208
|
+
name: 'Person'
|
|
219
209
|
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
status: 'Active'
|
|
226
|
-
},
|
|
227
|
-
include: 'attributes'
|
|
228
|
-
});
|
|
229
|
-
case 3:
|
|
230
|
-
result = _context5.sent;
|
|
231
|
-
expect(_axios["default"].post.mock.calls).toEqual([['space/app/api/v1/models', {
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
_context5.next = 3;
|
|
213
|
+
return (0, _bridgeModels.createBridgeModel)({
|
|
214
|
+
bridgeModel: {
|
|
232
215
|
name: 'Person',
|
|
233
216
|
status: 'Active'
|
|
234
|
-
},
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
217
|
+
},
|
|
218
|
+
include: 'attributes'
|
|
219
|
+
});
|
|
220
|
+
case 3:
|
|
221
|
+
result = _context5.sent;
|
|
222
|
+
expect(_axios["default"].post.mock.calls).toEqual([['space/app/api/v1/models', {
|
|
223
|
+
name: 'Person',
|
|
224
|
+
status: 'Active'
|
|
225
|
+
}, {
|
|
226
|
+
params: {
|
|
227
|
+
include: 'attributes'
|
|
228
|
+
},
|
|
229
|
+
headers: {
|
|
230
|
+
'X-Kinetic-AuthAssumed': 'true'
|
|
231
|
+
}
|
|
232
|
+
}]]);
|
|
233
|
+
expect(result).toEqual({
|
|
234
|
+
bridgeModel: {
|
|
235
|
+
name: 'Person'
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
case 6:
|
|
239
|
+
case "end":
|
|
240
|
+
return _context5.stop();
|
|
251
241
|
}
|
|
252
242
|
}, _callee5);
|
|
253
243
|
})));
|
|
@@ -261,73 +251,69 @@ describe('bridgeModels api', function () {
|
|
|
261
251
|
test('bad request', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee6() {
|
|
262
252
|
var result;
|
|
263
253
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee6$(_context6) {
|
|
264
|
-
while (1) {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
return _context6.stop();
|
|
295
|
-
}
|
|
254
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
255
|
+
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'
|
|
261
|
+
}
|
|
262
|
+
}));
|
|
263
|
+
_context6.next = 3;
|
|
264
|
+
return (0, _bridgeModels.createBridgeModel)({
|
|
265
|
+
bridgeModel: {
|
|
266
|
+
name: '',
|
|
267
|
+
status: 'Active'
|
|
268
|
+
},
|
|
269
|
+
include: 'attributes'
|
|
270
|
+
});
|
|
271
|
+
case 3:
|
|
272
|
+
result = _context6.sent;
|
|
273
|
+
expect(result).toEqual({
|
|
274
|
+
error: {
|
|
275
|
+
badRequest: true,
|
|
276
|
+
statusCode: 400,
|
|
277
|
+
key: null,
|
|
278
|
+
message: 'Invalid Bridge Model'
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
case 5:
|
|
282
|
+
case "end":
|
|
283
|
+
return _context6.stop();
|
|
296
284
|
}
|
|
297
285
|
}, _callee6);
|
|
298
286
|
})));
|
|
299
287
|
test('forbidden', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee7() {
|
|
300
288
|
var result;
|
|
301
289
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee7$(_context7) {
|
|
302
|
-
while (1) {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
return _context7.stop();
|
|
330
|
-
}
|
|
290
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
291
|
+
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'
|
|
295
|
+
}));
|
|
296
|
+
_context7.next = 3;
|
|
297
|
+
return (0, _bridgeModels.createBridgeModel)({
|
|
298
|
+
bridgeModel: {
|
|
299
|
+
name: '',
|
|
300
|
+
status: 'Active'
|
|
301
|
+
},
|
|
302
|
+
include: 'attributes'
|
|
303
|
+
});
|
|
304
|
+
case 3:
|
|
305
|
+
result = _context7.sent;
|
|
306
|
+
expect(result).toEqual({
|
|
307
|
+
error: {
|
|
308
|
+
forbidden: true,
|
|
309
|
+
statusCode: 403,
|
|
310
|
+
key: null,
|
|
311
|
+
message: 'Forbidden'
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
case 5:
|
|
315
|
+
case "end":
|
|
316
|
+
return _context7.stop();
|
|
331
317
|
}
|
|
332
318
|
}, _callee7);
|
|
333
319
|
})));
|
|
@@ -339,48 +325,46 @@ describe('bridgeModels api', function () {
|
|
|
339
325
|
test('success', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee8() {
|
|
340
326
|
var result;
|
|
341
327
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee8$(_context8) {
|
|
342
|
-
while (1) {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
name: 'Person New'
|
|
350
|
-
}
|
|
328
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
329
|
+
case 0:
|
|
330
|
+
_axios["default"].put.mockResolvedValue({
|
|
331
|
+
status: 200,
|
|
332
|
+
data: {
|
|
333
|
+
model: {
|
|
334
|
+
name: 'Person New'
|
|
351
335
|
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
status: 'Active'
|
|
359
|
-
},
|
|
360
|
-
include: 'attributes'
|
|
361
|
-
});
|
|
362
|
-
case 3:
|
|
363
|
-
result = _context8.sent;
|
|
364
|
-
expect(_axios["default"].put.mock.calls).toEqual([['space/app/api/v1/models/Person', {
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
_context8.next = 3;
|
|
339
|
+
return (0, _bridgeModels.updateBridgeModel)({
|
|
340
|
+
modelName: 'Person',
|
|
341
|
+
bridgeModel: {
|
|
365
342
|
name: 'Person New',
|
|
366
343
|
status: 'Active'
|
|
367
|
-
},
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
344
|
+
},
|
|
345
|
+
include: 'attributes'
|
|
346
|
+
});
|
|
347
|
+
case 3:
|
|
348
|
+
result = _context8.sent;
|
|
349
|
+
expect(_axios["default"].put.mock.calls).toEqual([['space/app/api/v1/models/Person', {
|
|
350
|
+
name: 'Person New',
|
|
351
|
+
status: 'Active'
|
|
352
|
+
}, {
|
|
353
|
+
params: {
|
|
354
|
+
include: 'attributes'
|
|
355
|
+
},
|
|
356
|
+
headers: {
|
|
357
|
+
'X-Kinetic-AuthAssumed': 'true'
|
|
358
|
+
}
|
|
359
|
+
}]]);
|
|
360
|
+
expect(result).toEqual({
|
|
361
|
+
bridgeModel: {
|
|
362
|
+
name: 'Person New'
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
case 6:
|
|
366
|
+
case "end":
|
|
367
|
+
return _context8.stop();
|
|
384
368
|
}
|
|
385
369
|
}, _callee8);
|
|
386
370
|
})));
|
|
@@ -403,75 +387,71 @@ describe('bridgeModels api', function () {
|
|
|
403
387
|
test('bad request', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee9() {
|
|
404
388
|
var result;
|
|
405
389
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee9$(_context9) {
|
|
406
|
-
while (1) {
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
return _context9.stop();
|
|
438
|
-
}
|
|
390
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
391
|
+
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'
|
|
397
|
+
}
|
|
398
|
+
}));
|
|
399
|
+
_context9.next = 3;
|
|
400
|
+
return (0, _bridgeModels.updateBridgeModel)({
|
|
401
|
+
modelName: 'Person',
|
|
402
|
+
bridgeModel: {
|
|
403
|
+
name: '',
|
|
404
|
+
status: 'Active'
|
|
405
|
+
},
|
|
406
|
+
include: 'attributes'
|
|
407
|
+
});
|
|
408
|
+
case 3:
|
|
409
|
+
result = _context9.sent;
|
|
410
|
+
expect(result).toEqual({
|
|
411
|
+
error: {
|
|
412
|
+
badRequest: true,
|
|
413
|
+
statusCode: 400,
|
|
414
|
+
key: null,
|
|
415
|
+
message: 'Invalid Bridge Model'
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
case 5:
|
|
419
|
+
case "end":
|
|
420
|
+
return _context9.stop();
|
|
439
421
|
}
|
|
440
422
|
}, _callee9);
|
|
441
423
|
})));
|
|
442
424
|
test('forbidden', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee10() {
|
|
443
425
|
var result;
|
|
444
426
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee10$(_context10) {
|
|
445
|
-
while (1) {
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
return _context10.stop();
|
|
474
|
-
}
|
|
427
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
428
|
+
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'
|
|
432
|
+
}));
|
|
433
|
+
_context10.next = 3;
|
|
434
|
+
return (0, _bridgeModels.updateBridgeModel)({
|
|
435
|
+
modelName: 'Person',
|
|
436
|
+
bridgeModel: {
|
|
437
|
+
name: '',
|
|
438
|
+
status: 'Active'
|
|
439
|
+
},
|
|
440
|
+
include: 'attributes'
|
|
441
|
+
});
|
|
442
|
+
case 3:
|
|
443
|
+
result = _context10.sent;
|
|
444
|
+
expect(result).toEqual({
|
|
445
|
+
error: {
|
|
446
|
+
forbidden: true,
|
|
447
|
+
statusCode: 403,
|
|
448
|
+
key: null,
|
|
449
|
+
message: 'Forbidden'
|
|
450
|
+
}
|
|
451
|
+
});
|
|
452
|
+
case 5:
|
|
453
|
+
case "end":
|
|
454
|
+
return _context10.stop();
|
|
475
455
|
}
|
|
476
456
|
}, _callee10);
|
|
477
457
|
})));
|