@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,23 @@
|
|
|
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 NodeType {
|
|
9
|
+
AGGREGATOR = 'aggregator',
|
|
10
|
+
DEFAULT = 'default',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export enum NodeSocketClientEventName {
|
|
14
|
+
CONNECT = 'nodeConnect',
|
|
15
|
+
DISCONNECT = 'nodeDisconnect',
|
|
16
|
+
MESSAGE = 'nodeMessage',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export enum NodeSocketServerEventName {
|
|
20
|
+
CONNECTED = 'nodeConnected',
|
|
21
|
+
DISCONNECTED = 'nodeDisconnected',
|
|
22
|
+
MESSAGE = 'nodeMessage',
|
|
23
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
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 } from '@authup/core-kit';
|
|
9
|
+
import type { DomainType } from '../constants';
|
|
10
|
+
import type { RegistryProject } from '../registry-project';
|
|
11
|
+
import type { Registry } from '../registry';
|
|
12
|
+
import type { DomainEventBaseContext } from '../types-base';
|
|
13
|
+
import type { NodeType } from './constants';
|
|
14
|
+
|
|
15
|
+
export interface Node {
|
|
16
|
+
id: string;
|
|
17
|
+
|
|
18
|
+
external_name: string | null;
|
|
19
|
+
|
|
20
|
+
name: string;
|
|
21
|
+
|
|
22
|
+
hidden: boolean;
|
|
23
|
+
|
|
24
|
+
type: `${NodeType}`;
|
|
25
|
+
|
|
26
|
+
online: boolean;
|
|
27
|
+
|
|
28
|
+
// ------------------------------------------------------------------
|
|
29
|
+
|
|
30
|
+
registry_id: Registry['id'];
|
|
31
|
+
|
|
32
|
+
registry: Registry;
|
|
33
|
+
|
|
34
|
+
registry_project_id: RegistryProject['id'] | null;
|
|
35
|
+
|
|
36
|
+
registry_project: RegistryProject;
|
|
37
|
+
|
|
38
|
+
// ------------------------------------------------------------------
|
|
39
|
+
|
|
40
|
+
robot_id: Robot['id'] | null;
|
|
41
|
+
|
|
42
|
+
// ------------------------------------------------------------------
|
|
43
|
+
|
|
44
|
+
realm_id: Realm['id'];
|
|
45
|
+
|
|
46
|
+
// ------------------------------------------------------------------
|
|
47
|
+
|
|
48
|
+
created_at: Date;
|
|
49
|
+
|
|
50
|
+
updated_at: Date;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export type NodeEventContext = DomainEventBaseContext & {
|
|
54
|
+
type: `${DomainType.NODE}`,
|
|
55
|
+
data: Node
|
|
56
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
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 { PermissionName as AuthPermissionName } from '@authup/core-kit';
|
|
9
|
+
|
|
10
|
+
export enum PermissionKey {
|
|
11
|
+
BUCKET_ADD = 'bucket_add',
|
|
12
|
+
BUCKET_EDIT = 'bucket_edit',
|
|
13
|
+
BUCKET_DROP = 'bucket_drop',
|
|
14
|
+
|
|
15
|
+
PROJECT_ADD = 'project_add',
|
|
16
|
+
PROJECT_DROP = 'project_drop',
|
|
17
|
+
PROJECT_EDIT = 'project_edit',
|
|
18
|
+
PROJECT_APPROVE = 'project_approve',
|
|
19
|
+
|
|
20
|
+
REGISTRY_MANAGE = 'registry_manage',
|
|
21
|
+
REGISTRY_PROJECT_MANAGE = 'registry_project_manage',
|
|
22
|
+
|
|
23
|
+
NODE_ADD = 'node_add',
|
|
24
|
+
NODE_DROP = 'node_drop',
|
|
25
|
+
NODE_EDIT = 'node_edit',
|
|
26
|
+
|
|
27
|
+
ANALYSIS_APPROVE = 'analysis_approve',
|
|
28
|
+
ANALYSIS_EDIT = 'analysis_edit',
|
|
29
|
+
ANALYSIS_ADD = 'analysis_add',
|
|
30
|
+
ANALYSIS_EXECUTION_START = 'analysis_execution_start',
|
|
31
|
+
ANALYSIS_EXECUTION_STOP = 'analysis_execution_stop',
|
|
32
|
+
ANALYSIS_DROP = 'analysis_drop',
|
|
33
|
+
ANALYSIS_RESULT_READ = 'analysis_result_read', // todo: this is maybe not required anymore
|
|
34
|
+
|
|
35
|
+
MASTER_IMAGE_MANAGE = 'master_image_manage',
|
|
36
|
+
MASTER_IMAGE_GROUP_MANAGE = 'master_image_group_manage',
|
|
37
|
+
|
|
38
|
+
SERVICE_MANAGE = 'service_manage',
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const PermissionID = {
|
|
42
|
+
...PermissionKey,
|
|
43
|
+
...AuthPermissionName,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type PermissionIDType = typeof PermissionID[keyof typeof PermissionID];
|
|
@@ -0,0 +1,40 @@
|
|
|
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 { DomainEventBaseContext } from '../types-base';
|
|
12
|
+
|
|
13
|
+
export interface Project {
|
|
14
|
+
id: string;
|
|
15
|
+
|
|
16
|
+
name: string;
|
|
17
|
+
|
|
18
|
+
analyses: number;
|
|
19
|
+
|
|
20
|
+
// ------------------------------------------------------------------
|
|
21
|
+
|
|
22
|
+
created_at: Date;
|
|
23
|
+
|
|
24
|
+
updated_at: Date;
|
|
25
|
+
|
|
26
|
+
// ------------------------------------------------------------------
|
|
27
|
+
|
|
28
|
+
realm_id: Realm['id'];
|
|
29
|
+
|
|
30
|
+
user_id: User['id'];
|
|
31
|
+
|
|
32
|
+
master_image_id: MasterImage['id'] | null;
|
|
33
|
+
|
|
34
|
+
master_image: MasterImage | null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type ProjectEventContext = DomainEventBaseContext & {
|
|
38
|
+
type: `${DomainType.PROJECT}`,
|
|
39
|
+
data: Project
|
|
40
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
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 ProjectNodeApprovalCommand {
|
|
9
|
+
APPROVE = 'approve',
|
|
10
|
+
REJECT = 'reject',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export enum ProjectNodeApprovalStatus {
|
|
14
|
+
REJECTED = 'rejected',
|
|
15
|
+
APPROVED = 'approved',
|
|
16
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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 { Project } from '../project';
|
|
11
|
+
import type { Node } from '../node';
|
|
12
|
+
import type { DomainEventBaseContext } from '../types-base';
|
|
13
|
+
import type { ProjectNodeApprovalStatus } from './constants';
|
|
14
|
+
|
|
15
|
+
export interface ProjectNode {
|
|
16
|
+
id: string;
|
|
17
|
+
|
|
18
|
+
approval_status: ProjectNodeApprovalStatus | null;
|
|
19
|
+
|
|
20
|
+
comment: string | null;
|
|
21
|
+
|
|
22
|
+
// ------------------------------------------------------------------
|
|
23
|
+
|
|
24
|
+
created_at: Date;
|
|
25
|
+
|
|
26
|
+
updated_at: Date;
|
|
27
|
+
|
|
28
|
+
// ------------------------------------------------------------------
|
|
29
|
+
|
|
30
|
+
project_id: Project['id'];
|
|
31
|
+
|
|
32
|
+
project: Project;
|
|
33
|
+
|
|
34
|
+
project_realm_id: Realm['id'];
|
|
35
|
+
|
|
36
|
+
node_id: Node['id'];
|
|
37
|
+
|
|
38
|
+
node: Node;
|
|
39
|
+
|
|
40
|
+
node_realm_id: Realm['id'];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type ProjectNodeEventContext = DomainEventBaseContext & {
|
|
44
|
+
type: `${DomainType.PROJECT_NODE}`,
|
|
45
|
+
data: ProjectNode
|
|
46
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
|
|
10
|
+
export function buildSocketRealmNamespaceName(realmId: Realm['id']) {
|
|
11
|
+
return `/resources#${realmId}`;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function parseSocketRealmNamespaceName(name: string) : string | undefined {
|
|
15
|
+
return name.startsWith('/resources#') ?
|
|
16
|
+
name.substring('/resources#'.length) :
|
|
17
|
+
name;
|
|
18
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
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 const registryRobotSecretRegex = /^(?=.*[A-Z])(?=.*[a-z])(?=.*\d).{8,}$/;
|
|
@@ -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 Registry {
|
|
12
|
+
id: string;
|
|
13
|
+
|
|
14
|
+
name: string;
|
|
15
|
+
|
|
16
|
+
host: string;
|
|
17
|
+
|
|
18
|
+
// ------------------------------------------------------------------
|
|
19
|
+
|
|
20
|
+
account_name: string | null;
|
|
21
|
+
|
|
22
|
+
account_secret: string | null;
|
|
23
|
+
|
|
24
|
+
// ------------------------------------------------------------------
|
|
25
|
+
|
|
26
|
+
created_at: Date;
|
|
27
|
+
|
|
28
|
+
updated_at: Date;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type RegistryEventContext = DomainEventBaseContext & {
|
|
32
|
+
type: `${DomainType.REGISTRY}`,
|
|
33
|
+
data: Registry
|
|
34
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
export * from './constants';
|
|
9
|
+
export * from './entity';
|
|
10
|
+
export * from './utils';
|
|
@@ -0,0 +1,15 @@
|
|
|
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 { Registry } from './entity';
|
|
9
|
+
|
|
10
|
+
export function buildRegistryClientConnectionStringFromRegistry(entity: Registry) {
|
|
11
|
+
// todo: support other registries beside harbor and v2.0
|
|
12
|
+
|
|
13
|
+
const url = `https://${entity.host}/api/v2.0/`;
|
|
14
|
+
return `${entity.account_name}:${entity.account_secret}@${url}`;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
export enum RegistryProjectType {
|
|
9
|
+
DEFAULT = 'default',
|
|
10
|
+
AGGREGATOR = 'aggregator',
|
|
11
|
+
INCOMING = 'incoming',
|
|
12
|
+
OUTGOING = 'outgoing',
|
|
13
|
+
MASTER_IMAGES = 'masterImages',
|
|
14
|
+
NODE = 'node',
|
|
15
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
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 { Registry } from '../registry';
|
|
11
|
+
import type { DomainEventBaseContext } from '../types-base';
|
|
12
|
+
import type { RegistryProjectType } from './constants';
|
|
13
|
+
|
|
14
|
+
export interface RegistryProject {
|
|
15
|
+
id: string;
|
|
16
|
+
|
|
17
|
+
name: string;
|
|
18
|
+
|
|
19
|
+
type: `${RegistryProjectType}`;
|
|
20
|
+
|
|
21
|
+
public: boolean;
|
|
22
|
+
|
|
23
|
+
// ------------------------------------------------------------------
|
|
24
|
+
|
|
25
|
+
// a-z0-9-_ {0,255}
|
|
26
|
+
external_name: string;
|
|
27
|
+
|
|
28
|
+
external_id: string | null;
|
|
29
|
+
|
|
30
|
+
// ------------------------------------------------------------------
|
|
31
|
+
|
|
32
|
+
account_id: string | null;
|
|
33
|
+
|
|
34
|
+
account_name: string | null;
|
|
35
|
+
|
|
36
|
+
account_secret: string | null;
|
|
37
|
+
|
|
38
|
+
// ------------------------------------------------------------------
|
|
39
|
+
|
|
40
|
+
webhook_name: string | null;
|
|
41
|
+
|
|
42
|
+
webhook_exists: boolean | null;
|
|
43
|
+
|
|
44
|
+
// ------------------------------------------------------------------
|
|
45
|
+
|
|
46
|
+
registry_id: Registry['id'];
|
|
47
|
+
|
|
48
|
+
registry: Registry;
|
|
49
|
+
|
|
50
|
+
// ------------------------------------------------------------------
|
|
51
|
+
|
|
52
|
+
realm_id: Realm['id'] | null;
|
|
53
|
+
|
|
54
|
+
// ------------------------------------------------------------------
|
|
55
|
+
|
|
56
|
+
created_at: Date;
|
|
57
|
+
|
|
58
|
+
updated_at: Date;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export type RegistryProjectEventContext = DomainEventBaseContext & {
|
|
62
|
+
type: `${DomainType.REGISTRY_PROJECT}`,
|
|
63
|
+
data: RegistryProject
|
|
64
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
export * from './constants';
|
|
9
|
+
export * from './entity';
|
|
10
|
+
export * from './socket';
|
|
11
|
+
export * from './utils';
|
|
@@ -0,0 +1,12 @@
|
|
|
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 { RegistryProject } from './entity';
|
|
9
|
+
|
|
10
|
+
export function buildSocketRegistryProjectRoomName(id?: RegistryProject['id']) {
|
|
11
|
+
return `registry-projects${id ? `#${id}` : ''}`;
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
import { createNanoID } from '@privateaim/kit';
|
|
9
|
+
|
|
10
|
+
export function generateRegistryProjectId() {
|
|
11
|
+
return createNanoID('0123456789abcdefghijklmnopqrstuvwxyz');
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
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 ServiceID {
|
|
9
|
+
// Core Service(s)
|
|
10
|
+
SYSTEM = 'system',
|
|
11
|
+
|
|
12
|
+
// Third Party Service(s)
|
|
13
|
+
REGISTRY = 'registry',
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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 './registry';
|
|
9
|
+
export * from './secret-engine';
|
|
10
|
+
export * from './constants';
|
|
11
|
+
export * from './station-registry';
|
|
@@ -0,0 +1,40 @@
|
|
|
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 RegistryAPICommand {
|
|
9
|
+
SETUP = 'setup',
|
|
10
|
+
CLEANUP = 'cleanup',
|
|
11
|
+
DELETE = 'delete',
|
|
12
|
+
|
|
13
|
+
PROJECT_LINK = 'projectLink',
|
|
14
|
+
PROJECT_UNLINK = 'projectUnlink',
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Incoming train project name
|
|
19
|
+
*/
|
|
20
|
+
export const REGISTRY_INCOMING_PROJECT_NAME = 'incoming';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Outgoing train project name
|
|
24
|
+
*/
|
|
25
|
+
export const REGISTRY_OUTGOING_PROJECT_NAME = 'outgoing';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Master Image project name
|
|
29
|
+
*/
|
|
30
|
+
export const REGISTRY_MASTER_IMAGE_PROJECT_NAME = 'master';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Latest image tag
|
|
34
|
+
*/
|
|
35
|
+
export const REGISTRY_ARTIFACT_TAG_LATEST = 'latest';
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* base image tag
|
|
39
|
+
*/
|
|
40
|
+
export const REGISTRY_ARTIFACT_TAG_BASE = 'base';
|
|
@@ -0,0 +1,14 @@
|
|
|
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 SecretStorageAPICommand {
|
|
9
|
+
ENGINE_CREATE = 'engineCreate',
|
|
10
|
+
|
|
11
|
+
ENGINE_KEY_SAVE = 'engineKeySave',
|
|
12
|
+
ENGINE_KEY_PULL = 'engineKeyPull',
|
|
13
|
+
ENGINE_KEY_DROP = 'engineKeyDrop',
|
|
14
|
+
}
|
|
@@ -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
|
+
import type { SecretStorageAPICommand } from './constants';
|
|
9
|
+
|
|
10
|
+
export type SecretStorageCommandType = `${SecretStorageAPICommand}`;
|
|
@@ -0,0 +1,21 @@
|
|
|
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 { DomainEventName } from './constants';
|
|
9
|
+
|
|
10
|
+
export type DomainEntityWithID = {
|
|
11
|
+
[key: string]: any,
|
|
12
|
+
id: any
|
|
13
|
+
};
|
|
14
|
+
export type DomainEntityID<T> = T extends DomainEntityWithID ?
|
|
15
|
+
T['id'] :
|
|
16
|
+
never;
|
|
17
|
+
|
|
18
|
+
export type DomainEventBaseContext = {
|
|
19
|
+
event: `${DomainEventName}`,
|
|
20
|
+
type: string
|
|
21
|
+
};
|