@mzedstudio/uploadthingtrack 0.1.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 +176 -0
- package/README.md +264 -0
- package/dist/client/index.d.ts +157 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +121 -0
- package/dist/client/index.js.map +1 -0
- package/dist/component/_generated/api.d.ts +48 -0
- package/dist/component/_generated/api.d.ts.map +1 -0
- package/dist/component/_generated/api.js +31 -0
- package/dist/component/_generated/api.js.map +1 -0
- package/dist/component/_generated/component.d.ts +119 -0
- package/dist/component/_generated/component.d.ts.map +1 -0
- package/dist/component/_generated/component.js +11 -0
- package/dist/component/_generated/component.js.map +1 -0
- package/dist/component/_generated/dataModel.d.ts +46 -0
- package/dist/component/_generated/dataModel.d.ts.map +1 -0
- package/dist/component/_generated/dataModel.js +11 -0
- package/dist/component/_generated/dataModel.js.map +1 -0
- package/dist/component/_generated/server.d.ts +121 -0
- package/dist/component/_generated/server.d.ts.map +1 -0
- package/dist/component/_generated/server.js +78 -0
- package/dist/component/_generated/server.js.map +1 -0
- package/dist/component/access.d.ts +9 -0
- package/dist/component/access.d.ts.map +1 -0
- package/dist/component/access.js +31 -0
- package/dist/component/access.js.map +1 -0
- package/dist/component/callbacks.d.ts +16 -0
- package/dist/component/callbacks.d.ts.map +1 -0
- package/dist/component/callbacks.js +147 -0
- package/dist/component/callbacks.js.map +1 -0
- package/dist/component/cleanup.d.ts +9 -0
- package/dist/component/cleanup.d.ts.map +1 -0
- package/dist/component/cleanup.js +32 -0
- package/dist/component/cleanup.js.map +1 -0
- package/dist/component/config.d.ts +42 -0
- package/dist/component/config.d.ts.map +1 -0
- package/dist/component/config.js +87 -0
- package/dist/component/config.js.map +1 -0
- package/dist/component/convex.config.d.ts +3 -0
- package/dist/component/convex.config.d.ts.map +1 -0
- package/dist/component/convex.config.js +3 -0
- package/dist/component/convex.config.js.map +1 -0
- package/dist/component/files.d.ts +72 -0
- package/dist/component/files.d.ts.map +1 -0
- package/dist/component/files.js +153 -0
- package/dist/component/files.js.map +1 -0
- package/dist/component/queries.d.ts +43 -0
- package/dist/component/queries.d.ts.map +1 -0
- package/dist/component/queries.js +113 -0
- package/dist/component/queries.js.map +1 -0
- package/dist/component/schema.d.ts +97 -0
- package/dist/component/schema.d.ts.map +1 -0
- package/dist/component/schema.js +42 -0
- package/dist/component/schema.js.map +1 -0
- package/dist/component/stats.d.ts +7 -0
- package/dist/component/stats.d.ts.map +1 -0
- package/dist/component/stats.js +20 -0
- package/dist/component/stats.js.map +1 -0
- package/dist/component/types.d.ts +78 -0
- package/dist/component/types.d.ts.map +1 -0
- package/dist/component/types.js +34 -0
- package/dist/component/types.js.map +1 -0
- package/package.json +84 -0
- package/src/client/index.ts +277 -0
- package/src/component/_generated/api.ts +64 -0
- package/src/component/_generated/component.ts +159 -0
- package/src/component/_generated/dataModel.ts +60 -0
- package/src/component/_generated/server.ts +156 -0
- package/src/component/access.ts +39 -0
- package/src/component/callbacks.ts +173 -0
- package/src/component/cleanup.ts +40 -0
- package/src/component/config.ts +115 -0
- package/src/component/convex.config.ts +2 -0
- package/src/component/files.ts +186 -0
- package/src/component/queries.ts +121 -0
- package/src/component/schema.ts +44 -0
- package/src/component/stats.ts +23 -0
- package/src/component/types.ts +49 -0
- package/src/test.ts +21 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/component/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAC7F,OAAO,EAAE,kBAAkB,EAAE,MAAM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3
|
+
key: string;
|
|
4
|
+
}, Promise<{
|
|
5
|
+
_id: import("convex/values").GenericId<"files">;
|
|
6
|
+
_creationTime: number;
|
|
7
|
+
access?: {
|
|
8
|
+
allowUserIds?: string[] | undefined;
|
|
9
|
+
denyUserIds?: string[] | undefined;
|
|
10
|
+
visibility: "public" | "private" | "restricted";
|
|
11
|
+
} | undefined;
|
|
12
|
+
folder?: string | undefined;
|
|
13
|
+
fileType?: string | undefined;
|
|
14
|
+
customId?: string | undefined;
|
|
15
|
+
tags?: string[] | undefined;
|
|
16
|
+
metadata?: any;
|
|
17
|
+
expiresAt?: number | undefined;
|
|
18
|
+
replacedAt?: number | undefined;
|
|
19
|
+
key: string;
|
|
20
|
+
userId: string;
|
|
21
|
+
mimeType: string;
|
|
22
|
+
url: string;
|
|
23
|
+
name: string;
|
|
24
|
+
size: number;
|
|
25
|
+
uploadedAt: number;
|
|
26
|
+
} | null>>;
|
|
27
|
+
export declare const listFiles: import("convex/server").RegisteredQuery<"public", {
|
|
28
|
+
folder?: string | undefined;
|
|
29
|
+
viewerUserId?: string | undefined;
|
|
30
|
+
includeExpired?: boolean | undefined;
|
|
31
|
+
limit?: number | undefined;
|
|
32
|
+
mimeType?: string | undefined;
|
|
33
|
+
tag?: string | undefined;
|
|
34
|
+
ownerUserId: string;
|
|
35
|
+
}, Promise<any[]>>;
|
|
36
|
+
export declare const expiredBatch: import("convex/server").RegisteredQuery<"internal", {
|
|
37
|
+
limit: number;
|
|
38
|
+
now: number;
|
|
39
|
+
}, Promise<{
|
|
40
|
+
key: string;
|
|
41
|
+
_id: string;
|
|
42
|
+
}[]>>;
|
|
43
|
+
//# sourceMappingURL=queries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../src/component/queries.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;UAyBvB,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;;;;kBA2DpB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;SAWQ,MAAM;SAAO,MAAM;KAQlD,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { query, internalQuery } from "./_generated/server";
|
|
2
|
+
import { v } from "convex/values";
|
|
3
|
+
import { canAccess } from "./access";
|
|
4
|
+
async function getFolderRule(ctx, folder) {
|
|
5
|
+
if (!folder)
|
|
6
|
+
return undefined;
|
|
7
|
+
const rule = await ctx.db
|
|
8
|
+
.query("folderRules")
|
|
9
|
+
.withIndex("by_folder", (q) => q.eq("folder", folder))
|
|
10
|
+
.unique();
|
|
11
|
+
return rule?.access;
|
|
12
|
+
}
|
|
13
|
+
export const getFileByKey = query({
|
|
14
|
+
args: {
|
|
15
|
+
key: v.string(),
|
|
16
|
+
viewerUserId: v.optional(v.string()),
|
|
17
|
+
},
|
|
18
|
+
handler: async (ctx, args) => {
|
|
19
|
+
const file = await ctx.db
|
|
20
|
+
.query("files")
|
|
21
|
+
.withIndex("by_key", (q) => q.eq("key", args.key))
|
|
22
|
+
.unique();
|
|
23
|
+
if (!file)
|
|
24
|
+
return null;
|
|
25
|
+
const folderRule = await getFolderRule(ctx, file.folder);
|
|
26
|
+
const allowed = canAccess({
|
|
27
|
+
ownerId: file.userId,
|
|
28
|
+
viewerId: args.viewerUserId,
|
|
29
|
+
fileRule: file.access,
|
|
30
|
+
folderRule,
|
|
31
|
+
});
|
|
32
|
+
if (!allowed)
|
|
33
|
+
return null;
|
|
34
|
+
return file;
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
export const listFiles = query({
|
|
38
|
+
args: {
|
|
39
|
+
ownerUserId: v.string(),
|
|
40
|
+
viewerUserId: v.optional(v.string()),
|
|
41
|
+
mimeType: v.optional(v.string()),
|
|
42
|
+
tag: v.optional(v.string()),
|
|
43
|
+
folder: v.optional(v.string()),
|
|
44
|
+
includeExpired: v.optional(v.boolean()),
|
|
45
|
+
limit: v.optional(v.number()),
|
|
46
|
+
},
|
|
47
|
+
handler: async (ctx, args) => {
|
|
48
|
+
const query = ctx.db
|
|
49
|
+
.query("files")
|
|
50
|
+
.withIndex("by_user_uploadedAt", (q) => q.eq("userId", args.ownerUserId))
|
|
51
|
+
.order("desc");
|
|
52
|
+
const results = [];
|
|
53
|
+
const now = Date.now();
|
|
54
|
+
const limit = args.limit ?? 50;
|
|
55
|
+
const folderCache = new Map();
|
|
56
|
+
for await (const file of query) {
|
|
57
|
+
if (!args.includeExpired && file.expiresAt !== undefined && file.expiresAt <= now) {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
if (args.mimeType && file.mimeType !== args.mimeType) {
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
if (args.tag && !file.tags?.includes(args.tag)) {
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
if (args.folder && file.folder !== args.folder) {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
let folderRule;
|
|
70
|
+
if (file.folder) {
|
|
71
|
+
if (folderCache.has(file.folder)) {
|
|
72
|
+
folderRule = folderCache.get(file.folder);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
folderRule = await getFolderRule(ctx, file.folder);
|
|
76
|
+
folderCache.set(file.folder, folderRule);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const allowed = canAccess({
|
|
80
|
+
ownerId: file.userId,
|
|
81
|
+
viewerId: args.viewerUserId,
|
|
82
|
+
fileRule: file.access,
|
|
83
|
+
folderRule,
|
|
84
|
+
});
|
|
85
|
+
if (!allowed)
|
|
86
|
+
continue;
|
|
87
|
+
results.push(file);
|
|
88
|
+
if (results.length >= limit)
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
return results;
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
export const expiredBatch = internalQuery({
|
|
95
|
+
args: {
|
|
96
|
+
now: v.number(),
|
|
97
|
+
limit: v.number(),
|
|
98
|
+
},
|
|
99
|
+
handler: async (ctx, args) => {
|
|
100
|
+
const query = ctx.db
|
|
101
|
+
.query("files")
|
|
102
|
+
.withIndex("by_expiresAt", (q) => q.lte("expiresAt", args.now))
|
|
103
|
+
.order("asc");
|
|
104
|
+
const expired = [];
|
|
105
|
+
for await (const file of query) {
|
|
106
|
+
expired.push({ key: file.key, _id: file._id });
|
|
107
|
+
if (expired.length >= args.limit)
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
return expired;
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
//# sourceMappingURL=queries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../../src/component/queries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,KAAK,UAAU,aAAa,CAAC,GAAQ,EAAE,MAAe;IACpD,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAC9B,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,EAAE;SACtB,KAAK,CAAC,aAAa,CAAC;SACpB,SAAS,CAAC,WAAW,EAAE,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;SAC1D,MAAM,EAAE,CAAC;IACZ,OAAO,IAAI,EAAE,MAAM,CAAC;AACtB,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC;IAChC,IAAI,EAAE;QACJ,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;QACf,YAAY,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;KACrC;IACD,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EA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AAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;YAC/C,IAAI,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK;gBAAE,MAAM;QAC1C,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
declare const _default: import("convex/server").SchemaDefinition<{
|
|
2
|
+
files: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
3
|
+
access?: {
|
|
4
|
+
allowUserIds?: string[] | undefined;
|
|
5
|
+
denyUserIds?: string[] | undefined;
|
|
6
|
+
visibility: "public" | "private" | "restricted";
|
|
7
|
+
} | undefined;
|
|
8
|
+
folder?: string | undefined;
|
|
9
|
+
fileType?: string | undefined;
|
|
10
|
+
customId?: string | undefined;
|
|
11
|
+
tags?: string[] | undefined;
|
|
12
|
+
metadata?: any;
|
|
13
|
+
expiresAt?: number | undefined;
|
|
14
|
+
replacedAt?: number | undefined;
|
|
15
|
+
key: string;
|
|
16
|
+
userId: string;
|
|
17
|
+
mimeType: string;
|
|
18
|
+
url: string;
|
|
19
|
+
name: string;
|
|
20
|
+
size: number;
|
|
21
|
+
uploadedAt: number;
|
|
22
|
+
}, {
|
|
23
|
+
key: import("convex/values").VString<string, "required">;
|
|
24
|
+
url: import("convex/values").VString<string, "required">;
|
|
25
|
+
name: import("convex/values").VString<string, "required">;
|
|
26
|
+
size: import("convex/values").VFloat64<number, "required">;
|
|
27
|
+
mimeType: import("convex/values").VString<string, "required">;
|
|
28
|
+
uploadedAt: import("convex/values").VFloat64<number, "required">;
|
|
29
|
+
userId: import("convex/values").VString<string, "required">;
|
|
30
|
+
tags: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
|
|
31
|
+
folder: import("convex/values").VString<string | undefined, "optional">;
|
|
32
|
+
access: import("convex/values").VObject<{
|
|
33
|
+
allowUserIds?: string[] | undefined;
|
|
34
|
+
denyUserIds?: string[] | undefined;
|
|
35
|
+
visibility: "public" | "private" | "restricted";
|
|
36
|
+
} | undefined, {
|
|
37
|
+
visibility: import("convex/values").VUnion<"public" | "private" | "restricted", [import("convex/values").VLiteral<"public", "required">, import("convex/values").VLiteral<"private", "required">, import("convex/values").VLiteral<"restricted", "required">], "required", never>;
|
|
38
|
+
allowUserIds: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
|
|
39
|
+
denyUserIds: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
|
|
40
|
+
}, "optional", "visibility" | "allowUserIds" | "denyUserIds">;
|
|
41
|
+
metadata: import("convex/values").VAny<any, "optional", string>;
|
|
42
|
+
expiresAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
43
|
+
replacedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
44
|
+
customId: import("convex/values").VString<string | undefined, "optional">;
|
|
45
|
+
fileType: import("convex/values").VString<string | undefined, "optional">;
|
|
46
|
+
}, "required", "access" | "key" | "folder" | "userId" | "mimeType" | "url" | "name" | "size" | "uploadedAt" | "fileType" | "customId" | "tags" | "metadata" | "expiresAt" | "access.visibility" | "access.allowUserIds" | "access.denyUserIds" | `metadata.${string}` | "replacedAt">, {
|
|
47
|
+
by_key: ["key", "_creationTime"];
|
|
48
|
+
by_user: ["userId", "_creationTime"];
|
|
49
|
+
by_user_uploadedAt: ["userId", "uploadedAt", "_creationTime"];
|
|
50
|
+
by_folder: ["folder", "_creationTime"];
|
|
51
|
+
by_expiresAt: ["expiresAt", "_creationTime"];
|
|
52
|
+
}, {}, {}>;
|
|
53
|
+
folderRules: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
54
|
+
access: {
|
|
55
|
+
allowUserIds?: string[] | undefined;
|
|
56
|
+
denyUserIds?: string[] | undefined;
|
|
57
|
+
visibility: "public" | "private" | "restricted";
|
|
58
|
+
};
|
|
59
|
+
folder: string;
|
|
60
|
+
updatedAt: number;
|
|
61
|
+
}, {
|
|
62
|
+
folder: import("convex/values").VString<string, "required">;
|
|
63
|
+
access: import("convex/values").VObject<{
|
|
64
|
+
allowUserIds?: string[] | undefined;
|
|
65
|
+
denyUserIds?: string[] | undefined;
|
|
66
|
+
visibility: "public" | "private" | "restricted";
|
|
67
|
+
}, {
|
|
68
|
+
visibility: import("convex/values").VUnion<"public" | "private" | "restricted", [import("convex/values").VLiteral<"public", "required">, import("convex/values").VLiteral<"private", "required">, import("convex/values").VLiteral<"restricted", "required">], "required", never>;
|
|
69
|
+
allowUserIds: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
|
|
70
|
+
denyUserIds: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
|
|
71
|
+
}, "required", "visibility" | "allowUserIds" | "denyUserIds">;
|
|
72
|
+
updatedAt: import("convex/values").VFloat64<number, "required">;
|
|
73
|
+
}, "required", "access" | "folder" | "access.visibility" | "access.allowUserIds" | "access.denyUserIds" | "updatedAt">, {
|
|
74
|
+
by_folder: ["folder", "_creationTime"];
|
|
75
|
+
}, {}, {}>;
|
|
76
|
+
globals: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
77
|
+
uploadthingApiKey?: string | undefined;
|
|
78
|
+
defaultTtlMs?: number | undefined;
|
|
79
|
+
ttlByMimeType?: Record<string, number> | undefined;
|
|
80
|
+
ttlByFileType?: Record<string, number> | undefined;
|
|
81
|
+
deleteRemoteOnExpire?: boolean | undefined;
|
|
82
|
+
deleteBatchSize?: number | undefined;
|
|
83
|
+
singleton: "globals";
|
|
84
|
+
}, {
|
|
85
|
+
singleton: import("convex/values").VLiteral<"globals", "required">;
|
|
86
|
+
uploadthingApiKey: import("convex/values").VString<string | undefined, "optional">;
|
|
87
|
+
defaultTtlMs: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
88
|
+
ttlByMimeType: import("convex/values").VRecord<Record<string, number> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, "optional", string>;
|
|
89
|
+
ttlByFileType: import("convex/values").VRecord<Record<string, number> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, "optional", string>;
|
|
90
|
+
deleteRemoteOnExpire: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
91
|
+
deleteBatchSize: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
92
|
+
}, "required", "uploadthingApiKey" | "defaultTtlMs" | "ttlByMimeType" | "ttlByFileType" | "deleteRemoteOnExpire" | "deleteBatchSize" | `ttlByMimeType.${string}` | `ttlByFileType.${string}` | "singleton">, {
|
|
93
|
+
by_singleton: ["singleton", "_creationTime"];
|
|
94
|
+
}, {}, {}>;
|
|
95
|
+
}, true>;
|
|
96
|
+
export default _default;
|
|
97
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/component/schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,wBAuCG"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { defineSchema, defineTable } from "convex/server";
|
|
2
|
+
import { v } from "convex/values";
|
|
3
|
+
import { accessRuleValidator } from "./types";
|
|
4
|
+
export default defineSchema({
|
|
5
|
+
files: defineTable({
|
|
6
|
+
key: v.string(),
|
|
7
|
+
url: v.string(),
|
|
8
|
+
name: v.string(),
|
|
9
|
+
size: v.number(),
|
|
10
|
+
mimeType: v.string(),
|
|
11
|
+
uploadedAt: v.number(),
|
|
12
|
+
userId: v.string(),
|
|
13
|
+
tags: v.optional(v.array(v.string())),
|
|
14
|
+
folder: v.optional(v.string()),
|
|
15
|
+
access: v.optional(accessRuleValidator),
|
|
16
|
+
metadata: v.optional(v.any()),
|
|
17
|
+
expiresAt: v.optional(v.number()),
|
|
18
|
+
replacedAt: v.optional(v.number()),
|
|
19
|
+
customId: v.optional(v.string()),
|
|
20
|
+
fileType: v.optional(v.string()),
|
|
21
|
+
})
|
|
22
|
+
.index("by_key", ["key"])
|
|
23
|
+
.index("by_user", ["userId"])
|
|
24
|
+
.index("by_user_uploadedAt", ["userId", "uploadedAt"])
|
|
25
|
+
.index("by_folder", ["folder"])
|
|
26
|
+
.index("by_expiresAt", ["expiresAt"]),
|
|
27
|
+
folderRules: defineTable({
|
|
28
|
+
folder: v.string(),
|
|
29
|
+
access: accessRuleValidator,
|
|
30
|
+
updatedAt: v.number(),
|
|
31
|
+
}).index("by_folder", ["folder"]),
|
|
32
|
+
globals: defineTable({
|
|
33
|
+
singleton: v.literal("globals"),
|
|
34
|
+
uploadthingApiKey: v.optional(v.string()),
|
|
35
|
+
defaultTtlMs: v.optional(v.number()),
|
|
36
|
+
ttlByMimeType: v.optional(v.record(v.string(), v.number())),
|
|
37
|
+
ttlByFileType: v.optional(v.record(v.string(), v.number())),
|
|
38
|
+
deleteRemoteOnExpire: v.optional(v.boolean()),
|
|
39
|
+
deleteBatchSize: v.optional(v.number()),
|
|
40
|
+
}).index("by_singleton", ["singleton"]),
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/component/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,eAAe,YAAY,CAAC;IAC1B,KAAK,EAAE,WAAW,CAAC;QACjB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;QACf,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;QACf,IAAI,EAAE,CAAC,CAAC,MAA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KACtB,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC;IAEjC,OAAO,EAAE,WAAW,CAAC;QACnB,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;QAC/B,iBAAiB,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QACzC,YAAY,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QACpC,aAAa,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;QAC3D,aAAa,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;QAC3D,oBAAoB,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAC7C,eAAe,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;KACxC,CAAC,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC,WAAW,CAAC,CAAC;CACxC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../src/component/stats.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa;;;;;GAmBxB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { query } from "./_generated/server";
|
|
2
|
+
import { v } from "convex/values";
|
|
3
|
+
export const getUsageStats = query({
|
|
4
|
+
args: {
|
|
5
|
+
userId: v.string(),
|
|
6
|
+
},
|
|
7
|
+
handler: async (ctx, args) => {
|
|
8
|
+
let totalFiles = 0;
|
|
9
|
+
let totalBytes = 0;
|
|
10
|
+
const query = ctx.db
|
|
11
|
+
.query("files")
|
|
12
|
+
.withIndex("by_user", (q) => q.eq("userId", args.userId));
|
|
13
|
+
for await (const file of query) {
|
|
14
|
+
totalFiles += 1;
|
|
15
|
+
totalBytes += file.size;
|
|
16
|
+
}
|
|
17
|
+
return { totalFiles, totalBytes };
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=stats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../src/component/stats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAElC,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC;IACjC,IAAI,EAAE;QACJ,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;KACnB;IACD,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC3B,IAAI,UAAU,GAAG,CAAC,CAAC;QACnB,IAAI,UAAU,GAAG,CAAC,CAAC;QAEnB,MAAM,KAAK,GAAG,GAAG,CAAC,EAAE;aACjB,KAAK,CAAC,OAAO,CAAC;aACd,SAAS,CAAC,SAAS,EAAE,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAEjE,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YAC/B,UAAU,IAAI,CAAC,CAAC;YAChB,UAAU,IAAI,IAAI,CAAC,IAAI,CAAC;QAC1B,CAAC;QAED,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;IACpC,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { type Infer } from "convex/values";
|
|
2
|
+
export declare const accessRuleValidator: import("convex/values").VObject<{
|
|
3
|
+
allowUserIds?: string[] | undefined;
|
|
4
|
+
denyUserIds?: string[] | undefined;
|
|
5
|
+
visibility: "public" | "private" | "restricted";
|
|
6
|
+
}, {
|
|
7
|
+
visibility: import("convex/values").VUnion<"public" | "private" | "restricted", [import("convex/values").VLiteral<"public", "required">, import("convex/values").VLiteral<"private", "required">, import("convex/values").VLiteral<"restricted", "required">], "required", never>;
|
|
8
|
+
allowUserIds: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
|
|
9
|
+
denyUserIds: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
|
|
10
|
+
}, "required", "visibility" | "allowUserIds" | "denyUserIds">;
|
|
11
|
+
export type AccessRule = Infer<typeof accessRuleValidator>;
|
|
12
|
+
export declare const fileInfoValidator: import("convex/values").VObject<{
|
|
13
|
+
uploadedAt?: number | undefined;
|
|
14
|
+
fileType?: string | undefined;
|
|
15
|
+
customId?: string | undefined;
|
|
16
|
+
key: string;
|
|
17
|
+
mimeType: string;
|
|
18
|
+
url: string;
|
|
19
|
+
name: string;
|
|
20
|
+
size: number;
|
|
21
|
+
}, {
|
|
22
|
+
key: import("convex/values").VString<string, "required">;
|
|
23
|
+
url: import("convex/values").VString<string, "required">;
|
|
24
|
+
name: import("convex/values").VString<string, "required">;
|
|
25
|
+
size: import("convex/values").VFloat64<number, "required">;
|
|
26
|
+
mimeType: import("convex/values").VString<string, "required">;
|
|
27
|
+
uploadedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
28
|
+
fileType: import("convex/values").VString<string | undefined, "optional">;
|
|
29
|
+
customId: import("convex/values").VString<string | undefined, "optional">;
|
|
30
|
+
}, "required", "key" | "mimeType" | "url" | "name" | "size" | "uploadedAt" | "fileType" | "customId">;
|
|
31
|
+
export type FileInfo = Infer<typeof fileInfoValidator>;
|
|
32
|
+
export declare const fileUpsertOptionsValidator: import("convex/values").VObject<{
|
|
33
|
+
access?: {
|
|
34
|
+
allowUserIds?: string[] | undefined;
|
|
35
|
+
denyUserIds?: string[] | undefined;
|
|
36
|
+
visibility: "public" | "private" | "restricted";
|
|
37
|
+
} | undefined;
|
|
38
|
+
folder?: string | undefined;
|
|
39
|
+
fileType?: string | undefined;
|
|
40
|
+
tags?: string[] | undefined;
|
|
41
|
+
metadata?: any;
|
|
42
|
+
expiresAt?: number | undefined;
|
|
43
|
+
ttlMs?: number | undefined;
|
|
44
|
+
}, {
|
|
45
|
+
tags: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
|
|
46
|
+
folder: import("convex/values").VString<string | undefined, "optional">;
|
|
47
|
+
access: import("convex/values").VObject<{
|
|
48
|
+
allowUserIds?: string[] | undefined;
|
|
49
|
+
denyUserIds?: string[] | undefined;
|
|
50
|
+
visibility: "public" | "private" | "restricted";
|
|
51
|
+
} | undefined, {
|
|
52
|
+
visibility: import("convex/values").VUnion<"public" | "private" | "restricted", [import("convex/values").VLiteral<"public", "required">, import("convex/values").VLiteral<"private", "required">, import("convex/values").VLiteral<"restricted", "required">], "required", never>;
|
|
53
|
+
allowUserIds: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
|
|
54
|
+
denyUserIds: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
|
|
55
|
+
}, "optional", "visibility" | "allowUserIds" | "denyUserIds">;
|
|
56
|
+
metadata: import("convex/values").VAny<any, "optional", string>;
|
|
57
|
+
expiresAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
58
|
+
ttlMs: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
59
|
+
fileType: import("convex/values").VString<string | undefined, "optional">;
|
|
60
|
+
}, "required", "access" | "folder" | "fileType" | "tags" | "metadata" | "expiresAt" | "ttlMs" | "access.visibility" | "access.allowUserIds" | "access.denyUserIds" | `metadata.${string}`>;
|
|
61
|
+
export type FileUpsertOptions = Infer<typeof fileUpsertOptionsValidator>;
|
|
62
|
+
export declare const configUpdateValidator: import("convex/values").VObject<{
|
|
63
|
+
uploadthingApiKey?: string | undefined;
|
|
64
|
+
defaultTtlMs?: number | undefined;
|
|
65
|
+
ttlByMimeType?: Record<string, number> | undefined;
|
|
66
|
+
ttlByFileType?: Record<string, number> | undefined;
|
|
67
|
+
deleteRemoteOnExpire?: boolean | undefined;
|
|
68
|
+
deleteBatchSize?: number | undefined;
|
|
69
|
+
}, {
|
|
70
|
+
uploadthingApiKey: import("convex/values").VString<string | undefined, "optional">;
|
|
71
|
+
defaultTtlMs: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
72
|
+
ttlByMimeType: import("convex/values").VRecord<Record<string, number> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, "optional", string>;
|
|
73
|
+
ttlByFileType: import("convex/values").VRecord<Record<string, number> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, "optional", string>;
|
|
74
|
+
deleteRemoteOnExpire: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
75
|
+
deleteBatchSize: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
76
|
+
}, "required", "uploadthingApiKey" | "defaultTtlMs" | "ttlByMimeType" | "ttlByFileType" | "deleteRemoteOnExpire" | "deleteBatchSize" | `ttlByMimeType.${string}` | `ttlByFileType.${string}`>;
|
|
77
|
+
export type ConfigUpdate = Infer<typeof configUpdateValidator>;
|
|
78
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/component/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAK,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AAE9C,eAAO,MAAM,mBAAmB;;;;;;;;6DAQ9B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE3D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;qGAS5B,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAEvD,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;0LAQrC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEzE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;6LAOhC,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { v } from "convex/values";
|
|
2
|
+
export const accessRuleValidator = v.object({
|
|
3
|
+
visibility: v.union(v.literal("public"), v.literal("private"), v.literal("restricted")),
|
|
4
|
+
allowUserIds: v.optional(v.array(v.string())),
|
|
5
|
+
denyUserIds: v.optional(v.array(v.string())),
|
|
6
|
+
});
|
|
7
|
+
export const fileInfoValidator = v.object({
|
|
8
|
+
key: v.string(),
|
|
9
|
+
url: v.string(),
|
|
10
|
+
name: v.string(),
|
|
11
|
+
size: v.number(),
|
|
12
|
+
mimeType: v.string(),
|
|
13
|
+
uploadedAt: v.optional(v.number()),
|
|
14
|
+
fileType: v.optional(v.string()),
|
|
15
|
+
customId: v.optional(v.string()),
|
|
16
|
+
});
|
|
17
|
+
export const fileUpsertOptionsValidator = v.object({
|
|
18
|
+
tags: v.optional(v.array(v.string())),
|
|
19
|
+
folder: v.optional(v.string()),
|
|
20
|
+
access: v.optional(accessRuleValidator),
|
|
21
|
+
metadata: v.optional(v.any()),
|
|
22
|
+
expiresAt: v.optional(v.number()),
|
|
23
|
+
ttlMs: v.optional(v.number()),
|
|
24
|
+
fileType: v.optional(v.string()),
|
|
25
|
+
});
|
|
26
|
+
export const configUpdateValidator = v.object({
|
|
27
|
+
uploadthingApiKey: v.optional(v.string()),
|
|
28
|
+
defaultTtlMs: v.optional(v.number()),
|
|
29
|
+
ttlByMimeType: v.optional(v.record(v.string(), v.number())),
|
|
30
|
+
ttlByFileType: v.optional(v.record(v.string(), v.number())),
|
|
31
|
+
deleteRemoteOnExpire: v.optional(v.boolean()),
|
|
32
|
+
deleteBatchSize: v.optional(v.number()),
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/component/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAc,MAAM,eAAe,CAAC;AAE9C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,UAAU,EAAE,CAAC,CAAC,KAAK,CACjB,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EACnB,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EACpB,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CACxB;IACD,YAAY,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IAC7C,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;CAC7C,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAChC,QAAQ,EAAE,CAAC,CAAC,QA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IAC7C,eAAe,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CACxC,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mzedstudio/uploadthingtrack",
|
|
3
|
+
"description": "UploadThing file tracking, access control, and cleanup for Convex.",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"convex",
|
|
8
|
+
"component",
|
|
9
|
+
"uploadthing",
|
|
10
|
+
"file-upload"
|
|
11
|
+
],
|
|
12
|
+
"type": "module",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"src"
|
|
16
|
+
],
|
|
17
|
+
"types": "./dist/client/index.d.ts",
|
|
18
|
+
"module": "./dist/client/index.js",
|
|
19
|
+
"exports": {
|
|
20
|
+
"./package.json": "./package.json",
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/client/index.d.ts",
|
|
23
|
+
"default": "./dist/client/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./test": "./src/test.ts",
|
|
26
|
+
"./_generated/component.js": {
|
|
27
|
+
"types": "./dist/component/_generated/component.d.ts"
|
|
28
|
+
},
|
|
29
|
+
"./_generated/component": {
|
|
30
|
+
"types": "./dist/component/_generated/component.d.ts"
|
|
31
|
+
},
|
|
32
|
+
"./convex.config.js": {
|
|
33
|
+
"types": "./dist/component/convex.config.d.ts",
|
|
34
|
+
"default": "./dist/component/convex.config.js"
|
|
35
|
+
},
|
|
36
|
+
"./convex.config": {
|
|
37
|
+
"types": "./dist/component/convex.config.d.ts",
|
|
38
|
+
"default": "./dist/component/convex.config.js"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"convex": "^1.31.7"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@edge-runtime/vm": "^5.0.0",
|
|
46
|
+
"@types/cors": "^2.8.17",
|
|
47
|
+
"@types/express": "^4.17.21",
|
|
48
|
+
"@types/node": "^22.10.5",
|
|
49
|
+
"@types/react": "^18.3.12",
|
|
50
|
+
"@types/react-dom": "^18.3.1",
|
|
51
|
+
"@uploadthing/react": "^7.3.3",
|
|
52
|
+
"@vitejs/plugin-react": "^4.3.3",
|
|
53
|
+
"chokidar-cli": "^3.0.0",
|
|
54
|
+
"convex": "1.31.7",
|
|
55
|
+
"convex-test": "^0.0.41",
|
|
56
|
+
"cors": "^2.8.5",
|
|
57
|
+
"dotenv": "^16.4.7",
|
|
58
|
+
"express": "^4.19.2",
|
|
59
|
+
"npm-run-all2": "^8.0.4",
|
|
60
|
+
"path-exists-cli": "^2.0.0",
|
|
61
|
+
"react": "^18.3.1",
|
|
62
|
+
"react-dom": "^18.3.1",
|
|
63
|
+
"tsx": "^4.19.2",
|
|
64
|
+
"typescript": "^5.6.3",
|
|
65
|
+
"uploadthing": "^7.7.4",
|
|
66
|
+
"vite": "^5.4.11",
|
|
67
|
+
"vitest": "^2.1.5"
|
|
68
|
+
},
|
|
69
|
+
"scripts": {
|
|
70
|
+
"dev": "npm-run-all --parallel dev:*",
|
|
71
|
+
"dev:backend": "convex dev --typecheck-components",
|
|
72
|
+
"dev:frontend": "cd example && vite --clearScreen false",
|
|
73
|
+
"dev:build": "chokidar 'tsconfig*.json' 'src/**/*.ts' -i '**/*.test.ts' -c 'npm run build:codegen' --initial",
|
|
74
|
+
"dev:uploadthing": "tsx watch example/server/index.ts",
|
|
75
|
+
"predev": "npx path-exists .env.local dist || (npm run build && convex dev --once)",
|
|
76
|
+
"build": "tsc --project ./tsconfig.build.json",
|
|
77
|
+
"build:codegen": "npx convex codegen --component-dir ./src/component && npm run build",
|
|
78
|
+
"build:clean": "rm -rf dist *.tsbuildinfo && npm run build:codegen",
|
|
79
|
+
"typecheck": "tsc --noEmit",
|
|
80
|
+
"test": "vitest run",
|
|
81
|
+
"test:watch": "vitest --clearScreen false",
|
|
82
|
+
"preversion": "npm ci && npm run build:clean && npm test && npm run typecheck"
|
|
83
|
+
}
|
|
84
|
+
}
|