zyphr 0.1.64 → 0.1.66

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e53e2a25fa6b997b6fd932f7b87f4562ef9109abec1e6ab7781fb740dd14426
4
- data.tar.gz: 468e8c41c576a915b01ebe96f341c19f682238fffee101dc6f32ea598baa5d85
3
+ metadata.gz: f33c2c02adcbf0bd60c921c7dc357478b5726c0b984e1298201125c1e2c65455
4
+ data.tar.gz: 435e121c0edf7400b7b89b7918eaa5478dc08cafad2c002c76ea356539ae36a3
5
5
  SHA512:
6
- metadata.gz: f478ec01374b4d9ad883b25b948f66274619ce68114353aa3c34a5cec89bde1844776c3c9f019179d55de972db7f0f6cc956450fc52c5da9628bc3758554ad1b
7
- data.tar.gz: 7cc930a3e11f6e7a41b269a5a7391b5d9177341f9d6c12b438fb5fb80c5e1c3d7137fe65130cc4b68bdab331dd4a33ef85adba4c12fcf2537fa9578736a1d99d
6
+ metadata.gz: d8cdf4f705e2aaad3542d415df6a8c8f71bf7af79020abb0df1e8521ae3d085c119cab00d899096a10ab1b3f35f4e95404728ae5c7275f95daa4b11e633c5161
7
+ data.tar.gz: e226e4db4034313a4bf73882cf3353680e16df445ed97f499b5eabb0dca84579727c7bec1c50e002a1bd7cb7397e9aa34f03042d7b831907ba74b27fee905f60
@@ -22,7 +22,7 @@ All URIs are relative to *https://api.zyphr.dev/v1*
22
22
 
23
23
  Bulk-upsert auth email templates
24
24
 
25
- Atomic upsert of any subset of magic_link, password_reset, email_verification. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
25
+ Atomic upsert of any subset of magic_link, password_reset, email_verification, email_otp, invitation. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
26
26
 
27
27
  ### Examples
28
28
 
@@ -90,7 +90,7 @@ end
90
90
 
91
91
  Verify a magic link
92
92
 
93
- Verify a magic link token and authenticate the user. Returns auth result with is_new_user flag.
93
+ Verify a magic link token and authenticate the user. Returns auth result with is_new_user flag. A magic link is a single factor, so a user who has enrolled MFA gets `mfa_required: true` and an `mfa_challenge` instead of tokens; complete the login with the challenge token at `POST /auth/mfa/verify`, exactly as after password login.
94
94
 
95
95
  ### Examples
96
96
 
@@ -400,7 +400,7 @@ end
400
400
 
401
401
  Pre-provision (invite) an end user (server-side admin)
402
402
 
403
- Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"magic\"` sends a magic-link sign-in email. - `send_link: \"password_reset\"` sends a set-password email. - `send_link: \"none\"` (default) creates the user with no email. A `redirect_url` is required when `send_link` is \"magic\" or \"password_reset\"; it must match the application's redirect_uris allowlist (custom schemes such as yourapp://path are permitted).
403
+ Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"invitation\"` sends the `invitation` auth email: a set-password link (valid 7 days) redeemed at `POST /auth/reset-password`, so the invitee ends up with a password. It has its own per-application template, separate from password reset's. Not sent to an identity that can already sign in. - `send_link: \"password_reset\"` sends a set-password email using the password-reset template. - `send_link: \"magic\"` sends a magic-link sign-in email. The user still has no credential afterwards. - `send_link: \"none\"` (default) creates the user with no email. A `redirect_url` is required whenever `send_link` is not \"none\"; it must match the application's redirect_uris allowlist (custom schemes such as yourapp://path are permitted).
404
404
 
405
405
  ### Examples
406
406
 
@@ -7,6 +7,8 @@
7
7
  | **magic_link** | [**UpsertAuthEmailTemplateRequest**](UpsertAuthEmailTemplateRequest.md) | | [optional] |
8
8
  | **password_reset** | [**UpsertAuthEmailTemplateRequest**](UpsertAuthEmailTemplateRequest.md) | | [optional] |
