@cosmoner/sdk 1.7.1 → 1.9.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.
@@ -0,0 +1,111 @@
1
+ /** Databases service namespace — a project's dedicated and shared databases. */
2
+ import { type ResolvedConfig } from "../config";
3
+ import type { Transport } from "../transport";
4
+ /** One database of any kind, as the project overview lists it. */
5
+ export interface DatabaseSummary {
6
+ kind: "DEDICATED" | "LEGACY_POOLED";
7
+ id: string;
8
+ name: string;
9
+ engine: string;
10
+ version: string | null;
11
+ region: string;
12
+ status: string;
13
+ /** The size of a dedicated database, or the tier of a shared one. */
14
+ plan: string;
15
+ createdAt: string;
16
+ dedicated?: {
17
+ numNodes: number;
18
+ storageGb: number | null;
19
+ };
20
+ pooled?: {
21
+ maxConnections: number;
22
+ storageLimitMb: number;
23
+ };
24
+ }
25
+ /** A dedicated database. The API returns more; the rest are present at runtime. */
26
+ export interface DedicatedDatabase {
27
+ id: string;
28
+ name: string;
29
+ engine: string;
30
+ version: string | null;
31
+ provider: string;
32
+ region: string;
33
+ size: string;
34
+ numNodes: number;
35
+ storageGb: number | null;
36
+ status: string;
37
+ host: string | null;
38
+ port: number | null;
39
+ defaultDb: string | null;
40
+ defaultUser: string | null;
41
+ createdAt: string;
42
+ }
43
+ /** A dedicated database read on its own. */
44
+ export interface DedicatedDatabaseDetail extends DedicatedDatabase {
45
+ /**
46
+ * A full connection URI, **including the password**. Always present once
47
+ * the database is online, and readable with only `databases:read`, so
48
+ * guard the key accordingly.
49
+ */
50
+ connectionUri: string | null;
51
+ }
52
+ /** A database on the shared cluster. No password is ever returned for one. */
53
+ export interface SharedDatabase {
54
+ id: string;
55
+ clusterId: string;
56
+ clusterName: string;
57
+ dbName: string;
58
+ dbUser: string;
59
+ host: string;
60
+ port: number;
61
+ region: string;
62
+ poolName: string | null;
63
+ poolPort: number | null;
64
+ poolMode: string;
65
+ status: string;
66
+ tier: string;
67
+ maxConnections: number;
68
+ storageLimitMb: number;
69
+ createdAt: string;
70
+ }
71
+ /** Options accepted by every method, for working across projects. */
72
+ export interface ProjectScopedParams {
73
+ /** Overrides the client-level default project for this call. */
74
+ projectId?: string;
75
+ }
76
+ interface Envelope<T> {
77
+ success: true;
78
+ data: T;
79
+ }
80
+ export type ListDatabasesResponse = Envelope<DatabaseSummary[]>;
81
+ export type ListDedicatedDatabasesResponse = Envelope<DedicatedDatabase[]>;
82
+ export type GetDedicatedDatabaseResponse = Envelope<DedicatedDatabaseDetail>;
83
+ export type ListSharedDatabasesResponse = Envelope<SharedDatabase[]>;
84
+ export type GetSharedDatabaseResponse = Envelope<SharedDatabase>;
85
+ export type DeleteDatabaseResponse = Envelope<Record<string, never>>;
86
+ /** Read operations on a project's databases. */
87
+ export declare class DatabasesService {
88
+ private readonly transport;
89
+ private readonly config;
90
+ constructor(transport: Transport, config: ResolvedConfig);
91
+ /** Builds the collection route for the resolved project. */
92
+ private basePath;
93
+ /** Lists every database in the project, of every kind, newest first. */
94
+ list(params?: ProjectScopedParams): Promise<ListDatabasesResponse>;
95
+ /** Lists the project's dedicated databases. */
96
+ listDedicated(params?: ProjectScopedParams): Promise<ListDedicatedDatabasesResponse>;
97
+ /**
98
+ * Fetches one dedicated database. Its `connectionUri` carries the password;
99
+ * see {@link DedicatedDatabaseDetail}.
100
+ */
101
+ getDedicated(databaseId: string, params?: ProjectScopedParams): Promise<GetDedicatedDatabaseResponse>;
102
+ /** Lists the project's databases on the shared cluster. */
103
+ listShared(params?: ProjectScopedParams): Promise<ListSharedDatabasesResponse>;
104
+ /** Fetches one database on the shared cluster. */
105
+ getShared(tenantId: string, params?: ProjectScopedParams): Promise<GetSharedDatabaseResponse>;
106
+ /** Permanently deletes a dedicated database cluster and its data, and stops its billing. */
107
+ deleteDedicated(databaseId: string, params?: ProjectScopedParams): Promise<DeleteDatabaseResponse>;
108
+ /** Permanently deletes a shared database and its data, and stops its billing. */
109
+ deleteShared(tenantId: string, params?: ProjectScopedParams): Promise<DeleteDatabaseResponse>;
110
+ }
111
+ export {};
@@ -0,0 +1,86 @@
1
+ /** Domains service namespace — a project's domains and their DNS records. */
2
+ import { type ResolvedConfig } from "../config";
3
+ import type { Transport } from "../transport";
4
+ /** One DNS record on a domain. */
5
+ export interface DnsRecord {
6
+ id: string;
7
+ type: string;
8
+ name: string;
9
+ value: string;
10
+ ttl: number;
11
+ priority: number | null;
12
+ }
13
+ /** A domain as the API lists it. The API returns more; the rest are present at runtime. */
14
+ export interface Domain {
15
+ id: string;
16
+ name: string;
17
+ type: "PURCHASED" | "MIGRATED" | "EXTERNAL";
18
+ status: string;
19
+ registrar: string | null;
20
+ expiresAt: string | null;
21
+ autoRenew: boolean;
22
+ dnsRecords: DnsRecord[];
23
+ /** The TXT record that proves ownership of an external domain; null otherwise. */
24
+ verificationRecord: {
25
+ type: "TXT";
26
+ name: string;
27
+ value: string;
28
+ } | null;
29
+ createdAt: string;
30
+ }
31
+ /** Options accepted by every method, for working across projects. */
32
+ export interface ProjectScopedParams {
33
+ /** Overrides the client-level default project for this call. */
34
+ projectId?: string;
35
+ }
36
+ interface Envelope<T> {
37
+ success: true;
38
+ data: T;
39
+ }
40
+ export type ListDomainsResponse = Envelope<Domain[]>;
41
+ export type GetDomainResponse = Envelope<Domain>;
42
+ /** The TXT record that proves you control a domain you added. */
43
+ export interface VerificationRecord {
44
+ type: "TXT";
45
+ name: string;
46
+ value: string;
47
+ }
48
+ export type CreateDomainResponse = Envelope<Domain & {
49
+ verificationRecord: VerificationRecord;
50
+ }>;
51
+ export type VerifyDomainResponse = Envelope<{
52
+ status: "ACTIVE" | "PENDING";
53
+ verified: boolean;
54
+ record: VerificationRecord;
55
+ /** Why the lookup failed, when it did. */
56
+ error?: string;
57
+ }>;
58
+ export type DeleteDomainResponse = Envelope<{
59
+ id: string;
60
+ }>;
61
+ /** Read operations on a project's domains. */
62
+ export declare class DomainsService {
63
+ private readonly transport;
64
+ private readonly config;
65
+ constructor(transport: Transport, config: ResolvedConfig);
66
+ /** Builds the collection route for the resolved project. */
67
+ private basePath;
68
+ /** Lists every domain in the project, with its DNS records. */
69
+ list(params?: ProjectScopedParams): Promise<ListDomainsResponse>;
70
+ /** Fetches one domain by id or by name, e.g. `example.com`. */
71
+ get(domain: string, params?: ProjectScopedParams): Promise<GetDomainResponse>;
72
+ /**
73
+ * Adds a domain you already own, e.g. `example.com`. Free. Publish the
74
+ * returned `verificationRecord`, then call `verify()`. Buying a domain is not
75
+ * part of the SDK.
76
+ */
77
+ create(name: string, params?: ProjectScopedParams): Promise<CreateDomainResponse>;
78
+ /** Checks a domain's verification record, by domain id or name. */
79
+ verify(domain: string, params?: ProjectScopedParams): Promise<VerifyDomainResponse>;
80
+ /**
81
+ * Removes a domain and its DNS records, by id or name. Refused with 409
82
+ * while an app or an email domain uses it.
83
+ */
84
+ delete(domain: string, params?: ProjectScopedParams): Promise<DeleteDomainResponse>;
85
+ }
86
+ export {};
@@ -19,6 +19,58 @@ export interface SendEmailResponse {
19
19
  messageId: string;
20
20
  };
