zyphr 0.1.23 → 0.1.25

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 (45) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -0
  3. data/docs/AuthRegistrationApi.md +137 -0
  4. data/docs/AuthUser.md +6 -0
  5. data/docs/BatchRecipient.md +22 -0
  6. data/docs/ConvertAnonymousUserRequest.md +49 -0
  7. data/docs/ConvertAnonymousUserRequestOneOf.md +24 -0
  8. data/docs/ConvertAnonymousUserRequestOneOf1.md +24 -0
  9. data/docs/ConvertAnonymousUserRequestOneOf1AppleUser.md +18 -0
  10. data/docs/ConvertAnonymousUserRequestOneOf1AppleUserName.md +20 -0
  11. data/docs/CreateTemplateRequest.md +3 -3
  12. data/docs/EmailsApi.md +2 -2
  13. data/docs/SendBatchEmailRequest.md +20 -2
  14. data/docs/SignInAnonymouslyRequest.md +22 -0
  15. data/docs/TemplateResponse.md +3 -1
  16. data/docs/UpdateTemplateRequest.md +3 -3
  17. data/lib/zyphr/api/auth_registration_api.rb +136 -0
  18. data/lib/zyphr/api/emails_api.rb +2 -2
  19. data/lib/zyphr/models/auth_user.rb +33 -1
  20. data/lib/zyphr/models/batch_recipient.rb +258 -0
  21. data/lib/zyphr/models/convert_anonymous_user_request.rb +105 -0
  22. data/lib/zyphr/models/convert_anonymous_user_request_one_of.rb +323 -0
  23. data/lib/zyphr/models/convert_anonymous_user_request_one_of1.rb +324 -0
  24. data/lib/zyphr/models/convert_anonymous_user_request_one_of1_apple_user.rb +221 -0
  25. data/lib/zyphr/models/convert_anonymous_user_request_one_of1_apple_user_name.rb +229 -0
  26. data/lib/zyphr/models/create_template_request.rb +3 -3
  27. data/lib/zyphr/models/send_batch_email_request.rb +162 -22
  28. data/lib/zyphr/models/sign_in_anonymously_request.rb +296 -0
  29. data/lib/zyphr/models/template_response.rb +16 -4
  30. data/lib/zyphr/models/update_template_request.rb +3 -0
  31. data/lib/zyphr.rb +7 -0
  32. data/spec/api/auth_registration_api_spec.rb +24 -0
  33. data/spec/api/emails_api_spec.rb +1 -1
  34. data/spec/models/auth_user_spec.rb +18 -0
  35. data/spec/models/batch_recipient_spec.rb +48 -0
  36. data/spec/models/convert_anonymous_user_request_one_of1_apple_user_name_spec.rb +42 -0
  37. data/spec/models/convert_anonymous_user_request_one_of1_apple_user_spec.rb +36 -0
  38. data/spec/models/convert_anonymous_user_request_one_of1_spec.rb +58 -0
  39. data/spec/models/convert_anonymous_user_request_one_of_spec.rb +58 -0
  40. data/spec/models/convert_anonymous_user_request_spec.rb +32 -0
  41. data/spec/models/send_batch_email_request_spec.rb +55 -1
  42. data/spec/models/sign_in_anonymously_request_spec.rb +48 -0
  43. data/spec/models/template_response_spec.rb +6 -0
  44. data/zyphr.gemspec +1 -1
  45. metadata +391 -363
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b8fcb1badee8f50b9507765d4c2bcc896b0b966dbae85a89028f881008176a9
4
- data.tar.gz: 6ba51b317d1e0f17d6c0becd75b2e8c616932c37a24a4c166c08fce7e50cb7cf
3
+ metadata.gz: 37ff4cedd6136ea114aba25062df659b06561fcab18d579300e661716f4327f9
4
+ data.tar.gz: f6061fb34c72ddbf525aa75137bd9e942cc6106bbbfaed5d537fc49f583aea30
5
5
  SHA512:
