diff --git a/generate.sh b/generate.sh index 86fcff1..5ddf03a 100755 --- a/generate.sh +++ b/generate.sh @@ -11,8 +11,18 @@ fields="\ .components.schemas.UpdateUserRequest.properties.email \ .components.schemas.UpdateUserRequest.properties.phone \ .components.schemas.UpdateUserRequest.properties.user_metadata \ +.components.schemas.CreateMagicLinkRequest.properties.channel \ +.components.schemas.CreateMagicLinkRequest.properties.email \ .components.schemas.CreateMagicLinkRequest.properties.language \ +.components.schemas.CreateMagicLinkRequest.properties.magic_link_path \ +.components.schemas.CreateMagicLinkRequest.properties.phone \ +.components.schemas.CreateMagicLinkRequest.properties.redirect_url \ +.components.schemas.CreateMagicLinkRequest.properties.send \ +.components.schemas.CreateMagicLinkRequest.properties.ttl \ +.components.schemas.CreateMagicLinkRequest.properties.type \ +.components.schemas.CreateMagicLinkRequest.properties.user_id \ .components.schemas.MagicLinkType \ +.components.schemas.MagicLinkChannel \ .components.schemas.UserInfo.properties.user_metadata \ .components.schemas.UserInfo.properties.webauthn_types" for field in $fields; do diff --git a/passage.gen.go b/passage.gen.go index c960fc9..6f591cf 100644 --- a/passage.gen.go +++ b/passage.gen.go @@ -57,6 +57,7 @@ const ( FunctionSecretKeyNotFound N404ErrorCode = "function_secret_key_not_found" FunctionVersionNotFound N404ErrorCode = "function_version_not_found" MetadataFieldNotFound N404ErrorCode = "metadata_field_not_found" + NativeClientNotFound N404ErrorCode = "native_client_not_found" Oauth2AppNotFound N404ErrorCode = "oauth2_app_not_found" OrganizationMemberNotFound N404ErrorCode = "organization_member_not_found" SmsProviderNotFound N404ErrorCode = "sms_provider_not_found" @@ -112,6 +113,13 @@ const ( VerifyIdentifierType MagicLinkType = "verify_identifier" ) +// Defines values for SocialConnectionType. +const ( + Apple SocialConnectionType = "apple" + Github SocialConnectionType = "github" + Google SocialConnectionType = "google" +) + // Defines values for Technologies. const ( Android Technologies = "android" @@ -124,6 +132,13 @@ const ( Vue Technologies = "vue" ) +// Defines values for ThemeType. +const ( + Auto ThemeType = "auto" + Dark ThemeType = "dark" + Light ThemeType = "light" +) + // Defines values for TTLDisplayUnit. const ( D TTLDisplayUnit = "d" @@ -132,6 +147,13 @@ const ( S TTLDisplayUnit = "s" ) +// Defines values for UserEventAction. +const ( + UserEventActionLogin UserEventAction = "login" + UserEventActionOther UserEventAction = "other" + UserEventActionRegister UserEventAction = "register" +) + // Defines values for UserEventStatus. const ( UserEventStatusComplete UserEventStatus = "complete" @@ -230,37 +252,42 @@ type AppInfo struct { AuthFallbackMethodTTL int `json:"auth_fallback_method_ttl"` // AuthMethods Denotes what methods this app is allowed to use for authentication with configurations - AuthMethods AuthMethods `json:"auth_methods"` - AuthOrigin string `json:"auth_origin"` + AuthMethods AuthMethods `json:"auth_methods"` + AuthOrigin string `json:"auth_origin"` + + // AutoThemeEnabled Deprecated Property. Please use `hosted_theme` to set hosted page theming instead. + // Deprecated: + AutoThemeEnabled bool `json:"auto_theme_enabled"` CreatedAt time.Time `json:"created_at"` DarkLogoURL *string `json:"dark_logo_url,omitempty"` DefaultLanguage string `json:"default_language"` ElementCustomization ElementCustomization `json:"element_customization"` ElementCustomizationDark ElementCustomization `json:"element_customization_dark"` - // Hosted whether or not the app's login page hosted by passage + // Hosted whether or not the app's login page is hosted by Passage Hosted bool `json:"hosted"` // HostedSubdomain the subdomain of the app's hosted login page - HostedSubdomain string `json:"hosted_subdomain"` - ID string `json:"id"` - IDTokenLifetime *int `json:"id_token_lifetime,omitempty"` - Layouts Layouts `json:"layouts"` - LightLogoURL *string `json:"light_logo_url,omitempty"` - LoginURL string `json:"login_url"` - Name string `json:"name"` - PassageBranding bool `json:"passage_branding"` - ProfileManagement bool `json:"profile_management"` - PublicSignup bool `json:"public_signup"` - RedirectURL string `json:"redirect_url"` - RefreshAbsoluteLifetime int `json:"refresh_absolute_lifetime"` - RefreshEnabled bool `json:"refresh_enabled"` - RefreshInactivityLifetime int `json:"refresh_inactivity_lifetime"` - RequireEmailVerification bool `json:"require_email_verification"` - RequireIdentifierVerification bool `json:"require_identifier_verification"` - RequiredIdentifier string `json:"required_identifier"` - Role string `json:"role"` - RSAPublicKey string `json:"rsa_public_key"` + HostedSubdomain string `json:"hosted_subdomain"` + HostedTheme ThemeType `json:"hosted_theme"` + ID string `json:"id"` + IDTokenLifetime *int `json:"id_token_lifetime,omitempty"` + Layouts Layouts `json:"layouts"` + LightLogoURL *string `json:"light_logo_url,omitempty"` + LoginURL string `json:"login_url"` + Name string `json:"name"` + PassageBranding bool `json:"passage_branding"` + ProfileManagement bool `json:"profile_management"` + PublicSignup bool `json:"public_signup"` + RedirectURL string `json:"redirect_url"` + RefreshAbsoluteLifetime int `json:"refresh_absolute_lifetime"` + RefreshEnabled bool `json:"refresh_enabled"` + RefreshInactivityLifetime int `json:"refresh_inactivity_lifetime"` + RequireEmailVerification bool `json:"require_email_verification"` + RequireIdentifierVerification bool `json:"require_identifier_verification"` + RequiredIdentifier string `json:"required_identifier"` + Role string `json:"role"` + RSAPublicKey string `json:"rsa_public_key"` // Secret can only be retrieved by an app admin Secret *string `json:"secret,omitempty"` @@ -299,18 +326,20 @@ type AuthMethods struct { // CreateMagicLinkBody defines model for CreateMagicLinkBody. type CreateMagicLinkBody struct { - Channel ChannelType `json:"channel"` - Email string `json:"email"` + Channel ChannelType `json:"channel,omitempty"` + Email string `json:"email,omitempty"` // Language language of the email to send (optional) - Language string `json:"language,omitempty"` - MagicLinkPath string `json:"magic_link_path"` - Phone string `json:"phone"` - RedirectURL string `json:"redirect_url"` - Send bool `json:"send"` - TTL int `json:"ttl"` + Language string `json:"language,omitempty"` + + // MagicLinkPath must be a relative url + MagicLinkPath string `json:"magic_link_path,omitempty"` + Phone string `json:"phone,omitempty"` + RedirectURL string `json:"redirect_url,omitempty"` + Send bool `json:"send,omitempty"` + TTL int `json:"ttl,omitempty"` Type MagicLinkType `json:"type,omitempty"` - UserID string `json:"user_id"` + UserID string `json:"user_id,omitempty"` } // CreateUserBody defines model for CreateUserBody. @@ -444,9 +473,12 @@ type ListDevicesResponse struct { // ListPaginatedUsersItem defines model for ListPaginatedUsersItem. type ListPaginatedUsersItem struct { - CreatedAt time.Time `json:"created_at"` - Email string `json:"email"` - EmailVerified bool `json:"email_verified"` + CreatedAt time.Time `json:"created_at"` + Email string `json:"email"` + EmailVerified bool `json:"email_verified"` + + // ExternalID The external ID of the user. Only set if the user was created in a Flex app. + ExternalID string `json:"external_id"` ID string `json:"id"` LastLoginAt time.Time `json:"last_login_at"` LoginCount int `json:"login_count"` @@ -542,9 +574,15 @@ type PasskeysAuthMethod struct { Enabled bool `json:"enabled"` } +// SocialConnectionType defines model for SocialConnectionType. +type SocialConnectionType string + // Technologies defines model for Technologies. type Technologies string +// ThemeType defines model for ThemeType. +type ThemeType string + // TTLDisplayUnit Deprecated Property. The preferred unit for displaying the TTL. This value is for display only. // * `s` - seconds // * `m` - minutes @@ -559,14 +597,20 @@ type UpdateBody struct { UserMetadata map[string]interface{} `json:"user_metadata,omitempty"` } +// UserEventAction defines model for UserEventAction. +type UserEventAction string + // UserEventStatus defines model for UserEventStatus. type UserEventStatus string // User defines model for User. type User struct { - CreatedAt time.Time `json:"created_at"` - Email string `json:"email"` - EmailVerified bool `json:"email_verified"` + CreatedAt time.Time `json:"created_at"` + Email string `json:"email"` + EmailVerified bool `json:"email_verified"` + + // ExternalID The external ID of the user. Only set if the user was created in a Flex app. + ExternalID string `json:"external_id"` ID string `json:"id"` LastLoginAt time.Time `json:"last_login_at"` LoginCount int `json:"login_count"` @@ -599,13 +643,20 @@ type UserMetadataFieldType string // UserRecentEvent defines model for UserRecentEvent. type UserRecentEvent struct { - CompletedAt *time.Time `json:"completed_at"` - CreatedAt time.Time `json:"created_at"` - ID string `json:"id"` - IPAddr string `json:"ip_addr"` - Status UserEventStatus `json:"status"` - Type string `json:"type"` - UserAgent string `json:"user_agent"` + Action UserEventAction `json:"action"` + CompletedAt *time.Time `json:"completed_at"` + CreatedAt time.Time `json:"created_at"` + ID string `json:"id"` + IPAddr string `json:"ip_addr"` + SocialLoginType *SocialConnectionType `json:"social_login_type"` + Status UserEventStatus `json:"status"` + Type string `json:"type"` + + // UserAgent The raw user agent value from the originating device + UserAgent string `json:"user_agent"` + + // UserAgentDisplay A display-friendly version of the user agent + UserAgentDisplay string `json:"user_agent_display"` } // UserResponse defines model for UserResponse. @@ -672,9 +723,21 @@ type AppID = string // UserID defines model for user_id. type UserID = string +// N400BadRequest defines model for 400BadRequest. +type N400BadRequest = N400Error + +// N401Unauthorized defines model for 401Unauthorized. +type N401Unauthorized = N401Error + // N403Forbidden defines model for 403Forbidden. type N403Forbidden = N403Error +// N404NotFound defines model for 404NotFound. +type N404NotFound = N404Error + +// N500InternalServerError defines model for 500InternalServerError. +type N500InternalServerError = N500Error + // ListPaginatedUsersParams defines parameters for ListPaginatedUsers. type ListPaginatedUsersParams struct { // Page page to fetch (min=1) @@ -1823,11 +1886,11 @@ type CreateMagicLinkResponse struct { Body []byte HTTPResponse *http.Response JSON201 *MagicLinkResponse - JSON400 *N400Error - JSON401 *N401Error + JSON400 *N400BadRequest + JSON401 *N401Unauthorized JSON403 *N403Forbidden - JSON404 *N404Error - JSON500 *N500Error + JSON404 *N404NotFound + JSON500 *N500InternalServerError } // Status returns HTTPResponse.Status @@ -2298,14 +2361,14 @@ func ParseCreateMagicLinkResponse(rsp *http.Response) (*CreateMagicLinkResponse, response.JSON201 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest N400Error + var dest N400BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON400 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest N401Error + var dest N401Unauthorized if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -2319,14 +2382,14 @@ func ParseCreateMagicLinkResponse(rsp *http.Response) (*CreateMagicLinkResponse, response.JSON403 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest N404Error + var dest N404NotFound if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON404 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: - var dest N500Error + var dest N500InternalServerError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err }