@warmhub/sdk-ts 0.70.0 → 0.71.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.
package/dist/index.d.ts CHANGED
@@ -60,6 +60,13 @@ declare const CLI_TIMESTAMP_HEADER = "X-WarmHub-Timestamp";
60
60
  */
61
61
  type CliHttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
62
62
 
63
+ /** Every event type a webhook subscription can watch. */
64
+ declare const SUBSCRIBABLE_EVENT_TYPES: readonly ["commit", "repo.renamed", "org.renamed", "org.member_added", "org.repo_created", "org.repo_published", "thing.renamed", "shape.renamed"];
65
+ type SubscribableEventType = (typeof SUBSCRIBABLE_EVENT_TYPES)[number];
66
+ /** Org-scoped events — created with an `orgName` and no `repoName`. */
67
+ declare const ORG_SCOPED_EVENT_TYPES: readonly ["org.renamed", "org.member_added", "org.repo_created", "org.repo_published"];
68
+ type OrgScopedEventType = (typeof ORG_SCOPED_EVENT_TYPES)[number];
69
+
63
70
  /**
64
71
  * Validate a data payload against shape field definitions.
65
72
  *
@@ -787,6 +794,7 @@ type ThingGetManyResult$1 = {
787
794
  synthesized?: boolean;
788
795
  aboutWref?: string;
789
796
  committerWref?: string;
797
+ createdBy?: string;
790
798
  revisedBy?: string;
791
799
  metadata?: {
792
800
  durableId: string;
@@ -2105,6 +2113,7 @@ type ShapeRemove = {
2105
2113
  type SubscriptionInfo = {
2106
2114
  name: string;
2107
2115
  kind: 'webhook' | 'cron';
2116
+ eventType: SubscribableEventType;
2108
2117
  active: boolean;
2109
2118
  shapeName?: string;
2110
2119
  sourceRepo?: string;
@@ -2152,7 +2161,7 @@ type SubscriptionCompatCreateCommon = {
2152
2161
  * `filterJson` object and a shape binding (`shapeName` or `filterJson.shape`).
2153
2162
  * - `repo.renamed` / `thing.renamed` / `shape.renamed` — repo-scoped metadata
2154
2163
  * events; no shape/filter/source.
2155
- * - `org.renamed` — org-scoped metadata event; no `repoName`/shape/filter/source.
2164
+ * - org-scoped metadata events — no `repoName`/shape/filter/source.
2156
2165
  *
2157
2166
  * The metadata variants forbid the commit-only fields at the type level so
2158
2167
  * invalid shapes fail at compile time, not just server-side.
@@ -2172,7 +2181,7 @@ type SubscriptionCompatCreateInput = (SubscriptionCompatCreateCommon & {
2172
2181
  shapeName?: never;
2173
2182
  sourceRepoRef?: never;
2174
2183
  }) | (SubscriptionCompatCreateCommon & {
2175
- eventType: 'org.renamed';
2184
+ eventType: OrgScopedEventType;
2176
2185
  repoName?: never;
2177
2186
  filterJson?: never;
2178
2187
  shapeName?: never;
@@ -2180,9 +2189,9 @@ type SubscriptionCompatCreateInput = (SubscriptionCompatCreateCommon & {
2180
2189
  });
2181
2190
  /**
2182
2191
  * Input shape for `client.subscription.update`. `orgName` and `name` identify
2183
- * the subscription; omit `repoName` to update an org-scoped (`org.renamed`)
2192
+ * the subscription; omit `repoName` to update an org-scoped
2184
2193
  * subscription. All other fields are optional and only the ones you provide get
2185
- * patched. Metadata subscriptions (any `*.renamed`) reject
2194
+ * patched. Metadata subscriptions reject
2186
2195
  * `shapeName`/`filterJson` — they have only delivery fields to edit.
2187
2196
  *
2188
2197
  * @see https://docs.warmhub.ai/subscriptions/managing/#update-subscription
@@ -2572,6 +2581,7 @@ type CurrentUserInfo = {
2572
2581
  externalId: string;
2573
2582
  identityWref: string | null;
2574
2583
  knockUserToken: string | null;
2584
+ personalOrgName: string | null;
2575
2585
  } | null;
2576
2586
  /** @internal */
