@privateaim/core-kit 0.6.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/CHANGELOG.md +125 -0
- package/LICENSE +202 -0
- package/README.md +5 -0
- package/dist/constants.d.ts +6 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/domains/analysis/constants.d.ts +47 -0
- package/dist/domains/analysis/constants.d.ts.map +1 -0
- package/dist/domains/analysis/entity.d.ts +30 -0
- package/dist/domains/analysis/entity.d.ts.map +1 -0
- package/dist/domains/analysis/index.d.ts +3 -0
- package/dist/domains/analysis/index.d.ts.map +1 -0
- package/dist/domains/analysis-bucket/constants.d.ts +6 -0
- package/dist/domains/analysis-bucket/constants.d.ts.map +1 -0
- package/dist/domains/analysis-bucket/entity.d.ts +20 -0
- package/dist/domains/analysis-bucket/entity.d.ts.map +1 -0
- package/dist/domains/analysis-bucket/index.d.ts +4 -0
- package/dist/domains/analysis-bucket/index.d.ts.map +1 -0
- package/dist/domains/analysis-bucket/utils.d.ts +4 -0
- package/dist/domains/analysis-bucket/utils.d.ts.map +1 -0
- package/dist/domains/analysis-bucket-file/entity.d.ts +25 -0
- package/dist/domains/analysis-bucket-file/entity.d.ts.map +1 -0
- package/dist/domains/analysis-bucket-file/index.d.ts +2 -0
- package/dist/domains/analysis-bucket-file/index.d.ts.map +1 -0
- package/dist/domains/analysis-log/entity.d.ts +50 -0
- package/dist/domains/analysis-log/entity.d.ts.map +1 -0
- package/dist/domains/analysis-log/index.d.ts +2 -0
- package/dist/domains/analysis-log/index.d.ts.map +1 -0
- package/dist/domains/analysis-node/constants.d.ts +20 -0
- package/dist/domains/analysis-node/constants.d.ts.map +1 -0
- package/dist/domains/analysis-node/entity.d.ts +35 -0
- package/dist/domains/analysis-node/entity.d.ts.map +1 -0
- package/dist/domains/analysis-node/index.d.ts +3 -0
- package/dist/domains/analysis-node/index.d.ts.map +1 -0
- package/dist/domains/constants.d.ts +31 -0
- package/dist/domains/constants.d.ts.map +1 -0
- package/dist/domains/index.d.ts +20 -0
- package/dist/domains/index.d.ts.map +1 -0
- package/dist/domains/master-image/constants.d.ts +8 -0
- package/dist/domains/master-image/constants.d.ts.map +1 -0
- package/dist/domains/master-image/entity.d.ts +18 -0
- package/dist/domains/master-image/entity.d.ts.map +1 -0
- package/dist/domains/master-image/index.d.ts +3 -0
- package/dist/domains/master-image/index.d.ts.map +1 -0
- package/dist/domains/master-image-group/entity.d.ts +17 -0
- package/dist/domains/master-image-group/entity.d.ts.map +1 -0
- package/dist/domains/master-image-group/index.d.ts +2 -0
- package/dist/domains/master-image-group/index.d.ts.map +1 -0
- package/dist/domains/node/constants.d.ts +15 -0
- package/dist/domains/node/constants.d.ts.map +1 -0
- package/dist/domains/node/entity.d.ts +27 -0
- package/dist/domains/node/entity.d.ts.map +1 -0
- package/dist/domains/node/index.d.ts +3 -0
- package/dist/domains/node/index.d.ts.map +1 -0
- package/dist/domains/permission/constants.d.ts +88 -0
- package/dist/domains/permission/constants.d.ts.map +1 -0
- package/dist/domains/permission/index.d.ts +2 -0
- package/dist/domains/permission/index.d.ts.map +1 -0
- package/dist/domains/project/entity.d.ts +20 -0
- package/dist/domains/project/entity.d.ts.map +1 -0
- package/dist/domains/project/index.d.ts +2 -0
- package/dist/domains/project/index.d.ts.map +1 -0
- package/dist/domains/project-node/constants.d.ts +9 -0
- package/dist/domains/project-node/constants.d.ts.map +1 -0
- package/dist/domains/project-node/entity.d.ts +24 -0
- package/dist/domains/project-node/entity.d.ts.map +1 -0
- package/dist/domains/project-node/index.d.ts +3 -0
- package/dist/domains/project-node/index.d.ts.map +1 -0
- package/dist/domains/realm/index.d.ts +2 -0
- package/dist/domains/realm/index.d.ts.map +1 -0
- package/dist/domains/realm/socket.d.ts +4 -0
- package/dist/domains/realm/socket.d.ts.map +1 -0
- package/dist/domains/registry/constants.d.ts +2 -0
- package/dist/domains/registry/constants.d.ts.map +1 -0
- package/dist/domains/registry/entity.d.ts +16 -0
- package/dist/domains/registry/entity.d.ts.map +1 -0
- package/dist/domains/registry/index.d.ts +4 -0
- package/dist/domains/registry/index.d.ts.map +1 -0
- package/dist/domains/registry/utils.d.ts +3 -0
- package/dist/domains/registry/utils.d.ts.map +1 -0
- package/dist/domains/registry-project/constants.d.ts +9 -0
- package/dist/domains/registry-project/constants.d.ts.map +1 -0
- package/dist/domains/registry-project/entity.d.ts +28 -0
- package/dist/domains/registry-project/entity.d.ts.map +1 -0
- package/dist/domains/registry-project/index.d.ts +5 -0
- package/dist/domains/registry-project/index.d.ts.map +1 -0
- package/dist/domains/registry-project/socket.d.ts +3 -0
- package/dist/domains/registry-project/socket.d.ts.map +1 -0
- package/dist/domains/registry-project/utils.d.ts +2 -0
- package/dist/domains/registry-project/utils.d.ts.map +1 -0
- package/dist/domains/service/constants.d.ts +5 -0
- package/dist/domains/service/constants.d.ts.map +1 -0
- package/dist/domains/service/index.d.ts +5 -0
- package/dist/domains/service/index.d.ts.map +1 -0
- package/dist/domains/service/registry/constants.d.ts +28 -0
- package/dist/domains/service/registry/constants.d.ts.map +1 -0
- package/dist/domains/service/registry/index.d.ts +2 -0
- package/dist/domains/service/registry/index.d.ts.map +1 -0
- package/dist/domains/service/secret-engine/constants.d.ts +7 -0
- package/dist/domains/service/secret-engine/constants.d.ts.map +1 -0
- package/dist/domains/service/secret-engine/index.d.ts +3 -0
- package/dist/domains/service/secret-engine/index.d.ts.map +1 -0
- package/dist/domains/service/secret-engine/type.d.ts +3 -0
- package/dist/domains/service/secret-engine/type.d.ts.map +1 -0
- package/dist/domains/service/station-registry/constants.d.ts +4 -0
- package/dist/domains/service/station-registry/constants.d.ts.map +1 -0
- package/dist/domains/service/station-registry/index.d.ts +2 -0
- package/dist/domains/service/station-registry/index.d.ts.map +1 -0
- package/dist/domains/types-base.d.ts +11 -0
- package/dist/domains/types-base.d.ts.map +1 -0
- package/dist/domains/types.d.ts +20 -0
- package/dist/domains/types.d.ts.map +1 -0
- package/dist/domains/utils.d.ts +7 -0
- package/dist/domains/utils.d.ts.map +1 -0
- package/dist/error/constants.d.ts +4 -0
- package/dist/error/constants.d.ts.map +1 -0
- package/dist/error/entities/connection-string.d.ts +5 -0
- package/dist/error/entities/connection-string.d.ts.map +1 -0
- package/dist/error/entities/index.d.ts +2 -0
- package/dist/error/entities/index.d.ts.map +1 -0
- package/dist/error/index.d.ts +3 -0
- package/dist/error/index.d.ts.map +1 -0
- package/dist/index.cjs +488 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +469 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +40 -0
- package/rollup.config.mjs +19 -0
- package/src/constants.ts +12 -0
- package/src/domains/analysis/constants.ts +78 -0
- package/src/domains/analysis/entity.ts +72 -0
- package/src/domains/analysis/index.ts +9 -0
- package/src/domains/analysis-bucket/constants.ts +12 -0
- package/src/domains/analysis-bucket/entity.ts +41 -0
- package/src/domains/analysis-bucket/index.ts +10 -0
- package/src/domains/analysis-bucket/utils.ts +28 -0
- package/src/domains/analysis-bucket-file/entity.ts +55 -0
- package/src/domains/analysis-bucket-file/index.ts +8 -0
- package/src/domains/analysis-log/entity.ts +78 -0
- package/src/domains/analysis-log/index.ts +8 -0
- package/src/domains/analysis-node/constants.ts +33 -0
- package/src/domains/analysis-node/entity.ts +65 -0
- package/src/domains/analysis-node/index.ts +9 -0
- package/src/domains/constants.ts +40 -0
- package/src/domains/index.ts +26 -0
- package/src/domains/master-image/constants.ts +15 -0
- package/src/domains/master-image/entity.ts +36 -0
- package/src/domains/master-image/index.ts +8 -0
- package/src/domains/master-image-group/entity.ts +34 -0
- package/src/domains/master-image-group/index.ts +7 -0
- package/src/domains/node/constants.ts +23 -0
- package/src/domains/node/entity.ts +56 -0
- package/src/domains/node/index.ts +9 -0
- package/src/domains/permission/constants.ts +46 -0
- package/src/domains/permission/index.ts +8 -0
- package/src/domains/project/entity.ts +40 -0
- package/src/domains/project/index.ts +8 -0
- package/src/domains/project-node/constants.ts +16 -0
- package/src/domains/project-node/entity.ts +46 -0
- package/src/domains/project-node/index.ts +9 -0
- package/src/domains/realm/index.ts +8 -0
- package/src/domains/realm/socket.ts +18 -0
- package/src/domains/registry/constants.ts +8 -0
- package/src/domains/registry/entity.ts +34 -0
- package/src/domains/registry/index.ts +10 -0
- package/src/domains/registry/utils.ts +15 -0
- package/src/domains/registry-project/constants.ts +15 -0
- package/src/domains/registry-project/entity.ts +64 -0
- package/src/domains/registry-project/index.ts +11 -0
- package/src/domains/registry-project/socket.ts +12 -0
- package/src/domains/registry-project/utils.ts +12 -0
- package/src/domains/service/constants.ts +14 -0
- package/src/domains/service/index.ts +11 -0
- package/src/domains/service/registry/constants.ts +40 -0
- package/src/domains/service/registry/index.ts +8 -0
- package/src/domains/service/secret-engine/constants.ts +14 -0
- package/src/domains/service/secret-engine/index.ts +9 -0
- package/src/domains/service/secret-engine/type.ts +10 -0
- package/src/domains/service/station-registry/constants.ts +10 -0
- package/src/domains/service/station-registry/index.ts +8 -0
- package/src/domains/types-base.ts +21 -0
- package/src/domains/types.ts +98 -0
- package/src/domains/utils.ts +41 -0
- package/src/error/constants.ts +10 -0
- package/src/error/entities/connection-string.ts +26 -0
- package/src/error/entities/index.ts +8 -0
- package/src/error/index.ts +9 -0
- package/src/index.ts +10 -0
- package/tsconfig.build.json +11 -0
- package/tsconfig.json +10 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2024.
|
|
3
|
+
* Author Peter Placzek (tada5hi)
|
|
4
|
+
* For the full copyright and license information,
|
|
5
|
+
* view the LICENSE file that was distributed with this source code.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export enum AnalysisBuildStatus {
|
|
9
|
+
STARTING = 'starting', // ui trigger
|
|
10
|
+
STARTED = 'started', // tb trigger
|
|
11
|
+
|
|
12
|
+
STOPPING = 'stopping', // ui trigger
|
|
13
|
+
STOPPED = 'stopped', // tb trigger
|
|
14
|
+
|
|
15
|
+
FINISHED = 'finished', // tb trigger
|
|
16
|
+
FAILED = 'failed', // tb trigger
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// -------------------------------------------------------------------------
|
|
20
|
+
|
|
21
|
+
export enum AnalysisConfigurationStatus {
|
|
22
|
+
BASE_CONFIGURED = 'base',
|
|
23
|
+
SECURITY_CONFIGURED = 'security_configured', // todo: still relevant ?
|
|
24
|
+
RESOURCE_CONFIGURED = 'resource_configured',
|
|
25
|
+
HASH_GENERATED = 'hash_generated', // todo: still relevant ?
|
|
26
|
+
HASH_SIGNED = 'hash_signed', // todo: signed by xyz
|
|
27
|
+
FINISHED = 'finished',
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// -------------------------------------------------------------------------
|
|
31
|
+
|
|
32
|
+
export enum AnalysisRunStatus {
|
|
33
|
+
STARTING = 'starting',
|
|
34
|
+
STARTED = 'started',
|
|
35
|
+
|
|
36
|
+
RUNNING = 'running',
|
|
37
|
+
|
|
38
|
+
STOPPING = 'stopping',
|
|
39
|
+
STOPPED = 'stopped',
|
|
40
|
+
|
|
41
|
+
FINISHED = 'finished',
|
|
42
|
+
FAILED = 'failed',
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// -------------------------------------------------------------------------
|
|
46
|
+
|
|
47
|
+
export enum AnalysisResultStatus {
|
|
48
|
+
STARTED = 'started',
|
|
49
|
+
|
|
50
|
+
DOWNLOADING = 'downloading',
|
|
51
|
+
DOWNLOADED = 'downloaded',
|
|
52
|
+
|
|
53
|
+
PROCESSING = 'extracting',
|
|
54
|
+
PROCESSED = 'extracted',
|
|
55
|
+
|
|
56
|
+
FINISHED = 'finished',
|
|
57
|
+
FAILED = 'failed',
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// -------------------------------------------------------------------------
|
|
61
|
+
|
|
62
|
+
export enum AnalysisAPICommand {
|
|
63
|
+
SPIN_UP = 'spinUp',
|
|
64
|
+
TEAR_DOWN = 'tearDown',
|
|
65
|
+
|
|
66
|
+
BUILD_START = 'buildStart',
|
|
67
|
+
BUILD_STOP = 'buildStop',
|
|
68
|
+
BUILD_STATUS = 'buildStatus',
|
|
69
|
+
|
|
70
|
+
CONFIGURATION_LOCK = 'configurationLock',
|
|
71
|
+
CONFIGURATION_UNLOCK = 'configurationUnlock',
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// -------------------------------------------------------------------------
|
|
75
|
+
|
|
76
|
+
export enum AnalysisContainerPath {
|
|
77
|
+
CODE = '/opt/code/',
|
|
78
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2024.
|
|
3
|
+
* Author Peter Placzek (tada5hi)
|
|
4
|
+
* For the full copyright and license information,
|
|
5
|
+
* view the LICENSE file that was distributed with this source code.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { Realm, User } from '@authup/core-kit';
|
|
9
|
+
import type { DomainType } from '../constants';
|
|
10
|
+
import type { MasterImage } from '../master-image';
|
|
11
|
+
import type { Project } from '../project';
|
|
12
|
+
import type { DomainEventBaseContext } from '../types-base';
|
|
13
|
+
import type {
|
|
14
|
+
AnalysisBuildStatus,
|
|
15
|
+
AnalysisRunStatus,
|
|
16
|
+
} from './constants';
|
|
17
|
+
import type { Registry } from '../registry';
|
|
18
|
+
|
|
19
|
+
export interface Analysis {
|
|
20
|
+
id: string;
|
|
21
|
+
|
|
22
|
+
name: string | null;
|
|
23
|
+
|
|
24
|
+
nodes: number;
|
|
25
|
+
|
|
26
|
+
// ------------------------------------------------------------------
|
|
27
|
+
|
|
28
|
+
configuration_locked: boolean;
|
|
29
|
+
|
|
30
|
+
// ------------------------------------------------------------------
|
|
31
|
+
|
|
32
|
+
build_status: AnalysisBuildStatus | null;
|
|
33
|
+
|
|
34
|
+
// ------------------------------------------------------------------
|
|
35
|
+
|
|
36
|
+
run_status: AnalysisRunStatus | null;
|
|
37
|
+
|
|
38
|
+
// ------------------------------------------------------------------
|
|
39
|
+
|
|
40
|
+
created_at: Date;
|
|
41
|
+
|
|
42
|
+
updated_at: Date;
|
|
43
|
+
|
|
44
|
+
// ------------------------------------------------------------------
|
|
45
|
+
|
|
46
|
+
registry: Registry;
|
|
47
|
+
|
|
48
|
+
registry_id: Registry['id'];
|
|
49
|
+
|
|
50
|
+
// ------------------------------------------------------------------
|
|
51
|
+
|
|
52
|
+
realm_id: Realm['id'];
|
|
53
|
+
|
|
54
|
+
user_id: User['id'];
|
|
55
|
+
|
|
56
|
+
// ------------------------------------------------------------------
|
|
57
|
+
|
|
58
|
+
project_id: Project['id'];
|
|
59
|
+
|
|
60
|
+
project: Project;
|
|
61
|
+
|
|
62
|
+
// ------------------------------------------------------------------
|
|
63
|
+
|
|
64
|
+
master_image_id: MasterImage['id'] | null;
|
|
65
|
+
|
|
66
|
+
master_image: MasterImage;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type AnalysisEventContext = DomainEventBaseContext & {
|
|
70
|
+
type: `${DomainType.ANALYSIS}`,
|
|
71
|
+
data: Analysis
|
|
72
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024.
|
|
3
|
+
* Author Peter Placzek (tada5hi)
|
|
4
|
+
* For the full copyright and license information,
|
|
5
|
+
* view the LICENSE file that was distributed with this source code.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export enum AnalysisBucketType {
|
|
9
|
+
CODE = 'CODE',
|
|
10
|
+
RESULT = 'RESULT',
|
|
11
|
+
TEMP = 'TEMP',
|
|
12
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2024.
|
|
3
|
+
* Author Peter Placzek (tada5hi)
|
|
4
|
+
* For the full copyright and license information,
|
|
5
|
+
* view the LICENSE file that was distributed with this source code.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { Realm } from '@authup/core-kit';
|
|
9
|
+
import type { Analysis } from '../analysis';
|
|
10
|
+
import type { DomainType } from '../constants';
|
|
11
|
+
import type { DomainEventBaseContext } from '../types-base';
|
|
12
|
+
import type { AnalysisBucketType } from './constants';
|
|
13
|
+
|
|
14
|
+
export interface AnalysisBucket {
|
|
15
|
+
id: string;
|
|
16
|
+
|
|
17
|
+
type: `${AnalysisBucketType}`;
|
|
18
|
+
|
|
19
|
+
external_id: string | null;
|
|
20
|
+
|
|
21
|
+
// ------------------------------------------------------------------
|
|
22
|
+
|
|
23
|
+
created_at: Date;
|
|
24
|
+
|
|
25
|
+
updated_at: Date;
|
|
26
|
+
|
|
27
|
+
// ------------------------------------------------------------------
|
|
28
|
+
|
|
29
|
+
analysis_id: Analysis['id'];
|
|
30
|
+
|
|
31
|
+
analysis: Analysis;
|
|
32
|
+
|
|
33
|
+
// ------------------------------------------------------------------
|
|
34
|
+
|
|
35
|
+
realm_id: Realm['id'];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type AnalysisBucketEventContext = DomainEventBaseContext & {
|
|
39
|
+
type: `${DomainType.ANALYSIS_BUCKET}`,
|
|
40
|
+
data: AnalysisBucket
|
|
41
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2024.
|
|
3
|
+
* Author Peter Placzek (tada5hi)
|
|
4
|
+
* For the full copyright and license information,
|
|
5
|
+
* view the LICENSE file that was distributed with this source code.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export * from './constants';
|
|
9
|
+
export * from './entity';
|
|
10
|
+
export * from './utils';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024.
|
|
3
|
+
* Author Peter Placzek (tada5hi)
|
|
4
|
+
* For the full copyright and license information,
|
|
5
|
+
* view the LICENSE file that was distributed with this source code.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { Analysis } from '../analysis';
|
|
9
|
+
import { AnalysisBucketType } from './constants';
|
|
10
|
+
|
|
11
|
+
export function buildAnalysisBucketName(
|
|
12
|
+
type: `${AnalysisBucketType}`,
|
|
13
|
+
id: Analysis['id'],
|
|
14
|
+
) {
|
|
15
|
+
switch (type) {
|
|
16
|
+
case AnalysisBucketType.CODE: {
|
|
17
|
+
return `analysis-code-files.${id}`;
|
|
18
|
+
}
|
|
19
|
+
case AnalysisBucketType.TEMP: {
|
|
20
|
+
return `analysis-temp-files.${id}`;
|
|
21
|
+
}
|
|
22
|
+
case AnalysisBucketType.RESULT: {
|
|
23
|
+
return `analysis-result-files.${id}`;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
throw new SyntaxError('The argument can only have any bucket type value.');
|
|
28
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2024.
|
|
3
|
+
* Author Peter Placzek (tada5hi)
|
|
4
|
+
* For the full copyright and license information,
|
|
5
|
+
* view the LICENSE file that was distributed with this source code.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { Realm, Robot, User } from '@authup/core-kit';
|
|
9
|
+
import type { AnalysisBucket } from '../analysis-bucket';
|
|
10
|
+
import type { DomainType } from '../constants';
|
|
11
|
+
import type { Analysis } from '../analysis';
|
|
12
|
+
import type { DomainEventBaseContext } from '../types-base';
|
|
13
|
+
|
|
14
|
+
export interface AnalysisBucketFile {
|
|
15
|
+
id: string;
|
|
16
|
+
|
|
17
|
+
name: string;
|
|
18
|
+
|
|
19
|
+
root: boolean;
|
|
20
|
+
|
|
21
|
+
// ------------------------------------------------------------------
|
|
22
|
+
|
|
23
|
+
created_at: Date;
|
|
24
|
+
|
|
25
|
+
updated_at: Date;
|
|
26
|
+
|
|
27
|
+
// ------------------------------------------------------------------
|
|
28
|
+
|
|
29
|
+
external_id: string;
|
|
30
|
+
|
|
31
|
+
// ------------------------------------------------------------------
|
|
32
|
+
|
|
33
|
+
bucket_id: AnalysisBucket['id'];
|
|
34
|
+
|
|
35
|
+
bucket: AnalysisBucket;
|
|
36
|
+
|
|
37
|
+
// ------------------------------------------------------------------
|
|
38
|
+
|
|
39
|
+
analysis_id: Analysis['id'];
|
|
40
|
+
|
|
41
|
+
analysis: Analysis;
|
|
42
|
+
|
|
43
|
+
// ------------------------------------------------------------------
|
|
44
|
+
|
|
45
|
+
realm_id: Realm['id'];
|
|
46
|
+
|
|
47
|
+
user_id: User['id'] | null;
|
|
48
|
+
|
|
49
|
+
robot_id: Robot['id'] | null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type AnalysisFileEventContext = DomainEventBaseContext & {
|
|
53
|
+
type: `${DomainType.ANALYSIS_BUCKET_FILE}`,
|
|
54
|
+
data: AnalysisBucketFile
|
|
55
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022-2024.
|
|
3
|
+
* Author Peter Placzek (tada5hi)
|
|
4
|
+
* For the full copyright and license information,
|
|
5
|
+
* view the LICENSE file that was distributed with this source code.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { Realm } from '@authup/core-kit';
|
|
9
|
+
import type { DomainType } from '../constants';
|
|
10
|
+
import type {
|
|
11
|
+
Analysis,
|
|
12
|
+
} from '../analysis';
|
|
13
|
+
import type { DomainEventBaseContext } from '../types-base';
|
|
14
|
+
|
|
15
|
+
export interface AnalysisLog {
|
|
16
|
+
id: string;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* e.g: building, routing, ...
|
|
20
|
+
*/
|
|
21
|
+
component: string | null;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* e.g: process, check, stop, ...
|
|
25
|
+
*/
|
|
26
|
+
command: string | null;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* e.g checking, checked
|
|
30
|
+
*/
|
|
31
|
+
event: string | null;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* e.g: init, ...
|
|
35
|
+
*/
|
|
36
|
+
step: string | null;
|
|
37
|
+
|
|
38
|
+
error: boolean;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* e.g: trainNotBuild, entrypointNotFound, ...
|
|
42
|
+
*/
|
|
43
|
+
error_code: string | null;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* e.g. started, finished, failed, ...
|
|
47
|
+
*/
|
|
48
|
+
status: string | null;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* e.g: error_message
|
|
52
|
+
*/
|
|
53
|
+
status_message: string | null;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* e.g: {station_id: xxx, station_index: 0}
|
|
57
|
+
*/
|
|
58
|
+
meta: string | null;
|
|
59
|
+
|
|
60
|
+
// ------------------------------------------------------------------
|
|
61
|
+
|
|
62
|
+
created_at: Date;
|
|
63
|
+
|
|
64
|
+
updated_at: Date;
|
|
65
|
+
|
|
66
|
+
// ------------------------------------------------------------------
|
|
67
|
+
|
|
68
|
+
analysis_id: Analysis['id'];
|
|
69
|
+
|
|
70
|
+
analysis: Analysis;
|
|
71
|
+
|
|
72
|
+
realm_id: Realm['id'];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export type AnalysisLogEventContext = DomainEventBaseContext & {
|
|
76
|
+
type: `${DomainType.ANALYSIS_LOG}`,
|
|
77
|
+
data: AnalysisLog
|
|
78
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2024.
|
|
3
|
+
* Author Peter Placzek (tada5hi)
|
|
4
|
+
* For the full copyright and license information,
|
|
5
|
+
* view the LICENSE file that was distributed with this source code.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export enum AnalysisNodeApprovalCommand {
|
|
9
|
+
APPROVE = 'approve',
|
|
10
|
+
REJECT = 'reject',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export enum AnalysisNodeApprovalStatus {
|
|
14
|
+
REJECTED = 'rejected',
|
|
15
|
+
APPROVED = 'approved',
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// -------------------------------------------------------------------------
|
|
19
|
+
|
|
20
|
+
export enum AnalysisNodeRunStatus {
|
|
21
|
+
ARRIVED = 'arrived',
|
|
22
|
+
PULLED = 'pulled',
|
|
23
|
+
PUSHED = 'pushed', // todo: this won't happen anymore
|
|
24
|
+
DEPARTED = 'departed', // todo: this won't happen anymore
|
|
25
|
+
FAILED = 'failed', // todo: this won't happen anymore
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// -------------------------------------------------------------------------
|
|
29
|
+
|
|
30
|
+
export enum AnalysisNodeStatic {
|
|
31
|
+
INCOMING = 'incoming',
|
|
32
|
+
OUTGOING = 'outgoing',
|
|
33
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2024.
|
|
3
|
+
* Author Peter Placzek (tada5hi)
|
|
4
|
+
* For the full copyright and license information,
|
|
5
|
+
* view the LICENSE file that was distributed with this source code.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { Realm } from '@authup/core-kit';
|
|
9
|
+
import type { DomainType } from '../constants';
|
|
10
|
+
import type { Node } from '../node';
|
|
11
|
+
import type { Analysis } from '../analysis';
|
|
12
|
+
import type { DomainEventBaseContext } from '../types-base';
|
|
13
|
+
import type { AnalysisNodeApprovalStatus, AnalysisNodeRunStatus } from './constants';
|
|
14
|
+
|
|
15
|
+
export interface AnalysisNode {
|
|
16
|
+
id: string;
|
|
17
|
+
|
|
18
|
+
// ------------------------------------------------------------------
|
|
19
|
+
|
|
20
|
+
approval_status: AnalysisNodeApprovalStatus | null;
|
|
21
|
+
|
|
22
|
+
run_status: AnalysisNodeRunStatus | null;
|
|
23
|
+
|
|
24
|
+
// ------------------------------------------------------------------
|
|
25
|
+
|
|
26
|
+
comment: string;
|
|
27
|
+
|
|
28
|
+
index: number;
|
|
29
|
+
|
|
30
|
+
// ------------------------------------------------------------------
|
|
31
|
+
|
|
32
|
+
artifact_tag: string | null;
|
|
33
|
+
|
|
34
|
+
artifact_digest: string | null;
|
|
35
|
+
|
|
36
|
+
// ------------------------------------------------------------------
|
|
37
|
+
|
|
38
|
+
created_at: Date;
|
|
39
|
+
|
|
40
|
+
updated_at: Date;
|
|
41
|
+
|
|
42
|
+
// ------------------------------------------------------------------
|
|
43
|
+
|
|
44
|
+
analysis_id: Analysis['id'];
|
|
45
|
+
|
|
46
|
+
analysis: Analysis;
|
|
47
|
+
|
|
48
|
+
analysis_realm_id: Realm['id'];
|
|
49
|
+
|
|
50
|
+
node_id: Node['id'];
|
|
51
|
+
|
|
52
|
+
node: Node;
|
|
53
|
+
|
|
54
|
+
node_realm_id: Realm['id'];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type TrainStationEventContext = DomainEventBaseContext & {
|
|
58
|
+
type: `${DomainType.ANALYSIS_NODE}`,
|
|
59
|
+
data: AnalysisNode
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export type AnalyseNodeSocketEventData = Record<string, { online: boolean, realmId: string }>;
|
|
63
|
+
export type AnalyseNodeSocketCTSEvents = {
|
|
64
|
+
analysisNodes: (id: Analysis['id'], cb?: (err: null | Error, data: AnalyseNodeSocketEventData) => void) => void
|
|
65
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2024.
|
|
3
|
+
* Author Peter Placzek (tada5hi)
|
|
4
|
+
* For the full copyright and license information,
|
|
5
|
+
* view the LICENSE file that was distributed with this source code.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export enum DomainType {
|
|
9
|
+
MASTER_IMAGE = 'masterImage',
|
|
10
|
+
MASTER_IMAGE_GROUP = 'masterImageGroup',
|
|
11
|
+
PROJECT = 'project',
|
|
12
|
+
PROJECT_NODE = 'projectNode',
|
|
13
|
+
REGISTRY = 'registry',
|
|
14
|
+
REGISTRY_PROJECT = 'registryProject',
|
|
15
|
+
NODE = 'node',
|
|
16
|
+
SERVICE = 'service',
|
|
17
|
+
ANALYSIS = 'analysis',
|
|
18
|
+
ANALYSIS_BUCKET = 'analysisBucket',
|
|
19
|
+
ANALYSIS_BUCKET_FILE = 'analysisBucketFile',
|
|
20
|
+
ANALYSIS_LOG = 'analysisLog',
|
|
21
|
+
ANALYSIS_NODE = 'analysisNode',
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export enum DomainSubType {
|
|
25
|
+
PROJECT_NODE_IN = 'projectNodeIn',
|
|
26
|
+
PROJECT_NODE_OUT = 'projectNodeOut',
|
|
27
|
+
ANALYSIS_NODE_IN = 'analysisNodeIn',
|
|
28
|
+
ANALYSIS_NODE_OUT = 'analysisNodeOut',
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export enum DomainEventName {
|
|
32
|
+
CREATED = 'created',
|
|
33
|
+
DELETED = 'deleted',
|
|
34
|
+
UPDATED = 'updated',
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export enum DomainEventSubscriptionName {
|
|
38
|
+
SUBSCRIBE = 'subscribe',
|
|
39
|
+
UNSUBSCRIBE = 'unsubscribe',
|
|
40
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2024.
|
|
3
|
+
* Author Peter Placzek (tada5hi)
|
|
4
|
+
* For the full copyright and license information,
|
|
5
|
+
* view the LICENSE file that was distributed with this source code.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export * from './analysis';
|
|
9
|
+
export * from './analysis-bucket';
|
|
10
|
+
export * from './analysis-bucket-file';
|
|
11
|
+
export * from './analysis-log';
|
|
12
|
+
export * from './analysis-node';
|
|
13
|
+
export * from './permission';
|
|
14
|
+
export * from './realm';
|
|
15
|
+
export * from './master-image-group';
|
|
16
|
+
export * from './master-image';
|
|
17
|
+
export * from './project';
|
|
18
|
+
export * from './project-node';
|
|
19
|
+
export * from './registry';
|
|
20
|
+
export * from './registry-project';
|
|
21
|
+
export * from './node';
|
|
22
|
+
export * from './service';
|
|
23
|
+
export * from './constants';
|
|
24
|
+
export * from './types';
|
|
25
|
+
export * from './types-base';
|
|
26
|
+
export * from './utils';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2024.
|
|
3
|
+
* Author Peter Placzek (tada5hi)
|
|
4
|
+
* For the full copyright and license information,
|
|
5
|
+
* view the LICENSE file that was distributed with this source code.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export enum MasterImageCommand {
|
|
9
|
+
SYNC = 'sync',
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export enum MasterImageGroupType {
|
|
13
|
+
LANGUAGE = 'language',
|
|
14
|
+
DEFAULT = 'default',
|
|
15
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2024.
|
|
3
|
+
* Author Peter Placzek (tada5hi)
|
|
4
|
+
* For the full copyright and license information,
|
|
5
|
+
* view the LICENSE file that was distributed with this source code.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { DomainType } from '../constants';
|
|
9
|
+
import type { DomainEventBaseContext } from '../types-base';
|
|
10
|
+
|
|
11
|
+
export interface MasterImage {
|
|
12
|
+
id: string;
|
|
13
|
+
|
|
14
|
+
path: string | null;
|
|
15
|
+
|
|
16
|
+
virtual_path: string;
|
|
17
|
+
|
|
18
|
+
group_virtual_path: string;
|
|
19
|
+
|
|
20
|
+
name: string;
|
|
21
|
+
|
|
22
|
+
command: string | null;
|
|
23
|
+
|
|
24
|
+
command_arguments: any | null;
|
|
25
|
+
|
|
26
|
+
// ------------------------------------------------------------------
|
|
27
|
+
|
|
28
|
+
created_at: Date;
|
|
29
|
+
|
|
30
|
+
updated_at: Date;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type MasterImageEventContext = DomainEventBaseContext & {
|
|
34
|
+
type: `${DomainType.MASTER_IMAGE}`,
|
|
35
|
+
data: MasterImage
|
|
36
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2024.
|
|
3
|
+
* Author Peter Placzek (tada5hi)
|
|
4
|
+
* For the full copyright and license information,
|
|
5
|
+
* view the LICENSE file that was distributed with this source code.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { DomainType } from '../constants';
|
|
9
|
+
import type { DomainEventBaseContext } from '../types-base';
|
|
10
|
+
|
|
11
|
+
export interface MasterImageGroup {
|
|
12
|
+
id: string;
|
|
13
|
+
|
|
14
|
+
name: string;
|
|
15
|
+
|
|
16
|
+
path: string;
|
|
17
|
+
|
|
18
|
+
virtual_path: string;
|
|
19
|
+
|
|
20
|
+
command: string | null;
|
|
21
|
+
|
|
22
|
+
command_arguments: any | null;
|
|
23
|
+
|
|
24
|
+
// ------------------------------------------------------------------
|
|
25
|
+
|
|
26
|
+
created_at: Date;
|
|
27
|
+
|
|
28
|
+
updated_at: Date;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type MasterImageGroupEventContext = DomainEventBaseContext & {
|
|
32
|
+
type: `${DomainType.MASTER_IMAGE_GROUP}`,
|
|
33
|
+
data: MasterImageGroup
|
|
34
|
+
};
|