zyphr 0.1.32 → 0.1.33
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 +41 -0
- data/docs/AddOrganizationMemberRequest.md +20 -0
- data/docs/AuthOrganizationsApi.md +864 -0
- data/docs/AuthUserProfileApi.md +76 -0
- data/docs/CreateOrganizationRequest.md +22 -0
- data/docs/LoginRequest.md +3 -1
- data/docs/MuseApi.md +681 -0
- data/docs/Organization.md +34 -0
- data/docs/OrganizationListResponse.md +20 -0
- data/docs/OrganizationListResponseMeta.md +20 -0
- data/docs/OrganizationMembersListResponse.md +20 -0
- data/docs/OrganizationMembership.md +30 -0
- data/docs/OrganizationMembershipResponse.md +20 -0
- data/docs/OrganizationMembershipWithUser.md +34 -0
- data/docs/OrganizationResponse.md +20 -0
- data/docs/RegisterRequest.md +5 -1
- data/docs/SwitchOrganizationRequest.md +20 -0
- data/docs/SwitchOrganizationResponse.md +20 -0
- data/docs/SwitchOrganizationResponseData.md +22 -0
- data/docs/SwitchOrganizationResponseDataTokens.md +24 -0
- data/docs/SwitchOrganizationResponseDataUser.md +20 -0
- data/docs/UpdateOrganizationMemberRoleRequest.md +18 -0
- data/docs/UpdateOrganizationRequest.md +22 -0
- data/docs/V1MuseSubjectsSuggestPostRequest.md +24 -0
- data/lib/zyphr/api/auth_organizations_api.rb +773 -0
- data/lib/zyphr/api/auth_user_profile_api.rb +61 -0
- data/lib/zyphr/api/muse_api.rb +644 -0
- data/lib/zyphr/models/add_organization_member_request.rb +248 -0
- data/lib/zyphr/models/create_organization_request.rb +258 -0
- data/lib/zyphr/models/login_request.rb +14 -4
- data/lib/zyphr/models/organization.rb +434 -0
- data/lib/zyphr/models/organization_list_response.rb +265 -0
- data/lib/zyphr/models/organization_list_response_meta.rb +230 -0
- data/lib/zyphr/models/organization_members_list_response.rb +265 -0
- data/lib/zyphr/models/organization_membership.rb +379 -0
- data/lib/zyphr/models/organization_membership_response.rb +263 -0
- data/lib/zyphr/models/organization_membership_with_user.rb +405 -0
- data/lib/zyphr/models/organization_response.rb +263 -0
- data/lib/zyphr/models/register_request.rb +43 -4
- data/lib/zyphr/models/switch_organization_request.rb +263 -0
- data/lib/zyphr/models/switch_organization_response.rb +263 -0
- data/lib/zyphr/models/switch_organization_response_data.rb +289 -0
- data/lib/zyphr/models/switch_organization_response_data_tokens.rb +339 -0
- data/lib/zyphr/models/switch_organization_response_data_user.rb +230 -0
- data/lib/zyphr/models/update_organization_member_role_request.rb +223 -0
- data/lib/zyphr/models/update_organization_request.rb +239 -0
- data/lib/zyphr/models/v1_muse_subjects_suggest_post_request.rb +326 -0
- data/lib/zyphr.rb +20 -0
- data/spec/api/auth_organizations_api_spec.rb +171 -0
- data/spec/api/auth_user_profile_api_spec.rb +12 -0
- data/spec/api/muse_api_spec.rb +156 -0
- data/spec/models/add_organization_member_request_spec.rb +42 -0
- data/spec/models/create_organization_request_spec.rb +48 -0
- data/spec/models/login_request_spec.rb +6 -0
- data/spec/models/organization_list_response_meta_spec.rb +42 -0
- data/spec/models/organization_list_response_spec.rb +42 -0
- data/spec/models/organization_members_list_response_spec.rb +42 -0
- data/spec/models/organization_membership_response_spec.rb +42 -0
- data/spec/models/organization_membership_spec.rb +72 -0
- data/spec/models/organization_membership_with_user_spec.rb +84 -0
- data/spec/models/organization_response_spec.rb +42 -0
- data/spec/models/organization_spec.rb +84 -0
- data/spec/models/register_request_spec.rb +12 -0
- data/spec/models/switch_organization_request_spec.rb +42 -0
- data/spec/models/switch_organization_response_data_spec.rb +48 -0
- data/spec/models/switch_organization_response_data_tokens_spec.rb +58 -0
- data/spec/models/switch_organization_response_data_user_spec.rb +42 -0
- data/spec/models/switch_organization_response_spec.rb +42 -0
- data/spec/models/update_organization_member_role_request_spec.rb +36 -0
- data/spec/models/update_organization_request_spec.rb +48 -0
- data/spec/models/v1_muse_subjects_suggest_post_request_spec.rb +58 -0
- data/zyphr.gemspec +1 -1
- metadata +82 -2
data/docs/AuthUserProfileApi.md
CHANGED
|
@@ -5,6 +5,7 @@ All URIs are relative to *https://api.zyphr.dev/v1*
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
| ------ | ------------ | ----------- |
|
|
7
7
|
| [**delete_end_user**](AuthUserProfileApi.md#delete_end_user) | **DELETE** /auth/users/me | Delete current end user account |
|
|
8
|
+
| [**delete_end_user_by_application**](AuthUserProfileApi.md#delete_end_user_by_application) | **DELETE** /auth/users/{user_id} | Delete an end user (test environment only) |
|
|
8
9
|
| [**get_end_user**](AuthUserProfileApi.md#get_end_user) | **GET** /auth/users/me | Get current end user profile |
|
|
9
10
|
| [**update_end_user**](AuthUserProfileApi.md#update_end_user) | **PATCH** /auth/users/me | Update current end user profile |
|
|
10
11
|
|
|
@@ -80,6 +81,81 @@ This endpoint does not need any parameter.
|
|
|
80
81
|
- **Accept**: application/json
|
|
81
82
|
|
|
82
83
|
|
|
84
|
+
## delete_end_user_by_application
|
|
85
|
+
|
|
86
|
+
> delete_end_user_by_application(user_id)
|
|
87
|
+
|
|
88
|
+
Delete an end user (test environment only)
|
|
89
|
+
|
|
90
|
+
App-credentialed soft-delete for an end user, scoped to the test environment only. Live-mode credentials receive 403 — this is the intentional safety guard against a misconfigured CI runner nuking production users. Mirrors the self-service `DELETE /auth/users/me` flow: revokes all sessions, soft-deletes the row (status='deleted'), and emits a `user.deleted` webhook with `method='application_admin'`. The audit log row survives (no FK to end_users), so org-history queries still resolve. Intended for smoke / test-fixture cleanup. Production deletes should continue to use `DELETE /auth/users/me` from the end-user's own session or the dashboard.
|
|
91
|
+
|
|
92
|
+
### Examples
|
|
93
|
+
|
|
94
|
+
```ruby
|
|
95
|
+
require 'time'
|
|
96
|
+
require 'zyphr'
|
|
97
|
+
# setup authorization
|
|
98
|
+
Zyphr.configure do |config|
|
|
99
|
+
# Configure API key authorization: ApplicationSecret
|
|
100
|
+
config.api_key['X-Application-Secret'] = 'YOUR API KEY'
|
|
101
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
102
|
+
# config.api_key_prefix['X-Application-Secret'] = 'Bearer'
|
|
103
|
+
|
|
104
|
+
# Configure API key authorization: ApplicationPublicKey
|
|
105
|
+
config.api_key['X-Application-Key'] = 'YOUR API KEY'
|
|
106
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
107
|
+
# config.api_key_prefix['X-Application-Key'] = 'Bearer'
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
api_instance = Zyphr::AuthUserProfileApi.new
|
|
111
|
+
user_id = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String |
|
|
112
|
+
|
|
113
|
+
begin
|
|
114
|
+
# Delete an end user (test environment only)
|
|
115
|
+
api_instance.delete_end_user_by_application(user_id)
|
|
116
|
+
rescue Zyphr::ApiError => e
|
|
117
|
+
puts "Error when calling AuthUserProfileApi->delete_end_user_by_application: #{e}"
|
|
118
|
+
end
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
#### Using the delete_end_user_by_application_with_http_info variant
|
|
122
|
+
|
|
123
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
|
124
|
+
|
|
125
|
+
> <Array(nil, Integer, Hash)> delete_end_user_by_application_with_http_info(user_id)
|
|
126
|
+
|
|
127
|
+
```ruby
|
|
128
|
+
begin
|
|
129
|
+
# Delete an end user (test environment only)
|
|
130
|
+
data, status_code, headers = api_instance.delete_end_user_by_application_with_http_info(user_id)
|
|
131
|
+
p status_code # => 2xx
|
|
132
|
+
p headers # => { ... }
|
|
133
|
+
p data # => nil
|
|
134
|
+
rescue Zyphr::ApiError => e
|
|
135
|
+
puts "Error when calling AuthUserProfileApi->delete_end_user_by_application_with_http_info: #{e}"
|
|
136
|
+
end
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Parameters
|
|
140
|
+
|
|
141
|
+
| Name | Type | Description | Notes |
|
|
142
|
+
| ---- | ---- | ----------- | ----- |
|
|
143
|
+
| **user_id** | **String** | | |
|
|
144
|
+
|
|
145
|
+
### Return type
|
|
146
|
+
|
|
147
|
+
nil (empty response body)
|
|
148
|
+
|
|
149
|
+
### Authorization
|
|
150
|
+
|
|
151
|
+
[ApplicationSecret](../README.md#ApplicationSecret), [ApplicationPublicKey](../README.md#ApplicationPublicKey)
|
|
152
|
+
|
|
153
|
+
### HTTP request headers
|
|
154
|
+
|
|
155
|
+
- **Content-Type**: Not defined
|
|
156
|
+
- **Accept**: Not defined
|
|
157
|
+
|
|
158
|
+
|
|
83
159
|
## get_end_user
|
|
84
160
|
|
|
85
161
|
> <AuthUserResponse> get_end_user
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Zyphr::CreateOrganizationRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **name** | **String** | | |
|
|
8
|
+
| **slug** | **String** | Optional human-friendly identifier, unique per environment when present. | [optional] |
|
|
9
|
+
| **metadata** | **Object** | Integrator-owned opaque JSON. | [optional] |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'zyphr'
|
|
15
|
+
|
|
16
|
+
instance = Zyphr::CreateOrganizationRequest.new(
|
|
17
|
+
name: Acme Inc,
|
|
18
|
+
slug: acme,
|
|
19
|
+
metadata: null
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
data/docs/LoginRequest.md
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
| **email** | **String** | | |
|
|
8
8
|
| **password** | **String** | | |
|
|
9
9
|
| **custom_claims** | **Hash<String, Object>** | Custom claims to embed in JWT (max 4KB) | [optional] |
|
|
10
|
+
| **organization_id** | **String** | Optional active organization for the resulting token (sc-5591). If specified the user must be a member; the token's org_id is set to it. If omitted and the user has 0 or 1 non-Default memberships, org_id is auto-populated. If 2+ memberships, omit and call switchOrganization to pick. Requires Pro/Enterprise. | [optional] |
|
|
10
11
|
|
|
11
12
|
## Example
|
|
12
13
|
|
|
@@ -16,7 +17,8 @@ require 'zyphr'
|
|
|
16
17
|
instance = Zyphr::LoginRequest.new(
|
|
17
18
|
email: null,
|
|
18
19
|
password: null,
|
|
19
|
-
custom_claims: null
|
|
20
|
+
custom_claims: null,
|
|
21
|
+
organization_id: null
|
|
20
22
|
)
|
|
21
23
|
```
|
|
22
24
|
|