@crossauth/sveltekit 0.0.17 → 0.0.20
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.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1588 -1584
- package/dist/sveltekitadminclientendpoints.d.ts +17 -16
- package/dist/sveltekitadminendpoints.d.ts +21 -20
- package/dist/sveltekitapikey.d.ts +3 -3
- package/dist/sveltekitoauthclient.d.ts +17 -19
- package/dist/sveltekitoauthserver.d.ts +14 -14
- package/dist/sveltekitresserver.d.ts +5 -4
- package/dist/sveltekitserver.d.ts +9 -8
- package/dist/sveltekitsession.d.ts +5 -5
- package/dist/sveltekitsessionadapter.d.ts +2 -3
- package/dist/sveltekitsharedclientendpoints.d.ts +8 -7
- package/dist/sveltekituserclientendpoints.d.ts +17 -16
- package/dist/sveltekituserendpoints.d.ts +37 -36
- package/dist/tests/sveltekitoauthclient.test.d.ts +6 -6
- package/dist/tests/sveltekitoauthresserver.test.d.ts +5 -5
- package/dist/tests/sveltemocks.d.ts +2 -3
- package/dist/tests/testshared.d.ts +8 -8
- package/dist/utils.d.ts +1 -2
- package/package.json +4 -3
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { SveltekitEndpoint } from './sveltekitserver';
|
|
2
|
-
import { SvelteKitSessionServer
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { type SveltekitEndpoint } from './sveltekitserver';
|
|
2
|
+
import { SvelteKitSessionServer } from './sveltekitsession';
|
|
3
|
+
import type { SvelteKitSessionServerOptions } from './sveltekitsession';
|
|
4
|
+
import type { User, UserInputFields } from '@crossauth/common';
|
|
5
|
+
import { ErrorCode } from '@crossauth/common';
|
|
6
|
+
import type { RequestEvent } from '@sveltejs/kit';
|
|
6
7
|
/**
|
|
7
8
|
* Return type for {@link SvelteKitUserEndpoints.login},
|
|
8
9
|
* {@link SvelteKitUserEndpoints.loginFactor2} and the
|
|
@@ -305,7 +306,7 @@ export declare class SvelteKitUserEndpoints {
|
|
|
305
306
|
* @param event the SvelteKit request event
|
|
306
307
|
* @returns true or false
|
|
307
308
|
*/
|
|
308
|
-
canEditUser(event: RequestEvent):
|
|
309
|
+
canEditUser(event: RequestEvent): any;
|
|
309
310
|
/**
|
|
310
311
|
* Log a user in if possible.
|
|
311
312
|
*
|
|
@@ -627,13 +628,13 @@ export declare class SvelteKitUserEndpoints {
|
|
|
627
628
|
*/
|
|
628
629
|
reconfigureFactor2(event: RequestEvent): Promise<ChangeFactor2Return>;
|
|
629
630
|
baseEndpoint(event: RequestEvent): {
|
|
630
|
-
user:
|
|
631
|
-
csrfToken:
|
|
631
|
+
user: any;
|
|
632
|
+
csrfToken: any;
|
|
632
633
|
};
|
|
633
634
|
readonly signupEndpoint: {
|
|
634
635
|
load: (event: RequestEvent) => Promise<{
|
|
635
|
-
user:
|
|
636
|
-
csrfToken:
|
|
636
|
+
user: any;
|
|
637
|
+
csrfToken: any;
|
|
637
638
|
allowedFactor2: {
|
|
638
639
|
name: string;
|
|
639
640
|
friendlyName: string;
|
|
@@ -646,9 +647,9 @@ export declare class SvelteKitUserEndpoints {
|
|
|
646
647
|
};
|
|
647
648
|
readonly loginEndpoint: {
|
|
648
649
|
load: (event: RequestEvent) => Promise<{
|
|
649
|
-
user:
|
|
650
|
-
csrfToken:
|
|
651
|
-
next:
|
|
650
|
+
user: any;
|
|
651
|
+
csrfToken: any;
|
|
652
|
+
next: any;
|
|
652
653
|
}>;
|
|
653
654
|
actions: {
|
|
654
655
|
login: (event: RequestEvent) => Promise<LoginReturn>;
|
|
@@ -663,8 +664,8 @@ export declare class SvelteKitUserEndpoints {
|
|
|
663
664
|
default: (event: RequestEvent) => Promise<LogoutReturn>;
|
|
664
665
|
};
|
|
665
666
|
load: (event: RequestEvent) => Promise<{
|
|
666
|
-
user:
|
|
667
|
-
csrfToken:
|
|
667
|
+
user: any;
|
|
668
|
+
csrfToken: any;
|
|
668
669
|
}>;
|
|
669
670
|
};
|
|
670
671
|
readonly changeFactor2Endpoint: {
|
|
@@ -673,9 +674,9 @@ export declare class SvelteKitUserEndpoints {
|
|
|
673
674
|
reconfigure: (event: RequestEvent) => Promise<ChangeFactor2Return>;
|
|
674
675
|
};
|
|
675
676
|
load: (event: RequestEvent) => Promise<{
|
|
676
|
-
user:
|
|
677
|
-
csrfToken:
|
|
678
|
-
username:
|
|
677
|
+
user: any;
|
|
678
|
+
csrfToken: any;
|
|
679
|
+
username: any;
|
|
679
680
|
required?: boolean | undefined;
|
|
680
681
|
next?: string | undefined;
|
|
681
682
|
allowedFactor2: {
|
|
@@ -690,8 +691,8 @@ export declare class SvelteKitUserEndpoints {
|
|
|
690
691
|
default: (event: RequestEvent) => Promise<ChangePasswordReturn>;
|
|
691
692
|
};
|
|
692
693
|
load: (event: RequestEvent) => Promise<{
|
|
693
|
-
user:
|
|
694
|
-
csrfToken:
|
|
694
|
+
user: any;
|
|
695
|
+
csrfToken: any;
|
|
695
696
|
required?: boolean | undefined;
|
|
696
697
|
next?: string | undefined;
|
|
697
698
|
}>;
|
|
@@ -701,8 +702,8 @@ export declare class SvelteKitUserEndpoints {
|
|
|
701
702
|
default: (event: RequestEvent) => Promise<ConfigureFactor2Return>;
|
|
702
703
|
};
|
|
703
704
|
load: (event: RequestEvent) => Promise<{
|
|
704
|
-
user:
|
|
705
|
-
csrfToken:
|
|
705
|
+
user: any;
|
|
706
|
+
csrfToken: any;
|
|
706
707
|
}>;
|
|
707
708
|
};
|
|
708
709
|
readonly deleteUserEndpoint: {
|
|
@@ -710,8 +711,8 @@ export declare class SvelteKitUserEndpoints {
|
|
|
710
711
|
default: (event: RequestEvent) => Promise<DeleteUserReturn>;
|
|
711
712
|
};
|
|
712
713
|
load: (event: RequestEvent) => Promise<{
|
|
713
|
-
user:
|
|
714
|
-
csrfToken:
|
|
714
|
+
user: any;
|
|
715
|
+
csrfToken: any;
|
|
715
716
|
}>;
|
|
716
717
|
};
|
|
717
718
|
readonly resetPasswordEndpoint: {
|
|
@@ -719,8 +720,8 @@ export declare class SvelteKitUserEndpoints {
|
|
|
719
720
|
default: (event: RequestEvent) => Promise<RequestPasswordResetReturn>;
|
|
720
721
|
};
|
|
721
722
|
load: (event: RequestEvent) => Promise<{
|
|
722
|
-
user:
|
|
723
|
-
csrfToken:
|
|
723
|
+
user: any;
|
|
724
|
+
csrfToken: any;
|
|
724
725
|
required?: boolean | undefined;
|
|
725
726
|
next?: string | undefined;
|
|
726
727
|
}>;
|
|
@@ -728,14 +729,14 @@ export declare class SvelteKitUserEndpoints {
|
|
|
728
729
|
readonly passwordResetTokenEndpoint: {
|
|
729
730
|
actions: {
|
|
730
731
|
default: (event: RequestEvent) => Promise<ResetPasswordReturn | {
|
|
731
|
-
user:
|
|
732
|
-
csrfToken:
|
|
732
|
+
user: any;
|
|
733
|
+
csrfToken: any;
|
|
733
734
|
ok: boolean;
|
|
734
735
|
tokenValidated: boolean;
|
|
735
736
|
error: string;
|
|
736
737
|
} | {
|
|
737
|
-
user:
|
|
738
|
-
csrfToken:
|
|
738
|
+
user: any;
|
|
739
|
+
csrfToken: any;
|
|
739
740
|
ok: boolean;
|
|
740
741
|
tokenValidated: boolean;
|
|
741
742
|
error: string | undefined;
|
|
@@ -744,17 +745,17 @@ export declare class SvelteKitUserEndpoints {
|
|
|
744
745
|
}>;
|
|
745
746
|
};
|
|
746
747
|
load: (event: RequestEvent) => Promise<{
|
|
747
|
-
user:
|
|
748
|
-
csrfToken:
|
|
748
|
+
user: any;
|
|
749
|
+
csrfToken: any;
|
|
749
750
|
tokenValidated: boolean;
|
|
750
751
|
error: string | undefined;
|
|
751
752
|
} | {
|
|
752
|
-
user:
|
|
753
|
-
csrfToken:
|
|
753
|
+
user: any;
|
|
754
|
+
csrfToken: any;
|
|
754
755
|
tokenValidated: boolean;
|
|
755
756
|
} | {
|
|
756
|
-
user:
|
|
757
|
-
csrfToken:
|
|
757
|
+
user: any;
|
|
758
|
+
csrfToken: any;
|
|
758
759
|
tokenValidated: boolean;
|
|
759
760
|
error: string;
|
|
760
761
|
errorCode: ErrorCode;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export declare function oauthLogin(options?: {}): Promise<{
|
|
2
|
-
server: import(
|
|
3
|
-
authServer: import(
|
|
4
|
-
sessionCookieValue:
|
|
2
|
+
server: import("..").SvelteKitServer;
|
|
3
|
+
authServer: import("@crossauth/backend").OAuthAuthorizationServer;
|
|
4
|
+
sessionCookieValue: any;
|
|
5
5
|
sessionId: string | undefined;
|
|
6
6
|
access_token: any;
|
|
7
7
|
refresh_token: any;
|
|
8
|
-
keyStorage: import(
|
|
9
|
-
userStorage: import(
|
|
10
|
-
clientStorage: import(
|
|
8
|
+
keyStorage: import("@crossauth/backend").InMemoryKeyStorage;
|
|
9
|
+
userStorage: import("@crossauth/backend").InMemoryUserStorage;
|
|
10
|
+
clientStorage: import("@crossauth/backend").InMemoryOAuthClientStorage;
|
|
11
11
|
}>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare function oauthLogin(): Promise<{
|
|
2
|
-
server: import(
|
|
3
|
-
authServer: import(
|
|
4
|
-
sessionCookieValue:
|
|
2
|
+
server: import("..").SvelteKitServer;
|
|
3
|
+
authServer: import("@crossauth/backend").OAuthAuthorizationServer;
|
|
4
|
+
sessionCookieValue: any;
|
|
5
5
|
sessionId: string | undefined;
|
|
6
6
|
access_token: any;
|
|
7
7
|
refresh_token: any;
|
|
8
|
-
keyStorage: import(
|
|
9
|
-
userStorage: import(
|
|
8
|
+
keyStorage: import("@crossauth/backend").InMemoryKeyStorage;
|
|
9
|
+
userStorage: import("@crossauth/backend").InMemoryUserStorage;
|
|
10
10
|
}>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Cookies, RequestEvent, MaybePromise, ResolveOptions } from '@sveltejs/kit';
|
|
2
|
-
import { CookieParseOptions, CookieSerializeOptions } from 'cookie';
|
|
3
|
-
|
|
1
|
+
import { type Cookies, type RequestEvent, type MaybePromise, type ResolveOptions } from '@sveltejs/kit';
|
|
2
|
+
import { type CookieParseOptions, type CookieSerializeOptions } from 'cookie';
|
|
4
3
|
export declare class MockCookies implements Cookies {
|
|
5
4
|
cookies: {
|
|
6
5
|
[key: string]: {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { MockResolver, MockRequestEvent } from './sveltemocks';
|
|
2
2
|
import { SvelteKitServer } from '../sveltekitserver';
|
|
3
|
-
import { OAuthAuthorizationServer
|
|
4
|
-
import { OpenIdConfiguration, OAuthClient } from '@crossauth/common';
|
|
5
|
-
import {
|
|
6
|
-
|
|
3
|
+
import { OAuthAuthorizationServer } from '@crossauth/backend';
|
|
4
|
+
import { type OpenIdConfiguration, type OAuthClient } from '@crossauth/common';
|
|
5
|
+
import { InMemoryKeyStorage, InMemoryUserStorage, InMemoryOAuthClientStorage, LocalPasswordAuthenticator, ApiKeyManager } from '@crossauth/backend';
|
|
6
|
+
import type { Handle } from '@sveltejs/kit';
|
|
7
7
|
export declare const oidcConfiguration: OpenIdConfiguration;
|
|
8
8
|
export declare function createUsers(userStorage: InMemoryUserStorage): Promise<void>;
|
|
9
9
|
export declare function createSession(userid: string, userStorage: InMemoryUserStorage, keyStorage: InMemoryKeyStorage, options?: {}): Promise<{
|
|
10
|
-
key: import(
|
|
11
|
-
cookie: import(
|
|
10
|
+
key: import("@crossauth/common").Key;
|
|
11
|
+
cookie: import("@crossauth/backend").Cookie;
|
|
12
12
|
}>;
|
|
13
13
|
export declare function createClients(clientStorage: InMemoryOAuthClientStorage, secretRequired?: boolean): Promise<OAuthClient>;
|
|
14
14
|
export declare function makeServer(makeSession?: boolean, makeApiKey?: boolean, makeOAuthServer?: boolean, makeOAuthClient?: boolean, options?: {}): Promise<{
|
|
@@ -32,13 +32,13 @@ export declare function login(server: SvelteKitServer, resolver: MockResolver, h
|
|
|
32
32
|
event: MockRequestEvent<{
|
|
33
33
|
param1: string;
|
|
34
34
|
}, "1">;
|
|
35
|
-
ret: import(
|
|
35
|
+
ret: import("..").LoginReturn | undefined;
|
|
36
36
|
}>;
|
|
37
37
|
export declare function loginFactor2(server: SvelteKitServer, resolver: MockResolver, handle: Handle, sessionCookieValue: string, sessionId: string): Promise<{
|
|
38
38
|
event: MockRequestEvent<{
|
|
39
39
|
param1: string;
|
|
40
40
|
}, "1">;
|
|
41
|
-
ret: import(
|
|
41
|
+
ret: import("..").LoginReturn | undefined;
|
|
42
42
|
}>;
|
|
43
43
|
export declare function getAuthServer({ aud, persistAccessToken, emptyScopeIsValid, secretRequired, rollingRefreshToken, }?: {
|
|
44
44
|
challenge?: boolean;
|
package/dist/utils.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crossauth/sveltekit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -46,10 +46,11 @@
|
|
|
46
46
|
"minimatch": "^10.0.1",
|
|
47
47
|
"qrcode": "^1.5.4",
|
|
48
48
|
"vite-plugin-dts": "^3.6.4",
|
|
49
|
-
"@crossauth/backend": "^0.0.
|
|
50
|
-
"@crossauth/common": "^0.0.
|
|
49
|
+
"@crossauth/backend": "^0.0.20",
|
|
50
|
+
"@crossauth/common": "^0.0.20"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
|
+
"preparex": "svelte-kit sync",
|
|
53
54
|
"dev": "vite dev",
|
|
54
55
|
"build": "vite build",
|
|
55
56
|
"preview": "vite preview",
|