Initial commit: New MoreminiMore website with fresh design

This commit is contained in:
MoreminiMore
2026-04-22 01:59:05 +07:00
commit 76409638cc
14010 changed files with 2052041 additions and 0 deletions

25
node_modules/drizzle-orm/neon/index.cjs generated vendored Normal file
View File

@@ -0,0 +1,25 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var neon_exports = {};
module.exports = __toCommonJS(neon_exports);
__reExport(neon_exports, require("./neon-identity.cjs"), module.exports);
__reExport(neon_exports, require("./rls.cjs"), module.exports);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
...require("./neon-identity.cjs"),
...require("./rls.cjs")
});
//# sourceMappingURL=index.cjs.map

1
node_modules/drizzle-orm/neon/index.cjs.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/neon/index.ts"],"sourcesContent":["export * from './neon-identity.ts';\nexport * from './rls.ts';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,yBAAc,+BAAd;AACA,yBAAc,qBADd;","names":[]}

2
node_modules/drizzle-orm/neon/index.d.cts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export * from "./neon-identity.cjs";
export * from "./rls.cjs";

2
node_modules/drizzle-orm/neon/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export * from "./neon-identity.js";
export * from "./rls.js";

3
node_modules/drizzle-orm/neon/index.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
export * from "./neon-identity.js";
export * from "./rls.js";
//# sourceMappingURL=index.js.map

1
node_modules/drizzle-orm/neon/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/neon/index.ts"],"sourcesContent":["export * from './neon-identity.ts';\nexport * from './rls.ts';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;","names":[]}

38
node_modules/drizzle-orm/neon/neon-identity.cjs generated vendored Normal file
View File

@@ -0,0 +1,38 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var neon_identity_exports = {};
__export(neon_identity_exports, {
usersSync: () => usersSync
});
module.exports = __toCommonJS(neon_identity_exports);
var import_pg_core = require("../pg-core/index.cjs");
const neonAuthSchema = (0, import_pg_core.pgSchema)("neon_auth");
const usersSync = neonAuthSchema.table("users_sync", {
rawJson: (0, import_pg_core.jsonb)("raw_json").notNull(),
id: (0, import_pg_core.text)().primaryKey().notNull(),
name: (0, import_pg_core.text)(),
email: (0, import_pg_core.text)(),
createdAt: (0, import_pg_core.timestamp)("created_at", { withTimezone: true, mode: "string" }),
deletedAt: (0, import_pg_core.timestamp)("deleted_at", { withTimezone: true, mode: "string" })
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
usersSync
});
//# sourceMappingURL=neon-identity.cjs.map

