@convex-dev/better-auth 0.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/LICENSE +201 -0
- package/README.md +44 -0
- package/dist/commonjs/client/adapter.d.ts +4 -0
- package/dist/commonjs/client/adapter.d.ts.map +1 -0
- package/dist/commonjs/client/adapter.js +189 -0
- package/dist/commonjs/client/adapter.js.map +1 -0
- package/dist/commonjs/client/cors.d.ts +72 -0
- package/dist/commonjs/client/cors.d.ts.map +1 -0
- package/dist/commonjs/client/cors.js +281 -0
- package/dist/commonjs/client/cors.js.map +1 -0
- package/dist/commonjs/client/index.d.ts +302 -0
- package/dist/commonjs/client/index.d.ts.map +1 -0
- package/dist/commonjs/client/index.js +232 -0
- package/dist/commonjs/client/index.js.map +1 -0
- package/dist/commonjs/client/plugins/index.d.ts +3 -0
- package/dist/commonjs/client/plugins/index.d.ts.map +1 -0
- package/dist/commonjs/client/plugins/index.js +3 -0
- package/dist/commonjs/client/plugins/index.js.map +1 -0
- package/dist/commonjs/component/_generated/api.d.ts +12 -0
- package/dist/commonjs/component/_generated/api.d.ts.map +1 -0
- package/dist/commonjs/component/_generated/api.js +22 -0
- package/dist/commonjs/component/_generated/api.js.map +1 -0
- package/dist/commonjs/component/_generated/server.d.ts +64 -0
- package/dist/commonjs/component/_generated/server.d.ts.map +1 -0
- package/dist/commonjs/component/_generated/server.js +74 -0
- package/dist/commonjs/component/_generated/server.js.map +1 -0
- package/dist/commonjs/component/convex.config.d.ts +3 -0
- package/dist/commonjs/component/convex.config.d.ts.map +1 -0
- package/dist/commonjs/component/convex.config.js +4 -0
- package/dist/commonjs/component/convex.config.js.map +1 -0
- package/dist/commonjs/component/lib.d.ts +584 -0
- package/dist/commonjs/component/lib.d.ts.map +1 -0
- package/dist/commonjs/component/lib.js +323 -0
- package/dist/commonjs/component/lib.js.map +1 -0
- package/dist/commonjs/component/schema.d.ts +116 -0
- package/dist/commonjs/component/schema.d.ts.map +1 -0
- package/dist/commonjs/component/schema.js +68 -0
- package/dist/commonjs/component/schema.js.map +1 -0
- package/dist/commonjs/component/util.d.ts +394 -0
- package/dist/commonjs/component/util.d.ts.map +1 -0
- package/dist/commonjs/component/util.js +4 -0
- package/dist/commonjs/component/util.js.map +1 -0
- package/dist/commonjs/nextjs/index.d.ts +10 -0
- package/dist/commonjs/nextjs/index.d.ts.map +1 -0
- package/dist/commonjs/nextjs/index.js +23 -0
- package/dist/commonjs/nextjs/index.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/plugins/convex/client.d.ts +6 -0
- package/dist/commonjs/plugins/convex/client.d.ts.map +1 -0
- package/dist/commonjs/plugins/convex/client.js +7 -0
- package/dist/commonjs/plugins/convex/client.js.map +1 -0
- package/dist/commonjs/plugins/convex/index.d.ts +280 -0
- package/dist/commonjs/plugins/convex/index.d.ts.map +1 -0
- package/dist/commonjs/plugins/convex/index.js +253 -0
- package/dist/commonjs/plugins/convex/index.js.map +1 -0
- package/dist/commonjs/plugins/cross-domain/client.d.ts +123 -0
- package/dist/commonjs/plugins/cross-domain/client.d.ts.map +1 -0
- package/dist/commonjs/plugins/cross-domain/client.js +164 -0
- package/dist/commonjs/plugins/cross-domain/client.js.map +1 -0
- package/dist/commonjs/plugins/cross-domain/index.d.ts +81 -0
- package/dist/commonjs/plugins/cross-domain/index.d.ts.map +1 -0
- package/dist/commonjs/plugins/cross-domain/index.js +135 -0
- package/dist/commonjs/plugins/cross-domain/index.js.map +1 -0
- package/dist/commonjs/plugins/index.d.ts +3 -0
- package/dist/commonjs/plugins/index.d.ts.map +1 -0
- package/dist/commonjs/plugins/index.js +3 -0
- package/dist/commonjs/plugins/index.js.map +1 -0
- package/dist/commonjs/react/client.d.ts +31 -0
- package/dist/commonjs/react/client.d.ts.map +1 -0
- package/dist/commonjs/react/client.js +102 -0
- package/dist/commonjs/react/client.js.map +1 -0
- package/dist/commonjs/react/index.d.ts +9 -0
- package/dist/commonjs/react/index.d.ts.map +1 -0
- package/dist/commonjs/react/index.js +15 -0
- package/dist/commonjs/react/index.js.map +1 -0
- package/dist/commonjs/react-start/index.d.ts +10 -0
- package/dist/commonjs/react-start/index.d.ts.map +1 -0
- package/dist/commonjs/react-start/index.js +32 -0
- package/dist/commonjs/react-start/index.js.map +1 -0
- package/dist/esm/client/adapter.d.ts +4 -0
- package/dist/esm/client/adapter.d.ts.map +1 -0
- package/dist/esm/client/adapter.js +189 -0
- package/dist/esm/client/adapter.js.map +1 -0
- package/dist/esm/client/cors.d.ts +72 -0
- package/dist/esm/client/cors.d.ts.map +1 -0
- package/dist/esm/client/cors.js +281 -0
- package/dist/esm/client/cors.js.map +1 -0
- package/dist/esm/client/index.d.ts +302 -0
- package/dist/esm/client/index.d.ts.map +1 -0
- package/dist/esm/client/index.js +232 -0
- package/dist/esm/client/index.js.map +1 -0
- package/dist/esm/client/plugins/index.d.ts +3 -0
- package/dist/esm/client/plugins/index.d.ts.map +1 -0
- package/dist/esm/client/plugins/index.js +3 -0
- package/dist/esm/client/plugins/index.js.map +1 -0
- package/dist/esm/component/_generated/api.d.ts +12 -0
- package/dist/esm/component/_generated/api.d.ts.map +1 -0
- package/dist/esm/component/_generated/api.js +22 -0
- package/dist/esm/component/_generated/api.js.map +1 -0
- package/dist/esm/component/_generated/server.d.ts +64 -0
- package/dist/esm/component/_generated/server.d.ts.map +1 -0
- package/dist/esm/component/_generated/server.js +74 -0
- package/dist/esm/component/_generated/server.js.map +1 -0
- package/dist/esm/component/convex.config.d.ts +3 -0
- package/dist/esm/component/convex.config.d.ts.map +1 -0
- package/dist/esm/component/convex.config.js +4 -0
- package/dist/esm/component/convex.config.js.map +1 -0
- package/dist/esm/component/lib.d.ts +584 -0
- package/dist/esm/component/lib.d.ts.map +1 -0
- package/dist/esm/component/lib.js +323 -0
- package/dist/esm/component/lib.js.map +1 -0
- package/dist/esm/component/schema.d.ts +116 -0
- package/dist/esm/component/schema.d.ts.map +1 -0
- package/dist/esm/component/schema.js +68 -0
- package/dist/esm/component/schema.js.map +1 -0
- package/dist/esm/component/util.d.ts +394 -0
- package/dist/esm/component/util.d.ts.map +1 -0
- package/dist/esm/component/util.js +4 -0
- package/dist/esm/component/util.js.map +1 -0
- package/dist/esm/nextjs/index.d.ts +10 -0
- package/dist/esm/nextjs/index.d.ts.map +1 -0
- package/dist/esm/nextjs/index.js +23 -0
- package/dist/esm/nextjs/index.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/plugins/convex/client.d.ts +6 -0
- package/dist/esm/plugins/convex/client.d.ts.map +1 -0
- package/dist/esm/plugins/convex/client.js +7 -0
- package/dist/esm/plugins/convex/client.js.map +1 -0
- package/dist/esm/plugins/convex/index.d.ts +280 -0
- package/dist/esm/plugins/convex/index.d.ts.map +1 -0
- package/dist/esm/plugins/convex/index.js +253 -0
- package/dist/esm/plugins/convex/index.js.map +1 -0
- package/dist/esm/plugins/cross-domain/client.d.ts +123 -0
- package/dist/esm/plugins/cross-domain/client.d.ts.map +1 -0
- package/dist/esm/plugins/cross-domain/client.js +164 -0
- package/dist/esm/plugins/cross-domain/client.js.map +1 -0
- package/dist/esm/plugins/cross-domain/index.d.ts +81 -0
- package/dist/esm/plugins/cross-domain/index.d.ts.map +1 -0
- package/dist/esm/plugins/cross-domain/index.js +135 -0
- package/dist/esm/plugins/cross-domain/index.js.map +1 -0
- package/dist/esm/plugins/index.d.ts +3 -0
- package/dist/esm/plugins/index.d.ts.map +1 -0
- package/dist/esm/plugins/index.js +3 -0
- package/dist/esm/plugins/index.js.map +1 -0
- package/dist/esm/react/client.d.ts +31 -0
- package/dist/esm/react/client.d.ts.map +1 -0
- package/dist/esm/react/client.js +102 -0
- package/dist/esm/react/client.js.map +1 -0
- package/dist/esm/react/index.d.ts +9 -0
- package/dist/esm/react/index.d.ts.map +1 -0
- package/dist/esm/react/index.js +15 -0
- package/dist/esm/react/index.js.map +1 -0
- package/dist/esm/react-start/index.d.ts +10 -0
- package/dist/esm/react-start/index.d.ts.map +1 -0
- package/dist/esm/react-start/index.js +32 -0
- package/dist/esm/react-start/index.js.map +1 -0
- package/package.json +161 -0
- package/plugins/package.json +5 -0
- package/react/package.json +5 -0
- package/src/client/adapter.ts +236 -0
- package/src/client/cors.ts +403 -0
- package/src/client/index.ts +381 -0
- package/src/client/plugins/index.ts +2 -0
- package/src/component/_generated/api.d.ts +313 -0
- package/src/component/_generated/api.js +23 -0
- package/src/component/_generated/dataModel.d.ts +60 -0
- package/src/component/_generated/server.d.ts +149 -0
- package/src/component/_generated/server.js +90 -0
- package/src/component/convex.config.ts +5 -0
- package/src/component/lib.ts +391 -0
- package/src/component/schema.ts +74 -0
- package/src/component/util.ts +4 -0
- package/src/nextjs/index.ts +30 -0
- package/src/plugins/convex/client.ts +9 -0
- package/src/plugins/convex/index.ts +296 -0
- package/src/plugins/cross-domain/client.ts +209 -0
- package/src/plugins/cross-domain/index.ts +156 -0
- package/src/plugins/index.ts +2 -0
- package/src/react/client.tsx +184 -0
- package/src/react/index.tsx +38 -0
- package/src/react-start/index.ts +51 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { httpActionGeneric, internalMutationGeneric, queryGeneric, } from "convex/server";
|
|
2
|
+
import { v } from "convex/values";
|
|
3
|
+
import schema from "../component/schema";
|
|
4
|
+
import { convexAdapter } from "./adapter";
|
|
5
|
+
import corsRouter from "./cors";
|
|
6
|
+
import { getByArgsValidator, updateArgsInputValidator } from "../component/lib";
|
|
7
|
+
import { omit } from "convex-helpers";
|
|
8
|
+
import { createCookieGetter } from "better-auth/cookies";
|
|
9
|
+
import { fetchQuery } from "convex/nextjs";
|
|
10
|
+
export { convexAdapter };
|
|
11
|
+
const createUserFields = omit(schema.tables.user.validator.fields, ["userId"]);
|
|
12
|
+
const createUserValidator = v.object(createUserFields);
|
|
13
|
+
const createUserArgsValidator = v.object({
|
|
14
|
+
input: v.object({
|
|
15
|
+
...createUserFields,
|
|
16
|
+
table: v.literal("user"),
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
19
|
+
const updateUserArgsValidator = v.object({
|
|
20
|
+
input: updateArgsInputValidator("user"),
|
|
21
|
+
});
|
|
22
|
+
const deleteUserArgsValidator = v.object(getByArgsValidator);
|
|
23
|
+
const createSessionArgsValidator = v.object({
|
|
24
|
+
input: v.object({
|
|
25
|
+
table: v.literal("session"),
|
|
26
|
+
...schema.tables.session.validator.fields,
|
|
27
|
+
}),
|
|
28
|
+
});
|
|
29
|
+
export class BetterAuth {
|
|
30
|
+
component;
|
|
31
|
+
config;
|
|
32
|
+
constructor(component, config) {
|
|
33
|
+
this.component = component;
|
|
34
|
+
this.config = config;
|
|
35
|
+
}
|
|
36
|
+
async isAuthenticated(token) {
|
|
37
|
+
if (!this.config.publicAuthFunctions?.isAuthenticated) {
|
|
38
|
+
throw new Error("isAuthenticated function not found. It must be a named export in convex/auth.ts");
|
|
39
|
+
}
|
|
40
|
+
return fetchQuery(this.config.publicAuthFunctions.isAuthenticated, {}, { token: token ?? undefined });
|
|
41
|
+
}
|
|
42
|
+
async getHeaders(ctx) {
|
|
43
|
+
const identity = await ctx.auth.getUserIdentity();
|
|
44
|
+
if (!identity) {
|
|
45
|
+
return new Headers();
|
|
46
|
+
}
|
|
47
|
+
const session = await ctx.runQuery(this.component.lib.getCurrentSession);
|
|
48
|
+
return new Headers({
|
|
49
|
+
authorization: `Bearer ${session?.token}`,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
// TODO: use the proper id type for auth functions
|
|
53
|
+
async getAuthUserId(ctx) {
|
|
54
|
+
const identity = await ctx.auth.getUserIdentity();
|
|
55
|
+
if (!identity) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
return identity.subject;
|
|
59
|
+
}
|
|
60
|
+
// Convenience function for getting the Better Auth user
|
|
61
|
+
async getAuthUser(ctx) {
|
|
62
|
+
const identity = await ctx.auth.getUserIdentity();
|
|
63
|
+
if (!identity) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
const doc = await ctx.runQuery(this.component.lib.getBy, {
|
|
67
|
+
table: "user",
|
|
68
|
+
field: "userId",
|
|
69
|
+
value: identity.subject,
|
|
70
|
+
});
|
|
71
|
+
if (!doc) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
// Type narrowing
|
|
75
|
+
if (!("emailVerified" in doc)) {
|
|
76
|
+
throw new Error("invalid user");
|
|
77
|
+
}
|
|
78
|
+
const { id: _id, ...user } = doc;
|
|
79
|
+
return user;
|
|
80
|
+
}
|
|
81
|
+
async getIdTokenCookieName(createAuth) {
|
|
82
|
+
const auth = createAuth({});
|
|
83
|
+
const createCookie = createCookieGetter(auth.options);
|
|
84
|
+
const cookie = createCookie("convex_jwt");
|
|
85
|
+
return cookie.name;
|
|
86
|
+
}
|
|
87
|
+
createAuthFunctions(opts) {
|
|
88
|
+
return {
|
|
89
|
+
isAuthenticated: queryGeneric({
|
|
90
|
+
args: v.object({}),
|
|
91
|
+
handler: async (ctx) => {
|
|
92
|
+
const identity = await ctx.auth.getUserIdentity();
|
|
93
|
+
return identity !== null;
|
|
94
|
+
},
|
|
95
|
+
}),
|
|
96
|
+
createUser: internalMutationGeneric({
|
|
97
|
+
args: createUserArgsValidator,
|
|
98
|
+
handler: async (ctx, args) => {
|
|
99
|
+
const userId = await opts.onCreateUser(ctx, args.input);
|
|
100
|
+
const input = { ...args.input, table: "user", userId };
|
|
101
|
+
return ctx.runMutation(this.component.lib.create, {
|
|
102
|
+
input,
|
|
103
|
+
});
|
|
104
|
+
},
|
|
105
|
+
}),
|
|
106
|
+
deleteUser: internalMutationGeneric({
|
|
107
|
+
args: deleteUserArgsValidator,
|
|
108
|
+
handler: async (ctx, args) => {
|
|
109
|
+
const doc = await ctx.runMutation(this.component.lib.deleteBy, args);
|
|
110
|
+
if (opts.onDeleteUser) {
|
|
111
|
+
await opts.onDeleteUser(ctx, doc.userId);
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
}),
|
|
115
|
+
updateUser: internalMutationGeneric({
|
|
116
|
+
args: updateUserArgsValidator,
|
|
117
|
+
handler: async (ctx, args) => {
|
|
118
|
+
const updatedUser = await ctx.runMutation(this.component.lib.update, args);
|
|
119
|
+
// Type narrowing
|
|
120
|
+
if (!("emailVerified" in updatedUser)) {
|
|
121
|
+
throw new Error("invalid user");
|
|
122
|
+
}
|
|
123
|
+
if (opts.onUpdateUser) {
|
|
124
|
+
await opts.onUpdateUser(ctx, omit(updatedUser, ["id"]));
|
|
125
|
+
}
|
|
126
|
+
return updatedUser;
|
|
127
|
+
},
|
|
128
|
+
}),
|
|
129
|
+
createSession: internalMutationGeneric({
|
|
130
|
+
args: createSessionArgsValidator,
|
|
131
|
+
handler: async (ctx, args) => {
|
|
132
|
+
const session = await ctx.runMutation(this.component.lib.create, args);
|
|
133
|
+
// Type narrowing
|
|
134
|
+
if (!("ipAddress" in session)) {
|
|
135
|
+
throw new Error("invalid session");
|
|
136
|
+
}
|
|
137
|
+
await opts.onCreateSession?.(ctx, session);
|
|
138
|
+
return session;
|
|
139
|
+
},
|
|
140
|
+
}),
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
registerRoutes(http, createAuth, opts) {
|
|
144
|
+
const path = opts?.path ?? "/api/auth";
|
|
145
|
+
const options = createAuth({}).options;
|
|
146
|
+
const trustedOriginsOption = Array.isArray(options.trustedOrigins)
|
|
147
|
+
? options.trustedOrigins
|
|
148
|
+
: [];
|
|
149
|
+
const trustedOrigins = createAuth({}).options.plugins?.reduce((acc, plugin) => {
|
|
150
|
+
if (plugin.options?.trustedOrigins) {
|
|
151
|
+
acc.push(...plugin.options.trustedOrigins);
|
|
152
|
+
}
|
|
153
|
+
return acc;
|
|
154
|
+
}, [...trustedOriginsOption, options.baseURL].filter(Boolean));
|
|
155
|
+
// Reuse trustedOrigins as default for allowedOrigins
|
|
156
|
+
const allowedOrigins = opts?.allowedOrigins ??
|
|
157
|
+
trustedOrigins?.map((origin) =>
|
|
158
|
+
// Strip trailing wildcards, unsupported for allowedOrigins
|
|
159
|
+
origin.endsWith("*") && origin.length > 1 ? origin.slice(0, -1) : origin);
|
|
160
|
+
const requireEnv = (name) => {
|
|
161
|
+
const value = process.env[name];
|
|
162
|
+
if (value === undefined) {
|
|
163
|
+
throw new Error(`Missing environment variable \`${name}\``);
|
|
164
|
+
}
|
|
165
|
+
return value;
|
|
166
|
+
};
|
|
167
|
+
const authRequestHandler = httpActionGeneric(async (ctx, request) => {
|
|
168
|
+
const auth = createAuth(ctx);
|
|
169
|
+
const response = await auth.handler(request);
|
|
170
|
+
if (this.config?.verbose) {
|
|
171
|
+
console.log("response headers", response.headers);
|
|
172
|
+
}
|
|
173
|
+
return response;
|
|
174
|
+
});
|
|
175
|
+
const cors = corsRouter(http, {
|
|
176
|
+
allowedOrigins,
|
|
177
|
+
allowCredentials: true,
|
|
178
|
+
allowedHeaders: ["Authorization", "Content-Type", "Better-Auth-Cookie"],
|
|
179
|
+
verbose: this.config?.verbose,
|
|
180
|
+
exposedHeaders: ["Set-Better-Auth-Cookie"],
|
|
181
|
+
});
|
|
182
|
+
http.route({
|
|
183
|
+
path: "/.well-known/openid-configuration",
|
|
184
|
+
method: "GET",
|
|
185
|
+
handler: httpActionGeneric(async () => {
|
|
186
|
+
const url = `${requireEnv("CONVEX_SITE_URL")}/api/auth/convex/.well-known/openid-configuration`;
|
|
187
|
+
return Response.redirect(url);
|
|
188
|
+
}),
|
|
189
|
+
});
|
|
190
|
+
http.route({
|
|
191
|
+
path: `${path}/convex/.well-known/openid-configuration`,
|
|
192
|
+
method: "GET",
|
|
193
|
+
handler: authRequestHandler,
|
|
194
|
+
});
|
|
195
|
+
http.route({
|
|
196
|
+
path: `${path}/convex/jwks`,
|
|
197
|
+
method: "GET",
|
|
198
|
+
handler: authRequestHandler,
|
|
199
|
+
});
|
|
200
|
+
http.route({
|
|
201
|
+
pathPrefix: `${path}/callback/`,
|
|
202
|
+
method: "GET",
|
|
203
|
+
handler: authRequestHandler,
|
|
204
|
+
});
|
|
205
|
+
http.route({
|
|
206
|
+
path: `${path}/magic-link/verify`,
|
|
207
|
+
method: "GET",
|
|
208
|
+
handler: authRequestHandler,
|
|
209
|
+
});
|
|
210
|
+
http.route({
|
|
211
|
+
path: `${path}/verify-email`,
|
|
212
|
+
method: "GET",
|
|
213
|
+
handler: authRequestHandler,
|
|
214
|
+
});
|
|
215
|
+
http.route({
|
|
216
|
+
pathPrefix: `${path}/reset-password/`,
|
|
217
|
+
method: "GET",
|
|
218
|
+
handler: authRequestHandler,
|
|
219
|
+
});
|
|
220
|
+
cors.route({
|
|
221
|
+
pathPrefix: `${path}/`,
|
|
222
|
+
method: "GET",
|
|
223
|
+
handler: authRequestHandler,
|
|
224
|
+
});
|
|
225
|
+
cors.route({
|
|
226
|
+
pathPrefix: `${path}/`,
|
|
227
|
+
method: "POST",
|
|
228
|
+
handler: authRequestHandler,
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,iBAAiB,EACjB,uBAAuB,EACvB,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAyB,CAAC,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,UAAU,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAEhF,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,M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{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/plugins/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/client/plugins/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A utility for referencing Convex functions in your app's API.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* ```js
|
|
6
|
+
* const myFunctionReference = api.myModule.myFunction;
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
9
|
+
export const api: import("convex/server").AnyApi;
|
|
10
|
+
export const internal: import("convex/server").AnyApi;
|
|
11
|
+
export const components: import("convex/server").AnyChildComponents;
|
|
12
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/component/_generated/api.js"],"names":[],"mappings":"AAYA;;;;;;;GAOG;AACH,iDAA0B;AAC1B,sDAA+B;AAC/B,oEAA8C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated `api` utility.
|
|
4
|
+
*
|
|
5
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { anyApi, componentsGeneric } from "convex/server";
|
|
11
|
+
/**
|
|
12
|
+
* A utility for referencing Convex functions in your app's API.
|
|
13
|
+
*
|
|
14
|
+
* Usage:
|
|
15
|
+
* ```js
|
|
16
|
+
* const myFunctionReference = api.myModule.myFunction;
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export const api = anyApi;
|
|
20
|
+
export const internal = anyApi;
|
|
21
|
+
export const components = componentsGeneric();
|
|
22
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../src/component/_generated/api.js"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE1D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,MAAM,CAAC;AAC1B,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC;AAC/B,MAAM,CAAC,MAAM,UAAU,GAAG,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Define a query in this Convex app's public API.
|
|
3
|
+
*
|
|
4
|
+
* This function will be allowed to read your Convex database and will be accessible from the client.
|
|
5
|
+
*
|
|
6
|
+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
7
|
+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
8
|
+
*/
|
|
9
|
+
export const query: import("convex/server").QueryBuilder<any, "public">;
|
|
10
|
+
/**
|
|
11
|
+
* Define a query that is only accessible from other Convex functions (but not from the client).
|
|
12
|
+
*
|
|
13
|
+
* This function will be allowed to read from your Convex database. It will not be accessible from the client.
|
|
14
|
+
*
|
|
15
|
+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
16
|
+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
17
|
+
*/
|
|
18
|
+
export const internalQuery: import("convex/server").QueryBuilder<any, "internal">;
|
|
19
|
+
/**
|
|
20
|
+
* Define a mutation in this Convex app's public API.
|
|
21
|
+
*
|
|
22
|
+
* This function will be allowed to modify your Convex database and will be accessible from the client.
|
|
23
|
+
*
|
|
24
|
+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
25
|
+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
26
|
+
*/
|
|
27
|
+
export const mutation: import("convex/server").MutationBuilder<any, "public">;
|
|
28
|
+
/**
|
|
29
|
+
* Define a mutation that is only accessible from other Convex functions (but not from the client).
|
|
30
|
+
*
|
|
31
|
+
* This function will be allowed to modify your Convex database. It will not be accessible from the client.
|
|
32
|
+
*
|
|
33
|
+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
34
|
+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
35
|
+
*/
|
|
36
|
+
export const internalMutation: import("convex/server").MutationBuilder<any, "internal">;
|
|
37
|
+
/**
|
|
38
|
+
* Define an action in this Convex app's public API.
|
|
39
|
+
*
|
|
40
|
+
* An action is a function which can execute any JavaScript code, including non-deterministic
|
|
41
|
+
* code and code with side-effects, like calling third-party services.
|
|
42
|
+
* They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
|
|
43
|
+
* They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
|
|
44
|
+
*
|
|
45
|
+
* @param func - The action. It receives an {@link ActionCtx} as its first argument.
|
|
46
|
+
* @returns The wrapped action. Include this as an `export` to name it and make it accessible.
|
|
47
|
+
*/
|
|
48
|
+
export const action: import("convex/server").ActionBuilder<any, "public">;
|
|
49
|
+
/**
|
|
50
|
+
* Define an action that is only accessible from other Convex functions (but not from the client).
|
|
51
|
+
*
|
|
52
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument.
|
|
53
|
+
* @returns The wrapped function. Include this as an `export` to name it and make it accessible.
|
|
54
|
+
*/
|
|
55
|
+
export const internalAction: import("convex/server").ActionBuilder<any, "internal">;
|
|
56
|
+
/**
|
|
57
|
+
* Define a Convex HTTP action.
|
|
58
|
+
*
|
|
59
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument, and a `Request` object
|
|
60
|
+
* as its second.
|
|
61
|
+
* @returns The wrapped endpoint function. Route a URL path to this function in `convex/http.js`.
|
|
62
|
+
*/
|
|
63
|
+
export const httpAction: (func: (ctx: import("convex/server").GenericActionCtx<import("convex/server").GenericDataModel>, request: Request) => Promise<Response>) => import("convex/server").PublicHttpAction;
|
|
64
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../src/component/_generated/server.js"],"names":[],"mappings":"AAqBA;;;;;;;GAOG;AACH,wEAAkC;AAElC;;;;;;;GAOG;AACH,kFAAkD;AAElD;;;;;;;GAOG;AACH,8EAAwC;AAExC;;;;;;;GAOG;AACH,wFAAwD;AAExD;;;;;;;;;;GAUG;AACH,0EAAoC;AAEpC;;;;;GAKG;AACH,oFAAoD;AAEpD;;;;;;GAMG;AACH,8MAA4C"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated utilities for implementing server-side Convex query and mutation functions.
|
|
4
|
+
*
|
|
5
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { actionGeneric, httpActionGeneric, queryGeneric, mutationGeneric, internalActionGeneric, internalMutationGeneric, internalQueryGeneric, componentsGeneric, } from "convex/server";
|
|
11
|
+
/**
|
|
12
|
+
* Define a query in this Convex app's public API.
|
|
13
|
+
*
|
|
14
|
+
* This function will be allowed to read your Convex database and will be accessible from the client.
|
|
15
|
+
*
|
|
16
|
+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
17
|
+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
18
|
+
*/
|
|
19
|
+
export const query = queryGeneric;
|
|
20
|
+
/**
|
|
21
|
+
* Define a query that is only accessible from other Convex functions (but not from the client).
|
|
22
|
+
*
|
|
23
|
+
* This function will be allowed to read from your Convex database. It will not be accessible from the client.
|
|
24
|
+
*
|
|
25
|
+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
26
|
+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
27
|
+
*/
|
|
28
|
+
export const internalQuery = internalQueryGeneric;
|
|
29
|
+
/**
|
|
30
|
+
* Define a mutation in this Convex app's public API.
|
|
31
|
+
*
|
|
32
|
+
* This function will be allowed to modify your Convex database and will be accessible from the client.
|
|
33
|
+
*
|
|
34
|
+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
35
|
+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
36
|
+
*/
|
|
37
|
+
export const mutation = mutationGeneric;
|
|
38
|
+
/**
|
|
39
|
+
* Define a mutation that is only accessible from other Convex functions (but not from the client).
|
|
40
|
+
*
|
|
41
|
+
* This function will be allowed to modify your Convex database. It will not be accessible from the client.
|
|
42
|
+
*
|
|
43
|
+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
44
|
+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
45
|
+
*/
|
|
46
|
+
export const internalMutation = internalMutationGeneric;
|
|
47
|
+
/**
|
|
48
|
+
* Define an action in this Convex app's public API.
|
|
49
|
+
*
|
|
50
|
+
* An action is a function which can execute any JavaScript code, including non-deterministic
|
|
51
|
+
* code and code with side-effects, like calling third-party services.
|
|
52
|
+
* They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
|
|
53
|
+
* They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
|
|
54
|
+
*
|
|
55
|
+
* @param func - The action. It receives an {@link ActionCtx} as its first argument.
|
|
56
|
+
* @returns The wrapped action. Include this as an `export` to name it and make it accessible.
|
|
57
|
+
*/
|
|
58
|
+
export const action = actionGeneric;
|
|
59
|
+
/**
|
|
60
|
+
* Define an action that is only accessible from other Convex functions (but not from the client).
|
|
61
|
+
*
|
|
62
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument.
|
|
63
|
+
* @returns The wrapped function. Include this as an `export` to name it and make it accessible.
|
|
64
|
+
*/
|
|
65
|
+
export const internalAction = internalActionGeneric;
|
|
66
|
+
/**
|
|
67
|
+
* Define a Convex HTTP action.
|
|
68
|
+
*
|
|
69
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument, and a `Request` object
|
|
70
|
+
* as its second.
|
|
71
|
+
* @returns The wrapped endpoint function. Route a URL path to this function in `convex/http.js`.
|
|
72
|
+
*/
|
|
73
|
+
export const httpAction = httpActionGeneric;
|
|
74
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../../src/component/_generated/server.js"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AAEH,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,YAAY,CAAC;AAElC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAElD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,eAAe,CAAC;AAExC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AAExD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,aAAa,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,qBAAqB,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convex.config.d.ts","sourceRoot":"","sources":["../../../src/component/convex.config.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,SAAS,kDAAgC,CAAC;AAEhD,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convex.config.js","sourceRoot":"","sources":["../../../src/component/convex.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,SAAS,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC;AAEhD,eAAe,SAAS,CAAC"}
|