@kineticdata/react 5.0.16 → 5.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/lib/apis/core/attributeDefinitions.js +3 -2
- package/lib/apis/core/authentication.js +13 -5
- package/lib/apis/core/backgroundJobs.js +22 -39
- package/lib/apis/core/fileResources.js +36 -0
- package/lib/apis/core/filestores.js +40 -0
- package/lib/apis/core/forms.js +21 -36
- package/lib/apis/core/forms.test.js +51 -278
- package/lib/apis/core/securityPolicyDefinitions.test.js +4 -4
- package/lib/apis/core/submissions.js +46 -30
- package/lib/apis/core/webhooks.js +1 -2
- package/lib/apis/discussions/index.js +2 -1
- package/lib/apis/http.js +28 -13
- package/lib/apis/http.test.js +13 -15
- package/lib/apis/index.js +2 -0
- package/lib/apis/system/index.js +86 -1
- package/lib/apis/task/index.js +22 -14
- package/lib/components/agent/filestore/FilestoreForm.js +132 -0
- package/lib/components/agent/filestore/FilestoreTable.js +53 -0
- package/lib/components/common/BridgeSelect.js +2 -1
- package/lib/components/common/FormSelect.js +2 -1
- package/lib/components/common/Scroller.js +6 -6
- package/lib/components/common/TableInput.js +74 -29
- package/lib/components/common/TeamSelect.js +2 -1
- package/lib/components/common/Typeahead.js +7 -4
- package/lib/components/common/UserSelect.js +2 -1
- package/lib/components/common/authentication/AuthenticationContainer.js +50 -27
- package/lib/components/common/code_input/languageHelpers.test.js +1 -1
- package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +1 -1
- package/lib/components/core/attribute_definition/AttributeDefinitionTable.js +1 -1
- package/lib/components/core/core_form/CoreForm.js +10 -10
- package/lib/components/core/field_definition/FieldDefinitionForm.js +130 -0
- package/lib/components/core/field_definition/FieldDefinitionTable.js +86 -0
- package/lib/components/core/file_resource/FileResourceForm.js +180 -0
- package/lib/components/core/file_resource/FileResourceTable.js +71 -0
- package/lib/components/core/form/FormForm.js +12 -17
- package/lib/components/core/form/FormTable.js +3 -8
- package/lib/components/core/i18n/I18n.js +15 -15
- package/lib/components/core/index_definition/IndexDefinitionForm.js +32 -19
- package/lib/components/core/index_definition/IndexDefinitionTable.js +15 -24
- package/lib/components/core/index_job/IndexJobTable.js +12 -9
- package/lib/components/core/security_definition/SecurityDefinitionForm.js +1 -1
- package/lib/components/core/space/SpaceForm.js +59 -10
- package/lib/components/core/submission/DatastoreSubmissionTable.js +31 -1
- package/lib/components/core/submission/FormSubmissionFilters.js +378 -0
- package/lib/components/core/submission/FormSubmissionTable.js +116 -0
- package/lib/components/core/submission/KappSubmissionTable.js +250 -0
- package/lib/components/core/submission/SubmissionForm.js +124 -0
- package/lib/components/core/submission/SubmissionTable.js +35 -249
- package/lib/components/core/submission/helpers.js +95 -0
- package/lib/components/core/submission/helpers.test.js +96 -0
- package/lib/components/core/translation/ContextTable.js +1 -1
- package/lib/components/core/user/UserForm.js +2 -2
- package/lib/components/core/webapi/WebApiForm.js +111 -126
- package/lib/components/core/webhook/WebhookForm.js +1 -1
- package/lib/components/form/Form.helpers.js +1 -1
- package/lib/components/form/Form.js +200 -144
- package/lib/components/index.js +16 -6
- package/lib/components/system/SystemBackgroundTasksTable.js +83 -0
- package/lib/components/system/SystemSecurityForm.js +69 -0
- package/lib/components/system/helpers.js +20 -6
- package/lib/components/system/spaces/SystemSpaceForm.js +44 -16
- package/lib/components/system/spaces/SystemTenantForm.js +15 -9
- package/lib/components/system/spaces/SystemTenantTable.js +21 -16
- package/lib/components/table/Table.js +37 -10
- package/lib/components/table/Table.redux.js +228 -57
- package/lib/components/table/Table.redux.test.js +73 -2
- package/lib/components/task/builder/Connector.js +21 -10
- package/lib/components/task/builder/ConnectorForm.js +1 -1
- package/lib/components/task/builder/Node.js +10 -3
- package/lib/components/task/builder/NodeForm.js +54 -22
- package/lib/components/task/builder/NodeParametersForm.js +5 -2
- package/lib/components/task/builder/SvgCanvas.js +13 -4
- package/lib/components/task/builder/TaskDefinitionConfigForm.js +113 -0
- package/lib/components/task/builder/TreeBuilder.js +27 -9
- package/lib/components/task/builder/builder.redux.js +159 -52
- package/lib/components/task/builder/helpers.js +5 -3
- package/lib/components/task/builder/models.js +84 -12
- package/lib/components/task/errors/RunErrorTable.js +1 -1
- package/lib/components/task/runs/CreateManualTriggerForm.js +15 -24
- package/lib/components/task/runs/RunTable.js +5 -3
- package/lib/components/task/triggers/TriggerTable.js +3 -2
- package/lib/components/task/workflows/WorkflowForm.js +67 -85
- package/lib/helpers/index.js +19 -2
- package/lib/index.js +1 -0
- package/lib/models/discussions.js +18 -2
- package/lib/models/index.js +1 -1
- package/package.json +3 -3
- package/proxyhelper.js +19 -6
|
@@ -3,14 +3,15 @@ import { bundle } from '../../helpers';
|
|
|
3
3
|
import { handleErrors, headerBuilder, paramBuilder } from '../http'; // The API returns the singular name of the attribute type, so we remove the "s",
|
|
4
4
|
// except for userProfileAttributeDefinitions and datastoreFormAttributeDefinitions
|
|
5
5
|
// TODO: KCORE-2982
|
|
6
|
+
// TODO: Remove datastoreFormAttributeDefinitions when fully deprecated. See b4a24c6
|
|
6
7
|
|
|
7
8
|
var responseEnvelope = function responseEnvelope(attributeType) {
|
|
8
9
|
return ['userProfileAttributeDefinitions', 'datastoreFormAttributeDefinitions'].includes(attributeType) ? attributeType : attributeType.replace(/s$/, '');
|
|
9
10
|
};
|
|
10
11
|
|
|
11
12
|
var validateOptions = function validateOptions(functionName, requiredOptions, options) {
|
|
12
|
-
var validAttributes = ['spaceAttributeDefinitions', 'teamAttributeDefinitions', 'userAttributeDefinitions', 'userProfileAttributeDefinitions', 'categoryAttributeDefinitions', 'kappAttributeDefinitions', 'formAttributeDefinitions'
|
|
13
|
-
var attributesRequiringKappSlug = ['categoryAttributeDefinitions', 'kappAttributeDefinitions'
|
|
13
|
+
var validAttributes = ['spaceAttributeDefinitions', 'teamAttributeDefinitions', 'userAttributeDefinitions', 'userProfileAttributeDefinitions', 'categoryAttributeDefinitions', 'kappAttributeDefinitions', 'formAttributeDefinitions'];
|
|
14
|
+
var attributesRequiringKappSlug = ['categoryAttributeDefinitions', 'kappAttributeDefinitions'];
|
|
14
15
|
var kappSlugMissing = attributesRequiringKappSlug.includes(options.attributeType) && !options.kappSlug;
|
|
15
16
|
var invalidType = !validAttributes.includes(options.attributeType);
|
|
16
17
|
var missing = requiredOptions.filter(function (requiredOption) {
|
|
@@ -4,7 +4,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
|
4
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
5
5
|
import axios from 'axios';
|
|
6
6
|
import { bundle } from '../../helpers';
|
|
7
|
-
import { fetchProfile } from '
|
|
7
|
+
import { fetchProfile } from './profile';
|
|
8
8
|
import { handleErrors } from '../http';
|
|
9
9
|
export var login = function login(_ref) {
|
|
10
10
|
var username = _ref.username,
|
|
@@ -20,7 +20,7 @@ export var logoutDirect = function logoutDirect() {
|
|
|
20
20
|
return axios.get("".concat(bundle.spaceLocation(), "/app/logout"));
|
|
21
21
|
};
|
|
22
22
|
var checkedOrigin = process.env.REACT_APP_API_HOST ? process.env.REACT_APP_API_HOST : typeof window !== 'undefined' ? window.location.origin : null;
|
|
23
|
-
var clientId = process.env.REACT_APP_OAUTH_CLIENT_ID
|
|
23
|
+
var clientId = process.env.REACT_APP_OAUTH_CLIENT_ID ? process.env.REACT_APP_OAUTH_CLIENT_ID : process.env.NODE_ENV === 'production' ? 'system' : 'system-dev';
|
|
24
24
|
export var retrieveJwt = function retrieveJwt() {
|
|
25
25
|
return new Promise(function (resolve) {
|
|
26
26
|
var iframe = document.createElement('iframe');
|
|
@@ -52,9 +52,17 @@ export var singleSignOn = function singleSignOn(spaceSlug, dimensions) {
|
|
|
52
52
|
var options = _objectSpread(_objectSpread({}, dimensions), getPopupPosition(window, dimensions));
|
|
53
53
|
|
|
54
54
|
var endpoint = bundle.spaceLocation() + '/app/saml/login/alias/' + spaceSlug;
|
|
55
|
-
var popup = window.open(endpoint, target, stringifyOptions(options));
|
|
55
|
+
var popup = window.open(endpoint, target, stringifyOptions(options));
|
|
56
|
+
|
|
57
|
+
if (!popup) {
|
|
58
|
+
resolve({
|
|
59
|
+
error: 'Enterprise Sign In popup was blocked by the browser.'
|
|
60
|
+
});
|
|
61
|
+
return;
|
|
62
|
+
} // Create an event handler that closes the popup window if we focus the
|
|
56
63
|
// parent window
|
|
57
64
|
|
|
65
|
+
|
|
58
66
|
var windowFocusHandler = function windowFocusHandler() {
|
|
59
67
|
popup.close();
|
|
60
68
|
window.removeEventListener('focus', windowFocusHandler);
|
|
@@ -80,7 +88,7 @@ export var singleSignOn = function singleSignOn(spaceSlug, dimensions) {
|
|
|
80
88
|
}
|
|
81
89
|
|
|
82
90
|
resolve({
|
|
83
|
-
error: '
|
|
91
|
+
error: 'Enterprise Sign In was cancelled.'
|
|
84
92
|
});
|
|
85
93
|
_context.next = 12;
|
|
86
94
|
break;
|
|
@@ -107,7 +115,7 @@ export var singleSignOn = function singleSignOn(spaceSlug, dimensions) {
|
|
|
107
115
|
} else {
|
|
108
116
|
popup.close();
|
|
109
117
|
resolve({
|
|
110
|
-
error: '
|
|
118
|
+
error: 'Enterprise Sign In timed out.'
|
|
111
119
|
});
|
|
112
120
|
}
|
|
113
121
|
|
|
@@ -1,15 +1,24 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
1
2
|
import axios from 'axios';
|
|
2
3
|
import { bundle } from '../../helpers';
|
|
3
4
|
import { handleErrors, paramBuilder, headerBuilder } from '../http';
|
|
4
5
|
|
|
5
|
-
var backgroundJobPath = function backgroundJobPath(
|
|
6
|
-
|
|
6
|
+
var backgroundJobPath = function backgroundJobPath() {
|
|
7
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
8
|
+
formSlug = _ref.formSlug,
|
|
9
|
+
kappSlug = _ref.kappSlug,
|
|
10
|
+
job = _ref.job;
|
|
11
|
+
|
|
12
|
+
var basePath = !formSlug && !kappSlug ? "".concat(bundle.apiLocation(), "/backgroundJobs") : !formSlug && kappSlug ? "".concat(bundle.apiLocation(), "/kapps/").concat(kappSlug, "/backgroundJobs") : formSlug && !kappSlug ? "".concat(bundle.apiLocation(), "/forms/").concat(formSlug, "/backgroundJobs") : "".concat(bundle.apiLocation(), "/kapps/").concat(kappSlug, "/forms/").concat(formSlug, "/backgroundJobs");
|
|
13
|
+
return basePath + (job ? "/".concat(job) : '');
|
|
7
14
|
};
|
|
8
15
|
|
|
9
16
|
export var fetchBackgroundJobs = function fetchBackgroundJobs() {
|
|
10
17
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
11
|
-
return axios.get(backgroundJobPath(), {
|
|
12
|
-
params: paramBuilder(options),
|
|
18
|
+
return axios.get(backgroundJobPath(options), {
|
|
19
|
+
params: _objectSpread(_objectSpread({}, paramBuilder(options)), {}, {
|
|
20
|
+
completed: options.completed
|
|
21
|
+
}),
|
|
13
22
|
headers: headerBuilder(options)
|
|
14
23
|
}).then(function (response) {
|
|
15
24
|
return {
|
|
@@ -19,22 +28,16 @@ export var fetchBackgroundJobs = function fetchBackgroundJobs() {
|
|
|
19
28
|
};
|
|
20
29
|
export var createBackgroundJob = function createBackgroundJob() {
|
|
21
30
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
22
|
-
var
|
|
23
|
-
type = options.type,
|
|
31
|
+
var type = options.type,
|
|
24
32
|
content = options.content;
|
|
25
|
-
var path = backgroundJobPath(
|
|
26
|
-
|
|
27
|
-
if (job === null) {
|
|
28
|
-
throw new Error("createBackgroundJob failed! Property \"job\" is required.");
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (path === null) {
|
|
32
|
-
throw new Error("createBackgroundJob failed! Unsupported parentType: 'job.parentType'");
|
|
33
|
-
}
|
|
34
|
-
|
|
33
|
+
var path = backgroundJobPath(options);
|
|
35
34
|
return axios.post(path, {
|
|
36
35
|
type: type,
|
|
37
36
|
content: content
|
|
37
|
+
}, {
|
|
38
|
+
params: {
|
|
39
|
+
simulate: options.simulate
|
|
40
|
+
}
|
|
38
41
|
}).then(function (response) {
|
|
39
42
|
return {
|
|
40
43
|
backgroundJob: response.data.backgroundJob
|
|
@@ -43,18 +46,8 @@ export var createBackgroundJob = function createBackgroundJob() {
|
|
|
43
46
|
};
|
|
44
47
|
export var updateBackgroundJob = function updateBackgroundJob() {
|
|
45
48
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
var path = backgroundJobPath(job);
|
|
49
|
-
|
|
50
|
-
if (job === null) {
|
|
51
|
-
throw new Error("updateBackgroundJob failed! Property \"job\" is required.");
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (path === null) {
|
|
55
|
-
throw new Error("updateBackgroundJob failed! Unsupported parentType: 'job.parentType'");
|
|
56
|
-
}
|
|
57
|
-
|
|
49
|
+
var status = options.status;
|
|
50
|
+
var path = backgroundJobPath(options);
|
|
58
51
|
return axios.put(path, {
|
|
59
52
|
status: status
|
|
60
53
|
}, {
|
|
@@ -68,17 +61,7 @@ export var updateBackgroundJob = function updateBackgroundJob() {
|
|
|
68
61
|
};
|
|
69
62
|
export var deleteBackgroundJob = function deleteBackgroundJob() {
|
|
70
63
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
71
|
-
var
|
|
72
|
-
var path = backgroundJobPath(job);
|
|
73
|
-
|
|
74
|
-
if (job === null) {
|
|
75
|
-
throw new Error("deleteBackgroundJob failed! Property \"job\" is required.");
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (path === null) {
|
|
79
|
-
throw new Error("deleteBackgroundJob failed! Unsupported parentType: 'job.parentType'");
|
|
80
|
-
}
|
|
81
|
-
|
|
64
|
+
var path = backgroundJobPath(options);
|
|
82
65
|
return axios["delete"](path, {
|
|
83
66
|
params: paramBuilder(options),
|
|
84
67
|
headers: headerBuilder(options)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { apiGroup } from '../http';
|
|
2
|
+
|
|
3
|
+
var _apiGroup = apiGroup({
|
|
4
|
+
name: 'FileResource',
|
|
5
|
+
dataOption: 'fileResource',
|
|
6
|
+
plural: {
|
|
7
|
+
requiredOptions: [],
|
|
8
|
+
url: function url() {
|
|
9
|
+
return '/fileResources';
|
|
10
|
+
},
|
|
11
|
+
transform: function transform(response) {
|
|
12
|
+
return {
|
|
13
|
+
fileResources: response.data.fileResources
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
singular: {
|
|
18
|
+
requiredOptions: ['fileResourceSlug'],
|
|
19
|
+
url: function url(_ref) {
|
|
20
|
+
var fileResourceSlug = _ref.fileResourceSlug;
|
|
21
|
+
return "/fileResources/".concat(fileResourceSlug);
|
|
22
|
+
},
|
|
23
|
+
transform: function transform(response) {
|
|
24
|
+
return {
|
|
25
|
+
fileResource: response.data.fileResource
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}),
|
|
30
|
+
fetchFileResources = _apiGroup.fetchFileResources,
|
|
31
|
+
fetchFileResource = _apiGroup.fetchFileResource,
|
|
32
|
+
createFileResource = _apiGroup.createFileResource,
|
|
33
|
+
updateFileResource = _apiGroup.updateFileResource,
|
|
34
|
+
deleteFileResource = _apiGroup.deleteFileResource;
|
|
35
|
+
|
|
36
|
+
export { fetchFileResources, fetchFileResource, createFileResource, updateFileResource, deleteFileResource };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { apiGroup } from '../http';
|
|
2
|
+
|
|
3
|
+
var _apiGroup = apiGroup({
|
|
4
|
+
name: 'Filestore',
|
|
5
|
+
dataOption: 'filestore',
|
|
6
|
+
plural: {
|
|
7
|
+
requiredOptions: [],
|
|
8
|
+
url: function url(_ref) {
|
|
9
|
+
var _ref$agentSlug = _ref.agentSlug,
|
|
10
|
+
agentSlug = _ref$agentSlug === void 0 ? 'system' : _ref$agentSlug;
|
|
11
|
+
return "/app/components/agents/".concat(agentSlug, "/app/api/v1/filestores");
|
|
12
|
+
},
|
|
13
|
+
transform: function transform(response) {
|
|
14
|
+
return {
|
|
15
|
+
filestores: response.data.filestores
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
singular: {
|
|
20
|
+
requiredOptions: ['filestoreSlug'],
|
|
21
|
+
url: function url(_ref2) {
|
|
22
|
+
var _ref2$agentSlug = _ref2.agentSlug,
|
|
23
|
+
agentSlug = _ref2$agentSlug === void 0 ? 'system' : _ref2$agentSlug,
|
|
24
|
+
filestoreSlug = _ref2.filestoreSlug;
|
|
25
|
+
return "/app/components/agents/".concat(agentSlug, "/app/api/v1/filestores/").concat(filestoreSlug);
|
|
26
|
+
},
|
|
27
|
+
transform: function transform(response) {
|
|
28
|
+
return {
|
|
29
|
+
filestore: response.data.filestore
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}),
|
|
34
|
+
fetchFilestores = _apiGroup.fetchFilestores,
|
|
35
|
+
fetchFilestore = _apiGroup.fetchFilestore,
|
|
36
|
+
createFilestore = _apiGroup.createFilestore,
|
|
37
|
+
updateFilestore = _apiGroup.updateFilestore,
|
|
38
|
+
deleteFilestore = _apiGroup.deleteFilestore;
|
|
39
|
+
|
|
40
|
+
export { fetchFilestores, fetchFilestore, createFilestore, updateFilestore, deleteFilestore };
|
package/lib/apis/core/forms.js
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import { bundle } from '../../helpers';
|
|
3
3
|
import { handleErrors, paramBuilder, headerBuilder } from '../http';
|
|
4
|
+
|
|
5
|
+
var getPath = function getPath(kappSlug, formSlug) {
|
|
6
|
+
var formSuffix = formSlug ? "/".concat(formSlug) : '';
|
|
7
|
+
return kappSlug ? "".concat(bundle.apiLocation(), "/kapps/").concat(kappSlug, "/forms").concat(formSuffix) : "".concat(bundle.apiLocation(), "/datastore/forms").concat(formSuffix);
|
|
8
|
+
}; // TODO: datastore is deprecated, remove datastore routes from paths.
|
|
9
|
+
|
|
10
|
+
|
|
4
11
|
export var fetchForms = function fetchForms() {
|
|
5
12
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
datastore = options.datastore;
|
|
9
|
-
var path = datastore ? "".concat(bundle.apiLocation(), "/datastore/forms") : "".concat(bundle.apiLocation(), "/kapps/").concat(kappSlug, "/forms"); // Build URL and fetch the space.
|
|
13
|
+
var kappSlug = options.kappSlug;
|
|
14
|
+
var path = getPath(kappSlug); // Build URL and fetch the space.
|
|
10
15
|
|
|
11
16
|
return axios.get(path, {
|
|
12
17
|
params: paramBuilder(options),
|
|
@@ -21,16 +26,14 @@ export var fetchForms = function fetchForms() {
|
|
|
21
26
|
};
|
|
22
27
|
export var fetchForm = function fetchForm() {
|
|
23
28
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
formSlug = options.formSlug,
|
|
27
|
-
datastore = options.datastore;
|
|
29
|
+
var kappSlug = options.kappSlug,
|
|
30
|
+
formSlug = options.formSlug;
|
|
28
31
|
|
|
29
32
|
if (!formSlug) {
|
|
30
33
|
throw new Error('fetchForm failed! The option "formSlug" is required.');
|
|
31
34
|
}
|
|
32
35
|
|
|
33
|
-
var path =
|
|
36
|
+
var path = getPath(kappSlug, formSlug); // Build URL and fetch the space.
|
|
34
37
|
|
|
35
38
|
return axios.get(path, {
|
|
36
39
|
params: paramBuilder(options),
|
|
@@ -43,20 +46,14 @@ export var fetchForm = function fetchForm() {
|
|
|
43
46
|
};
|
|
44
47
|
export var createForm = function createForm() {
|
|
45
48
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
form = options.form,
|
|
49
|
-
datastore = options.datastore;
|
|
50
|
-
|
|
51
|
-
if (!kappSlug && !datastore) {
|
|
52
|
-
throw new Error('createForm failed! The option "kappSlug" is required.');
|
|
53
|
-
}
|
|
49
|
+
var kappSlug = options.kappSlug,
|
|
50
|
+
form = options.form;
|
|
54
51
|
|
|
55
52
|
if (!form) {
|
|
56
53
|
throw new Error('createForm failed! The option "form" is required.');
|
|
57
54
|
}
|
|
58
55
|
|
|
59
|
-
var path =
|
|
56
|
+
var path = getPath(kappSlug);
|
|
60
57
|
return axios.post(path, form, {
|
|
61
58
|
params: paramBuilder(options),
|
|
62
59
|
headers: headerBuilder(options)
|
|
@@ -68,15 +65,9 @@ export var createForm = function createForm() {
|
|
|
68
65
|
};
|
|
69
66
|
export var updateForm = function updateForm() {
|
|
70
67
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
71
|
-
var
|
|
72
|
-
kappSlug = _options$kappSlug4 === void 0 ? bundle.kappSlug() : _options$kappSlug4,
|
|
68
|
+
var kappSlug = options.kappSlug,
|
|
73
69
|
formSlug = options.formSlug,
|
|
74
|
-
form = options.form
|
|
75
|
-
datastore = options.datastore;
|
|
76
|
-
|
|
77
|
-
if (!kappSlug && !datastore) {
|
|
78
|
-
throw new Error('updateForm failed! The option "kappSlug" is required.');
|
|
79
|
-
}
|
|
70
|
+
form = options.form;
|
|
80
71
|
|
|
81
72
|
if (!formSlug) {
|
|
82
73
|
throw new Error('updateForm failed! The option "formSlug" is required.');
|
|
@@ -86,7 +77,7 @@ export var updateForm = function updateForm() {
|
|
|
86
77
|
throw new Error('updateForm failed! The option "form" is required.');
|
|
87
78
|
}
|
|
88
79
|
|
|
89
|
-
var path =
|
|
80
|
+
var path = getPath(kappSlug, formSlug);
|
|
90
81
|
return axios.put(path, form, {
|
|
91
82
|
params: paramBuilder(options),
|
|
92
83
|
headers: headerBuilder(options)
|
|
@@ -98,20 +89,14 @@ export var updateForm = function updateForm() {
|
|
|
98
89
|
};
|
|
99
90
|
export var deleteForm = function deleteForm() {
|
|
100
91
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
101
|
-
var
|
|
102
|
-
|
|
103
|
-
formSlug = options.formSlug,
|
|
104
|
-
datastore = options.datastore;
|
|
105
|
-
|
|
106
|
-
if (!kappSlug && !datastore) {
|
|
107
|
-
throw new Error('deleteForm failed! The option "kappSlug" is required.');
|
|
108
|
-
}
|
|
92
|
+
var kappSlug = options.kappSlug,
|
|
93
|
+
formSlug = options.formSlug;
|
|
109
94
|
|
|
110
95
|
if (!formSlug) {
|
|
111
96
|
throw new Error('deleteForm failed! The option "formSlug" is required.');
|
|
112
97
|
}
|
|
113
98
|
|
|
114
|
-
var path =
|
|
99
|
+
var path = getPath(kappSlug, formSlug);
|
|
115
100
|
return axios["delete"](path, {
|
|
116
101
|
params: paramBuilder(options),
|
|
117
102
|
headers: headerBuilder(options)
|