@leancodepl/kratos 8.3.6 → 8.5.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.
Files changed (80) hide show
  1. package/README.md +368 -4
  2. package/package.json +43 -7
  3. package/index.cjs.d.ts +0 -1
  4. package/index.cjs.default.js +0 -1
  5. package/index.cjs.js +0 -4362
  6. package/index.cjs.mjs +0 -2
  7. package/index.esm.d.ts +0 -1
  8. package/index.esm.js +0 -4334
  9. package/src/index.d.ts +0 -12
  10. package/src/lib/cards/index.d.ts +0 -2
  11. package/src/lib/cards/userAuthCard.d.ts +0 -20
  12. package/src/lib/cards/userSettingsCard.d.ts +0 -10
  13. package/src/lib/createKratosClient.d.ts +0 -2
  14. package/src/lib/defaultComponents/DefaultButtonComponent/index.d.ts +0 -2
  15. package/src/lib/defaultComponents/DefaultCheckboxComponent/index.d.ts +0 -2
  16. package/src/lib/defaultComponents/DefaultImageComponent/index.d.ts +0 -2
  17. package/src/lib/defaultComponents/DefaultInputComponent/index.d.ts +0 -2
  18. package/src/lib/defaultComponents/DefaultLinkComponent/index.d.ts +0 -2
  19. package/src/lib/defaultComponents/DefaultMessageComponent/index.d.ts +0 -2
  20. package/src/lib/defaultComponents/DefaultMessageFormatComponent/index.d.ts +0 -2
  21. package/src/lib/defaultComponents/DefaultTextComponent/index.d.ts +0 -2
  22. package/src/lib/defaultComponents/DefaultUiMessagesComponent/index.d.ts +0 -2
  23. package/src/lib/defaultComponents.d.ts +0 -2
  24. package/src/lib/flows/index.d.ts +0 -7
  25. package/src/lib/flows/useLoginFlow.d.ts +0 -21
  26. package/src/lib/flows/useLogoutFlow.d.ts +0 -8
  27. package/src/lib/flows/useReauthenticationFlow.d.ts +0 -8
  28. package/src/lib/flows/useRecoveryFlow.d.ts +0 -20
  29. package/src/lib/flows/useRegistrationFlow.d.ts +0 -20
  30. package/src/lib/flows/useSettingsFlow.d.ts +0 -20
  31. package/src/lib/flows/useVerificationFlow.d.ts +0 -20
  32. package/src/lib/helpers/errorMessages.d.ts +0 -7
  33. package/src/lib/helpers/filterFlowNodes.d.ts +0 -7
  34. package/src/lib/helpers/formattedMessage.d.ts +0 -4
  35. package/src/lib/helpers/getNodeLabel.d.ts +0 -2
  36. package/src/lib/helpers/node.d.ts +0 -7
  37. package/src/lib/helpers/useScriptNodes.d.ts +0 -5
  38. package/src/lib/helpers/userAuthForm.d.ts +0 -31
  39. package/src/lib/kratosContext.d.ts +0 -11
  40. package/src/lib/kratosContextProvider.d.ts +0 -10
  41. package/src/lib/sections/authCodeSection.d.ts +0 -14
  42. package/src/lib/sections/identifierFirstLoginSection.d.ts +0 -8
  43. package/src/lib/sections/linkSection.d.ts +0 -14
  44. package/src/lib/sections/loginSection.d.ts +0 -8
  45. package/src/lib/sections/lookupSecretSettingsSection.d.ts +0 -8
  46. package/src/lib/sections/oidcSection.d.ts +0 -8
  47. package/src/lib/sections/oidcSettingsSection.d.ts +0 -8
  48. package/src/lib/sections/passkeySettingsSection.d.ts +0 -8
  49. package/src/lib/sections/passwordSettingsSection.d.ts +0 -8
  50. package/src/lib/sections/passwordlessSection.d.ts +0 -8
  51. package/src/lib/sections/profileLoginSection.d.ts +0 -8
  52. package/src/lib/sections/profileRegistrationSection.d.ts +0 -8
  53. package/src/lib/sections/profileSettingsSection.d.ts +0 -8
  54. package/src/lib/sections/registrationSection.d.ts +0 -8
  55. package/src/lib/sections/totpSettingsSection.d.ts +0 -8
  56. package/src/lib/sessionManager/baseSessionManager.d.ts +0 -13
  57. package/src/lib/types/components.d.ts +0 -78
  58. package/src/lib/types/enums/errorId.d.ts +0 -16
  59. package/src/lib/types/enums/errorValidation.d.ts +0 -30
  60. package/src/lib/types/enums/errorValidationLogin.d.ts +0 -9
  61. package/src/lib/types/enums/errorValidationRecovery.d.ts +0 -9
  62. package/src/lib/types/enums/errorValidationRegistration.d.ts +0 -4
  63. package/src/lib/types/enums/errorValidationSettings.d.ts +0 -4
  64. package/src/lib/types/enums/errorValidationVerification.d.ts +0 -9
  65. package/src/lib/types/enums/index.d.ts +0 -14
  66. package/src/lib/types/enums/infoNodeLabel.d.ts +0 -14
  67. package/src/lib/types/enums/infoSelfServiceLogin.d.ts +0 -16
  68. package/src/lib/types/enums/infoSelfServiceRecovery.d.ts +0 -6
  69. package/src/lib/types/enums/infoSelfServiceRegistration.d.ts +0 -7
  70. package/src/lib/types/enums/infoSelfServiceSettings.d.ts +0 -21
  71. package/src/lib/types/enums/infoSelfServiceVerification.d.ts +0 -6
  72. package/src/lib/types/enums/misc.d.ts +0 -10
  73. package/src/lib/types/responseError.d.ts +0 -2
  74. package/src/lib/types/useHandleFlowError.d.ts +0 -13
  75. package/src/lib/utils/filterNodesByGroups.d.ts +0 -22
  76. package/src/lib/utils/getNodeInputType.d.ts +0 -1
  77. package/src/lib/utils/handleCancelError.d.ts +0 -2
  78. package/src/lib/utils/helpers.d.ts +0 -11
  79. package/src/lib/utils/typeGuards.d.ts +0 -24
  80. package/src/lib/utils/variables.d.ts +0 -4