9
9
  | **email_verification** | [**UpsertAuthEmailTemplateRequest**](UpsertAuthEmailTemplateRequest.md) | | [optional] |
10
+ | **email_otp** | [**UpsertAuthEmailTemplateRequest**](UpsertAuthEmailTemplateRequest.md) | | [optional] |
11
+ | **invitation** | [**UpsertAuthEmailTemplateRequest**](UpsertAuthEmailTemplateRequest.md) | | [optional] |
10
12
 
11
13
  ## Example
12
14
 
@@ -16,7 +18,9 @@ require 'zyphr'
16
18
  instance = Zyphr::BulkUpsertAuthEmailTemplatesRequest.new(
17
19
  magic_link: null,
18
20
  password_reset: null,
19
- email_verification: null
21
+ email_verification: null,
22
+ email_otp: null,
23
+ invitation: null
20
24
  )
21
25
  ```
22
26
 
@@ -6,8 +6,8 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **user_id** | **String** | | [optional] |
8
8
  | **created** | **Boolean** | True when a new user was provisioned; false when an existing user was reused (idempotent on email). | [optional] |
9
- | **link_sent** | **Boolean** | True when a magic-link or password-reset email was successfully dispatched. | [optional] |
10
- | **link_suppressed_reason** | **String** | Present only when `send_link` was requested and `link_sent` is false — explains why, so a caller can distinguish \"suppressed by design\" from \"delivery failed\". Known values: - `identity_has_other_auth_methods` — the identity has no password but does have a linked OAuth provider and/or a passkey, so it is not locked out and no set-password link is sent. The attempt is recorded as a suppressed message, visible via `GET /emails`. - `user_not_found_in_environment` — the identity could not be resolved in the calling environment (a race; it was created or resolved immediately prior). - `recipient_not_allowlisted` — the application's `test_recipients` allowlist blocked the recipient. - `send_failed` — dispatch was attempted and failed with no more specific code. Not a closed set: a mail-provider error code may be surfaced verbatim, so treat an unrecognised value as a generic failure rather than an error. | [optional] |
9
+ | **link_sent** | **Boolean** | True when the requested invitation, magic-link or password-reset email was successfully dispatched. | [optional] |
10
+ | **link_suppressed_reason** | **String** | Present only when `send_link` was requested and `link_sent` is false — explains why, so a caller can distinguish \"suppressed by design\" from \"delivery failed\". Known values: - `identity_has_other_auth_methods` — the identity has no password but does have a linked OAuth provider and/or a passkey, so it is not locked out and no set-password link is sent. The attempt is recorded as a suppressed message, visible via `GET /emails`. (For `send_link: \"invitation\"` the reason is returned here only; no suppressed message is recorded.) - `user_has_password` — `send_link: \"invitation\"` only: the identity already has a password, so there is nothing to accept. Use `password_reset` to send a reset. - `user_not_found_in_environment` — the identity could not be resolved in the calling environment (a race; it was created or resolved immediately prior). - `recipient_not_allowlisted` — the application's `test_recipients` allowlist blocked the recipient. - `send_failed` — dispatch was attempted and failed with no more specific code. Not a closed set: a mail-provider error code may be surfaced verbatim, so treat an unrecognised value as a generic failure rather than an error. | [optional] |
11
11
 
12
12
  ## Example
13
13
 
@@ -4,8 +4,10 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
+ | **mfa_required** | **Boolean** | | [optional] |
7
8
  | **user** | [**AuthUser**](AuthUser.md) | | [optional] |
8
9
  | **tokens** | [**AuthTokens**](AuthTokens.md) | | [optional] |
10
+ | **mfa_challenge** | [**AuthLoginResultMfaChallenge**](AuthLoginResultMfaChallenge.md) | | [optional] |
9
11
  | **is_new_user** | **Boolean** | | [optional] |
10
12
 
11
13
  ## Example
@@ -14,8 +16,10 @@
14
16
  require 'zyphr'
15
17
 
16
18
  instance = Zyphr::MagicLinkVerifyResponseData.new(
19
+ mfa_required: null,
17
20
  user: null,
18
21
  tokens: null,
22
+ mfa_challenge: null,
19
23
  is_new_user: null
20
24
  )
