composio 0.1.9 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 12bca9fcaf3ed64d8a9fc4ae997d474f9512a6342f635813652d56fed502cd70
4
- data.tar.gz: a1ed487a3dc4cdc2d8612a0c38145f73321610469b07fce41ccbcfa3e2e9ec02
3
+ metadata.gz: 5aecc3e5f9446b4ddffd0be14d28cee1934a0fbc7bdfd0035168c6a9c047987e
4
+ data.tar.gz: b4b3ee3a9224052e762f07e9e6285b0c0a2ee7e3c470e48602b794478c99f4d8
5
5
  SHA512:
6
- metadata.gz: 66f00bd57d5c0684e623f86ab625f985639a49780d69c9139fc066a0f056424ee334ce50573bb971315a898fc83f14e6eeefe09ba7bb36d38ec2c67d9fc43b7b
7
- data.tar.gz: e123dc3761333a513fd6a955e6d8b72ac6c2ac45dc738afdbd51d154d5c1f20f1778bafedd62164a71f0c67f174ca0540243895c7248ecb09c05b5abb3e370e1
6
+ metadata.gz: 579f87f534abdbcd8ddbdfa8ac9c5a38e3514fcbcbda42b702e044fa790a526e163b3b1a233473c50eb419c51adcdd19412a83801994b0876cb8e0a29c71d4fe
7
+ data.tar.gz: 929b082c49ea2a0e881bb50e2adc3fcb2b86a70f27e64fd0c03104d5baf929b3551c65e4c1e17250c96246f1f769046b2af4ec88148216f48502064d417b3e3d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- composio (0.1.9)
4
+ composio (0.1.10)
5
5
  faraday (>= 1.0.1, < 3.0)
6
6
  faraday-multipart (~> 1.0, >= 1.0.4)
7
7
 
@@ -49,7 +49,7 @@ GEM
49
49
  rspec-core (~> 3.13.0)
50
50
  rspec-expectations (~> 3.13.0)
51
51
  rspec-mocks (~> 3.13.0)
52
- rspec-core (3.13.1)
52
+ rspec-core (3.13.2)
53
53
  rspec-support (~> 3.13.0)
54
54
  rspec-expectations (3.13.3)
55
55
  diff-lcs (>= 1.2.0, < 2.0)
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Composio SDK: Equip your agent with high-quality tools and build your real-world usecase
8
8
 
