@ic-reactor/react 3.12.5 → 4.0.0-beta.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.
Files changed (139) hide show
  1. package/README.md +236 -423
  2. package/dist/index.d.ts +259 -12
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +470 -17
  5. package/dist/index.js.map +1 -1
  6. package/llms.txt +82 -54
  7. package/package.json +12 -28
  8. package/src/index.tsx +611 -0
  9. package/dist/auth/authentication-manager.d.ts +0 -123
  10. package/dist/auth/authentication-manager.d.ts.map +0 -1
  11. package/dist/auth/authentication-manager.js +0 -767
  12. package/dist/auth/authentication-manager.js.map +0 -1
  13. package/dist/auth/constants.d.ts +0 -24
  14. package/dist/auth/constants.d.ts.map +0 -1
  15. package/dist/auth/constants.js +0 -24
  16. package/dist/auth/constants.js.map +0 -1
  17. package/dist/auth/createIdentityAttributeHooks.d.ts +0 -14
  18. package/dist/auth/createIdentityAttributeHooks.d.ts.map +0 -1
  19. package/dist/auth/createIdentityAttributeHooks.js +0 -106
  20. package/dist/auth/createIdentityAttributeHooks.js.map +0 -1
  21. package/dist/auth/identity-attributes-manager.d.ts +0 -26
  22. package/dist/auth/identity-attributes-manager.d.ts.map +0 -1
  23. package/dist/auth/identity-attributes-manager.js +0 -107
  24. package/dist/auth/identity-attributes-manager.js.map +0 -1
  25. package/dist/auth/identity-attributes.d.ts +0 -19
  26. package/dist/auth/identity-attributes.d.ts.map +0 -1
  27. package/dist/auth/identity-attributes.js +0 -170
  28. package/dist/auth/identity-attributes.js.map +0 -1
  29. package/dist/auth/index.d.ts +0 -8
  30. package/dist/auth/index.d.ts.map +0 -1
  31. package/dist/auth/index.js +0 -8
  32. package/dist/auth/index.js.map +0 -1
  33. package/dist/auth/local-ii-probe.d.ts +0 -46
  34. package/dist/auth/local-ii-probe.d.ts.map +0 -1
  35. package/dist/auth/local-ii-probe.js +0 -102
  36. package/dist/auth/local-ii-probe.js.map +0 -1
  37. package/dist/auth/types.d.ts +0 -179
  38. package/dist/auth/types.d.ts.map +0 -1
  39. package/dist/auth/types.js +0 -2
  40. package/dist/auth/types.js.map +0 -1
  41. package/dist/createActorHooks.d.ts +0 -52
  42. package/dist/createActorHooks.d.ts.map +0 -1
  43. package/dist/createActorHooks.js +0 -17
  44. package/dist/createActorHooks.js.map +0 -1
  45. package/dist/createInfiniteQuery.d.ts +0 -144
  46. package/dist/createInfiniteQuery.d.ts.map +0 -1
  47. package/dist/createInfiniteQuery.js +0 -174
  48. package/dist/createInfiniteQuery.js.map +0 -1
  49. package/dist/createMutation.d.ts +0 -30
  50. package/dist/createMutation.d.ts.map +0 -1
  51. package/dist/createMutation.js +0 -192
  52. package/dist/createMutation.js.map +0 -1
  53. package/dist/createQuery.d.ts +0 -30
  54. package/dist/createQuery.d.ts.map +0 -1
  55. package/dist/createQuery.js +0 -117
  56. package/dist/createQuery.js.map +0 -1
  57. package/dist/createSuspenseInfiniteQuery.d.ts +0 -147
  58. package/dist/createSuspenseInfiniteQuery.d.ts.map +0 -1
  59. package/dist/createSuspenseInfiniteQuery.js +0 -177
  60. package/dist/createSuspenseInfiniteQuery.js.map +0 -1
  61. package/dist/createSuspenseQuery.d.ts +0 -25
  62. package/dist/createSuspenseQuery.d.ts.map +0 -1
  63. package/dist/createSuspenseQuery.js +0 -111
  64. package/dist/createSuspenseQuery.js.map +0 -1
  65. package/dist/defineReactor.d.ts +0 -125
  66. package/dist/defineReactor.d.ts.map +0 -1
  67. package/dist/defineReactor.js +0 -180
  68. package/dist/defineReactor.js.map +0 -1
  69. package/dist/hooks/createAuthHooks.d.ts +0 -43
  70. package/dist/hooks/createAuthHooks.d.ts.map +0 -1
  71. package/dist/hooks/createAuthHooks.js +0 -131
  72. package/dist/hooks/createAuthHooks.js.map +0 -1
  73. package/dist/hooks/index.d.ts +0 -21
  74. package/dist/hooks/index.d.ts.map +0 -1
  75. package/dist/hooks/index.js +0 -24
  76. package/dist/hooks/index.js.map +0 -1
  77. package/dist/hooks/useActorInfiniteQuery.d.ts +0 -39
  78. package/dist/hooks/useActorInfiniteQuery.d.ts.map +0 -1
  79. package/dist/hooks/useActorInfiniteQuery.js +0 -56
  80. package/dist/hooks/useActorInfiniteQuery.js.map +0 -1
  81. package/dist/hooks/useActorMethod.d.ts +0 -115
  82. package/dist/hooks/useActorMethod.d.ts.map +0 -1
  83. package/dist/hooks/useActorMethod.js +0 -250
  84. package/dist/hooks/useActorMethod.js.map +0 -1
  85. package/dist/hooks/useActorMutation.d.ts +0 -48
  86. package/dist/hooks/useActorMutation.d.ts.map +0 -1
  87. package/dist/hooks/useActorMutation.js +0 -69
  88. package/dist/hooks/useActorMutation.js.map +0 -1
  89. package/dist/hooks/useActorQuery.d.ts +0 -32
  90. package/dist/hooks/useActorQuery.d.ts.map +0 -1
  91. package/dist/hooks/useActorQuery.js +0 -46
  92. package/dist/hooks/useActorQuery.js.map +0 -1
  93. package/dist/hooks/useActorSuspenseInfiniteQuery.d.ts +0 -39
  94. package/dist/hooks/useActorSuspenseInfiniteQuery.d.ts.map +0 -1
  95. package/dist/hooks/useActorSuspenseInfiniteQuery.js +0 -56
  96. package/dist/hooks/useActorSuspenseInfiniteQuery.js.map +0 -1
  97. package/dist/hooks/useActorSuspenseQuery.d.ts +0 -32
  98. package/dist/hooks/useActorSuspenseQuery.d.ts.map +0 -1
  99. package/dist/hooks/useActorSuspenseQuery.js +0 -47
  100. package/dist/hooks/useActorSuspenseQuery.js.map +0 -1
  101. package/dist/types.d.ts +0 -270
  102. package/dist/types.d.ts.map +0 -1
  103. package/dist/types.js +0 -5
  104. package/dist/types.js.map +0 -1
  105. package/dist/utils.d.ts +0 -51
  106. package/dist/utils.d.ts.map +0 -1
  107. package/dist/utils.js +0 -105
  108. package/dist/utils.js.map +0 -1
  109. package/dist/validation.d.ts +0 -131
  110. package/dist/validation.d.ts.map +0 -1
  111. package/dist/validation.js +0 -125
  112. package/dist/validation.js.map +0 -1
  113. package/src/auth/authentication-manager.ts +0 -860
  114. package/src/auth/constants.ts +0 -32
  115. package/src/auth/createIdentityAttributeHooks.ts +0 -143
  116. package/src/auth/identity-attributes-manager.ts +0 -131
  117. package/src/auth/identity-attributes.ts +0 -270
  118. package/src/auth/index.ts +0 -7
  119. package/src/auth/local-ii-probe.ts +0 -147
  120. package/src/auth/types.ts +0 -200
  121. package/src/createActorHooks.ts +0 -220
  122. package/src/createInfiniteQuery.ts +0 -578
  123. package/src/createMutation.ts +0 -341
  124. package/src/createQuery.ts +0 -237
  125. package/src/createSuspenseInfiniteQuery.ts +0 -601
  126. package/src/createSuspenseQuery.ts +0 -234
  127. package/src/defineReactor.ts +0 -324
  128. package/src/hooks/createAuthHooks.ts +0 -189
  129. package/src/hooks/index.ts +0 -103
  130. package/src/hooks/useActorInfiniteQuery.ts +0 -205
  131. package/src/hooks/useActorMethod.ts +0 -507
  132. package/src/hooks/useActorMutation.ts +0 -205
  133. package/src/hooks/useActorQuery.ts +0 -124
  134. package/src/hooks/useActorSuspenseInfiniteQuery.ts +0 -205
  135. package/src/hooks/useActorSuspenseQuery.ts +0 -132
  136. package/src/index.ts +0 -23
  137. package/src/types.ts +0 -499
  138. package/src/utils.ts +0 -121
  139. package/src/validation.ts +0 -202
