@leancodepl/kratos 7.8.2 → 8.1.0
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/index.cjs.js +383 -395
- package/index.esm.js +380 -386
- package/package.json +10 -3
- package/src/lib/flows/useLoginFlow.d.ts +10 -2
- package/src/lib/flows/useRecoveryFlow.d.ts +9 -2
- package/src/lib/flows/useRegistrationFlow.d.ts +9 -2
- package/src/lib/flows/useSettingsFlow.d.ts +9 -2
- package/src/lib/flows/useVerificationFlow.d.ts +9 -1
- package/src/lib/kratosContext.d.ts +0 -1
- package/src/lib/utils/filterNodesByGroups.d.ts +3 -3
- package/src/lib/utils/variables.d.ts +1 -0
- package/src/lib/utils/parseSearchParams.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leancodepl/kratos",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.1.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@ory/client": ">=1.14.3",
|
|
7
7
|
"axios": ">=1.6.0",
|
|
8
8
|
"lodash": ">=4.0.0",
|
|
9
9
|
"react-intl": ">=6.0.0",
|
|
10
|
-
"react-router": ">=6.0.0",
|
|
11
10
|
"rxjs": ">=7.0.0",
|
|
12
11
|
"yn": ">=5.0.0"
|
|
13
12
|
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"react": "18.3.1"
|
|
15
|
+
},
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"react": "*"
|
|
18
|
+
},
|
|
14
19
|
"exports": {
|
|
15
20
|
"./package.json": "./package.json",
|
|
16
21
|
".": {
|
|
17
22
|
"module": "./index.esm.js",
|
|
23
|
+
"types": "./index.esm.d.ts",
|
|
18
24
|
"import": "./index.cjs.mjs",
|
|
19
25
|
"default": "./index.cjs.js"
|
|
20
26
|
}
|
|
21
27
|
},
|
|
22
28
|
"module": "./index.esm.js",
|
|
23
|
-
"main": "./index.cjs.js"
|
|
29
|
+
"main": "./index.cjs.js",
|
|
30
|
+
"types": "./index.esm.d.ts"
|
|
24
31
|
}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { FrontendApi, LoginFlow, Session, UpdateLoginFlowBody } from "@ory/client";
|
|
2
|
-
|
|
2
|
+
import { aalParameterName, flowIdParameterName, refreshParameterName, returnToParameterName } from "../utils/variables";
|
|
3
|
+
export type LoginSearchParams = {
|
|
4
|
+
[flowIdParameterName]?: string;
|
|
5
|
+
[returnToParameterName]?: string;
|
|
6
|
+
[refreshParameterName]?: string;
|
|
7
|
+
[aalParameterName]?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function useLoginFlow({ kratosClient, returnTo, onLoggedIn, onSessionAlreadyAvailable, searchParams, updateSearchParams, }: {
|
|
3
10
|
kratosClient: FrontendApi;
|
|
4
|
-
loginRoute: string;
|
|
5
11
|
returnTo?: string;
|
|
6
12
|
onLoggedIn?: (session: Session) => void;
|
|
7
13
|
onSessionAlreadyAvailable?: () => void;
|
|
14
|
+
updateSearchParams: (searchParams: LoginSearchParams) => void;
|
|
15
|
+
searchParams?: LoginSearchParams;
|
|
8
16
|
}): {
|
|
9
17
|
flow: LoginFlow | undefined;
|
|
10
18
|
submit: ({ body }: {
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { ContinueWith, FrontendApi, RecoveryFlow, UpdateRecoveryFlowBody } from "@ory/client";
|
|
2
|
-
|
|
2
|
+
import { flowIdParameterName, returnToParameterName } from "../utils/variables";
|
|
3
|
+
type RecoveryFlowSearchParams = {
|
|
4
|
+
[flowIdParameterName]?: string;
|
|
5
|
+
[returnToParameterName]?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function useRecoveryFlow({ kratosClient, onSessionAlreadyAvailable, onContinueWith, searchParams, updateSearchParams, }: {
|
|
3
8
|
kratosClient: FrontendApi;
|
|
4
|
-
recoveryRoute: string;
|
|
5
9
|
onSessionAlreadyAvailable: () => void;
|
|
6
10
|
onContinueWith?: (continueWith: ContinueWith[]) => void;
|
|
11
|
+
searchParams?: RecoveryFlowSearchParams;
|
|
12
|
+
updateSearchParams: (searchParams: RecoveryFlowSearchParams) => void;
|
|
7
13
|
}): {
|
|
8
14
|
flow: RecoveryFlow | undefined;
|
|
9
15
|
submit: ({ body }: {
|
|
@@ -11,3 +17,4 @@ export declare function useRecoveryFlow({ kratosClient, recoveryRoute, onSession
|
|
|
11
17
|
}) => Promise<unknown> | undefined;
|
|
12
18
|
isRecovering: boolean;
|
|
13
19
|
};
|
|
20
|
+
export {};
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { ContinueWith, FrontendApi, RegistrationFlow, UpdateRegistrationFlowBody } from "@ory/client";
|
|
2
|
-
|
|
2
|
+
import { flowIdParameterName, returnToParameterName } from "../utils/variables";
|
|
3
|
+
type RegistrationFlowSearchParams = {
|
|
4
|
+
[flowIdParameterName]?: string;
|
|
5
|
+
[returnToParameterName]?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function useRegisterFlow({ kratosClient, onSessionAlreadyAvailable, onContinueWith, searchParams, updateSearchParams, }: {
|
|
3
8
|
kratosClient: FrontendApi;
|
|
4
|
-
registrationRoute: string;
|
|
5
9
|
onSessionAlreadyAvailable: () => void;
|
|
6
10
|
onContinueWith?: (continueWith: ContinueWith[]) => void;
|
|
11
|
+
searchParams?: RegistrationFlowSearchParams;
|
|
12
|
+
updateSearchParams: (searchParams: RegistrationFlowSearchParams) => void;
|
|
7
13
|
}): {
|
|
8
14
|
flow: RegistrationFlow | undefined;
|
|
9
15
|
submit: ({ body }: {
|
|
@@ -11,3 +17,4 @@ export declare function useRegisterFlow({ kratosClient, registrationRoute, onSes
|
|
|
11
17
|
}) => Promise<unknown> | undefined;
|
|
12
18
|
isRegistered: boolean;
|
|
13
19
|
};
|
|
20
|
+
export {};
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { ContinueWith, FrontendApi, SettingsFlow, UpdateSettingsFlowBody } from "@ory/client";
|
|
2
2
|
import { AxiosRequestConfig } from "axios";
|
|
3
|
-
|
|
3
|
+
import { flowIdParameterName, returnToParameterName } from "../utils/variables";
|
|
4
|
+
type SettingsFlowSearchParams = {
|
|
5
|
+
[flowIdParameterName]?: string;
|
|
6
|
+
[returnToParameterName]?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function useSettingsFlow({ kratosClient, params, onContinueWith, searchParams, updateSearchParams, }: {
|
|
4
9
|
kratosClient: FrontendApi;
|
|
5
|
-
settingsRoute: string;
|
|
6
10
|
params?: AxiosRequestConfig["params"];
|
|
7
11
|
onContinueWith?: (continueWith: ContinueWith[]) => void;
|
|
12
|
+
searchParams?: SettingsFlowSearchParams;
|
|
13
|
+
updateSearchParams: (searchParams: SettingsFlowSearchParams) => void;
|
|
8
14
|
}): {
|
|
9
15
|
flow: SettingsFlow | undefined;
|
|
10
16
|
submit: ({ body }: {
|
|
11
17
|
body: UpdateSettingsFlowBody;
|
|
12
18
|
}) => Promise<unknown> | undefined;
|
|
13
19
|
};
|
|
20
|
+
export {};
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { FrontendApi, UpdateVerificationFlowBody, VerificationFlow } from "@ory/client";
|
|
2
|
-
|
|
2
|
+
import { flowIdParameterName, returnToParameterName } from "../utils/variables";
|
|
3
|
+
type RecoveryFlowSearchParams = {
|
|
4
|
+
[flowIdParameterName]?: string;
|
|
5
|
+
[returnToParameterName]?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function useVerificationFlow({ initialFlowId, kratosClient, onVerified, searchParams, updateSearchParams, }: {
|
|
3
8
|
initialFlowId?: string;
|
|
4
9
|
kratosClient: FrontendApi;
|
|
5
10
|
onVerified: () => void;
|
|
11
|
+
searchParams?: RecoveryFlowSearchParams;
|
|
12
|
+
updateSearchParams: (searchParams: RecoveryFlowSearchParams) => void;
|
|
6
13
|
}): {
|
|
7
14
|
flow: VerificationFlow | undefined;
|
|
8
15
|
submit: ({ body }: {
|
|
@@ -10,3 +17,4 @@ export declare function useVerificationFlow({ initialFlowId, kratosClient, onVer
|
|
|
10
17
|
}) => Promise<unknown> | undefined;
|
|
11
18
|
reset: () => void;
|
|
12
19
|
};
|
|
20
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { UiNode, UiNodeGroupEnum, UiNodeInputAttributesTypeEnum } from "@ory/client";
|
|
2
2
|
export type FilterNodesByGroups = {
|
|
3
3
|
nodes: Array<UiNode>;
|
|
4
|
-
groups?: Array<
|
|
4
|
+
groups?: Array<string | UiNodeGroupEnum> | string | UiNodeGroupEnum;
|
|
5
5
|
withoutDefaultGroup?: boolean;
|
|
6
|
-
attributes?: Array<
|
|
6
|
+
attributes?: Array<string | UiNodeInputAttributesTypeEnum> | string | UiNodeInputAttributesTypeEnum;
|
|
7
7
|
withoutDefaultAttributes?: boolean;
|
|
8
|
-
excludeAttributes?: Array<
|
|
8
|
+
excludeAttributes?: Array<string | UiNodeInputAttributesTypeEnum> | string | UiNodeInputAttributesTypeEnum;
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* Filters nodes by their groups and attributes.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function parseSearchParams(search: string): Record<string, string>;
|