21
25
  ```
@@ -101,7 +101,7 @@ end
101
101
 
102
102
  Create or update a subscriber
103
103
 
104
- Upsert a subscriber by external_id. If a subscriber with the given external_id already exists, it will be updated.
104
+ Upsert a subscriber by external_id. If a subscriber with the given external_id already exists, it will be updated; fields you omit keep their existing values. A new subscriber's timezone defaults to UTC and locale to en.
105
105
 
106
106
  ### Examples
107
107
 
@@ -20,7 +20,7 @@ module Zyphr
20
20
  @api_client = api_client
21
21
  end
22
22
  # Bulk-upsert auth email templates
23
- # Atomic upsert of any subset of magic_link, password_reset, email_verification. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
23
+ # Atomic upsert of any subset of magic_link, password_reset, email_verification, email_otp, invitation. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
24
24
  # @param bulk_upsert_auth_email_templates_request [BulkUpsertAuthEmailTemplatesRequest]
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @return [BulkUpsertAuthEmailTemplatesResponse]
@@ -30,7 +30,7 @@ module Zyphr
30
30
  end
31
31
 
32
32
  # Bulk-upsert auth email templates
33
- # Atomic upsert of any subset of magic_link, password_reset, email_verification. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
33
+ # Atomic upsert of any subset of magic_link, password_reset, email_verification, email_otp, invitation. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
34
34
  # @param bulk_upsert_auth_email_templates_request [BulkUpsertAuthEmailTemplatesRequest]
35
35
  # @param [Hash] opts the optional parameters
36
36
  # @return [Array<(BulkUpsertAuthEmailTemplatesResponse, Integer, Hash)>] BulkUpsertAuthEmailTemplatesResponse data, response status code and response headers
@@ -88,7 +88,7 @@ module Zyphr
88
88
  end
89
89
 
90
90
  # Verify a magic link
91
- # Verify a magic link token and authenticate the user. Returns auth result with is_new_user flag.
91
+ # Verify a magic link token and authenticate the user. Returns auth result with is_new_user flag. A magic link is a single factor, so a user who has enrolled MFA gets `mfa_required: true` and an `mfa_challenge` instead of tokens; complete the login with the challenge token at `POST /auth/mfa/verify`, exactly as after password login.
92
92
  # @param magic_link_verify_request [MagicLinkVerifyRequest]
93
93
  # @param [Hash] opts the optional parameters
94
94
  # @return [MagicLinkVerifyResponse]
@@ -98,7 +98,7 @@ module Zyphr
98
98
  end
99
99
 
100
100
  # Verify a magic link
101
- # Verify a magic link token and authenticate the user. Returns auth result with is_new_user flag.
101
+ # Verify a magic link token and authenticate the user. Returns auth result with is_new_user flag. A magic link is a single factor, so a user who has enrolled MFA gets &#x60;mfa_required: true&#x60; and an &#x60;mfa_challenge&#x60; instead of tokens; complete the login with the challenge token at &#x60;POST /auth/mfa/verify&#x60;, exactly as after password login.
102
102
  # @param magic_link_verify_request [MagicLinkVerifyRequest]
103
103
  # @param [Hash] opts the optional parameters
104
104
  # @return [Array<(MagicLinkVerifyResponse, Integer, Hash)>] MagicLinkVerifyResponse data, response status code and response headers
@@ -334,7 +334,7 @@ module Zyphr
334
334
  end
335
335
 
336
336
  # Pre-provision (invite) an end user (server-side admin)
337
- # Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"magic\"` sends a magic-link sign-in email. - `send_link: \"password_reset\"` sends a set-password email. - `send_link: \"none\"` (default) creates the user with no email. A `redirect_url` is required when `send_link` is \"magic\" or \"password_reset\"; it must match the application's redirect_uris allowlist (custom schemes such as yourapp://path are permitted).
337
+ # Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"invitation\"` sends the `invitation` auth email: a set-password link (valid 7 days) redeemed at `POST /auth/reset-password`, so the invitee ends up with a password. It has its own per-application template, separate from password reset's. Not sent to an identity that can already sign in. - `send_link: \"password_reset\"` sends a set-password email using the password-reset template. - `send_link: \"magic\"` sends a magic-link sign-in email. The user still has no credential afterwards. - `send_link: \"none\"` (default) creates the user with no email. A `redirect_url` is required whenever `send_link` is not \"none\"; it must match the application's redirect_uris allowlist (custom schemes such as yourapp://path are permitted).
338
338
  # @param invite_end_user_request [InviteEndUserRequest]
