@serve.zone/interfaces 5.0.4 → 5.4.2
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/.smartconfig.json +32 -0
- package/changelog.md +22 -0
- package/dist_ts/00_commitinfo_data.js +9 -0
- package/dist_ts/data/baremetal.d.ts +61 -0
- package/dist_ts/data/baremetal.js +2 -0
- package/{dist_ts_interfaces → dist_ts}/data/cloudlyconfig.d.ts +0 -2
- package/{dist_ts_interfaces → dist_ts}/data/cloudlyconfig.js +1 -1
- package/{dist_ts_interfaces → dist_ts}/data/cluster.d.ts +7 -3
- package/{dist_ts_interfaces → dist_ts}/data/cluster.js +1 -1
- package/dist_ts/data/clusternode.d.ts +59 -0
- package/dist_ts/data/clusternode.js +2 -0
- package/{dist_ts_interfaces → dist_ts}/data/config.js +1 -1
- package/dist_ts/data/deployment.d.ts +51 -0
- package/{dist_ts_interfaces → dist_ts}/data/deployment.js +1 -1
- package/dist_ts/data/dns.d.ts +85 -0
- package/dist_ts/data/dns.js +2 -0
- package/{dist_ts_interfaces → dist_ts}/data/docker.js +1 -1
- package/dist_ts/data/domain.d.ts +102 -0
- package/dist_ts/data/domain.js +2 -0
- package/{dist_ts_interfaces → dist_ts}/data/event.js +1 -1
- package/dist_ts/data/externalregistry.d.ts +92 -0
- package/{dist_ts_interfaces → dist_ts}/data/externalregistry.js +1 -1
- package/{dist_ts_interfaces → dist_ts}/data/image.js +1 -1
- package/{dist_ts_interfaces → dist_ts}/data/index.d.ts +6 -1
- package/dist_ts/data/index.js +22 -0
- package/{dist_ts_interfaces → dist_ts}/data/secretbundle.js +1 -1
- package/{dist_ts_interfaces → dist_ts}/data/secretgroup.js +1 -1
- package/{dist_ts_interfaces → dist_ts}/data/server.js +1 -1
- package/dist_ts/data/service.d.ts +75 -0
- package/{dist_ts_interfaces → dist_ts}/data/service.js +1 -1
- package/dist_ts/data/settings.d.ts +34 -0
- package/dist_ts/data/settings.js +2 -0
- package/{dist_ts_interfaces → dist_ts}/data/status.js +1 -1
- package/dist_ts/data/taskexecution.d.ts +72 -0
- package/dist_ts/data/taskexecution.js +2 -0
- package/{dist_ts_interfaces → dist_ts}/data/traffic.js +1 -1
- package/{dist_ts_interfaces → dist_ts}/data/user.js +1 -1
- package/{dist_ts_interfaces → dist_ts}/data/version.js +1 -1
- package/{dist_ts_interfaces → dist_ts}/index.js +1 -1
- package/{dist_ts_interfaces → dist_ts}/platformservice/aibridge.js +1 -1
- package/dist_ts/platformservice/index.js +7 -0
- package/{dist_ts_interfaces → dist_ts}/platformservice/letter.js +1 -1
- package/{dist_ts_interfaces → dist_ts}/platformservice/mta.js +1 -1
- package/dist_ts/platformservice/pushnotification.js +2 -0
- package/{dist_ts_interfaces → dist_ts}/platformservice/sms.js +1 -1
- package/{dist_ts_interfaces → dist_ts}/plugins.js +1 -1
- package/{dist_ts_interfaces → dist_ts}/requests/admin.js +1 -1
- package/dist_ts/requests/baremetal.d.ts +19 -0
- package/dist_ts/requests/baremetal.js +2 -0
- package/{dist_ts_interfaces → dist_ts}/requests/certificate.js +1 -1
- package/{dist_ts_interfaces → dist_ts}/requests/cluster.d.ts +1 -0
- package/{dist_ts_interfaces → dist_ts}/requests/cluster.js +1 -1
- package/{dist_ts_interfaces → dist_ts}/requests/config.js +1 -1
- package/dist_ts/requests/deployment.d.ts +96 -0
- package/dist_ts/requests/deployment.js +2 -0
- package/dist_ts/requests/dns.d.ts +63 -0
- package/dist_ts/requests/dns.js +2 -0
- package/dist_ts/requests/domain.d.ts +69 -0
- package/dist_ts/requests/domain.js +2 -0
- package/{dist_ts_interfaces → dist_ts}/requests/externalregistry.d.ts +13 -0
- package/dist_ts/requests/externalregistry.js +4 -0
- package/{dist_ts_interfaces → dist_ts}/requests/identity.js +1 -1
- package/{dist_ts_interfaces → dist_ts}/requests/image.js +1 -1
- package/dist_ts/requests/index.d.ts +26 -0
- package/dist_ts/requests/index.js +28 -0
- package/{dist_ts_interfaces → dist_ts}/requests/inform.js +1 -1
- package/{dist_ts_interfaces → dist_ts}/requests/log.js +1 -1
- package/{dist_ts_interfaces → dist_ts}/requests/network.js +1 -1
- package/dist_ts/requests/node.d.ts +29 -0
- package/dist_ts/requests/node.js +2 -0
- package/{dist_ts_interfaces → dist_ts}/requests/routing.js +1 -1
- package/{dist_ts_interfaces → dist_ts}/requests/secretbundle.js +1 -1
- package/{dist_ts_interfaces → dist_ts}/requests/secretgroup.js +1 -1
- package/{dist_ts_interfaces → dist_ts}/requests/server.js +1 -1
- package/{dist_ts_interfaces → dist_ts}/requests/service.js +1 -1
- package/dist_ts/requests/settings.d.ts +49 -0
- package/dist_ts/requests/settings.js +2 -0
- package/{dist_ts_interfaces → dist_ts}/requests/status.js +1 -1
- package/dist_ts/requests/task.d.ts +65 -0
- package/dist_ts/requests/task.js +4 -0
- package/{dist_ts_interfaces → dist_ts}/requests/version.js +1 -1
- package/license +1 -1
- package/package.json +43 -18
- package/readme.md +12 -206
- package/{ts_interfaces → ts}/00_commitinfo_data.ts +2 -2
- package/ts/data/baremetal.ts +73 -0
- package/{ts_interfaces → ts}/data/cloudlyconfig.ts +0 -2
- package/{ts_interfaces → ts}/data/cluster.ts +8 -3
- package/ts/data/clusternode.ts +71 -0
- package/ts/data/deployment.ts +63 -0
- package/ts/data/dns.ts +100 -0
- package/ts/data/domain.ts +124 -0
- package/ts/data/externalregistry.ts +110 -0
- package/{ts_interfaces → ts}/data/index.ts +7 -2
- package/ts/data/service.ts +77 -0
- package/ts/data/settings.ts +56 -0
- package/ts/data/taskexecution.ts +84 -0
- package/ts/requests/baremetal.ts +22 -0
- package/{ts_interfaces → ts}/requests/cluster.ts +1 -0
- package/ts/requests/deployment.ts +141 -0
- package/ts/requests/dns.ts +93 -0
- package/ts/requests/domain.ts +99 -0
- package/{ts_interfaces → ts}/requests/externalregistry.ts +17 -0
- package/{ts_interfaces → ts}/requests/index.ts +14 -0
- package/ts/requests/node.ts +33 -0
- package/ts/requests/settings.ts +59 -0
- package/ts/requests/task.ts +95 -0
- package/cli.js +0 -4
- package/dist_ts_interfaces/00_commitinfo_data.js +0 -9
- package/dist_ts_interfaces/data/deployment.d.ts +0 -11
- package/dist_ts_interfaces/data/externalregistry.d.ts +0 -10
- package/dist_ts_interfaces/data/index.js +0 -17
- package/dist_ts_interfaces/data/service.d.ts +0 -37
- package/dist_ts_interfaces/platformservice/index.js +0 -7
- package/dist_ts_interfaces/platformservice/pushnotification.js +0 -2
- package/dist_ts_interfaces/requests/externalregistry.js +0 -4
- package/dist_ts_interfaces/requests/index.d.ts +0 -19
- package/dist_ts_interfaces/requests/index.js +0 -21
- package/ts_interfaces/data/deployment.ts +0 -13
- package/ts_interfaces/data/externalregistry.ts +0 -12
- package/ts_interfaces/data/service.ts +0 -34
- package/ts_interfaces/readme.md +0 -223
- package/ts_interfaces/tspublish.json +0 -13
- /package/{dist_ts_interfaces → dist_ts}/00_commitinfo_data.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/data/config.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/data/docker.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/data/event.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/data/image.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/data/secretbundle.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/data/secretgroup.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/data/server.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/data/status.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/data/traffic.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/data/user.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/data/version.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/index.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/platformservice/aibridge.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/platformservice/index.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/platformservice/letter.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/platformservice/mta.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/platformservice/pushnotification.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/platformservice/sms.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/plugins.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/requests/admin.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/requests/certificate.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/requests/config.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/requests/identity.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/requests/image.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/requests/inform.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/requests/log.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/requests/network.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/requests/routing.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/requests/secretbundle.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/requests/secretgroup.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/requests/server.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/requests/service.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/requests/status.d.ts +0 -0
- /package/{dist_ts_interfaces → dist_ts}/requests/version.d.ts +0 -0
- /package/{ts_interfaces → ts}/data/config.ts +0 -0
- /package/{ts_interfaces → ts}/data/docker.ts +0 -0
- /package/{ts_interfaces → ts}/data/event.ts +0 -0
- /package/{ts_interfaces → ts}/data/image.ts +0 -0
- /package/{ts_interfaces → ts}/data/secretbundle.ts +0 -0
- /package/{ts_interfaces → ts}/data/secretgroup.ts +0 -0
- /package/{ts_interfaces → ts}/data/server.ts +0 -0
- /package/{ts_interfaces → ts}/data/status.ts +0 -0
- /package/{ts_interfaces → ts}/data/traffic.ts +0 -0
- /package/{ts_interfaces → ts}/data/user.ts +0 -0
- /package/{ts_interfaces → ts}/data/version.ts +0 -0
- /package/{ts_interfaces → ts}/index.ts +0 -0
- /package/{ts_interfaces → ts}/platformservice/00readme.md +0 -0
- /package/{ts_interfaces → ts}/platformservice/aibridge.ts +0 -0
- /package/{ts_interfaces → ts}/platformservice/index.ts +0 -0
- /package/{ts_interfaces → ts}/platformservice/letter.ts +0 -0
- /package/{ts_interfaces → ts}/platformservice/mta.ts +0 -0
- /package/{ts_interfaces → ts}/platformservice/pushnotification.ts +0 -0
- /package/{ts_interfaces → ts}/platformservice/sms.ts +0 -0
- /package/{ts_interfaces → ts}/plugins.ts +0 -0
- /package/{ts_interfaces → ts}/requests/admin.ts +0 -0
- /package/{ts_interfaces → ts}/requests/certificate.ts +0 -0
- /package/{ts_interfaces → ts}/requests/config.ts +0 -0
- /package/{ts_interfaces → ts}/requests/identity.ts +0 -0
- /package/{ts_interfaces → ts}/requests/image.ts +0 -0
- /package/{ts_interfaces → ts}/requests/inform.ts +0 -0
- /package/{ts_interfaces → ts}/requests/log.ts +0 -0
- /package/{ts_interfaces → ts}/requests/network.ts +0 -0
- /package/{ts_interfaces → ts}/requests/routing.ts +0 -0
- /package/{ts_interfaces → ts}/requests/secretbundle.ts +0 -0
- /package/{ts_interfaces → ts}/requests/secretgroup.ts +0 -0
- /package/{ts_interfaces → ts}/requests/server.ts +0 -0
- /package/{ts_interfaces → ts}/requests/service.ts +0 -0
- /package/{ts_interfaces → ts}/requests/status.ts +0 -0
- /package/{ts_interfaces → ts}/requests/version.ts +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
|
|
3
|
+
export interface IBareMetal {
|
|
4
|
+
id: string;
|
|
5
|
+
data: {
|
|
6
|
+
hostname: string;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* IPMI management IP address
|
|
10
|
+
*/
|
|
11
|
+
ipmiAddress?: string;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Encrypted IPMI credentials
|
|
15
|
+
*/
|
|
16
|
+
ipmiCredentials?: {
|
|
17
|
+
username: string;
|
|
18
|
+
passwordEncrypted: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Primary network IP address
|
|
23
|
+
*/
|
|
24
|
+
primaryIp: string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Provider of the physical server
|
|
28
|
+
*/
|
|
29
|
+
provider: 'hetzner' | 'aws' | 'digitalocean' | 'onpremise';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Data center or location
|
|
33
|
+
*/
|
|
34
|
+
location: string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Hardware specifications
|
|
38
|
+
*/
|
|
39
|
+
specs: {
|
|
40
|
+
cpuModel: string;
|
|
41
|
+
cpuCores: number;
|
|
42
|
+
memoryGB: number;
|
|
43
|
+
storageGB: number;
|
|
44
|
+
storageType: 'ssd' | 'hdd' | 'nvme';
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Current power state
|
|
49
|
+
*/
|
|
50
|
+
powerState: 'on' | 'off' | 'unknown';
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Operating system information
|
|
54
|
+
*/
|
|
55
|
+
osInfo: {
|
|
56
|
+
name: string;
|
|
57
|
+
version: string;
|
|
58
|
+
kernel?: string;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Array of ClusterNode IDs running on this hardware
|
|
63
|
+
*/
|
|
64
|
+
assignedNodeIds: string[];
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Metadata for provider-specific information
|
|
68
|
+
*/
|
|
69
|
+
providerMetadata?: {
|
|
70
|
+
[key: string]: any;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as plugins from '../plugins.js';
|
|
2
2
|
|
|
3
3
|
import { type IDockerRegistryInfo } from '../data/docker.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { IClusterNode } from './clusternode.js';
|
|
5
5
|
|
|
6
6
|
export interface ICluster {
|
|
7
7
|
id: string;
|
|
@@ -19,9 +19,14 @@ export interface ICluster {
|
|
|
19
19
|
cloudlyUrl?: string;
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Cluster setup mode - manual by default, or auto-provision with cloud provider
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
setupMode?: 'manual' | 'hetzner' | 'aws' | 'digitalocean';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Nodes that are part of the cluster
|
|
28
|
+
*/
|
|
29
|
+
nodes: IClusterNode[];
|
|
25
30
|
|
|
26
31
|
/**
|
|
27
32
|
* ACME info. This is used to get SSL certificates.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
|
|
3
|
+
export interface IClusterNodeMetrics {
|
|
4
|
+
cpuUsagePercent: number;
|
|
5
|
+
memoryUsedMB: number;
|
|
6
|
+
memoryAvailableMB: number;
|
|
7
|
+
diskUsedGB: number;
|
|
8
|
+
diskAvailableGB: number;
|
|
9
|
+
containerCount: number;
|
|
10
|
+
timestamp: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface IClusterNode {
|
|
14
|
+
id: string;
|
|
15
|
+
data: {
|
|
16
|
+
/**
|
|
17
|
+
* Reference to the cluster this node belongs to
|
|
18
|
+
*/
|
|
19
|
+
clusterId: string;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Reference to the physical server (if applicable)
|
|
23
|
+
*/
|
|
24
|
+
baremetalId?: string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Type of node
|
|
28
|
+
*/
|
|
29
|
+
nodeType: 'baremetal' | 'vm' | 'container';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Current status of the node
|
|
33
|
+
*/
|
|
34
|
+
status: 'initializing' | 'online' | 'offline' | 'maintenance';
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Role of the node in the cluster
|
|
38
|
+
*/
|
|
39
|
+
role: 'master' | 'worker';
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Timestamp when node joined the cluster
|
|
43
|
+
*/
|
|
44
|
+
joinedAt: number;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Last health check timestamp
|
|
48
|
+
*/
|
|
49
|
+
lastHealthCheck: number;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Current metrics for the node
|
|
53
|
+
*/
|
|
54
|
+
metrics?: IClusterNodeMetrics;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Docker swarm node ID if part of swarm
|
|
58
|
+
*/
|
|
59
|
+
swarmNodeId?: string;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* SSH keys deployed to this node
|
|
63
|
+
*/
|
|
64
|
+
sshKeys: plugins.tsclass.network.ISshKey[];
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Debian packages installed on this node
|
|
68
|
+
*/
|
|
69
|
+
requiredDebianPackages: string[];
|
|
70
|
+
};
|
|
71
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* a deployment happens when a service is deployed
|
|
5
|
+
* tracks the status of a deployment
|
|
6
|
+
*/
|
|
7
|
+
export interface IDeployment {
|
|
8
|
+
id: string;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The service being deployed (single service per deployment)
|
|
12
|
+
*/
|
|
13
|
+
serviceId: string;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The node this deployment is running on
|
|
17
|
+
*/
|
|
18
|
+
nodeId: string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Docker container ID for this deployment
|
|
22
|
+
*/
|
|
23
|
+
containerId?: string;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Image used for this deployment
|
|
27
|
+
*/
|
|
28
|
+
usedImageId: string;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Version of the service deployed
|
|
32
|
+
*/
|
|
33
|
+
version: string;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Timestamp when deployed
|
|
37
|
+
*/
|
|
38
|
+
deployedAt: number;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Deployment log entries
|
|
42
|
+
*/
|
|
43
|
+
deploymentLog: string[];
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Current status of the deployment
|
|
47
|
+
*/
|
|
48
|
+
status: 'scheduled' | 'starting' | 'running' | 'stopping' | 'stopped' | 'failed';
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Health status of the deployment
|
|
52
|
+
*/
|
|
53
|
+
healthStatus?: 'healthy' | 'unhealthy' | 'unknown';
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Resource usage for this deployment
|
|
57
|
+
*/
|
|
58
|
+
resourceUsage?: {
|
|
59
|
+
cpuUsagePercent: number;
|
|
60
|
+
memoryUsedMB: number;
|
|
61
|
+
lastUpdated: number;
|
|
62
|
+
};
|
|
63
|
+
}
|
package/ts/data/dns.ts
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
export type TDnsRecordType = 'A' | 'AAAA' | 'CNAME' | 'MX' | 'TXT' | 'NS' | 'SOA' | 'SRV' | 'CAA' | 'PTR';
|
|
2
|
+
|
|
3
|
+
export interface IDnsEntry {
|
|
4
|
+
id: string;
|
|
5
|
+
data: {
|
|
6
|
+
/**
|
|
7
|
+
* The DNS record type
|
|
8
|
+
*/
|
|
9
|
+
type: TDnsRecordType;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The DNS record name (e.g., www, @, mail)
|
|
13
|
+
* @ represents the root domain
|
|
14
|
+
*/
|
|
15
|
+
name: string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The value of the DNS record
|
|
19
|
+
* - For A/AAAA: IP address
|
|
20
|
+
* - For CNAME: Target domain
|
|
21
|
+
* - For MX: Mail server hostname
|
|
22
|
+
* - For TXT: Text value
|
|
23
|
+
* - For NS: Nameserver hostname
|
|
24
|
+
* - For SRV: Target hostname
|
|
25
|
+
* - For CAA: CAA record value
|
|
26
|
+
* - For PTR: Domain name
|
|
27
|
+
*/
|
|
28
|
+
value: string;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Time to live in seconds
|
|
32
|
+
* Default: 3600 (1 hour)
|
|
33
|
+
*/
|
|
34
|
+
ttl: number;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Priority (used for MX and SRV records)
|
|
38
|
+
* Lower values have higher priority
|
|
39
|
+
*/
|
|
40
|
+
priority?: number;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The DNS zone this entry belongs to
|
|
44
|
+
* e.g., example.com
|
|
45
|
+
* @deprecated Use domainId instead
|
|
46
|
+
*/
|
|
47
|
+
zone: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The domain ID this DNS entry belongs to
|
|
51
|
+
* Links to the Domain entity
|
|
52
|
+
*/
|
|
53
|
+
domainId?: string;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Additional fields for SRV records
|
|
57
|
+
*/
|
|
58
|
+
weight?: number;
|
|
59
|
+
port?: number;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Whether this DNS entry is active
|
|
63
|
+
*/
|
|
64
|
+
active: boolean;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Optional description for documentation
|
|
68
|
+
*/
|
|
69
|
+
description?: string;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Timestamp when the entry was created
|
|
73
|
+
*/
|
|
74
|
+
createdAt?: number;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Timestamp when the entry was last updated
|
|
78
|
+
*/
|
|
79
|
+
updatedAt?: number;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Whether this DNS entry was auto-generated
|
|
83
|
+
*/
|
|
84
|
+
isAutoGenerated?: boolean;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The service ID that created this DNS entry (for auto-generated entries)
|
|
88
|
+
*/
|
|
89
|
+
sourceServiceId?: string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The source type of this DNS entry
|
|
93
|
+
* - manual: Created by user through UI/API
|
|
94
|
+
* - service: Auto-generated from service configuration
|
|
95
|
+
* - system: Created by system processes
|
|
96
|
+
* - external: Synced from external DNS providers
|
|
97
|
+
*/
|
|
98
|
+
sourceType?: 'manual' | 'service' | 'system' | 'external';
|
|
99
|
+
};
|
|
100
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
export type TDomainStatus = 'active' | 'pending' | 'expired' | 'suspended' | 'transferred';
|
|
2
|
+
export type TDomainVerificationStatus = 'verified' | 'pending' | 'failed' | 'not_required';
|
|
3
|
+
|
|
4
|
+
export interface IDomain {
|
|
5
|
+
id: string;
|
|
6
|
+
data: {
|
|
7
|
+
/**
|
|
8
|
+
* The domain name (e.g., example.com)
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Description or notes about the domain
|
|
14
|
+
*/
|
|
15
|
+
description?: string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Current status of the domain
|
|
19
|
+
*/
|
|
20
|
+
status: TDomainStatus;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Domain verification status
|
|
24
|
+
*/
|
|
25
|
+
verificationStatus: TDomainVerificationStatus;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Nameservers for the domain
|
|
29
|
+
*/
|
|
30
|
+
nameservers: string[];
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Domain registrar information
|
|
34
|
+
*/
|
|
35
|
+
registrar?: {
|
|
36
|
+
name: string;
|
|
37
|
+
url?: string;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Domain registration date (timestamp)
|
|
42
|
+
*/
|
|
43
|
+
registeredAt?: number;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Domain expiration date (timestamp)
|
|
47
|
+
*/
|
|
48
|
+
expiresAt?: number;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Whether auto-renewal is enabled
|
|
52
|
+
*/
|
|
53
|
+
autoRenew: boolean;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* DNSSEC enabled
|
|
57
|
+
*/
|
|
58
|
+
dnssecEnabled?: boolean;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Tags for categorization
|
|
62
|
+
*/
|
|
63
|
+
tags?: string[];
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Whether this domain is primary for the organization
|
|
67
|
+
*/
|
|
68
|
+
isPrimary?: boolean;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* SSL certificate status
|
|
72
|
+
*/
|
|
73
|
+
sslStatus?: 'active' | 'pending' | 'expired' | 'none';
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Cloudly activation state controls whether we actively manage DNS/certificates
|
|
77
|
+
* - available: discovered/imported, not actively managed
|
|
78
|
+
* - activated: actively managed (DNS edits allowed, certs considered)
|
|
79
|
+
* - ignored: explicitly ignored from management/automation
|
|
80
|
+
*/
|
|
81
|
+
activationState?: 'available' | 'activated' | 'ignored';
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Last verification attempt timestamp
|
|
85
|
+
*/
|
|
86
|
+
lastVerificationAt?: number;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Verification method used
|
|
90
|
+
*/
|
|
91
|
+
verificationMethod?: 'dns' | 'http' | 'email' | 'manual';
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Verification token (for DNS/HTTP verification)
|
|
95
|
+
*/
|
|
96
|
+
verificationToken?: string;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Cloudflare zone ID if managed by Cloudflare
|
|
100
|
+
*/
|
|
101
|
+
cloudflareZoneId?: string;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Sync metadata
|
|
105
|
+
*/
|
|
106
|
+
syncSource?: 'cloudflare' | 'manual' | null;
|
|
107
|
+
lastSyncAt?: number;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Whether domain is managed externally
|
|
111
|
+
*/
|
|
112
|
+
isExternal?: boolean;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Creation timestamp
|
|
116
|
+
*/
|
|
117
|
+
createdAt?: number;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Last update timestamp
|
|
121
|
+
*/
|
|
122
|
+
updatedAt?: number;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
|
|
3
|
+
export interface IExternalRegistry {
|
|
4
|
+
id: string;
|
|
5
|
+
data: {
|
|
6
|
+
/**
|
|
7
|
+
* Registry type
|
|
8
|
+
*/
|
|
9
|
+
type: 'docker' | 'npm';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Human-readable name for the registry
|
|
13
|
+
*/
|
|
14
|
+
name: string;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Registry URL (e.g., https://registry.gitlab.com, docker.io)
|
|
18
|
+
*/
|
|
19
|
+
url: string;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Username for authentication (optional for token-based or public registries)
|
|
23
|
+
*/
|
|
24
|
+
username?: string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Password, access token, or API key for authentication (optional for public registries)
|
|
28
|
+
*/
|
|
29
|
+
password?: string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Optional description
|
|
33
|
+
*/
|
|
34
|
+
description?: string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Whether this is the default registry for its type
|
|
38
|
+
*/
|
|
39
|
+
isDefault?: boolean;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Authentication type
|
|
43
|
+
*/
|
|
44
|
+
authType?: 'none' | 'basic' | 'token' | 'oauth2';
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Allow insecure registry connections (HTTP or self-signed certs)
|
|
48
|
+
*/
|
|
49
|
+
insecure?: boolean;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Optional namespace/organization for the registry
|
|
53
|
+
*/
|
|
54
|
+
namespace?: string;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Proxy configuration
|
|
58
|
+
*/
|
|
59
|
+
proxy?: {
|
|
60
|
+
http?: string;
|
|
61
|
+
https?: string;
|
|
62
|
+
noProxy?: string;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Registry-specific configuration
|
|
67
|
+
*/
|
|
68
|
+
config?: {
|
|
69
|
+
/**
|
|
70
|
+
* For Docker registries
|
|
71
|
+
*/
|
|
72
|
+
dockerConfig?: {
|
|
73
|
+
email?: string;
|
|
74
|
+
serverAddress?: string;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* For npm registries
|
|
78
|
+
*/
|
|
79
|
+
npmConfig?: {
|
|
80
|
+
scope?: string;
|
|
81
|
+
alwaysAuth?: boolean;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Status of the registry connection
|
|
87
|
+
*/
|
|
88
|
+
status?: 'active' | 'inactive' | 'error' | 'unverified';
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Last error message if status is 'error'
|
|
92
|
+
*/
|
|
93
|
+
lastError?: string;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Timestamp when the registry was last successfully verified
|
|
97
|
+
*/
|
|
98
|
+
lastVerified?: number;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Timestamp when the registry was created
|
|
102
|
+
*/
|
|
103
|
+
createdAt?: number;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Timestamp when the registry was last updated
|
|
107
|
+
*/
|
|
108
|
+
updatedAt?: number;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
@@ -2,15 +2,20 @@ export * from './cloudlyconfig.js';
|
|
|
2
2
|
export * from './cluster.js';
|
|
3
3
|
export * from './config.js';
|
|
4
4
|
export * from './deployment.js';
|
|
5
|
+
export * from './dns.js';
|
|
5
6
|
export * from './docker.js';
|
|
7
|
+
export * from './domain.js';
|
|
6
8
|
export * from './event.js';
|
|
7
9
|
export * from './externalregistry.js';
|
|
8
10
|
export * from './image.js';
|
|
9
11
|
export * from './secretbundle.js';
|
|
10
|
-
export * from './secretgroup.js'
|
|
11
|
-
export * from './
|
|
12
|
+
export * from './secretgroup.js';
|
|
13
|
+
export * from './baremetal.js';
|
|
14
|
+
export * from './clusternode.js';
|
|
15
|
+
export * from './settings.js';
|
|
12
16
|
export * from './service.js';
|
|
13
17
|
export * from './status.js';
|
|
18
|
+
export * from './taskexecution.js';
|
|
14
19
|
export * from './traffic.js';
|
|
15
20
|
export * from './user.js';
|
|
16
21
|
export * from './version.js';
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { IServiceRessources } from './docker.js';
|
|
2
|
+
|
|
3
|
+
export interface IService {
|
|
4
|
+
id: string;
|
|
5
|
+
data: {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
imageId: string;
|
|
9
|
+
imageVersion: string;
|
|
10
|
+
environment: { [key: string]: string };
|
|
11
|
+
/**
|
|
12
|
+
* the main secret bundle id, exclusive to the service
|
|
13
|
+
*/
|
|
14
|
+
secretBundleId: string;
|
|
15
|
+
/**
|
|
16
|
+
* those secret bundle ids do not belong to the service itself
|
|
17
|
+
* and thus live past the service lifecycle
|
|
18
|
+
*/
|
|
19
|
+
additionalSecretBundleIds?: string[];
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Service category determines deployment behavior
|
|
23
|
+
* - base: Core services that run on every node (coreflow, coretraffic, corelog)
|
|
24
|
+
* - distributed: Services that run on limited nodes (cores3, coremongo)
|
|
25
|
+
* - workload: User applications
|
|
26
|
+
*/
|
|
27
|
+
serviceCategory: 'base' | 'distributed' | 'workload';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Deployment strategy for the service
|
|
31
|
+
* - all-nodes: Deploy to every node in the cluster
|
|
32
|
+
* - limited-replicas: Deploy to a limited number of nodes
|
|
33
|
+
* - custom: Custom deployment logic
|
|
34
|
+
*/
|
|
35
|
+
deploymentStrategy: 'all-nodes' | 'limited-replicas' | 'custom';
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Maximum number of replicas for distributed services
|
|
39
|
+
* For example, 3 for cores3 or coremongo
|
|
40
|
+
*/
|
|
41
|
+
maxReplicas?: number;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Whether to enforce anti-affinity rules
|
|
45
|
+
* When true, tries to spread deployments across different BareMetal servers
|
|
46
|
+
*/
|
|
47
|
+
antiAffinity?: boolean;
|
|
48
|
+
|
|
49
|
+
scaleFactor: number;
|
|
50
|
+
balancingStrategy: 'round-robin' | 'least-connections';
|
|
51
|
+
ports: {
|
|
52
|
+
web: number;
|
|
53
|
+
custom?: { [domain: string]: string };
|
|
54
|
+
};
|
|
55
|
+
resources?: IServiceRessources;
|
|
56
|
+
domains: {
|
|
57
|
+
/**
|
|
58
|
+
* Optional domain ID to specify which domain to use
|
|
59
|
+
* If not specified, will use the default domain or require manual configuration
|
|
60
|
+
*/
|
|
61
|
+
domainId?: string;
|
|
62
|
+
/**
|
|
63
|
+
* The subdomain name (e.g., 'api', 'www', '@' for root)
|
|
64
|
+
*/
|
|
65
|
+
name: string;
|
|
66
|
+
/**
|
|
67
|
+
* The port to expose (defaults to ports.web if not specified)
|
|
68
|
+
*/
|
|
69
|
+
port?: number;
|
|
70
|
+
/**
|
|
71
|
+
* The protocol for this domain entry
|
|
72
|
+
*/
|
|
73
|
+
protocol?: 'http' | 'https' | 'ssh';
|
|
74
|
+
}[];
|
|
75
|
+
deploymentIds: string[];
|
|
76
|
+
};
|
|
77
|
+
}
|