@warmhub/sdk-ts 0.62.1 → 0.63.0

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.
@@ -8660,23 +8660,6 @@ async function verifyCliCall(request, secrets, opts) {
8660
8660
  args = { ...query };
8661
8661
  } else {
8662
8662
  query = {};
8663
- body = await request.text();
8664
- let parsed;
8665
- try {
8666
- parsed = JSON.parse(body);
8667
- } catch {
8668
- throw new CliCallVerificationError(
8669
- "invalid-body",
8670
- "POST body is not valid JSON"
8671
- );
8672
- }
8673
- if (!isArgsRecord(parsed)) {
8674
- throw new CliCallVerificationError(
8675
- "invalid-body",
8676
- "POST body must be a JSON object of primitive args (string / number / boolean)"
8677
- );
8678
- }
8679
- args = parsed;
8680
8663
  }
8681
8664
  if (hasSigning) {
8682
8665
  const signature = request.headers.get(CLI_SIGNATURE_HEADER);
@@ -8700,6 +8683,7 @@ async function verifyCliCall(request, secrets, opts) {
8700
8683
  `${CLI_TIMESTAMP_HEADER} must be an integer unix seconds value; got "${timestampHeader}"`
8701
8684
  );
8702
8685
  }
8686
+ body = await bodyTextForVerification(request, cliMethod, body);
8703
8687
  const verification = await verifyCliRequest({
8704
8688
  secret: secrets.CLI_SIGNING_SECRET,
8705
8689
  method: cliMethod,
@@ -8749,8 +8733,35 @@ async function verifyCliCall(request, secrets, opts) {
8749
8733
  );
8750
8734
  }
8751
8735
  }
8736
+ if (args === void 0) {
8737
+ body = await bodyTextForVerification(request, cliMethod, body);
8738
+ args = parseBodyArgs(body);
8739
+ }
8752
8740
  return { method: cliMethod, installRepo, args };
8753
8741
  }
8742
+ async function bodyTextForVerification(request, method, existing) {
8743
+ if (!cliMethodHasBody(method)) return "";
8744
+ if (existing !== void 0) return existing;
8745
+ return request.text();
8746
+ }
8747
+ function parseBodyArgs(body) {
8748
+ let parsed;
8749
+ try {
8750
+ parsed = JSON.parse(body);
8751
+ } catch {
8752
+ throw new CliCallVerificationError(
8753
+ "invalid-body",
8754
+ "POST body is not valid JSON"
8755
+ );
8756
+ }
8757
+ if (!isArgsRecord(parsed)) {
8758
+ throw new CliCallVerificationError(
8759
+ "invalid-body",
8760
+ "POST body must be a JSON object of primitive args (string / number / boolean)"
8761
+ );
8762
+ }
8763
+ return parsed;
8764
+ }
8754
8765
  function isNonEmpty(value) {
8755
8766
  return typeof value === "string" && value.length > 0;
8756
8767
  }
@@ -9327,7 +9338,7 @@ function validateWarmHubClientOptions(options) {
9327
9338
  throw new TypeError(`Unknown WarmHubClient option "${key}"${hint}`);
9328
9339
  }
9329
9340
  }
9330
- var SDK_VERSION = "0.62.1" ;
9341
+ var SDK_VERSION = "0.63.0" ;
9331
9342
  var DEFAULT_API_URL = "https://api.warmhub.ai";
9332
9343
  var UNBATCHED_TRPC_PATHS = /* @__PURE__ */ new Set([
9333
9344
  "repo.shapeInstanceCounts",
@@ -9760,6 +9771,21 @@ var WarmHubClient = class _WarmHubClient {
9760
9771
  }
9761
9772
  }
9762
9773
  };
9774
+ /**
9775
+ * Homepage surfaces.
9776
+ */
9777
+ homepage = {
9778
+ /**
9779
+ * Return manually curated featured homepage lists.
9780
+ */
9781
+ featuredLists: async () => {
9782
+ try {
9783
+ return await this.trpc.homepage.featuredLists.query();
9784
+ } catch (error) {
9785
+ throw toWarmHubError(error);
9786
+ }
9787
+ }
9788
+ };
9763
9789
  /**
9764
9790
  * Effective-access resolution for UI gating and service-side authorization.
9765
9791
  * First-party surface (web UI + whedge edge); the underlying `access.resolve`
@@ -11154,14 +11180,15 @@ var WarmHubClient = class _WarmHubClient {
11154
11180
  }
11155
11181
  },
11156
11182
  /**
11157
- * Claim one action delivery run for processing.
11183
+ * Claim one action delivery for processing.
11158
11184
  */
11159
- claimDelivery: async (orgName, repoName, runId, holderId) => {
11185
+ claimDelivery: async (orgName, repoName, target, holderId) => {
11186
+ const deliveryTarget = typeof target === "string" ? { runId: target } : target;
11160
11187
  try {
11161
11188
  return await this.trpc.action.claimDelivery.mutate({
11162
11189
  orgName,
11163
11190
  repoName,
11164
- runId,
11191
+ ...deliveryTarget,
11165
11192
  holderId
11166
11193
  });
11167
11194
  } catch (error) {
@@ -11169,14 +11196,15 @@ var WarmHubClient = class _WarmHubClient {
11169
11196
  }
11170
11197
  },
11171
11198
  /**
11172
- * Mark one claimed action delivery run as complete.
11199
+ * Mark one claimed action delivery as complete.
11173
11200
  */
11174
- completeDelivery: async (orgName, repoName, runId, holderId) => {
11201
+ completeDelivery: async (orgName, repoName, target, holderId) => {
11202
+ const deliveryTarget = typeof target === "string" ? { runId: target } : target;
11175
11203
  try {
11176
11204
  return await this.trpc.action.completeDelivery.mutate({
11177
11205
  orgName,
11178
11206
  repoName,
11179
- runId,
11207
+ ...deliveryTarget,
11180
11208
  holderId
11181
11209
  });
11182
11210
  } catch (error) {
@@ -12582,5 +12610,5 @@ re2js/build/index.js:
12582
12610
  */
12583
12611
 
12584
12612
  export { AllStreamOperationsFailedError, CLI_INSTALL_REPO_HEADER, CLI_SIGNATURE_HEADER, CLI_TIMESTAMP_HEADER, CONTENT_FIELD_LIMIT_ERROR, CliCallVerificationError, DEFAULT_API_URL, DEFAULT_STREAM_CHUNK_SIZE, MAX_CONTENT_FIELD_BYTES, MAX_STREAM_APPEND_OPERATION_COUNT2 as MAX_STREAM_APPEND_OPERATION_COUNT, OperationBuilder, PartialStreamSubmissionError, SDK_VERSION, WarmHubClient, WarmHubError, connectionErrorMessage, contentFieldLimitError, countStreamAppendResultStatuses, isConnectionError, isRetryable, isWarmHubError, normalizeWref, resolveFunctionLogMode, sanitizeErrorMessage, sdkVersionIsBelowMinimum, streamAppendResultStatus, submitOperationsViaStream, toWarmHubError, validateAgainstShape, verifyCliCall };
12585
- //# sourceMappingURL=chunk-XMQSHDUV.js.map
12586
- //# sourceMappingURL=chunk-XMQSHDUV.js.map
12613
+ //# sourceMappingURL=chunk-JPX7ZWWE.js.map
12614
+ //# sourceMappingURL=chunk-JPX7ZWWE.js.map