339
339
  # @param [Hash] opts the optional parameters
340
340
  # @return [InviteEndUser200Response]
@@ -344,7 +344,7 @@ module Zyphr
344
344
  end
345
345
 
346
346
  # Pre-provision (invite) an end user (server-side admin)
347
- # Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when &#x60;send_link&#x60; is set, sends a first-login link so the user can set up their account without self-registration. - &#x60;send_link: \&quot;magic\&quot;&#x60; sends a magic-link sign-in email. - &#x60;send_link: \&quot;password_reset\&quot;&#x60; sends a set-password email. - &#x60;send_link: \&quot;none\&quot;&#x60; (default) creates the user with no email. A &#x60;redirect_url&#x60; is required when &#x60;send_link&#x60; is \&quot;magic\&quot; or \&quot;password_reset\&quot;; it must match the application&#39;s redirect_uris allowlist (custom schemes such as yourapp://path are permitted).
347
+ # Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when &#x60;send_link&#x60; is set, sends a first-login link so the user can set up their account without self-registration. - &#x60;send_link: \&quot;invitation\&quot;&#x60; sends the &#x60;invitation&#x60; auth email: a set-password link (valid 7 days) redeemed at &#x60;POST /auth/reset-password&#x60;, so the invitee ends up with a password. It has its own per-application template, separate from password reset&#39;s. Not sent to an identity that can already sign in. - &#x60;send_link: \&quot;password_reset\&quot;&#x60; sends a set-password email using the password-reset template. - &#x60;send_link: \&quot;magic\&quot;&#x60; sends a magic-link sign-in email. The user still has no credential afterwards. - &#x60;send_link: \&quot;none\&quot;&#x60; (default) creates the user with no email. A &#x60;redirect_url&#x60; is required whenever &#x60;send_link&#x60; is not \&quot;none\&quot;; it must match the application&#39;s redirect_uris allowlist (custom schemes such as yourapp://path are permitted).
348
348
  # @param invite_end_user_request [InviteEndUserRequest]
349
349
  # @param [Hash] opts the optional parameters
350
350
  # @return [Array<(InviteEndUser200Response, Integer, Hash)>] InviteEndUser200Response data, response status code and response headers
@@ -86,7 +86,7 @@ module Zyphr
86
86
  end
87
87
 
88
88
  # Create or update a subscriber
89
- # Upsert a subscriber by external_id. If a subscriber with the given external_id already exists, it will be updated.
89
+ # Upsert a subscriber by external_id. If a subscriber with the given external_id already exists, it will be updated; fields you omit keep their existing values. A new subscriber's timezone defaults to UTC and locale to en.
90
90
  # @param create_subscriber_request [CreateSubscriberRequest]
91
91
  # @param [Hash] opts the optional parameters
92
92
  # @return [SubscriberResponse]
@@ -96,7 +96,7 @@ module Zyphr
96
96
  end
97
97
 
98
98
  # Create or update a subscriber
99
- # Upsert a subscriber by external_id. If a subscriber with the given external_id already exists, it will be updated.
99
+ # Upsert a subscriber by external_id. If a subscriber with the given external_id already exists, it will be updated; fields you omit keep their existing values. A new subscriber&#39;s timezone defaults to UTC and locale to en.
100
100
  # @param create_subscriber_request [CreateSubscriberRequest]
101
101
  # @param [Hash] opts the optional parameters
102
102
  # @return [Array<(SubscriberResponse, Integer, Hash)>] SubscriberResponse data, response status code and response headers
@@ -18,9 +18,11 @@ module Zyphr
18
18
  MAGIC_LINK = "magic_link".freeze
