@insforge/cli 0.1.9 → 0.1.10

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.js CHANGED
@@ -2745,6 +2745,89 @@ function registerLogsCommand(program2) {
2745
2745
  });
2746
2746
  }
2747
2747
 
2748
+ // src/commands/metadata.ts
2749
+ function registerMetadataCommand(program2) {
2750
+ program2.command("metadata").description("Show backend metadata (auth, database, buckets, edge functions, realtime, AI models)").action(async (_opts, cmd) => {
2751
+ const { json } = getRootOpts(cmd);
2752
+ try {
2753
+ await requireAuth();
2754
+ const res = await ossFetch("/api/metadata");
2755
+ const data = await res.json();
2756
+ if (json) {
2757
+ outputJson(data);
2758
+ return;
2759
+ }
2760
+ console.log("\n Auth");
2761
+ console.log(` OAuth Providers: ${data.auth.oAuthProviders.length ? data.auth.oAuthProviders.join(", ") : "(none)"}`);
2762
+ console.log(` Email Verification: ${data.auth.requireEmailVerification ? "Yes" : "No"}`);
2763
+ console.log(` Password Policy:`);
2764
+ console.log(` Min Length: ${data.auth.passwordMinLength}, requireLowercase: ${data.auth.requireLowercase}, requireNumber: ${data.auth.requireNumber}, requireSpecialChar: ${data.auth.requireSpecialChar}, requireUppercase: ${data.auth.requireUppercase}`);
2765
+ console.log(` Verify Email Method: ${data.auth.verifyEmailMethod}`);
2766
+ console.log(` Reset Password Method: ${data.auth.resetPasswordMethod}`);
2767
+ console.log("\n Database");
2768
+ console.log(` Size: ${formatSize2(data.database.totalSizeInGB)}`);
2769
+ if (data.database.tables.length) {
2770
+ outputTable(
2771
+ ["Table", "Records"],
2772
+ data.database.tables.map((t) => [t.tableName, String(t.recordCount)])
2773
+ );
2774
+ } else {
2775
+ console.log(" No tables.");
2776
+ }
2777
+ console.log("\n Storage");
2778
+ console.log(` Size: ${formatSize2(data.storage.totalSizeInGB)}`);
2779
+ if (data.storage.buckets.length) {
2780
+ outputTable(
2781
+ ["Bucket", "Public", "Objects"],
2782
+ data.storage.buckets.map((b) => [b.name, b.public ? "Yes" : "No", String(b.objectCount ?? "-")])
2783
+ );
2784
+ } else {
2785
+ console.log(" No buckets.");
2786
+ }
2787
+ console.log("\n Functions");
2788
+ if (data.functions.length) {
2789
+ outputTable(
2790
+ ["Slug", "Name", "Status", "Description"],
2791
+ data.functions.map((f) => [f.slug, f.name, f.status, f.description || "-"])
2792
+ );
2793
+ } else {
2794
+ console.log(" No functions deployed.");
2795
+ }
2796
+ if (data.aiIntegration?.models?.length) {
2797
+ console.log("\n AI Models");
2798
+ outputTable(
2799
+ ["Model", "Input", "Output"],
2800
+ data.aiIntegration.models.map((m) => [
2801
+ m.modelId,
2802
+ m.inputModality.join(", "),
2803
+ m.outputModality.join(", ")
2804
+ ])
2805
+ );
2806
+ }
2807
+ if (data.realtime?.channels && Array.isArray(data.realtime.channels) && data.realtime.channels.length) {
2808
+ console.log(`
2809
+ Realtime: ${data.realtime.channels.length} channel(s)`);
2810
+ outputTable(
2811
+ ["Id", "Pattern", "Webhook URLs", "Enabled", "Description"],
2812
+ data.realtime.channels.map((c) => [c.id, c.pattern, c.webhookUrls?.join(", ") || "-", c.enabled ? "Yes" : "No", c.description || "-"])
2813
+ );
2814
+ }
2815
+ if (data.version) {
2816
+ console.log(`
2817
+ Version: ${data.version}`);
2818
+ }
2819
+ console.log("");
2820
+ } catch (err) {
2821
+ handleError(err, json);
2822
+ }
2823
+ });
2824
+ }
2825
+ function formatSize2(gb) {
2826
+ if (gb < 1e-3) return `${(gb * 1024 * 1024).toFixed(1)} KB`;
2827
+ if (gb < 1) return `${(gb * 1024).toFixed(2)} MB`;
2828
+ return `${gb.toFixed(2)} GB`;
2829
+ }
2830
+
2748
2831
  // src/index.ts
2749
2832
  var __dirname = dirname(fileURLToPath(import.meta.url));
2750
2833
  var pkg = JSON.parse(readFileSync6(join6(__dirname, "../package.json"), "utf-8"));
@@ -2810,6 +2893,7 @@ registerSecretsAddCommand(secretsCmd);
2810
2893
  registerSecretsUpdateCommand(secretsCmd);
2811
2894
  registerSecretsDeleteCommand(secretsCmd);
2812
2895
  registerLogsCommand(program);
2896
+ registerMetadataCommand(program);
2813
2897
  var schedulesCmd = program.command("schedules").description("Manage scheduled tasks (cron jobs)");
2814
2898
  registerSchedulesListCommand(schedulesCmd);
2815
2899
  registerSchedulesGetCommand(schedulesCmd);