1
node_modules/drizzle-orm/neon/neon-identity.cjs.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/neon/neon-identity.ts"],"sourcesContent":["import { jsonb, pgSchema, text, timestamp } from '~/pg-core/index.ts';\n\nconst neonAuthSchema = pgSchema('neon_auth');\n\n/**\n * Table schema of the `users_sync` table used by Neon Auth.\n * This table automatically synchronizes and stores user data from external authentication providers.\n *\n * @schema neon_auth\n * @table users_sync\n */\nexport const usersSync = neonAuthSchema.table('users_sync', {\n\trawJson: jsonb('raw_json').notNull(),\n\tid: text().primaryKey().notNull(),\n\tname: text(),\n\temail: text(),\n\tcreatedAt: timestamp('created_at', { withTimezone: true, mode: 'string' }),\n\tdeletedAt: timestamp('deleted_at', { withTimezone: true, mode: 'string' }),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAiD;AAEjD,MAAM,qBAAiB,yBAAS,WAAW;AASpC,MAAM,YAAY,eAAe,MAAM,cAAc;AAAA,EAC3D,aAAS,sBAAM,UAAU,EAAE,QAAQ;AAAA,EACnC,QAAI,qBAAK,EAAE,WAAW,EAAE,QAAQ;AAAA,EAChC,UAAM,qBAAK;AAAA,EACX,WAAO,qBAAK;AAAA,EACZ,eAAW,0BAAU,cAAc,EAAE,cAAc,MAAM,MAAM,SAAS,CAAC;AAAA,EACzE,eAAW,0BAAU,cAAc,EAAE,cAAc,MAAM,MAAM,SAAS,CAAC;AAC1E,CAAC;","names":[]}

116
node_modules/drizzle-orm/neon/neon-identity.d.cts generated vendored Normal file
View File

@@ -0,0 +1,116 @@
/**
* Table schema of the `users_sync` table used by Neon Auth.
* This table automatically synchronizes and stores user data from external authentication providers.
*
* @schema neon_auth
* @table users_sync
*/
export declare const usersSync: import("../pg-core/index.ts").PgTableWithColumns<{
name: "users_sync";
schema: "neon_auth";
columns: {
rawJson: import("../pg-core/index.ts").PgColumn<{
name: "raw_json";
tableName: "users_sync";
dataType: "json";
columnType: "PgJsonb";
data: unknown;
driverParam: unknown;
notNull: true;
hasDefault: false;
isPrimaryKey: false;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: undefined;
baseColumn: never;
identity: undefined;
generated: undefined;
}, {}, {}>;
id: import("../pg-core/index.ts").PgColumn<{
name: "id";
tableName: "users_sync";
dataType: "string";
columnType: "PgText";
data: string;
driverParam: string;
notNull: true;
hasDefault: false;
isPrimaryKey: true;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: [string, ...string[]];
baseColumn: never;
identity: undefined;
generated: undefined;
}, {}, {}>;
name: import("../pg-core/index.ts").PgColumn<{
name: "name";
tableName: "users_sync";
dataType: "string";
columnType: "PgText";
data: string;
driverParam: string;
notNull: false;
hasDefault: false;
isPrimaryKey: false;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: [string, ...string[]];
baseColumn: never;
identity: undefined;
generated: undefined;
}, {}, {}>;
email: import("../pg-core/index.ts").PgColumn<{
name: "email";
tableName: "users_sync";
dataType: "string";
columnType: "PgText";
data: string;
driverParam: string;
notNull: false;
hasDefault: false;
isPrimaryKey: false;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: [string, ...string[]];
baseColumn: never;
identity: undefined;
generated: undefined;
}, {}, {}>;
createdAt: import("../pg-core/index.ts").PgColumn<{
name: "created_at";
tableName: "users_sync";
dataType: "string";
columnType: "PgTimestampString";
data: string;
driverParam: string;
notNull: false;
hasDefault: false;
isPrimaryKey: false;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: undefined;
baseColumn: never;
identity: undefined;
generated: undefined;
}, {}, {}>;
deletedAt: import("../pg-core/index.ts").PgColumn<{
name: "deleted_at";
tableName: "users_sync";
dataType: "string";
columnType: "PgTimestampString";
data: string;
driverParam: string;
notNull: false;
hasDefault: false;
isPrimaryKey: false;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: undefined;
baseColumn: never;
identity: undefined;
generated: undefined;
}, {}, {}>;
};
dialect: "pg";
}>;

116
node_modules/drizzle-orm/neon/neon-identity.d.ts generated vendored Normal file
View File

@@ -0,0 +1,116 @@
/**
* Table schema of the `users_sync` table used by Neon Auth.
* This table automatically synchronizes and stores user data from external authentication providers.
*
* @schema neon_auth
* @table users_sync
*/
export declare const usersSync: import("../pg-core/index.js").PgTableWithColumns<{
name: "users_sync";
schema: "neon_auth";
columns: {
rawJson: import("../pg-core/index.js").PgColumn<{
name: "raw_json";
tableName: "users_sync";
dataType: "json";
columnType: "PgJsonb";
data: unknown;
driverParam: unknown;
notNull: true;
hasDefault: false;
isPrimaryKey: false;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: undefined;
baseColumn: never;
identity: undefined;
generated: undefined;
}, {}, {}>;
id: import("../pg-core/index.js").PgColumn<{
name: "id";
tableName: "users_sync";
dataType: "string";
columnType: "PgText";
data: string;
driverParam: string;
notNull: true;
hasDefault: false;
isPrimaryKey: true;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: [string, ...string[]];
baseColumn: never;
identity: undefined;
generated: undefined;
}, {}, {}>;
name: import("../pg-core/index.js").PgColumn<{
name: "name";
tableName: "users_sync";
dataType: "string";
columnType: "PgText";
data: string;
driverParam: string;
notNull: false;
hasDefault: false;
isPrimaryKey: false;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: [string, ...string[]];
baseColumn: never;
identity: undefined;
generated: undefined;
}, {}, {}>;
email: import("../pg-core/index.js").PgColumn<{
name: "email";
tableName: "users_sync";
dataType: "string";
columnType: "PgText";
data: string;
driverParam: string;
notNull: false;
hasDefault: false;
isPrimaryKey: false;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: [string, ...string[]];
baseColumn: never;
identity: undefined;
generated: undefined;
}, {}, {}>;
createdAt: import("../pg-core/index.js").PgColumn<{
name: "created_at";
tableName: "users_sync";
dataType: "string";
columnType: "PgTimestampString";
data: string;
driverParam: string;
notNull: false;
hasDefault: false;
isPrimaryKey: false;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: undefined;
baseColumn: never;
identity: undefined;
generated: undefined;
}, {}, {}>;
deletedAt: import("../pg-core/index.js").PgColumn<{
name: "deleted_at";
tableName: "users_sync";
dataType: "string";
columnType: "PgTimestampString";
data: string;
driverParam: string;
notNull: false;
hasDefault: false;
isPrimaryKey: false;
isAutoincrement: false;
hasRuntimeDefault: false;
enumValues: undefined;
baseColumn: never;
identity: undefined;
generated: undefined;
}, {}, {}>;
};
dialect: "pg";
}>;

14
node_modules/drizzle-orm/neon/neon-identity.js generated vendored Normal file
View File

@@ -0,0 +1,14 @@
import { jsonb, pgSchema, text, timestamp } from "../pg-core/index.js";
const neonAuthSchema = pgSchema("neon_auth");
const usersSync = neonAuthSchema.table("users_sync", {
rawJson: jsonb("raw_json").notNull(),
id: text().primaryKey().notNull(),
name: text(),
email: text(),
createdAt: timestamp("created_at", { withTimezone: true, mode: "string" }),
deletedAt: timestamp("deleted_at", { withTimezone: true, mode: "string" })
});
export {
usersSync
};
//# sourceMappingURL=neon-identity.js.map

1
node_modules/drizzle-orm/neon/neon-identity.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/neon/neon-identity.ts"],"sourcesContent":["import { jsonb, pgSchema, text, timestamp } from '~/pg-core/index.ts';\n\nconst neonAuthSchema = pgSchema('neon_auth');\n\n/**\n * Table schema of the `users_sync` table used by Neon Auth.\n * This table automatically synchronizes and stores user data from external authentication providers.\n *\n * @schema neon_auth\n * @table users_sync\n */\nexport const usersSync = neonAuthSchema.table('users_sync', {\n\trawJson: jsonb('raw_json').notNull(),\n\tid: text().primaryKey().notNull(),\n\tname: text(),\n\temail: text(),\n\tcreatedAt: timestamp('created_at', { withTimezone: true, mode: 'string' }),\n\tdeletedAt: timestamp('deleted_at', { withTimezone: true, mode: 'string' }),\n});\n"],"mappings":"AAAA,SAAS,OAAO,UAAU,MAAM,iBAAiB;AAEjD,MAAM,iBAAiB,SAAS,WAAW;AASpC,MAAM,YAAY,eAAe,MAAM,cAAc;AAAA,EAC3D,SAAS,MAAM,UAAU,EAAE,QAAQ;AAAA,EACnC,IAAI,KAAK,EAAE,WAAW,EAAE,QAAQ;AAAA,EAChC,MAAM,KAAK;AAAA,EACX,OAAO,KAAK;AAAA,EACZ,WAAW,UAAU,cAAc,EAAE,cAAc,MAAM,MAAM,SAAS,CAAC;AAAA,EACzE,WAAW,UAAU,cAAc,EAAE,cAAc,MAAM,MAAM,SAAS,CAAC;AAC1E,CAAC;","names":[]}

96
node_modules/drizzle-orm/neon/rls.cjs generated vendored Normal file
View File

@@ -0,0 +1,96 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var rls_exports = {};
__export(rls_exports, {
anonymousRole: () => anonymousRole,
authUid: () => authUid,
authenticatedRole: () => authenticatedRole,
crudPolicy: () => crudPolicy
});
module.exports = __toCommonJS(rls_exports);
var import_entity = require("../entity.cjs");
var import_pg_core = require("../pg-core/index.cjs");
var import_roles = require("../pg-core/roles.cjs");
var import_sql = require("../sql/sql.cjs");
const crudPolicy = (options) => {
if (options.read === void 0) {
throw new Error("crudPolicy requires a read policy");
}
if (options.modify === void 0) {
throw new Error("crudPolicy requires a modify policy");
}
let read;
if (options.read === true) {
read = import_sql.sql`true`;
} else if (options.read === false) {
read = import_sql.sql`false`;
} else if (options.read !== null) {
read = options.read;
}
let modify;
if (options.modify === true) {
modify = import_sql.sql`true`;
} else if (options.modify === false) {
modify = import_sql.sql`false`;
} else if (options.modify !== null) {
modify = options.modify;
}
let rolesName = "";
if (Array.isArray(options.role)) {
rolesName = options.role.map((it) => {
return (0, import_entity.is)(it, import_roles.PgRole) ? it.name : it;
}).join("-");
} else {
rolesName = (0, import_entity.is)(options.role, import_roles.PgRole) ? options.role.name : options.role;
}
return [
read && (0, import_pg_core.pgPolicy)(`crud-${rolesName}-policy-select`, {
for: "select",
to: options.role,
using: read
}),
modify && (0, import_pg_core.pgPolicy)(`crud-${rolesName}-policy-insert`, {
for: "insert",
to: options.role,
withCheck: modify
}),
modify && (0, import_pg_core.pgPolicy)(`crud-${rolesName}-policy-update`, {
for: "update",
to: options.role,
using: modify,
withCheck: modify
}),
modify && (0, import_pg_core.pgPolicy)(`crud-${rolesName}-policy-delete`, {
for: "delete",
to: options.role,
using: modify
})
].filter(Boolean);
};
const authenticatedRole = (0, import_roles.pgRole)("authenticated").existing();
const anonymousRole = (0, import_roles.pgRole)("anonymous").existing();
const authUid = (userIdColumn) => import_sql.sql`(select auth.user_id() = ${userIdColumn})`;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
anonymousRole,
authUid,
authenticatedRole,
crudPolicy
});
//# sourceMappingURL=rls.cjs.map

