@roxyon/api-client 0.1.1 → 0.3.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/dist/index.cjs +171 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +179 -20
- package/dist/index.d.ts +179 -20
- package/dist/index.js +168 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -117,14 +117,13 @@ interface AccountSubscription {
|
|
|
117
117
|
id: string;
|
|
118
118
|
name: string;
|
|
119
119
|
status: string;
|
|
120
|
-
node: string;
|
|
121
|
-
datacenter: string;
|
|
122
|
-
container: string;
|
|
123
120
|
}
|
|
124
121
|
interface AccountDomain {
|
|
125
122
|
id: string;
|
|
126
123
|
name: string;
|
|
127
124
|
subscription: string;
|
|
125
|
+
/** `active`, or `provisioning` while a freshly-added host comes up. */
|
|
126
|
+
status?: string;
|
|
128
127
|
}
|
|
129
128
|
interface AccountContext {
|
|
130
129
|
user: {
|
|
@@ -144,7 +143,6 @@ interface AccountApp {
|
|
|
144
143
|
configRevision: number;
|
|
145
144
|
appliedRevision: number;
|
|
146
145
|
lastError: string | null;
|
|
147
|
-
sourcePath: string;
|
|
148
146
|
repo: {
|
|
149
147
|
url: string;
|
|
150
148
|
branch: string;
|
|
@@ -152,9 +150,10 @@ interface AccountApp {
|
|
|
152
150
|
}
|
|
153
151
|
/**
|
|
154
152
|
* `GET /account/context` — one call the CLI / MCP server use to plan a deploy:
|
|
155
|
-
* the signed-in user, their subscriptions
|
|
156
|
-
*
|
|
157
|
-
*
|
|
153
|
+
* the signed-in user, their subscriptions, and their domains. Resolvable by a
|
|
154
|
+
* session token OR a Personal Access Token, so a CI job with only a PAT never
|
|
155
|
+
* has to touch the BaaS. Infra details (nodes, datacenters, container names,
|
|
156
|
+
* filesystem paths) are deliberately not surfaced here.
|
|
158
157
|
*/
|
|
159
158
|
declare class AccountApi {
|
|
160
159
|
private readonly client;
|
|
@@ -365,15 +364,130 @@ declare class AuthApi {
|
|
|
365
364
|
logout(): Promise<void>;
|
|
366
365
|
}
|
|
367
366
|
|
|
367
|
+
interface CreateDatabaseInput {
|
|
368
|
+
/** DB name suffix — the platform prefixes it with the subscription's own username (globally unique). */
|
|
369
|
+
name: string;
|
|
370
|
+
/** Subscription to attach it to. Omit when the account has exactly one. */
|
|
371
|
+
subscription?: string;
|
|
372
|
+
/** Omit to have the platform generate one. */
|
|
373
|
+
password?: string;
|
|
374
|
+
}
|
|
375
|
+
interface CreateDatabaseResult {
|
|
376
|
+
ok: boolean;
|
|
377
|
+
objectId: string;
|
|
378
|
+
name: string;
|
|
379
|
+
username: string;
|
|
380
|
+
/** Shown once — not retrievable afterwards. */
|
|
381
|
+
password?: string;
|
|
382
|
+
/** `<node-ip>:6033` — the ProxySQL endpoint to connect the app to. */
|
|
383
|
+
host?: string;
|
|
384
|
+
status: 'provisioning' | 'active' | 'failed';
|
|
385
|
+
error?: string;
|
|
386
|
+
}
|
|
387
|
+
interface DatabaseSummary {
|
|
388
|
+
objectId: string;
|
|
389
|
+
Name: string;
|
|
390
|
+
Username: string;
|
|
391
|
+
Status: string;
|
|
392
|
+
}
|
|
393
|
+
interface DeleteDatabaseResult {
|
|
394
|
+
ok: boolean;
|
|
395
|
+
objectId: string;
|
|
396
|
+
status: 'deleting' | 'deleted' | 'failed';
|
|
397
|
+
error?: string;
|
|
398
|
+
}
|
|
399
|
+
/** Databases (MySQL/MariaDB on the shared Galera cluster) attached to a subscription. */
|
|
400
|
+
declare class DatabasesApi {
|
|
401
|
+
private readonly client;
|
|
402
|
+
constructor(client: RoxyonClient);
|
|
403
|
+
list(subscriptionId: string): Promise<DatabaseSummary[]>;
|
|
404
|
+
/** `POST /databases/create` — provision a database + user; the reconciler does the rest. */
|
|
405
|
+
create(input: CreateDatabaseInput): Promise<CreateDatabaseResult>;
|
|
406
|
+
/** `POST /databases/delete` */
|
|
407
|
+
delete(databaseId: string): Promise<DeleteDatabaseResult>;
|
|
408
|
+
}
|
|
409
|
+
|
|
368
410
|
interface Domain {
|
|
369
411
|
objectId: string;
|
|
370
412
|
Name: string;
|
|
371
413
|
}
|
|
372
|
-
|
|
414
|
+
interface CreateDomainInput {
|
|
415
|
+
/** FQDN to host — a subdomain of a domain the account already hosts, or `*.roxyon.com`. */
|
|
416
|
+
host: string;
|
|
417
|
+
/** Subscription to attach it to. Omit when the account has exactly one. */
|
|
418
|
+
subscription?: string;
|
|
419
|
+
/** `spa` → unmatched paths serve `/index.html`; default `static`. */
|
|
420
|
+
siteType?: 'static' | 'spa';
|
|
421
|
+
/** PHP version for the vhost (e.g. `"8.3"`). Unknown/omitted falls back to the platform default. */
|
|
422
|
+
phpVersion?: string;
|
|
423
|
+
}
|
|
424
|
+
interface CreateDomainResult {
|
|
425
|
+
ok: boolean;
|
|
426
|
+
objectId: string;
|
|
427
|
+
host: string;
|
|
428
|
+
/** `subdomain` of an owned parent, or `primary`. */
|
|
429
|
+
type: 'subdomain' | 'primary';
|
|
430
|
+
/** `provisioning` while DNS/vhost/TLS come up, then `active` (or `failed`). */
|
|
431
|
+
status: 'provisioning' | 'active' | 'failed';
|
|
432
|
+
error?: string;
|
|
433
|
+
}
|
|
434
|
+
/** Domains (hosts) attached to a subscription. */
|
|
373
435
|
declare class DomainsApi {
|
|
374
436
|
private readonly client;
|
|
375
437
|
constructor(client: RoxyonClient);
|
|
376
438
|
list(subscriptionId: string): Promise<Domain[]>;
|
|
439
|
+
/**
|
|
440
|
+
* `POST /domains/create` — provision a subdomain (DNS + vhost + auto-TLS). The
|
|
441
|
+
* server decides subdomain vs primary from the caller's existing hosts and
|
|
442
|
+
* writes the `pending` row; the platform's reconciler does the rest.
|
|
443
|
+
*/
|
|
444
|
+
create(input: CreateDomainInput): Promise<CreateDomainResult>;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
interface CreateEmailInput {
|
|
448
|
+
/** The part before `@`. */
|
|
449
|
+
localPart: string;
|
|
450
|
+
/** A hostname already on the account. */
|
|
451
|
+
domain: string;
|
|
452
|
+
/** Omit to have the platform generate one. */
|
|
453
|
+
password?: string;
|
|
454
|
+
/** Mailbox quota in MB. Default 1024. */
|
|
455
|
+
quota?: number;
|
|
456
|
+
forwardTo?: string;
|
|
457
|
+
saveCopy?: boolean;
|
|
458
|
+
}
|
|
459
|
+
interface CreateEmailResult {
|
|
460
|
+
ok: boolean;
|
|
461
|
+
objectId: string;
|
|
462
|
+
email: string;
|
|
463
|
+
/** Shown once — not retrievable afterwards. */
|
|
464
|
+
password?: string;
|
|
465
|
+
quota?: number;
|
|
466
|
+
status: 'provisioning' | 'active' | 'failed';
|
|
467
|
+
error?: string;
|
|
468
|
+
}
|
|
469
|
+
interface EmailSummary {
|
|
470
|
+
objectId: string;
|
|
471
|
+
Email: string;
|
|
472
|
+
LocalPart: string;
|
|
473
|
+
Status: string;
|
|
474
|
+
Quota?: number;
|
|
475
|
+
}
|
|
476
|
+
interface DeleteEmailResult {
|
|
477
|
+
ok: boolean;
|
|
478
|
+
objectId: string;
|
|
479
|
+
status: 'deleting' | 'deleted' | 'failed';
|
|
480
|
+
error?: string;
|
|
481
|
+
}
|
|
482
|
+
/** Mailboxes attached to a subscription's domains. */
|
|
483
|
+
declare class EmailApi {
|
|
484
|
+
private readonly client;
|
|
485
|
+
constructor(client: RoxyonClient);
|
|
486
|
+
list(subscriptionId: string): Promise<EmailSummary[]>;
|
|
487
|
+
/** `POST /emails/create` — provision a mailbox; the reconciler does the rest. */
|
|
488
|
+
create(input: CreateEmailInput): Promise<CreateEmailResult>;
|
|
489
|
+
/** `POST /emails/delete` */
|
|
490
|
+
delete(emailId: string): Promise<DeleteEmailResult>;
|
|
377
491
|
}
|
|
378
492
|
|
|
379
493
|
interface StaticDeployResult {
|
|
@@ -381,30 +495,72 @@ interface StaticDeployResult {
|
|
|
381
495
|
host: string;
|
|
382
496
|
path: string;
|
|
383
497
|
files?: number;
|
|
498
|
+
bytes?: number;
|
|
384
499
|
error?: string;
|
|
385
500
|
}
|
|
501
|
+
interface DeployOptions {
|
|
502
|
+
/** Replace the docroot contents instead of overlaying (keeps `.well-known`). */
|
|
503
|
+
clean?: boolean;
|
|
504
|
+
/** Flip the host to SPA routing: unmatched paths serve `/index.html`. */
|
|
505
|
+
spa?: boolean;
|
|
506
|
+
}
|
|
507
|
+
interface SiteFile {
|
|
508
|
+
/** POSIX path relative to the site root. */
|
|
509
|
+
path: string;
|
|
510
|
+
size: number;
|
|
511
|
+
type: 'file' | 'dir';
|
|
512
|
+
}
|
|
513
|
+
interface SiteFileContent {
|
|
514
|
+
path: string;
|
|
515
|
+
size: number;
|
|
516
|
+
encoding: 'utf8' | 'base64';
|
|
517
|
+
content: string;
|
|
518
|
+
}
|
|
386
519
|
/**
|
|
387
|
-
* Static-site
|
|
388
|
-
*
|
|
389
|
-
* (
|
|
390
|
-
*
|
|
391
|
-
*
|
|
392
|
-
* `POST /sites/deploy` — NEW endpoint (see `backend/` in this repo).
|
|
520
|
+
* Static-site hosting: the files under a host's document root
|
|
521
|
+
* (`public_html[/<folder>]`), served directly by nginx. No Application row, no
|
|
522
|
+
* process. All routes go to the console (`POST /sites/deploy`, `GET /sites/files`,
|
|
523
|
+
* `GET /sites/file`) and authenticate with a session token or a `roxp_` PAT.
|
|
393
524
|
*/
|
|
394
525
|
declare class SitesApi {
|
|
395
526
|
private readonly client;
|
|
396
527
|
constructor(client: RoxyonClient);
|
|
397
|
-
|
|
528
|
+
/** Upload a gzip tarball into `host`'s docroot (+ optional sub-`folder`). */
|
|
529
|
+
deploy(host: string, folder: string, tarball: Uint8Array, opts?: DeployOptions): Promise<StaticDeployResult>;
|
|
530
|
+
/** List the files currently in `host`'s docroot (optionally under `path`). */
|
|
531
|
+
listFiles(host: string, folder?: string, path?: string): Promise<SiteFile[]>;
|
|
532
|
+
/** Read one file from `host`'s docroot. */
|
|
533
|
+
readFile(host: string, folder: string, path: string): Promise<SiteFileContent>;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
interface ResetSshPasswordInput {
|
|
537
|
+
/** Subscription to reset. Omit when the account has exactly one. */
|
|
538
|
+
subscription?: string;
|
|
539
|
+
/** Omit to have the platform generate one meeting the strength rules. */
|
|
540
|
+
password?: string;
|
|
541
|
+
}
|
|
542
|
+
interface ResetSshPasswordResult {
|
|
543
|
+
ok: boolean;
|
|
544
|
+
subscription: string;
|
|
545
|
+
/** Shown once — the platform never stores or re-shows it. */
|
|
546
|
+
password: string;
|
|
547
|
+
status: 'pending' | 'active' | 'failed';
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* The shared shell password used for SSH, SFTP and the file manager on a
|
|
551
|
+
* subscription's container (SSHpiper maps the username to the container).
|
|
552
|
+
*/
|
|
553
|
+
declare class SshApi {
|
|
554
|
+
private readonly client;
|
|
555
|
+
constructor(client: RoxyonClient);
|
|
556
|
+
/** `POST /ssh/password` */
|
|
557
|
+
resetPassword(input?: ResetSshPasswordInput): Promise<ResetSshPasswordResult>;
|
|
398
558
|
}
|
|
399
559
|
|
|
400
560
|
interface Subscription {
|
|
401
561
|
objectId: string;
|
|
402
562
|
Name?: string;
|
|
403
563
|
Status?: string;
|
|
404
|
-
Username?: string;
|
|
405
|
-
/** Infra node the subscription's container lives on (internal). */
|
|
406
|
-
Node?: string;
|
|
407
|
-
Datacenter?: string;
|
|
408
564
|
[k: string]: unknown;
|
|
409
565
|
}
|
|
410
566
|
interface Privilege {
|
|
@@ -536,8 +692,11 @@ declare class Roxyon {
|
|
|
536
692
|
readonly domains: DomainsApi;
|
|
537
693
|
readonly applications: ApplicationsApi;
|
|
538
694
|
readonly sites: SitesApi;
|
|
695
|
+
readonly databases: DatabasesApi;
|
|
696
|
+
readonly email: EmailApi;
|
|
697
|
+
readonly ssh: SshApi;
|
|
539
698
|
constructor(options?: RoxyonClientOptions | RoxyonClient);
|
|
540
699
|
get sessionToken(): string | undefined;
|
|
541
700
|
}
|
|
542
701
|
|
|
543
|
-
export { AccountApi, type AccountApp, type AccountContext, type AccountDomain, type AccountSubscription, type Application, type ApplicationProcess, type ApplicationRoute, ApplicationsApi, AuthApi, type CreateApplicationInput, type CreateOnDeploy, type CreatedToken, DEFAULT_APP, DEFAULT_BAAS_URL, DEFAULT_CONSOLE_URL, type DeployKind, type DeployResult, type Domain, DomainsApi, LUMEN_BUILD, type LoginPrecheck, type LoginResult, type Privilege, RUNTIMES, type RequestOptions, Roxyon, RoxyonApiError, RoxyonClient, type RoxyonClientOptions, type RoxyonUser, type RuntimeName, type RuntimeSpec, type SessionGrant, SitesApi, type StaticDeployResult, type Subscription, SubscriptionsApi, type TokenScope, type TokenSummary, TokensApi, assertOk, envFromStored, formatEnv, isAuthError, parseEnv, rxError, toQueryString };
|
|
702
|
+
export { AccountApi, type AccountApp, type AccountContext, type AccountDomain, type AccountSubscription, type Application, type ApplicationProcess, type ApplicationRoute, ApplicationsApi, AuthApi, type CreateApplicationInput, type CreateDatabaseInput, type CreateDatabaseResult, type CreateDomainInput, type CreateDomainResult, type CreateEmailInput, type CreateEmailResult, type CreateOnDeploy, type CreatedToken, DEFAULT_APP, DEFAULT_BAAS_URL, DEFAULT_CONSOLE_URL, type DatabaseSummary, DatabasesApi, type DeleteDatabaseResult, type DeleteEmailResult, type DeployKind, type DeployOptions, type DeployResult, type Domain, DomainsApi, EmailApi, type EmailSummary, LUMEN_BUILD, type LoginPrecheck, type LoginResult, type Privilege, RUNTIMES, type RequestOptions, type ResetSshPasswordInput, type ResetSshPasswordResult, Roxyon, RoxyonApiError, RoxyonClient, type RoxyonClientOptions, type RoxyonUser, type RuntimeName, type RuntimeSpec, type SessionGrant, type SiteFile, type SiteFileContent, SitesApi, SshApi, type StaticDeployResult, type Subscription, SubscriptionsApi, type TokenScope, type TokenSummary, TokensApi, assertOk, envFromStored, formatEnv, isAuthError, parseEnv, rxError, toQueryString };
|
package/dist/index.d.ts
CHANGED
|
@@ -117,14 +117,13 @@ interface AccountSubscription {
|
|
|
117
117
|
id: string;
|
|
118
118
|
name: string;
|
|
119
119
|
status: string;
|
|
120
|
-
node: string;
|
|
121
|
-
datacenter: string;
|
|
122
|
-
container: string;
|
|
123
120
|
}
|
|
124
121
|
interface AccountDomain {
|
|
125
122
|
id: string;
|
|
126
123
|
name: string;
|
|
127
124
|
subscription: string;
|
|
125
|
+
/** `active`, or `provisioning` while a freshly-added host comes up. */
|
|
126
|
+
status?: string;
|
|
128
127
|
}
|
|
129
128
|
interface AccountContext {
|
|
130
129
|
user: {
|
|
@@ -144,7 +143,6 @@ interface AccountApp {
|
|
|
144
143
|
configRevision: number;
|
|
145
144
|
appliedRevision: number;
|
|
146
145
|
lastError: string | null;
|
|
147
|
-
sourcePath: string;
|
|
148
146
|
repo: {
|
|
149
147
|
url: string;
|
|
150
148
|
branch: string;
|
|
@@ -152,9 +150,10 @@ interface AccountApp {
|
|
|
152
150
|
}
|
|
153
151
|
/**
|
|
154
152
|
* `GET /account/context` — one call the CLI / MCP server use to plan a deploy:
|
|
155
|
-
* the signed-in user, their subscriptions
|
|
156
|
-
*
|
|
157
|
-
*
|
|
153
|
+
* the signed-in user, their subscriptions, and their domains. Resolvable by a
|
|
154
|
+
* session token OR a Personal Access Token, so a CI job with only a PAT never
|
|
155
|
+
* has to touch the BaaS. Infra details (nodes, datacenters, container names,
|
|
156
|
+
* filesystem paths) are deliberately not surfaced here.
|
|
158
157
|
*/
|
|
159
158
|
declare class AccountApi {
|
|
160
159
|
private readonly client;
|
|
@@ -365,15 +364,130 @@ declare class AuthApi {
|
|
|
365
364
|
logout(): Promise<void>;
|
|
366
365
|
}
|
|
367
366
|
|
|
367
|
+
interface CreateDatabaseInput {
|
|
368
|
+
/** DB name suffix — the platform prefixes it with the subscription's own username (globally unique). */
|
|
369
|
+
name: string;
|
|
370
|
+
/** Subscription to attach it to. Omit when the account has exactly one. */
|
|
371
|
+
subscription?: string;
|
|
372
|
+
/** Omit to have the platform generate one. */
|
|
373
|
+
password?: string;
|
|
374
|
+
}
|
|
375
|
+
interface CreateDatabaseResult {
|
|
376
|
+
ok: boolean;
|
|
377
|
+
objectId: string;
|
|
378
|
+
name: string;
|
|
379
|
+
username: string;
|
|
380
|
+
/** Shown once — not retrievable afterwards. */
|
|
381
|
+
password?: string;
|
|
382
|
+
/** `<node-ip>:6033` — the ProxySQL endpoint to connect the app to. */
|
|
383
|
+
host?: string;
|
|
384
|
+
status: 'provisioning' | 'active' | 'failed';
|
|
385
|
+
error?: string;
|
|
386
|
+
}
|
|
387
|
+
interface DatabaseSummary {
|
|
388
|
+
objectId: string;
|
|
389
|
+
Name: string;
|
|
390
|
+
Username: string;
|
|
391
|
+
Status: string;
|
|
392
|
+
}
|
|
393
|
+
interface DeleteDatabaseResult {
|
|
394
|
+
ok: boolean;
|
|
395
|
+
objectId: string;
|
|
396
|
+
status: 'deleting' | 'deleted' | 'failed';
|
|
397
|
+
error?: string;
|
|
398
|
+
}
|
|
399
|
+
/** Databases (MySQL/MariaDB on the shared Galera cluster) attached to a subscription. */
|
|
400
|
+
declare class DatabasesApi {
|
|
401
|
+
private readonly client;
|
|
402
|
+
constructor(client: RoxyonClient);
|
|
403
|
+
list(subscriptionId: string): Promise<DatabaseSummary[]>;
|
|
404
|
+
/** `POST /databases/create` — provision a database + user; the reconciler does the rest. */
|
|
405
|
+
create(input: CreateDatabaseInput): Promise<CreateDatabaseResult>;
|
|
406
|
+
/** `POST /databases/delete` */
|
|
407
|
+
delete(databaseId: string): Promise<DeleteDatabaseResult>;
|
|
408
|
+
}
|
|
409
|
+
|
|
368
410
|
interface Domain {
|
|
369
411
|
objectId: string;
|
|
370
412
|
Name: string;
|
|
371
413
|
}
|
|
372
|
-
|
|
414
|
+
interface CreateDomainInput {
|
|
415
|
+
/** FQDN to host — a subdomain of a domain the account already hosts, or `*.roxyon.com`. */
|
|
416
|
+
host: string;
|
|
417
|
+
/** Subscription to attach it to. Omit when the account has exactly one. */
|
|
418
|
+
subscription?: string;
|
|
419
|
+
/** `spa` → unmatched paths serve `/index.html`; default `static`. */
|
|
420
|
+
siteType?: 'static' | 'spa';
|
|
421
|
+
/** PHP version for the vhost (e.g. `"8.3"`). Unknown/omitted falls back to the platform default. */
|
|
422
|
+
phpVersion?: string;
|
|
423
|
+
}
|
|
424
|
+
interface CreateDomainResult {
|
|
425
|
+
ok: boolean;
|
|
426
|
+
objectId: string;
|
|
427
|
+
host: string;
|
|
428
|
+
/** `subdomain` of an owned parent, or `primary`. */
|
|
429
|
+
type: 'subdomain' | 'primary';
|
|
430
|
+
/** `provisioning` while DNS/vhost/TLS come up, then `active` (or `failed`). */
|
|
431
|
+
status: 'provisioning' | 'active' | 'failed';
|
|
432
|
+
error?: string;
|
|
433
|
+
}
|
|
434
|
+
/** Domains (hosts) attached to a subscription. */
|
|
373
435
|
declare class DomainsApi {
|
|
374
436
|
private readonly client;
|
|
375
437
|
constructor(client: RoxyonClient);
|
|
376
438
|
list(subscriptionId: string): Promise<Domain[]>;
|
|
439
|
+
/**
|
|
440
|
+
* `POST /domains/create` — provision a subdomain (DNS + vhost + auto-TLS). The
|
|
441
|
+
* server decides subdomain vs primary from the caller's existing hosts and
|
|
442
|
+
* writes the `pending` row; the platform's reconciler does the rest.
|
|
443
|
+
*/
|
|
444
|
+
create(input: CreateDomainInput): Promise<CreateDomainResult>;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
interface CreateEmailInput {
|
|
448
|
+
/** The part before `@`. */
|
|
449
|
+
localPart: string;
|
|
450
|
+
/** A hostname already on the account. */
|
|
451
|
+
domain: string;
|
|
452
|
+
/** Omit to have the platform generate one. */
|
|
453
|
+
password?: string;
|
|
454
|
+
/** Mailbox quota in MB. Default 1024. */
|
|
455
|
+
quota?: number;
|
|
456
|
+
forwardTo?: string;
|
|
457
|
+
saveCopy?: boolean;
|
|
458
|
+
}
|
|
459
|
+
interface CreateEmailResult {
|
|
460
|
+
ok: boolean;
|
|
461
|
+
objectId: string;
|
|
462
|
+
email: string;
|
|
463
|
+
/** Shown once — not retrievable afterwards. */
|
|
464
|
+
password?: string;
|
|
465
|
+
quota?: number;
|
|
466
|
+
status: 'provisioning' | 'active' | 'failed';
|
|
467
|
+
error?: string;
|
|
468
|
+
}
|
|
469
|
+
interface EmailSummary {
|
|
470
|
+
objectId: string;
|
|
471
|
+
Email: string;
|
|
472
|
+
LocalPart: string;
|
|
473
|
+
Status: string;
|
|
474
|
+
Quota?: number;
|
|
475
|
+
}
|
|
476
|
+
interface DeleteEmailResult {
|
|
477
|
+
ok: boolean;
|
|
478
|
+
objectId: string;
|
|
479
|
+
status: 'deleting' | 'deleted' | 'failed';
|
|
480
|
+
error?: string;
|
|
481
|
+
}
|
|
482
|
+
/** Mailboxes attached to a subscription's domains. */
|
|
483
|
+
declare class EmailApi {
|
|
484
|
+
private readonly client;
|
|
485
|
+
constructor(client: RoxyonClient);
|
|
486
|
+
list(subscriptionId: string): Promise<EmailSummary[]>;
|
|
487
|
+
/** `POST /emails/create` — provision a mailbox; the reconciler does the rest. */
|
|
488
|
+
create(input: CreateEmailInput): Promise<CreateEmailResult>;
|
|
489
|
+
/** `POST /emails/delete` */
|
|
490
|
+
delete(emailId: string): Promise<DeleteEmailResult>;
|
|
377
491
|
}
|
|
378
492
|
|
|
379
493
|
interface StaticDeployResult {
|
|
@@ -381,30 +495,72 @@ interface StaticDeployResult {
|
|
|
381
495
|
host: string;
|
|
382
496
|
path: string;
|
|
383
497
|
files?: number;
|
|
498
|
+
bytes?: number;
|
|
384
499
|
error?: string;
|
|
385
500
|
}
|
|
501
|
+
interface DeployOptions {
|
|
502
|
+
/** Replace the docroot contents instead of overlaying (keeps `.well-known`). */
|
|
503
|
+
clean?: boolean;
|
|
504
|
+
/** Flip the host to SPA routing: unmatched paths serve `/index.html`. */
|
|
505
|
+
spa?: boolean;
|
|
506
|
+
}
|
|
507
|
+
interface SiteFile {
|
|
508
|
+
/** POSIX path relative to the site root. */
|
|
509
|
+
path: string;
|
|
510
|
+
size: number;
|
|
511
|
+
type: 'file' | 'dir';
|
|
512
|
+
}
|
|
513
|
+
interface SiteFileContent {
|
|
514
|
+
path: string;
|
|
515
|
+
size: number;
|
|
516
|
+
encoding: 'utf8' | 'base64';
|
|
517
|
+
content: string;
|
|
518
|
+
}
|
|
386
519
|
/**
|
|
387
|
-
* Static-site
|
|
388
|
-
*
|
|
389
|
-
* (
|
|
390
|
-
*
|
|
391
|
-
*
|
|
392
|
-
* `POST /sites/deploy` — NEW endpoint (see `backend/` in this repo).
|
|
520
|
+
* Static-site hosting: the files under a host's document root
|
|
521
|
+
* (`public_html[/<folder>]`), served directly by nginx. No Application row, no
|
|
522
|
+
* process. All routes go to the console (`POST /sites/deploy`, `GET /sites/files`,
|
|
523
|
+
* `GET /sites/file`) and authenticate with a session token or a `roxp_` PAT.
|
|
393
524
|
*/
|
|
394
525
|
declare class SitesApi {
|
|
395
526
|
private readonly client;
|
|
396
527
|
constructor(client: RoxyonClient);
|
|
397
|
-
|
|
528
|
+
/** Upload a gzip tarball into `host`'s docroot (+ optional sub-`folder`). */
|
|
529
|
+
deploy(host: string, folder: string, tarball: Uint8Array, opts?: DeployOptions): Promise<StaticDeployResult>;
|
|
530
|
+
/** List the files currently in `host`'s docroot (optionally under `path`). */
|
|
531
|
+
listFiles(host: string, folder?: string, path?: string): Promise<SiteFile[]>;
|
|
532
|
+
/** Read one file from `host`'s docroot. */
|
|
533
|
+
readFile(host: string, folder: string, path: string): Promise<SiteFileContent>;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
interface ResetSshPasswordInput {
|
|
537
|
+
/** Subscription to reset. Omit when the account has exactly one. */
|
|
538
|
+
subscription?: string;
|
|
539
|
+
/** Omit to have the platform generate one meeting the strength rules. */
|
|
540
|
+
password?: string;
|
|
541
|
+
}
|
|
542
|
+
interface ResetSshPasswordResult {
|
|
543
|
+
ok: boolean;
|
|
544
|
+
subscription: string;
|
|
545
|
+
/** Shown once — the platform never stores or re-shows it. */
|
|
546
|
+
password: string;
|
|
547
|
+
status: 'pending' | 'active' | 'failed';
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* The shared shell password used for SSH, SFTP and the file manager on a
|
|
551
|
+
* subscription's container (SSHpiper maps the username to the container).
|
|
552
|
+
*/
|
|
553
|
+
declare class SshApi {
|
|
554
|
+
private readonly client;
|
|
555
|
+
constructor(client: RoxyonClient);
|
|
556
|
+
/** `POST /ssh/password` */
|
|
557
|
+
resetPassword(input?: ResetSshPasswordInput): Promise<ResetSshPasswordResult>;
|
|
398
558
|
}
|
|
399
559
|
|
|
400
560
|
interface Subscription {
|
|
401
561
|
objectId: string;
|
|
402
562
|
Name?: string;
|
|
403
563
|
Status?: string;
|
|
404
|
-
Username?: string;
|
|
405
|
-
/** Infra node the subscription's container lives on (internal). */
|
|
406
|
-
Node?: string;
|
|
407
|
-
Datacenter?: string;
|
|
408
564
|
[k: string]: unknown;
|
|
409
565
|
}
|
|
410
566
|
interface Privilege {
|
|
@@ -536,8 +692,11 @@ declare class Roxyon {
|
|
|
536
692
|
readonly domains: DomainsApi;
|
|
537
693
|
readonly applications: ApplicationsApi;
|
|
538
694
|
readonly sites: SitesApi;
|
|
695
|
+
readonly databases: DatabasesApi;
|
|
696
|
+
readonly email: EmailApi;
|
|
697
|
+
readonly ssh: SshApi;
|
|
539
698
|
constructor(options?: RoxyonClientOptions | RoxyonClient);
|
|
540
699
|
get sessionToken(): string | undefined;
|
|
541
700
|
}
|
|
542
701
|
|
|
543
|
-
export { AccountApi, type AccountApp, type AccountContext, type AccountDomain, type AccountSubscription, type Application, type ApplicationProcess, type ApplicationRoute, ApplicationsApi, AuthApi, type CreateApplicationInput, type CreateOnDeploy, type CreatedToken, DEFAULT_APP, DEFAULT_BAAS_URL, DEFAULT_CONSOLE_URL, type DeployKind, type DeployResult, type Domain, DomainsApi, LUMEN_BUILD, type LoginPrecheck, type LoginResult, type Privilege, RUNTIMES, type RequestOptions, Roxyon, RoxyonApiError, RoxyonClient, type RoxyonClientOptions, type RoxyonUser, type RuntimeName, type RuntimeSpec, type SessionGrant, SitesApi, type StaticDeployResult, type Subscription, SubscriptionsApi, type TokenScope, type TokenSummary, TokensApi, assertOk, envFromStored, formatEnv, isAuthError, parseEnv, rxError, toQueryString };
|
|
702
|
+
export { AccountApi, type AccountApp, type AccountContext, type AccountDomain, type AccountSubscription, type Application, type ApplicationProcess, type ApplicationRoute, ApplicationsApi, AuthApi, type CreateApplicationInput, type CreateDatabaseInput, type CreateDatabaseResult, type CreateDomainInput, type CreateDomainResult, type CreateEmailInput, type CreateEmailResult, type CreateOnDeploy, type CreatedToken, DEFAULT_APP, DEFAULT_BAAS_URL, DEFAULT_CONSOLE_URL, type DatabaseSummary, DatabasesApi, type DeleteDatabaseResult, type DeleteEmailResult, type DeployKind, type DeployOptions, type DeployResult, type Domain, DomainsApi, EmailApi, type EmailSummary, LUMEN_BUILD, type LoginPrecheck, type LoginResult, type Privilege, RUNTIMES, type RequestOptions, type ResetSshPasswordInput, type ResetSshPasswordResult, Roxyon, RoxyonApiError, RoxyonClient, type RoxyonClientOptions, type RoxyonUser, type RuntimeName, type RuntimeSpec, type SessionGrant, type SiteFile, type SiteFileContent, SitesApi, SshApi, type StaticDeployResult, type Subscription, SubscriptionsApi, type TokenScope, type TokenSummary, TokensApi, assertOk, envFromStored, formatEnv, isAuthError, parseEnv, rxError, toQueryString };
|