21
21
  }
22
+ /** A project's sending domain. SMTP passwords and the DKIM private key are never returned. */
23
+ export interface EmailDomain {
24
+ id: string;
25
+ domainId: string;
26
+ status: "DNS_PENDING" | "ACTIVE" | "SUSPENDED";
27
+ verifiedAt: string | null;
28
+ domain: {
29
+ id: string;
30
+ name: string;
31
+ status: string;
32
+ type: string;
33
+ };
34
+ credentials: Array<{
35
+ id: string;
36
+ label: string;
37
+ fromAddress: string | null;
38
+ smtpUsername: string;
39
+ sentCount: number;
40
+ lastUsedAt: string | null;
41
+ }>;
42
+ /** The records to publish before the domain can send. */
43
+ dnsRecords: Array<{
44
+ type: "TXT";
45
+ name: string;
46
+ value: string;
47
+ purpose: "DKIM" | "SPF" | "DMARC";
48
+ description: string;
49
+ }>;
50
+ createdAt: string;
51
+ }
52
+ /** A sending domain read on its own, with whether it can send yet. */
53
+ export interface EmailDomainDetail extends EmailDomain {
54
+ sending: {
55
+ identity: "VERIFIED" | "PENDING" | "FAILED" | "MISSING" | null;
56
+ billingRequired: boolean;
57
+ };
58
+ }
59
+ /** Options accepted by the domain reads, for working across projects. */
60
+ export interface ProjectScopedParams {
61
+ /** Overrides the client-level default project for this call. */
62
+ projectId?: string;
63
+ }
64
+ /** Envelope returned by `client.email.listDomains()`. */
65
+ export interface ListEmailDomainsResponse {
66
+ success: true;
67
+ data: EmailDomain[];
68
+ }
69
+ /** Envelope returned by `client.email.getDomain()`. */
70
+ export interface GetEmailDomainResponse {
71
+ success: true;
72
+ data: EmailDomainDetail;
73
+ }
22
74
  /** Email operations for a project. */
