@nkzw/fate 1.5.2 → 1.6.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/README.md +51 -155
- package/docs/api/classes/FateClient.md +35 -35
- package/docs/api/functions/clientRoot.md +1 -1
- package/docs/api/functions/createClient.md +1 -1
- package/docs/api/functions/createGraphQLTransport.md +1 -1
- package/docs/api/functions/createHTTPTransport.md +1 -1
- package/docs/api/functions/createTRPCTransport.md +1 -1
- package/docs/api/functions/defer.md +1 -1
- package/docs/api/functions/getDeferredMetadata.md +1 -1
- package/docs/api/functions/getListEntries.md +1 -1
- package/docs/api/functions/getSelectionPlan.md +1 -1
- package/docs/api/functions/graphqlMutation.md +1 -1
- package/docs/api/functions/isDeferred.md +1 -1
- package/docs/api/functions/isRecord.md +1 -1
- package/docs/api/functions/isViewTag.md +1 -1
- package/docs/api/functions/liveConnectionTopic.md +1 -1
- package/docs/api/functions/liveEntityTopic.md +1 -1
- package/docs/api/functions/liveGlobalConnectionTopic.md +1 -1
- package/docs/api/functions/mutation.md +1 -1
- package/docs/api/functions/toEntityId.md +1 -1
- package/docs/api/functions/view.md +1 -1
- package/docs/api/interfaces/FateThenable.md +3 -3
- package/docs/api/interfaces/Persistence.md +1 -1
- package/docs/api/interfaces/PersistenceSession.md +9 -9
- package/docs/api/interfaces/Transport.md +8 -8
- package/docs/api/server/classes/FateRequestError.md +5 -5
- package/docs/api/server/drizzle/functions/createDrizzleFate.md +1 -1
- package/docs/api/server/drizzle/functions/createDrizzleSourceAdapter.md +1 -1
- package/docs/api/server/drizzle/functions/createDrizzleSourceRegistry.md +1 -1
- package/docs/api/server/drizzle/type-aliases/DrizzleManyToManyConfig.md +1 -1
- package/docs/api/server/drizzle/type-aliases/DrizzleManyToManyInput.md +1 -1
- package/docs/api/server/drizzle/type-aliases/DrizzleQueryExtra.md +3 -3
- package/docs/api/server/drizzle/type-aliases/DrizzleSourceAdapter.md +9 -9
- package/docs/api/server/drizzle/type-aliases/DrizzleViewConfig.md +1 -1
- package/docs/api/server/functions/bindSourceProcedures.md +1 -1
- package/docs/api/server/functions/computed.md +1 -1
- package/docs/api/server/functions/count.md +1 -1
- package/docs/api/server/functions/createFateFetchHandler.md +1 -1
- package/docs/api/server/functions/createFateServer.md +1 -1
- package/docs/api/server/functions/createHonoFateHandler.md +1 -1
- package/docs/api/server/functions/createLiveEventBus.md +1 -1
- package/docs/api/server/functions/createNestedSourcePlan.md +1 -1
- package/docs/api/server/functions/createResolver.md +1 -1
- package/docs/api/server/functions/createSourcePlan.md +1 -1
- package/docs/api/server/functions/createSourceProcedures.md +1 -1
- package/docs/api/server/functions/dataView.md +1 -1
- package/docs/api/server/functions/field.md +1 -1
- package/docs/api/server/functions/getNestedSelection.md +1 -1
- package/docs/api/server/functions/getScopedArgs.md +1 -1
- package/docs/api/server/functions/hasNestedSelection.md +1 -1
- package/docs/api/server/functions/list.md +1 -1
- package/docs/api/server/functions/refetchSourceById.md +1 -1
- package/docs/api/server/functions/resolveSourceById.md +1 -1
- package/docs/api/server/functions/resolveSourceByIds.md +1 -1
- package/docs/api/server/functions/resolveSourceConnection.md +1 -1
- package/docs/api/server/functions/resolver.md +1 -1
- package/docs/api/server/functions/toPrismaSelect.md +1 -1
- package/docs/api/server/functions/withConnection.md +1 -1
- package/docs/api/server/prisma/functions/createPrismaFate.md +1 -1
- package/docs/api/server/prisma/functions/createPrismaSourceAdapter.md +1 -1
- package/docs/api/server/prisma/functions/createPrismaSourceRegistry.md +1 -1
- package/docs/api/server/prisma/functions/prismaConnectionArgs.md +1 -1
- package/docs/api/server/prisma/type-aliases/PrismaDelegate.md +4 -4
- package/docs/api/server/prisma/type-aliases/PrismaQueryExtra.md +1 -1
- package/docs/api/server/prisma/type-aliases/PrismaSourceAdapter.md +9 -9
- package/docs/api/server/prisma/type-aliases/PrismaViewConfig.md +1 -1
- package/docs/api/server/type-aliases/ComputedField.md +5 -5
- package/docs/api/server/type-aliases/ComputedSelection.md +1 -1
- package/docs/api/server/type-aliases/ConnectionItem.md +3 -3
- package/docs/api/server/type-aliases/ConnectionPagination.md +5 -5
- package/docs/api/server/type-aliases/ConnectionResult.md +3 -3
- package/docs/api/server/type-aliases/CountSelection.md +4 -4
- package/docs/api/server/type-aliases/CountWhere.md +1 -1
- package/docs/api/server/type-aliases/DataViewListOptions.md +2 -2
- package/docs/api/server/type-aliases/DataViewOrderBy.md +1 -1
- package/docs/api/server/type-aliases/DataViewOrderDirection.md +1 -1
- package/docs/api/server/type-aliases/DataViewResult.md +1 -1
- package/docs/api/server/type-aliases/Entity.md +1 -1
- package/docs/api/server/type-aliases/FateServer.md +5 -5
- package/docs/api/server/type-aliases/FateServerManifest.md +1 -1
- package/docs/api/server/type-aliases/FieldSelection.md +3 -3
- package/docs/api/server/type-aliases/LiveConnectionEventType.md +1 -1
- package/docs/api/server/type-aliases/LiveConnectionSourceEvent.md +1 -1
- package/docs/api/server/type-aliases/LiveEventBus.md +1 -1
- package/docs/api/server/type-aliases/LiveEventType.md +1 -1
- package/docs/api/server/type-aliases/LiveSourceEvent.md +1 -1
- package/docs/api/server/type-aliases/NativeFateAPI.md +4 -4
- package/docs/api/server/type-aliases/OrderDirection.md +1 -1
- package/docs/api/server/type-aliases/SourceConfig.md +6 -6
- package/docs/api/server/type-aliases/SourceDefinition.md +6 -6
- package/docs/api/server/type-aliases/SourceOrder.md +1 -1
- package/docs/api/server/type-aliases/SourceOrderField.md +3 -3
- package/docs/api/server/type-aliases/SourcePlan.md +1 -1
- package/docs/api/server/type-aliases/SourcePlanNode.md +1 -1
- package/docs/api/server/type-aliases/SourceRegistry.md +1 -1
- package/docs/api/server/type-aliases/SourceRelation.md +1 -1
- package/docs/api/server/type-aliases/SourceRelationConfig.md +1 -1
- package/docs/api/server/variables/byIdInput.md +1 -1
- package/docs/api/server/variables/connectionArgs.md +1 -1
- package/docs/api/type-aliases/ConnectionMetadata.md +1 -1
- package/docs/api/type-aliases/ConnectionRef.md +1 -1
- package/docs/api/type-aliases/Deferred.md +1 -1
- package/docs/api/type-aliases/DeferredMetadata.md +1 -1
- package/docs/api/type-aliases/DeferredSelection.md +1 -1
- package/docs/api/type-aliases/DeferredSnapshot.md +1 -1
- package/docs/api/type-aliases/Entity.md +2 -2
- package/docs/api/type-aliases/EntityId.md +1 -1
- package/docs/api/type-aliases/FateDehydratedState.md +1 -1
- package/docs/api/type-aliases/FateLiveConnectionEvent.md +1 -1
- package/docs/api/type-aliases/FateLiveEvent.md +1 -1
- package/docs/api/type-aliases/FateMutations.md +1 -1
- package/docs/api/type-aliases/FateOperation.md +1 -1
- package/docs/api/type-aliases/FateProtocolRequest.md +1 -1
- package/docs/api/type-aliases/FateProtocolResponse.md +1 -1
- package/docs/api/type-aliases/FateRecord.md +1 -1
- package/docs/api/type-aliases/FateRoots.md +1 -1
- package/docs/api/type-aliases/GraphQLMutationDefinition.md +1 -1
- package/docs/api/type-aliases/GraphQLMutationInput.md +1 -1
- package/docs/api/type-aliases/GraphQLMutationMap.md +1 -1
- package/docs/api/type-aliases/GraphQLMutationOutput.md +1 -1
- package/docs/api/type-aliases/GraphQLTransportOptions.md +12 -12
- package/docs/api/type-aliases/HydrateOptions.md +1 -1
- package/docs/api/type-aliases/HydrationLimits.md +1 -1
- package/docs/api/type-aliases/InferFateAPI.md +1 -1
- package/docs/api/type-aliases/List.md +1 -1
- package/docs/api/type-aliases/ListEntry.md +1 -1
- package/docs/api/type-aliases/ListItem.md +1 -1
- package/docs/api/type-aliases/Mask.md +1 -1
- package/docs/api/type-aliases/MutationDefinition.md +1 -1
- package/docs/api/type-aliases/MutationEntity.md +1 -1
- package/docs/api/type-aliases/MutationIdentifier.md +1 -1
- package/docs/api/type-aliases/MutationIdentity.md +1 -1
- package/docs/api/type-aliases/MutationInput.md +1 -1
- package/docs/api/type-aliases/MutationResult.md +1 -1
- package/docs/api/type-aliases/NodesItem.md +1 -1
- package/docs/api/type-aliases/Pagination.md +5 -5
- package/docs/api/type-aliases/PersistedMutationStatus.md +1 -1
- package/docs/api/type-aliases/PersistenceSnapshot.md +1 -1
- package/docs/api/type-aliases/Request.md +1 -1
- package/docs/api/type-aliases/RequestMode.md +1 -1
- package/docs/api/type-aliases/RequestOptions.md +1 -1
- package/docs/api/type-aliases/RequestPersistenceOptions.md +1 -1
- package/docs/api/type-aliases/RequestResult.md +1 -1
- package/docs/api/type-aliases/Selection.md +1 -1
- package/docs/api/type-aliases/TypeConfig.md +4 -4
- package/docs/api/type-aliases/View.md +1 -1
- package/docs/api/type-aliases/ViewData.md +1 -1
- package/docs/api/type-aliases/ViewEntity.md +1 -1
- package/docs/api/type-aliases/ViewEntityName.md +1 -1
- package/docs/api/type-aliases/ViewRef.md +1 -1
- package/docs/api/type-aliases/ViewSelection.md +1 -1
- package/docs/api/type-aliases/ViewSnapshot.md +1 -1
- package/docs/api/type-aliases/ViewTag.md +1 -1
- package/docs/api/variables/ConnectionTag.md +1 -1
- package/docs/api/variables/DeferTag.md +1 -1
- package/docs/api/variables/DeferredTag.md +1 -1
- package/docs/integrations/cloudflare.md +21 -139
- package/docs/integrations/void.md +33 -19
- package/lib/{executor-oPTYqgQV.d.mts → executor-C3JLgeJ_.d.mts} +1 -1
- package/lib/{graphqlTransport-CGYE4NdD.d.mts → graphqlTransport-D7IPm9wQ.d.mts} +1 -1
- package/lib/graphqlTransport.d.mts +1 -1
- package/lib/{idempotency-types-DuqJ7KSd.d.mts → idempotency-types-jgGOlHFl.d.mts} +1 -1
- package/lib/idempotency.d.mts +2 -2
- package/lib/index.d.mts +4 -4
- package/lib/index.mjs +1 -1
- package/lib/{list-5hrTVoiB.d.mts → list-Dj7P-fay.d.mts} +1 -1
- package/lib/list.d.mts +1 -1
- package/lib/persistence.d.mts +1 -1
- package/lib/persistence.mjs +1 -1
- package/lib/{record-Dxjvpsep.d.mts → record-DmyMlWdZ.d.mts} +3 -3
- package/lib/server/drizzle.d.mts +2 -2
- package/lib/server/prisma.d.mts +2 -2
- package/lib/server.d.mts +3 -3
- package/lib/{store-CakBBzWG.mjs → store-Dl_OPES3.mjs} +1 -95
- package/lib/{transport-DR0fwleU.d.mts → transport-c5vvbtDC.d.mts} +4 -4
- package/lib/vite.d.mts +1 -1
- package/lib/vite.mjs +7 -27
- package/package.json +4 -4
|
@@ -1,161 +1,43 @@
|
|
|
1
1
|
# Cloudflare Integration
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Use it when your backend runs directly on Cloudflare Workers and you want fate live views without adopting the Void platform.
|
|
3
|
+
Deploy fate directly to your own Cloudflare account with [Void](void.md). The Void template includes the app, D1 database, Drizzle migrations, Better Auth, and live updates through `void-fate` and `void/live`.
|
|
6
4
|
|
|
7
5
|
## New Project
|
|
8
6
|
|
|
9
|
-
For a new Cloudflare Workers app, start from the Cloudflare template. It includes the client, Worker server, D1 migrations, Wrangler config, Durable Object live transport, auth wiring, and generated fate client setup.
|
|
10
|
-
|
|
11
7
|
```sh
|
|
12
|
-
vp create fate my-app --template
|
|
8
|
+
vp create fate my-app --template void
|
|
9
|
+
cd my-app
|
|
10
|
+
vp run dev:setup
|
|
11
|
+
vp run dev
|
|
13
12
|
```
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
Add `--framework vue` to the create command to use Vue instead of React.
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
vp create fate my-app --template cloudflare --framework vue
|
|
19
|
-
```
|
|
16
|
+
## Deploy
|
|
20
17
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
For an existing Cloudflare Workers project, add the packages directly:
|
|
18
|
+
From the project root:
|
|
24
19
|
|
|
25
20
|
```sh
|
|
26
|
-
|
|
27
|
-
pnpm add -D wrangler
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
For Vue clients, replace `react-fate` with `vue-fate`.
|
|
31
|
-
|
|
32
|
-
## Server Setup
|
|
33
|
-
|
|
34
|
-
Create a Cloudflare live stream and pass its Fate live facade to `createFateServer`.
|
|
35
|
-
|
|
36
|
-
```ts
|
|
37
|
-
// src/fate/live.ts
|
|
38
|
-
import { defineCloudflareFateLiveStream } from 'cf-fate/server';
|
|
39
|
-
|
|
40
|
-
export const fateStream = defineCloudflareFateLiveStream({
|
|
41
|
-
allowAnonymousControl: true,
|
|
42
|
-
binding: 'FATE_LIVE',
|
|
43
|
-
id: 'fate',
|
|
44
|
-
});
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
```ts
|
|
48
|
-
// src/fate/server.ts
|
|
49
|
-
import { createFateServer } from '@nkzw/fate/server';
|
|
50
|
-
import { createCloudflareFateLive } from 'cf-fate/server';
|
|
51
|
-
|
|
52
|
-
export const fateLive = createCloudflareFateLive();
|
|
53
|
-
export const { live } = fateLive;
|
|
54
|
-
|
|
55
|
-
export const fateServer = createFateServer({
|
|
56
|
-
live,
|
|
57
|
-
// context,
|
|
58
|
-
// roots,
|
|
59
|
-
// sources,
|
|
60
|
-
});
|
|
21
|
+
vp exec void deploy --platform cloudflare
|
|
61
22
|
```
|
|
62
23
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
```ts
|
|
66
|
-
live.update('Post', postId, { changed: ['likes'] });
|
|
67
|
-
live.connection('Post.comments', { id: postId }).appendNode('Comment', commentId);
|
|
68
|
-
```
|
|
24
|
+
Void signs you into Cloudflare when needed, lets you select your account, provisions resources, applies checked-in database migrations, and deploys the app. It saves resource IDs in the root `wrangler.jsonc`; commit that updated config for subsequent deployments. A Void platform account is not required.
|
|
69
25
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
Expose one route for Fate RPC and one route for the SSE live stream.
|
|
73
|
-
|
|
74
|
-
```ts
|
|
75
|
-
import {
|
|
76
|
-
createCloudflareFateLiveDurableObject,
|
|
77
|
-
defineCloudflareFateLiveRoute,
|
|
78
|
-
defineCloudflareFateRoute,
|
|
79
|
-
} from 'cf-fate/server';
|
|
80
|
-
import { fateStream } from './fate/live';
|
|
81
|
-
import { fateLive, fateServer } from './fate/server';
|
|
82
|
-
|
|
83
|
-
const fateRoute = defineCloudflareFateRoute(fateServer, fateLive, { stream: fateStream });
|
|
84
|
-
const fateLiveRoute = defineCloudflareFateLiveRoute(fateStream);
|
|
85
|
-
|
|
86
|
-
export const FateLiveDurableObject = createCloudflareFateLiveDurableObject({
|
|
87
|
-
binding: 'FATE_LIVE',
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
export default {
|
|
91
|
-
fetch(request, env, ctx) {
|
|
92
|
-
const url = new URL(request.url);
|
|
93
|
-
if (url.pathname === '/fate') {
|
|
94
|
-
return fateRoute.fetch(request, env, ctx);
|
|
95
|
-
}
|
|
96
|
-
if (url.pathname === '/fate-live') {
|
|
97
|
-
return fateLiveRoute.fetch(request, env, ctx);
|
|
98
|
-
}
|
|
99
|
-
return new Response('Not Found', { status: 404 });
|
|
100
|
-
},
|
|
101
|
-
};
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
## Wrangler
|
|
105
|
-
|
|
106
|
-
Add a Durable Object binding and migration. `cf-fate` uses `node:async_hooks`, so the Worker must enable Node compatibility.
|
|
107
|
-
|
|
108
|
-
```jsonc
|
|
109
|
-
{
|
|
110
|
-
"compatibility_flags": ["nodejs_compat"],
|
|
111
|
-
"durable_objects": {
|
|
112
|
-
"bindings": [
|
|
113
|
-
{
|
|
114
|
-
"name": "FATE_LIVE",
|
|
115
|
-
"class_name": "FateLiveDurableObject",
|
|
116
|
-
},
|
|
117
|
-
],
|
|
118
|
-
},
|
|
119
|
-
"migrations": [
|
|
120
|
-
{
|
|
121
|
-
"tag": "fate-live-v1",
|
|
122
|
-
"new_sqlite_classes": ["FateLiveDurableObject"],
|
|
123
|
-
},
|
|
124
|
-
],
|
|
125
|
-
}
|
|
126
|
-
```
|
|
26
|
+
The template includes the `VOID_LIVE` Durable Object binding and its class migration. Keep them in `wrangler.jsonc` so live subscriptions can receive updates across requests. RPC requests use `/fate`, and live updates use `/fate-live`.
|
|
127
27
|
|
|
128
|
-
|
|
28
|
+
After changing your database schema or auth configuration, run `vp run db:generate`, review and commit the generated migrations, then deploy. The migrations must include the Better Auth schema used in production.
|
|
129
29
|
|
|
130
|
-
|
|
30
|
+
See [Void's Cloudflare deployment guide](https://void.cloud/integrations/cloudflare) for custom domains, secrets, and CI configuration.
|
|
131
31
|
|
|
132
|
-
|
|
133
|
-
import { fate } from 'react-fate/vite';
|
|
32
|
+
## Migrating from cf-fate
|
|
134
33
|
|
|
135
|
-
fate
|
|
136
|
-
module: './src/fate/server.ts',
|
|
137
|
-
transport: 'cloudflare',
|
|
138
|
-
});
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
Then point the generated client at the Worker endpoints:
|
|
142
|
-
|
|
143
|
-
```tsx
|
|
144
|
-
import { FateClient } from 'react-fate';
|
|
145
|
-
import { createFateClient } from 'react-fate/client';
|
|
146
|
-
|
|
147
|
-
const fate = createFateClient({
|
|
148
|
-
liveUrl: 'http://localhost:8787/fate-live',
|
|
149
|
-
url: 'http://localhost:8787/fate',
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
export function App({ children }) {
|
|
153
|
-
return <FateClient client={fate}>{children}</FateClient>;
|
|
154
|
-
}
|
|
155
|
-
```
|
|
34
|
+
Fate 1.6 replaces the standalone Cloudflare adapter and template with the Void integration. Use `--template void` for new projects and `transport: 'void'` in the fate Vite plugin.
|
|
156
35
|
|
|
157
|
-
|
|
36
|
+
For an existing app, move the Worker routes into Void's `routes/` directory and follow the [Void integration](void.md) for the complete setup:
|
|
158
37
|
|
|
159
|
-
|
|
38
|
+
- Define the live stream with `defineLiveStream` from `void/live`.
|
|
39
|
+
- Use `createVoidFateLive`, `defineVoidFateRoute`, and `defineVoidFateLiveRoute` from `void-fate/server`.
|
|
40
|
+
- Let the generated client use `void/live/client` for live connections.
|
|
41
|
+
- Remove the `cf-fate` dependency and the custom Worker entry point.
|
|
160
42
|
|
|
161
|
-
|
|
43
|
+
Deploy the Void app as a new Worker with its `VOID_LIVE` binding and class migration. The old `FATE_LIVE` Durable Object class and its active connections are not migrated. Preserve existing database IDs and migration history when reusing your database, and reconnect clients to the new app after deployment.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Void Integration
|
|
2
2
|
|
|
3
|
-
`void-fate` is the
|
|
3
|
+
`void-fate` is the [Void](https://void.cloud) adapter for fate. Deploy your app directly to your own Cloudflare account or to the Void platform with the same integration.
|
|
4
4
|
|
|
5
5
|
Use this integration when your app runs on Void and you want the example app's
|
|
6
6
|
setup without copying its adapter glue.
|
|
@@ -127,14 +127,29 @@ live.connection('Post.comments', { id: postId }).appendNode('Comment', commentId
|
|
|
127
127
|
|
|
128
128
|
## Routes
|
|
129
129
|
|
|
130
|
+
Define a live stream once in a server-only module:
|
|
131
|
+
|
|
132
|
+
```ts
|
|
133
|
+
// src/fate/live.ts
|
|
134
|
+
import { defineLiveStream } from 'void/live';
|
|
135
|
+
|
|
136
|
+
export const fateStream = defineLiveStream({
|
|
137
|
+
allowAnonymousControl: true,
|
|
138
|
+
id: 'fate',
|
|
139
|
+
});
|
|
140
|
+
```
|
|
141
|
+
|
|
130
142
|
Add one route for fate RPC requests:
|
|
131
143
|
|
|
132
144
|
```tsx
|
|
133
145
|
// routes/fate.ts
|
|
134
146
|
import { defineVoidFateRoute } from 'void-fate/server';
|
|
147
|
+
import { fateStream } from '../src/fate/live.ts';
|
|
135
148
|
import { fateLive, fateServer } from '../src/fate/server.ts';
|
|
136
149
|
|
|
137
|
-
export const { GET, POST } = defineVoidFateRoute(fateServer, fateLive
|
|
150
|
+
export const { GET, POST } = defineVoidFateRoute(fateServer, fateLive, {
|
|
151
|
+
stream: fateStream,
|
|
152
|
+
});
|
|
138
153
|
```
|
|
139
154
|
|
|
140
155
|
Add a second route for the live SSE transport:
|
|
@@ -142,9 +157,9 @@ Add a second route for the live SSE transport:
|
|
|
142
157
|
```tsx
|
|
143
158
|
// routes/fate-live.ts
|
|
144
159
|
import { defineVoidFateLiveRoute } from 'void-fate/server';
|
|
145
|
-
import {
|
|
160
|
+
import { fateStream } from '../src/fate/live.ts';
|
|
146
161
|
|
|
147
|
-
export const { GET, POST } = defineVoidFateLiveRoute(
|
|
162
|
+
export const { GET, POST } = defineVoidFateLiveRoute(fateStream);
|
|
148
163
|
```
|
|
149
164
|
|
|
150
165
|
The live route handles `GET /fate-live` SSE connections and `POST /fate-live`
|
|
@@ -210,13 +225,7 @@ present.
|
|
|
210
225
|
## Custom Paths
|
|
211
226
|
|
|
212
227
|
The default route pair is `/fate` and `/fate-live`. If your Void app uses
|
|
213
|
-
different paths,
|
|
214
|
-
|
|
215
|
-
```tsx
|
|
216
|
-
export const fateLive = createVoidFateLive({
|
|
217
|
-
livePath: '/custom-fate-live',
|
|
218
|
-
});
|
|
219
|
-
```
|
|
228
|
+
different paths, update your route filenames and configure the matching client paths.
|
|
220
229
|
|
|
221
230
|
::: code-group
|
|
222
231
|
|
|
@@ -252,14 +261,19 @@ or router configuration matches the paths you pass to the client.
|
|
|
252
261
|
|
|
253
262
|
## Live Transport
|
|
254
263
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
In local development, `void-fate` uses a development token for that internal
|
|
260
|
-
publish request. Outside local development, Void must provide `__VOID_PROXY_TOKEN`
|
|
261
|
-
in the route environment. If no internal publish token is available, the adapter
|
|
262
|
-
falls back to the in-memory live bus for the current request context.
|
|
264
|
+
`createVoidFateLive` publishes entity and connection events through the `void/live`
|
|
265
|
+
stream associated with the current request. Void manages the Durable Object
|
|
266
|
+
transport that distributes events to connected clients across requests.
|
|
263
267
|
|
|
264
268
|
The live transport is best-effort and does not replay missed events after a
|
|
265
269
|
client reconnects. This matches fate's default in-memory live event bus.
|
|
270
|
+
|
|
271
|
+
## Cloudflare Deployment
|
|
272
|
+
|
|
273
|
+
From your project root, run:
|
|
274
|
+
|
|
275
|
+
```sh
|
|
276
|
+
vp exec void deploy --platform cloudflare
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
Void provisions resources and deploys directly to your Cloudflare account. See the [Cloudflare integration](cloudflare.md) for setup and migration instructions.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as AnyRecord, lt as QueryProcedure } from "./transport-
|
|
1
|
+
import { b as AnyRecord, lt as QueryProcedure } from "./transport-c5vvbtDC.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/server/dataView.d.ts
|
|
4
4
|
declare const dataViewFieldsKey: unique symbol;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as MutationShape, k as Entity, q as TypeConfig, t as Transport } from "./transport-
|
|
1
|
+
import { B as MutationShape, k as Entity, q as TypeConfig, t as Transport } from "./transport-c5vvbtDC.mjs";
|
|
2
2
|
//#region src/graphqlTransport.d.ts
|
|
3
3
|
type TransportMutations = Record<string, MutationShape>;
|
|
4
4
|
type EmptyTransportMutations = Record<never, MutationShape>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as GraphQLTransportOptions, i as GraphQLMutationOutput, n as GraphQLMutationInput, o as createGraphQLTransport, r as GraphQLMutationMap, s as graphqlMutation, t as GraphQLMutationDefinition } from "./graphqlTransport-
|
|
1
|
+
import { a as GraphQLTransportOptions, i as GraphQLMutationOutput, n as GraphQLMutationInput, o as createGraphQLTransport, r as GraphQLMutationMap, s as graphqlMutation, t as GraphQLMutationDefinition } from "./graphqlTransport-D7IPm9wQ.mjs";
|
|
2
2
|
export { GraphQLMutationDefinition, GraphQLMutationInput, GraphQLMutationMap, GraphQLMutationOutput, GraphQLTransportOptions, createGraphQLTransport, graphqlMutation };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as MutationIdentity } from "./transport-
|
|
1
|
+
import { r as MutationIdentity } from "./transport-c5vvbtDC.mjs";
|
|
2
2
|
//#region src/server/idempotency-types.d.ts
|
|
3
3
|
/** Server enforcement for a durable mutation. The resolver must use the supplied context. */
|
|
4
4
|
interface MutationIdempotency<Context> {
|
package/lib/idempotency.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as encodeHydrationValue } from "./transport-
|
|
2
|
-
import { n as MutationIdempotencyOptions, t as MutationIdempotency } from "./idempotency-types-
|
|
1
|
+
import { _ as encodeHydrationValue } from "./transport-c5vvbtDC.mjs";
|
|
2
|
+
import { n as MutationIdempotencyOptions, t as MutationIdempotency } from "./idempotency-types-jgGOlHFl.mjs";
|
|
3
3
|
//#region src/idempotency.d.ts
|
|
4
4
|
export type MutationReceipt = Readonly<{
|
|
5
5
|
fingerprint: string;
|
package/lib/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $ as ViewRef, A as EntityId, B as MutationShape, C as ConnectionTag, D as DeferredSelection, E as DeferredMetadata, F as MutationDefinition, G as RootDefinition, H as Pagination, I as MutationEntity, J as TypeName, K as Selection, L as MutationIdentifier, M as FateThenable, N as ListItem, O as DeferredTag, P as Mask, Q as ViewEntityName, R as MutationInput, S as ConnectionRef, T as Deferred, U as Request$1, V as NodesItem, W as RequestResult, X as ViewData, Y as View, Z as ViewEntity, a as Persistence, at as isViewTag, b as AnyRecord, c as RequestPersistenceOptions, d as RequestMode, et as ViewSelection, f as RequestOptions, g as HydrationLimits, h as HydrateOptions, i as PersistedMutationStatus, it as __FateSelectionBrand, j as FateRoots, k as Entity, l as DeferredSnapshot, m as FateDehydratedState, n as createTRPCTransport, nt as ViewTag, o as PersistenceSession, ot as FateMutations, p as createClient, q as TypeConfig, r as MutationIdentity, rt as __FateEntityBrand, s as PersistenceSnapshot, st as mutation, t as Transport, tt as ViewSnapshot, u as FateClient, v as List, w as DeferTag, x as ConnectionMetadata, y as getSelectionPlan, z as MutationResult } from "./transport-
|
|
2
|
-
import { a as GraphQLTransportOptions, i as GraphQLMutationOutput, n as GraphQLMutationInput, o as createGraphQLTransport, r as GraphQLMutationMap, s as graphqlMutation, t as GraphQLMutationDefinition } from "./graphqlTransport-
|
|
3
|
-
import { C as liveGlobalConnectionTopic, S as liveEntityTopic, a as FateProtocolRequest, i as FateOperation, n as FateLiveConnectionEvent, o as FateProtocolResponse, r as FateLiveEvent, t as isRecord, u as InferFateAPI, x as liveConnectionTopic } from "./record-
|
|
4
|
-
import { n as getListEntries, t as ListEntry } from "./list-
|
|
1
|
+
import { $ as ViewRef, A as EntityId, B as MutationShape, C as ConnectionTag, D as DeferredSelection, E as DeferredMetadata, F as MutationDefinition, G as RootDefinition, H as Pagination, I as MutationEntity, J as TypeName, K as Selection, L as MutationIdentifier, M as FateThenable, N as ListItem, O as DeferredTag, P as Mask, Q as ViewEntityName, R as MutationInput, S as ConnectionRef, T as Deferred, U as Request$1, V as NodesItem, W as RequestResult, X as ViewData, Y as View, Z as ViewEntity, a as Persistence, at as isViewTag, b as AnyRecord, c as RequestPersistenceOptions, d as RequestMode, et as ViewSelection, f as RequestOptions, g as HydrationLimits, h as HydrateOptions, i as PersistedMutationStatus, it as __FateSelectionBrand, j as FateRoots, k as Entity, l as DeferredSnapshot, m as FateDehydratedState, n as createTRPCTransport, nt as ViewTag, o as PersistenceSession, ot as FateMutations, p as createClient, q as TypeConfig, r as MutationIdentity, rt as __FateEntityBrand, s as PersistenceSnapshot, st as mutation, t as Transport, tt as ViewSnapshot, u as FateClient, v as List, w as DeferTag, x as ConnectionMetadata, y as getSelectionPlan, z as MutationResult } from "./transport-c5vvbtDC.mjs";
|
|
2
|
+
import { a as GraphQLTransportOptions, i as GraphQLMutationOutput, n as GraphQLMutationInput, o as createGraphQLTransport, r as GraphQLMutationMap, s as graphqlMutation, t as GraphQLMutationDefinition } from "./graphqlTransport-D7IPm9wQ.mjs";
|
|
3
|
+
import { C as liveGlobalConnectionTopic, S as liveEntityTopic, a as FateProtocolRequest, i as FateOperation, n as FateLiveConnectionEvent, o as FateProtocolResponse, r as FateLiveEvent, t as isRecord, u as InferFateAPI, x as liveConnectionTopic } from "./record-DmyMlWdZ.mjs";
|
|
4
|
+
import { n as getListEntries, t as ListEntry } from "./list-Dj7P-fay.mjs";
|
|
5
5
|
//#region src/defer.d.ts
|
|
6
6
|
export declare function defer<S>(selection: S): DeferredSelection<S>;
|
|
7
7
|
export declare const isDeferred: (value: unknown) => value is Deferred<unknown>;
|
package/lib/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as isRecord } from "./record-B07VwXd-.mjs";
|
|
2
2
|
import { a as hashArgs, c as scopeArgsPayload, i as filterConnectionArgs, r as combineArgsPayload, s as resolvedArgsFromPlan, t as applyArgsPayloadToPlan } from "./args-CRLIRl_v.mjs";
|
|
3
3
|
import { _ as isNodesItem, a as createNodeRef, c as ConnectionTag, f as RootKind, g as isNodeItem, i as resolveHydrationLimits, l as DeferTag, m as ViewsTag, o as getNodeRefId, r as encodeHydrationValue, s as isNodeRef, t as decodeClientHydrationState, u as DeferredTag, v as isQueryItem, y as isViewTag } from "./hydration-DPZRJgnu.mjs";
|
|
4
|
-
import { C as isDeferredSelection, S as isDeferred, _ as view, a as mutation, b as getDeferredMetadata, c as getDeferredSelectionPlan, d as createRefWithViewNames, f as getRootViewNames, g as getViewPayloads, h as getViewNames, l as getSelectionPlan, m as toEntityId, n as getListKey, p as parseEntityId, r as mergePreservingExisting, s as wrapMutation, t as Store, u as assignViewTag, v as createDeferred, x as getDeferredSelection, y as defer } from "./store-
|
|
4
|
+
import { C as isDeferredSelection, S as isDeferred, _ as view, a as mutation, b as getDeferredMetadata, c as getDeferredSelectionPlan, d as createRefWithViewNames, f as getRootViewNames, g as getViewPayloads, h as getViewNames, l as getSelectionPlan, m as toEntityId, n as getListKey, p as parseEntityId, r as mergePreservingExisting, s as wrapMutation, t as Store, u as assignViewTag, v as createDeferred, x as getDeferredSelection, y as defer } from "./store-Dl_OPES3.mjs";
|
|
5
5
|
import { t as getListEntries } from "./list-_6fXYLtJ.mjs";
|
|
6
6
|
import { n as errorCodeFromStatus, t as FateRequestError } from "./protocol-DS5sf6sd.mjs";
|
|
7
7
|
import { n as graphqlMutation, t as createGraphQLTransport } from "./graphqlTransport-DmheG3AO.mjs";
|
package/lib/list.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as getListEntries, t as ListEntry } from "./list-
|
|
1
|
+
import { n as getListEntries, t as ListEntry } from "./list-Dj7P-fay.mjs";
|
|
2
2
|
export { ListEntry, getListEntries };
|
package/lib/persistence.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as Persistence, c as RequestPersistenceOptions, i as PersistedMutationStatus, o as PersistenceSession, s as PersistenceSnapshot } from "./transport-
|
|
1
|
+
import { a as Persistence, c as RequestPersistenceOptions, i as PersistedMutationStatus, o as PersistenceSession, s as PersistenceSnapshot } from "./transport-c5vvbtDC.mjs";
|
|
2
2
|
//#region src/persistence.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Backend-neutral durable storage. Batches apply atomically and resolve only after
|
package/lib/persistence.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as isRecord } from "./record-B07VwXd-.mjs";
|
|
2
2
|
import { i as filterConnectionArgs } from "./args-CRLIRl_v.mjs";
|
|
3
3
|
import { a as createNodeRef, n as decodeHydrationValue, o as getNodeRefId, r as encodeHydrationValue, s as isNodeRef, t as decodeClientHydrationState } from "./hydration-DPZRJgnu.mjs";
|
|
4
|
-
import { i as getErrorStatusCode, m as toEntityId, n as getListKey, o as prepareMutation } from "./store-
|
|
4
|
+
import { i as getErrorStatusCode, m as toEntityId, n as getListKey, o as prepareMutation } from "./store-Dl_OPES3.mjs";
|
|
5
5
|
import { t as FateRequestError } from "./protocol-DS5sf6sd.mjs";
|
|
6
6
|
//#region src/persistence-codec.ts
|
|
7
7
|
const isStringArray = (value) => Array.isArray(value) && value.every((entry) => typeof entry === "string");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { b as AnyRecord, r as MutationIdentity } from "./transport-
|
|
2
|
-
import { t as MutationIdempotency } from "./idempotency-types-
|
|
3
|
-
import { N as DataViewResult, S as ConnectionResult, k as DataView, l as SourceDefinition, t as SourceRegistry } from "./executor-
|
|
1
|
+
import { b as AnyRecord, r as MutationIdentity } from "./transport-c5vvbtDC.mjs";
|
|
2
|
+
import { t as MutationIdempotency } from "./idempotency-types-jgGOlHFl.mjs";
|
|
3
|
+
import { N as DataViewResult, S as ConnectionResult, k as DataView, l as SourceDefinition, t as SourceRegistry } from "./executor-C3JLgeJ_.mjs";
|
|
4
4
|
//#region src/liveTopics.d.ts
|
|
5
5
|
declare const liveEntityTopic: (type: string, id: string | number) => string;
|
|
6
6
|
declare const liveConnectionTopic: (procedure: string, args?: Record<string, unknown>) => string;
|
package/lib/server/drizzle.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as AnyRecord, lt as QueryProcedure } from "../transport-
|
|
2
|
-
import { S as ConnectionResult, c as SourceConfig, f as SourcePlan, k as DataView, l as SourceDefinition, o as DataViewModule, p as SourcePlanNode, t as SourceRegistry } from "../executor-
|
|
1
|
+
import { b as AnyRecord, lt as QueryProcedure } from "../transport-c5vvbtDC.mjs";
|
|
2
|
+
import { S as ConnectionResult, c as SourceConfig, f as SourcePlan, k as DataView, l as SourceDefinition, o as DataViewModule, p as SourcePlanNode, t as SourceRegistry } from "../executor-C3JLgeJ_.mjs";
|
|
3
3
|
import { AnyColumn, SQLWrapper, Table } from "drizzle-orm";
|
|
4
4
|
//#region src/server/drizzle.d.ts
|
|
5
5
|
type SourceTarget<Item extends AnyRecord = AnyRecord> = DataView<Item> | SourceDefinition<Item, unknown>;
|
package/lib/server/prisma.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as AnyRecord, lt as QueryProcedure } from "../transport-
|
|
2
|
-
import { S as ConnectionResult, c as SourceConfig, f as SourcePlan, k as DataView, l as SourceDefinition, o as DataViewModule, p as SourcePlanNode, s as OrderDirection, t as SourceRegistry } from "../executor-
|
|
1
|
+
import { b as AnyRecord, lt as QueryProcedure } from "../transport-c5vvbtDC.mjs";
|
|
2
|
+
import { S as ConnectionResult, c as SourceConfig, f as SourcePlan, k as DataView, l as SourceDefinition, o as DataViewModule, p as SourcePlanNode, s as OrderDirection, t as SourceRegistry } from "../executor-C3JLgeJ_.mjs";
|
|
3
3
|
//#region src/server/prisma.d.ts
|
|
4
4
|
export type PrismaDelegate = {
|
|
5
5
|
findMany?: (args: any) => Promise<Array<AnyRecord>>;
|
package/lib/server.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { b as AnyRecord$1, ct as AnyProcedure } from "./transport-
|
|
2
|
-
import { C as liveGlobalConnectionTopic, S as liveEntityTopic, _ as LiveEventBus, b as createLiveEventBus, c as FateServer, d as NativeFateAPI, f as createFateFetchHandler, g as LiveConnectionSourceEvent, h as LiveConnectionEventType, l as FateServerManifest, m as createHonoFateHandler, p as createFateServer, s as FateRequestError, t as isRecord, u as InferFateAPI, v as LiveEventType, x as liveConnectionTopic, y as LiveSourceEvent } from "./record-
|
|
3
|
-
import { A as DataViewListOptions, B as dataView, C as connectionArgs, D as CountSelection, E as ComputedSelection, F as FieldSelection, H as list$1, I as ViewPlan, L as computed, M as DataViewOrderDirection, N as DataViewResult, O as CountWhere, P as Entity, R as count, S as ConnectionResult, T as ComputedField, U as resolver, V as field, _ as createSourcePlan, a as resolveSourceConnection, b as ConnectionItem, c as SourceConfig, d as SourceOrderField, f as SourcePlan, g as createNestedSourcePlan, h as SourceRelationConfig, i as resolveSourceByIds, j as DataViewOrderBy, l as SourceDefinition, m as SourceRelation, n as refetchSourceById, p as SourcePlanNode, r as resolveSourceById, s as OrderDirection, t as SourceRegistry, u as SourceOrder, v as getNestedSelection, w as withConnection, x as ConnectionPagination, y as hasNestedSelection, z as createResolver } from "./executor-
|
|
1
|
+
import { b as AnyRecord$1, ct as AnyProcedure } from "./transport-c5vvbtDC.mjs";
|
|
2
|
+
import { C as liveGlobalConnectionTopic, S as liveEntityTopic, _ as LiveEventBus, b as createLiveEventBus, c as FateServer, d as NativeFateAPI, f as createFateFetchHandler, g as LiveConnectionSourceEvent, h as LiveConnectionEventType, l as FateServerManifest, m as createHonoFateHandler, p as createFateServer, s as FateRequestError, t as isRecord, u as InferFateAPI, v as LiveEventType, x as liveConnectionTopic, y as LiveSourceEvent } from "./record-DmyMlWdZ.mjs";
|
|
3
|
+
import { A as DataViewListOptions, B as dataView, C as connectionArgs, D as CountSelection, E as ComputedSelection, F as FieldSelection, H as list$1, I as ViewPlan, L as computed, M as DataViewOrderDirection, N as DataViewResult, O as CountWhere, P as Entity, R as count, S as ConnectionResult, T as ComputedField, U as resolver, V as field, _ as createSourcePlan, a as resolveSourceConnection, b as ConnectionItem, c as SourceConfig, d as SourceOrderField, f as SourcePlan, g as createNestedSourcePlan, h as SourceRelationConfig, i as resolveSourceByIds, j as DataViewOrderBy, l as SourceDefinition, m as SourceRelation, n as refetchSourceById, p as SourcePlanNode, r as resolveSourceById, s as OrderDirection, t as SourceRegistry, u as SourceOrder, v as getNestedSelection, w as withConnection, x as ConnectionPagination, y as hasNestedSelection, z as createResolver } from "./executor-C3JLgeJ_.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/server/input.d.ts
|
|
6
6
|
export declare const byIdInput: z.ZodObject<{
|
|
@@ -12,30 +12,7 @@ const createDeferred = (metadata) => Object.freeze({ [DeferredTag]: metadata });
|
|
|
12
12
|
const isDeferred = (value) => typeof value === "object" && value !== null && DeferredTag in value;
|
|
13
13
|
const getDeferredMetadata = (deferred) => deferred[DeferredTag];
|
|
14
14
|
//#endregion
|
|
15
|
-
//#region ../../node_modules/.pnpm/@trpc+server@11.
|
|
16
|
-
var __create = Object.create;
|
|
17
|
-
var __defProp = Object.defineProperty;
|
|
18
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
19
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
20
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
21
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
22
|
-
var __commonJS = (cb, mod) => function() {
|
|
23
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
24
|
-
};
|
|
25
|
-
var __copyProps = (to, from, except, desc) => {
|
|
26
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
27
|
-
key = keys[i];
|
|
28
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
29
|
-
get: ((k) => from[k]).bind(null, key),
|
|
30
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
return to;
|
|
34
|
-
};
|
|
35
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
36
|
-
value: mod,
|
|
37
|
-
enumerable: true
|
|
38
|
-
}) : target, mod));
|
|
15
|
+
//#region ../../node_modules/.pnpm/@trpc+server@11.19.0_typescript@7.0.2/node_modules/@trpc/server/dist/getErrorShape-B0JBUs-i.mjs
|
|
39
16
|
const JSONRPC2_TO_HTTP_CODE = {
|
|
40
17
|
PARSE_ERROR: 400,
|
|
41
18
|
BAD_REQUEST: 400,
|
|
@@ -66,77 +43,6 @@ function getStatusCodeFromKey(code) {
|
|
|
66
43
|
function getHTTPStatusCodeFromError(error) {
|
|
67
44
|
return getStatusCodeFromKey(error.code);
|
|
68
45
|
}
|
|
69
|
-
var require_typeof = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(exports, module) {
|
|
70
|
-
function _typeof$2(o) {
|
|
71
|
-
"@babel/helpers - typeof";
|
|
72
|
-
return module.exports = _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
73
|
-
return typeof o$1;
|
|
74
|
-
} : function(o$1) {
|
|
75
|
-
return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
|
|
76
|
-
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof$2(o);
|
|
77
|
-
}
|
|
78
|
-
module.exports = _typeof$2, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
79
|
-
} });
|
|
80
|
-
var require_toPrimitive = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(exports, module) {
|
|
81
|
-
var _typeof$1 = require_typeof()["default"];
|
|
82
|
-
function toPrimitive$1(t, r) {
|
|
83
|
-
if ("object" != _typeof$1(t) || !t) return t;
|
|
84
|
-
var e = t[Symbol.toPrimitive];
|
|
85
|
-
if (void 0 !== e) {
|
|
86
|
-
var i = e.call(t, r || "default");
|
|
87
|
-
if ("object" != _typeof$1(i)) return i;
|
|
88
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
89
|
-
}
|
|
90
|
-
return ("string" === r ? String : Number)(t);
|
|
91
|
-
}
|
|
92
|
-
module.exports = toPrimitive$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
93
|
-
} });
|
|
94
|
-
var require_toPropertyKey = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(exports, module) {
|
|
95
|
-
var _typeof = require_typeof()["default"];
|
|
96
|
-
var toPrimitive = require_toPrimitive();
|
|
97
|
-
function toPropertyKey$1(t) {
|
|
98
|
-
var i = toPrimitive(t, "string");
|
|
99
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
100
|
-
}
|
|
101
|
-
module.exports = toPropertyKey$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
102
|
-
} });
|
|
103
|
-
var require_defineProperty = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(exports, module) {
|
|
104
|
-
var toPropertyKey = require_toPropertyKey();
|
|
105
|
-
function _defineProperty(e, r, t) {
|
|
106
|
-
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
107
|
-
value: t,
|
|
108
|
-
enumerable: !0,
|
|
109
|
-
configurable: !0,
|
|
110
|
-
writable: !0
|
|
111
|
-
}) : e[r] = t, e;
|
|
112
|
-
}
|
|
113
|
-
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
114
|
-
} });
|
|
115
|
-
__toESM(__commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(exports, module) {
|
|
116
|
-
var defineProperty = require_defineProperty();
|
|
117
|
-
function ownKeys(e, r) {
|
|
118
|
-
var t = Object.keys(e);
|
|
119
|
-
if (Object.getOwnPropertySymbols) {
|
|
120
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
121
|
-
r && (o = o.filter(function(r$1) {
|
|
122
|
-
return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
|
|
123
|
-
})), t.push.apply(t, o);
|
|
124
|
-
}
|
|
125
|
-
return t;
|
|
126
|
-
}
|
|
127
|
-
function _objectSpread2(e) {
|
|
128
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
129
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
130
|
-
r % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {
|
|
131
|
-
defineProperty(e, r$1, t[r$1]);
|
|
132
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
|
|
133
|
-
Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
return e;
|
|
137
|
-
}
|
|
138
|
-
module.exports = _objectSpread2, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
139
|
-
} })(), 1);
|
|
140
46
|
//#endregion
|
|
141
47
|
//#region src/view.ts
|
|
142
48
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TRPCClient } from "@trpc/client";
|
|
2
|
-
//#region ../../node_modules/.pnpm/@trpc+server@11.
|
|
2
|
+
//#region ../../node_modules/.pnpm/@trpc+server@11.19.0_typescript@7.0.2/node_modules/@trpc/server/dist/index-BMimGNYb.d.mts
|
|
3
3
|
//#region src/observable/types.d.ts
|
|
4
4
|
interface Unsubscribable {
|
|
5
5
|
unsubscribe(): void;
|
|
@@ -23,7 +23,7 @@ interface Observer<TValue, TError> {
|
|
|
23
23
|
type UnaryFunction<TSource, TReturn> = (source: TSource) => TReturn;
|
|
24
24
|
type OperatorFunction<TValueBefore, TErrorBefore, TValueAfter, TErrorAfter> = UnaryFunction<Subscribable<TValueBefore, TErrorBefore>, Subscribable<TValueAfter, TErrorAfter>>;
|
|
25
25
|
//#endregion
|
|
26
|
-
//#region ../../node_modules/.pnpm/@trpc+server@11.
|
|
26
|
+
//#region ../../node_modules/.pnpm/@trpc+server@11.19.0_typescript@7.0.2/node_modules/@trpc/server/dist/unstable-core-do-not-import-BK_OKrtM.d.mts
|
|
27
27
|
/**
|
|
28
28
|
* @public
|
|
29
29
|
*/
|
|
@@ -76,7 +76,7 @@ type TRPC_ERROR_CODE_NUMBER = ValueOf<typeof TRPC_ERROR_CODES_BY_KEY>;
|
|
|
76
76
|
type TRPC_ERROR_CODE_KEY = keyof typeof TRPC_ERROR_CODES_BY_KEY;
|
|
77
77
|
declare class TRPCError extends Error {
|
|
78
78
|
readonly cause?: Error;
|
|
79
|
-
readonly code: "
|
|
79
|
+
readonly code: "BAD_GATEWAY" | "BAD_REQUEST" | "CLIENT_CLOSED_REQUEST" | "CONFLICT" | "FORBIDDEN" | "GATEWAY_TIMEOUT" | "INTERNAL_SERVER_ERROR" | "METHOD_NOT_SUPPORTED" | "NOT_FOUND" | "NOT_IMPLEMENTED" | "PARSE_ERROR" | "PAYLOAD_TOO_LARGE" | "PAYMENT_REQUIRED" | "PRECONDITION_FAILED" | "PRECONDITION_REQUIRED" | "SERVICE_UNAVAILABLE" | "TIMEOUT" | "TOO_MANY_REQUESTS" | "UNAUTHORIZED" | "UNPROCESSABLE_CONTENT" | "UNSUPPORTED_MEDIA_TYPE";
|
|
80
80
|
constructor(opts: {
|
|
81
81
|
message?: string;
|
|
82
82
|
code: TRPC_ERROR_CODE_KEY;
|
|
@@ -196,7 +196,7 @@ interface ProcedureCallOptions<TContext> {
|
|
|
196
196
|
}
|
|
197
197
|
//#endregion
|
|
198
198
|
//#region src/unstable-core-do-not-import/procedure.d.ts
|
|
199
|
-
declare const procedureTypes: readonly [
|
|
199
|
+
declare const procedureTypes: readonly ['query', 'mutation', 'subscription'];
|
|
200
200
|
/**
|
|
201
201
|
* @public
|
|
202
202
|
*/
|
package/lib/vite.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Plugin } from "vite";
|
|
2
2
|
//#region src/viteTypes.d.ts
|
|
3
|
-
type FateViteTransport = '
|
|
3
|
+
type FateViteTransport = 'graphql' | 'native' | 'trpc' | 'void';
|
|
4
4
|
//#endregion
|
|
5
5
|
//#region src/vite.d.ts
|
|
6
6
|
type ClientRuntime = '@nkzw/fate' | 'react-fate' | 'vue-fate';
|