tensors-ruby 0.1.0
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 +7 -0
- data/Gemfile +9 -0
- data/README.md +154 -0
- data/lib/tensors-ruby/api/auth_api.rb +387 -0
- data/lib/tensors-ruby/api/civit_ai_api.rb +85 -0
- data/lib/tensors-ruby/api/comfy_uiapi_api.rb +582 -0
- data/lib/tensors-ruby/api/database_api.rb +655 -0
- data/lib/tensors-ruby/api/default_api.rb +77 -0
- data/lib/tensors-ruby/api/download_api.rb +210 -0
- data/lib/tensors-ruby/api/gallery_api.rb +416 -0
- data/lib/tensors-ruby/api/search_api.rb +129 -0
- data/lib/tensors-ruby/api_client.rb +441 -0
- data/lib/tensors-ruby/api_error.rb +58 -0
- data/lib/tensors-ruby/api_model_base.rb +88 -0
- data/lib/tensors-ruby/configuration.rb +399 -0
- data/lib/tensors-ruby/models/cache_request.rb +165 -0
- data/lib/tensors-ruby/models/download_request.rb +179 -0
- data/lib/tensors-ruby/models/generate_request.rb +444 -0
- data/lib/tensors-ruby/models/generate_response.rb +213 -0
- data/lib/tensors-ruby/models/http_validation_error.rb +149 -0
- data/lib/tensors-ruby/models/location_inner.rb +103 -0
- data/lib/tensors-ruby/models/metadata_update.rb +181 -0
- data/lib/tensors-ruby/models/models_response.rb +205 -0
- data/lib/tensors-ruby/models/provider.rb +41 -0
- data/lib/tensors-ruby/models/queue_status_response.rb +161 -0
- data/lib/tensors-ruby/models/scan_request.rb +165 -0
- data/lib/tensors-ruby/models/sort_order.rb +41 -0
- data/lib/tensors-ruby/models/system_stats_response.rb +161 -0
- data/lib/tensors-ruby/models/validation_error.rb +237 -0
- data/lib/tensors-ruby/models/workflow_request.rb +168 -0
- data/lib/tensors-ruby/models/workflow_response.rb +222 -0
- data/lib/tensors-ruby/version.rb +15 -0
- data/lib/tensors-ruby.rb +64 -0
- data/spec/api/auth_api_spec.rb +109 -0
- data/spec/api/civit_ai_api_spec.rb +47 -0
- data/spec/api/comfy_uiapi_api_spec.rb +141 -0
- data/spec/api/database_api_spec.rb +155 -0
- data/spec/api/default_api_spec.rb +45 -0
- data/spec/api/download_api_spec.rb +70 -0
- data/spec/api/gallery_api_spec.rb +109 -0
- data/spec/api/search_api_spec.rb +60 -0
- data/spec/models/cache_request_spec.rb +36 -0
- data/spec/models/download_request_spec.rb +54 -0
- data/spec/models/generate_request_spec.rb +108 -0
- data/spec/models/generate_response_spec.rb +54 -0
- data/spec/models/http_validation_error_spec.rb +36 -0
- data/spec/models/location_inner_spec.rb +21 -0
- data/spec/models/metadata_update_spec.rb +54 -0
- data/spec/models/models_response_spec.rb +66 -0
- data/spec/models/provider_spec.rb +30 -0
- data/spec/models/queue_status_response_spec.rb +42 -0
- data/spec/models/scan_request_spec.rb +36 -0
- data/spec/models/sort_order_spec.rb +30 -0
- data/spec/models/system_stats_response_spec.rb +42 -0
- data/spec/models/validation_error_spec.rb +60 -0
- data/spec/models/workflow_request_spec.rb +36 -0
- data/spec/models/workflow_response_spec.rb +60 -0
- data/spec/spec_helper.rb +111 -0
- data/tensors-ruby.gemspec +41 -0
- metadata +194 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 8f1624176344e744d84a0dc604154ae08c7d4b5a726658fd61b81f39691bfd27
|
|
4
|
+
data.tar.gz: 55180d94c3f3fb1fe18fa68fa88c1219580f572e58db7ced1261d23a280a7b64
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: e04e89866b6193fe691d149648415c8f86c89ae3cd30119307a63bc92984b92242509d33d8fbdb60d15a4258556548847da2d6d3c98c0fe96336349fd97808cb
|
|
7
|
+
data.tar.gz: d12acd991f36ec80b008dc11bfeaf6d1d75e30b3d7f0de37dad168b09a734f4f62d30150455072ed5c966eb4d67291683a222634c91fb28b95510e44e8955e9c
|
data/Gemfile
ADDED
data/README.md
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# tensors-ruby
|
|
2
|
+
|
|
3
|
+
TensorsApi - the Ruby gem for the tensors
|
|
4
|
+
|
|
5
|
+
API for CivitAI model management and image gallery
|
|
6
|
+
|
|
7
|
+
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
|
8
|
+
|
|
9
|
+
- API version: 0.1.18
|
|
10
|
+
- Package version: 0.1.0
|
|
11
|
+
- Generator version: 7.21.0
|
|
12
|
+
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
### Build a gem
|
|
17
|
+
|
|
18
|
+
To build the Ruby code into a gem:
|
|
19
|
+
|
|
20
|
+
```shell
|
|
21
|
+
gem build tensors-ruby.gemspec
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Then either install the gem locally:
|
|
25
|
+
|
|
26
|
+
```shell
|
|
27
|
+
gem install ./tensors-ruby-0.1.0.gem
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
(for development, run `gem install --dev ./tensors-ruby-0.1.0.gem` to install the development dependencies)
|
|
31
|
+
|
|
32
|
+
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
|
33
|
+
|
|
34
|
+
Finally add this to the Gemfile:
|
|
35
|
+
|
|
36
|
+
gem 'tensors-ruby', '~> 0.1.0'
|
|
37
|
+
|
|
38
|
+
### Install from Git
|
|
39
|
+
|
|
40
|
+
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
|
|
41
|
+
|
|
42
|
+
gem 'tensors-ruby', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
|
|
43
|
+
|
|
44
|
+
### Include the Ruby code directly
|
|
45
|
+
|
|
46
|
+
Include the Ruby code directly using `-I` as follows:
|
|
47
|
+
|
|
48
|
+
```shell
|
|
49
|
+
ruby -Ilib script.rb
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Getting Started
|
|
53
|
+
|
|
54
|
+
Please follow the [installation](#installation) procedure and then run the following code:
|
|
55
|
+
|
|
56
|
+
```ruby
|
|
57
|
+
# Load the gem
|
|
58
|
+
require 'tensors-ruby'
|
|
59
|
+
|
|
60
|
+
api_instance = TensorsApi::AuthApi.new
|
|
61
|
+
|
|
62
|
+
begin
|
|
63
|
+
#Auth Success
|
|
64
|
+
result = api_instance.auth_success_auth_success_get
|
|
65
|
+
p result
|
|
66
|
+
rescue TensorsApi::ApiError => e
|
|
67
|
+
puts "Exception when calling AuthApi->auth_success_auth_success_get: #{e}"
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Documentation for API Endpoints
|
|
73
|
+
|
|
74
|
+
All URIs are relative to *http://localhost*
|
|
75
|
+
|
|
76
|
+
Class | Method | HTTP request | Description
|
|
77
|
+
------------ | ------------- | ------------- | -------------
|
|
78
|
+
*TensorsApi::AuthApi* | [**auth_success_auth_success_get**](docs/AuthApi.md#auth_success_auth_success_get) | **GET** /auth/success | Auth Success
|
|
79
|
+
*TensorsApi::AuthApi* | [**github_auth_auth_github_get**](docs/AuthApi.md#github_auth_auth_github_get) | **GET** /auth/github | Github Auth
|
|
80
|
+
*TensorsApi::AuthApi* | [**github_callback_auth_callback_get**](docs/AuthApi.md#github_callback_auth_callback_get) | **GET** /auth/callback | Github Callback
|
|
81
|
+
*TensorsApi::AuthApi* | [**login_page_auth_login_get**](docs/AuthApi.md#login_page_auth_login_get) | **GET** /auth/login | Login Page
|
|
82
|
+
*TensorsApi::AuthApi* | [**logout_auth_logout_get**](docs/AuthApi.md#logout_auth_logout_get) | **GET** /auth/logout | Logout
|
|
83
|
+
*TensorsApi::AuthApi* | [**verify_token_auth_verify_get**](docs/AuthApi.md#verify_token_auth_verify_get) | **GET** /auth/verify | Verify Token
|
|
84
|
+
*TensorsApi::CivitAIApi* | [**get_model_api_civitai_model_model_id_get**](docs/CivitAIApi.md#get_model_api_civitai_model_model_id_get) | **GET** /api/civitai/model/{model_id} | Get Model
|
|
85
|
+
*TensorsApi::ComfyUIAPIApi* | [**comfyui_clear_queue_api_comfyui_queue_delete**](docs/ComfyUIAPIApi.md#comfyui_clear_queue_api_comfyui_queue_delete) | **DELETE** /api/comfyui/queue | Comfyui Clear Queue
|
|
86
|
+
*TensorsApi::ComfyUIAPIApi* | [**comfyui_generate_api_comfyui_generate_post**](docs/ComfyUIAPIApi.md#comfyui_generate_api_comfyui_generate_post) | **POST** /api/comfyui/generate | Comfyui Generate
|
|
87
|
+
*TensorsApi::ComfyUIAPIApi* | [**comfyui_history_detail_api_comfyui_history_prompt_id_get**](docs/ComfyUIAPIApi.md#comfyui_history_detail_api_comfyui_history_prompt_id_get) | **GET** /api/comfyui/history/{prompt_id} | Comfyui History Detail
|
|
88
|
+
*TensorsApi::ComfyUIAPIApi* | [**comfyui_history_list_api_comfyui_history_get**](docs/ComfyUIAPIApi.md#comfyui_history_list_api_comfyui_history_get) | **GET** /api/comfyui/history | Comfyui History List
|
|
89
|
+
*TensorsApi::ComfyUIAPIApi* | [**comfyui_image_api_comfyui_image_filename_get**](docs/ComfyUIAPIApi.md#comfyui_image_api_comfyui_image_filename_get) | **GET** /api/comfyui/image/{filename} | Comfyui Image
|
|
90
|
+
*TensorsApi::ComfyUIAPIApi* | [**comfyui_models_api_comfyui_models_get**](docs/ComfyUIAPIApi.md#comfyui_models_api_comfyui_models_get) | **GET** /api/comfyui/models | Comfyui Models
|
|
91
|
+
*TensorsApi::ComfyUIAPIApi* | [**comfyui_queue_api_comfyui_queue_get**](docs/ComfyUIAPIApi.md#comfyui_queue_api_comfyui_queue_get) | **GET** /api/comfyui/queue | Comfyui Queue
|
|
92
|
+
*TensorsApi::ComfyUIAPIApi* | [**comfyui_status_api_comfyui_status_get**](docs/ComfyUIAPIApi.md#comfyui_status_api_comfyui_status_get) | **GET** /api/comfyui/status | Comfyui Status
|
|
93
|
+
*TensorsApi::ComfyUIAPIApi* | [**comfyui_workflow_api_comfyui_workflow_post**](docs/ComfyUIAPIApi.md#comfyui_workflow_api_comfyui_workflow_post) | **POST** /api/comfyui/workflow | Comfyui Workflow
|
|
94
|
+
*TensorsApi::DatabaseApi* | [**cache_model_api_db_cache_post**](docs/DatabaseApi.md#cache_model_api_db_cache_post) | **POST** /api/db/cache | Cache Model
|
|
95
|
+
*TensorsApi::DatabaseApi* | [**get_file_api_db_files_file_id_get**](docs/DatabaseApi.md#get_file_api_db_files_file_id_get) | **GET** /api/db/files/{file_id} | Get File
|
|
96
|
+
*TensorsApi::DatabaseApi* | [**get_model_api_db_models_civitai_id_get**](docs/DatabaseApi.md#get_model_api_db_models_civitai_id_get) | **GET** /api/db/models/{civitai_id} | Get Model
|
|
97
|
+
*TensorsApi::DatabaseApi* | [**get_stats_api_db_stats_get**](docs/DatabaseApi.md#get_stats_api_db_stats_get) | **GET** /api/db/stats | Get Stats
|
|
98
|
+
*TensorsApi::DatabaseApi* | [**get_triggers_by_path_api_db_triggers_get**](docs/DatabaseApi.md#get_triggers_by_path_api_db_triggers_get) | **GET** /api/db/triggers | Get Triggers By Path
|
|
99
|
+
*TensorsApi::DatabaseApi* | [**get_triggers_by_version_api_db_triggers_version_id_get**](docs/DatabaseApi.md#get_triggers_by_version_api_db_triggers_version_id_get) | **GET** /api/db/triggers/{version_id} | Get Triggers By Version
|
|
100
|
+
*TensorsApi::DatabaseApi* | [**link_files_api_db_link_post**](docs/DatabaseApi.md#link_files_api_db_link_post) | **POST** /api/db/link | Link Files
|
|
101
|
+
*TensorsApi::DatabaseApi* | [**list_files_api_db_files_get**](docs/DatabaseApi.md#list_files_api_db_files_get) | **GET** /api/db/files | List Files
|
|
102
|
+
*TensorsApi::DatabaseApi* | [**scan_directory_api_db_scan_post**](docs/DatabaseApi.md#scan_directory_api_db_scan_post) | **POST** /api/db/scan | Scan Directory
|
|
103
|
+
*TensorsApi::DatabaseApi* | [**search_models_api_db_models_get**](docs/DatabaseApi.md#search_models_api_db_models_get) | **GET** /api/db/models | Search Models
|
|
104
|
+
*TensorsApi::DefaultApi* | [**status_status_get**](docs/DefaultApi.md#status_status_get) | **GET** /status | Status
|
|
105
|
+
*TensorsApi::DownloadApi* | [**get_download_status_api_download_status_download_id_get**](docs/DownloadApi.md#get_download_status_api_download_status_download_id_get) | **GET** /api/download/status/{download_id} | Get Download Status
|
|
106
|
+
*TensorsApi::DownloadApi* | [**list_active_downloads_api_download_active_get**](docs/DownloadApi.md#list_active_downloads_api_download_active_get) | **GET** /api/download/active | List Active Downloads
|
|
107
|
+
*TensorsApi::DownloadApi* | [**start_download_api_download_post**](docs/DownloadApi.md#start_download_api_download_post) | **POST** /api/download | Start Download
|
|
108
|
+
*TensorsApi::GalleryApi* | [**delete_image_api_images_image_id_delete**](docs/GalleryApi.md#delete_image_api_images_image_id_delete) | **DELETE** /api/images/{image_id} | Delete Image
|
|
109
|
+
*TensorsApi::GalleryApi* | [**edit_image_metadata_api_images_image_id_edit_post**](docs/GalleryApi.md#edit_image_metadata_api_images_image_id_edit_post) | **POST** /api/images/{image_id}/edit | Edit Image Metadata
|
|
110
|
+
*TensorsApi::GalleryApi* | [**gallery_stats_api_images_stats_summary_get**](docs/GalleryApi.md#gallery_stats_api_images_stats_summary_get) | **GET** /api/images/stats/summary | Gallery Stats
|
|
111
|
+
*TensorsApi::GalleryApi* | [**get_image_api_images_image_id_get**](docs/GalleryApi.md#get_image_api_images_image_id_get) | **GET** /api/images/{image_id} | Get Image
|
|
112
|
+
*TensorsApi::GalleryApi* | [**get_image_metadata_api_images_image_id_meta_get**](docs/GalleryApi.md#get_image_metadata_api_images_image_id_meta_get) | **GET** /api/images/{image_id}/meta | Get Image Metadata
|
|
113
|
+
*TensorsApi::GalleryApi* | [**list_images_api_images_get**](docs/GalleryApi.md#list_images_api_images_get) | **GET** /api/images | List Images
|
|
114
|
+
*TensorsApi::SearchApi* | [**search_models_api_search_get**](docs/SearchApi.md#search_models_api_search_get) | **GET** /api/search | Search Models
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
## Documentation for Models
|
|
118
|
+
|
|
119
|
+
- [TensorsApi::CacheRequest](docs/CacheRequest.md)
|
|
120
|
+
- [TensorsApi::DownloadRequest](docs/DownloadRequest.md)
|
|
121
|
+
- [TensorsApi::GenerateRequest](docs/GenerateRequest.md)
|
|
122
|
+
- [TensorsApi::GenerateResponse](docs/GenerateResponse.md)
|
|
123
|
+
- [TensorsApi::HTTPValidationError](docs/HTTPValidationError.md)
|
|
124
|
+
- [TensorsApi::LocationInner](docs/LocationInner.md)
|
|
125
|
+
- [TensorsApi::MetadataUpdate](docs/MetadataUpdate.md)
|
|
126
|
+
- [TensorsApi::ModelsResponse](docs/ModelsResponse.md)
|
|
127
|
+
- [TensorsApi::Provider](docs/Provider.md)
|
|
128
|
+
- [TensorsApi::QueueStatusResponse](docs/QueueStatusResponse.md)
|
|
129
|
+
- [TensorsApi::ScanRequest](docs/ScanRequest.md)
|
|
130
|
+
- [TensorsApi::SortOrder](docs/SortOrder.md)
|
|
131
|
+
- [TensorsApi::SystemStatsResponse](docs/SystemStatsResponse.md)
|
|
132
|
+
- [TensorsApi::ValidationError](docs/ValidationError.md)
|
|
133
|
+
- [TensorsApi::WorkflowRequest](docs/WorkflowRequest.md)
|
|
134
|
+
- [TensorsApi::WorkflowResponse](docs/WorkflowResponse.md)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
## Documentation for Authorization
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
Authentication schemes defined for the API:
|
|
141
|
+
### APIKeyHeader
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
- **Type**: API key
|
|
145
|
+
- **API key parameter name**: X-API-Key
|
|
146
|
+
- **Location**: HTTP header
|
|
147
|
+
|
|
148
|
+
### APIKeyQuery
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
- **Type**: API key
|
|
152
|
+
- **API key parameter name**: api_key
|
|
153
|
+
- **Location**: URL query string
|
|
154
|
+
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#tensors
|
|
3
|
+
|
|
4
|
+
#API for CivitAI model management and image gallery
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.1.18
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.21.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module TensorsApi
|
|
16
|
+
class AuthApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Auth Success
|
|
23
|
+
# Show success page after login.
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @return [Object]
|
|
26
|
+
def auth_success_auth_success_get(opts = {})
|
|
27
|
+
data, _status_code, _headers = auth_success_auth_success_get_with_http_info(opts)
|
|
28
|
+
data
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Auth Success
|
|
32
|
+
# Show success page after login.
|
|
33
|
+
# @param [Hash] opts the optional parameters
|
|
34
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
35
|
+
def auth_success_auth_success_get_with_http_info(opts = {})
|
|
36
|
+
if @api_client.config.debugging
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: AuthApi.auth_success_auth_success_get ...'
|
|
38
|
+
end
|
|
39
|
+
# resource path
|
|
40
|
+
local_var_path = '/auth/success'
|
|
41
|
+
|
|
42
|
+
# query parameters
|
|
43
|
+
query_params = opts[:query_params] || {}
|
|
44
|
+
|
|
45
|
+
# header parameters
|
|
46
|
+
header_params = opts[:header_params] || {}
|
|
47
|
+
# HTTP header 'Accept' (if needed)
|
|
48
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
49
|
+
|
|
50
|
+
# form parameters
|
|
51
|
+
form_params = opts[:form_params] || {}
|
|
52
|
+
|
|
53
|
+
# http body (model)
|
|
54
|
+
post_body = opts[:debug_body]
|
|
55
|
+
|
|
56
|
+
# return_type
|
|
57
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
58
|
+
|
|
59
|
+
# auth_names
|
|
60
|
+
auth_names = opts[:debug_auth_names] || []
|
|
61
|
+
|
|
62
|
+
new_options = opts.merge(
|
|
63
|
+
:operation => :"AuthApi.auth_success_auth_success_get",
|
|
64
|
+
:header_params => header_params,
|
|
65
|
+
:query_params => query_params,
|
|
66
|
+
:form_params => form_params,
|
|
67
|
+
:body => post_body,
|
|
68
|
+
:auth_names => auth_names,
|
|
69
|
+
:return_type => return_type
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
73
|
+
if @api_client.config.debugging
|
|
74
|
+
@api_client.config.logger.debug "API called: AuthApi#auth_success_auth_success_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
75
|
+
end
|
|
76
|
+
return data, status_code, headers
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Github Auth
|
|
80
|
+
# Redirect to GitHub OAuth.
|
|
81
|
+
# @param [Hash] opts the optional parameters
|
|
82
|
+
# @option opts [String] :return_url URL to redirect after login
|
|
83
|
+
# @return [Object]
|
|
84
|
+
def github_auth_auth_github_get(opts = {})
|
|
85
|
+
data, _status_code, _headers = github_auth_auth_github_get_with_http_info(opts)
|
|
86
|
+
data
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Github Auth
|
|
90
|
+
# Redirect to GitHub OAuth.
|
|
91
|
+
# @param [Hash] opts the optional parameters
|
|
92
|
+
# @option opts [String] :return_url URL to redirect after login
|
|
93
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
94
|
+
def github_auth_auth_github_get_with_http_info(opts = {})
|
|
95
|
+
if @api_client.config.debugging
|
|
96
|
+
@api_client.config.logger.debug 'Calling API: AuthApi.github_auth_auth_github_get ...'
|
|
97
|
+
end
|
|
98
|
+
# resource path
|
|
99
|
+
local_var_path = '/auth/github'
|
|
100
|
+
|
|
101
|
+
# query parameters
|
|
102
|
+
query_params = opts[:query_params] || {}
|
|
103
|
+
query_params[:'return_url'] = opts[:'return_url'] if !opts[:'return_url'].nil?
|
|
104
|
+
|
|
105
|
+
# header parameters
|
|
106
|
+
header_params = opts[:header_params] || {}
|
|
107
|
+
# HTTP header 'Accept' (if needed)
|
|
108
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
109
|
+
|
|
110
|
+
# form parameters
|
|
111
|
+
form_params = opts[:form_params] || {}
|
|
112
|
+
|
|
113
|
+
# http body (model)
|
|
114
|
+
post_body = opts[:debug_body]
|
|
115
|
+
|
|
116
|
+
# return_type
|
|
117
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
118
|
+
|
|
119
|
+
# auth_names
|
|
120
|
+
auth_names = opts[:debug_auth_names] || []
|
|
121
|
+
|
|
122
|
+
new_options = opts.merge(
|
|
123
|
+
:operation => :"AuthApi.github_auth_auth_github_get",
|
|
124
|
+
:header_params => header_params,
|
|
125
|
+
:query_params => query_params,
|
|
126
|
+
:form_params => form_params,
|
|
127
|
+
:body => post_body,
|
|
128
|
+
:auth_names => auth_names,
|
|
129
|
+
:return_type => return_type
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
133
|
+
if @api_client.config.debugging
|
|
134
|
+
@api_client.config.logger.debug "API called: AuthApi#github_auth_auth_github_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
135
|
+
end
|
|
136
|
+
return data, status_code, headers
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Github Callback
|
|
140
|
+
# Handle GitHub OAuth callback.
|
|
141
|
+
# @param [Hash] opts the optional parameters
|
|
142
|
+
# @option opts [String] :code
|
|
143
|
+
# @option opts [String] :state
|
|
144
|
+
# @return [Object]
|
|
145
|
+
def github_callback_auth_callback_get(opts = {})
|
|
146
|
+
data, _status_code, _headers = github_callback_auth_callback_get_with_http_info(opts)
|
|
147
|
+
data
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Github Callback
|
|
151
|
+
# Handle GitHub OAuth callback.
|
|
152
|
+
# @param [Hash] opts the optional parameters
|
|
153
|
+
# @option opts [String] :code
|
|
154
|
+
# @option opts [String] :state
|
|
155
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
156
|
+
def github_callback_auth_callback_get_with_http_info(opts = {})
|
|
157
|
+
if @api_client.config.debugging
|
|
158
|
+
@api_client.config.logger.debug 'Calling API: AuthApi.github_callback_auth_callback_get ...'
|
|
159
|
+
end
|
|
160
|
+
# resource path
|
|
161
|
+
local_var_path = '/auth/callback'
|
|
162
|
+
|
|
163
|
+
# query parameters
|
|
164
|
+
query_params = opts[:query_params] || {}
|
|
165
|
+
query_params[:'code'] = opts[:'code'] if !opts[:'code'].nil?
|
|
166
|
+
query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
|
|
167
|
+
|
|
168
|
+
# header parameters
|
|
169
|
+
header_params = opts[:header_params] || {}
|
|
170
|
+
# HTTP header 'Accept' (if needed)
|
|
171
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
172
|
+
|
|
173
|
+
# form parameters
|
|
174
|
+
form_params = opts[:form_params] || {}
|
|
175
|
+
|
|
176
|
+
# http body (model)
|
|
177
|
+
post_body = opts[:debug_body]
|
|
178
|
+
|
|
179
|
+
# return_type
|
|
180
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
181
|
+
|
|
182
|
+
# auth_names
|
|
183
|
+
auth_names = opts[:debug_auth_names] || []
|
|
184
|
+
|
|
185
|
+
new_options = opts.merge(
|
|
186
|
+
:operation => :"AuthApi.github_callback_auth_callback_get",
|
|
187
|
+
:header_params => header_params,
|
|
188
|
+
:query_params => query_params,
|
|
189
|
+
:form_params => form_params,
|
|
190
|
+
:body => post_body,
|
|
191
|
+
:auth_names => auth_names,
|
|
192
|
+
:return_type => return_type
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
196
|
+
if @api_client.config.debugging
|
|
197
|
+
@api_client.config.logger.debug "API called: AuthApi#github_callback_auth_callback_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
198
|
+
end
|
|
199
|
+
return data, status_code, headers
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Login Page
|
|
203
|
+
# Show login page.
|
|
204
|
+
# @param [Hash] opts the optional parameters
|
|
205
|
+
# @option opts [String] :return_url URL to redirect after login
|
|
206
|
+
# @option opts [String] :error
|
|
207
|
+
# @return [Object]
|
|
208
|
+
def login_page_auth_login_get(opts = {})
|
|
209
|
+
data, _status_code, _headers = login_page_auth_login_get_with_http_info(opts)
|
|
210
|
+
data
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# Login Page
|
|
214
|
+
# Show login page.
|
|
215
|
+
# @param [Hash] opts the optional parameters
|
|
216
|
+
# @option opts [String] :return_url URL to redirect after login
|
|
217
|
+
# @option opts [String] :error
|
|
218
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
219
|
+
def login_page_auth_login_get_with_http_info(opts = {})
|
|
220
|
+
if @api_client.config.debugging
|
|
221
|
+
@api_client.config.logger.debug 'Calling API: AuthApi.login_page_auth_login_get ...'
|
|
222
|
+
end
|
|
223
|
+
# resource path
|
|
224
|
+
local_var_path = '/auth/login'
|
|
225
|
+
|
|
226
|
+
# query parameters
|
|
227
|
+
query_params = opts[:query_params] || {}
|
|
228
|
+
query_params[:'return_url'] = opts[:'return_url'] if !opts[:'return_url'].nil?
|
|
229
|
+
query_params[:'error'] = opts[:'error'] if !opts[:'error'].nil?
|
|
230
|
+
|
|
231
|
+
# header parameters
|
|
232
|
+
header_params = opts[:header_params] || {}
|
|
233
|
+
# HTTP header 'Accept' (if needed)
|
|
234
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
235
|
+
|
|
236
|
+
# form parameters
|
|
237
|
+
form_params = opts[:form_params] || {}
|
|
238
|
+
|
|
239
|
+
# http body (model)
|
|
240
|
+
post_body = opts[:debug_body]
|
|
241
|
+
|
|
242
|
+
# return_type
|
|
243
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
244
|
+
|
|
245
|
+
# auth_names
|
|
246
|
+
auth_names = opts[:debug_auth_names] || []
|
|
247
|
+
|
|
248
|
+
new_options = opts.merge(
|
|
249
|
+
:operation => :"AuthApi.login_page_auth_login_get",
|
|
250
|
+
:header_params => header_params,
|
|
251
|
+
:query_params => query_params,
|
|
252
|
+
:form_params => form_params,
|
|
253
|
+
:body => post_body,
|
|
254
|
+
:auth_names => auth_names,
|
|
255
|
+
:return_type => return_type
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
259
|
+
if @api_client.config.debugging
|
|
260
|
+
@api_client.config.logger.debug "API called: AuthApi#login_page_auth_login_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
261
|
+
end
|
|
262
|
+
return data, status_code, headers
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# Logout
|
|
266
|
+
# Clear session and redirect.
|
|
267
|
+
# @param [Hash] opts the optional parameters
|
|
268
|
+
# @option opts [String] :return_url
|
|
269
|
+
# @return [Object]
|
|
270
|
+
def logout_auth_logout_get(opts = {})
|
|
271
|
+
data, _status_code, _headers = logout_auth_logout_get_with_http_info(opts)
|
|
272
|
+
data
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
# Logout
|
|
276
|
+
# Clear session and redirect.
|
|
277
|
+
# @param [Hash] opts the optional parameters
|
|
278
|
+
# @option opts [String] :return_url
|
|
279
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
280
|
+
def logout_auth_logout_get_with_http_info(opts = {})
|
|
281
|
+
if @api_client.config.debugging
|
|
282
|
+
@api_client.config.logger.debug 'Calling API: AuthApi.logout_auth_logout_get ...'
|
|
283
|
+
end
|
|
284
|
+
# resource path
|
|
285
|
+
local_var_path = '/auth/logout'
|
|
286
|
+
|
|
287
|
+
# query parameters
|
|
288
|
+
query_params = opts[:query_params] || {}
|
|
289
|
+
query_params[:'return_url'] = opts[:'return_url'] if !opts[:'return_url'].nil?
|
|
290
|
+
|
|
291
|
+
# header parameters
|
|
292
|
+
header_params = opts[:header_params] || {}
|
|
293
|
+
# HTTP header 'Accept' (if needed)
|
|
294
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
295
|
+
|
|
296
|
+
# form parameters
|
|
297
|
+
form_params = opts[:form_params] || {}
|
|
298
|
+
|
|
299
|
+
# http body (model)
|
|
300
|
+
post_body = opts[:debug_body]
|
|
301
|
+
|
|
302
|
+
# return_type
|
|
303
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
304
|
+
|
|
305
|
+
# auth_names
|
|
306
|
+
auth_names = opts[:debug_auth_names] || []
|
|
307
|
+
|
|
308
|
+
new_options = opts.merge(
|
|
309
|
+
:operation => :"AuthApi.logout_auth_logout_get",
|
|
310
|
+
:header_params => header_params,
|
|
311
|
+
:query_params => query_params,
|
|
312
|
+
:form_params => form_params,
|
|
313
|
+
:body => post_body,
|
|
314
|
+
:auth_names => auth_names,
|
|
315
|
+
:return_type => return_type
|
|
316
|
+
)
|
|
317
|
+
|
|
318
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
319
|
+
if @api_client.config.debugging
|
|
320
|
+
@api_client.config.logger.debug "API called: AuthApi#logout_auth_logout_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
321
|
+
end
|
|
322
|
+
return data, status_code, headers
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
# Verify Token
|
|
326
|
+
# Verify a session token. Returns user info if valid.
|
|
327
|
+
# @param [Hash] opts the optional parameters
|
|
328
|
+
# @option opts [String] :token
|
|
329
|
+
# @option opts [String] :tensors_session
|
|
330
|
+
# @return [Object]
|
|
331
|
+
def verify_token_auth_verify_get(opts = {})
|
|
332
|
+
data, _status_code, _headers = verify_token_auth_verify_get_with_http_info(opts)
|
|
333
|
+
data
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
# Verify Token
|
|
337
|
+
# Verify a session token. Returns user info if valid.
|
|
338
|
+
# @param [Hash] opts the optional parameters
|
|
339
|
+
# @option opts [String] :token
|
|
340
|
+
# @option opts [String] :tensors_session
|
|
341
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
342
|
+
def verify_token_auth_verify_get_with_http_info(opts = {})
|
|
343
|
+
if @api_client.config.debugging
|
|
344
|
+
@api_client.config.logger.debug 'Calling API: AuthApi.verify_token_auth_verify_get ...'
|
|
345
|
+
end
|
|
346
|
+
# resource path
|
|
347
|
+
local_var_path = '/auth/verify'
|
|
348
|
+
|
|
349
|
+
# query parameters
|
|
350
|
+
query_params = opts[:query_params] || {}
|
|
351
|
+
query_params[:'token'] = opts[:'token'] if !opts[:'token'].nil?
|
|
352
|
+
|
|
353
|
+
# header parameters
|
|
354
|
+
header_params = opts[:header_params] || {}
|
|
355
|
+
# HTTP header 'Accept' (if needed)
|
|
356
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
357
|
+
|
|
358
|
+
# form parameters
|
|
359
|
+
form_params = opts[:form_params] || {}
|
|
360
|
+
|
|
361
|
+
# http body (model)
|
|
362
|
+
post_body = opts[:debug_body]
|
|
363
|
+
|
|
364
|
+
# return_type
|
|
365
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
366
|
+
|
|
367
|
+
# auth_names
|
|
368
|
+
auth_names = opts[:debug_auth_names] || []
|
|
369
|
+
|
|
370
|
+
new_options = opts.merge(
|
|
371
|
+
:operation => :"AuthApi.verify_token_auth_verify_get",
|
|
372
|
+
:header_params => header_params,
|
|
373
|
+
:query_params => query_params,
|
|
374
|
+
:form_params => form_params,
|
|
375
|
+
:body => post_body,
|
|
376
|
+
:auth_names => auth_names,
|
|
377
|
+
:return_type => return_type
|
|
378
|
+
)
|
|
379
|
+
|
|
380
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
381
|
+
if @api_client.config.debugging
|
|
382
|
+
@api_client.config.logger.debug "API called: AuthApi#verify_token_auth_verify_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
383
|
+
end
|
|
384
|
+
return data, status_code, headers
|
|
385
|
+
end
|
|
386
|
+
end
|
|
387
|
+
end
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#tensors
|
|
3
|
+
|
|
4
|
+
#API for CivitAI model management and image gallery
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.1.18
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.21.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module TensorsApi
|
|
16
|
+
class CivitAIApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get Model
|
|
23
|
+
# Get model details from CivitAI and cache to database.
|
|
24
|
+
# @param model_id [Integer]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [Object]
|
|
27
|
+
def get_model_api_civitai_model_model_id_get(model_id, opts = {})
|
|
28
|
+
data, _status_code, _headers = get_model_api_civitai_model_model_id_get_with_http_info(model_id, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Get Model
|
|
33
|
+
# Get model details from CivitAI and cache to database.
|
|
34
|
+
# @param model_id [Integer]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
37
|
+
def get_model_api_civitai_model_model_id_get_with_http_info(model_id, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: CivitAIApi.get_model_api_civitai_model_model_id_get ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'model_id' is set
|
|
42
|
+
if @api_client.config.client_side_validation && model_id.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'model_id' when calling CivitAIApi.get_model_api_civitai_model_model_id_get"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/api/civitai/model/{model_id}'.sub('{' + 'model_id' + '}', CGI.escape(model_id.to_s))
|
|
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
|
+
|
|
56
|
+
# form parameters
|
|
57
|
+
form_params = opts[:form_params] || {}
|
|
58
|
+
|
|
59
|
+
# http body (model)
|
|
60
|
+
post_body = opts[:debug_body]
|
|
61
|
+
|
|
62
|
+
# return_type
|
|
63
|
+
return_type = opts[:debug_return_type] || 'Object'
|
|
64
|
+
|
|
65
|
+
# auth_names
|
|
66
|
+
auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'APIKeyQuery']
|
|
67
|
+
|
|
68
|
+
new_options = opts.merge(
|
|
69
|
+
:operation => :"CivitAIApi.get_model_api_civitai_model_model_id_get",
|
|
70
|
+
:header_params => header_params,
|
|
71
|
+
:query_params => query_params,
|
|
72
|
+
:form_params => form_params,
|
|
73
|
+
:body => post_body,
|
|
74
|
+
:auth_names => auth_names,
|
|
75
|
+
:return_type => return_type
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
79
|
+
if @api_client.config.debugging
|
|
80
|
+
@api_client.config.logger.debug "API called: CivitAIApi#get_model_api_civitai_model_model_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
81
|
+
end
|
|
82
|
+
return data, status_code, headers
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|