@kineticdata/react 6.0.5 → 6.1.1

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 (151) hide show
  1. package/README.md +110 -110
  2. package/assets/task/icons/defer.svg +12 -12
  3. package/assets/task/icons/drag-handle.svg +3 -3
  4. package/assets/task/icons/filter.svg +11 -11
  5. package/assets/task/icons/loop.svg +10 -10
  6. package/assets/task/icons/plus_small.svg +5 -5
  7. package/assets/task/icons/routine.svg +9 -9
  8. package/assets/task/icons/scale-minus.svg +11 -11
  9. package/assets/task/icons/scale-plus.svg +13 -13
  10. package/assets/task/icons/start.svg +11 -11
  11. package/assets/task/icons/stop.svg +8 -8
  12. package/lib/apis/core/activity.js +4 -4
  13. package/lib/apis/core/attributeDefinitions.js +64 -6
  14. package/lib/apis/core/attributeDefinitions.test.js +7 -4
  15. package/lib/apis/core/authentication.js +12 -1
  16. package/lib/apis/core/bridgeModels.test.js +46 -23
  17. package/lib/apis/core/bridgedresources.js +41 -41
  18. package/lib/apis/core/fileResources.js +2 -6
  19. package/lib/apis/core/forms.js +51 -2
  20. package/lib/apis/core/forms.test.js +32 -19
  21. package/lib/apis/core/integrations.js +61 -0
  22. package/lib/apis/core/kapps.js +49 -0
  23. package/lib/apis/core/kapps.test.js +16 -10
  24. package/lib/apis/core/notices.js +7 -0
  25. package/lib/apis/core/securityPolicyDefinitions.test.js +7 -4
  26. package/lib/apis/core/space.js +18 -0
  27. package/lib/apis/core/space.test.js +16 -10
  28. package/lib/apis/core/submissionActivities.js +38 -0
  29. package/lib/apis/core/submissions.js +114 -15
  30. package/lib/apis/core/translations.test.js +126 -55
  31. package/lib/apis/core/userPreferences.js +59 -0
  32. package/lib/apis/core/webApis.js +32 -2
  33. package/lib/apis/core/webhooks.test.js +7 -4
  34. package/lib/apis/http.js +30 -5
  35. package/lib/apis/index.js +48 -0
  36. package/lib/apis/integrator/index.js +337 -0
  37. package/lib/apis/system/index.js +64 -12
  38. package/lib/apis/task/index.js +9 -2
  39. package/lib/components/agent/filestore/FilestoreForm.js +1 -1
  40. package/lib/components/common/AttributeSelect.js +11 -2
  41. package/lib/components/common/BridgeSelect.js +3 -1
  42. package/lib/components/common/ConnectionSelect.js +73 -0
  43. package/lib/components/common/FormSelect.js +3 -1
  44. package/lib/components/common/NodeSelect.js +1 -0
  45. package/lib/components/common/StaticSelect.js +16 -6
  46. package/lib/components/common/TableInput.js +4 -1
  47. package/lib/components/common/TeamSelect.js +3 -1
  48. package/lib/components/common/ToastContainer.js +34 -10
  49. package/lib/components/common/Typeahead.js +62 -23
  50. package/lib/components/common/UserSelect.js +3 -1
  51. package/lib/components/common/authentication/AuthenticationContainer.js +121 -55
  52. package/lib/components/common/authentication/RequestInterceptor.js +1 -1
  53. package/lib/components/common/preferences/PreferencesProvider.js +461 -0
  54. package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +10 -7
  55. package/lib/components/core/bridge_model/BridgeModelTable.js +19 -0
  56. package/lib/components/core/bridge_model_attribute/BridgeModelAttributeForm.js +6 -9
  57. package/lib/components/core/bridge_model_attribute/BridgeModelAttributeTable.js +0 -4
  58. package/lib/components/core/bridge_model_qualification/BridgeModelQualificationForm.js +7 -10
  59. package/lib/components/core/bridge_model_qualification/BridgeModelQualificationTable.js +2 -15
  60. package/lib/components/core/category/CategoryForm.js +4 -1
  61. package/lib/components/core/category/CategoryTable.js +2 -2
  62. package/lib/components/core/core_form/CoreForm.js +18 -10
  63. package/lib/components/core/field_definition/FieldDefinitionForm.js +3 -3
  64. package/lib/components/core/file_resource/FileResourceForm.js +2 -1
  65. package/lib/components/core/file_resource/FileResourceTable.js +14 -7
  66. package/lib/components/core/form/FormForm.js +42 -19
  67. package/lib/components/core/form/FormTable.js +13 -14
  68. package/lib/components/core/form_type/FormTypeForm.js +3 -0
  69. package/lib/components/core/i18n/Moment.js +1 -0
  70. package/lib/components/core/integration/IntegrationForm.js +232 -0
  71. package/lib/components/core/integration/IntegrationTable.js +142 -0
  72. package/lib/components/core/kapp/KappForm.js +18 -5
  73. package/lib/components/core/kapp/KappTable.js +3 -3
  74. package/lib/components/core/log/LogTable.js +1 -1
  75. package/lib/components/core/security_definition/SecurityDefinitionForm.js +48 -10
  76. package/lib/components/core/space/SpaceForm.js +17 -36
  77. package/lib/components/core/submission/DatastoreSubmissionTable.js +4 -4
  78. package/lib/components/core/submission/FormSubmissionTable.js +12 -7
  79. package/lib/components/core/submission/KappSubmissionTable.js +4 -4
  80. package/lib/components/core/submission/SubmissionActivityForm.js +79 -0
  81. package/lib/components/core/submission/SubmissionForm.js +15 -3
  82. package/lib/components/core/team/TeamTable.js +17 -7
  83. package/lib/components/core/translation/EntryTable.js +8 -7
  84. package/lib/components/core/user/UserForm.js +2 -0
  85. package/lib/components/core/user/UserTable.js +22 -22
  86. package/lib/components/core/webapi/WebApiForm.js +5 -2
  87. package/lib/components/core/webapi/WebApiTable.js +2 -2
  88. package/lib/components/core/webhook/WebhookForm.js +43 -33
  89. package/lib/components/core/webhook/WebhookTable.js +16 -16
  90. package/lib/components/core/webhook_job/WebhookJobTable.js +17 -6
  91. package/lib/components/form/Form.helpers.js +10 -4
  92. package/lib/components/form/Form.js +264 -171
  93. package/lib/components/form/Form.models.js +6 -1
  94. package/lib/components/form/FormState.js +9 -5
  95. package/lib/components/form/SimpleForm.js +2 -2
  96. package/lib/components/form/defaults/CodeField.js +44 -1
  97. package/lib/components/index.js +152 -3
  98. package/lib/components/integrator/connection/ConnectionForm.js +156 -0
  99. package/lib/components/integrator/connection/ConnectionTable.js +82 -0
  100. package/lib/components/integrator/connection/config_fields/http.js +570 -0
  101. package/lib/components/integrator/connection/config_fields/sql.js +123 -0
  102. package/lib/components/integrator/integrationTypes.js +120 -0
  103. package/lib/components/integrator/operation/OperationForm.js +148 -0
  104. package/lib/components/integrator/operation/OperationTable.js +62 -0
  105. package/lib/components/integrator/operation/config_fields/http.js +185 -0
  106. package/lib/components/integrator/operation/config_fields/sql.js +81 -0
  107. package/lib/components/system/SystemSecurityForm.js +1 -1
  108. package/lib/components/system/SystemTaskAdapterForm.js +9 -9
  109. package/lib/components/system/SystemUserForm.js +2 -0
  110. package/lib/components/system/helpers.js +123 -100
  111. package/lib/components/system/spaces/SystemSpaceForm.js +9 -37
  112. package/lib/components/system/spaces/SystemTenantForm.js +276 -104
  113. package/lib/components/system/spaces/SystemTenantMigrateForm.js +449 -0
  114. package/lib/components/system/spaces/SystemTenantTable.js +20 -16
  115. package/lib/components/table/Table.js +75 -15
  116. package/lib/components/table/Table.redux.js +297 -73
  117. package/lib/components/table/defaults/FilterControl.js +24 -0
  118. package/lib/components/table/defaults/index.js +2 -0
  119. package/lib/components/table/tests/Table.test.js +22 -22
  120. package/lib/components/table/tests/components.js +9 -2
  121. package/lib/components/task/builder/Connector.js +51 -41
  122. package/lib/components/task/builder/ConnectorForm.js +11 -7
  123. package/lib/components/task/builder/Node.js +31 -35
  124. package/lib/components/task/builder/NodeForm.js +93 -22
  125. package/lib/components/task/builder/NodeParametersForm.js +29 -17
  126. package/lib/components/task/builder/SvgCanvas.js +3 -17
  127. package/lib/components/task/builder/TaskDefinitionConfigForm.js +18 -50
  128. package/lib/components/task/builder/TreeBuilder.js +23 -3
  129. package/lib/components/task/builder/builder.redux.js +342 -197
  130. package/lib/components/task/builder/constants.js +10 -2
  131. package/lib/components/task/builder/helpers.js +231 -81
  132. package/lib/components/task/builder/models.js +7 -6
  133. package/lib/components/task/category/TaskCategoryTable.js +3 -3
  134. package/lib/components/task/common/UsageTable.js +9 -2
  135. package/lib/components/task/handlers/HandlerTable.js +44 -37
  136. package/lib/components/task/policy_rule/PolicyRuleTable.js +3 -3
  137. package/lib/components/task/runs/CreateManualTriggerForm.js +2 -0
  138. package/lib/components/task/runs/RunTable.js +10 -14
  139. package/lib/components/task/runs/RunTaskTable.js +1 -1
  140. package/lib/components/task/sources/SourceTable.js +2 -2
  141. package/lib/components/task/triggers/TriggerTable.js +2 -2
  142. package/lib/components/task/workflows/LinkedWorkflowTable.js +16 -11
  143. package/lib/components/task/workflows/WorkflowForm.js +27 -8
  144. package/lib/components/task/workflows/WorkflowTable.js +27 -26
  145. package/lib/helpers/index.js +307 -74
  146. package/lib/index.js +2 -1
  147. package/lib/saga.js +4 -4
  148. package/lib/store.js +2 -1
  149. package/package.json +7 -6
  150. package/proxyhelper.js +201 -176
  151. package/CHANGELOG.md +0 -94
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.integrationTypes = exports.getOperationMetadata = exports.getConnectionMetadata = exports["default"] = void 0;
7
+ var _immutable = require("immutable");
8
+ var integrationTypes = exports.integrationTypes = [{
9
+ label: 'HTTP',
10
+ value: 'http'
11
+ },
12
+ // { label: 'SMTP', value: 'smtp' },
13
+ {
14
+ label: 'PostgreSQL',
15
+ value: 'postgres',
16
+ group: 'sql',
17
+ groupLabel: 'SQL'
18
+ }, {
19
+ label: 'SQL Server',
20
+ value: 'mssql',
21
+ group: 'sql',
22
+ groupLabel: 'SQL'
23
+ }];
24
+
25
+ // Helper function for getting the label for a given type value
26
+ integrationTypes.getLabel = function (value) {
27
+ var _integrationTypes$fin;
28
+ return ((_integrationTypes$fin = integrationTypes.find(function (t) {
29
+ return t.value === value;
30
+ })) === null || _integrationTypes$fin === void 0 ? void 0 : _integrationTypes$fin.label) || value;
31
+ };
32
+ var _default = exports["default"] = integrationTypes;
33
+ var getConnectionMetadata = exports.getConnectionMetadata = function getConnectionMetadata(connection) {
34
+ var type = (0, _immutable.getIn)(connection, ['config', 'configType']);
35
+ switch (type) {
36
+ case 'http':
37
+ return {
38
+ // Details content to render for each option in a list of connections
39
+ optionDetail: (0, _immutable.getIn)(connection, ['config', 'baseUrl']),
40
+ optionDetailLabel: 'Base URL',
41
+ // Documentation link
42
+ docsLink: (0, _immutable.getIn)(connection, ['documentationLink']),
43
+ // Properties to list in page/modal headings
44
+ headingData: [{
45
+ label: 'Base URL',
46
+ value: (0, _immutable.getIn)(connection, ['config', 'baseUrl'])
47
+ }, {
48
+ label: 'Auth',
49
+ value: {
50
+ basic: 'Basic',
51
+ client_credentials: 'OAuth 2.0',
52
+ http_bearer_token: 'HTTP Bearer Token',
53
+ raw_bearer_token: 'Raw Bearer Token'
54
+ }[(0, _immutable.getIn)(connection, ['config', 'auth', 'authType'])] || 'None'
55
+ }].filter(function (o) {
56
+ return o.value;
57
+ }),
58
+ // Table columns for the operations table of this type of connection.
59
+ // Objects define columns to add, and strings define default columns to
60
+ // show. The order of the items defines the order of the columns.
61
+ operationColumns: [{
62
+ value: 'method',
63
+ title: 'Method',
64
+ components: {
65
+ BodyCell: HTTPMethodCell
66
+ },
67
+ toggleable: true
68
+ }, 'name', 'updatedAt', 'actions']
69
+ };
70
+ case 'postgres':
71
+ case 'mssql':
72
+ default:
73
+ return {
74
+ headingData: [],
75
+ operationColumns: ['name', 'updatedAt', 'actions']
76
+ };
77
+ }
78
+ };
79
+ var getOperationMetadata = exports.getOperationMetadata = function getOperationMetadata(operation) {
80
+ var type = (0, _immutable.getIn)(operation, ['config', 'configType']);
81
+ switch (type) {
82
+ case 'http':
83
+ return {
84
+ // Details content to render for each option in a list of operations
85
+ optionDetail: (0, _immutable.getIn)(operation, ['config', 'method']),
86
+ optionDetailLabel: 'Method',
87
+ optionDetailComponent: HTTPMethod,
88
+ // Documentation link
89
+ docsLink: (0, _immutable.getIn)(operation, ['documentationLink']),
90
+ // Properties to list in page/modal headings
91
+ headingData: [{
92
+ label: 'Request Path',
93
+ value: (0, _immutable.getIn)(operation, ['config', 'path'])
94
+ }, {
95
+ label: 'Method',
96
+ value: (0, _immutable.getIn)(operation, ['config', 'method'])
97
+ }].filter(function (o) {
98
+ return o.value;
99
+ })
100
+ };
101
+ case 'postgres':
102
+ case 'mssql':
103
+ default:
104
+ return {
105
+ headingData: []
106
+ };
107
+ }
108
+ };
109
+ var HTTPMethodCell = function HTTPMethodCell(_ref) {
110
+ var row = _ref.row;
111
+ return /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("span", {
112
+ className: "badge badge-info"
113
+ }, row.getIn(['config', 'method'])));
114
+ };
115
+ var HTTPMethod = function HTTPMethod(_ref2) {
116
+ var value = _ref2.value;
117
+ return /*#__PURE__*/React.createElement("span", {
118
+ className: "badge badge-info"
119
+ }, value);
120
+ };
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.OperationForm = void 0;
8
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
9
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
11
+ var _immutable = require("immutable");
12
+ var _Form = require("../../form/Form");
13
+ var _apis = require("../../../apis");
14
+ var _http = require("./config_fields/http");
15
+ var _sql = require("./config_fields/sql");
16
+ var dataSources = function dataSources(_ref) {
17
+ var id = _ref.id,
18
+ connectionId = _ref.connectionId;
19
+ return {
20
+ connection: {
21
+ fn: _apis.fetchConnection,
22
+ params: connectionId && [{
23
+ id: connectionId
24
+ }],
25
+ transform: function transform(result) {
26
+ return result.connection;
27
+ }
28
+ },
29
+ operation: {
30
+ fn: _apis.fetchOperation,
31
+ params: id && connectionId && [{
32
+ id: id,
33
+ connectionId: connectionId
34
+ }],
35
+ transform: function transform(result) {
36
+ return result.operation;
37
+ }
38
+ }
39
+ };
40
+ };
41
+ var handleSubmit = function handleSubmit(_ref2) {
42
+ var id = _ref2.id,
43
+ connectionId = _ref2.connectionId,
44
+ clone = _ref2.clone;
45
+ return function (values) {
46
+ return (id && !clone ? _apis.updateOperation : _apis.createOperation)({
47
+ id: id,
48
+ connectionId: connectionId,
49
+ operation: values.toJS()
50
+ }).then(function (_ref3) {
51
+ var operation = _ref3.operation,
52
+ error = _ref3.error;
53
+ if (error) {
54
+ throw error.statusCode === 400 && error.message || 'There was an error saving the operation';
55
+ }
56
+ return operation;
57
+ });
58
+ };
59
+ };
60
+ var getFieldConfigByType = function getFieldConfigByType(type, operation) {
61
+ switch (type) {
62
+ case 'http':
63
+ var configFieldsHTTP = (0, _http.generateHttpOperationConfigFields)((0, _immutable.get)(operation, 'config'));
64
+ return [configFieldsHTTP, (0, _http.serializeHttpOperationConfigFields)(configFieldsHTTP)];
65
+ case 'postgres':
66
+ var configFieldsPostgres = (0, _sql.generatePostgresOperationConfigFields)((0, _immutable.get)(operation, 'config'));
67
+ return [configFieldsPostgres, (0, _sql.serializeSQLOperationConfigFields)(configFieldsPostgres)];
68
+ case 'mssql':
69
+ var configFieldsMSSQL = (0, _sql.generateMSSQLOperationConfigFields)((0, _immutable.get)(operation, 'config'));
70
+ return [configFieldsMSSQL, (0, _sql.serializeSQLOperationConfigFields)(configFieldsMSSQL)];
71
+ default:
72
+ return [[], undefined];
73
+ }
74
+ };
75
+ var fields = function fields(_ref4) {
76
+ var id = _ref4.id,
77
+ clone = _ref4.clone;
78
+ return function (_ref5) {
79
+ var operation = _ref5.operation,
80
+ connection = _ref5.connection;
81
+ if (connection && (!id || operation)) {
82
+ // Set type from the operation if it exists, or from the connection
83
+ var typeValue = (0, _immutable.getIn)(connection, ['config', 'configType']);
84
+ var _getFieldConfigByType = getFieldConfigByType(typeValue, operation),
85
+ _getFieldConfigByType2 = (0, _slicedToArray2["default"])(_getFieldConfigByType, 2),
86
+ configFields = _getFieldConfigByType2[0],
87
+ configSerialize = _getFieldConfigByType2[1];
88
+ return [{
89
+ name: 'name',
90
+ label: 'Operation Name',
91
+ type: 'text',
92
+ initialValue: !clone ? (0, _immutable.get)(operation, 'name') : '',
93
+ required: true,
94
+ placeholder: !clone ? 'Enter a name to find your operation easily' : "Clone of ".concat((0, _immutable.get)(operation, 'name'))
95
+ }, {
96
+ name: 'documentationLink',
97
+ label: 'API Documentation Link',
98
+ type: 'text',
99
+ initialValue: (0, _immutable.get)(operation, 'documentationLink') || '',
100
+ placeholder: 'Optional (but recommended)'
101
+ }, {
102
+ name: 'notes',
103
+ label: 'Description',
104
+ type: 'text',
105
+ initialValue: (0, _immutable.get)(operation, 'notes') || '',
106
+ placeholder: 'Enter a short description for the operation'
107
+ }, {
108
+ name: 'outputs',
109
+ label: 'Outputs',
110
+ type: 'map',
111
+ initialValue: (0, _immutable.get)(operation, 'outputs') || {},
112
+ placeholder: 'Output Key',
113
+ serialize: function serialize(_ref6) {
114
+ var values = _ref6.values;
115
+ return values.get('outputs');
116
+ },
117
+ constraint: function constraint(_ref7) {
118
+ var values = _ref7.values;
119
+ return values.get('outputs').every(function (value, key) {
120
+ return key && key.match(/^[a-z\d_-]+[a-z\d\s_-]*$/i) && (!value.get('children') || value.get('children').every(function (_, childKey) {
121
+ return childKey && childKey.match(/^[a-z\d_-]+[a-z\d\s_-]*$/i);
122
+ }));
123
+ });
124
+ },
125
+ constraintMessage: ''
126
+ }, {
127
+ name: 'config',
128
+ label: 'Config',
129
+ type: null,
130
+ visible: false,
131
+ initialValue: (0, _immutable.get)(operation, 'config'),
132
+ // Serialize the transient config fields into a single config object
133
+ serialize: configSerialize
134
+ }].concat((0, _toConsumableArray2["default"])(configFields.map(function (field) {
135
+ return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, field), {}, {
136
+ "transient": true
137
+ });
138
+ })));
139
+ }
140
+ };
141
+ };
142
+ var OperationForm = exports.OperationForm = (0, _Form.generateForm)({
143
+ formOptions: ['id', 'connectionId', 'clone'],
144
+ dataSources: dataSources,
145
+ fields: fields,
146
+ handleSubmit: handleSubmit
147
+ });
148
+ OperationForm.displayName = 'OperationForm';
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.OperationTable = void 0;
7
+ var _apis = require("../../../apis");
8
+ var _Table = require("../../table/Table");
9
+ var _helpers = require("../../../helpers");
10
+ var filters = function filters() {
11
+ return function () {
12
+ return [{
13
+ name: 'name',
14
+ label: 'Name',
15
+ type: 'text'
16
+ }];
17
+ };
18
+ };
19
+ var clientSide = (0, _helpers.defineFilter)(true).matches('name', 'name').end();
20
+ var dataSource = function dataSource(_ref) {
21
+ var connectionId = _ref.connectionId;
22
+ return {
23
+ fn: _apis.fetchOperations,
24
+ clientSide: clientSide,
25
+ params: function params() {
26
+ return connectionId && [{
27
+ connectionId: connectionId
28
+ }];
29
+ },
30
+ transform: function transform(result) {
31
+ return {
32
+ data: result.operations
33
+ };
34
+ }
35
+ };
36
+ };
37
+ var columns = [{
38
+ value: 'name',
39
+ title: 'Name',
40
+ sortable: true
41
+ }, {
42
+ value: 'id',
43
+ title: 'Id',
44
+ toggleable: true
45
+ }, {
46
+ value: 'insertedAt',
47
+ title: 'Created At',
48
+ sortable: true,
49
+ toggleable: true
50
+ }, {
51
+ value: 'updatedAt',
52
+ title: 'Updated At',
53
+ sortable: true,
54
+ toggleable: true
55
+ }];
56
+ var OperationTable = exports.OperationTable = (0, _Table.generateTable)({
57
+ tableOptions: ['connectionId'],
58
+ columns: columns,
59
+ filters: filters,
60
+ dataSource: dataSource
61
+ });
62
+ OperationTable.displayName = 'OperationTable';
@@ -0,0 +1,185 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.serializeHttpOperationConfigFields = exports.generateHttpOperationConfigFields = void 0;
8
+ var _immutable = require("immutable");
9
+ var _integrationTypes = _interopRequireDefault(require("../../integrationTypes"));
10
+ var serializeHttpOperationConfigFields = exports.serializeHttpOperationConfigFields = function serializeHttpOperationConfigFields(configFields) {
11
+ return function (_ref) {
12
+ var values = _ref.values;
13
+ return configFields.reduce(function (serialization, _ref2) {
14
+ var name = _ref2.name,
15
+ type = _ref2.type,
16
+ visible = _ref2.visible,
17
+ _transient = _ref2["transient"];
18
+ if (
19
+ // Field must not be transient
20
+ !_transient && (
21
+ // Field must be visible
22
+ typeof visible === 'function' ? visible({
23
+ values: values
24
+ }) : typeof visible === 'undefined' || !!visible)) {
25
+ // Set the value into the correct structure
26
+ return serialization.setIn(name.split('.'), values.get(name));
27
+ }
28
+ return serialization;
29
+ }, (0, _immutable.Map)());
30
+ };
31
+ };
32
+ var generateHttpOperationConfigFields = exports.generateHttpOperationConfigFields = function generateHttpOperationConfigFields(config) {
33
+ return [{
34
+ name: 'configType',
35
+ label: 'Type',
36
+ type: 'select',
37
+ options: _integrationTypes["default"],
38
+ initialValue: 'http',
39
+ required: true,
40
+ enabled: false
41
+ }, {
42
+ name: 'method',
43
+ label: 'Method',
44
+ type: 'select',
45
+ options: [{
46
+ label: 'GET',
47
+ value: 'GET'
48
+ }, {
49
+ label: 'POST',
50
+ value: 'POST'
51
+ }, {
52
+ label: 'PUT',
53
+ value: 'PUT'
54
+ }, {
55
+ label: 'PATCH',
56
+ value: 'PATCH'
57
+ }, {
58
+ label: 'DELETE',
59
+ value: 'DELETE'
60
+ }],
61
+ initialValue: (0, _immutable.get)(config, 'method'),
62
+ required: true
63
+ }, {
64
+ name: 'path',
65
+ label: 'Request Path',
66
+ type: 'text',
67
+ initialValue: (0, _immutable.get)(config, 'path'),
68
+ required: true,
69
+ helpText: /*#__PURE__*/React.createElement(React.Fragment, null, "Use the ", /*#__PURE__*/React.createElement("code", null, '{{parameter}}'), " format to create dynamic parameters.")
70
+ }, {
71
+ name: 'params',
72
+ label: 'URL Parameters',
73
+ type: 'map',
74
+ initialValue: (0, _immutable.get)(config, 'params'),
75
+ placeholder: 'Parameter Key',
76
+ helpText: /*#__PURE__*/React.createElement(React.Fragment, null, "Use the ", /*#__PURE__*/React.createElement("code", null, '{{parameter}}'), " format to create dynamic parameters.")
77
+ }, {
78
+ name: 'headers',
79
+ label: 'Headers',
80
+ type: 'map',
81
+ initialValue: (0, _immutable.get)(config, 'headers'),
82
+ placeholder: 'Header Key',
83
+ helpText: /*#__PURE__*/React.createElement(React.Fragment, null, "Use the ", /*#__PURE__*/React.createElement("code", null, '{{parameter}}'), " format to create dynamic parameters.")
84
+ }, {
85
+ name: 'followRedirect',
86
+ label: 'Follow Redirect',
87
+ type: 'checkbox',
88
+ initialValue: (0, _immutable.get)(config, 'followRedirect')
89
+ }, {
90
+ name: 'streamResponse',
91
+ label: 'Stream Response',
92
+ type: 'checkbox',
93
+ initialValue: (0, _immutable.get)(config, 'streamResponse')
94
+ }, {
95
+ name: 'includeEmptyParams',
96
+ label: 'Include Empty Parameters',
97
+ type: 'checkbox',
98
+ initialValue: (0, _immutable.get)(config, 'includeEmptyParams')
99
+ }, {
100
+ name: 'body.bodyType',
101
+ label: 'Body Type',
102
+ type: 'radio',
103
+ options: [{
104
+ label: 'Form URL Encoded',
105
+ value: 'www_form_urlencoded'
106
+ }, {
107
+ label: 'Raw',
108
+ value: 'raw'
109
+ }
110
+ // { label: 'Multipart', value: 'multipart_form' },
111
+ ],
112
+
113
+ initialValue: (0, _immutable.getIn)(config, ['body', 'bodyType']) || 'www_form_urlencoded'
114
+ }, {
115
+ name: 'body.form',
116
+ label: 'Form Body',
117
+ type: 'map',
118
+ initialValue: (0, _immutable.getIn)(config, ['body', 'form']),
119
+ visible: function visible(_ref3) {
120
+ var values = _ref3.values;
121
+ return values.get('body.bodyType') === 'www_form_urlencoded';
122
+ },
123
+ placeholder: 'Body Key',
124
+ helpText: /*#__PURE__*/React.createElement(React.Fragment, null, "Use the ", /*#__PURE__*/React.createElement("code", null, '{{parameter}}'), " format to create dynamic parameters.")
125
+ }, {
126
+ name: 'body.raw',
127
+ label: 'Raw Body',
128
+ type: 'code',
129
+ language: function language(_ref4) {
130
+ var _values$get$find, _values$get$find$toLo;
131
+ var values = _ref4.values;
132
+ return getLanguageFromContentType((_values$get$find = values.get('headers').find(function (_, header) {
133
+ return (header === null || header === void 0 ? void 0 : header.toLowerCase()) === 'content-type';
134
+ })) === null || _values$get$find === void 0 ? void 0 : (_values$get$find$toLo = _values$get$find.toLowerCase) === null || _values$get$find$toLo === void 0 ? void 0 : _values$get$find$toLo.call(_values$get$find));
135
+ },
136
+ initialValue: (0, _immutable.getIn)(config, ['body', 'raw']),
137
+ visible: function visible(_ref5) {
138
+ var values = _ref5.values;
139
+ return values.get('body.bodyType') === 'raw';
140
+ },
141
+ helpText: /*#__PURE__*/React.createElement(React.Fragment, null, "Use the ", /*#__PURE__*/React.createElement("code", null, '{{parameter}}'), " format to create dynamic parameters.")
142
+ }, {
143
+ name: 'body.parts',
144
+ label: 'Multipart Body',
145
+ type: 'table',
146
+ options: [{
147
+ name: 'name',
148
+ label: 'Name',
149
+ type: 'text'
150
+ }, {
151
+ name: 'contentType',
152
+ label: 'Content Type',
153
+ type: 'text'
154
+ }, {
155
+ name: 'content',
156
+ label: 'Content',
157
+ type: 'code',
158
+ renderAttributes: {
159
+ simple: true,
160
+ max: 'sm'
161
+ }
162
+ }, {
163
+ name: 'fileName',
164
+ label: 'File Name',
165
+ type: 'text'
166
+ }],
167
+ initialValue: (0, _immutable.getIn)(config, ['body', 'parts'], (0, _immutable.List)()),
168
+ visible: function visible(_ref6) {
169
+ var values = _ref6.values;
170
+ return values.get('body.bodyType') === 'multipart_form';
171
+ },
172
+ helpText: /*#__PURE__*/React.createElement(React.Fragment, null, "Use the ", /*#__PURE__*/React.createElement("code", null, '{{parameter}}'), " format to create dynamic parameters.")
173
+ }];
174
+ };
175
+ function getLanguageFromContentType(contentType) {
176
+ switch (contentType) {
177
+ case 'application/json':
178
+ return 'json';
179
+ case 'application/xml':
180
+ case 'text/xml':
181
+ return 'xml';
182
+ default:
183
+ return 'none';
184
+ }
185
+ }
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.serializeSQLOperationConfigFields = exports.generatePostgresOperationConfigFields = exports.generateMSSQLOperationConfigFields = void 0;
8
+ var _immutable = require("immutable");
9
+ var _integrationTypes = _interopRequireDefault(require("../../integrationTypes"));
10
+ var serializeSQLOperationConfigFields = exports.serializeSQLOperationConfigFields = function serializeSQLOperationConfigFields(configFields) {
11
+ return function (_ref) {
12
+ var values = _ref.values;
13
+ return configFields.reduce(function (serialization, _ref2) {
14
+ var name = _ref2.name,
15
+ type = _ref2.type,
16
+ visible = _ref2.visible,
17
+ _transient = _ref2["transient"];
18
+ if (
19
+ // Field must not be transient
20
+ !_transient && (
21
+ // Field must be visible
22
+ typeof visible === 'function' ? visible({
23
+ values: values
24
+ }) : typeof visible === 'undefined' || !!visible)) {
25
+ // Set the value into the correct structure
26
+ return serialization.setIn(name.split('.'), values.get(name));
27
+ }
28
+ return serialization;
29
+ }, (0, _immutable.Map)());
30
+ };
31
+ };
32
+ var generatePostgresOperationConfigFields = exports.generatePostgresOperationConfigFields = function generatePostgresOperationConfigFields(config) {
33
+ return [{
34
+ name: 'configType',
35
+ label: 'Type',
36
+ type: 'select',
37
+ options: _integrationTypes["default"],
38
+ initialValue: 'postgres',
39
+ required: true,
40
+ enabled: false
41
+ }, {
42
+ name: 'statement',
43
+ label: 'Query',
44
+ type: 'code',
45
+ language: 'postgresql',
46
+ initialValue: (0, _immutable.get)(config, 'statement'),
47
+ required: true
48
+ }, {
49
+ name: 'parameters',
50
+ label: 'Query Parameters',
51
+ type: 'text-multi',
52
+ initialValue: (0, _immutable.get)(config, 'parameters'),
53
+ placeholder: 'Value',
54
+ helpText: /*#__PURE__*/React.createElement(React.Fragment, null, "Use the ", /*#__PURE__*/React.createElement("code", null, '{{parameter}}'), " format to create dynamic parameters.")
55
+ }];
56
+ };
57
+ var generateMSSQLOperationConfigFields = exports.generateMSSQLOperationConfigFields = function generateMSSQLOperationConfigFields(config) {
58
+ return [{
59
+ name: 'configType',
60
+ label: 'Type',
61
+ type: 'select',
62
+ options: _integrationTypes["default"],
63
+ initialValue: 'mssql',
64
+ required: true,
65
+ enabled: false
66
+ }, {
67
+ name: 'statement',
68
+ label: 'Query',
69
+ type: 'code',
70
+ language: 'mssql',
71
+ initialValue: (0, _immutable.get)(config, 'statement'),
72
+ required: true
73
+ }, {
74
+ name: 'parameters',
75
+ label: 'Query Parameters',
76
+ type: 'map',
77
+ initialValue: (0, _immutable.get)(config, 'parameters'),
78
+ placeholder: 'Key',
79
+ helpText: /*#__PURE__*/React.createElement(React.Fragment, null, "Use the ", /*#__PURE__*/React.createElement("code", null, '{{parameter}}'), " format to create dynamic parameters.")
80
+ }];
81
+ };
@@ -55,7 +55,7 @@ var fields = function fields() {
55
55
  }