@@ -1,30 +0,0 @@
1
- export declare enum ErrorValidation {
2
- ErrorValidation = 4000000,
3
- ErrorValidationGeneric = 4000001,
4
- ErrorValidationRequired = 4000002,
5
- ErrorValidationMinLength = 4000003,
6
- ErrorValidationInvalidFormat = 4000004,
7
- ErrorValidationPasswordPolicyViolation = 4000005,
8
- ErrorValidationInvalidCredentials = 4000006,
9
- ErrorValidationDuplicateCredentials = 4000007,
10
- ErrorValidationTOTPVerifierWrong = 4000008,
11
- ErrorValidationIdentifierMissing = 4000009,
12
- ErrorValidationAddressNotVerified = 4000010,
13
- ErrorValidationNoTOTPDevice = 4000011,
14
- ErrorValidationLookupAlreadyUsed = 4000012,
15
- ErrorValidationNoWebAuthnDevice = 4000013,
16
- ErrorValidationNoLookup = 4000014,
17
- ErrorValidationSuchNoWebAuthnUser = 4000015,
18
- ErrorValidationLookupInvalid = 4000016,
19
- ErrorValidationMaxLength = 4000017,
20
- ErrorValidationMinimum = 4000018,
21
- ErrorValidationExclusiveMinimum = 4000019,
22
- ErrorValidationMaximum = 4000020,
23
- ErrorValidationExclusiveMaximum = 4000021,
24
- ErrorValidationMultipleOf = 4000022,
25
- ErrorValidationMaxItems = 4000023,
26
- ErrorValidationMinItems = 4000024,
27
- ErrorValidationUniqueItems = 4000025,
28
- ErrorValidationWrongType = 4000026,
29
- ErrorValidationDuplicateCredentialsOnOIDCLink = 4000027
30
- }
@@ -1,9 +0,0 @@
1
- export declare enum ErrorValidationLogin {
2
- ErrorValidationLogin = 4010000,
3
- ErrorValidationLoginFlowExpired = 4010001,
4
- ErrorValidationLoginNoStrategyFound = 4010002,
5
- ErrorValidationRegistrationNoStrategyFound = 4010003,
6
- ErrorValidationSettingsNoStrategyFound = 4010004,
7
- ErrorValidationRecoveryNoStrategyFound = 4010005,
8
- ErrorValidationVerificationNoStrategyFound = 4010006
9
- }
@@ -1,9 +0,0 @@
1
- export declare enum ErrorValidationRecovery {
2
- ErrorValidationRecovery = 4060000,
3
- ErrorValidationRecoveryRetrySuccess = 4060001,
4
- ErrorValidationRecoveryStateFailure = 4060002,
5
- ErrorValidationRecoveryMissingRecoveryToken = 4060003,
6
- ErrorValidationRecoveryTokenInvalidOrAlreadyUsed = 4060004,
7
- ErrorValidationRecoveryFlowExpired = 4060005,
8
- ErrorValidationRecoveryCodeInvalidOrAlreadyUsed = 4060006
9
- }
@@ -1,4 +0,0 @@
1
- export declare enum ErrorValidationRegistration {
2
- ErrorValidationRegistration = 4040000,
3
- ErrorValidationRegistrationFlowExpired = 4040001
4
- }
@@ -1,4 +0,0 @@
1
- export declare enum ErrorValidationSettings {
2
- ErrorValidationSettings = 4050000,
3
- ErrorValidationSettingsFlowExpired = 4050001
4
- }
@@ -1,9 +0,0 @@
1
- export declare enum ErrorValidationVerification {
2
- ErrorValidationVerification = 4070000,
3
- ErrorValidationVerificationTokenInvalidOrAlreadyUsed = 4070001,
4
- ErrorValidationVerificationRetrySuccess = 4070002,
5
- ErrorValidationVerificationStateFailure = 4070003,
6
- ErrorValidationVerificationMissingVerificationToken = 4070004,
7
- ErrorValidationVerificationFlowExpired = 4070005,
8
- ErrorValidationVerificationCodeInvalidOrAlreadyUsed = 4070006
9
- }
@@ -1,14 +0,0 @@
1
- export * from "./errorId";
2
- export * from "./errorValidation";
3
- export * from "./errorValidationLogin";
4
- export * from "./errorValidationRecovery";
5
- export * from "./errorValidationRegistration";
6
- export * from "./errorValidationSettings";
7
- export * from "./errorValidationVerification";
8
- export * from "./infoNodeLabel";
9
- export * from "./infoSelfServiceLogin";
10
- export * from "./infoSelfServiceRecovery";
11
- export * from "./infoSelfServiceRegistration";
12
- export * from "./infoSelfServiceSettings";
13
- export * from "./infoSelfServiceVerification";
14
- export * from "./misc";
@@ -1,14 +0,0 @@
1
- export declare enum InfoNodeLabel {
2
- InfoNodeLabel = 1070000,
3
- InfoNodeLabelInputPassword = 1070001,
4
- InfoNodeLabelGenerated = 1070002,
5
- InfoNodeLabelSave = 1070003,
6
- InfoNodeLabelID = 1070004,
7
- InfoNodeLabelSubmit = 1070005,
8
- InfoNodeLabelVerifyOTP = 1070006,
9
- InfoNodeLabelEmail = 1070007,
10
- InfoNodeLabelResendOTP = 1070008,
11
- InfoNodeLabelContinue = 1070009,
12
- InfoNodeLabelRecoveryCode = 1070010,
13
- InfoNodeLabelVerificationCode = 1070011
14
- }
@@ -1,16 +0,0 @@
1
- export declare enum InfoSelfServiceLogin {
2
- InfoSelfServiceLoginRoot = 1010000,
3
- InfoSelfServiceLogin = 1010001,
4
- InfoSelfServiceLoginWith = 1010002,
5
- InfoSelfServiceLoginReAuth = 1010003,
6
- InfoSelfServiceLoginMFA = 1010004,
7
- InfoSelfServiceLoginVerify = 1010005,
8
- InfoSelfServiceLoginTOTPLabel = 1010006,
9
- InfoLoginLookupLabel = 1010007,
10
- InfoSelfServiceLoginWebAuthn = 1010008,
11
- InfoLoginTOTP = 1010009,
12
- InfoLoginLookup = 1010010,
13
- InfoSelfServiceLoginContinueWebAuthn = 1010011,
14
- InfoSelfServiceLoginWebAuthnPasswordless = 1010012,
15
- InfoSelfServiceLoginContinue = 1010013
16
- }
@@ -1,6 +0,0 @@
1
- export declare enum InfoSelfServiceRecovery {
2
- InfoSelfServiceRecovery = 1060000,
3
- InfoSelfServiceRecoverySuccessful = 1060001,
4
- InfoSelfServiceRecoveryEmailSent = 1060002,
5
- InfoSelfServiceRecoveryEmailWithCodeSent = 1060003
6
- }
@@ -1,7 +0,0 @@
1
- export declare enum InfoSelfServiceRegistration {
2
- InfoSelfServiceRegistrationRoot = 1040000,
3
- InfoSelfServiceRegistration = 1040001,
4
- InfoSelfServiceRegistrationWith = 1040002,
5
- InfoSelfServiceRegistrationContinue = 1040003,
6
- InfoSelfServiceRegistrationRegisterWebAuthn = 1040004
7
- }
@@ -1,21 +0,0 @@
1
- export declare enum InfoSelfServiceSettings {
2
- InfoSelfServiceSettings = 1050000,
3
- InfoSelfServiceSettingsUpdateSuccess = 1050001,
4
- InfoSelfServiceSettingsUpdateLinkOidc = 1050002,
5
- InfoSelfServiceSettingsUpdateUnlinkOidc = 1050003,
6
- InfoSelfServiceSettingsUpdateUnlinkTOTP = 1050004,
7
- InfoSelfServiceSettingsTOTPQRCode = 1050005,
8
- InfoSelfServiceSettingsTOTPSecret = 1050006,
9
- InfoSelfServiceSettingsRevealLookup = 1050007,
10
- InfoSelfServiceSettingsRegenerateLookup = 1050008,
11
- InfoSelfServiceSettingsLookupSecret = 1050009,
12
- InfoSelfServiceSettingsLookupSecretLabel = 1050010,
13
- InfoSelfServiceSettingsLookupConfirm = 1050011,
14
- InfoSelfServiceSettingsRegisterWebAuthn = 1050012,
15
- InfoSelfServiceSettingsRegisterWebAuthnDisplayName = 1050013,
16
- InfoSelfServiceSettingsLookupSecretUsed = 1050014,
17
- InfoSelfServiceSettingsLookupSecretList = 1050015,
18
- InfoSelfServiceSettingsDisableLookup = 1050016,
19
- InfoSelfServiceSettingsTOTPSecretLabel = 1050017,
20
- InfoSelfServiceSettingsRemoveWebAuthn = 1050018
21
- }
@@ -1,6 +0,0 @@
1
- export declare enum InfoSelfServiceVerification {
2
- InfoSelfServiceVerification = 1080000,
3
- InfoSelfServiceVerificationEmailSent = 1080001,
4
- InfoSelfServiceVerificationSuccessful = 1080002,
5
- InfoSelfServiceVerificationEmailWithCodeSent = 1080003
6
- }
@@ -1,10 +0,0 @@
1
- export declare enum ErrorSystem {
2
- ErrorSystem = 5000000,
3
- ErrorSystemGeneric = 5000001
4
- }
5
- export declare enum InfoSelfServiceLogout {
6
- InfoSelfServiceLogout = 1020000
7
- }
8
- export declare enum InfoSelfServiceMFA {
9
- InfoSelfServiceMFA = 1030000
10
- }
@@ -1,2 +0,0 @@
1
- import { AxiosError } from "axios";
2
- export type ResponseError<T = any> = AxiosError<T>;
@@ -1,13 +0,0 @@
1
- import { AxiosError } from "axios";
2
- import { ErrorId } from "./enums/errorId";
3
- export type FlowErrorResponse = {
4
- error?: {
5
- id?: ErrorId;
6
- };
7
- redirect_browser_to: string;
8
- use_flow_id?: string;
9
- };
10
- export type UseHandleFlowError = (props: {
11
- resetFlow: (newFlowId?: string) => void;
12
- onSessionAlreadyAvailable?: () => void;
13
- }) => (err: AxiosError<FlowErrorResponse>) => Promise<unknown>;
@@ -1,22 +0,0 @@
1
- import { UiNode, UiNodeGroupEnum, UiNodeInputAttributesTypeEnum } from "@ory/client";
2
- export type FilterNodesByGroups = {
3
- nodes: Array<UiNode>;
4
- groups?: Array<string | UiNodeGroupEnum> | string | UiNodeGroupEnum;
5
- withoutDefaultGroup?: boolean;
6
- attributes?: Array<string | UiNodeInputAttributesTypeEnum> | string | UiNodeInputAttributesTypeEnum;
7
- withoutDefaultAttributes?: boolean;
8
- excludeAttributes?: Array<string | UiNodeInputAttributesTypeEnum> | string | UiNodeInputAttributesTypeEnum;
9
- };
10
- /**
11
- * Filters nodes by their groups and attributes.
12
- * If no filtering options are specified, all nodes are returned.
13
- * Will always add default nodes unless `withoutDefaultGroup` is true.
14
- * Will always add default attributes unless `withoutDefaultAttributes` is true.
15
- * @param {Object} filterNodesByGroups - An object containing the nodes and the filtering options.
16
- * @param {Array<UiNode>} filterNodesByGroups.nodes - An array of nodes.
17
- * @param {Array<UiNodeGroupEnum | string> | string} filterNodesByGroups.groups - An array or comma seperated strings of groups to filter by.
18
- * @param {boolean} filterNodesByGroups.withoutDefaultGroup - If true, will not add default nodes under the 'default' category.
19
- * @param {Array<UiNodeInputAttributesTypeEnum | string> | string} filterNodesByGroups.attributes - An array or comma seperated strings of attributes to filter by.
20
- * @param {boolean} filterNodesByGroups.withoutDefaultAttributes - If true, will not add default attributes such as 'hidden' and 'script'.
21
- */
22
- export declare const filterNodesByGroups: ({ nodes, groups, withoutDefaultGroup, attributes, withoutDefaultAttributes, excludeAttributes, }: FilterNodesByGroups) => UiNode[];
@@ -1 +0,0 @@
1
- export declare function getNodeInputType(attr: unknown): string;
@@ -1,2 +0,0 @@
1
- import { AxiosError } from "axios";
2
- export declare function handleCancelError(err: AxiosError): Promise<void>;
@@ -1,11 +0,0 @@
1
- import { UiNode } from "@ory/client";
2
- export declare function hasOidc(nodes: UiNode[]): boolean;
3
- export declare function hasPassword(nodes: UiNode[]): boolean;
4
- export declare function hasDefault(nodes: UiNode[]): boolean;
5
- export declare function hasProfile(nodes: UiNode[]): boolean;
6
- export declare function hasPasskey(nodes: UiNode[]): boolean;
7
- export declare function hasIdentifierFirst(nodes: UiNode[]): boolean;
8
- export declare function hasLookupSecret(nodes: UiNode[]): boolean;
9
- export declare function hasTotp(nodes: UiNode[]): boolean;
10
- export declare function hasCode(nodes: UiNode[]): boolean;
11
- export declare function hasHiddenIdentifier(nodes: UiNode[]): boolean;
@@ -1,24 +0,0 @@
1
- import { UiNodeAnchorAttributes, UiNodeAttributes, UiNodeImageAttributes, UiNodeInputAttributes, UiNodeScriptAttributes, UiNodeTextAttributes, UiText } from "@ory/client";
2
- export declare function isUiNodeAnchorAttributes(attrs: UiNodeAttributes): attrs is {
3
- node_type: "a";
4
- } & UiNodeAnchorAttributes;
5
- export declare function isUiNodeImageAttributes(attrs: UiNodeAttributes): attrs is {
6
- node_type: "img";
7
- } & UiNodeImageAttributes;
8
- export declare function isUiNodeInputAttributes(attrs: UiNodeAttributes): attrs is {
9
- node_type: "input";
10
- } & UiNodeInputAttributes;
11
- export declare function isUiNodeTextAttributes(attrs: UiNodeAttributes): attrs is {
12
- node_type: "text";
13
- } & UiNodeTextAttributes;
14
- export declare function isUiNodeScriptAttributes(attrs: UiNodeAttributes): attrs is {
15
- node_type: "script";
16
- } & UiNodeScriptAttributes;
17
- export type UiNodeTextSecretsAttributes = {
18
- text: {
19
- context: {
20
- secrets: UiText[];
21
- };
22
- } & Omit<UiText, "context">;
23
- } & Omit<UiNodeTextAttributes, "text">;
24
- export declare function isUiNodeTextSecretsAttributes(attributes: UiNodeTextAttributes): attributes is UiNodeTextSecretsAttributes;
@@ -1,4 +0,0 @@
1
- export declare const returnToParameterName = "return_to";
2
- export declare const aalParameterName = "aal";
3
- export declare const flowIdParameterName = "flow";
4
- export declare const refreshParameterName = "refresh";