19
19
  PASSWORD_RESET = "password_reset".freeze
20
20
  EMAIL_VERIFICATION = "email_verification".freeze
21
+ EMAIL_OTP = "email_otp".freeze
22
+ INVITATION = "invitation".freeze
21
23
 
22
24
  def self.all_vars
23
- @all_vars ||= [MAGIC_LINK, PASSWORD_RESET, EMAIL_VERIFICATION].freeze
25
+ @all_vars ||= [MAGIC_LINK, PASSWORD_RESET, EMAIL_VERIFICATION, EMAIL_OTP, INVITATION].freeze
24
26
  end
25
27
 
26
28
  # Builds the enum from string
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Zyphr
17
- # Atomic upsert of any subset of magic_link, password_reset, email_verification. At least one entry must be provided.
17
+ # Atomic upsert of any subset of magic_link, password_reset, email_verification, email_otp, invitation. At least one entry must be provided.
18
18
  class BulkUpsertAuthEmailTemplatesRequest
19
19
  attr_accessor :magic_link
20
20
 
@@ -22,12 +22,18 @@ module Zyphr
22
22
 
23
23
  attr_accessor :email_verification
24
24
 
25
+ attr_accessor :email_otp
26
+
27
+ attr_accessor :invitation
28
+
25
29
  # Attribute mapping from ruby-style variable name to JSON key.
26
30
  def self.attribute_map
27
31
  {
28
32
  :'magic_link' => :'magic_link',
29
33
  :'password_reset' => :'password_reset',
30
- :'email_verification' => :'email_verification'
34
+ :'email_verification' => :'email_verification',
35
+ :'email_otp' => :'email_otp',
36
+ :'invitation' => :'invitation'
31
37
  }
32
38
  end
33
39
 
@@ -46,7 +52,9 @@ module Zyphr
46
52
  {
47
53
  :'magic_link' => :'UpsertAuthEmailTemplateRequest',
48
54
  :'password_reset' => :'UpsertAuthEmailTemplateRequest',
49
- :'email_verification' => :'UpsertAuthEmailTemplateRequest'
55
+ :'email_verification' => :'UpsertAuthEmailTemplateRequest',
56
+ :'email_otp' => :'UpsertAuthEmailTemplateRequest',
57
+ :'invitation' => :'UpsertAuthEmailTemplateRequest'
50
58
  }
51
59
  end
52
60
 
@@ -83,6 +91,14 @@ module Zyphr
83
91
  if attributes.key?(:'email_verification')
84
92
  self.email_verification = attributes[:'email_verification']
85
93
  end
94
+
95
+ if attributes.key?(:'email_otp')
96
+ self.email_otp = attributes[:'email_otp']
97
+ end
98
+
99
+ if attributes.key?(:'invitation')
100
+ self.invitation = attributes[:'invitation']
101
+ end
86
102
  end
87
103
 
88
104
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -107,7 +123,9 @@ module Zyphr
107
123
  self.class == o.class &&
108
124
  magic_link == o.magic_link &&
109
125
  password_reset == o.password_reset &&
110
- email_verification == o.email_verification
126
+ email_verification == o.email_verification &&
127
+ email_otp == o.email_otp &&
128
+ invitation == o.invitation
111
129
  end
112
130
 
113
131
  # @see the `==` method
@@ -119,7 +137,7 @@ module Zyphr
119
137
  # Calculates hash code according to all attributes.
120
138
  # @return [Integer] Hash code
121
139
  def hash
122
- [magic_link, password_reset, email_verification].hash
140
+ [magic_link, password_reset, email_verification, email_otp, invitation].hash
123
141
  end
124
142
 
125
143
  # Builds the object from hash
@@ -20,10 +20,10 @@ module Zyphr
20
20
  # True when a new user was provisioned; false when an existing user was reused (idempotent on email).
21
21
  attr_accessor :created
22
22
 
23
- # True when a magic-link or password-reset email was successfully dispatched.
23
+ # True when the requested invitation, magic-link or password-reset email was successfully dispatched.
24
24
  attr_accessor :link_sent
25
25
 
