@kineticdata/react 6.0.1 → 6.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +86 -0
- 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 +19 -35
- 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 +16 -31
- package/lib/apis/system/index.js +46 -91
- package/lib/apis/task/index.js +60 -119
- package/lib/components/agent/bridge/BridgeForm.js +1 -2
- package/lib/components/agent/bridge/BridgeTable.js +1 -2
- package/lib/components/agent/filestore/FilestoreForm.js +1 -2
- package/lib/components/agent/filestore/FilestoreTable.js +1 -2
- package/lib/components/agent/handler/AgentHandlerForm.js +1 -2
- package/lib/components/agent/handler/AgentHandlerTable.js +1 -2
- 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 +7 -12
- 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 +1 -2
- package/lib/components/common/defaults/index.js +2 -3
- package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +1 -2
- package/lib/components/core/attribute_definition/AttributeDefinitionTable.js +1 -2
- package/lib/components/core/bridge_model/BridgeModelForm.js +52 -55
- package/lib/components/core/bridge_model/BridgeModelTable.js +1 -2
- 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 +1 -2
- 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 +2 -4
- 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 +4 -4
- package/lib/components/core/form/FormTable.js +1 -2
- package/lib/components/core/form_type/FormTypeForm.js +1 -2
- package/lib/components/core/form_type/FormTypeTable.js +1 -2
- 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 +1 -2
- 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 +1 -2
- package/lib/components/core/log/LogTable.js +2 -4
- 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 +1 -2
- 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 +2 -4
- package/lib/components/core/submission/KappSubmissionTable.js +2 -4
- 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 +1 -2
- package/lib/components/core/team/TeamTable.js +1 -2
- 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 +1 -2
- package/lib/components/core/webapi/WebApiForm.js +97 -101
- package/lib/components/core/webapi/WebApiTable.js +1 -2
- package/lib/components/core/webhook/WebhookForm.js +1 -2
- package/lib/components/core/webhook/WebhookTable.js +1 -2
- package/lib/components/core/webhook_job/WebhookJobTable.js +1 -2
- package/lib/components/form/Form.helpers.js +10 -19
- package/lib/components/form/Form.js +312 -355
- package/lib/components/form/Form.models.js +6 -11
- package/lib/components/form/FormState.js +3 -3
- 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 +4354 -4508
- package/lib/components/form/tests/components.js +73 -64
- package/lib/components/index.js +7 -0
- package/lib/components/system/SystemBackgroundTasksTable.js +1 -2
- package/lib/components/system/SystemCassandraForm.js +1 -2
- package/lib/components/system/SystemElasticSearchForm.js +1 -2
- package/lib/components/system/SystemFilestoreForm.js +2 -3
- package/lib/components/system/SystemForm.js +1 -2
- package/lib/components/system/SystemIngressForm.js +1 -2
- package/lib/components/system/SystemSecurityForm.js +1 -2
- package/lib/components/system/SystemSmtpForm.js +1 -2
- package/lib/components/system/SystemTaskAdapterForm.js +1 -2
- package/lib/components/system/SystemTrustedCertificateForm.js +1 -2
- package/lib/components/system/SystemTrustedCertificatesTable.js +1 -2
- package/lib/components/system/SystemUserForm.js +1 -2
- package/lib/components/system/helpers.js +11 -21
- package/lib/components/system/spaces/SystemSpaceForm.js +2 -3
- package/lib/components/system/spaces/SystemTenantForm.js +2 -3
- package/lib/components/system/spaces/SystemTenantTable.js +1 -2
- package/lib/components/table/Table.js +48 -51
- package/lib/components/table/Table.redux.js +161 -188
- package/lib/components/table/Table.test.js +115 -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 +1 -2
- 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 +2 -3
- package/lib/components/table/tests/Table.redux.test.js +162 -0
- package/lib/components/table/tests/Table.test.js +767 -0
- package/lib/components/table/tests/components.js +182 -0
- 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 +14 -5
- package/lib/components/task/builder/builder.redux.js +187 -186
- 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 +24 -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 +2 -3
- 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 +1 -2
- 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 +2 -3
- 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 +1 -2
- package/lib/components/task/triggers/TriggerTable.js +2 -3
- package/lib/components/task/workflows/LinkedWorkflowForm.js +3 -5
- package/lib/components/task/workflows/LinkedWorkflowTable.js +1 -2
- package/lib/components/task/workflows/MissingRoutineTable.js +1 -2
- package/lib/components/task/workflows/WorkflowForm.js +91 -41
- package/lib/components/task/workflows/WorkflowTable.js +1 -2
- package/lib/helpers/SearchBuilder.js +2 -4
- package/lib/helpers/index.js +13 -26
- package/lib/index.js +3 -6
- package/lib/reducer.js +3 -5
- package/lib/saga.js +32 -48
- package/lib/store.js +32 -42
- package/package.json +12 -15
- package/lib/components/core/CoreFormModal.js +0 -64
- package/lib/components/core/CoreModal.js +0 -114
|
@@ -142,94 +142,90 @@ describe('kapps api', function () {
|
|
|
142
142
|
test('success', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee() {
|
|
143
143
|
var _yield$updateKapp, kapp, error;
|
|
144
144
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee$(_context) {
|
|
145
|
-
while (1) {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
data: {
|
|
151
|
-
kapp: {
|
|
152
|
-
name: 'Test',
|
|
153
|
-
attributes: [{
|
|
154
|
-
name: 'Company Name',
|
|
155
|
-
values: ['Foo Bar']
|
|
156
|
-
}]
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
_context.next = 3;
|
|
161
|
-
return (0, _kapps.updateKapp)({
|
|
162
|
-
kappSlug: 'catalog',
|
|
145
|
+
while (1) switch (_context.prev = _context.next) {
|
|
146
|
+
case 0:
|
|
147
|
+
_axios["default"].put.mockResolvedValue({
|
|
148
|
+
status: 200,
|
|
149
|
+
data: {
|
|
163
150
|
kapp: {
|
|
164
151
|
name: 'Test',
|
|
165
152
|
attributes: [{
|
|
166
153
|
name: 'Company Name',
|
|
167
154
|
values: ['Foo Bar']
|
|
168
155
|
}]
|
|
169
|
-
},
|
|
170
|
-
include: 'attributes'
|
|
171
|
-
});
|
|
172
|
-
case 3:
|
|
173
|
-
_yield$updateKapp = _context.sent;
|
|
174
|
-
kapp = _yield$updateKapp.kapp;
|
|
175
|
-
error = _yield$updateKapp.error;
|
|
176
|
-
expect(_axios["default"].put.mock.calls).toEqual([['kapp/app/api/v1/kapps/catalog', {
|
|
177
|
-
name: 'Test',
|
|
178
|
-
attributes: [{
|
|
179
|
-
name: 'Company Name',
|
|
180
|
-
values: ['Foo Bar']
|
|
181
|
-
}]
|
|
182
|
-
}, {
|
|
183
|
-
params: {
|
|
184
|
-
include: 'attributes'
|
|
185
|
-
},
|
|
186
|
-
headers: {
|
|
187
|
-
'X-Kinetic-AuthAssumed': 'true'
|
|
188
156
|
}
|
|
189
|
-
}
|
|
190
|
-
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
_context.next = 3;
|
|
160
|
+
return (0, _kapps.updateKapp)({
|
|
161
|
+
kappSlug: 'catalog',
|
|
162
|
+
kapp: {
|
|
191
163
|
name: 'Test',
|
|
192
164
|
attributes: [{
|
|
193
165
|
name: 'Company Name',
|
|
194
166
|
values: ['Foo Bar']
|
|
195
167
|
}]
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
168
|
+
},
|
|
169
|
+
include: 'attributes'
|
|
170
|
+
});
|
|
171
|
+
case 3:
|
|
172
|
+
_yield$updateKapp = _context.sent;
|
|
173
|
+
kapp = _yield$updateKapp.kapp;
|
|
174
|
+
error = _yield$updateKapp.error;
|
|
175
|
+
expect(_axios["default"].put.mock.calls).toEqual([['kapp/app/api/v1/kapps/catalog', {
|
|
176
|
+
name: 'Test',
|
|
177
|
+
attributes: [{
|
|
178
|
+
name: 'Company Name',
|
|
179
|
+
values: ['Foo Bar']
|
|
180
|
+
}]
|
|
181
|
+
}, {
|
|
182
|
+
params: {
|
|
183
|
+
include: 'attributes'
|
|
184
|
+
},
|
|
185
|
+
headers: {
|
|
186
|
+
'X-Kinetic-AuthAssumed': 'true'
|
|
187
|
+
}
|
|
188
|
+
}]]);
|
|
189
|
+
expect(kapp).toEqual({
|
|
190
|
+
name: 'Test',
|
|
191
|
+
attributes: [{
|
|
192
|
+
name: 'Company Name',
|
|
193
|
+
values: ['Foo Bar']
|
|
194
|
+
}]
|
|
195
|
+
});
|
|
196
|
+
expect(error).toBeUndefined();
|
|
197
|
+
case 9:
|
|
198
|
+
case "end":
|
|
199
|
+
return _context.stop();
|
|
202
200
|
}
|
|
203
201
|
}, _callee);
|
|
204
202
|
})));
|
|
205
203
|
test('defaults to bundle.kappSlug() when no kappSlug provided', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee2() {
|
|
206
204
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee2$(_context2) {
|
|
207
|
-
while (1) {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
kapp: {
|
|
217
|
-
name: 'Test'
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
case 3:
|
|
221
|
-
expect(_axios["default"].put.mock.calls).toEqual([['kapp/app/api/v1/kapps/mock-kapp', {
|
|
205
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
206
|
+
case 0:
|
|
207
|
+
_axios["default"].put.mockResolvedValue({
|
|
208
|
+
status: 200,
|
|
209
|
+
data: {}
|
|
210
|
+
});
|
|
211
|
+
_context2.next = 3;
|
|
212
|
+
return (0, _kapps.updateKapp)({
|
|
213
|
+
kapp: {
|
|
222
214
|
name: 'Test'
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
case 3:
|
|
218
|
+
expect(_axios["default"].put.mock.calls).toEqual([['kapp/app/api/v1/kapps/mock-kapp', {
|
|
219
|
+
name: 'Test'
|
|
220
|
+
}, {
|
|
221
|
+
params: {},
|
|
222
|
+
headers: {
|
|
223
|
+
'X-Kinetic-AuthAssumed': 'true'
|
|
224
|
+
}
|
|
225
|
+
}]]);
|
|
226
|
+
case 4:
|
|
227
|
+
case "end":
|
|
228
|
+
return _context2.stop();
|
|
233
229
|
}
|
|
234
230
|
}, _callee2);
|
|
235
231
|
})));
|
|
@@ -251,72 +247,68 @@ describe('kapps api', function () {
|
|
|
251
247
|
test('bad request', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee3() {
|
|
252
248
|
var _yield$updateKapp2, kapp, error;
|
|
253
249
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee3$(_context3) {
|
|
254
|
-
while (1) {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
return _context3.stop();
|
|
284
|
-
}
|
|
250
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
251
|
+
case 0:
|
|
252
|
+
_axios["default"].put.mockRejectedValue((0, _createError["default"])('Request failed with status code 400', null, 400, null, {
|
|
253
|
+
status: 400,
|
|
254
|
+
statusText: 'Bad Request',
|
|
255
|
+
data: {
|
|
256
|
+
error: 'Invalid kapp'
|
|
257
|
+
}
|
|
258
|
+
}));
|
|
259
|
+
_context3.next = 3;
|
|
260
|
+
return (0, _kapps.updateKapp)({
|
|
261
|
+
kapp: {
|
|
262
|
+
name: null
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
case 3:
|
|
266
|
+
_yield$updateKapp2 = _context3.sent;
|
|
267
|
+
kapp = _yield$updateKapp2.kapp;
|
|
268
|
+
error = _yield$updateKapp2.error;
|
|
269
|
+
expect(kapp).toBeUndefined();
|
|
270
|
+
expect(error).toEqual({
|
|
271
|
+
statusCode: 400,
|
|
272
|
+
key: null,
|
|
273
|
+
badRequest: true,
|
|
274
|
+
message: 'Invalid kapp'
|
|
275
|
+
});
|
|
276
|
+
case 8:
|
|
277
|
+
case "end":
|
|
278
|
+
return _context3.stop();
|
|
285
279
|
}
|
|
286
280
|
}, _callee3);
|
|
287
281
|
})));
|
|
288
282
|
test('forbidden', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee4() {
|
|
289
283
|
var _yield$updateKapp3, kapp, error;
|
|
290
284
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee4$(_context4) {
|
|
291
|
-
while (1) {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
return _context4.stop();
|
|
319
|
-
}
|
|
285
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
286
|
+
case 0:
|
|
287
|
+
_axios["default"].put.mockRejectedValue((0, _createError["default"])('Request failed with status code 403', null, 403, null, {
|
|
288
|
+
status: 403,
|
|
289
|
+
statusText: 'Forbidden',
|
|
290
|
+
data: {}
|
|
291
|
+
}));
|
|
292
|
+
_context4.next = 3;
|
|
293
|
+
return (0, _kapps.updateKapp)({
|
|
294
|
+
kapp: {
|
|
295
|
+
name: 'Foo'
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
case 3:
|
|
299
|
+
_yield$updateKapp3 = _context4.sent;
|
|
300
|
+
kapp = _yield$updateKapp3.kapp;
|
|
301
|
+
error = _yield$updateKapp3.error;
|
|
302
|
+
expect(kapp).toBeUndefined();
|
|
303
|
+
expect(error).toEqual({
|
|
304
|
+
statusCode: 403,
|
|
305
|
+
key: null,
|
|
306
|
+
forbidden: true,
|
|
307
|
+
message: 'Forbidden'
|
|
308
|
+
});
|
|
309
|
+
case 8:
|
|
310
|
+
case "end":
|
|
311
|
+
return _context4.stop();
|
|
320
312
|
}
|
|
321
313
|
}, _callee4);
|
|
322
314
|
})));
|
package/lib/apis/core/logs.js
CHANGED
|
@@ -16,7 +16,7 @@ var parseNDLog = function parseNDLog(logLine) {
|
|
|
16
16
|
}
|
|
17
17
|
return {};
|
|
18
18
|
};
|
|
19
|
-
var fetchLogsVersion = function fetchLogsVersion() {
|
|
19
|
+
var fetchLogsVersion = exports.fetchLogsVersion = function fetchLogsVersion() {
|
|
20
20
|
return _axios["default"].get("".concat(_helpers.bundle.spaceLocation(), "/app/loghub/api/v1/version"), {}).then(function (response) {
|
|
21
21
|
return response.data;
|
|
22
22
|
})["catch"](function (response) {
|
|
@@ -25,8 +25,7 @@ var fetchLogsVersion = function fetchLogsVersion() {
|
|
|
25
25
|
};
|
|
26
26
|
});
|
|
27
27
|
};
|
|
28
|
-
exports.
|
|
29
|
-
var fetchLogs = function fetchLogs() {
|
|
28
|
+
var fetchLogs = exports.fetchLogs = function fetchLogs() {
|
|
30
29
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
31
30
|
var format = options.format || 'ndjson';
|
|
32
31
|
return _axios["default"].get("".concat(_helpers.bundle.spaceLocation(), "/app/loghub/api/v1/logs"), {
|
|
@@ -66,5 +65,4 @@ var fetchLogs = function fetchLogs() {
|
|
|
66
65
|
logs: logs
|
|
67
66
|
};
|
|
68
67
|
})["catch"](_http.handleErrors);
|
|
69
|
-
};
|
|
70
|
-
exports.fetchLogs = fetchLogs;
|
|
68
|
+
};
|
|
@@ -8,7 +8,7 @@ exports.deleteMembership = exports.createMembership = void 0;
|
|
|
8
8
|
var _axios = _interopRequireDefault(require("axios"));
|
|
9
9
|
var _helpers = require("../../helpers");
|
|
10
10
|
var _http = require("../http");
|
|
11
|
-
var createMembership = function createMembership() {
|
|
11
|
+
var createMembership = exports.createMembership = function createMembership() {
|
|
12
12
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
13
13
|
var team = options.team,
|
|
14
14
|
user = options.user;
|
|
@@ -29,8 +29,7 @@ var createMembership = function createMembership() {
|
|
|
29
29
|
};
|
|
30
30
|
})["catch"](_http.handleErrors);
|
|
31
31
|
};
|
|
32
|
-
exports.
|
|
33
|
-
var deleteMembership = function deleteMembership() {
|
|
32
|
+
var deleteMembership = exports.deleteMembership = function deleteMembership() {
|
|
34
33
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
35
34
|
var teamSlug = options.teamSlug,
|
|
36
35
|
username = options.username;
|
|
@@ -43,5 +42,4 @@ var deleteMembership = function deleteMembership() {
|
|
|
43
42
|
return _axios["default"]["delete"]("".concat(_helpers.bundle.apiLocation(), "/memberships/").concat(teamSlug, "_").concat(username), {
|
|
44
43
|
params: (0, _http.paramBuilder)(options)
|
|
45
44
|
})["catch"](_http.handleErrors);
|
|
46
|
-
};
|
|
47
|
-
exports.deleteMembership = deleteMembership;
|
|
45
|
+
};
|
package/lib/apis/core/meta.js
CHANGED
|
@@ -8,15 +8,13 @@ exports.fetchTimezones = exports.fetchSpaceWebhookEvents = exports.fetchSpaMeta
|
|
|
8
8
|
var _axios = _interopRequireDefault(require("axios"));
|
|
9
9
|
var _helpers = require("../../helpers");
|
|
10
10
|
var _http = require("../http");
|
|
11
|
-
var fetchLocales = function fetchLocales() {
|
|
11
|
+
var fetchLocales = exports.fetchLocales = function fetchLocales() {
|
|
12
12
|
return _axios["default"].get("".concat(_helpers.bundle.apiLocation(), "/meta/locales"));
|
|
13
13
|
};
|
|
14
|
-
exports.
|
|
15
|
-
var fetchTimezones = function fetchTimezones() {
|
|
14
|
+
var fetchTimezones = exports.fetchTimezones = function fetchTimezones() {
|
|
16
15
|
return _axios["default"].get("".concat(_helpers.bundle.apiLocation(), "/meta/timezones"));
|
|
17
16
|
};
|
|
18
|
-
exports.
|
|
19
|
-
var fetchSpaceWebhookEvents = function fetchSpaceWebhookEvents() {
|
|
17
|
+
var fetchSpaceWebhookEvents = exports.fetchSpaceWebhookEvents = function fetchSpaceWebhookEvents() {
|
|
20
18
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
21
19
|
return _axios["default"].get("".concat(_helpers.bundle.apiLocation(), "/meta/webhooks/events/space"), {
|
|
22
20
|
headers: (0, _http.headerBuilder)(options)
|
|
@@ -24,8 +22,7 @@ var fetchSpaceWebhookEvents = function fetchSpaceWebhookEvents() {
|
|
|
24
22
|
return response.data;
|
|
25
23
|
})["catch"](_http.handleErrors);
|
|
26
24
|
};
|
|
27
|
-
exports.
|
|
28
|
-
var fetchKappWebhookEvents = function fetchKappWebhookEvents() {
|
|
25
|
+
var fetchKappWebhookEvents = exports.fetchKappWebhookEvents = function fetchKappWebhookEvents() {
|
|
29
26
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
30
27
|
return _axios["default"].get("".concat(_helpers.bundle.apiLocation(), "/meta/webhooks/events/kapp"), {
|
|
31
28
|
headers: (0, _http.headerBuilder)(options)
|
|
@@ -33,8 +30,7 @@ var fetchKappWebhookEvents = function fetchKappWebhookEvents() {
|
|
|
33
30
|
return response.data;
|
|
34
31
|
})["catch"](_http.handleErrors);
|
|
35
32
|
};
|
|
36
|
-
exports.
|
|
37
|
-
var fetchSpaMeta = function fetchSpaMeta() {
|
|
33
|
+
var fetchSpaMeta = exports.fetchSpaMeta = function fetchSpaMeta() {
|
|
38
34
|
return _axios["default"].get("".concat(_helpers.bundle.apiLocation(), "/meta/spa"), {
|
|
39
35
|
__bypassInitInterceptor: true,
|
|
40
36
|
headers: {
|
|
@@ -43,5 +39,4 @@ var fetchSpaMeta = function fetchSpaMeta() {
|
|
|
43
39
|
}).then(function (response) {
|
|
44
40
|
return response.data;
|
|
45
41
|
})["catch"](_http.handleErrors);
|
|
46
|
-
};
|
|
47
|
-
exports.fetchSpaMeta = fetchSpaMeta;
|
|
42
|
+
};
|
package/lib/apis/core/notices.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.fetchNotices = void 0;
|
|
|
8
8
|
var _axios = _interopRequireDefault(require("axios"));
|
|
9
9
|
var _helpers = require("../../helpers");
|
|
10
10
|
var _http = require("../http");
|
|
11
|
-
var fetchNotices = function fetchNotices() {
|
|
11
|
+
var fetchNotices = exports.fetchNotices = function fetchNotices() {
|
|
12
12
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
13
13
|
return _axios["default"].get(_helpers.bundle.apiLocation() + '/notices', {
|
|
14
14
|
params: (0, _http.paramBuilder)(options),
|
|
@@ -18,5 +18,4 @@ var fetchNotices = function fetchNotices() {
|
|
|
18
18
|
notices: response.data.notices
|
|
19
19
|
};
|
|
20
20
|
})["catch"](_http.handleErrors);
|
|
21
|
-
};
|
|
22
|
-
exports.fetchNotices = fetchNotices;
|
|
21
|
+
};
|
|
@@ -13,7 +13,7 @@ var buildEndpoint = function buildEndpoint(_ref) {
|
|
|
13
13
|
var clientId = _ref.clientId;
|
|
14
14
|
return clientId ? "".concat(_helpers.bundle.apiLocation(), "/oauthClients/").concat(encodeURIComponent(clientId)) : "".concat(_helpers.bundle.apiLocation(), "/oauthClients");
|
|
15
15
|
};
|
|
16
|
-
var fetchOAuthClients = function fetchOAuthClients() {
|
|
16
|
+
var fetchOAuthClients = exports.fetchOAuthClients = function fetchOAuthClients() {
|
|
17
17
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
18
18
|
return _axios["default"].get(buildEndpoint(options), {
|
|
19
19
|
params: (0, _objectSpread2["default"])({}, (0, _http.paramBuilder)(options)),
|
|
@@ -24,8 +24,7 @@ var fetchOAuthClients = function fetchOAuthClients() {
|
|
|
24
24
|
};
|
|
25
25
|
})["catch"](_http.handleErrors);
|
|
26
26
|
};
|
|
27
|
-
exports.
|
|
28
|
-
var fetchOAuthClient = function fetchOAuthClient() {
|
|
27
|
+
var fetchOAuthClient = exports.fetchOAuthClient = function fetchOAuthClient() {
|
|
29
28
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
30
29
|
var clientId = options.clientId;
|
|
31
30
|
if (!clientId) {
|
|
@@ -40,8 +39,7 @@ var fetchOAuthClient = function fetchOAuthClient() {
|
|
|
40
39
|
};
|
|
41
40
|
})["catch"](_http.handleErrors);
|
|
42
41
|
};
|
|
43
|
-
exports.
|
|
44
|
-
var updateOAuthClient = function updateOAuthClient() {
|
|
42
|
+
var updateOAuthClient = exports.updateOAuthClient = function updateOAuthClient() {
|
|
45
43
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
46
44
|
var clientId = options.clientId,
|
|
47
45
|
client = options.client;
|
|
@@ -62,8 +60,7 @@ var updateOAuthClient = function updateOAuthClient() {
|
|
|
62
60
|
};
|
|
63
61
|
})["catch"](_http.handleErrors);
|
|
64
62
|
};
|
|
65
|
-
exports.
|
|
66
|
-
var createOAuthClient = function createOAuthClient() {
|
|
63
|
+
var createOAuthClient = exports.createOAuthClient = function createOAuthClient() {
|
|
67
64
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
68
65
|
var client = options.client;
|
|
69
66
|
if (!client) {
|
|
@@ -80,8 +77,7 @@ var createOAuthClient = function createOAuthClient() {
|
|
|
80
77
|
};
|
|
81
78
|
})["catch"](_http.handleErrors);
|
|
82
79
|
};
|
|
83
|
-
exports.
|
|
84
|
-
var deleteOAuthClient = function deleteOAuthClient() {
|
|
80
|
+
var deleteOAuthClient = exports.deleteOAuthClient = function deleteOAuthClient() {
|
|
85
81
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
86
82
|
var clientId = options.clientId;
|
|
87
83
|
if (!clientId) {
|
|
@@ -97,5 +93,4 @@ var deleteOAuthClient = function deleteOAuthClient() {
|
|
|
97
93
|
client: response.data.client
|
|
98
94
|
};
|
|
99
95
|
})["catch"](_http.handleErrors);
|
|
100
|
-
};
|
|
101
|
-
exports.deleteOAuthClient = deleteOAuthClient;
|
|
96
|
+
};
|
|
@@ -8,7 +8,7 @@ exports.validateAgent = exports.updateTaskComponent = exports.updateAgentCompone
|
|
|
8
8
|
var _axios = _interopRequireDefault(require("axios"));
|
|
9
9
|
var _helpers = require("../../helpers");
|
|
10
10
|
var _http = require("../http");
|
|
11
|
-
var fetchTaskComponent = function fetchTaskComponent() {
|
|
11
|
+
var fetchTaskComponent = exports.fetchTaskComponent = function fetchTaskComponent() {
|
|
12
12
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
13
13
|
(0, _http.validateOptions)('fetchTaskComponent', [], options);
|
|
14
14
|
return _axios["default"].get("".concat(_helpers.bundle.apiLocation(), "/platformComponents/task"), {
|
|
@@ -20,8 +20,7 @@ var fetchTaskComponent = function fetchTaskComponent() {
|
|
|
20
20
|
};
|
|
21
21
|
})["catch"](_http.handleErrors);
|
|
22
22
|
};
|
|
23
|
-
exports.
|
|
24
|
-
var updateTaskComponent = function updateTaskComponent() {
|
|
23
|
+
var updateTaskComponent = exports.updateTaskComponent = function updateTaskComponent() {
|
|
25
24
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
26
25
|
(0, _http.validateOptions)('updateTaskComponent', ['task'], options);
|
|
27
26
|
return _axios["default"].put("".concat(_helpers.bundle.apiLocation(), "/platformComponents/task"), options.task, {
|
|
@@ -33,8 +32,7 @@ var updateTaskComponent = function updateTaskComponent() {
|
|
|
33
32
|
};
|
|
34
33
|
})["catch"](_http.handleErrors);
|
|
35
34
|
};
|
|
36
|
-
exports.
|
|
37
|
-
var fetchAgentComponents = function fetchAgentComponents() {
|
|
35
|
+
var fetchAgentComponents = exports.fetchAgentComponents = function fetchAgentComponents() {
|
|
38
36
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
39
37
|
return _axios["default"].get("".concat(_helpers.bundle.apiLocation(), "/platformComponents/agents"), {
|
|
40
38
|
params: (0, _http.paramBuilder)(options),
|
|
@@ -45,8 +43,7 @@ var fetchAgentComponents = function fetchAgentComponents() {
|
|
|
45
43
|
};
|
|
46
44
|
})["catch"](_http.handleErrors);
|
|
47
45
|
};
|
|
48
|
-
exports.
|
|
49
|
-
var fetchAgentComponent = function fetchAgentComponent() {
|
|
46
|
+
var fetchAgentComponent = exports.fetchAgentComponent = function fetchAgentComponent() {
|
|
50
47
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
51
48
|
(0, _http.validateOptions)('fetchAgentComponent', ['slug'], options);
|
|
52
49
|
return _axios["default"].get("".concat(_helpers.bundle.apiLocation(), "/platformComponents/agents/").concat(options.slug), {
|
|
@@ -58,8 +55,7 @@ var fetchAgentComponent = function fetchAgentComponent() {
|
|
|
58
55
|
};
|
|
59
56
|
})["catch"](_http.handleErrors);
|
|
60
57
|
};
|
|
61
|
-
exports.
|
|
62
|
-
var createAgentComponent = function createAgentComponent() {
|
|
58
|
+
var createAgentComponent = exports.createAgentComponent = function createAgentComponent() {
|
|
63
59
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
64
60
|
(0, _http.validateOptions)('createAgentComponent', ['agent'], options);
|
|
65
61
|
return _axios["default"].post("".concat(_helpers.bundle.apiLocation(), "/platformComponents/agents"), options.agent, {
|
|
@@ -71,8 +67,7 @@ var createAgentComponent = function createAgentComponent() {
|
|
|
71
67
|
};
|
|
72
68
|
})["catch"](_http.handleErrors);
|
|
73
69
|
};
|
|
74
|
-
exports.
|
|
75
|
-
var updateAgentComponent = function updateAgentComponent() {
|
|
70
|
+
var updateAgentComponent = exports.updateAgentComponent = function updateAgentComponent() {
|
|
76
71
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
77
72
|
(0, _http.validateOptions)('updateAgentComponent', ['slug', 'agent'], options);
|
|
78
73
|
return _axios["default"].put("".concat(_helpers.bundle.apiLocation(), "/platformComponents/agents/").concat(options.slug), options.agent, {
|
|
@@ -84,8 +79,7 @@ var updateAgentComponent = function updateAgentComponent() {
|
|
|
84
79
|
};
|
|
85
80
|
})["catch"](_http.handleErrors);
|
|
86
81
|
};
|
|
87
|
-
exports.
|
|
88
|
-
var deleteAgentComponent = function deleteAgentComponent() {
|
|
82
|
+
var deleteAgentComponent = exports.deleteAgentComponent = function deleteAgentComponent() {
|
|
89
83
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
90
84
|
(0, _http.validateOptions)('deleteAgentComponent', ['slug'], options);
|
|
91
85
|
return _axios["default"]["delete"]("".concat(_helpers.bundle.apiLocation(), "/platformComponents/agents/").concat(options.slug), {
|
|
@@ -97,8 +91,7 @@ var deleteAgentComponent = function deleteAgentComponent() {
|
|
|
97
91
|
};
|
|
98
92
|
})["catch"](_http.handleErrors);
|
|
99
93
|
};
|
|
100
|
-
exports.
|
|
101
|
-
var validateAgent = function validateAgent() {
|
|
94
|
+
var validateAgent = exports.validateAgent = function validateAgent() {
|
|
102
95
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
103
96
|
(0, _http.validateOptions)('validateAgent', [], options);
|
|
104
97
|
return _axios["default"].get("".concat((0, _helpers.buildAgentPath)(options), "/app/api/v1/bridges"), {
|
|
@@ -110,8 +103,7 @@ var validateAgent = function validateAgent() {
|
|
|
110
103
|
};
|
|
111
104
|
})["catch"](_http.handleErrors);
|
|
112
105
|
};
|
|
113
|
-
exports.
|
|
114
|
-
var fetchAgentComponentVersion = function fetchAgentComponentVersion() {
|
|
106
|
+
var fetchAgentComponentVersion = exports.fetchAgentComponentVersion = function fetchAgentComponentVersion() {
|
|
115
107
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
116
108
|
(0, _http.validateOptions)('validateAgent', [], options);
|
|
117
109
|
return _axios["default"].get("".concat((0, _helpers.buildAgentPath)(options), "/app/api/v1/version"), {
|
|
@@ -122,5 +114,4 @@ var fetchAgentComponentVersion = function fetchAgentComponentVersion() {
|
|
|
122
114
|
version: response.data.version
|
|
123
115
|
};
|
|
124
116
|
})["catch"](_http.handleErrors);
|
|
125
|
-
};
|
|
126
|
-
exports.fetchAgentComponentVersion = fetchAgentComponentVersion;
|
|
117
|
+
};
|
|
@@ -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 fetchPlatformItem = function fetchPlatformItem(options) {
|
|
12
|
+
var fetchPlatformItem = exports.fetchPlatformItem = function fetchPlatformItem(options) {
|
|
13
13
|
(0, _http.validateOptions)('fetchPlatformItem', ['type', 'id'], options);
|
|
14
14
|
var path = options.type === 'Space' ? "".concat(_helpers.bundle.apiLocation(), "/space") : "".concat(_helpers.bundle.apiLocation(), "/items/").concat(options.type, "/").concat(options.id);
|
|
15
15
|
var include = options.type === 'Form' ? 'kapp,kapp.space' : options.type === 'Kapp' ? 'space' : '';
|
|
@@ -26,5 +26,4 @@ var fetchPlatformItem = function fetchPlatformItem(options) {
|
|
|
26
26
|
// Clean up any errors we receive. Make sure this the last thing so that it
|
|
27
27
|
// cleans up any errors.
|
|
28
28
|
["catch"](_http.handleErrors);
|
|
29
|
-
};
|
|
30
|
-
exports.fetchPlatformItem = fetchPlatformItem;
|
|
29
|
+
};
|
package/lib/apis/core/profile.js
CHANGED
|
@@ -14,7 +14,7 @@ var getProfileEndpoint = function getProfileEndpoint() {
|
|
|
14
14
|
|
|
15
15
|
// Extract the profile from the data and return it.
|
|
16
16
|
// If there are any errors clean them up and return them instead.
|
|
17
|
-
var fetchProfile = function fetchProfile() {
|
|
17
|
+
var fetchProfile = exports.fetchProfile = function fetchProfile() {
|
|
18
18
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
19
19
|
// Build URL and fetch the space.
|
|
20
20
|
return _axios["default"].get(getProfileEndpoint(), {
|
|
@@ -26,8 +26,7 @@ var fetchProfile = function fetchProfile() {
|
|
|
26
26
|
};
|
|
27
27
|
})["catch"](_http.handleErrors);
|
|
28
28
|
};
|
|
29
|
-
exports.
|
|
30
|
-
var updateProfile = function updateProfile() {
|
|
29
|
+
var updateProfile = exports.updateProfile = function updateProfile() {
|
|
31
30
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
32
31
|
var profile = options.profile;
|
|
33
32
|
if (!profile) {
|
|
@@ -43,5 +42,4 @@ var updateProfile = function updateProfile() {
|
|
|
43
42
|
profile: response.data.user
|
|
44
43
|
};
|
|
45
44
|
})["catch"](_http.handleErrors);
|
|
46
|
-
};
|
|
47
|
-
exports.updateProfile = updateProfile;
|
|
45
|
+
};
|
|
@@ -30,7 +30,7 @@ var buildEndpoint = function buildEndpoint(_ref) {
|
|
|
30
30
|
var basePath = kappSlug ? "".concat(_helpers.bundle.apiLocation(), "/kapps/").concat(kappSlug, "/securityPolicyDefinitions") : "".concat(_helpers.bundle.apiLocation(), "/securityPolicyDefinitions");
|
|
31
31
|
return securityPolicyName ? "".concat(basePath, "/").concat(encodeURIComponent(securityPolicyName)) : basePath;
|
|
32
32
|
};
|
|
33
|
-
var fetchSecurityPolicyDefinitions = function fetchSecurityPolicyDefinitions() {
|
|
33
|
+
var fetchSecurityPolicyDefinitions = exports.fetchSecurityPolicyDefinitions = function fetchSecurityPolicyDefinitions() {
|
|
34
34
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
35
35
|
validateOptions('fetchSecurityPolicyDefinitions', [], options);
|
|
36
36
|
return _axios["default"].get(buildEndpoint(options), {
|
|
@@ -42,8 +42,7 @@ var fetchSecurityPolicyDefinitions = function fetchSecurityPolicyDefinitions() {
|
|
|
42
42
|
};
|
|
43
43
|
})["catch"](_http.handleErrors);
|
|
44
44
|
};
|
|
45
|
-
exports.
|
|
46
|
-
var fetchSecurityPolicyDefinition = function fetchSecurityPolicyDefinition() {
|
|
45
|
+
var fetchSecurityPolicyDefinition = exports.fetchSecurityPolicyDefinition = function fetchSecurityPolicyDefinition() {
|
|
47
46
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
48
47
|
validateOptions('fetchSecurityPolicyDefinition', ['securityPolicyName'], options);
|
|
49
48
|
return _axios["default"].get(buildEndpoint(options), {
|
|
@@ -55,8 +54,7 @@ var fetchSecurityPolicyDefinition = function fetchSecurityPolicyDefinition() {
|
|
|
55
54
|
};
|
|
56
55
|
})["catch"](_http.handleErrors);
|
|
57
56
|
};
|
|
58
|
-
exports.
|
|
59
|
-
var createSecurityPolicyDefinition = function createSecurityPolicyDefinition() {
|
|
57
|
+
var createSecurityPolicyDefinition = exports.createSecurityPolicyDefinition = function createSecurityPolicyDefinition() {
|
|
60
58
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
61
59
|
var kappSlug = options.kappSlug,
|
|
62
60
|
securityPolicyDefinition = options.securityPolicyDefinition;
|
|
@@ -73,8 +71,7 @@ var createSecurityPolicyDefinition = function createSecurityPolicyDefinition() {
|
|
|
73
71
|
};
|
|
74
72
|
})["catch"](_http.handleErrors);
|
|
75
73
|
};
|
|
76
|
-
exports.
|
|
77
|
-
var updateSecurityPolicyDefinition = function updateSecurityPolicyDefinition() {
|
|
74
|
+
var updateSecurityPolicyDefinition = exports.updateSecurityPolicyDefinition = function updateSecurityPolicyDefinition() {
|
|
78
75
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
79
76
|
var securityPolicyDefinition = options.securityPolicyDefinition;
|
|
80
77
|
validateOptions('updateSecurityPolicyDefinition', ['securityPolicyName', 'securityPolicyDefinition'], options);
|
|
@@ -87,8 +84,7 @@ var updateSecurityPolicyDefinition = function updateSecurityPolicyDefinition() {
|
|
|
87
84
|
};
|
|
88
85
|
})["catch"](_http.handleErrors);
|
|
89
86
|
};
|
|
90
|
-
exports.
|
|
91
|
-
var deleteSecurityPolicyDefinition = function deleteSecurityPolicyDefinition() {
|
|
87
|
+
var deleteSecurityPolicyDefinition = exports.deleteSecurityPolicyDefinition = function deleteSecurityPolicyDefinition() {
|
|
92
88
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
93
89
|
validateOptions('deleteSecurityPolicyDefinition', ['securityPolicyName'], options);
|
|
94
90
|
return _axios["default"]["delete"](buildEndpoint(options), {
|
|
@@ -99,5 +95,4 @@ var deleteSecurityPolicyDefinition = function deleteSecurityPolicyDefinition() {
|
|
|
99
95
|
securityPolicyDefinition: response.data.securityPolicyDefinition
|
|
100
96
|
};
|
|
101
97
|
})["catch"](_http.handleErrors);
|
|
102
|
-
};
|
|
103
|
-
exports.deleteSecurityPolicyDefinition = deleteSecurityPolicyDefinition;
|
|
98
|
+
};
|