@fluid-app/fluid-cli-droplets 0.1.791 → 0.1.793

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 (2) hide show
  1. package/dist/index.mjs +24 -36
  2. package/package.json +7 -7
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ import Ajv2020 from "ajv/dist/2020.js";
4
4
  import { createHash } from "node:crypto";
5
5
  import { createInterface } from "node:readline/promises";
6
6
  import "commander";
7
- //#region ../../../apps/rails/config/droplet_manifest/v1.schema.json
7
+ // ../../../apps/rails/config/droplet_manifest/v1.schema.json
8
8
  var v1_schema_default = {
9
9
  $schema: "https://json-schema.org/draft/2020-12/schema",
10
10
  $id: "https://schemas.fluid.app/droplet/manifest/v1.json",
@@ -294,8 +294,7 @@ var v1_schema_default = {
294
294
  }
295
295
  }
296
296
  };
297
- //#endregion
298
- //#region src/manifest/validate.ts
297
+ // src/manifest/validate.ts
299
298
  const AUTHORITY = "The server is authoritative and checks additional catalogs, scope ceilings and publisher identity.";
300
299
  const checkSchema = new Ajv2020({
301
300
  allErrors: true,
@@ -332,7 +331,7 @@ function validateManifest(text) {
332
331
  code,
333
332
  detail
334
333
  });
335
- if (Buffer.byteLength(text) > 256 * 1024) {
334
+ if (Buffer.byteLength(text) > 262144) {
336
335
  add("/", "manifest_too_large");
337
336
  return { errors };
338
337
  }
@@ -402,8 +401,7 @@ function validateManifest(text) {
402
401
  errors
403
402
  };
404
403
  }
405
- //#endregion
406
- //#region src/manifest/canonical.ts
404
+ // src/manifest/canonical.ts
407
405
  /** Public: Serialize JSON using RFC 8785 UTF-16 ordering and ECMAScript numbers. */
408
406
  function canonicalize(value) {
409
407
  if (typeof value === "string") {
@@ -423,9 +421,11 @@ function canonicalize(value) {
423
421
  function manifestDigest(value) {
424
422
  return `sha256:${createHash("sha256").update(canonicalize(value)).digest("hex")}`;
425
423
  }
426
- //#endregion
427
- //#region src/manifest/publish.ts
424
+ // src/manifest/publish.ts
428
425
  var ManifestError = class extends Error {
426
+ code;
427
+ exitCode;
428
+ details;
429
429
  constructor(code, exitCode = 1, details) {
430
430
  super(code);
431
431
  this.code = code;
@@ -493,8 +493,7 @@ async function publishManifest(manifest, baseUrl, dryRun, allowWidening) {
493
493
  ...dryRun || allowWidening ? { allow_widening: true } : {}
494
494
  });
495
495
  }
496
- //#endregion
497
- //#region src/install/api.ts
496
+ // src/install/api.ts
498
497
  /** A failure the CLI reports as-is, with a non-zero exit. */
499
498
  var DropletsCliError = class extends Error {
500
499
  constructor(message) {
@@ -646,8 +645,7 @@ async function getDropletHealth(client, dropletUuid, windowHours) {
646
645
  return rethrowDropletReadError(error, dropletUuid, "health");
647
646
  }
648
647
  }
649
- //#endregion
650
- //#region src/status/api.ts
648
+ // src/status/api.ts
651
649
  function statusPath(dropletUuid) {
652
650
  return `/api/company/v2026-10/droplets/${encodeURIComponent(dropletUuid)}/status`;
653
651
  }
@@ -662,8 +660,7 @@ async function getDropletStatus(client, dropletUuid, windowHours) {
662
660
  return rethrowDropletReadError(error, dropletUuid, "status", `${dropletUuid} has no installation for this company, or is not a droplet it can see. List what is installed with \`fluid droplets installed\`.`);
663
661
  }
664
662
  }
665
- //#endregion
666
- //#region src/commands/install.ts
663
+ // src/commands/install.ts
667
664
  async function askOnTerminal(question) {
668
665
  const readline = createInterface({
669
666
  input: process.stdin,
@@ -745,8 +742,7 @@ function registerInstallCommands(parent, ctx) {
745
742
  ctx.output(await listInstallations(await dropletsClient$1(ctx), opts));
746
743
  }));
747
744
  }
748
- //#endregion
749
- //#region src/commands/manifest.ts
745
+ // src/commands/manifest.ts
750
746
  /** Public: Register local validation and Actions-only manifest publication commands. */
751
747
  function registerManifestCommands(parent, ctx) {
752
748
  const manifest = parent.command("manifest").description(`Droplet manifests. ${AUTHORITY}`);
@@ -773,8 +769,8 @@ function registerManifestCommands(parent, ctx) {
773
769
  }
774
770
  try {
775
771
  const file = path ?? "./fluid.droplet.json";
776
- const limit = 256 * 1024;
777
- const buffer = Buffer.alloc(limit + 1);
772
+ const limit = 262144;
773
+ const buffer = Buffer.alloc(262145);
778
774
  let length = 0;
779
775
  const handle = await open(file, "r");
780
776
  try {
@@ -831,8 +827,7 @@ function registerManifestCommands(parent, ctx) {
831
827
  });
832
828
  }
833
829
  }
834
- //#endregion
835
- //#region src/commands/rollback.ts
830
+ // src/commands/rollback.ts
836
831
  /** Public: Register confirmed rollbacks for one installation or all of a droplet. */
837
832
  function registerRollbackCommands(parent, ctx) {
838
833
  parent.command("rollback <version>").description("Roll back live config; would_await_consent still requires merchant consent").option("--install <uuid>", "Installation to roll back").option("--all", "Roll back all installations").option("--droplet <uuid>", "Owned droplet (required with --all)").option("--yes", "Confirm without a prompt", false).action(async (version, opts) => {
@@ -852,8 +847,7 @@ function registerRollbackCommands(parent, ctx) {
852
847
  }
853
848
  });
854
849
  }
855
- //#endregion
856
- //#region src/publish/api.ts
850
+ // src/publish/api.ts
857
851
  /**
858
852
  * Asking Fluid to publish a droplet, and a root admin's review of those
859
853
  * requests, through the v2026-10 APIs
@@ -942,8 +936,7 @@ async function decidePublishRequest(client, requestId, decision, reason) {
942
936
  if (decision === "reject" && !reason?.trim()) throw new DropletsCliError("Say why with --reason.");
943
937
  return (await client.post(reviewPath(requestId, decision), decision === "reject" ? { reason } : void 0)).publish_request;
944
938
  }
945
- //#endregion
946
- //#region src/commands/publish.ts
939
+ // src/commands/publish.ts
947
940
  function run(action) {
948
941
  return action().catch(fail);
949
942
  }
@@ -980,18 +973,17 @@ function registerPublishCommands(parent, ctx) {
980
973
  ctx.output(await decidePublishRequest(await dropletsClient(ctx), requestId, "reject", opts.reason));
981
974
  }));
982
975
  }
983
- //#endregion
984
- //#region src/generated/categories.ts
976
+ // src/generated/categories.ts
985
977
  function registerCategories(parent, ctx) {
986
- declareInputs(parent.command("categories").description("categories").command("list").description("Returns a list of all droplet categories").action(async () => {
978
+ const resource = parent.command("categories").description("categories");
979
+ declareInputs(resource.command("list").description("Returns a list of all droplet categories").action(async () => {
987
980
  const client = await ctx.getClient();
988
981
  if (ctx.verbose) process.stderr.write("GET /api/droplet_categories\n");
989
982
  const result = await client.get(`/api/droplet_categories`);
990
983
  ctx.output(result);
991
984
  }), () => []);
992
985
  }
993
- //#endregion
994
- //#region src/generated/installations.ts
986
+ // src/generated/installations.ts
995
987
  function registerInstallations(parent, ctx) {
996
988
  const resource = parent.command("installations").description("installations");
997
989
  declareInputs(resource.command("list").description("List droplet installations").option("--page <value>", "Page number for pagination").option("--per-page <value>", "Number of records per page (max: 100)").option("--category <value>", "Filter by droplet category").action(async (opts) => {
@@ -1044,8 +1036,7 @@ function registerInstallations(parent, ctx) {
1044
1036
  ctx.output(result);
1045
1037
  }), () => []);
1046
1038
  }
1047
- //#endregion
1048
- //#region src/generated/primary.ts
1039
+ // src/generated/primary.ts
1049
1040
  function registerPrimary(parent, ctx) {
1050
1041
  declareInputs(parent.command("get-companies <uuid>").description("returns an array of companies using a droplet").option("--pagination <value>", "pagination").action(async (uuid, opts) => {
1051
1042
  const client = await ctx.getClient();
@@ -1104,15 +1095,13 @@ function registerPrimary(parent, ctx) {
1104
1095
  ctx.output(result);
1105
1096
  }), () => []);
1106
1097
  }
1107
- //#endregion
1108
- //#region src/generated/index.ts
1098
+ // src/generated/index.ts
1109
1099
  function registerAllCommands(parent, ctx) {
1110
1100
  registerCategories(parent, ctx);
1111
1101
  registerInstallations(parent, ctx);
1112
1102
  registerPrimary(parent, ctx);
1113
1103
  }
1114
- //#endregion
1115
- //#region src/index.ts
1104
+ // src/index.ts
1116
1105
  const plugin = {
1117
1106
  name: "@fluid-app/fluid-cli-droplets",
1118
1107
  version: "0.1.0",
@@ -1126,7 +1115,6 @@ const plugin = {
1126
1115
  }));
1127
1116
  }
1128
1117
  };
1129
- //#endregion
1130
1118
  export { plugin as default };
1131
1119
 
1132
1120
  //# sourceMappingURL=index.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-app/fluid-cli-droplets",
3
- "version": "0.1.791",
3
+ "version": "0.1.793",
4
4
  "description": "Fluid CLI commands for droplet management",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",
@@ -17,9 +17,9 @@
17
17
  "access": "public"
18
18
  },
19
19
  "dependencies": {
20
- "@fluid-app/fluid-cli": "0.1.808",
21
- "ajv": "8.17.1",
22
- "commander": "^12.0.0"
20
+ "@fluid-app/fluid-cli": "0.1.810",
21
+ "ajv": "^8.17.1",
22
+ "commander": "^12.1.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@fluid-app/api-client-scripts": "0.0.0",
@@ -29,9 +29,9 @@
29
29
  "@types/jest": "^29.5.14",
30
30
  "@types/node": "24.10.12",
31
31
  "jest": "^29.7.0",
32
- "tsdown": "^0.21.0",
32
+ "tsdown": "0.23.7",
33
33
  "tsx": "^4.21.0",
34
- "typescript": "^5"
34
+ "typescript": "7.0.2"
35
35
  },
36
36
  "engines": {
37
37
  "node": ">=24.0.0"
@@ -86,7 +86,7 @@
86
86
  "generate": "tsx scripts/generate.ts",
87
87
  "lint": "oxlint",
88
88
  "lint:fix": "oxlint --fix",
89
- "typecheck": "tsgo --noEmit",
89
+ "typecheck": "tsc --noEmit",
90
90
  "test": "jest"
91
91
  }
92
92
  }