56
56
  }, {
57
57
  name: 'allowedSystemIpsEnabled',
58
- label: 'Enabled Allowed IP Restrictions?',
58
+ label: 'Allowed IP Restrictions',
59
59
  type: 'checkbox',
60
60
  initialValue: (0, _immutable.get)(systemSecurity, 'allowedSystemIps', (0, _immutable.List)()).size > 0,
61
61
  "transient": true
@@ -14,8 +14,8 @@ var _immutable = require("immutable");
14
14
  var _Form2 = require("../form/Form.helpers");
15
15
  var dataSources = function dataSources() {
16
16
  return {
17
- defaultTaskDbAdapter: {
18
- fn: _system.fetchSystemDefaultTaskDbAdapter,
17
+ defaultSQLDatabaseAdapter: {
18
+ fn: _system.fetchSystemDefaultSQLDbAdapter,
19
19
  params: [],
20
20
  transform: function transform(result) {
21
21
  return result.adapter;
@@ -45,9 +45,9 @@ var handleSubmit = function handleSubmit() {
45
45
  };
46
46
  var adapter = {
47
47
  type: type,
48
- properties: (0, _helpers.adapterProperties)(values, type, filterFn)
48
+ properties: (0, _helpers.adapterProperties)(values, null, type, filterFn)
49
49
  };
50
- return (0, _system.updateSystemDefaultTaskDbAdapter)({
50
+ return (0, _system.updateSystemDefaultSQLDbAdapter)({
51
51
  adapter: adapter,
52
52
  multipart: Object.entries(adapter.properties).some(function (_ref2) {
53
53
  var _ref3 = (0, _slicedToArray2["default"])(_ref2, 2),
@@ -60,14 +60,14 @@ var handleSubmit = function handleSubmit() {
60
60
  };
61
61
  var fields = function fields() {
62
62
  return function (_ref4) {
63
- var defaultTaskDbAdapter = _ref4.defaultTaskDbAdapter;
64
- return (defaultTaskDbAdapter || defaultTaskDbAdapter === null) && [{
63
+ var defaultSQLDatabaseAdapter = _ref4.defaultSQLDatabaseAdapter;
64
+ return (defaultSQLDatabaseAdapter || defaultSQLDatabaseAdapter === null) && [{
65
65
  name: 'type',
66
- label: 'Task Adapter',
66
+ label: 'Database Adapter',
67
67
  type: 'select',
68
68
  options: _helpers.VALIDATE_DB_ADAPTERS,
69
- initialValue: (0, _immutable.getIn)(defaultTaskDbAdapter, ['type'], '')
70
- }].concat((0, _toConsumableArray2["default"])((0, _helpers.MSSQL_FIELDS)('type', defaultTaskDbAdapter, [], null)), (0, _toConsumableArray2["default"])((0, _helpers.ORACLE_FIELDS)('type', defaultTaskDbAdapter, [], null)), (0, _toConsumableArray2["default"])((0, _helpers.POSTGRES_FIELDS)('type', defaultTaskDbAdapter, [], null)));
69
+ initialValue: (0, _immutable.getIn)(defaultSQLDatabaseAdapter, ['type'], '')
70
+ }].concat((0, _toConsumableArray2["default"])((0, _helpers.MSSQL_FIELDS)('type', defaultSQLDatabaseAdapter, [], null)), (0, _toConsumableArray2["default"])((0, _helpers.ORACLE_FIELDS)('type', defaultSQLDatabaseAdapter, [], null)), (0, _toConsumableArray2["default"])((0, _helpers.POSTGRES_FIELDS)('type', defaultSQLDatabaseAdapter, [], null)));
71
71
  };
72
72
  };
73
73
  var SystemTaskAdapterForm = exports.SystemTaskAdapterForm = (0, _Form.generateForm)({
@@ -35,6 +35,8 @@ var fields = function fields() {
35
35
  label: 'Username',
36
36
  type: 'text',
37
37
  required: true,
38
+ pattern: /^[^/&?=:%]*$/,
39
+ patternMessage: 'The characters / & ? = : % are not allowed.',
38
40
  initialValue: (0, _immutable.get)(user, 'username') || ''
39
41
  }, {
40
42
  name: 'password',