@postonus/cli 0.1.29 → 0.1.30

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