6
- metadata.gz: ca806ff3567cfada05a98543b861f1974ab135e235edf03ad3ae4d4668a051817451f6503ab7c301bb5f02a9cb68649f64b7faa2fe5a98f1a0957e3079a6fbcf
7
- data.tar.gz: 5ce7284db506e4e5afaff6cd23da1178b36cb7d544ccd3c9fe908c7f3c083739662ee5d7731fb0a285026e54bed23e09bc3c0aa0d0c090d83c9c8ba20a43e6a2
6
+ metadata.gz: ebc454dee8dc25cc88cedf2941541db3f8d3d0e3e3a0be1083141cd48eb2cd690b83aa746734f519628100701837fd7032b8f41117c557dba0eac757752433f0
7
+ data.tar.gz: a804ea5e68f648595eaa178741e4ab8872b49a4778f3e7ebd503b3b81e37e484be90075cf4abab45e5ea358539c6fda6de305d20ca5bbd8c79cb2648acccca7b
data/README.md CHANGED
@@ -168,7 +168,9 @@ Class | Method | HTTP request | Description
168
168
  *Zyphr::AuthPhoneApi* | [**send_phone_registration_otp**](docs/AuthPhoneApi.md#send_phone_registration_otp) | **POST** /auth/phone/register/send | Send phone registration OTP
169
169
  *Zyphr::AuthPhoneApi* | [**verify_phone_login**](docs/AuthPhoneApi.md#verify_phone_login) | **POST** /auth/phone/login/verify | Verify phone login OTP
170
170
  *Zyphr::AuthPhoneApi* | [**verify_phone_registration**](docs/AuthPhoneApi.md#verify_phone_registration) | **POST** /auth/phone/register/verify | Verify phone registration OTP
171
+ *Zyphr::AuthRegistrationApi* | [**convert_anonymous_user**](docs/AuthRegistrationApi.md#convert_anonymous_user) | **POST** /auth/users/convert | Convert anonymous account to a full account
171
172
  *Zyphr::AuthRegistrationApi* | [**register_end_user**](docs/AuthRegistrationApi.md#register_end_user) | **POST** /auth/users/register | Register a new end user
173
+ *Zyphr::AuthRegistrationApi* | [**sign_in_anonymously**](docs/AuthRegistrationApi.md#sign_in_anonymously) | **POST** /auth/users/anonymous | Sign in anonymously
172
174
  *Zyphr::AuthSessionsApi* | [**list_end_user_sessions**](docs/AuthSessionsApi.md#list_end_user_sessions) | **GET** /auth/sessions | List active sessions
173
175
  *Zyphr::AuthSessionsApi* | [**refresh_end_user_token**](docs/AuthSessionsApi.md#refresh_end_user_token) | **POST** /auth/sessions/refresh | Refresh access token
174
176
  *Zyphr::AuthSessionsApi* | [**revoke_all_end_user_sessions**](docs/AuthSessionsApi.md#revoke_all_end_user_sessions) | **POST** /auth/sessions/revoke-all | Revoke all sessions
@@ -363,6 +365,7 @@ Class | Method | HTTP request | Description
363
365
  - [Zyphr::AuthUserResponse](docs/AuthUserResponse.md)
364
366
  - [Zyphr::AuthUserResponseData](docs/AuthUserResponseData.md)
365
367
  - [Zyphr::BatchPublishWaaSEvents201Response](docs/BatchPublishWaaSEvents201Response.md)
368
+ - [Zyphr::BatchRecipient](docs/BatchRecipient.md)
366
369
  - [Zyphr::BulkRetryWebhookDeliveriesRequest](docs/BulkRetryWebhookDeliveriesRequest.md)
367
370
  - [Zyphr::BulkUpsertAuthEmailTemplatesRequest](docs/BulkUpsertAuthEmailTemplatesRequest.md)
368
371
  - [Zyphr::BulkUpsertAuthEmailTemplatesResponse](docs/BulkUpsertAuthEmailTemplatesResponse.md)
@@ -379,6 +382,11 @@ Class | Method | HTTP request | Description
379
382
  - [Zyphr::ConsentStatus](docs/ConsentStatus.md)
380
383
  - [Zyphr::ConsentStatusResponse](docs/ConsentStatusResponse.md)
381
384
  - [Zyphr::ConsentWithdrawResponse](docs/ConsentWithdrawResponse.md)
385
+ - [Zyphr::ConvertAnonymousUserRequest](docs/ConvertAnonymousUserRequest.md)
386
+ - [Zyphr::ConvertAnonymousUserRequestOneOf](docs/ConvertAnonymousUserRequestOneOf.md)
387
+ - [Zyphr::ConvertAnonymousUserRequestOneOf1](docs/ConvertAnonymousUserRequestOneOf1.md)
388
+ - [Zyphr::ConvertAnonymousUserRequestOneOf1AppleUser](docs/ConvertAnonymousUserRequestOneOf1AppleUser.md)
389
+ - [Zyphr::ConvertAnonymousUserRequestOneOf1AppleUserName](docs/ConvertAnonymousUserRequestOneOf1AppleUserName.md)
382
390
  - [Zyphr::CreateCategoryRequest](docs/CreateCategoryRequest.md)
383
391
  - [Zyphr::CreateSubscriberRequest](docs/CreateSubscriberRequest.md)
384
392
  - [Zyphr::CreateTemplateRequest](docs/CreateTemplateRequest.md)
@@ -566,6 +574,7 @@ Class | Method | HTTP request | Description
566
574
  - [Zyphr::SessionListResponseDataSessionInfo](docs/SessionListResponseDataSessionInfo.md)
567
575
  - [Zyphr::SetPreferencesRequest](docs/SetPreferencesRequest.md)
568
576
  - [Zyphr::SetPreferencesRequestPreferencesInner](docs/SetPreferencesRequestPreferencesInner.md)
577
+ - [Zyphr::SignInAnonymouslyRequest](docs/SignInAnonymouslyRequest.md)
569
578
  - [Zyphr::SlackMessage](docs/SlackMessage.md)
570
579
  - [Zyphr::SlackMessageListResponse](docs/SlackMessageListResponse.md)
571
580
  - [Zyphr::SlackMessageListResponseMeta](docs/SlackMessageListResponseMeta.md)
@@ -4,7 +4,73 @@ All URIs are relative to *https://api.zyphr.dev/v1*
4
4
 
5
5
  | Method | HTTP request | Description |
6
6
  | ------ | ------------ | ----------- |
7
+ | [**convert_anonymous_user**](AuthRegistrationApi.md#convert_anonymous_user) | **POST** /auth/users/convert | Convert anonymous account to a full account |
7
8
  | [**register_end_user**](AuthRegistrationApi.md#register_end_user) | **POST** /auth/users/register | Register a new end user |
9
+ | [**sign_in_anonymously**](AuthRegistrationApi.md#sign_in_anonymously) | **POST** /auth/users/anonymous | Sign in anonymously |
10
+
11
+
12
+ ## convert_anonymous_user
13
+
14
+ > <AuthResultResponse> convert_anonymous_user(convert_anonymous_user_request)
15
+
16
+ Convert anonymous account to a full account
17
+
18
+ Upgrade the calling anonymous user to a full email+password account in place. The end_user.id is preserved, so customer-domain tables with foreign keys to end_users.id need no migration on conversion. All prior sessions for the user (including the anonymous token used to make this call) are revoked. A fresh token pair is returned in the response body. The conversion is the moment the user becomes billable -- MAU is tracked from this point forward.
19
+
20
+ ### Examples
21
+
22
+ ```ruby
23
+ require 'time'
24
+ require 'zyphr'
25
+
26
+ api_instance = Zyphr::AuthRegistrationApi.new
27
+ convert_anonymous_user_request = Zyphr::ConvertAnonymousUserRequestOneOf.new({method: 'password', email: 'email_example', password: 'password_example'}) # ConvertAnonymousUserRequest |
28
+
29
+ begin
30
+ # Convert anonymous account to a full account
31
+ result = api_instance.convert_anonymous_user(convert_anonymous_user_request)
32
+ p result
33
+ rescue Zyphr::ApiError => e
34
+ puts "Error when calling AuthRegistrationApi->convert_anonymous_user: #{e}"
35
+ end
36
+ ```
37
+
38
+ #### Using the convert_anonymous_user_with_http_info variant
39
+
40
+ This returns an Array which contains the response data, status code and headers.
41
+
42
+ > <Array(<AuthResultResponse>, Integer, Hash)> convert_anonymous_user_with_http_info(convert_anonymous_user_request)
43
+
44
+ ```ruby
45
+ begin
46
+ # Convert anonymous account to a full account
47
+ data, status_code, headers = api_instance.convert_anonymous_user_with_http_info(convert_anonymous_user_request)
48
+ p status_code # => 2xx
49
+ p headers # => { ... }
50
+ p data # => <AuthResultResponse>
51
+ rescue Zyphr::ApiError => e
52
+ puts "Error when calling AuthRegistrationApi->convert_anonymous_user_with_http_info: #{e}"
53
+ end
54
+ ```
55
+
56
+ ### Parameters
57
+
58
+ | Name | Type | Description | Notes |
59
+ | ---- | ---- | ----------- | ----- |
60
+ | **convert_anonymous_user_request** | [**ConvertAnonymousUserRequest**](ConvertAnonymousUserRequest.md) | | |
61
+
62
+ ### Return type
63
+
64
+ [**AuthResultResponse**](AuthResultResponse.md)
65
+
66
+ ### Authorization
67
+
68
+ No authorization required
69
+
70
+ ### HTTP request headers
71
+
72
+ - **Content-Type**: application/json
73
+ - **Accept**: application/json
8
74
 
9
75
 
10
76
  ## register_end_user
@@ -82,3 +148,74 @@ end
82
148
  - **Content-Type**: application/json
83
149
  - **Accept**: application/json
84
150
 
151
+
152
+ ## sign_in_anonymously
153
+
154
+ > <AuthResultResponse> sign_in_anonymously(sign_in_anonymously_request)
155
+
156
+ Sign in anonymously
157
+
158
+ Issue an end-user identity to a device without email, password, OAuth, or any other credential. Idempotent per (application, environment, device_id): repeated calls with the same device_id return the same user but a fresh token pair. Prior sessions for the user remain valid until natural expiry. Anonymous users do not count toward MAU quota until their first authenticated request after sign-in (excluding /v1/auth/refresh). Convert an anonymous user to a full account via POST /v1/auth/users/convert.
159
+
160
+ ### Examples
161
+
162
+ ```ruby
163
+ require 'time'
164
+ require 'zyphr'
165
+ # setup authorization
166
+ Zyphr.configure do |config|
167
+ # Configure API key authorization: ApplicationPublicKey
168
+ config.api_key['X-Application-Key'] = 'YOUR API KEY'
169
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
170
+ # config.api_key_prefix['X-Application-Key'] = 'Bearer'
171
+ end
172
+
173
+ api_instance = Zyphr::AuthRegistrationApi.new
174
+ sign_in_anonymously_request = Zyphr::SignInAnonymouslyRequest.new({device_id: 'device_id_example'}) # SignInAnonymouslyRequest |
175
+
176
+ begin
177
+ # Sign in anonymously
178
+ result = api_instance.sign_in_anonymously(sign_in_anonymously_request)
179
+ p result
180
+ rescue Zyphr::ApiError => e
181
+ puts "Error when calling AuthRegistrationApi->sign_in_anonymously: #{e}"
182
+ end
183
+ ```
184
+
185
+ #### Using the sign_in_anonymously_with_http_info variant
186
+
187
+ This returns an Array which contains the response data, status code and headers.
188
+
189
+ > <Array(<AuthResultResponse>, Integer, Hash)> sign_in_anonymously_with_http_info(sign_in_anonymously_request)
190
+
191
+ ```ruby
192
+ begin
193
+ # Sign in anonymously
194
+ data, status_code, headers = api_instance.sign_in_anonymously_with_http_info(sign_in_anonymously_request)
195
+ p status_code # => 2xx
196
+ p headers # => { ... }
197
+ p data # => <AuthResultResponse>
198
+ rescue Zyphr::ApiError => e
199
+ puts "Error when calling AuthRegistrationApi->sign_in_anonymously_with_http_info: #{e}"
200
+ end
201
+ ```
202
+
203
+ ### Parameters
204
+
205
+ | Name | Type | Description | Notes |
206
+ | ---- | ---- | ----------- | ----- |
207
+ | **sign_in_anonymously_request** | [**SignInAnonymouslyRequest**](SignInAnonymouslyRequest.md) | | |
208
+
209
+ ### Return type
210
+
211
+ [**AuthResultResponse**](AuthResultResponse.md)
212
+
213
+ ### Authorization
214
+
215
+ [ApplicationPublicKey](../README.md#ApplicationPublicKey)
216
+
217
+ ### HTTP request headers
218
+
219
+ - **Content-Type**: application/json
220
+ - **Accept**: application/json
221
+
data/docs/AuthUser.md CHANGED
@@ -14,6 +14,9 @@
14
14
  | **phone_verified** | **Boolean** | | [optional] |
15
15
  | **status** | **String** | | [optional] |
16
16
  | **mfa_enabled** | **Boolean** | | [optional] |
17
+ | **is_anonymous** | **Boolean** | True if the user signed in anonymously and has not yet been converted to a full account. | [optional] |
18
+ | **anonymous_device_id** | **String** | Per-device identifier supplied at anonymous sign-in. Preserved across conversion so client-side \&quot;this device has scores from me\&quot; detection survives the upgrade. NULL for users who never signed in anonymously. | [optional] |
19
+ | **first_activity_at** | **Time** | Set on the user&#39;s first authenticated request after anonymous sign-in (excluding /auth/refresh). MAU billing for anonymous-origin users keys off this timestamp instead of created_at. | [optional] |
17
20
  | **created_at** | **Time** | | [optional] |
18
21
  | **updated_at** | **Time** | | [optional] |
19
22
  | **last_login_at** | **Time** | | [optional] |
@@ -34,6 +37,9 @@ instance = Zyphr::AuthUser.new(
34
37
  phone_verified: null,
35
38
  status: null,
36
39
  mfa_enabled: null,
40
+ is_anonymous: null,
41
+ anonymous_device_id: null,
42
+ first_activity_at: null,
37
43
  created_at: null,
38
44
  updated_at: null,
39
45
  last_login_at: null
@@ -0,0 +1,22 @@
1
+ # Zyphr::BatchRecipient
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **email** | **String** | | |
8
+ | **name** | **String** | | [optional] |
9
+ | **variables** | **Hash&lt;String, Object&gt;** | Per-recipient template variables. Merged on top of the batch-level &#x60;template_data&#x60;, so per-recipient values win on key collisions. | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'zyphr'
15
+
16
+ instance = Zyphr::BatchRecipient.new(
17
+ email: null,
18
+ name: null,
19
+ variables: null
20
+ )
21
+ ```
22
+
@@ -0,0 +1,49 @@
1
+ # Zyphr::ConvertAnonymousUserRequest
2
+
3
+ ## Class instance methods
4
+
5
+ ### `openapi_one_of`
6
+
7
+ Returns the list of classes defined in oneOf.
8
+
9
+ #### Example
10
+
11
+ ```ruby
12
+ require 'zyphr'
13
+
14
+ Zyphr::ConvertAnonymousUserRequest.openapi_one_of
15
+ # =>
16
+ # [
17
+ # :'ConvertAnonymousUserRequestOneOf',
18
+ # :'ConvertAnonymousUserRequestOneOf1'
19
+ # ]
20
+ ```
21
+
22
+ ### build
23
+
24
+ Find the appropriate object from the `openapi_one_of` list and casts the data into it.
25
+
26
+ #### Example
27
+
28
+ ```ruby
29
+ require 'zyphr'
30
+
31
+ Zyphr::ConvertAnonymousUserRequest.build(data)
32
+ # => #<ConvertAnonymousUserRequestOneOf:0x00007fdd4aab02a0>
33
+
34
+ Zyphr::ConvertAnonymousUserRequest.build(data_that_doesnt_match)
35
+ # => nil
36
+ ```
37
+
38
+ #### Parameters
39
+
40
+ | Name | Type | Description |
41
+ | ---- | ---- | ----------- |
42
+ | **data** | **Mixed** | data to be matched against the list of oneOf items |
43
+
44
+ #### Return type
45
+
46
+ - `ConvertAnonymousUserRequestOneOf`
47
+ - `ConvertAnonymousUserRequestOneOf1`
48
+ - `nil` (if no type matches)
49
+
@@ -0,0 +1,24 @@
1
+ # Zyphr::ConvertAnonymousUserRequestOneOf
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **method** | **String** | | |
8
+ | **email** | **String** | | |
9
+ | **password** | **String** | | |
10
+ | **name** | **String** | Optional. Overwrites the user&#39;s existing name if provided. | [optional] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'zyphr'
16
+
17
+ instance = Zyphr::ConvertAnonymousUserRequestOneOf.new(
18
+ method: null,
19
+ email: null,
20
+ password: null,
21
+ name: null
22
+ )
23
+ ```
24
+
@@ -0,0 +1,24 @@
1
+ # Zyphr::ConvertAnonymousUserRequestOneOf1
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **method** | **String** | | |
8
+ | **code** | **String** | Authorization code returned by the OAuth provider after the user authorizes. | |
9
+ | **state** | **String** | Opaque state token previously issued by GET /v1/auth/oauth/authorize. | |
10
+ | **apple_user** | [**ConvertAnonymousUserRequestOneOf1AppleUser**](ConvertAnonymousUserRequestOneOf1AppleUser.md) | | [optional] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'zyphr'
16
+
17
+ instance = Zyphr::ConvertAnonymousUserRequestOneOf1.new(
18
+ method: null,
19
+ code: null,
20
+ state: null,
21
+ apple_user: null
22
+ )
23
+ ```
24
+
@@ -0,0 +1,18 @@
1
+ # Zyphr::ConvertAnonymousUserRequestOneOf1AppleUser
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **name** | [**ConvertAnonymousUserRequestOneOf1AppleUserName**](ConvertAnonymousUserRequestOneOf1AppleUserName.md) | | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'zyphr'
13
+
14
+ instance = Zyphr::ConvertAnonymousUserRequestOneOf1AppleUser.new(
15
+ name: null
16
+ )
17
+ ```
18
+
@@ -0,0 +1,20 @@
1
+ # Zyphr::ConvertAnonymousUserRequestOneOf1AppleUserName
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **first_name** | **String** | | [optional] |
8
+ | **last_name** | **String** | | [optional] |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'zyphr'
14
+
15
+ instance = Zyphr::ConvertAnonymousUserRequestOneOf1AppleUserName.new(
16
+ first_name: null,
17
+ last_name: null
18
+ )
19
+ ```
20
+
@@ -6,9 +6,9 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **name** | **String** | Template name (letters, numbers, underscores, hyphens) | |
8
8
  | **description** | **String** | | [optional] |
9
- | **subject** | **String** | Email subject line (supports Handlebars) | [optional] |
10
- | **html** | **String** | HTML body (supports Handlebars) | [optional] |
11
- | **text** | **String** | Plain text body (supports Handlebars) | [optional] |
9
+ | **subject** | **String** | Email subject line. Supports Handlebars &#x60;{{var}}&#x60; interpolation; values are HTML-escaped on render (see &#x60;html&#x60; field for the full escape policy). | [optional] |
10
+ | **html** | **String** | HTML body. Supports Handlebars &#x60;{{var}}&#x60; interpolation; values are always HTML-escaped on render. **Triple-brace &#x60;{{{var}}}&#x60; (raw HTML output) is not supported** for XSS-prevention reasons — input containing &#x60;{{{var}}}&#x60; is rewritten to &#x60;{{var}}&#x60; on save and the response includes a top-level &#x60;warnings&#x60; array describing what changed. To inject pre-rendered HTML, render the entire &#x60;html&#x60; field outside Zyphr and POST it to &#x60;/v1/email/send&#x60; directly without &#x60;template_id&#x60;. | [optional] |
11
+ | **text** | **String** | Plain text body. Supports Handlebars &#x60;{{var}}&#x60; interpolation; triple-brace syntax is rewritten to double-brace on save (same policy as the &#x60;html&#x60; field). | [optional] |
12
12
 
13
13
  ## Example
14
14
 
data/docs/EmailsApi.md CHANGED
@@ -310,7 +310,7 @@ end
310
310
 
311
311
  Send batch emails
312
312
 
313
- Send up to 100 emails in a single request. Each recipient gets their own message record.
313
+ Send a single email to up to 100 recipients in one request. Each recipient gets their own message record. Provide either raw content (`subject` plus `html` and/or `text`) or a `template_id` with `template_data`. Per-recipient `variables` are merged on top of the batch-level `template_data`.
314
314
 
315
315
  ### Examples
316
316
 
@@ -326,7 +326,7 @@ Zyphr.configure do |config|
326
326
  end
327
327
 
328
328
  api_instance = Zyphr::EmailsApi.new
329
- send_batch_email_request = Zyphr::SendBatchEmailRequest.new({messages: [Zyphr::SendEmailRequest.new({to: [{"email": "user@example.com", "name": "John Doe"}], subject: 'Welcome to Zyphr!'})]}) # SendBatchEmailRequest |
329
+ send_batch_email_request = Zyphr::SendBatchEmailRequest.new({from: Zyphr::EmailAddress.new, to: [Zyphr::BatchRecipient.new({email: 'email_example'})]}) # SendBatchEmailRequest |
330
330
 
331
331
  begin
332
332
  # Send batch emails
@@ -4,7 +4,16 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
- | **messages** | [**Array&lt;SendEmailRequest&gt;**](SendEmailRequest.md) | | |
7
+ | **from** | [**EmailAddress**](EmailAddress.md) | Sender address. The API also accepts a plain email string for convenience. | |
8
+ | **to** | [**Array&lt;BatchRecipient&gt;**](BatchRecipient.md) | | |
9
+ | **reply_to** | [**EmailAddress**](EmailAddress.md) | Reply-to address. The API also accepts a plain email string for convenience. | [optional] |
10
+ | **subject** | **String** | Required when sending raw content (no &#x60;template_id&#x60;). | [optional] |
11
+ | **html** | **String** | Provide either &#x60;html&#x60; or &#x60;text&#x60; (or both) when sending raw content. | [optional] |
12
+ | **text** | **String** | Provide either &#x60;html&#x60; or &#x60;text&#x60; (or both) when sending raw content. | [optional] |
13
+ | **template_id** | **String** | Template ID to use instead of raw &#x60;subject&#x60;/&#x60;html&#x60;/&#x60;text&#x60;. | [optional] |
14
+ | **template_data** | **Hash&lt;String, Object&gt;** | Default variables to pass to the template. Merged with each recipient&#39;s per-recipient &#x60;variables&#x60; (per-recipient values win on key collisions). | [optional] |
15
+ | **tags** | **Array&lt;String&gt;** | | [optional] |
16
+ | **metadata** | **Hash&lt;String, Object&gt;** | | [optional] |
8
17
 
9
18
  ## Example
10
19
 
@@ -12,7 +21,16 @@
12
21
  require 'zyphr'
13
22
 
14
23
  instance = Zyphr::SendBatchEmailRequest.new(
15
- messages: null
24
+ from: null,
25
+ to: null,
26
+ reply_to: null,
27
+ subject: null,
28
+ html: null,
29
+ text: null,
30
+ template_id: null,
31
+ template_data: null,
32
+ tags: null,
33
+ metadata: null
16
34
  )
17
35
  ```
18
36
 
@@ -0,0 +1,22 @@
1
+ # Zyphr::SignInAnonymouslyRequest
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **device_id** | **String** | Stable per-device identifier supplied by the client. Use a cryptographically-random opaque value persisted to client storage on first run. | |
8
+ | **name** | **String** | Optional display name. If omitted, the user has no name until conversion. | [optional] |
9
+ | **metadata** | **Hash&lt;String, Object&gt;** | | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'zyphr'
15
+
16
+ instance = Zyphr::SignInAnonymouslyRequest.new(
17
+ device_id: null,
18
+ name: null,
19
+ metadata: null
20
+ )
21
+ ```
22
+
@@ -6,6 +6,7 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **data** | [**Template**](Template.md) | | [optional] |
8
8
  | **meta** | [**RequestMeta**](RequestMeta.md) | | [optional] |
9
+ | **warnings** | **Array&lt;String&gt;** | Non-fatal advisories about the request. Currently emitted only when the server rewrites template content for security (see the &#x60;html&#x60; field on &#x60;CreateTemplateRequest&#x60; for the triple-brace policy). Omitted entirely when no warnings apply — clients should treat its absence as equivalent to an empty array. | [optional] |
9
10
 
10
11
  ## Example
11
12
 
@@ -14,7 +15,8 @@ require 'zyphr'
14
15
 
15
16
  instance = Zyphr::TemplateResponse.new(
16
17
  data: null,
17
- meta: null
18
+ meta: null,
19
+ warnings: [&quot;Stripped 1 occurrence(s) of triple-brace Handlebars syntax {{{var}}} from html. Raw HTML output is not supported for security reasons; values render HTML-escaped via {{var}}.&quot;]
18
20
  )
19
21
  ```
20
22
 
@@ -6,9 +6,9 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **name** | **String** | | [optional] |
8
8
  | **description** | **String** | | [optional] |
9
- | **subject** | **String** | | [optional] |
10
- | **html** | **String** | | [optional] |
11
- | **text** | **String** | | [optional] |
9
+ | **subject** | **String** | Email subject line. Supports Handlebars &#x60;{{var}}&#x60; interpolation (HTML-escaped on render). | [optional] |
10
+ | **html** | **String** | HTML body. Supports Handlebars &#x60;{{var}}&#x60; interpolation; values are always HTML-escaped on render. Triple-brace &#x60;{{{var}}}&#x60; is not supported — input is rewritten to &#x60;{{var}}&#x60; on save and the response includes a top-level &#x60;warnings&#x60; array describing the rewrite. See &#x60;CreateTemplateRequest.html&#x60; for full rationale. | [optional] |
11
+ | **text** | **String** | Plain text body. Supports Handlebars &#x60;{{var}}&#x60; interpolation; same triple-brace rewrite policy as &#x60;html&#x60;. | [optional] |
12
12
 
13
13
  ## Example
14
14
 
@@ -19,6 +19,74 @@ module Zyphr
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Convert anonymous account to a full account
23
+ # Upgrade the calling anonymous user to a full email+password account in place. The end_user.id is preserved, so customer-domain tables with foreign keys to end_users.id need no migration on conversion. All prior sessions for the user (including the anonymous token used to make this call) are revoked. A fresh token pair is returned in the response body. The conversion is the moment the user becomes billable -- MAU is tracked from this point forward.
24
+ # @param convert_anonymous_user_request [ConvertAnonymousUserRequest]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [AuthResultResponse]
27
+ def convert_anonymous_user(convert_anonymous_user_request, opts = {})
28
+ data, _status_code, _headers = convert_anonymous_user_with_http_info(convert_anonymous_user_request, opts)
29
+ data
30
+ end
31
+
32
+ # Convert anonymous account to a full account
33
+ # Upgrade the calling anonymous user to a full email+password account in place. The end_user.id is preserved, so customer-domain tables with foreign keys to end_users.id need no migration on conversion. All prior sessions for the user (including the anonymous token used to make this call) are revoked. A fresh token pair is returned in the response body. The conversion is the moment the user becomes billable -- MAU is tracked from this point forward.
34
+ # @param convert_anonymous_user_request [ConvertAnonymousUserRequest]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(AuthResultResponse, Integer, Hash)>] AuthResultResponse data, response status code and response headers
37
+ def convert_anonymous_user_with_http_info(convert_anonymous_user_request, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: AuthRegistrationApi.convert_anonymous_user ...'
40
+ end
41
+ # verify the required parameter 'convert_anonymous_user_request' is set
42
+ if @api_client.config.client_side_validation && convert_anonymous_user_request.nil?
43
+ fail ArgumentError, "Missing the required parameter 'convert_anonymous_user_request' when calling AuthRegistrationApi.convert_anonymous_user"
44
+ end
45
+ # resource path
46
+ local_var_path = '/auth/users/convert'
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
55
+ # HTTP header 'Content-Type'
56
+ content_type = @api_client.select_header_content_type(['application/json'])
57
+ if !content_type.nil?
58
+ header_params['Content-Type'] = content_type
59
+ end
60
+
61
+ # form parameters
62
+ form_params = opts[:form_params] || {}
63
+
64
+ # http body (model)
65
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(convert_anonymous_user_request)
66
+
67
+ # return_type
68
+ return_type = opts[:debug_return_type] || 'AuthResultResponse'
69
+
70
+ # auth_names
71
+ auth_names = opts[:debug_auth_names] || []
72
+
73
+ new_options = opts.merge(
74
+ :operation => :"AuthRegistrationApi.convert_anonymous_user",
75
+ :header_params => header_params,
76
+ :query_params => query_params,
77
+ :form_params => form_params,
78
+ :body => post_body,
79
+ :auth_names => auth_names,
80
+ :return_type => return_type
81
+ )
82
+
83
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
84
+ if @api_client.config.debugging
85
+ @api_client.config.logger.debug "API called: AuthRegistrationApi#convert_anonymous_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
+ end
87
+ return data, status_code, headers
88
+ end
89
+
22
90
  # Register a new end user
23
91
  # Register a new end user with email and password.
24
92
  # @param register_request [RegisterRequest]
@@ -86,5 +154,73 @@ module Zyphr
86
154
  end
87
155
  return data, status_code, headers
88
156
  end
157
+
158
+ # Sign in anonymously
159
+ # Issue an end-user identity to a device without email, password, OAuth, or any other credential. Idempotent per (application, environment, device_id): repeated calls with the same device_id return the same user but a fresh token pair. Prior sessions for the user remain valid until natural expiry. Anonymous users do not count toward MAU quota until their first authenticated request after sign-in (excluding /v1/auth/refresh). Convert an anonymous user to a full account via POST /v1/auth/users/convert.
160
+ # @param sign_in_anonymously_request [SignInAnonymouslyRequest]
161
+ # @param [Hash] opts the optional parameters
162
+ # @return [AuthResultResponse]
163
+ def sign_in_anonymously(sign_in_anonymously_request, opts = {})
164
+ data, _status_code, _headers = sign_in_anonymously_with_http_info(sign_in_anonymously_request, opts)
165
+ data
166
+ end
167
+
168
+ # Sign in anonymously
169
+ # Issue an end-user identity to a device without email, password, OAuth, or any other credential. Idempotent per (application, environment, device_id): repeated calls with the same device_id return the same user but a fresh token pair. Prior sessions for the user remain valid until natural expiry. Anonymous users do not count toward MAU quota until their first authenticated request after sign-in (excluding /v1/auth/refresh). Convert an anonymous user to a full account via POST /v1/auth/users/convert.
170
+ # @param sign_in_anonymously_request [SignInAnonymouslyRequest]
171
+ # @param [Hash] opts the optional parameters
172
+ # @return [Array<(AuthResultResponse, Integer, Hash)>] AuthResultResponse data, response status code and response headers
173
+ def sign_in_anonymously_with_http_info(sign_in_anonymously_request, opts = {})
174
+ if @api_client.config.debugging
175
+ @api_client.config.logger.debug 'Calling API: AuthRegistrationApi.sign_in_anonymously ...'
176
+ end
177
+ # verify the required parameter 'sign_in_anonymously_request' is set
178
+ if @api_client.config.client_side_validation && sign_in_anonymously_request.nil?
179
+ fail ArgumentError, "Missing the required parameter 'sign_in_anonymously_request' when calling AuthRegistrationApi.sign_in_anonymously"
180
+ end
181
+ # resource path
182
+ local_var_path = '/auth/users/anonymous'
183
+
184
+ # query parameters
185
+ query_params = opts[:query_params] || {}
186
+
187
+ # header parameters
188
+ header_params = opts[:header_params] || {}
189
+ # HTTP header 'Accept' (if needed)
190
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
191
+ # HTTP header 'Content-Type'
192
+ content_type = @api_client.select_header_content_type(['application/json'])
193
+ if !content_type.nil?
194
+ header_params['Content-Type'] = content_type
195
+ end
196
+
197
+ # form parameters
198
+ form_params = opts[:form_params] || {}
199
+
200
+ # http body (model)
201
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(sign_in_anonymously_request)
202
+
203
+ # return_type
204
+ return_type = opts[:debug_return_type] || 'AuthResultResponse'
205
+
206
+ # auth_names
207
+ auth_names = opts[:debug_auth_names] || ['ApplicationPublicKey']
208
+
209
+ new_options = opts.merge(
210
+ :operation => :"AuthRegistrationApi.sign_in_anonymously",
211
+ :header_params => header_params,
212
+ :query_params => query_params,
213
+ :form_params => form_params,
214
+ :body => post_body,
215
+ :auth_names => auth_names,
216
+ :return_type => return_type
217
+ )
218
+
219
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
220
+ if @api_client.config.debugging
221
+ @api_client.config.logger.debug "API called: AuthRegistrationApi#sign_in_anonymously\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
222
+ end
223
+ return data, status_code, headers
224
+ end
89
225
  end
90
226
  end