26
- # Present only when `send_link` was requested and `link_sent` is false — explains why, so a caller can distinguish \"suppressed by design\" from \"delivery failed\". Known values: - `identity_has_other_auth_methods` — the identity has no password but does have a linked OAuth provider and/or a passkey, so it is not locked out and no set-password link is sent. The attempt is recorded as a suppressed message, visible via `GET /emails`. - `user_not_found_in_environment` — the identity could not be resolved in the calling environment (a race; it was created or resolved immediately prior). - `recipient_not_allowlisted` — the application's `test_recipients` allowlist blocked the recipient. - `send_failed` — dispatch was attempted and failed with no more specific code. Not a closed set: a mail-provider error code may be surfaced verbatim, so treat an unrecognised value as a generic failure rather than an error.
26
+ # Present only when `send_link` was requested and `link_sent` is false — explains why, so a caller can distinguish \"suppressed by design\" from \"delivery failed\". Known values: - `identity_has_other_auth_methods` — the identity has no password but does have a linked OAuth provider and/or a passkey, so it is not locked out and no set-password link is sent. The attempt is recorded as a suppressed message, visible via `GET /emails`. (For `send_link: \"invitation\"` the reason is returned here only; no suppressed message is recorded.) - `user_has_password` — `send_link: \"invitation\"` only: the identity already has a password, so there is nothing to accept. Use `password_reset` to send a reset. - `user_not_found_in_environment` — the identity could not be resolved in the calling environment (a race; it was created or resolved immediately prior). - `recipient_not_allowlisted` — the application's `test_recipients` allowlist blocked the recipient. - `send_failed` — dispatch was attempted and failed with no more specific code. Not a closed set: a mail-provider error code may be surfaced verbatim, so treat an unrecognised value as a generic failure rather than an error.
27
27
  attr_accessor :link_suppressed_reason
28
28
 
29
29
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -143,7 +143,7 @@ module Zyphr
143
143
  def valid?
144
144
  warn '[DEPRECATED] the `valid?` method is obsolete'
145
145
  return false if @email.nil?
146
- send_link_validator = EnumAttributeValidator.new('String', ["magic", "password_reset", "none"])
146
+ send_link_validator = EnumAttributeValidator.new('String', ["invitation", "magic", "password_reset", "none"])
147
147
  return false unless send_link_validator.valid?(@send_link)
148
148
  true
149
149
  end
@@ -161,7 +161,7 @@ module Zyphr
161
161
  # Custom attribute writer method checking allowed values (enum).
162
162
  # @param [Object] send_link Object to be assigned
163
163
  def send_link=(send_link)
164
- validator = EnumAttributeValidator.new('String', ["magic", "password_reset", "none"])
164
+ validator = EnumAttributeValidator.new('String', ["invitation", "magic", "password_reset", "none"])
165
165
  unless validator.valid?(send_link)
166
166
  fail ArgumentError, "invalid value for \"send_link\", must be one of #{validator.allowable_values}."
167
167
  end
@@ -15,17 +15,23 @@ require 'time'
15
15
 
16
16
  module Zyphr
17
17
  class MagicLinkVerifyResponseData
18
+ attr_accessor :mfa_required
19
+
18
20
  attr_accessor :user
19
21
 
20
22
  attr_accessor :tokens
21
23
 
24
+ attr_accessor :mfa_challenge
25
+
22
26
  attr_accessor :is_new_user
23
27
 
24
28
  # Attribute mapping from ruby-style variable name to JSON key.
25
29
  def self.attribute_map
26
30
  {
31
+ :'mfa_required' => :'mfa_required',
27
32
  :'user' => :'user',
28
33
  :'tokens' => :'tokens',
34
+ :'mfa_challenge' => :'mfa_challenge',
29
35
  :'is_new_user' => :'is_new_user'
30
36
  }
31
37
  end
@@ -43,8 +49,10 @@ module Zyphr
43
49
  # Attribute type mapping.
44
50
  def self.openapi_types
45
51
  {
52
+ :'mfa_required' => :'Boolean',
46
53
  :'user' => :'AuthUser',
47
54
  :'tokens' => :'AuthTokens',
55
+ :'mfa_challenge' => :'AuthLoginResultMfaChallenge',
48
56
  :'is_new_user' => :'Boolean'
49
57
  }
