@warmhub/sdk-ts 0.128.0 → 0.129.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/CHANGELOG.md +8 -0
- package/changelog.json +10 -0
- package/dist/checkpoint.js +1 -1
- package/dist/checkpoint.js.map +1 -1
- package/dist/{chunk-NOX7T26R.js → chunk-UCK4ZIVG.js} +16 -16
- package/dist/chunk-UCK4ZIVG.js.map +1 -0
- package/dist/chunk-ZMQZTPR4.js +10 -0
- package/dist/chunk-ZMQZTPR4.js.map +1 -0
- package/dist/index.d.ts +38 -30
- package/dist/index.js +1 -1
- package/dist/react.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-NOX7T26R.js.map +0 -1
- package/dist/chunk-YWUAJWBG.js +0 -10
- package/dist/chunk-YWUAJWBG.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -274,13 +274,14 @@ type CommitValidateInput$1 = {
|
|
|
274
274
|
kind: 'thing';
|
|
275
275
|
name: string;
|
|
276
276
|
data: unknown;
|
|
277
|
+
about?: never;
|
|
277
278
|
affirmedTargets?: never;
|
|
278
279
|
skipExisting?: boolean;
|
|
279
280
|
} | {
|
|
280
281
|
operation: 'add';
|
|
281
282
|
kind: 'assertion';
|
|
282
283
|
name: string;
|
|
283
|
-
about
|
|
284
|
+
about?: string;
|
|
284
285
|
data: unknown;
|
|
285
286
|
affirmedTargets?: Array<string>;
|
|
286
287
|
skipExisting?: boolean;
|
|
@@ -337,7 +338,7 @@ type CommitValidateInput$1 = {
|
|
|
337
338
|
leaseId?: string;
|
|
338
339
|
} | {
|
|
339
340
|
operation: 'reaffirm';
|
|
340
|
-
kind?: 'assertion';
|
|
341
|
+
kind?: 'assertion' | 'thing';
|
|
341
342
|
name: string;
|
|
342
343
|
add?: Array<string>;
|
|
343
344
|
remove?: Array<string>;
|
|
@@ -1194,7 +1195,7 @@ type ComponentDetail = {
|
|
|
1194
1195
|
ownedThings: Array<{
|
|
1195
1196
|
wref: string;
|
|
1196
1197
|
name: string;
|
|
1197
|
-
kind: 'thing' | '
|
|
1198
|
+
kind: 'thing' | 'shape';
|
|
1198
1199
|
shapeName?: string;
|
|
1199
1200
|
declaredShapes?: Array<string>;
|
|
1200
1201
|
validatedShapes?: Array<string>;
|
|
@@ -1938,13 +1939,14 @@ type StreamAppendInput$1 = {
|
|
|
1938
1939
|
kind: 'thing';
|
|
1939
1940
|
name: string;
|
|
1940
1941
|
data: unknown;
|
|
1942
|
+
about?: never;
|
|
1941
1943
|
affirmedTargets?: never;
|
|
1942
1944
|
skipExisting?: boolean;
|
|
1943
1945
|
} | {
|
|
1944
1946
|
operation: 'add';
|
|
1945
1947
|
kind: 'assertion';
|
|
1946
1948
|
name: string;
|
|
1947
|
-
about
|
|
1949
|
+
about?: string;
|
|
1948
1950
|
data: unknown;
|
|
1949
1951
|
affirmedTargets?: Array<string>;
|
|
1950
1952
|
skipExisting?: boolean;
|
|
@@ -2001,7 +2003,7 @@ type StreamAppendInput$1 = {
|
|
|
2001
2003
|
leaseId?: string;
|
|
2002
2004
|
} | {
|
|
2003
2005
|
operation: 'reaffirm';
|
|
2004
|
-
kind?: 'assertion';
|
|
2006
|
+
kind?: 'assertion' | 'thing';
|
|
2005
2007
|
name: string;
|
|
2006
2008
|
add?: Array<string>;
|
|
2007
2009
|
remove?: Array<string>;
|
|
@@ -5371,7 +5373,7 @@ type ShapeListResult = {
|
|
|
5371
5373
|
type ThingHistoryResult = {
|
|
5372
5374
|
thing?: {
|
|
5373
5375
|
wref: string;
|
|
5374
|
-
kind: '
|
|
5376
|
+
kind: 'thing' | 'shape';
|
|
5375
5377
|
shapeName?: string;
|
|
5376
5378
|
};
|
|
5377
5379
|
versions: Array<{
|
|
@@ -5414,7 +5416,7 @@ type ThingGetManyResult$1 = {
|
|
|
5414
5416
|
wref: string;
|
|
5415
5417
|
pinnedWref?: string;
|
|
5416
5418
|
name: string;
|
|
5417
|
-
kind: 'thing' | '
|
|
5419
|
+
kind: 'thing' | 'shape';
|
|
5418
5420
|
shape?: string;
|
|
5419
5421
|
shapeName?: string;
|
|
5420
5422
|
validatedShape?: string;
|
|
@@ -5773,7 +5775,7 @@ type ViewEvaluateResult$1 = {
|
|
|
5773
5775
|
items: Array<{
|
|
5774
5776
|
wref: string;
|
|
5775
5777
|
name: string;
|
|
5776
|
-
kind: 'thing' | '
|
|
5778
|
+
kind: 'thing' | 'shape';
|
|
5777
5779
|
shapeName?: string;
|
|
5778
5780
|
declaredShapes?: Array<string>;
|
|
5779
5781
|
validatedShapes?: Array<string>;
|
|
@@ -5935,6 +5937,9 @@ declare const MAX_WREFS_PER_THING_VERSION = 10000;
|
|
|
5935
5937
|
|
|
5936
5938
|
declare const COMMIT_OPERATION_KINDS: readonly ["shape", "thing", "assertion", "collection"];
|
|
5937
5939
|
type CommitOperationKind = (typeof COMMIT_OPERATION_KINDS)[number];
|
|
5940
|
+
/** What a read may be ASKED for: a read kind, or one of the legacy aliases. */
|
|
5941
|
+
declare const READ_KIND_FILTERS: readonly ["thing", "shape", "collection", "assertion"];
|
|
5942
|
+
type ReadKindFilter = (typeof READ_KIND_FILTERS)[number];
|
|
5938
5943
|
|
|
5939
5944
|
/**
|
|
5940
5945
|
* Canonical request signing for component CLI dispatch.
|
|
@@ -6026,24 +6031,16 @@ declare const repositoryExportRowSchema: z.ZodUnion<readonly [z.ZodDiscriminated
|
|
|
6026
6031
|
shape: z.ZodString;
|
|
6027
6032
|
memberCount: z.ZodNumber;
|
|
6028
6033
|
}, z.core.$strict>>>;
|
|
6029
|
-
|
|
6030
|
-
data: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
|
|
6031
|
-
wref: z.ZodString;
|
|
6032
|
-
durableId: z.ZodString;
|
|
6033
|
-
version: z.ZodNumber;
|
|
6034
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
6035
|
-
kind: z.ZodLiteral<"assertion">;
|
|
6036
|
-
shapes: z.ZodArray<z.ZodString>;
|
|
6037
|
-
about: z.ZodObject<{
|
|
6034
|
+
about: z.ZodOptional<z.ZodObject<{
|
|
6038
6035
|
wref: z.ZodString;
|
|
6039
6036
|
v: z.ZodOptional<z.ZodNumber>;
|
|
6040
6037
|
durableId: z.ZodString;
|
|
6041
|
-
}, z.core.$strict
|
|
6042
|
-
affirmed: z.ZodArray<z.ZodObject<{
|
|
6038
|
+
}, z.core.$strict>>;
|
|
6039
|
+
affirmed: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
6043
6040
|
wref: z.ZodString;
|
|
6044
6041
|
v: z.ZodOptional<z.ZodNumber>;
|
|
6045
6042
|
durableId: z.ZodString;
|
|
6046
|
-
}, z.core.$strict
|
|
6043
|
+
}, z.core.$strict>>>;
|
|
6047
6044
|
active: z.ZodLiteral<true>;
|
|
6048
6045
|
data: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
|
|
6049
6046
|
wref: z.ZodString;
|
|
@@ -6053,7 +6050,6 @@ declare const repositoryExportRowSchema: z.ZodUnion<readonly [z.ZodDiscriminated
|
|
|
6053
6050
|
kind: z.ZodEnum<{
|
|
6054
6051
|
shape: "shape";
|
|
6055
6052
|
thing: "thing";
|
|
6056
|
-
assertion: "assertion";
|
|
6057
6053
|
}>;
|
|
6058
6054
|
active: z.ZodLiteral<false>;
|
|
6059
6055
|
wref: z.ZodString;
|
|
@@ -6062,7 +6058,7 @@ declare const repositoryExportRowSchema: z.ZodUnion<readonly [z.ZodDiscriminated
|
|
|
6062
6058
|
}, z.core.$strict>]>;
|
|
6063
6059
|
declare const repositoryExportHeaderSchema: z.ZodObject<{
|
|
6064
6060
|
kind: z.ZodLiteral<"header">;
|
|
6065
|
-
formatVersion: z.ZodLiteral<
|
|
6061
|
+
formatVersion: z.ZodLiteral<5>;
|
|
6066
6062
|
repo: z.ZodString;
|
|
6067
6063
|
mode: z.ZodEnum<{
|
|
6068
6064
|
ops: "ops";
|
|
@@ -6362,7 +6358,7 @@ interface ReaffirmOperation {
|
|
|
6362
6358
|
/**
|
|
6363
6359
|
* Optional kind safety hint; reaffirm applies only to assertions.
|
|
6364
6360
|
*/
|
|
6365
|
-
kind?: 'assertion';
|
|
6361
|
+
kind?: 'assertion' | 'thing';
|
|
6366
6362
|
/**
|
|
6367
6363
|
* Pinned target wrefs (`Shape/name@vN`) to affirm. A target already in the
|
|
6368
6364
|
* set is reported as `ignored`, not an error.
|
|
@@ -7447,7 +7443,7 @@ interface ReaffirmOp {
|
|
|
7447
7443
|
/**
|
|
7448
7444
|
* Optional kind safety hint; reaffirm applies only to assertions.
|
|
7449
7445
|
*/
|
|
7450
|
-
readonly kind?: 'assertion';
|
|
7446
|
+
readonly kind?: 'assertion' | 'thing';
|
|
7451
7447
|
/**
|
|
7452
7448
|
* Pinned target wrefs (`Shape/name@vN`) to affirm.
|
|
7453
7449
|
*/
|
|
@@ -8296,6 +8292,18 @@ type ShapeReviseOptions = {
|
|
|
8296
8292
|
/** Replace the composition list; omit to preserve it, or pass [] to clear it. */
|
|
8297
8293
|
composes?: string[];
|
|
8298
8294
|
};
|
|
8295
|
+
type ShapeReviseArgs = [
|
|
8296
|
+
orgName: string,
|
|
8297
|
+
repoName: string,
|
|
8298
|
+
shapeName: string,
|
|
8299
|
+
opts: ShapeReviseOptions
|
|
8300
|
+
] | [
|
|
8301
|
+
orgName: string,
|
|
8302
|
+
repoName: string,
|
|
8303
|
+
shapeName: string,
|
|
8304
|
+
newFields: Record<string, unknown> | undefined,
|
|
8305
|
+
opts: ShapeReviseOptions
|
|
8306
|
+
];
|
|
8299
8307
|
/** @internal */
|
|
8300
8308
|
type ShapeRemoveOptions = {
|
|
8301
8309
|
eventRequestId: string;
|
|
@@ -9114,12 +9122,12 @@ type FilterOptions = {
|
|
|
9114
9122
|
/** Include the full certified Shape closure on each returned item. */
|
|
9115
9123
|
includeValidatedShapes?: boolean;
|
|
9116
9124
|
/**
|
|
9117
|
-
* Filter to records of this kind
|
|
9118
|
-
* `collection
|
|
9119
|
-
*
|
|
9120
|
-
*
|
|
9125
|
+
* Filter to records of this kind. Results project only `shape` or `thing`;
|
|
9126
|
+
* `assertion` and `collection` remain input aliases during their retirement
|
|
9127
|
+
* windows. Assertions carry `aboutWref` + `affirmedWrefs`; collections carry
|
|
9128
|
+
* `collections`.
|
|
9121
9129
|
*/
|
|
9122
|
-
kind?:
|
|
9130
|
+
kind?: ReadKindFilter;
|
|
9123
9131
|
/** Filter assertions whose `about` target wref matches the supplied value. */
|
|
9124
9132
|
about?: string;
|
|
9125
9133
|
/**
|
|
@@ -10324,7 +10332,7 @@ declare class WarmHubClient {
|
|
|
10324
10332
|
* @param opts.eventRequestId Caller-owned UUID retained across ambiguous retries.
|
|
10325
10333
|
* @param opts.description Optional human-readable description for the revised shape.
|
|
10326
10334
|
*/
|
|
10327
|
-
revise: (
|
|
10335
|
+
revise: (...args: ShapeReviseArgs) => Promise<ShapeChange>;
|
|
10328
10336
|
/**
|
|
10329
10337
|
* Retract a shape definition.
|
|
10330
10338
|
*
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{t as AllStreamOperationsFailedError,A as CliCallVerificationError,E as DEFAULT_API_URL,q as DEFAULT_STREAM_CHUNK_SIZE,b as MAX_COMMIT_VALIDATION_ENCODED_BYTES,a as MAX_COMMIT_VALIDATION_OPERATIONS,r as MAX_STREAM_APPEND_OPERATION_COUNT,C as OperationBuilder,s as PartialStreamSubmissionError,i as RepositoryExportError,j as RepositoryExportSession,z as SDK_VERSION,n as StreamSubmissionAggregator,y as StreamingSubmissionOutcomeUnknownError,O as WarmHubClient,H as WarmHubError,h as applyRepositoryExportDelta,f as collectDurableTokens,e as commitValidateRequestBodyBytes,M as connectionErrorMessage,v as countStreamAppendResultStatuses,c as createCommitValidateInput,p as createOperationEventRequestId,o as createOperationEventSubmissionId,k as createRepositoryExportSession,d as encodeCommitValidateRequestBody,g as getResponseDecorations,L as isConnectionError,w as isDefiniteStreamAppendRejection,K as isRetryable,J as isWarmHubError,D as normalizeWref,l as readRepositoryExportStream,F as resolveFunctionLogMode,m as restoreRepositoryExportSession,G as sanitizeErrorMessage,N as sdkVersionIsBelowMinimum,u as streamAppendResultStatus,x as submitOperationsViaStream,I as toWarmHubError,B as verifyCliCall}from'./chunk-
|
|
1
|
+
export{t as AllStreamOperationsFailedError,A as CliCallVerificationError,E as DEFAULT_API_URL,q as DEFAULT_STREAM_CHUNK_SIZE,b as MAX_COMMIT_VALIDATION_ENCODED_BYTES,a as MAX_COMMIT_VALIDATION_OPERATIONS,r as MAX_STREAM_APPEND_OPERATION_COUNT,C as OperationBuilder,s as PartialStreamSubmissionError,i as RepositoryExportError,j as RepositoryExportSession,z as SDK_VERSION,n as StreamSubmissionAggregator,y as StreamingSubmissionOutcomeUnknownError,O as WarmHubClient,H as WarmHubError,h as applyRepositoryExportDelta,f as collectDurableTokens,e as commitValidateRequestBodyBytes,M as connectionErrorMessage,v as countStreamAppendResultStatuses,c as createCommitValidateInput,p as createOperationEventRequestId,o as createOperationEventSubmissionId,k as createRepositoryExportSession,d as encodeCommitValidateRequestBody,g as getResponseDecorations,L as isConnectionError,w as isDefiniteStreamAppendRejection,K as isRetryable,J as isWarmHubError,D as normalizeWref,l as readRepositoryExportStream,F as resolveFunctionLogMode,m as restoreRepositoryExportSession,G as sanitizeErrorMessage,N as sdkVersionIsBelowMinimum,u as streamAppendResultStatus,x as submitOperationsViaStream,I as toWarmHubError,B as verifyCliCall}from'./chunk-ZMQZTPR4.js';export{t as CLI_INSTALL_REPO_HEADER,u as CLI_SIGNATURE_HEADER,v as CLI_TIMESTAMP_HEADER,d as CONTENT_FIELD_LIMIT_ERROR,c as MAX_CONTENT_FIELD_BYTES,o as MAX_WREFS_PER_THING_VERSION,C as ORG_AUTH_SCOPES,y as REPO_AUTH_SCOPES,e as contentFieldLimitError,D as isKnownOrgAuthScope,z as isKnownRepoAuthScope,E as operationEventStreamRequestId,$ as validateAgainstShape}from'./chunk-UCK4ZIVG.js';//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/react.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {O}from'./chunk-
|
|
1
|
+
import {O}from'./chunk-ZMQZTPR4.js';export{E as DEFAULT_API_URL,z as SDK_VERSION,O as WarmHubClient,H as WarmHubError,I as toWarmHubError}from'./chunk-ZMQZTPR4.js';import'./chunk-UCK4ZIVG.js';import {createContext,useMemo,useState,useEffect,useContext}from'react';import {jsx}from'react/jsx-runtime';var p=createContext(null),f=createContext({isAuthenticated:false,isLoading:true});function P({apiUrl:e,children:t,auth:o,client:s,decorateResponses:r}){let n=s?.name,u=s?.version,i=o.getAccessToken,a=useMemo(()=>new O({apiUrl:e,accessToken:async()=>await i()??void 0,client:{name:n,version:u},decorateResponses:r}),[e,n,u,r,i]);return jsx(p.Provider,{value:a,children:jsx(g,{auth:o,client:a,children:t})})}function g({auth:e,client:t,children:o}){let[s,r]=useState(null),n=e.isAuthenticated&&s===t;useEffect(()=>{if(!e.isAuthenticated){r(null);return}let i=false;return t.auth.sync().then(()=>{i||r(t);}).catch(a=>{console.error("auth.sync failed:",a),i||r(t);}),()=>{i=true;}},[e.isAuthenticated,t]);let u=useMemo(()=>({isAuthenticated:e.isAuthenticated&&n,isLoading:e.isLoading||e.isAuthenticated&&!n}),[e.isAuthenticated,e.isLoading,n]);return e.isLoading||e.isAuthenticated&&!n?null:jsx(f.Provider,{value:u,children:o})}function v(){let e=useContext(p);if(!e)throw new Error("useWarmHubClient must be used within a WarmHubProvider");return e}function S(){return useContext(f)}export{P as WarmHubProvider,S as useWarmHubAuth,v as useWarmHubClient};//# sourceMappingURL=react.js.map
|
|
2
2
|
//# sourceMappingURL=react.js.map
|
package/package.json
CHANGED