@podosoft/podokit-api-client 0.10.2 → 0.10.3
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/README.md +1 -1
- package/dist/index.d.ts +18 -4
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -84,7 +84,7 @@ also re-exported so account UIs can display the exact limits enforced by the API
|
|
|
84
84
|
|
|
85
85
|
## Authentication upgrades
|
|
86
86
|
|
|
87
|
-
The client requires Better Auth 1.7.
|
|
87
|
+
The client requires Better Auth 1.7.17 or newer within the 1.x release line, with
|
|
88
88
|
matching API key and passkey plugins. Upgrade the backend and its integrations
|
|
89
89
|
together. The 1.7.7 security update changes verification-record namespaces and
|
|
90
90
|
OAuth state encryption; pending Magic Links and OAuth/SAML sign-ins must be
|
package/dist/index.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ export declare function createApiClient(options?: ApiClientOptions): {
|
|
|
73
73
|
$InferServerPlugin: {
|
|
74
74
|
id: "admin";
|
|
75
75
|
version: string;
|
|
76
|
-
init(): {
|
|
76
|
+
init(authContext: import("better-auth").AuthContext): {
|
|
77
77
|
options: {
|
|
78
78
|
databaseHooks: {
|
|
79
79
|
user: {
|
|
@@ -880,7 +880,7 @@ export declare function createApiClient(options?: ApiClientOptions): {
|
|
|
880
880
|
$Infer: {
|
|
881
881
|
body: {
|
|
882
882
|
permissions: {
|
|
883
|
-
readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "get" | "update")[] | undefined;
|
|
883
|
+
readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "set-phone" | "get" | "update")[] | undefined;
|
|
884
884
|
readonly session?: ("list" | "delete" | "revoke")[] | undefined;
|
|
885
885
|
};
|
|
886
886
|
} & {
|
|
@@ -917,7 +917,9 @@ export declare function createApiClient(options?: ApiClientOptions): {
|
|
|
917
917
|
YOU_CANNOT_IMPERSONATE_ADMINS: import("better-auth").RawError<"YOU_CANNOT_IMPERSONATE_ADMINS">;
|
|
918
918
|
INVALID_ROLE_TYPE: import("better-auth").RawError<"INVALID_ROLE_TYPE">;
|
|
919
919
|
YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL">;
|
|
920
|
+
YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PHONE_NUMBER: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PHONE_NUMBER">;
|
|
920
921
|
PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER: import("better-auth").RawError<"PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER">;
|
|
922
|
+
USER_ID_CANNOT_BE_UPDATED: import("better-auth").RawError<"USER_ID_CANNOT_BE_UPDATED">;
|
|
921
923
|
};
|
|
922
924
|
schema: {
|
|
923
925
|
user: {
|
|
@@ -957,7 +959,7 @@ export declare function createApiClient(options?: ApiClientOptions): {
|
|
|
957
959
|
};
|
|
958
960
|
options: NoInfer<{
|
|
959
961
|
ac: import("better-auth/plugins").AccessControl<{
|
|
960
|
-
readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "impersonate-admins", "delete", "set-password", "set-email", "get", "update"];
|
|
962
|
+
readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "impersonate-admins", "delete", "set-password", "set-email", "set-phone", "get", "update"];
|
|
961
963
|
readonly session: readonly ["list", "revoke", "delete"];
|
|
962
964
|
}>;
|
|
963
965
|
roles: {
|
|
@@ -970,7 +972,7 @@ export declare function createApiClient(options?: ApiClientOptions): {
|
|
|
970
972
|
admin: {
|
|
971
973
|
checkRolePermission: <R extends "user" | "admin">(data: {
|
|
972
974
|
permissions: {
|
|
973
|
-
readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "get" | "update")[] | undefined;
|
|
975
|
+
readonly user?: ("create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "delete" | "set-password" | "set-email" | "set-phone" | "get" | "update")[] | undefined;
|
|
974
976
|
readonly session?: ("list" | "delete" | "revoke")[] | undefined;
|
|
975
977
|
};
|
|
976
978
|
} & {
|
|
@@ -1010,7 +1012,9 @@ export declare function createApiClient(options?: ApiClientOptions): {
|
|
|
1010
1012
|
YOU_CANNOT_IMPERSONATE_ADMINS: import("better-auth").RawError<"YOU_CANNOT_IMPERSONATE_ADMINS">;
|
|
1011
1013
|
INVALID_ROLE_TYPE: import("better-auth").RawError<"INVALID_ROLE_TYPE">;
|
|
1012
1014
|
YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL">;
|
|
1015
|
+
YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PHONE_NUMBER: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PHONE_NUMBER">;
|
|
1013
1016
|
PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER: import("better-auth").RawError<"PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER">;
|
|
1017
|
+
USER_ID_CANNOT_BE_UPDATED: import("better-auth").RawError<"USER_ID_CANNOT_BE_UPDATED">;
|
|
1014
1018
|
};
|
|
1015
1019
|
} | {
|
|
1016
1020
|
id: "two-factor";
|
|
@@ -1325,7 +1329,9 @@ export declare function createApiClient(options?: ApiClientOptions): {
|
|
|
1325
1329
|
UNEXPECTED_ERROR: import("better-auth").RawError<"UNEXPECTED_ERROR">;
|
|
1326
1330
|
OTP_NOT_FOUND: import("better-auth").RawError<"OTP_NOT_FOUND">;
|
|
1327
1331
|
PHONE_NUMBER_NOT_VERIFIED: import("better-auth").RawError<"PHONE_NUMBER_NOT_VERIFIED">;
|
|
1332
|
+
PHONE_NUMBER_PENDING_VERIFICATION: import("better-auth").RawError<"PHONE_NUMBER_PENDING_VERIFICATION">;
|
|
1328
1333
|
PHONE_NUMBER_CANNOT_BE_UPDATED: import("better-auth").RawError<"PHONE_NUMBER_CANNOT_BE_UPDATED">;
|
|
1334
|
+
PHONE_NUMBER_CANNOT_BE_SET: import("better-auth").RawError<"PHONE_NUMBER_CANNOT_BE_SET">;
|
|
1329
1335
|
SEND_OTP_NOT_IMPLEMENTED: import("better-auth").RawError<"SEND_OTP_NOT_IMPLEMENTED">;
|
|
1330
1336
|
};
|
|
1331
1337
|
} | {
|
|
@@ -2526,6 +2532,11 @@ export declare function createApiClient(options?: ApiClientOptions): {
|
|
|
2526
2532
|
$InferServerPlugin: ReturnType<(options?: import("@better-auth/passkey/client").PasskeyOptions | undefined) => {
|
|
2527
2533
|
id: "passkey";
|
|
2528
2534
|
version: string;
|
|
2535
|
+
init(ctx: import("better-auth").AuthContext): {
|
|
2536
|
+
context: {
|
|
2537
|
+
passkeyBaseURLFromRequest: boolean;
|
|
2538
|
+
};
|
|
2539
|
+
};
|
|
2529
2540
|
endpoints: {
|
|
2530
2541
|
generatePasskeyRegistrationOptions: import("better-call").StrictEndpoint<"/passkey/generate-register-options", {
|
|
2531
2542
|
method: "GET";
|
|
@@ -3099,6 +3110,7 @@ export declare function createApiClient(options?: ApiClientOptions): {
|
|
|
3099
3110
|
};
|
|
3100
3111
|
};
|
|
3101
3112
|
$ERROR_CODES: {
|
|
3113
|
+
ORIGIN_NOT_CONFIGURED: import("better-auth").RawError<"ORIGIN_NOT_CONFIGURED">;
|
|
3102
3114
|
CHALLENGE_NOT_FOUND: import("better-auth").RawError<"CHALLENGE_NOT_FOUND">;
|
|
3103
3115
|
YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
|
|
3104
3116
|
FAILED_TO_VERIFY_REGISTRATION: import("better-auth").RawError<"FAILED_TO_VERIFY_REGISTRATION">;
|
|
@@ -3231,6 +3243,7 @@ export declare function createApiClient(options?: ApiClientOptions): {
|
|
|
3231
3243
|
signal: "$sessionSignal";
|
|
3232
3244
|
})[];
|
|
3233
3245
|
$ERROR_CODES: {
|
|
3246
|
+
ORIGIN_NOT_CONFIGURED: import("better-auth").RawError<"ORIGIN_NOT_CONFIGURED">;
|
|
3234
3247
|
CHALLENGE_NOT_FOUND: import("better-auth").RawError<"CHALLENGE_NOT_FOUND">;
|
|
3235
3248
|
YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
|
|
3236
3249
|
FAILED_TO_VERIFY_REGISTRATION: import("better-auth").RawError<"FAILED_TO_VERIFY_REGISTRATION">;
|
|
@@ -3473,6 +3486,7 @@ export declare function createApiClient(options?: ApiClientOptions): {
|
|
|
3473
3486
|
EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION: import("better-auth").RawError<"EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION">;
|
|
3474
3487
|
EMAIL_VERIFICATION_REQUIRED_FOR_INVITATION: import("better-auth").RawError<"EMAIL_VERIFICATION_REQUIRED_FOR_INVITATION">;
|
|
3475
3488
|
YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION">;
|
|
3489
|
+
YOU_ARE_NOT_ALLOWED_TO_LIST_INVITATIONS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_INVITATIONS">;
|
|
3476
3490
|
INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION: import("better-auth").RawError<"INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION">;
|
|
3477
3491
|
YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE">;
|
|
3478
3492
|
FAILED_TO_RETRIEVE_INVITATION: import("better-auth").RawError<"FAILED_TO_RETRIEVE_INVITATION">;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@podosoft/podokit-api-client",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.3",
|
|
4
4
|
"description": "Typed API client for PodoKit backends: better-auth (auth + admin) plus a standard error-envelope request layer.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@podosoft/podokit-contracts": "^0.7.0",
|
|
33
|
-
"better-auth": "^1.7.
|
|
34
|
-
"@better-auth/api-key": "^1.7.
|
|
35
|
-
"@better-auth/passkey": "^1.7.
|
|
33
|
+
"better-auth": "^1.7.17",
|
|
34
|
+
"@better-auth/api-key": "^1.7.17",
|
|
35
|
+
"@better-auth/passkey": "^1.7.17"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "tsc -p tsconfig.json",
|