@kineticdata/react 6.0.0 → 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 +47 -30
- package/lib/apis/http.test.js +100 -0
- package/lib/apis/system/index.js +167 -81
- package/lib/apis/task/index.js +73 -118
- package/lib/components/agent/bridge/BridgeForm.js +1 -2
- package/lib/components/agent/bridge/BridgeTable.js +5 -3
- package/lib/components/agent/filestore/FilestoreForm.js +1 -2
- package/lib/components/agent/filestore/FilestoreTable.js +5 -3
- package/lib/components/agent/handler/AgentHandlerForm.js +1 -2
- package/lib/components/agent/handler/AgentHandlerTable.js +6 -4
- 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 +165 -0
- 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 +25 -0
- package/lib/components/common/defaults/index.js +12 -0
- package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +1 -2
- package/lib/components/core/attribute_definition/AttributeDefinitionTable.js +8 -5
- package/lib/components/core/bridge_model/BridgeModelForm.js +52 -55
- package/lib/components/core/bridge_model/BridgeModelTable.js +6 -4
- 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 +14 -8
- 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 +13 -9
- 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 +23 -13
- package/lib/components/core/form_type/FormTypeForm.js +1 -2
- package/lib/components/core/form_type/FormTypeTable.js +4 -3
- 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 +13 -7
- 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 +18 -34
- package/lib/components/core/log/LogTable.js +10 -6
- 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 +10 -6
- 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 +39 -23
- package/lib/components/core/submission/KappSubmissionTable.js +39 -23
- 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 +2 -3
- package/lib/components/core/team/TeamTable.js +12 -7
- 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 +24 -7
- package/lib/components/core/webapi/WebApiForm.js +138 -123
- package/lib/components/core/webapi/WebApiTable.js +15 -9
- package/lib/components/core/webhook/WebhookForm.js +1 -2
- package/lib/components/core/webhook/WebhookTable.js +20 -11
- package/lib/components/core/webhook_job/WebhookJobTable.js +40 -21
- package/lib/components/form/Form.helpers.js +91 -38
- package/lib/components/form/Form.js +312 -355
- package/lib/components/form/Form.models.js +7 -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 +60 -0
- package/lib/components/system/SystemBackgroundTasksTable.js +1 -2
- package/lib/components/system/SystemCassandraForm.js +97 -0
- package/lib/components/system/SystemElasticSearchForm.js +97 -0
- package/lib/components/system/SystemFilestoreForm.js +12 -8
- package/lib/components/system/SystemForm.js +1 -2
- package/lib/components/system/SystemIngressForm.js +78 -31
- package/lib/components/system/SystemSecurityForm.js +1 -2
- package/lib/components/system/SystemSmtpForm.js +1 -2
- package/lib/components/system/SystemTaskAdapterForm.js +30 -7
- package/lib/components/system/SystemTrustedCertificateForm.js +39 -0
- package/lib/components/system/SystemTrustedCertificatesTable.js +73 -0
- package/lib/components/system/SystemUserForm.js +1 -2
- package/lib/components/system/helpers.js +236 -65
- package/lib/components/system/spaces/SystemSpaceForm.js +2 -3
- package/lib/components/system/spaces/SystemTenantForm.js +77 -37
- package/lib/components/system/spaces/SystemTenantTable.js +1 -2
- package/lib/components/table/Table.js +132 -54
- package/lib/components/table/Table.redux.js +229 -235
- package/lib/components/table/Table.test.js +154 -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 +25 -0
- 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 +5 -4
- 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 +35 -17
- 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 +24 -13
- 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 +24 -12
- 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 +16 -9
- package/lib/components/task/triggers/TriggerTable.js +52 -26
- package/lib/components/task/workflows/LinkedWorkflowForm.js +3 -5
- package/lib/components/task/workflows/LinkedWorkflowTable.js +33 -18
- 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 +31 -17
- package/lib/helpers/SearchBuilder.js +2 -4
- package/lib/helpers/index.js +13 -26
- package/lib/index.js +7 -9
- package/lib/reducer.js +3 -5
- package/lib/saga.js +32 -48
- package/lib/store.js +32 -42
- package/package.json +26 -16
- package/proxyhelper.js +17 -11
- package/lib/components/core/CoreFormModal.js +0 -64
- package/lib/components/core/CoreModal.js +0 -114
|
@@ -26,33 +26,11 @@ describe('webhooks api', function () {
|
|
|
26
26
|
test('success space scoped webhooks', /*#__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
|
-
data: {
|
|
35
|
-
webhooks: [{
|
|
36
|
-
authStrategy: null,
|
|
37
|
-
event: 'Login Failure',
|
|
38
|
-
filter: '',
|
|
39
|
-
name: 'Test Webhook Name',
|
|
40
|
-
type: 'Space',
|
|
41
|
-
url: 'https://myapi.com/api/v1'
|
|
42
|
-
}]
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
_context.next = 3;
|
|
46
|
-
return (0, _webhooks.fetchWebhooks)();
|
|
47
|
-
case 3:
|
|
48
|
-
result = _context.sent;
|
|
49
|
-
expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/webhooks', {
|
|
50
|
-
params: {},
|
|
51
|
-
headers: {
|
|
52
|
-
'X-Kinetic-AuthAssumed': 'true'
|
|
53
|
-
}
|
|
54
|
-
}]]);
|
|
55
|
-
expect(result).toEqual({
|
|
29
|
+
while (1) switch (_context.prev = _context.next) {
|
|
30
|
+
case 0:
|
|
31
|
+
_axios["default"].get.mockResolvedValue({
|
|
32
|
+
status: 200,
|
|
33
|
+
data: {
|
|
56
34
|
webhooks: [{
|
|
57
35
|
authStrategy: null,
|
|
58
36
|
event: 'Login Failure',
|
|
@@ -61,46 +39,42 @@ describe('webhooks api', function () {
|
|
|
61
39
|
type: 'Space',
|
|
62
40
|
url: 'https://myapi.com/api/v1'
|
|
63
41
|
}]
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
_context.next = 3;
|
|
45
|
+
return (0, _webhooks.fetchWebhooks)();
|
|
46
|
+
case 3:
|
|
47
|
+
result = _context.sent;
|
|
48
|
+
expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/webhooks', {
|
|
49
|
+
params: {},
|
|
50
|
+
headers: {
|
|
51
|
+
'X-Kinetic-AuthAssumed': 'true'
|
|
52
|
+
}
|
|
53
|
+
}]]);
|
|
54
|
+
expect(result).toEqual({
|
|
55
|
+
webhooks: [{
|
|
56
|
+
authStrategy: null,
|
|
57
|
+
event: 'Login Failure',
|
|
58
|
+
filter: '',
|
|
59
|
+
name: 'Test Webhook Name',
|
|
60
|
+
type: 'Space',
|
|
61
|
+
url: 'https://myapi.com/api/v1'
|
|
62
|
+
}]
|
|
63
|
+
});
|
|
64
|
+
case 6:
|
|
65
|
+
case "end":
|
|
66
|
+
return _context.stop();
|
|
69
67
|
}
|
|
70
68
|
}, _callee);
|
|
71
69
|
})));
|
|
72
70
|
test('success kapp scoped webhooks', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee2() {
|
|
73
71
|
var result;
|
|
74
72
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee2$(_context2) {
|
|
75
|
-
while (1) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
data: {
|
|
81
|
-
webhooks: [{
|
|
82
|
-
authStrategy: null,
|
|
83
|
-
event: 'Login Failure',
|
|
84
|
-
filter: '',
|
|
85
|
-
name: 'Test Webhook Name',
|
|
86
|
-
type: 'Space',
|
|
87
|
-
url: 'https://myapi.com/api/v1'
|
|
88
|
-
}]
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
_context2.next = 3;
|
|
92
|
-
return (0, _webhooks.fetchWebhooks)({
|
|
93
|
-
kappSlug: 'services'
|
|
94
|
-
});
|
|
95
|
-
case 3:
|
|
96
|
-
result = _context2.sent;
|
|
97
|
-
expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/kapps/services/webhooks', {
|
|
98
|
-
params: {},
|
|
99
|
-
headers: {
|
|
100
|
-
'X-Kinetic-AuthAssumed': 'true'
|
|
101
|
-
}
|
|
102
|
-
}]]);
|
|
103
|
-
expect(result).toEqual({
|
|
73
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
74
|
+
case 0:
|
|
75
|
+
_axios["default"].get.mockResolvedValue({
|
|
76
|
+
status: 200,
|
|
77
|
+
data: {
|
|
104
78
|
webhooks: [{
|
|
105
79
|
authStrategy: null,
|
|
106
80
|
event: 'Login Failure',
|
|
@@ -109,46 +83,66 @@ describe('webhooks api', function () {
|
|
|
109
83
|
type: 'Space',
|
|
110
84
|
url: 'https://myapi.com/api/v1'
|
|
111
85
|
}]
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
_context2.next = 3;
|
|
89
|
+
return (0, _webhooks.fetchWebhooks)({
|
|
90
|
+
kappSlug: 'services'
|
|
91
|
+
});
|
|
92
|
+
case 3:
|
|
93
|
+
result = _context2.sent;
|
|
94
|
+
expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/kapps/services/webhooks', {
|
|
95
|
+
params: {},
|
|
96
|
+
headers: {
|
|
97
|
+
'X-Kinetic-AuthAssumed': 'true'
|
|
98
|
+
}
|
|
99
|
+
}]]);
|
|
100
|
+
expect(result).toEqual({
|
|
101
|
+
webhooks: [{
|
|
102
|
+
authStrategy: null,
|
|
103
|
+
event: 'Login Failure',
|
|
104
|
+
filter: '',
|
|
105
|
+
name: 'Test Webhook Name',
|
|
106
|
+
type: 'Space',
|
|
107
|
+
url: 'https://myapi.com/api/v1'
|
|
108
|
+
}]
|
|
109
|
+
});
|
|
110
|
+
case 6:
|
|
111
|
+
case "end":
|
|
112
|
+
return _context2.stop();
|
|
117
113
|
}
|
|
118
114
|
}, _callee2);
|
|
119
115
|
})));
|
|
120
116
|
test('forbidden', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee3() {
|
|
121
117
|
var result;
|
|
122
118
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee3$(_context3) {
|
|
123
|
-
while (1) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
return _context3.stop();
|
|
151
|
-
}
|
|
119
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
120
|
+
case 0:
|
|
121
|
+
_axios["default"].get.mockRejectedValue((0, _createError["default"])('Request failed with status code 403', null, 403, null, {
|
|
122
|
+
status: 403,
|
|
123
|
+
statusText: 'Forbidden'
|
|
124
|
+
}));
|
|
125
|
+
_context3.next = 3;
|
|
126
|
+
return (0, _webhooks.fetchWebhooks)();
|
|
127
|
+
case 3:
|
|
128
|
+
result = _context3.sent;
|
|
129
|
+
expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/webhooks', {
|
|
130
|
+
params: {},
|
|
131
|
+
headers: {
|
|
132
|
+
'X-Kinetic-AuthAssumed': 'true'
|
|
133
|
+
}
|
|
134
|
+
}]]);
|
|
135
|
+
expect(result).toEqual({
|
|
136
|
+
error: {
|
|
137
|
+
forbidden: true,
|
|
138
|
+
statusCode: 403,
|
|
139
|
+
key: null,
|
|
140
|
+
message: 'Forbidden'
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
case 6:
|
|
144
|
+
case "end":
|
|
145
|
+
return _context3.stop();
|
|
152
146
|
}
|
|
153
147
|
}, _callee3);
|
|
154
148
|
})));
|
|
@@ -160,35 +154,11 @@ describe('webhooks api', function () {
|
|
|
160
154
|
test('success', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee4() {
|
|
161
155
|
var result;
|
|
162
156
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee4$(_context4) {
|
|
163
|
-
while (1) {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
data: {
|
|
169
|
-
webhook: {
|
|
170
|
-
authStrategy: null,
|
|
171
|
-
event: 'Login Failure',
|
|
172
|
-
filter: '',
|
|
173
|
-
name: 'Test Webhook Name',
|
|
174
|
-
type: 'Space',
|
|
175
|
-
url: 'https://myapi.com/api/v1'
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
_context4.next = 3;
|
|
180
|
-
return (0, _webhooks.fetchWebhook)({
|
|
181
|
-
webhookName: 'Test Webhook Name'
|
|
182
|
-
});
|
|
183
|
-
case 3:
|
|
184
|
-
result = _context4.sent;
|
|
185
|
-
expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/webhooks/Test%20Webhook%20Name', {
|
|
186
|
-
params: {},
|
|
187
|
-
headers: {
|
|
188
|
-
'X-Kinetic-AuthAssumed': 'true'
|
|
189
|
-
}
|
|
190
|
-
}]]);
|
|
191
|
-
expect(result).toEqual({
|
|
157
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
158
|
+
case 0:
|
|
159
|
+
_axios["default"].get.mockResolvedValue({
|
|
160
|
+
status: 200,
|
|
161
|
+
data: {
|
|
192
162
|
webhook: {
|
|
193
163
|
authStrategy: null,
|
|
194
164
|
event: 'Login Failure',
|
|
@@ -197,11 +167,33 @@ describe('webhooks api', function () {
|
|
|
197
167
|
type: 'Space',
|
|
198
168
|
url: 'https://myapi.com/api/v1'
|
|
199
169
|
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
_context4.next = 3;
|
|
173
|
+
return (0, _webhooks.fetchWebhook)({
|
|
174
|
+
webhookName: 'Test Webhook Name'
|
|
175
|
+
});
|
|
176
|
+
case 3:
|
|
177
|
+
result = _context4.sent;
|
|
178
|
+
expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/webhooks/Test%20Webhook%20Name', {
|
|
179
|
+
params: {},
|
|
180
|
+
headers: {
|
|
181
|
+
'X-Kinetic-AuthAssumed': 'true'
|
|
182
|
+
}
|
|
183
|
+
}]]);
|
|
184
|
+
expect(result).toEqual({
|
|
185
|
+
webhook: {
|
|
186
|
+
authStrategy: null,
|
|
187
|
+
event: 'Login Failure',
|
|
188
|
+
filter: '',
|
|
189
|
+
name: 'Test Webhook Name',
|
|
190
|
+
type: 'Space',
|
|
191
|
+
url: 'https://myapi.com/api/v1'
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
case 6:
|
|
195
|
+
case "end":
|
|
196
|
+
return _context4.stop();
|
|
205
197
|
}
|
|
206
198
|
}, _callee4);
|
|
207
199
|
})));
|
|
@@ -222,24 +214,11 @@ describe('webhooks api', function () {
|
|
|
222
214
|
test('success create webhook space', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee5() {
|
|
223
215
|
var result;
|
|
224
216
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee5$(_context5) {
|
|
225
|
-
while (1) {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
data: {
|
|
231
|
-
webhook: {
|
|
232
|
-
authStrategy: null,
|
|
233
|
-
event: 'Login Failure',
|
|
234
|
-
filter: '',
|
|
235
|
-
name: 'Test Webhook Name',
|
|
236
|
-
type: 'Space',
|
|
237
|
-
url: 'https://myapi.com/api/v1'
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
});
|
|
241
|
-
_context5.next = 3;
|
|
242
|
-
return (0, _webhooks.createWebhook)({
|
|
217
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
218
|
+
case 0:
|
|
219
|
+
_axios["default"].post.mockResolvedValue({
|
|
220
|
+
status: 200,
|
|
221
|
+
data: {
|
|
243
222
|
webhook: {
|
|
244
223
|
authStrategy: null,
|
|
245
224
|
event: 'Login Failure',
|
|
@@ -248,61 +227,58 @@ describe('webhooks api', function () {
|
|
|
248
227
|
type: 'Space',
|
|
249
228
|
url: 'https://myapi.com/api/v1'
|
|
250
229
|
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
_context5.next = 3;
|
|
233
|
+
return (0, _webhooks.createWebhook)({
|
|
234
|
+
webhook: {
|
|
255
235
|
authStrategy: null,
|
|
256
236
|
event: 'Login Failure',
|
|
257
237
|
filter: '',
|
|
258
238
|
name: 'Test Webhook Name',
|
|
259
239
|
type: 'Space',
|
|
260
240
|
url: 'https://myapi.com/api/v1'
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
case 3:
|
|
244
|
+
result = _context5.sent;
|
|
245
|
+
expect(_axios["default"].post.mock.calls).toEqual([['space/app/api/v1/webhooks', {
|
|
246
|
+
authStrategy: null,
|
|
247
|
+
event: 'Login Failure',
|
|
248
|
+
filter: '',
|
|
249
|
+
name: 'Test Webhook Name',
|
|
250
|
+
type: 'Space',
|
|
251
|
+
url: 'https://myapi.com/api/v1'
|
|
252
|
+
}, {
|
|
253
|
+
params: {},
|
|
254
|
+
headers: {
|
|
255
|
+
'X-Kinetic-AuthAssumed': 'true'
|
|
256
|
+
}
|
|
257
|
+
}]]);
|
|
258
|
+
expect(result).toEqual({
|
|
259
|
+
webhook: {
|
|
260
|
+
authStrategy: null,
|
|
261
|
+
event: 'Login Failure',
|
|
262
|
+
filter: '',
|
|
263
|
+
name: 'Test Webhook Name',
|
|
264
|
+
type: 'Space',
|
|
265
|
+
url: 'https://myapi.com/api/v1'
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
case 6:
|
|
269
|
+
case "end":
|
|
270
|
+
return _context5.stop();
|
|
281
271
|
}
|
|
282
272
|
}, _callee5);
|
|
283
273
|
})));
|
|
284
274
|
test('success create security definition kapp', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee6() {
|
|
285
275
|
var result;
|
|
286
276
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee6$(_context6) {
|
|
287
|
-
while (1) {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
data: {
|
|
293
|
-
webhook: {
|
|
294
|
-
authStrategy: null,
|
|
295
|
-
event: 'Login Failure',
|
|
296
|
-
filter: '',
|
|
297
|
-
name: 'Test Webhook Name',
|
|
298
|
-
type: 'Space',
|
|
299
|
-
url: 'https://myapi.com/api/v1'
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
});
|
|
303
|
-
_context6.next = 3;
|
|
304
|
-
return (0, _webhooks.createWebhook)({
|
|
305
|
-
kappSlug: 'services',
|
|
277
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
278
|
+
case 0:
|
|
279
|
+
_axios["default"].post.mockResolvedValue({
|
|
280
|
+
status: 200,
|
|
281
|
+
data: {
|
|
306
282
|
webhook: {
|
|
307
283
|
authStrategy: null,
|
|
308
284
|
event: 'Login Failure',
|
|
@@ -311,36 +287,48 @@ describe('webhooks api', function () {
|
|
|
311
287
|
type: 'Space',
|
|
312
288
|
url: 'https://myapi.com/api/v1'
|
|
313
289
|
}
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
_context6.next = 3;
|
|
293
|
+
return (0, _webhooks.createWebhook)({
|
|
294
|
+
kappSlug: 'services',
|
|
295
|
+
webhook: {
|
|
318
296
|
authStrategy: null,
|
|
319
297
|
event: 'Login Failure',
|
|
320
298
|
filter: '',
|
|
321
299
|
name: 'Test Webhook Name',
|
|
322
300
|
type: 'Space',
|
|
323
301
|
url: 'https://myapi.com/api/v1'
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
case 3:
|
|
305
|
+
result = _context6.sent;
|
|
306
|
+
expect(_axios["default"].post.mock.calls).toEqual([['space/app/api/v1/kapps/services/webhooks', {
|
|
307
|
+
authStrategy: null,
|
|
308
|
+
event: 'Login Failure',
|
|
309
|
+
filter: '',
|
|
310
|
+
name: 'Test Webhook Name',
|
|
311
|
+
type: 'Space',
|
|
312
|
+
url: 'https://myapi.com/api/v1'
|
|
313
|
+
}, {
|
|
314
|
+
params: {},
|
|
315
|
+
headers: {
|
|
316
|
+
'X-Kinetic-AuthAssumed': 'true'
|
|
317
|
+
}
|
|
318
|
+
}]]);
|
|
319
|
+
expect(result).toEqual({
|
|
320
|
+
webhook: {
|
|
321
|
+
authStrategy: null,
|
|
322
|
+
event: 'Login Failure',
|
|
323
|
+
filter: '',
|
|
324
|
+
name: 'Test Webhook Name',
|
|
325
|
+
type: 'Space',
|
|
326
|
+
url: 'https://myapi.com/api/v1'
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
case 6:
|
|
330
|
+
case "end":
|
|
331
|
+
return _context6.stop();
|
|
344
332
|
}
|
|
345
333
|
}, _callee6);
|
|
346
334
|
})));
|
|
@@ -352,25 +340,11 @@ describe('webhooks api', function () {
|
|
|
352
340
|
test('success update webhook', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee7() {
|
|
353
341
|
var result;
|
|
354
342
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee7$(_context7) {
|
|
355
|
-
while (1) {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
data: {
|
|
361
|
-
webhook: {
|
|
362
|
-
authStrategy: null,
|
|
363
|
-
event: 'Login Failure',
|
|
364
|
-
filter: '',
|
|
365
|
-
name: 'New Test Webhook Name',
|
|
366
|
-
type: 'Space',
|
|
367
|
-
url: 'https://myapi.com/api/v1'
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
});
|
|
371
|
-
_context7.next = 3;
|
|
372
|
-
return (0, _webhooks.updateWebhook)({
|
|
373
|
-
webhookName: 'Test Webhook Name',
|
|
343
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
344
|
+
case 0:
|
|
345
|
+
_axios["default"].put.mockResolvedValue({
|
|
346
|
+
status: 200,
|
|
347
|
+
data: {
|
|
374
348
|
webhook: {
|
|
375
349
|
authStrategy: null,
|
|
376
350
|
event: 'Login Failure',
|
|
@@ -379,36 +353,48 @@ describe('webhooks api', function () {
|
|
|
379
353
|
type: 'Space',
|
|
380
354
|
url: 'https://myapi.com/api/v1'
|
|
381
355
|
}
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
_context7.next = 3;
|
|
359
|
+
return (0, _webhooks.updateWebhook)({
|
|
360
|
+
webhookName: 'Test Webhook Name',
|
|
361
|
+
webhook: {
|
|
386
362
|
authStrategy: null,
|
|
387
363
|
event: 'Login Failure',
|
|
388
364
|
filter: '',
|
|
389
365
|
name: 'New Test Webhook Name',
|
|
390
366
|
type: 'Space',
|
|
391
367
|
url: 'https://myapi.com/api/v1'
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
case 3:
|
|
371
|
+
result = _context7.sent;
|
|
372
|
+
expect(_axios["default"].put.mock.calls).toEqual([['space/app/api/v1/webhooks/Test%20Webhook%20Name', {
|
|
373
|
+
authStrategy: null,
|
|
374
|
+
event: 'Login Failure',
|
|
375
|
+
filter: '',
|
|
376
|
+
name: 'New Test Webhook Name',
|
|
377
|
+
type: 'Space',
|
|
378
|
+
url: 'https://myapi.com/api/v1'
|
|
379
|
+
}, {
|
|
380
|
+
params: {},
|
|
381
|
+
headers: {
|
|
382
|
+
'X-Kinetic-AuthAssumed': 'true'
|
|
383
|
+
}
|
|
384
|
+
}]]);
|
|
385
|
+
expect(result).toEqual({
|
|
386
|
+
webhook: {
|
|
387
|
+
authStrategy: null,
|
|
388
|
+
event: 'Login Failure',
|
|
389
|
+
filter: '',
|
|
390
|
+
name: 'New Test Webhook Name',
|
|
391
|
+
type: 'Space',
|
|
392
|
+
url: 'https://myapi.com/api/v1'
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
case 6:
|
|
396
|
+
case "end":
|
|
397
|
+
return _context7.stop();
|
|
412
398
|
}
|
|
413
399
|
}, _callee7);
|
|
414
400
|
})));
|
|
@@ -12,7 +12,7 @@ var _http = require("../http");
|
|
|
12
12
|
var buildEndpoint = function buildEndpoint(scope, kappSlug) {
|
|
13
13
|
return scope === 'kapp' ? "".concat(_helpers.bundle.apiLocation(), "/kapps/").concat(kappSlug, "/webhookJobs") : "".concat(_helpers.bundle.apiLocation(), "/webhookJobs");
|
|
14
14
|
};
|
|
15
|
-
var fetchWebhookJobs = function fetchWebhookJobs() {
|
|
15
|
+
var fetchWebhookJobs = exports.fetchWebhookJobs = function fetchWebhookJobs() {
|
|
16
16
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
17
17
|
var scope = options.scope,
|
|
18
18
|
kappSlug = options.kappSlug,
|
|
@@ -33,8 +33,7 @@ var fetchWebhookJobs = function fetchWebhookJobs() {
|
|
|
33
33
|
};
|
|
34
34
|
})["catch"](_http.handleErrors);
|
|
35
35
|
};
|
|
36
|
-
exports.
|
|
37
|
-
var updateWebhookJob = function updateWebhookJob() {
|
|
36
|
+
var updateWebhookJob = exports.updateWebhookJob = function updateWebhookJob() {
|
|
38
37
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
39
38
|
var id = options.id,
|
|
40
39
|
kappSlug = options.kappSlug,
|
|
@@ -54,5 +53,4 @@ var updateWebhookJob = function updateWebhookJob() {
|
|
|
54
53
|
webhookJob: response.data.webhookJob
|
|
55
54
|
};
|
|
56
55
|
})["catch"](_http.handleErrors);
|
|
57
|
-
};
|
|
58
|
-
exports.updateWebhookJob = updateWebhookJob;
|
|
56
|
+
};
|
|
@@ -37,22 +37,17 @@ var _apiGroup = (0, _http.apiGroup)({
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
}),
|
|
40
|
-
fetchWorkflows = _apiGroup.fetchWorkflows,
|
|
41
|
-
fetchWorkflow = _apiGroup.fetchWorkflow,
|
|
42
|
-
createWorkflow = _apiGroup.createWorkflow,
|
|
43
|
-
updateWorkflow = _apiGroup.updateWorkflow,
|
|
44
|
-
deleteWorkflow = _apiGroup.deleteWorkflow;
|
|
45
|
-
exports.deleteWorkflow = deleteWorkflow;
|
|
46
|
-
exports.updateWorkflow = updateWorkflow;
|
|
47
|
-
exports.createWorkflow = createWorkflow;
|
|
48
|
-
exports.fetchWorkflow = fetchWorkflow;
|
|
49
|
-
exports.fetchWorkflows = fetchWorkflows;
|
|
40
|
+
fetchWorkflows = exports.fetchWorkflows = _apiGroup.fetchWorkflows,
|
|
41
|
+
fetchWorkflow = exports.fetchWorkflow = _apiGroup.fetchWorkflow,
|
|
42
|
+
createWorkflow = exports.createWorkflow = _apiGroup.createWorkflow,
|
|
43
|
+
updateWorkflow = exports.updateWorkflow = _apiGroup.updateWorkflow,
|
|
44
|
+
deleteWorkflow = exports.deleteWorkflow = _apiGroup.deleteWorkflow;
|
|
50
45
|
var repairPath = function repairPath(_ref3) {
|
|
51
46
|
var kappSlug = _ref3.kappSlug,
|
|
52
47
|
formSlug = _ref3.formSlug;
|
|
53
48
|
return kappSlug && formSlug ? "".concat(_helpers.bundle.apiLocation(), "/kapps/").concat(kappSlug, "/forms/").concat(formSlug, "/workflows/repair") : kappSlug ? "".concat(_helpers.bundle.apiLocation(), "/kapps/").concat(kappSlug, "/workflows/repair") : "".concat(_helpers.bundle.apiLocation(), "/workflows/repair");
|
|
54
49
|
};
|
|
55
|
-
var repairWorkflows = function repairWorkflows() {
|
|
50
|
+
var repairWorkflows = exports.repairWorkflows = function repairWorkflows() {
|
|
56
51
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
57
52
|
return _axios["default"].post(repairPath(options), {
|
|
58
53
|
params: (0, _http.paramBuilder)(options),
|
|
@@ -60,5 +55,4 @@ var repairWorkflows = function repairWorkflows() {
|
|
|
60
55
|
}).then(function (response) {
|
|
61
56
|
return response.data;
|
|
62
57
|
})["catch"](_http.handleErrors);
|
|
63
|
-
};
|
|
64
|
-
exports.repairWorkflows = repairWorkflows;
|
|
58
|
+
};
|