@northern.tech/store 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +9 -0
- package/.prettierignore +1 -0
- package/CHANGELOG.md +12 -0
- package/actions.ts +32 -0
- package/api/general-api.test.ts +51 -0
- package/api/general-api.ts +60 -0
- package/api/types/AWSCredentials.ts +16 -0
- package/api/types/Actor.ts +35 -0
- package/api/types/Addon.ts +17 -0
- package/api/types/AddonTenantadm.ts +17 -0
- package/api/types/Alert.ts +34 -0
- package/api/types/AlertDetails.ts +23 -0
- package/api/types/AlertSubject.ts +23 -0
- package/api/types/ApiBurst.ts +21 -0
- package/api/types/ApiBurstTenantadm.ts +21 -0
- package/api/types/ApiLimits.ts +16 -0
- package/api/types/ApiLimitsTenantadm.ts +16 -0
- package/api/types/ApiQuota.ts +17 -0
- package/api/types/ApiQuotaTenantadm.ts +17 -0
- package/api/types/Artifact.ts +48 -0
- package/api/types/ArtifactDeployments.ts +48 -0
- package/api/types/ArtifactInfo.ts +11 -0
- package/api/types/ArtifactInfoDeployments.ts +11 -0
- package/api/types/ArtifactLink.ts +11 -0
- package/api/types/ArtifactTypeInfo.ts +13 -0
- package/api/types/ArtifactTypeInfoDeployments.ts +13 -0
- package/api/types/ArtifactUpdate.ts +10 -0
- package/api/types/ArtifactUploadLink.ts +15 -0
- package/api/types/Attribute.ts +36 -0
- package/api/types/AttributeInventory.ts +32 -0
- package/api/types/AuditLog.ts +26 -0
- package/api/types/AuthSet.ts +33 -0
- package/api/types/AuthSetDeviceauth.ts +37 -0
- package/api/types/AutoAuthRequest.ts +23 -0
- package/api/types/AzureSharedAccessSecret.ts +11 -0
- package/api/types/BillingInfo.ts +13 -0
- package/api/types/BinaryDeltaConfiguration.ts +15 -0
- package/api/types/BinaryDeltaConfigurationDeployments.ts +15 -0
- package/api/types/BinaryDeltaLimits.ts +15 -0
- package/api/types/BinaryDeltaLimitsDeployments.ts +15 -0
- package/api/types/BoundingBox.ts +11 -0
- package/api/types/CancelRequest.ts +10 -0
- package/api/types/CardData.ts +49 -0
- package/api/types/CardSetupData.ts +17 -0
- package/api/types/CheckoutData.ts +13 -0
- package/api/types/Configuration.ts +11 -0
- package/api/types/Count.ts +13 -0
- package/api/types/Credentials.ts +23 -0
- package/api/types/DBusSubsystem.ts +27 -0
- package/api/types/DeltaConfiguration.ts +14 -0
- package/api/types/DeltaConfigurationDeployments.ts +14 -0
- package/api/types/Deployment.ts +95 -0
- package/api/types/DeploymentAggregation.ts +18 -0
- package/api/types/DeploymentAggregationItem.ts +18 -0
- package/api/types/DeploymentAggregationTerm.ts +23 -0
- package/api/types/DeploymentAggregationTerms.ts +18 -0
- package/api/types/DeploymentAttributeProjection.ts +11 -0
- package/api/types/DeploymentAuditlogs.ts +11 -0
- package/api/types/DeploymentDeployments.ts +99 -0
- package/api/types/DeploymentFilterTerm.ts +37 -0
- package/api/types/DeploymentIdentifier.ts +10 -0
- package/api/types/DeploymentPhase.ts +23 -0
- package/api/types/DeploymentReporting.ts +46 -0
- package/api/types/DeploymentSearchTerms.ts +39 -0
- package/api/types/DeploymentSortTerm.ts +25 -0
- package/api/types/DeploymentStatistics.ts +15 -0
- package/api/types/DeploymentStatusStatistics.ts +54 -0
- package/api/types/Device.ts +29 -0
- package/api/types/DeviceAggregation.ts +18 -0
- package/api/types/DeviceAggregationItem.ts +18 -0
- package/api/types/DeviceAggregationTerm.ts +27 -0
- package/api/types/DeviceAggregationTerms.ts +22 -0
- package/api/types/DeviceAttribute.ts +23 -0
- package/api/types/DeviceAttributeProjection.ts +15 -0
- package/api/types/DeviceAuditlogs.ts +17 -0
- package/api/types/DeviceAuthEvent.ts +23 -0
- package/api/types/DeviceConfiguration.ts +16 -0
- package/api/types/DeviceDeployment.ts +11 -0
- package/api/types/DeviceDeployments.ts +31 -0
- package/api/types/DeviceDeviceauth.ts +42 -0
- package/api/types/DeviceFilterAttribute.ts +22 -0
- package/api/types/DeviceFilterTerm.ts +41 -0
- package/api/types/DeviceInventory.ts +19 -0
- package/api/types/DeviceInventoryInventory.ts +19 -0
- package/api/types/DeviceReporting.ts +22 -0
- package/api/types/DeviceSearchTerms.ts +39 -0
- package/api/types/DeviceSortTerm.ts +29 -0
- package/api/types/DeviceState.ts +32 -0
- package/api/types/DeviceStateDeviceconnect.ts +33 -0
- package/api/types/DeviceStateIot_manager.ts +14 -0
- package/api/types/DeviceStatus.ts +19 -0
- package/api/types/DeviceWithImage.ts +80 -0
- package/api/types/DirectUploadMetadata.ts +18 -0
- package/api/types/EmailVerificationCompletion.ts +13 -0
- package/api/types/EmailVerificationRequest.ts +13 -0
- package/api/types/Error.ts +17 -0
- package/api/types/ErrorAuditlogs.ts +13 -0
- package/api/types/ErrorDeployments.ts +17 -0
- package/api/types/ErrorDeviceauth.ts +13 -0
- package/api/types/ErrorDeviceconfig.ts +17 -0
- package/api/types/ErrorDeviceconnect.ts +17 -0
- package/api/types/ErrorDevicemonitor.ts +17 -0
- package/api/types/ErrorExt.ts +18 -0
- package/api/types/ErrorInventory.ts +17 -0
- package/api/types/ErrorIot_manager.ts +17 -0
- package/api/types/ErrorNotFound.ts +17 -0
- package/api/types/ErrorReporting.ts +18 -0
- package/api/types/ErrorTenantadm.ts +13 -0
- package/api/types/ErrorUseradm.ts +17 -0
- package/api/types/Event.ts +48 -0
- package/api/types/ExternalIdentity.ts +17 -0
- package/api/types/Features.ts +17 -0
- package/api/types/FileUpload.ts +23 -0
- package/api/types/Filter.ts +19 -0
- package/api/types/FilterAttribute.ts +21 -0
- package/api/types/FilterDefinition.ts +18 -0
- package/api/types/FilterDeployments.ts +19 -0
- package/api/types/FilterInventory.ts +20 -0
- package/api/types/FilterPredicate.ts +78 -0
- package/api/types/FilterPredicateDeployments.ts +48 -0
- package/api/types/FilterPredicateInventory.ts +76 -0
- package/api/types/GeoBoundingBox.ts +10 -0
- package/api/types/GeoBoundingBoxFilter.ts +6 -0
- package/api/types/GeoDistance.ts +17 -0
- package/api/types/GeoDistanceFilter.ts +10 -0
- package/api/types/GeoPoint.ts +15 -0
- package/api/types/Group.ts +10 -0
- package/api/types/HTTP.ts +19 -0
- package/api/types/IdentityData.ts +25 -0
- package/api/types/InputParameter.ts +8 -0
- package/api/types/Integration.ts +24 -0
- package/api/types/JobStatus.ts +13 -0
- package/api/types/Limit.ts +21 -0
- package/api/types/LimitDeployments.ts +21 -0
- package/api/types/LimitDeviceauth.ts +10 -0
- package/api/types/LimitUseradm.ts +11 -0
- package/api/types/Limits.ts +11 -0
- package/api/types/LineDescriptor.ts +11 -0
- package/api/types/LogSubsystem.ts +23 -0
- package/api/types/LoginOptions.ts +18 -0
- package/api/types/ManagementAPIConfiguration.ts +5 -0
- package/api/types/MenderTypes.ts +183 -0
- package/api/types/MonitorConfiguration.ts +22 -0
- package/api/types/NewConfigurationDeployment.ts +15 -0
- package/api/types/NewConfigurationDeploymentResponse.ts +10 -0
- package/api/types/NewDeployment.ts +42 -0
- package/api/types/NewDeploymentForGroup.ts +33 -0
- package/api/types/NewDeploymentPhase.ts +37 -0
- package/api/types/NewDeploymentPhaseDeployments.ts +20 -0
- package/api/types/NewDeploymentV2.ts +31 -0
- package/api/types/NewTenant.ts +41 -0
- package/api/types/Object.ts +35 -0
- package/api/types/OwnUserUpdate.ts +21 -0
- package/api/types/PasswordResetCompletion.ts +17 -0
- package/api/types/PasswordResetRequest.ts +13 -0
- package/api/types/Permission.ts +21 -0
- package/api/types/PermissionObject.ts +14 -0
- package/api/types/PermissionSet.ts +22 -0
- package/api/types/PermissionSetWithScope.ts +15 -0
- package/api/types/PersonalAccessToken.ts +29 -0
- package/api/types/PersonalAccessTokenRequest.ts +18 -0
- package/api/types/Plan.ts +19 -0
- package/api/types/PlanBindingDetails.ts +13 -0
- package/api/types/PlanChangeRequest.ts +14 -0
- package/api/types/PlanLimits.ts +12 -0
- package/api/types/PreAuthSet.ts +16 -0
- package/api/types/Release.ts +32 -0
- package/api/types/ReleaseDeployments.ts +32 -0
- package/api/types/ReleaseUpdate.ts +13 -0
- package/api/types/Releases.ts +9 -0
- package/api/types/ReleasesDeleteError.ts +21 -0
- package/api/types/ReleasesDeployments.ts +9 -0
- package/api/types/Role.ts +19 -0
- package/api/types/RolePermission.ts +25 -0
- package/api/types/RolePermissionObject.ts +17 -0
- package/api/types/RoleUseradm.ts +19 -0
- package/api/types/SAMLMetadata.ts +21 -0
- package/api/types/Scope.ts +19 -0
- package/api/types/SelectAttribute.ts +17 -0
- package/api/types/ServiceSubsystem.ts +19 -0
- package/api/types/Settings.ts +23 -0
- package/api/types/SortCriteria.ts +30 -0
- package/api/types/SsoObject.ts +21 -0
- package/api/types/Status.ts +17 -0
- package/api/types/StatusDeviceauth.ts +18 -0
- package/api/types/StatusTenantadm.ts +19 -0
- package/api/types/StorageLimit.ts +17 -0
- package/api/types/SubscriptionData.ts +8 -0
- package/api/types/SupportRequest.ts +17 -0
- package/api/types/Tag.ts +27 -0
- package/api/types/Tags.ts +10 -0
- package/api/types/TaskResult.ts +13 -0
- package/api/types/TaskResultCLI.ts +10 -0
- package/api/types/TaskResultHTTPRequest.ts +8 -0
- package/api/types/TaskResultHTTPResponse.ts +10 -0
- package/api/types/Tenant.ts +38 -0
- package/api/types/TenantApiLimits.ts +12 -0
- package/api/types/TenantApiLimitsTenantadm.ts +12 -0
- package/api/types/TenantIdName.ts +14 -0
- package/api/types/TenantIdsData.ts +10 -0
- package/api/types/TenantInfo.ts +14 -0
- package/api/types/TenantShortInfo.ts +21 -0
- package/api/types/TenantTenantadm.ts +38 -0
- package/api/types/TenantsIdName.ts +6 -0
- package/api/types/Update.ts +17 -0
- package/api/types/UpdateDeployments.ts +18 -0
- package/api/types/UpdateFile.ts +13 -0
- package/api/types/UpdateFileDeployments.ts +13 -0
- package/api/types/UpdateTypes.ts +8 -0
- package/api/types/UpgradeCompleteRequest.ts +23 -0
- package/api/types/User.ts +13 -0
- package/api/types/UserAuditlogs.ts +13 -0
- package/api/types/UserNew.ts +26 -0
- package/api/types/UserUpdate.ts +25 -0
- package/api/types/UserUseradm.ts +45 -0
- package/api/types/UserWithTenantInfo.ts +8 -0
- package/api/types/XDeltaArgs.ts +9 -0
- package/api/types/XDeltaArgsDeployments.ts +9 -0
- package/api/types/XDeltaArgsLimits.ts +10 -0
- package/api/types/XDeltaArgsLimitsDeployments.ts +10 -0
- package/api/users-api.ts +34 -0
- package/appSlice/constants.ts +166 -0
- package/appSlice/index.ts +159 -0
- package/appSlice/reducer.test.ts +97 -0
- package/appSlice/selectors.ts +33 -0
- package/appSlice/thunks.test.ts +118 -0
- package/appSlice/thunks.ts +148 -0
- package/auth.test.ts +36 -0
- package/auth.ts +82 -0
- package/commonConstants.tsx +252 -0
- package/commonSelectors.ts +255 -0
- package/constants.ts +22 -0
- package/deploymentsSlice/constants.ts +175 -0
- package/deploymentsSlice/index.ts +145 -0
- package/deploymentsSlice/reducer.test.ts +108 -0
- package/deploymentsSlice/selectors.ts +58 -0
- package/deploymentsSlice/thunks.test.ts +425 -0
- package/deploymentsSlice/thunks.ts +382 -0
- package/devicesSlice/constants.ts +56 -0
- package/devicesSlice/index.ts +207 -0
- package/devicesSlice/reducer.test.ts +194 -0
- package/devicesSlice/selectors.ts +127 -0
- package/devicesSlice/thunks.test.tsx +1245 -0
- package/devicesSlice/thunks.tsx +1098 -0
- package/monitorSlice/constants.ts +17 -0
- package/monitorSlice/index.ts +65 -0
- package/monitorSlice/reducer.test.ts +79 -0
- package/monitorSlice/selectors.ts +15 -0
- package/monitorSlice/thunks.test.ts +112 -0
- package/monitorSlice/thunks.ts +101 -0
- package/onboardingSlice/constants.ts +53 -0
- package/onboardingSlice/index.ts +60 -0
- package/onboardingSlice/reducer.test.ts +45 -0
- package/onboardingSlice/selectors.ts +15 -0
- package/onboardingSlice/thunks.test.ts +235 -0
- package/onboardingSlice/thunks.ts +142 -0
- package/organizationSlice/constants.ts +82 -0
- package/organizationSlice/index.ts +111 -0
- package/organizationSlice/reducer.test.ts +78 -0
- package/organizationSlice/selectors.ts +45 -0
- package/organizationSlice/thunks.test.ts +619 -0
- package/organizationSlice/thunks.ts +383 -0
- package/package.json +38 -0
- package/releasesSlice/constants.ts +18 -0
- package/releasesSlice/index.ts +116 -0
- package/releasesSlice/reducer.test.ts +78 -0
- package/releasesSlice/selectors.ts +33 -0
- package/releasesSlice/thunks.test.ts +389 -0
- package/releasesSlice/thunks.ts +379 -0
- package/selectors.ts +22 -0
- package/store.ts +89 -0
- package/storehooks.test.tsx +386 -0
- package/storehooks.ts +250 -0
- package/thunks.ts +21 -0
- package/tsconfig.json +11 -0
- package/tsup.config.ts +11 -0
- package/usersSlice/constants.ts +374 -0
- package/usersSlice/index.ts +151 -0
- package/usersSlice/reducer.test.ts +141 -0
- package/usersSlice/selectors.ts +60 -0
- package/usersSlice/thunks.test.ts +660 -0
- package/usersSlice/thunks.ts +773 -0
- package/utils.test.ts +187 -0
- package/utils.ts +249 -0
package/.eslintrc.cjs
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @type {import("eslint").Linter.Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
root: true,
|
|
4
|
+
extends: ['@northern.tech/eslint-config/react.js'],
|
|
5
|
+
ignorePatterns: ['node_modules/', 'dist/', '**/*.test.ts', '**/*.test.tsx', '**/api/types/Settings.ts'],
|
|
6
|
+
globals: {
|
|
7
|
+
mender_environment: true
|
|
8
|
+
}
|
|
9
|
+
};
|
package/.prettierignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
api/types/*
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.1.0](https://github.com/NorthernTechHQ/nt-gui/compare/@northern.tech/store-0.0.1...@northern.tech/store-0.1.0) (2024-11-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* added tenant creation thunk ([651a67b](https://github.com/NorthernTechHQ/nt-gui/commit/651a67b7df45a0515acfc15e0771ba25ef5f2beb))
|
|
9
|
+
* added tenant-related location utils ([ee167e4](https://github.com/NorthernTechHQ/nt-gui/commit/ee167e45bd4229c86fdb457d140719f8f0b608b8))
|
|
10
|
+
* added tenant-related location utils ([5a7d931](https://github.com/NorthernTechHQ/nt-gui/commit/5a7d931ef7c94a126ae0796d772895fb650816a9))
|
|
11
|
+
* basic repository setup ([da55163](https://github.com/NorthernTechHQ/nt-gui/commit/da55163f94358d3472499f5953734603826d5255))
|
|
12
|
+
* basic repository setup ([7b61c8c](https://github.com/NorthernTechHQ/nt-gui/commit/7b61c8c4f3b46d6ba998bc194f75dab8c8cc7cf6))
|
package/actions.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright 2024 Northern.tech AS
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
import { actions as appActions } from './appSlice';
|
|
15
|
+
import { actions as deploymentActions } from './deploymentsSlice';
|
|
16
|
+
import { actions as devicesActions } from './devicesSlice';
|
|
17
|
+
import { actions as monitorActions } from './monitorSlice';
|
|
18
|
+
import { actions as onboardingActions } from './onboardingSlice';
|
|
19
|
+
import { actions as organizationActions } from './organizationSlice';
|
|
20
|
+
import { actions as releaseActions } from './releasesSlice';
|
|
21
|
+
import { actions as userActions } from './usersSlice';
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
...appActions,
|
|
25
|
+
...deploymentActions,
|
|
26
|
+
...devicesActions,
|
|
27
|
+
...monitorActions,
|
|
28
|
+
...onboardingActions,
|
|
29
|
+
...organizationActions,
|
|
30
|
+
...releaseActions,
|
|
31
|
+
...userActions
|
|
32
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// Copyright 2020 Northern.tech AS
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
import Api from './general-api';
|
|
15
|
+
|
|
16
|
+
const testLocation = '/test';
|
|
17
|
+
|
|
18
|
+
describe('General API module', () => {
|
|
19
|
+
it('should allow GET requests', done => {
|
|
20
|
+
Api.get(testLocation)
|
|
21
|
+
.then(res => {
|
|
22
|
+
expect(res.config.headers.Authorization).toMatch(/Bearer/);
|
|
23
|
+
return res.config.method === 'get' ? done() : done('failed');
|
|
24
|
+
})
|
|
25
|
+
.catch(done);
|
|
26
|
+
});
|
|
27
|
+
it('should allow POST requests', done => {
|
|
28
|
+
Api.post(testLocation)
|
|
29
|
+
.then(res => {
|
|
30
|
+
expect(res.config.headers.Authorization).toMatch(/Bearer/);
|
|
31
|
+
return res.config.method === 'post' ? done() : done('failed');
|
|
32
|
+
})
|
|
33
|
+
.catch(done);
|
|
34
|
+
});
|
|
35
|
+
it('should allow PUT requests', done => {
|
|
36
|
+
Api.put(testLocation)
|
|
37
|
+
.then(res => {
|
|
38
|
+
expect(res.config.headers.Authorization).toMatch(/Bearer/);
|
|
39
|
+
return res.config.method === 'put' ? done() : done('failed');
|
|
40
|
+
})
|
|
41
|
+
.catch(done);
|
|
42
|
+
});
|
|
43
|
+
it('should allow DELETE requests', done => {
|
|
44
|
+
Api.delete(testLocation)
|
|
45
|
+
.then(res => {
|
|
46
|
+
expect(res.config.headers.Authorization).toMatch(/Bearer/);
|
|
47
|
+
return res.config.method === 'del' || res.config.method === 'delete' ? done() : done('failed');
|
|
48
|
+
})
|
|
49
|
+
.catch(done);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// Copyright 2017 Northern.tech AS
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
// @ts-nocheck
|
|
15
|
+
import axios, { isCancel } from 'axios';
|
|
16
|
+
|
|
17
|
+
import { cleanUp, getToken } from '../auth';
|
|
18
|
+
import { TIMEOUTS } from '../constants';
|
|
19
|
+
|
|
20
|
+
const unauthorizedRedirect = error => {
|
|
21
|
+
if (!isCancel(error) && error.response?.status === 401 && getToken()) {
|
|
22
|
+
cleanUp();
|
|
23
|
+
window.location.replace('/ui/');
|
|
24
|
+
}
|
|
25
|
+
return Promise.reject(error);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const commonRequestConfig = { timeout: TIMEOUTS.refreshDefault, headers: { 'Content-Type': 'application/json' } };
|
|
29
|
+
|
|
30
|
+
export const authenticatedRequest = axios.create(commonRequestConfig);
|
|
31
|
+
authenticatedRequest.interceptors.response.use(res => res, unauthorizedRedirect);
|
|
32
|
+
authenticatedRequest.interceptors.request.use(
|
|
33
|
+
config => ({ ...config, headers: { ...config.headers, Authorization: `Bearer ${getToken()}` } }),
|
|
34
|
+
error => Promise.reject(error)
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
const Api = {
|
|
38
|
+
get: authenticatedRequest.get,
|
|
39
|
+
delete: (url, data) => authenticatedRequest.request({ method: 'delete', url, data }),
|
|
40
|
+
patch: authenticatedRequest.patch,
|
|
41
|
+
post: authenticatedRequest.post,
|
|
42
|
+
postUnauthorized: (url, data, config = {}) => axios.post(url, data, { ...commonRequestConfig, ...config }),
|
|
43
|
+
put: authenticatedRequest.put,
|
|
44
|
+
upload: (url, formData, progress, cancelSignal) =>
|
|
45
|
+
authenticatedRequest.post(url, formData, {
|
|
46
|
+
headers: { 'Content-Type': 'multipart/form-data' },
|
|
47
|
+
onUploadProgress: progress,
|
|
48
|
+
timeout: 0,
|
|
49
|
+
signal: cancelSignal
|
|
50
|
+
}),
|
|
51
|
+
uploadPut: (url, formData, progress, cancelSignal) =>
|
|
52
|
+
authenticatedRequest.put(url, formData, {
|
|
53
|
+
headers: { 'Content-Type': 'multipart/form-data' },
|
|
54
|
+
onUploadProgress: progress,
|
|
55
|
+
timeout: 0,
|
|
56
|
+
signal: cancelSignal
|
|
57
|
+
})
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export default Api;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/**
|
|
6
|
+
* AWS credentials in the form of access key id and secret access key, a region and a
|
|
7
|
+
* device policy name.
|
|
8
|
+
*/
|
|
9
|
+
export type AWSCredentials = {
|
|
10
|
+
aws: {
|
|
11
|
+
access_key_id: string;
|
|
12
|
+
secret_access_key: string;
|
|
13
|
+
region: string;
|
|
14
|
+
device_policy_name: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/**
|
|
6
|
+
* The actor may be a user or device.
|
|
7
|
+
* Depending on the type of the actor different information will be available.
|
|
8
|
+
*/
|
|
9
|
+
export type Actor = {
|
|
10
|
+
/**
|
|
11
|
+
* An unique identifier of the actor.
|
|
12
|
+
*/
|
|
13
|
+
id: string;
|
|
14
|
+
/**
|
|
15
|
+
* The type of the actor.
|
|
16
|
+
*/
|
|
17
|
+
type: Actor.type;
|
|
18
|
+
/**
|
|
19
|
+
* The email address of the user.
|
|
20
|
+
*/
|
|
21
|
+
email?: string;
|
|
22
|
+
/**
|
|
23
|
+
* The Indentity data of the device.
|
|
24
|
+
*/
|
|
25
|
+
identity_data?: string;
|
|
26
|
+
};
|
|
27
|
+
export namespace Actor {
|
|
28
|
+
/**
|
|
29
|
+
* The type of the actor.
|
|
30
|
+
*/
|
|
31
|
+
export enum type {
|
|
32
|
+
USER = "user",
|
|
33
|
+
DEVICE = "device",
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/**
|
|
6
|
+
* Mender addon definition.
|
|
7
|
+
*/
|
|
8
|
+
export type Addon = {
|
|
9
|
+
/**
|
|
10
|
+
* Name of the addon (one of ['configure', 'troubleshoot']).
|
|
11
|
+
*/
|
|
12
|
+
name?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Enabled/disabled flag.
|
|
15
|
+
*/
|
|
16
|
+
enabled?: boolean;
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/**
|
|
6
|
+
* Mender addon definition.
|
|
7
|
+
*/
|
|
8
|
+
export type AddonTenantadm = {
|
|
9
|
+
/**
|
|
10
|
+
* Name of the addon (one of ['configure', 'troubleshoot']).
|
|
11
|
+
*/
|
|
12
|
+
name?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Enabled/disabled flag.
|
|
15
|
+
*/
|
|
16
|
+
enabled?: boolean;
|
|
17
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
import type { AlertSubject } from "./AlertSubject";
|
|
6
|
+
export type Alert = {
|
|
7
|
+
/**
|
|
8
|
+
* A unique ID for the alert.
|
|
9
|
+
*/
|
|
10
|
+
id?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The name of the alert.
|
|
13
|
+
*/
|
|
14
|
+
name?: string;
|
|
15
|
+
device_id: string;
|
|
16
|
+
/**
|
|
17
|
+
* Alert severity level
|
|
18
|
+
*/
|
|
19
|
+
level?: Alert.level;
|
|
20
|
+
subject: AlertSubject;
|
|
21
|
+
/**
|
|
22
|
+
* Time and date when the alert occurred
|
|
23
|
+
*/
|
|
24
|
+
timestamp: string;
|
|
25
|
+
};
|
|
26
|
+
export namespace Alert {
|
|
27
|
+
/**
|
|
28
|
+
* Alert severity level
|
|
29
|
+
*/
|
|
30
|
+
export enum level {
|
|
31
|
+
OK = "OK",
|
|
32
|
+
CRITICAL = "CRITICAL",
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
import type { LineDescriptor } from "./LineDescriptor";
|
|
6
|
+
/**
|
|
7
|
+
* Additional details on the alert.
|
|
8
|
+
*/
|
|
9
|
+
export type AlertDetails = {
|
|
10
|
+
/**
|
|
11
|
+
* Alert description.
|
|
12
|
+
*/
|
|
13
|
+
description?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Log lines before matched pattern.
|
|
16
|
+
*/
|
|
17
|
+
lines_before?: Array<LineDescriptor>;
|
|
18
|
+
/**
|
|
19
|
+
* Log lines after matched pattern.
|
|
20
|
+
*/
|
|
21
|
+
lines_after?: Array<LineDescriptor>;
|
|
22
|
+
line_matching?: LineDescriptor;
|
|
23
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
import type { AlertDetails } from "./AlertDetails";
|
|
6
|
+
/**
|
|
7
|
+
* Alert subject: the description of the alert origin
|
|
8
|
+
*/
|
|
9
|
+
export type AlertSubject = {
|
|
10
|
+
/**
|
|
11
|
+
* Name of an entity that caused the alert
|
|
12
|
+
*/
|
|
13
|
+
name: string;
|
|
14
|
+
/**
|
|
15
|
+
* The type of executable that triggered the alert
|
|
16
|
+
*/
|
|
17
|
+
type: string;
|
|
18
|
+
/**
|
|
19
|
+
* Status of an entity that caused the alert
|
|
20
|
+
*/
|
|
21
|
+
status: string;
|
|
22
|
+
details?: AlertDetails;
|
|
23
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/**
|
|
6
|
+
* API burst limit definition.
|
|
7
|
+
*/
|
|
8
|
+
export type ApiBurst = {
|
|
9
|
+
/**
|
|
10
|
+
* HTTP verb.
|
|
11
|
+
*/
|
|
12
|
+
action?: string;
|
|
13
|
+
/**
|
|
14
|
+
* URI of the resource subject to the limit.
|
|
15
|
+
*/
|
|
16
|
+
uri?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Minimum allowed interval, in seconds, between subsequent calls to 'action' on 'uri' (10 = one call every 10 seconds, etc.)
|
|
19
|
+
*/
|
|
20
|
+
min_interval_sec?: number;
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/**
|
|
6
|
+
* API burst limit definition.
|
|
7
|
+
*/
|
|
8
|
+
export type ApiBurstTenantadm = {
|
|
9
|
+
/**
|
|
10
|
+
* HTTP verb.
|
|
11
|
+
*/
|
|
12
|
+
action?: string;
|
|
13
|
+
/**
|
|
14
|
+
* URI of the resource subject to the limit.
|
|
15
|
+
*/
|
|
16
|
+
uri?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Minimum allowed interval, in seconds, between subsequent calls to 'action' on 'uri' (10 = one call every 10 seconds, etc.)
|
|
19
|
+
*/
|
|
20
|
+
min_interval_sec?: number;
|
|
21
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
import type { ApiBurst } from "./ApiBurst";
|
|
6
|
+
import type { ApiQuota } from "./ApiQuota";
|
|
7
|
+
/**
|
|
8
|
+
* Usage quota and burst limit definitions for an API type.
|
|
9
|
+
*/
|
|
10
|
+
export type ApiLimits = {
|
|
11
|
+
/**
|
|
12
|
+
* Collection of api burst limit definitions over specified API resources.
|
|
13
|
+
*/
|
|
14
|
+
bursts?: Array<ApiBurst>;
|
|
15
|
+
quota?: ApiQuota;
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
import type { ApiBurst } from "./ApiBurst";
|
|
6
|
+
import type { ApiQuota } from "./ApiQuota";
|
|
7
|
+
/**
|
|
8
|
+
* Usage quota and burst limit definitions for an API type.
|
|
9
|
+
*/
|
|
10
|
+
export type ApiLimitsTenantadm = {
|
|
11
|
+
/**
|
|
12
|
+
* Collection of api burst limit definitions over specified API resources.
|
|
13
|
+
*/
|
|
14
|
+
bursts?: Array<ApiBurst>;
|
|
15
|
+
quota?: ApiQuota;
|
|
16
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/**
|
|
6
|
+
* API usage quota definition.
|
|
7
|
+
*/
|
|
8
|
+
export type ApiQuota = {
|
|
9
|
+
/**
|
|
10
|
+
* Maximum allowed number of calls within 'interval'.
|
|
11
|
+
*/
|
|
12
|
+
max_calls?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Interval definition, in seconds (60 = 1 minute, 3600 = 1 hour, etc.).
|
|
15
|
+
*/
|
|
16
|
+
interval_sec?: number;
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/**
|
|
6
|
+
* API usage quota definition.
|
|
7
|
+
*/
|
|
8
|
+
export type ApiQuotaTenantadm = {
|
|
9
|
+
/**
|
|
10
|
+
* Maximum allowed number of calls within 'interval'.
|
|
11
|
+
*/
|
|
12
|
+
max_calls?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Interval definition, in seconds (60 = 1 minute, 3600 = 1 hour, etc.).
|
|
15
|
+
*/
|
|
16
|
+
interval_sec?: number;
|
|
17
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
import type { ArtifactInfo } from "./ArtifactInfo";
|
|
6
|
+
import type { Update } from "./Update";
|
|
7
|
+
/**
|
|
8
|
+
* Detailed artifact.
|
|
9
|
+
*/
|
|
10
|
+
export type Artifact = {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
/**
|
|
15
|
+
* An array of compatible device types.
|
|
16
|
+
*/
|
|
17
|
+
device_types_compatible: Array<string>;
|
|
18
|
+
info?: ArtifactInfo;
|
|
19
|
+
/**
|
|
20
|
+
* Idicates if artifact is signed or not.
|
|
21
|
+
*/
|
|
22
|
+
signed?: boolean;
|
|
23
|
+
updates?: Array<Update>;
|
|
24
|
+
/**
|
|
25
|
+
* List of Artifact provides.
|
|
26
|
+
*
|
|
27
|
+
* Map of key/value pairs, where both keys and values are strings.
|
|
28
|
+
*/
|
|
29
|
+
artifact_provides?: Record<string, string>;
|
|
30
|
+
/**
|
|
31
|
+
* List of Artifact depends.
|
|
32
|
+
*
|
|
33
|
+
* Map of key/value pairs, where keys are strings and values are lists of strings.
|
|
34
|
+
*/
|
|
35
|
+
artifact_depends?: Record<string, Array<string>>;
|
|
36
|
+
/**
|
|
37
|
+
* List of Clear Artifact provides.
|
|
38
|
+
*/
|
|
39
|
+
clears_artifact_provides?: Array<string>;
|
|
40
|
+
/**
|
|
41
|
+
* Artifact total size in bytes - the size of the actual file that will be transferred to the device (compressed).
|
|
42
|
+
*/
|
|
43
|
+
size?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Represents creation / last edition of any of the artifact properties.
|
|
46
|
+
*/
|
|
47
|
+
modified: string;
|
|
48
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
import type { ArtifactInfo } from "./ArtifactInfo";
|
|
6
|
+
import type { Update } from "./Update";
|
|
7
|
+
/**
|
|
8
|
+
* Detailed artifact.
|
|
9
|
+
*/
|
|
10
|
+
export type ArtifactDeployments = {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
/**
|
|
15
|
+
* An array of compatible device types.
|
|
16
|
+
*/
|
|
17
|
+
device_types_compatible: Array<string>;
|
|
18
|
+
info?: ArtifactInfo;
|
|
19
|
+
/**
|
|
20
|
+
* Idicates if artifact is signed or not.
|
|
21
|
+
*/
|
|
22
|
+
signed?: boolean;
|
|
23
|
+
updates?: Array<Update>;
|
|
24
|
+
/**
|
|
25
|
+
* List of Artifact provides.
|
|
26
|
+
*
|
|
27
|
+
* Map of key/value pairs, where both keys and values are strings.
|
|
28
|
+
*/
|
|
29
|
+
artifact_provides?: Record<string, string>;
|
|
30
|
+
/**
|
|
31
|
+
* List of Artifact depends.
|
|
32
|
+
*
|
|
33
|
+
* Map of key/value pairs, where keys are strings and values are lists of strings.
|
|
34
|
+
*/
|
|
35
|
+
artifact_depends?: Record<string, Array<string>>;
|
|
36
|
+
/**
|
|
37
|
+
* List of Clear Artifact provides.
|
|
38
|
+
*/
|
|
39
|
+
clears_artifact_provides?: Array<string>;
|
|
40
|
+
/**
|
|
41
|
+
* Artifact total size in bytes - the size of the actual file that will be transferred to the device (compressed).
|
|
42
|
+
*/
|
|
43
|
+
size?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Represents creation / last edition of any of the artifact properties.
|
|
46
|
+
*/
|
|
47
|
+
modified: string;
|
|
48
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/**
|
|
6
|
+
* Information about artifact format and version.
|
|
7
|
+
*/
|
|
8
|
+
export type ArtifactInfo = {
|
|
9
|
+
format?: string;
|
|
10
|
+
version?: number;
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/**
|
|
6
|
+
* Information about artifact format and version.
|
|
7
|
+
*/
|
|
8
|
+
export type ArtifactInfoDeployments = {
|
|
9
|
+
format?: string;
|
|
10
|
+
version?: number;
|
|
11
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/**
|
|
6
|
+
* Information about update type.
|
|
7
|
+
*/
|
|
8
|
+
export type ArtifactTypeInfo = {
|
|
9
|
+
/**
|
|
10
|
+
* Note that for emtpy Artifacts, the type is 'null'
|
|
11
|
+
*/
|
|
12
|
+
type?: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/**
|
|
6
|
+
* Information about update type.
|
|
7
|
+
*/
|
|
8
|
+
export type ArtifactTypeInfoDeployments = {
|
|
9
|
+
/**
|
|
10
|
+
* Note that for emtpy Artifacts, the type is 'null'
|
|
11
|
+
*/
|
|
12
|
+
type?: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/**
|
|
6
|
+
* URL for artifact file upload.
|
|
7
|
+
*/
|
|
8
|
+
export type ArtifactUploadLink = {
|
|
9
|
+
/**
|
|
10
|
+
* The ID of the artifact upload intent.
|
|
11
|
+
*/
|
|
12
|
+
id: string;
|
|
13
|
+
uri: string;
|
|
14
|
+
expire: string;
|
|
15
|
+
};
|