weft-sdk 0.6.2 → 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 +10 -13
- 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 +43 -0
- data/docs/Error.md +0 -1
- data/docs/ErrorResponse.md +0 -1
- data/docs/Fetch403Response.md +48 -0
- data/docs/FetchApi.md +10 -7
- data/docs/FetchBalanceSnapshot.md +5 -2
- data/docs/FetchErrorResponse.md +0 -1
- data/docs/FetchRequest.md +0 -1
- data/docs/FetchRequestBody.md +0 -1
- data/docs/FetchResponse.md +6 -3
- data/docs/InsufficientScopeResponse.md +21 -0
- data/docs/MeApiKey.md +25 -0
- data/docs/MeApiKeyCreator.md +21 -0
- 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 +23 -0
- data/docs/ResourceEnrollmentResponse.md +17 -0
- data/docs/ResourceStats.md +29 -0
- data/docs/ResourcesApi.md +71 -0
- 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 +5 -2
- 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 +90 -0
- 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 +94 -85
- 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 +474 -0
- 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 +104 -0
- data/lib/weft/generated/models/fetch_balance_snapshot.rb +59 -4
- 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 +85 -7
- data/lib/weft/generated/models/insufficient_scope_response.rb +242 -0
- data/lib/weft/generated/models/{search_skill.rb → me_api_key.rb} +50 -92
- data/lib/weft/generated/models/me_api_key_creator.rb +200 -0
- 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/purchase_artifact.rb +237 -0
- 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/{search_agent_card.rb → resource_enrollment_request.rb} +59 -75
- data/lib/weft/generated/models/resource_enrollment_response.rb +164 -0
- data/lib/weft/generated/models/resource_stats.rb +323 -0
- 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_endpoint_price.rb +223 -0
- 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 +366 -30
- 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 +58 -4
- data/lib/weft/generated/version.rb +3 -3
- data/lib/weft/generated.rb +10 -4
- data/lib/weft/sdk.rb +1 -1
- metadata +75 -17
- 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/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
|
@@ -0,0 +1,370 @@
|
|
|
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
|
+
# The buyer User represented by an account API key or OAuth token.
|
|
18
|
+
class UserPrincipal < ApiModelBase
|
|
19
|
+
attr_accessor :principal_type
|
|
20
|
+
|
|
21
|
+
attr_accessor :id
|
|
22
|
+
|
|
23
|
+
attr_accessor :email
|
|
24
|
+
|
|
25
|
+
attr_accessor :display_name
|
|
26
|
+
|
|
27
|
+
attr_accessor :status
|
|
28
|
+
|
|
29
|
+
attr_accessor :buyer_enabled
|
|
30
|
+
|
|
31
|
+
attr_accessor :seller_enabled
|
|
32
|
+
|
|
33
|
+
attr_accessor :provisioning_status
|
|
34
|
+
|
|
35
|
+
attr_accessor :wallet
|
|
36
|
+
|
|
37
|
+
class EnumAttributeValidator
|
|
38
|
+
attr_reader :datatype
|
|
39
|
+
attr_reader :allowable_values
|
|
40
|
+
|
|
41
|
+
def initialize(datatype, allowable_values)
|
|
42
|
+
@allowable_values = allowable_values.map do |value|
|
|
43
|
+
case datatype.to_s
|
|
44
|
+
when /Integer/i
|
|
45
|
+
value.to_i
|
|
46
|
+
when /Float/i
|
|
47
|
+
value.to_f
|
|
48
|
+
else
|
|
49
|
+
value
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def valid?(value)
|
|
55
|
+
!value || allowable_values.include?(value)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
60
|
+
def self.attribute_map
|
|
61
|
+
{
|
|
62
|
+
:'principal_type' => :'principal_type',
|
|
63
|
+
:'id' => :'id',
|
|
64
|
+
:'email' => :'email',
|
|
65
|
+
:'display_name' => :'display_name',
|
|
66
|
+
:'status' => :'status',
|
|
67
|
+
:'buyer_enabled' => :'buyer_enabled',
|
|
68
|
+
:'seller_enabled' => :'seller_enabled',
|
|
69
|
+
:'provisioning_status' => :'provisioning_status',
|
|
70
|
+
:'wallet' => :'wallet'
|
|
71
|
+
}
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Returns attribute mapping this model knows about
|
|
75
|
+
def self.acceptable_attribute_map
|
|
76
|
+
attribute_map
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Returns all the JSON keys this model knows about
|
|
80
|
+
def self.acceptable_attributes
|
|
81
|
+
acceptable_attribute_map.values
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Attribute type mapping.
|
|
85
|
+
def self.openapi_types
|
|
86
|
+
{
|
|
87
|
+
:'principal_type' => :'String',
|
|
88
|
+
:'id' => :'Integer',
|
|
89
|
+
:'email' => :'String',
|
|
90
|
+
:'display_name' => :'String',
|
|
91
|
+
:'status' => :'String',
|
|
92
|
+
:'buyer_enabled' => :'Boolean',
|
|
93
|
+
:'seller_enabled' => :'Boolean',
|
|
94
|
+
:'provisioning_status' => :'String',
|
|
95
|
+
:'wallet' => :'PrincipalWallet'
|
|
96
|
+
}
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# List of attributes with nullable: true
|
|
100
|
+
def self.openapi_nullable
|
|
101
|
+
Set.new([
|
|
102
|
+
:'wallet'
|
|
103
|
+
])
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Initializes the object
|
|
107
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
108
|
+
def initialize(attributes = {})
|
|
109
|
+
if (!attributes.is_a?(Hash))
|
|
110
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Weft::UserPrincipal` initialize method"
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
114
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
115
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
116
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
117
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Weft::UserPrincipal`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
118
|
+
end
|
|
119
|
+
h[k.to_sym] = v
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if attributes.key?(:'principal_type')
|
|
123
|
+
self.principal_type = attributes[:'principal_type']
|
|
124
|
+
else
|
|
125
|
+
self.principal_type = nil
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:'id')
|
|
129
|
+
self.id = attributes[:'id']
|
|
130
|
+
else
|
|
131
|
+
self.id = nil
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if attributes.key?(:'email')
|
|
135
|
+
self.email = attributes[:'email']
|
|
136
|
+
else
|
|
137
|
+
self.email = nil
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if attributes.key?(:'display_name')
|
|
141
|
+
self.display_name = attributes[:'display_name']
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if attributes.key?(:'status')
|
|
145
|
+
self.status = attributes[:'status']
|
|
146
|
+
else
|
|
147
|
+
self.status = nil
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
if attributes.key?(:'buyer_enabled')
|
|
151
|
+
self.buyer_enabled = attributes[:'buyer_enabled']
|
|
152
|
+
else
|
|
153
|
+
self.buyer_enabled = nil
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if attributes.key?(:'seller_enabled')
|
|
157
|
+
self.seller_enabled = attributes[:'seller_enabled']
|
|
158
|
+
else
|
|
159
|
+
self.seller_enabled = nil
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if attributes.key?(:'provisioning_status')
|
|
163
|
+
self.provisioning_status = attributes[:'provisioning_status']
|
|
164
|
+
else
|
|
165
|
+
self.provisioning_status = nil
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
if attributes.key?(:'wallet')
|
|
169
|
+
self.wallet = attributes[:'wallet']
|
|
170
|
+
else
|
|
171
|
+
self.wallet = nil
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
176
|
+
# @return Array for valid properties with the reasons
|
|
177
|
+
def list_invalid_properties
|
|
178
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
179
|
+
invalid_properties = Array.new
|
|
180
|
+
if @principal_type.nil?
|
|
181
|
+
invalid_properties.push('invalid value for "principal_type", principal_type cannot be nil.')
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
if @id.nil?
|
|
185
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
if @email.nil?
|
|
189
|
+
invalid_properties.push('invalid value for "email", email cannot be nil.')
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
if @status.nil?
|
|
193
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
if @buyer_enabled.nil?
|
|
197
|
+
invalid_properties.push('invalid value for "buyer_enabled", buyer_enabled cannot be nil.')
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
if @seller_enabled.nil?
|
|
201
|
+
invalid_properties.push('invalid value for "seller_enabled", seller_enabled cannot be nil.')
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
if @provisioning_status.nil?
|
|
205
|
+
invalid_properties.push('invalid value for "provisioning_status", provisioning_status cannot be nil.')
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
invalid_properties
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Check to see if the all the properties in the model are valid
|
|
212
|
+
# @return true if the model is valid
|
|
213
|
+
def valid?
|
|
214
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
215
|
+
return false if @principal_type.nil?
|
|
216
|
+
principal_type_validator = EnumAttributeValidator.new('String', ["user"])
|
|
217
|
+
return false unless principal_type_validator.valid?(@principal_type)
|
|
218
|
+
return false if @id.nil?
|
|
219
|
+
return false if @email.nil?
|
|
220
|
+
return false if @status.nil?
|
|
221
|
+
status_validator = EnumAttributeValidator.new('String', ["active", "blocked"])
|
|
222
|
+
return false unless status_validator.valid?(@status)
|
|
223
|
+
return false if @buyer_enabled.nil?
|
|
224
|
+
return false if @seller_enabled.nil?
|
|
225
|
+
return false if @provisioning_status.nil?
|
|
226
|
+
provisioning_status_validator = EnumAttributeValidator.new('String', ["pending", "ready", "not_applicable"])
|
|
227
|
+
return false unless provisioning_status_validator.valid?(@provisioning_status)
|
|
228
|
+
true
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
232
|
+
# @param [Object] principal_type Object to be assigned
|
|
233
|
+
def principal_type=(principal_type)
|
|
234
|
+
validator = EnumAttributeValidator.new('String', ["user"])
|
|
235
|
+
unless validator.valid?(principal_type)
|
|
236
|
+
fail ArgumentError, "invalid value for \"principal_type\", must be one of #{validator.allowable_values}."
|
|
237
|
+
end
|
|
238
|
+
@principal_type = principal_type
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# Custom attribute writer method with validation
|
|
242
|
+
# @param [Object] id Value to be assigned
|
|
243
|
+
def id=(id)
|
|
244
|
+
if id.nil?
|
|
245
|
+
fail ArgumentError, 'id cannot be nil'
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
@id = id
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
# Custom attribute writer method with validation
|
|
252
|
+
# @param [Object] email Value to be assigned
|
|
253
|
+
def email=(email)
|
|
254
|
+
if email.nil?
|
|
255
|
+
fail ArgumentError, 'email cannot be nil'
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
@email = email
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
262
|
+
# @param [Object] status Object to be assigned
|
|
263
|
+
def status=(status)
|
|
264
|
+
validator = EnumAttributeValidator.new('String', ["active", "blocked"])
|
|
265
|
+
unless validator.valid?(status)
|
|
266
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
|
267
|
+
end
|
|
268
|
+
@status = status
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
# Custom attribute writer method with validation
|
|
272
|
+
# @param [Object] buyer_enabled Value to be assigned
|
|
273
|
+
def buyer_enabled=(buyer_enabled)
|
|
274
|
+
if buyer_enabled.nil?
|
|
275
|
+
fail ArgumentError, 'buyer_enabled cannot be nil'
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
@buyer_enabled = buyer_enabled
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
# Custom attribute writer method with validation
|
|
282
|
+
# @param [Object] seller_enabled Value to be assigned
|
|
283
|
+
def seller_enabled=(seller_enabled)
|
|
284
|
+
if seller_enabled.nil?
|
|
285
|
+
fail ArgumentError, 'seller_enabled cannot be nil'
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
@seller_enabled = seller_enabled
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
292
|
+
# @param [Object] provisioning_status Object to be assigned
|
|
293
|
+
def provisioning_status=(provisioning_status)
|
|
294
|
+
validator = EnumAttributeValidator.new('String', ["pending", "ready", "not_applicable"])
|
|
295
|
+
unless validator.valid?(provisioning_status)
|
|
296
|
+
fail ArgumentError, "invalid value for \"provisioning_status\", must be one of #{validator.allowable_values}."
|
|
297
|
+
end
|
|
298
|
+
@provisioning_status = provisioning_status
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
# Checks equality by comparing each attribute.
|
|
302
|
+
# @param [Object] Object to be compared
|
|
303
|
+
def ==(o)
|
|
304
|
+
return true if self.equal?(o)
|
|
305
|
+
self.class == o.class &&
|
|
306
|
+
principal_type == o.principal_type &&
|
|
307
|
+
id == o.id &&
|
|
308
|
+
email == o.email &&
|
|
309
|
+
display_name == o.display_name &&
|
|
310
|
+
status == o.status &&
|
|
311
|
+
buyer_enabled == o.buyer_enabled &&
|
|
312
|
+
seller_enabled == o.seller_enabled &&
|
|
313
|
+
provisioning_status == o.provisioning_status &&
|
|
314
|
+
wallet == o.wallet
|
|
315
|
+
end
|
|
316
|
+
|
|
317
|
+
# @see the `==` method
|
|
318
|
+
# @param [Object] Object to be compared
|
|
319
|
+
def eql?(o)
|
|
320
|
+
self == o
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
# Calculates hash code according to all attributes.
|
|
324
|
+
# @return [Integer] Hash code
|
|
325
|
+
def hash
|
|
326
|
+
[principal_type, id, email, display_name, status, buyer_enabled, seller_enabled, provisioning_status, wallet].hash
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
# Builds the object from hash
|
|
330
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
331
|
+
# @return [Object] Returns the model itself
|
|
332
|
+
def self.build_from_hash(attributes)
|
|
333
|
+
return nil unless attributes.is_a?(Hash)
|
|
334
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
335
|
+
transformed_hash = {}
|
|
336
|
+
openapi_types.each_pair do |key, type|
|
|
337
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
338
|
+
transformed_hash["#{key}"] = nil
|
|
339
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
340
|
+
# check to ensure the input is an array given that the attribute
|
|
341
|
+
# is documented as an array but the input is not
|
|
342
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
343
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
344
|
+
end
|
|
345
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
346
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
347
|
+
end
|
|
348
|
+
end
|
|
349
|
+
new(transformed_hash)
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
# Returns the object in the form of hash
|
|
353
|
+
# @return [Hash] Returns the object in the form of hash
|
|
354
|
+
def to_hash
|
|
355
|
+
hash = {}
|
|
356
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
357
|
+
value = self.send(attr)
|
|
358
|
+
if value.nil?
|
|
359
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
360
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
hash[param] = _to_hash(value)
|
|
364
|
+
end
|
|
365
|
+
hash
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
end
|
|
369
|
+
|
|
370
|
+
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
|
|
@@ -18,9 +18,15 @@ module Weft
|
|
|
18
18
|
# EVM address of the buyer's Privy-managed wallet. Null if no wallet provisioned.
|
|
19
19
|
attr_accessor :address
|
|
20
20
|
|
|
21
|
-
# Live USDC balance,
|
|
21
|
+
# Live Base USDC balance, exact to the micro-dollar (up to 6 decimals, minimum 2). Returns \"0.00\" if the upstream wallet provider is unreachable.
|
|
22
22
|
attr_accessor :balance_usdc
|
|
23
23
|
|
|
24
|
+
# Aggregated USD value of the allowlisted Tempo TIP-20 dollar tokens on the wallet's paired Tempo chain, exact to the micro-dollar. `null` when the value is UNKNOWN — the Tempo RPC read failed, or no dollar token is allowlisted for that chain yet (e.g. Tempo mainnet pre-launch). A null here is never \"0.00\"; it means \"we couldn't determine it\", and `total_usd` then reflects the Base component only.
|
|
25
|
+
attr_accessor :tempo_usd
|
|
26
|
+
|
|
27
|
+
# Single aggregated USD balance = Base USDC + Tempo dollar tokens, exact to the micro-dollar. When `tempo_usd` is null (unavailable/unallowlisted) this equals `balance_usdc` alone. Null when the Base USDC provider is unreachable, because the surface never claims zero for a component it could not read.
|
|
28
|
+
attr_accessor :total_usd
|
|
29
|
+
|
|
24
30
|
# Wallet network (e.g. `base-sepolia`).
|
|
25
31
|
attr_accessor :network
|
|
26
32
|
|
|
@@ -29,6 +35,8 @@ module Weft
|
|
|
29
35
|
{
|
|
30
36
|
:'address' => :'address',
|
|
31
37
|
:'balance_usdc' => :'balance_usdc',
|
|
38
|
+
:'tempo_usd' => :'tempo_usd',
|
|
39
|
+
:'total_usd' => :'total_usd',
|
|
32
40
|
:'network' => :'network'
|
|
33
41
|
}
|
|
34
42
|
end
|
|
@@ -48,6 +56,8 @@ module Weft
|
|
|
48
56
|
{
|
|
49
57
|
:'address' => :'String',
|
|
50
58
|
:'balance_usdc' => :'String',
|
|
59
|
+
:'tempo_usd' => :'String',
|
|
60
|
+
:'total_usd' => :'String',
|
|
51
61
|
:'network' => :'String'
|
|
52
62
|
}
|
|
53
63
|
end
|
|
@@ -86,6 +96,18 @@ module Weft
|
|
|
86
96
|
self.balance_usdc = nil
|
|
87
97
|
end
|
|
88
98
|
|
|
99
|
+
if attributes.key?(:'tempo_usd')
|
|
100
|
+
self.tempo_usd = attributes[:'tempo_usd']
|
|
101
|
+
else
|
|
102
|
+
self.tempo_usd = nil
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
if attributes.key?(:'total_usd')
|
|
106
|
+
self.total_usd = attributes[:'total_usd']
|
|
107
|
+
else
|
|
108
|
+
self.total_usd = nil
|
|
109
|
+
end
|
|
110
|
+
|
|
89
111
|
if attributes.key?(:'network')
|
|
90
112
|
self.network = attributes[:'network']
|
|
91
113
|
else
|
|
@@ -106,6 +128,14 @@ module Weft
|
|
|
106
128
|
invalid_properties.push('invalid value for "balance_usdc", balance_usdc cannot be nil.')
|
|
107
129
|
end
|
|
108
130
|
|
|
131
|
+
if @tempo_usd.nil?
|
|
132
|
+
invalid_properties.push('invalid value for "tempo_usd", tempo_usd cannot be nil.')
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
if @total_usd.nil?
|
|
136
|
+
invalid_properties.push('invalid value for "total_usd", total_usd cannot be nil.')
|
|
137
|
+
end
|
|
138
|
+
|
|
109
139
|
if @network.nil?
|
|
110
140
|
invalid_properties.push('invalid value for "network", network cannot be nil.')
|
|
111
141
|
end
|
|
@@ -119,6 +149,8 @@ module Weft
|
|
|
119
149
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
120
150
|
return false if @address.nil?
|
|
121
151
|
return false if @balance_usdc.nil?
|
|
152
|
+
return false if @tempo_usd.nil?
|
|
153
|
+
return false if @total_usd.nil?
|
|
122
154
|
return false if @network.nil?
|
|
123
155
|
true
|
|
124
156
|
end
|
|
@@ -143,6 +175,26 @@ module Weft
|
|
|
143
175
|
@balance_usdc = balance_usdc
|
|
144
176
|
end
|
|
145
177
|
|
|
178
|
+
# Custom attribute writer method with validation
|
|
179
|
+
# @param [Object] tempo_usd Value to be assigned
|
|
180
|
+
def tempo_usd=(tempo_usd)
|
|
181
|
+
if tempo_usd.nil?
|
|
182
|
+
fail ArgumentError, 'tempo_usd cannot be nil'
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
@tempo_usd = tempo_usd
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Custom attribute writer method with validation
|
|
189
|
+
# @param [Object] total_usd Value to be assigned
|
|
190
|
+
def total_usd=(total_usd)
|
|
191
|
+
if total_usd.nil?
|
|
192
|
+
fail ArgumentError, 'total_usd cannot be nil'
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
@total_usd = total_usd
|
|
196
|
+
end
|
|
197
|
+
|
|
146
198
|
# Custom attribute writer method with validation
|
|
147
199
|
# @param [Object] network Value to be assigned
|
|
148
200
|
def network=(network)
|
|
@@ -160,6 +212,8 @@ module Weft
|
|
|
160
212
|
self.class == o.class &&
|
|
161
213
|
address == o.address &&
|
|
162
214
|
balance_usdc == o.balance_usdc &&
|
|
215
|
+
tempo_usd == o.tempo_usd &&
|
|
216
|
+
total_usd == o.total_usd &&
|
|
163
217
|
network == o.network
|
|
164
218
|
end
|
|
165
219
|
|
|
@@ -172,7 +226,7 @@ module Weft
|
|
|
172
226
|
# Calculates hash code according to all attributes.
|
|
173
227
|
# @return [Integer] Hash code
|
|
174
228
|
def hash
|
|
175
|
-
[address, balance_usdc, network].hash
|
|
229
|
+
[address, balance_usdc, tempo_usd, total_usd, network].hash
|
|
176
230
|
end
|
|
177
231
|
|
|
178
232
|
# 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
|
|
@@ -11,5 +11,5 @@ Generator version: 7.19.0
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
13
13
|
module Weft
|
|
14
|
-
VERSION = '0.
|
|
14
|
+
VERSION = '0.9.0'
|
|
15
15
|
end
|
data/lib/weft/generated.rb
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
require 'set'
|
|
2
|
+
|
|
3
|
+
require_relative 'generated/version'
|
|
4
|
+
require_relative 'generated/api_error'
|
|
5
|
+
require_relative 'generated/api_model_base'
|
|
6
|
+
require_relative 'generated/configuration'
|
|
7
|
+
require_relative 'generated/api_client'
|
|
8
|
+
|
|
9
|
+
Dir[File.join(__dir__, 'generated/models/*.rb')].sort.each { |file| require file }
|
|
10
|
+
Dir[File.join(__dir__, 'generated/api/*.rb')].sort.each { |file| require file }
|