@kineticdata/react 5.1.2 → 6.0.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/assets/task/icons/drag-handle.svg +3 -0
- package/assets/task/icons/plus_small.svg +2 -4
- package/lib/apis/agent/adapters.js +16 -12
- package/lib/apis/agent/bridges.js +54 -41
- package/lib/apis/agent/handlers.js +51 -38
- package/lib/apis/core/activity.js +19 -11
- package/lib/apis/core/attributeDefinitions.js +54 -46
- package/lib/apis/core/attributeDefinitions.test.js +47 -55
- package/lib/apis/core/authentication.js +58 -63
- package/lib/apis/core/backgroundJobs.js +38 -30
- package/lib/apis/core/bridgeModelAttributeMappings.js +42 -34
- package/lib/apis/core/bridgeModelAttributes.js +47 -37
- package/lib/apis/core/bridgeModelMappings.js +42 -34
- package/lib/apis/core/bridgeModelQualificationMappings.js +42 -34
- package/lib/apis/core/bridgeModelQualifications.js +42 -34
- package/lib/apis/core/bridgeModels.js +56 -46
- package/lib/apis/core/bridgeModels.test.js +64 -80
- package/lib/apis/core/bridgedresources.js +64 -72
- package/lib/apis/core/bridgedresources.test.js +33 -30
- package/lib/apis/core/categories.js +59 -52
- package/lib/apis/core/categories.test.js +36 -33
- package/lib/apis/core/fileResources.js +41 -33
- package/lib/apis/core/filestores.js +42 -34
- package/lib/apis/core/formTypes.js +50 -44
- package/lib/apis/core/forms.js +53 -49
- package/lib/apis/core/forms.test.js +60 -74
- package/lib/apis/core/kapps.js +45 -39
- package/lib/apis/core/kapps.test.js +45 -52
- package/lib/apis/core/logs.js +20 -16
- package/lib/apis/core/memberships.js +23 -20
- package/lib/apis/core/meta.js +31 -19
- package/lib/apis/core/notices.js +17 -9
- package/lib/apis/core/oauthClients.js +49 -45
- package/lib/apis/core/platformComponents.js +73 -57
- package/lib/apis/core/platformItems.js +22 -13
- package/lib/apis/core/profile.js +28 -21
- package/lib/apis/core/profile.test.js +20 -17
- package/lib/apis/core/securityPolicyDefinitions.js +48 -41
- package/lib/apis/core/securityPolicyDefinitions.test.js +50 -60
- package/lib/apis/core/space.js +23 -16
- package/lib/apis/core/space.test.js +31 -38
- package/lib/apis/core/submissions.js +213 -186
- package/lib/apis/core/submissions.test.js +39 -36
- package/lib/apis/core/teams.js +51 -44
- package/lib/apis/core/teams.test.js +42 -39
- package/lib/apis/core/translations.js +123 -130
- package/lib/apis/core/translations.test.js +278 -368
- package/lib/apis/core/users.js +56 -49
- package/lib/apis/core/users.test.js +42 -39
- package/lib/apis/core/version.js +20 -11
- package/lib/apis/core/webApis.js +42 -34
- package/lib/apis/core/webhooks.js +48 -41
- package/lib/apis/core/webhooks.test.js +50 -60
- package/lib/apis/core/webhooksJobs.js +30 -26
- package/lib/apis/core/workflows.js +52 -44
- package/lib/apis/http.js +89 -80
- package/lib/apis/http.test.js +37 -38
- package/lib/apis/index.js +506 -50
- package/lib/apis/system/index.js +228 -211
- package/lib/apis/task/index.js +280 -227
- package/lib/components/agent/bridge/BridgeForm.js +50 -50
- package/lib/components/agent/bridge/BridgeTable.js +12 -8
- package/lib/components/agent/filestore/FilestoreForm.js +49 -48
- package/lib/components/agent/filestore/FilestoreTable.js +12 -8
- package/lib/components/agent/handler/AgentHandlerForm.js +24 -27
- package/lib/components/agent/handler/AgentHandlerTable.js +12 -8
- package/lib/components/common/AttributeSelect.js +15 -9
- package/lib/components/common/BridgeSelect.js +48 -43
- package/lib/components/common/ComponentConfigContext.js +9 -2
- package/lib/components/common/ContentEditable.js +36 -60
- package/lib/components/common/FormSelect.js +70 -58
- package/lib/components/common/NodeSelect.js +23 -19
- package/lib/components/common/Scroller.js +24 -23
- package/lib/components/common/StaticSelect.js +57 -50
- package/lib/components/common/TableInput.js +54 -57
- package/lib/components/common/TeamSelect.js +42 -39
- package/lib/components/common/Typeahead.js +121 -138
- package/lib/components/common/UserSelect.js +42 -41
- package/lib/components/common/authentication/AuthInterceptor.js +15 -19
- package/lib/components/common/authentication/AuthInterceptor.test.js +46 -64
- package/lib/components/common/authentication/AuthenticationContainer.js +350 -454
- package/lib/components/common/authentication/RequestInterceptor.js +16 -19
- package/lib/components/common/code_input/CodeInput.js +92 -122
- package/lib/components/common/code_input/draftHelpers.js +96 -90
- package/lib/components/common/code_input/languageHelpers.js +49 -47
- package/lib/components/common/code_input/languageHelpers.test.js +21 -16
- package/lib/components/core/CoreFormModal.js +26 -24
- package/lib/components/core/CoreModal.js +37 -31
- package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +24 -23
- package/lib/components/core/attribute_definition/AttributeDefinitionTable.js +18 -15
- package/lib/components/core/bridge_model/BridgeModelForm.js +27 -37
- package/lib/components/core/bridge_model/BridgeModelTable.js +12 -8
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeForm.js +17 -16
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeTable.js +25 -21
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationForm.js +20 -20
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationTable.js +27 -22
- package/lib/components/core/category/CategoryForm.js +22 -22
- package/lib/components/core/category/CategoryTable.js +15 -10
- package/lib/components/core/core_form/CoreForm.js +209 -285
- package/lib/components/core/core_form/CoreForm.test.js +12 -10
- package/lib/components/core/core_form/defaults/index.js +52 -44
- package/lib/components/core/core_form/globals.js +14 -5
- package/lib/components/core/field_definition/FieldDefinitionForm.js +23 -21
- package/lib/components/core/field_definition/FieldDefinitionTable.js +15 -10
- package/lib/components/core/file_resource/FileResourceForm.js +38 -37
- package/lib/components/core/file_resource/FileResourceTable.js +16 -12
- package/lib/components/core/form/FormForm.js +56 -61
- package/lib/components/core/form/FormTable.js +25 -22
- package/lib/components/core/form_type/FormTypeForm.js +14 -13
- package/lib/components/core/form_type/FormTypeTable.js +12 -8
- package/lib/components/core/i18n/I18n.js +54 -61
- package/lib/components/core/i18n/I18nContext.js +9 -2
- package/lib/components/core/i18n/I18nProvider.js +40 -43
- package/lib/components/core/i18n/Moment.js +40 -50
- package/lib/components/core/index_definition/IndexDefinitionForm.js +23 -24
- package/lib/components/core/index_definition/IndexDefinitionTable.js +19 -11
- package/lib/components/core/index_job/IndexJobTable.js +20 -15
- package/lib/components/core/kapp/KappForm.js +57 -58
- package/lib/components/core/kapp/KappTable.js +17 -12
- package/lib/components/core/log/LogTable.js +35 -33
- package/lib/components/core/oauth_client/OAuthClientForm.js +17 -17
- package/lib/components/core/oauth_client/OAuthClientTable.js +12 -8
- package/lib/components/core/platform_component/AgentComponentForm.js +15 -15
- package/lib/components/core/platform_component/AgentComponentTable.js +10 -5
- package/lib/components/core/platform_component/TaskComponentForm.js +14 -14
- package/lib/components/core/profile/ProfileForm.js +40 -39
- package/lib/components/core/security_definition/SecurityDefinitionForm.js +28 -25
- package/lib/components/core/security_definition/SecurityDefinitionTable.js +18 -13
- package/lib/components/core/space/SpaceForm.js +79 -90
- package/lib/components/core/submission/DatastoreSubmissionFilters.js +39 -40
- package/lib/components/core/submission/DatastoreSubmissionTable.js +37 -34
- package/lib/components/core/submission/FormSubmissionFilters.js +79 -75
- package/lib/components/core/submission/FormSubmissionTable.js +27 -20
- package/lib/components/core/submission/KappSubmissionTable.js +30 -29
- package/lib/components/core/submission/SubmissionForm.js +126 -55
- package/lib/components/core/submission/SubmissionTable.js +24 -20
- package/lib/components/core/submission/helpers.js +37 -33
- package/lib/components/core/submission/helpers.test.js +69 -20
- package/lib/components/core/team/TeamForm.js +24 -21
- package/lib/components/core/team/TeamTable.js +16 -11
- package/lib/components/core/translation/ContextForm.js +13 -10
- package/lib/components/core/translation/ContextTable.js +13 -10
- package/lib/components/core/translation/EntryForm.js +27 -24
- package/lib/components/core/translation/EntryTable.js +19 -16
- package/lib/components/core/translation/LocaleForm.js +16 -13
- package/lib/components/core/translation/LocaleTable.js +12 -8
- package/lib/components/core/user/UserForm.js +38 -37
- package/lib/components/core/user/UserTable.js +19 -15
- package/lib/components/core/webapi/WebApiForm.js +49 -61
- package/lib/components/core/webapi/WebApiTable.js +14 -10
- package/lib/components/core/webhook/WebhookForm.js +33 -32
- package/lib/components/core/webhook/WebhookTable.js +22 -20
- package/lib/components/core/webhook_job/WebhookJobTable.js +19 -16
- package/lib/components/form/Form.helpers.js +102 -90
- package/lib/components/form/Form.js +467 -524
- package/lib/components/form/Form.models.js +38 -24
- package/lib/components/form/FormState.js +8 -5
- package/lib/components/form/KitchenSinkForm.js +135 -4
- package/lib/components/form/defaults/AttributesField.js +48 -59
- package/lib/components/form/defaults/CheckboxField.js +14 -6
- package/lib/components/form/defaults/CodeField.js +15 -7
- package/lib/components/form/defaults/FormButtons.js +12 -4
- package/lib/components/form/defaults/FormError.js +12 -4
- package/lib/components/form/defaults/FormField.js +15 -7
- package/lib/components/form/defaults/FormLayout.js +12 -4
- package/lib/components/form/defaults/FormMultiField.js +15 -7
- package/lib/components/form/defaults/PasswordField.js +14 -6
- package/lib/components/form/defaults/RadioField.js +15 -7
- package/lib/components/form/defaults/SampleTeamsRolesFIeld.js +17 -9
- package/lib/components/form/defaults/SelectField.js +16 -8
- package/lib/components/form/defaults/SelectMultiField.js +15 -7
- package/lib/components/form/defaults/TableField.js +14 -6
- package/lib/components/form/defaults/TeamField.js +15 -7
- package/lib/components/form/defaults/TeamMultiField.js +15 -7
- package/lib/components/form/defaults/TextField.js +14 -6
- package/lib/components/form/defaults/TextMultiField.js +26 -28
- package/lib/components/form/defaults/UserField.js +15 -7
- package/lib/components/form/defaults/UserMultiField.js +15 -7
- package/lib/components/form/defaults/index.js +48 -41
- package/lib/components/form/tests/Form.test.js +568 -864
- package/lib/components/form/tests/components.js +15 -25
- package/lib/components/form/tests/helpers.test.js +35 -33
- package/lib/components/index.js +981 -135
- package/lib/components/system/SystemBackgroundTasksTable.js +14 -10
- package/lib/components/system/SystemFilestoreForm.js +28 -25
- package/lib/components/system/SystemForm.js +19 -16
- package/lib/components/system/SystemIngressForm.js +10 -9
- package/lib/components/system/SystemSecurityForm.js +17 -14
- package/lib/components/system/SystemSmtpForm.js +13 -13
- package/lib/components/system/SystemTaskAdapterForm.js +21 -17
- package/lib/components/system/SystemUserForm.js +15 -14
- package/lib/components/system/helpers.js +62 -60
- package/lib/components/system/helpers.test.js +16 -12
- package/lib/components/system/spaces/SystemSpaceForm.js +25 -24
- package/lib/components/system/spaces/SystemTenantForm.js +43 -40
- package/lib/components/system/spaces/SystemTenantTable.js +12 -8
- package/lib/components/table/Table.js +211 -224
- package/lib/components/table/Table.redux.js +292 -329
- package/lib/components/table/Table.redux.test.js +49 -47
- package/lib/components/table/Table.test.js +107 -132
- package/lib/components/table/defaults/BodyCell.js +12 -6
- package/lib/components/table/defaults/BodyRow.js +10 -4
- package/lib/components/table/defaults/BooleanFilter.js +17 -11
- package/lib/components/table/defaults/EmptyBodyRow.js +12 -6
- package/lib/components/table/defaults/FilterLayout.js +17 -11
- package/lib/components/table/defaults/Footer.js +11 -5
- package/lib/components/table/defaults/FooterCell.js +10 -4
- package/lib/components/table/defaults/FooterRow.js +10 -4
- package/lib/components/table/defaults/Header.js +10 -4
- package/lib/components/table/defaults/HeaderCell.js +16 -10
- package/lib/components/table/defaults/HeaderRow.js +10 -4
- package/lib/components/table/defaults/PaginationControl.js +18 -9
- package/lib/components/table/defaults/TableBody.js +10 -4
- package/lib/components/table/defaults/TableLayout.js +12 -6
- package/lib/components/table/defaults/TextFilter.js +16 -10
- package/lib/components/table/defaults/index.js +41 -33
- package/lib/components/task/builder/Connector.js +100 -111
- package/lib/components/task/builder/ConnectorForm.js +17 -11
- package/lib/components/task/builder/Node.js +101 -83
- package/lib/components/task/builder/NodeForm.js +30 -27
- package/lib/components/task/builder/NodeParametersForm.js +27 -24
- package/lib/components/task/builder/SvgCanvas.js +67 -96
- package/lib/components/task/builder/SvgText.js +19 -134
- package/lib/components/task/builder/TaskDefinitionConfigForm.js +27 -22
- package/lib/components/task/builder/TreeBuilder.js +140 -115
- package/lib/components/task/builder/builder.redux.js +311 -326
- package/lib/components/task/builder/constants.js +94 -45
- package/lib/components/task/builder/helpers.js +184 -173
- package/lib/components/task/builder/helpers.test.js +20 -18
- package/lib/components/task/builder/models.js +121 -98
- package/lib/components/task/category/TaskCategoryForm.js +31 -29
- package/lib/components/task/category/TaskCategoryTable.js +12 -8
- package/lib/components/task/common/UsageTable.js +16 -12
- package/lib/components/task/engine/EngineSettingsForm.js +13 -11
- package/lib/components/task/errors/RunErrorTable.js +17 -13
- package/lib/components/task/errors/SystemErrorsTable.js +13 -9
- package/lib/components/task/handlers/HandlerForm.js +55 -55
- package/lib/components/task/handlers/HandlerTable.js +12 -8
- package/lib/components/task/handlers/MissingHandlerTable.js +12 -8
- package/lib/components/task/policy_rule/PolicyRuleForm.js +33 -32
- package/lib/components/task/policy_rule/PolicyRuleTable.js +12 -8
- package/lib/components/task/runs/CreateManualTriggerForm.js +17 -15
- package/lib/components/task/runs/RunTable.js +23 -20
- package/lib/components/task/runs/RunTaskTable.js +10 -6
- package/lib/components/task/sources/SourceForm.js +47 -47
- package/lib/components/task/sources/SourceTable.js +14 -11
- package/lib/components/task/triggers/TriggerTable.js +21 -18
- package/lib/components/task/workflows/LinkedWorkflowForm.js +48 -54
- package/lib/components/task/workflows/LinkedWorkflowTable.js +14 -10
- package/lib/components/task/workflows/MissingRoutineTable.js +12 -8
- package/lib/components/task/workflows/WorkflowForm.js +49 -44
- package/lib/components/task/workflows/WorkflowTable.js +17 -14
- package/lib/helpers/SearchBuilder.js +73 -127
- package/lib/helpers/SearchBuilder.test.js +184 -175
- package/lib/helpers/index.js +116 -74
- package/lib/index.js +86 -38
- package/lib/reducer.js +11 -3
- package/lib/saga.js +42 -38
- package/lib/store.js +59 -35
- package/package.json +3 -28
- package/proxyhelper.js +105 -46
- package/assets/discussions/images/avi_128.png +0 -0
- package/assets/discussions/images/excel_128.png +0 -0
- package/assets/discussions/images/html_128.png +0 -0
- package/assets/discussions/images/illustrator_128.png +0 -0
- package/assets/discussions/images/indesign_128.png +0 -0
- package/assets/discussions/images/movie_128.png +0 -0
- package/assets/discussions/images/mpeg_128.png +0 -0
- package/assets/discussions/images/pdf_128.png +0 -0
- package/assets/discussions/images/photoshop_128.png +0 -0
- package/assets/discussions/images/powerpoint_128.png +0 -0
- package/assets/discussions/images/txt_128.png +0 -0
- package/assets/discussions/images/unknown_128.png +0 -0
- package/assets/discussions/images/word_128.png +0 -0
- package/assets/discussions/styles/_discussion.scss +0 -506
- package/lib/apis/discussions/index.js +0 -395
- package/lib/apis/socket/index.js +0 -77
- package/lib/apis/socket/socket.js +0 -350
- package/lib/apis/socket/socket.test.js +0 -90
- package/lib/apis/socket/timer.js +0 -45
- package/lib/apis/socket/timer.test.js +0 -51
- package/lib/apis/socket/topic.js +0 -185
- package/lib/apis/topics/index.js +0 -19
- package/lib/components/discussions/ChatInputForm.js +0 -424
- package/lib/components/discussions/DateBanner.js +0 -10
- package/lib/components/discussions/Discussion.js +0 -202
- package/lib/components/discussions/DiscussionForm.js +0 -227
- package/lib/components/discussions/InvitationForm.js +0 -107
- package/lib/components/discussions/MessageHistory.js +0 -110
- package/lib/components/discussions/MessagesByDate.js +0 -40
- package/lib/components/discussions/MessagesList.js +0 -30
- package/lib/components/discussions/MoreMessagesBanner.js +0 -26
- package/lib/components/discussions/ScrollHelper.js +0 -84
- package/lib/components/discussions/SystemMessage.js +0 -88
- package/lib/components/discussions/SystemMessageGroup.js +0 -15
- package/lib/components/discussions/UserMessage.js +0 -163
- package/lib/components/discussions/UserMessageGroup.js +0 -34
- package/lib/components/discussions/redux.js +0 -178
- package/lib/components/discussions/sagas.js +0 -500
- package/lib/helpers/discussions/canManage.js +0 -30
- package/lib/helpers/discussions/canManage.test.js +0 -69
- package/lib/helpers/discussions/generateSystemMessageContent.js +0 -131
- package/lib/helpers/discussions/generateSystemMessageContent.test.js +0 -450
- package/lib/models/discussions.js +0 -76
- package/lib/models/index.js +0 -1
package/lib/apis/core/notices.js
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.fetchNotices = void 0;
|
|
8
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
9
|
+
var _helpers = require("../../helpers");
|
|
10
|
+
var _http = require("../http");
|
|
11
|
+
var fetchNotices = function fetchNotices() {
|
|
5
12
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
6
|
-
return
|
|
7
|
-
params: paramBuilder(options),
|
|
8
|
-
headers: headerBuilder(options)
|
|
13
|
+
return _axios["default"].get(_helpers.bundle.apiLocation() + '/notices', {
|
|
14
|
+
params: (0, _http.paramBuilder)(options),
|
|
15
|
+
headers: (0, _http.headerBuilder)(options)
|
|
9
16
|
}).then(function (response) {
|
|
10
17
|
return {
|
|
11
18
|
notices: response.data.notices
|
|
12
19
|
};
|
|
13
|
-
})["catch"](handleErrors);
|
|
14
|
-
};
|
|
20
|
+
})["catch"](_http.handleErrors);
|
|
21
|
+
};
|
|
22
|
+
exports.fetchNotices = fetchNotices;
|
|
@@ -1,97 +1,101 @@
|
|
|
1
|
-
|
|
2
|
-
import axios from 'axios';
|
|
3
|
-
import { bundle } from '../../helpers';
|
|
4
|
-
import { handleErrors, paramBuilder, headerBuilder } from '../http';
|
|
1
|
+
"use strict";
|
|
5
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.updateOAuthClient = exports.fetchOAuthClients = exports.fetchOAuthClient = exports.deleteOAuthClient = exports.createOAuthClient = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
10
|
+
var _helpers = require("../../helpers");
|
|
11
|
+
var _http = require("../http");
|
|
6
12
|
var buildEndpoint = function buildEndpoint(_ref) {
|
|
7
13
|
var clientId = _ref.clientId;
|
|
8
|
-
return clientId ? "".concat(bundle.apiLocation(), "/oauthClients/").concat(encodeURIComponent(clientId)) : "".concat(bundle.apiLocation(), "/oauthClients");
|
|
14
|
+
return clientId ? "".concat(_helpers.bundle.apiLocation(), "/oauthClients/").concat(encodeURIComponent(clientId)) : "".concat(_helpers.bundle.apiLocation(), "/oauthClients");
|
|
9
15
|
};
|
|
10
|
-
|
|
11
|
-
export var fetchOAuthClients = function fetchOAuthClients() {
|
|
16
|
+
var fetchOAuthClients = function fetchOAuthClients() {
|
|
12
17
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
13
|
-
return
|
|
14
|
-
params:
|
|
15
|
-
headers: headerBuilder(options)
|
|
18
|
+
return _axios["default"].get(buildEndpoint(options), {
|
|
19
|
+
params: (0, _objectSpread2["default"])({}, (0, _http.paramBuilder)(options)),
|
|
20
|
+
headers: (0, _http.headerBuilder)(options)
|
|
16
21
|
}).then(function (response) {
|
|
17
22
|
return {
|
|
18
23
|
oauthClients: response.data.oauthClients
|
|
19
24
|
};
|
|
20
|
-
})["catch"](handleErrors);
|
|
25
|
+
})["catch"](_http.handleErrors);
|
|
21
26
|
};
|
|
22
|
-
|
|
27
|
+
exports.fetchOAuthClients = fetchOAuthClients;
|
|
28
|
+
var fetchOAuthClient = function fetchOAuthClient() {
|
|
23
29
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
24
30
|
var clientId = options.clientId;
|
|
25
|
-
|
|
26
31
|
if (!clientId) {
|
|
27
32
|
throw new Error('fetchOAuthClient failed! The option "clientId" is required.');
|
|
28
33
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
headers: headerBuilder(options)
|
|
34
|
+
return _axios["default"].get(buildEndpoint(options), {
|
|
35
|
+
params: (0, _objectSpread2["default"])({}, (0, _http.paramBuilder)(options)),
|
|
36
|
+
headers: (0, _http.headerBuilder)(options)
|
|
33
37
|
}).then(function (response) {
|
|
34
38
|
return {
|
|
35
39
|
client: response.data.client
|
|
36
40
|
};
|
|
37
|
-
})["catch"](handleErrors);
|
|
41
|
+
})["catch"](_http.handleErrors);
|
|
38
42
|
};
|
|
39
|
-
|
|
43
|
+
exports.fetchOAuthClient = fetchOAuthClient;
|
|
44
|
+
var updateOAuthClient = function updateOAuthClient() {
|
|
40
45
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
41
46
|
var clientId = options.clientId,
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
client = options.client;
|
|
44
48
|
if (!clientId) {
|
|
45
49
|
throw new Error('updateOAuthClient failed! The option "clientId" is required.');
|
|
46
50
|
}
|
|
47
|
-
|
|
48
51
|
if (!client) {
|
|
49
52
|
throw new Error('updateOAuthClient failed! The option "client" is required.');
|
|
50
|
-
}
|
|
51
|
-
|
|
53
|
+
}
|
|
52
54
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
// Build URL and fetch the space.
|
|
56
|
+
return _axios["default"].put(buildEndpoint(options), client, {
|
|
57
|
+
params: (0, _http.paramBuilder)(options),
|
|
58
|
+
headers: (0, _http.headerBuilder)(options)
|
|
56
59
|
}).then(function (response) {
|
|
57
60
|
return {
|
|
58
61
|
client: response.data.client
|
|
59
62
|
};
|
|
60
|
-
})["catch"](handleErrors);
|
|
63
|
+
})["catch"](_http.handleErrors);
|
|
61
64
|
};
|
|
62
|
-
|
|
65
|
+
exports.updateOAuthClient = updateOAuthClient;
|
|
66
|
+
var createOAuthClient = function createOAuthClient() {
|
|
63
67
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
64
68
|
var client = options.client;
|
|
65
|
-
|
|
66
69
|
if (!client) {
|
|
67
70
|
throw new Error('updateOAuthClient failed! The option "client" is required.');
|
|
68
|
-
}
|
|
69
|
-
|
|
71
|
+
}
|
|
70
72
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
// Build URL and fetch the space.
|
|
74
|
+
return _axios["default"].post(buildEndpoint(options), client, {
|
|
75
|
+
params: (0, _http.paramBuilder)(options),
|
|
76
|
+
headers: (0, _http.headerBuilder)(options)
|
|
74
77
|
}).then(function (response) {
|
|
75
78
|
return {
|
|
76
79
|
client: response.data.client
|
|
77
80
|
};
|
|
78
|
-
})["catch"](handleErrors);
|
|
81
|
+
})["catch"](_http.handleErrors);
|
|
79
82
|
};
|
|
80
|
-
|
|
83
|
+
exports.createOAuthClient = createOAuthClient;
|
|
84
|
+
var deleteOAuthClient = function deleteOAuthClient() {
|
|
81
85
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
82
86
|
var clientId = options.clientId;
|
|
83
|
-
|
|
84
87
|
if (!clientId) {
|
|
85
88
|
throw new Error('deleteOAuthClient failed! The option "clientId" is required.');
|
|
86
|
-
}
|
|
87
|
-
|
|
89
|
+
}
|
|
88
90
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
// Build URL and fetch the space.
|
|
92
|
+
return _axios["default"]["delete"](buildEndpoint(options), {
|
|
93
|
+
params: (0, _http.paramBuilder)(options),
|
|
94
|
+
headers: (0, _http.headerBuilder)(options)
|
|
92
95
|
}).then(function (response) {
|
|
93
96
|
return {
|
|
94
97
|
client: response.data.client
|
|
95
98
|
};
|
|
96
|
-
})["catch"](handleErrors);
|
|
97
|
-
};
|
|
99
|
+
})["catch"](_http.handleErrors);
|
|
100
|
+
};
|
|
101
|
+
exports.deleteOAuthClient = deleteOAuthClient;
|
|
@@ -1,110 +1,126 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.validateAgent = exports.updateTaskComponent = exports.updateAgentComponent = exports.fetchTaskComponent = exports.fetchAgentComponents = exports.fetchAgentComponentVersion = exports.fetchAgentComponent = exports.deleteAgentComponent = exports.createAgentComponent = void 0;
|
|
8
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
9
|
+
var _helpers = require("../../helpers");
|
|
10
|
+
var _http = require("../http");
|
|
11
|
+
var fetchTaskComponent = function fetchTaskComponent() {
|
|
5
12
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
6
|
-
validateOptions('fetchTaskComponent', [], options);
|
|
7
|
-
return
|
|
8
|
-
params: paramBuilder(options),
|
|
9
|
-
headers: headerBuilder(options)
|
|
13
|
+
(0, _http.validateOptions)('fetchTaskComponent', [], options);
|
|
14
|
+
return _axios["default"].get("".concat(_helpers.bundle.apiLocation(), "/platformComponents/task"), {
|
|
15
|
+
params: (0, _http.paramBuilder)(options),
|
|
16
|
+
headers: (0, _http.headerBuilder)(options)
|
|
10
17
|
}).then(function (response) {
|
|
11
18
|
return {
|
|
12
19
|
task: response.data.task
|
|
13
20
|
};
|
|
14
|
-
})["catch"](handleErrors);
|
|
21
|
+
})["catch"](_http.handleErrors);
|
|
15
22
|
};
|
|
16
|
-
|
|
23
|
+
exports.fetchTaskComponent = fetchTaskComponent;
|
|
24
|
+
var updateTaskComponent = function updateTaskComponent() {
|
|
17
25
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
18
|
-
validateOptions('updateTaskComponent', ['task'], options);
|
|
19
|
-
return
|
|
20
|
-
params: paramBuilder(options),
|
|
21
|
-
headers: headerBuilder(options)
|
|
26
|
+
(0, _http.validateOptions)('updateTaskComponent', ['task'], options);
|
|
27
|
+
return _axios["default"].put("".concat(_helpers.bundle.apiLocation(), "/platformComponents/task"), options.task, {
|
|
28
|
+
params: (0, _http.paramBuilder)(options),
|
|
29
|
+
headers: (0, _http.headerBuilder)(options)
|
|
22
30
|
}).then(function (response) {
|
|
23
31
|
return {
|
|
24
32
|
task: response.data.task
|
|
25
33
|
};
|
|
26
|
-
})["catch"](handleErrors);
|
|
34
|
+
})["catch"](_http.handleErrors);
|
|
27
35
|
};
|
|
28
|
-
|
|
36
|
+
exports.updateTaskComponent = updateTaskComponent;
|
|
37
|
+
var fetchAgentComponents = function fetchAgentComponents() {
|
|
29
38
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
30
|
-
return
|
|
31
|
-
params: paramBuilder(options),
|
|
32
|
-
headers: headerBuilder(options)
|
|
39
|
+
return _axios["default"].get("".concat(_helpers.bundle.apiLocation(), "/platformComponents/agents"), {
|
|
40
|
+
params: (0, _http.paramBuilder)(options),
|
|
41
|
+
headers: (0, _http.headerBuilder)(options)
|
|
33
42
|
}).then(function (response) {
|
|
34
43
|
return {
|
|
35
44
|
agents: response.data.agents
|
|
36
45
|
};
|
|
37
|
-
})["catch"](handleErrors);
|
|
46
|
+
})["catch"](_http.handleErrors);
|
|
38
47
|
};
|
|
39
|
-
|
|
48
|
+
exports.fetchAgentComponents = fetchAgentComponents;
|
|
49
|
+
var fetchAgentComponent = function fetchAgentComponent() {
|
|
40
50
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
41
|
-
validateOptions('fetchAgentComponent', ['slug'], options);
|
|
42
|
-
return
|
|
43
|
-
params: paramBuilder(options),
|
|
44
|
-
headers: headerBuilder(options)
|
|
51
|
+
(0, _http.validateOptions)('fetchAgentComponent', ['slug'], options);
|
|
52
|
+
return _axios["default"].get("".concat(_helpers.bundle.apiLocation(), "/platformComponents/agents/").concat(options.slug), {
|
|
53
|
+
params: (0, _http.paramBuilder)(options),
|
|
54
|
+
headers: (0, _http.headerBuilder)(options)
|
|
45
55
|
}).then(function (response) {
|
|
46
56
|
return {
|
|
47
57
|
agent: response.data.agent
|
|
48
58
|
};
|
|
49
|
-
})["catch"](handleErrors);
|
|
59
|
+
})["catch"](_http.handleErrors);
|
|
50
60
|
};
|
|
51
|
-
|
|
61
|
+
exports.fetchAgentComponent = fetchAgentComponent;
|
|
62
|
+
var createAgentComponent = function createAgentComponent() {
|
|
52
63
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
53
|
-
validateOptions('createAgentComponent', ['agent'], options);
|
|
54
|
-
return
|
|
55
|
-
params: paramBuilder(options),
|
|
56
|
-
headers: headerBuilder(options)
|
|
64
|
+
(0, _http.validateOptions)('createAgentComponent', ['agent'], options);
|
|
65
|
+
return _axios["default"].post("".concat(_helpers.bundle.apiLocation(), "/platformComponents/agents"), options.agent, {
|
|
66
|
+
params: (0, _http.paramBuilder)(options),
|
|
67
|
+
headers: (0, _http.headerBuilder)(options)
|
|
57
68
|
}).then(function (response) {
|
|
58
69
|
return {
|
|
59
70
|
agent: response.data.agent
|
|
60
71
|
};
|
|
61
|
-
})["catch"](handleErrors);
|
|
72
|
+
})["catch"](_http.handleErrors);
|
|
62
73
|
};
|
|
63
|
-
|
|
74
|
+
exports.createAgentComponent = createAgentComponent;
|
|
75
|
+
var updateAgentComponent = function updateAgentComponent() {
|
|
64
76
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
65
|
-
validateOptions('updateAgentComponent', ['slug', 'agent'], options);
|
|
66
|
-
return
|
|
67
|
-
params: paramBuilder(options),
|
|
68
|
-
headers: headerBuilder(options)
|
|
77
|
+
(0, _http.validateOptions)('updateAgentComponent', ['slug', 'agent'], options);
|
|
78
|
+
return _axios["default"].put("".concat(_helpers.bundle.apiLocation(), "/platformComponents/agents/").concat(options.slug), options.agent, {
|
|
79
|
+
params: (0, _http.paramBuilder)(options),
|
|
80
|
+
headers: (0, _http.headerBuilder)(options)
|
|
69
81
|
}).then(function (response) {
|
|
70
82
|
return {
|
|
71
83
|
agent: response.data.agent
|
|
72
84
|
};
|
|
73
|
-
})["catch"](handleErrors);
|
|
85
|
+
})["catch"](_http.handleErrors);
|
|
74
86
|
};
|
|
75
|
-
|
|
87
|
+
exports.updateAgentComponent = updateAgentComponent;
|
|
88
|
+
var deleteAgentComponent = function deleteAgentComponent() {
|
|
76
89
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
77
|
-
validateOptions('deleteAgentComponent', ['slug'], options);
|
|
78
|
-
return
|
|
79
|
-
params: paramBuilder(options),
|
|
80
|
-
headers: headerBuilder(options)
|
|
90
|
+
(0, _http.validateOptions)('deleteAgentComponent', ['slug'], options);
|
|
91
|
+
return _axios["default"]["delete"]("".concat(_helpers.bundle.apiLocation(), "/platformComponents/agents/").concat(options.slug), {
|
|
92
|
+
params: (0, _http.paramBuilder)(options),
|
|
93
|
+
headers: (0, _http.headerBuilder)(options)
|
|
81
94
|
}).then(function (response) {
|
|
82
95
|
return {
|
|
83
96
|
agent: response.data.agent
|
|
84
97
|
};
|
|
85
|
-
})["catch"](handleErrors);
|
|
98
|
+
})["catch"](_http.handleErrors);
|
|
86
99
|
};
|
|
87
|
-
|
|
100
|
+
exports.deleteAgentComponent = deleteAgentComponent;
|
|
101
|
+
var validateAgent = function validateAgent() {
|
|
88
102
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
89
|
-
validateOptions('validateAgent', [], options);
|
|
90
|
-
return
|
|
91
|
-
params: paramBuilder(options),
|
|
92
|
-
headers: headerBuilder(options)
|
|
103
|
+
(0, _http.validateOptions)('validateAgent', [], options);
|
|
104
|
+
return _axios["default"].get("".concat((0, _helpers.buildAgentPath)(options), "/app/api/v1/bridges"), {
|
|
105
|
+
params: (0, _http.paramBuilder)(options),
|
|
106
|
+
headers: (0, _http.headerBuilder)(options)
|
|
93
107
|
}).then(function (response) {
|
|
94
108
|
return {
|
|
95
109
|
successMessage: "".concat(options.agentSlug, " has been successfully validated.")
|
|
96
110
|
};
|
|
97
|
-
})["catch"](handleErrors);
|
|
111
|
+
})["catch"](_http.handleErrors);
|
|
98
112
|
};
|
|
99
|
-
|
|
113
|
+
exports.validateAgent = validateAgent;
|
|
114
|
+
var fetchAgentComponentVersion = function fetchAgentComponentVersion() {
|
|
100
115
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
101
|
-
validateOptions('validateAgent', [], options);
|
|
102
|
-
return
|
|
103
|
-
params: paramBuilder(options),
|
|
104
|
-
headers: headerBuilder(options)
|
|
116
|
+
(0, _http.validateOptions)('validateAgent', [], options);
|
|
117
|
+
return _axios["default"].get("".concat((0, _helpers.buildAgentPath)(options), "/app/api/v1/version"), {
|
|
118
|
+
params: (0, _http.paramBuilder)(options),
|
|
119
|
+
headers: (0, _http.headerBuilder)(options)
|
|
105
120
|
}).then(function (response) {
|
|
106
121
|
return {
|
|
107
122
|
version: response.data.version
|
|
108
123
|
};
|
|
109
|
-
})["catch"](handleErrors);
|
|
110
|
-
};
|
|
124
|
+
})["catch"](_http.handleErrors);
|
|
125
|
+
};
|
|
126
|
+
exports.fetchAgentComponentVersion = fetchAgentComponentVersion;
|
|
@@ -1,21 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.fetchPlatformItem = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
10
|
+
var _helpers = require("../../helpers");
|
|
11
|
+
var _http = require("../http");
|
|
12
|
+
var fetchPlatformItem = function fetchPlatformItem(options) {
|
|
13
|
+
(0, _http.validateOptions)('fetchPlatformItem', ['type', 'id'], options);
|
|
14
|
+
var path = options.type === 'Space' ? "".concat(_helpers.bundle.apiLocation(), "/space") : "".concat(_helpers.bundle.apiLocation(), "/items/").concat(options.type, "/").concat(options.id);
|
|
8
15
|
var include = options.type === 'Form' ? 'kapp,kapp.space' : options.type === 'Kapp' ? 'space' : '';
|
|
9
|
-
return
|
|
10
|
-
params: paramBuilder(
|
|
16
|
+
return _axios["default"].get(path, {
|
|
17
|
+
params: (0, _http.paramBuilder)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, options), {}, {
|
|
11
18
|
include: include
|
|
12
19
|
})),
|
|
13
|
-
headers: headerBuilder(options)
|
|
20
|
+
headers: (0, _http.headerBuilder)(options)
|
|
14
21
|
}).then(function (response) {
|
|
15
22
|
return {
|
|
16
23
|
platformItem: response.data.space || response.data.kapp || response.data.form
|
|
17
24
|
};
|
|
18
|
-
})
|
|
25
|
+
})
|
|
26
|
+
// Clean up any errors we receive. Make sure this the last thing so that it
|
|
19
27
|
// cleans up any errors.
|
|
20
|
-
["catch"](handleErrors);
|
|
21
|
-
};
|
|
28
|
+
["catch"](_http.handleErrors);
|
|
29
|
+
};
|
|
30
|
+
exports.fetchPlatformItem = fetchPlatformItem;
|
package/lib/apis/core/profile.js
CHANGED
|
@@ -1,40 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
import { bundle } from '../../helpers';
|
|
3
|
-
import { handleErrors, paramBuilder, headerBuilder } from '../http';
|
|
1
|
+
"use strict";
|
|
4
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.updateProfile = exports.fetchProfile = void 0;
|
|
8
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
9
|
+
var _helpers = require("../../helpers");
|
|
10
|
+
var _http = require("../http");
|
|
5
11
|
var getProfileEndpoint = function getProfileEndpoint() {
|
|
6
|
-
return "".concat(bundle.apiLocation(), "/me");
|
|
7
|
-
};
|
|
8
|
-
// If there are any errors clean them up and return them instead.
|
|
9
|
-
|
|
12
|
+
return "".concat(_helpers.bundle.apiLocation(), "/me");
|
|
13
|
+
};
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
// Extract the profile from the data and return it.
|
|
16
|
+
// If there are any errors clean them up and return them instead.
|
|
17
|
+
var fetchProfile = function fetchProfile() {
|
|
12
18
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
13
19
|
// Build URL and fetch the space.
|
|
14
|
-
return
|
|
15
|
-
params: paramBuilder(options),
|
|
16
|
-
headers: headerBuilder(options)
|
|
20
|
+
return _axios["default"].get(getProfileEndpoint(), {
|
|
21
|
+
params: (0, _http.paramBuilder)(options),
|
|
22
|
+
headers: (0, _http.headerBuilder)(options)
|
|
17
23
|
}).then(function (response) {
|
|
18
24
|
return {
|
|
19
25
|
profile: response.data
|
|
20
26
|
};
|
|
21
|
-
})["catch"](handleErrors);
|
|
27
|
+
})["catch"](_http.handleErrors);
|
|
22
28
|
};
|
|
23
|
-
|
|
29
|
+
exports.fetchProfile = fetchProfile;
|
|
30
|
+
var updateProfile = function updateProfile() {
|
|
24
31
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
25
32
|
var profile = options.profile;
|
|
26
|
-
|
|
27
33
|
if (!profile) {
|
|
28
34
|
throw new Error('updateProfile failed! The option "profile" is required.');
|
|
29
|
-
}
|
|
30
|
-
|
|
35
|
+
}
|
|
31
36
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
// Build URL and fetch the space.
|
|
38
|
+
return _axios["default"].put(getProfileEndpoint(), profile, {
|
|
39
|
+
params: (0, _http.paramBuilder)(options),
|
|
40
|
+
headers: (0, _http.headerBuilder)(options)
|
|
35
41
|
}).then(function (response) {
|
|
36
42
|
return {
|
|
37
43
|
profile: response.data.user
|
|
38
44
|
};
|
|
39
|
-
})["catch"](handleErrors);
|
|
40
|
-
};
|
|
45
|
+
})["catch"](_http.handleErrors);
|
|
46
|
+
};
|
|
47
|
+
exports.updateProfile = updateProfile;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import { fetchProfile, updateProfile } from './profile';
|
|
3
|
-
import { UserBuilder } from '../../../tests/utils/user_builder';
|
|
4
|
-
import { rejectPromiseWith, resolvePromiseWith } from '../../../tests/utils/promises'; // Mock out the bundle object from a dependency.
|
|
1
|
+
"use strict";
|
|
5
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
5
|
+
var _profile = require("./profile");
|
|
6
|
+
var _user_builder = require("../../../tests/utils/user_builder");
|
|
7
|
+
var _promises = require("../../../tests/utils/promises");
|
|
8
|
+
// Mock out the bundle object from a dependency.
|
|
6
9
|
jest.mock('../../helpers', function () {
|
|
7
10
|
return {
|
|
8
11
|
bundle: {
|
|
@@ -25,20 +28,20 @@ describe('profile api', function () {
|
|
|
25
28
|
status: 200,
|
|
26
29
|
data: {}
|
|
27
30
|
};
|
|
28
|
-
testUser = new UserBuilder().stub().withAttribute('Attribute', 'value').build();
|
|
31
|
+
testUser = new _user_builder.UserBuilder().stub().withAttribute('Attribute', 'value').build();
|
|
29
32
|
response.data = testUser;
|
|
30
|
-
|
|
33
|
+
_axios["default"].get = (0, _promises.resolvePromiseWith)(response);
|
|
31
34
|
});
|
|
32
35
|
test('does not return errors', function () {
|
|
33
36
|
expect.assertions(1);
|
|
34
|
-
return fetchProfile().then(function (_ref) {
|
|
37
|
+
return (0, _profile.fetchProfile)().then(function (_ref) {
|
|
35
38
|
var errors = _ref.errors;
|
|
36
39
|
expect(errors).toBeUndefined();
|
|
37
40
|
});
|
|
38
41
|
});
|
|
39
42
|
test('returns a profile', function () {
|
|
40
43
|
expect.assertions(1);
|
|
41
|
-
return fetchProfile().then(function (_ref2) {
|
|
44
|
+
return (0, _profile.fetchProfile)().then(function (_ref2) {
|
|
42
45
|
var profile = _ref2.profile;
|
|
43
46
|
expect(profile).toMatchObject({
|
|
44
47
|
username: testUser.username,
|
|
@@ -48,7 +51,7 @@ describe('profile api', function () {
|
|
|
48
51
|
});
|
|
49
52
|
test('returns attributes', function () {
|
|
50
53
|
expect.assertions(2);
|
|
51
|
-
return fetchProfile().then(function (_ref3) {
|
|
54
|
+
return (0, _profile.fetchProfile)().then(function (_ref3) {
|
|
52
55
|
var profile = _ref3.profile;
|
|
53
56
|
expect(profile.attributes).toBeDefined();
|
|
54
57
|
expect(profile.attributes).toBeInstanceOf(Array);
|
|
@@ -67,13 +70,13 @@ describe('profile api', function () {
|
|
|
67
70
|
user: {}
|
|
68
71
|
}
|
|
69
72
|
};
|
|
70
|
-
testUser = new UserBuilder().stub().withAttribute('Attribute', 'value').build();
|
|
73
|
+
testUser = new _user_builder.UserBuilder().stub().withAttribute('Attribute', 'value').build();
|
|
71
74
|
response.data.user = testUser;
|
|
72
|
-
|
|
75
|
+
_axios["default"].put = (0, _promises.resolvePromiseWith)(response);
|
|
73
76
|
});
|
|
74
77
|
test('does not return errors', function () {
|
|
75
78
|
expect.assertions(1);
|
|
76
|
-
return updateProfile({
|
|
79
|
+
return (0, _profile.updateProfile)({
|
|
77
80
|
profile: testUser
|
|
78
81
|
}).then(function (_ref4) {
|
|
79
82
|
var errors = _ref4.errors;
|
|
@@ -82,7 +85,7 @@ describe('profile api', function () {
|
|
|
82
85
|
});
|
|
83
86
|
test('returns a profile', function () {
|
|
84
87
|
expect.assertions(1);
|
|
85
|
-
return updateProfile({
|
|
88
|
+
return (0, _profile.updateProfile)({
|
|
86
89
|
profile: testUser
|
|
87
90
|
}).then(function (_ref5) {
|
|
88
91
|
var profile = _ref5.profile;
|
|
@@ -94,7 +97,7 @@ describe('profile api', function () {
|
|
|
94
97
|
});
|
|
95
98
|
test('returns attributes', function () {
|
|
96
99
|
expect.assertions(2);
|
|
97
|
-
return updateProfile({
|
|
100
|
+
return (0, _profile.updateProfile)({
|
|
98
101
|
profile: testUser
|
|
99
102
|
}).then(function (_ref6) {
|
|
100
103
|
var profile = _ref6.profile;
|
|
@@ -110,18 +113,18 @@ describe('profile api', function () {
|
|
|
110
113
|
status: 500,
|
|
111
114
|
data: {}
|
|
112
115
|
};
|
|
113
|
-
|
|
116
|
+
_axios["default"].put = (0, _promises.rejectPromiseWith)({
|
|
114
117
|
response: response
|
|
115
118
|
});
|
|
116
119
|
});
|
|
117
120
|
test('throws an exception when no profile object is provided', function () {
|
|
118
121
|
expect(function () {
|
|
119
|
-
updateProfile();
|
|
122
|
+
(0, _profile.updateProfile)();
|
|
120
123
|
}).toThrow();
|
|
121
124
|
});
|
|
122
125
|
test('does return errors', function () {
|
|
123
126
|
expect.assertions(1);
|
|
124
|
-
return updateProfile({
|
|
127
|
+
return (0, _profile.updateProfile)({
|
|
125
128
|
profile: {}
|
|
126
129
|
}).then(function (_ref7) {
|
|
127
130
|
var error = _ref7.error;
|