@@ -909,123 +909,123 @@ public struct ListUsersPaginatedResponse: Hashable, Sendable {
909909 public var total : Int
910910}
911911
912- public struct GenerateLinkParams : Sendable {
913- struct Body : Encodable {
914- var type : GenerateLinkType
915- var email : String
916- var password : String ?
917- var newEmail : String ?
918- var data : [ String : AnyJSON ] ?
919- }
920- var body : Body
921- var redirectTo : URL ?
922-
923- /// Generates a signup link.
924- public static func signUp(
925- email: String ,
926- password: String ,
927- data: [ String : AnyJSON ] ? = nil ,
928- redirectTo: URL ? = nil
929- ) -> GenerateLinkParams {
930- GenerateLinkParams (
931- body: . init(
932- type: . signup,
933- email: email,
934- password: password,
935- data: data
936- ) ,
937- redirectTo: redirectTo
938- )
939- }
940-
941- /// Generates an invite link.
942- public static func invite(
943- email: String ,
944- data: [ String : AnyJSON ] ? = nil ,
945- redirectTo: URL ? = nil
946- ) -> GenerateLinkParams {
947- GenerateLinkParams (
948- body: . init(
949- type: . invite,
950- email: email,
951- data: data
952- ) ,
953- redirectTo: redirectTo
954- )
955- }
956-
957- /// Generates a magic link.
958- public static func magicLink(
959- email: String ,
960- data: [ String : AnyJSON ] ? = nil ,
961- redirectTo: URL ? = nil
962- ) -> GenerateLinkParams {
963- GenerateLinkParams (
964- body: . init(
965- type: . magiclink,
966- email: email,
967- data: data
968- ) ,
969- redirectTo: redirectTo
970- )
971- }
972-
973- /// Generates a recovery link.
974- public static func recovery(
975- email: String ,
976- redirectTo: URL ? = nil
977- ) -> GenerateLinkParams {
978- GenerateLinkParams (
979- body: . init(
980- type: . recovery,
981- email: email
982- ) ,
983- redirectTo: redirectTo
984- )
985- }
986-
987- }
988-
989- /// The response from the ``AuthAdmin/generateLink(params:)`` function.
990- public struct GenerateLinkResponse : Hashable , Sendable , Decodable {
991- /// The properties related to the email link generated.
992- public let properties : GenerateLinkProperties
993- /// The user that the email link is associated to.
994- public let user : User
995-
996- public init ( from decoder: any Decoder ) throws {
997- self . properties = try GenerateLinkProperties ( from: decoder)
998- self . user = try User ( from: decoder)
999- }
1000- }
1001-
1002- /// The properties related to the email link generated.
1003- public struct GenerateLinkProperties : Decodable , Hashable , Sendable {
1004- /// The email link to send to the users.
1005- /// The action link follows the following format: auth/v1/verify?type={verification_type}&token={hashed_token}&redirect_to={redirect_to}
1006- public let actionLink : URL
1007- /// The raw ramil OTP.
1008- /// You should send this in the email if you want your users to verify using an OTP instead of the action link.
1009- public let emailOTP : String
1010- /// The hashed token appended to the action link.
1011- public let hashedToken : String
1012- /// The URL appended to the action link.
1013- public let redirectTo : URL
1014- /// The verification type that the emaillink is associated to.
1015- public let verificationType : GenerateLinkType
1016- }
1017-
1018- public struct GenerateLinkType : RawRepresentable , Codable , Hashable , Sendable {
1019- public let rawValue : String
1020-
1021- public init ( rawValue: String ) {
1022- self . rawValue = rawValue
1023- }
1024-
1025- public static let signup = GenerateLinkType ( rawValue: " signup " )
1026- public static let invite = GenerateLinkType ( rawValue: " invite " )
1027- public static let magiclink = GenerateLinkType ( rawValue: " magiclink " )
1028- public static let recovery = GenerateLinkType ( rawValue: " recovery " )
1029- public static let emailChangeCurrent = GenerateLinkType ( rawValue: " email_change_current " )
1030- public static let emailChangeNew = GenerateLinkType ( rawValue: " email_change_new " )
1031- }
912+ // public struct GenerateLinkParams: Sendable {
913+ // struct Body: Encodable {
914+ // var type: GenerateLinkType
915+ // var email: String
916+ // var password: String?
917+ // var newEmail: String?
918+ // var data: [String: AnyJSON]?
919+ // }
920+ // var body: Body
921+ // var redirectTo: URL?
922+ //
923+ // /// Generates a signup link.
924+ // public static func signUp(
925+ // email: String,
926+ // password: String,
927+ // data: [String: AnyJSON]? = nil,
928+ // redirectTo: URL? = nil
929+ // ) -> GenerateLinkParams {
930+ // GenerateLinkParams(
931+ // body: .init(
932+ // type: .signup,
933+ // email: email,
934+ // password: password,
935+ // data: data
936+ // ),
937+ // redirectTo: redirectTo
938+ // )
939+ // }
940+ //
941+ // /// Generates an invite link.
942+ // public static func invite(
943+ // email: String,
944+ // data: [String: AnyJSON]? = nil,
945+ // redirectTo: URL? = nil
946+ // ) -> GenerateLinkParams {
947+ // GenerateLinkParams(
948+ // body: .init(
949+ // type: .invite,
950+ // email: email,
951+ // data: data
952+ // ),
953+ // redirectTo: redirectTo
954+ // )
955+ // }
956+ //
957+ // /// Generates a magic link.
958+ // public static func magicLink(
959+ // email: String,
960+ // data: [String: AnyJSON]? = nil,
961+ // redirectTo: URL? = nil
962+ // ) -> GenerateLinkParams {
963+ // GenerateLinkParams(
964+ // body: .init(
965+ // type: .magiclink,
966+ // email: email,
967+ // data: data
968+ // ),
969+ // redirectTo: redirectTo
970+ // )
971+ // }
972+ //
973+ // /// Generates a recovery link.
974+ // public static func recovery(
975+ // email: String,
976+ // redirectTo: URL? = nil
977+ // ) -> GenerateLinkParams {
978+ // GenerateLinkParams(
979+ // body: .init(
980+ // type: .recovery,
981+ // email: email
982+ // ),
983+ // redirectTo: redirectTo
984+ // )
985+ // }
986+ //
987+ // }
988+ //
989+ ///// The response from the ``AuthAdmin/generateLink(params:)`` function.
990+ // public struct GenerateLinkResponse: Hashable, Sendable, Decodable {
991+ // /// The properties related to the email link generated.
992+ // public let properties: GenerateLinkProperties
993+ // /// The user that the email link is associated to.
994+ // public let user: User
995+ //
996+ // public init(from decoder: any Decoder) throws {
997+ // self.properties = try GenerateLinkProperties(from: decoder)
998+ // self.user = try User(from: decoder)
999+ // }
1000+ // }
1001+ //
1002+ ///// The properties related to the email link generated.
1003+ // public struct GenerateLinkProperties: Decodable, Hashable, Sendable {
1004+ // /// The email link to send to the users.
1005+ // /// The action link follows the following format: auth/v1/verify?type={verification_type}&token={hashed_token}&redirect_to={redirect_to}
1006+ // public let actionLink: URL
1007+ // /// The raw ramil OTP.
1008+ // /// You should send this in the email if you want your users to verify using an OTP instead of the action link.
1009+ // public let emailOTP: String
1010+ // /// The hashed token appended to the action link.
1011+ // public let hashedToken: String
1012+ // /// The URL appended to the action link.
1013+ // public let redirectTo: URL
1014+ // /// The verification type that the emaillink is associated to.
1015+ // public let verificationType: GenerateLinkType
1016+ // }
1017+ //
1018+ // public struct GenerateLinkType: RawRepresentable, Codable, Hashable, Sendable {
1019+ // public let rawValue: String
1020+ //
1021+ // public init(rawValue: String) {
1022+ // self.rawValue = rawValue
1023+ // }
1024+ //
1025+ // public static let signup = GenerateLinkType(rawValue: "signup")
1026+ // public static let invite = GenerateLinkType(rawValue: "invite")
1027+ // public static let magiclink = GenerateLinkType(rawValue: "magiclink")
1028+ // public static let recovery = GenerateLinkType(rawValue: "recovery")
1029+ // public static let emailChangeCurrent = GenerateLinkType(rawValue: "email_change_current")
1030+ // public static let emailChangeNew = GenerateLinkType(rawValue: "email_change_new")
1031+ // }
0 commit comments