@vef-framework-react/core 2.13.0 → 2.14.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/cjs/http/body-encoding.cjs +1 -0
- package/dist/cjs/http/client.cjs +1 -1
- package/dist/cjs/http/constants.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/storage/index.cjs +1 -1
- package/dist/cjs/storage/protocol.cjs +1 -1
- package/dist/es/api/client.js +1 -1
- package/dist/es/api/constants.js +1 -1
- package/dist/es/api/helpers.js +1 -1
- package/dist/es/api/index.js +1 -1
- package/dist/es/auth/helpers.js +1 -1
- package/dist/es/auth/index.js +1 -1
- package/dist/es/context/api-client.js +1 -1
- package/dist/es/context/app.js +1 -1
- package/dist/es/context/context-selector.js +1 -1
- package/dist/es/context/disabled.js +1 -1
- package/dist/es/context/index.js +1 -1
- package/dist/es/dnd/index.js +1 -1
- package/dist/es/http/body-encoding.js +28 -0
- package/dist/es/http/client.js +78 -56
- package/dist/es/http/constants.js +3 -3
- package/dist/es/http/errors.js +1 -1
- package/dist/es/http/helpers.js +1 -1
- package/dist/es/http/index.js +1 -1
- package/dist/es/immer/index.js +1 -1
- package/dist/es/index.js +13 -13
- package/dist/es/motion/features.js +1 -1
- package/dist/es/motion/index.js +1 -1
- package/dist/es/motion/motion-provider.js +1 -1
- package/dist/es/push/client.js +1 -1
- package/dist/es/push/helpers.js +1 -1
- package/dist/es/push/index.js +1 -1
- package/dist/es/push/types.js +1 -1
- package/dist/es/query/constants.js +1 -1
- package/dist/es/query/helpers.js +1 -1
- package/dist/es/query/hooks.js +1 -1
- package/dist/es/query/index.js +1 -1
- package/dist/es/sse/client.js +1 -1
- package/dist/es/sse/helpers.js +1 -1
- package/dist/es/sse/index.js +1 -1
- package/dist/es/sse/stream-machine.js +1 -1
- package/dist/es/state/index.js +1 -1
- package/dist/es/state-machine/index.js +1 -1
- package/dist/es/storage/errors.js +1 -1
- package/dist/es/storage/index.js +8 -8
- package/dist/es/storage/protocol.js +26 -16
- package/dist/es/storage/resumable/fingerprint.js +1 -1
- package/dist/es/storage/resumable/index.js +1 -1
- package/dist/es/storage/resumable/persistence.js +1 -1
- package/dist/es/storage/resumable/plan.js +1 -1
- package/dist/es/storage/types.js +1 -1
- package/dist/es/storage/uploader-machine.js +1 -1
- package/dist/es/storage/uploader.js +1 -1
- package/dist/es/store/bound.js +1 -1
- package/dist/es/store/index.js +1 -1
- package/dist/es/store/unbound.js +1 -1
- package/dist/es/store/use-deep.js +1 -1
- package/dist/types/http/body-encoding.d.ts +18 -0
- package/dist/types/http/client.d.ts +9 -1
- package/dist/types/http/constants.d.ts +5 -0
- package/dist/types/http/types.d.ts +18 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/storage/index.d.ts +1 -1
- package/dist/types/storage/protocol.d.ts +36 -0
- package/package.json +2 -2
package/dist/es/motion/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/core v2.
|
|
1
|
+
/*! @vef-framework-react/core v2.14.0 made by Venus | 2026-08-05T04:05:15.622Z */
|
|
2
2
|
import e from "./motion-provider.js";
|
|
3
3
|
import { AnimatePresence as t, LayoutGroup as n, Reorder as r, useDragControls as i, useInView as a } from "motion/react";
|
|
4
4
|
import * as o from "motion/react-m";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/core v2.
|
|
1
|
+
/*! @vef-framework-react/core v2.14.0 made by Venus | 2026-08-05T04:05:15.622Z */
|
|
2
2
|
import { generateId as e } from "@vef-framework-react/shared";
|
|
3
3
|
import { useState as t } from "react";
|
|
4
4
|
import { jsx as n } from "@emotion/react/jsx-runtime";
|
package/dist/es/push/client.js
CHANGED
package/dist/es/push/helpers.js
CHANGED
package/dist/es/push/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/core v2.
|
|
1
|
+
/*! @vef-framework-react/core v2.14.0 made by Venus | 2026-08-05T04:05:15.622Z */
|
|
2
2
|
import { PUSH_CLOSE_SESSION_INVALID as e, PUSH_CLOSE_TOO_MANY_CONNECTIONS as t } from "./types.js";
|
|
3
3
|
import { PushClient as n } from "./client.js";
|
|
4
4
|
import { createPushClient as r } from "./helpers.js";
|
package/dist/es/push/types.js
CHANGED
package/dist/es/query/helpers.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/core v2.
|
|
1
|
+
/*! @vef-framework-react/core v2.14.0 made by Venus | 2026-08-05T04:05:15.622Z */
|
|
2
2
|
import { hashKey as e, isPlainObject as t } from "@vef-framework-react/shared";
|
|
3
3
|
import { MutationCache as n, QueryClient as r, keepPreviousData as i, matchQuery as a } from "@tanstack/react-query";
|
|
4
4
|
//#region src/query/helpers.ts
|
package/dist/es/query/hooks.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/core v2.
|
|
1
|
+
/*! @vef-framework-react/core v2.14.0 made by Venus | 2026-08-05T04:05:15.622Z */
|
|
2
2
|
import { matchMutation as e, matchQuery as t, skipToken as n, useInfiniteQuery as r, useIsFetching as i, useIsMutating as a, useMutation as o, useMutationState as s, useQueries as c, useQuery as l, useQueryClient as u, useQueryErrorResetBoundary as d } from "@tanstack/react-query";
|
|
3
3
|
//#region src/query/hooks.ts
|
|
4
4
|
function f(e) {
|
package/dist/es/query/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/core v2.
|
|
1
|
+
/*! @vef-framework-react/core v2.14.0 made by Venus | 2026-08-05T04:05:15.622Z */
|
|
2
2
|
import { QUERY_CLIENT_KEY as e } from "./constants.js";
|
|
3
3
|
import { createQueryClient as t } from "./helpers.js";
|
|
4
4
|
import { useInfiniteQuery as n, useIsFetching as r, useIsMutating as i, useMutation as a, useMutationState as o, useQueries as s, useQuery as c } from "./hooks.js";
|
package/dist/es/sse/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/core v2.
|
|
1
|
+
/*! @vef-framework-react/core v2.14.0 made by Venus | 2026-08-05T04:05:15.622Z */
|
|
2
2
|
import { TokenExpiredError as e, createStreamMachine as t } from "./stream-machine.js";
|
|
3
3
|
import { isString as n } from "@vef-framework-react/shared";
|
|
4
4
|
import { fetchEventSource as r } from "@microsoft/fetch-event-source";
|
package/dist/es/sse/helpers.js
CHANGED
package/dist/es/sse/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/core v2.
|
|
1
|
+
/*! @vef-framework-react/core v2.14.0 made by Venus | 2026-08-05T04:05:15.622Z */
|
|
2
2
|
import { SseClient as e } from "./client.js";
|
|
3
3
|
import { createSseClient as t } from "./helpers.js";
|
|
4
4
|
export { e as SseClient, t as createSseClient };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/core v2.
|
|
1
|
+
/*! @vef-framework-react/core v2.14.0 made by Venus | 2026-08-05T04:05:15.622Z */
|
|
2
2
|
import { fromPromise as e, setup as t } from "xstate";
|
|
3
3
|
//#region src/sse/stream-machine.ts
|
|
4
4
|
var n = class extends Error {
|
package/dist/es/state/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! @vef-framework-react/core v2.
|
|
1
|
+
/*! @vef-framework-react/core v2.14.0 made by Venus | 2026-08-05T04:05:15.622Z */
|
|
2
2
|
import { Provider as e, atom as t, createStore as n, getDefaultStore as r, useAtom as i, useAtomValue as a, useSetAtom as o, useStore as s } from "jotai";
|
|
3
3
|
export { e as AtomStoreProvider, t as atom, n as createAtomStore, r as getDefaultAtomStore, i as useAtom, s as useAtomStore, a as useAtomValue, o as useSetAtom };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/core v2.
|
|
1
|
+
/*! @vef-framework-react/core v2.14.0 made by Venus | 2026-08-05T04:05:15.622Z */
|
|
2
2
|
import { Actor as e, assign as t, createActor as n, createMachine as r } from "xstate";
|
|
3
3
|
import { useActorRef as i, useActorRef as a, useSelector as o } from "@xstate/react";
|
|
4
4
|
//#region src/state-machine/index.ts
|
package/dist/es/storage/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/*! @vef-framework-react/core v2.
|
|
1
|
+
/*! @vef-framework-react/core v2.14.0 made by Venus | 2026-08-05T04:05:15.622Z */
|
|
2
2
|
import { UploadAbortedError as e, UploadError as t, UploadPartError as n, UploadProtocolError as r } from "./errors.js";
|
|
3
|
-
import { DEFAULT_API_PATH as i,
|
|
4
|
-
import { PrefixFingerprinter as
|
|
5
|
-
import { LocalStoragePersistence as
|
|
6
|
-
import { resolveResumePlan as
|
|
7
|
-
import { PRIVATE_PREFIX as
|
|
8
|
-
import { Uploader as
|
|
9
|
-
export { i as DEFAULT_API_PATH, a as
|
|
3
|
+
import { DEFAULT_API_PATH as i, DEFAULT_FILE_RESOURCE as a, DEFAULT_RESOURCE as o, DEFAULT_VERSION as s, abortUpload as c, completeUpload as l, initUpload as u, listParts as d, resolveFiles as f, uploadPart as p } from "./protocol.js";
|
|
4
|
+
import { PrefixFingerprinter as m, WeakFingerprinter as h } from "./resumable/fingerprint.js";
|
|
5
|
+
import { LocalStoragePersistence as g } from "./resumable/persistence.js";
|
|
6
|
+
import { resolveResumePlan as _ } from "./resumable/plan.js";
|
|
7
|
+
import { PRIVATE_PREFIX as v, PUBLIC_PREFIX as y } from "./types.js";
|
|
8
|
+
import { Uploader as b, uploadFile as x } from "./uploader.js";
|
|
9
|
+
export { i as DEFAULT_API_PATH, a as DEFAULT_FILE_RESOURCE, o as DEFAULT_RESOURCE, s as DEFAULT_VERSION, g as LocalStoragePersistence, v as PRIVATE_PREFIX, y as PUBLIC_PREFIX, m as PrefixFingerprinter, e as UploadAbortedError, t as UploadError, n as UploadPartError, r as UploadProtocolError, b as Uploader, h as WeakFingerprinter, c as abortUpload, l as completeUpload, u as initUpload, d as listParts, f as resolveFiles, _ as resolveResumePlan, x as uploadFile, p as uploadPart };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
/*! @vef-framework-react/core v2.
|
|
1
|
+
/*! @vef-framework-react/core v2.14.0 made by Venus | 2026-08-05T04:05:15.622Z */
|
|
2
2
|
import { createApiRequest as e } from "../api/helpers.js";
|
|
3
3
|
import { UploadProtocolError as t } from "./errors.js";
|
|
4
4
|
//#region src/storage/protocol.ts
|
|
5
|
-
var n = "/api", r = "sys/storage", i = "v1", a = "
|
|
6
|
-
async function
|
|
5
|
+
var n = "/api", r = "sys/storage", i = "v1", a = "sys/storage/file", o = "init_upload", s = "upload_part", c = "list_parts", l = "complete_upload", u = "abort_upload", d = "resolve";
|
|
6
|
+
async function f(n, r, i) {
|
|
7
7
|
try {
|
|
8
8
|
return (await n.http.post(n.apiPath, {
|
|
9
|
-
data: e(n.resource,
|
|
9
|
+
data: e(n.resource, o, n.version, r),
|
|
10
10
|
signal: i
|
|
11
11
|
})).data;
|
|
12
12
|
} catch (e) {
|
|
13
|
-
throw new t(
|
|
13
|
+
throw new t(o, "failed to initialize upload", { cause: e });
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
async function
|
|
16
|
+
async function p(e, t) {
|
|
17
17
|
let n = new FormData();
|
|
18
|
-
return n.append("resource", e.resource), n.append("action",
|
|
18
|
+
return n.append("resource", e.resource), n.append("action", s), n.append("version", e.version), n.append("params", JSON.stringify({
|
|
19
19
|
claimId: t.claimId,
|
|
20
20
|
partNumber: t.partNumber
|
|
21
21
|
})), n.append("file", t.blob), (await e.http.upload(e.apiPath, {
|
|
@@ -24,32 +24,42 @@ async function d(e, t) {
|
|
|
24
24
|
signal: t.signal
|
|
25
25
|
})).data;
|
|
26
26
|
}
|
|
27
|
-
async function
|
|
27
|
+
async function m(n, r, i) {
|
|
28
28
|
try {
|
|
29
29
|
return (await n.http.post(n.apiPath, {
|
|
30
|
-
data: e(n.resource,
|
|
30
|
+
data: e(n.resource, c, n.version, { claimId: r }),
|
|
31
31
|
signal: i
|
|
32
32
|
})).data;
|
|
33
33
|
} catch (e) {
|
|
34
|
-
throw new t(
|
|
34
|
+
throw new t(c, "failed to list parts", { cause: e });
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
async function
|
|
37
|
+
async function h(n, r, i) {
|
|
38
38
|
try {
|
|
39
39
|
return (await n.http.post(n.apiPath, {
|
|
40
|
-
data: e(n.resource,
|
|
40
|
+
data: e(n.resource, l, n.version, { claimId: r }),
|
|
41
|
+
signal: i
|
|
42
|
+
})).data;
|
|
43
|
+
} catch (e) {
|
|
44
|
+
throw new t(l, "failed to complete upload", { cause: e });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
async function g(n, r, i) {
|
|
48
|
+
try {
|
|
49
|
+
return (await n.http.post(n.apiPath, {
|
|
50
|
+
data: e(n.resource, d, n.version, { keys: r }),
|
|
41
51
|
signal: i
|
|
42
52
|
})).data;
|
|
43
53
|
} catch (e) {
|
|
44
|
-
throw new t(
|
|
54
|
+
throw new t(d, "failed to resolve files", { cause: e });
|
|
45
55
|
}
|
|
46
56
|
}
|
|
47
|
-
async function
|
|
57
|
+
async function _(t, n, r) {
|
|
48
58
|
try {
|
|
49
|
-
await t.http.post(t.apiPath, { data: e(t.resource,
|
|
59
|
+
await t.http.post(t.apiPath, { data: e(t.resource, u, t.version, { claimId: n }) });
|
|
50
60
|
} catch (e) {
|
|
51
61
|
r?.(e);
|
|
52
62
|
}
|
|
53
63
|
}
|
|
54
64
|
//#endregion
|
|
55
|
-
export { n as DEFAULT_API_PATH, r as DEFAULT_RESOURCE, i as DEFAULT_VERSION,
|
|
65
|
+
export { n as DEFAULT_API_PATH, a as DEFAULT_FILE_RESOURCE, r as DEFAULT_RESOURCE, i as DEFAULT_VERSION, _ as abortUpload, h as completeUpload, f as initUpload, m as listParts, g as resolveFiles, p as uploadPart };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/core v2.
|
|
1
|
+
/*! @vef-framework-react/core v2.14.0 made by Venus | 2026-08-05T04:05:15.622Z */
|
|
2
2
|
import { PrefixFingerprinter as e, WeakFingerprinter as t } from "./fingerprint.js";
|
|
3
3
|
import { LocalStoragePersistence as n } from "./persistence.js";
|
|
4
4
|
import { resolveResumePlan as r } from "./plan.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/core v2.
|
|
1
|
+
/*! @vef-framework-react/core v2.14.0 made by Venus | 2026-08-05T04:05:15.622Z */
|
|
2
2
|
import { abortUpload as e, listParts as t } from "../protocol.js";
|
|
3
3
|
//#region src/storage/resumable/plan.ts
|
|
4
4
|
async function n(n) {
|
package/dist/es/storage/types.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/core v2.
|
|
1
|
+
/*! @vef-framework-react/core v2.14.0 made by Venus | 2026-08-05T04:05:15.622Z */
|
|
2
2
|
import { assertEvent as e, fromPromise as t, setup as n } from "xstate";
|
|
3
3
|
//#region src/storage/uploader-machine.ts
|
|
4
4
|
function r(r) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/core v2.
|
|
1
|
+
/*! @vef-framework-react/core v2.14.0 made by Venus | 2026-08-05T04:05:15.622Z */
|
|
2
2
|
import { UploadAbortedError as e, UploadError as t, UploadPartError as n, UploadProtocolError as r } from "./errors.js";
|
|
3
3
|
import { abortUpload as i, completeUpload as a, initUpload as o, uploadPart as s } from "./protocol.js";
|
|
4
4
|
import { createUploaderMachine as c } from "./uploader-machine.js";
|
package/dist/es/store/bound.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/core v2.
|
|
1
|
+
/*! @vef-framework-react/core v2.14.0 made by Venus | 2026-08-05T04:05:15.622Z */
|
|
2
2
|
import { constantCase as e, identity as t } from "@vef-framework-react/shared";
|
|
3
3
|
import { create as n } from "zustand";
|
|
4
4
|
import { createJSONStorage as r, persist as i, subscribeWithSelector as a } from "zustand/middleware";
|
package/dist/es/store/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/core v2.
|
|
1
|
+
/*! @vef-framework-react/core v2.14.0 made by Venus | 2026-08-05T04:05:15.622Z */
|
|
2
2
|
import { createPersistedStore as e, createStore as t } from "./bound.js";
|
|
3
3
|
import { createComponentStore as n } from "./unbound.js";
|
|
4
4
|
import { useDeep as r } from "./use-deep.js";
|
package/dist/es/store/unbound.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/core v2.
|
|
1
|
+
/*! @vef-framework-react/core v2.14.0 made by Venus | 2026-08-05T04:05:15.622Z */
|
|
2
2
|
import { constantCase as e, identity as t, isPlainObject as n, mergeWith as r } from "@vef-framework-react/shared";
|
|
3
3
|
import { createContext as i, use as a, useRef as o } from "react";
|
|
4
4
|
import { jsx as s } from "@emotion/react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/core v2.
|
|
1
|
+
/*! @vef-framework-react/core v2.14.0 made by Venus | 2026-08-05T04:05:15.622Z */
|
|
2
2
|
import { isDeepEqual as e } from "@vef-framework-react/shared";
|
|
3
3
|
import { useRef as t } from "react";
|
|
4
4
|
//#region src/store/use-deep.ts
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BodyEncoding } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* The transport encoding actually applied to a request body, paired with the
|
|
4
|
+
* encoded text. `gzip+base64` degrades to `base64` when the runtime has no
|
|
5
|
+
* `CompressionStream`, so the reported encoding can differ from the request.
|
|
6
|
+
*/
|
|
7
|
+
export interface EncodedRequestBody {
|
|
8
|
+
body: string;
|
|
9
|
+
encoding: Exclude<BodyEncoding, "none">;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Encode a serialized JSON payload for transport so a code-shaped body (an
|
|
13
|
+
* integration adapter or envelope/auth script) survives middleboxes that
|
|
14
|
+
* false-positive on it; the server's body-encoding middleware reverses it
|
|
15
|
+
* before parsing. `gzip+base64` compresses first — smaller on the wire and
|
|
16
|
+
* still text-shaped — and falls back to `base64` when the runtime cannot gzip.
|
|
17
|
+
*/
|
|
18
|
+
export declare function encodeRequestBody(payload: string, encoding: Exclude<BodyEncoding, "none">): Promise<EncodedRequestBody>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosProgressEvent } from 'axios';
|
|
2
|
-
import { ApiResult, HttpClientOptions, HttpFileResponse, RequestOptions } from './types';
|
|
2
|
+
import { ApiResult, BodyEncoding, HttpClientOptions, HttpFileResponse, RequestOptions } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* The HTTP client.
|
|
5
5
|
*/
|
|
@@ -103,6 +103,12 @@ export declare class HttpClient {
|
|
|
103
103
|
* Extract a filename from Content-Disposition.
|
|
104
104
|
*/
|
|
105
105
|
private getResponseFilename;
|
|
106
|
+
/**
|
|
107
|
+
* Apply the resolved transport body encoding to a request, adding the
|
|
108
|
+
* `X-Body-Encoding` header for the server to reverse. A non-JSON body or a
|
|
109
|
+
* resolved `none` encoding passes through untouched.
|
|
110
|
+
*/
|
|
111
|
+
private encodeRequestData;
|
|
106
112
|
/**
|
|
107
113
|
* Ensure the token is refreshed. Can be called proactively by external code
|
|
108
114
|
* (e.g., fetch-based SSE) to refresh token before/after request.
|
|
@@ -123,6 +129,7 @@ export declare class HttpClient {
|
|
|
123
129
|
post<R = unknown, D = unknown, P = unknown>(url: string, options?: RequestOptions & {
|
|
124
130
|
data?: D;
|
|
125
131
|
params?: P;
|
|
132
|
+
bodyEncoding?: BodyEncoding;
|
|
126
133
|
}): Promise<ApiResult<R>>;
|
|
127
134
|
/**
|
|
128
135
|
* PUT request.
|
|
@@ -130,6 +137,7 @@ export declare class HttpClient {
|
|
|
130
137
|
put<R = unknown, D = unknown, P = unknown>(url: string, options?: RequestOptions & {
|
|
131
138
|
data?: D;
|
|
132
139
|
params?: P;
|
|
140
|
+
bodyEncoding?: BodyEncoding;
|
|
133
141
|
}): Promise<ApiResult<R>>;
|
|
134
142
|
/**
|
|
135
143
|
* DELETE request.
|
|
@@ -21,6 +21,11 @@ export declare const SKIP_AUTH_HEADER = "X-Skip-Authentication";
|
|
|
21
21
|
* The header value for skipping authentication.
|
|
22
22
|
*/
|
|
23
23
|
export declare const SKIP_AUTH_VALUE = "1";
|
|
24
|
+
/**
|
|
25
|
+
* The header naming the transport encoding applied to a request body, which the
|
|
26
|
+
* server's body-encoding middleware reverses before parsing.
|
|
27
|
+
*/
|
|
28
|
+
export declare const BODY_ENCODING_HEADER = "X-Body-Encoding";
|
|
24
29
|
/**
|
|
25
30
|
* Default request timeout in milliseconds (30 seconds).
|
|
26
31
|
*/
|
|
@@ -18,6 +18,18 @@ export interface ApiResult<T = unknown> {
|
|
|
18
18
|
*/
|
|
19
19
|
readonly data: T;
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* How a request body is transport-encoded so a code-shaped payload survives
|
|
23
|
+
* middleboxes (WAF / proxy) that false-positive on it; the server's
|
|
24
|
+
* body-encoding middleware reverses it before parsing.
|
|
25
|
+
*
|
|
26
|
+
* - `none` — send the body verbatim (also opts a single request out of a
|
|
27
|
+
* client-wide `defaultBodyEncoding`).
|
|
28
|
+
* - `base64` — base64 of the UTF-8 JSON body.
|
|
29
|
+
* - `gzip+base64` — base64 of a gzip stream of the UTF-8 JSON body; smaller on
|
|
30
|
+
* the wire and still text-shaped.
|
|
31
|
+
*/
|
|
32
|
+
export type BodyEncoding = "none" | "base64" | "gzip+base64";
|
|
21
33
|
/**
|
|
22
34
|
* The authenticated tokens.
|
|
23
35
|
*/
|
|
@@ -87,6 +99,12 @@ export interface HttpClientOptions {
|
|
|
87
99
|
* The function to show the error message.
|
|
88
100
|
*/
|
|
89
101
|
showErrorMessage?: (message: string) => void;
|
|
102
|
+
/**
|
|
103
|
+
* The transport encoding applied to every request body by default. Individual
|
|
104
|
+
* requests override it (including `"none"` to opt out); absent means the body
|
|
105
|
+
* is sent verbatim.
|
|
106
|
+
*/
|
|
107
|
+
defaultBodyEncoding?: BodyEncoding;
|
|
90
108
|
}
|
|
91
109
|
/**
|
|
92
110
|
* A file fetched through the HTTP client.
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { checkPermission, type PermissionCheckMode } from './auth';
|
|
|
3
3
|
export { type DataOption, type DataOptionWithPinyin, type PaginationParams, type PaginationResult } from './common';
|
|
4
4
|
export { ApiClientProvider, AppContextProvider, createContextWithSelector, DisabledProvider, useApiClient, useAppContext, useDisabled, type AppContext, type SelectorContextProviderProps, type SelectorContextResult, type UseSelectorContext } from './context';
|
|
5
5
|
export { AxisModifier, closestCenter, closestCorners, CollisionPriority, defaultCollisionDetection, defaultPreset, directionBiased, DragDropContext, DragDropProvider, Draggable, DragOverlay, Droppable, Feedback, KeyboardSensor, moveArrayItem, moveDragItem, PointerActivationConstraints, pointerDistance, pointerIntersection, PointerSensor, restrictShapeToBoundingRectangle, RestrictToElement, RestrictToHorizontalAxis, RestrictToVerticalAxis, RestrictToWindow, shapeIntersection, SnapModifier, swapArrayItem, swapDragItem, useDragDropMonitor, useDraggable, useDragOperation, useDroppable, useSortable, type BeforeDragStartEvent, type CollisionDetector, type CollisionEvent, type DragDropContextProps, type DragDropEventHandlers, type DragEndEvent, type DraggableChildrenFn, type DraggableId, type DraggableLocation, type DraggableProps, type DraggableProvided, type DraggableProvidedDraggableProps, type DraggableProvidedDragHandleProps, type DraggableRubric, type DraggableStateSnapshot, type DragMoveEvent, type DragOverEvent, type DragStartEvent, type DroppableId, type DroppableProps, type DroppableProvided, type DroppableProvidedProps, type DroppableStateSnapshot, type DropResult, type FeedbackInput, type FeedbackOptions, type FeedbackType, type OnBeforeCaptureResponder, type OnBeforeDragStartResponder, type OnDragEndResponder, type OnDragStartResponder, type OnDragUpdateResponder } from './dnd';
|
|
6
|
-
export type { ApiResult, AuthTokens, HttpClient, HttpClientOptions, HttpFileResponse, ProgressEvent, RequestOptions } from './http';
|
|
6
|
+
export type { ApiResult, AuthTokens, BodyEncoding, HttpClient, HttpClientOptions, HttpFileResponse, ProgressEvent, RequestOptions } from './http';
|
|
7
7
|
export { BusinessError, isBusinessError, skipAuthenticationHeader, skipAuthenticationValue } from './http';
|
|
8
8
|
export { applyPatches, currentState, originalState, produce, produceWithPatches, useImmer, useImmerReducer } from './immer';
|
|
9
9
|
export { AnimatePresence, LayoutGroup, motion, MotionProvider, Reorder, useDragControls, useInView, type MotionProps, type ResolvedValues, type TargetAndTransition, type Transition, type Variant, type VariantLabels, type Variants } from './motion';
|
|
@@ -12,6 +12,6 @@ export { keepPreviousData, matchMutation, matchQuery, skipQueryToken, useInfinit
|
|
|
12
12
|
export { createSseClient, SseClient, type SseClientOptions, type SseEventHandlers, type SseMessageEvent, type SseRequestConfig } from './sse';
|
|
13
13
|
export { atom, AtomStoreProvider, createAtomStore, getDefaultAtomStore, useAtom, useAtomStore, useAtomValue, useSetAtom, type Atom, type AtomGetter, type AtomSetter, type ExtractAtomArgs, type ExtractAtomResult, type ExtractAtomValue, type PrimitiveAtom, type SetStateAction, type WritableAtom } from './state';
|
|
14
14
|
export { Actor, createActor, createMachine, updateContext, useActor, useActorRef, type ActorLogic, type ActorOptions, type AnyActorLogic, type AnyMachineSnapshot, type AnyStateMachine, type MachineConfig, type MachineContext, type MachineSnapshot, type RequiredActorOptionsKeys, type SnapshotFrom, type StateMachine } from './state-machine';
|
|
15
|
-
export { abortUpload, completeUpload, initUpload, listParts, LocalStoragePersistence, PrefixFingerprinter, PRIVATE_PREFIX, PUBLIC_PREFIX, resolveResumePlan, DEFAULT_API_PATH as STORAGE_API_PATH, DEFAULT_RESOURCE as STORAGE_RESOURCE, DEFAULT_VERSION as STORAGE_VERSION, UploadAbortedError, Uploader, UploadError, uploadFile, uploadPart, UploadPartError, UploadProtocolError, WeakFingerprinter, type CompleteUploadResponse, type FileFingerprinter, type InitUploadParams, type InitUploadResponse, type ListedPart, type ListPartsResponse, type ObjectInfo, type ProtocolContext, type ResolveResumeInputs, type ResumablePersistence, type ResumeCandidate, type ResumeDecision, type ResumeDecisionHandler, type ResumePlan, type ResumeRecord, type UploaderOptions, type UploadInit, type UploadPartResponse, type UploadProgress, type UploadResult, type UploadSessionSnapshot, type UploadStatus } from './storage';
|
|
15
|
+
export { abortUpload, completeUpload, initUpload, listParts, LocalStoragePersistence, PrefixFingerprinter, PRIVATE_PREFIX, PUBLIC_PREFIX, resolveFiles, resolveResumePlan, DEFAULT_API_PATH as STORAGE_API_PATH, DEFAULT_FILE_RESOURCE as STORAGE_FILE_RESOURCE, DEFAULT_RESOURCE as STORAGE_RESOURCE, DEFAULT_VERSION as STORAGE_VERSION, UploadAbortedError, Uploader, UploadError, uploadFile, uploadPart, UploadPartError, UploadProtocolError, WeakFingerprinter, type CompleteUploadResponse, type FileFingerprinter, type InitUploadParams, type InitUploadResponse, type ListedPart, type ListPartsResponse, type ObjectInfo, type ProtocolContext, type ResolvedFile, type ResolveFilesResponse, type ResolveResumeInputs, type ResumablePersistence, type ResumeCandidate, type ResumeDecision, type ResumeDecisionHandler, type ResumePlan, type ResumeRecord, type UploaderOptions, type UploadInit, type UploadPartResponse, type UploadProgress, type UploadResult, type UploadSessionSnapshot, type UploadStatus } from './storage';
|
|
16
16
|
export { createComponentStore, createPersistedStore, createStore, useDeep, useShallow, type PersistenceOptions, type ComponentStoreResult as ReturnedComponentStoreResult, type SliceStateCreator, type StoreProviderProps, type UnboundStore, type UseBoundStore, type UseBoundStoreWithPersist, type UseStore } from './store';
|
|
17
17
|
export { clsx, type ClassArray, type ClassDictionary, type ClassValue } from 'clsx';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { UploadAbortedError, UploadError, UploadPartError, UploadProtocolError } from './errors';
|
|
2
|
-
export { abortUpload, completeUpload, DEFAULT_API_PATH, DEFAULT_RESOURCE, DEFAULT_VERSION, initUpload, listParts, uploadPart, type CompleteUploadResponse, type InitUploadParams, type InitUploadResponse, type ListedPart, type ListPartsResponse, type ObjectInfo, type ProtocolContext, type UploadPartResponse } from './protocol';
|
|
2
|
+
export { abortUpload, completeUpload, DEFAULT_API_PATH, DEFAULT_FILE_RESOURCE, DEFAULT_RESOURCE, DEFAULT_VERSION, initUpload, listParts, resolveFiles, uploadPart, type CompleteUploadResponse, type InitUploadParams, type InitUploadResponse, type ListedPart, type ListPartsResponse, type ObjectInfo, type ProtocolContext, type ResolvedFile, type ResolveFilesResponse, type UploadPartResponse } from './protocol';
|
|
3
3
|
export { LocalStoragePersistence, PrefixFingerprinter, resolveResumePlan, WeakFingerprinter, type FileFingerprinter, type ResolveResumeInputs, type ResumablePersistence, type ResumeCandidate, type ResumeDecision, type ResumeDecisionHandler, type ResumePlan, type ResumeRecord } from './resumable';
|
|
4
4
|
export { PRIVATE_PREFIX, PUBLIC_PREFIX, type UploaderOptions, type UploadInit, type UploadProgress, type UploadResult, type UploadSessionSnapshot, type UploadStatus } from './types';
|
|
5
5
|
export { Uploader, uploadFile } from './uploader';
|
|
@@ -7,6 +7,12 @@ import { HttpClient } from '../http';
|
|
|
7
7
|
export declare const DEFAULT_API_PATH = "/api";
|
|
8
8
|
export declare const DEFAULT_RESOURCE = "sys/storage";
|
|
9
9
|
export declare const DEFAULT_VERSION = "v1";
|
|
10
|
+
/**
|
|
11
|
+
* Read side of the backend's durable upload registry. Separate from
|
|
12
|
+
* `DEFAULT_RESOURCE` because it is a query surface over recorded state,
|
|
13
|
+
* not a step in the chunked-upload state machine.
|
|
14
|
+
*/
|
|
15
|
+
export declare const DEFAULT_FILE_RESOURCE = "sys/storage/file";
|
|
10
16
|
/**
|
|
11
17
|
* Shared identifying fields for every storage RPC call. The protocol allows
|
|
12
18
|
* overriding `resource` / `version` per call site so callers running against
|
|
@@ -93,6 +99,36 @@ export declare function listParts(ctx: ProtocolContext, claimId: string, signal?
|
|
|
93
99
|
* its `upload_part` table — the client never replays ETags.
|
|
94
100
|
*/
|
|
95
101
|
export declare function completeUpload(ctx: ProtocolContext, claimId: string, signal?: GenericAbortSignal): Promise<CompleteUploadResponse>;
|
|
102
|
+
/**
|
|
103
|
+
* One row of `resolve`. Mirrors the backend's `ResolvedFile` struct.
|
|
104
|
+
*
|
|
105
|
+
* `status` follows the backend's file lifecycle: `"uploaded"` (recorded,
|
|
106
|
+
* not yet referenced by business data), `"claimed"` (adopted by a
|
|
107
|
+
* business transaction), `"deleted"` (the object is gone but the record
|
|
108
|
+
* of it remains).
|
|
109
|
+
*/
|
|
110
|
+
export interface ResolvedFile {
|
|
111
|
+
key: string;
|
|
112
|
+
originalFilename: string;
|
|
113
|
+
contentType: string;
|
|
114
|
+
size: number;
|
|
115
|
+
status: "uploaded" | "claimed" | "deleted";
|
|
116
|
+
uploadedAt: string;
|
|
117
|
+
uploadedBy: string;
|
|
118
|
+
}
|
|
119
|
+
export interface ResolveFilesResponse {
|
|
120
|
+
files: ResolvedFile[];
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Resolve stored object keys into the metadata needed to render them —
|
|
124
|
+
* original filename above all. A business model stores only the key, so
|
|
125
|
+
* without this a re-opened form can only show the generated object name.
|
|
126
|
+
*
|
|
127
|
+
* Keys the caller may not read, and keys the backend has no record of,
|
|
128
|
+
* are omitted from the response rather than reported as errors: the
|
|
129
|
+
* caller is rendering a list and must degrade to the bare key.
|
|
130
|
+
*/
|
|
131
|
+
export declare function resolveFiles(ctx: ProtocolContext, keys: string[], signal?: GenericAbortSignal): Promise<ResolveFilesResponse>;
|
|
96
132
|
/**
|
|
97
133
|
* Best-effort cancellation of an in-flight session. Errors are swallowed —
|
|
98
134
|
* `abort_upload` is idempotent on the server, and a failure here must not
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vef-framework-react/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.14.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Core features for VEF framework",
|
|
6
6
|
"keywords": [
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"use-immer": "^0.11.0",
|
|
58
58
|
"xstate": "^5.32.3",
|
|
59
59
|
"zustand": "^5.0.14",
|
|
60
|
-
"@vef-framework-react/shared": "2.
|
|
60
|
+
"@vef-framework-react/shared": "2.14.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"react": "^19.2.7"
|