@rulebricks/cli 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.
Files changed (93) hide show
  1. package/README.md +62 -0
  2. package/dist/commands/clone.d.ts +6 -0
  3. package/dist/commands/clone.js +60 -0
  4. package/dist/commands/deploy.d.ts +8 -0
  5. package/dist/commands/deploy.js +409 -0
  6. package/dist/commands/destroy.d.ts +8 -0
  7. package/dist/commands/destroy.js +298 -0
  8. package/dist/commands/init.d.ts +7 -0
  9. package/dist/commands/init.js +201 -0
  10. package/dist/commands/logs.d.ts +9 -0
  11. package/dist/commands/logs.js +222 -0
  12. package/dist/commands/open.d.ts +7 -0
  13. package/dist/commands/open.js +139 -0
  14. package/dist/commands/status.d.ts +5 -0
  15. package/dist/commands/status.js +125 -0
  16. package/dist/commands/upgrade.d.ts +7 -0
  17. package/dist/commands/upgrade.js +239 -0
  18. package/dist/components/DNSWaitScreen.d.ts +9 -0
  19. package/dist/components/DNSWaitScreen.js +73 -0
  20. package/dist/components/Wizard/WizardContext.d.ts +176 -0
  21. package/dist/components/Wizard/WizardContext.js +346 -0
  22. package/dist/components/Wizard/index.d.ts +2 -0
  23. package/dist/components/Wizard/index.js +2 -0
  24. package/dist/components/Wizard/steps/CloudProviderStep.d.ts +6 -0
  25. package/dist/components/Wizard/steps/CloudProviderStep.js +210 -0
  26. package/dist/components/Wizard/steps/CredentialsStep.d.ts +6 -0
  27. package/dist/components/Wizard/steps/CredentialsStep.js +22 -0
  28. package/dist/components/Wizard/steps/DatabaseStep.d.ts +6 -0
  29. package/dist/components/Wizard/steps/DatabaseStep.js +80 -0
  30. package/dist/components/Wizard/steps/DeploymentModeStep.d.ts +5 -0
  31. package/dist/components/Wizard/steps/DeploymentModeStep.js +26 -0
  32. package/dist/components/Wizard/steps/DomainStep.d.ts +6 -0
  33. package/dist/components/Wizard/steps/DomainStep.js +126 -0
  34. package/dist/components/Wizard/steps/FeatureConfigStep.d.ts +6 -0
  35. package/dist/components/Wizard/steps/FeatureConfigStep.js +765 -0
  36. package/dist/components/Wizard/steps/FeaturesStep.d.ts +6 -0
  37. package/dist/components/Wizard/steps/FeaturesStep.js +119 -0
  38. package/dist/components/Wizard/steps/ReviewStep.d.ts +6 -0
  39. package/dist/components/Wizard/steps/ReviewStep.js +56 -0
  40. package/dist/components/Wizard/steps/SMTPStep.d.ts +6 -0
  41. package/dist/components/Wizard/steps/SMTPStep.js +191 -0
  42. package/dist/components/Wizard/steps/SupabaseCredentialsStep.d.ts +6 -0
  43. package/dist/components/Wizard/steps/SupabaseCredentialsStep.js +76 -0
  44. package/dist/components/Wizard/steps/TierStep.d.ts +6 -0
  45. package/dist/components/Wizard/steps/TierStep.js +29 -0
  46. package/dist/components/Wizard/steps/VersionStep.d.ts +6 -0
  47. package/dist/components/Wizard/steps/VersionStep.js +113 -0
  48. package/dist/components/Wizard/steps/index.d.ts +12 -0
  49. package/dist/components/Wizard/steps/index.js +12 -0
  50. package/dist/components/common/AppShell.d.ts +31 -0
  51. package/dist/components/common/AppShell.js +31 -0
  52. package/dist/components/common/Box.d.ts +20 -0
  53. package/dist/components/common/Box.js +20 -0
  54. package/dist/components/common/Logo.d.ts +7 -0
  55. package/dist/components/common/Logo.js +22 -0
  56. package/dist/components/common/Spinner.d.ts +12 -0
  57. package/dist/components/common/Spinner.js +28 -0
  58. package/dist/components/common/index.d.ts +6 -0
  59. package/dist/components/common/index.js +5 -0
  60. package/dist/index.d.ts +2 -0
  61. package/dist/index.js +202 -0
  62. package/dist/lib/cloudCli.d.ts +156 -0
  63. package/dist/lib/cloudCli.js +691 -0
  64. package/dist/lib/config.d.ts +91 -0
  65. package/dist/lib/config.js +278 -0
  66. package/dist/lib/dns.d.ts +41 -0
  67. package/dist/lib/dns.js +235 -0
  68. package/dist/lib/dockerHub.d.ts +57 -0
  69. package/dist/lib/dockerHub.js +128 -0
  70. package/dist/lib/helm.d.ts +53 -0
  71. package/dist/lib/helm.js +209 -0
  72. package/dist/lib/helmValues.d.ts +17 -0
  73. package/dist/lib/helmValues.js +693 -0
  74. package/dist/lib/kubernetes.d.ts +161 -0
  75. package/dist/lib/kubernetes.js +755 -0
  76. package/dist/lib/terraform.d.ts +44 -0
  77. package/dist/lib/terraform.js +230 -0
  78. package/dist/lib/theme.d.ts +81 -0
  79. package/dist/lib/theme.js +115 -0
  80. package/dist/lib/validation.d.ts +47 -0
  81. package/dist/lib/validation.js +164 -0
  82. package/dist/lib/versions.d.ts +69 -0
  83. package/dist/lib/versions.js +139 -0
  84. package/dist/types/index.d.ts +718 -0
  85. package/dist/types/index.js +556 -0
  86. package/email-templates/email_change.html +325 -0
  87. package/email-templates/invite.html +383 -0
  88. package/email-templates/password_change.html +414 -0
  89. package/email-templates/verify.html +396 -0
  90. package/package.json +78 -0
  91. package/terraform/aws/main.tf +327 -0
  92. package/terraform/azure/main.tf +326 -0
  93. package/terraform/gcp/main.tf +369 -0
