@warmhub/sdk-ts 0.162.0 → 0.163.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/CHANGELOG.md +12 -0
- package/README.md +5 -5
- package/changelog.json +10 -0
- package/dist/checkpoint.d.ts +101 -29
- package/dist/checkpoint.js +1 -1
- package/dist/checkpoint.js.map +1 -1
- package/dist/chunk-C2brwOhe.js +37 -0
- package/dist/chunk-C2brwOhe.js.map +1 -0
- package/dist/chunk-DvEqOqwB.js +2 -0
- package/dist/chunk-DvEqOqwB.js.map +1 -0
- package/dist/index.d.ts +10472 -10198
- package/dist/index.js +1 -2
- package/dist/react.d.ts +39 -35
- package/dist/react.js +1 -1
- package/dist/react.js.map +1 -1
- package/package.json +6 -7
- package/dist/chunk-BL6W7226.js +0 -34
- package/dist/chunk-BL6W7226.js.map +0 -1
- package/dist/chunk-XUGC6JZH.js +0 -10
- package/dist/chunk-XUGC6JZH.js.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import{$ as e,A as t,B as n,C as r,Ct as i,D as a,Dt as o,E as s,Et as c,F as l,G as u,H as d,I as f,J as p,K as m,L as h,M as g,N as _,O as v,Ot as y,P as b,Q as x,R as S,S as C,St as w,T,Tt as E,U as D,V as O,W as k,X as A,Y as j,Z as M,_ as N,_t as P,a as F,at as I,b as L,bt as R,c as z,ct as B,d as V,dt as H,et as U,f as W,ft as G,g as K,gt as q,h as J,ht as Y,i as X,it as Z,j as Q,k as $,l as ee,lt as te,m as ne,mt as re,n as ie,nt as ae,o as oe,ot as se,p as ce,pt as le,q as ue,r as de,rt as fe,s as pe,st as me,t as he,tt as ge,u as _e,ut as ve,v as ye,vt as be,w as xe,wt as Se,x as Ce,xt as we,y as Te,yt as Ee,z as De}from"./chunk-C2brwOhe.js";import{f as Oe,s as ke}from"./chunk-DvEqOqwB.js";export{l as AllStreamOperationsFailedError,ke as CHECKPOINT_CONTENT_TYPES,w as CLI_INSTALL_REPO_HEADER,i as CLI_SIGNATURE_HEADER,Se as CLI_TIMESTAMP_HEADER,be as COMPONENT_INSTALL_RESULT_STATES,re as COMPONENT_SUMMARY_STATES,c as CONTENT_FIELD_LIMIT_ERROR,G as CREDENTIAL_SCOPES,Te as CliCallVerificationError,he as DEFAULT_API_URL,f as DEFAULT_STREAM_CHUNK_SIZE,j as DEPENDENCY_FAILED,ve as GLOBAL_SEARCH_RESULT_ITEM_KINDS,s as GraphExportError,a as GraphExportSession,B as HOMEPAGE_FEATURED_ITEM_KINDS,k as MAX_COMMIT_VALIDATION_ENCODED_BYTES,u as MAX_COMMIT_VALIDATION_OPERATIONS,o as MAX_CONTENT_FIELD_BYTES,h as MAX_STREAM_APPEND_OPERATION_COUNT,E as MAX_WREFS_PER_THING_VERSION,se as ORG_AUTH_SCOPES,fe as ORG_MEMBER_STATUSES,ge as ORG_ROLES,$ as OperationBuilder,S as PartialStreamSubmissionError,q as REPO_AUTH_SCOPES,ce as RepositoryExportError,ne as RepositoryExportSession,Ce as SDK_VERSION,R as SUBSCRIBABLE_EVENT_TYPES,O as StreamSubmissionAggregator,C as StreamingSubmissionOutcomeUnknownError,ie as WarmHubClient,e as WarmHubError,A as WriteOperationError,T as applyGraphExportDelta,J as applyRepositoryExportDelta,D as collectDurableTokens,m as commitValidateRequestBodyBytes,de as connectionErrorMessage,y as contentFieldLimitError,g as countStreamAppendResultStatuses,ue as createCommitValidateInput,v as createGraphExportSession,t as createKeepShapesResolver,De as createOperationEventRequestId,n as createOperationEventSubmissionId,K as createRepositoryExportSession,p as encodeCommitValidateRequestBody,d as getResponseDecorations,X as isAllStreamOperationsFailedError,F as isConnectionError,_ as isDefiniteStreamAppendRejection,Oe as isKnownCheckpointContentType,Ee as isKnownComponentInstallResultState,Y as isKnownComponentSummaryState,le as isKnownCredentialScope,H as isKnownGlobalSearchResultItemKind,te as isKnownHomepageFeaturedItemKind,me as isKnownOrgAuthScope,Z as isKnownOrgMemberStatus,ae as isKnownOrgRole,P as isKnownRepoAuthScope,we as isKnownSubscribableEventType,oe as isRetryable,M as isShapeReference,pe as isWarmHubError,z as normalizeWref,I as operationEventStreamRequestId,r as readGraphExportStream,N as readRepositoryExportStream,ee as resolveFunctionLogMode,xe as restoreGraphExportSession,ye as restoreRepositoryExportSession,_e as sanitizeErrorMessage,V as sdkVersionIsBelowMinimum,x as shapeName,b as streamAppendResultStatus,Q as submitOperationsViaStream,W as toWarmHubError,U as validateAgainstShape,L as verifyCliCall};
|
package/dist/react.d.ts
CHANGED
|
@@ -1,43 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/**
|
|
2
|
+
* SDK React surface: provider + client context + auth state.
|
|
3
|
+
*
|
|
4
|
+
* Intended for first-party WarmHub apps only. TanStack Query hooks live
|
|
5
|
+
* in the webapp, not here.
|
|
6
|
+
*
|
|
7
|
+
* @module React
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
import { AboutOptions, AboutResult, CountOptions, CountResult, CurrentUserInfo, DEFAULT_API_URL, ErrorKind, FilterOptions, FilterResult, GraphListPageOptions, GraphListPageResult, GraphWithStatsInfo, HeadResult, HistoryResult, Operation, OperationSubmitResult, PingResult, RefsOptions, RefsResult, RepoListPageOptions, RepoListPageResult, RepoWithStatsInfo, ResolveWrefResult, SDK_VERSION, SearchOptions, SearchResult, ThingDetail, WarmHubClient, WarmHubClient as WarmHubClient$1, WarmHubClientOptions, WarmHubError, toWarmHubError } from "./index.js";
|
|
11
|
+
import { ReactNode } from "react";
|
|
7
12
|
/** @internal */
|
|
8
13
|
interface WarmHubProviderProps {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
isAuthenticated: boolean;
|
|
13
|
-
isLoading: boolean;
|
|
14
|
-
getAccessToken: () => Promise<string | null>;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Self-identification forwarded to the `X-WarmHub-Client` header. First-party
|
|
18
|
-
* apps set `name` (e.g. `warmhub-web`) so backend observability can tell them
|
|
19
|
-
* apart from raw SDK consumers; an omitted `version` falls through to the SDK
|
|
20
|
-
* version. See `WarmHubClientOptions.client`.
|
|
21
|
-
*/
|
|
22
|
-
client?: {
|
|
23
|
-
name?: string;
|
|
24
|
-
version?: string;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Opt the app's client into response auto-decoration; see
|
|
28
|
-
* `WarmHubClientOptions.decorateResponses`.
|
|
29
|
-
*/
|
|
30
|
-
decorateResponses?: boolean;
|
|
31
|
-
}
|
|
32
|
-
interface WarmHubAuthState {
|
|
14
|
+
apiUrl: string;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
auth: {
|
|
33
17
|
isAuthenticated: boolean;
|
|
34
18
|
isLoading: boolean;
|
|
19
|
+
getAccessToken: () => Promise<string | null>;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Self-identification forwarded to the `X-WarmHub-Client` header. First-party
|
|
23
|
+
* apps set `name` (e.g. `warmhub-web`) so backend observability can tell them
|
|
24
|
+
* apart from raw SDK consumers; an omitted `version` falls through to the SDK
|
|
25
|
+
* version. See `WarmHubClientOptions.client`.
|
|
26
|
+
*/
|
|
27
|
+
client?: {
|
|
28
|
+
name?: string;
|
|
29
|
+
version?: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Opt the app's client into response auto-decoration; see
|
|
33
|
+
* `WarmHubClientOptions.decorateResponses`.
|
|
34
|
+
*/
|
|
35
|
+
decorateResponses?: boolean;
|
|
36
|
+
}
|
|
37
|
+
interface WarmHubAuthState {
|
|
38
|
+
isAuthenticated: boolean;
|
|
39
|
+
isLoading: boolean;
|
|
35
40
|
}
|
|
36
41
|
/** @internal */
|
|
37
|
-
declare function WarmHubProvider({ apiUrl, children, auth, client: clientIdentity, decorateResponses
|
|
42
|
+
export declare function WarmHubProvider({ apiUrl, children, auth, client: clientIdentity, decorateResponses }: WarmHubProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
38
43
|
/** @internal */
|
|
39
|
-
declare function useWarmHubClient(): WarmHubClient;
|
|
44
|
+
export declare function useWarmHubClient(): WarmHubClient$1;
|
|
40
45
|
/** @internal */
|
|
41
|
-
declare function useWarmHubAuth(): WarmHubAuthState;
|
|
42
|
-
|
|
43
|
-
export { WarmHubClient, WarmHubProvider, type WarmHubProviderProps, useWarmHubAuth, useWarmHubClient };
|
|
46
|
+
export declare function useWarmHubAuth(): WarmHubAuthState;
|
|
47
|
+
export { type AboutOptions, type AboutResult, type CountOptions, type CountResult, type CurrentUserInfo, DEFAULT_API_URL, type ErrorKind, type FilterOptions, type FilterResult, type GraphListPageOptions, type GraphListPageResult, type GraphWithStatsInfo, type HeadResult, type HistoryResult, type Operation, type OperationSubmitResult, type PingResult, type RefsOptions, type RefsResult, type RepoListPageOptions, type RepoListPageResult, type RepoWithStatsInfo, type ResolveWrefResult, SDK_VERSION, type SearchOptions, type SearchResult, type ThingDetail, WarmHubClient, type WarmHubClientOptions, WarmHubError, type WarmHubProviderProps, toWarmHubError };
|
package/dist/react.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{$ as e,f as t,n,t as r,x as i}from"./chunk-C2brwOhe.js";import{createContext as a,useContext as o,useEffect as s,useMemo as c,useState as l}from"react";import{jsx as u}from"react/jsx-runtime";const d=a(null),f=a({isAuthenticated:!1,isLoading:!0});function p({apiUrl:e,children:t,auth:r,client:i,decorateResponses:a}){let o=i?.name,s=i?.version,l=r.getAccessToken,f=c(()=>new n({apiUrl:e,accessToken:async()=>await l()??void 0,client:{name:o,version:s},decorateResponses:a}),[e,o,s,a,l]);return/* @__PURE__ */ u(d.Provider,{value:f,children:/* @__PURE__ */ u(m,{auth:r,client:f,children:t})})}function m({auth:e,client:t,children:n}){let[r,i]=l(null),a=e.isAuthenticated&&r===t;s(()=>{if(!e.isAuthenticated){i(null);return}let n=!1;return t.auth.sync().then(()=>{n||i(t)}).catch(e=>{console.error(`auth.sync failed:`,e),n||i(t)}),()=>{n=!0}},[e.isAuthenticated,t]);let o=c(()=>({isAuthenticated:e.isAuthenticated&&a,isLoading:e.isLoading||e.isAuthenticated&&!a}),[e.isAuthenticated,e.isLoading,a]);return e.isLoading||e.isAuthenticated&&!a?null:/* @__PURE__ */ u(f.Provider,{value:o,children:n})}function h(){let e=o(d);if(!e)throw Error(`useWarmHubClient must be used within a WarmHubProvider`);return e}function g(){return o(f)}export{r as DEFAULT_API_URL,i as SDK_VERSION,n as WarmHubClient,e as WarmHubError,p as WarmHubProvider,t as toWarmHubError,g as useWarmHubAuth,h as useWarmHubClient};
|
|
2
2
|
//# sourceMappingURL=react.js.map
|
package/dist/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"react.js","names":["WarmHubError","toWarmHubError","DEFAULT_API_URL","SDK_VERSION","ClientContext","createContext","AuthContext","WarmHubProvider","clientIdentity","clientName","clientVersion","getAccessToken","auth","client","useMemo","WarmHubClient","apiUrl","decorateResponses","AuthSyncGate","syncedClient","setSyncedClient","useState","synced","useEffect","cancelled","err","authState","useWarmHubClient","useContext","useWarmHubAuth"],"sources":["../src/react/provider.tsx"],"mappings":"A,uMAsCA,MAAMI,EAAgBC,EAAoC,IAAI,EACxDC,EAAcD,EAAgC,CAClD,gBAAiB,GACjB,UAAW,EACb,CAAC,EAGD,SAAgBE,EAAgB,CAC9B,SACA,WACA,OACA,OAAQC,EACR,qBACuB,CAKvB,IAAMC,EAAaD,GAAgB,KAC7BE,EAAgBF,GAAgB,QAChCG,EAAiBC,EAAK,eACtBC,EAASC,MAEX,IAAIC,EAAc,CAChB,SACA,YAAa,SAEJ,MADaJ,EAAe,GACnB,IAAA,GAElB,OAAQ,CAAE,KAAMF,EA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ts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.163.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "The TypeScript SDK for WarmHub — create repos, commit and query data, and compound knowledge with your AI agents.",
|
|
@@ -63,10 +63,9 @@
|
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"build": "if [ \"${WARMHUB_TEST_RUNTIME_BUILD:-}\" = \"1\" ]; then bun run build:test-runtime; else bun run build:full; fi",
|
|
66
|
-
"build:full": "
|
|
67
|
-
"build:runtime": "
|
|
68
|
-
"build:
|
|
69
|
-
"build:test-runtime": "tsup --config tsup.test-runtime.config.ts",
|
|
66
|
+
"build:full": "NODE_OPTIONS=--max-old-space-size=4096 tsdown && bun run scripts/inject-doc-links.ts",
|
|
67
|
+
"build:runtime": "tsdown --filter runtime",
|
|
68
|
+
"build:test-runtime": "bun run build:runtime",
|
|
70
69
|
"generate:api-contract": "bun run scripts/generate-api-contract.ts",
|
|
71
70
|
"generate:backend-types": "bun run --cwd ../sdk-conformance generate:backend-types",
|
|
72
71
|
"audit:api-contract": "bun run scripts/audit-api-contract.ts",
|
|
@@ -103,11 +102,11 @@
|
|
|
103
102
|
"zod": "4.6.7"
|
|
104
103
|
},
|
|
105
104
|
"devDependencies": {
|
|
105
|
+
"@types/react": "catalog:",
|
|
106
106
|
"@vitest/coverage-v8": "catalog:",
|
|
107
107
|
"pako": "2.1.0",
|
|
108
|
-
"@types/react": "catalog:",
|
|
109
108
|
"react": "19.2.6",
|
|
110
|
-
"
|
|
109
|
+
"tsdown": "0.23.7",
|
|
111
110
|
"typedoc": "0.28.19",
|
|
112
111
|
"typescript": "5.9.3",
|
|
113
112
|
"typescript-native": "catalog:",
|