ninepm 0.69.0 → 0.78.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/README.md +86 -10
- package/dist/cli-types.d.ts +2 -0
- package/dist/dns-host.d.ts +15 -0
- package/dist/dns-host.js +43 -0
- package/dist/dns-providers.d.ts +91 -0
- package/dist/dns-providers.js +194 -0
- package/dist/domain-state.d.ts +147 -0
- package/dist/domain-state.js +248 -0
- package/dist/index.d.ts +185 -7
- package/dist/index.js +906 -24
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Agent } from "undici";
|
|
3
|
+
import { type DomainNext, type DomainReason, type DomainRecordStatus, type DomainState, type DomainStateDnsCheck, type DomainStateDnsInstruction, type DomainStateInput } from "./domain-state.js";
|
|
3
4
|
import type { AccessGrant, AccessGrantType, AccessProviderKey, AppAccessSettings, AppAccessServiceToken, AppAccessToken, AppDatabase, AppRuntime, AppUserFilesUsage, ContainerImageUploadInstruction, ContainerRegion, Deployment, ManagedFileObject, ManagedFileShare, ManagedFileUsage, Project } from "./cli-types.js";
|
|
4
5
|
export interface DeployOptions {
|
|
5
6
|
directory: string;
|
|
@@ -18,6 +19,7 @@ export interface DeployOptions {
|
|
|
18
19
|
runtime?: AppRuntime;
|
|
19
20
|
entry?: string;
|
|
20
21
|
publicAssets?: string;
|
|
22
|
+
missingPages?: "spa" | "404";
|
|
21
23
|
port?: number;
|
|
22
24
|
healthPath?: string;
|
|
23
25
|
region?: ContainerRegion;
|
|
@@ -105,6 +107,7 @@ export interface DeletedSiteResult {
|
|
|
105
107
|
slug: string;
|
|
106
108
|
workers: number;
|
|
107
109
|
customDomains: number;
|
|
110
|
+
customDomainNames?: string[];
|
|
108
111
|
containerApplications?: number;
|
|
109
112
|
containerImages?: number;
|
|
110
113
|
accessApps: number;
|
|
@@ -124,7 +127,7 @@ export interface CreatedServiceToken {
|
|
|
124
127
|
clientSecret: string;
|
|
125
128
|
}
|
|
126
129
|
export type FetchLike = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
127
|
-
export declare const CLI_VERSION = "0.
|
|
130
|
+
export declare const CLI_VERSION = "0.78.0";
|
|
128
131
|
type CredentialBackend = "macos-keychain" | "windows-dpapi" | "linux-secret-service" | "file-plaintext" | "none";
|
|
129
132
|
export interface StoredCredentialEntry {
|
|
130
133
|
token: string;
|
|
@@ -225,7 +228,8 @@ export declare class DeployError extends Error {
|
|
|
225
228
|
* prevent (#1061).
|
|
226
229
|
*/
|
|
227
230
|
export declare class DeliberateRefusalError extends Error {
|
|
228
|
-
|
|
231
|
+
readonly code: string | undefined;
|
|
232
|
+
constructor(message: string, code?: string);
|
|
229
233
|
}
|
|
230
234
|
export declare function isDeliberateRefusal(error: unknown): boolean;
|
|
231
235
|
export declare function deployDirectory(initialOptions: DeployOptions): Promise<DeployResult>;
|
|
@@ -271,12 +275,16 @@ export type LogoutSummary = {
|
|
|
271
275
|
};
|
|
272
276
|
export declare function summarizeRevocations(attempts: RevocationAttempt[]): LogoutSummary;
|
|
273
277
|
export declare function getSiteAccess(options: SiteAccessOptions): Promise<AccessState>;
|
|
274
|
-
export declare
|
|
275
|
-
export
|
|
276
|
-
|
|
278
|
+
export declare const ACCESS_MODE_CHANGE_UNCONFIRMED = "access_mode_change_unconfirmed";
|
|
279
|
+
export interface AccessModeChangeOptions extends SiteAccessOptions {
|
|
280
|
+
switchMode?: boolean;
|
|
281
|
+
}
|
|
282
|
+
export declare function setSiteAccessPublic(options: AccessModeChangeOptions): Promise<AccessState["access"]>;
|
|
283
|
+
export declare function setSiteAccessOtp(options: AccessModeChangeOptions): Promise<AccessState["access"]>;
|
|
284
|
+
export declare function setSiteAccessIdp(options: AccessModeChangeOptions & {
|
|
277
285
|
providers?: AccessProviderKey[];
|
|
278
286
|
}): Promise<AccessState["access"]>;
|
|
279
|
-
export declare function createAccessServiceToken(options:
|
|
287
|
+
export declare function createAccessServiceToken(options: AccessModeChangeOptions & {
|
|
280
288
|
name?: string;
|
|
281
289
|
duration?: string;
|
|
282
290
|
}): Promise<CreatedServiceToken>;
|
|
@@ -485,6 +493,7 @@ export declare function dashboardUrlForApiUrl(apiUrl: string): string;
|
|
|
485
493
|
type CliCommand = {
|
|
486
494
|
kind: "deploy";
|
|
487
495
|
options: DeployOptions;
|
|
496
|
+
apiUrlFrom: ApiUrlSource;
|
|
488
497
|
} | {
|
|
489
498
|
kind: "version";
|
|
490
499
|
} | {
|
|
@@ -612,6 +621,37 @@ type CliCommand = {
|
|
|
612
621
|
};
|
|
613
622
|
apiUrl: string;
|
|
614
623
|
token: string;
|
|
624
|
+
} | {
|
|
625
|
+
kind: "domains";
|
|
626
|
+
owner?: string;
|
|
627
|
+
apiUrlFrom: ApiUrlSource;
|
|
628
|
+
action: {
|
|
629
|
+
kind: "list";
|
|
630
|
+
site?: string;
|
|
631
|
+
json: boolean;
|
|
632
|
+
} | {
|
|
633
|
+
kind: "add" | "status" | "check";
|
|
634
|
+
site: string;
|
|
635
|
+
hostname: string;
|
|
636
|
+
json: boolean;
|
|
637
|
+
} | {
|
|
638
|
+
kind: "wait";
|
|
639
|
+
site: string;
|
|
640
|
+
hostname: string;
|
|
641
|
+
json: boolean;
|
|
642
|
+
timeoutSeconds: number;
|
|
643
|
+
intervalSeconds: number;
|
|
644
|
+
} | {
|
|
645
|
+
kind: "restart";
|
|
646
|
+
site: string;
|
|
647
|
+
hostname: string;
|
|
648
|
+
} | {
|
|
649
|
+
kind: "remove";
|
|
650
|
+
site: string;
|
|
651
|
+
hostname: string;
|
|
652
|
+
};
|
|
653
|
+
apiUrl: string;
|
|
654
|
+
token: string;
|
|
615
655
|
} | {
|
|
616
656
|
kind: "deployments";
|
|
617
657
|
action: {
|
|
@@ -632,13 +672,16 @@ type CliCommand = {
|
|
|
632
672
|
} | {
|
|
633
673
|
kind: "public";
|
|
634
674
|
site: string;
|
|
675
|
+
switchMode?: true;
|
|
635
676
|
} | {
|
|
636
677
|
kind: "otp";
|
|
637
678
|
site: string;
|
|
679
|
+
switchMode?: true;
|
|
638
680
|
} | {
|
|
639
681
|
kind: "idp";
|
|
640
682
|
site: string;
|
|
641
683
|
providers?: AccessProviderKey[];
|
|
684
|
+
switchMode?: true;
|
|
642
685
|
} | {
|
|
643
686
|
kind: "allow";
|
|
644
687
|
site: string;
|
|
@@ -654,6 +697,7 @@ type CliCommand = {
|
|
|
654
697
|
site: string;
|
|
655
698
|
name?: string;
|
|
656
699
|
duration?: string;
|
|
700
|
+
switchMode?: true;
|
|
657
701
|
} | {
|
|
658
702
|
kind: "service-revoke";
|
|
659
703
|
site: string;
|
|
@@ -669,6 +713,7 @@ type CliCommand = {
|
|
|
669
713
|
tokenId: string;
|
|
670
714
|
};
|
|
671
715
|
apiUrl: string;
|
|
716
|
+
apiUrlFrom: ApiUrlSource;
|
|
672
717
|
token: string;
|
|
673
718
|
};
|
|
674
719
|
export declare function parseArgs(argv: string[]): CliCommand;
|
|
@@ -688,7 +733,129 @@ export declare function deploymentsListJson<T extends ListedDeployment>(deployme
|
|
|
688
733
|
serving: boolean;
|
|
689
734
|
}>;
|
|
690
735
|
};
|
|
736
|
+
export { CUSTOM_DOMAIN_EXPIRED_TEXT, deriveDomainState, deriveDomainStatus, domainRecordStatuses, type DomainRecordCheck, type DomainRecordStatus, type DomainState, } from "./domain-state.js";
|
|
737
|
+
export type CliDnsInstruction = DomainStateDnsInstruction;
|
|
738
|
+
export type CliDomainDnsCheck = DomainStateDnsCheck & {
|
|
739
|
+
advisories?: Array<{
|
|
740
|
+
code: string;
|
|
741
|
+
message: string;
|
|
742
|
+
}>;
|
|
743
|
+
};
|
|
744
|
+
export interface CliDomain extends DomainStateInput {
|
|
745
|
+
dnsCheck?: CliDomainDnsCheck;
|
|
746
|
+
expireAfter?: string | null;
|
|
747
|
+
expiresAt?: string | null;
|
|
748
|
+
app?: {
|
|
749
|
+
id: string;
|
|
750
|
+
slug: string;
|
|
751
|
+
name: string;
|
|
752
|
+
};
|
|
753
|
+
state?: string;
|
|
754
|
+
reason?: DomainReason | null;
|
|
755
|
+
next?: DomainNext;
|
|
756
|
+
}
|
|
757
|
+
export interface DomainRecordStatusJson extends DomainRecordStatus {
|
|
758
|
+
typeAtProvider: string | null;
|
|
759
|
+
nameAtProvider: string;
|
|
760
|
+
valueAtProvider: string;
|
|
761
|
+
}
|
|
762
|
+
export interface DomainStatusJson {
|
|
763
|
+
hostname: string;
|
|
764
|
+
app: string;
|
|
765
|
+
state: DomainState | (string & {});
|
|
766
|
+
routing: string;
|
|
767
|
+
tls: string;
|
|
768
|
+
provider: string | null;
|
|
769
|
+
providerId: string | null;
|
|
770
|
+
nameservers: string[];
|
|
771
|
+
zone: string | null;
|
|
772
|
+
records: DomainRecordStatusJson[];
|
|
773
|
+
advisories: Array<{
|
|
774
|
+
code: string;
|
|
775
|
+
message: string;
|
|
776
|
+
}>;
|
|
777
|
+
error: string | null;
|
|
778
|
+
expiresAt: string | null;
|
|
779
|
+
checkedAt: string;
|
|
780
|
+
reason: DomainReason | null;
|
|
781
|
+
next: DomainNext;
|
|
782
|
+
}
|
|
783
|
+
export declare const DOMAIN_WAIT_EXIT: {
|
|
784
|
+
readonly live: 0;
|
|
785
|
+
readonly ownerAction: 10;
|
|
786
|
+
readonly platform: 11;
|
|
787
|
+
readonly failed: 20;
|
|
788
|
+
};
|
|
789
|
+
export declare function domainStatusJson(domain: CliDomain, app: string, checkedAt: string): DomainStatusJson;
|
|
790
|
+
export declare function domainStateLabel(state: string): string;
|
|
791
|
+
export declare function domainWaitExitCode(status: Pick<DomainStatusJson, "state" | "next">): number;
|
|
792
|
+
export interface DomainFormatOptions {
|
|
793
|
+
owner?: string;
|
|
794
|
+
target?: AccessApiTarget;
|
|
795
|
+
}
|
|
796
|
+
export declare const DNS_PROVIDER_NOTES: Record<string, string>;
|
|
797
|
+
export declare function formatDomainStatus(status: DomainStatusJson, options?: DomainFormatOptions): string[];
|
|
798
|
+
export declare function domainWaitTimeoutMessage(status: DomainStatusJson): string;
|
|
799
|
+
export declare function formatDomainsList(statuses: DomainStatusJson[]): string[];
|
|
800
|
+
export declare class DomainsApiError extends Error {
|
|
801
|
+
readonly status: number;
|
|
802
|
+
readonly code: string | null;
|
|
803
|
+
constructor(message: string, status: number, code: string | null);
|
|
804
|
+
}
|
|
805
|
+
export declare function domainsApiError(status: number, text: string): DomainsApiError;
|
|
806
|
+
export interface DomainCommandOptions extends ApiOptions {
|
|
807
|
+
site: string;
|
|
808
|
+
owner?: string;
|
|
809
|
+
}
|
|
810
|
+
export declare function normalizeDomainArg(value: string): string;
|
|
811
|
+
export declare function listDomainStatuses(options: ApiOptions & {
|
|
812
|
+
site?: string;
|
|
813
|
+
owner?: string;
|
|
814
|
+
now?: () => Date;
|
|
815
|
+
}): Promise<DomainStatusJson[]>;
|
|
816
|
+
export declare function getDomainStatus(options: DomainCommandOptions & {
|
|
817
|
+
hostname: string;
|
|
818
|
+
now?: () => Date;
|
|
819
|
+
}): Promise<DomainStatusJson>;
|
|
820
|
+
export declare function addDomain(options: DomainCommandOptions & {
|
|
821
|
+
hostname: string;
|
|
822
|
+
}): Promise<CliDomain | null>;
|
|
823
|
+
export declare function recheckDomain(options: DomainCommandOptions & {
|
|
824
|
+
hostname: string;
|
|
825
|
+
}): Promise<void>;
|
|
826
|
+
export declare function restartDomain(options: DomainCommandOptions & {
|
|
827
|
+
hostname: string;
|
|
828
|
+
}): Promise<{
|
|
829
|
+
domain: CliDomain;
|
|
830
|
+
replacedInstructions: CliDnsInstruction[];
|
|
831
|
+
}>;
|
|
832
|
+
export declare function removeDomain(options: DomainCommandOptions & {
|
|
833
|
+
hostname: string;
|
|
834
|
+
}): Promise<CliDomain | null>;
|
|
835
|
+
export declare const DEPLOY_DOMAINS_TIMEOUT_MS = 4500;
|
|
836
|
+
export declare function deployCustomDomainStatuses(options: ApiOptions & {
|
|
837
|
+
projectId: string;
|
|
838
|
+
slug: string;
|
|
839
|
+
timeoutMs?: number;
|
|
840
|
+
now?: () => Date;
|
|
841
|
+
}): Promise<DomainStatusJson[] | null>;
|
|
842
|
+
export declare function deployCustomDomainLines(statuses: DomainStatusJson[] | null, slug: string, owner?: string, target?: AccessApiTarget): string[];
|
|
843
|
+
export interface DomainWaitResult {
|
|
844
|
+
status: DomainStatusJson;
|
|
845
|
+
exitCode: number;
|
|
846
|
+
timedOut: boolean;
|
|
847
|
+
}
|
|
848
|
+
export declare function waitForDomain(options: DomainCommandOptions & {
|
|
849
|
+
hostname: string;
|
|
850
|
+
timeoutMs: number;
|
|
851
|
+
intervalMs: number;
|
|
852
|
+
nowMs?: () => number;
|
|
853
|
+
sleepFn?: (ms: number) => Promise<void>;
|
|
854
|
+
onStatus?: (status: DomainStatusJson) => void;
|
|
855
|
+
onRetry?: (error: unknown) => void;
|
|
856
|
+
}): Promise<DomainWaitResult>;
|
|
691
857
|
export declare function healthWithReason(status: string | null | undefined, reason: string | null | undefined): string;
|
|
858
|
+
export type ApiUrlSource = "flag" | "env" | "default";
|
|
692
859
|
export declare function workerPublicFiles(paths: readonly string[], serverEntry: string, selection: string | null): Array<{
|
|
693
860
|
path: string;
|
|
694
861
|
url: string;
|
|
@@ -723,4 +890,15 @@ export declare function hasNoGraphicalDisplay(platform: string, env: Record<stri
|
|
|
723
890
|
export declare function formatAppUserFilesUsageLine(slug: string, usage: AppUserFilesUsage): string;
|
|
724
891
|
export declare class UsageError extends Error {
|
|
725
892
|
}
|
|
726
|
-
export
|
|
893
|
+
export declare function missingPagesLine(deployment: Deployment): string | null;
|
|
894
|
+
type AccessModeChangeAction = Extract<Extract<CliCommand, {
|
|
895
|
+
kind: "access";
|
|
896
|
+
}>["action"], {
|
|
897
|
+
kind: "public" | "otp" | "idp" | "service-create";
|
|
898
|
+
}>;
|
|
899
|
+
export interface AccessApiTarget {
|
|
900
|
+
apiUrl: string;
|
|
901
|
+
apiUrlFrom: ApiUrlSource;
|
|
902
|
+
}
|
|
903
|
+
export declare function apiUrlFlagFor(target?: AccessApiTarget): string;
|
|
904
|
+
export declare function accessSwitchModeCommand(action: AccessModeChangeAction, target?: AccessApiTarget): string;
|