kitcn 0.12.27 → 0.13.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.
- package/dist/aggregate/index.d.ts +1 -1
- package/dist/aggregate/index.js +1 -1
- package/dist/auth/client/index.d.ts +312 -4
- package/dist/auth/client/index.js +17 -5
- package/dist/auth/config/index.d.ts +1 -1
- package/dist/auth/generated/index.d.ts +1 -1
- package/dist/auth/generated/index.js +1 -1
- package/dist/auth/http/index.d.ts +12 -9
- package/dist/auth/http/index.js +35 -6
- package/dist/auth/index.d.ts +292 -8
- package/dist/auth/index.js +29 -23
- package/dist/auth/nextjs/index.d.ts +4 -3
- package/dist/auth/nextjs/index.js +9 -4
- package/dist/auth/start/index.d.ts +13 -3
- package/dist/auth/start/index.js +97 -8
- package/dist/{backend-core-DqCCa0nr.mjs → backend-core-yq-eWLRJ.mjs} +140 -54
- package/dist/{builder-Cb6gloDB.js → builder-DBgto1yn.js} +4 -3
- package/dist/{caller-factory-cTXNvYdz.js → caller-factory-NEfgD5E0.js} +3 -3
- package/dist/cli.mjs +26 -26
- package/dist/convex-plugin-C3N9BB-J.js +275 -0
- package/dist/convex-plugin-tWTDqoKJ.mjs +276 -0
- package/dist/{create-schema-orm-DOyiNDCx.js → create-schema-orm-B3f2Kc8O.js} +1 -1
- package/dist/crpc/index.d.ts +2 -2
- package/dist/crpc/index.js +3 -3
- package/dist/{customFunctions-C0voKmtx.js → customFunctions-DxEEO4Dq.js} +2 -1
- package/dist/{generated-contract-disabled-21YxPk5W.d.ts → generated-contract-disabled-C_-KWRfT.d.ts} +4 -2
- package/dist/{http-types-BLFA9zS7.d.ts → http-types-zsMHb_QN.d.ts} +2 -2
- package/dist/{middleware-DkIhQXwg.js → middleware-Bg-PdtrI.js} +1 -1
- package/dist/{middleware-nS_qXecO.d.ts → middleware-DrtexzF3.d.ts} +1 -1
- package/dist/orm/index.d.ts +3 -3
- package/dist/orm/index.js +3 -3
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.js +1 -1
- package/dist/{procedure-caller-AjLfkHyF.js → procedure-caller-DplSC7Us.js} +2 -2
- package/dist/{procedure-name-D-fDCBlo.d.ts → procedure-name-BCRBr6Po.d.ts} +3 -3
- package/dist/ratelimit/index.d.ts +2 -2
- package/dist/ratelimit/index.js +3 -3
- package/dist/react/index.d.ts +18 -14
- package/dist/react/index.js +14 -27
- package/dist/rsc/index.d.ts +4 -4
- package/dist/rsc/index.js +4 -4
- package/dist/{runtime-CtvJPkur.js → runtime-i6t-HoZn.js} +1 -1
- package/dist/server/index.d.ts +4 -4
- package/dist/server/index.js +4 -4
- package/dist/solid/index.d.ts +300 -4
- package/dist/token-B9Bjcqug.d.ts +13 -0
- package/dist/token-tpipF-7y.js +47 -0
- package/dist/{types-C6pQrnzD.d.ts → types-YHpe0rsb.d.ts} +1 -1
- package/dist/upstream-BR6sBLg3.js +84 -0
- package/dist/upstream-BUCdbLok.mjs +26 -0
- package/dist/{validators-B7oIJCAp.js → validators-C7LelqTN.js} +2 -84
- package/dist/watcher.mjs +1 -1
- package/dist/{where-clause-compiler-DdjN63Io.d.ts → where-clause-compiler-TMppDl9g.d.ts} +51 -51
- package/package.json +5 -4
- package/skills/convex/references/features/auth.md +20 -0
- package/skills/convex/references/features/orm.md +9 -0
- package/skills/convex/references/setup/auth.md +2 -0
- package/skills/convex/references/setup/index.md +5 -5
- package/skills/convex/references/setup/server.md +1 -1
- /package/dist/{api-entry-BUAh_K4k.js → api-entry-N3nBOlI2.js} +0 -0
- /package/dist/{context-utils-BvWW0Ilq.d.ts → context-utils-OMkMGhBk.d.ts} +0 -0
- /package/dist/{create-schema-odyF4kCy.js → create-schema-BXrKE2YY.js} +0 -0
- /package/dist/{error-BZEnI7Sq.js → error-Bvo7YEhk.js} +0 -0
- /package/dist/{generated-contract-disabled-Cih4eITO.js → generated-contract-disabled-BXaz7JCE.js} +0 -0
- /package/dist/{meta-utils-0Pu0Nrap.js → meta-utils-D9K4fICl.js} +0 -0
- /package/dist/{query-context-CFZqIvD7.d.ts → query-context-CNo9ffvI.d.ts} +0 -0
- /package/dist/{query-context-B8o6-8kC.js → query-context-ydn9kb6P.js} +0 -0
- /package/dist/{query-options-Dw7cOyXl.js → query-options-C96zLANM.js} +0 -0
- /package/dist/{transformer-DtDhR3Lc.js → transformer-C6pGVHqx.js} +0 -0
- /package/dist/{types-BiJE7qxR.d.ts → types-BCl8gfGy.d.ts} +0 -0
- /package/dist/{types-a-RHmrDZ.d.ts → types-CnTpHR1F.d.ts} +0 -0
- /package/dist/{types-BTb_4BaU.d.ts → types-DF2cg_w0.d.ts} +0 -0
- /package/dist/{validators-vzRKjBJC.d.ts → validators-BhsByJeg.d.ts} +0 -0
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { t as omit } from "./upstream-BUCdbLok.mjs";
|
|
3
|
+
import { createAuthEndpoint, createAuthMiddleware, sessionMiddleware } from "better-auth/api";
|
|
4
|
+
import { bearer } from "better-auth/plugins/bearer";
|
|
5
|
+
import { jwt } from "better-auth/plugins/jwt";
|
|
6
|
+
import { oidcProvider } from "better-auth/plugins/oidc-provider";
|
|
7
|
+
|
|
8
|
+
//#region src/auth/internal/convex-plugin.ts
|
|
9
|
+
const JWT_COOKIE_NAME = "convex_jwt";
|
|
10
|
+
const normalizeAfterHooks = (hooks) => {
|
|
11
|
+
return hooks.map((hook) => ({
|
|
12
|
+
...hook,
|
|
13
|
+
matcher: (ctx) => Boolean(hook.matcher(ctx))
|
|
14
|
+
}));
|
|
15
|
+
};
|
|
16
|
+
const getJwksAlg = (authProvider) => {
|
|
17
|
+
const isCustomJwt = "type" in authProvider && authProvider.type === "customJwt";
|
|
18
|
+
if (isCustomJwt && authProvider.algorithm !== "RS256") throw new Error("Only RS256 is supported for custom JWT with Better Auth");
|
|
19
|
+
return isCustomJwt ? authProvider.algorithm : "EdDSA";
|
|
20
|
+
};
|
|
21
|
+
const parseAuthConfig = (authConfig, opts) => {
|
|
22
|
+
const providerConfigs = authConfig.providers.filter((provider) => provider.applicationID === "convex");
|
|
23
|
+
if (providerConfigs.length > 1) throw new Error("Multiple auth providers with applicationID 'convex' detected. Please use only one.");
|
|
24
|
+
const providerConfig = providerConfigs[0];
|
|
25
|
+
if (!providerConfig) throw new Error("No auth provider with applicationID 'convex' found. Please add one to your auth config.");
|
|
26
|
+
if (!("type" in providerConfig) || providerConfig.type !== "customJwt") return providerConfig;
|
|
27
|
+
const isDataUriJwks = providerConfig.jwks?.startsWith("data:text/");
|
|
28
|
+
if (isDataUriJwks && !opts.jwks) throw new Error("Static JWKS detected in auth config, but missing from Convex plugin");
|
|
29
|
+
if (!isDataUriJwks && opts.jwks) console.warn("Static JWKS provided to Convex plugin, but not to auth config. This adds an unnecessary network request for token verification.");
|
|
30
|
+
return providerConfig;
|
|
31
|
+
};
|
|
32
|
+
const convex = (opts) => {
|
|
33
|
+
const jwtExpirationSeconds = opts.jwt?.expirationSeconds ?? opts.jwtExpirationSeconds ?? 900;
|
|
34
|
+
const oidcProvider$1 = oidcProvider({
|
|
35
|
+
loginPage: "/not-used",
|
|
36
|
+
metadata: {
|
|
37
|
+
issuer: `${process.env.CONVEX_SITE_URL}`,
|
|
38
|
+
jwks_uri: `${process.env.CONVEX_SITE_URL}${opts.options?.basePath ?? "/api/auth"}/convex/jwks`
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
const providerConfig = parseAuthConfig(opts.authConfig, opts);
|
|
42
|
+
const jwtOptions = {
|
|
43
|
+
jwt: {
|
|
44
|
+
issuer: `${process.env.CONVEX_SITE_URL}`,
|
|
45
|
+
audience: "convex",
|
|
46
|
+
expirationTime: `${jwtExpirationSeconds}s`,
|
|
47
|
+
definePayload: async ({ user, session }) => ({
|
|
48
|
+
...opts.jwt?.definePayload ? await opts.jwt.definePayload({
|
|
49
|
+
session,
|
|
50
|
+
user
|
|
51
|
+
}) : omit(user, ["id", "image"]),
|
|
52
|
+
sessionId: session.id,
|
|
53
|
+
iat: Math.floor(Date.now() / 1e3)
|
|
54
|
+
})
|
|
55
|
+
},
|
|
56
|
+
jwks: { keyPairConfig: { alg: getJwksAlg(providerConfig) } }
|
|
57
|
+
};
|
|
58
|
+
const jwks = opts.jwks ? JSON.parse(opts.jwks) : void 0;
|
|
59
|
+
const jwt$1 = jwt({
|
|
60
|
+
...jwtOptions,
|
|
61
|
+
adapter: {
|
|
62
|
+
createJwk: async (webKey, ctx) => {
|
|
63
|
+
if (opts.jwks) throw new Error("Not implemented");
|
|
64
|
+
return await ctx.context.adapter.create({
|
|
65
|
+
model: "jwks",
|
|
66
|
+
data: {
|
|
67
|
+
...webKey,
|
|
68
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
getJwks: async (ctx) => {
|
|
73
|
+
if (opts.jwks) return jwks;
|
|
74
|
+
return (await ctx.context.adapter.findMany({
|
|
75
|
+
model: "jwks",
|
|
76
|
+
sortBy: {
|
|
77
|
+
direction: "desc",
|
|
78
|
+
field: "createdAt"
|
|
79
|
+
}
|
|
80
|
+
})).map((key) => ({
|
|
81
|
+
...key,
|
|
82
|
+
createdAt: new Date(key.createdAt),
|
|
83
|
+
...key.expiresAt ? { expiresAt: new Date(key.expiresAt) } : {}
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
const bearer$1 = bearer();
|
|
89
|
+
const schema = {
|
|
90
|
+
user: { fields: { userId: {
|
|
91
|
+
type: "string",
|
|
92
|
+
required: false,
|
|
93
|
+
input: false
|
|
94
|
+
} } },
|
|
95
|
+
...jwt$1.schema
|
|
96
|
+
};
|
|
97
|
+
return {
|
|
98
|
+
id: "convex",
|
|
99
|
+
init: (ctx) => {
|
|
100
|
+
const { options } = ctx;
|
|
101
|
+
if (options.basePath !== "/api/auth" && !opts.options?.basePath) console.warn(`Better Auth basePath set to ${options.basePath} but no basePath is set in the Convex plugin. This is probably a mistake.`);
|
|
102
|
+
if (opts.options?.basePath && options.basePath !== opts.options?.basePath) console.warn(`Better Auth basePath ${options.basePath} does not match Convex plugin basePath ${opts.options?.basePath}. This is probably a mistake.`);
|
|
103
|
+
},
|
|
104
|
+
hooks: {
|
|
105
|
+
before: [...bearer$1.hooks.before, {
|
|
106
|
+
matcher: (ctx) => {
|
|
107
|
+
return !ctx.context.adapter.options?.isRunMutationCtx;
|
|
108
|
+
},
|
|
109
|
+
handler: createAuthMiddleware(async (ctx) => {
|
|
110
|
+
ctx.query = {
|
|
111
|
+
...ctx.query,
|
|
112
|
+
disableRefresh: true
|
|
113
|
+
};
|
|
114
|
+
ctx.context.internalAdapter.deleteSession = async (..._args) => {};
|
|
115
|
+
const knownSafePaths = ["/api-key/list", "/api-key/get"];
|
|
116
|
+
const noopWrite = (method) => {
|
|
117
|
+
return async (..._args) => {
|
|
118
|
+
if (ctx.path && !knownSafePaths.includes(ctx.path)) console.warn(`[convex-better-auth] Write operation "${method}" skipped in query context for ${ctx.path}`);
|
|
119
|
+
return 0;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
ctx.context.adapter.create = noopWrite("create");
|
|
123
|
+
ctx.context.adapter.update = noopWrite("update");
|
|
124
|
+
ctx.context.adapter.updateMany = noopWrite("updateMany");
|
|
125
|
+
ctx.context.adapter.delete = noopWrite("delete");
|
|
126
|
+
ctx.context.adapter.deleteMany = noopWrite("deleteMany");
|
|
127
|
+
return { context: ctx };
|
|
128
|
+
})
|
|
129
|
+
}],
|
|
130
|
+
after: [
|
|
131
|
+
...normalizeAfterHooks(oidcProvider$1.hooks.after),
|
|
132
|
+
{
|
|
133
|
+
matcher: (ctx) => {
|
|
134
|
+
return Boolean(ctx.path?.startsWith("/sign-in") || ctx.path?.startsWith("/sign-up") || ctx.path?.startsWith("/callback") || ctx.path?.startsWith("/oauth2/callback") || ctx.path?.startsWith("/magic-link/verify") || ctx.path?.startsWith("/email-otp/verify-email") || ctx.path?.startsWith("/phone-number/verify") || ctx.path?.startsWith("/siwe/verify") || ctx.path?.startsWith("/update-session") || ctx.path?.startsWith("/get-session") && ctx.context.session);
|
|
135
|
+
},
|
|
136
|
+
handler: createAuthMiddleware(async (ctx) => {
|
|
137
|
+
const originalSession = ctx.context.session;
|
|
138
|
+
try {
|
|
139
|
+
ctx.context.session = ctx.context.session ?? ctx.context.newSession;
|
|
140
|
+
const { token } = await jwt$1.endpoints.getToken({
|
|
141
|
+
...ctx,
|
|
142
|
+
headers: {},
|
|
143
|
+
method: "GET",
|
|
144
|
+
returnHeaders: false,
|
|
145
|
+
returnStatus: false
|
|
146
|
+
});
|
|
147
|
+
const jwtCookie = ctx.context.createAuthCookie(JWT_COOKIE_NAME, { maxAge: jwtExpirationSeconds });
|
|
148
|
+
ctx.setCookie(jwtCookie.name, token, jwtCookie.attributes);
|
|
149
|
+
} catch (_error) {}
|
|
150
|
+
ctx.context.session = originalSession;
|
|
151
|
+
})
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
matcher: (ctx) => {
|
|
155
|
+
return Boolean(ctx.path?.startsWith("/sign-out") || ctx.path?.startsWith("/delete-user") || ctx.path?.startsWith("/get-session") && !ctx.context.session);
|
|
156
|
+
},
|
|
157
|
+
handler: createAuthMiddleware(async (ctx) => {
|
|
158
|
+
const jwtCookie = ctx.context.createAuthCookie(JWT_COOKIE_NAME, { maxAge: 0 });
|
|
159
|
+
ctx.setCookie(jwtCookie.name, "", jwtCookie.attributes);
|
|
160
|
+
})
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
endpoints: {
|
|
165
|
+
getOpenIdConfig: createAuthEndpoint("/convex/.well-known/openid-configuration", {
|
|
166
|
+
method: "GET",
|
|
167
|
+
metadata: { isAction: false }
|
|
168
|
+
}, async (ctx) => {
|
|
169
|
+
return await oidcProvider$1.endpoints.getOpenIdConfig({
|
|
170
|
+
...ctx,
|
|
171
|
+
returnHeaders: false,
|
|
172
|
+
returnStatus: false
|
|
173
|
+
});
|
|
174
|
+
}),
|
|
175
|
+
getJwks: createAuthEndpoint("/convex/jwks", {
|
|
176
|
+
method: "GET",
|
|
177
|
+
metadata: { openapi: {
|
|
178
|
+
description: "Get the JSON Web Key Set",
|
|
179
|
+
responses: { "200": { description: "JSON Web Key Set retrieved successfully" } }
|
|
180
|
+
} }
|
|
181
|
+
}, async (ctx) => {
|
|
182
|
+
return await jwt$1.endpoints.getJwks({
|
|
183
|
+
...ctx,
|
|
184
|
+
returnHeaders: false,
|
|
185
|
+
returnStatus: false
|
|
186
|
+
});
|
|
187
|
+
}),
|
|
188
|
+
getLatestJwks: createAuthEndpoint("/convex/latest-jwks", {
|
|
189
|
+
isAction: true,
|
|
190
|
+
method: "POST",
|
|
191
|
+
metadata: {
|
|
192
|
+
SERVER_ONLY: true,
|
|
193
|
+
openapi: { description: "Delete and regenerate JWKS, and return the new JWKS for static usage" }
|
|
194
|
+
}
|
|
195
|
+
}, async (ctx) => {
|
|
196
|
+
await jwt(jwtOptions).endpoints.getJwks({
|
|
197
|
+
...ctx,
|
|
198
|
+
method: "GET"
|
|
199
|
+
});
|
|
200
|
+
const jwks = await ctx.context.adapter.findMany({
|
|
201
|
+
model: "jwks",
|
|
202
|
+
limit: 1,
|
|
203
|
+
sortBy: {
|
|
204
|
+
direction: "desc",
|
|
205
|
+
field: "createdAt"
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
jwks[0].alg = jwtOptions.jwks.keyPairConfig.alg;
|
|
209
|
+
return jwks;
|
|
210
|
+
}),
|
|
211
|
+
rotateKeys: createAuthEndpoint("/convex/rotate-keys", {
|
|
212
|
+
isAction: true,
|
|
213
|
+
method: "POST",
|
|
214
|
+
metadata: {
|
|
215
|
+
SERVER_ONLY: true,
|
|
216
|
+
openapi: { description: "Delete and regenerate JWKS, and return the new JWKS for static usage" }
|
|
217
|
+
}
|
|
218
|
+
}, async (ctx) => {
|
|
219
|
+
await ctx.context.adapter.deleteMany({
|
|
220
|
+
model: "jwks",
|
|
221
|
+
where: []
|
|
222
|
+
});
|
|
223
|
+
await jwt(jwtOptions).endpoints.getJwks({
|
|
224
|
+
...ctx,
|
|
225
|
+
method: "GET"
|
|
226
|
+
});
|
|
227
|
+
const jwks = await ctx.context.adapter.findMany({
|
|
228
|
+
model: "jwks",
|
|
229
|
+
limit: 1,
|
|
230
|
+
sortBy: {
|
|
231
|
+
direction: "desc",
|
|
232
|
+
field: "createdAt"
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
jwks[0].alg = jwtOptions.jwks.keyPairConfig.alg;
|
|
236
|
+
return jwks;
|
|
237
|
+
}),
|
|
238
|
+
getToken: createAuthEndpoint("/convex/token", {
|
|
239
|
+
method: "GET",
|
|
240
|
+
requireHeaders: true,
|
|
241
|
+
use: [sessionMiddleware],
|
|
242
|
+
metadata: { openapi: { description: "Get a JWT token" } }
|
|
243
|
+
}, async (ctx) => {
|
|
244
|
+
const runEndpoint = async () => {
|
|
245
|
+
const response = await jwt$1.endpoints.getToken({
|
|
246
|
+
...ctx,
|
|
247
|
+
returnHeaders: false,
|
|
248
|
+
returnStatus: false
|
|
249
|
+
});
|
|
250
|
+
const jwtCookie = ctx.context.createAuthCookie(JWT_COOKIE_NAME, { maxAge: jwtExpirationSeconds });
|
|
251
|
+
ctx.setCookie(jwtCookie.name, response.token, jwtCookie.attributes);
|
|
252
|
+
return response;
|
|
253
|
+
};
|
|
254
|
+
try {
|
|
255
|
+
return await runEndpoint();
|
|
256
|
+
} catch (error) {
|
|
257
|
+
if (!opts.jwks && error?.code === "ERR_JOSE_NOT_SUPPORTED") {
|
|
258
|
+
if (opts.jwksRotateOnTokenGenerationError) {
|
|
259
|
+
await ctx.context.adapter.deleteMany({
|
|
260
|
+
model: "jwks",
|
|
261
|
+
where: []
|
|
262
|
+
});
|
|
263
|
+
return await runEndpoint();
|
|
264
|
+
}
|
|
265
|
+
console.error("Try temporarily setting jwksRotateOnTokenGenerationError: true on the Convex Better Auth plugin.");
|
|
266
|
+
}
|
|
267
|
+
throw error;
|
|
268
|
+
}
|
|
269
|
+
})
|
|
270
|
+
},
|
|
271
|
+
schema
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
//#endregion
|
|
276
|
+
export { convex };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { augmentBetterAuthTables, indexFields } from "./create-schema-
|
|
1
|
+
import { augmentBetterAuthTables, indexFields } from "./create-schema-BXrKE2YY.js";
|
|
2
2
|
|
|
3
3
|
//#region src/auth/create-schema-orm.ts
|
|
4
4
|
const specialFields = (tables) => Object.fromEntries(Object.entries(tables).map(([key, table]) => {
|
package/dist/crpc/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as DataTransformer, F as decodeWire, I as defaultCRPCTransformer, L as encodeWire, M as WireCodec, N as createTaggedTransformer, O as CombinedDataTransformer, P as dateWireCodec, R as getTransformer, a as HttpProcedureCall, c as InferHttpInput, i as HttpErrorCode, j as DataTransformerOptions, k as DATE_CODEC_TAG, l as InferHttpOutput, n as HttpClientError, o as HttpRouteInfo, r as HttpClientFromRouter, s as HttpRouteMap, t as HttpClient, u as isHttpClientError, z as identityTransformer } from "../http-types-
|
|
2
|
-
import { A as HttpInputArgs, C as ReservedMutationOptions, D as VanillaMutation, E as VanillaAction, F as replaceUrlParam, M as RESERVED_KEYS, N as buildSearchParams, O as HttpClientOptions, P as executeHttpRequest, S as ReservedInfiniteQueryOptions, T as StaticQueryOptsParam, _ as IsPaginated, a as BaseInfiniteQueryOptsParam, b as PaginatedFnMeta, c as ConvexMutationKey, d as ConvexQueryMeta, f as EmptyObject, g as InfiniteQueryInput, h as FnMeta, i as BaseConvexQueryOptions, j as HttpProxyBaseOptions, k as HttpFormValue, l as ConvexQueryHookOptions, m as FUNC_REF_SYMBOL, n as BaseConvexActionOptions, o as ConvexActionKey, p as ExtractPaginatedItem, r as BaseConvexInfiniteQueryOptions, s as ConvexInfiniteQueryMeta, t as AuthType, u as ConvexQueryKey, v as Meta, w as ReservedQueryOptions, x as PaginationOpts, y as MutationVariables } from "../types-
|
|
1
|
+
import { A as DataTransformer, F as decodeWire, I as defaultCRPCTransformer, L as encodeWire, M as WireCodec, N as createTaggedTransformer, O as CombinedDataTransformer, P as dateWireCodec, R as getTransformer, a as HttpProcedureCall, c as InferHttpInput, i as HttpErrorCode, j as DataTransformerOptions, k as DATE_CODEC_TAG, l as InferHttpOutput, n as HttpClientError, o as HttpRouteInfo, r as HttpClientFromRouter, s as HttpRouteMap, t as HttpClient, u as isHttpClientError, z as identityTransformer } from "../http-types-zsMHb_QN.js";
|
|
2
|
+
import { A as HttpInputArgs, C as ReservedMutationOptions, D as VanillaMutation, E as VanillaAction, F as replaceUrlParam, M as RESERVED_KEYS, N as buildSearchParams, O as HttpClientOptions, P as executeHttpRequest, S as ReservedInfiniteQueryOptions, T as StaticQueryOptsParam, _ as IsPaginated, a as BaseInfiniteQueryOptsParam, b as PaginatedFnMeta, c as ConvexMutationKey, d as ConvexQueryMeta, f as EmptyObject, g as InfiniteQueryInput, h as FnMeta, i as BaseConvexQueryOptions, j as HttpProxyBaseOptions, k as HttpFormValue, l as ConvexQueryHookOptions, m as FUNC_REF_SYMBOL, n as BaseConvexActionOptions, o as ConvexActionKey, p as ExtractPaginatedItem, r as BaseConvexInfiniteQueryOptions, s as ConvexInfiniteQueryMeta, t as AuthType, u as ConvexQueryKey, v as Meta, w as ReservedQueryOptions, x as PaginationOpts, y as MutationVariables } from "../types-YHpe0rsb.js";
|
|
3
3
|
import { FunctionArgs, FunctionReference } from "convex/server";
|
|
4
4
|
|
|
5
5
|
//#region src/crpc/auth-error.d.ts
|
package/dist/crpc/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as isCRPCErrorCode, i as isCRPCError, n as defaultIsUnauthorized, r as isCRPCClientError, t as CRPCClientError } from "../error-
|
|
2
|
-
import { a as defaultCRPCTransformer, c as identityTransformer, i as decodeWire, n as createTaggedTransformer, o as encodeWire, r as dateWireCodec, s as getTransformer, t as DATE_CODEC_TAG } from "../transformer-
|
|
3
|
-
import { n as convexInfiniteQueryOptions, r as convexQuery, t as convexAction } from "../query-options-
|
|
1
|
+
import { a as isCRPCErrorCode, i as isCRPCError, n as defaultIsUnauthorized, r as isCRPCClientError, t as CRPCClientError } from "../error-Bvo7YEhk.js";
|
|
2
|
+
import { a as defaultCRPCTransformer, c as identityTransformer, i as decodeWire, n as createTaggedTransformer, o as encodeWire, r as dateWireCodec, s as getTransformer, t as DATE_CODEC_TAG } from "../transformer-C6pGVHqx.js";
|
|
3
|
+
import { n as convexInfiniteQueryOptions, r as convexQuery, t as convexAction } from "../query-options-C96zLANM.js";
|
|
4
4
|
|
|
5
5
|
//#region src/crpc/auth-error.ts
|
|
6
6
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as pick, r as omit } from "./upstream-BR6sBLg3.js";
|
|
2
|
+
import { t as addFieldsToValidator } from "./validators-C7LelqTN.js";
|
|
2
3
|
|
|
3
4
|
//#region src/internal/upstream/server/customFunctions.ts
|
|
4
5
|
/**
|
package/dist/{generated-contract-disabled-21YxPk5W.d.ts → generated-contract-disabled-C_-KWRfT.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as GetAuth } from "./types-
|
|
2
|
-
import { t as GenericCtx } from "./context-utils-
|
|
1
|
+
import { t as GetAuth } from "./types-BCl8gfGy.js";
|
|
2
|
+
import { t as GenericCtx } from "./context-utils-OMkMGhBk.js";
|
|
3
3
|
import * as convex_server0 from "convex/server";
|
|
4
4
|
import { DocumentByName, FunctionReference, GenericDataModel, GenericMutationCtx, GenericSchema, SchemaDefinition, TableNamesInDataModel, internalMutationGeneric } from "convex/server";
|
|
5
5
|
import * as better_auth_adapters0 from "better-auth/adapters";
|
|
@@ -218,6 +218,7 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>, DataModel e
|
|
|
218
218
|
findMany: convex_server0.RegisteredQuery<"internal", {
|
|
219
219
|
join?: any;
|
|
220
220
|
where?: {
|
|
221
|
+
mode?: "sensitive" | "insensitive" | undefined;
|
|
221
222
|
connector?: "AND" | "OR" | undefined;
|
|
222
223
|
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
223
224
|
value: string | number | boolean | string[] | number[] | null;
|
|
@@ -243,6 +244,7 @@ declare const createApi: <Schema extends SchemaDefinition<any, any>, DataModel e
|
|
|
243
244
|
join?: any;
|
|
244
245
|
select?: string[] | undefined;
|
|
245
246
|
where?: {
|
|
247
|
+
mode?: "sensitive" | "insensitive" | undefined;
|
|
246
248
|
connector?: "AND" | "OR" | undefined;
|
|
247
249
|
operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "not_in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
248
250
|
value: string | number | boolean | string[] | number[] | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as Simplify } from "./types-
|
|
2
|
-
import { g as UnsetMarker, t as AnyMiddleware } from "./types-
|
|
1
|
+
import { o as Simplify } from "./types-DF2cg_w0.js";
|
|
2
|
+
import { g as UnsetMarker, t as AnyMiddleware } from "./types-CnTpHR1F.js";
|
|
3
3
|
import { GenericActionCtx, GenericDataModel, HttpRouter } from "convex/server";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { Context, Hono } from "hono";
|
package/dist/orm/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as GenericOrmCtx$1, $n as unique, $r as endsWith, $t as ManyConfig, A as ConvexDateMode, An as ConvexRankIndexBuilder, Ar as ReturningResult, At as MigrationManifestEntry, B as ConvexBytesBuilderInitial, Bn as rankIndex, Br as OrmSchemaRelations, Bt as defineMigration, C as ConvexNumberBuilderInitial, Ci as ColumnBuilderWithTableName, Cn as RlsRole, Cr as MutationReturning, Ct as MigrationStatusArgs, D as id, Di as IsPrimaryKey, Dn as ConvexAggregateIndexBuilderOn, Dr as PaginatedResult, Dt as MigrationDoc, E as ConvexIdBuilderInitial, Ei as HasDefault, En as ConvexAggregateIndexBuilder, Er as OrderDirection, Et as MigrationDirection, F as custom, Fn as ConvexVectorIndexBuilder, Fr as unsetToken, Ft as MigrationStateMap, G as ConvexBigIntBuilder, Gn as ConvexCheckConfig, Gr as ExpressionVisitor, Gt as OrmReader$1, H as ConvexBooleanBuilder, Hn as uniqueIndex, Hr as TableName, Ht as detectMigrationDrift, I as json, In as ConvexVectorIndexBuilderOn, Ir as Brand, It as MigrationStep, J as CountBackfillChunkArgs, Jn as ConvexUniqueConstraintBuilder, Jr as LogicalExpression, Jt as RlsMode, K as ConvexBigIntBuilderInitial, Kn as ConvexForeignKeyBuilder, Kr as FieldReference, Kt as OrmWriter$1, L as objectOf, Ln as ConvexVectorIndexConfig, Lr as Columns, Lt as MigrationTableName, M as ConvexCustomBuilder, Mn as ConvexSearchIndexBuilder, Mr as UpdateSet, Mt as MigrationPlan, N as ConvexCustomBuilderInitial, Nn as ConvexSearchIndexBuilderOn, Nr as VectorQueryConfig, Nt as MigrationRunStatus, O as ConvexDateBuilder, Oi as IsUnique, On as ConvexIndexBuilder, Or as PredicateWhereIndexConfig, Ot as MigrationDocContext, P as arrayOf, Pn as ConvexSearchIndexConfig, Pr as VectorSearchProvider, Pt as MigrationSet, Q as GenericOrm$1, Qn as foreignKey, Qr as contains, Qt as ExtractTablesWithRelations, R as unionOf, Rn as aggregateIndex, Rr as OrmSchemaExtensionTables, Rt as MigrationWriteMode, S as ConvexNumberBuilder, Si as ColumnBuilderTypeConfig, Sn as rlsPolicy, Sr as MutationResult, St as MigrationRunChunkArgs, T as ConvexIdBuilder, Ti as DrizzleEntity, Tn as rlsRole, Tr as OrderByClause, Tt as MigrationDefinition, U as ConvexBooleanBuilderInitial, Un as vectorIndex, Ur as SystemFields, Ut as DatabaseWithMutations, V as bytes, Vn as searchIndex, Vr as OrmSchemaTriggers, Vt as defineMigrationSet, W as boolean, Wn as ConvexCheckBuilder, Wr as BinaryExpression, Wt as DatabaseWithQuery, X as CountBackfillStatusArgs, Xn as ConvexUniqueConstraintConfig, Xr as and, Xt as extractRelationsConfig, Y as CountBackfillKickoffArgs, Yn as ConvexUniqueConstraintBuilderOn, Yr as UnaryExpression, Yt as EdgeMetadata, Z as CreateOrmOptions, Zn as check, Zr as between, Zt as ExtractTablesFromSchema, _ as ConvexTimestampMode, _i as startsWith, _n as deletion, _r as MutationExecuteConfig, _t as OrmTriggerContext, a as requireSchemaRelations, ai as inArray, an as TablesRelationalConfig, ar as AggregateResult, at as OrmWriterCtx, b as ConvexTextEnumBuilderInitial, bi as ColumnBuilderBaseConfig, bn as RlsPolicyConfig, br as MutationPaginateConfig, bt as MigrationCancelArgs, c as TableConfigResult, ci as isNull, cn as ConvexDeletionBuilder, cr as CountConfig, ct as ScheduledMutationBatchArgs, d as OrmNotFoundError, di as lte, dn as ConvexTableWithColumns, dr as FilterOperators, dt as scheduledDeleteFactory, ei as eq, en as OneConfig, er as ConvexTextBuilder, et as OrmApiResult, f as ConvexVectorBuilder, fi as ne, fn as DiscriminatorBuilderConfig, fr as GetColumnData, ft as SchemaExtension, g as ConvexTimestampBuilderInitial, gi as or, gn as convexTable, gr as InsertValue, gt as OrmTriggerChange, h as ConvexTimestampBuilder, hi as notInArray, hn as TableConfig, hr as InferSelectModel, ht as OrmTableTriggers, i as getSchemaTriggers, ii as ilike, in as TableRelationalConfig, ir as AggregateFieldValue, it as OrmReaderCtx, j as date, jn as ConvexRankIndexBuilderOn, jr as ReturningSelection, jt as MigrationMigrateOne, k as ConvexDateBuilderInitial, ki as NotNull, kn as ConvexIndexBuilderOn, kr as ReturningAll, kt as MigrationDriftIssue, l as getTableColumns, li as like, ln as ConvexDeletionConfig, lr as CountResult, lt as scheduledMutationBatchFactory, m as vector, mi as notBetween, mn as OrmLifecycleOperation, mr as InferModelFromColumns, mt as OrmBeforeResult, n as defineSchema, ni as gt, nn as RelationsBuilderColumnBase, nr as text, nt as OrmClientWithApi$1, o as asc, oi as isFieldReference, on as defineRelations, or as BuildQueryResult, ot as ResolveOrmSchema, p as ConvexVectorBuilderInitial, pi as not, pn as OrmLifecycleChange, pr as InferInsertModel, pt as defineSchemaExtension, q as bigint, qn as ConvexForeignKeyConfig, qr as FilterExpression, qt as RlsContext, r as getSchemaRelations, ri as gte, rn as RelationsBuilderColumnConfig, rr as AggregateConfig, rt as OrmFunctions, s as desc, si as isNotNull, sn as defineRelationsPart, sr as BuildRelationResult, st as createOrm, t as WhereClauseResult, ti as fieldRef, tn as RelationsBuilder, tr as ConvexTextBuilderInitial, tt as OrmClientBase$1, u as getTableConfig, ui as lt, un as ConvexTable, ur as DBQueryConfig, ut as ScheduledDeleteArgs, v as timestamp, vi as AnyColumn, vn as discriminator, vr as MutationExecuteResult, vt as OrmTriggers, w as integer, wi as ColumnDataType, wn as RlsRoleConfig, wr as MutationRunMode, wt as MigrationAppliedState, x as textEnum, xi as ColumnBuilderRuntimeConfig, xn as RlsPolicyToOption, xr as MutationPaginatedResult, xt as MigrationRunArgs, y as ConvexTextEnumBuilder, yi as ColumnBuilder, yn as RlsPolicy, yr as MutationExecutionMode, yt as defineTriggers, z as ConvexBytesBuilder, zn as index, zr as OrmSchemaExtensions, zt as buildMigrationPlan } from "../where-clause-compiler-
|
|
2
|
-
import { i as pretendRequired, n as deprecated, r as pretend } from "../validators-
|
|
3
|
-
import { a as QueryCtxWithPreferredOrmQueryTable, i as QueryCtxWithOrmQueryTable, n as LookupByIdResultByCtx, o as getByIdWithOrmQueryFallback, r as QueryCtxWithOptionalOrmQueryTable, t as DocByCtx } from "../query-context-
|
|
1
|
+
import { $ as GenericOrmCtx$1, $n as unique, $r as endsWith, $t as ManyConfig, A as ConvexDateMode, An as ConvexRankIndexBuilder, Ar as ReturningResult, At as MigrationManifestEntry, B as ConvexBytesBuilderInitial, Bn as rankIndex, Br as OrmSchemaRelations, Bt as defineMigration, C as ConvexNumberBuilderInitial, Ci as ColumnBuilderWithTableName, Cn as RlsRole, Cr as MutationReturning, Ct as MigrationStatusArgs, D as id, Di as IsPrimaryKey, Dn as ConvexAggregateIndexBuilderOn, Dr as PaginatedResult, Dt as MigrationDoc, E as ConvexIdBuilderInitial, Ei as HasDefault, En as ConvexAggregateIndexBuilder, Er as OrderDirection, Et as MigrationDirection, F as custom, Fn as ConvexVectorIndexBuilder, Fr as unsetToken, Ft as MigrationStateMap, G as ConvexBigIntBuilder, Gn as ConvexCheckConfig, Gr as ExpressionVisitor, Gt as OrmReader$1, H as ConvexBooleanBuilder, Hn as uniqueIndex, Hr as TableName, Ht as detectMigrationDrift, I as json, In as ConvexVectorIndexBuilderOn, Ir as Brand, It as MigrationStep, J as CountBackfillChunkArgs, Jn as ConvexUniqueConstraintBuilder, Jr as LogicalExpression, Jt as RlsMode, K as ConvexBigIntBuilderInitial, Kn as ConvexForeignKeyBuilder, Kr as FieldReference, Kt as OrmWriter$1, L as objectOf, Ln as ConvexVectorIndexConfig, Lr as Columns, Lt as MigrationTableName, M as ConvexCustomBuilder, Mn as ConvexSearchIndexBuilder, Mr as UpdateSet, Mt as MigrationPlan, N as ConvexCustomBuilderInitial, Nn as ConvexSearchIndexBuilderOn, Nr as VectorQueryConfig, Nt as MigrationRunStatus, O as ConvexDateBuilder, Oi as IsUnique, On as ConvexIndexBuilder, Or as PredicateWhereIndexConfig, Ot as MigrationDocContext, P as arrayOf, Pn as ConvexSearchIndexConfig, Pr as VectorSearchProvider, Pt as MigrationSet, Q as GenericOrm$1, Qn as foreignKey, Qr as contains, Qt as ExtractTablesWithRelations, R as unionOf, Rn as aggregateIndex, Rr as OrmSchemaExtensionTables, Rt as MigrationWriteMode, S as ConvexNumberBuilder, Si as ColumnBuilderTypeConfig, Sn as rlsPolicy, Sr as MutationResult, St as MigrationRunChunkArgs, T as ConvexIdBuilder, Ti as DrizzleEntity, Tn as rlsRole, Tr as OrderByClause, Tt as MigrationDefinition, U as ConvexBooleanBuilderInitial, Un as vectorIndex, Ur as SystemFields, Ut as DatabaseWithMutations, V as bytes, Vn as searchIndex, Vr as OrmSchemaTriggers, Vt as defineMigrationSet, W as boolean, Wn as ConvexCheckBuilder, Wr as BinaryExpression, Wt as DatabaseWithQuery, X as CountBackfillStatusArgs, Xn as ConvexUniqueConstraintConfig, Xr as and, Xt as extractRelationsConfig, Y as CountBackfillKickoffArgs, Yn as ConvexUniqueConstraintBuilderOn, Yr as UnaryExpression, Yt as EdgeMetadata, Z as CreateOrmOptions, Zn as check, Zr as between, Zt as ExtractTablesFromSchema, _ as ConvexTimestampMode, _i as startsWith, _n as deletion, _r as MutationExecuteConfig, _t as OrmTriggerContext, a as requireSchemaRelations, ai as inArray, an as TablesRelationalConfig, ar as AggregateResult, at as OrmWriterCtx, b as ConvexTextEnumBuilderInitial, bi as ColumnBuilderBaseConfig, bn as RlsPolicyConfig, br as MutationPaginateConfig, bt as MigrationCancelArgs, c as TableConfigResult, ci as isNull, cn as ConvexDeletionBuilder, cr as CountConfig, ct as ScheduledMutationBatchArgs, d as OrmNotFoundError, di as lte, dn as ConvexTableWithColumns, dr as FilterOperators, dt as scheduledDeleteFactory, ei as eq, en as OneConfig, er as ConvexTextBuilder, et as OrmApiResult, f as ConvexVectorBuilder, fi as ne, fn as DiscriminatorBuilderConfig, fr as GetColumnData, ft as SchemaExtension, g as ConvexTimestampBuilderInitial, gi as or, gn as convexTable, gr as InsertValue, gt as OrmTriggerChange, h as ConvexTimestampBuilder, hi as notInArray, hn as TableConfig, hr as InferSelectModel, ht as OrmTableTriggers, i as getSchemaTriggers, ii as ilike, in as TableRelationalConfig, ir as AggregateFieldValue, it as OrmReaderCtx, j as date, jn as ConvexRankIndexBuilderOn, jr as ReturningSelection, jt as MigrationMigrateOne, k as ConvexDateBuilderInitial, ki as NotNull, kn as ConvexIndexBuilderOn, kr as ReturningAll, kt as MigrationDriftIssue, l as getTableColumns, li as like, ln as ConvexDeletionConfig, lr as CountResult, lt as scheduledMutationBatchFactory, m as vector, mi as notBetween, mn as OrmLifecycleOperation, mr as InferModelFromColumns, mt as OrmBeforeResult, n as defineSchema, ni as gt, nn as RelationsBuilderColumnBase, nr as text, nt as OrmClientWithApi$1, o as asc, oi as isFieldReference, on as defineRelations, or as BuildQueryResult, ot as ResolveOrmSchema, p as ConvexVectorBuilderInitial, pi as not, pn as OrmLifecycleChange, pr as InferInsertModel, pt as defineSchemaExtension, q as bigint, qn as ConvexForeignKeyConfig, qr as FilterExpression, qt as RlsContext, r as getSchemaRelations, ri as gte, rn as RelationsBuilderColumnConfig, rr as AggregateConfig, rt as OrmFunctions, s as desc, si as isNotNull, sn as defineRelationsPart, sr as BuildRelationResult, st as createOrm, t as WhereClauseResult, ti as fieldRef, tn as RelationsBuilder, tr as ConvexTextBuilderInitial, tt as OrmClientBase$1, u as getTableConfig, ui as lt, un as ConvexTable, ur as DBQueryConfig, ut as ScheduledDeleteArgs, v as timestamp, vi as AnyColumn, vn as discriminator, vr as MutationExecuteResult, vt as OrmTriggers, w as integer, wi as ColumnDataType, wn as RlsRoleConfig, wr as MutationRunMode, wt as MigrationAppliedState, x as textEnum, xi as ColumnBuilderRuntimeConfig, xn as RlsPolicyToOption, xr as MutationPaginatedResult, xt as MigrationRunArgs, y as ConvexTextEnumBuilder, yi as ColumnBuilder, yn as RlsPolicy, yr as MutationExecutionMode, yt as defineTriggers, z as ConvexBytesBuilder, zn as index, zr as OrmSchemaExtensions, zt as buildMigrationPlan } from "../where-clause-compiler-TMppDl9g.js";
|
|
2
|
+
import { i as pretendRequired, n as deprecated, r as pretend } from "../validators-BhsByJeg.js";
|
|
3
|
+
import { a as QueryCtxWithPreferredOrmQueryTable, i as QueryCtxWithOrmQueryTable, n as LookupByIdResultByCtx, o as getByIdWithOrmQueryFallback, r as QueryCtxWithOptionalOrmQueryTable, t as DocByCtx } from "../query-context-CNo9ffvI.js";
|
|
4
4
|
import { DefineSchemaOptions, GenericDatabaseReader, GenericDatabaseWriter, GenericSchema, SchemaDefinition } from "convex/server";
|
|
5
5
|
|
|
6
6
|
//#region src/orm/index.d.ts
|
package/dist/orm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as vectorIndex, B as ConvexColumnBuilder, C as RlsPolicy, D as rankIndex, E as index, F as arrayOf, I as custom, L as json, M as createSystemFields, N as integer, O as searchIndex, P as id, R as objectOf, S as TablePolymorphic, T as aggregateIndex, V as entityKind, _ as OrmSchemaRelations, a as deletion, b as TableDeleteConfig, c as Columns, d as OrmSchemaDefinition, f as OrmSchemaExtensionRelations, g as OrmSchemaOptions, h as OrmSchemaExtensions, i as convexTable, j as text, k as uniqueIndex, l as EnableRLS, m as OrmSchemaExtensionTriggers, o as discriminator, p as OrmSchemaExtensionTables, s as Brand, t as DirectAggregate, u as OrmContext, v as OrmSchemaTriggers, w as rlsPolicy, x as TableName, y as RlsPolicies, z as unionOf } from "../runtime-
|
|
2
|
-
import { a as pretendRequired, i as pretend, n as deprecated } from "../validators-
|
|
3
|
-
import { A as ne, C as inArray, D as like, E as isNull, F as notLike, I as or, L as startsWith, M as notBetween, N as notIlike, O as lt, P as notInArray, S as ilike, T as isNotNull, _ as endsWith, a as mergedStream, b as gt, c as isUnsetToken, d as arrayContained, f as arrayContains, g as contains, h as column, i as getIndexFields, j as not, k as lte, l as unsetToken, m as between, n as EmptyStream, o as stream, p as arrayOverlaps, r as QueryStream, s as streamIndexRange, t as getByIdWithOrmQueryFallback, u as and, v as eq, w as isFieldReference, x as gte, y as fieldRef } from "../query-context-
|
|
1
|
+
import { A as vectorIndex, B as ConvexColumnBuilder, C as RlsPolicy, D as rankIndex, E as index, F as arrayOf, I as custom, L as json, M as createSystemFields, N as integer, O as searchIndex, P as id, R as objectOf, S as TablePolymorphic, T as aggregateIndex, V as entityKind, _ as OrmSchemaRelations, a as deletion, b as TableDeleteConfig, c as Columns, d as OrmSchemaDefinition, f as OrmSchemaExtensionRelations, g as OrmSchemaOptions, h as OrmSchemaExtensions, i as convexTable, j as text, k as uniqueIndex, l as EnableRLS, m as OrmSchemaExtensionTriggers, o as discriminator, p as OrmSchemaExtensionTables, s as Brand, t as DirectAggregate, u as OrmContext, v as OrmSchemaTriggers, w as rlsPolicy, x as TableName, y as RlsPolicies, z as unionOf } from "../runtime-i6t-HoZn.js";
|
|
2
|
+
import { a as pretendRequired, i as pretend, n as deprecated } from "../validators-C7LelqTN.js";
|
|
3
|
+
import { A as ne, C as inArray, D as like, E as isNull, F as notLike, I as or, L as startsWith, M as notBetween, N as notIlike, O as lt, P as notInArray, S as ilike, T as isNotNull, _ as endsWith, a as mergedStream, b as gt, c as isUnsetToken, d as arrayContained, f as arrayContains, g as contains, h as column, i as getIndexFields, j as not, k as lte, l as unsetToken, m as between, n as EmptyStream, o as stream, p as arrayOverlaps, r as QueryStream, s as streamIndexRange, t as getByIdWithOrmQueryFallback, u as and, v as eq, w as isFieldReference, x as gte, y as fieldRef } from "../query-context-ydn9kb6P.js";
|
|
4
4
|
import { v } from "convex/values";
|
|
5
5
|
import { defineSchema as defineSchema$1, internalActionGeneric, internalMutationGeneric } from "convex/server";
|
|
6
6
|
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as PluginConfigureResolver, i as PluginConfigureInput, n as PluginApiScope, o as definePlugin, r as PluginConfigureContext, s as resolvePluginOptions, t as Plugin } from "../middleware-
|
|
1
|
+
import { a as PluginConfigureResolver, i as PluginConfigureInput, n as PluginApiScope, o as definePlugin, r as PluginConfigureContext, s as resolvePluginOptions, t as Plugin } from "../middleware-DrtexzF3.js";
|
|
2
2
|
export { type Plugin, type PluginApiScope, type PluginConfigureContext, type PluginConfigureInput, type PluginConfigureResolver, definePlugin, resolvePluginOptions };
|
package/dist/plugins/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as decodeWire, o as encodeWire } from "./transformer-
|
|
2
|
-
import { _ as CRPCError } from "./builder-
|
|
1
|
+
import { i as decodeWire, o as encodeWire } from "./transformer-C6pGVHqx.js";
|
|
2
|
+
import { _ as CRPCError } from "./builder-DBgto1yn.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/server/env.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as VRequired } from "./validators-
|
|
2
|
-
import { C as HttpProcedure, D as ProcedureMeta, R as getTransformer, S as HttpMethod, c as InferHttpInput, d as CRPCHttpRouter, j as DataTransformerOptions, l as InferHttpOutput, p as HttpRouterRecord, w as HttpProcedureBuilderDef, x as HttpHandlerOpts } from "./http-types-
|
|
3
|
-
import { g as UnsetMarker, i as IntersectIfDefined, o as MiddlewareBuilder, p as Overwrite$1, s as MiddlewareFunction, t as AnyMiddleware } from "./types-
|
|
1
|
+
import { t as VRequired } from "./validators-BhsByJeg.js";
|
|
2
|
+
import { C as HttpProcedure, D as ProcedureMeta, R as getTransformer, S as HttpMethod, c as InferHttpInput, d as CRPCHttpRouter, j as DataTransformerOptions, l as InferHttpOutput, p as HttpRouterRecord, w as HttpProcedureBuilderDef, x as HttpHandlerOpts } from "./http-types-zsMHb_QN.js";
|
|
3
|
+
import { g as UnsetMarker, i as IntersectIfDefined, o as MiddlewareBuilder, p as Overwrite$1, s as MiddlewareFunction, t as AnyMiddleware } from "./types-CnTpHR1F.js";
|
|
4
4
|
import { ConvexError, GenericId, GenericValidator, ObjectType, OptionalProperty, PropertyValidators, VAny, VArray, VBoolean, VBytes, VFloat64, VId, VInt64, VLiteral, VNull, VObject, VOptional, VRecord, VString, VUnion, Validator, Value as Value$1 } from "convex/values";
|
|
5
5
|
import { ActionBuilder, ArgsArrayToObject, DefaultFunctionArgs, FunctionReference, FunctionReturnType, FunctionVisibility, GenericActionCtx, GenericDataModel, GenericMutationCtx, GenericQueryCtx, MutationBuilder, QueryBuilder, RegisteredAction, RegisteredMutation, RegisteredQuery, TableNamesInDataModel } from "convex/server";
|
|
6
6
|
import { z } from "zod";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as MiddlewareBuilder } from "../types-
|
|
2
|
-
import { t as Plugin } from "../middleware-
|
|
1
|
+
import { o as MiddlewareBuilder } from "../types-CnTpHR1F.js";
|
|
2
|
+
import { t as Plugin } from "../middleware-DrtexzF3.js";
|
|
3
3
|
import * as convex_server0 from "convex/server";
|
|
4
4
|
|
|
5
5
|
//#region src/ratelimit/duration.d.ts
|
package/dist/ratelimit/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { u as requireMutationCtx } from "../api-entry-
|
|
2
|
-
import { _ as CRPCError } from "../builder-
|
|
3
|
-
import { t as definePlugin } from "../middleware-
|
|
1
|
+
import { u as requireMutationCtx } from "../api-entry-N3nBOlI2.js";
|
|
2
|
+
import { _ as CRPCError } from "../builder-DBgto1yn.js";
|
|
3
|
+
import { t as definePlugin } from "../middleware-Bg-PdtrI.js";
|
|
4
4
|
import { v } from "convex/values";
|
|
5
5
|
import { mutationGeneric, queryGeneric } from "convex/server";
|
|
6
6
|
|
package/dist/react/index.d.ts
CHANGED
|
@@ -41,7 +41,10 @@ declare function isAuthMutationError(error: unknown): error is AuthMutationError
|
|
|
41
41
|
//#endregion
|
|
42
42
|
//#region src/react/auth-mutations.d.ts
|
|
43
43
|
type MutationOptionsHook<TData, TVariables = void> = (options?: Omit<UseMutationOptions<TData, DefaultError, TVariables>, 'mutationFn'>) => UseMutationOptions<TData, DefaultError, TVariables>;
|
|
44
|
-
type AnyFn = (...args:
|
|
44
|
+
type AnyFn = (...args: unknown[]) => Promise<unknown>;
|
|
45
|
+
type MutationArgsWithFetchOptions = {
|
|
46
|
+
fetchOptions?: Record<string, unknown>;
|
|
47
|
+
};
|
|
45
48
|
type AuthClient = {
|
|
46
49
|
$store?: {
|
|
47
50
|
atoms?: {
|
|
@@ -68,21 +71,16 @@ type AuthClient = {
|
|
|
68
71
|
};
|
|
69
72
|
};
|
|
70
73
|
getSession?: AnyFn;
|
|
71
|
-
signOut
|
|
72
|
-
signIn
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
signOut?: AnyFn;
|
|
75
|
+
signIn?: {
|
|
76
|
+
anonymous?: AnyFn;
|
|
77
|
+
social?: AnyFn;
|
|
78
|
+
email?: AnyFn;
|
|
75
79
|
};
|
|
76
|
-
signUp
|
|
77
|
-
email
|
|
80
|
+
signUp?: {
|
|
81
|
+
email?: AnyFn;
|
|
78
82
|
};
|
|
79
83
|
};
|
|
80
|
-
type AuthMutationsResult<T extends AuthClient> = {
|
|
81
|
-
useSignOutMutationOptions: MutationOptionsHook<Awaited<ReturnType<T['signOut']>>, Parameters<T['signOut']>[0] | void>;
|
|
82
|
-
useSignInSocialMutationOptions: MutationOptionsHook<Awaited<ReturnType<T['signIn']['social']>>, Parameters<T['signIn']['social']>[0]>;
|
|
83
|
-
useSignInMutationOptions: MutationOptionsHook<Awaited<ReturnType<T['signIn']['email']>>, Parameters<T['signIn']['email']>[0]>;
|
|
84
|
-
useSignUpMutationOptions: MutationOptionsHook<Awaited<ReturnType<T['signUp']['email']>>, Parameters<T['signUp']['email']>[0]>;
|
|
85
|
-
};
|
|
86
84
|
/**
|
|
87
85
|
* Create mutation option hooks from a better-auth client.
|
|
88
86
|
*
|
|
@@ -106,7 +104,13 @@ type AuthMutationsResult<T extends AuthClient> = {
|
|
|
106
104
|
* }));
|
|
107
105
|
* ```
|
|
108
106
|
*/
|
|
109
|
-
|
|
107
|
+
type AuthMutationsResult = {
|
|
108
|
+
useSignOutMutationOptions: MutationOptionsHook<unknown, MutationArgsWithFetchOptions | void>;
|
|
109
|
+
useSignInSocialMutationOptions: MutationOptionsHook<unknown, unknown>;
|
|
110
|
+
useSignInMutationOptions: MutationOptionsHook<unknown, unknown>;
|
|
111
|
+
useSignUpMutationOptions: MutationOptionsHook<unknown, unknown>;
|
|
112
|
+
};
|
|
113
|
+
declare function createAuthMutations(authClient: AuthClient): AuthMutationsResult;
|
|
110
114
|
//#endregion
|
|
111
115
|
//#region src/react/auth-store.d.ts
|
|
112
116
|
type FetchAccessTokenFn = (args: {
|
package/dist/react/index.js
CHANGED
|
@@ -1388,6 +1388,12 @@ const seedReturnedToken = (store, value) => {
|
|
|
1388
1388
|
store.set("sessionSyncGraceUntil", Date.now() + AUTH_SESSION_SYNC_GRACE_MS);
|
|
1389
1389
|
if (decodeJwtExp(token) === null) writeAuthSessionFallbackToken(token);
|
|
1390
1390
|
};
|
|
1391
|
+
const toAuthMutationError = (error) => new AuthMutationError({
|
|
1392
|
+
code: error?.code,
|
|
1393
|
+
message: error?.message,
|
|
1394
|
+
status: error?.status ?? 500,
|
|
1395
|
+
statusText: error?.statusText ?? "AUTH_ERROR"
|
|
1396
|
+
});
|
|
1391
1397
|
const syncSessionAtom = (authClient, sessionData) => {
|
|
1392
1398
|
const sessionAtom = authClient.$store?.atoms?.session;
|
|
1393
1399
|
if (typeof sessionAtom?.get !== "function" || typeof sessionAtom.set !== "function") return;
|
|
@@ -1422,29 +1428,6 @@ const withDisabledSessionSignal = (args) => {
|
|
|
1422
1428
|
}
|
|
1423
1429
|
};
|
|
1424
1430
|
};
|
|
1425
|
-
/**
|
|
1426
|
-
* Create mutation option hooks from a better-auth client.
|
|
1427
|
-
*
|
|
1428
|
-
* @example
|
|
1429
|
-
* ```tsx
|
|
1430
|
-
* // lib/auth-client.ts
|
|
1431
|
-
* import { createAuthMutations } from 'kitcn/react';
|
|
1432
|
-
*
|
|
1433
|
-
* export const authClient = createAuthClient({...});
|
|
1434
|
-
*
|
|
1435
|
-
* export const {
|
|
1436
|
-
* useSignOutMutationOptions,
|
|
1437
|
-
* useSignInSocialMutationOptions,
|
|
1438
|
-
* useSignInMutationOptions,
|
|
1439
|
-
* useSignUpMutationOptions,
|
|
1440
|
-
* } = createAuthMutations(authClient);
|
|
1441
|
-
*
|
|
1442
|
-
* // components/header.tsx
|
|
1443
|
-
* const signOutMutation = useMutation(useSignOutMutationOptions({
|
|
1444
|
-
* onSuccess: () => router.push('/login'),
|
|
1445
|
-
* }));
|
|
1446
|
-
* ```
|
|
1447
|
-
*/
|
|
1448
1431
|
function createAuthMutations(authClient) {
|
|
1449
1432
|
const useSignOutMutationOptions = ((options) => {
|
|
1450
1433
|
const convexQueryClient = useConvexQueryClient();
|
|
@@ -1452,10 +1435,11 @@ function createAuthMutations(authClient) {
|
|
|
1452
1435
|
return {
|
|
1453
1436
|
...options,
|
|
1454
1437
|
mutationFn: async (args) => {
|
|
1438
|
+
if (typeof authClient.signOut !== "function") throw new Error("Auth client does not expose signOut");
|
|
1455
1439
|
authStoreApi.set("isAuthenticated", false);
|
|
1456
1440
|
convexQueryClient?.unsubscribeAuthQueries();
|
|
1457
1441
|
const res = await authClient.signOut(args);
|
|
1458
|
-
if (res?.error) throw
|
|
1442
|
+
if (res?.error) throw toAuthMutationError(res.error);
|
|
1459
1443
|
authStoreApi.set("token", null);
|
|
1460
1444
|
authStoreApi.set("expiresAt", null);
|
|
1461
1445
|
authStoreApi.set("sessionSyncGraceUntil", null);
|
|
@@ -1471,8 +1455,9 @@ function createAuthMutations(authClient) {
|
|
|
1471
1455
|
return {
|
|
1472
1456
|
...options,
|
|
1473
1457
|
mutationFn: async (args) => {
|
|
1458
|
+
if (typeof authClient.signIn?.social !== "function") throw new Error("Auth client does not expose signIn.social");
|
|
1474
1459
|
const res = await authClient.signIn.social(withDisabledSessionSignal(args));
|
|
1475
|
-
if (res?.error) throw
|
|
1460
|
+
if (res?.error) throw toAuthMutationError(res.error);
|
|
1476
1461
|
seedReturnedToken(authStoreApi, res);
|
|
1477
1462
|
await hydrateReturnedSession(authClient, res);
|
|
1478
1463
|
await ensureAuth(authStoreApi);
|
|
@@ -1488,8 +1473,9 @@ function createAuthMutations(authClient) {
|
|
|
1488
1473
|
return {
|
|
1489
1474
|
...options,
|
|
1490
1475
|
mutationFn: async (args) => {
|
|
1476
|
+
if (typeof authClient.signIn?.email !== "function") throw new Error("Auth client does not expose signIn.email");
|
|
1491
1477
|
const res = await authClient.signIn.email(withDisabledSessionSignal(args));
|
|
1492
|
-
if (res?.error) throw
|
|
1478
|
+
if (res?.error) throw toAuthMutationError(res.error);
|
|
1493
1479
|
seedReturnedToken(authStoreApi, res);
|
|
1494
1480
|
await hydrateReturnedSession(authClient, res);
|
|
1495
1481
|
await ensureAuth(authStoreApi);
|
|
@@ -1505,8 +1491,9 @@ function createAuthMutations(authClient) {
|
|
|
1505
1491
|
return {
|
|
1506
1492
|
...options,
|
|
1507
1493
|
mutationFn: async (args) => {
|
|
1494
|
+
if (typeof authClient.signUp?.email !== "function") throw new Error("Auth client does not expose signUp.email");
|
|
1508
1495
|
const res = await authClient.signUp.email(withDisabledSessionSignal(args));
|
|
1509
|
-
if (res?.error) throw
|
|
1496
|
+
if (res?.error) throw toAuthMutationError(res.error);
|
|
1510
1497
|
seedReturnedToken(authStoreApi, res);
|
|
1511
1498
|
await hydrateReturnedSession(authClient, res);
|
|
1512
1499
|
await ensureAuth(authStoreApi);
|
package/dist/rsc/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as DeepPartial, o as Simplify, r as DistributiveOmit } from "../types-
|
|
2
|
-
import { C as HttpProcedure, d as CRPCHttpRouter, j as DataTransformerOptions, p as HttpRouterRecord } from "../http-types-
|
|
3
|
-
import { g as UnsetMarker } from "../types-
|
|
4
|
-
import { A as HttpInputArgs, C as ReservedMutationOptions$1, S as ReservedInfiniteQueryOptions, T as StaticQueryOptsParam, _ as IsPaginated, b as PaginatedFnMeta, c as ConvexMutationKey, d as ConvexQueryMeta, f as EmptyObject, g as InfiniteQueryInput, l as ConvexQueryHookOptions, m as FUNC_REF_SYMBOL, o as ConvexActionKey, p as ExtractPaginatedItem, s as ConvexInfiniteQueryMeta, u as ConvexQueryKey, w as ReservedQueryOptions$1, y as MutationVariables } from "../types-
|
|
1
|
+
import { n as DeepPartial, o as Simplify, r as DistributiveOmit } from "../types-DF2cg_w0.js";
|
|
2
|
+
import { C as HttpProcedure, d as CRPCHttpRouter, j as DataTransformerOptions, p as HttpRouterRecord } from "../http-types-zsMHb_QN.js";
|
|
3
|
+
import { g as UnsetMarker } from "../types-CnTpHR1F.js";
|
|
4
|
+
import { A as HttpInputArgs, C as ReservedMutationOptions$1, S as ReservedInfiniteQueryOptions, T as StaticQueryOptsParam, _ as IsPaginated, b as PaginatedFnMeta, c as ConvexMutationKey, d as ConvexQueryMeta, f as EmptyObject, g as InfiniteQueryInput, l as ConvexQueryHookOptions, m as FUNC_REF_SYMBOL, o as ConvexActionKey, p as ExtractPaginatedItem, s as ConvexInfiniteQueryMeta, u as ConvexQueryKey, w as ReservedQueryOptions$1, y as MutationVariables } from "../types-YHpe0rsb.js";
|
|
5
5
|
import { FunctionArgs, FunctionReference, FunctionReturnType } from "convex/server";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import { DefaultError, QueryFilters, SkipToken, UseMutationOptions, UseQueryOptions } from "@tanstack/react-query";
|
package/dist/rsc/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as defaultIsUnauthorized } from "../error-
|
|
2
|
-
import { n as getFuncRef, r as getFunctionMeta, t as buildMetaIndex } from "../meta-utils-
|
|
3
|
-
import { i as decodeWire, s as getTransformer } from "../transformer-
|
|
4
|
-
import { n as convexInfiniteQueryOptions, r as convexQuery } from "../query-options-
|
|
1
|
+
import { n as defaultIsUnauthorized } from "../error-Bvo7YEhk.js";
|
|
2
|
+
import { n as getFuncRef, r as getFunctionMeta, t as buildMetaIndex } from "../meta-utils-D9K4fICl.js";
|
|
3
|
+
import { i as decodeWire, s as getTransformer } from "../transformer-C6pGVHqx.js";
|
|
4
|
+
import { n as convexInfiniteQueryOptions, r as convexQuery } from "../query-options-C96zLANM.js";
|
|
5
5
|
import { convexToJson } from "convex/values";
|
|
6
6
|
import { getFunctionName } from "convex/server";
|
|
7
7
|
import { fetchAction, fetchQuery } from "convex/nextjs";
|