@kineticdata/react 5.1.0-rc.1 → 5.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.
- package/lib/apis/core/attributeDefinitions.js +11 -9
- package/lib/apis/core/attributeDefinitions.test.js +1 -1
- package/lib/apis/core/authentication.js +13 -5
- package/lib/apis/core/backgroundJobs.js +2 -1
- package/lib/apis/core/bridgeModelAttributeMappings.js +1 -1
- package/lib/apis/core/bridgeModelAttributes.js +15 -12
- package/lib/apis/core/bridgeModelMappings.js +1 -1
- package/lib/apis/core/bridgeModelQualificationMappings.js +2 -2
- package/lib/apis/core/bridgeModelQualifications.js +2 -2
- package/lib/apis/core/bridgeModels.js +14 -8
- package/lib/apis/core/bridgedresources.js +3 -2
- package/lib/apis/core/fileResources.js +36 -0
- package/lib/apis/core/filestores.js +40 -0
- package/lib/apis/core/formTypes.js +18 -21
- package/lib/apis/core/oauthClients.js +11 -5
- package/lib/apis/core/securityPolicyDefinitions.js +1 -1
- package/lib/apis/core/securityPolicyDefinitions.test.js +4 -4
- package/lib/apis/core/submissions.js +68 -0
- package/lib/apis/core/webhooks.js +1 -1
- package/lib/apis/core/webhooks.test.js +2 -2
- package/lib/apis/http.js +17 -3
- package/lib/apis/index.js +2 -0
- package/lib/apis/system/index.js +86 -1
- package/lib/apis/task/index.js +20 -13
- 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/core/core_form/CoreForm.js +10 -10
- package/lib/components/core/file_resource/FileResourceForm.js +180 -0
- package/lib/components/core/file_resource/FileResourceTable.js +71 -0
- package/lib/components/core/i18n/I18n.js +14 -14
- package/lib/components/core/security_definition/SecurityDefinitionForm.js +1 -1
- package/lib/components/core/space/SpaceForm.js +37 -8
- package/lib/components/core/submission/FormSubmissionFilters.js +3 -11
- package/lib/components/core/submission/FormSubmissionTable.js +4 -2
- package/lib/components/core/submission/SubmissionForm.js +124 -0
- package/lib/components/core/submission/helpers.js +2 -2
- package/lib/components/core/user/UserForm.js +2 -2
- package/lib/components/core/webapi/WebApiForm.js +111 -126
- package/lib/components/form/Form.helpers.js +1 -1
- package/lib/components/form/Form.js +200 -144
- package/lib/components/index.js +14 -6
- package/lib/components/system/SystemBackgroundTasksTable.js +83 -0
- package/lib/components/system/SystemSecurityForm.js +69 -0
- package/lib/components/system/helpers.js +2 -2
- 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 +15 -10
- package/lib/components/table/Table.js +9 -6
- 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 +51 -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/workflows/WorkflowForm.js +67 -85
- package/lib/helpers/index.js +4 -1
- package/lib/index.js +1 -0
- package/package.json +2 -2
- package/proxyhelper.js +19 -6
|
@@ -32,11 +32,13 @@ var validateOptions = function validateOptions(functionName, requiredOptions, op
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
var buildEndpoint = function buildEndpoint(_ref) {
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
var kappSlug = _ref.kappSlug,
|
|
36
|
+
at = _ref.attributeType,
|
|
37
|
+
an = _ref.attributeName;
|
|
38
|
+
var attributeType = encodeURIComponent(at);
|
|
39
|
+
var attributeName = encodeURIComponent(an);
|
|
38
40
|
var basePath = kappSlug ? "".concat(bundle.apiLocation(), "/kapps/").concat(kappSlug, "/").concat(attributeType) : "".concat(bundle.apiLocation(), "/").concat(attributeType);
|
|
39
|
-
return
|
|
41
|
+
return an ? "".concat(basePath, "/").concat(attributeName) : basePath;
|
|
40
42
|
};
|
|
41
43
|
|
|
42
44
|
export var fetchAttributeDefinitions = function fetchAttributeDefinitions() {
|
|
@@ -70,12 +72,12 @@ export var createAttributeDefinition = function createAttributeDefinition() {
|
|
|
70
72
|
var kappSlug = options.kappSlug,
|
|
71
73
|
attributeType = options.attributeType,
|
|
72
74
|
attributeDefinition = options.attributeDefinition;
|
|
73
|
-
validateOptions('createAttributeDefinition', ['attributeType', 'attributeDefinition'], options); //
|
|
74
|
-
// so not using the buildEndpoint function
|
|
75
|
+
validateOptions('createAttributeDefinition', ['attributeType', 'attributeDefinition'], options); // The API returns the singular name of the attribute type, so we remove the "s"
|
|
75
76
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
return axios.post(buildEndpoint({
|
|
78
|
+
kappSlug: kappSlug,
|
|
79
|
+
attributeType: attributeType
|
|
80
|
+
}), attributeDefinition, {
|
|
79
81
|
params: paramBuilder(options),
|
|
80
82
|
headers: headerBuilder(options)
|
|
81
83
|
}).then(function (response) {
|
|
@@ -325,7 +325,7 @@ describe('attributeDefinitions api', function () {
|
|
|
325
325
|
|
|
326
326
|
case 3:
|
|
327
327
|
result = _context6.sent;
|
|
328
|
-
expect(axios.put.mock.calls).toEqual([['space/app/api/v1/spaceAttributeDefinitions/Test
|
|
328
|
+
expect(axios.put.mock.calls).toEqual([['space/app/api/v1/spaceAttributeDefinitions/Test%20Attribute', {
|
|
329
329
|
name: 'Test Attribute',
|
|
330
330
|
description: 'Test Attr Desc',
|
|
331
331
|
allowsMultiple: true
|
|
@@ -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
|
|
|
@@ -9,8 +9,9 @@ var backgroundJobPath = function backgroundJobPath() {
|
|
|
9
9
|
kappSlug = _ref.kappSlug,
|
|
10
10
|
job = _ref.job;
|
|
11
11
|
|
|
12
|
+
var j = encodeURIComponent(job);
|
|
12
13
|
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(
|
|
14
|
+
return basePath + (job ? "/".concat(j) : '');
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
export var fetchBackgroundJobs = function fetchBackgroundJobs() {
|
|
@@ -22,7 +22,7 @@ var _apiGroup = apiGroup({
|
|
|
22
22
|
var modelName = _ref2.modelName,
|
|
23
23
|
mappingName = _ref2.mappingName,
|
|
24
24
|
attributeName = _ref2.attributeName;
|
|
25
|
-
return "/models/".concat(modelName, "/mappings/").concat(mappingName, "/attributes/").concat(attributeName);
|
|
25
|
+
return "/models/".concat(modelName, "/mappings/").concat(mappingName, "/attributes/").concat(encodeURIComponent(attributeName));
|
|
26
26
|
},
|
|
27
27
|
transform: function transform(response) {
|
|
28
28
|
return {
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import { bundle } from '../../helpers';
|
|
3
3
|
import { handleErrors, headerBuilder, paramBuilder, validateOptions } from '../http';
|
|
4
|
+
|
|
5
|
+
var buildEndpoint = function buildEndpoint(_ref) {
|
|
6
|
+
var modelName = _ref.modelName,
|
|
7
|
+
attributeName = _ref.attributeName;
|
|
8
|
+
var an = encodeURIComponent(attributeName);
|
|
9
|
+
var mn = encodeURIComponent(modelName);
|
|
10
|
+
return attributeName ? "".concat(bundle.apiLocation(), "/models/").concat(mn, "/attributes") : "".concat(bundle.apiLocation(), "/models/").concat(mn, "/attributes/").concat(an);
|
|
11
|
+
};
|
|
12
|
+
|
|
4
13
|
export var fetchBridgeModelAttributes = function fetchBridgeModelAttributes() {
|
|
5
14
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
6
15
|
validateOptions('fetchBridgeModelAttributes', ['modelName'], options);
|
|
7
|
-
return axios.get(
|
|
16
|
+
return axios.get(buildEndpoint(options), {
|
|
8
17
|
params: paramBuilder(options),
|
|
9
18
|
headers: headerBuilder(options)
|
|
10
19
|
}).then(function (response) {
|
|
@@ -16,9 +25,7 @@ export var fetchBridgeModelAttributes = function fetchBridgeModelAttributes() {
|
|
|
16
25
|
export var fetchBridgeModelAttribute = function fetchBridgeModelAttribute() {
|
|
17
26
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
18
27
|
validateOptions('fetchBridgeModelAttribute', ['modelName', 'attributeName'], options);
|
|
19
|
-
|
|
20
|
-
attributeName = options.attributeName;
|
|
21
|
-
return axios.get("".concat(bundle.apiLocation(), "/models/").concat(modelName, "/attributes/").concat(attributeName), {
|
|
28
|
+
return axios.get(buildEndpoint(options), {
|
|
22
29
|
params: paramBuilder(options),
|
|
23
30
|
headers: headerBuilder(options)
|
|
24
31
|
}).then(function (response) {
|
|
@@ -30,7 +37,7 @@ export var fetchBridgeModelAttribute = function fetchBridgeModelAttribute() {
|
|
|
30
37
|
export var createBridgeModelAttribute = function createBridgeModelAttribute() {
|
|
31
38
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
32
39
|
validateOptions('createBridgeModelAttribute', ['modelName', 'bridgeModelAttribute'], options);
|
|
33
|
-
return axios.post(
|
|
40
|
+
return axios.post(buildEndpoint(options), options.bridgeModelAttribute, {
|
|
34
41
|
params: paramBuilder(options),
|
|
35
42
|
headers: headerBuilder(options)
|
|
36
43
|
}).then(function (response) {
|
|
@@ -42,10 +49,8 @@ export var createBridgeModelAttribute = function createBridgeModelAttribute() {
|
|
|
42
49
|
export var updateBridgeModelAttribute = function updateBridgeModelAttribute() {
|
|
43
50
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
44
51
|
validateOptions('updateBridgeModelAttribute', ['modelName', 'attributeName', 'bridgeModelAttribute'], options);
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
bridgeModelAttribute = options.bridgeModelAttribute;
|
|
48
|
-
return axios.put("".concat(bundle.apiLocation(), "/models/").concat(modelName, "/attributes/").concat(attributeName), bridgeModelAttribute, {
|
|
52
|
+
var bridgeModelAttribute = options.bridgeModelAttribute;
|
|
53
|
+
return axios.put(buildEndpoint(options), bridgeModelAttribute, {
|
|
49
54
|
params: paramBuilder(options),
|
|
50
55
|
headers: headerBuilder(options)
|
|
51
56
|
}).then(function (response) {
|
|
@@ -57,9 +62,7 @@ export var updateBridgeModelAttribute = function updateBridgeModelAttribute() {
|
|
|
57
62
|
export var deleteBridgeModelAttribute = function deleteBridgeModelAttribute() {
|
|
58
63
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
59
64
|
validateOptions('deleteBridgeModelAttribute', ['modelName', 'attributeName'], options);
|
|
60
|
-
|
|
61
|
-
attributeName = options.attributeName;
|
|
62
|
-
return axios["delete"]("".concat(bundle.apiLocation(), "/models/").concat(modelName, "/attributes/").concat(attributeName), {
|
|
65
|
+
return axios["delete"](buildEndpoint(options), {
|
|
63
66
|
params: paramBuilder(options),
|
|
64
67
|
headers: headerBuilder(options)
|
|
65
68
|
}).then(function (response) {
|
|
@@ -20,7 +20,7 @@ var _apiGroup = apiGroup({
|
|
|
20
20
|
url: function url(_ref2) {
|
|
21
21
|
var modelName = _ref2.modelName,
|
|
22
22
|
mappingName = _ref2.mappingName;
|
|
23
|
-
return "/models/".concat(modelName, "/mappings/").concat(mappingName);
|
|
23
|
+
return "/models/".concat(encodeURIComponent(modelName), "/mappings/").concat(encodeURIComponent(mappingName));
|
|
24
24
|
},
|
|
25
25
|
transform: function transform(response) {
|
|
26
26
|
return {
|
|
@@ -8,7 +8,7 @@ var _apiGroup = apiGroup({
|
|
|
8
8
|
url: function url(_ref) {
|
|
9
9
|
var modelName = _ref.modelName,
|
|
10
10
|
mappingName = _ref.mappingName;
|
|
11
|
-
return "/models/".concat(modelName, "/mappings/").concat(mappingName, "/qualifications");
|
|
11
|
+
return "/models/".concat(encodeURIComponent(modelName), "/mappings/").concat(encodeURIComponent(mappingName), "/qualifications");
|
|
12
12
|
},
|
|
13
13
|
transform: function transform(response) {
|
|
14
14
|
return {
|
|
@@ -22,7 +22,7 @@ var _apiGroup = apiGroup({
|
|
|
22
22
|
var modelName = _ref2.modelName,
|
|
23
23
|
mappingName = _ref2.mappingName,
|
|
24
24
|
qualificationName = _ref2.qualificationName;
|
|
25
|
-
return "/models/".concat(modelName, "/mappings/").concat(mappingName, "/qualifications/").concat(qualificationName);
|
|
25
|
+
return "/models/".concat(encodeURIComponent(modelName), "/mappings/").concat(encodeURIComponent(mappingName), "/qualifications/").concat(encodeURIComponent(qualificationName));
|
|
26
26
|
},
|
|
27
27
|
transform: function transform(response) {
|
|
28
28
|
return {
|
|
@@ -7,7 +7,7 @@ var _apiGroup = apiGroup({
|
|
|
7
7
|
requiredOptions: ['modelName'],
|
|
8
8
|
url: function url(_ref) {
|
|
9
9
|
var modelName = _ref.modelName;
|
|
10
|
-
return "/models/".concat(modelName, "/qualifications");
|
|
10
|
+
return "/models/".concat(encodeURIComponent(modelName), "/qualifications");
|
|
11
11
|
},
|
|
12
12
|
transform: function transform(response) {
|
|
13
13
|
return {
|
|
@@ -20,7 +20,7 @@ var _apiGroup = apiGroup({
|
|
|
20
20
|
url: function url(_ref2) {
|
|
21
21
|
var modelName = _ref2.modelName,
|
|
22
22
|
qualificationName = _ref2.qualificationName;
|
|
23
|
-
return "/models/".concat(modelName, "/qualifications/").concat(qualificationName);
|
|
23
|
+
return "/models/".concat(encodeURIComponent(modelName), "/qualifications/").concat(encodeURIComponent(qualificationName));
|
|
24
24
|
},
|
|
25
25
|
transform: function transform(response) {
|
|
26
26
|
return {
|
|
@@ -2,9 +2,16 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
2
2
|
import axios from 'axios';
|
|
3
3
|
import { bundle } from '../../helpers';
|
|
4
4
|
import { handleErrors, headerBuilder, paramBuilder, validateOptions } from '../http';
|
|
5
|
+
|
|
6
|
+
var buildEndpoint = function buildEndpoint(_ref) {
|
|
7
|
+
var modelName = _ref.modelName;
|
|
8
|
+
var mn = encodeURIComponent(modelName);
|
|
9
|
+
return modelName ? "".concat(bundle.apiLocation(), "/models/").concat(mn) : "".concat(bundle.apiLocation(), "/models");
|
|
10
|
+
};
|
|
11
|
+
|
|
5
12
|
export var fetchBridgeModels = function fetchBridgeModels() {
|
|
6
13
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
-
return axios.get(
|
|
14
|
+
return axios.get(buildEndpoint(options), {
|
|
8
15
|
params: paramBuilder(options),
|
|
9
16
|
headers: headerBuilder(options)
|
|
10
17
|
}).then(function (response) {
|
|
@@ -16,7 +23,7 @@ export var fetchBridgeModels = function fetchBridgeModels() {
|
|
|
16
23
|
export var fetchBridgeModel = function fetchBridgeModel() {
|
|
17
24
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
18
25
|
validateOptions('fetchBridgeModel', ['modelName'], options);
|
|
19
|
-
return axios.get(
|
|
26
|
+
return axios.get(buildEndpoint(options), {
|
|
20
27
|
params: paramBuilder(options),
|
|
21
28
|
headers: headerBuilder(options)
|
|
22
29
|
}).then(function (response) {
|
|
@@ -29,8 +36,7 @@ var TEST_METHODS = ['retrieve', 'search', 'count'];
|
|
|
29
36
|
export var testBridgeModel = function testBridgeModel() {
|
|
30
37
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
31
38
|
validateOptions('testBridgeModel', ['modelName', 'qualificationName', 'method'], options);
|
|
32
|
-
var
|
|
33
|
-
qualificationName = options.qualificationName,
|
|
39
|
+
var qualificationName = options.qualificationName,
|
|
34
40
|
_options$attributes = options.attributes,
|
|
35
41
|
attributes = _options$attributes === void 0 ? [] : _options$attributes;
|
|
36
42
|
var method = TEST_METHODS.includes(options.method) ? options.method : 'retrieve';
|
|
@@ -38,7 +44,7 @@ export var testBridgeModel = function testBridgeModel() {
|
|
|
38
44
|
params["parameters[".concat(parameter.name, "]")] = parameter.value;
|
|
39
45
|
return params;
|
|
40
46
|
}, {});
|
|
41
|
-
return axios.post("".concat(
|
|
47
|
+
return axios.post("".concat(buildEndpoint(options), "/qualifications/").concat(encodeURIComponent(qualificationName), "/").concat(encodeURIComponent(method)), null, {
|
|
42
48
|
params: _objectSpread(_objectSpread({}, paramBuilder(options)), {}, {
|
|
43
49
|
attributes: attributes.join(',')
|
|
44
50
|
}, parameters),
|
|
@@ -48,7 +54,7 @@ export var testBridgeModel = function testBridgeModel() {
|
|
|
48
54
|
export var createBridgeModel = function createBridgeModel() {
|
|
49
55
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
50
56
|
validateOptions('createBridgeModel', ['bridgeModel'], options);
|
|
51
|
-
return axios.post(
|
|
57
|
+
return axios.post(buildEndpoint(options), options.bridgeModel, {
|
|
52
58
|
params: paramBuilder(options),
|
|
53
59
|
headers: headerBuilder(options)
|
|
54
60
|
}).then(function (response) {
|
|
@@ -60,7 +66,7 @@ export var createBridgeModel = function createBridgeModel() {
|
|
|
60
66
|
export var updateBridgeModel = function updateBridgeModel() {
|
|
61
67
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
62
68
|
validateOptions('updateBridgeModel', ['modelName', 'bridgeModel'], options);
|
|
63
|
-
return axios.put(
|
|
69
|
+
return axios.put(buildEndpoint(options), options.bridgeModel, {
|
|
64
70
|
params: paramBuilder(options),
|
|
65
71
|
headers: headerBuilder(options)
|
|
66
72
|
}).then(function (response) {
|
|
@@ -72,7 +78,7 @@ export var updateBridgeModel = function updateBridgeModel() {
|
|
|
72
78
|
export var deleteBridgeModel = function deleteBridgeModel() {
|
|
73
79
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
74
80
|
validateOptions('deleteBridgeModel', ['modelName'], options);
|
|
75
|
-
return axios["delete"](
|
|
81
|
+
return axios["delete"](buildEndpoint(options), {
|
|
76
82
|
params: paramBuilder(options),
|
|
77
83
|
headers: headerBuilder(options)
|
|
78
84
|
}).then(function (response) {
|
|
@@ -31,10 +31,11 @@ export var bridgedResourceUrl = function bridgedResourceUrl(options) {
|
|
|
31
31
|
|
|
32
32
|
if (!bridgedResourceName) {
|
|
33
33
|
throw new Error('Property "bridgedResourceName" is required.');
|
|
34
|
-
}
|
|
34
|
+
}
|
|
35
35
|
|
|
36
|
+
var brn = encodeURIComponent(options.bridgedResourceName); // build the url
|
|
36
37
|
|
|
37
|
-
var url = datastore ? "".concat(bundle.spaceLocation(), "/app/datastore/forms/").concat(
|
|
38
|
+
var url = datastore ? "".concat(bundle.spaceLocation(), "/app/datastore/forms/").concat(formSlug, "/bridgedResources/").concat(brn) : "".concat(bundle.spaceLocation(), "/").concat(kappSlug, "/").concat(formSlug, "/bridgedResources/").concat(brn); // append any attributes if they were specified
|
|
38
39
|
|
|
39
40
|
if (counting) {
|
|
40
41
|
url += '/count';
|
|
@@ -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 };
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import { bundle } from '../../helpers';
|
|
3
3
|
import { handleErrors, headerBuilder, paramBuilder } from '../http';
|
|
4
|
+
|
|
5
|
+
var buildEndpoint = function buildEndpoint(_ref) {
|
|
6
|
+
var _ref$kappSlug = _ref.kappSlug,
|
|
7
|
+
kappSlug = _ref$kappSlug === void 0 ? bundle.kappSlug() : _ref$kappSlug,
|
|
8
|
+
name = _ref.name;
|
|
9
|
+
return name ? "".concat(bundle.apiLocation(), "/kapps/").concat(kappSlug, "/formTypes/").concat(encodeURIComponent(name)) : "".concat(bundle.apiLocation(), "/kapps/").concat(kappSlug, "/formTypes");
|
|
10
|
+
};
|
|
11
|
+
|
|
4
12
|
export var fetchFormTypes = function fetchFormTypes() {
|
|
5
13
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return axios.get("".concat(bundle.apiLocation(), "/kapps/").concat(kappSlug, "/formTypes"), {
|
|
14
|
+
// Build URL and fetch the form types.
|
|
15
|
+
return axios.get(buildEndpoint(options), {
|
|
10
16
|
params: paramBuilder(options),
|
|
11
17
|
headers: headerBuilder(options)
|
|
12
18
|
}).then(function (response) {
|
|
@@ -17,16 +23,14 @@ export var fetchFormTypes = function fetchFormTypes() {
|
|
|
17
23
|
};
|
|
18
24
|
export var fetchFormType = function fetchFormType() {
|
|
19
25
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
20
|
-
var
|
|
21
|
-
kappSlug = _options$kappSlug2 === void 0 ? bundle.kappSlug() : _options$kappSlug2,
|
|
22
|
-
name = options.name;
|
|
26
|
+
var name = options.name;
|
|
23
27
|
|
|
24
28
|
if (!name) {
|
|
25
29
|
throw new Error('fetchFormType failed! The option "name" is required.');
|
|
26
30
|
} // Build URL and fetch the form type.
|
|
27
31
|
|
|
28
32
|
|
|
29
|
-
return axios.get(
|
|
33
|
+
return axios.get(buildEndpoint(options), {
|
|
30
34
|
params: paramBuilder(options),
|
|
31
35
|
headers: headerBuilder(options)
|
|
32
36
|
}).then(function (response) {
|
|
@@ -37,16 +41,14 @@ export var fetchFormType = function fetchFormType() {
|
|
|
37
41
|
};
|
|
38
42
|
export var createFormType = function createFormType() {
|
|
39
43
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
40
|
-
var
|
|
41
|
-
kappSlug = _options$kappSlug3 === void 0 ? bundle.kappSlug() : _options$kappSlug3,
|
|
42
|
-
formType = options.formType;
|
|
44
|
+
var formType = options.formType;
|
|
43
45
|
|
|
44
46
|
if (!formType) {
|
|
45
47
|
throw new Error('createFormType failed! The option "formType" is required.');
|
|
46
48
|
} // Build URL and create the form type.
|
|
47
49
|
|
|
48
50
|
|
|
49
|
-
return axios.post(
|
|
51
|
+
return axios.post(buildEndpoint(options), formType, {
|
|
50
52
|
params: paramBuilder(options),
|
|
51
53
|
headers: headerBuilder(options)
|
|
52
54
|
}).then(function (response) {
|
|
@@ -57,9 +59,7 @@ export var createFormType = function createFormType() {
|
|
|
57
59
|
};
|
|
58
60
|
export var updateFormType = function updateFormType() {
|
|
59
61
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
60
|
-
var
|
|
61
|
-
kappSlug = _options$kappSlug4 === void 0 ? bundle.kappSlug() : _options$kappSlug4,
|
|
62
|
-
formType = options.formType,
|
|
62
|
+
var formType = options.formType,
|
|
63
63
|
name = options.name;
|
|
64
64
|
|
|
65
65
|
if (!formType) {
|
|
@@ -71,7 +71,7 @@ export var updateFormType = function updateFormType() {
|
|
|
71
71
|
} // Build URL and update the form type.
|
|
72
72
|
|
|
73
73
|
|
|
74
|
-
return axios.put(
|
|
74
|
+
return axios.put(buildEndpoint(options), formType, {
|
|
75
75
|
params: paramBuilder(options),
|
|
76
76
|
headers: headerBuilder(options)
|
|
77
77
|
}).then(function (response) {
|
|
@@ -82,11 +82,8 @@ export var updateFormType = function updateFormType() {
|
|
|
82
82
|
};
|
|
83
83
|
export var deleteFormType = function deleteFormType() {
|
|
84
84
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
name = options.name; // Build URL and delete the form type.
|
|
88
|
-
|
|
89
|
-
return axios["delete"]("".concat(bundle.apiLocation(), "/kapps/").concat(kappSlug, "/formTypes/").concat(name), {
|
|
85
|
+
// Build URL and delete the form type.
|
|
86
|
+
return axios["delete"](buildEndpoint(options), {
|
|
90
87
|
params: paramBuilder(options),
|
|
91
88
|
headers: headerBuilder(options)
|
|
92
89
|
}).then(function (response) {
|
|
@@ -2,9 +2,15 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
2
2
|
import axios from 'axios';
|
|
3
3
|
import { bundle } from '../../helpers';
|
|
4
4
|
import { handleErrors, paramBuilder, headerBuilder } from '../http';
|
|
5
|
+
|
|
6
|
+
var buildEndpoint = function buildEndpoint(_ref) {
|
|
7
|
+
var clientId = _ref.clientId;
|
|
8
|
+
return clientId ? "".concat(bundle.apiLocation(), "/oauthClients/").concat(encodeURIComponent(clientId)) : "".concat(bundle.apiLocation(), "/oauthClients");
|
|
9
|
+
};
|
|
10
|
+
|
|
5
11
|
export var fetchOAuthClients = function fetchOAuthClients() {
|
|
6
12
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
-
return axios.get(
|
|
13
|
+
return axios.get(buildEndpoint(options), {
|
|
8
14
|
params: _objectSpread({}, paramBuilder(options)),
|
|
9
15
|
headers: headerBuilder(options)
|
|
10
16
|
}).then(function (response) {
|
|
@@ -21,7 +27,7 @@ export var fetchOAuthClient = function fetchOAuthClient() {
|
|
|
21
27
|
throw new Error('fetchOAuthClient failed! The option "clientId" is required.');
|
|
22
28
|
}
|
|
23
29
|
|
|
24
|
-
return axios.get(
|
|
30
|
+
return axios.get(buildEndpoint(options), {
|
|
25
31
|
params: _objectSpread({}, paramBuilder(options)),
|
|
26
32
|
headers: headerBuilder(options)
|
|
27
33
|
}).then(function (response) {
|
|
@@ -44,7 +50,7 @@ export var updateOAuthClient = function updateOAuthClient() {
|
|
|
44
50
|
} // Build URL and fetch the space.
|
|
45
51
|
|
|
46
52
|
|
|
47
|
-
return axios.put(
|
|
53
|
+
return axios.put(buildEndpoint(options), client, {
|
|
48
54
|
params: paramBuilder(options),
|
|
49
55
|
headers: headerBuilder(options)
|
|
50
56
|
}).then(function (response) {
|
|
@@ -62,7 +68,7 @@ export var createOAuthClient = function createOAuthClient() {
|
|
|
62
68
|
} // Build URL and fetch the space.
|
|
63
69
|
|
|
64
70
|
|
|
65
|
-
return axios.post(
|
|
71
|
+
return axios.post(buildEndpoint(options), client, {
|
|
66
72
|
params: paramBuilder(options),
|
|
67
73
|
headers: headerBuilder(options)
|
|
68
74
|
}).then(function (response) {
|
|
@@ -80,7 +86,7 @@ export var deleteOAuthClient = function deleteOAuthClient() {
|
|
|
80
86
|
} // Build URL and fetch the space.
|
|
81
87
|
|
|
82
88
|
|
|
83
|
-
return axios["delete"](
|
|
89
|
+
return axios["delete"](buildEndpoint(options), {
|
|
84
90
|
params: paramBuilder(options),
|
|
85
91
|
headers: headerBuilder(options)
|
|
86
92
|
}).then(function (response) {
|
|
@@ -25,7 +25,7 @@ var buildEndpoint = function buildEndpoint(_ref) {
|
|
|
25
25
|
var kappSlug = _ref.kappSlug,
|
|
26
26
|
securityPolicyName = _ref.securityPolicyName;
|
|
27
27
|
var basePath = kappSlug ? "".concat(bundle.apiLocation(), "/kapps/").concat(kappSlug, "/securityPolicyDefinitions") : "".concat(bundle.apiLocation(), "/securityPolicyDefinitions");
|
|
28
|
-
return securityPolicyName ? "".concat(basePath, "/").concat(securityPolicyName) : basePath;
|
|
28
|
+
return securityPolicyName ? "".concat(basePath, "/").concat(encodeURIComponent(securityPolicyName)) : basePath;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
export var fetchSecurityPolicyDefinitions = function fetchSecurityPolicyDefinitions() {
|
|
@@ -31,7 +31,7 @@ describe('securityPolicyDefinitions api', function () {
|
|
|
31
31
|
securityPolicyDefinitions: [{
|
|
32
32
|
message: 'Must be an administrator.',
|
|
33
33
|
name: 'Admins',
|
|
34
|
-
rule: "/* \n * Space admins are allowed access regardless of the
|
|
34
|
+
rule: "/* \n * Space admins are allowed access regardless of the result of security \n * policies. Returning 'false' denies anyone but a space access. \n */\nfalse",
|
|
35
35
|
type: 'Space'
|
|
36
36
|
}, {
|
|
37
37
|
message: 'Must be authenticated.',
|
|
@@ -61,7 +61,7 @@ describe('securityPolicyDefinitions api', function () {
|
|
|
61
61
|
securityPolicyDefinitions: [{
|
|
62
62
|
message: 'Must be an administrator.',
|
|
63
63
|
name: 'Admins',
|
|
64
|
-
rule: "/* \n * Space admins are allowed access regardless of the
|
|
64
|
+
rule: "/* \n * Space admins are allowed access regardless of the result of security \n * policies. Returning 'false' denies anyone but a space access. \n */\nfalse",
|
|
65
65
|
type: 'Space'
|
|
66
66
|
}, {
|
|
67
67
|
message: 'Must be authenticated.',
|
|
@@ -95,7 +95,7 @@ describe('securityPolicyDefinitions api', function () {
|
|
|
95
95
|
securityPolicyDefinitions: [{
|
|
96
96
|
message: 'Must be an administrator.',
|
|
97
97
|
name: 'Admins',
|
|
98
|
-
rule: "/* \n * Space admins are allowed access regardless of the
|
|
98
|
+
rule: "/* \n * Space admins are allowed access regardless of the result of security \n * policies. Returning 'false' denies anyone but a space access. \n */\nfalse",
|
|
99
99
|
type: 'Kapp'
|
|
100
100
|
}, {
|
|
101
101
|
message: 'Must be authenticated.',
|
|
@@ -132,7 +132,7 @@ describe('securityPolicyDefinitions api', function () {
|
|
|
132
132
|
securityPolicyDefinitions: [{
|
|
133
133
|
message: 'Must be an administrator.',
|
|
134
134
|
name: 'Admins',
|
|
135
|
-
rule: "/* \n * Space admins are allowed access regardless of the
|
|
135
|
+
rule: "/* \n * Space admins are allowed access regardless of the result of security \n * policies. Returning 'false' denies anyone but a space access. \n */\nfalse",
|
|
136
136
|
type: 'Kapp'
|
|
137
137
|
}, {
|
|
138
138
|
message: 'Must be authenticated.',
|