@warmhub/sdk-ts 0.93.0 → 0.94.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/checkpoint.js +1 -1
- package/dist/chunk-NCX3V2MO.js +8 -0
- package/dist/{chunk-CJGZJYNN.js.map → chunk-NCX3V2MO.js.map} +1 -1
- package/dist/{chunk-CC45V5YE.js → chunk-V5UNTMIL.js} +24 -24
- package/dist/chunk-V5UNTMIL.js.map +1 -0
- package/dist/index.d.ts +43 -22
- package/dist/index.js +1 -1
- package/dist/react.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-CC45V5YE.js.map +0 -1
- package/dist/chunk-CJGZJYNN.js +0 -8
package/dist/index.d.ts
CHANGED
|
@@ -4753,6 +4753,7 @@ type ThingHeadVersionsResult$1 = {
|
|
|
4753
4753
|
requested: number;
|
|
4754
4754
|
items: Array<{
|
|
4755
4755
|
wref: string;
|
|
4756
|
+
canonicalWref: string;
|
|
4756
4757
|
durableId: string;
|
|
4757
4758
|
version: number;
|
|
4758
4759
|
active: boolean;
|
|
@@ -5310,7 +5311,33 @@ declare const ORG_SCOPED_EVENT_TYPES: readonly ["org.renamed", "org.member_added
|
|
|
5310
5311
|
type OrgScopedEventType = (typeof ORG_SCOPED_EVENT_TYPES)[number];
|
|
5311
5312
|
|
|
5312
5313
|
/**
|
|
5313
|
-
*
|
|
5314
|
+
* Warning details for input fields that no shape in the effective set declares.
|
|
5315
|
+
* @see https://docs.warmhub.ai/sdk-reference/type-aliases/undeclaredfieldswarning/
|
|
5316
|
+
*/
|
|
5317
|
+
type UndeclaredFieldsWarning = {
|
|
5318
|
+
undeclaredFields: string[];
|
|
5319
|
+
undeclaredFieldsTruncated?: true;
|
|
5320
|
+
totalUndeclared?: number;
|
|
5321
|
+
};
|
|
5322
|
+
|
|
5323
|
+
/**
|
|
5324
|
+
* Discriminated result returned when input is validated against shape fields.
|
|
5325
|
+
* @see https://docs.warmhub.ai/sdk-reference/type-aliases/shapevalidatorresult/
|
|
5326
|
+
*/
|
|
5327
|
+
type ShapeValidatorResult = {
|
|
5328
|
+
valid: true;
|
|
5329
|
+
warnings?: UndeclaredFieldsWarning;
|
|
5330
|
+
} | {
|
|
5331
|
+
valid: false;
|
|
5332
|
+
errors: string[];
|
|
5333
|
+
warnings?: UndeclaredFieldsWarning;
|
|
5334
|
+
};
|
|
5335
|
+
/**
|
|
5336
|
+
* Validate a data payload against a single shape's field definitions.
|
|
5337
|
+
*
|
|
5338
|
+
* A single shape is an effective set of one, so this is
|
|
5339
|
+
* {@link compileShapesValidator} with a one-element set — same checks, same
|
|
5340
|
+
* order, same messages.
|
|
5314
5341
|
*
|
|
5315
5342
|
* Shape field types:
|
|
5316
5343
|
* - "number", "string", "boolean": primitive types
|
|
@@ -5346,27 +5373,6 @@ type OrgScopedEventType = (typeof ORG_SCOPED_EVENT_TYPES)[number];
|
|
|
5346
5373
|
* @see https://docs.warmhub.ai/sdk-reference/functions/validateagainstshape/
|
|
5347
5374
|
*/
|
|
5348
5375
|
declare function validateAgainstShape(data: Record<string, unknown>, shapeFields: Record<string, unknown>): ShapeValidatorResult;
|
|
5349
|
-
/**
|
|
5350
|
-
* Warning details for input fields that the shape does not declare.
|
|
5351
|
-
* @see https://docs.warmhub.ai/sdk-reference/type-aliases/undeclaredfieldswarning/
|
|
5352
|
-
*/
|
|
5353
|
-
type UndeclaredFieldsWarning = {
|
|
5354
|
-
undeclaredFields: string[];
|
|
5355
|
-
undeclaredFieldsTruncated?: true;
|
|
5356
|
-
totalUndeclared?: number;
|
|
5357
|
-
};
|
|
5358
|
-
/**
|
|
5359
|
-
* Discriminated result returned when input is validated against shape fields.
|
|
5360
|
-
* @see https://docs.warmhub.ai/sdk-reference/type-aliases/shapevalidatorresult/
|
|
5361
|
-
*/
|
|
5362
|
-
type ShapeValidatorResult = {
|
|
5363
|
-
valid: true;
|
|
5364
|
-
warnings?: UndeclaredFieldsWarning;
|
|
5365
|
-
} | {
|
|
5366
|
-
valid: false;
|
|
5367
|
-
errors: string[];
|
|
5368
|
-
warnings?: UndeclaredFieldsWarning;
|
|
5369
|
-
};
|
|
5370
5376
|
|
|
5371
5377
|
/**
|
|
5372
5378
|
* Hardcoded meta-schema for validating shape definitions.
|
|
@@ -7485,8 +7491,23 @@ type ThingDetail = {
|
|
|
7485
7491
|
pinnedWref?: string;
|
|
7486
7492
|
name: string;
|
|
7487
7493
|
kind: string;
|
|
7494
|
+
/**
|
|
7495
|
+
* @deprecated Legacy alias of `shapeName` from the pre-Postgres API
|
|
7496
|
+
* layering — the two are identical for every thing. Read `shapeName`
|
|
7497
|
+
* instead. This field is retired together with the other single-shape read
|
|
7498
|
+
* fields when the multi-shape read arrays land (the multi-shape program's
|
|
7499
|
+
* write-format change).
|
|
7500
|
+
*/
|
|
7488
7501
|
shape?: string;
|
|
7502
|
+
/** Canonical unversioned shape name (e.g. `"Game"`). */
|
|
7489
7503
|
shapeName?: string;
|
|
7504
|
+
/**
|
|
7505
|
+
* Version-pinned shape wref (e.g. `"Game@v3"`). Naming caveat: despite the
|
|
7506
|
+
* name, this is synthesized from the shape's *current* version at read
|
|
7507
|
+
* time — exact validation provenance is not stored today. The multi-shape
|
|
7508
|
+
* program's certificate records restore captured provenance, after which
|
|
7509
|
+
* this is served from the certificate rather than synthesized.
|
|
7510
|
+
*/
|
|
7490
7511
|
validatedShape?: string;
|
|
7491
7512
|
version: number;
|
|
7492
7513
|
active: boolean;
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{m as AllStreamOperationsFailedError,s as CliCallVerificationError,w as DEFAULT_API_URL,j as DEFAULT_STREAM_CHUNK_SIZE,b as MAX_COMMIT_VALIDATION_ENCODED_BYTES,a as MAX_COMMIT_VALIDATION_OPERATIONS,k as MAX_STREAM_APPEND_OPERATION_COUNT,u as OperationBuilder,l as PartialStreamSubmissionError,r as SDK_VERSION,f as StreamSubmissionAggregator,G as WarmHubClient,z as WarmHubError,e as commitValidateRequestBodyBytes,E as connectionErrorMessage,o as countStreamAppendResultStatuses,c as createCommitValidateInput,h as createOperationEventRequestId,g as createOperationEventSubmissionId,d as encodeCommitValidateRequestBody,D as isConnectionError,p as isDefiniteStreamAppendRejection,C as isRetryable,B as isWarmHubError,v as normalizeWref,i as operationEventStreamRequestId,x as resolveFunctionLogMode,y as sanitizeErrorMessage,F as sdkVersionIsBelowMinimum,n as streamAppendResultStatus,q as submitOperationsViaStream,A as toWarmHubError,t as verifyCliCall}from'./chunk-
|
|
1
|
+
export{m as AllStreamOperationsFailedError,s as CliCallVerificationError,w as DEFAULT_API_URL,j as DEFAULT_STREAM_CHUNK_SIZE,b as MAX_COMMIT_VALIDATION_ENCODED_BYTES,a as MAX_COMMIT_VALIDATION_OPERATIONS,k as MAX_STREAM_APPEND_OPERATION_COUNT,u as OperationBuilder,l as PartialStreamSubmissionError,r as SDK_VERSION,f as StreamSubmissionAggregator,G as WarmHubClient,z as WarmHubError,e as commitValidateRequestBodyBytes,E as connectionErrorMessage,o as countStreamAppendResultStatuses,c as createCommitValidateInput,h as createOperationEventRequestId,g as createOperationEventSubmissionId,d as encodeCommitValidateRequestBody,D as isConnectionError,p as isDefiniteStreamAppendRejection,C as isRetryable,B as isWarmHubError,v as normalizeWref,i as operationEventStreamRequestId,x as resolveFunctionLogMode,y as sanitizeErrorMessage,F as sdkVersionIsBelowMinimum,n as streamAppendResultStatus,q as submitOperationsViaStream,A as toWarmHubError,t as verifyCliCall}from'./chunk-NCX3V2MO.js';export{m as CLI_INSTALL_REPO_HEADER,n as CLI_SIGNATURE_HEADER,o as CLI_TIMESTAMP_HEADER,w as CONTENT_FIELD_LIMIT_ERROR,v as MAX_CONTENT_FIELD_BYTES,y as ORG_AUTH_SCOPES,r as REPO_AUTH_SCOPES,x as contentFieldLimitError,z as isKnownOrgAuthScope,s as isKnownRepoAuthScope,O as validateAgainstShape}from'./chunk-V5UNTMIL.js';//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/react.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {G}from'./chunk-
|
|
1
|
+
import {G}from'./chunk-NCX3V2MO.js';export{w as DEFAULT_API_URL,r as SDK_VERSION,G as WarmHubClient,z as WarmHubError,A as toWarmHubError}from'./chunk-NCX3V2MO.js';import'./chunk-V5UNTMIL.js';import {createContext,useMemo,useState,useEffect,useContext}from'react';import {jsx}from'react/jsx-runtime';var b=createContext(null),p=createContext({isAuthenticated:false,isLoading:true});function P({apiUrl:e,children:t,auth:i,client:o}){let r=o?.name,n=o?.version,s=useMemo(()=>new G({apiUrl:e,accessToken:async()=>await i.getAccessToken()??void 0,client:{name:r,version:n}}),[e,i.getAccessToken,r,n]);return jsx(b.Provider,{value:s,children:jsx(g,{auth:i,client:s,children:t})})}function g({auth:e,client:t,children:i}){let[o,r]=useState(null),n=e.isAuthenticated&&o===t;useEffect(()=>{if(!e.isAuthenticated){r(null);return}let u=false;return t.auth.sync().then(()=>{u||r(t);}).catch(f=>{console.error("auth.sync failed:",f),u||r(t);}),()=>{u=true;}},[e.isAuthenticated,t]);let s=useMemo(()=>({isAuthenticated:e.isAuthenticated&&n,isLoading:e.isLoading||e.isAuthenticated&&!n}),[e.isAuthenticated,e.isLoading,n]);return e.isLoading||e.isAuthenticated&&!n?null:jsx(p.Provider,{value:s,children:i})}function v(){let e=useContext(b);if(!e)throw new Error("useWarmHubClient must be used within a WarmHubProvider");return e}function S(){return useContext(p)}export{P as WarmHubProvider,S as useWarmHubAuth,v as useWarmHubClient};//# sourceMappingURL=react.js.map
|
|
2
2
|
//# sourceMappingURL=react.js.map
|
package/package.json
CHANGED