50
58
  end
@@ -58,7 +66,7 @@ module Zyphr
58
66
  # List of class defined in allOf (OpenAPI v3)
59
67
  def self.openapi_all_of
60
68
  [
61
- :'AuthResult'
69
+ :'AuthLoginResult'
62
70
  ]
63
71
  end
64
72
 
@@ -78,6 +86,10 @@ module Zyphr
78
86
  h[k.to_sym] = v
79
87
  }
80
88
 
89
+ if attributes.key?(:'mfa_required')
90
+ self.mfa_required = attributes[:'mfa_required']
91
+ end
92
+
81
93
  if attributes.key?(:'user')
82
94
  self.user = attributes[:'user']
83
95
  end
@@ -86,6 +98,10 @@ module Zyphr
86
98
  self.tokens = attributes[:'tokens']
87
99
  end
88
100
 
101
+ if attributes.key?(:'mfa_challenge')
102
+ self.mfa_challenge = attributes[:'mfa_challenge']
103
+ end
104
+
89
105
  if attributes.key?(:'is_new_user')
90
106
  self.is_new_user = attributes[:'is_new_user']
91
107
  end
@@ -111,8 +127,10 @@ module Zyphr
111
127
  def ==(o)
112
128
  return true if self.equal?(o)
113
129
  self.class == o.class &&
130
+ mfa_required == o.mfa_required &&
114
131
  user == o.user &&
115
132
  tokens == o.tokens &&
133
+ mfa_challenge == o.mfa_challenge &&
116
134
  is_new_user == o.is_new_user
117
135
  end
118
136
 
@@ -125,7 +143,7 @@ module Zyphr
125
143
  # Calculates hash code according to all attributes.
126
144
  # @return [Integer] Hash code
127
145
  def hash
128
- [user, tokens, is_new_user].hash
146
+ [mfa_required, user, tokens, mfa_challenge, is_new_user].hash
129
147
  end
130
148
 
131
149
  # Builds the object from hash
@@ -34,7 +34,7 @@ describe 'AuthEmailTemplatesApi' do
34
34
 
35
35
  # unit tests for bulk_upsert_auth_email_templates
36
36
  # Bulk-upsert auth email templates
37
- # Atomic upsert of any subset of magic_link, password_reset, email_verification. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
37
+ # Atomic upsert of any subset of magic_link, password_reset, email_verification, email_otp, invitation. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
38
38
  # @param bulk_upsert_auth_email_templates_request
39
39
  # @param [Hash] opts the optional parameters
40
40
  # @return [BulkUpsertAuthEmailTemplatesResponse]
@@ -46,7 +46,7 @@ describe 'AuthMagicLinksApi' do
46
46
 
47
47
  # unit tests for verify_magic_link
48
48
  # Verify a magic link
49
- # Verify a magic link token and authenticate the user. Returns auth result with is_new_user flag.
49
+ # Verify a magic link token and authenticate the user. Returns auth result with is_new_user flag. A magic link is a single factor, so a user who has enrolled MFA gets &#x60;mfa_required: true&#x60; and an &#x60;mfa_challenge&#x60; instead of tokens; complete the login with the challenge token at &#x60;POST /auth/mfa/verify&#x60;, exactly as after password login.
50
50
  # @param magic_link_verify_request
51
51
  # @param [Hash] opts the optional parameters
52
52
  # @return [MagicLinkVerifyResponse]
@@ -94,7 +94,7 @@ describe 'AuthUserDirectoryApi' do
94
94
 
95
95
  # unit tests for invite_end_user
96
96
  # Pre-provision (invite) an end user (server-side admin)