9
- [![npm](https://img.shields.io/badge/gem-v0.1.9-blue)](https://rubygems.org/gems/composio/versions/0.1.9)
9
+ [![npm](https://img.shields.io/badge/gem-v0.1.10-blue)](https://rubygems.org/gems/composio/versions/0.1.10)
10
10
  [![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://composio.dev)
11
11
 
12
12
  </div>
@@ -78,7 +78,7 @@ Composio SDK: Equip your agent with high-quality tools and build your real-world
78
78
  Add to Gemfile:
79
79
 
80
80
  ```ruby
81
- gem 'composio', '~> 0.1.9'
81
+ gem 'composio', '~> 0.1.10'
82
82
  ```
83
83
 
84
84
  ## Getting Started<a id="getting-started"></a>
@@ -217,8 +217,6 @@ result = composio.actions.execute(
217
217
  "value" => "value_example",
218
218
  }
219
219
  ],
220
- "base_url" => "base_url_example",
221
- "body" => {},
222
220
  },
223
221
  text: "string_example",
224
222
  )
@@ -233,7 +231,7 @@ p result
233
231
  ##### entityId: `String`<a id="entityid-string"></a>
234
232
  ##### endpoint: `String`<a id="endpoint-string"></a>
235
233
  ##### input: `Object`<a id="input-object"></a>
236
- ##### authConfig: [`GetConnectionInfoResponseDTO`](./lib/composio/models/get_connection_info_response_dto.rb)<a id="authconfig-getconnectioninforesponsedtolibcomposiomodelsget_connection_info_response_dtorb"></a>
234
+ ##### authConfig: [`CustomAuthDTO`](./lib/composio/models/custom_auth_dto.rb)<a id="authconfig-customauthdtolibcomposiomodelscustom_auth_dtorb"></a>
237
235
  ##### text: `String`<a id="text-string"></a>
238
236
  #### 🔄 Return<a id="🔄-return"></a>
239
237
 
@@ -26,7 +26,7 @@ module Composio
26
26
  # @param entity_id [String]
27
27
  # @param endpoint [String]
28
28
  # @param input [Object]
29
- # @param auth_config [GetConnectionInfoResponseDTO]
29
+ # @param auth_config [CustomAuthDTO]
30
30
  # @param text [String]
31
31
  # @param body [ActionExecutionReqDTO]
32
32
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
@@ -54,7 +54,7 @@ module Composio
54
54
  # @param entity_id [String]
55
55
  # @param endpoint [String]
56
56
  # @param input [Object]
57
- # @param auth_config [GetConnectionInfoResponseDTO]
57
+ # @param auth_config [CustomAuthDTO]
58
58
  # @param text [String]
59
59
  # @param body [ActionExecutionReqDTO]
60
60
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
@@ -51,7 +51,7 @@ module Composio
51
51
  :'entity_id' => :'String',
52
52
  :'endpoint' => :'String',
53
53
  :'input' => :'Object',
54
- :'auth_config' => :'GetConnectionInfoResponseDTO',
54
+ :'auth_config' => :'CustomAuthDTO',
55
55
  :'text' => :'String'
56
56
  }
57
57
  end
@@ -0,0 +1,240 @@
1
+ =begin
2
+ #Composio OpenAPI
3
+
4
+ #Composio SDK: Equip your agent with high-quality tools and build your real-world usecase
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ =end
8
+
9
+ require 'date'
10
+ require 'time'
11
+
12
+ module Composio
13
+ class CustomAuthDTO
14
+ attr_accessor :parameters
15
+
16
+ attr_accessor :base_url
17
+
18
+ attr_accessor :body
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'parameters' => :'parameters',
24
+ :'base_url' => :'base_url',
25
+ :'body' => :'body'
26
+ }
27
+ end
28
+
29
+ # Returns all the JSON keys this model knows about
30
+ def self.acceptable_attributes
31
+ attribute_map.values
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.openapi_types
36
+ {
37
+ :'parameters' => :'Array<Parameter>',
38
+ :'base_url' => :'String',
39
+ :'body' => :'Object'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Composio::CustomAuthDTO` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Composio::CustomAuthDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'parameters')
65
+ if (value = attributes[:'parameters']).is_a?(Array)
66
+ self.parameters = value
67
+ end
68
+ end
69
+
70
+ if attributes.key?(:'base_url')
71
+ self.base_url = attributes[:'base_url']
72
+ end
73
+
74
+ if attributes.key?(:'body')
75
+ self.body = attributes[:'body']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ invalid_properties = Array.new
83
+ if @parameters.nil?
84
+ invalid_properties.push('invalid value for "parameters", parameters cannot be nil.')
85
+ end
86
+
87
+ invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ return false if @parameters.nil?
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ parameters == o.parameters &&
103
+ base_url == o.base_url &&
104
+ body == o.body
105
+ end
106
+
107
+ # @see the `==` method
108
+ # @param [Object] Object to be compared
109
+ def eql?(o)
110
+ self == o
111
+ end
112
+
113
+ # Calculates hash code according to all attributes.
114
+ # @return [Integer] Hash code
115
+ def hash
116
+ [parameters, base_url, body].hash
117
+ end
118
+
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def self.build_from_hash(attributes)
123
+ new.build_from_hash(attributes)
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ attributes = attributes.transform_keys(&:to_sym)
132
+ self.class.openapi_types.each_pair do |key, type|
133
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
134
+ self.send("#{key}=", nil)
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
139
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
140
+ end
141
+ elsif !attributes[self.class.attribute_map[key]].nil?
142
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
143
+ end
144
+ end
145
+
146
+ self
147
+ end
148
+
149
+ # Deserializes the data based on type
150
+ # @param string type Data type
151
+ # @param string value Value to be deserialized
152
+ # @return [Object] Deserialized data
153
+ def _deserialize(type, value)
154
+ case type.to_sym
155
+ when :Time
156
+ Time.parse(value)
157
+ when :Date
158
+ Date.parse(value)
159
+ when :String
160
+ value.to_s
161
+ when :Integer
162
+ value.to_i
163
+ when :Float
164
+ value.to_f
165
+ when :Boolean
166
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
+ true
168
+ else
169
+ false
170
+ end
171
+ when :Object
172
+ # generic object (usually a Hash), return directly
173
+ value
174
+ when /\AArray<(?<inner_type>.+)>\z/
175
+ inner_type = Regexp.last_match[:inner_type]
176
+ value.map { |v| _deserialize(inner_type, v) }
177
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
+ k_type = Regexp.last_match[:k_type]
179
+ v_type = Regexp.last_match[:v_type]
180
+ {}.tap do |hash|
181
+ value.each do |k, v|
182
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
+ end
184
+ end
185
+ else # model
186
+ # models (e.g. Pet) or oneOf
187
+ klass = Composio.const_get(type)
188
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
189
+ end
190
+ end
191
+
192
+ # Returns the string representation of the object
193
+ # @return [String] String presentation of the object
194
+ def to_s
195
+ to_hash.to_s
196
+ end
197
+
198
+ # to_body is an alias to to_hash (backward compatibility)
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_body
201
+ to_hash
202
+ end
203
+
204
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ if value.nil?
211
+ is_nullable = self.class.openapi_nullable.include?(attr)
212
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
+ end
214
+
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ # Outputs non-array value in the form of hash
221
+ # For object, use to_hash. Otherwise, just return the value
222
+ # @param [Object] value Any valid value
223
+ # @return [Hash] Returns the value in the form of hash
224
+ def _to_hash(value)
225
+ if value.is_a?(Array)
226
+ value.compact.map { |v| _to_hash(v) }
227
+ elsif value.is_a?(Hash)
228
+ {}.tap do |hash|
229
+ value.each { |k, v| hash[k] = _to_hash(v) }
230
+ end
231
+ elsif value.respond_to? :to_hash
232
+ value.to_hash
233
+ else
234
+ value
235
+ end
236
+ end
237
+
238
+ end
239
+
240
+ end
@@ -15,9 +15,10 @@ module Composio
15
15
  STARTER = "STARTER".freeze
16
16
  GROWTH = "GROWTH".freeze
17
17
  ENTERPRISE = "ENTERPRISE".freeze
18
+ STARTUP = "STARTUP".freeze
18
19
 
19
20
  def self.all_vars
20
- @all_vars ||= [HOBBY, STARTER, GROWTH, ENTERPRISE].freeze
21
+ @all_vars ||= [HOBBY, STARTER, GROWTH, ENTERPRISE, STARTUP].freeze
21
22
  end
22
23
 
23
24
  # Builds the enum from string
@@ -7,5 +7,5 @@ The version of the OpenAPI document: 1.0.0
7
7
  =end
8
8
 
9
9
  module Composio
10
- VERSION = '0.1.9'
10
+ VERSION = '0.1.10'
11
11
  end
data/lib/composio.rb CHANGED
@@ -59,6 +59,7 @@ require 'composio/models/connector_list_item_dto_updated_at'
59
59
  require 'composio/models/create_checkout_session_req_dto'
60
60
  require 'composio/models/create_connector_payload_dto'
61
61
  require 'composio/models/create_connector_payload_dto_use_composio_auth'
62
+ require 'composio/models/custom_auth_dto'
62
63
  require 'composio/models/data'
63
64
  require 'composio/models/delete_api_key_req_dto'
64
65
  require 'composio/models/delete_api_key_response_dto'
@@ -0,0 +1,40 @@
1
+ =begin
2
+ #Composio OpenAPI
3
+
4
+ #Composio SDK: Equip your agent with high-quality tools and build your real-world usecase
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ =end
8
+
9
+ require 'spec_helper'
10
+ require 'json'
11
+ require 'date'
12
+
13
+ # Unit tests for Composio::CustomAuthDTO
14
+ describe Composio::CustomAuthDTO do
15
+ let(:instance) { Composio::CustomAuthDTO.new }
16
+
17
+ describe 'test an instance of CustomAuthDTO' do
18
+ it 'should create an instance of CustomAuthDTO' do
19
+ expect(instance).to be_instance_of(Composio::CustomAuthDTO)
20
+ end
21
+ end
22
+ describe 'test attribute "parameters"' do
23
+ it 'should work' do
24
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
25
+ end
26
+ end
27
+
28
+ describe 'test attribute "base_url"' do
29
+ it 'should work' do
30
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
31
+ end
32
+ end
33
+
34
+ describe 'test attribute "body"' do
35
+ it 'should work' do
36
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
37
+ end
38
+ end
39
+
40
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: composio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konfig
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-10 00:00:00.000000000 Z
11
+ date: 2024-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -144,6 +144,7 @@ files:
144
144
  - lib/composio/models/create_checkout_session_req_dto.rb
145
145
  - lib/composio/models/create_connector_payload_dto.rb
146
146
  - lib/composio/models/create_connector_payload_dto_use_composio_auth.rb
147
+ - lib/composio/models/custom_auth_dto.rb
147
148
  - lib/composio/models/data.rb
148
149
  - lib/composio/models/delete_api_key_req_dto.rb
149
150
  - lib/composio/models/delete_api_key_response_dto.rb
@@ -305,6 +306,7 @@ files:
305
306
  - spec/models/create_checkout_session_req_dto_spec.rb
306
307
  - spec/models/create_connector_payload_dto_spec.rb
307
308
  - spec/models/create_connector_payload_dto_use_composio_auth_spec.rb
309
+ - spec/models/custom_auth_dto_spec.rb
308
310
  - spec/models/data_spec.rb
309
311
  - spec/models/delete_api_key_req_dto_spec.rb
310
312
  - spec/models/delete_api_key_response_dto_spec.rb
@@ -461,6 +463,7 @@ test_files:
461
463
  - spec/models/track_client_req_dto_spec.rb
462
464
  - spec/models/action_metadata_type_spec.rb
463
465
  - spec/models/toggle_trigger_state_response_dto_spec.rb
466
+ - spec/models/custom_auth_dto_spec.rb
464
467
  - spec/models/connected_account_response_dto_spec.rb
465
468
  - spec/models/verify_magic_link_res_dto_spec.rb
466
469
  - spec/models/ingest_data_response_dto_spec.rb