@@ -0,0 +1,161 @@
1
+ import { CloudProvider } from "../types/index.js";
2
+ /**
3
+ * Checks if kubectl is installed
4
+ */
5
+ export declare function isKubectlInstalled(): Promise<boolean>;
6
+ /**
7
+ * Gets the kubectl client version
8
+ */
9
+ export declare function getKubectlVersion(): Promise<string>;
10
+ /**
11
+ * Checks if the cluster is accessible
12
+ */
13
+ export declare function isClusterAccessible(): Promise<boolean>;
14
+ /**
15
+ * Checks if the cluster is accessible and returns error details if not.
16
+ * Returns null if accessible, or an error message string if not.
17
+ */
18
+ export declare function checkClusterAccessible(): Promise<string | null>;
19
+ /**
20
+ * Gets the current kubectl context
21
+ */
22
+ export declare function getCurrentContext(): Promise<string | null>;
23
+ /**
24
+ * Gets pod status for the Rulebricks namespace
25
+ */
26
+ export declare function getPodStatus(namespace?: string): Promise<PodStatus[]>;
27
+ export interface PodStatus {
28
+ name: string;
29
+ status: string;
30
+ ready: boolean;
31
+ restarts: number;
32
+ }
33
+ /**
34
+ * Gets service status for the Rulebricks namespace
35
+ */
36
+ export declare function getServiceStatus(namespace?: string): Promise<ServiceStatus[]>;
37
+ export interface ServiceStatus {
38
+ name: string;
39
+ type: string;
40
+ ports: number[];
41
+ externalIP: string | null;
42
+ }
43
+ /**
44
+ * Gets ingress status for the Rulebricks namespace
45
+ */
46
+ export declare function getIngressStatus(namespace?: string): Promise<IngressStatus[]>;
47
+ export interface IngressStatus {
48
+ name: string;
49
+ hosts: string[];
50
+ tls: boolean;
51
+ address: string | null;
52
+ }
53
+ /**
54
+ * Gets certificate status
55
+ */
56
+ export declare function getCertificateStatus(namespace?: string): Promise<CertificateStatus[]>;
57
+ export interface CertificateStatus {
58
+ name: string;
59
+ dnsNames: string[];
60
+ ready: boolean;
61
+ }
62
+ /**
63
+ * Streams logs from a pod
64
+ */
65
+ export declare function streamLogs(podName: string, namespace?: string, options?: {
66
+ follow?: boolean;
67
+ tail?: number;
68
+ container?: string;
69
+ }): Promise<void>;
70
+ /**
71
+ * Callback type for receiving log lines from multiple pods
72
+ */
73
+ export type LogLineCallback = (podName: string, line: string, colorIndex: number) => void;
74
+ /**
75
+ * Streams logs from multiple pods simultaneously.
76
+ * Each log line is prefixed with the pod name and a unique color.
77
+ * Returns a cleanup function to stop all log streams.
78
+ */
79
+ export declare function streamMultiPodLogs(podNames: string[], namespace: string, options?: {
80
+ follow?: boolean;
81
+ tail?: number;
82
+ timestamps?: boolean;
83
+ onLine?: LogLineCallback;
84
+ }): () => void;
85
+ /**
86
+ * Gets pods by label selector
87
+ */
88
+ export declare function getPodsByLabel(labelSelector: string, namespace?: string): Promise<string[]>;
89
+ /**
90
+ * List of valid component names for log viewing
91
+ */
92
+ export declare const VALID_LOG_COMPONENTS: string[];
93
+ /**
94
+ * Gets pods for a specific component in a deployment.
95
+ * Queries all pods in the namespace and filters by component name patterns.
96
+ * This approach works for all components including subcharts like Traefik
97
+ * that may have different instance labels than the parent release.
98
+ */
99
+ export declare function getComponentPods(component: string, _releaseName: string, namespace: string): Promise<string[]>;
100
+ /**
101
+ * Deletes a namespace
102
+ */
103
+ export declare function deleteNamespace(namespace: string, options?: {
104
+ wait?: boolean;
105
+ }): Promise<void>;
106
+ /**
107
+ * Deletes all PVCs in a namespace
108
+ */
109
+ export declare function deletePVCs(namespace: string, options?: {
110
+ wait?: boolean;
111
+ }): Promise<void>;
112
+ /**
113
+ * Removes finalizers from KEDA ScaledObjects to prevent namespace deletion from hanging.
114
+ * KEDA finalizers wait for the KEDA controller to clean up, but if KEDA is being deleted
115
+ * with the namespace, this causes a deadlock.
116
+ */
117
+ export declare function removeKedaFinalizers(namespace: string): Promise<void>;
118
+ /**
119
+ * Checks if a namespace exists
120
+ */
121
+ export declare function namespaceExists(namespace: string): Promise<boolean>;
122
+ /**
123
+ * Waits for cluster to be accessible with retries.
124
+ * EKS IAM authentication can take time to propagate after cluster creation.
125
+ */
126
+ export declare function waitForClusterAccess(maxRetries?: number, delayMs?: number): Promise<void>;
127
+ /**
128
+ * Creates default StorageClass for the cloud provider.
129
+ * Should be called after kubeconfig is configured and cluster is accessible.
130
+ */
131
+ export declare function createDefaultStorageClass(provider: CloudProvider): Promise<void>;
132
+ /**
133
+ * Deployed image versions from Kubernetes
134
+ */
135
+ export interface DeployedVersions {
136
+ appVersion: string | null;
137
+ hpsVersion: string | null;
138
+ }
139
+ /**
140
+ * Gets the actual deployed image versions from Kubernetes deployments.
141
+ * Queries the app and HPS deployments to get their current image tags.
142
+ *
143
+ * @param releaseName - The Helm release name (e.g., "rulebricks")
144
+ * @param namespace - The Kubernetes namespace
145
+ * @returns DeployedVersions with app and HPS versions, or null if not found
146
+ */
147
+ export declare function getDeployedImageVersions(releaseName: string, namespace: string): Promise<DeployedVersions>;
148
+ /**
149
+ * Kubernetes workload types that support rollout restart
150
+ */
151
+ export type WorkloadType = "deployment" | "statefulset" | "daemonset";
152
+ /**
153
+ * Performs a rollout restart on a Kubernetes workload (deployment, statefulset, or daemonset).
154
+ * This forces pods to be recreated, pulling fresh images if pullPolicy is Always.
155
+ *
156
+ * @param workloadType - The type of workload (deployment, statefulset, daemonset)
157
+ * @param name - The name of the workload to restart
158
+ * @param namespace - The Kubernetes namespace
159
+ * @returns true if restart was successful, false if workload doesn't exist or failed
160
+ */
161
+ export declare function rolloutRestart(workloadType: WorkloadType, name: string, namespace: string): Promise<boolean>;