@postonus/cli 0.1.29 → 0.1.31

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
@@ -7833,7 +7833,6 @@ var MediaSourceSchema = object({
7833
7833
  id: MediaSourceIdSchema,
7834
7834
  label: string2(),
7835
7835
  description: string2(),
7836
- icon: string2(),
7837
7836
  category: literal("media-storage"),
7838
7837
  requiresEnv: array(string2()),
7839
7838
  comingSoon: boolean2().optional(),
@@ -12335,7 +12334,7 @@ function formatTable(headers, rows) {
12335
12334
  }
12336
12335
 
12337
12336
  // src/version.ts
12338
- var CLI_VERSION = "0.1.29";
12337
+ var CLI_VERSION = "0.1.31";
12339
12338
 
12340
12339
  // src/client.ts
12341
12340
  var DEVICE_CODE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
@@ -12772,6 +12771,7 @@ async function whoami() {
12772
12771
  import { render as render3 } from "ink";
12773
12772
  import open3 from "open";
12774
12773
  import { jsx as jsx3 } from "react/jsx-runtime";
12774
+ var UNDERSCORE_GLOBAL_REGEX = /_/g;
12775
12775
  function healthy(channel) {
12776
12776
  return channel.connectStatus === "ACTIVE" && channel.tokenStatus === "VALID";
12777
12777
  }
@@ -12835,7 +12835,7 @@ async function pickPlatform(existing) {
12835
12835
  const credential = isCredentialPlatform(platform);
12836
12836
  return {
12837
12837
  value: platform,
12838
- label: platform.toLowerCase().replace(/_/g, " "),
12838
+ label: platform.toLowerCase().replace(UNDERSCORE_GLOBAL_REGEX, " "),
12839
12839
  hint: credential ? "(connect in the dashboard)" : connected > 0 ? `(${connected} connected)` : void 0,
12840
12840
  disabled: credential
12841
12841
  };
@@ -12920,13 +12920,15 @@ import { createInterface } from "readline";
12920
12920
  function isString2(val) {
12921
12921
  return typeof val === "string";
12922
12922
  }
12923
+ var DOUBLE_NEWLINE_REGEX = /\r?\n\r?\n/;
12924
+ var SINGLE_NEWLINE_REGEX = /\r?\n/;
12923
12925
  function decodeMessages(contentType, body) {
12924
12926
  if (!contentType?.includes("text/event-stream")) {
12925
12927
  const trimmed = body.trim();
12926
12928
  return trimmed.length > 0 ? [trimmed] : [];
12927
12929
  }
12928
- return body.split(/\r?\n\r?\n/).map(
12929
- (event) => event.split(/\r?\n/).filter((line) => line.startsWith("data:")).map((line) => line.slice("data:".length).trimStart()).join("\n")
12930
+ return body.split(DOUBLE_NEWLINE_REGEX).map(
12931
+ (event) => event.split(SINGLE_NEWLINE_REGEX).filter((line) => line.startsWith("data:")).map((line) => line.slice("data:".length).trimStart()).join("\n")
12930
12932
  ).filter((data) => data.length > 0);
12931
12933
  }
12932
12934
  function tokenAudiences(accessToken) {
@@ -13174,8 +13176,9 @@ async function readContent(text, options) {
13174
13176
  function readFileOrFail(path) {
13175
13177
  return readFile2(path, "utf8").catch(() => fail(`Could not read ${path}`));
13176
13178
  }
13179
+ var THREAD_DIVIDER_REGEX = /^---[ \t]*$/m;
13177
13180
  async function readThread(path) {
13178
- const segments = (await readFileOrFail(path)).split(/^---[ \t]*$/m).map((segment) => segment.trim()).filter(Boolean);
13181
+ const segments = (await readFileOrFail(path)).split(THREAD_DIVIDER_REGEX).map((segment) => segment.trim()).filter(Boolean);
13179
13182
  if (segments.length < 2) failUsage(`${path} holds one segment. Separate thread segments with a line of \`---\`.`);
13180
13183
  return segments;
13181
13184
  }
@@ -13374,8 +13377,9 @@ function formatWhen(scheduledAt) {
13374
13377
  minute: "2-digit"
13375
13378
  });
13376
13379
  }
13380
+ var WHITESPACE_RUN_REGEX = /\s+/g;
13377
13381
  function truncate(text, length = 44) {
13378
- const collapsed = text.replace(/\s+/g, " ").trim();
13382
+ const collapsed = text.replace(WHITESPACE_RUN_REGEX, " ").trim();
13379
13383
  return collapsed.length <= length ? collapsed : `${collapsed.slice(0, length - 1)}\u2026`;
13380
13384
  }
13381
13385
  async function listQueue(options) {