@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.
- package/dist/{chunk-RYQ5AAIU.js → chunk-QGZ5CW3Y.js} +54 -16
- package/dist/chunk-QGZ5CW3Y.js.map +1 -0
- package/dist/index.d.ts +80 -33
- package/dist/index.js +1 -1
- package/dist/react.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-RYQ5AAIU.js.map +0 -1
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
|
*
|
|
@@ -300,7 +307,7 @@ type CommitApplyResult = {
|
|
|
300
307
|
}>;
|
|
301
308
|
};
|
|
302
309
|
type CollectionContainsResult$1 = {
|
|
303
|
-
type: 'pair' | 'set' | 'list' | 'triple';
|
|
310
|
+
type: 'arc' | 'bond' | 'pair' | 'set' | 'list' | 'triple';
|
|
304
311
|
wref: string;
|
|
305
312
|
version: number;
|
|
306
313
|
results: Array<{
|
|
@@ -310,7 +317,7 @@ type CollectionContainsResult$1 = {
|
|
|
310
317
|
}>;
|
|
311
318
|
};
|
|
312
319
|
type CollectionDiffResult$1 = {
|
|
313
|
-
type: 'pair' | 'set' | 'list' | 'triple';
|
|
320
|
+
type: 'arc' | 'bond' | 'pair' | 'set' | 'list' | 'triple';
|
|
314
321
|
leftWref: string;
|
|
315
322
|
rightWref: string;
|
|
316
323
|
leftVersion: number;
|
|
@@ -319,45 +326,45 @@ type CollectionDiffResult$1 = {
|
|
|
319
326
|
added: Array<{
|
|
320
327
|
wref: string;
|
|
321
328
|
position?: number;
|
|
322
|
-
fieldPath: 'first' | 'second' | 'third' | 'members' | 'items';
|
|
329
|
+
fieldPath: 'from' | 'to' | 'ends' | 'first' | 'second' | 'third' | 'members' | 'items';
|
|
323
330
|
}>;
|
|
324
331
|
removed: Array<{
|
|
325
332
|
wref: string;
|
|
326
333
|
position?: number;
|
|
327
|
-
fieldPath: 'first' | 'second' | 'third' | 'members' | 'items';
|
|
334
|
+
fieldPath: 'from' | 'to' | 'ends' | 'first' | 'second' | 'third' | 'members' | 'items';
|
|
328
335
|
}>;
|
|
329
336
|
unchanged: Array<{
|
|
330
337
|
wref: string;
|
|
331
338
|
position?: number;
|
|
332
|
-
fieldPath: 'first' | 'second' | 'third' | 'members' | 'items';
|
|
339
|
+
fieldPath: 'from' | 'to' | 'ends' | 'first' | 'second' | 'third' | 'members' | 'items';
|
|
333
340
|
}>;
|
|
334
341
|
changed: Array<{
|
|
335
342
|
position: number;
|
|
336
343
|
left?: {
|
|
337
344
|
wref: string;
|
|
338
345
|
position?: number;
|
|
339
|
-
fieldPath: 'first' | 'second' | 'third' | 'members' | 'items';
|
|
346
|
+
fieldPath: 'from' | 'to' | 'ends' | 'first' | 'second' | 'third' | 'members' | 'items';
|
|
340
347
|
};
|
|
341
348
|
right?: {
|
|
342
349
|
wref: string;
|
|
343
350
|
position?: number;
|
|
344
|
-
fieldPath: 'first' | 'second' | 'third' | 'members' | 'items';
|
|
351
|
+
fieldPath: 'from' | 'to' | 'ends' | 'first' | 'second' | 'third' | 'members' | 'items';
|
|
345
352
|
};
|
|
346
353
|
}>;
|
|
347
354
|
};
|
|
348
355
|
type CollectionMember$1 = {
|
|
349
356
|
wref: string;
|
|
350
357
|
position?: number;
|
|
351
|
-
fieldPath: 'first' | 'second' | 'third' | 'members' | 'items';
|
|
358
|
+
fieldPath: 'from' | 'to' | 'ends' | 'first' | 'second' | 'third' | 'members' | 'items';
|
|
352
359
|
};
|
|
353
360
|
type CollectionMembersPage$1 = {
|
|
354
|
-
type: 'pair' | 'set' | 'list' | 'triple';
|
|
361
|
+
type: 'arc' | 'bond' | 'pair' | 'set' | 'list' | 'triple';
|
|
355
362
|
wref: string;
|
|
356
363
|
version: number;
|
|
357
364
|
items: Array<{
|
|
358
365
|
wref: string;
|
|
359
366
|
position?: number;
|
|
360
|
-
fieldPath: 'first' | 'second' | 'third' | 'members' | 'items';
|
|
367
|
+
fieldPath: 'from' | 'to' | 'ends' | 'first' | 'second' | 'third' | 'members' | 'items';
|
|
361
368
|
}>;
|
|
362
369
|
nextCursor?: string;
|
|
363
370
|
};
|
|
@@ -371,7 +378,7 @@ type CollectionMutationResult$1 = {
|
|
|
371
378
|
status: 'created' | 'updated' | 'noop';
|
|
372
379
|
};
|
|
373
380
|
type CollectionStatsResult$1 = {
|
|
374
|
-
type: 'pair' | 'set' | 'list' | 'triple';
|
|
381
|
+
type: 'arc' | 'bond' | 'pair' | 'set' | 'list' | 'triple';
|
|
375
382
|
wref: string;
|
|
376
383
|
version: number;
|
|
377
384
|
memberCount: number;
|
|
@@ -773,8 +780,8 @@ type ThingGetManyResult$1 = {
|
|
|
773
780
|
version: number;
|
|
774
781
|
data?: unknown;
|
|
775
782
|
collection?: {
|
|
776
|
-
type: 'pair' | 'set' | 'list' | 'triple';
|
|
777
|
-
memberField: 'first/second' | 'first/second/third' | 'members' | 'items';
|
|
783
|
+
type: 'arc' | 'bond' | 'pair' | 'set' | 'list' | 'triple';
|
|
784
|
+
memberField: 'from/to' | 'ends' | 'first/second' | 'first/second/third' | 'members' | 'items';
|
|
778
785
|
memberCount: number;
|
|
779
786
|
dataMode: 'full' | 'summary';
|
|
780
787
|
fullData: boolean;
|
|
@@ -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
|
-
* -
|
|
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:
|
|
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
|
|
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
|
|
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 = {
|
|
@@ -2666,8 +2676,8 @@ type ThingMetadata = {
|
|
|
2666
2676
|
type CollectionReadDataMode = 'auto' | 'full';
|
|
2667
2677
|
/** @internal */
|
|
2668
2678
|
type CollectionReadSummary = {
|
|
2669
|
-
type: 'pair' | 'set' | 'list' | 'triple';
|
|
2670
|
-
memberField: 'first/second' | 'first/second/third' | 'members' | 'items';
|
|
2679
|
+
type: 'arc' | 'bond' | 'pair' | 'set' | 'list' | 'triple';
|
|
2680
|
+
memberField: 'from/to' | 'ends' | 'first/second' | 'first/second/third' | 'members' | 'items';
|
|
2671
2681
|
memberCount: number;
|
|
2672
2682
|
dataMode: 'full' | 'summary';
|
|
2673
2683
|
fullData: boolean;
|
|
@@ -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
|
|
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
|
-
*
|
|
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
|
|
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
|
|
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
|
|
4168
|
+
* List subscription action runs as a `Page<ActionRunInfo>` (`items` +
|
|
4169
|
+
* optional `nextCursor`), newest-first, capped at 200 runs per page.
|
|
4138
4170
|
*
|
|
4139
|
-
*
|
|
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
|
|
4146
|
-
*
|
|
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
|
|
4763
|
+
* List subscription action runs as a `Page<ActionRunInfo>` (`items` +
|
|
4764
|
+
* optional `nextCursor`), newest-first, capped at 200 runs per page.
|
|
4725
4765
|
*
|
|
4726
|
-
*
|
|
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
|
|
4733
|
-
*
|
|
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-
|
|
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-QGZ5CW3Y.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-
|
|
2
|
-
export { DEFAULT_API_URL, SDK_VERSION, WarmHubClient, WarmHubError, toWarmHubError } from './chunk-
|
|
1
|
+
import { WarmHubClient } from './chunk-QGZ5CW3Y.js';
|
|
2
|
+
export { DEFAULT_API_URL, SDK_VERSION, WarmHubClient, WarmHubError, toWarmHubError } from './chunk-QGZ5CW3Y.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