appos 0.3.2-0 → 0.3.3-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/dist/bin/auth-schema-CcqAJY9P.mjs +2 -0
- package/dist/bin/better-sqlite3-CuQ3hsWl.mjs +2 -0
- package/dist/bin/bun-sql-DGeo-s_M.mjs +2 -0
- package/dist/bin/cache-3oO07miM.mjs +2 -0
- package/dist/bin/chunk-l9p7A9gZ.mjs +2 -0
- package/dist/bin/cockroach-BaICwY7N.mjs +2 -0
- package/dist/bin/database-CaysWPpa.mjs +2 -0
- package/dist/bin/esm-BvsccvmM.mjs +2 -0
- package/dist/bin/esm-CGKzJ7Am.mjs +3 -0
- package/dist/bin/event-DnSe3eh0.mjs +8 -0
- package/dist/bin/extract-blob-metadata-iqwTl2ft.mjs +170 -0
- package/dist/bin/generate-image-variant-Lyx0vhM6.mjs +2 -0
- package/dist/bin/generate-preview-0MrKxslA.mjs +2 -0
- package/dist/bin/libsql-DQJrZsU9.mjs +2 -0
- package/dist/bin/logger-BAGZLUzj.mjs +2 -0
- package/dist/bin/main.mjs +1201 -190
- package/dist/bin/migrator-B7iNKM8N.mjs +2 -0
- package/dist/bin/migrator-BKE1cSQQ.mjs +2 -0
- package/dist/bin/migrator-BXcbc9zs.mjs +2 -0
- package/dist/bin/migrator-B_XhRWZC.mjs +8 -0
- package/dist/bin/migrator-Bz52Gtr8.mjs +2 -0
- package/dist/bin/migrator-C7W-cZHB.mjs +2 -0
- package/dist/bin/migrator-CEnKyGSW.mjs +2 -0
- package/dist/bin/migrator-CHzIIl5X.mjs +2 -0
- package/dist/bin/migrator-CR-rjZdM.mjs +2 -0
- package/dist/bin/migrator-CjIr1ZCx.mjs +8 -0
- package/dist/bin/migrator-Cuubh2dg.mjs +2 -0
- package/dist/bin/migrator-D8m-ORbr.mjs +8 -0
- package/dist/bin/migrator-DBFwrhZH.mjs +2 -0
- package/dist/bin/migrator-DLmhW9u_.mjs +2 -0
- package/dist/bin/migrator-DLoHx807.mjs +4 -0
- package/dist/bin/migrator-DtN_iS87.mjs +2 -0
- package/dist/bin/migrator-Yc57lb3w.mjs +2 -0
- package/dist/bin/migrator-cEVXH3xC.mjs +2 -0
- package/dist/bin/migrator-hWi-sYIq.mjs +2 -0
- package/dist/bin/mysql2-DufFWkj4.mjs +2 -0
- package/dist/bin/neon-serverless-5a4h2VFz.mjs +2 -0
- package/dist/bin/node-CiOp4xrR.mjs +22 -0
- package/dist/bin/node-mssql-DvZGaUkB.mjs +322 -0
- package/dist/bin/node-postgres-BqbJVBQY.mjs +2 -0
- package/dist/bin/node-postgres-DnhRTTO8.mjs +2 -0
- package/dist/bin/open-0ksnL0S8.mjs +2 -0
- package/dist/bin/pdf-sUYeFPr4.mjs +14 -0
- package/dist/bin/pg-CaH8ptj-.mjs +2 -0
- package/dist/bin/pg-core-BLTZt9AH.mjs +8 -0
- package/dist/bin/pg-core-CGzidKaA.mjs +2 -0
- package/dist/bin/pglite-BJB9z7Ju.mjs +2 -0
- package/dist/bin/planetscale-serverless-H3RfLlMK.mjs +13 -0
- package/dist/bin/postgres-js-DuOf1eWm.mjs +2 -0
- package/dist/bin/purge-attachment-DQXpTtTx.mjs +2 -0
- package/dist/bin/purge-audit-logs-BEt2J2gD.mjs +2 -0
- package/dist/bin/{purge-unattached-blobs-Duvv8Izd.mjs → purge-unattached-blobs-DOmk4ddJ.mjs} +1 -1
- package/dist/bin/query-builder-DSRrR6X_.mjs +8 -0
- package/dist/bin/query-builder-V8-LDhvA.mjs +3 -0
- package/dist/bin/session-CdB1A-LB.mjs +14 -0
- package/dist/bin/session-Cl2e-_i8.mjs +8 -0
- package/dist/bin/singlestore-COft6TlR.mjs +8 -0
- package/dist/bin/sql-D-eKV1Dn.mjs +2 -0
- package/dist/bin/sqlite-cloud-Co9jOn5G.mjs +2 -0
- package/dist/bin/sqlite-proxy-Cpu78gJF.mjs +2 -0
- package/dist/bin/src-C-oXmCzx.mjs +6 -0
- package/dist/bin/table-3zUpWkMg.mjs +2 -0
- package/dist/bin/track-db-changes-DWyY5jXm.mjs +2 -0
- package/dist/bin/utils-CyoeCJlf.mjs +2 -0
- package/dist/bin/utils-EoqYQKy1.mjs +2 -0
- package/dist/bin/utils-bsypyqPl.mjs +2 -0
- package/dist/bin/vercel-postgres-HWL6xtqi.mjs +2 -0
- package/dist/bin/workflow-zxHDyfLq.mjs +2 -0
- package/dist/bin/youch-handler-DrYdbUhe.mjs +2 -0
- package/dist/bin/zod-MJjkEkRY.mjs +24 -0
- package/dist/exports/api/_virtual/rolldown_runtime.mjs +36 -1
- package/dist/exports/api/app-context.mjs +24 -1
- package/dist/exports/api/auth-schema.mjs +373 -1
- package/dist/exports/api/auth.d.mts +4 -0
- package/dist/exports/api/auth.mjs +188 -1
- package/dist/exports/api/cache.d.mts +2 -2
- package/dist/exports/api/cache.mjs +28 -1
- package/dist/exports/api/config.mjs +72 -1
- package/dist/exports/api/constants.mjs +92 -1
- package/dist/exports/api/container.mjs +49 -1
- package/dist/exports/api/database.mjs +218 -1
- package/dist/exports/api/event.mjs +236 -1
- package/dist/exports/api/i18n.mjs +45 -1
- package/dist/exports/api/index.mjs +20 -1
- package/dist/exports/api/instrumentation.mjs +40 -1
- package/dist/exports/api/logger.mjs +26 -1
- package/dist/exports/api/mailer.mjs +37 -1
- package/dist/exports/api/middleware.mjs +73 -1
- package/dist/exports/api/openapi.mjs +507 -1
- package/dist/exports/api/orm.mjs +43 -1
- package/dist/exports/api/otel.mjs +56 -1
- package/dist/exports/api/redis.mjs +41 -1
- package/dist/exports/api/storage-schema.mjs +72 -1
- package/dist/exports/api/storage.mjs +833 -1
- package/dist/exports/api/web/auth.mjs +17 -1
- package/dist/exports/api/workflow.mjs +196 -1
- package/dist/exports/api/workflows/_virtual/rolldown_runtime.mjs +36 -1
- package/dist/exports/api/workflows/api/auth-schema.mjs +373 -1
- package/dist/exports/api/workflows/api/auth.d.mts +4 -0
- package/dist/exports/api/workflows/api/cache.d.mts +2 -2
- package/dist/exports/api/workflows/api/event.mjs +126 -1
- package/dist/exports/api/workflows/api/redis.mjs +3 -1
- package/dist/exports/api/workflows/api/workflow.mjs +135 -1
- package/dist/exports/api/workflows/constants.mjs +23 -1
- package/dist/exports/api/workflows/extract-blob-metadata.mjs +132 -1
- package/dist/exports/api/workflows/generate-image-variant.d.mts +2 -2
- package/dist/exports/api/workflows/generate-image-variant.mjs +118 -1
- package/dist/exports/api/workflows/generate-preview.mjs +160 -1
- package/dist/exports/api/workflows/index.mjs +3 -1
- package/dist/exports/api/workflows/purge-attachment.mjs +34 -1
- package/dist/exports/api/workflows/purge-audit-logs.mjs +47 -1
- package/dist/exports/api/workflows/purge-unattached-blobs.mjs +46 -1
- package/dist/exports/api/workflows/track-db-changes.mjs +110 -1
- package/dist/exports/cli/_virtual/rolldown_runtime.mjs +36 -1
- package/dist/exports/cli/api/auth-schema.mjs +373 -1
- package/dist/exports/cli/api/auth.d.mts +4 -0
- package/dist/exports/cli/api/cache.d.mts +2 -2
- package/dist/exports/cli/api/event.mjs +126 -1
- package/dist/exports/cli/api/redis.mjs +3 -1
- package/dist/exports/cli/api/workflow.mjs +135 -1
- package/dist/exports/cli/api/workflows/extract-blob-metadata.mjs +132 -1
- package/dist/exports/cli/api/workflows/generate-image-variant.mjs +118 -1
- package/dist/exports/cli/api/workflows/generate-preview.mjs +160 -1
- package/dist/exports/cli/api/workflows/purge-attachment.mjs +34 -1
- package/dist/exports/cli/api/workflows/purge-audit-logs.mjs +47 -1
- package/dist/exports/cli/api/workflows/purge-unattached-blobs.mjs +46 -1
- package/dist/exports/cli/api/workflows/track-db-changes.mjs +110 -1
- package/dist/exports/cli/command.d.mts +2 -0
- package/dist/exports/cli/command.mjs +43 -1
- package/dist/exports/cli/constants.mjs +23 -1
- package/dist/exports/cli/index.mjs +3 -1
- package/dist/exports/devtools/index.js +4 -1
- package/dist/exports/tests/api/auth.d.mts +4 -0
- package/dist/exports/tests/api/cache.d.mts +2 -2
- package/dist/exports/tests/api/middleware/i18n.mjs +1 -1
- package/dist/exports/tests/api/middleware/youch-handler.mjs +1 -1
- package/dist/exports/tests/api/openapi.mjs +1 -1
- package/dist/exports/tests/api/server.mjs +1 -1
- package/dist/exports/tests/constants.mjs +1 -1
- package/dist/exports/vendors/date.js +1 -1
- package/dist/exports/vendors/toolkit.js +1 -1
- package/dist/exports/vendors/zod.js +1 -1
- package/dist/exports/vitest/globals.mjs +1 -1
- package/dist/exports/web/auth.js +75 -1
- package/dist/exports/web/i18n.js +45 -1
- package/dist/exports/web/index.js +8 -1
- package/package.json +19 -17
- package/dist/bin/auth-schema-Va0CYicu.mjs +0 -2
- package/dist/bin/event-8JibGFH_.mjs +0 -2
- package/dist/bin/extract-blob-metadata-DjPfHtQ2.mjs +0 -2
- package/dist/bin/generate-image-variant-D5VDFyWj.mjs +0 -2
- package/dist/bin/generate-preview-Dssw7w5U.mjs +0 -2
- package/dist/bin/purge-attachment-BBPzIxwt.mjs +0 -2
- package/dist/bin/purge-audit-logs-BeZy3IFM.mjs +0 -2
- package/dist/bin/track-db-changes-CFykw_YO.mjs +0 -2
- package/dist/bin/workflow-BNUZrj4F.mjs +0 -2
- package/dist/bin/youch-handler-BadUgHb0.mjs +0 -2
|
@@ -1 +1,36 @@
|
|
|
1
|
-
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (all, symbols) => {
|
|
7
|
+
let target = {};
|
|
8
|
+
for (var name in all) {
|
|
9
|
+
__defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
if (symbols) {
|
|
15
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
16
|
+
}
|
|
17
|
+
return target;
|
|
18
|
+
};
|
|
19
|
+
var __copyProps = (to, from, except, desc) => {
|
|
20
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
22
|
+
key = keys[i];
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
24
|
+
__defProp(to, key, {
|
|
25
|
+
get: ((k) => from[k]).bind(null, key),
|
|
26
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return to;
|
|
32
|
+
};
|
|
33
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
export { __export, __reExport };
|
|
@@ -1 +1,24 @@
|
|
|
1
|
-
import{fromNodeHeaders
|
|
1
|
+
import { fromNodeHeaders } from "better-auth/node";
|
|
2
|
+
|
|
3
|
+
//#region src/api/app-context.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a unified AppContext for tRPC and OpenAPI handlers.
|
|
6
|
+
*
|
|
7
|
+
* For tRPC (session auth): Pass fetchSession=true to fetch session from Better Auth.
|
|
8
|
+
* For OpenAPI (API key auth): Pass fetchSession=false (default), session will be null.
|
|
9
|
+
*/
|
|
10
|
+
async function defineAppContext(opts) {
|
|
11
|
+
const { apiKey, container, request, fetchSession = false } = opts;
|
|
12
|
+
const headers = fromNodeHeaders(request.headers);
|
|
13
|
+
const sessionData = fetchSession ? await container.auth.api.getSession({ headers }) : null;
|
|
14
|
+
return {
|
|
15
|
+
apiKey,
|
|
16
|
+
container,
|
|
17
|
+
request,
|
|
18
|
+
session: sessionData?.session ?? null,
|
|
19
|
+
user: sessionData?.user ?? null
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { defineAppContext };
|
|
@@ -1 +1,373 @@
|
|
|
1
|
-
import{sql
|
|
1
|
+
import { sql } from "drizzle-orm";
|
|
2
|
+
import { pgTable } from "drizzle-orm/pg-core";
|
|
3
|
+
|
|
4
|
+
//#region src/api/auth-schema.ts
|
|
5
|
+
/**
|
|
6
|
+
* Defines the authentication schema for the application.
|
|
7
|
+
*
|
|
8
|
+
* @returns An object containing the schema and relations for the authentication tables.
|
|
9
|
+
*/
|
|
10
|
+
function defineAuthSchema() {
|
|
11
|
+
const accounts = pgTable("accounts", (t) => ({
|
|
12
|
+
id: t.text("id").primaryKey().default(sql`uuidv7()`),
|
|
13
|
+
accessToken: t.text("access_token"),
|
|
14
|
+
accessTokenExpiresAt: t.timestamp("access_token_expires_at", {
|
|
15
|
+
mode: "string",
|
|
16
|
+
withTimezone: true
|
|
17
|
+
}),
|
|
18
|
+
accountId: t.text("account_id").notNull(),
|
|
19
|
+
createdAt: t.timestamp("created_at", {
|
|
20
|
+
mode: "string",
|
|
21
|
+
withTimezone: true
|
|
22
|
+
}).default(sql`NOW()`).notNull(),
|
|
23
|
+
idToken: t.text("id_token"),
|
|
24
|
+
providerId: t.text("provider_id").notNull(),
|
|
25
|
+
password: t.text("password"),
|
|
26
|
+
userId: t.text("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
|
|
27
|
+
refreshToken: t.text("refresh_token"),
|
|
28
|
+
refreshTokenExpiresAt: t.timestamp("refresh_token_expires_at", {
|
|
29
|
+
mode: "string",
|
|
30
|
+
withTimezone: true
|
|
31
|
+
}),
|
|
32
|
+
scope: t.text("scope"),
|
|
33
|
+
updatedAt: t.timestamp("updated_at", {
|
|
34
|
+
mode: "string",
|
|
35
|
+
withTimezone: true
|
|
36
|
+
}).default(sql`NOW()`).notNull()
|
|
37
|
+
}), (t) => []);
|
|
38
|
+
const apiKeys = pgTable("api_keys", (t) => ({
|
|
39
|
+
id: t.text("id").primaryKey().default(sql`uuidv7()`),
|
|
40
|
+
name: t.text("name"),
|
|
41
|
+
enabled: t.boolean("enabled").default(true),
|
|
42
|
+
expiresAt: t.timestamp("expires_at", {
|
|
43
|
+
mode: "string",
|
|
44
|
+
withTimezone: true
|
|
45
|
+
}),
|
|
46
|
+
key: t.text("key").notNull(),
|
|
47
|
+
lastRefillAt: t.timestamp("last_refill_at", {
|
|
48
|
+
mode: "string",
|
|
49
|
+
withTimezone: true
|
|
50
|
+
}),
|
|
51
|
+
lastRequest: t.timestamp("last_request", {
|
|
52
|
+
mode: "string",
|
|
53
|
+
withTimezone: true
|
|
54
|
+
}),
|
|
55
|
+
lastUsedAt: t.timestamp("last_used_at", {
|
|
56
|
+
mode: "string",
|
|
57
|
+
withTimezone: true
|
|
58
|
+
}),
|
|
59
|
+
metadata: t.text("metadata"),
|
|
60
|
+
permissions: t.text("permissions"),
|
|
61
|
+
prefix: t.text("prefix"),
|
|
62
|
+
rateLimitEnabled: t.boolean("rate_limit_enabled").default(true),
|
|
63
|
+
rateLimitTimeWindow: t.integer("rate_limit_time_window").default(864e5),
|
|
64
|
+
rateLimitMax: t.integer("rate_limit_max").default(10),
|
|
65
|
+
refillInterval: t.integer("refill_interval"),
|
|
66
|
+
refillAmount: t.integer("refill_amount"),
|
|
67
|
+
requestCount: t.integer("request_count"),
|
|
68
|
+
remaining: t.integer("remaining"),
|
|
69
|
+
start: t.text("start"),
|
|
70
|
+
userId: t.text("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
|
|
71
|
+
createdAt: t.timestamp("created_at", {
|
|
72
|
+
mode: "string",
|
|
73
|
+
withTimezone: true
|
|
74
|
+
}).default(sql`NOW()`).notNull(),
|
|
75
|
+
updatedAt: t.timestamp("updated_at", {
|
|
76
|
+
mode: "string",
|
|
77
|
+
withTimezone: true
|
|
78
|
+
}).default(sql`NOW()`).notNull()
|
|
79
|
+
}), (t) => []);
|
|
80
|
+
const invitations = pgTable("invitations", (t) => ({
|
|
81
|
+
id: t.text("id").primaryKey().default(sql`uuidv7()`),
|
|
82
|
+
email: t.text("email").notNull(),
|
|
83
|
+
expiresAt: t.timestamp("expires_at", {
|
|
84
|
+
mode: "string",
|
|
85
|
+
withTimezone: true
|
|
86
|
+
}).notNull(),
|
|
87
|
+
inviterId: t.text("inviter_id").notNull().references(() => users.id, { onDelete: "cascade" }),
|
|
88
|
+
organizationId: t.text("organization_id").notNull().references(() => organizations.id, { onDelete: "cascade" }),
|
|
89
|
+
role: t.text("role"),
|
|
90
|
+
status: t.text("status").default("pending").notNull(),
|
|
91
|
+
teamId: t.text("team_id"),
|
|
92
|
+
createdAt: t.timestamp("created_at", {
|
|
93
|
+
mode: "string",
|
|
94
|
+
withTimezone: true
|
|
95
|
+
}).default(sql`NOW()`).notNull(),
|
|
96
|
+
updatedAt: t.timestamp("updated_at", {
|
|
97
|
+
mode: "string",
|
|
98
|
+
withTimezone: true
|
|
99
|
+
}).default(sql`NOW()`).notNull()
|
|
100
|
+
}), (t) => []);
|
|
101
|
+
const members = pgTable("members", (t) => ({
|
|
102
|
+
id: t.text("id").primaryKey().default(sql`uuidv7()`),
|
|
103
|
+
organizationId: t.text("organization_id").notNull().references(() => organizations.id, { onDelete: "cascade" }),
|
|
104
|
+
role: t.text("role").default("member").notNull(),
|
|
105
|
+
userId: t.text("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
|
|
106
|
+
createdAt: t.timestamp("created_at", {
|
|
107
|
+
mode: "string",
|
|
108
|
+
withTimezone: true
|
|
109
|
+
}).default(sql`NOW()`).notNull()
|
|
110
|
+
}), (t) => []);
|
|
111
|
+
const organizations = pgTable("organizations", (t) => ({
|
|
112
|
+
id: t.text("id").primaryKey().default(sql`uuidv7()`),
|
|
113
|
+
name: t.text("name").notNull(),
|
|
114
|
+
slug: t.text("slug").unique(),
|
|
115
|
+
logo: t.text("logo"),
|
|
116
|
+
createdAt: t.timestamp("created_at", {
|
|
117
|
+
mode: "string",
|
|
118
|
+
withTimezone: true
|
|
119
|
+
}).default(sql`NOW()`).notNull(),
|
|
120
|
+
updatedAt: t.timestamp("updated_at", {
|
|
121
|
+
mode: "string",
|
|
122
|
+
withTimezone: true
|
|
123
|
+
}).default(sql`NOW()`).notNull(),
|
|
124
|
+
metadata: t.text("metadata")
|
|
125
|
+
}), (t) => []);
|
|
126
|
+
const sessions = pgTable("sessions", (t) => ({
|
|
127
|
+
id: t.text("id").primaryKey().default(sql`uuidv7()`),
|
|
128
|
+
activeOrganizationId: t.text("active_organization_id").references(() => organizations.id, { onDelete: "set null" }),
|
|
129
|
+
activeTeamId: t.text("active_team_id"),
|
|
130
|
+
createdAt: t.timestamp("created_at", {
|
|
131
|
+
mode: "string",
|
|
132
|
+
withTimezone: true
|
|
133
|
+
}).default(sql`NOW()`).notNull(),
|
|
134
|
+
expiresAt: t.timestamp("expires_at", {
|
|
135
|
+
mode: "string",
|
|
136
|
+
withTimezone: true
|
|
137
|
+
}).notNull(),
|
|
138
|
+
impersonatedBy: t.text("impersonated_by").references(() => users.id, { onDelete: "set null" }),
|
|
139
|
+
ipAddress: t.text("ip_address"),
|
|
140
|
+
token: t.text("token").notNull().unique(),
|
|
141
|
+
updatedAt: t.timestamp("updated_at", {
|
|
142
|
+
mode: "string",
|
|
143
|
+
withTimezone: true
|
|
144
|
+
}).default(sql`NOW()`).notNull(),
|
|
145
|
+
userAgent: t.text("user_agent"),
|
|
146
|
+
userId: t.text("user_id").notNull().references(() => users.id, { onDelete: "cascade" })
|
|
147
|
+
}), (t) => []);
|
|
148
|
+
const ssoProviders = pgTable("sso_providers", (t) => ({
|
|
149
|
+
id: t.text("id").primaryKey().default(sql`uuidv7()`),
|
|
150
|
+
domain: t.text("domain").notNull(),
|
|
151
|
+
issuer: t.text("issuer").notNull(),
|
|
152
|
+
oidcConfig: t.text("oidc_config"),
|
|
153
|
+
organizationId: t.text("organization_id").references(() => organizations.id, { onDelete: "cascade" }),
|
|
154
|
+
providerId: t.text("provider_id").notNull().unique(),
|
|
155
|
+
samlConfig: t.text("saml_config"),
|
|
156
|
+
userId: t.text("user_id").references(() => users.id, { onDelete: "cascade" })
|
|
157
|
+
}), (t) => []);
|
|
158
|
+
const users = pgTable("users", (t) => ({
|
|
159
|
+
id: t.text("id").primaryKey().default(sql`uuidv7()`),
|
|
160
|
+
banExpires: t.timestamp("ban_expires", {
|
|
161
|
+
mode: "string",
|
|
162
|
+
withTimezone: true
|
|
163
|
+
}),
|
|
164
|
+
banReason: t.text("ban_reason"),
|
|
165
|
+
banned: t.boolean("banned").default(false),
|
|
166
|
+
createdAt: t.timestamp("created_at", {
|
|
167
|
+
mode: "string",
|
|
168
|
+
withTimezone: true
|
|
169
|
+
}).default(sql`NOW()`).notNull(),
|
|
170
|
+
displayUsername: t.text("display_username"),
|
|
171
|
+
email: t.text("email").notNull().unique(),
|
|
172
|
+
emailVerified: t.boolean("email_verified").default(false).notNull(),
|
|
173
|
+
image: t.text("image"),
|
|
174
|
+
isAnonymous: t.boolean("is_anonymous"),
|
|
175
|
+
lastLoginMethod: t.text("last_login_method"),
|
|
176
|
+
name: t.text("name").notNull(),
|
|
177
|
+
phoneNumber: t.text("phone_number").unique(),
|
|
178
|
+
phoneNumberVerified: t.boolean("phone_number_verified"),
|
|
179
|
+
role: t.text("role"),
|
|
180
|
+
twoFactorEnabled: t.boolean("two_factor_enabled").default(false),
|
|
181
|
+
updatedAt: t.timestamp("updated_at", {
|
|
182
|
+
mode: "string",
|
|
183
|
+
withTimezone: true
|
|
184
|
+
}).default(sql`NOW()`).notNull(),
|
|
185
|
+
username: t.text("username").unique()
|
|
186
|
+
}), (t) => []);
|
|
187
|
+
const teams = pgTable("teams", (t) => ({
|
|
188
|
+
id: t.text("id").primaryKey().default(sql`uuidv7()`),
|
|
189
|
+
name: t.text("name").notNull(),
|
|
190
|
+
organizationId: t.text("organization_id").notNull().references(() => organizations.id, { onDelete: "cascade" }),
|
|
191
|
+
createdAt: t.timestamp("created_at", {
|
|
192
|
+
mode: "string",
|
|
193
|
+
withTimezone: true
|
|
194
|
+
}).default(sql`NOW()`).notNull(),
|
|
195
|
+
updatedAt: t.timestamp("updated_at", {
|
|
196
|
+
mode: "string",
|
|
197
|
+
withTimezone: true
|
|
198
|
+
}).default(sql`NOW()`).notNull()
|
|
199
|
+
}), (t) => []);
|
|
200
|
+
const teamMembers = pgTable("team_members", (t) => ({
|
|
201
|
+
id: t.text("id").primaryKey().default(sql`uuidv7()`),
|
|
202
|
+
teamId: t.text("team_id").notNull().references(() => teams.id, { onDelete: "cascade" }),
|
|
203
|
+
userId: t.text("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
|
|
204
|
+
createdAt: t.timestamp("created_at", {
|
|
205
|
+
mode: "string",
|
|
206
|
+
withTimezone: true
|
|
207
|
+
}).default(sql`NOW()`).notNull()
|
|
208
|
+
}), (t) => []);
|
|
209
|
+
const twoFactors = pgTable("two_factors", (t) => ({
|
|
210
|
+
id: t.text("id").primaryKey().default(sql`uuidv7()`),
|
|
211
|
+
secret: t.text("secret").notNull(),
|
|
212
|
+
backupCodes: t.text("backup_codes").notNull(),
|
|
213
|
+
userId: t.text("user_id").notNull().references(() => users.id, { onDelete: "cascade" })
|
|
214
|
+
}), (t) => []);
|
|
215
|
+
const verifications = pgTable("verifications", (t) => ({
|
|
216
|
+
id: t.text("id").primaryKey().default(sql`uuidv7()`),
|
|
217
|
+
createdAt: t.timestamp("created_at", {
|
|
218
|
+
mode: "string",
|
|
219
|
+
withTimezone: true
|
|
220
|
+
}).default(sql`NOW()`).notNull(),
|
|
221
|
+
expiresAt: t.timestamp("expires_at", {
|
|
222
|
+
mode: "string",
|
|
223
|
+
withTimezone: true
|
|
224
|
+
}).notNull(),
|
|
225
|
+
identifier: t.text("identifier").notNull(),
|
|
226
|
+
updatedAt: t.timestamp("updated_at", {
|
|
227
|
+
mode: "string",
|
|
228
|
+
withTimezone: true
|
|
229
|
+
}).default(sql`NOW()`).notNull(),
|
|
230
|
+
value: t.text("value").notNull()
|
|
231
|
+
}), (t) => []);
|
|
232
|
+
return {
|
|
233
|
+
tables: {
|
|
234
|
+
accounts,
|
|
235
|
+
apiKeys,
|
|
236
|
+
auditLogs: pgTable("audit_logs", (t) => ({
|
|
237
|
+
id: t.text("id").primaryKey().default(sql`uuidv7()`),
|
|
238
|
+
tableName: t.text("table_name"),
|
|
239
|
+
action: t.text("action").notNull(),
|
|
240
|
+
customAction: t.text("custom_action"),
|
|
241
|
+
oldData: t.jsonb("old_data"),
|
|
242
|
+
newData: t.jsonb("new_data"),
|
|
243
|
+
metadata: t.jsonb("metadata"),
|
|
244
|
+
organizationId: t.text("organization_id").references(() => organizations.id, { onDelete: "set null" }),
|
|
245
|
+
userId: t.text("user_id").references(() => users.id, { onDelete: "set null" }),
|
|
246
|
+
sessionId: t.text("session_id").references(() => sessions.id, { onDelete: "set null" }),
|
|
247
|
+
requestId: t.text("request_id"),
|
|
248
|
+
createdAt: t.timestamp("created_at", {
|
|
249
|
+
mode: "string",
|
|
250
|
+
withTimezone: true
|
|
251
|
+
}).default(sql`NOW()`).notNull()
|
|
252
|
+
}), (t) => []),
|
|
253
|
+
invitations,
|
|
254
|
+
members,
|
|
255
|
+
organizations,
|
|
256
|
+
sessions,
|
|
257
|
+
ssoProviders,
|
|
258
|
+
teams,
|
|
259
|
+
teamMembers,
|
|
260
|
+
twoFactors,
|
|
261
|
+
users,
|
|
262
|
+
verifications
|
|
263
|
+
},
|
|
264
|
+
relations: (r) => ({
|
|
265
|
+
users: {
|
|
266
|
+
sessions: r.many.sessions({
|
|
267
|
+
from: r.users.id,
|
|
268
|
+
to: r.sessions.userId
|
|
269
|
+
}),
|
|
270
|
+
accounts: r.many.accounts({
|
|
271
|
+
from: r.users.id,
|
|
272
|
+
to: r.accounts.userId
|
|
273
|
+
}),
|
|
274
|
+
apiKeys: r.many.apiKeys({
|
|
275
|
+
from: r.users.id,
|
|
276
|
+
to: r.apiKeys.userId
|
|
277
|
+
}),
|
|
278
|
+
memberships: r.many.members({
|
|
279
|
+
from: r.users.id,
|
|
280
|
+
to: r.members.userId
|
|
281
|
+
}),
|
|
282
|
+
invitations: r.many.invitations({
|
|
283
|
+
from: r.users.id,
|
|
284
|
+
to: r.invitations.inviterId
|
|
285
|
+
}),
|
|
286
|
+
ssoProvider: r.one.ssoProviders({
|
|
287
|
+
from: r.users.id,
|
|
288
|
+
to: r.ssoProviders.userId
|
|
289
|
+
}),
|
|
290
|
+
twoFactor: r.one.twoFactors({
|
|
291
|
+
from: r.users.id,
|
|
292
|
+
to: r.twoFactors.userId
|
|
293
|
+
})
|
|
294
|
+
},
|
|
295
|
+
sessions: { user: r.one.users({
|
|
296
|
+
from: r.sessions.userId,
|
|
297
|
+
to: r.users.id
|
|
298
|
+
}) },
|
|
299
|
+
accounts: { user: r.one.users({
|
|
300
|
+
from: r.accounts.userId,
|
|
301
|
+
to: r.users.id
|
|
302
|
+
}) },
|
|
303
|
+
apiKeys: { user: r.one.users({
|
|
304
|
+
from: r.apiKeys.userId,
|
|
305
|
+
to: r.users.id
|
|
306
|
+
}) },
|
|
307
|
+
organizations: {
|
|
308
|
+
members: r.many.members({
|
|
309
|
+
from: r.organizations.id,
|
|
310
|
+
to: r.members.organizationId
|
|
311
|
+
}),
|
|
312
|
+
invitations: r.many.invitations({
|
|
313
|
+
from: r.organizations.id,
|
|
314
|
+
to: r.invitations.organizationId
|
|
315
|
+
}),
|
|
316
|
+
teams: r.many.teams({
|
|
317
|
+
from: r.organizations.id,
|
|
318
|
+
to: r.teams.organizationId
|
|
319
|
+
})
|
|
320
|
+
},
|
|
321
|
+
members: {
|
|
322
|
+
organization: r.one.organizations({
|
|
323
|
+
from: r.members.organizationId,
|
|
324
|
+
to: r.organizations.id
|
|
325
|
+
}),
|
|
326
|
+
user: r.one.users({
|
|
327
|
+
from: r.members.userId,
|
|
328
|
+
to: r.users.id
|
|
329
|
+
})
|
|
330
|
+
},
|
|
331
|
+
invitations: {
|
|
332
|
+
organization: r.one.organizations({
|
|
333
|
+
from: r.invitations.organizationId,
|
|
334
|
+
to: r.organizations.id
|
|
335
|
+
}),
|
|
336
|
+
inviter: r.one.users({
|
|
337
|
+
from: r.invitations.inviterId,
|
|
338
|
+
to: r.users.id
|
|
339
|
+
})
|
|
340
|
+
},
|
|
341
|
+
teams: { organization: r.one.organizations({
|
|
342
|
+
from: r.teams.organizationId,
|
|
343
|
+
to: r.organizations.id
|
|
344
|
+
}) },
|
|
345
|
+
ssoProviders: { user: r.one.users({
|
|
346
|
+
from: r.ssoProviders.userId,
|
|
347
|
+
to: r.users.id
|
|
348
|
+
}) },
|
|
349
|
+
verifications: {},
|
|
350
|
+
twoFactors: { user: r.one.users({
|
|
351
|
+
from: r.twoFactors.userId,
|
|
352
|
+
to: r.users.id
|
|
353
|
+
}) },
|
|
354
|
+
auditLogs: {
|
|
355
|
+
organization: r.one.organizations({
|
|
356
|
+
from: r.auditLogs.organizationId,
|
|
357
|
+
to: r.organizations.id
|
|
358
|
+
}),
|
|
359
|
+
user: r.one.users({
|
|
360
|
+
from: r.auditLogs.userId,
|
|
361
|
+
to: r.users.id
|
|
362
|
+
}),
|
|
363
|
+
session: r.one.sessions({
|
|
364
|
+
from: r.auditLogs.sessionId,
|
|
365
|
+
to: r.sessions.id
|
|
366
|
+
})
|
|
367
|
+
}
|
|
368
|
+
})
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
//#endregion
|
|
373
|
+
export { defineAuthSchema };
|
|
@@ -370,6 +370,10 @@ type DefineAuthOptions<T extends AuthConfig, TDb = unknown> = {
|
|
|
370
370
|
* Hooks for email sending and OTP delivery.
|
|
371
371
|
*/
|
|
372
372
|
hooks: RequiredHooks<T>;
|
|
373
|
+
/**
|
|
374
|
+
* Secret key for signing tokens and cookies.
|
|
375
|
+
*/
|
|
376
|
+
secret: string;
|
|
373
377
|
/**
|
|
374
378
|
* Session configuration.
|
|
375
379
|
*/
|
|
@@ -1 +1,188 @@
|
|
|
1
|
-
import{AUTH_BASE_PATH
|
|
1
|
+
import { AUTH_BASE_PATH, AUTH_BASE_URL } from "./web/auth.mjs";
|
|
2
|
+
import { passkey } from "@better-auth/passkey";
|
|
3
|
+
import { sso } from "@better-auth/sso";
|
|
4
|
+
import { betterAuth } from "better-auth";
|
|
5
|
+
import { drizzleAdapter } from "better-auth/adapters/drizzle";
|
|
6
|
+
import { admin, anonymous, apiKey, emailOTP, magicLink, multiSession, phoneNumber, twoFactor, username } from "better-auth/plugins";
|
|
7
|
+
import { createAccessControl } from "better-auth/plugins/access";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
|
|
10
|
+
//#region src/api/auth.ts
|
|
11
|
+
/**
|
|
12
|
+
* Standard audit log actions following OCSF/CADF standards.
|
|
13
|
+
* Zod enum provides both runtime validation and TypeScript type.
|
|
14
|
+
*
|
|
15
|
+
* Actions:
|
|
16
|
+
* - Data ops: INSERT, UPDATE, DELETE, TRUNCATE, SELECT
|
|
17
|
+
* - Auth ops: LOGIN, LOGOUT, LOGIN_FAILED, PASSWORD_CHANGE
|
|
18
|
+
* - Custom: CUSTOM (use customAction field for app-specific events)
|
|
19
|
+
*/
|
|
20
|
+
const auditActionSchema = z.enum([
|
|
21
|
+
"DELETE",
|
|
22
|
+
"LOGIN",
|
|
23
|
+
"LOGOUT",
|
|
24
|
+
"INSERT",
|
|
25
|
+
"PASSWORD_CHANGE",
|
|
26
|
+
"TRUNCATE",
|
|
27
|
+
"UPDATE"
|
|
28
|
+
]);
|
|
29
|
+
/**
|
|
30
|
+
* Defines Better Auth instance from neutral config + server dependencies.
|
|
31
|
+
*/
|
|
32
|
+
function defineAuth(opts) {
|
|
33
|
+
const { auditLog, config, appName, database, hooks, oauth, passkey: passkeyConfig, secret, session } = opts;
|
|
34
|
+
const plugins = [];
|
|
35
|
+
if (config.plugins?.admin) plugins.push(admin({
|
|
36
|
+
defaultRole: config.plugins.admin.defaultRole,
|
|
37
|
+
adminRoles: config.plugins.admin.adminRoles
|
|
38
|
+
}));
|
|
39
|
+
if (config.plugins?.apiKey) plugins.push(apiKey({
|
|
40
|
+
defaultPrefix: config.plugins.apiKey.defaultPrefix,
|
|
41
|
+
defaultKeyLength: config.plugins.apiKey.defaultKeyLength,
|
|
42
|
+
rateLimit: config.plugins.apiKey.rateLimit ? {
|
|
43
|
+
enabled: true,
|
|
44
|
+
maxRequests: config.plugins.apiKey.rateLimit.maxRequests,
|
|
45
|
+
timeWindow: config.plugins.apiKey.rateLimit.timeWindow
|
|
46
|
+
} : void 0
|
|
47
|
+
}));
|
|
48
|
+
if (config.plugins?.twoFactor) plugins.push(twoFactor({
|
|
49
|
+
issuer: config.plugins.twoFactor.issuer ?? appName,
|
|
50
|
+
totpOptions: config.plugins.twoFactor.totp ? {
|
|
51
|
+
digits: config.plugins.twoFactor.totp.digits,
|
|
52
|
+
period: config.plugins.twoFactor.totp.period
|
|
53
|
+
} : void 0,
|
|
54
|
+
backupCodeOptions: config.plugins.twoFactor.backupCodes ? {
|
|
55
|
+
amount: config.plugins.twoFactor.backupCodes.amount,
|
|
56
|
+
length: config.plugins.twoFactor.backupCodes.length
|
|
57
|
+
} : void 0,
|
|
58
|
+
otpOptions: config.plugins.twoFactor.otp && hooks.send2FAOTP ? { sendOTP: async ({ user, otp }) => hooks.send2FAOTP({
|
|
59
|
+
email: user.email,
|
|
60
|
+
otp
|
|
61
|
+
}) } : void 0
|
|
62
|
+
}));
|
|
63
|
+
if (config.methods?.passkey && passkeyConfig) plugins.push(passkey({
|
|
64
|
+
rpName: appName,
|
|
65
|
+
rpID: passkeyConfig.rpID,
|
|
66
|
+
origin: passkeyConfig.origin
|
|
67
|
+
}));
|
|
68
|
+
if (config.methods?.magicLink && hooks.sendMagicLink) plugins.push(magicLink({
|
|
69
|
+
expiresIn: config.methods.magicLink.expiresIn,
|
|
70
|
+
sendMagicLink: async ({ email, url, token }) => {
|
|
71
|
+
await hooks.sendMagicLink({
|
|
72
|
+
email,
|
|
73
|
+
url,
|
|
74
|
+
token
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}));
|
|
78
|
+
if (config.methods?.phoneOtp && hooks.sendPhoneOTP) plugins.push(phoneNumber({
|
|
79
|
+
otpLength: config.methods.phoneOtp.otpLength,
|
|
80
|
+
expiresIn: config.methods.phoneOtp.expiresIn,
|
|
81
|
+
sendOTP: async ({ phoneNumber: phone, code }) => {
|
|
82
|
+
await hooks.sendPhoneOTP({
|
|
83
|
+
phoneNumber: phone,
|
|
84
|
+
otp: code
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}));
|
|
88
|
+
if (config.methods?.emailOtp && hooks.sendEmailOTP) plugins.push(emailOTP({
|
|
89
|
+
otpLength: config.methods.emailOtp.otpLength,
|
|
90
|
+
expiresIn: config.methods.emailOtp.expiresIn,
|
|
91
|
+
sendVerificationOTP: async ({ email, otp }) => {
|
|
92
|
+
await hooks.sendEmailOTP({
|
|
93
|
+
email,
|
|
94
|
+
otp
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}));
|
|
98
|
+
if (config.plugins?.username) plugins.push(username({
|
|
99
|
+
minUsernameLength: config.plugins.username.minUsernameLength,
|
|
100
|
+
maxUsernameLength: config.plugins.username.maxUsernameLength
|
|
101
|
+
}));
|
|
102
|
+
if (config.plugins?.anonymous) plugins.push(anonymous({ emailDomainName: config.plugins.anonymous.emailDomainName }));
|
|
103
|
+
if (config.plugins?.multiSession) plugins.push(multiSession({ maximumSessions: config.plugins.multiSession.maximumSessions }));
|
|
104
|
+
if (config.plugins?.sso) plugins.push(sso({
|
|
105
|
+
providersLimit: config.plugins.sso.providersLimit,
|
|
106
|
+
trustEmailVerified: config.plugins.sso.trustEmailVerified,
|
|
107
|
+
domainVerification: config.plugins.sso.domainVerification ? { enabled: true } : void 0
|
|
108
|
+
}));
|
|
109
|
+
const socialProviders = {};
|
|
110
|
+
if (config.oauth?.google) socialProviders.google = {
|
|
111
|
+
clientId: oauth?.google?.clientId ?? process.env.GOOGLE_CLIENT_ID ?? "",
|
|
112
|
+
clientSecret: oauth?.google?.clientSecret ?? process.env.GOOGLE_CLIENT_SECRET ?? ""
|
|
113
|
+
};
|
|
114
|
+
if (config.oauth?.github) socialProviders.github = {
|
|
115
|
+
clientId: oauth?.github?.clientId ?? process.env.GITHUB_CLIENT_ID ?? "",
|
|
116
|
+
clientSecret: oauth?.github?.clientSecret ?? process.env.GITHUB_CLIENT_SECRET ?? ""
|
|
117
|
+
};
|
|
118
|
+
if (config.oauth?.apple) socialProviders.apple = {
|
|
119
|
+
clientId: oauth?.apple?.clientId ?? process.env.APPLE_CLIENT_ID ?? "",
|
|
120
|
+
clientSecret: oauth?.apple?.clientSecret ?? process.env.APPLE_CLIENT_SECRET ?? ""
|
|
121
|
+
};
|
|
122
|
+
if (config.oauth?.facebook) socialProviders.facebook = {
|
|
123
|
+
clientId: oauth?.facebook?.clientId ?? process.env.FACEBOOK_CLIENT_ID ?? "",
|
|
124
|
+
clientSecret: oauth?.facebook?.clientSecret ?? process.env.FACEBOOK_CLIENT_SECRET ?? ""
|
|
125
|
+
};
|
|
126
|
+
const basePath = config.basePath ?? AUTH_BASE_PATH;
|
|
127
|
+
const baseURL = config.baseURL ?? AUTH_BASE_URL;
|
|
128
|
+
const auth = betterAuth({
|
|
129
|
+
account: { accountLinking: {
|
|
130
|
+
enabled: true,
|
|
131
|
+
trustedProviders: ["email-password", "google"]
|
|
132
|
+
} },
|
|
133
|
+
advanced: {
|
|
134
|
+
cookiePrefix: appName.replace(/\s+/g, "_").toLowerCase(),
|
|
135
|
+
database: { generateId: false },
|
|
136
|
+
ipAddress: {
|
|
137
|
+
disableIpTracking: false,
|
|
138
|
+
ipAddressHeaders: [
|
|
139
|
+
"cf-connecting-ip",
|
|
140
|
+
"x-client-ip",
|
|
141
|
+
"x-forwarded-for",
|
|
142
|
+
"x-real-ip"
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
appName,
|
|
147
|
+
baseURL: baseURL || void 0,
|
|
148
|
+
basePath,
|
|
149
|
+
database: drizzleAdapter(database, {
|
|
150
|
+
provider: "pg",
|
|
151
|
+
usePlural: true
|
|
152
|
+
}),
|
|
153
|
+
emailAndPassword: config.methods?.emailPassword ? {
|
|
154
|
+
enabled: true,
|
|
155
|
+
requireEmailVerification: config.methods.emailPassword.requireEmailVerification,
|
|
156
|
+
minPasswordLength: config.methods.emailPassword.minPasswordLength,
|
|
157
|
+
maxPasswordLength: config.methods.emailPassword.maxPasswordLength,
|
|
158
|
+
sendVerificationEmail: hooks.sendVerificationEmail ? async ({ user, url, token }) => hooks.sendVerificationEmail({
|
|
159
|
+
email: user.email,
|
|
160
|
+
url,
|
|
161
|
+
token
|
|
162
|
+
}) : void 0,
|
|
163
|
+
sendResetPassword: hooks.sendResetPasswordEmail ? async ({ user, url, token }) => hooks.sendResetPasswordEmail({
|
|
164
|
+
email: user.email,
|
|
165
|
+
url,
|
|
166
|
+
token
|
|
167
|
+
}) : void 0
|
|
168
|
+
} : { enabled: false },
|
|
169
|
+
plugins,
|
|
170
|
+
secret,
|
|
171
|
+
session: session ? {
|
|
172
|
+
expiresIn: session.expiresIn,
|
|
173
|
+
updateAge: session.updateAge,
|
|
174
|
+
freshAge: session.freshAge
|
|
175
|
+
} : void 0,
|
|
176
|
+
socialProviders: Object.keys(socialProviders).length > 0 ? socialProviders : void 0
|
|
177
|
+
});
|
|
178
|
+
const excludeTablesSet = new Set(auditLog?.excludeTables ?? []);
|
|
179
|
+
return Object.assign(auth, {
|
|
180
|
+
auditLog,
|
|
181
|
+
shouldAudit(tableName) {
|
|
182
|
+
return !excludeTablesSet.has(tableName);
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
//#endregion
|
|
188
|
+
export { auditActionSchema, createAccessControl, defineAuth };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Logger } from "./logger.mjs";
|
|
2
|
+
import * as _keyv_redis0 from "@keyv/redis";
|
|
2
3
|
import { KeyvRedisOptions } from "@keyv/redis";
|
|
3
|
-
import * as keyv0 from "keyv";
|
|
4
4
|
|
|
5
5
|
//#region src/api/cache.d.ts
|
|
6
6
|
/**
|
|
@@ -39,6 +39,6 @@ declare function defineCache({
|
|
|
39
39
|
url,
|
|
40
40
|
logger,
|
|
41
41
|
options
|
|
42
|
-
}: DefineCacheOptions):
|
|
42
|
+
}: DefineCacheOptions): _keyv_redis0.Keyv<any>;
|
|
43
43
|
//#endregion
|
|
44
44
|
export { Cache, DefineCacheOptions, defineCache };
|