weft-sdk 0.7.0 → 0.9.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 +4 -4
- data/docs/APIKeysApi.md +1 -2
- data/docs/AccountApi.md +6 -5
- data/docs/AccountDetails.md +2 -1
- data/docs/ApiKey.md +0 -1
- data/docs/ApiKeyCreated.md +0 -1
- data/docs/ApiKeyCreatedResponse.md +0 -1
- data/docs/ApiKeyListResponse.md +0 -1
- data/docs/AuthApi.md +6 -7
- data/docs/AuthResponse.md +0 -1
- data/docs/AuthResponseData.md +0 -1
- data/docs/BalanceApi.md +1 -2
- data/docs/BalanceResponse.md +3 -4
- data/docs/ConfirmRequest.md +0 -1
- data/docs/CreateApiKeyRequest.md +0 -1
- data/docs/DefaultApi.md +0 -1
- data/docs/EnrolledResource.md +0 -1
- data/docs/Error.md +0 -1
- data/docs/ErrorResponse.md +0 -1
- data/docs/Fetch403Response.md +0 -1
- data/docs/FetchApi.md +10 -7
- data/docs/FetchBalanceSnapshot.md +2 -3
- data/docs/FetchErrorResponse.md +0 -1
- data/docs/FetchRequest.md +0 -1
- data/docs/FetchRequestBody.md +0 -1
- data/docs/FetchResponse.md +5 -2
- data/docs/InsufficientScopeResponse.md +0 -1
- data/docs/MeApiKey.md +0 -1
- data/docs/MeApiKeyCreator.md +0 -1
- data/docs/MeResponse.md +1 -2
- data/docs/MeResponseData.md +78 -0
- data/docs/Merchant.md +0 -1
- data/docs/MessageResponse.md +0 -1
- data/docs/MessageResponseData.md +0 -1
- data/docs/Pagination.md +0 -1
- data/docs/PasswordResetRequest.md +0 -1
- data/docs/PasswordUpdateRequest.md +0 -1
- data/docs/Payment.md +0 -3
- data/docs/PaymentListResponse.md +0 -1
- data/docs/PaymentResponse.md +0 -1
- data/docs/PaymentsApi.md +0 -1
- data/docs/PrincipalWallet.md +19 -0
- data/docs/PromoBalance.md +0 -1
- data/docs/Purchase.md +43 -0
- data/docs/PurchaseArtifact.md +23 -0
- data/docs/PurchaseListResponse.md +19 -0
- data/docs/PurchaseResponse.md +17 -0
- data/docs/PurchasesApi.md +148 -0
- data/docs/ResendConfirmationRequest.md +0 -1
- data/docs/ResourceEnrollmentRequest.md +0 -1
- data/docs/ResourceEnrollmentResponse.md +0 -1
- data/docs/ResourceStats.md +0 -1
- data/docs/ResourcesApi.md +2 -3
- data/docs/SearchApi.md +2 -3
- data/docs/SearchCapabilityRef.md +19 -0
- data/docs/SearchEndpointCall.md +23 -0
- data/docs/SearchEndpointHit.md +41 -0
- data/docs/SearchEndpointPrice.md +25 -0
- data/docs/SearchErrorResponse.md +0 -1
- data/docs/SearchFilterSpec.md +23 -0
- data/docs/SearchPaymentOffer.md +31 -0
- data/docs/SearchPriceAtomicFilter.md +25 -0
- data/docs/SearchPriceUsdFilter.md +25 -0
- data/docs/SearchProtocolFilter.md +19 -0
- data/docs/SearchProviderRef.md +21 -0
- data/docs/SearchRequest.md +3 -4
- data/docs/SearchResourceTypeFilter.md +19 -0
- data/docs/SearchResponse.md +35 -8
- data/docs/SearchResponseWarningsInner.md +23 -0
- data/docs/SearchResult.md +8 -21
- data/docs/SignInRequest.md +0 -1
- data/docs/SignUpRequest.md +0 -1
- data/docs/SpendingPolicy.md +0 -1
- data/docs/User.md +0 -1
- data/docs/UserPrincipal.md +33 -0
- data/docs/Wallet.md +3 -4
- data/lib/weft/generated/api/account_api.rb +6 -4
- data/lib/weft/generated/api/api_keys_api.rb +4 -4
- data/lib/weft/generated/api/auth_api.rb +14 -14
- data/lib/weft/generated/api/balance_api.rb +4 -4
- data/lib/weft/generated/api/default_api.rb +2 -2
- data/lib/weft/generated/api/fetch_api.rb +22 -6
- data/lib/weft/generated/api/payments_api.rb +2 -2
- data/lib/weft/generated/api/purchases_api.rb +150 -0
- data/lib/weft/generated/api/resources_api.rb +6 -6
- data/lib/weft/generated/api/search_api.rb +6 -6
- data/lib/weft/generated/api_client.rb +2 -2
- data/lib/weft/generated/api_error.rb +2 -2
- data/lib/weft/generated/api_model_base.rb +2 -2
- data/lib/weft/generated/configuration.rb +2 -2
- data/lib/weft/generated/models/account_details.rb +54 -4
- data/lib/weft/generated/models/api_key.rb +2 -2
- data/lib/weft/generated/models/api_key_created.rb +2 -2
- data/lib/weft/generated/models/api_key_created_response.rb +2 -2
- data/lib/weft/generated/models/api_key_list_response.rb +2 -2
- data/lib/weft/generated/models/auth_response.rb +2 -2
- data/lib/weft/generated/models/auth_response_data.rb +2 -2
- data/lib/weft/generated/models/balance_response.rb +5 -5
- data/lib/weft/generated/models/confirm_request.rb +2 -2
- data/lib/weft/generated/models/create_api_key_request.rb +2 -2
- data/lib/weft/generated/models/enrolled_resource.rb +4 -4
- data/lib/weft/generated/models/error.rb +3 -3
- data/lib/weft/generated/models/error_response.rb +3 -3
- data/lib/weft/generated/models/fetch403_response.rb +2 -2
- data/lib/weft/generated/models/fetch_balance_snapshot.rb +5 -5
- data/lib/weft/generated/models/fetch_error_response.rb +5 -5
- data/lib/weft/generated/models/fetch_request.rb +5 -5
- data/lib/weft/generated/models/fetch_request_body.rb +2 -2
- data/lib/weft/generated/models/fetch_response.rb +83 -5
- data/lib/weft/generated/models/insufficient_scope_response.rb +3 -3
- data/lib/weft/generated/models/me_api_key.rb +2 -2
- data/lib/weft/generated/models/me_api_key_creator.rb +3 -3
- data/lib/weft/generated/models/me_response.rb +3 -3
- data/lib/weft/generated/models/me_response_data.rb +55 -0
- data/lib/weft/generated/models/merchant.rb +2 -2
- data/lib/weft/generated/models/message_response.rb +2 -2
- data/lib/weft/generated/models/message_response_data.rb +2 -2
- data/lib/weft/generated/models/pagination.rb +2 -2
- data/lib/weft/generated/models/password_reset_request.rb +2 -2
- data/lib/weft/generated/models/password_update_request.rb +2 -2
- data/lib/weft/generated/models/payment.rb +3 -12
- data/lib/weft/generated/models/payment_list_response.rb +2 -2
- data/lib/weft/generated/models/payment_response.rb +2 -2
- data/lib/weft/generated/models/principal_wallet.rb +190 -0
- data/lib/weft/generated/models/promo_balance.rb +3 -3
- data/lib/weft/generated/models/purchase.rb +427 -0
- data/lib/weft/generated/models/{search_agent_card.rb → purchase_artifact.rb} +91 -82
- data/lib/weft/generated/models/purchase_list_response.rb +192 -0
- data/lib/weft/generated/models/purchase_response.rb +164 -0
- data/lib/weft/generated/models/resend_confirmation_request.rb +2 -2
- data/lib/weft/generated/models/resource_enrollment_request.rb +5 -5
- data/lib/weft/generated/models/resource_enrollment_response.rb +2 -2
- data/lib/weft/generated/models/resource_stats.rb +2 -2
- data/lib/weft/generated/models/{search_skill_endpoint.rb → search_capability_ref.rb} +18 -19
- data/lib/weft/generated/models/search_endpoint_call.rb +179 -0
- data/lib/weft/generated/models/search_endpoint_hit.rb +296 -0
- data/lib/weft/generated/models/{search_skill.rb → search_endpoint_price.rb} +76 -112
- data/lib/weft/generated/models/search_error_response.rb +5 -5
- data/lib/weft/generated/models/search_filter_spec.rb +175 -0
- data/lib/weft/generated/models/{search_pricing.rb → search_payment_offer.rb} +64 -67
- data/lib/weft/generated/models/search_price_atomic_filter.rb +284 -0
- data/lib/weft/generated/models/search_price_usd_filter.rb +294 -0
- data/lib/weft/generated/models/search_protocol_filter.rb +200 -0
- data/lib/weft/generated/models/{search_endpoints.rb → search_provider_ref.rb} +26 -36
- data/lib/weft/generated/models/search_request.rb +36 -27
- data/lib/weft/generated/models/search_resource_type_filter.rb +200 -0
- data/lib/weft/generated/models/search_response.rb +367 -31
- data/lib/weft/generated/models/search_response_warnings_inner.rb +210 -0
- data/lib/weft/generated/models/search_result.rb +68 -220
- data/lib/weft/generated/models/sign_in_request.rb +2 -2
- data/lib/weft/generated/models/sign_up_request.rb +2 -2
- data/lib/weft/generated/models/spending_policy.rb +2 -2
- data/lib/weft/generated/models/user.rb +2 -2
- data/lib/weft/generated/models/user_principal.rb +370 -0
- data/lib/weft/generated/models/wallet.rb +5 -5
- data/lib/weft/generated/version.rb +3 -3
- data/lib/weft/generated.rb +10 -4
- data/lib/weft/sdk.rb +1 -1
- metadata +57 -19
- data/docs/SearchAgentCard.md +0 -34
- data/docs/SearchEndpoints.md +0 -24
- data/docs/SearchFilters.md +0 -26
- data/docs/SearchPricing.md +0 -24
- data/docs/SearchRanking.md +0 -26
- data/docs/SearchResponseResultsInner.md +0 -36
- data/docs/SearchSkill.md +0 -36
- data/docs/SearchSkillEndpoint.md +0 -20
- data/lib/weft/generated/models/search_filters.rb +0 -277
- data/lib/weft/generated/models/search_ranking.rb +0 -277
- data/lib/weft/generated/models/search_response_results_inner.rb +0 -103
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Weft API
|
|
3
|
+
|
|
4
|
+
#The Weft API is the buyer-runtime surface that powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and any third-party agent that wants to discover and pay for paid resources on Weft. v1 covers five buyer concerns: 1. Account onboarding (`/api/v1/auth/*`, `/api/v1/me`) 2. CLI authentication (`/api/v1/api_keys`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/purchases`) Seller-side concerns (agent management, payout analytics, webhook delivery, the public storefront for `data_api` resources) live in the dashboard and are intentionally not documented here. They will be split out into a separate, dashboard-scoped spec when they need to be SDK-consumable. All errors share the envelope defined by `ErrorResponse`, except the buyer-runtime endpoints (`/search`, `/fetch`) which use bespoke envelopes carrying additional context — see `SearchErrorResponse` and `FetchErrorResponse`.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.9.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Weft
|
|
17
|
+
class SearchResponseWarningsInner < ApiModelBase
|
|
18
|
+
attr_accessor :code
|
|
19
|
+
|
|
20
|
+
attr_accessor :message
|
|
21
|
+
|
|
22
|
+
# Typed cause for codes that carry one. Null otherwise.
|
|
23
|
+
attr_accessor :cause
|
|
24
|
+
|
|
25
|
+
# Structured context for the warning. Null when the code carries none.
|
|
26
|
+
attr_accessor :context
|
|
27
|
+
|
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
|
+
def self.attribute_map
|
|
30
|
+
{
|
|
31
|
+
:'code' => :'code',
|
|
32
|
+
:'message' => :'message',
|
|
33
|
+
:'cause' => :'cause',
|
|
34
|
+
:'context' => :'context'
|
|
35
|
+
}
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Returns attribute mapping this model knows about
|
|
39
|
+
def self.acceptable_attribute_map
|
|
40
|
+
attribute_map
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Returns all the JSON keys this model knows about
|
|
44
|
+
def self.acceptable_attributes
|
|
45
|
+
acceptable_attribute_map.values
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Attribute type mapping.
|
|
49
|
+
def self.openapi_types
|
|
50
|
+
{
|
|
51
|
+
:'code' => :'String',
|
|
52
|
+
:'message' => :'String',
|
|
53
|
+
:'cause' => :'String',
|
|
54
|
+
:'context' => :'Object'
|
|
55
|
+
}
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# List of attributes with nullable: true
|
|
59
|
+
def self.openapi_nullable
|
|
60
|
+
Set.new([
|
|
61
|
+
])
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Initializes the object
|
|
65
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
66
|
+
def initialize(attributes = {})
|
|
67
|
+
if (!attributes.is_a?(Hash))
|
|
68
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Weft::SearchResponseWarningsInner` initialize method"
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
72
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
73
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
74
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
75
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Weft::SearchResponseWarningsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
76
|
+
end
|
|
77
|
+
h[k.to_sym] = v
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if attributes.key?(:'code')
|
|
81
|
+
self.code = attributes[:'code']
|
|
82
|
+
else
|
|
83
|
+
self.code = nil
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
if attributes.key?(:'message')
|
|
87
|
+
self.message = attributes[:'message']
|
|
88
|
+
else
|
|
89
|
+
self.message = nil
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'cause')
|
|
93
|
+
self.cause = attributes[:'cause']
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
if attributes.key?(:'context')
|
|
97
|
+
self.context = attributes[:'context']
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
102
|
+
# @return Array for valid properties with the reasons
|
|
103
|
+
def list_invalid_properties
|
|
104
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
105
|
+
invalid_properties = Array.new
|
|
106
|
+
if @code.nil?
|
|
107
|
+
invalid_properties.push('invalid value for "code", code cannot be nil.')
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if @message.nil?
|
|
111
|
+
invalid_properties.push('invalid value for "message", message cannot be nil.')
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
invalid_properties
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Check to see if the all the properties in the model are valid
|
|
118
|
+
# @return true if the model is valid
|
|
119
|
+
def valid?
|
|
120
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
121
|
+
return false if @code.nil?
|
|
122
|
+
return false if @message.nil?
|
|
123
|
+
true
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Custom attribute writer method with validation
|
|
127
|
+
# @param [Object] code Value to be assigned
|
|
128
|
+
def code=(code)
|
|
129
|
+
if code.nil?
|
|
130
|
+
fail ArgumentError, 'code cannot be nil'
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
@code = code
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Custom attribute writer method with validation
|
|
137
|
+
# @param [Object] message Value to be assigned
|
|
138
|
+
def message=(message)
|
|
139
|
+
if message.nil?
|
|
140
|
+
fail ArgumentError, 'message cannot be nil'
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
@message = message
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Checks equality by comparing each attribute.
|
|
147
|
+
# @param [Object] Object to be compared
|
|
148
|
+
def ==(o)
|
|
149
|
+
return true if self.equal?(o)
|
|
150
|
+
self.class == o.class &&
|
|
151
|
+
code == o.code &&
|
|
152
|
+
message == o.message &&
|
|
153
|
+
cause == o.cause &&
|
|
154
|
+
context == o.context
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# @see the `==` method
|
|
158
|
+
# @param [Object] Object to be compared
|
|
159
|
+
def eql?(o)
|
|
160
|
+
self == o
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Calculates hash code according to all attributes.
|
|
164
|
+
# @return [Integer] Hash code
|
|
165
|
+
def hash
|
|
166
|
+
[code, message, cause, context].hash
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Builds the object from hash
|
|
170
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
171
|
+
# @return [Object] Returns the model itself
|
|
172
|
+
def self.build_from_hash(attributes)
|
|
173
|
+
return nil unless attributes.is_a?(Hash)
|
|
174
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
175
|
+
transformed_hash = {}
|
|
176
|
+
openapi_types.each_pair do |key, type|
|
|
177
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
178
|
+
transformed_hash["#{key}"] = nil
|
|
179
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
180
|
+
# check to ensure the input is an array given that the attribute
|
|
181
|
+
# is documented as an array but the input is not
|
|
182
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
183
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
184
|
+
end
|
|
185
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
186
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
187
|
+
end
|
|
188
|
+
end
|
|
189
|
+
new(transformed_hash)
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Returns the object in the form of hash
|
|
193
|
+
# @return [Hash] Returns the object in the form of hash
|
|
194
|
+
def to_hash
|
|
195
|
+
hash = {}
|
|
196
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
197
|
+
value = self.send(attr)
|
|
198
|
+
if value.nil?
|
|
199
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
200
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
hash[param] = _to_hash(value)
|
|
204
|
+
end
|
|
205
|
+
hash
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
end
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Weft API
|
|
3
3
|
|
|
4
|
-
#The Weft API is the buyer-runtime surface that powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and any third-party agent that wants to discover and pay for paid resources on Weft. v1 covers five buyer concerns: 1. Account onboarding (`/api/v1/auth/*`, `/api/v1/me`) 2. CLI authentication (`/api/v1/api_keys`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/
|
|
4
|
+
#The Weft API is the buyer-runtime surface that powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and any third-party agent that wants to discover and pay for paid resources on Weft. v1 covers five buyer concerns: 1. Account onboarding (`/api/v1/auth/*`, `/api/v1/me`) 2. CLI authentication (`/api/v1/api_keys`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/purchases`) Seller-side concerns (agent management, payout analytics, webhook delivery, the public storefront for `data_api` resources) live in the dashboard and are intentionally not documented here. They will be split out into a separate, dashboard-scoped spec when they need to be SDK-consumable. All errors share the envelope defined by `ErrorResponse`, except the buyer-runtime endpoints (`/search`, `/fetch`) which use bespoke envelopes carrying additional context — see `SearchErrorResponse` and `FetchErrorResponse`.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 0.
|
|
6
|
+
The version of the OpenAPI document: 0.9.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.19.0
|
|
@@ -15,67 +15,21 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Weft
|
|
17
17
|
class SearchResult < ApiModelBase
|
|
18
|
-
|
|
19
|
-
attr_accessor :id
|
|
18
|
+
attr_accessor :provider
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
attr_accessor :score
|
|
23
|
-
|
|
24
|
-
# Agent protocol surface.
|
|
25
|
-
attr_accessor :protocol
|
|
26
|
-
|
|
27
|
-
# Domain tags declared by the agent.
|
|
28
|
-
attr_accessor :domain
|
|
29
|
-
|
|
30
|
-
# Reseller slug if this agent is fronted by an aggregator (e.g. `locus`).
|
|
31
|
-
attr_accessor :reseller
|
|
32
|
-
|
|
33
|
-
# Upstream provider hostname when fronted by a reseller.
|
|
34
|
-
attr_accessor :upstream
|
|
35
|
-
|
|
36
|
-
attr_accessor :agent_card
|
|
37
|
-
|
|
38
|
-
attr_accessor :pricing
|
|
39
|
-
|
|
40
|
-
attr_accessor :ranking
|
|
20
|
+
attr_accessor :capability
|
|
41
21
|
|
|
42
22
|
attr_accessor :endpoints
|
|
43
23
|
|
|
44
|
-
|
|
45
|
-
attr_reader :datatype
|
|
46
|
-
attr_reader :allowable_values
|
|
47
|
-
|
|
48
|
-
def initialize(datatype, allowable_values)
|
|
49
|
-
@allowable_values = allowable_values.map do |value|
|
|
50
|
-
case datatype.to_s
|
|
51
|
-
when /Integer/i
|
|
52
|
-
value.to_i
|
|
53
|
-
when /Float/i
|
|
54
|
-
value.to_f
|
|
55
|
-
else
|
|
56
|
-
value
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
def valid?(value)
|
|
62
|
-
!value || allowable_values.include?(value)
|
|
63
|
-
end
|
|
64
|
-
end
|
|
24
|
+
attr_accessor :score
|
|
65
25
|
|
|
66
26
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
67
27
|
def self.attribute_map
|
|
68
28
|
{
|
|
69
|
-
:'
|
|
70
|
-
:'
|
|
71
|
-
:'
|
|
72
|
-
:'
|
|
73
|
-
:'reseller' => :'reseller',
|
|
74
|
-
:'upstream' => :'upstream',
|
|
75
|
-
:'agent_card' => :'agent_card',
|
|
76
|
-
:'pricing' => :'pricing',
|
|
77
|
-
:'ranking' => :'ranking',
|
|
78
|
-
:'endpoints' => :'endpoints'
|
|
29
|
+
:'provider' => :'provider',
|
|
30
|
+
:'capability' => :'capability',
|
|
31
|
+
:'endpoints' => :'endpoints',
|
|
32
|
+
:'score' => :'score'
|
|
79
33
|
}
|
|
80
34
|
end
|
|
81
35
|
|
|
@@ -92,16 +46,10 @@ module Weft
|
|
|
92
46
|
# Attribute type mapping.
|
|
93
47
|
def self.openapi_types
|
|
94
48
|
{
|
|
95
|
-
:'
|
|
96
|
-
:'
|
|
97
|
-
:'
|
|
98
|
-
:'
|
|
99
|
-
:'reseller' => :'String',
|
|
100
|
-
:'upstream' => :'String',
|
|
101
|
-
:'agent_card' => :'SearchAgentCard',
|
|
102
|
-
:'pricing' => :'SearchPricing',
|
|
103
|
-
:'ranking' => :'SearchRanking',
|
|
104
|
-
:'endpoints' => :'SearchEndpoints'
|
|
49
|
+
:'provider' => :'SearchProviderRef',
|
|
50
|
+
:'capability' => :'SearchCapabilityRef',
|
|
51
|
+
:'endpoints' => :'Array<SearchEndpointHit>',
|
|
52
|
+
:'score' => :'Float'
|
|
105
53
|
}
|
|
106
54
|
end
|
|
107
55
|
|
|
@@ -127,62 +75,30 @@ module Weft
|
|
|
127
75
|
h[k.to_sym] = v
|
|
128
76
|
}
|
|
129
77
|
|
|
130
|
-
if attributes.key?(:'
|
|
131
|
-
self.
|
|
78
|
+
if attributes.key?(:'provider')
|
|
79
|
+
self.provider = attributes[:'provider']
|
|
132
80
|
else
|
|
133
|
-
self.
|
|
134
|
-
end
|
|
135
|
-
|
|
136
|
-
if attributes.key?(:'score')
|
|
137
|
-
self.score = attributes[:'score']
|
|
138
|
-
else
|
|
139
|
-
self.score = nil
|
|
81
|
+
self.provider = nil
|
|
140
82
|
end
|
|
141
83
|
|
|
142
|
-
if attributes.key?(:'
|
|
143
|
-
self.
|
|
84
|
+
if attributes.key?(:'capability')
|
|
85
|
+
self.capability = attributes[:'capability']
|
|
144
86
|
else
|
|
145
|
-
self.
|
|
87
|
+
self.capability = nil
|
|
146
88
|
end
|
|
147
89
|
|
|
148
|
-
if attributes.key?(:'
|
|
149
|
-
if (value = attributes[:'
|
|
150
|
-
self.
|
|
90
|
+
if attributes.key?(:'endpoints')
|
|
91
|
+
if (value = attributes[:'endpoints']).is_a?(Array)
|
|
92
|
+
self.endpoints = value
|
|
151
93
|
end
|
|
152
94
|
else
|
|
153
|
-
self.
|
|
154
|
-
end
|
|
155
|
-
|
|
156
|
-
if attributes.key?(:'reseller')
|
|
157
|
-
self.reseller = attributes[:'reseller']
|
|
158
|
-
end
|
|
159
|
-
|
|
160
|
-
if attributes.key?(:'upstream')
|
|
161
|
-
self.upstream = attributes[:'upstream']
|
|
162
|
-
end
|
|
163
|
-
|
|
164
|
-
if attributes.key?(:'agent_card')
|
|
165
|
-
self.agent_card = attributes[:'agent_card']
|
|
166
|
-
else
|
|
167
|
-
self.agent_card = nil
|
|
168
|
-
end
|
|
169
|
-
|
|
170
|
-
if attributes.key?(:'pricing')
|
|
171
|
-
self.pricing = attributes[:'pricing']
|
|
172
|
-
else
|
|
173
|
-
self.pricing = nil
|
|
174
|
-
end
|
|
175
|
-
|
|
176
|
-
if attributes.key?(:'ranking')
|
|
177
|
-
self.ranking = attributes[:'ranking']
|
|
178
|
-
else
|
|
179
|
-
self.ranking = nil
|
|
95
|
+
self.endpoints = nil
|
|
180
96
|
end
|
|
181
97
|
|
|
182
|
-
if attributes.key?(:'
|
|
183
|
-
self.
|
|
98
|
+
if attributes.key?(:'score')
|
|
99
|
+
self.score = attributes[:'score']
|
|
184
100
|
else
|
|
185
|
-
self.
|
|
101
|
+
self.score = nil
|
|
186
102
|
end
|
|
187
103
|
end
|
|
188
104
|
|
|
@@ -191,8 +107,16 @@ module Weft
|
|
|
191
107
|
def list_invalid_properties
|
|
192
108
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
193
109
|
invalid_properties = Array.new
|
|
194
|
-
if @
|
|
195
|
-
invalid_properties.push('invalid value for "
|
|
110
|
+
if @provider.nil?
|
|
111
|
+
invalid_properties.push('invalid value for "provider", provider cannot be nil.')
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if @capability.nil?
|
|
115
|
+
invalid_properties.push('invalid value for "capability", capability cannot be nil.')
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if @endpoints.nil?
|
|
119
|
+
invalid_properties.push('invalid value for "endpoints", endpoints cannot be nil.')
|
|
196
120
|
end
|
|
197
121
|
|
|
198
122
|
if @score.nil?
|
|
@@ -207,30 +131,6 @@ module Weft
|
|
|
207
131
|
invalid_properties.push('invalid value for "score", must be greater than or equal to 0.')
|
|
208
132
|
end
|
|
209
133
|
|
|
210
|
-
if @protocol.nil?
|
|
211
|
-
invalid_properties.push('invalid value for "protocol", protocol cannot be nil.')
|
|
212
|
-
end
|
|
213
|
-
|
|
214
|
-
if @domain.nil?
|
|
215
|
-
invalid_properties.push('invalid value for "domain", domain cannot be nil.')
|
|
216
|
-
end
|
|
217
|
-
|
|
218
|
-
if @agent_card.nil?
|
|
219
|
-
invalid_properties.push('invalid value for "agent_card", agent_card cannot be nil.')
|
|
220
|
-
end
|
|
221
|
-
|
|
222
|
-
if @pricing.nil?
|
|
223
|
-
invalid_properties.push('invalid value for "pricing", pricing cannot be nil.')
|
|
224
|
-
end
|
|
225
|
-
|
|
226
|
-
if @ranking.nil?
|
|
227
|
-
invalid_properties.push('invalid value for "ranking", ranking cannot be nil.')
|
|
228
|
-
end
|
|
229
|
-
|
|
230
|
-
if @endpoints.nil?
|
|
231
|
-
invalid_properties.push('invalid value for "endpoints", endpoints cannot be nil.')
|
|
232
|
-
end
|
|
233
|
-
|
|
234
134
|
invalid_properties
|
|
235
135
|
end
|
|
236
136
|
|
|
@@ -238,107 +138,61 @@ module Weft
|
|
|
238
138
|
# @return true if the model is valid
|
|
239
139
|
def valid?
|
|
240
140
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
241
|
-
return false if @
|
|
141
|
+
return false if @provider.nil?
|
|
142
|
+
return false if @capability.nil?
|
|
143
|
+
return false if @endpoints.nil?
|
|
242
144
|
return false if @score.nil?
|
|
243
145
|
return false if @score > 1
|
|
244
146
|
return false if @score < 0
|
|
245
|
-
return false if @protocol.nil?
|
|
246
|
-
protocol_validator = EnumAttributeValidator.new('String', ["a2a", "mcp", "openapi", "AgentNet"])
|
|
247
|
-
return false unless protocol_validator.valid?(@protocol)
|
|
248
|
-
return false if @domain.nil?
|
|
249
|
-
return false if @agent_card.nil?
|
|
250
|
-
return false if @pricing.nil?
|
|
251
|
-
return false if @ranking.nil?
|
|
252
|
-
return false if @endpoints.nil?
|
|
253
147
|
true
|
|
254
148
|
end
|
|
255
149
|
|
|
256
150
|
# Custom attribute writer method with validation
|
|
257
|
-
# @param [Object]
|
|
258
|
-
def
|
|
259
|
-
if
|
|
260
|
-
fail ArgumentError, '
|
|
151
|
+
# @param [Object] provider Value to be assigned
|
|
152
|
+
def provider=(provider)
|
|
153
|
+
if provider.nil?
|
|
154
|
+
fail ArgumentError, 'provider cannot be nil'
|
|
261
155
|
end
|
|
262
156
|
|
|
263
|
-
@
|
|
264
|
-
end
|
|
265
|
-
|
|
266
|
-
# Custom attribute writer method with validation
|
|
267
|
-
# @param [Object] score Value to be assigned
|
|
268
|
-
def score=(score)
|
|
269
|
-
if score.nil?
|
|
270
|
-
fail ArgumentError, 'score cannot be nil'
|
|
271
|
-
end
|
|
272
|
-
|
|
273
|
-
if score > 1
|
|
274
|
-
fail ArgumentError, 'invalid value for "score", must be smaller than or equal to 1.'
|
|
275
|
-
end
|
|
276
|
-
|
|
277
|
-
if score < 0
|
|
278
|
-
fail ArgumentError, 'invalid value for "score", must be greater than or equal to 0.'
|
|
279
|
-
end
|
|
280
|
-
|
|
281
|
-
@score = score
|
|
282
|
-
end
|
|
283
|
-
|
|
284
|
-
# Custom attribute writer method checking allowed values (enum).
|
|
285
|
-
# @param [Object] protocol Object to be assigned
|
|
286
|
-
def protocol=(protocol)
|
|
287
|
-
validator = EnumAttributeValidator.new('String', ["a2a", "mcp", "openapi", "AgentNet"])
|
|
288
|
-
unless validator.valid?(protocol)
|
|
289
|
-
fail ArgumentError, "invalid value for \"protocol\", must be one of #{validator.allowable_values}."
|
|
290
|
-
end
|
|
291
|
-
@protocol = protocol
|
|
157
|
+
@provider = provider
|
|
292
158
|
end
|
|
293
159
|
|
|
294
160
|
# Custom attribute writer method with validation
|
|
295
|
-
# @param [Object]
|
|
296
|
-
def
|
|
297
|
-
if
|
|
298
|
-
fail ArgumentError, '
|
|
161
|
+
# @param [Object] capability Value to be assigned
|
|
162
|
+
def capability=(capability)
|
|
163
|
+
if capability.nil?
|
|
164
|
+
fail ArgumentError, 'capability cannot be nil'
|
|
299
165
|
end
|
|
300
166
|
|
|
301
|
-
@
|
|
167
|
+
@capability = capability
|
|
302
168
|
end
|
|
303
169
|
|
|
304
170
|
# Custom attribute writer method with validation
|
|
305
|
-
# @param [Object]
|
|
306
|
-
def
|
|
307
|
-
if
|
|
308
|
-
fail ArgumentError, '
|
|
171
|
+
# @param [Object] endpoints Value to be assigned
|
|
172
|
+
def endpoints=(endpoints)
|
|
173
|
+
if endpoints.nil?
|
|
174
|
+
fail ArgumentError, 'endpoints cannot be nil'
|
|
309
175
|
end
|
|
310
176
|
|
|
311
|
-
@
|
|
177
|
+
@endpoints = endpoints
|
|
312
178
|
end
|
|
313
179
|
|
|
314
180
|
# Custom attribute writer method with validation
|
|
315
|
-
# @param [Object]
|
|
316
|
-
def
|
|
317
|
-
if
|
|
318
|
-
fail ArgumentError, '
|
|
181
|
+
# @param [Object] score Value to be assigned
|
|
182
|
+
def score=(score)
|
|
183
|
+
if score.nil?
|
|
184
|
+
fail ArgumentError, 'score cannot be nil'
|
|
319
185
|
end
|
|
320
186
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
# Custom attribute writer method with validation
|
|
325
|
-
# @param [Object] ranking Value to be assigned
|
|
326
|
-
def ranking=(ranking)
|
|
327
|
-
if ranking.nil?
|
|
328
|
-
fail ArgumentError, 'ranking cannot be nil'
|
|
187
|
+
if score > 1
|
|
188
|
+
fail ArgumentError, 'invalid value for "score", must be smaller than or equal to 1.'
|
|
329
189
|
end
|
|
330
190
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
# Custom attribute writer method with validation
|
|
335
|
-
# @param [Object] endpoints Value to be assigned
|
|
336
|
-
def endpoints=(endpoints)
|
|
337
|
-
if endpoints.nil?
|
|
338
|
-
fail ArgumentError, 'endpoints cannot be nil'
|
|
191
|
+
if score < 0
|
|
192
|
+
fail ArgumentError, 'invalid value for "score", must be greater than or equal to 0.'
|
|
339
193
|
end
|
|
340
194
|
|
|
341
|
-
@
|
|
195
|
+
@score = score
|
|
342
196
|
end
|
|
343
197
|
|
|
344
198
|
# Checks equality by comparing each attribute.
|
|
@@ -346,16 +200,10 @@ module Weft
|
|
|
346
200
|
def ==(o)
|
|
347
201
|
return true if self.equal?(o)
|
|
348
202
|
self.class == o.class &&
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
reseller == o.reseller &&
|
|
354
|
-
upstream == o.upstream &&
|
|
355
|
-
agent_card == o.agent_card &&
|
|
356
|
-
pricing == o.pricing &&
|
|
357
|
-
ranking == o.ranking &&
|
|
358
|
-
endpoints == o.endpoints
|
|
203
|
+
provider == o.provider &&
|
|
204
|
+
capability == o.capability &&
|
|
205
|
+
endpoints == o.endpoints &&
|
|
206
|
+
score == o.score
|
|
359
207
|
end
|
|
360
208
|
|
|
361
209
|
# @see the `==` method
|
|
@@ -367,7 +215,7 @@ module Weft
|
|
|
367
215
|
# Calculates hash code according to all attributes.
|
|
368
216
|
# @return [Integer] Hash code
|
|
369
217
|
def hash
|
|
370
|
-
[
|
|
218
|
+
[provider, capability, endpoints, score].hash
|
|
371
219
|
end
|
|
372
220
|
|
|
373
221
|
# Builds the object from hash
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Weft API
|
|
3
3
|
|
|
4
|
-
#The Weft API is the buyer-runtime surface that powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and any third-party agent that wants to discover and pay for paid resources on Weft. v1 covers five buyer concerns: 1. Account onboarding (`/api/v1/auth/*`, `/api/v1/me`) 2. CLI authentication (`/api/v1/api_keys`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/
|
|
4
|
+
#The Weft API is the buyer-runtime surface that powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and any third-party agent that wants to discover and pay for paid resources on Weft. v1 covers five buyer concerns: 1. Account onboarding (`/api/v1/auth/*`, `/api/v1/me`) 2. CLI authentication (`/api/v1/api_keys`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/purchases`) Seller-side concerns (agent management, payout analytics, webhook delivery, the public storefront for `data_api` resources) live in the dashboard and are intentionally not documented here. They will be split out into a separate, dashboard-scoped spec when they need to be SDK-consumable. All errors share the envelope defined by `ErrorResponse`, except the buyer-runtime endpoints (`/search`, `/fetch`) which use bespoke envelopes carrying additional context — see `SearchErrorResponse` and `FetchErrorResponse`.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 0.
|
|
6
|
+
The version of the OpenAPI document: 0.9.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.19.0
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Weft API
|
|
3
3
|
|
|
4
|
-
#The Weft API is the buyer-runtime surface that powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and any third-party agent that wants to discover and pay for paid resources on Weft. v1 covers five buyer concerns: 1. Account onboarding (`/api/v1/auth/*`, `/api/v1/me`) 2. CLI authentication (`/api/v1/api_keys`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/
|
|
4
|
+
#The Weft API is the buyer-runtime surface that powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and any third-party agent that wants to discover and pay for paid resources on Weft. v1 covers five buyer concerns: 1. Account onboarding (`/api/v1/auth/*`, `/api/v1/me`) 2. CLI authentication (`/api/v1/api_keys`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/purchases`) Seller-side concerns (agent management, payout analytics, webhook delivery, the public storefront for `data_api` resources) live in the dashboard and are intentionally not documented here. They will be split out into a separate, dashboard-scoped spec when they need to be SDK-consumable. All errors share the envelope defined by `ErrorResponse`, except the buyer-runtime endpoints (`/search`, `/fetch`) which use bespoke envelopes carrying additional context — see `SearchErrorResponse` and `FetchErrorResponse`.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 0.
|
|
6
|
+
The version of the OpenAPI document: 0.9.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.19.0
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Weft API
|
|
3
3
|
|
|
4
|
-
#The Weft API is the buyer-runtime surface that powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and any third-party agent that wants to discover and pay for paid resources on Weft. v1 covers five buyer concerns: 1. Account onboarding (`/api/v1/auth/*`, `/api/v1/me`) 2. CLI authentication (`/api/v1/api_keys`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/
|
|
4
|
+
#The Weft API is the buyer-runtime surface that powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and any third-party agent that wants to discover and pay for paid resources on Weft. v1 covers five buyer concerns: 1. Account onboarding (`/api/v1/auth/*`, `/api/v1/me`) 2. CLI authentication (`/api/v1/api_keys`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/purchases`) Seller-side concerns (agent management, payout analytics, webhook delivery, the public storefront for `data_api` resources) live in the dashboard and are intentionally not documented here. They will be split out into a separate, dashboard-scoped spec when they need to be SDK-consumable. All errors share the envelope defined by `ErrorResponse`, except the buyer-runtime endpoints (`/search`, `/fetch`) which use bespoke envelopes carrying additional context — see `SearchErrorResponse` and `FetchErrorResponse`.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 0.
|
|
6
|
+
The version of the OpenAPI document: 0.9.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.19.0
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Weft API
|
|
3
3
|
|
|
4
|
-
#The Weft API is the buyer-runtime surface that powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and any third-party agent that wants to discover and pay for paid resources on Weft. v1 covers five buyer concerns: 1. Account onboarding (`/api/v1/auth/*`, `/api/v1/me`) 2. CLI authentication (`/api/v1/api_keys`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/
|
|
4
|
+
#The Weft API is the buyer-runtime surface that powers the `weft` CLI, the hosted MCP server (`weft.network/mcp`), and any third-party agent that wants to discover and pay for paid resources on Weft. v1 covers five buyer concerns: 1. Account onboarding (`/api/v1/auth/*`, `/api/v1/me`) 2. CLI authentication (`/api/v1/api_keys`) 3. Wallet visibility (`/api/v1/balance`) 4. Discovery (`/api/v1/search`) 5. Paid execution (`/api/v1/fetch`) 6. Purchase history (`/api/v1/purchases`) Seller-side concerns (agent management, payout analytics, webhook delivery, the public storefront for `data_api` resources) live in the dashboard and are intentionally not documented here. They will be split out into a separate, dashboard-scoped spec when they need to be SDK-consumable. All errors share the envelope defined by `ErrorResponse`, except the buyer-runtime endpoints (`/search`, `/fetch`) which use bespoke envelopes carrying additional context — see `SearchErrorResponse` and `FetchErrorResponse`.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 0.
|
|
6
|
+
The version of the OpenAPI document: 0.9.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.19.0
|