@@ -1,46 +0,0 @@
1
- /**
2
- * Ask a locally deployed Internet Identity canister what it actually serves.
3
- *
4
- * `localInternetIdentityProvider` builds `http://<id>.localhost:<port>/authorize`,
5
- * the id.ai-era path. Whether that works depends on which Internet Identity
6
- * build is installed, and the window is narrow:
7
- *
8
- * - up to `release-2025-03-07`, the SPA lived at `/` and used a `#authorize`
9
- * fragment; `/authorize` is not an asset
10
- * - `release-2026-01-05` through `release-2026-03-16` serve `/authorize`
11
- * - from `release-2026-03-23` the frontend left the canister entirely (the id.ai
12
- * split), so `/authorize` 404s even on `.raw`
13
- *
14
- * Outside that window the login popup renders the gateway's
15
- * "Response Verification Error" page and the app simply waits until the user
16
- * closes it. Nothing points at the cause.
17
- *
18
- * Asking the canister over the agent avoids the gateway, so the answer is about
19
- * the canister's assets rather than about how the gateway felt about them.
20
- */
21
- import { type HttpAgent } from "@icp-sdk/core/agent";
22
- /** Where a given Internet Identity build expects the sign-in flow to start. */
23
- export type AuthorizePath = "/authorize" | "/#authorize";
24
- export interface LocalIiProbe {
25
- /** The path that works, or `null` when the canister serves no sign-in UI. */
26
- path: AuthorizePath | null;
27
- /**
28
- * The probe could not reach a conclusion — the canister was unreachable, or
29
- * it does not expose `http_request` at all. Callers keep their existing
30
- * behaviour rather than blocking a login that might well work.
31
- */
32
- inconclusive: boolean;
33
- }
34
- /**
35
- * Determine which authorize path a locally deployed Internet Identity serves.
36
- *
37
- * Never throws. A probe that cannot answer returns `inconclusive`, because a
38
- * diagnostic that blocks a working setup is worse than the failure it explains.
39
- */
40
- export declare function probeLocalInternetIdentity(agent: HttpAgent, canisterId: string): Promise<LocalIiProbe>;
41
- /**
42
- * The error a login gets when the installed build serves no sign-in UI, in
43
- * place of a 503 page inside a popup the app cannot see.
44
- */
45
- export declare function localInternetIdentityUnavailableError(canisterId: string): Error;
46
- //# sourceMappingURL=local-ii-probe.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"local-ii-probe.d.ts","sourceRoot":"","sources":["../../src/auth/local-ii-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAqC3D,+EAA+E;AAC/E,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,aAAa,CAAA;AAExD,MAAM,WAAW,YAAY;IAC3B,6EAA6E;IAC7E,IAAI,EAAE,aAAa,GAAG,IAAI,CAAA;IAC1B;;;;OAIG;IACH,YAAY,EAAE,OAAO,CAAA;CACtB;AAmBD;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAC9C,KAAK,EAAE,SAAS,EAChB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,YAAY,CAAC,CA+BvB;AAED;;;GAGG;AACH,wBAAgB,qCAAqC,CACnD,UAAU,EAAE,MAAM,GACjB,KAAK,CASP"}
@@ -1,102 +0,0 @@
1
- /**
2
- * Ask a locally deployed Internet Identity canister what it actually serves.
3
- *
4
- * `localInternetIdentityProvider` builds `http://<id>.localhost:<port>/authorize`,
5
- * the id.ai-era path. Whether that works depends on which Internet Identity
6
- * build is installed, and the window is narrow:
7
- *
8
- * - up to `release-2025-03-07`, the SPA lived at `/` and used a `#authorize`
9
- * fragment; `/authorize` is not an asset
10
- * - `release-2026-01-05` through `release-2026-03-16` serve `/authorize`
11
- * - from `release-2026-03-23` the frontend left the canister entirely (the id.ai
12
- * split), so `/authorize` 404s even on `.raw`
13
- *
14
- * Outside that window the login popup renders the gateway's
15
- * "Response Verification Error" page and the app simply waits until the user
16
- * closes it. Nothing points at the cause.
17
- *
18
- * Asking the canister over the agent avoids the gateway, so the answer is about
19
- * the canister's assets rather than about how the gateway felt about them.
20
- */
21
- import { Actor } from "@icp-sdk/core/agent";
22
- /** The `http_request` query every asset-serving canister exposes. */
23
- const httpInterface = ({ IDL }) => {
24
- const HeaderField = IDL.Tuple(IDL.Text, IDL.Text);
25
- return IDL.Service({
26
- http_request: IDL.Func([
27
- IDL.Record({
28
- method: IDL.Text,
29
- url: IDL.Text,
30
- headers: IDL.Vec(HeaderField),
31
- body: IDL.Vec(IDL.Nat8),
32
- }),
33
- ], [
34
- IDL.Record({
35
- status_code: IDL.Nat16,
36
- headers: IDL.Vec(HeaderField),
37
- body: IDL.Vec(IDL.Nat8),
38
- }),
39
- ], ["query"]),
40
- });
41
- };
42
- async function statusOf(actor, url) {
43
- try {
44
- const response = await actor.http_request({
45
- method: "GET",
46
- url,
47
- headers: [],
48
- body: new Uint8Array(),
49
- });
50
- return response.status_code;
51
- }
52
- catch {
53
- return undefined;
54
- }
55
- }
56
- /**
57
- * Determine which authorize path a locally deployed Internet Identity serves.
58
- *
59
- * Never throws. A probe that cannot answer returns `inconclusive`, because a
60
- * diagnostic that blocks a working setup is worse than the failure it explains.
61
- */
62
- export async function probeLocalInternetIdentity(agent, canisterId) {
63
- let actor;
64
- try {
65
- actor = Actor.createActor(httpInterface, {
66
- agent,
67
- canisterId,
68
- });
69
- }
70
- catch {
71
- return { path: "/authorize", inconclusive: true };
72
- }
73
- const authorize = await statusOf(actor, "/authorize");
74
- // The canister does not answer http_request at all — not an asset canister,
75
- // not deployed, or the replica is down. Not our call to make.
76
- if (authorize === undefined) {
77
- return { path: "/authorize", inconclusive: true };
78
- }
79
- if (authorize >= 200 && authorize < 300) {
80
- return { path: "/authorize", inconclusive: false };
81
- }
82
- // Pre-2026 builds serve the SPA at the root and drive the flow from a
83
- // `#authorize` fragment, which is a path the gateway never sees.
84
- const root = await statusOf(actor, "/");
85
- if (root !== undefined && root >= 200 && root < 300) {
86
- return { path: "/#authorize", inconclusive: false };
87
- }
88
- return { path: null, inconclusive: false };
89
- }
90
- /**
91
- * The error a login gets when the installed build serves no sign-in UI, in
92
- * place of a 503 page inside a popup the app cannot see.
93
- */
94
- export function localInternetIdentityUnavailableError(canisterId) {
95
- return new Error(`[ic-reactor] The Internet Identity canister ${canisterId} does not serve a sign-in UI: ` +
96
- `neither /authorize nor / returned a page. Internet Identity builds from ` +
97
- `release-2026-03-23 onward moved their frontend out of the canister (the id.ai split) ` +
98
- `and cannot be used locally. Install internet_identity_dev.wasm from release-2026-03-16, ` +
99
- `the newest build that still self-serves /authorize, or point \`identityProvider\` at a ` +
100
- `provider you host yourself.`);
101
- }
102
- //# sourceMappingURL=local-ii-probe.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"local-ii-probe.js","sourceRoot":"","sources":["../../src/auth/local-ii-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,KAAK,EAAkB,MAAM,qBAAqB,CAAA;AAG3D,qEAAqE;AACrE,MAAM,aAAa,GAAyB,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE;IACtD,MAAM,WAA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X,CAAC,CAAA;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,CAAA;IACnD,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC,CAAA;IAErD,4EAA4E;IAC5E,8DAA8D;IAC9D,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,CAAA;IACnD,CAAC;IAED,IAAI,SAAS,IAAI,GAAG,IAAI,SAAS,GAAG,GAAG,EAAE,CAAC;QACxC,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,CAAA;IACpD,CAAC;IAED,sEAAsE;IACtE,iEAAiE;IACjE,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IACvC,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,IAAI,GAAG,IAAI,IAAI,GAAG,GAAG,EAAE,CAAC;QACpD,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,YAAY,EAAE,KAAK,EAAE,CAAA;IACrD,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,CAAA;AAC5C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qCAAqC,CACnD,UAAkB;IAElB,OAAO,IAAI,KAAK,CACd,+CAA+C,UAAU,gCAAgC;QACvF,0EAA0E;QAC1E,uFAAuF;QACvF,0FAA0F;QAC1F,yFAAyF;QACzF,6BAA6B,CAChC,CAAA;AACH,CAAC"}
@@ -1,179 +0,0 @@
1
- import type { Identity, SignIdentity } from "@icp-sdk/core/agent";
2
- import type { PartialIdentity } from "@icp-sdk/core/identity";
3
- import type { Principal } from "@icp-sdk/core/principal";
4
- export interface SignedIdentityAttributes {
5
- data: Uint8Array;
6
- signature: Uint8Array;
7
- }
8
- /**
9
- * The 32-byte nonce issued by the relying-party canister.
10
- *
11
- * A function (or promise) lets the Internet Identity window open while the
12
- * nonce is still being fetched, so the popup is opened inside the user gesture
13
- * instead of after it. `@icp-sdk/auth` v8 requires the function form, and
14
- * IC Reactor normalizes whichever of these you pass into that thunk.
15
- */
16
- export type IdentityAttributeNonce = Uint8Array | Promise<Uint8Array> | (() => Uint8Array | Promise<Uint8Array>);
17
- export interface IdentityAttributeRequest {
18
- keys: string[];
19
- nonce: IdentityAttributeNonce;
20
- }
21
- export interface IdentityAttributeValues {
22
- email?: string;
23
- name?: string;
24
- verified_email?: string;
25
- [key: string]: string | undefined;
26
- }
27
- export interface IdentityAttributeResult {
28
- principal: string;
29
- requestedKeys: string[];
30
- signedAttributes: SignedIdentityAttributes;
31
- decodedAttributes: IdentityAttributeValues;
32
- completedAt: string;
33
- }
34
- /**
35
- * The providers that Internet Identity supports for one-click sign-in. Only
36
- * these three reach the underlying auth client.
37
- */
38
- type IdentityAttributeOpenIdProviderAlias = "google" | "apple" | "microsoft";
39
- /**
40
- * An OpenID provider, either as a well-known alias or as a raw issuer URL.
41
- *
42
- * The two forms are **not** interchangeable, and what each one does depends on
43
- * where it is passed:
44
- *
45
- * - An alias (`"google" | "apple" | "microsoft"`) is forwarded to the auth
46
- * client, which adds an `openid` search param to the identity provider URL so
47
- * the user signs in through that provider directly.
48
- * - Any other string is treated as a raw issuer URL and is **never** forwarded
49
- * to the auth client, so it never affects how the user signs in. It is only
50
- * meaningful when passed to {@link IdentityAttributesManager.requestOpenId}
51
- * (or `identityAttributeKeys`), which scopes the requested keys to
52
- * `openid:<issuer>:<key>`. Passed anywhere else it has no effect at all.
53
- */
54
- export type IdentityAttributeOpenIdProvider = IdentityAttributeOpenIdProviderAlias | (string & {});
55
- /** Session key algorithm used for each sign-in. */
56
- export type AuthClientKeyType = "ECDSA" | "Ed25519";
57
- /** Structural shape of an `@icp-sdk/auth` `AuthClientStorage`. */
58
- export interface AuthClientStorageLike {
59
- get(key: string): Promise<string | CryptoKeyPair | null>;
60
- set(key: string, value: string | CryptoKeyPair): Promise<void>;
61
- remove(key: string): Promise<void>;
62
- }
63
- /** Idle-session configuration forwarded to the underlying AuthClient. */
64
- export interface AuthClientIdleOptions {
65
- /** Called once the user has been idle for `idleTimeout` ms. */
66
- onIdle?: () => unknown;
67
- /** Idle timeout in ms. @default 600_000 (10 minutes) */
68
- idleTimeout?: number;
69
- /** Treat scroll events as activity. @default false */
70
- captureScroll?: boolean;
71
- /** Scroll debounce in ms. @default 100 */
72
- scrollDebounce?: number;
73
- /** Disable idle detection entirely. @default false */
74
- disableIdle?: boolean;
75
- /**
76
- * Disable the built-in idle callback, which signs the user out and reloads
77
- * the page. @default false
78
- */
79
- disableDefaultIdleCallback?: boolean;
80
- }
81
- export interface AuthenticationClientOptions {
82
- /** Identity provider URL. @default "https://id.ai/authorize" */
83
- identityProvider?: string | URL;
84
- /** `window.open` features string for the identity provider popup. */
85
- windowOpenerFeatures?: string;
86
- /**
87
- * Provider for one-click sign-in.
88
- *
89
- * Only the `"google" | "apple" | "microsoft"` aliases reach the auth client.
90
- * Any other value is dropped here and has **no effect** — raw issuer URLs are
91
- * only meaningful on `requestOpenId`, where they scope the requested keys.
92
- * @see {@link IdentityAttributeOpenIdProvider}
93
- */
94
- openIdProvider?: IdentityAttributeOpenIdProvider;
95
- /**
96
- * Derivation origin for the identity provider.
97
- *
98
- * Required when the app is served from more than one origin (e.g. a custom
99
- * domain plus `<canisterId>.icp0.io`) and every origin must resolve to the
100
- * same principal.
101
- * @see https://github.com/dfinity/internet-identity/blob/main/docs/internet-identity-spec.adoc
102
- */
103
- derivationOrigin?: string | URL;
104
- /** Persistent storage backend. @default IndexedDB */
105
- storage?: AuthClientStorageLike;
106
- /**
107
- * Session key algorithm. Use `"Ed25519"` when the storage backend cannot
108
- * hold a `CryptoKey`. @default "ECDSA"
109
- */
110
- keyType?: AuthClientKeyType;
111
- /**
112
- * Idle timeout configuration. Pass `{ disableIdle: true }` to opt out of the
113
- * default behaviour, which signs the user out and reloads after 10 minutes.
114
- */
115
- idleOptions?: AuthClientIdleOptions;
116
- /** An existing identity to authenticate via delegation. */
117
- identity?: SignIdentity | PartialIdentity;
118
- /**
119
- * How the client talks to the identity provider. `"redirect"` requires
120
- * `@icp-sdk/auth` v8 or later and is ignored by older versions.
121
- * @default "window"
122
- */
123
- transport?: "window" | "redirect";
124
- }
125
- export interface AuthClientSignInOptions {
126
- maxTimeToLive?: bigint;
127
- targets?: Principal[];
128
- }
129
- export interface AuthenticationSignInOptions extends AuthClientSignInOptions, AuthenticationClientOptions {
130
- onSuccess?: () => void | Promise<void>;
131
- onError?: (error?: string) => void | Promise<void>;
132
- }
133
- export interface RequestIdentityAttributesParameters extends AuthenticationClientOptions {
134
- keys: string[];
135
- nonce: IdentityAttributeNonce;
136
- /**
137
- * Sign in as part of the same identity-provider interaction.
138
- * @default true
139
- */
140
- signIn?: boolean;
141
- maxTimeToLive?: bigint;
142
- targets?: Principal[];
143
- }
144
- export interface RequestOpenIdIdentityAttributesParameters extends Omit<RequestIdentityAttributesParameters, "openIdProvider"> {
145
- /**
146
- * Provider the requested `keys` are scoped to, producing
147
- * `openid:<issuer>:<key>`.
148
- *
149
- * Passing one of the `"google" | "apple" | "microsoft"` aliases additionally
150
- * routes sign-in through that provider, so the user grants attribute access
151
- * in the same step. A raw issuer URL only scopes the keys.
152
- * @see {@link IdentityAttributeOpenIdProvider}
153
- */
154
- openIdProvider: IdentityAttributeOpenIdProvider;
155
- }
156
- /**
157
- * Structural subset of `@icp-sdk/auth`'s `AuthClient` that IC Reactor relies
158
- * on. Declared locally so `@icp-sdk/auth` stays an optional peer dependency.
159
- */
160
- export interface AuthClientLike {
161
- getIdentity(): Promise<Identity> | Identity;
162
- isAuthenticated(): Promise<boolean> | boolean;
163
- signIn(options?: AuthClientSignInOptions): Promise<Identity>;
164
- signOut(options?: {
165
- returnTo?: string;
166
- }): Promise<void>;
167
- requestAttributes(params: {
168
- keys: string[];
169
- nonce: () => Promise<Uint8Array>;
170
- }): Promise<SignedIdentityAttributes>;
171
- }
172
- export interface AuthState {
173
- identity: Identity | null;
174
- isAuthenticating: boolean;
175
- isAuthenticated: boolean;
176
- error: Error | undefined;
177
- }
178
- export {};
179
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/auth/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,UAAU,CAAA;IAChB,SAAS,EAAE,UAAU,CAAA;CACtB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,sBAAsB,GAChC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAA;AAE7E,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,KAAK,EAAE,sBAAsB,CAAA;CAC9B;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CAClC;AAED,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,gBAAgB,EAAE,wBAAwB,CAAA;IAC1C,iBAAiB,EAAE,uBAAuB,CAAA;IAC1C,WAAW,EAAE,MAAM,CAAA;CACpB;AAED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AA;IAC5D,OAAO,CAAC,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACvD,iBAAiB,CAAC,MAAM,EAAE;QACxB,IAAI,EAAE,MAAM,EAAE,CAAA;QAGd,KAAK,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAA;KACjC,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAA;CACtC;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAA;IACzB,gBAAgB,EAAE,OAAO,CAAA;IACzB,eAAe,EAAE,OAAO,CAAA;IACxB,KAAK,EAAE,KAAK,GAAG,SAAS,CAAA;CACzB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/auth/types.ts"],"names":[],"mappings":""}
@@ -1,52 +0,0 @@
1
- /**
2
- * Actor Hooks Factory - Creates a full set of React hooks for a reactor instance.
3
- *
4
- * This is the primary entry point for using the library in React applications.
5
- * It generates type-safe hooks for:
6
- * - Queries (useActorQuery)
7
- * - Suspense Queries (useActorSuspenseQuery)
8
- * - Infinite Queries (useActorInfiniteQuery)
9
- * - Suspense Infinite Queries (useActorSuspenseInfiniteQuery)
10
- * - Mutations (useActorMutation)
11
- *
12
- * @example
13
- * const { useActorQuery, useActorMutation } = createActorHooks(reactor)
14
- *
15
- * // In component
16
- * const { data } = useActorQuery({ functionName: 'get_user' })
17
- * const { mutate } = useActorMutation({ functionName: 'update_user' })
18
- */
19
- import { Reactor, DisplayReactor, ReactorReturnErr, ReactorReturnOk, ReactorQueryData, BaseActor, FunctionName, ReactorArgs, TransformKey } from "@ic-reactor/core";
20
- import { UseQueryResult, UseSuspenseQueryResult, UseInfiniteQueryResult, UseSuspenseInfiniteQueryResult, UseMutationResult, InfiniteData } from "@tanstack/react-query";
21
- import { useActorMethod, UseActorMethodParameters } from "./hooks/useActorMethod.js";
22
- import type { CallConfig } from "@icp-sdk/core/agent";
23
- import { InfiniteQueryConfig } from "./createInfiniteQuery.js";
24
- import { SuspenseInfiniteQueryConfig } from "./createSuspenseInfiniteQuery.js";
25
- import { QueryConfig, SuspenseQueryConfig, MutationConfig } from "./types.js";
26
- /**
27
- * The bound query hooks forward their config to `useActorQuery` and
28
- * `useActorSuspenseQuery`, which take `callConfig`. `QueryConfig` is shared with
29
- * `createQuery`, which does not use it, so it is added here and not there.
30
- */
31
- type WithCallConfig<Config> = Config & {
32
- /** Agent call configuration (canisterId override, effectiveCanisterId, etc.) */
33
- callConfig?: CallConfig;
34
- };
35
- export type ActorHooks<Service, Transform extends TransformKey> = {
36
- useActorQuery: {
37
- <Method extends FunctionName<Service>>(config: WithCallConfig<QueryConfig<Service, Method, Transform, ReactorQueryData<ReactorReturnOk<Service, Method, Transform>>>>): UseQueryResult<ReactorQueryData<ReactorReturnOk<Service, Method, Transform>>, ReactorReturnErr<Service, Method, Transform>>;
38
- <Method extends FunctionName<Service>, TData>(config: WithCallConfig<QueryConfig<Service, Method, Transform, TData>>): UseQueryResult<TData, ReactorReturnErr<Service, Method, Transform>>;
39
- };
40
- useActorSuspenseQuery: {
41
- <Method extends FunctionName<Service>>(config: WithCallConfig<SuspenseQueryConfig<Service, Method, Transform, ReactorQueryData<ReactorReturnOk<Service, Method, Transform>>>>): UseSuspenseQueryResult<ReactorQueryData<ReactorReturnOk<Service, Method, Transform>>, ReactorReturnErr<Service, Method, Transform>>;
42
- <Method extends FunctionName<Service>, TData>(config: WithCallConfig<SuspenseQueryConfig<Service, Method, Transform, TData>>): UseSuspenseQueryResult<TData, ReactorReturnErr<Service, Method, Transform>>;
43
- };
44
- useActorInfiniteQuery: <Method extends FunctionName<Service>, TPageParam = unknown, Selected = InfiniteData<ReactorQueryData<ReactorReturnOk<Service, Method, Transform>>, TPageParam>>(config: InfiniteQueryConfig<Service, Method, Transform, TPageParam, Selected>) => UseInfiniteQueryResult<Selected, ReactorReturnErr<Service, Method, Transform>>;
45
- useActorSuspenseInfiniteQuery: <Method extends FunctionName<Service>, TPageParam = unknown, Selected = InfiniteData<ReactorQueryData<ReactorReturnOk<Service, Method, Transform>>, TPageParam>>(config: SuspenseInfiniteQueryConfig<Service, Method, Transform, TPageParam, Selected>) => UseSuspenseInfiniteQueryResult<Selected, ReactorReturnErr<Service, Method, Transform>>;
46
- useActorMutation: <Method extends FunctionName<Service>, TOnMutateResult = unknown>(config: MutationConfig<Service, Method, Transform, TOnMutateResult>) => UseMutationResult<ReactorReturnOk<Service, Method, Transform>, ReactorReturnErr<Service, Method, Transform>, ReactorArgs<Service, Method, Transform>, TOnMutateResult>;
47
- useActorMethod: <Method extends FunctionName<Service>>(config: Omit<UseActorMethodParameters<Service, Method, Transform>, "reactor">) => ReturnType<typeof useActorMethod<Service, Method, Transform>>;
48
- };
49
- export declare function createActorHooks<Service>(reactor: DisplayReactor<Service>): ActorHooks<Service, "display">;
50
- export declare function createActorHooks<Service = BaseActor, Transform extends TransformKey = "candid">(reactor: Reactor<Service, Transform>): ActorHooks<Service, Transform>;
51
- export {};
52
- //# sourceMappingURL=createActorHooks.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createActorHooks.d.ts","sourceRoot":"","sources":["../src/createActorHooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EACL,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,WAAW,EACX,YAAY,EACb,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,sBAAsB,EACtB,8BAA8B,EAC9B,iBAAiB,EACjB,YAAY,EACb,MAAM,uBAAuB,CAAA;AAM9B,OAAO,EACL,cAAc,EACd,wBAAwB,EACzB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAA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AED,gBAAgB,EAAE,CAChB,MAAM,SAAS,YAAY,CAAC,OAAO,CAAC,EACpC,eAAe,GAAG,OAAO,EAEzB,MAAM,EAAE,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,CAAC,KAChE,iBAAiB,CACpB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAC3C,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAG5C,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EACvC,eAAe,CAChB,CAAA;IAED,cAAc,EAAE,CAAC,MAAM,SAAS,YAAY,CAAC,OAAO,CAAC,EACnD,MAAM,EAAE,IAAI,CACV,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EACpD,SAAS,CACV,KACE,UAAU,CAAC,OAAO,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAA;CACnE,CAAA;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EACtC,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,GAC/B,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;AAEjC,wBAAgB,gBAAgB,CAC9B,OAAO,GAAG,SAAS,EACnB,SAAS,SAAS,YAAY,GAAG,QAAQ,EACzC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA"}
@@ -1,17 +0,0 @@
1
- import { useActorQuery } from "./hooks/useActorQuery.js";
2
- import { useActorSuspenseQuery } from "./hooks/useActorSuspenseQuery.js";
3
- import { useActorInfiniteQuery } from "./hooks/useActorInfiniteQuery.js";
4
- import { useActorSuspenseInfiniteQuery } from "./hooks/useActorSuspenseInfiniteQuery.js";
5
- import { useActorMutation } from "./hooks/useActorMutation.js";
6
- import { useActorMethod, } from "./hooks/useActorMethod.js";
7
- export function createActorHooks(reactor) {
8
- return {
9
- useActorQuery: ((config) => useActorQuery({ ...config, reactor })),
10
- useActorSuspenseQuery: ((config) => useActorSuspenseQuery({ ...config, reactor })),
11
- useActorInfiniteQuery: ((config) => useActorInfiniteQuery({ ...config, reactor })),
12
- useActorSuspenseInfiniteQuery: ((config) => useActorSuspenseInfiniteQuery({ ...config, reactor })),
13
- useActorMutation: ((config) => useActorMutation({ ...config, reactor })),
14
- useActorMethod: (config) => useActorMethod({ ...config, reactor }),
15
- };
16
- }
17
- //# sourceMappingURL=createActorHooks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createActorHooks.js","sourceRoot":"","sources":["../src/createActorHooks.ts"],"names":[],"mappings":"AAqCA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AACxE,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAA;AACxF,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,EACL,cAAc,GAEf,MAAM,2BAA2B,CAAA;AAqIlC,MAAM,UAAU,gBAAgB,CAC9B,OAAoC;IAEpC,OAAO;QACL,aAAa,EAAE,CAAC,CAAC,MAAW,EAAE,EAAE,CAC9B,aAAa,CAAC,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,CAAC,CAGrB;QAElB,qBAAqB,EAAE,CAAC,CAAC,MAAW,EAAE,EAAE,CACtC,qBAAqB,CAAC,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,CAAC,CAGrB;QAE1B,qBAAqB,EAAE,CAAC,CAAC,MAAW,EAAE,EAAE,CACtC,qBAAqB,CAAC,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,CAAC,CAGrB;QAE1B,6BAA6B,EAAE,CAAC,CAAC,MAAW,EAAE,EAAE,CAC9C,6BAA6B,CAAC,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,CAAC,CAGrB;QAElC,gBAAgB,EAAE,CAAC,CAAC,MAAW,EAAE,EAAE,CACjC,gBAAgB,CAAC,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,CAAC,CAGrB;QAErB,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CACzB,cAAc,CAAC,EAAE,GAAG,MAAM,EAAE,OAAO,EAIlC,CAAC;KACL,CAAA;AACH,CAAC"}
@@ -1,144 +0,0 @@
1
- /**
2
- * Infinite Query Factory - Generic wrapper for React Query paginated canister data
3
- *
4
- * Creates unified fetch/hook/invalidate functions for any paginated canister method.
5
- * Works with any Reactor instance.
6
- *
7
- * @example
8
- * const postsQuery = createInfiniteQuery(reactor, {
9
- * functionName: "get_posts",
10
- * initialPageParam: 0,
11
- * getArgs: (cursor) => [{ cursor, limit: 10 }],
12
- * getNextPageParam: (lastPage) => lastPage.nextCursor,
13
- * })
14
- *
15
- * // In component
16
- * const { data, fetchNextPage, hasNextPage } = postsQuery.useInfiniteQuery()
17
- *
18
- * // Flatten all pages
19
- * const allPosts = data?.pages.flatMap(page => page.posts)
20
- *
21
- * // Invalidate cache
22
- * postsQuery.invalidate()
23
- */
24
- import type { Reactor, FunctionName, ReactorArgs, BaseActor, TransformKey, ReactorReturnOk, ReactorQueryData, ReactorReturnErr } from "@ic-reactor/core";
25
- import { QueryKey, InfiniteData, UseInfiniteQueryResult, UseInfiniteQueryOptions, InfiniteQueryObserverOptions } from "@tanstack/react-query";
26
- import { CallConfig } from "@icp-sdk/core/agent";
27
- import { NoInfer } from "./types.js";
28
- type InfiniteQueryFactoryFn<Service, Method extends FunctionName<Service>, Transform extends TransformKey, TPageParam, Selected> = {
29
- (getArgs: (pageParam: TPageParam) => ReactorArgs<Service, Method, Transform>): InfiniteQueryResult<InfiniteQueryPageData<Service, Method, Transform>, TPageParam, Selected, InfiniteQueryError<Service, Method, Transform>>;
30
- };
31
- /** The raw page data type returned by the query function */
32
- export type InfiniteQueryPageData<Service = BaseActor, Method extends FunctionName<Service> = FunctionName<Service>, Transform extends TransformKey = "candid"> = ReactorQueryData<ReactorReturnOk<Service, Method, Transform>>;
33
- /** The error type for infinite queries */
34
- export type InfiniteQueryError<Service = BaseActor, Method extends FunctionName<Service> = FunctionName<Service>, Transform extends TransformKey = "candid"> = ReactorReturnErr<Service, Method, Transform>;
35
- /**
36
- * Configuration for createActorInfiniteQuery.
37
- * Extends InfiniteQueryObserverOptions to accept standard TanStack Query
38
- * infinite-query options at the create level (e.g. refetchInterval,
39
- * refetchOnMount, refetchOnWindowFocus, retry, gcTime, networkMode).
40
- *
41
- * @template Service - The actor interface type
42
- * @template Method - The method name on the actor
43
- * @template Transform - The transformation key (identity, display, etc.)
44
- * @template TPageParam - The type of the page parameter
45
- * @template Selected - The type returned after select transformation
46
- */
47
- export interface InfiniteQueryConfig<Service = BaseActor, Method extends FunctionName<Service> = FunctionName<Service>, Transform extends TransformKey = "candid", TPageParam = unknown, Selected = InfiniteData<InfiniteQueryPageData<Service, Method, Transform>, TPageParam>> extends Omit<InfiniteQueryObserverOptions<InfiniteQueryPageData<Service, Method, Transform>, InfiniteQueryError<Service, Method, Transform>, Selected, QueryKey, TPageParam>, "queryKey" | "queryFn"> {
48
- /** The method to call on the canister */
49
- functionName: Method;
50
- /** Call configuration for the actor method */
51
- callConfig?: CallConfig;
52
- /** Custom query key (optional, auto-generated if not provided) */
53
- queryKey?: QueryKey;
54
- /** Initial page parameter */
55
- initialPageParam: TPageParam;
56
- /** Function to get args from page parameter */
57
- getArgs: (pageParam: TPageParam) => ReactorArgs<Service, Method, Transform>;
58
- /**
59
- * Narrows what the cache key derives from the call arguments.
60
- *
61
- * By default the key is scoped by `getArgs(initialPageParam)`, so two
62
- * infinite queries on the same method with different arguments stay in
63
- * separate cache entries. Supply this when those args embed the cursor and
64
- * only part of them identifies the query — return the stable, serializable
65
- * portion (typically everything except the pagination field).
66
- */
67
- getKeyArgs?: (args: ReactorArgs<Service, Method, Transform>) => unknown;
68
- /** Function to determine next page parameter */
69
- getNextPageParam: (lastPage: InfiniteQueryPageData<Service, Method, Transform>, allPages: InfiniteQueryPageData<Service, Method, Transform>[], lastPageParam: TPageParam, allPageParams: TPageParam[]) => TPageParam | undefined | null;
70
- /** Function to determine previous page parameter (for bi-directional) */
71
- getPreviousPageParam?: (firstPage: InfiniteQueryPageData<Service, Method, Transform>, allPages: InfiniteQueryPageData<Service, Method, Transform>[], firstPageParam: TPageParam, allPageParams: TPageParam[]) => TPageParam | undefined | null;
72
- }
73
- /**
74
- * Configuration for createActorInfiniteQueryFactory (without initialPageParam, getArgs determined at call time).
75
- */
76
- export type InfiniteQueryFactoryConfig<Service = BaseActor, Method extends FunctionName<Service> = FunctionName<Service>, Transform extends TransformKey = "candid", TPageParam = unknown, Selected = InfiniteData<InfiniteQueryPageData<Service, Method, Transform>, TPageParam>> = Omit<InfiniteQueryConfig<Service, Method, Transform, TPageParam, Selected>, "getArgs">;
77
- /**
78
- * useInfiniteQuery hook with chained select support.
79
- */
80
- export interface UseInfiniteQueryWithSelect<TPageData, TPageParam, Selected = InfiniteData<TPageData, TPageParam>, TError = Error> {
81
- (options?: Omit<UseInfiniteQueryOptions<TPageData, TError, Selected, QueryKey, TPageParam>, "select" | "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam" | "getPreviousPageParam">): UseInfiniteQueryResult<Selected, TError>;
82
- <TFinal = Selected>(options: Omit<UseInfiniteQueryOptions<TPageData, TError, TFinal, QueryKey, TPageParam>, "queryKey" | "queryFn" | "select" | "initialPageParam" | "getNextPageParam" | "getPreviousPageParam"> & {
83
- select: (data: Selected) => TFinal;
84
- }): UseInfiniteQueryResult<TFinal, TError>;
85
- }
86
- /**
87
- * Result from createActorInfiniteQuery
88
- *
89
- * @template TPageData - The raw page data type
90
- * @template TPageParam - The page parameter type
91
- * @template Selected - The type after select transformation
92
- * @template TError - The error type
93
- */
94
- export interface InfiniteQueryResult<TPageData, TPageParam, Selected = InfiniteData<TPageData, TPageParam>, TError = Error> {
95
- /** Fetch first page in loader (uses ensureQueryData for cache-first) */
96
- fetch: () => Promise<Selected>;
97
- /** React hook for components - supports pagination */
98
- useInfiniteQuery: UseInfiniteQueryWithSelect<TPageData, TPageParam, Selected, TError>;
99
- /** Invalidate the cache (refetches if query is active) */
100
- invalidate: () => Promise<void>;
101
- /** Get query key (for advanced React Query usage) */
102
- getQueryKey: () => QueryKey;
103
- /**
104
- * Read data directly from cache without fetching.
105
- * Returns undefined if data is not in cache.
106
- */
107
- getCacheData: {
108
- (): Selected | undefined;
109
- <TFinal>(select: (data: Selected) => TFinal): TFinal | undefined;
110
- };
111
- }
112
- export declare function createInfiniteQuery<Service, Transform extends TransformKey, Method extends FunctionName<Service> = FunctionName<Service>, TPageParam = unknown, Selected = InfiniteData<InfiniteQueryPageData<Service, Method, Transform>, TPageParam>>(reactor: Reactor<Service, Transform>, config: InfiniteQueryConfig<NoInfer<Service>, Method, Transform, TPageParam, Selected>): InfiniteQueryResult<InfiniteQueryPageData<Service, Method, Transform>, TPageParam, Selected, InfiniteQueryError<Service, Method, Transform>>;
113
- /**
114
- * Create an infinite query factory that accepts getArgs at call time.
115
- * Useful when pagination logic varies by context.
116
- *
117
- * @template Service - The actor interface type
118
- * @template Method - The method name on the actor
119
- * @template Transform - The transformation key (identity, display, etc.)
120
- * @template TPageParam - The page parameter type
121
- * @template Selected - The type returned after select transformation
122
- *
123
- * @param reactor - The Reactor instance
124
- * @param config - Infinite query configuration (without getArgs)
125
- * @returns A function that accepts getArgs and returns an ActorInfiniteQueryResult
126
- *
127
- * @example
128
- * const getPostsQuery = createActorInfiniteQueryFactory(reactor, {
129
- * functionName: "get_posts",
130
- * initialPageParam: 0,
131
- * getKeyArgs: (args) => {
132
- * const [{ userId }] = args
133
- * return [{ userId }]
134
- * },
135
- * getNextPageParam: (lastPage) => lastPage.nextCursor,
136
- * })
137
- *
138
- * // Create query with specific args builder
139
- * const userPostsQuery = getPostsQuery((cursor) => [{ userId, cursor, limit: 10 }])
140
- * const { data, fetchNextPage } = userPostsQuery.useInfiniteQuery()
141
- */
142
- export declare function createInfiniteQueryFactory<Service, Transform extends TransformKey, Method extends FunctionName<Service> = FunctionName<Service>, TPageParam = unknown, Selected = InfiniteData<InfiniteQueryPageData<Service, Method, Transform>, TPageParam>>(reactor: Reactor<Service, Transform>, config: InfiniteQueryFactoryConfig<NoInfer<Service>, Method, Transform, TPageParam, Selected>): InfiniteQueryFactoryFn<Service, Method, Transform, TPageParam, Selected>;
143
- export {};
144
- //# sourceMappingURL=createInfiniteQuery.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createInfiniteQuery.d.ts","sourceRoot":"","sources":["../src/createInfiniteQuery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,EACV,OAAO,EACP,YAAY,EACZ,WAAW,EACX,SAAS,EACT,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,QAAQ,EAER,YAAY,EACZ,sBAAsB,EACtB,uBAAuB,EAGvB,4BAA4B,EAC7B,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAOpC,KAAK,sBAAsB,CACzB,OAAO,EACP,MAAM,SAAS,YAAY,CAAC,OAAO,CAAC,EACpC,SAAS,SAAS,YAAY,EAC9B,UAAU,EACV,QAAQ,IACN;IACF,CACE,OAAO,EAAE,CAAC,SAAS,EAAE,UAAU,KAAK,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,GAC1E,mBAAmB,CACpB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EACjD,UAAU,EACV,QAAQ,EACR,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,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