1
node_modules/drizzle-orm/neon/rls.cjs.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/neon/rls.ts"],"sourcesContent":["import { is } from '~/entity.ts';\nimport { type AnyPgColumn, pgPolicy, type PgPolicyToOption } from '~/pg-core/index.ts';\nimport { PgRole, pgRole } from '~/pg-core/roles.ts';\nimport { type SQL, sql } from '~/sql/sql.ts';\n\n/**\n * Generates a set of PostgreSQL row-level security (RLS) policies for CRUD operations based on the provided options.\n *\n * @param options - An object containing the policy configuration.\n * @param options.role - The PostgreSQL role(s) to apply the policy to. Can be a single `PgRole` instance or an array of `PgRole` instances or role names.\n * @param options.read - The SQL expression or boolean value that defines the read policy. Set to `true` to allow all reads, `false` to deny all reads, or provide a custom SQL expression. Set to `null` to prevent the policy from being generated.\n * @param options.modify - The SQL expression or boolean value that defines the modify (insert, update, delete) policies. Set to `true` to allow all modifications, `false` to deny all modifications, or provide a custom SQL expression. Set to `null` to prevent policies from being generated.\n * @returns An array of PostgreSQL policy definitions, one for each CRUD operation.\n */\nexport const crudPolicy = (options: {\n\trole: PgPolicyToOption;\n\tread: SQL | boolean | null;\n\tmodify: SQL | boolean | null;\n}) => {\n\tif (options.read === undefined) {\n\t\tthrow new Error('crudPolicy requires a read policy');\n\t}\n\n\tif (options.modify === undefined) {\n\t\tthrow new Error('crudPolicy requires a modify policy');\n\t}\n\n\tlet read: SQL | undefined;\n\tif (options.read === true) {\n\t\tread = sql`true`;\n\t} else if (options.read === false) {\n\t\tread = sql`false`;\n\t} else if (options.read !== null) {\n\t\tread = options.read;\n\t}\n\n\tlet modify: SQL | undefined;\n\tif (options.modify === true) {\n\t\tmodify = sql`true`;\n\t} else if (options.modify === false) {\n\t\tmodify = sql`false`;\n\t} else if (options.modify !== null) {\n\t\tmodify = options.modify;\n\t}\n\n\tlet rolesName = '';\n\tif (Array.isArray(options.role)) {\n\t\trolesName = options.role\n\t\t\t.map((it) => {\n\t\t\t\treturn is(it, PgRole) ? it.name : (it as string);\n\t\t\t})\n\t\t\t.join('-');\n\t} else {\n\t\trolesName = is(options.role, PgRole)\n\t\t\t? options.role.name\n\t\t\t: (options.role as string);\n\t}\n\n\treturn [\n\t\tread\n\t\t&& pgPolicy(`crud-${rolesName}-policy-select`, {\n\t\t\tfor: 'select',\n\t\t\tto: options.role,\n\t\t\tusing: read,\n\t\t}),\n\n\t\tmodify\n\t\t&& pgPolicy(`crud-${rolesName}-policy-insert`, {\n\t\t\tfor: 'insert',\n\t\t\tto: options.role,\n\t\t\twithCheck: modify,\n\t\t}),\n\t\tmodify\n\t\t&& pgPolicy(`crud-${rolesName}-policy-update`, {\n\t\t\tfor: 'update',\n\t\t\tto: options.role,\n\t\t\tusing: modify,\n\t\t\twithCheck: modify,\n\t\t}),\n\t\tmodify\n\t\t&& pgPolicy(`crud-${rolesName}-policy-delete`, {\n\t\t\tfor: 'delete',\n\t\t\tto: options.role,\n\t\t\tusing: modify,\n\t\t}),\n\t].filter(Boolean);\n};\n\n// These are default roles that Neon will set up.\nexport const authenticatedRole = pgRole('authenticated').existing();\nexport const anonymousRole = pgRole('anonymous').existing();\n\nexport const authUid = (userIdColumn: AnyPgColumn) => sql`(select auth.user_id() = ${userIdColumn})`;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAmB;AACnB,qBAAkE;AAClE,mBAA+B;AAC/B,iBAA8B;AAWvB,MAAM,aAAa,CAAC,YAIrB;AACL,MAAI,QAAQ,SAAS,QAAW;AAC/B,UAAM,IAAI,MAAM,mCAAmC;AAAA,EACpD;AAEA,MAAI,QAAQ,WAAW,QAAW;AACjC,UAAM,IAAI,MAAM,qCAAqC;AAAA,EACtD;AAEA,MAAI;AACJ,MAAI,QAAQ,SAAS,MAAM;AAC1B,WAAO;AAAA,EACR,WAAW,QAAQ,SAAS,OAAO;AAClC,WAAO;AAAA,EACR,WAAW,QAAQ,SAAS,MAAM;AACjC,WAAO,QAAQ;AAAA,EAChB;AAEA,MAAI;AACJ,MAAI,QAAQ,WAAW,MAAM;AAC5B,aAAS;AAAA,EACV,WAAW,QAAQ,WAAW,OAAO;AACpC,aAAS;AAAA,EACV,WAAW,QAAQ,WAAW,MAAM;AACnC,aAAS,QAAQ;AAAA,EAClB;AAEA,MAAI,YAAY;AAChB,MAAI,MAAM,QAAQ,QAAQ,IAAI,GAAG;AAChC,gBAAY,QAAQ,KAClB,IAAI,CAAC,OAAO;AACZ,iBAAO,kBAAG,IAAI,mBAAM,IAAI,GAAG,OAAQ;AAAA,IACpC,CAAC,EACA,KAAK,GAAG;AAAA,EACX,OAAO;AACN,oBAAY,kBAAG,QAAQ,MAAM,mBAAM,IAChC,QAAQ,KAAK,OACZ,QAAQ;AAAA,EACb;AAEA,SAAO;AAAA,IACN,YACG,yBAAS,QAAQ,SAAS,kBAAkB;AAAA,MAC9C,KAAK;AAAA,MACL,IAAI,QAAQ;AAAA,MACZ,OAAO;AAAA,IACR,CAAC;AAAA,IAED,cACG,yBAAS,QAAQ,SAAS,kBAAkB;AAAA,MAC9C,KAAK;AAAA,MACL,IAAI,QAAQ;AAAA,MACZ,WAAW;AAAA,IACZ,CAAC;AAAA,IACD,cACG,yBAAS,QAAQ,SAAS,kBAAkB;AAAA,MAC9C,KAAK;AAAA,MACL,IAAI,QAAQ;AAAA,MACZ,OAAO;AAAA,MACP,WAAW;AAAA,IACZ,CAAC;AAAA,IACD,cACG,yBAAS,QAAQ,SAAS,kBAAkB;AAAA,MAC9C,KAAK;AAAA,MACL,IAAI,QAAQ;AAAA,MACZ,OAAO;AAAA,IACR,CAAC;AAAA,EACF,EAAE,OAAO,OAAO;AACjB;AAGO,MAAM,wBAAoB,qBAAO,eAAe,EAAE,SAAS;AAC3D,MAAM,oBAAgB,qBAAO,WAAW,EAAE,SAAS;AAEnD,MAAM,UAAU,CAAC,iBAA8B,0CAA+B,YAAY;","names":[]}

