@kumori/aurora-backend-handler 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitlab-ci.yml +57 -0
- package/README.md +352 -0
- package/api/account-api-service.ts +1092 -0
- package/api/deploy-service-helper.ts +1611 -0
- package/api/environment-api-service.ts +542 -0
- package/api/marketplace-api-service.ts +1031 -0
- package/api/organizations-api-service.ts +0 -0
- package/api/planProvider-api-service.ts +24 -0
- package/api/reporting-api-service.ts +35 -0
- package/api/resources-api-service.ts +821 -0
- package/api/service-api-service.ts +796 -0
- package/api/tenant-api-service.ts +1260 -0
- package/api/user-api-service.ts +1161 -0
- package/backend-handler.ts +1127 -0
- package/environment.ts +7 -0
- package/event-helper.ts +577 -0
- package/event-names.ts +152 -0
- package/helpers/account-helper.ts +331 -0
- package/helpers/environment-helper.ts +289 -0
- package/helpers/link-helper.ts +114 -0
- package/helpers/plan-helper.ts +104 -0
- package/helpers/registry-helper.ts +134 -0
- package/helpers/resource-helper.ts +387 -0
- package/helpers/revision-helper.ts +899 -0
- package/helpers/service-helper.ts +627 -0
- package/helpers/tenant-helper.ts +191 -0
- package/helpers/token-helper.ts +107 -0
- package/helpers/user-helper.ts +140 -0
- package/jest.config.ts +40 -0
- package/jest.setup.js +4 -0
- package/package.json +50 -0
- package/test/backend-handler.test.ts +792 -0
- package/test/deploy-service-helper.test.ts +518 -0
- package/test/event-helper.test.ts +152 -0
- package/tsconfig.json +26 -0
- package/utils/utils.ts +78 -0
- package/websocket-manager.ts +1833 -0
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
import { eventHelper } from "./../backend-handler";
|
|
3
|
+
import {
|
|
4
|
+
initializeGlobalWebSocketClient,
|
|
5
|
+
makeGlobalWebSocketRequest,
|
|
6
|
+
} from "../websocket-manager";
|
|
7
|
+
|
|
8
|
+
export const getPlanProviders = async (security:string) => {
|
|
9
|
+
try {
|
|
10
|
+
await initializeGlobalWebSocketClient(security);
|
|
11
|
+
const queryParams = {
|
|
12
|
+
};
|
|
13
|
+
const response = await makeGlobalWebSocketRequest(
|
|
14
|
+
"plan:list_plan_providers",
|
|
15
|
+
queryParams,
|
|
16
|
+
30000,
|
|
17
|
+
"GET",
|
|
18
|
+
`all`
|
|
19
|
+
);
|
|
20
|
+
return response;
|
|
21
|
+
} catch (error) {
|
|
22
|
+
eventHelper.planProviders.publish.loadError();
|
|
23
|
+
}
|
|
24
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Environment } from "@hestekumori/aurora-interfaces";
|
|
2
|
+
import { makeGlobalWebSocketRequest } from "../websocket-manager";
|
|
3
|
+
|
|
4
|
+
export const getReporting = async (env: Environment) => {
|
|
5
|
+
try {
|
|
6
|
+
const toDate = new Date();
|
|
7
|
+
const fromDate = new Date();
|
|
8
|
+
fromDate.setDate(fromDate.getDate() - 1);
|
|
9
|
+
const from = fromDate.toISOString();
|
|
10
|
+
const to = toDate.toISOString();
|
|
11
|
+
|
|
12
|
+
const requestBody = {
|
|
13
|
+
tenant: env.tenant,
|
|
14
|
+
account: env.account,
|
|
15
|
+
environment: env.name,
|
|
16
|
+
type: 'historical',
|
|
17
|
+
from: from,
|
|
18
|
+
to: to
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const response = await makeGlobalWebSocketRequest(
|
|
22
|
+
"reporting:get_reporting",
|
|
23
|
+
requestBody,
|
|
24
|
+
30000,
|
|
25
|
+
"GET",
|
|
26
|
+
"REPORTING"
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
return response.data;
|
|
30
|
+
|
|
31
|
+
} catch (error) {
|
|
32
|
+
console.error('Error obtaining the reporting data for ', env);
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
};
|