@kineticdata/react 6.0.0 → 6.0.2
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/agent/adapters.js +2 -3
- package/lib/apis/agent/bridges.js +7 -13
- package/lib/apis/agent/handlers.js +7 -13
- package/lib/apis/core/activity.js +2 -3
- package/lib/apis/core/attributeDefinitions.js +6 -11
- package/lib/apis/core/attributeDefinitions.test.js +201 -213
- package/lib/apis/core/authentication.js +74 -84
- package/lib/apis/core/backgroundJobs.js +5 -9
- package/lib/apis/core/bridgeModelAttributeMappings.js +5 -10
- package/lib/apis/core/bridgeModelAttributes.js +6 -11
- package/lib/apis/core/bridgeModelMappings.js +5 -10
- package/lib/apis/core/bridgeModelQualificationMappings.js +5 -10
- package/lib/apis/core/bridgeModelQualifications.js +5 -10
- package/lib/apis/core/bridgeModels.js +7 -13
- package/lib/apis/core/bridgeModels.test.js +313 -333
- package/lib/apis/core/bridgedresources.js +7 -13
- package/lib/apis/core/categories.js +6 -11
- package/lib/apis/core/fileResources.js +5 -10
- package/lib/apis/core/filestores.js +5 -10
- package/lib/apis/core/formTypes.js +6 -11
- package/lib/apis/core/forms.js +6 -11
- package/lib/apis/core/forms.test.js +201 -213
- package/lib/apis/core/kapps.js +6 -11
- package/lib/apis/core/kapps.test.js +122 -130
- package/lib/apis/core/logs.js +3 -5
- package/lib/apis/core/memberships.js +3 -5
- package/lib/apis/core/meta.js +6 -11
- package/lib/apis/core/notices.js +2 -3
- package/lib/apis/core/oauthClients.js +6 -11
- package/lib/apis/core/platformComponents.js +10 -19
- package/lib/apis/core/platformItems.js +2 -3
- package/lib/apis/core/profile.js +3 -5
- package/lib/apis/core/securityPolicyDefinitions.js +6 -11
- package/lib/apis/core/securityPolicyDefinitions.test.js +254 -268
- package/lib/apis/core/space.js +3 -5
- package/lib/apis/core/space.test.js +106 -114
- package/lib/apis/core/submissions.js +17 -33
- package/lib/apis/core/teams.js +6 -11
- package/lib/apis/core/translations.js +18 -35
- package/lib/apis/core/translations.test.js +1343 -1437
- package/lib/apis/core/users.js +6 -11
- package/lib/apis/core/version.js +2 -3
- package/lib/apis/core/webApis.js +5 -10
- package/lib/apis/core/webhooks.js +6 -11
- package/lib/apis/core/webhooks.test.js +243 -257
- package/lib/apis/core/webhooksJobs.js +3 -5
- package/lib/apis/core/workflows.js +7 -13
- package/lib/apis/http.js +47 -30
- package/lib/apis/http.test.js +100 -0
- package/lib/apis/system/index.js +167 -81
- package/lib/apis/task/index.js +73 -118
- package/lib/components/agent/bridge/BridgeForm.js +1 -2
- package/lib/components/agent/bridge/BridgeTable.js +5 -3
- package/lib/components/agent/filestore/FilestoreForm.js +1 -2
- package/lib/components/agent/filestore/FilestoreTable.js +5 -3
- package/lib/components/agent/handler/AgentHandlerForm.js +1 -2
- package/lib/components/agent/handler/AgentHandlerTable.js +6 -4
- package/lib/components/common/AttributeSelect.js +2 -3
- package/lib/components/common/BridgeSelect.js +16 -17
- package/lib/components/common/ComponentConfigContext.js +1 -2
- package/lib/components/common/ContentEditable.js +23 -3
- package/lib/components/common/FormSelect.js +16 -17
- package/lib/components/common/NodeSelect.js +2 -3
- package/lib/components/common/Scroller.js +2 -3
- package/lib/components/common/StaticSelect.js +14 -15
- package/lib/components/common/TableInput.js +276 -63
- package/lib/components/common/TeamSelect.js +16 -17
- package/lib/components/common/ToastContainer.js +165 -0
- package/lib/components/common/Typeahead.js +15 -2
- package/lib/components/common/UserSelect.js +16 -17
- package/lib/components/common/authentication/AuthInterceptor.js +2 -3
- package/lib/components/common/authentication/AuthInterceptor.test.js +141 -153
- package/lib/components/common/authentication/AuthenticationContainer.js +332 -343
- package/lib/components/common/authentication/RequestInterceptor.js +2 -10
- package/lib/components/common/code_input/CodeInput.js +4 -9
- package/lib/components/common/code_input/draftHelpers.js +20 -37
- package/lib/components/common/code_input/languageHelpers.js +6 -12
- package/lib/components/common/code_input/languageHelpers.test.js +10 -8
- package/lib/components/common/defaults/Toast.js +25 -0
- package/lib/components/common/defaults/index.js +12 -0
- package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +1 -2
- package/lib/components/core/attribute_definition/AttributeDefinitionTable.js +8 -5
- package/lib/components/core/bridge_model/BridgeModelForm.js +52 -55
- package/lib/components/core/bridge_model/BridgeModelTable.js +6 -4
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeForm.js +1 -2
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeTable.js +1 -2
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationForm.js +1 -2
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationTable.js +1 -2
- package/lib/components/core/category/CategoryForm.js +1 -2
- package/lib/components/core/category/CategoryTable.js +14 -8
- package/lib/components/core/core_form/CoreForm.js +11 -22
- package/lib/components/core/core_form/defaults/index.js +11 -19
- package/lib/components/core/core_form/globals.js +3 -5
- package/lib/components/core/field_definition/FieldDefinitionForm.js +1 -2
- package/lib/components/core/field_definition/FieldDefinitionTable.js +13 -9
- package/lib/components/core/file_resource/FileResourceForm.js +1 -2
- package/lib/components/core/file_resource/FileResourceTable.js +1 -2
- package/lib/components/core/form/FormForm.js +1 -2
- package/lib/components/core/form/FormTable.js +23 -13
- package/lib/components/core/form_type/FormTypeForm.js +1 -2
- package/lib/components/core/form_type/FormTypeTable.js +4 -3
- package/lib/components/core/i18n/I18n.js +2 -4
- package/lib/components/core/i18n/I18nContext.js +1 -2
- package/lib/components/core/i18n/I18nProvider.js +2 -3
- package/lib/components/core/i18n/Moment.js +10 -9
- package/lib/components/core/index_definition/IndexDefinitionForm.js +1 -2
- package/lib/components/core/index_definition/IndexDefinitionTable.js +13 -7
- package/lib/components/core/index_job/IndexJobTable.js +1 -2
- package/lib/components/core/kapp/KappForm.js +1 -2
- package/lib/components/core/kapp/KappTable.js +18 -34
- package/lib/components/core/log/LogTable.js +10 -6
- package/lib/components/core/oauth_client/OAuthClientForm.js +1 -2
- package/lib/components/core/oauth_client/OAuthClientTable.js +1 -2
- package/lib/components/core/platform_component/AgentComponentForm.js +1 -2
- package/lib/components/core/platform_component/AgentComponentTable.js +1 -2
- package/lib/components/core/platform_component/TaskComponentForm.js +1 -2
- package/lib/components/core/profile/ProfileForm.js +1 -2
- package/lib/components/core/security_definition/SecurityDefinitionForm.js +3 -6
- package/lib/components/core/security_definition/SecurityDefinitionTable.js +10 -6
- package/lib/components/core/space/SpaceForm.js +1 -2
- package/lib/components/core/submission/DatastoreSubmissionFilters.js +3 -5
- package/lib/components/core/submission/DatastoreSubmissionTable.js +2 -4
- package/lib/components/core/submission/FormSubmissionFilters.js +4 -7
- package/lib/components/core/submission/FormSubmissionTable.js +39 -23
- package/lib/components/core/submission/KappSubmissionTable.js +39 -23
- package/lib/components/core/submission/SubmissionForm.js +1 -2
- package/lib/components/core/submission/SubmissionTable.js +2 -3
- package/lib/components/core/submission/helpers.js +4 -7
- package/lib/components/core/team/TeamForm.js +2 -3
- package/lib/components/core/team/TeamTable.js +12 -7
- package/lib/components/core/translation/ContextForm.js +1 -2
- package/lib/components/core/translation/ContextTable.js +1 -2
- package/lib/components/core/translation/EntryForm.js +1 -2
- package/lib/components/core/translation/EntryTable.js +1 -2
- package/lib/components/core/translation/LocaleForm.js +1 -2
- package/lib/components/core/translation/LocaleTable.js +1 -2
- package/lib/components/core/user/UserForm.js +1 -2
- package/lib/components/core/user/UserTable.js +24 -7
- package/lib/components/core/webapi/WebApiForm.js +138 -123
- package/lib/components/core/webapi/WebApiTable.js +15 -9
- package/lib/components/core/webhook/WebhookForm.js +1 -2
- package/lib/components/core/webhook/WebhookTable.js +20 -11
- package/lib/components/core/webhook_job/WebhookJobTable.js +40 -21
- package/lib/components/form/Form.helpers.js +91 -38
- package/lib/components/form/Form.js +312 -355
- package/lib/components/form/Form.models.js +7 -11
- package/lib/components/form/FormState.js +1 -2
- package/lib/components/form/KitchenSinkForm.js +23 -3
- package/lib/components/form/SimpleForm.helpers.js +262 -0
- package/lib/components/form/SimpleForm.js +462 -0
- package/lib/components/form/SimpleForm.models.js +62 -0
- package/lib/components/form/defaults/AttributesField.js +3 -4
- package/lib/components/form/defaults/CheckboxField.js +2 -3
- package/lib/components/form/defaults/CodeField.js +2 -3
- package/lib/components/form/defaults/FormButtons.js +2 -3
- package/lib/components/form/defaults/FormError.js +2 -3
- package/lib/components/form/defaults/FormField.js +2 -3
- package/lib/components/form/defaults/FormLayout.js +2 -3
- package/lib/components/form/defaults/FormMultiField.js +2 -3
- package/lib/components/form/defaults/PasswordField.js +2 -3
- package/lib/components/form/defaults/RadioField.js +2 -3
- package/lib/components/form/defaults/SampleTeamsRolesFIeld.js +2 -3
- package/lib/components/form/defaults/SelectField.js +2 -3
- package/lib/components/form/defaults/SelectMultiField.js +2 -3
- package/lib/components/form/defaults/TableField.js +2 -3
- package/lib/components/form/defaults/TeamField.js +2 -3
- package/lib/components/form/defaults/TeamMultiField.js +2 -3
- package/lib/components/form/defaults/TextField.js +2 -3
- package/lib/components/form/defaults/TextMultiField.js +2 -3
- package/lib/components/form/defaults/UserField.js +2 -3
- package/lib/components/form/defaults/UserMultiField.js +2 -3
- package/lib/components/form/defaults/index.js +2 -3
- package/lib/components/form/tests/Form.test.js +3865 -4257
- package/lib/components/form/tests/components.js +2 -3
- package/lib/components/index.js +60 -0
- package/lib/components/system/SystemBackgroundTasksTable.js +1 -2
- package/lib/components/system/SystemCassandraForm.js +97 -0
- package/lib/components/system/SystemElasticSearchForm.js +97 -0
- package/lib/components/system/SystemFilestoreForm.js +12 -8
- package/lib/components/system/SystemForm.js +1 -2
- package/lib/components/system/SystemIngressForm.js +78 -31
- package/lib/components/system/SystemSecurityForm.js +1 -2
- package/lib/components/system/SystemSmtpForm.js +1 -2
- package/lib/components/system/SystemTaskAdapterForm.js +30 -7
- package/lib/components/system/SystemTrustedCertificateForm.js +39 -0
- package/lib/components/system/SystemTrustedCertificatesTable.js +73 -0
- package/lib/components/system/SystemUserForm.js +1 -2
- package/lib/components/system/helpers.js +236 -65
- package/lib/components/system/spaces/SystemSpaceForm.js +2 -3
- package/lib/components/system/spaces/SystemTenantForm.js +77 -37
- package/lib/components/system/spaces/SystemTenantTable.js +1 -2
- package/lib/components/table/Table.js +132 -54
- package/lib/components/table/Table.redux.js +229 -235
- package/lib/components/table/Table.test.js +154 -123
- package/lib/components/table/defaults/BodyCell.js +1 -2
- package/lib/components/table/defaults/BodyRow.js +1 -2
- package/lib/components/table/defaults/BooleanFilter.js +1 -2
- package/lib/components/table/defaults/ColumnControl.js +25 -0
- package/lib/components/table/defaults/EmptyBodyRow.js +1 -2
- package/lib/components/table/defaults/FilterLayout.js +1 -2
- package/lib/components/table/defaults/Footer.js +1 -2
- package/lib/components/table/defaults/FooterCell.js +1 -2
- package/lib/components/table/defaults/FooterRow.js +1 -2
- package/lib/components/table/defaults/Header.js +1 -2
- package/lib/components/table/defaults/HeaderCell.js +1 -2
- package/lib/components/table/defaults/HeaderRow.js +1 -2
- package/lib/components/table/defaults/PaginationControl.js +2 -4
- package/lib/components/table/defaults/TableBody.js +1 -2
- package/lib/components/table/defaults/TableLayout.js +1 -2
- package/lib/components/table/defaults/TextFilter.js +1 -2
- package/lib/components/table/defaults/index.js +5 -4
- package/lib/components/task/builder/Connector.js +26 -11
- package/lib/components/task/builder/ConnectorForm.js +1 -2
- package/lib/components/task/builder/Node.js +18 -9
- package/lib/components/task/builder/NodeForm.js +1 -2
- package/lib/components/task/builder/NodeParametersForm.js +1 -2
- package/lib/components/task/builder/SvgCanvas.js +2 -3
- package/lib/components/task/builder/SvgText.js +2 -3
- package/lib/components/task/builder/TaskDefinitionConfigForm.js +3 -6
- package/lib/components/task/builder/TreeBuilder.js +10 -4
- package/lib/components/task/builder/builder.redux.js +171 -182
- package/lib/components/task/builder/constants.js +38 -76
- package/lib/components/task/builder/helpers.js +23 -40
- package/lib/components/task/builder/models.js +19 -35
- package/lib/components/task/category/TaskCategoryForm.js +2 -3
- package/lib/components/task/category/TaskCategoryTable.js +1 -2
- package/lib/components/task/common/UsageTable.js +1 -2
- package/lib/components/task/engine/EngineSettingsForm.js +2 -3
- package/lib/components/task/errors/RunErrorTable.js +35 -17
- package/lib/components/task/errors/SystemErrorsTable.js +1 -2
- package/lib/components/task/handlers/HandlerForm.js +2 -3
- package/lib/components/task/handlers/HandlerTable.js +24 -13
- package/lib/components/task/handlers/MissingHandlerTable.js +1 -2
- package/lib/components/task/policy_rule/PolicyRuleForm.js +2 -3
- package/lib/components/task/policy_rule/PolicyRuleTable.js +1 -2
- package/lib/components/task/runs/CreateManualTriggerForm.js +1 -2
- package/lib/components/task/runs/RunTable.js +24 -12
- package/lib/components/task/runs/RunTaskTable.js +1 -2
- package/lib/components/task/sources/SourceForm.js +1 -2
- package/lib/components/task/sources/SourceTable.js +16 -9
- package/lib/components/task/triggers/TriggerTable.js +52 -26
- package/lib/components/task/workflows/LinkedWorkflowForm.js +3 -5
- package/lib/components/task/workflows/LinkedWorkflowTable.js +33 -18
- package/lib/components/task/workflows/MissingRoutineTable.js +1 -2
- package/lib/components/task/workflows/WorkflowForm.js +2 -3
- package/lib/components/task/workflows/WorkflowTable.js +31 -17
- package/lib/helpers/SearchBuilder.js +2 -4
- package/lib/helpers/index.js +13 -26
- package/lib/index.js +7 -9
- package/lib/reducer.js +3 -5
- package/lib/saga.js +32 -48
- package/lib/store.js +32 -42
- package/package.json +26 -16
- package/proxyhelper.js +17 -11
- package/lib/components/core/CoreFormModal.js +0 -64
- package/lib/components/core/CoreModal.js +0 -114
|
@@ -80,149 +80,141 @@ describe('space api', function () {
|
|
|
80
80
|
test('success', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee() {
|
|
81
81
|
var _yield$updateSpace, space, error;
|
|
82
82
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee$(_context) {
|
|
83
|
-
while (1) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
data: {
|
|
89
|
-
space: {
|
|
90
|
-
name: 'Foo',
|
|
91
|
-
attributes: [{
|
|
92
|
-
name: 'Company Name',
|
|
93
|
-
values: ['Foo Bar']
|
|
94
|
-
}]
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
_context.next = 3;
|
|
99
|
-
return (0, _space.updateSpace)({
|
|
83
|
+
while (1) switch (_context.prev = _context.next) {
|
|
84
|
+
case 0:
|
|
85
|
+
_axios["default"].put.mockResolvedValue({
|
|
86
|
+
status: 200,
|
|
87
|
+
data: {
|
|
100
88
|
space: {
|
|
101
89
|
name: 'Foo',
|
|
102
90
|
attributes: [{
|
|
103
91
|
name: 'Company Name',
|
|
104
92
|
values: ['Foo Bar']
|
|
105
93
|
}]
|
|
106
|
-
},
|
|
107
|
-
include: 'attributes'
|
|
108
|
-
});
|
|
109
|
-
case 3:
|
|
110
|
-
_yield$updateSpace = _context.sent;
|
|
111
|
-
space = _yield$updateSpace.space;
|
|
112
|
-
error = _yield$updateSpace.error;
|
|
113
|
-
expect(_axios["default"].put.mock.calls).toEqual([['/app/api/v1/space', {
|
|
114
|
-
name: 'Foo',
|
|
115
|
-
attributes: [{
|
|
116
|
-
name: 'Company Name',
|
|
117
|
-
values: ['Foo Bar']
|
|
118
|
-
}]
|
|
119
|
-
}, {
|
|
120
|
-
params: {
|
|
121
|
-
include: 'attributes'
|
|
122
|
-
},
|
|
123
|
-
headers: {
|
|
124
|
-
'X-Kinetic-AuthAssumed': 'true'
|
|
125
94
|
}
|
|
126
|
-
}
|
|
127
|
-
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
_context.next = 3;
|
|
98
|
+
return (0, _space.updateSpace)({
|
|
99
|
+
space: {
|
|
128
100
|
name: 'Foo',
|
|
129
101
|
attributes: [{
|
|
130
102
|
name: 'Company Name',
|
|
131
103
|
values: ['Foo Bar']
|
|
132
104
|
}]
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
105
|
+
},
|
|
106
|
+
include: 'attributes'
|
|
107
|
+
});
|
|
108
|
+
case 3:
|
|
109
|
+
_yield$updateSpace = _context.sent;
|
|
110
|
+
space = _yield$updateSpace.space;
|
|
111
|
+
error = _yield$updateSpace.error;
|
|
112
|
+
expect(_axios["default"].put.mock.calls).toEqual([['/app/api/v1/space', {
|
|
113
|
+
name: 'Foo',
|
|
114
|
+
attributes: [{
|
|
115
|
+
name: 'Company Name',
|
|
116
|
+
values: ['Foo Bar']
|
|
117
|
+
}]
|
|
118
|
+
}, {
|
|
119
|
+
params: {
|
|
120
|
+
include: 'attributes'
|
|
121
|
+
},
|
|
122
|
+
headers: {
|
|
123
|
+
'X-Kinetic-AuthAssumed': 'true'
|
|
124
|
+
}
|
|
125
|
+
}]]);
|
|
126
|
+
expect(space).toEqual({
|
|
127
|
+
name: 'Foo',
|
|
128
|
+
attributes: [{
|
|
129
|
+
name: 'Company Name',
|
|
130
|
+
values: ['Foo Bar']
|
|
131
|
+
}]
|
|
132
|
+
});
|
|
133
|
+
expect(error).toBeUndefined();
|
|
134
|
+
case 9:
|
|
135
|
+
case "end":
|
|
136
|
+
return _context.stop();
|
|
139
137
|
}
|
|
140
138
|
}, _callee);
|
|
141
139
|
})));
|
|
142
140
|
test('missing space', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee2() {
|
|
143
141
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee2$(_context2) {
|
|
144
|
-
while (1) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
return _context2.stop();
|
|
153
|
-
}
|
|
142
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
143
|
+
case 0:
|
|
144
|
+
expect(function () {
|
|
145
|
+
(0, _space.updateSpace)({});
|
|
146
|
+
}).toThrow('updateSpace failed! The option "space" is required.');
|
|
147
|
+
case 1:
|
|
148
|
+
case "end":
|
|
149
|
+
return _context2.stop();
|
|
154
150
|
}
|
|
155
151
|
}, _callee2);
|
|
156
152
|
})));
|
|
157
153
|
test('bad request', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee3() {
|
|
158
154
|
var _yield$updateSpace2, space, error;
|
|
159
155
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee3$(_context3) {
|
|
160
|
-
while (1) {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
return _context3.stop();
|
|
190
|
-
}
|
|
156
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
157
|
+
case 0:
|
|
158
|
+
_axios["default"].put.mockRejectedValue((0, _createError["default"])('Request failed with status code 400', null, 400, null, {
|
|
159
|
+
status: 400,
|
|
160
|
+
statusText: 'Bad Request',
|
|
161
|
+
data: {
|
|
162
|
+
error: 'Invalid space'
|
|
163
|
+
}
|
|
164
|
+
}));
|
|
165
|
+
_context3.next = 3;
|
|
166
|
+
return (0, _space.updateSpace)({
|
|
167
|
+
space: {
|
|
168
|
+
name: null
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
case 3:
|
|
172
|
+
_yield$updateSpace2 = _context3.sent;
|
|
173
|
+
space = _yield$updateSpace2.space;
|
|
174
|
+
error = _yield$updateSpace2.error;
|
|
175
|
+
expect(space).toBeUndefined();
|
|
176
|
+
expect(error).toEqual({
|
|
177
|
+
message: 'Invalid space',
|
|
178
|
+
statusCode: 400,
|
|
179
|
+
key: null,
|
|
180
|
+
badRequest: true
|
|
181
|
+
});
|
|
182
|
+
case 8:
|
|
183
|
+
case "end":
|
|
184
|
+
return _context3.stop();
|
|
191
185
|
}
|
|
192
186
|
}, _callee3);
|
|
193
187
|
})));
|
|
194
188
|
test('serverError', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee4() {
|
|
195
189
|
var _yield$updateSpace3, space, error;
|
|
196
190
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee4$(_context4) {
|
|
197
|
-
while (1) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
return _context4.stop();
|
|
225
|
-
}
|
|
191
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
192
|
+
case 0:
|
|
193
|
+
_axios["default"].put.mockRejectedValue((0, _createError["default"])('Request failed with status code 403', null, 403, null, {
|
|
194
|
+
status: 403,
|
|
195
|
+
statusText: 'Forbidden',
|
|
196
|
+
data: {}
|
|
197
|
+
}));
|
|
198
|
+
_context4.next = 3;
|
|
199
|
+
return (0, _space.updateSpace)({
|
|
200
|
+
space: {
|
|
201
|
+
name: 'Foo'
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
case 3:
|
|
205
|
+
_yield$updateSpace3 = _context4.sent;
|
|
206
|
+
space = _yield$updateSpace3.space;
|
|
207
|
+
error = _yield$updateSpace3.error;
|
|
208
|
+
expect(space).toBeUndefined();
|
|
209
|
+
expect(error).toEqual({
|
|
210
|
+
statusCode: 403,
|
|
211
|
+
message: 'Forbidden',
|
|
212
|
+
key: null,
|
|
213
|
+
forbidden: true
|
|
214
|
+
});
|
|
215
|
+
case 8:
|
|
216
|
+
case "end":
|
|
217
|
+
return _context4.stop();
|
|
226
218
|
}
|
|
227
219
|
}, _callee4);
|
|
228
220
|
})));
|
|
@@ -16,12 +16,9 @@ var _http = require("../http");
|
|
|
16
16
|
var _immutable = require("immutable");
|
|
17
17
|
// TODO: datastore is deprecated, remove datastore routes from paths.
|
|
18
18
|
|
|
19
|
-
var VALID_TIMELINES = ['closedAt', 'createdAt', 'submittedAt', 'updatedAt'];
|
|
20
|
-
exports.
|
|
21
|
-
var
|
|
22
|
-
exports.VALID_KAPP_CORE_STATES = VALID_KAPP_CORE_STATES;
|
|
23
|
-
var VALID_DS_CORE_STATES = ['Draft', 'Submitted'];
|
|
24
|
-
exports.VALID_DS_CORE_STATES = VALID_DS_CORE_STATES;
|
|
19
|
+
var VALID_TIMELINES = exports.VALID_TIMELINES = ['closedAt', 'createdAt', 'submittedAt', 'updatedAt'];
|
|
20
|
+
var VALID_KAPP_CORE_STATES = exports.VALID_KAPP_CORE_STATES = ['Draft', 'Submitted', 'Closed'];
|
|
21
|
+
var VALID_DS_CORE_STATES = exports.VALID_DS_CORE_STATES = ['Draft', 'Submitted'];
|
|
25
22
|
var getValidCoreStates = function getValidCoreStates() {
|
|
26
23
|
var datastore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
27
24
|
return datastore ? VALID_DS_CORE_STATES : VALID_KAPP_CORE_STATES;
|
|
@@ -30,7 +27,7 @@ var nullFix = function nullFix(val) {
|
|
|
30
27
|
var nullable = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
31
28
|
return nullable ? val === '' || val === null ? 'null' : "\"".concat(val, "\"") : val === null ? '""' : "\"".concat(val, "\"");
|
|
32
29
|
};
|
|
33
|
-
var SubmissionSearch = /*#__PURE__*/function () {
|
|
30
|
+
var SubmissionSearch = exports.SubmissionSearch = /*#__PURE__*/function () {
|
|
34
31
|
function SubmissionSearch() {
|
|
35
32
|
var datastore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
36
33
|
(0, _classCallCheck2["default"])(this, SubmissionSearch);
|
|
@@ -392,8 +389,7 @@ var SubmissionSearch = /*#__PURE__*/function () {
|
|
|
392
389
|
}]);
|
|
393
390
|
return SubmissionSearch;
|
|
394
391
|
}();
|
|
395
|
-
exports.
|
|
396
|
-
var searchSubmissions = function searchSubmissions(options) {
|
|
392
|
+
var searchSubmissions = exports.searchSubmissions = function searchSubmissions(options) {
|
|
397
393
|
var kapp = options.kapp,
|
|
398
394
|
form = options.form,
|
|
399
395
|
search = options.search,
|
|
@@ -440,8 +436,7 @@ var searchSubmissions = function searchSubmissions(options) {
|
|
|
440
436
|
promise = promise["catch"](_http.handleErrors);
|
|
441
437
|
return promise;
|
|
442
438
|
};
|
|
443
|
-
exports.
|
|
444
|
-
var fetchSubmission = function fetchSubmission(options) {
|
|
439
|
+
var fetchSubmission = exports.fetchSubmission = function fetchSubmission(options) {
|
|
445
440
|
var id = options.id;
|
|
446
441
|
if (!id) {
|
|
447
442
|
throw new Error('fetchSubmission failed! The option "id" is required.');
|
|
@@ -461,8 +456,7 @@ var fetchSubmission = function fetchSubmission(options) {
|
|
|
461
456
|
// cleans up any errors.
|
|
462
457
|
["catch"](_http.handleErrors);
|
|
463
458
|
};
|
|
464
|
-
exports.
|
|
465
|
-
var createSubmission = function createSubmission(options) {
|
|
459
|
+
var createSubmission = exports.createSubmission = function createSubmission(options) {
|
|
466
460
|
var _options$kappSlug = options.kappSlug,
|
|
467
461
|
kappSlug = _options$kappSlug === void 0 ? _helpers.bundle.kappSlug() : _options$kappSlug,
|
|
468
462
|
formSlug = options.formSlug,
|
|
@@ -498,8 +492,7 @@ var createSubmission = function createSubmission(options) {
|
|
|
498
492
|
// cleans up any errors.
|
|
499
493
|
["catch"](_http.handleErrors);
|
|
500
494
|
};
|
|
501
|
-
exports.
|
|
502
|
-
var updateSubmission = function updateSubmission(options) {
|
|
495
|
+
var updateSubmission = exports.updateSubmission = function updateSubmission(options) {
|
|
503
496
|
var id = options.id,
|
|
504
497
|
values = options.values;
|
|
505
498
|
var path = options.datastore ? "".concat(_helpers.bundle.apiLocation(), "/datastore/submissions/").concat(id) : "".concat(_helpers.bundle.apiLocation(), "/submissions/").concat(id);
|
|
@@ -520,8 +513,7 @@ var updateSubmission = function updateSubmission(options) {
|
|
|
520
513
|
// cleans up any errors.
|
|
521
514
|
["catch"](_http.handleErrors);
|
|
522
515
|
};
|
|
523
|
-
exports.
|
|
524
|
-
var saveSubmissionMultipart = function saveSubmissionMultipart(options) {
|
|
516
|
+
var saveSubmissionMultipart = exports.saveSubmissionMultipart = function saveSubmissionMultipart(options) {
|
|
525
517
|
var kappSlug = options.kappSlug,
|
|
526
518
|
formSlug = options.formSlug,
|
|
527
519
|
id = options.id,
|
|
@@ -565,8 +557,7 @@ var saveSubmissionMultipart = function saveSubmissionMultipart(options) {
|
|
|
565
557
|
};
|
|
566
558
|
})["catch"](_http.handleErrors);
|
|
567
559
|
};
|
|
568
|
-
exports.
|
|
569
|
-
var submitSubmission = function submitSubmission(options) {
|
|
560
|
+
var submitSubmission = exports.submitSubmission = function submitSubmission(options) {
|
|
570
561
|
var id = options.id,
|
|
571
562
|
values = options.values,
|
|
572
563
|
page = options.page,
|
|
@@ -594,8 +585,7 @@ var submitSubmission = function submitSubmission(options) {
|
|
|
594
585
|
// cleans up any errors.
|
|
595
586
|
["catch"](_http.handleErrors);
|
|
596
587
|
};
|
|
597
|
-
exports.
|
|
598
|
-
var deleteSubmission = function deleteSubmission(options) {
|
|
588
|
+
var deleteSubmission = exports.deleteSubmission = function deleteSubmission(options) {
|
|
599
589
|
var id = options.id;
|
|
600
590
|
if (!id) {
|
|
601
591
|
throw new Error('deleteSubmission failed! The option "id" is required.');
|
|
@@ -615,8 +605,7 @@ var deleteSubmission = function deleteSubmission(options) {
|
|
|
615
605
|
// cleans up any errors.
|
|
616
606
|
["catch"](_http.handleErrors);
|
|
617
607
|
};
|
|
618
|
-
exports.
|
|
619
|
-
var exportSubmissions = function exportSubmissions(options) {
|
|
608
|
+
var exportSubmissions = exports.exportSubmissions = function exportSubmissions(options) {
|
|
620
609
|
var kappSlug = options.kappSlug,
|
|
621
610
|
formSlug = options.formSlug,
|
|
622
611
|
onDownloadProgress = options.onDownloadProgress;
|
|
@@ -634,15 +623,12 @@ var exportSubmissions = function exportSubmissions(options) {
|
|
|
634
623
|
responseType: 'blob'
|
|
635
624
|
});
|
|
636
625
|
};
|
|
637
|
-
exports.
|
|
638
|
-
var
|
|
639
|
-
exports.MODE_IMPORT = MODE_IMPORT;
|
|
640
|
-
var MODE_BULK = 'bulk';
|
|
641
|
-
exports.MODE_BULK = MODE_BULK;
|
|
626
|
+
var MODE_IMPORT = exports.MODE_IMPORT = 'import';
|
|
627
|
+
var MODE_BULK = exports.MODE_BULK = 'bulk';
|
|
642
628
|
var modeToFn = function modeToFn(mode) {
|
|
643
629
|
return mode === MODE_BULK ? 'post' : 'patch';
|
|
644
630
|
};
|
|
645
|
-
var importSubmissionStatus = function importSubmissionStatus(options) {
|
|
631
|
+
var importSubmissionStatus = exports.importSubmissionStatus = function importSubmissionStatus(options) {
|
|
646
632
|
var kappSlug = options.kappSlug,
|
|
647
633
|
formSlug = options.formSlug,
|
|
648
634
|
jobId = options.jobId;
|
|
@@ -656,8 +642,7 @@ var importSubmissionStatus = function importSubmissionStatus(options) {
|
|
|
656
642
|
};
|
|
657
643
|
})["catch"](_http.handleErrors);
|
|
658
644
|
};
|
|
659
|
-
exports.
|
|
660
|
-
var importSubmissions = function importSubmissions(options) {
|
|
645
|
+
var importSubmissions = exports.importSubmissions = function importSubmissions(options) {
|
|
661
646
|
var kappSlug = options.kappSlug,
|
|
662
647
|
formSlug = options.formSlug,
|
|
663
648
|
onUploadProgress = options.onUploadProgress,
|
|
@@ -692,5 +677,4 @@ var importSubmissions = function importSubmissions(options) {
|
|
|
692
677
|
return (0, _http.handleErrors)(error);
|
|
693
678
|
}
|
|
694
679
|
});
|
|
695
|
-
};
|
|
696
|
-
exports.importSubmissions = importSubmissions;
|
|
680
|
+
};
|
package/lib/apis/core/teams.js
CHANGED
|
@@ -9,7 +9,7 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/
|
|
|
9
9
|
var _axios = _interopRequireDefault(require("axios"));
|
|
10
10
|
var _helpers = require("../../helpers");
|
|
11
11
|
var _http = require("../http");
|
|
12
|
-
var fetchTeams = function fetchTeams() {
|
|
12
|
+
var fetchTeams = exports.fetchTeams = function fetchTeams() {
|
|
13
13
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
14
14
|
// Build URL and fetch the space.
|
|
15
15
|
return _axios["default"].get("".concat(_helpers.bundle.apiLocation(), "/teams"), {
|
|
@@ -25,8 +25,7 @@ var fetchTeams = function fetchTeams() {
|
|
|
25
25
|
};
|
|
26
26
|
})["catch"](_http.handleErrors);
|
|
27
27
|
};
|
|
28
|
-
exports.
|
|
29
|
-
var fetchTeam = function fetchTeam() {
|
|
28
|
+
var fetchTeam = exports.fetchTeam = function fetchTeam() {
|
|
30
29
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
31
30
|
var teamSlug = options.teamSlug;
|
|
32
31
|
if (!teamSlug) {
|
|
@@ -43,8 +42,7 @@ var fetchTeam = function fetchTeam() {
|
|
|
43
42
|
};
|
|
44
43
|
})["catch"](_http.handleErrors);
|
|
45
44
|
};
|
|
46
|
-
exports.
|
|
47
|
-
var updateTeam = function updateTeam() {
|
|
45
|
+
var updateTeam = exports.updateTeam = function updateTeam() {
|
|
48
46
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
49
47
|
var teamSlug = options.teamSlug,
|
|
50
48
|
team = options.team;
|
|
@@ -65,8 +63,7 @@ var updateTeam = function updateTeam() {
|
|
|
65
63
|
};
|
|
66
64
|
})["catch"](_http.handleErrors);
|
|
67
65
|
};
|
|
68
|
-
exports.
|
|
69
|
-
var createTeam = function createTeam() {
|
|
66
|
+
var createTeam = exports.createTeam = function createTeam() {
|
|
70
67
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
71
68
|
var team = options.team;
|
|
72
69
|
if (!team) {
|
|
@@ -83,8 +80,7 @@ var createTeam = function createTeam() {
|
|
|
83
80
|
};
|
|
84
81
|
})["catch"](_http.handleErrors);
|
|
85
82
|
};
|
|
86
|
-
exports.
|
|
87
|
-
var deleteTeam = function deleteTeam() {
|
|
83
|
+
var deleteTeam = exports.deleteTeam = function deleteTeam() {
|
|
88
84
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
89
85
|
var teamSlug = options.teamSlug;
|
|
90
86
|
if (!teamSlug) {
|
|
@@ -100,5 +96,4 @@ var deleteTeam = function deleteTeam() {
|
|
|
100
96
|
team: response.data.team
|
|
101
97
|
};
|
|
102
98
|
})["catch"](_http.handleErrors);
|
|
103
|
-
};
|
|
104
|
-
exports.deleteTeam = deleteTeam;
|
|
99
|
+
};
|
|
@@ -20,7 +20,7 @@ var validateOptions = function validateOptions(functionName, requiredOptions, op
|
|
|
20
20
|
throw new Error("".concat(functionName, " failed! The following required options are missing: ").concat(missing));
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
var fetchAvailableLocales = function fetchAvailableLocales() {
|
|
23
|
+
var fetchAvailableLocales = exports.fetchAvailableLocales = function fetchAvailableLocales() {
|
|
24
24
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
25
25
|
var paramModifier = function paramModifier(params) {
|
|
26
26
|
return options.localeCode ? (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, params), {}, {
|
|
@@ -36,8 +36,7 @@ var fetchAvailableLocales = function fetchAvailableLocales() {
|
|
|
36
36
|
};
|
|
37
37
|
})["catch"](_http.handleErrors);
|
|
38
38
|
};
|
|
39
|
-
exports.
|
|
40
|
-
var clearTranslationsCache = function clearTranslationsCache() {
|
|
39
|
+
var clearTranslationsCache = exports.clearTranslationsCache = function clearTranslationsCache() {
|
|
41
40
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
42
41
|
return _axios["default"]["delete"]("".concat(getEndpointPrefix(), "/cache"), {
|
|
43
42
|
params: (0, _http.paramBuilder)(options),
|
|
@@ -48,8 +47,7 @@ var clearTranslationsCache = function clearTranslationsCache() {
|
|
|
48
47
|
};
|
|
49
48
|
})["catch"](_http.handleErrors);
|
|
50
49
|
};
|
|
51
|
-
exports.
|
|
52
|
-
var fetchStagedTranslations = function fetchStagedTranslations() {
|
|
50
|
+
var fetchStagedTranslations = exports.fetchStagedTranslations = function fetchStagedTranslations() {
|
|
53
51
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
54
52
|
var paramModifier = function paramModifier(params) {
|
|
55
53
|
return options.contextName ? (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, params), {}, {
|
|
@@ -65,8 +63,7 @@ var fetchStagedTranslations = function fetchStagedTranslations() {
|
|
|
65
63
|
};
|
|
66
64
|
})["catch"](_http.handleErrors);
|
|
67
65
|
};
|
|
68
|
-
exports.
|
|
69
|
-
var fetchDefaultLocale = function fetchDefaultLocale() {
|
|
66
|
+
var fetchDefaultLocale = exports.fetchDefaultLocale = function fetchDefaultLocale() {
|
|
70
67
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
71
68
|
return _axios["default"].get("".concat(getEndpointPrefix(), "/settings/defaultLocale"), {
|
|
72
69
|
params: (0, _http.paramBuilder)(options),
|
|
@@ -77,8 +74,7 @@ var fetchDefaultLocale = function fetchDefaultLocale() {
|
|
|
77
74
|
};
|
|
78
75
|
})["catch"](_http.handleErrors);
|
|
79
76
|
};
|
|
80
|
-
exports.
|
|
81
|
-
var setDefaultLocale = function setDefaultLocale() {
|
|
77
|
+
var setDefaultLocale = exports.setDefaultLocale = function setDefaultLocale() {
|
|
82
78
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
83
79
|
validateOptions('setDefaultLocale', ['localeCode'], options);
|
|
84
80
|
return _axios["default"].put("".concat(getEndpointPrefix(), "/settings/defaultLocale"), {
|
|
@@ -92,8 +88,7 @@ var setDefaultLocale = function setDefaultLocale() {
|
|
|
92
88
|
};
|
|
93
89
|
})["catch"](_http.handleErrors);
|
|
94
90
|
};
|
|
95
|
-
exports.
|
|
96
|
-
var fetchEnabledLocales = function fetchEnabledLocales() {
|
|
91
|
+
var fetchEnabledLocales = exports.fetchEnabledLocales = function fetchEnabledLocales() {
|
|
97
92
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
98
93
|
return _axios["default"].get("".concat(getEndpointPrefix(), "/settings/locales"), {
|
|
99
94
|
params: (0, _http.paramBuilder)(options),
|
|
@@ -104,8 +99,7 @@ var fetchEnabledLocales = function fetchEnabledLocales() {
|
|
|
104
99
|
};
|
|
105
100
|
})["catch"](_http.handleErrors);
|
|
106
101
|
};
|
|
107
|
-
exports.
|
|
108
|
-
var enableLocale = function enableLocale() {
|
|
102
|
+
var enableLocale = exports.enableLocale = function enableLocale() {
|
|
109
103
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
110
104
|
validateOptions('enableLocale', ['localeCode'], options);
|
|
111
105
|
return _axios["default"].post("".concat(getEndpointPrefix(), "/settings/locales"), {
|
|
@@ -119,8 +113,7 @@ var enableLocale = function enableLocale() {
|
|
|
119
113
|
};
|
|
120
114
|
})["catch"](_http.handleErrors);
|
|
121
115
|
};
|
|
122
|
-
exports.
|
|
123
|
-
var disableLocale = function disableLocale() {
|
|
116
|
+
var disableLocale = exports.disableLocale = function disableLocale() {
|
|
124
117
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
125
118
|
validateOptions('disableLocale', ['localeCode'], options);
|
|
126
119
|
return _axios["default"]["delete"]("".concat(getEndpointPrefix(), "/settings/locales/").concat(options.localeCode), {
|
|
@@ -132,8 +125,7 @@ var disableLocale = function disableLocale() {
|
|
|
132
125
|
};
|
|
133
126
|
})["catch"](_http.handleErrors);
|
|
134
127
|
};
|
|
135
|
-
exports.
|
|
136
|
-
var fetchContexts = function fetchContexts() {
|
|
128
|
+
var fetchContexts = exports.fetchContexts = function fetchContexts() {
|
|
137
129
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
138
130
|
var paramModifier = function paramModifier(params) {
|
|
139
131
|
if (options.custom) {
|
|
@@ -167,8 +159,7 @@ var fetchContexts = function fetchContexts() {
|
|
|
167
159
|
};
|
|
168
160
|
})["catch"](_http.handleErrors);
|
|
169
161
|
};
|
|
170
|
-
exports.
|
|
171
|
-
var createContext = function createContext() {
|
|
162
|
+
var createContext = exports.createContext = function createContext() {
|
|
172
163
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
173
164
|
validateOptions('createContext', ['context'], options);
|
|
174
165
|
return _axios["default"].post("".concat(getEndpointPrefix(), "/contexts"), options.context, {
|
|
@@ -180,8 +171,7 @@ var createContext = function createContext() {
|
|
|
180
171
|
};
|
|
181
172
|
})["catch"](_http.handleErrors);
|
|
182
173
|
};
|
|
183
|
-
exports.
|
|
184
|
-
var updateContext = function updateContext() {
|
|
174
|
+
var updateContext = exports.updateContext = function updateContext() {
|
|
185
175
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
186
176
|
validateOptions('updateContext', ['contextName', 'context'], options);
|
|
187
177
|
return _axios["default"].put("".concat(getEndpointPrefix(), "/contexts/").concat(options.contextName), options.context, {
|
|
@@ -193,8 +183,7 @@ var updateContext = function updateContext() {
|
|
|
193
183
|
};
|
|
194
184
|
})["catch"](_http.handleErrors);
|
|
195
185
|
};
|
|
196
|
-
exports.
|
|
197
|
-
var deleteContext = function deleteContext() {
|
|
186
|
+
var deleteContext = exports.deleteContext = function deleteContext() {
|
|
198
187
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
199
188
|
validateOptions('deleteContext', ['contextName'], options);
|
|
200
189
|
return _axios["default"]["delete"]("".concat(getEndpointPrefix(), "/contexts/").concat(options.contextName), {
|
|
@@ -206,8 +195,7 @@ var deleteContext = function deleteContext() {
|
|
|
206
195
|
};
|
|
207
196
|
})["catch"](_http.handleErrors);
|
|
208
197
|
};
|
|
209
|
-
exports.
|
|
210
|
-
var fetchContextKeys = function fetchContextKeys() {
|
|
198
|
+
var fetchContextKeys = exports.fetchContextKeys = function fetchContextKeys() {
|
|
211
199
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
212
200
|
validateOptions('fetchContextKeys', ['contextName'], options);
|
|
213
201
|
return _axios["default"].get("".concat(getEndpointPrefix(), "/contexts/").concat(options.contextName, "/keys"), {
|
|
@@ -219,8 +207,7 @@ var fetchContextKeys = function fetchContextKeys() {
|
|
|
219
207
|
};
|
|
220
208
|
})["catch"](_http.handleErrors);
|
|
221
209
|
};
|
|
222
|
-
exports.
|
|
223
|
-
var updateContextKey = function updateContextKey() {
|
|
210
|
+
var updateContextKey = exports.updateContextKey = function updateContextKey() {
|
|
224
211
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
225
212
|
validateOptions('updateContextKey', ['contextName', 'keyHash', 'key'], options);
|
|
226
213
|
return _axios["default"].put("".concat(getEndpointPrefix(), "/contexts/").concat(options.contextName, "/keys/").concat(options.keyHash), options.key, {
|
|
@@ -232,8 +219,7 @@ var updateContextKey = function updateContextKey() {
|
|
|
232
219
|
};
|
|
233
220
|
})["catch"](_http.handleErrors);
|
|
234
221
|
};
|
|
235
|
-
exports.
|
|
236
|
-
var fetchTranslations = function fetchTranslations() {
|
|
222
|
+
var fetchTranslations = exports.fetchTranslations = function fetchTranslations() {
|
|
237
223
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
238
224
|
if (options.cache) {
|
|
239
225
|
validateOptions('fetchTranslations', ['contextName', 'localeCode'], options);
|
|
@@ -269,8 +255,7 @@ var fetchTranslations = function fetchTranslations() {
|
|
|
269
255
|
};
|
|
270
256
|
})["catch"](_http.handleErrors);
|
|
271
257
|
};
|
|
272
|
-
exports.
|
|
273
|
-
var upsertTranslations = function upsertTranslations() {
|
|
258
|
+
var upsertTranslations = exports.upsertTranslations = function upsertTranslations() {
|
|
274
259
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
275
260
|
var data = null;
|
|
276
261
|
if (options["import"]) {
|
|
@@ -303,8 +288,7 @@ var upsertTranslations = function upsertTranslations() {
|
|
|
303
288
|
};
|
|
304
289
|
})["catch"](_http.handleErrors);
|
|
305
290
|
};
|
|
306
|
-
exports.
|
|
307
|
-
var deleteTranslations = function deleteTranslations() {
|
|
291
|
+
var deleteTranslations = exports.deleteTranslations = function deleteTranslations() {
|
|
308
292
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
309
293
|
if (options.keyHash) {
|
|
310
294
|
validateOptions('deleteTranslations', ['contextName'], options);
|
|
@@ -330,5 +314,4 @@ var deleteTranslations = function deleteTranslations() {
|
|
|
330
314
|
message: response.data.message
|
|
331
315
|
};
|
|
332
316
|
})["catch"](_http.handleErrors);
|
|
333
|
-
};
|
|
334
|
-
exports.deleteTranslations = deleteTranslations;
|
|
317
|
+
};
|