97
- # Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when &#x60;send_link&#x60; is set, sends a first-login link so the user can set up their account without self-registration. - &#x60;send_link: \&quot;magic\&quot;&#x60; sends a magic-link sign-in email. - &#x60;send_link: \&quot;password_reset\&quot;&#x60; sends a set-password email. - &#x60;send_link: \&quot;none\&quot;&#x60; (default) creates the user with no email. A &#x60;redirect_url&#x60; is required when &#x60;send_link&#x60; is \&quot;magic\&quot; or \&quot;password_reset\&quot;; it must match the application&#39;s redirect_uris allowlist (custom schemes such as yourapp://path are permitted).
97
+ # Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when &#x60;send_link&#x60; is set, sends a first-login link so the user can set up their account without self-registration. - &#x60;send_link: \&quot;invitation\&quot;&#x60; sends the &#x60;invitation&#x60; auth email: a set-password link (valid 7 days) redeemed at &#x60;POST /auth/reset-password&#x60;, so the invitee ends up with a password. It has its own per-application template, separate from password reset&#39;s. Not sent to an identity that can already sign in. - &#x60;send_link: \&quot;password_reset\&quot;&#x60; sends a set-password email using the password-reset template. - &#x60;send_link: \&quot;magic\&quot;&#x60; sends a magic-link sign-in email. The user still has no credential afterwards. - &#x60;send_link: \&quot;none\&quot;&#x60; (default) creates the user with no email. A &#x60;redirect_url&#x60; is required whenever &#x60;send_link&#x60; is not \&quot;none\&quot;; it must match the application&#39;s redirect_uris allowlist (custom schemes such as yourapp://path are permitted).
98
98
  # @param invite_end_user_request
99
99
  # @param [Hash] opts the optional parameters
100
100
  # @return [InviteEndUser200Response]
@@ -45,7 +45,7 @@ describe 'SubscribersApi' do
45
45
 
46
46
  # unit tests for create_subscriber
47
47
  # Create or update a subscriber
48
- # Upsert a subscriber by external_id. If a subscriber with the given external_id already exists, it will be updated.
48
+ # Upsert a subscriber by external_id. If a subscriber with the given external_id already exists, it will be updated; fields you omit keep their existing values. A new subscriber&#39;s timezone defaults to UTC and locale to en.
49
49
  # @param create_subscriber_request
50
50
  # @param [Hash] opts the optional parameters
51
51
  # @return [SubscriberResponse]
@@ -45,4 +45,16 @@ describe Zyphr::BulkUpsertAuthEmailTemplatesRequest do
45
45
  end
46
46
  end
47
47
 
48
+ describe 'test attribute "email_otp"' do
49
+ it 'should work' do
50
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
51
+ end
52
+ end
53
+
54
+ describe 'test attribute "invitation"' do
55
+ it 'should work' do
56
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
57
+ end
58
+ end
59
+
48
60
  end
@@ -48,7 +48,7 @@ describe Zyphr::InviteEndUserRequest do
48
48
  describe 'test attribute "send_link"' do
49
49
  it 'should work' do
50
50
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
51
- # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["magic", "password_reset", "none"])
51
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["invitation", "magic", "password_reset", "none"])
52
52
  # validator.allowable_values.each do |value|
53
53
  # expect { instance.send_link = value }.not_to raise_error
54
54
  # end
@@ -27,6 +27,12 @@ describe Zyphr::MagicLinkVerifyResponseData do
27
27
  end
28
28
  end
29
29
 
30
+ describe 'test attribute "mfa_required"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
30
36
  describe 'test attribute "user"' do
31
37
  it 'should work' do
32
38
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -39,6 +45,12 @@ describe Zyphr::MagicLinkVerifyResponseData do
39
45
  end
40
46
  end
41
47
 
48
+ describe 'test attribute "mfa_challenge"' do
49
+ it 'should work' do
50
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
51
+ end
52
+ end
53
+
42
54
  describe 'test attribute "is_new_user"' do
43
55
  it 'should work' do
44
56
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
data/zyphr.gemspec CHANGED
@@ -17,7 +17,7 @@ require "zyphr/version"
17
17
 
18
18
  Gem::Specification.new do |s|
19
19
  s.name = "zyphr"
20
- s.version = '0.1.64'
20
+ s.version = '0.1.66'
21
21
  s.platform = Gem::Platform::RUBY
22
22
  s.authors = ["Zyphr"]
23
23
  s.email = ["support@zyphr.dev"]