@warmhub/sdk-ts 0.58.0 → 0.60.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-OUMYNKVW.js → chunk-E4ZCBSQZ.js} +86 -54
- package/dist/chunk-E4ZCBSQZ.js.map +1 -0
- package/dist/index.d.ts +355 -227
- package/dist/index.js +1 -1
- package/dist/react.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-OUMYNKVW.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,171 @@
|
|
|
1
|
+
declare const COMMIT_OPERATIONS: readonly ["add", "revise", "retract", "rename"];
|
|
2
|
+
type CommitOperation = (typeof COMMIT_OPERATIONS)[number];
|
|
3
|
+
declare const COMMIT_OPERATION_KINDS: readonly ["shape", "thing", "assertion", "collection"];
|
|
4
|
+
type CommitOperationKind = (typeof COMMIT_OPERATION_KINDS)[number];
|
|
5
|
+
type CollectionAbout$2 = {
|
|
6
|
+
pair: [string, string];
|
|
7
|
+
} | {
|
|
8
|
+
triple: [string, string, string];
|
|
9
|
+
} | {
|
|
10
|
+
set: string[];
|
|
11
|
+
} | {
|
|
12
|
+
list: string[];
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Canonical request signing for component CLI dispatch.
|
|
17
|
+
*
|
|
18
|
+
* Component workers expose CLI methods over HTTP. The platform dispatcher
|
|
19
|
+
* signs each call with HMAC-SHA256 over a canonical request representation
|
|
20
|
+
* so the worker can authenticate the caller without sharing more than a
|
|
21
|
+
* single secret. The same canonical input works for GET and POST methods:
|
|
22
|
+
* the difference is whether the method args ride in the query string or
|
|
23
|
+
* the body.
|
|
24
|
+
*
|
|
25
|
+
* Canonical signing input:
|
|
26
|
+
* <METHOD>\n<PATH>\n<CANONICAL_QUERY>\n<INSTALL_REPO>\n<SHA256_HEX(BODY)>\n<TIMESTAMP>
|
|
27
|
+
*
|
|
28
|
+
* Where:
|
|
29
|
+
* - METHOD is the uppercased HTTP method ('GET' | 'POST').
|
|
30
|
+
* - PATH is the URL path component (no scheme, host, or query).
|
|
31
|
+
* - CANONICAL_QUERY is `canonicalCliQueryString(query)` — sorted, RFC 3986
|
|
32
|
+
* percent-encoded, omitting undefined / null entries.
|
|
33
|
+
* - INSTALL_REPO is the `<org>/<repo>` slug of the install, transmitted on
|
|
34
|
+
* the wire as the `X-WarmHub-Install-Repo` header.
|
|
35
|
+
* - BODY is the raw request body string ('' for GET).
|
|
36
|
+
* - TIMESTAMP is unix-seconds since epoch (string-formatted).
|
|
37
|
+
*
|
|
38
|
+
* Verifiers should enforce a tolerance window on the timestamp to bound
|
|
39
|
+
* replay attacks (default 300 s); they should also compare signatures in
|
|
40
|
+
* constant time.
|
|
41
|
+
*
|
|
42
|
+
* This module is intentionally low-level: component authors import the
|
|
43
|
+
* higher-level `verifyCliCall(request, secret)` wrapper from
|
|
44
|
+
* `@warmhub/sdk-ts`, which extracts the canonical inputs from a Fetch
|
|
45
|
+
* `Request` and calls `verifyCliRequest` for them.
|
|
46
|
+
*/
|
|
47
|
+
/**
|
|
48
|
+
* Wire header names for component CLI dispatch — the single source of truth
|
|
49
|
+
* shared by the backend dispatcher (which sets them) and `verifyCliCall` (which
|
|
50
|
+
* reads them). The install repo always rides in {@link CLI_INSTALL_REPO_HEADER};
|
|
51
|
+
* the signing scheme adds {@link CLI_SIGNATURE_HEADER} + {@link CLI_TIMESTAMP_HEADER}.
|
|
52
|
+
* @see https://docs.warmhub.ai/sdk-reference/variables/cli_install_repo_header/
|
|
53
|
+
*/
|
|
54
|
+
declare const CLI_INSTALL_REPO_HEADER = "X-WarmHub-Install-Repo";
|
|
55
|
+
/**
|
|
56
|
+
* @see https://docs.warmhub.ai/sdk-reference/variables/cli_signature_header/
|
|
57
|
+
*/
|
|
58
|
+
declare const CLI_SIGNATURE_HEADER = "X-WarmHub-Signature";
|
|
59
|
+
/**
|
|
60
|
+
* @see https://docs.warmhub.ai/sdk-reference/variables/cli_timestamp_header/
|
|
61
|
+
*/
|
|
62
|
+
declare const CLI_TIMESTAMP_HEADER = "X-WarmHub-Timestamp";
|
|
63
|
+
/**
|
|
64
|
+
* HTTP verbs a component CLI method can declare. No-body verbs (GET, DELETE)
|
|
65
|
+
* carry args in the query string; body verbs (POST, PUT, PATCH) carry args in
|
|
66
|
+
* the JSON body.
|
|
67
|
+
*/
|
|
68
|
+
type CliHttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Hardcoded meta-schema for validating shape definitions.
|
|
72
|
+
* Shapes are NOT validated against a DB-stored shape — they validate against this constant.
|
|
73
|
+
* This avoids the bootstrap chicken-and-egg problem.
|
|
74
|
+
*
|
|
75
|
+
* A valid shape definition is:
|
|
76
|
+
* { fields: Record<string, TypeSpec>, description?: string }
|
|
77
|
+
* where TypeSpec is one of:
|
|
78
|
+
* - primitive string: "number", "string", "boolean", "wref", "array"
|
|
79
|
+
* - optional primitive: "number?", "string?", "boolean?", "wref?", "array?"
|
|
80
|
+
* - typed field object: { type: primitive, description?: string }
|
|
81
|
+
* - array: [TypeSpec] (shorthand) or { type: "array", items: TypeSpec }
|
|
82
|
+
* - nested object: { fieldName: TypeSpec, ... } (key may end with "?" for optional)
|
|
83
|
+
*
|
|
84
|
+
* The primitive vocabulary above is closed: any other type name (e.g. "text",
|
|
85
|
+
* "integer", "json", "date") is rejected. See VALID_PRIMITIVE_TYPES in
|
|
86
|
+
* ./shape-types.ts for the authoritative set.
|
|
87
|
+
*/
|
|
88
|
+
/**
|
|
89
|
+
* Maximum size, in bytes (UTF-8 encoded), allowed for a single content field value.
|
|
90
|
+
* WarmHub is not a document store: values larger than this are rejected at validation.
|
|
91
|
+
* Store large documents in S3, Box, Drive, or another document system and reference
|
|
92
|
+
* them from WarmHub instead.
|
|
93
|
+
* @see https://docs.warmhub.ai/sdk-reference/variables/max_content_field_bytes/
|
|
94
|
+
*/
|
|
95
|
+
declare const MAX_CONTENT_FIELD_BYTES: number;
|
|
96
|
+
/**
|
|
97
|
+
* Human-readable explanation of the {@link MAX_CONTENT_FIELD_BYTES} limit, suitable for
|
|
98
|
+
* appending to a field-specific validation error. States the byte cap and points callers
|
|
99
|
+
* to an external document store for large payloads.
|
|
100
|
+
* @see https://docs.warmhub.ai/sdk-reference/variables/content_field_limit_error/
|
|
101
|
+
*/
|
|
102
|
+
declare const CONTENT_FIELD_LIMIT_ERROR: string;
|
|
103
|
+
/**
|
|
104
|
+
* Returns a validation error message if the given string exceeds
|
|
105
|
+
* {@link MAX_CONTENT_FIELD_BYTES} when UTF-8 encoded, or `null` if it is within the limit.
|
|
106
|
+
*
|
|
107
|
+
* @param path - The field path, used to identify the offending field in the message.
|
|
108
|
+
* @param value - The candidate field value to measure.
|
|
109
|
+
* @see https://docs.warmhub.ai/sdk-reference/functions/contentfieldlimiterror/
|
|
110
|
+
*/
|
|
111
|
+
declare function contentFieldLimitError(path: string, value: string): string | null;
|
|
112
|
+
/**
|
|
113
|
+
* Validate a data payload against shape field definitions.
|
|
114
|
+
*
|
|
115
|
+
* Shape field types:
|
|
116
|
+
* - "number", "string", "boolean": primitive types
|
|
117
|
+
* - "wref": string (reference to another thing)
|
|
118
|
+
* - Typed field objects: { type: primitive, description?: string }
|
|
119
|
+
* - Nested objects: { fieldName: type, ... }
|
|
120
|
+
* - Arrays: [elementType]
|
|
121
|
+
* - Optional fields: field name ending with "?" (e.g. "terminal_reason?": "string")
|
|
122
|
+
* OR type string ending with "?" (e.g. "terminal_reason": "string?")
|
|
123
|
+
* OR typed object type ending with "?" (e.g. { type: "string?" })
|
|
124
|
+
*
|
|
125
|
+
* For v1 this is permissive: validates top-level field existence and basic types.
|
|
126
|
+
* Returns a {@link ShapeValidatorResult} discriminated union — read `result.valid`
|
|
127
|
+
* to branch, then `result.errors` (only present when invalid) for the list of
|
|
128
|
+
* messages. `result.warnings` may be present in either branch and carries
|
|
129
|
+
* undeclared top-level field names.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```ts
|
|
133
|
+
* import { validateAgainstShape } from "@warmhub/sdk-ts";
|
|
134
|
+
*
|
|
135
|
+
* const shapeFields = { x: "number", y: "number", label: "string?" };
|
|
136
|
+
*
|
|
137
|
+
* const ok = validateAgainstShape({ x: 1, y: 2 }, shapeFields);
|
|
138
|
+
* // ok.valid === true
|
|
139
|
+
*
|
|
140
|
+
* const bad = validateAgainstShape({ x: "not-a-number" }, shapeFields);
|
|
141
|
+
* if (!bad.valid) {
|
|
142
|
+
* for (const message of bad.errors) console.error(message);
|
|
143
|
+
* // ['Field "x" must be a number', 'Missing required field: "y"']
|
|
144
|
+
* }
|
|
145
|
+
* ```
|
|
146
|
+
* @see https://docs.warmhub.ai/sdk-reference/functions/validateagainstshape/
|
|
147
|
+
*/
|
|
148
|
+
declare function validateAgainstShape(data: Record<string, unknown>, shapeFields: Record<string, unknown>): ShapeValidatorResult;
|
|
149
|
+
/**
|
|
150
|
+
* @see https://docs.warmhub.ai/sdk-reference/type-aliases/undeclaredfieldswarning/
|
|
151
|
+
*/
|
|
152
|
+
type UndeclaredFieldsWarning = {
|
|
153
|
+
undeclaredFields: string[];
|
|
154
|
+
undeclaredFieldsTruncated?: true;
|
|
155
|
+
totalUndeclared?: number;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* @see https://docs.warmhub.ai/sdk-reference/type-aliases/shapevalidatorresult/
|
|
159
|
+
*/
|
|
160
|
+
type ShapeValidatorResult = {
|
|
161
|
+
valid: true;
|
|
162
|
+
warnings?: UndeclaredFieldsWarning;
|
|
163
|
+
} | {
|
|
164
|
+
valid: false;
|
|
165
|
+
errors: string[];
|
|
166
|
+
warnings?: UndeclaredFieldsWarning;
|
|
167
|
+
};
|
|
168
|
+
|
|
1
169
|
type ActionAttempt = {
|
|
2
170
|
attempt: number;
|
|
3
171
|
status: string;
|
|
@@ -100,7 +268,7 @@ type AccessResolveResult$1 = {
|
|
|
100
268
|
type AuthSyncResult = {
|
|
101
269
|
success: boolean;
|
|
102
270
|
};
|
|
103
|
-
type CollectionAbout$
|
|
271
|
+
type CollectionAbout$1 = {
|
|
104
272
|
pair: [string, string];
|
|
105
273
|
} | {
|
|
106
274
|
triple: [string, string, string];
|
|
@@ -118,7 +286,7 @@ type CommitApplyResult = {
|
|
|
118
286
|
operations: Array<{
|
|
119
287
|
opIndex?: number;
|
|
120
288
|
name: string;
|
|
121
|
-
operation: 'add' | 'revise' | 'retract' | 'noop';
|
|
289
|
+
operation: 'add' | 'revise' | 'retract' | 'rename' | 'noop';
|
|
122
290
|
version: number;
|
|
123
291
|
dataHash: string;
|
|
124
292
|
status?: 'applied' | 'noop';
|
|
@@ -156,11 +324,11 @@ type ComponentDetail = {
|
|
|
156
324
|
synthesized?: boolean;
|
|
157
325
|
aboutWref?: string;
|
|
158
326
|
committerWref?: string;
|
|
159
|
-
|
|
327
|
+
revisedBy?: string;
|
|
160
328
|
metadata?: {
|
|
161
329
|
durableId: string;
|
|
162
|
-
|
|
163
|
-
|
|
330
|
+
createdOn: number;
|
|
331
|
+
revisedOn: number;
|
|
164
332
|
};
|
|
165
333
|
};
|
|
166
334
|
ownedShapes: Array<{
|
|
@@ -188,8 +356,8 @@ type ComponentDetail = {
|
|
|
188
356
|
aboutWref?: string;
|
|
189
357
|
metadata?: {
|
|
190
358
|
durableId: string;
|
|
191
|
-
|
|
192
|
-
|
|
359
|
+
createdOn: number;
|
|
360
|
+
revisedOn: number;
|
|
193
361
|
};
|
|
194
362
|
}>;
|
|
195
363
|
};
|
|
@@ -333,9 +501,14 @@ type StreamAppendInput$1 = {
|
|
|
333
501
|
} | {
|
|
334
502
|
operation: 'retract';
|
|
335
503
|
name: string;
|
|
336
|
-
kind?: '
|
|
504
|
+
kind?: 'shape' | 'thing' | 'assertion' | 'collection';
|
|
337
505
|
reason?: string;
|
|
338
506
|
leaseId?: string;
|
|
507
|
+
} | {
|
|
508
|
+
operation: 'rename';
|
|
509
|
+
name: string;
|
|
510
|
+
newName: string;
|
|
511
|
+
kind?: 'shape' | 'thing' | 'assertion' | 'collection';
|
|
339
512
|
}>;
|
|
340
513
|
};
|
|
341
514
|
type StreamAppendResult$1 = {
|
|
@@ -346,7 +519,7 @@ type StreamAppendResult$1 = {
|
|
|
346
519
|
results: Array<{
|
|
347
520
|
opIndex?: number;
|
|
348
521
|
name: string;
|
|
349
|
-
operation?: 'add' | 'revise' | 'retract' | 'noop';
|
|
522
|
+
operation?: 'add' | 'revise' | 'retract' | 'rename' | 'noop';
|
|
350
523
|
version?: number;
|
|
351
524
|
dataHash?: string;
|
|
352
525
|
status?: 'success' | 'noop' | 'failed';
|
|
@@ -480,11 +653,11 @@ type ThingGetManyResult$1 = {
|
|
|
480
653
|
synthesized?: boolean;
|
|
481
654
|
aboutWref?: string;
|
|
482
655
|
committerWref?: string;
|
|
483
|
-
|
|
656
|
+
revisedBy?: string;
|
|
484
657
|
metadata?: {
|
|
485
658
|
durableId: string;
|
|
486
|
-
|
|
487
|
-
|
|
659
|
+
createdOn: number;
|
|
660
|
+
revisedOn: number;
|
|
488
661
|
};
|
|
489
662
|
}>;
|
|
490
663
|
missing: Array<string>;
|
|
@@ -496,7 +669,7 @@ type ThingHeadVersionsResult$1 = {
|
|
|
496
669
|
durableId: string;
|
|
497
670
|
version: number;
|
|
498
671
|
active: boolean;
|
|
499
|
-
|
|
672
|
+
revisedOn: number;
|
|
500
673
|
}>;
|
|
501
674
|
missing: Array<string>;
|
|
502
675
|
};
|
|
@@ -627,6 +800,13 @@ type ShapeChangeResult = {
|
|
|
627
800
|
version: number;
|
|
628
801
|
dataHash: string;
|
|
629
802
|
};
|
|
803
|
+
type ShapeRemoveResult = {
|
|
804
|
+
name: string;
|
|
805
|
+
operation: 'add' | 'revise' | 'retract' | 'noop';
|
|
806
|
+
version: number;
|
|
807
|
+
dataHash: string;
|
|
808
|
+
removed: true;
|
|
809
|
+
};
|
|
630
810
|
type SubscriptionBindCredentialsResult$1 = {
|
|
631
811
|
bound: true;
|
|
632
812
|
subscriptionName: string;
|
|
@@ -691,7 +871,7 @@ interface AddOperation {
|
|
|
691
871
|
* (1–2 segments → thing, 3+ segments → assertion). Shape adds always
|
|
692
872
|
* require explicit `kind: 'shape'`.
|
|
693
873
|
*/
|
|
694
|
-
kind?:
|
|
874
|
+
kind?: CommitOperationKind;
|
|
695
875
|
/**
|
|
696
876
|
* Target name. Use `Shape/localName` for things and assertions; use the
|
|
697
877
|
* plain shape name for shapes.
|
|
@@ -701,7 +881,7 @@ interface AddOperation {
|
|
|
701
881
|
* Assertion target wref or inline collection descriptor. Presence of
|
|
702
882
|
* `about` makes the add an assertion unless `kind` overrides it.
|
|
703
883
|
*/
|
|
704
|
-
about?: string | CollectionAbout$
|
|
884
|
+
about?: string | CollectionAbout$1;
|
|
705
885
|
/**
|
|
706
886
|
* Shape-validated data payload for shape, thing, or assertion adds.
|
|
707
887
|
*/
|
|
@@ -741,7 +921,7 @@ interface ReviseOperation {
|
|
|
741
921
|
/**
|
|
742
922
|
* Optional kind safety hint: `shape`, `thing`, `assertion`, or `collection`.
|
|
743
923
|
*/
|
|
744
|
-
kind?:
|
|
924
|
+
kind?: CommitOperationKind;
|
|
745
925
|
/**
|
|
746
926
|
* Target name to revise. Equivalent to `wref` for local paths.
|
|
747
927
|
*/
|
|
@@ -792,7 +972,7 @@ interface RetractOperation {
|
|
|
792
972
|
/**
|
|
793
973
|
* Optional kind safety hint: `thing`, `assertion`, `shape`, or `collection`.
|
|
794
974
|
*/
|
|
795
|
-
kind?:
|
|
975
|
+
kind?: CommitOperationKind;
|
|
796
976
|
/**
|
|
797
977
|
* Optional human-readable retraction reason.
|
|
798
978
|
*/
|
|
@@ -804,10 +984,37 @@ interface RetractOperation {
|
|
|
804
984
|
*/
|
|
805
985
|
leaseId?: string;
|
|
806
986
|
}
|
|
987
|
+
/**
|
|
988
|
+
* Rename operation accepted by `client.commit.apply` (#4848). Rewrites a thing's
|
|
989
|
+
* or shape's name in place — a version-less metadata op that records a from→to
|
|
990
|
+
* event but mints no new body version.
|
|
991
|
+
*
|
|
992
|
+
* @see https://docs.warmhub.ai/writes/operations/#rename-operations
|
|
993
|
+
*/
|
|
994
|
+
interface RenameOperation {
|
|
995
|
+
/**
|
|
996
|
+
* Operation discriminator. Required.
|
|
997
|
+
*/
|
|
998
|
+
operation: 'rename';
|
|
999
|
+
/**
|
|
1000
|
+
* Current target: `Shape/oldName` for a thing/assertion, or the plain shape
|
|
1001
|
+
* name for a shape.
|
|
1002
|
+
*/
|
|
1003
|
+
name: string;
|
|
1004
|
+
/**
|
|
1005
|
+
* New bare name — within the same shape for a thing/assertion, or the new
|
|
1006
|
+
* shape name for a shape rename.
|
|
1007
|
+
*/
|
|
1008
|
+
newName: string;
|
|
1009
|
+
/**
|
|
1010
|
+
* Optional kind safety hint: `thing`, `assertion`, `shape`, or `collection`.
|
|
1011
|
+
*/
|
|
1012
|
+
kind?: CommitOperationKind;
|
|
1013
|
+
}
|
|
807
1014
|
/**
|
|
808
1015
|
* Commit operation accepted by `client.commit.apply`. Discriminated union over
|
|
809
|
-
* {@link AddOperation}, {@link ReviseOperation},
|
|
810
|
-
* keyed on `operation`.
|
|
1016
|
+
* {@link AddOperation}, {@link ReviseOperation}, {@link RetractOperation}, and
|
|
1017
|
+
* {@link RenameOperation}, keyed on `operation`.
|
|
811
1018
|
*
|
|
812
1019
|
* Inline array literals passed directly to `client.commit.apply` are
|
|
813
1020
|
* contextually typed by the parameter, so `operation: "add"` stays narrowed
|
|
@@ -835,7 +1042,7 @@ interface RetractOperation {
|
|
|
835
1042
|
*
|
|
836
1043
|
* @see https://docs.warmhub.ai/sdk/write-methods/#typing-operation-arrays
|
|
837
1044
|
*/
|
|
838
|
-
type Operation = AddOperation | ReviseOperation | RetractOperation;
|
|
1045
|
+
type Operation = AddOperation | ReviseOperation | RetractOperation | RenameOperation;
|
|
839
1046
|
|
|
840
1047
|
/**
|
|
841
1048
|
* Default number of operations the SDK sends per stream append chunk.
|
|
@@ -849,6 +1056,7 @@ declare const DEFAULT_STREAM_CHUNK_SIZE = 1000;
|
|
|
849
1056
|
* @internal
|
|
850
1057
|
*/
|
|
851
1058
|
declare const MAX_STREAM_APPEND_OPERATION_COUNT = 10000;
|
|
1059
|
+
type CommitResultOperation = CommitOperation | 'noop';
|
|
852
1060
|
interface OperationStreamClient {
|
|
853
1061
|
stream: {
|
|
854
1062
|
append(input: StreamAppendInput$1): Promise<StreamAppendResult$1>;
|
|
@@ -868,7 +1076,7 @@ type SubmittedStreamResult = {
|
|
|
868
1076
|
operations: Array<{
|
|
869
1077
|
opIndex?: number;
|
|
870
1078
|
name: string;
|
|
871
|
-
operation:
|
|
1079
|
+
operation: CommitResultOperation;
|
|
872
1080
|
dataHash: string;
|
|
873
1081
|
version: number;
|
|
874
1082
|
status?: 'applied' | 'noop' | 'error';
|
|
@@ -1060,170 +1268,6 @@ declare function submitOperationsViaStream(client: OperationStreamClient, args:
|
|
|
1060
1268
|
retry?: RetryPolicyOptions | false;
|
|
1061
1269
|
}): Promise<SubmittedStreamResult>;
|
|
1062
1270
|
|
|
1063
|
-
type CollectionAbout$1 = {
|
|
1064
|
-
pair: [string, string];
|
|
1065
|
-
} | {
|
|
1066
|
-
triple: [string, string, string];
|
|
1067
|
-
} | {
|
|
1068
|
-
set: string[];
|
|
1069
|
-
} | {
|
|
1070
|
-
list: string[];
|
|
1071
|
-
};
|
|
1072
|
-
|
|
1073
|
-
/**
|
|
1074
|
-
* Canonical request signing for component CLI dispatch.
|
|
1075
|
-
*
|
|
1076
|
-
* Component workers expose CLI methods over HTTP. The platform dispatcher
|
|
1077
|
-
* signs each call with HMAC-SHA256 over a canonical request representation
|
|
1078
|
-
* so the worker can authenticate the caller without sharing more than a
|
|
1079
|
-
* single secret. The same canonical input works for GET and POST methods:
|
|
1080
|
-
* the difference is whether the method args ride in the query string or
|
|
1081
|
-
* the body.
|
|
1082
|
-
*
|
|
1083
|
-
* Canonical signing input:
|
|
1084
|
-
* <METHOD>\n<PATH>\n<CANONICAL_QUERY>\n<INSTALL_REPO>\n<SHA256_HEX(BODY)>\n<TIMESTAMP>
|
|
1085
|
-
*
|
|
1086
|
-
* Where:
|
|
1087
|
-
* - METHOD is the uppercased HTTP method ('GET' | 'POST').
|
|
1088
|
-
* - PATH is the URL path component (no scheme, host, or query).
|
|
1089
|
-
* - CANONICAL_QUERY is `canonicalCliQueryString(query)` — sorted, RFC 3986
|
|
1090
|
-
* percent-encoded, omitting undefined / null entries.
|
|
1091
|
-
* - INSTALL_REPO is the `<org>/<repo>` slug of the install, transmitted on
|
|
1092
|
-
* the wire as the `X-WarmHub-Install-Repo` header.
|
|
1093
|
-
* - BODY is the raw request body string ('' for GET).
|
|
1094
|
-
* - TIMESTAMP is unix-seconds since epoch (string-formatted).
|
|
1095
|
-
*
|
|
1096
|
-
* Verifiers should enforce a tolerance window on the timestamp to bound
|
|
1097
|
-
* replay attacks (default 300 s); they should also compare signatures in
|
|
1098
|
-
* constant time.
|
|
1099
|
-
*
|
|
1100
|
-
* This module is intentionally low-level: component authors import the
|
|
1101
|
-
* higher-level `verifyCliCall(request, secret)` wrapper from
|
|
1102
|
-
* `@warmhub/sdk-ts`, which extracts the canonical inputs from a Fetch
|
|
1103
|
-
* `Request` and calls `verifyCliRequest` for them.
|
|
1104
|
-
*/
|
|
1105
|
-
/**
|
|
1106
|
-
* Wire header names for component CLI dispatch — the single source of truth
|
|
1107
|
-
* shared by the backend dispatcher (which sets them) and `verifyCliCall` (which
|
|
1108
|
-
* reads them). The install repo always rides in {@link CLI_INSTALL_REPO_HEADER};
|
|
1109
|
-
* the signing scheme adds {@link CLI_SIGNATURE_HEADER} + {@link CLI_TIMESTAMP_HEADER}.
|
|
1110
|
-
* @see https://docs.warmhub.ai/sdk-reference/variables/cli_install_repo_header/
|
|
1111
|
-
*/
|
|
1112
|
-
declare const CLI_INSTALL_REPO_HEADER = "X-WarmHub-Install-Repo";
|
|
1113
|
-
/**
|
|
1114
|
-
* @see https://docs.warmhub.ai/sdk-reference/variables/cli_signature_header/
|
|
1115
|
-
*/
|
|
1116
|
-
declare const CLI_SIGNATURE_HEADER = "X-WarmHub-Signature";
|
|
1117
|
-
/**
|
|
1118
|
-
* @see https://docs.warmhub.ai/sdk-reference/variables/cli_timestamp_header/
|
|
1119
|
-
*/
|
|
1120
|
-
declare const CLI_TIMESTAMP_HEADER = "X-WarmHub-Timestamp";
|
|
1121
|
-
/**
|
|
1122
|
-
* HTTP verbs a component CLI method can declare. No-body verbs (GET, DELETE)
|
|
1123
|
-
* carry args in the query string; body verbs (POST, PUT, PATCH) carry args in
|
|
1124
|
-
* the JSON body.
|
|
1125
|
-
*/
|
|
1126
|
-
type CliHttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
1127
|
-
|
|
1128
|
-
/**
|
|
1129
|
-
* Hardcoded meta-schema for validating shape definitions.
|
|
1130
|
-
* Shapes are NOT validated against a DB-stored shape — they validate against this constant.
|
|
1131
|
-
* This avoids the bootstrap chicken-and-egg problem.
|
|
1132
|
-
*
|
|
1133
|
-
* A valid shape definition is:
|
|
1134
|
-
* { fields: Record<string, TypeSpec>, description?: string }
|
|
1135
|
-
* where TypeSpec is one of:
|
|
1136
|
-
* - primitive string: "number", "string", "boolean", "wref", "array"
|
|
1137
|
-
* - optional primitive: "number?", "string?", "boolean?", "wref?", "array?"
|
|
1138
|
-
* - typed field object: { type: primitive, description?: string }
|
|
1139
|
-
* - array: [TypeSpec] (shorthand) or { type: "array", items: TypeSpec }
|
|
1140
|
-
* - nested object: { fieldName: TypeSpec, ... } (key may end with "?" for optional)
|
|
1141
|
-
*
|
|
1142
|
-
* The primitive vocabulary above is closed: any other type name (e.g. "text",
|
|
1143
|
-
* "integer", "json", "date") is rejected. See VALID_PRIMITIVE_TYPES in
|
|
1144
|
-
* ./shape-types.ts for the authoritative set.
|
|
1145
|
-
*/
|
|
1146
|
-
/**
|
|
1147
|
-
* Maximum size, in bytes (UTF-8 encoded), allowed for a single content field value.
|
|
1148
|
-
* WarmHub is not a document store: values larger than this are rejected at validation.
|
|
1149
|
-
* Store large documents in S3, Box, Drive, or another document system and reference
|
|
1150
|
-
* them from WarmHub instead.
|
|
1151
|
-
* @see https://docs.warmhub.ai/sdk-reference/variables/max_content_field_bytes/
|
|
1152
|
-
*/
|
|
1153
|
-
declare const MAX_CONTENT_FIELD_BYTES: number;
|
|
1154
|
-
/**
|
|
1155
|
-
* Human-readable explanation of the {@link MAX_CONTENT_FIELD_BYTES} limit, suitable for
|
|
1156
|
-
* appending to a field-specific validation error. States the byte cap and points callers
|
|
1157
|
-
* to an external document store for large payloads.
|
|
1158
|
-
* @see https://docs.warmhub.ai/sdk-reference/variables/content_field_limit_error/
|
|
1159
|
-
*/
|
|
1160
|
-
declare const CONTENT_FIELD_LIMIT_ERROR: string;
|
|
1161
|
-
/**
|
|
1162
|
-
* Returns a validation error message if the given string exceeds
|
|
1163
|
-
* {@link MAX_CONTENT_FIELD_BYTES} when UTF-8 encoded, or `null` if it is within the limit.
|
|
1164
|
-
*
|
|
1165
|
-
* @param path - The field path, used to identify the offending field in the message.
|
|
1166
|
-
* @param value - The candidate field value to measure.
|
|
1167
|
-
* @see https://docs.warmhub.ai/sdk-reference/functions/contentfieldlimiterror/
|
|
1168
|
-
*/
|
|
1169
|
-
declare function contentFieldLimitError(path: string, value: string): string | null;
|
|
1170
|
-
/**
|
|
1171
|
-
* Validate a data payload against shape field definitions.
|
|
1172
|
-
*
|
|
1173
|
-
* Shape field types:
|
|
1174
|
-
* - "number", "string", "boolean": primitive types
|
|
1175
|
-
* - "wref": string (reference to another thing)
|
|
1176
|
-
* - Typed field objects: { type: primitive, description?: string }
|
|
1177
|
-
* - Nested objects: { fieldName: type, ... }
|
|
1178
|
-
* - Arrays: [elementType]
|
|
1179
|
-
* - Optional fields: field name ending with "?" (e.g. "terminal_reason?": "string")
|
|
1180
|
-
* OR type string ending with "?" (e.g. "terminal_reason": "string?")
|
|
1181
|
-
* OR typed object type ending with "?" (e.g. { type: "string?" })
|
|
1182
|
-
*
|
|
1183
|
-
* For v1 this is permissive: validates top-level field existence and basic types.
|
|
1184
|
-
* Returns a {@link ShapeValidatorResult} discriminated union — read `result.valid`
|
|
1185
|
-
* to branch, then `result.errors` (only present when invalid) for the list of
|
|
1186
|
-
* messages. `result.warnings` may be present in either branch and carries
|
|
1187
|
-
* undeclared top-level field names.
|
|
1188
|
-
*
|
|
1189
|
-
* @example
|
|
1190
|
-
* ```ts
|
|
1191
|
-
* import { validateAgainstShape } from "@warmhub/sdk-ts";
|
|
1192
|
-
*
|
|
1193
|
-
* const shapeFields = { x: "number", y: "number", label: "string?" };
|
|
1194
|
-
*
|
|
1195
|
-
* const ok = validateAgainstShape({ x: 1, y: 2 }, shapeFields);
|
|
1196
|
-
* // ok.valid === true
|
|
1197
|
-
*
|
|
1198
|
-
* const bad = validateAgainstShape({ x: "not-a-number" }, shapeFields);
|
|
1199
|
-
* if (!bad.valid) {
|
|
1200
|
-
* for (const message of bad.errors) console.error(message);
|
|
1201
|
-
* // ['Field "x" must be a number', 'Missing required field: "y"']
|
|
1202
|
-
* }
|
|
1203
|
-
* ```
|
|
1204
|
-
* @see https://docs.warmhub.ai/sdk-reference/functions/validateagainstshape/
|
|
1205
|
-
*/
|
|
1206
|
-
declare function validateAgainstShape(data: Record<string, unknown>, shapeFields: Record<string, unknown>): ShapeValidatorResult;
|
|
1207
|
-
/**
|
|
1208
|
-
* @see https://docs.warmhub.ai/sdk-reference/type-aliases/undeclaredfieldswarning/
|
|
1209
|
-
*/
|
|
1210
|
-
type UndeclaredFieldsWarning = {
|
|
1211
|
-
undeclaredFields: string[];
|
|
1212
|
-
undeclaredFieldsTruncated?: true;
|
|
1213
|
-
totalUndeclared?: number;
|
|
1214
|
-
};
|
|
1215
|
-
/**
|
|
1216
|
-
* @see https://docs.warmhub.ai/sdk-reference/type-aliases/shapevalidatorresult/
|
|
1217
|
-
*/
|
|
1218
|
-
type ShapeValidatorResult = {
|
|
1219
|
-
valid: true;
|
|
1220
|
-
warnings?: UndeclaredFieldsWarning;
|
|
1221
|
-
} | {
|
|
1222
|
-
valid: false;
|
|
1223
|
-
errors: string[];
|
|
1224
|
-
warnings?: UndeclaredFieldsWarning;
|
|
1225
|
-
};
|
|
1226
|
-
|
|
1227
1271
|
/**
|
|
1228
1272
|
* Server-side verifier for component CLI dispatch calls.
|
|
1229
1273
|
*
|
|
@@ -1347,7 +1391,7 @@ interface AddOp {
|
|
|
1347
1391
|
/**
|
|
1348
1392
|
* Assertion target wref or inline collection descriptor. Presence of `about` makes the add an assertion unless `kind` overrides it.
|
|
1349
1393
|
*/
|
|
1350
|
-
readonly about?: string | CollectionAbout$
|
|
1394
|
+
readonly about?: string | CollectionAbout$2;
|
|
1351
1395
|
/**
|
|
1352
1396
|
* Collection type. Used only for collection adds.
|
|
1353
1397
|
*/
|
|
@@ -1429,7 +1473,7 @@ interface RetractOp {
|
|
|
1429
1473
|
/**
|
|
1430
1474
|
* Optional kind safety hint: `thing`, `assertion`, `shape`, or `collection`.
|
|
1431
1475
|
*/
|
|
1432
|
-
readonly kind?:
|
|
1476
|
+
readonly kind?: CommitOperationKind;
|
|
1433
1477
|
/**
|
|
1434
1478
|
* Optional human-readable retraction reason.
|
|
1435
1479
|
*/
|
|
@@ -1559,7 +1603,7 @@ declare class OperationBuilder {
|
|
|
1559
1603
|
*/
|
|
1560
1604
|
retract(target: string | {
|
|
1561
1605
|
name: string;
|
|
1562
|
-
kind?:
|
|
1606
|
+
kind?: CommitOperationKind;
|
|
1563
1607
|
reason?: string;
|
|
1564
1608
|
leaseId?: string;
|
|
1565
1609
|
}): this;
|
|
@@ -1633,7 +1677,7 @@ declare class OperationBuilder {
|
|
|
1633
1677
|
}
|
|
1634
1678
|
|
|
1635
1679
|
/** @internal */
|
|
1636
|
-
type CollectionAbout = CollectionAbout$
|
|
1680
|
+
type CollectionAbout = CollectionAbout$1;
|
|
1637
1681
|
/** @internal */
|
|
1638
1682
|
type CollectionTag = CollectionTag$1;
|
|
1639
1683
|
/** @internal */
|
|
@@ -1699,6 +1743,49 @@ interface RequestEvent {
|
|
|
1699
1743
|
operation: 'query' | 'mutation' | 'action';
|
|
1700
1744
|
functionPath: string;
|
|
1701
1745
|
}
|
|
1746
|
+
/**
|
|
1747
|
+
* Argument forms for the single-subscription management methods (`get`,
|
|
1748
|
+
* `reveal`, `pause`, `resume`, `remove`). GH-4679: the positional
|
|
1749
|
+
* `(orgName, repoName, name)` form addresses a repo-scoped subscription; the
|
|
1750
|
+
* object form may omit `repoName` to address an org-scoped (`org.renamed`)
|
|
1751
|
+
* subscription — `get({ orgName, name })`.
|
|
1752
|
+
*/
|
|
1753
|
+
type SubscriptionRefArgs = [orgName: string, repoName: string, name: string] | [ref: {
|
|
1754
|
+
orgName: string;
|
|
1755
|
+
repoName?: string;
|
|
1756
|
+
name: string;
|
|
1757
|
+
}];
|
|
1758
|
+
/** Argument forms for `list` — see {@link SubscriptionRefArgs}. */
|
|
1759
|
+
type SubscriptionListArgs = [orgName: string, repoName?: string] | [ref: {
|
|
1760
|
+
orgName: string;
|
|
1761
|
+
repoName?: string;
|
|
1762
|
+
}];
|
|
1763
|
+
/**
|
|
1764
|
+
* Argument forms for `bindCredentials` — positional `(orgName, repoName,
|
|
1765
|
+
* subscriptionName, credentialSetName)` addresses a repo-scoped subscription;
|
|
1766
|
+
* the object form may omit `repoName` for an org-scoped subscription.
|
|
1767
|
+
*/
|
|
1768
|
+
type SubscriptionBindArgs = [
|
|
1769
|
+
orgName: string,
|
|
1770
|
+
repoName: string,
|
|
1771
|
+
subscriptionName: string,
|
|
1772
|
+
credentialSetName: string
|
|
1773
|
+
] | [
|
|
1774
|
+
ref: {
|
|
1775
|
+
orgName: string;
|
|
1776
|
+
repoName?: string;
|
|
1777
|
+
subscriptionName: string;
|
|
1778
|
+
credentialSetName: string;
|
|
1779
|
+
}
|
|
1780
|
+
];
|
|
1781
|
+
/** Argument forms for `unbindCredentials` — see {@link SubscriptionBindArgs}. */
|
|
1782
|
+
type SubscriptionUnbindArgs = [orgName: string, repoName: string, subscriptionName: string] | [
|
|
1783
|
+
ref: {
|
|
1784
|
+
orgName: string;
|
|
1785
|
+
repoName?: string;
|
|
1786
|
+
subscriptionName: string;
|
|
1787
|
+
}
|
|
1788
|
+
];
|
|
1702
1789
|
/** @internal */
|
|
1703
1790
|
type CoreErrorKind = 'BACKEND' | 'NOT_FOUND' | 'FORBIDDEN' | 'UNAUTHENTICATED' | 'VALIDATION_ERROR' | 'CONFLICT' | 'RATE_LIMITED' | 'CANCELLED' | 'NETWORK';
|
|
1704
1791
|
/**
|
|
@@ -1751,7 +1838,7 @@ type ShapeList = ShapeListResult;
|
|
|
1751
1838
|
*/
|
|
1752
1839
|
type ShapeRemove = {
|
|
1753
1840
|
name: string;
|
|
1754
|
-
operation: '
|
|
1841
|
+
operation: ShapeRemoveResult['operation'];
|
|
1755
1842
|
version: number;
|
|
1756
1843
|
dataHash: string;
|
|
1757
1844
|
removed: true;
|
|
@@ -1799,10 +1886,8 @@ type SubscriptionInfo = {
|
|
|
1799
1886
|
*/
|
|
1800
1887
|
type SubscriptionList = SubscriptionInfo[];
|
|
1801
1888
|
/** @internal */
|
|
1802
|
-
type
|
|
1889
|
+
type SubscriptionCompatCreateCommon = {
|
|
1803
1890
|
orgName: string;
|
|
1804
|
-
repoName: string;
|
|
1805
|
-
shapeName?: string;
|
|
1806
1891
|
name: string;
|
|
1807
1892
|
webhookUrl: string;
|
|
1808
1893
|
fallbackWebhookUrl?: string;
|
|
@@ -1810,35 +1895,57 @@ type SubscriptionCompatCreateBase = {
|
|
|
1810
1895
|
notifyOnSuccess?: boolean;
|
|
1811
1896
|
componentRef?: string;
|
|
1812
1897
|
workspacePolicy?: never;
|
|
1898
|
+
kind: 'webhook';
|
|
1813
1899
|
/** @internal */
|
|
1814
1900
|
actionContainer?: string;
|
|
1815
1901
|
/** @internal */
|
|
1816
1902
|
actionContainerConfig?: unknown;
|
|
1817
1903
|
};
|
|
1818
1904
|
/**
|
|
1819
|
-
* Input shape for `client.subscription.create
|
|
1820
|
-
*
|
|
1821
|
-
*
|
|
1822
|
-
*
|
|
1823
|
-
*
|
|
1905
|
+
* Input shape for `client.subscription.create`, discriminated on `eventType`
|
|
1906
|
+
* (GH-4679):
|
|
1907
|
+
*
|
|
1908
|
+
* - default / `commit` — operation-based, repo-scoped (`repoName`); requires a
|
|
1909
|
+
* `filterJson` object and a shape binding (`shapeName` or `filterJson.shape`).
|
|
1910
|
+
* - `repo.renamed` — repo-scoped metadata event; no shape/filter/source.
|
|
1911
|
+
* - `org.renamed` — org-scoped metadata event; no `repoName`/shape/filter/source.
|
|
1912
|
+
*
|
|
1913
|
+
* The metadata variants forbid the commit-only fields at the type level so
|
|
1914
|
+
* invalid shapes fail at compile time, not just server-side.
|
|
1824
1915
|
*
|
|
1825
1916
|
* @see https://docs.warmhub.ai/subscriptions/creating/
|
|
1826
1917
|
*/
|
|
1827
|
-
type SubscriptionCompatCreateInput =
|
|
1828
|
-
|
|
1918
|
+
type SubscriptionCompatCreateInput = (SubscriptionCompatCreateCommon & {
|
|
1919
|
+
eventType?: 'commit';
|
|
1920
|
+
repoName: string;
|
|
1829
1921
|
filterJson: Record<string, unknown>;
|
|
1922
|
+
shapeName?: string;
|
|
1830
1923
|
sourceRepoRef?: string;
|
|
1831
|
-
}
|
|
1924
|
+
}) | (SubscriptionCompatCreateCommon & {
|
|
1925
|
+
eventType: 'repo.renamed';
|
|
1926
|
+
repoName: string;
|
|
1927
|
+
filterJson?: never;
|
|
1928
|
+
shapeName?: never;
|
|
1929
|
+
sourceRepoRef?: never;
|
|
1930
|
+
}) | (SubscriptionCompatCreateCommon & {
|
|
1931
|
+
eventType: 'org.renamed';
|
|
1932
|
+
repoName?: never;
|
|
1933
|
+
filterJson?: never;
|
|
1934
|
+
shapeName?: never;
|
|
1935
|
+
sourceRepoRef?: never;
|
|
1936
|
+
});
|
|
1832
1937
|
/**
|
|
1833
|
-
* Input shape for `client.subscription.update`. `orgName
|
|
1834
|
-
*
|
|
1835
|
-
* the ones you provide get
|
|
1938
|
+
* Input shape for `client.subscription.update`. `orgName` and `name` identify
|
|
1939
|
+
* the subscription; omit `repoName` to update an org-scoped (`org.renamed`)
|
|
1940
|
+
* subscription. All other fields are optional and only the ones you provide get
|
|
1941
|
+
* patched. Rename subscriptions (`repo.renamed`/`org.renamed`) reject
|
|
1942
|
+
* `shapeName`/`filterJson` — they have only delivery fields to edit.
|
|
1836
1943
|
*
|
|
1837
1944
|
* @see https://docs.warmhub.ai/subscriptions/managing/#update-subscription
|
|
1838
1945
|
*/
|
|
1839
1946
|
type SubscriptionCompatUpdateInput = {
|
|
1840
1947
|
orgName: string;
|
|
1841
|
-
repoName
|
|
1948
|
+
repoName?: string;
|
|
1842
1949
|
name: string;
|
|
1843
1950
|
shapeName?: string;
|
|
1844
1951
|
filterJson?: Record<string, unknown>;
|
|
@@ -2240,10 +2347,10 @@ type RepoLocator = {
|
|
|
2240
2347
|
* Stable identity and creation timestamps embedded on every thing-like read
|
|
2241
2348
|
* result. `durableId` is a self-routing, self-verifying token (Crockford base32
|
|
2242
2349
|
* over `repo_id + things.id + CRC-32C`) that remains identical before and after
|
|
2243
|
-
* rename and across revise/retract. `
|
|
2244
|
-
* date (stable across all mutations); `
|
|
2350
|
+
* rename and across revise/retract. `createdOn` records the thing's birth
|
|
2351
|
+
* date (stable across all mutations); `revisedOn` is the timestamp of
|
|
2245
2352
|
* the current version (advances on each revise). History rows carry only
|
|
2246
|
-
* `durableId` and `
|
|
2353
|
+
* `durableId` and `createdOn` — omit `revisedOn`.
|
|
2247
2354
|
*
|
|
2248
2355
|
* Pass a bare `durableId` (optionally with `@vN`) wherever a wref is accepted
|
|
2249
2356
|
* on read surfaces; `orgName`/`repoName` may be omitted for self-routing reads.
|
|
@@ -2252,8 +2359,8 @@ type RepoLocator = {
|
|
|
2252
2359
|
*/
|
|
2253
2360
|
type ThingMetadata = {
|
|
2254
2361
|
durableId: string;
|
|
2255
|
-
|
|
2256
|
-
|
|
2362
|
+
createdOn: number;
|
|
2363
|
+
revisedOn: number;
|
|
2257
2364
|
};
|
|
2258
2365
|
/** @internal */
|
|
2259
2366
|
type ThingItem = {
|
|
@@ -2325,7 +2432,8 @@ type ThingDetail = {
|
|
|
2325
2432
|
synthesized?: boolean;
|
|
2326
2433
|
aboutWref?: string;
|
|
2327
2434
|
committerWref?: string;
|
|
2328
|
-
createdByWref
|
|
2435
|
+
/** #4848 Phase C: current-version author (renamed from createdByWref). */
|
|
2436
|
+
revisedBy?: string;
|
|
2329
2437
|
metadata?: ThingMetadata;
|
|
2330
2438
|
[key: string]: unknown;
|
|
2331
2439
|
};
|
|
@@ -2361,7 +2469,7 @@ type HistoryResult = {
|
|
|
2361
2469
|
versions: Array<{
|
|
2362
2470
|
version: number;
|
|
2363
2471
|
wref: string;
|
|
2364
|
-
operation:
|
|
2472
|
+
operation: CommitOperation;
|
|
2365
2473
|
retractReason?: string;
|
|
2366
2474
|
active: boolean;
|
|
2367
2475
|
createdAt: number;
|
|
@@ -2370,8 +2478,9 @@ type HistoryResult = {
|
|
|
2370
2478
|
shapeName?: string;
|
|
2371
2479
|
data?: unknown;
|
|
2372
2480
|
committerWref?: string;
|
|
2373
|
-
createdByWref
|
|
2374
|
-
|
|
2481
|
+
/** #4848 Phase C: per-version author (renamed from createdByWref). */
|
|
2482
|
+
revisedBy?: string;
|
|
2483
|
+
metadata?: Pick<ThingMetadata, 'durableId' | 'createdOn'>;
|
|
2375
2484
|
[key: string]: unknown;
|
|
2376
2485
|
}>;
|
|
2377
2486
|
nextCursor?: string;
|
|
@@ -2381,7 +2490,7 @@ type ThingHeadRequest = {
|
|
|
2381
2490
|
orgName: string;
|
|
2382
2491
|
repoName: string;
|
|
2383
2492
|
shape?: string;
|
|
2384
|
-
kind?:
|
|
2493
|
+
kind?: CommitOperationKind;
|
|
2385
2494
|
match?: string;
|
|
2386
2495
|
dataMode?: 'full' | 'summary' | 'none';
|
|
2387
2496
|
includeRetracted?: boolean;
|
|
@@ -2630,7 +2739,7 @@ type FilterOptions = {
|
|
|
2630
2739
|
/** Filter to records of this shape name (for example `Player`). */
|
|
2631
2740
|
shape?: string;
|
|
2632
2741
|
/** Filter to records of this kind: `shape`, `thing`, `assertion`, or `collection`. */
|
|
2633
|
-
kind?:
|
|
2742
|
+
kind?: CommitOperationKind;
|
|
2634
2743
|
/** Filter assertions whose `about` target wref matches the supplied value. */
|
|
2635
2744
|
about?: string;
|
|
2636
2745
|
/** Glob pattern matched against record names (for example `Player/*`). */
|
|
@@ -3483,8 +3592,12 @@ declare class WarmHubClient {
|
|
|
3483
3592
|
create: (input: SubscriptionCompatCreateInput) => Promise<SubscriptionInfo>;
|
|
3484
3593
|
/**
|
|
3485
3594
|
* Get one subscription by name.
|
|
3595
|
+
*
|
|
3596
|
+
* Repo-scoped subscriptions are addressed by `(orgName, repoName, name)`;
|
|
3597
|
+
* org-scoped subscriptions (`org.renamed`) omit `repoName` via the object
|
|
3598
|
+
* form: `get({ orgName, name })`.
|
|
3486
3599
|
*/
|
|
3487
|
-
get: (
|
|
3600
|
+
get: (...args: SubscriptionRefArgs) => Promise<SubscriptionInfo>;
|
|
3488
3601
|
/**
|
|
3489
3602
|
* Reveal the raw webhook URL(s) for a subscription.
|
|
3490
3603
|
*
|
|
@@ -3495,11 +3608,15 @@ declare class WarmHubClient {
|
|
|
3495
3608
|
* setup token) may reveal only the subscriptions it is scoped to — a
|
|
3496
3609
|
* stricter contract than the redacted `get`/`list`, which are unscoped.
|
|
3497
3610
|
*/
|
|
3498
|
-
reveal: (
|
|
3611
|
+
reveal: (...args: SubscriptionRefArgs) => Promise<SubscriptionRevealResult>;
|
|
3499
3612
|
/**
|
|
3500
|
-
* List subscriptions
|
|
3613
|
+
* List subscriptions in a scope.
|
|
3614
|
+
*
|
|
3615
|
+
* Pass `(orgName, repoName)` to list a repository's subscriptions, or omit
|
|
3616
|
+
* `repoName` — `list(orgName)` or `list({ orgName })` — to list the
|
|
3617
|
+
* org-scoped (`org.renamed`) subscriptions.
|
|
3501
3618
|
*/
|
|
3502
|
-
list: (
|
|
3619
|
+
list: (...args: SubscriptionListArgs) => Promise<SubscriptionList>;
|
|
3503
3620
|
/**
|
|
3504
3621
|
* Update an existing webhook subscription.
|
|
3505
3622
|
*
|
|
@@ -3508,32 +3625,43 @@ declare class WarmHubClient {
|
|
|
3508
3625
|
update: (input: SubscriptionCompatUpdateInput) => Promise<SubscriptionInfo>;
|
|
3509
3626
|
/**
|
|
3510
3627
|
* Pause a subscription.
|
|
3628
|
+
*
|
|
3629
|
+
* Omit `repoName` (object form) to pause an org-scoped subscription.
|
|
3511
3630
|
*/
|
|
3512
|
-
pause: (
|
|
3631
|
+
pause: (...args: SubscriptionRefArgs) => Promise<{
|
|
3513
3632
|
name: string;
|
|
3514
3633
|
active: boolean;
|
|
3515
3634
|
}>;
|
|
3516
3635
|
/**
|
|
3517
3636
|
* Resume a paused subscription.
|
|
3637
|
+
*
|
|
3638
|
+
* Omit `repoName` (object form) to resume an org-scoped subscription.
|
|
3518
3639
|
*/
|
|
3519
|
-
resume: (
|
|
3640
|
+
resume: (...args: SubscriptionRefArgs) => Promise<{
|
|
3520
3641
|
name: string;
|
|
3521
3642
|
active: boolean;
|
|
3522
3643
|
}>;
|
|
3523
3644
|
/**
|
|
3524
3645
|
* Delete a subscription.
|
|
3646
|
+
*
|
|
3647
|
+
* Omit `repoName` (object form) to delete an org-scoped subscription.
|
|
3525
3648
|
*/
|
|
3526
|
-
remove: (
|
|
3649
|
+
remove: (...args: SubscriptionRefArgs) => Promise<{
|
|
3527
3650
|
ok: true;
|
|
3528
3651
|
}>;
|
|
3529
3652
|
/**
|
|
3530
3653
|
* Bind a credential set to a subscription for outbound webhook authentication.
|
|
3654
|
+
*
|
|
3655
|
+
* Omit `repoName` (object form) to bind an org-scoped subscription to one of
|
|
3656
|
+
* the org's org-scoped credential sets.
|
|
3531
3657
|
*/
|
|
3532
|
-
bindCredentials: (
|
|
3658
|
+
bindCredentials: (...args: SubscriptionBindArgs) => Promise<SubscriptionBindCredentialsResult>;
|
|
3533
3659
|
/**
|
|
3534
3660
|
* Remove the credential set currently bound to a subscription.
|
|
3661
|
+
*
|
|
3662
|
+
* Omit `repoName` (object form) for an org-scoped subscription.
|
|
3535
3663
|
*/
|
|
3536
|
-
unbindCredentials: (
|
|
3664
|
+
unbindCredentials: (...args: SubscriptionUnbindArgs) => Promise<SubscriptionUnbindCredentialsResult>;
|
|
3537
3665
|
};
|
|
3538
3666
|
/**
|
|
3539
3667
|
* Low-level action lease, delivery, run, and notification primitives for subscription consumers.
|
|
@@ -3707,7 +3835,7 @@ declare class WarmHubClient {
|
|
|
3707
3835
|
}) => Promise<ThingGetManyResult>;
|
|
3708
3836
|
/**
|
|
3709
3837
|
* Batched lightweight per-thing change probe — returns
|
|
3710
|
-
* `{ wref, durableId, version, active,
|
|
3838
|
+
* `{ wref, durableId, version, active, revisedOn }` per wref with NO
|
|
3711
3839
|
* payload. Use it to check whether locally-cached copies are still fresh
|
|
3712
3840
|
* without pulling `data`: a value is stale if `durableId` differs (the wref
|
|
3713
3841
|
* now points to a different thing), `version`/`active` differ (the same
|
|
@@ -4182,4 +4310,4 @@ declare class WarmHubClient {
|
|
|
4182
4310
|
private watchRepoQuery;
|
|
4183
4311
|
}
|
|
4184
4312
|
|
|
4185
|
-
export { type AboutOptions, type AboutResult, type AccessResolveInput, type AccessResolveResult, type AccessTokenProvider, type ActionAttemptInfo, type ActionLeaseAcquire, type ActionLeaseOp, type ActionListNotificationsOptions, type ActionListRunsOptions, type ActionLiveFeed, type ActionLiveFeedOptions, type ActionNotificationInfo, type ActionRunInfo, type ActionRunStatsInfo, type ActionRunStatsOptions, type AddOp, type AddOperation, AllStreamOperationsFailedError, type Assertion, CLI_INSTALL_REPO_HEADER, CLI_SIGNATURE_HEADER, CLI_TIMESTAMP_HEADER, CONTENT_FIELD_LIMIT_ERROR, type CliCallSecrets, CliCallVerificationError, type CliCallVerificationFailureReason, type CollectionAbout, type CollectionTag, type ComponentInfo, type ComponentInstallResult, type ComponentList, type ComponentListOptions, type ComponentUninstallResult, type ComponentView, type CoreErrorKind, type CountOptions, type CountResult, type CredentialAuditEntry, type CredentialDeleteResult, type CredentialGrantResult, type CredentialInfo, type CredentialKeyMutationResult, type CredentialRevokeResult, type CredentialUngrantResult, type CurrentUserInfo, DEFAULT_API_URL, DEFAULT_STREAM_CHUNK_SIZE, type ErrorKind, type FilterOptions, type FilterResult, type FunctionLogMode, type GlobalSearchOptions, type GlobalSearchResult, type GlobalSearchResultItem, type HeadResult, type HistoryResult, type IndexedFieldEntry, type IndexedFieldsReport, type LiveHandle, type LiveRepoEvent, type LiveSubscriptionLogOptions, type LiveThingHeadOptions, type LiveThingHistoryOptions, type LiveWatchResult, MAX_CONTENT_FIELD_BYTES, MAX_STREAM_APPEND_OPERATION_COUNT, type Operation, OperationBuilder, type OperationBuilderClient, type OperationBuilderOp, type OperationBuilderOptions, type OperationSubmitResult, type OrgAccessResult, type OrgInfo, type OrgList, type OrgListMembersOptions, type OrgListOptions, type OrgMemberInfo, type OrgMemberList, type OrgRef, type OrgRole, type Page, type PageRequest, PartialStreamSubmissionError, type PingResult, type RefLink, type RefsOptions, type RefsResult, type RenameResult, type RepoAccessResult, type RepoConfigureStatsView, type RepoDescribeResult, type RepoInfo, type RepoList, type RepoListForCallerOptions, type RepoListOptions, type RepoListPageOptions, type RepoListPageResult, type RepoLocator, type RepoRecentInfo, type RepoRef, type RepoShapeInstanceCountsView, type RepoSort, type RepoStatsBatchResult, type RepoStatsView, type RepoWithStatsInfo, type RequestEvent, type ResolveWrefResult, type RetractOp, type RetractOperation, type RetryPolicyOptions, type ReviseOp, type ReviseOperation, SDK_VERSION, type SearchOptions, type SearchResult, type Shape, type ShapeChange, type ShapeCreateOptions, type ShapeFields, type ShapeGetOptions, type ShapeHistory, type ShapeHistoryOptions, type ShapeList, type ShapeListOptions, type ShapeRef, type ShapeRemove, type ShapeReviseOptions, type ShapeValidatorResult, type StreamAppendInput, type StreamAppendResult, type StreamContinuationState, type SubscriptionBindCredentialsResult, type SubscriptionCompatCreateInput, type SubscriptionCompatUpdateInput, type SubscriptionInfo, type SubscriptionList, type SubscriptionUnbindCredentialsResult, type SynthesizedRepoContent, type ThingDetail, type ThingGet, type ThingGetManyResult, type ThingGetOptions, type ThingGetWithLease, type ThingGraphOptions, type ThingGraphResult, type ThingGraphValue, type ThingHead, type ThingHeadOptions, type ThingHeadRequest, type ThingHeadVersionsResult, type ThingHistory, type ThingHistoryOptions, type ThingItem, type ThingMetadata, type TokenInfo, type TokenResult, type UndeclaredFieldsWarning, type ValidationDiagnostic, type ValidationResult, type VerifiedCliCall, WarmHubClient, type WarmHubClientOptions, WarmHubError, type WarmHubErrorDetails, type WherePredicate, type WhoamiInfo, type WhoamiScopeEntry, type WireScopeEntry, connectionErrorMessage, contentFieldLimitError, countStreamAppendResultStatuses, isConnectionError, isRetryable, isWarmHubError, normalizeWref, resolveFunctionLogMode, sanitizeErrorMessage, sdkVersionIsBelowMinimum, streamAppendResultStatus, submitOperationsViaStream, toWarmHubError, validateAgainstShape, verifyCliCall };
|
|
4313
|
+
export { type AboutOptions, type AboutResult, type AccessResolveInput, type AccessResolveResult, type AccessTokenProvider, type ActionAttemptInfo, type ActionLeaseAcquire, type ActionLeaseOp, type ActionListNotificationsOptions, type ActionListRunsOptions, type ActionLiveFeed, type ActionLiveFeedOptions, type ActionNotificationInfo, type ActionRunInfo, type ActionRunStatsInfo, type ActionRunStatsOptions, type AddOp, type AddOperation, AllStreamOperationsFailedError, type Assertion, CLI_INSTALL_REPO_HEADER, CLI_SIGNATURE_HEADER, CLI_TIMESTAMP_HEADER, CONTENT_FIELD_LIMIT_ERROR, type CliCallSecrets, CliCallVerificationError, type CliCallVerificationFailureReason, type CollectionAbout, type CollectionTag, type ComponentInfo, type ComponentInstallResult, type ComponentList, type ComponentListOptions, type ComponentUninstallResult, type ComponentView, type CoreErrorKind, type CountOptions, type CountResult, type CredentialAuditEntry, type CredentialDeleteResult, type CredentialGrantResult, type CredentialInfo, type CredentialKeyMutationResult, type CredentialRevokeResult, type CredentialUngrantResult, type CurrentUserInfo, DEFAULT_API_URL, DEFAULT_STREAM_CHUNK_SIZE, type ErrorKind, type FilterOptions, type FilterResult, type FunctionLogMode, type GlobalSearchOptions, type GlobalSearchResult, type GlobalSearchResultItem, type HeadResult, type HistoryResult, type IndexedFieldEntry, type IndexedFieldsReport, type LiveHandle, type LiveRepoEvent, type LiveSubscriptionLogOptions, type LiveThingHeadOptions, type LiveThingHistoryOptions, type LiveWatchResult, MAX_CONTENT_FIELD_BYTES, MAX_STREAM_APPEND_OPERATION_COUNT, type Operation, OperationBuilder, type OperationBuilderClient, type OperationBuilderOp, type OperationBuilderOptions, type OperationSubmitResult, type OrgAccessResult, type OrgInfo, type OrgList, type OrgListMembersOptions, type OrgListOptions, type OrgMemberInfo, type OrgMemberList, type OrgRef, type OrgRole, type Page, type PageRequest, PartialStreamSubmissionError, type PingResult, type RefLink, type RefsOptions, type RefsResult, type RenameOperation, type RenameResult, type RepoAccessResult, type RepoConfigureStatsView, type RepoDescribeResult, type RepoInfo, type RepoList, type RepoListForCallerOptions, type RepoListOptions, type RepoListPageOptions, type RepoListPageResult, type RepoLocator, type RepoRecentInfo, type RepoRef, type RepoShapeInstanceCountsView, type RepoSort, type RepoStatsBatchResult, type RepoStatsView, type RepoWithStatsInfo, type RequestEvent, type ResolveWrefResult, type RetractOp, type RetractOperation, type RetryPolicyOptions, type ReviseOp, type ReviseOperation, SDK_VERSION, type SearchOptions, type SearchResult, type Shape, type ShapeChange, type ShapeCreateOptions, type ShapeFields, type ShapeGetOptions, type ShapeHistory, type ShapeHistoryOptions, type ShapeList, type ShapeListOptions, type ShapeRef, type ShapeRemove, type ShapeReviseOptions, type ShapeValidatorResult, type StreamAppendInput, type StreamAppendResult, type StreamContinuationState, type SubscriptionBindCredentialsResult, type SubscriptionCompatCreateInput, type SubscriptionCompatUpdateInput, type SubscriptionInfo, type SubscriptionList, type SubscriptionUnbindCredentialsResult, type SynthesizedRepoContent, type ThingDetail, type ThingGet, type ThingGetManyResult, type ThingGetOptions, type ThingGetWithLease, type ThingGraphOptions, type ThingGraphResult, type ThingGraphValue, type ThingHead, type ThingHeadOptions, type ThingHeadRequest, type ThingHeadVersionsResult, type ThingHistory, type ThingHistoryOptions, type ThingItem, type ThingMetadata, type TokenInfo, type TokenResult, type UndeclaredFieldsWarning, type ValidationDiagnostic, type ValidationResult, type VerifiedCliCall, WarmHubClient, type WarmHubClientOptions, WarmHubError, type WarmHubErrorDetails, type WherePredicate, type WhoamiInfo, type WhoamiScopeEntry, type WireScopeEntry, connectionErrorMessage, contentFieldLimitError, countStreamAppendResultStatuses, isConnectionError, isRetryable, isWarmHubError, normalizeWref, resolveFunctionLogMode, sanitizeErrorMessage, sdkVersionIsBelowMinimum, streamAppendResultStatus, submitOperationsViaStream, toWarmHubError, validateAgainstShape, verifyCliCall };
|