20
node_modules/drizzle-orm/neon/rls.d.cts generated vendored Normal file
View File

@@ -0,0 +1,20 @@
import { type AnyPgColumn, type PgPolicyToOption } from "../pg-core/index.cjs";
import { PgRole } from "../pg-core/roles.cjs";
import { type SQL } from "../sql/sql.cjs";
/**
* Generates a set of PostgreSQL row-level security (RLS) policies for CRUD operations based on the provided options.
*
* @param options - An object containing the policy configuration.
* @param options.role - The PostgreSQL role(s) to apply the policy to. Can be a single `PgRole` instance or an array of `PgRole` instances or role names.
* @param options.read - The SQL expression or boolean value that defines the read policy. Set to `true` to allow all reads, `false` to deny all reads, or provide a custom SQL expression. Set to `null` to prevent the policy from being generated.
* @param options.modify - The SQL expression or boolean value that defines the modify (insert, update, delete) policies. Set to `true` to allow all modifications, `false` to deny all modifications, or provide a custom SQL expression. Set to `null` to prevent policies from being generated.
* @returns An array of PostgreSQL policy definitions, one for each CRUD operation.
*/
export declare const crudPolicy: (options: {
role: PgPolicyToOption;
read: SQL | boolean | null;
modify: SQL | boolean | null;
}) => (import("../pg-core/index.ts").PgPolicy | undefined)[];
export declare const authenticatedRole: PgRole;
export declare const anonymousRole: PgRole;
export declare const authUid: (userIdColumn: AnyPgColumn) => SQL<unknown>;

