@erikey/react 0.4.20 → 0.4.21
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/index.d.mts +46 -0
- package/dist/index.mjs +169 -3
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +8 -597
- package/dist/styles.css.map +1 -1
- package/dist/ui/index.mjs +3630 -18895
- package/dist/ui/index.mjs.map +1 -1
- package/package.json +2 -33
package/dist/index.d.mts
CHANGED
|
@@ -39,6 +39,52 @@ interface DashboardClientConfig {
|
|
|
39
39
|
* ```
|
|
40
40
|
*/
|
|
41
41
|
declare function createDashboardClient(config?: DashboardClientConfig): {
|
|
42
|
+
siwe: {
|
|
43
|
+
nonce: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
44
|
+
walletAddress: string;
|
|
45
|
+
chainId?: number;
|
|
46
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any>>>(data_0: better_auth.Prettify<{
|
|
47
|
+
walletAddress: string;
|
|
48
|
+
chainId?: number;
|
|
49
|
+
} & {
|
|
50
|
+
fetchOptions?: FetchOptions;
|
|
51
|
+
}>, data_1?: FetchOptions) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
52
|
+
nonce: string;
|
|
53
|
+
}, {
|
|
54
|
+
code?: string | undefined;
|
|
55
|
+
message?: string | undefined;
|
|
56
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
57
|
+
};
|
|
58
|
+
} & {
|
|
59
|
+
siwe: {
|
|
60
|
+
verify: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
61
|
+
message: string;
|
|
62
|
+
signature: string;
|
|
63
|
+
walletAddress: string;
|
|
64
|
+
chainId?: number;
|
|
65
|
+
email?: string;
|
|
66
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any>>>(data_0: better_auth.Prettify<{
|
|
67
|
+
message: string;
|
|
68
|
+
signature: string;
|
|
69
|
+
walletAddress: string;
|
|
70
|
+
chainId?: number;
|
|
71
|
+
email?: string;
|
|
72
|
+
} & {
|
|
73
|
+
fetchOptions?: FetchOptions;
|
|
74
|
+
}>, data_1?: FetchOptions) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
75
|
+
token: string;
|
|
76
|
+
success: boolean;
|
|
77
|
+
user: {
|
|
78
|
+
id: string;
|
|
79
|
+
walletAddress: string;
|
|
80
|
+
chainId: number;
|
|
81
|
+
};
|
|
82
|
+
}, {
|
|
83
|
+
code?: string | undefined;
|
|
84
|
+
message?: string | undefined;
|
|
85
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
86
|
+
};
|
|
87
|
+
} & {
|
|
42
88
|
signIn: {
|
|
43
89
|
social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
44
90
|
provider: "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {});
|
package/dist/index.mjs
CHANGED
|
@@ -1141,12 +1141,178 @@ function createAuthClient(options) {
|
|
|
1141
1141
|
}, $fetch, pluginPathMethods, pluginsAtoms, atomListeners);
|
|
1142
1142
|
}
|
|
1143
1143
|
|
|
1144
|
+
// ../../../node_modules/.pnpm/better-auth@1.4.10_drizzle-kit@0.31.8_drizzle-orm@0.45.1_@cloudflare+workers-types@4.20251119_hirg525kbrpwuqvxcih3czaike/node_modules/better-auth/dist/plugins/access/access.mjs
|
|
1145
|
+
function role(statements) {
|
|
1146
|
+
return {
|
|
1147
|
+
authorize(request, connector = "AND") {
|
|
1148
|
+
let success = false;
|
|
1149
|
+
for (const [requestedResource, requestedActions] of Object.entries(request)) {
|
|
1150
|
+
const allowedActions = statements[requestedResource];
|
|
1151
|
+
if (!allowedActions) return {
|
|
1152
|
+
success: false,
|
|
1153
|
+
error: `You are not allowed to access resource: ${requestedResource}`
|
|
1154
|
+
};
|
|
1155
|
+
if (Array.isArray(requestedActions)) success = requestedActions.every((requestedAction) => allowedActions.includes(requestedAction));
|
|
1156
|
+
else if (typeof requestedActions === "object") {
|
|
1157
|
+
const actions = requestedActions;
|
|
1158
|
+
if (actions.connector === "OR") success = actions.actions.some((requestedAction) => allowedActions.includes(requestedAction));
|
|
1159
|
+
else success = actions.actions.every((requestedAction) => allowedActions.includes(requestedAction));
|
|
1160
|
+
} else throw new BetterAuthError("Invalid access control request");
|
|
1161
|
+
if (success && connector === "OR") return { success };
|
|
1162
|
+
if (!success && connector === "AND") return {
|
|
1163
|
+
success: false,
|
|
1164
|
+
error: `unauthorized to access resource "${requestedResource}"`
|
|
1165
|
+
};
|
|
1166
|
+
}
|
|
1167
|
+
if (success) return { success };
|
|
1168
|
+
return {
|
|
1169
|
+
success: false,
|
|
1170
|
+
error: "Not authorized"
|
|
1171
|
+
};
|
|
1172
|
+
},
|
|
1173
|
+
statements
|
|
1174
|
+
};
|
|
1175
|
+
}
|
|
1176
|
+
function createAccessControl(s) {
|
|
1177
|
+
return {
|
|
1178
|
+
newRole(statements) {
|
|
1179
|
+
return role(statements);
|
|
1180
|
+
},
|
|
1181
|
+
statements: s
|
|
1182
|
+
};
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
// ../../../node_modules/.pnpm/better-auth@1.4.10_drizzle-kit@0.31.8_drizzle-orm@0.45.1_@cloudflare+workers-types@4.20251119_hirg525kbrpwuqvxcih3czaike/node_modules/better-auth/dist/plugins/admin/access/statement.mjs
|
|
1186
|
+
var defaultStatements = {
|
|
1187
|
+
user: [
|
|
1188
|
+
"create",
|
|
1189
|
+
"list",
|
|
1190
|
+
"set-role",
|
|
1191
|
+
"ban",
|
|
1192
|
+
"impersonate",
|
|
1193
|
+
"delete",
|
|
1194
|
+
"set-password",
|
|
1195
|
+
"get",
|
|
1196
|
+
"update"
|
|
1197
|
+
],
|
|
1198
|
+
session: [
|
|
1199
|
+
"list",
|
|
1200
|
+
"revoke",
|
|
1201
|
+
"delete"
|
|
1202
|
+
]
|
|
1203
|
+
};
|
|
1204
|
+
var defaultAc = createAccessControl(defaultStatements);
|
|
1205
|
+
var adminAc = defaultAc.newRole({
|
|
1206
|
+
user: [
|
|
1207
|
+
"create",
|
|
1208
|
+
"list",
|
|
1209
|
+
"set-role",
|
|
1210
|
+
"ban",
|
|
1211
|
+
"impersonate",
|
|
1212
|
+
"delete",
|
|
1213
|
+
"set-password",
|
|
1214
|
+
"get",
|
|
1215
|
+
"update"
|
|
1216
|
+
],
|
|
1217
|
+
session: [
|
|
1218
|
+
"list",
|
|
1219
|
+
"revoke",
|
|
1220
|
+
"delete"
|
|
1221
|
+
]
|
|
1222
|
+
});
|
|
1223
|
+
var userAc = defaultAc.newRole({
|
|
1224
|
+
user: [],
|
|
1225
|
+
session: []
|
|
1226
|
+
});
|
|
1227
|
+
|
|
1228
|
+
// ../../../node_modules/.pnpm/better-auth@1.4.10_drizzle-kit@0.31.8_drizzle-orm@0.45.1_@cloudflare+workers-types@4.20251119_hirg525kbrpwuqvxcih3czaike/node_modules/better-auth/dist/plugins/organization/access/statement.mjs
|
|
1229
|
+
var defaultStatements2 = {
|
|
1230
|
+
organization: ["update", "delete"],
|
|
1231
|
+
member: [
|
|
1232
|
+
"create",
|
|
1233
|
+
"update",
|
|
1234
|
+
"delete"
|
|
1235
|
+
],
|
|
1236
|
+
invitation: ["create", "cancel"],
|
|
1237
|
+
team: [
|
|
1238
|
+
"create",
|
|
1239
|
+
"update",
|
|
1240
|
+
"delete"
|
|
1241
|
+
],
|
|
1242
|
+
ac: [
|
|
1243
|
+
"create",
|
|
1244
|
+
"read",
|
|
1245
|
+
"update",
|
|
1246
|
+
"delete"
|
|
1247
|
+
]
|
|
1248
|
+
};
|
|
1249
|
+
var defaultAc2 = createAccessControl(defaultStatements2);
|
|
1250
|
+
var adminAc2 = defaultAc2.newRole({
|
|
1251
|
+
organization: ["update"],
|
|
1252
|
+
invitation: ["create", "cancel"],
|
|
1253
|
+
member: [
|
|
1254
|
+
"create",
|
|
1255
|
+
"update",
|
|
1256
|
+
"delete"
|
|
1257
|
+
],
|
|
1258
|
+
team: [
|
|
1259
|
+
"create",
|
|
1260
|
+
"update",
|
|
1261
|
+
"delete"
|
|
1262
|
+
],
|
|
1263
|
+
ac: [
|
|
1264
|
+
"create",
|
|
1265
|
+
"read",
|
|
1266
|
+
"update",
|
|
1267
|
+
"delete"
|
|
1268
|
+
]
|
|
1269
|
+
});
|
|
1270
|
+
var ownerAc = defaultAc2.newRole({
|
|
1271
|
+
organization: ["update", "delete"],
|
|
1272
|
+
member: [
|
|
1273
|
+
"create",
|
|
1274
|
+
"update",
|
|
1275
|
+
"delete"
|
|
1276
|
+
],
|
|
1277
|
+
invitation: ["create", "cancel"],
|
|
1278
|
+
team: [
|
|
1279
|
+
"create",
|
|
1280
|
+
"update",
|
|
1281
|
+
"delete"
|
|
1282
|
+
],
|
|
1283
|
+
ac: [
|
|
1284
|
+
"create",
|
|
1285
|
+
"read",
|
|
1286
|
+
"update",
|
|
1287
|
+
"delete"
|
|
1288
|
+
]
|
|
1289
|
+
});
|
|
1290
|
+
var memberAc = defaultAc2.newRole({
|
|
1291
|
+
organization: [],
|
|
1292
|
+
member: [],
|
|
1293
|
+
invitation: [],
|
|
1294
|
+
team: [],
|
|
1295
|
+
ac: ["read"]
|
|
1296
|
+
});
|
|
1297
|
+
|
|
1298
|
+
// ../../../node_modules/.pnpm/better-auth@1.4.10_drizzle-kit@0.31.8_drizzle-orm@0.45.1_@cloudflare+workers-types@4.20251119_hirg525kbrpwuqvxcih3czaike/node_modules/better-auth/dist/plugins/siwe/client.mjs
|
|
1299
|
+
var siweClient = () => {
|
|
1300
|
+
return {
|
|
1301
|
+
id: "siwe",
|
|
1302
|
+
$InferServerPlugin: {}
|
|
1303
|
+
};
|
|
1304
|
+
};
|
|
1305
|
+
|
|
1144
1306
|
// src/dashboard-client.ts
|
|
1145
1307
|
function createDashboardClient(config) {
|
|
1146
1308
|
const baseURL = config?.baseURL || "https://api.erikey.com";
|
|
1147
1309
|
return createAuthClient({
|
|
1148
1310
|
baseURL,
|
|
1149
|
-
credentials: config?.credentials || "include"
|
|
1311
|
+
credentials: config?.credentials || "include",
|
|
1312
|
+
plugins: [
|
|
1313
|
+
siweClient()
|
|
1314
|
+
// Enable Sign-In with Ethereum
|
|
1315
|
+
]
|
|
1150
1316
|
});
|
|
1151
1317
|
}
|
|
1152
1318
|
|
|
@@ -1195,7 +1361,7 @@ function clearToken(projectId) {
|
|
|
1195
1361
|
}
|
|
1196
1362
|
|
|
1197
1363
|
// src/auth-client.ts
|
|
1198
|
-
function
|
|
1364
|
+
function createAuthClient3(config) {
|
|
1199
1365
|
const { projectId, baseUrl = "https://auth.erikey.com" } = config;
|
|
1200
1366
|
const useBearerAuth = shouldUseBearerAuth(baseUrl);
|
|
1201
1367
|
const fetchOptions = {
|
|
@@ -1421,7 +1587,7 @@ function createKvClient(config) {
|
|
|
1421
1587
|
};
|
|
1422
1588
|
}
|
|
1423
1589
|
export {
|
|
1424
|
-
|
|
1590
|
+
createAuthClient3 as createAuthClient,
|
|
1425
1591
|
createDashboardClient,
|
|
1426
1592
|
createKvClient
|
|
1427
1593
|
};
|