2577
2587
  type WhoamiScopeEntry = {
@@ -2747,6 +2757,12 @@ type ThingDetail = {
2747
2757
  synthesized?: boolean;
2748
2758
  aboutWref?: string;
2749
2759
  committerWref?: string;
2760
+ /**
2761
+ * #4848 Phase C: the thing's creator (first-version author), a peer of the
2762
+ * current-version author `revisedBy`. Present for things created after Phase
2763
+ * C; optional for legacy rows without trustworthy creator provenance.
2764
+ */
2765
+ createdBy?: string;
2750
2766
  /** #4848 Phase C: current-version author (renamed from createdByWref). */
2751
2767
  revisedBy?: string;
2752
2768
  metadata?: ThingMetadata;
@@ -2858,7 +2874,9 @@ type LiveRepoEvent = {
2858
2874
  type ActionListRunsOptions = {
2859
2875
  subscriptionName?: string;
2860
2876
  status?: 'pending' | 'running' | 'processing' | 'retry_wait' | 'succeeded' | 'suppressed' | 'failed_terminal' | 'dead_letter';
2877
+ outcome?: 'succeeded' | 'failed';
2861
2878
  since?: number;
2879
+ cursor?: string;
2862
2880
  limit?: number;
2863
2881
  };
2864
2882
  /** @internal */
@@ -3691,6 +3709,14 @@ declare class WarmHubClient {
3691
3709
  * Remove an active member or revoke a pending invite by email address.
3692
3710
  */
3693
3711
  removeMember: (orgName: string, email: string) => Promise<void>;
3712
+ /**
3713
+ * Leave an organization the caller is a member of (self-service).
3714
+ *
3715
+ * Session-only: requires an interactive user session, so personal access
3716
+ * tokens are rejected. You cannot leave your personal organization, and an
3717
+ * owner can only leave when the organization retains another active owner.
3718
+ */
3719
+ leave: (orgName: string) => Promise<void>;
3694
3720
  /**
3695
3721
  * Change a member's organization role.
3696
3722
  *
@@ -4012,16 +4038,21 @@ declare class WarmHubClient {
4012
4038
  /**
4013
4039
  * Create a webhook subscription.
4014
4040
  *
4015
- * 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.
4041
+ * Webhook subscriptions require a delivery URL. Commit subscriptions are
4042
+ * repo-scoped and require a shape/filter; repo and org metadata
4043
+ * subscriptions omit commit-only fields. Org-scoped events also omit
4044
+ * `repoName`.
4016
4045
  *
4017
- * 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.
4046
+ * Delivery can use a fallback URL, allow trace reentry, and opt into
4047
+ * success notifications. Commit subscriptions can additionally forward
4048
+ * events from another repository.
4018
4049
  */
4019
4050
  create: (input: SubscriptionCompatCreateInput) => Promise<SubscriptionInfo>;
4020
4051
  /**
4021
4052
  * Get one subscription by name.
4022
4053
  *
4023
4054
  * Repo-scoped subscriptions are addressed by `(orgName, repoName, name)`;
4024
- * org-scoped subscriptions (`org.renamed`) omit `repoName` via the object
4055
+ * org-scoped subscriptions omit `repoName` via the object
4025
4056
  * form: `get({ orgName, name })`.
4026
4057
  */
4027
4058
  get: (...args: SubscriptionRefArgs) => Promise<SubscriptionInfo>;
@@ -4041,7 +4072,7 @@ declare class WarmHubClient {
4041
4072
  *
4042
4073
  * Pass `(orgName, repoName)` to list a repository's subscriptions, or omit
4043
4074
  * `repoName` — `list(orgName)` or `list({ orgName })` — to list the
4044
- * org-scoped (`org.renamed`) subscriptions.
4075
+ * org-scoped subscriptions.
4045
4076
  */
4046
4077
  list: (...args: SubscriptionListArgs) => Promise<SubscriptionList>;
4047
4078
  /**
@@ -4134,16 +4165,24 @@ declare class WarmHubClient {
4134
4165
  */
4135
4166
  liveFeed: (orgName: string, repoName: string, subscriptionName: string, opts?: ActionLiveFeedOptions) => Promise<ActionLiveFeed>;
4136
4167
  /**
4137
- * List subscription action runs for a repository.
4168
+ * List subscription action runs as a `Page<ActionRunInfo>` (`items` +
4169
+ * optional `nextCursor`), newest-first, capped at 200 runs per page.
4138
4170
  *
4139
- * The result can be filtered by subscription name, status, and start time.
4171
+ * `status` and `outcome` are mutually exclusive.
4172
+ * `since` and `cursor` are mutually exclusive; pass `cursor` alone on later
4173
+ * pages — the `since` window rides in the cursor.
4174
+ * Cursors are opaque, short-lived resume tokens; on `VALIDATION_ERROR`
4175
+ * restart the query without `cursor`.
4176
+ * See docs/dev/warmhub-actions-api.md for the full contract.
4140
4177
  */
4141
- listRuns: (orgName: string, repoName: string, opts?: ActionListRunsOptions) => Promise<ActionRunInfo[]>;
4178
+ listRuns: (orgName: string, repoName: string, opts?: ActionListRunsOptions) => Promise<Page<ActionRunInfo>>;
4142
4179
  /**
4143
4180
  * Aggregate run counts (total + per-status) for a repo or one subscription.
4144
4181
  *
4145
- * Computed server-side over an optional `since` window — not bounded by the
4146
- * `listRuns` row cap, so it reflects the full window regardless of volume.
4182
+ * Computed server-side over an optional `since` window as a window
4183
+ * aggregate — it counts every run in the window, whereas `listRuns` returns
4184
+ * only a page sample of that pageable history. Use `runStats` for totals and
4185
+ * `listRuns` to walk the individual runs page by page.
4147
4186
  */
4148
4187
  runStats: (orgName: string, repoName: string, opts?: ActionRunStatsOptions) => Promise<ActionRunStatsInfo>;
4149
4188
  /**
@@ -4721,16 +4760,24 @@ declare class WarmHubClient {
4721
4760
  */
4722
4761
  liveFeed: (orgName: string, repoName: string, subscriptionName: string, opts?: ActionLiveFeedOptions) => Promise<ActionLiveFeed>;
4723
4762
  /**
4724
- * List subscription action runs for a repository.
4763
+ * List subscription action runs as a `Page<ActionRunInfo>` (`items` +
4764
+ * optional `nextCursor`), newest-first, capped at 200 runs per page.
4725
4765
  *
4726
- * The result can be filtered by subscription name, status, and start time.
4766
+ * `status` and `outcome` are mutually exclusive.
4767
+ * `since` and `cursor` are mutually exclusive; pass `cursor` alone on later
4768
+ * pages — the `since` window rides in the cursor.
4769
+ * Cursors are opaque, short-lived resume tokens; on `VALIDATION_ERROR`
4770
+ * restart the query without `cursor`.
4771
+ * See docs/dev/warmhub-actions-api.md for the full contract.
4727
4772
  */
4728
- listRuns: (orgName: string, repoName: string, opts?: ActionListRunsOptions) => Promise<ActionRunInfo[]>;
4773
+ listRuns: (orgName: string, repoName: string, opts?: ActionListRunsOptions) => Promise<Page<ActionRunInfo>>;
4729
4774
  /**
4730
4775
  * Aggregate run counts (total + per-status) for a repo or one subscription.
4731
4776
  *
4732
- * Computed server-side over an optional `since` window — not bounded by the
4733
- * `listRuns` row cap, so it reflects the full window regardless of volume.
4777
+ * Computed server-side over an optional `since` window as a window
4778
+ * aggregate — it counts every run in the window, whereas `listRuns` returns
4779
+ * only a page sample of that pageable history. Use `runStats` for totals and
4780
+ * `listRuns` to walk the individual runs page by page.
4734
4781
  */
4735
4782
  runStats: (orgName: string, repoName: string, opts?: ActionRunStatsOptions) => Promise<ActionRunStatsInfo>;
4736
4783
  /**
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- 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_COUNT, OperationBuilder, PartialStreamSubmissionError, SDK_VERSION, WarmHubClient, WarmHubError, connectionErrorMessage, contentFieldLimitError, countStreamAppendResultStatuses, isConnectionError, isRetryable, isWarmHubError, normalizeWref, resolveFunctionLogMode, sanitizeErrorMessage, sdkVersionIsBelowMinimum, streamAppendResultStatus, submitOperationsViaStream, toWarmHubError, validateAgainstShape, verifyCliCall } from './chunk-HZU73U4G.js';
1
+ 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_COUNT, OperationBuilder, PartialStreamSubmissionError, SDK_VERSION, WarmHubClient, WarmHubError, connectionErrorMessage, contentFieldLimitError, countStreamAppendResultStatuses, isConnectionError, isRetryable, isWarmHubError, normalizeWref, resolveFunctionLogMode, sanitizeErrorMessage, sdkVersionIsBelowMinimum, streamAppendResultStatus, submitOperationsViaStream, toWarmHubError, validateAgainstShape, verifyCliCall } from './chunk-WNHMOZB7.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
package/dist/react.js CHANGED
@@ -1,5 +1,5 @@
1
- import { WarmHubClient } from './chunk-HZU73U4G.js';
2
- export { DEFAULT_API_URL, SDK_VERSION, WarmHubClient, WarmHubError, toWarmHubError } from './chunk-HZU73U4G.js';
1
+ import { WarmHubClient } from './chunk-WNHMOZB7.js';
2
+ export { DEFAULT_API_URL, SDK_VERSION, WarmHubClient, WarmHubError, toWarmHubError } from './chunk-WNHMOZB7.js';
3
3
  import { createContext, useMemo, useState, useEffect, useContext } from 'react';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warmhub/sdk-ts",
3
- "version": "0.70.0",
3
+ "version": "0.71.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "The TypeScript SDK for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",