@supacloud/cli 0.21.0 → 0.21.1

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.js +18 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -11540,11 +11540,28 @@ function isCanonicalTimestamp(candidate) {
11540
11540
  return Number.isFinite(milliseconds) && new Date(milliseconds).toISOString() === candidate;
11541
11541
  }
11542
11542
  function safeSchedulePayload(schedule) {
11543
+ const hasProjectedBody = Object.hasOwn(schedule, "body_empty");
11544
+ const hasProjectedHeaders = Object.hasOwn(schedule, "header_names");
11545
+ if (!hasProjectedBody && !hasProjectedHeaders)
11546
+ return legacySchedulePayload(schedule);
11547
+ if (!hasProjectedBody || !hasProjectedHeaders)
11548
+ return null;
11543
11549
  const headerNames = safeHeaderNames(schedule.header_names);
11544
11550
  if (typeof schedule.body_empty !== "boolean" || !headerNames)
11545
11551
  return null;
11546
11552
  return { body_empty: schedule.body_empty, header_names: headerNames };
11547
11553
  }
11554
+ function legacySchedulePayload(schedule) {
11555
+ const body = objectRecord3(schedule.body);
11556
+ const headers = objectRecord3(schedule.headers);
11557
+ if (!body || !headers)
11558
+ return null;
11559
+ const headerNames = safeHeaderNames(Object.keys(headers));
11560
+ const stableHeaderValues = Object.entries(headers).every(([name, value]) => typeof value === "string" && headerValueIsStable(name.toLowerCase(), value));
11561
+ if (!headerNames || !stableHeaderValues)
11562
+ return null;
11563
+ return { body_empty: Object.keys(body).length === 0, header_names: headerNames };
11564
+ }
11548
11565
  function safeHeaderNames(candidate) {
11549
11566
  if (!Array.isArray(candidate) || candidate.length > MAX_HEADER_COUNT)
11550
11567
  return null;
@@ -12022,7 +12039,7 @@ var MUTATION_TOOL_SCHEMA = {
12022
12039
  // package.json
12023
12040
  var package_default = {
12024
12041
  name: "@supacloud/cli",
12025
- version: "0.21.0",
12042
+ version: "0.21.1",
12026
12043
  description: "Project-scoped CLI for SupaCloud users",
12027
12044
  type: "module",
12028
12045
  main: "./dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supacloud/cli",
3
- "version": "0.21.0",
3
+ "version": "0.21.1",
4
4
  "description": "Project-scoped CLI for SupaCloud users",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",