zyphr 0.1.24 → 0.1.26
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 +4 -4
- data/README.md +11 -0
- data/docs/AuthRegistrationApi.md +137 -0
- data/docs/AuthUser.md +6 -0
- data/docs/ConvertAnonymousUserRequest.md +49 -0
- data/docs/ConvertAnonymousUserRequestOneOf.md +24 -0
- data/docs/ConvertAnonymousUserRequestOneOf1.md +24 -0
- data/docs/ConvertAnonymousUserRequestOneOf1AppleUser.md +18 -0
- data/docs/ConvertAnonymousUserRequestOneOf1AppleUserName.md +20 -0
- data/docs/PayloadTooLargeError.md +20 -0
- data/docs/PayloadTooLargeErrorError.md +22 -0
- data/docs/PayloadTooLargeErrorErrorDetails.md +20 -0
- data/docs/SignInAnonymouslyRequest.md +22 -0
- data/lib/zyphr/api/auth_registration_api.rb +136 -0
- data/lib/zyphr/models/auth_user.rb +33 -1
- data/lib/zyphr/models/convert_anonymous_user_request.rb +105 -0
- data/lib/zyphr/models/convert_anonymous_user_request_one_of.rb +323 -0
- data/lib/zyphr/models/convert_anonymous_user_request_one_of1.rb +324 -0
- data/lib/zyphr/models/convert_anonymous_user_request_one_of1_apple_user.rb +221 -0
- data/lib/zyphr/models/convert_anonymous_user_request_one_of1_apple_user_name.rb +229 -0
- data/lib/zyphr/models/payload_too_large_error.rb +246 -0
- data/lib/zyphr/models/payload_too_large_error_error.rb +296 -0
- data/lib/zyphr/models/payload_too_large_error_error_details.rb +231 -0
- data/lib/zyphr/models/sign_in_anonymously_request.rb +296 -0
- data/lib/zyphr.rb +9 -0
- data/spec/api/auth_registration_api_spec.rb +24 -0
- data/spec/models/auth_user_spec.rb +18 -0
- data/spec/models/convert_anonymous_user_request_one_of1_apple_user_name_spec.rb +42 -0
- data/spec/models/convert_anonymous_user_request_one_of1_apple_user_spec.rb +36 -0
- data/spec/models/convert_anonymous_user_request_one_of1_spec.rb +58 -0
- data/spec/models/convert_anonymous_user_request_one_of_spec.rb +58 -0
- data/spec/models/convert_anonymous_user_request_spec.rb +32 -0
- data/spec/models/payload_too_large_error_error_details_spec.rb +42 -0
- data/spec/models/payload_too_large_error_error_spec.rb +52 -0
- data/spec/models/payload_too_large_error_spec.rb +42 -0
- data/spec/models/sign_in_anonymously_request_spec.rb +48 -0
- data/zyphr.gemspec +1 -1
- metadata +398 -362
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e5ac46909974f55876be36c741a964a101b4b607538f101da63d4b939ea60df8
|
|
4
|
+
data.tar.gz: 15216a2b9582d61c40700ee3c57d1b98884461f9208988896f900ad04a285e31
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b461f4a54817613fa1c1dca42b83947aec71fe00961ab2de2cc8426e7e8bb5b4030c582e55dec7e2e17dc4512366a30b84207ad47c3f6d6979e220e0843ab654
|
|
7
|
+
data.tar.gz: e6fdf37b45fb3f4f929b8d43a801bfefc6367c4d5eee61a8718969cde3af0176baaf90b7cfeb069153a074d1beb642ff9e63666cfd7eeb43344105e1f81d0d34
|
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
|
|
@@ -380,6 +382,11 @@ Class | Method | HTTP request | Description
|
|
|
380
382
|
- [Zyphr::ConsentStatus](docs/ConsentStatus.md)
|
|
381
383
|
- [Zyphr::ConsentStatusResponse](docs/ConsentStatusResponse.md)
|
|
382
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)
|
|
383
390
|
- [Zyphr::CreateCategoryRequest](docs/CreateCategoryRequest.md)
|
|
384
391
|
- [Zyphr::CreateSubscriberRequest](docs/CreateSubscriberRequest.md)
|
|
385
392
|
- [Zyphr::CreateTemplateRequest](docs/CreateTemplateRequest.md)
|
|
@@ -486,6 +493,9 @@ Class | Method | HTTP request | Description
|
|
|
486
493
|
- [Zyphr::PasswordRequirements](docs/PasswordRequirements.md)
|
|
487
494
|
- [Zyphr::PasswordRequirementsResponse](docs/PasswordRequirementsResponse.md)
|
|
488
495
|
- [Zyphr::PasswordRequirementsResponseData](docs/PasswordRequirementsResponseData.md)
|
|
496
|
+
- [Zyphr::PayloadTooLargeError](docs/PayloadTooLargeError.md)
|
|
497
|
+
- [Zyphr::PayloadTooLargeErrorError](docs/PayloadTooLargeErrorError.md)
|
|
498
|
+
- [Zyphr::PayloadTooLargeErrorErrorDetails](docs/PayloadTooLargeErrorErrorDetails.md)
|
|
489
499
|
- [Zyphr::PhoneAuthAvailabilityResponse](docs/PhoneAuthAvailabilityResponse.md)
|
|
490
500
|
- [Zyphr::PhoneAuthAvailabilityResponseData](docs/PhoneAuthAvailabilityResponseData.md)
|
|
491
501
|
- [Zyphr::PhoneLoginVerifyRequest](docs/PhoneLoginVerifyRequest.md)
|
|
@@ -567,6 +577,7 @@ Class | Method | HTTP request | Description
|
|
|
567
577
|
- [Zyphr::SessionListResponseDataSessionInfo](docs/SessionListResponseDataSessionInfo.md)
|
|
568
578
|
- [Zyphr::SetPreferencesRequest](docs/SetPreferencesRequest.md)
|
|
569
579
|
- [Zyphr::SetPreferencesRequestPreferencesInner](docs/SetPreferencesRequestPreferencesInner.md)
|
|
580
|
+
- [Zyphr::SignInAnonymouslyRequest](docs/SignInAnonymouslyRequest.md)
|
|
570
581
|
- [Zyphr::SlackMessage](docs/SlackMessage.md)
|
|
571
582
|
- [Zyphr::SlackMessageListResponse](docs/SlackMessageListResponse.md)
|
|
572
583
|
- [Zyphr::SlackMessageListResponseMeta](docs/SlackMessageListResponseMeta.md)
|
data/docs/AuthRegistrationApi.md
CHANGED
|
@@ -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 \"this device has scores from me\" detection survives the upgrade. NULL for users who never signed in anonymously. | [optional] |
|
|
19
|
+
| **first_activity_at** | **Time** | Set on the user'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,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'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
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Zyphr::PayloadTooLargeError
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **error** | [**PayloadTooLargeErrorError**](PayloadTooLargeErrorError.md) | | |
|
|
8
|
+
| **meta** | [**RequestMeta**](RequestMeta.md) | | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'zyphr'
|
|
14
|
+
|
|
15
|
+
instance = Zyphr::PayloadTooLargeError.new(
|
|
16
|
+
error: null,
|
|
17
|
+
meta: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Zyphr::PayloadTooLargeErrorError
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **code** | **String** | | |
|
|
8
|
+
| **message** | **String** | | |
|
|
9
|
+
| **details** | [**PayloadTooLargeErrorErrorDetails**](PayloadTooLargeErrorErrorDetails.md) | | [optional] |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'zyphr'
|
|
15
|
+
|
|
16
|
+
instance = Zyphr::PayloadTooLargeErrorError.new(
|
|
17
|
+
code: payload_too_large,
|
|
18
|
+
message: Request body exceeds the maximum allowed size. See https://zyphr.dev/resources/api-limits for current limits.,
|
|
19
|
+
details: null
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Zyphr::PayloadTooLargeErrorErrorDetails
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **limit_bytes** | **Integer** | Maximum allowed request body size in bytes. | [optional] |
|
|
8
|
+
| **received_bytes** | **Integer** | Size of the rejected request body in bytes. | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'zyphr'
|
|
14
|
+
|
|
15
|
+
instance = Zyphr::PayloadTooLargeErrorErrorDetails.new(
|
|
16
|
+
limit_bytes: 26214400,
|
|
17
|
+
received_bytes: 30000000
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -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<String, Object>** | | [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
|
+
|
|
@@ -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
|