20
node_modules/drizzle-orm/neon/rls.d.ts generated vendored Normal file
View File

@@ -0,0 +1,20 @@
import { type AnyPgColumn, type PgPolicyToOption } from "../pg-core/index.js";
import { PgRole } from "../pg-core/roles.js";
import { type SQL } from "../sql/sql.js";
/**
* Generates a set of PostgreSQL row-level security (RLS) policies for CRUD operations based on the provided options.
*
* @param options - An object containing the policy configuration.
* @param options.role - The PostgreSQL role(s) to apply the policy to. Can be a single `PgRole` instance or an array of `PgRole` instances or role names.
* @param options.read - The SQL expression or boolean value that defines the read policy. Set to `true` to allow all reads, `false` to deny all reads, or provide a custom SQL expression. Set to `null` to prevent the policy from being generated.
* @param options.modify - The SQL expression or boolean value that defines the modify (insert, update, delete) policies. Set to `true` to allow all modifications, `false` to deny all modifications, or provide a custom SQL expression. Set to `null` to prevent policies from being generated.
* @returns An array of PostgreSQL policy definitions, one for each CRUD operation.
*/
export declare const crudPolicy: (options: {
role: PgPolicyToOption;
read: SQL | boolean | null;
modify: SQL | boolean | null;
}) => (import("../pg-core/index.js").PgPolicy | undefined)[];
export declare const authenticatedRole: PgRole;
export declare const anonymousRole: PgRole;
export declare const authUid: (userIdColumn: AnyPgColumn) => SQL<unknown>;

