@kineticdata/react 6.0.4 → 6.1.0
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/CHANGELOG.md +116 -86
- package/lib/apis/core/attributeDefinitions.js +9 -6
- package/lib/apis/core/integrations.js +61 -0
- package/lib/apis/core/submissions.js +52 -15
- package/lib/apis/http.js +16 -2
- package/lib/apis/index.js +24 -0
- package/lib/apis/integrator/index.js +262 -0
- package/lib/apis/system/index.js +64 -12
- package/lib/apis/task/index.js +9 -2
- package/lib/components/agent/filestore/FilestoreForm.js +1 -1
- package/lib/components/common/AttributeSelect.js +10 -2
- package/lib/components/common/BridgeSelect.js +2 -1
- package/lib/components/common/ConnectionSelect.js +72 -0
- package/lib/components/common/FormSelect.js +2 -1
- package/lib/components/common/StaticSelect.js +15 -6
- package/lib/components/common/TableInput.js +4 -1
- package/lib/components/common/TeamSelect.js +2 -1
- package/lib/components/common/ToastContainer.js +34 -10
- package/lib/components/common/Typeahead.js +59 -23
- package/lib/components/common/UserSelect.js +2 -1
- package/lib/components/common/authentication/RequestInterceptor.js +1 -1
- package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +3 -0
- package/lib/components/core/bridge_model/BridgeModelTable.js +19 -0
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeForm.js +6 -9
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeTable.js +0 -4
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationForm.js +7 -10
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationTable.js +2 -15
- package/lib/components/core/category/CategoryForm.js +4 -1
- package/lib/components/core/category/CategoryTable.js +2 -2
- package/lib/components/core/core_form/CoreForm.js +18 -10
- package/lib/components/core/file_resource/FileResourceForm.js +2 -1
- package/lib/components/core/file_resource/FileResourceTable.js +14 -7
- package/lib/components/core/form/FormForm.js +42 -19
- package/lib/components/core/form/FormTable.js +14 -14
- package/lib/components/core/form_type/FormTypeForm.js +3 -0
- package/lib/components/core/i18n/Moment.js +1 -0
- package/lib/components/core/integration/IntegrationForm.js +232 -0
- package/lib/components/core/integration/IntegrationTable.js +139 -0
- package/lib/components/core/kapp/KappForm.js +56 -67
- package/lib/components/core/kapp/KappTable.js +3 -3
- package/lib/components/core/log/LogTable.js +1 -1
- package/lib/components/core/security_definition/SecurityDefinitionForm.js +48 -10
- package/lib/components/core/space/SpaceForm.js +97 -111
- package/lib/components/core/submission/DatastoreSubmissionTable.js +4 -4
- package/lib/components/core/submission/FormSubmissionTable.js +12 -7
- package/lib/components/core/submission/KappSubmissionTable.js +4 -4
- package/lib/components/core/submission/SubmissionForm.js +3 -1
- package/lib/components/core/team/TeamTable.js +17 -7
- package/lib/components/core/user/UserTable.js +18 -18
- package/lib/components/core/webapi/WebApiForm.js +5 -2
- package/lib/components/core/webapi/WebApiTable.js +2 -2
- package/lib/components/core/webhook/WebhookForm.js +43 -33
- package/lib/components/core/webhook/WebhookTable.js +16 -16
- package/lib/components/core/webhook_job/WebhookJobTable.js +17 -6
- package/lib/components/form/Form.helpers.js +10 -4
- package/lib/components/form/Form.js +250 -168
- package/lib/components/form/Form.models.js +6 -1
- package/lib/components/form/FormState.js +9 -5
- package/lib/components/form/defaults/CodeField.js +44 -1
- package/lib/components/index.js +84 -3
- package/lib/components/integrator/connection/ConnectionForm.js +112 -0
- package/lib/components/integrator/connection/ConnectionTable.js +80 -0
- package/lib/components/integrator/connection/config_fields/http.js +570 -0
- package/lib/components/integrator/integrationTypes.js +98 -0
- package/lib/components/integrator/operation/OperationForm.js +128 -0
- package/lib/components/integrator/operation/OperationTable.js +64 -0
- package/lib/components/integrator/operation/config_fields/http.js +184 -0
- package/lib/components/system/SystemSecurityForm.js +1 -1
- package/lib/components/system/SystemTaskAdapterForm.js +9 -9
- package/lib/components/system/helpers.js +123 -100
- package/lib/components/system/spaces/SystemSpaceForm.js +9 -37
- package/lib/components/system/spaces/SystemTenantForm.js +276 -104
- package/lib/components/system/spaces/SystemTenantMigrateForm.js +449 -0
- package/lib/components/system/spaces/SystemTenantTable.js +20 -16
- package/lib/components/table/Table.redux.js +1 -1
- package/lib/components/task/builder/ConnectorForm.js +11 -7
- package/lib/components/task/builder/Node.js +11 -2
- package/lib/components/task/builder/NodeForm.js +93 -22
- package/lib/components/task/builder/NodeParametersForm.js +29 -17
- package/lib/components/task/builder/TaskDefinitionConfigForm.js +18 -50
- package/lib/components/task/builder/TreeBuilder.js +32 -5
- package/lib/components/task/builder/builder.redux.js +399 -205
- package/lib/components/task/builder/constants.js +10 -2
- package/lib/components/task/builder/helpers.js +199 -79
- package/lib/components/task/builder/models.js +11 -9
- package/lib/components/task/category/TaskCategoryTable.js +3 -3
- package/lib/components/task/common/UsageTable.js +1 -1
- package/lib/components/task/handlers/HandlerTable.js +35 -19
- package/lib/components/task/policy_rule/PolicyRuleTable.js +3 -3
- package/lib/components/task/runs/CreateManualTriggerForm.js +2 -0
- package/lib/components/task/runs/RunTable.js +4 -4
- package/lib/components/task/runs/RunTaskTable.js +1 -1
- package/lib/components/task/sources/SourceTable.js +2 -2
- package/lib/components/task/triggers/TriggerTable.js +2 -2
- package/lib/components/task/workflows/LinkedWorkflowTable.js +2 -2
- package/lib/components/task/workflows/WorkflowForm.js +29 -9
- package/lib/components/task/workflows/WorkflowTable.js +2 -2
- package/lib/helpers/index.js +289 -72
- package/package.json +5 -3
- package/proxyhelper.js +28 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,86 +1,116 @@
|
|
|
1
|
-
# Changelog for `@kineticdata/react`
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- Upgraded
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
1
|
+
# Changelog for `@kineticdata/react`
|
|
2
|
+
|
|
3
|
+
This changelog documents the changes to the `@kineticdata/react` library that are relevant when the library is used for customer implementations. It does not document changes made to components used in our internal consoles.
|
|
4
|
+
|
|
5
|
+
When upgrading `@kineticdata/react` to a newer version, remember that all `@kineticdata/*` libraries must be on the same exact version. This is because each `@kineticdata/bundle-*` library has `@kineticdata/react` as a dependency, and if two different versions of `@kineticdata/react` are installed in a bundle, the bundle will never load because authentication happens in a different version of `@kineticdata/react` than the one used during rendering the packages.
|
|
6
|
+
|
|
7
|
+
Remember to always run `yarn install` after upgrading any dependency versions.
|
|
8
|
+
|
|
9
|
+
## 6.1.0 (February 7, 2025)
|
|
10
|
+
|
|
11
|
+
- Upgraded `axios` version to resolve vulnerabilities
|
|
12
|
+
- Added missing `qs` and `react-beautiful-dnd` dependencies
|
|
13
|
+
- Added new API functions for Kapp Integrations
|
|
14
|
+
- `fetchIntegrations`, `fetchIntegration`, `createIntegration`, `updateIntegration`, `deleteIntegration`, `executeIntegration`
|
|
15
|
+
- Added new API functions for Connections
|
|
16
|
+
- `fetchConnections`, `fetchConnection`, `updateConnection`, `createConnection`, `deleteConnection`, `testConnection`
|
|
17
|
+
- Added new API functions for Operations
|
|
18
|
+
- `fetchOperations`, `fetchOperation`, `updateOperation`, `createOperation`, `deleteOperation`, `fetchBulkOperations`, `inspectOperation`, `executeOperation`
|
|
19
|
+
- Added misc API functions that were missing
|
|
20
|
+
- `cloneSubmission`
|
|
21
|
+
- Added new props to `CoreForm`
|
|
22
|
+
- `renderProps` allows passing through props to the `Layout` component
|
|
23
|
+
- `addSubmissionIncludes` and `addFormIncludes` allows passing an array of additional `include` properties for the corresponding queries
|
|
24
|
+
|
|
25
|
+
## 6.0.5 (February 16, 2024)
|
|
26
|
+
|
|
27
|
+
- Upgraded `axios` version to resolve vulnerabilities
|
|
28
|
+
|
|
29
|
+
## 6.0.4 (January 22, 2024)
|
|
30
|
+
|
|
31
|
+
- Fixed bug with SAML logout options
|
|
32
|
+
|
|
33
|
+
## 6.0.3 (December 11, 2023)
|
|
34
|
+
|
|
35
|
+
_No relevant changes._
|
|
36
|
+
|
|
37
|
+
## 6.0.2 (November 6, 2023)
|
|
38
|
+
|
|
39
|
+
- Removed XSRF header setting from Request Interceptor
|
|
40
|
+
- Added SAML logout options
|
|
41
|
+
- Upgraded various `dependencies` to resolve vulnerabilities
|
|
42
|
+
- Updated the `react` and `react-dom` `peerDependencies` to `>=17.0.2` to support the latest versions of React
|
|
43
|
+
|
|
44
|
+
### Bundle Issues
|
|
45
|
+
|
|
46
|
+
One of the `dependencies` that was updated is `axios` whose latest version causes some issues with the latest `react-scripts`. If the bundle has a `craco.config.js` file, the following steps must be taken when upgrading to this version.
|
|
47
|
+
|
|
48
|
+
1. In `craco.config.js`, add the following function to the very end of the file:
|
|
49
|
+
|
|
50
|
+
```javascript
|
|
51
|
+
function getFileLoaderRule(rules) {
|
|
52
|
+
for (const rule of rules) {
|
|
53
|
+
if ('oneOf' in rule) {
|
|
54
|
+
const found = getFileLoaderRule(rule.oneOf);
|
|
55
|
+
if (found) {
|
|
56
|
+
return found;
|
|
57
|
+
}
|
|
58
|
+
} else if (rule.test === undefined && rule.type === 'asset/resource') {
|
|
59
|
+
return rule;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
2. In `craco.config.js`, add the following code inside the `configure` function of the `webpack` object:
|
|
66
|
+
|
|
67
|
+
```javascript
|
|
68
|
+
// Fix for CJS files not being treated as JavaScript files
|
|
69
|
+
// https://github.com/facebook/create-react-app/issues/11889#issuecomment-1114928008
|
|
70
|
+
const fileLoaderRule = getFileLoaderRule(webpackConfig.module.rules);
|
|
71
|
+
if (!fileLoaderRule) {
|
|
72
|
+
throw new Error('File loader not found');
|
|
73
|
+
}
|
|
74
|
+
fileLoaderRule.exclude.push(/\.cjs$/);
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## 6.0.1 (September 20, 2023)
|
|
78
|
+
|
|
79
|
+
- Updated the `react` and `react-dom` `peerDependencies` to `^17.0.2` to support React v17
|
|
80
|
+
|
|
81
|
+
### Bundle Issues
|
|
82
|
+
|
|
83
|
+
It is recommended to upgrade the bundle's `react` and `react-dom` versions to `^17.0.2`. This upgrade should not have any breaking changes. To do so, update these two dependency versions in `bundle/packages/app/package.json` and the peer dependency versions in all of the `package.json` files of the other packages.
|
|
84
|
+
|
|
85
|
+
If you do upgrade `react` to v17, the following steps must also be taken if the bundle has testing configured:
|
|
86
|
+
|
|
87
|
+
1. In `bundle/package.json`, remove the `enzyme-adapter-react-16` dependency, and add the following dependency:
|
|
88
|
+
`"@wojtekmaj/enzyme-adapter-react-17": "^0.8.0"`
|
|
89
|
+
2. In `bundle/packages/app/src/setupTests.js`, change the `Adapter` import from `enzyme-adapter-react-16` to be from `@wojtekmaj/enzyme-adapter-react-17`.
|
|
90
|
+
|
|
91
|
+
## 6.0.0 (February 22, 2023)
|
|
92
|
+
|
|
93
|
+
- Removed all code related to Discussions
|
|
94
|
+
- Removed most `devDependencies`, which were move to the project root
|
|
95
|
+
|
|
96
|
+
### Bundle Issues
|
|
97
|
+
|
|
98
|
+
Because all discussions code was removed from the library, any bundles that are upgraded to this version must have all of their discussions code removed as well, since the various imports from this library that bundles used no longer exist.
|
|
99
|
+
|
|
100
|
+
We consolidated most of our `devDependencies` into the root of our project, of which `@kineticdata/react` is just one part. Any bundles upgrading to this version must add the following `devDependencies` to the `package.json` file in the root of their `bundle` folder:
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
"@babel/cli": "^7.23.0",
|
|
104
|
+
"@babel/runtime": "^7.23.2",
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
If you get the following error when trying to run your bundle:
|
|
108
|
+
`Uncaught Error: Cannot find module '@babel/runtime/helpers/esm/regeneratorRuntime'`
|
|
109
|
+
You will need to run the following commands in your `bundle` directory:
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
npx yarn-deduplicate --packages @babel/runtime -- yarn.lock
|
|
113
|
+
yarn install
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The above step will always be required when first upgrading to a v6+ version of `@kineticdata/react`.
|
|
@@ -8,12 +8,9 @@ exports.updateAttributeDefinition = exports.fetchAttributeDefinitions = exports.
|
|
|
8
8
|
var _axios = _interopRequireDefault(require("axios"));
|
|
9
9
|
var _helpers = require("../../helpers");
|
|
10
10
|
var _http = require("../http");
|
|
11
|
-
// The API returns the singular name of the attribute type, so we remove the "s"
|
|
12
|
-
// except for userProfileAttributeDefinitions and datastoreFormAttributeDefinitions
|
|
13
|
-
// TODO: KCORE-2982
|
|
14
|
-
// TODO: Remove datastoreFormAttributeDefinitions when fully deprecated. See b4a24c6
|
|
11
|
+
// The API returns the singular name of the attribute type, so we remove the "s"
|
|
15
12
|
var responseEnvelope = function responseEnvelope(attributeType) {
|
|
16
|
-
return
|
|
13
|
+
return attributeType.replace(/s$/, '');
|
|
17
14
|
};
|
|
18
15
|
var validateOptions = function validateOptions(functionName, requiredOptions, options) {
|
|
19
16
|
var validAttributes = ['spaceAttributeDefinitions', 'teamAttributeDefinitions', 'userAttributeDefinitions', 'userProfileAttributeDefinitions', 'categoryAttributeDefinitions', 'kappAttributeDefinitions', 'formAttributeDefinitions'];
|
|
@@ -64,7 +61,13 @@ var fetchAttributeDefinition = exports.fetchAttributeDefinition = function fetch
|
|
|
64
61
|
headers: (0, _http.headerBuilder)(options)
|
|
65
62
|
}).then(function (response) {
|
|
66
63
|
return {
|
|
67
|
-
|
|
64
|
+
// The userProfileAttributeDefinition fetch returns a pluralized name
|
|
65
|
+
// instead of the singular name as it should, so we want to check both
|
|
66
|
+
// the singular and plural versions in that case to be backwards
|
|
67
|
+
// compatible when this gets fixed on the server.
|
|
68
|
+
// TODO Remove this check and only keep the responseEvelope once the
|
|
69
|
+
// server side code is fixed.
|
|
70
|
+
attributeDefinition: attributeType !== 'userProfileAttributeDefinitions' ? response.data[responseEnvelope(attributeType)] : response.data[responseEnvelope(attributeType)] || response.data[attributeType]
|
|
68
71
|
};
|
|
69
72
|
})["catch"](_http.handleErrors);
|
|
70
73
|
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.updateIntegration = exports.fetchIntegrations = exports.fetchIntegration = exports.executeIntegration = exports.deleteIntegration = exports.createIntegration = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
|
+
var _http = require("../http");
|
|
10
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
11
|
+
var _helpers = require("../../helpers");
|
|
12
|
+
var _apiGroup = (0, _http.apiGroup)({
|
|
13
|
+
name: 'Integration',
|
|
14
|
+
dataOption: 'integration',
|
|
15
|
+
plural: {
|
|
16
|
+
requiredOptions: ['kappSlug'],
|
|
17
|
+
url: function url(_ref) {
|
|
18
|
+
var kappSlug = _ref.kappSlug;
|
|
19
|
+
return "/kapps/".concat(kappSlug, "/integrations");
|
|
20
|
+
},
|
|
21
|
+
transform: function transform(response) {
|
|
22
|
+
return response.data;
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
singular: {
|
|
26
|
+
requiredOptions: ['kappSlug', 'name'],
|
|
27
|
+
url: function url(_ref2) {
|
|
28
|
+
var name = _ref2.name,
|
|
29
|
+
kappSlug = _ref2.kappSlug;
|
|
30
|
+
return "/kapps/".concat(kappSlug, "/integrations/").concat(name);
|
|
31
|
+
},
|
|
32
|
+
transform: function transform(response) {
|
|
33
|
+
return {
|
|
34
|
+
integration: response.data.integration
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}),
|
|
39
|
+
fetchIntegrations = exports.fetchIntegrations = _apiGroup.fetchIntegrations,
|
|
40
|
+
fetchIntegration = exports.fetchIntegration = _apiGroup.fetchIntegration,
|
|
41
|
+
createIntegration = exports.createIntegration = _apiGroup.createIntegration,
|
|
42
|
+
updateIntegration = exports.updateIntegration = _apiGroup.updateIntegration,
|
|
43
|
+
deleteIntegration = exports.deleteIntegration = _apiGroup.deleteIntegration;
|
|
44
|
+
var executeIntegration = exports.executeIntegration = function executeIntegration() {
|
|
45
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
46
|
+
(0, _http.validateOptions)('executeOperation', ['kappSlug', 'integrationName'], options);
|
|
47
|
+
var kappSlug = options.kappSlug,
|
|
48
|
+
formSlug = options.formSlug,
|
|
49
|
+
integrationName = options.integrationName,
|
|
50
|
+
_options$parameters = options.parameters,
|
|
51
|
+
parameters = _options$parameters === void 0 ? {} : _options$parameters;
|
|
52
|
+
var params = (0, _objectSpread2["default"])({}, (0, _http.paramBuilder)(options));
|
|
53
|
+
return _axios["default"].post("".concat(_helpers.bundle.apiLocation(), "/integrations/kapps/").concat(kappSlug).concat(formSlug ? "/forms/".concat(formSlug) : '', "/").concat(integrationName), parameters, {
|
|
54
|
+
params: params,
|
|
55
|
+
headers: (0, _http.headerBuilder)(options)
|
|
56
|
+
}).then(function (response) {
|
|
57
|
+
return {
|
|
58
|
+
data: response.data
|
|
59
|
+
};
|
|
60
|
+
})["catch"](_http.handleErrors);
|
|
61
|
+
};
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.updateSubmission = exports.submitSubmission = exports.searchSubmissions = exports.saveSubmissionMultipart = exports.importSubmissions = exports.importSubmissionStatus = exports.fetchSubmission = exports.exportSubmissions = exports.deleteSubmission = exports.createSubmission = exports.VALID_TIMELINES = exports.VALID_KAPP_CORE_STATES = exports.VALID_DS_CORE_STATES = exports.SubmissionSearch = exports.MODE_IMPORT = exports.MODE_BULK = void 0;
|
|
7
|
+
exports.updateSubmission = exports.submitSubmission = exports.searchSubmissions = exports.saveSubmissionMultipart = exports.importSubmissions = exports.importSubmissionStatus = exports.fetchSubmission = exports.exportSubmissions = exports.deleteSubmission = exports.createSubmission = exports.cloneSubmission = exports.VALID_TIMELINES = exports.VALID_KAPP_CORE_STATES = exports.VALID_DS_CORE_STATES = exports.SubmissionSearch = exports.MODE_IMPORT = exports.MODE_BULK = void 0;
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
|
|
9
9
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
|
@@ -40,8 +40,8 @@ var SubmissionSearch = exports.SubmissionSearch = /*#__PURE__*/function () {
|
|
|
40
40
|
this.isDatastore = datastore;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
/*
|
|
44
|
-
* Context Management
|
|
43
|
+
/*
|
|
44
|
+
* Context Management
|
|
45
45
|
*/
|
|
46
46
|
(0, _createClass2["default"])(SubmissionSearch, [{
|
|
47
47
|
key: "currentContext",
|
|
@@ -59,8 +59,8 @@ var SubmissionSearch = exports.SubmissionSearch = /*#__PURE__*/function () {
|
|
|
59
59
|
return this.queryContext.pop();
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
/*
|
|
63
|
-
* Execution Methods
|
|
62
|
+
/*
|
|
63
|
+
* Execution Methods
|
|
64
64
|
*/
|
|
65
65
|
}, {
|
|
66
66
|
key: "build",
|
|
@@ -81,8 +81,8 @@ var SubmissionSearch = exports.SubmissionSearch = /*#__PURE__*/function () {
|
|
|
81
81
|
return this.query;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
/*
|
|
85
|
-
* Equality Methods
|
|
84
|
+
/*
|
|
85
|
+
* Equality Methods
|
|
86
86
|
*/
|
|
87
87
|
}, {
|
|
88
88
|
key: "eq",
|
|
@@ -172,8 +172,8 @@ var SubmissionSearch = exports.SubmissionSearch = /*#__PURE__*/function () {
|
|
|
172
172
|
return this;
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
/*
|
|
176
|
-
* Grouping Methods
|
|
175
|
+
/*
|
|
176
|
+
* Grouping Methods
|
|
177
177
|
*/
|
|
178
178
|
}, {
|
|
179
179
|
key: "or",
|
|
@@ -205,8 +205,8 @@ var SubmissionSearch = exports.SubmissionSearch = /*#__PURE__*/function () {
|
|
|
205
205
|
return this;
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
/*
|
|
209
|
-
* Sorting Methods
|
|
208
|
+
/*
|
|
209
|
+
* Sorting Methods
|
|
210
210
|
*/
|
|
211
211
|
}, {
|
|
212
212
|
key: "sortBy",
|
|
@@ -305,8 +305,8 @@ var SubmissionSearch = exports.SubmissionSearch = /*#__PURE__*/function () {
|
|
|
305
305
|
return this;
|
|
306
306
|
}
|
|
307
307
|
|
|
308
|
-
/*
|
|
309
|
-
* Privately used utilities.
|
|
308
|
+
/*
|
|
309
|
+
* Privately used utilities.
|
|
310
310
|
*/
|
|
311
311
|
}, {
|
|
312
312
|
key: "validateOuter",
|
|
@@ -492,6 +492,43 @@ var createSubmission = exports.createSubmission = function createSubmission(opti
|
|
|
492
492
|
// cleans up any errors.
|
|
493
493
|
["catch"](_http.handleErrors);
|
|
494
494
|
};
|
|
495
|
+
var cloneSubmission = exports.cloneSubmission = function cloneSubmission(options) {
|
|
496
|
+
var id = options.id,
|
|
497
|
+
_options$completed2 = options.completed,
|
|
498
|
+
completed = _options$completed2 === void 0 ? false : _options$completed2,
|
|
499
|
+
_options$submission = options.submission,
|
|
500
|
+
submission = _options$submission === void 0 ? {} : _options$submission,
|
|
501
|
+
_options$files = options.files,
|
|
502
|
+
files = _options$files === void 0 ? [] : _options$files;
|
|
503
|
+
if (!id) {
|
|
504
|
+
throw new Error('cloneSubmission failed! The option "id" is required.');
|
|
505
|
+
}
|
|
506
|
+
var path = "".concat(_helpers.bundle.apiLocation(), "/submissions/").concat(id, "/clone");
|
|
507
|
+
var params = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, (0, _http.paramBuilder)(options)), {}, {
|
|
508
|
+
completed: completed
|
|
509
|
+
});
|
|
510
|
+
var formData = new FormData();
|
|
511
|
+
formData.append('submission', JSON.stringify(submission));
|
|
512
|
+
files.forEach(function (_ref) {
|
|
513
|
+
var fieldName = _ref.fieldName,
|
|
514
|
+
file = _ref.file,
|
|
515
|
+
filename = _ref.filename;
|
|
516
|
+
formData.append(fieldName, file, filename);
|
|
517
|
+
});
|
|
518
|
+
return _axios["default"].post(path, formData, {
|
|
519
|
+
params: params,
|
|
520
|
+
headers: (0, _http.headerBuilder)(options)
|
|
521
|
+
})
|
|
522
|
+
// Remove the response envelop and leave us with the submission one.
|
|
523
|
+
.then(function (response) {
|
|
524
|
+
return {
|
|
525
|
+
submission: response.data.submission
|
|
526
|
+
};
|
|
527
|
+
})
|
|
528
|
+
// Clean up any errors we receive. Make sure this the last thing so that it
|
|
529
|
+
// cleans up any errors.
|
|
530
|
+
["catch"](_http.handleErrors);
|
|
531
|
+
};
|
|
495
532
|
var updateSubmission = exports.updateSubmission = function updateSubmission(options) {
|
|
496
533
|
var id = options.id,
|
|
497
534
|
values = options.values;
|
|
@@ -521,8 +558,8 @@ var saveSubmissionMultipart = exports.saveSubmissionMultipart = function saveSub
|
|
|
521
558
|
files = options.files,
|
|
522
559
|
coreState = options.coreState,
|
|
523
560
|
parent = options.parent,
|
|
524
|
-
_options$
|
|
525
|
-
completed = _options$
|
|
561
|
+
_options$completed3 = options.completed,
|
|
562
|
+
completed = _options$completed3 === void 0 ? !id : _options$completed3;
|
|
526
563
|
|
|
527
564
|
// Determine whether we should use the create or update endpoint based on the
|
|
528
565
|
// options provided (the rest of the HTTP request behaves the same way
|
package/lib/apis/http.js
CHANGED
|
@@ -119,12 +119,26 @@ var formDataBuilder = exports.formDataBuilder = function formDataBuilder(data, p
|
|
|
119
119
|
return result;
|
|
120
120
|
}, formData);
|
|
121
121
|
};
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
*
|
|
125
|
+
* @param {string} functionName
|
|
126
|
+
* @param {(string|string[])[]} requiredOptions
|
|
127
|
+
* The keys of the required options. You can group keys in a nested array if
|
|
128
|
+
* only one of a subset is required.
|
|
129
|
+
* @param {object} options
|
|
130
|
+
* The options object to validate.
|
|
131
|
+
*/
|
|
122
132
|
var validateOptions = exports.validateOptions = function validateOptions(functionName, requiredOptions, options) {
|
|
123
133
|
var missing = requiredOptions.filter(function (requiredOption) {
|
|
124
|
-
return !
|
|
134
|
+
return Array.isArray(requiredOption) ? !requiredOption.some(function (option) {
|
|
135
|
+
return options[option];
|
|
136
|
+
}) : !options[requiredOption];
|
|
125
137
|
});
|
|
126
138
|
if (missing.length > 0) {
|
|
127
|
-
throw new Error("".concat(functionName, " failed! The following required options are missing: ").concat(missing)
|
|
139
|
+
throw new Error("".concat(functionName, " failed! The following required options are missing: ").concat(missing.map(function (key) {
|
|
140
|
+
return Array.isArray(key) ? key.join(' or ') : key;
|
|
141
|
+
}).join(', ')));
|
|
128
142
|
}
|
|
129
143
|
};
|
|
130
144
|
var apiFunction = exports.apiFunction = function apiFunction(_ref) {
|
package/lib/apis/index.js
CHANGED
|
@@ -204,6 +204,18 @@ Object.keys(_formTypes).forEach(function (key) {
|
|
|
204
204
|
}
|
|
205
205
|
});
|
|
206
206
|
});
|
|
207
|
+
var _integrations = require("./core/integrations");
|
|
208
|
+
Object.keys(_integrations).forEach(function (key) {
|
|
209
|
+
if (key === "default" || key === "__esModule") return;
|
|
210
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
211
|
+
if (key in exports && exports[key] === _integrations[key]) return;
|
|
212
|
+
Object.defineProperty(exports, key, {
|
|
213
|
+
enumerable: true,
|
|
214
|
+
get: function get() {
|
|
215
|
+
return _integrations[key];
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
});
|
|
207
219
|
var _kapps = require("./core/kapps");
|
|
208
220
|
Object.keys(_kapps).forEach(function (key) {
|
|
209
221
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -445,6 +457,18 @@ Object.keys(_workflows).forEach(function (key) {
|
|
|
445
457
|
});
|
|
446
458
|
});
|
|
447
459
|
var _http = require("./http");
|
|
460
|
+
var _integrator = require("./integrator");
|
|
461
|
+
Object.keys(_integrator).forEach(function (key) {
|
|
462
|
+
if (key === "default" || key === "__esModule") return;
|
|
463
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
464
|
+
if (key in exports && exports[key] === _integrator[key]) return;
|
|
465
|
+
Object.defineProperty(exports, key, {
|
|
466
|
+
enumerable: true,
|
|
467
|
+
get: function get() {
|
|
468
|
+
return _integrator[key];
|
|
469
|
+
}
|
|
470
|
+
});
|
|
471
|
+
});
|
|
448
472
|
var _task = require("./task");
|
|
449
473
|
Object.keys(_task).forEach(function (key) {
|
|
450
474
|
if (key === "default" || key === "__esModule") return;
|