@warmhub/sdk-ts 0.69.1 → 0.71.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.
@@ -3,7 +3,13 @@ import { TRPCClientError, createTRPCProxyClient, splitLink, httpBatchLink, httpL
3
3
  // src/index.ts
4
4
 
5
5
  // ../rules/src/builtin-shapes.ts
6
- var BUILTIN_SHAPE_NAMES = ["Pair", "Set", "List"];
6
+ var BUILTIN_SHAPE_NAMES = [
7
+ "Arc",
8
+ "Bond",
9
+ "Pair",
10
+ "Set",
11
+ "List"
12
+ ];
7
13
  var RETIRED_COLLECTION_SHAPE_NAMES = ["Triple"];
8
14
  var RESERVED_COLLECTION_SHAPE_NAMES = [
9
15
  ...BUILTIN_SHAPE_NAMES,
@@ -395,7 +401,9 @@ function preflightOpDiagnostics(op, operationIndex) {
395
401
  function builtinShapeGuard(op, operationIndex) {
396
402
  const errors = [];
397
403
  const name = op.name;
398
- if (name && isRetiredCollectionShape(name)) {
404
+ const isShapeRename = op.operation === "rename" && (op.kind === "shape" || op.name !== void 0 && !splitLocalPath(op.name));
405
+ const reservedSourcePassThrough = isShapeRename && name !== void 0 && isReservedCollectionShape(name) && op.newName !== void 0 && !isReservedCollectionShape(op.newName) && !isBuiltinShape(op.newName);
406
+ if (name && isRetiredCollectionShape(name) && !reservedSourcePassThrough) {
399
407
  errors.push({
400
408
  code: "RESERVED_NAME",
401
409
  operationIndex,
@@ -409,8 +417,7 @@ function builtinShapeGuard(op, operationIndex) {
409
417
  message: `Shape "${op.newName}" is a retired collection shape and cannot be written manually`
410
418
  });
411
419
  } else {
412
- const isShapeRename = op.operation === "rename" && (op.kind === "shape" || op.name !== void 0 && !splitLocalPath(op.name));
413
- const builtinShapeName = name && isBuiltinShape(name) ? name : isShapeRename && op.newName && isBuiltinShape(op.newName) ? op.newName : void 0;
420
+ const builtinShapeName = name && isBuiltinShape(name) && !reservedSourcePassThrough ? name : isShapeRename && op.newName && isBuiltinShape(op.newName) ? op.newName : void 0;
414
421
  if (builtinShapeName && (isShapeRename || op.operation !== "retract" && op.kind === "shape")) {
415
422
  const action = op.operation === "add" ? "created" : op.operation === "rename" ? "renamed" : "revised";
416
423
  errors.push({
@@ -9232,7 +9239,7 @@ function validateWarmHubClientOptions(options) {
9232
9239
  throw new TypeError(`Unknown WarmHubClient option "${key}"${hint}`);
9233
9240
  }
9234
9241
  }
9235
- var SDK_VERSION = "0.69.1" ;
9242
+ var SDK_VERSION = "0.71.0" ;
9236
9243
  var DEFAULT_API_URL = "https://api.warmhub.ai";
9237
9244
  var UNBATCHED_TRPC_PATHS = /* @__PURE__ */ new Set([
9238
9245
  "repo.shapeInstanceCounts",
@@ -10246,6 +10253,22 @@ var WarmHubClient = class _WarmHubClient {
10246
10253
  throw toWarmHubError(error);
10247
10254
  }
10248
10255
  },
10256
+ /**
10257
+ * Leave an organization the caller is a member of (self-service).
10258
+ *
10259
+ * Session-only: requires an interactive user session, so personal access
10260
+ * tokens are rejected. You cannot leave your personal organization, and an
10261
+ * owner can only leave when the organization retains another active owner.
10262
+ */
10263
+ leave: async (orgName) => {
10264
+ try {
10265
+ await this.trpc.org.leave.mutate({
10266
+ orgName
10267
+ });
10268
+ } catch (error) {
10269
+ throw toWarmHubError(error);
10270
+ }
10271
+ },
10249
10272
  /**
10250
10273
  * Change a member's organization role.
10251
10274
  *
@@ -10963,9 +10986,14 @@ var WarmHubClient = class _WarmHubClient {
10963
10986
  /**
10964
10987
  * Create a webhook subscription.
10965
10988
  *
10966
- * Webhook subscriptions require a delivery URL and can forward events from another repository, allow trace reentry, bind fallback delivery, and opt into success notifications. Component identity is set at creation time and follows the same authority rules as commit writes.
10989
+ * Webhook subscriptions require a delivery URL. Commit subscriptions are
10990
+ * repo-scoped and require a shape/filter; repo and org metadata
10991
+ * subscriptions omit commit-only fields. Org-scoped events also omit
10992
+ * `repoName`.
10967
10993
  *
10968
- * Webhook subscriptions must specify a shape filter via `shapeName` or `filterJson.shape`, except [shape-lifecycle subscriptions](/subscriptions/creating/#shape-lifecycle-subscriptions) which omit both and rely on a `{ kind: 'shape', ... }` filter.
10994
+ * Delivery can use a fallback URL, allow trace reentry, and opt into
10995
+ * success notifications. Commit subscriptions can additionally forward
10996
+ * events from another repository.
10969
10997
  */
10970
10998
  create: async (input) => {
10971
10999
  try {
@@ -10981,7 +11009,7 @@ var WarmHubClient = class _WarmHubClient {
10981
11009
  * Get one subscription by name.
10982
11010
  *
10983
11011
  * Repo-scoped subscriptions are addressed by `(orgName, repoName, name)`;
10984
- * org-scoped subscriptions (`org.renamed`) omit `repoName` via the object
11012
+ * org-scoped subscriptions omit `repoName` via the object
10985
11013
  * form: `get({ orgName, name })`.
10986
11014
  */
10987
11015
  get: async (...args) => {
@@ -11018,7 +11046,7 @@ var WarmHubClient = class _WarmHubClient {
11018
11046
  *
11019
11047
  * Pass `(orgName, repoName)` to list a repository's subscriptions, or omit
11020
11048
  * `repoName` — `list(orgName)` or `list({ orgName })` — to list the
11021
- * org-scoped (`org.renamed`) subscriptions.
11049
+ * org-scoped subscriptions.
11022
11050
  */
11023
11051
  list: async (...args) => {
11024
11052
  try {
@@ -11230,9 +11258,15 @@ var WarmHubClient = class _WarmHubClient {
11230
11258
  }
11231
11259
  },
11232
11260
  /**
11233
- * List subscription action runs for a repository.
11234
- *
11235
- * The result can be filtered by subscription name, status, and start time.
11261
+ * List subscription action runs as a `Page<ActionRunInfo>` (`items` +
11262
+ * optional `nextCursor`), newest-first, capped at 200 runs per page.
11263
+ *
11264
+ * `status` and `outcome` are mutually exclusive.
11265
+ * `since` and `cursor` are mutually exclusive; pass `cursor` alone on later
11266
+ * pages — the `since` window rides in the cursor.
11267
+ * Cursors are opaque, short-lived resume tokens; on `VALIDATION_ERROR`
11268
+ * restart the query without `cursor`.
11269
+ * See docs/dev/warmhub-actions-api.md for the full contract.
11236
11270
  */
11237
11271
  listRuns: async (orgName, repoName, opts) => {
11238
11272
  try {
@@ -11241,7 +11275,9 @@ var WarmHubClient = class _WarmHubClient {
11241
11275
  repoName,
11242
11276
  subscriptionName: opts?.subscriptionName,
11243
11277
  status: opts?.status,
11278
+ outcome: opts?.outcome,
11244
11279
  since: opts?.since,
11280
+ cursor: opts?.cursor,
11245
11281
  limit: opts?.limit
11246
11282
  });
11247
11283
  } catch (error) {
@@ -11251,8 +11287,10 @@ var WarmHubClient = class _WarmHubClient {
11251
11287
  /**
11252
11288
  * Aggregate run counts (total + per-status) for a repo or one subscription.
11253
11289
  *
11254
- * Computed server-side over an optional `since` window — not bounded by the
11255
- * `listRuns` row cap, so it reflects the full window regardless of volume.
11290
+ * Computed server-side over an optional `since` window as a window
11291
+ * aggregate — it counts every run in the window, whereas `listRuns` returns
11292
+ * only a page sample of that pageable history. Use `runStats` for totals and
11293
+ * `listRuns` to walk the individual runs page by page.
11256
11294
  */
11257
11295
  runStats: async (orgName, repoName, opts) => {
11258
11296
  try {
@@ -12767,5 +12805,5 @@ re2js/build/index.js:
12767
12805
  */
12768
12806
 
12769
12807
  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 };
12770
- //# sourceMappingURL=chunk-RYQ5AAIU.js.map
12771
- //# sourceMappingURL=chunk-RYQ5AAIU.js.map
12808
+ //# sourceMappingURL=chunk-QGZ5CW3Y.js.map
12809
+ //# sourceMappingURL=chunk-QGZ5CW3Y.js.map