23
75
  export declare class EmailService {
24
76
  private readonly transport;
@@ -30,4 +82,13 @@ export declare class EmailService {
30
82
  * At least one of `html` or `text` is required.
31
83
  */
32
84
  send(params: SendEmailParams): Promise<SendEmailResponse>;
85
+ /** Lists the project's sending domains, with their SMTP credentials and DNS records. */
86
+ listDomains(params?: ProjectScopedParams): Promise<ListEmailDomainsResponse>;
87
+ /** Fetches one sending domain by its id (not its domain name). */
88
+ getDomain(emailDomainId: string, params?: ProjectScopedParams): Promise<GetEmailDomainResponse>;
89
+ /**
90
+ * Stops sending from a domain and removes it from email. The domain itself
91
+ * stays in the project. The API answers 204, so there is nothing to return.
92
+ */
93
+ deleteDomain(emailDomainId: string, params?: ProjectScopedParams): Promise<void>;
33
94
  }
@@ -70,6 +70,7 @@ export type GetHostingSiteResponse = Envelope<HostingSite & {
70
70
  }>;
71
71
  export type GetHostingSiteWithCredentialsResponse = Envelope<HostingSiteWithCredentials>;
72
72
  export type GetHostingAccessResponse = Envelope<HostingAccess>;
73
+ export type DeleteHostingSiteResponse = Envelope<Record<string, never>>;
73
74
  /** Read operations on a project's shared hosting sites. */
74
75
  export declare class HostingService {
75
76
  private readonly transport;
@@ -86,5 +87,7 @@ export declare class HostingService {
86
87
  get(siteId: string, params?: GetHostingSiteParams): Promise<GetHostingSiteResponse>;
87
88
  /** Fetches the host, port and username for SFTP and SSH. */
88
89
  access(siteId: string, params?: ProjectScopedParams): Promise<GetHostingAccessResponse>;
90
+ /** Permanently deletes a hosting site with its files, databases and domains, and stops its billing. */
91
+ delete(siteId: string, params?: ProjectScopedParams): Promise<DeleteHostingSiteResponse>;
89
92
  }
90
93
  export {};
@@ -0,0 +1,66 @@
1
+ /** IAM service namespace — a project's storage and registry access keys. */
2
+ import { type ResolvedConfig } from "../config";
3
+ import type { Transport } from "../transport";
4
+ /**
5
+ * One access credential. Only the key id is ever returned; the secret half is
6
+ * shown once, when the credential is created.
7
+ */
8
+ export interface IamCredential {
9
+ iamUserName: string;
10
+ label: string | null;
11
+ accessKeyId: string;
12
+ createdAt: string;
13
+ origin: "project" | "registry" | "bucket";
14
+ registry: {
15
+ access: "pull" | "push";
16
+ allRepositories: boolean;
17
+ repositories: Array<{
18
+ repositoryId: string;
19
+ repositoryName: string;
20
+ registryId: string | null;
21
+ }>;
22
+ } | null;
23
+ storage: {
24
+ access: "read" | "write";
25
+ allBuckets: boolean;
26
+ buckets: Array<{
27
+ bucketId: string;
28
+ bucketName: string;
29
+ }>;
30
+ } | null;
31
+ }
32
+ /** The project's credentials, and any it could not read. */
33
+ export interface IamCredentialList {
34
+ credentials: IamCredential[];
35
+ /** Problems reading some credentials; the rest are still listed. */
36
+ errors: string[];
37
+ }
38
+ /** Options accepted by every method, for working across projects. */
39
+ export interface ProjectScopedParams {
40
+ /** Overrides the client-level default project for this call. */
41
+ projectId?: string;
42
+ }
43
+ interface Envelope<T> {
44
+ success: true;
45
+ data: T;
46
+ }
47
+ export type ListIamCredentialsResponse = Envelope<IamCredentialList>;
48
+ export type GetIamCredentialResponse = Envelope<IamCredential>;
49
+ /** Read operations on a project's access credentials. */
50
+ export declare class IamService {
51
+ private readonly transport;
52
+ private readonly config;
53
+ constructor(transport: Transport, config: ResolvedConfig);
54
+ /** Builds the collection route for the resolved project. */
55
+ private basePath;
56
+ /** Lists every access credential in the project, newest first. */
57
+ list(params?: ProjectScopedParams): Promise<ListIamCredentialsResponse>;
58
+ /** Fetches one credential by its IAM user name. */
59
+ get(iamUserName: string, params?: ProjectScopedParams): Promise<GetIamCredentialResponse>;
60
+ /**
61
+ * Deletes an IAM user and its access keys, by user name. Anything using the
62
+ * keys stops working. The API answers 204, so there is nothing to return.
63
+ */
64
+ delete(iamUserName: string, params?: ProjectScopedParams): Promise<void>;
65
+ }
66
+ export {};
@@ -0,0 +1,50 @@
1
+ /** Members service namespace — who belongs to a project. */
2
+ import { type ResolvedConfig } from "../config";
3
+ import type { Transport } from "../transport";
4
+ /** One member of a project. */
5
+ export interface ProjectMember {
6
+ id: string;
7
+ userId: string;
8
+ role: string;
9
+ createdAt: string;
10
+ user: {
11
+ name: string;
12
+ email: string;
13
+ image: string | null;
14
+ };
15
+ }
16
+ /** A project's members and the invitations not yet accepted. */
17
+ export interface ProjectMembers {
18
+ orgId: string;
19
+ /** The user the credential belongs to. */
20
+ currentUserId: string;
21
+ /** Who pays the project's invoices. */
22
+ billerUserId: string | null;
23
+ pendingBillerUserId: string | null;
24
+ members: ProjectMember[];
25
+ pendingInvitations: Array<{
26
+ id: string;
27
+ email: string;
28
+ role: string;
29
+ expiresAt: string;
30
+ }>;
31
+ }
32
+ /** Options accepted by every method, for working across projects. */
33
+ export interface ProjectScopedParams {
34
+ /** Overrides the client-level default project for this call. */
35
+ projectId?: string;
36
+ }
37
+ interface Envelope<T> {
38
+ success: true;
39
+ data: T;
40
+ }
41
+ export type ListMembersResponse = Envelope<ProjectMembers>;
42
+ /** Read operations on a project's members. */
43
+ export declare class MembersService {
44
+ private readonly transport;
45
+ private readonly config;
46
+ constructor(transport: Transport, config: ResolvedConfig);
47
+ /** Lists the project's members and pending invitations. */
48
+ list(params?: ProjectScopedParams): Promise<ListMembersResponse>;
49
+ }
50
+ export {};
@@ -0,0 +1,45 @@
1
+ /** Projects service namespace — the projects the credential can reach. */
2
+ import type { Transport } from "../transport";
3
+ /** A project as the API lists it. The API returns more; the rest are present at runtime. */
4
+ export interface Project {
5
+ id: string;
6
+ name: string;
7
+ /** Falls back to the id for a project created without a slug. */
8
+ slug: string;
9
+ billingEmail: string | null;
10
+ /** Set while the project is blocked for an unpaid invoice. */
11
+ blockedAt: string | null;
12
+ blockedReason: string | null;
13
+ /** How many of each resource the project holds. */
14
+ _count: {
15
+ servers: number;
16
+ domains: number;
17
+ members: number;
18
+ apps: number;
19
+ objectStorages: number;
20
+ containerRegistries: number;
21
+ databaseClusters: number;
22
+ };
23
+ }
24
+ interface Envelope<T> {
25
+ success: true;
26
+ data: T;
27
+ }
28
+ export type ListProjectsResponse = Envelope<Project[]>;
29
+ export type GetProjectResponse = Envelope<Project>;
30
+ /**
31
+ * Reads the projects the credential can reach.
32
+ *
33
+ * Account-level: it never uses the client's default project. An API key sees
34
+ * the one project it was issued for; a `cosmoner login` session sees every
35
+ * project its user is a member of.
36
+ */
37
+ export declare class ProjectsService {
38
+ private readonly transport;
39
+ constructor(transport: Transport);
40
+ /** Lists every project the credential can reach, newest first. */
41
+ list(): Promise<ListProjectsResponse>;
42
+ /** Fetches one project by id or slug. */
43
+ get(project: string): Promise<GetProjectResponse>;
44
+ }
45
+ export {};
@@ -0,0 +1,58 @@
1
+ /** Redis service namespace — a project's managed Redis and Valkey databases. */
2
+ import { type ResolvedConfig } from "../config";
3
+ import type { Transport } from "../transport";
4
+ /** A Redis database as the API lists it. The API returns more; the rest are present at runtime. */
5
+ export interface RedisDatabase {
6
+ id: string;
7
+ name: string;
8
+ provider: string;
9
+ engine: "REDIS" | "VALKEY";
10
+ engineVersion: string | null;
11
+ planSlug: string;
12
+ planType: "RAM" | "FLEX";
13
+ memoryMb: number;
14
+ throughputOps: number | null;
15
+ cloudProvider: string | null;
16
+ region: string;
17
+ replication: boolean;
18
+ dataPersistence: string;
19
+ status: "CREATING" | "ACTIVE" | "ERROR" | "TERMINATED";
20
+ host: string | null;
21
+ port: number | null;
22
+ createdAt: string;
23
+ }
24
+ /** A Redis database read on its own. */
25
+ export interface RedisDatabaseDetail extends RedisDatabase {
26
+ /**
27
+ * The plaintext password. Always present once provisioned, and readable
28
+ * with only `redis:read`, so guard the key accordingly.
29
+ */
30
+ password: string | null;
31
+ }
32
+ /** Options accepted by every method, for working across projects. */
33
+ export interface ProjectScopedParams {
34
+ /** Overrides the client-level default project for this call. */
35
+ projectId?: string;
36
+ }
37
+ interface Envelope<T> {
38
+ success: true;
39
+ data: T;
40
+ }
41
+ export type ListRedisDatabasesResponse = Envelope<RedisDatabase[]>;
42
+ export type GetRedisDatabaseResponse = Envelope<RedisDatabaseDetail>;
43
+ export type DeleteRedisDatabaseResponse = Envelope<Record<string, never>>;
44
+ /** Read operations on a project's Redis databases. */
45
+ export declare class RedisService {
46
+ private readonly transport;
47
+ private readonly config;
48
+ constructor(transport: Transport, config: ResolvedConfig);
49
+ /** Builds the collection route for the resolved project. */
50
+ private basePath;
51
+ /** Lists every Redis database in the project that has not been terminated. */
52
+ list(params?: ProjectScopedParams): Promise<ListRedisDatabasesResponse>;
53
+ /** Fetches one Redis database, with its password; see {@link RedisDatabaseDetail}. */
54
+ get(redisId: string, params?: ProjectScopedParams): Promise<GetRedisDatabaseResponse>;
55
+ /** Permanently deletes a Redis database and its data, and stops its billing. */
56
+ delete(redisId: string, params?: ProjectScopedParams): Promise<DeleteRedisDatabaseResponse>;
57
+ }
58
+ export {};
@@ -0,0 +1,50 @@
1
+ /** Registries service namespace — a project's container registries. */
2
+ import { type ResolvedConfig } from "../config";
3
+ import type { Transport } from "../transport";
4
+ /** One repository in a registry. */
5
+ export interface RegistryRepository {
6
+ id: string;
7
+ name: string;
8
+ /** The path to pull and push, e.g. `registry.cosmoner.com/acme/web`. */
9
+ fullPath: string;
10
+ visibility: "PRIVATE" | "PUBLIC";
11
+ }
12
+ /** A container registry. The API returns more; the rest are present at runtime. */
13
+ export interface Registry {
14
+ id: string;
15
+ name: string;
16
+ provider: string;
17
+ region: string;
18
+ endpoint: string | null;
19
+ status: "CREATING" | "ACTIVE" | "SUSPENDED" | "DELETING";
20
+ namespaceName: string | null;
21
+ repositories: RegistryRepository[];
22
+ createdAt: string;
23
+ }
24
+ /** Options accepted by every method, for working across projects. */
25
+ export interface ProjectScopedParams {
26
+ /** Overrides the client-level default project for this call. */
27
+ projectId?: string;
28
+ }
29
+ interface Envelope<T> {
30
+ success: true;
31
+ data: T;
32
+ }
33
+ export type ListRegistriesResponse = Envelope<Registry[]>;
34
+ export type GetRegistryResponse = Envelope<Registry>;
35
+ export type DeleteRegistryResponse = Envelope<Record<string, never>>;
36
+ /** Read operations on a project's container registries. */
37
+ export declare class RegistriesService {
38
+ private readonly transport;
39
+ private readonly config;
40
+ constructor(transport: Transport, config: ResolvedConfig);
41
+ /** Builds the collection route for the resolved project. */
42
+ private basePath;
43
+ /** Lists every registry in the project, with its repositories. */
44
+ list(params?: ProjectScopedParams): Promise<ListRegistriesResponse>;
45
+ /** Fetches one registry, with its repositories. */
46
+ get(registryId: string, params?: ProjectScopedParams): Promise<GetRegistryResponse>;
47
+ /** Permanently deletes a registry with every repository and image in it, and stops its billing. */
48
+ delete(registryId: string, params?: ProjectScopedParams): Promise<DeleteRegistryResponse>;
49
+ }
50
+ export {};
@@ -0,0 +1,59 @@
1
+ /** Servers service namespace — a project's virtual servers. */
2
+ import { type ResolvedConfig } from "../config";
3
+ import type { Transport } from "../transport";
4
+ export type ServerStatus = "PROVISIONING" | "RUNNING" | "STOPPED" | "ERROR" | "TERMINATED";
5
+ /** A server as the API lists it. The API returns more; the rest are present at runtime. */
6
+ export interface Server {
7
+ id: string;
8
+ name: string;
9
+ type: "LAMP" | "POSTGRES";
10
+ provider: string;
11
+ region: string;
12
+ instanceType: string;
13
+ image: string;
14
+ status: ServerStatus;
15
+ ipAddress: string | null;
16
+ hostname: string | null;
17
+ phpVersion: string | null;
18
+ pgVersion: string | null;
19
+ pgDatabase: string | null;
20
+ pgUsername: string | null;
21
+ sshUser: string | null;
22
+ createdAt: string;
23
+ updatedAt: string;
24
+ }
25
+ /** A server read on its own, with the SSH keys installed on it. */
26
+ export interface ServerDetail extends Server {
27
+ sshKeys: Array<{
28
+ id: string;
29
+ name: string;
30
+ fingerprint: string;
31
+ }>;
32
+ }
33
+ /** Options accepted by every method, for working across projects. */
34
+ export interface ProjectScopedParams {
35
+ /** Overrides the client-level default project for this call. */
36
+ projectId?: string;
37
+ }
38
+ interface Envelope<T> {
39
+ success: true;
40
+ data: T;
41
+ }
42
+ export type ListServersResponse = Envelope<Server[]>;
43
+ export type GetServerResponse = Envelope<ServerDetail>;
44
+ export type DeleteServerResponse = Envelope<Record<string, never>>;
45
+ /** Read operations on a project's servers. */
46
+ export declare class ServersService {
47
+ private readonly transport;
48
+ private readonly config;
49
+ constructor(transport: Transport, config: ResolvedConfig);
50
+ /** Builds the collection route for the resolved project. */
51
+ private basePath;
52
+ /** Lists every server in the project that has not been terminated. */
53
+ list(params?: ProjectScopedParams): Promise<ListServersResponse>;
54
+ /** Fetches one server, with the SSH keys installed on it. */
55
+ get(serverId: string, params?: ProjectScopedParams): Promise<GetServerResponse>;
56
+ /** Permanently deletes a server and its disk, and stops its billing. */
57
+ delete(serverId: string, params?: ProjectScopedParams): Promise<DeleteServerResponse>;
58
+ }
59
+ export {};
@@ -0,0 +1,51 @@
1
+ /** SSH keys service namespace — the public keys a project installs on its servers. */
2
+ import { type ResolvedConfig } from "../config";
3
+ import type { Transport } from "../transport";
4
+ /** A public SSH key. The private half is never stored or returned. */
5
+ export interface SshKey {
6
+ id: string;
7
+ name: string;
8
+ publicKey: string;
9
+ fingerprint: string;
10
+ createdAt: string;
11
+ updatedAt: string;
12
+ }
13
+ /** Options accepted by every method, for working across projects. */
14
+ export interface ProjectScopedParams {
15
+ /** Overrides the client-level default project for this call. */
16
+ projectId?: string;
17
+ }
18
+ interface Envelope<T> {
19
+ success: true;
20
+ data: T;
21
+ }
22
+ export type ListSshKeysResponse = Envelope<SshKey[]>;
23
+ /** Arguments accepted by `client.sshKeys.create()`. */
24
+ export interface CreateSshKeyParams extends ProjectScopedParams {
25
+ name: string;
26
+ /** One OpenSSH public key line, e.g. the contents of `~/.ssh/id_ed25519.pub`. DSA keys are refused. */
27
+ publicKey: string;
28
+ }
29
+ export type CreateSshKeyResponse = Envelope<SshKey>;
30
+ export type DeleteSshKeyResponse = Envelope<{
31
+ /** Servers the key was already installed on, where it still works: deleting does not revoke it there. */
32
+ stillAuthorisedOn: number;
33
+ }>;
34
+ /** A project's SSH keys. */
35
+ export declare class SshKeysService {
36
+ private readonly transport;
37
+ private readonly config;
38
+ constructor(transport: Transport, config: ResolvedConfig);
39
+ /** Lists every SSH key in the project. */
40
+ list(params?: ProjectScopedParams): Promise<ListSshKeysResponse>;
41
+ /** Adds a public key to the project, for installing on servers created later. */
42
+ create(params: CreateSshKeyParams): Promise<CreateSshKeyResponse>;
43
+ /**
44
+ * Removes a key from the project. Servers it was already installed on keep
45
+ * accepting it; `stillAuthorisedOn` says how many.
46
+ */
47
+ delete(sshKeyId: string, params?: ProjectScopedParams): Promise<DeleteSshKeyResponse>;
48
+ /** Builds the collection route for the resolved project. */
49
+ private basePath;
50
+ }
51
+ export {};
package/dist/version.d.ts CHANGED
@@ -8,5 +8,5 @@
8
8
  * the release workflow runs that straight after `npm version`, and
9
9
  * `version.test.ts` fails the build if the two ever disagree.
10
10
  */
11
- export declare const VERSION = "1.7.1";
12
- export declare const USER_AGENT = "cosmoner-node/1.7.1";
11
+ export declare const VERSION = "1.9.0";
12
+ export declare const USER_AGENT = "cosmoner-node/1.9.0";