Skip to content

Commit ab564a9

Browse files
authored
Merge pull request #20 from cnbrown04/role-creation
fix(build): fix a bunch of build errors
2 parents 71c941d + 519681c commit ab564a9

File tree

5 files changed

+19
-18
lines changed

5 files changed

+19
-18
lines changed

src/abac/adapter.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Kysely, Dialect, MysqlPool } from "kysely";
2-
import { Database } from "./database-types";
1+
import { Kysely, type Dialect } from "kysely";
2+
import { type Database } from "./database-types";
33

44
// Type definitions for dynamic imports
55
interface PostgresPoolConfig {
@@ -12,8 +12,6 @@ interface PostgresPool {
1212
new (config: PostgresPoolConfig): any;
1313
}
1414

15-
type DatabaseType = "mysql" | "postgres" | "sqlite";
16-
1715
interface BaseDbConfig {
1816
uri: string;
1917
connectionLimit?: number;

src/abac/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BetterAuthClientPlugin } from "better-auth";
1+
import { type BetterAuthClientPlugin } from "better-auth";
22
import { abac } from "./index";
33

44
const abacClient = () => {

src/abac/funcs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ function findAttributeByName(
842842
attributeName: string,
843843
attributes: Map<string, AttributeValue>
844844
): AttributeValue | undefined {
845-
for (const [key, value] of attributes) {
845+
for (const [_, value] of attributes) {
846846
if (value.name === attributeName) {
847847
return value;
848848
}

src/abac/index.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import {
77
canUserPerformActionOnResources,
88
canUserRead,
99
canUserWrite,
10-
AuthorizationRequest,
11-
AuthorizationResult,
12-
AttributeValue,
13-
PolicyEvaluation,
14-
PolicyWithRules,
10+
type AuthorizationRequest,
11+
type AuthorizationResult,
12+
type AttributeValue,
13+
type PolicyEvaluation,
14+
type PolicyWithRules,
1515
} from "./funcs";
1616
import { Kysely } from "kysely";
17-
import { Database } from "./database-types";
17+
import { type Database } from "./database-types";
1818
import { abacClient } from "./client";
1919
import { createAbacAdapter } from "./adapter";
2020

@@ -503,7 +503,7 @@ const abac = (db: Kysely<Database>, debugLogs: boolean) => {
503503
},
504504
},
505505

506-
onRequest: async (req, ctx) => {
506+
onRequest: async (req) => {
507507
const url = new URL(req.url);
508508
const path = url.pathname;
509509

@@ -784,7 +784,7 @@ const abac = (db: Kysely<Database>, debugLogs: boolean) => {
784784
{
785785
method: "GET",
786786
},
787-
async (ctx) => {
787+
async () => {
788788
try {
789789
return {
790790
message: "ABAC plugin is working!",

tsconfig.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
{
22
"compilerOptions": {
33
"target": "ES2020",
4-
"outDir": "./dist",
5-
"module": "CommonJS",
6-
"rootDir": "./src/abac",
4+
"module": "preserve",
5+
"moduleResolution": "bundler",
6+
7+
// custom
78
"declaration": true,
89
"strict": true,
910
"esModuleInterop": true,
10-
"skipLibCheck": true
11+
"skipLibCheck": true,
12+
"outDir": "./dist",
13+
"rootDir": "./src/abac"
1114
},
1215
"include": ["src/abac/**/*"],
1316
"exclude": ["node_modules", "dist"]

0 commit comments

Comments
 (0)