69
node_modules/drizzle-orm/neon/rls.js generated vendored Normal file
View File

@@ -0,0 +1,69 @@
import { is } from "../entity.js";
import { pgPolicy } from "../pg-core/index.js";
import { PgRole, pgRole } from "../pg-core/roles.js";
import { sql } from "../sql/sql.js";
const crudPolicy = (options) => {
if (options.read === void 0) {
throw new Error("crudPolicy requires a read policy");
}
if (options.modify === void 0) {
throw new Error("crudPolicy requires a modify policy");
}
let read;
if (options.read === true) {
read = sql`true`;
} else if (options.read === false) {
read = sql`false`;
} else if (options.read !== null) {
read = options.read;
}
let modify;
if (options.modify === true) {
modify = sql`true`;
} else if (options.modify === false) {
modify = sql`false`;
} else if (options.modify !== null) {
modify = options.modify;
}
let rolesName = "";
if (Array.isArray(options.role)) {
rolesName = options.role.map((it) => {
return is(it, PgRole) ? it.name : it;
}).join("-");
} else {
rolesName = is(options.role, PgRole) ? options.role.name : options.role;
}
return [
read && pgPolicy(`crud-${rolesName}-policy-select`, {
for: "select",
to: options.role,
using: read
}),
modify && pgPolicy(`crud-${rolesName}-policy-insert`, {
for: "insert",
to: options.role,
withCheck: modify
}),
modify && pgPolicy(`crud-${rolesName}-policy-update`, {
for: "update",
to: options.role,
using: modify,
withCheck: modify
}),
modify && pgPolicy(`crud-${rolesName}-policy-delete`, {
for: "delete",
to: options.role,
using: modify
})
].filter(Boolean);
};
const authenticatedRole = pgRole("authenticated").existing();
const anonymousRole = pgRole("anonymous").existing();
const authUid = (userIdColumn) => sql`(select auth.user_id() = ${userIdColumn})`;
export {
anonymousRole,
authUid,
authenticatedRole,
crudPolicy
};
//# sourceMappingURL=rls.js.map

