comfydeploy 0.0.1
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/lib/comfydeploy.rb +20 -0
- data/lib/open_api_sdk/comfydeploy.rb +85 -0
- data/lib/open_api_sdk/comfyui.rb +308 -0
- data/lib/open_api_sdk/files.rb +67 -0
- data/lib/open_api_sdk/machines.rb +214 -0
- data/lib/open_api_sdk/models/operations/custom_nodes.rb +45 -0
- data/lib/open_api_sdk/models/operations/dependencies.rb +36 -0
- data/lib/open_api_sdk/models/operations/environment.rb +19 -0
- data/lib/open_api_sdk/models/operations/eventtype.rb +19 -0
- data/lib/open_api_sdk/models/operations/fields_.rb +19 -0
- data/lib/open_api_sdk/models/operations/files.rb +30 -0
- data/lib/open_api_sdk/models/operations/get_auth_response_request_id_comfyui_response_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/get_auth_response_request_id_comfyui_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/get_auth_response_request_id_request.rb +24 -0
- data/lib/open_api_sdk/models/operations/get_auth_response_request_id_response.rb +42 -0
- data/lib/open_api_sdk/models/operations/get_auth_response_request_id_responsebody.rb +27 -0
- data/lib/open_api_sdk/models/operations/get_deployment_comfyui_responsebody.rb +20 -0
- data/lib/open_api_sdk/models/operations/get_deployment_id_inputs_request.rb +24 -0
- data/lib/open_api_sdk/models/operations/get_deployment_id_inputs_response.rb +39 -0
- data/lib/open_api_sdk/models/operations/get_deployment_id_inputs_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/get_deployment_request.rb +24 -0
- data/lib/open_api_sdk/models/operations/get_deployment_response.rb +36 -0
- data/lib/open_api_sdk/models/operations/get_deployment_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/get_run_gpu.rb +22 -0
- data/lib/open_api_sdk/models/operations/get_run_request.rb +24 -0
- data/lib/open_api_sdk/models/operations/get_run_response.rb +42 -0
- data/lib/open_api_sdk/models/operations/get_run_responsebody.rb +93 -0
- data/lib/open_api_sdk/models/operations/get_run_run_response_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/get_run_run_responsebody.rb +27 -0
- data/lib/open_api_sdk/models/operations/get_run_workflow_api.rb +20 -0
- data/lib/open_api_sdk/models/operations/get_upload_url_files_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/get_upload_url_request.rb +27 -0
- data/lib/open_api_sdk/models/operations/get_upload_url_response.rb +39 -0
- data/lib/open_api_sdk/models/operations/get_upload_url_responsebody.rb +30 -0
- data/lib/open_api_sdk/models/operations/get_v1_machines_machine_id_machines_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/get_v1_machines_machine_id_request.rb +27 -0
- data/lib/open_api_sdk/models/operations/get_v1_machines_machine_id_response.rb +39 -0
- data/lib/open_api_sdk/models/operations/get_v1_machines_machine_id_responsebody.rb +42 -0
- data/lib/open_api_sdk/models/operations/get_v1_machines_machines_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/get_v1_machines_request.rb +30 -0
- data/lib/open_api_sdk/models/operations/get_v1_machines_response.rb +39 -0
- data/lib/open_api_sdk/models/operations/get_v1_machines_responsebody.rb +27 -0
- data/lib/open_api_sdk/models/operations/get_v1_workflows_request.rb +30 -0
- data/lib/open_api_sdk/models/operations/get_v1_workflows_response.rb +39 -0
- data/lib/open_api_sdk/models/operations/get_v1_workflows_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/get_v1_workflows_workflow_id_outputs_request.rb +36 -0
- data/lib/open_api_sdk/models/operations/get_v1_workflows_workflow_id_outputs_response.rb +39 -0
- data/lib/open_api_sdk/models/operations/get_v1_workflows_workflow_id_outputs_responsebody.rb +27 -0
- data/lib/open_api_sdk/models/operations/get_v1_workflows_workflow_id_outputs_workflows_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/get_v1_workflows_workflow_id_request.rb +24 -0
- data/lib/open_api_sdk/models/operations/get_v1_workflows_workflow_id_response.rb +39 -0
- data/lib/open_api_sdk/models/operations/get_v1_workflows_workflow_id_responsebody.rb +45 -0
- data/lib/open_api_sdk/models/operations/get_v1_workflows_workflow_id_versions.rb +51 -0
- data/lib/open_api_sdk/models/operations/get_v1_workflows_workflow_id_workflows_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/get_v1_workflows_workflows_responsebody.rb +48 -0
- data/lib/open_api_sdk/models/operations/get_websocket_deployment_id_request.rb +24 -0
- data/lib/open_api_sdk/models/operations/get_websocket_deployment_id_response.rb +39 -0
- data/lib/open_api_sdk/models/operations/get_websocket_deployment_id_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/get_websocket_deployment_id_workflows_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/get_workflow_id_comfyui_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/get_workflow_id_dependencies.rb +20 -0
- data/lib/open_api_sdk/models/operations/get_workflow_id_request.rb +24 -0
- data/lib/open_api_sdk/models/operations/get_workflow_id_response.rb +39 -0
- data/lib/open_api_sdk/models/operations/get_workflow_id_responsebody.rb +54 -0
- data/lib/open_api_sdk/models/operations/get_workflow_id_snapshot.rb +20 -0
- data/lib/open_api_sdk/models/operations/get_workflow_id_workflow.rb +20 -0
- data/lib/open_api_sdk/models/operations/get_workflow_id_workflow_api.rb +20 -0
- data/lib/open_api_sdk/models/operations/get_workflow_version_version_id_comfyui_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/get_workflow_version_version_id_dependencies.rb +20 -0
- data/lib/open_api_sdk/models/operations/get_workflow_version_version_id_request.rb +24 -0
- data/lib/open_api_sdk/models/operations/get_workflow_version_version_id_response.rb +39 -0
- data/lib/open_api_sdk/models/operations/get_workflow_version_version_id_responsebody.rb +54 -0
- data/lib/open_api_sdk/models/operations/get_workflow_version_version_id_snapshot.rb +20 -0
- data/lib/open_api_sdk/models/operations/get_workflow_version_version_id_workflow_api.rb +20 -0
- data/lib/open_api_sdk/models/operations/git_custom_nodes.rb +27 -0
- data/lib/open_api_sdk/models/operations/gpu.rb +22 -0
- data/lib/open_api_sdk/models/operations/gpu_provider.rb +19 -0
- data/lib/open_api_sdk/models/operations/gputype.rb +22 -0
- data/lib/open_api_sdk/models/operations/machine_type.rb +23 -0
- data/lib/open_api_sdk/models/operations/machines.rb +45 -0
- data/lib/open_api_sdk/models/operations/models.rb +30 -0
- data/lib/open_api_sdk/models/operations/node.rb +27 -0
- data/lib/open_api_sdk/models/operations/origin.rb +22 -0
- data/lib/open_api_sdk/models/operations/outputs.rb +30 -0
- data/lib/open_api_sdk/models/operations/post_gpu_event_machines_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/post_gpu_event_requestbody.rb +48 -0
- data/lib/open_api_sdk/models/operations/post_gpu_event_response.rb +39 -0
- data/lib/open_api_sdk/models/operations/post_gpu_event_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/post_machine_endpoint_requestbody.rb +27 -0
- data/lib/open_api_sdk/models/operations/post_machine_endpoint_response.rb +39 -0
- data/lib/open_api_sdk/models/operations/post_machine_endpoint_responsebody.rb +27 -0
- data/lib/open_api_sdk/models/operations/post_machine_endpoint_workflows_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/post_run_requestbody.rb +57 -0
- data/lib/open_api_sdk/models/operations/post_run_response.rb +39 -0
- data/lib/open_api_sdk/models/operations/post_run_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/post_run_run_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/post_v1_machines_gpu.rb +18 -0
- data/lib/open_api_sdk/models/operations/post_v1_machines_machines_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/post_v1_machines_requestbody.rb +24 -0
- data/lib/open_api_sdk/models/operations/post_v1_machines_response.rb +39 -0
- data/lib/open_api_sdk/models/operations/post_v1_machines_responsebody.rb +132 -0
- data/lib/open_api_sdk/models/operations/post_v1_machines_status.rb +18 -0
- data/lib/open_api_sdk/models/operations/post_v1_machines_type.rb +18 -0
- data/lib/open_api_sdk/models/operations/post_v1_workflows_requestbody.rb +30 -0
- data/lib/open_api_sdk/models/operations/post_v1_workflows_response.rb +39 -0
- data/lib/open_api_sdk/models/operations/post_v1_workflows_responsebody.rb +30 -0
- data/lib/open_api_sdk/models/operations/post_v1_workflows_workflows_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/post_workflow_comfyui_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/post_workflow_requestbody.rb +39 -0
- data/lib/open_api_sdk/models/operations/post_workflow_response.rb +39 -0
- data/lib/open_api_sdk/models/operations/post_workflow_responsebody.rb +27 -0
- data/lib/open_api_sdk/models/operations/queryparam_runorigin.rb +22 -0
- data/lib/open_api_sdk/models/operations/responsebody.rb +36 -0
- data/lib/open_api_sdk/models/operations/run_log.rb +20 -0
- data/lib/open_api_sdk/models/operations/run_origin.rb +22 -0
- data/lib/open_api_sdk/models/operations/snapshot.rb +30 -0
- data/lib/open_api_sdk/models/operations/status.rb +26 -0
- data/lib/open_api_sdk/models/operations/type.rb +24 -0
- data/lib/open_api_sdk/models/operations/user.rb +24 -0
- data/lib/open_api_sdk/models/operations/versions.rb +27 -0
- data/lib/open_api_sdk/models/operations/webhook_status.rb +21 -0
- data/lib/open_api_sdk/models/operations/workflow.rb +20 -0
- data/lib/open_api_sdk/models/operations/workflow_api.rb +27 -0
- data/lib/open_api_sdk/models/operations/workflow_inputs.rb +20 -0
- data/lib/open_api_sdk/models/operations/workflow_json.rb +20 -0
- data/lib/open_api_sdk/models/operations/wsgputype.rb +18 -0
- data/lib/open_api_sdk/models/operations.rb +130 -0
- data/lib/open_api_sdk/models/shared/security.rb +24 -0
- data/lib/open_api_sdk/models/shared.rb +10 -0
- data/lib/open_api_sdk/run.rb +118 -0
- data/lib/open_api_sdk/sdkconfiguration.rb +52 -0
- data/lib/open_api_sdk/utils/metadata_fields.rb +150 -0
- data/lib/open_api_sdk/utils/t.rb +59 -0
- data/lib/open_api_sdk/utils/utils.rb +772 -0
- data/lib/open_api_sdk/workflows.rb +304 -0
- metadata +303 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 2dd17c4fb3024695e338a92b3bf85b7484a32dbb02479a0f6f76c4ec0fcbb30f
|
|
4
|
+
data.tar.gz: 06fcb2eedf1c1cc1f296f2fcea9815fe4ffe375ddf99122a62c459a46a0e53f2
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 438b4ddaab9e3c47786f058e11790b93feccdd6a27709a995de7ab75acb5b3b6971872016e3b904a9ed59e4ee9768bc4a39d31fc202a3ad1e493dce35e27767c
|
|
7
|
+
data.tar.gz: 037ad5937492b92ee0ccff6005712a4e02731a62b09ea7f0bb7e1d766a7ce2ed4787df6b546c522063e46375f9b42f85ff6f29ded1f2c2923afa7f5ba3993e7d
|
data/lib/comfydeploy.rb
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
module OpenApiSDK
|
|
7
|
+
autoload :ComfyDeploy, 'open_api_sdk/comfydeploy'
|
|
8
|
+
autoload :Shared, 'open_api_sdk/models/shared'
|
|
9
|
+
autoload :Operations, 'open_api_sdk/models/operations'
|
|
10
|
+
autoload :Run, 'open_api_sdk/run'
|
|
11
|
+
autoload :Files, 'open_api_sdk/files'
|
|
12
|
+
autoload :Workflows, 'open_api_sdk/workflows'
|
|
13
|
+
autoload :Comfyui, 'open_api_sdk/comfyui'
|
|
14
|
+
autoload :Machines, 'open_api_sdk/machines'
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
require_relative 'open_api_sdk/utils/t'
|
|
18
|
+
require_relative 'open_api_sdk/utils/utils'
|
|
19
|
+
require_relative 'open_api_sdk/utils/metadata_fields'
|
|
20
|
+
require_relative 'open_api_sdk/sdkconfiguration'
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
require 'faraday'
|
|
7
|
+
require 'faraday/multipart'
|
|
8
|
+
require 'sorbet-runtime'
|
|
9
|
+
|
|
10
|
+
module OpenApiSDK
|
|
11
|
+
extend T::Sig
|
|
12
|
+
|
|
13
|
+
class ComfyDeploy
|
|
14
|
+
extend T::Sig
|
|
15
|
+
|
|
16
|
+
attr_accessor :run, :files, :workflows, :comfyui, :machines
|
|
17
|
+
|
|
18
|
+
sig do
|
|
19
|
+
params(client: Faraday::Request,
|
|
20
|
+
security: T.nilable(Shared::Security),
|
|
21
|
+
server_idx: Integer,
|
|
22
|
+
server_url: String,
|
|
23
|
+
url_params: T::Hash[Symbol, String]).void
|
|
24
|
+
end
|
|
25
|
+
def initialize(client: nil,
|
|
26
|
+
security: nil,
|
|
27
|
+
server_idx: nil,
|
|
28
|
+
server_url: nil,
|
|
29
|
+
url_params: nil)
|
|
30
|
+
|
|
31
|
+
## Instantiates the SDK configuring it with the provided parameters.
|
|
32
|
+
# @param [Faraday::Request] client The faraday HTTP client to use for all operations
|
|
33
|
+
# @param [Shared::Security] security The security details required for authentication
|
|
34
|
+
# @param [::Integer] server_idx The index of the server to use for all operations
|
|
35
|
+
# @param [::String] server_url The server URL to use for all operations
|
|
36
|
+
# @param [::Hash<::Symbol, ::String>] url_params Parameters to optionally template the server URL with
|
|
37
|
+
|
|
38
|
+
if client.nil?
|
|
39
|
+
client = Faraday.new(request: {
|
|
40
|
+
params_encoder: Faraday::FlatParamsEncoder
|
|
41
|
+
}) do |f|
|
|
42
|
+
f.request :multipart, {}
|
|
43
|
+
# f.response :logger
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
if !server_url.nil?
|
|
48
|
+
if !url_params.nil?
|
|
49
|
+
server_url = Utils.template_url(server_url, url_params)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
server_idx = 0 if server_idx.nil?
|
|
53
|
+
|
|
54
|
+
@sdk_configuration = SDKConfiguration.new(client, security, server_url, server_idx)
|
|
55
|
+
init_sdks
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
sig { params(server_url: String).void }
|
|
59
|
+
def config_server_url(server_url)
|
|
60
|
+
@sdk_configuration.server_url = server_url
|
|
61
|
+
init_sdks
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
sig { params(server_idx: Integer).void }
|
|
65
|
+
def config_server(server_idx)
|
|
66
|
+
raise StandardError, "Invalid server index #{server_idx}" if server_idx.negative? || server_idx >= SERVERS.length
|
|
67
|
+
@sdk_configuration.server_idx = server_idx
|
|
68
|
+
init_sdks
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
sig { params(security: ::OpenApiSDK::Shared::Security).void }
|
|
72
|
+
def config_security(security)
|
|
73
|
+
@sdk_configuration.security = security
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
sig { void }
|
|
77
|
+
def init_sdks
|
|
78
|
+
@run = Run.new(@sdk_configuration)
|
|
79
|
+
@files = Files.new(@sdk_configuration)
|
|
80
|
+
@workflows = Workflows.new(@sdk_configuration)
|
|
81
|
+
@comfyui = Comfyui.new(@sdk_configuration)
|
|
82
|
+
@machines = Machines.new(@sdk_configuration)
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
require 'faraday'
|
|
7
|
+
require 'faraday/multipart'
|
|
8
|
+
require 'sorbet-runtime'
|
|
9
|
+
|
|
10
|
+
module OpenApiSDK
|
|
11
|
+
extend T::Sig
|
|
12
|
+
class Comfyui
|
|
13
|
+
extend T::Sig
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
sig { params(sdk_config: SDKConfiguration).void }
|
|
17
|
+
def initialize(sdk_config)
|
|
18
|
+
@sdk_configuration = sdk_config
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
sig { params(request_id: ::String).returns(::OpenApiSDK::Operations::GetAuthResponseRequestIdResponse) }
|
|
23
|
+
def get_auth_response_request_id_(request_id)
|
|
24
|
+
# get_auth_response_request_id_ - Get an API Key with code
|
|
25
|
+
# This endpoints is specifically built for ComfyUI workflow upload.
|
|
26
|
+
request = ::OpenApiSDK::Operations::GetAuthResponseRequestIdRequest.new(
|
|
27
|
+
|
|
28
|
+
request_id: request_id
|
|
29
|
+
)
|
|
30
|
+
url, params = @sdk_configuration.get_server_details
|
|
31
|
+
base_url = Utils.template_url(url, params)
|
|
32
|
+
url = Utils.generate_url(
|
|
33
|
+
::OpenApiSDK::Operations::GetAuthResponseRequestIdRequest,
|
|
34
|
+
base_url,
|
|
35
|
+
'/auth-response/{request_id}',
|
|
36
|
+
request
|
|
37
|
+
)
|
|
38
|
+
headers = {}
|
|
39
|
+
headers['Accept'] = 'application/json;q=1, text/plain;q=0'
|
|
40
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
41
|
+
|
|
42
|
+
r = @sdk_configuration.client.get(url) do |req|
|
|
43
|
+
req.headers = headers
|
|
44
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
|
48
|
+
|
|
49
|
+
res = ::OpenApiSDK::Operations::GetAuthResponseRequestIdResponse.new(
|
|
50
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
|
51
|
+
)
|
|
52
|
+
if r.status == 200
|
|
53
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
54
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Operations::GetAuthResponseRequestIdResponseBody)
|
|
55
|
+
res.two_hundred_application_json_object = out
|
|
56
|
+
end
|
|
57
|
+
elsif r.status == 201
|
|
58
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
59
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Operations::GetAuthResponseRequestIdComfyuiResponseBody)
|
|
60
|
+
res.two_hundred_and_one_application_json_object = out
|
|
61
|
+
end
|
|
62
|
+
elsif r.status == 401
|
|
63
|
+
res.four_hundred_and_one_text_plain_res = r.env.response_body if Utils.match_content_type(content_type, 'text/plain')
|
|
64
|
+
|
|
65
|
+
elsif r.status == 500
|
|
66
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
67
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Operations::GetAuthResponseRequestIdComfyuiResponseResponseBody)
|
|
68
|
+
res.five_hundred_application_json_object = out
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
res
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
sig { params(request: T.nilable(::OpenApiSDK::Operations::PostWorkflowRequestBody)).returns(::OpenApiSDK::Operations::PostWorkflowResponse) }
|
|
76
|
+
def post_workflow(request)
|
|
77
|
+
# post_workflow - Upload workflow from ComfyUI
|
|
78
|
+
# This endpoints is specifically built for ComfyUI workflow upload.
|
|
79
|
+
url, params = @sdk_configuration.get_server_details
|
|
80
|
+
base_url = Utils.template_url(url, params)
|
|
81
|
+
url = "#{base_url}/workflow"
|
|
82
|
+
headers = {}
|
|
83
|
+
req_content_type, data, form = Utils.serialize_request_body(request, :request, :json)
|
|
84
|
+
headers['content-type'] = req_content_type
|
|
85
|
+
headers['Accept'] = 'application/json;q=1, text/plain;q=0'
|
|
86
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
87
|
+
|
|
88
|
+
r = @sdk_configuration.client.post(url) do |req|
|
|
89
|
+
req.headers = headers
|
|
90
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
|
91
|
+
if form
|
|
92
|
+
req.body = Utils.encode_form(form)
|
|
93
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
|
94
|
+
req.body = URI.encode_www_form(data)
|
|
95
|
+
else
|
|
96
|
+
req.body = data
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
|
101
|
+
|
|
102
|
+
res = ::OpenApiSDK::Operations::PostWorkflowResponse.new(
|
|
103
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
|
104
|
+
)
|
|
105
|
+
if r.status == 200
|
|
106
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
107
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Operations::PostWorkflowResponseBody)
|
|
108
|
+
res.two_hundred_application_json_object = out
|
|
109
|
+
end
|
|
110
|
+
elsif r.status == 401
|
|
111
|
+
res.four_hundred_and_one_text_plain_res = r.env.response_body if Utils.match_content_type(content_type, 'text/plain')
|
|
112
|
+
|
|
113
|
+
elsif r.status == 500
|
|
114
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
115
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Operations::PostWorkflowComfyuiResponseBody)
|
|
116
|
+
res.five_hundred_application_json_object = out
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
res
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
sig { params(version_id: ::String).returns(::OpenApiSDK::Operations::GetWorkflowVersionVersionIdResponse) }
|
|
124
|
+
def get_workflow_version_version_id_(version_id)
|
|
125
|
+
# get_workflow_version_version_id_ - Get comfyui workflow
|
|
126
|
+
# Use this to retrieve comfyui workflow by id
|
|
127
|
+
request = ::OpenApiSDK::Operations::GetWorkflowVersionVersionIdRequest.new(
|
|
128
|
+
|
|
129
|
+
version_id: version_id
|
|
130
|
+
)
|
|
131
|
+
url, params = @sdk_configuration.get_server_details
|
|
132
|
+
base_url = Utils.template_url(url, params)
|
|
133
|
+
url = Utils.generate_url(
|
|
134
|
+
::OpenApiSDK::Operations::GetWorkflowVersionVersionIdRequest,
|
|
135
|
+
base_url,
|
|
136
|
+
'/workflow-version/{version_id}',
|
|
137
|
+
request
|
|
138
|
+
)
|
|
139
|
+
headers = {}
|
|
140
|
+
headers['Accept'] = 'application/json;q=1, text/plain;q=0'
|
|
141
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
142
|
+
|
|
143
|
+
r = @sdk_configuration.client.get(url) do |req|
|
|
144
|
+
req.headers = headers
|
|
145
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
|
149
|
+
|
|
150
|
+
res = ::OpenApiSDK::Operations::GetWorkflowVersionVersionIdResponse.new(
|
|
151
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
|
152
|
+
)
|
|
153
|
+
if r.status == 200
|
|
154
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
155
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Operations::GetWorkflowVersionVersionIdResponseBody)
|
|
156
|
+
res.two_hundred_application_json_object = out
|
|
157
|
+
end
|
|
158
|
+
elsif r.status == 401
|
|
159
|
+
res.four_hundred_and_one_text_plain_res = r.env.response_body if Utils.match_content_type(content_type, 'text/plain')
|
|
160
|
+
|
|
161
|
+
elsif r.status == 500
|
|
162
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
163
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Operations::GetWorkflowVersionVersionIdComfyuiResponseBody)
|
|
164
|
+
res.five_hundred_application_json_object = out
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
res
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
sig { params(id: ::String).returns(::OpenApiSDK::Operations::GetWorkflowIdResponse) }
|
|
172
|
+
def get_workflow_id_(id)
|
|
173
|
+
# get_workflow_id_ - Get comfyui workflow
|
|
174
|
+
# Use this to retrieve comfyui workflow by id
|
|
175
|
+
request = ::OpenApiSDK::Operations::GetWorkflowIdRequest.new(
|
|
176
|
+
|
|
177
|
+
id: id
|
|
178
|
+
)
|
|
179
|
+
url, params = @sdk_configuration.get_server_details
|
|
180
|
+
base_url = Utils.template_url(url, params)
|
|
181
|
+
url = Utils.generate_url(
|
|
182
|
+
::OpenApiSDK::Operations::GetWorkflowIdRequest,
|
|
183
|
+
base_url,
|
|
184
|
+
'/workflow/{id}',
|
|
185
|
+
request
|
|
186
|
+
)
|
|
187
|
+
headers = {}
|
|
188
|
+
headers['Accept'] = 'application/json;q=1, text/plain;q=0'
|
|
189
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
190
|
+
|
|
191
|
+
r = @sdk_configuration.client.get(url) do |req|
|
|
192
|
+
req.headers = headers
|
|
193
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
|
197
|
+
|
|
198
|
+
res = ::OpenApiSDK::Operations::GetWorkflowIdResponse.new(
|
|
199
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
|
200
|
+
)
|
|
201
|
+
if r.status == 200
|
|
202
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
203
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Operations::GetWorkflowIdResponseBody)
|
|
204
|
+
res.two_hundred_application_json_object = out
|
|
205
|
+
end
|
|
206
|
+
elsif r.status == 401
|
|
207
|
+
res.four_hundred_and_one_text_plain_res = r.env.response_body if Utils.match_content_type(content_type, 'text/plain')
|
|
208
|
+
|
|
209
|
+
elsif r.status == 500
|
|
210
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
211
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Operations::GetWorkflowIdComfyuiResponseBody)
|
|
212
|
+
res.five_hundred_application_json_object = out
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
res
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
sig { params(id: ::String).returns(::OpenApiSDK::Operations::GetDeploymentIdInputsResponse) }
|
|
220
|
+
def get_deployment_id_inputs(id)
|
|
221
|
+
# get_deployment_id_inputs - Get comfyui workflow inputs definition
|
|
222
|
+
# Use this to retrieve comfyui workflow inputs definition by id
|
|
223
|
+
request = ::OpenApiSDK::Operations::GetDeploymentIdInputsRequest.new(
|
|
224
|
+
|
|
225
|
+
id: id
|
|
226
|
+
)
|
|
227
|
+
url, params = @sdk_configuration.get_server_details
|
|
228
|
+
base_url = Utils.template_url(url, params)
|
|
229
|
+
url = Utils.generate_url(
|
|
230
|
+
::OpenApiSDK::Operations::GetDeploymentIdInputsRequest,
|
|
231
|
+
base_url,
|
|
232
|
+
'/deployment/{id}/inputs',
|
|
233
|
+
request
|
|
234
|
+
)
|
|
235
|
+
headers = {}
|
|
236
|
+
headers['Accept'] = 'application/json;q=1, text/plain;q=0'
|
|
237
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
238
|
+
|
|
239
|
+
r = @sdk_configuration.client.get(url) do |req|
|
|
240
|
+
req.headers = headers
|
|
241
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
|
245
|
+
|
|
246
|
+
res = ::OpenApiSDK::Operations::GetDeploymentIdInputsResponse.new(
|
|
247
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
|
248
|
+
)
|
|
249
|
+
if r.status == 200
|
|
250
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
251
|
+
out = Utils.unmarshal_complex(r.env.response_body, T::Array[::OpenApiSDK::Operations::ResponseBody])
|
|
252
|
+
res.response_bodies = out
|
|
253
|
+
end
|
|
254
|
+
elsif r.status == 401
|
|
255
|
+
res.res = r.env.response_body if Utils.match_content_type(content_type, 'text/plain')
|
|
256
|
+
|
|
257
|
+
elsif r.status == 500
|
|
258
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
259
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Operations::GetDeploymentIdInputsResponseBody)
|
|
260
|
+
res.object = out
|
|
261
|
+
end
|
|
262
|
+
end
|
|
263
|
+
res
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
sig { params(environment: T.nilable(::OpenApiSDK::Operations::Environment)).returns(::OpenApiSDK::Operations::GetDeploymentResponse) }
|
|
268
|
+
def get_deployment(environment = nil)
|
|
269
|
+
# get_deployment - Get all deployed workflows
|
|
270
|
+
# Get all deployed workflows
|
|
271
|
+
request = ::OpenApiSDK::Operations::GetDeploymentRequest.new(
|
|
272
|
+
|
|
273
|
+
environment: environment
|
|
274
|
+
)
|
|
275
|
+
url, params = @sdk_configuration.get_server_details
|
|
276
|
+
base_url = Utils.template_url(url, params)
|
|
277
|
+
url = "#{base_url}/deployment"
|
|
278
|
+
headers = {}
|
|
279
|
+
query_params = Utils.get_query_params(::OpenApiSDK::Operations::GetDeploymentRequest, request)
|
|
280
|
+
headers['Accept'] = 'application/json'
|
|
281
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
282
|
+
|
|
283
|
+
r = @sdk_configuration.client.get(url) do |req|
|
|
284
|
+
req.headers = headers
|
|
285
|
+
req.params = query_params
|
|
286
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
|
290
|
+
|
|
291
|
+
res = ::OpenApiSDK::Operations::GetDeploymentResponse.new(
|
|
292
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
|
293
|
+
)
|
|
294
|
+
if r.status == 200
|
|
295
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
296
|
+
out = Utils.unmarshal_complex(r.env.response_body, T::Array[::OpenApiSDK::Operations::GetDeploymentComfyuiResponseBody])
|
|
297
|
+
res.response_bodies = out
|
|
298
|
+
end
|
|
299
|
+
elsif r.status == 500
|
|
300
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
301
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Operations::GetDeploymentResponseBody)
|
|
302
|
+
res.object = out
|
|
303
|
+
end
|
|
304
|
+
end
|
|
305
|
+
res
|
|
306
|
+
end
|
|
307
|
+
end
|
|
308
|
+
end
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
require 'faraday'
|
|
7
|
+
require 'faraday/multipart'
|
|
8
|
+
require 'sorbet-runtime'
|
|
9
|
+
|
|
10
|
+
module OpenApiSDK
|
|
11
|
+
extend T::Sig
|
|
12
|
+
class Files
|
|
13
|
+
extend T::Sig
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
sig { params(sdk_config: SDKConfiguration).void }
|
|
17
|
+
def initialize(sdk_config)
|
|
18
|
+
@sdk_configuration = sdk_config
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
sig { params(type: ::OpenApiSDK::Operations::Type, file_size: ::String).returns(::OpenApiSDK::Operations::GetUploadUrlResponse) }
|
|
23
|
+
def get_upload_url(type, file_size)
|
|
24
|
+
# get_upload_url - Upload any files to the storage
|
|
25
|
+
# Usually when you run something, you want to upload a file, image etc.
|
|
26
|
+
request = ::OpenApiSDK::Operations::GetUploadUrlRequest.new(
|
|
27
|
+
|
|
28
|
+
type: type,
|
|
29
|
+
file_size: file_size
|
|
30
|
+
)
|
|
31
|
+
url, params = @sdk_configuration.get_server_details
|
|
32
|
+
base_url = Utils.template_url(url, params)
|
|
33
|
+
url = "#{base_url}/upload-url"
|
|
34
|
+
headers = {}
|
|
35
|
+
query_params = Utils.get_query_params(::OpenApiSDK::Operations::GetUploadUrlRequest, request)
|
|
36
|
+
headers['Accept'] = 'application/json;q=1, text/plain;q=0'
|
|
37
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
38
|
+
|
|
39
|
+
r = @sdk_configuration.client.get(url) do |req|
|
|
40
|
+
req.headers = headers
|
|
41
|
+
req.params = query_params
|
|
42
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
|
46
|
+
|
|
47
|
+
res = ::OpenApiSDK::Operations::GetUploadUrlResponse.new(
|
|
48
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
|
49
|
+
)
|
|
50
|
+
if r.status == 200
|
|
51
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
52
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Operations::GetUploadUrlResponseBody)
|
|
53
|
+
res.two_hundred_application_json_object = out
|
|
54
|
+
end
|
|
55
|
+
elsif r.status == 401
|
|
56
|
+
res.four_hundred_and_one_text_plain_res = r.env.response_body if Utils.match_content_type(content_type, 'text/plain')
|
|
57
|
+
|
|
58
|
+
elsif r.status == 500
|
|
59
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
60
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Operations::GetUploadUrlFilesResponseBody)
|
|
61
|
+
res.five_hundred_application_json_object = out
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
res
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|