1
node_modules/drizzle-orm/neon/rls.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/neon/rls.ts"],"sourcesContent":["import { is } from '~/entity.ts';\nimport { type AnyPgColumn, pgPolicy, type PgPolicyToOption } from '~/pg-core/index.ts';\nimport { PgRole, pgRole } from '~/pg-core/roles.ts';\nimport { type SQL, sql } from '~/sql/sql.ts';\n\n/**\n * Generates a set of PostgreSQL row-level security (RLS) policies for CRUD operations based on the provided options.\n *\n * @param options - An object containing the policy configuration.\n * @param options.role - The PostgreSQL role(s) to apply the policy to. Can be a single `PgRole` instance or an array of `PgRole` instances or role names.\n * @param options.read - The SQL expression or boolean value that defines the read policy. Set to `true` to allow all reads, `false` to deny all reads, or provide a custom SQL expression. Set to `null` to prevent the policy from being generated.\n * @param options.modify - The SQL expression or boolean value that defines the modify (insert, update, delete) policies. Set to `true` to allow all modifications, `false` to deny all modifications, or provide a custom SQL expression. Set to `null` to prevent policies from being generated.\n * @returns An array of PostgreSQL policy definitions, one for each CRUD operation.\n */\nexport const crudPolicy = (options: {\n\trole: PgPolicyToOption;\n\tread: SQL | boolean | null;\n\tmodify: SQL | boolean | null;\n}) => {\n\tif (options.read === undefined) {\n\t\tthrow new Error('crudPolicy requires a read policy');\n\t}\n\n\tif (options.modify === undefined) {\n\t\tthrow new Error('crudPolicy requires a modify policy');\n\t}\n\n\tlet read: SQL | undefined;\n\tif (options.read === true) {\n\t\tread = sql`true`;\n\t} else if (options.read === false) {\n\t\tread = sql`false`;\n\t} else if (options.read !== null) {\n\t\tread = options.read;\n\t}\n\n\tlet modify: SQL | undefined;\n\tif (options.modify === true) {\n\t\tmodify = sql`true`;\n\t} else if (options.modify === false) {\n\t\tmodify = sql`false`;\n\t} else if (options.modify !== null) {\n\t\tmodify = options.modify;\n\t}\n\n\tlet rolesName = '';\n\tif (Array.isArray(options.role)) {\n\t\trolesName = options.role\n\t\t\t.map((it) => {\n\t\t\t\treturn is(it, PgRole) ? it.name : (it as string);\n\t\t\t})\n\t\t\t.join('-');\n\t} else {\n\t\trolesName = is(options.role, PgRole)\n\t\t\t? options.role.name\n\t\t\t: (options.role as string);\n\t}\n\n\treturn [\n\t\tread\n\t\t&& pgPolicy(`crud-${rolesName}-policy-select`, {\n\t\t\tfor: 'select',\n\t\t\tto: options.role,\n\t\t\tusing: read,\n\t\t}),\n\n\t\tmodify\n\t\t&& pgPolicy(`crud-${rolesName}-policy-insert`, {\n\t\t\tfor: 'insert',\n\t\t\tto: options.role,\n\t\t\twithCheck: modify,\n\t\t}),\n\t\tmodify\n\t\t&& pgPolicy(`crud-${rolesName}-policy-update`, {\n\t\t\tfor: 'update',\n\t\t\tto: options.role,\n\t\t\tusing: modify,\n\t\t\twithCheck: modify,\n\t\t}),\n\t\tmodify\n\t\t&& pgPolicy(`crud-${rolesName}-policy-delete`, {\n\t\t\tfor: 'delete',\n\t\t\tto: options.role,\n\t\t\tusing: modify,\n\t\t}),\n\t].filter(Boolean);\n};\n\n// These are default roles that Neon will set up.\nexport const authenticatedRole = pgRole('authenticated').existing();\nexport const anonymousRole = pgRole('anonymous').existing();\n\nexport const authUid = (userIdColumn: AnyPgColumn) => sql`(select auth.user_id() = ${userIdColumn})`;\n"],"mappings":"AAAA,SAAS,UAAU;AACnB,SAA2B,gBAAuC;AAClE,SAAS,QAAQ,cAAc;AAC/B,SAAmB,WAAW;AAWvB,MAAM,aAAa,CAAC,YAIrB;AACL,MAAI,QAAQ,SAAS,QAAW;AAC/B,UAAM,IAAI,MAAM,mCAAmC;AAAA,EACpD;AAEA,MAAI,QAAQ,WAAW,QAAW;AACjC,UAAM,IAAI,MAAM,qCAAqC;AAAA,EACtD;AAEA,MAAI;AACJ,MAAI,QAAQ,SAAS,MAAM;AAC1B,WAAO;AAAA,EACR,WAAW,QAAQ,SAAS,OAAO;AAClC,WAAO;AAAA,EACR,WAAW,QAAQ,SAAS,MAAM;AACjC,WAAO,QAAQ;AAAA,EAChB;AAEA,MAAI;AACJ,MAAI,QAAQ,WAAW,MAAM;AAC5B,aAAS;AAAA,EACV,WAAW,QAAQ,WAAW,OAAO;AACpC,aAAS;AAAA,EACV,WAAW,QAAQ,WAAW,MAAM;AACnC,aAAS,QAAQ;AAAA,EAClB;AAEA,MAAI,YAAY;AAChB,MAAI,MAAM,QAAQ,QAAQ,IAAI,GAAG;AAChC,gBAAY,QAAQ,KAClB,IAAI,CAAC,OAAO;AACZ,aAAO,GAAG,IAAI,MAAM,IAAI,GAAG,OAAQ;AAAA,IACpC,CAAC,EACA,KAAK,GAAG;AAAA,EACX,OAAO;AACN,gBAAY,GAAG,QAAQ,MAAM,MAAM,IAChC,QAAQ,KAAK,OACZ,QAAQ;AAAA,EACb;AAEA,SAAO;AAAA,IACN,QACG,SAAS,QAAQ,SAAS,kBAAkB;AAAA,MAC9C,KAAK;AAAA,MACL,IAAI,QAAQ;AAAA,MACZ,OAAO;AAAA,IACR,CAAC;AAAA,IAED,UACG,SAAS,QAAQ,SAAS,kBAAkB;AAAA,MAC9C,KAAK;AAAA,MACL,IAAI,QAAQ;AAAA,MACZ,WAAW;AAAA,IACZ,CAAC;AAAA,IACD,UACG,SAAS,QAAQ,SAAS,kBAAkB;AAAA,MAC9C,KAAK;AAAA,MACL,IAAI,QAAQ;AAAA,MACZ,OAAO;AAAA,MACP,WAAW;AAAA,IACZ,CAAC;AAAA,IACD,UACG,SAAS,QAAQ,SAAS,kBAAkB;AAAA,MAC9C,KAAK;AAAA,MACL,IAAI,QAAQ;AAAA,MACZ,OAAO;AAAA,IACR,CAAC;AAAA,EACF,EAAE,OAAO,OAAO;AACjB;AAGO,MAAM,oBAAoB,OAAO,eAAe,EAAE,SAAS;AAC3D,MAAM,gBAAgB,OAAO,WAAW,EAAE,SAAS;AAEnD,MAAM,UAAU,CAAC,iBAA8B,+BAA+B,YAAY;","names":[]}