weft-sdk 0.7.0 → 0.9.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 +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
|
@@ -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.1
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.19.0
|
|
@@ -14,38 +14,22 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Weft
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
attr_accessor :name
|
|
17
|
+
class PurchaseArtifact < ApiModelBase
|
|
18
|
+
attr_accessor :id
|
|
20
19
|
|
|
21
|
-
attr_accessor :
|
|
20
|
+
attr_accessor :merchant_url
|
|
22
21
|
|
|
23
|
-
attr_accessor :
|
|
22
|
+
attr_accessor :bytes
|
|
24
23
|
|
|
25
|
-
attr_accessor :
|
|
26
|
-
|
|
27
|
-
attr_accessor :protocol_version
|
|
28
|
-
|
|
29
|
-
attr_accessor :capabilities
|
|
30
|
-
|
|
31
|
-
attr_accessor :default_input_modes
|
|
32
|
-
|
|
33
|
-
attr_accessor :default_output_modes
|
|
34
|
-
|
|
35
|
-
attr_accessor :skills
|
|
24
|
+
attr_accessor :mime
|
|
36
25
|
|
|
37
26
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
38
27
|
def self.attribute_map
|
|
39
28
|
{
|
|
40
|
-
:'
|
|
41
|
-
:'
|
|
42
|
-
:'
|
|
43
|
-
:'
|
|
44
|
-
:'protocol_version' => :'protocolVersion',
|
|
45
|
-
:'capabilities' => :'capabilities',
|
|
46
|
-
:'default_input_modes' => :'defaultInputModes',
|
|
47
|
-
:'default_output_modes' => :'defaultOutputModes',
|
|
48
|
-
:'skills' => :'skills'
|
|
29
|
+
:'id' => :'id',
|
|
30
|
+
:'merchant_url' => :'merchant_url',
|
|
31
|
+
:'bytes' => :'bytes',
|
|
32
|
+
:'mime' => :'mime'
|
|
49
33
|
}
|
|
50
34
|
end
|
|
51
35
|
|
|
@@ -62,21 +46,17 @@ module Weft
|
|
|
62
46
|
# Attribute type mapping.
|
|
63
47
|
def self.openapi_types
|
|
64
48
|
{
|
|
65
|
-
:'
|
|
66
|
-
:'
|
|
67
|
-
:'
|
|
68
|
-
:'
|
|
69
|
-
:'protocol_version' => :'String',
|
|
70
|
-
:'capabilities' => :'Hash<String, Object>',
|
|
71
|
-
:'default_input_modes' => :'Array<String>',
|
|
72
|
-
:'default_output_modes' => :'Array<String>',
|
|
73
|
-
:'skills' => :'Array<SearchSkill>'
|
|
49
|
+
:'id' => :'Integer',
|
|
50
|
+
:'merchant_url' => :'String',
|
|
51
|
+
:'bytes' => :'Integer',
|
|
52
|
+
:'mime' => :'String'
|
|
74
53
|
}
|
|
75
54
|
end
|
|
76
55
|
|
|
77
56
|
# List of attributes with nullable: true
|
|
78
57
|
def self.openapi_nullable
|
|
79
58
|
Set.new([
|
|
59
|
+
:'mime'
|
|
80
60
|
])
|
|
81
61
|
end
|
|
82
62
|
|
|
@@ -84,68 +64,64 @@ module Weft
|
|
|
84
64
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
85
65
|
def initialize(attributes = {})
|
|
86
66
|
if (!attributes.is_a?(Hash))
|
|
87
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Weft::
|
|
67
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Weft::PurchaseArtifact` initialize method"
|
|
88
68
|
end
|
|
89
69
|
|
|
90
70
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
91
71
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
92
72
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
93
73
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
94
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Weft::
|
|
74
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Weft::PurchaseArtifact`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
95
75
|
end
|
|
96
76
|
h[k.to_sym] = v
|
|
97
77
|
}
|
|
98
78
|
|
|
99
|
-
if attributes.key?(:'
|
|
100
|
-
self.
|
|
79
|
+
if attributes.key?(:'id')
|
|
80
|
+
self.id = attributes[:'id']
|
|
81
|
+
else
|
|
82
|
+
self.id = nil
|
|
101
83
|
end
|
|
102
84
|
|
|
103
|
-
if attributes.key?(:'
|
|
104
|
-
self.
|
|
85
|
+
if attributes.key?(:'merchant_url')
|
|
86
|
+
self.merchant_url = attributes[:'merchant_url']
|
|
87
|
+
else
|
|
88
|
+
self.merchant_url = nil
|
|
105
89
|
end
|
|
106
90
|
|
|
107
|
-
if attributes.key?(:'
|
|
108
|
-
self.
|
|
91
|
+
if attributes.key?(:'bytes')
|
|
92
|
+
self.bytes = attributes[:'bytes']
|
|
93
|
+
else
|
|
94
|
+
self.bytes = nil
|
|
109
95
|
end
|
|
110
96
|
|
|
111
|
-
if attributes.key?(:'
|
|
112
|
-
self.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
if attributes.key?(:'protocol_version')
|
|
116
|
-
self.protocol_version = attributes[:'protocol_version']
|
|
97
|
+
if attributes.key?(:'mime')
|
|
98
|
+
self.mime = attributes[:'mime']
|
|
99
|
+
else
|
|
100
|
+
self.mime = nil
|
|
117
101
|
end
|
|
102
|
+
end
|
|
118
103
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
104
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
105
|
+
# @return Array for valid properties with the reasons
|
|
106
|
+
def list_invalid_properties
|
|
107
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
108
|
+
invalid_properties = Array.new
|
|
109
|
+
if @id.nil?
|
|
110
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
123
111
|
end
|
|
124
112
|
|
|
125
|
-
if
|
|
126
|
-
|
|
127
|
-
self.default_input_modes = value
|
|
128
|
-
end
|
|
113
|
+
if @merchant_url.nil?
|
|
114
|
+
invalid_properties.push('invalid value for "merchant_url", merchant_url cannot be nil.')
|
|
129
115
|
end
|
|
130
116
|
|
|
131
|
-
if
|
|
132
|
-
|
|
133
|
-
self.default_output_modes = value
|
|
134
|
-
end
|
|
117
|
+
if @bytes.nil?
|
|
118
|
+
invalid_properties.push('invalid value for "bytes", bytes cannot be nil.')
|
|
135
119
|
end
|
|
136
120
|
|
|
137
|
-
if
|
|
138
|
-
|
|
139
|
-
self.skills = value
|
|
140
|
-
end
|
|
121
|
+
if @bytes < 0
|
|
122
|
+
invalid_properties.push('invalid value for "bytes", must be greater than or equal to 0.')
|
|
141
123
|
end
|
|
142
|
-
end
|
|
143
124
|
|
|
144
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
|
145
|
-
# @return Array for valid properties with the reasons
|
|
146
|
-
def list_invalid_properties
|
|
147
|
-
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
148
|
-
invalid_properties = Array.new
|
|
149
125
|
invalid_properties
|
|
150
126
|
end
|
|
151
127
|
|
|
@@ -153,23 +129,56 @@ module Weft
|
|
|
153
129
|
# @return true if the model is valid
|
|
154
130
|
def valid?
|
|
155
131
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
132
|
+
return false if @id.nil?
|
|
133
|
+
return false if @merchant_url.nil?
|
|
134
|
+
return false if @bytes.nil?
|
|
135
|
+
return false if @bytes < 0
|
|
156
136
|
true
|
|
157
137
|
end
|
|
158
138
|
|
|
139
|
+
# Custom attribute writer method with validation
|
|
140
|
+
# @param [Object] id Value to be assigned
|
|
141
|
+
def id=(id)
|
|
142
|
+
if id.nil?
|
|
143
|
+
fail ArgumentError, 'id cannot be nil'
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
@id = id
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Custom attribute writer method with validation
|
|
150
|
+
# @param [Object] merchant_url Value to be assigned
|
|
151
|
+
def merchant_url=(merchant_url)
|
|
152
|
+
if merchant_url.nil?
|
|
153
|
+
fail ArgumentError, 'merchant_url cannot be nil'
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
@merchant_url = merchant_url
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Custom attribute writer method with validation
|
|
160
|
+
# @param [Object] bytes Value to be assigned
|
|
161
|
+
def bytes=(bytes)
|
|
162
|
+
if bytes.nil?
|
|
163
|
+
fail ArgumentError, 'bytes cannot be nil'
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
if bytes < 0
|
|
167
|
+
fail ArgumentError, 'invalid value for "bytes", must be greater than or equal to 0.'
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
@bytes = bytes
|
|
171
|
+
end
|
|
172
|
+
|
|
159
173
|
# Checks equality by comparing each attribute.
|
|
160
174
|
# @param [Object] Object to be compared
|
|
161
175
|
def ==(o)
|
|
162
176
|
return true if self.equal?(o)
|
|
163
177
|
self.class == o.class &&
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
protocol_version == o.protocol_version &&
|
|
169
|
-
capabilities == o.capabilities &&
|
|
170
|
-
default_input_modes == o.default_input_modes &&
|
|
171
|
-
default_output_modes == o.default_output_modes &&
|
|
172
|
-
skills == o.skills
|
|
178
|
+
id == o.id &&
|
|
179
|
+
merchant_url == o.merchant_url &&
|
|
180
|
+
bytes == o.bytes &&
|
|
181
|
+
mime == o.mime
|
|
173
182
|
end
|
|
174
183
|
|
|
175
184
|
# @see the `==` method
|
|
@@ -181,7 +190,7 @@ module Weft
|
|
|
181
190
|
# Calculates hash code according to all attributes.
|
|
182
191
|
# @return [Integer] Hash code
|
|
183
192
|
def hash
|
|
184
|
-
[
|
|
193
|
+
[id, merchant_url, bytes, mime].hash
|
|
185
194
|
end
|
|
186
195
|
|
|
187
196
|
# Builds the object from hash
|
|
@@ -0,0 +1,192 @@
|
|
|
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.1
|
|
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 PurchaseListResponse < ApiModelBase
|
|
18
|
+
attr_accessor :data
|
|
19
|
+
|
|
20
|
+
attr_accessor :pagination
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'data' => :'data',
|
|
26
|
+
:'pagination' => :'pagination'
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Returns attribute mapping this model knows about
|
|
31
|
+
def self.acceptable_attribute_map
|
|
32
|
+
attribute_map
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Returns all the JSON keys this model knows about
|
|
36
|
+
def self.acceptable_attributes
|
|
37
|
+
acceptable_attribute_map.values
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Attribute type mapping.
|
|
41
|
+
def self.openapi_types
|
|
42
|
+
{
|
|
43
|
+
:'data' => :'Array<Purchase>',
|
|
44
|
+
:'pagination' => :'Pagination'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# List of attributes with nullable: true
|
|
49
|
+
def self.openapi_nullable
|
|
50
|
+
Set.new([
|
|
51
|
+
])
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Initializes the object
|
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
56
|
+
def initialize(attributes = {})
|
|
57
|
+
if (!attributes.is_a?(Hash))
|
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Weft::PurchaseListResponse` initialize method"
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
62
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
63
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
64
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Weft::PurchaseListResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
66
|
+
end
|
|
67
|
+
h[k.to_sym] = v
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if attributes.key?(:'data')
|
|
71
|
+
if (value = attributes[:'data']).is_a?(Array)
|
|
72
|
+
self.data = value
|
|
73
|
+
end
|
|
74
|
+
else
|
|
75
|
+
self.data = nil
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'pagination')
|
|
79
|
+
self.pagination = attributes[:'pagination']
|
|
80
|
+
else
|
|
81
|
+
self.pagination = nil
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
86
|
+
# @return Array for valid properties with the reasons
|
|
87
|
+
def list_invalid_properties
|
|
88
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
89
|
+
invalid_properties = Array.new
|
|
90
|
+
if @data.nil?
|
|
91
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if @pagination.nil?
|
|
95
|
+
invalid_properties.push('invalid value for "pagination", pagination cannot be nil.')
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
invalid_properties
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Check to see if the all the properties in the model are valid
|
|
102
|
+
# @return true if the model is valid
|
|
103
|
+
def valid?
|
|
104
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
105
|
+
return false if @data.nil?
|
|
106
|
+
return false if @pagination.nil?
|
|
107
|
+
true
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Custom attribute writer method with validation
|
|
111
|
+
# @param [Object] data Value to be assigned
|
|
112
|
+
def data=(data)
|
|
113
|
+
if data.nil?
|
|
114
|
+
fail ArgumentError, 'data cannot be nil'
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
@data = data
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Custom attribute writer method with validation
|
|
121
|
+
# @param [Object] pagination Value to be assigned
|
|
122
|
+
def pagination=(pagination)
|
|
123
|
+
if pagination.nil?
|
|
124
|
+
fail ArgumentError, 'pagination cannot be nil'
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
@pagination = pagination
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Checks equality by comparing each attribute.
|
|
131
|
+
# @param [Object] Object to be compared
|
|
132
|
+
def ==(o)
|
|
133
|
+
return true if self.equal?(o)
|
|
134
|
+
self.class == o.class &&
|
|
135
|
+
data == o.data &&
|
|
136
|
+
pagination == o.pagination
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# @see the `==` method
|
|
140
|
+
# @param [Object] Object to be compared
|
|
141
|
+
def eql?(o)
|
|
142
|
+
self == o
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Calculates hash code according to all attributes.
|
|
146
|
+
# @return [Integer] Hash code
|
|
147
|
+
def hash
|
|
148
|
+
[data, pagination].hash
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Builds the object from hash
|
|
152
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
153
|
+
# @return [Object] Returns the model itself
|
|
154
|
+
def self.build_from_hash(attributes)
|
|
155
|
+
return nil unless attributes.is_a?(Hash)
|
|
156
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
157
|
+
transformed_hash = {}
|
|
158
|
+
openapi_types.each_pair do |key, type|
|
|
159
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
160
|
+
transformed_hash["#{key}"] = nil
|
|
161
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
162
|
+
# check to ensure the input is an array given that the attribute
|
|
163
|
+
# is documented as an array but the input is not
|
|
164
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
165
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
166
|
+
end
|
|
167
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
168
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
new(transformed_hash)
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# Returns the object in the form of hash
|
|
175
|
+
# @return [Hash] Returns the object in the form of hash
|
|
176
|
+
def to_hash
|
|
177
|
+
hash = {}
|
|
178
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
179
|
+
value = self.send(attr)
|
|
180
|
+
if value.nil?
|
|
181
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
182
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
hash[param] = _to_hash(value)
|
|
186
|
+
end
|
|
187
|
+
hash
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
end
|
|
@@ -0,0 +1,164 @@
|
|
|
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.1
|
|
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 PurchaseResponse < ApiModelBase
|
|
18
|
+
attr_accessor :data
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'data' => :'data'
|
|
24
|
+
}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Returns attribute mapping this model knows about
|
|
28
|
+
def self.acceptable_attribute_map
|
|
29
|
+
attribute_map
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns all the JSON keys this model knows about
|
|
33
|
+
def self.acceptable_attributes
|
|
34
|
+
acceptable_attribute_map.values
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Attribute type mapping.
|
|
38
|
+
def self.openapi_types
|
|
39
|
+
{
|
|
40
|
+
:'data' => :'Purchase'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# List of attributes with nullable: true
|
|
45
|
+
def self.openapi_nullable
|
|
46
|
+
Set.new([
|
|
47
|
+
])
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Initializes the object
|
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
52
|
+
def initialize(attributes = {})
|
|
53
|
+
if (!attributes.is_a?(Hash))
|
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Weft::PurchaseResponse` initialize method"
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
58
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
60
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Weft::PurchaseResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
62
|
+
end
|
|
63
|
+
h[k.to_sym] = v
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if attributes.key?(:'data')
|
|
67
|
+
self.data = attributes[:'data']
|
|
68
|
+
else
|
|
69
|
+
self.data = nil
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
74
|
+
# @return Array for valid properties with the reasons
|
|
75
|
+
def list_invalid_properties
|
|
76
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
77
|
+
invalid_properties = Array.new
|
|
78
|
+
if @data.nil?
|
|
79
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
invalid_properties
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Check to see if the all the properties in the model are valid
|
|
86
|
+
# @return true if the model is valid
|
|
87
|
+
def valid?
|
|
88
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
89
|
+
return false if @data.nil?
|
|
90
|
+
true
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Custom attribute writer method with validation
|
|
94
|
+
# @param [Object] data Value to be assigned
|
|
95
|
+
def data=(data)
|
|
96
|
+
if data.nil?
|
|
97
|
+
fail ArgumentError, 'data cannot be nil'
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
@data = data
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Checks equality by comparing each attribute.
|
|
104
|
+
# @param [Object] Object to be compared
|
|
105
|
+
def ==(o)
|
|
106
|
+
return true if self.equal?(o)
|
|
107
|
+
self.class == o.class &&
|
|
108
|
+
data == o.data
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# @see the `==` method
|
|
112
|
+
# @param [Object] Object to be compared
|
|
113
|
+
def eql?(o)
|
|
114
|
+
self == o
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Calculates hash code according to all attributes.
|
|
118
|
+
# @return [Integer] Hash code
|
|
119
|
+
def hash
|
|
120
|
+
[data].hash
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Builds the object from hash
|
|
124
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
125
|
+
# @return [Object] Returns the model itself
|
|
126
|
+
def self.build_from_hash(attributes)
|
|
127
|
+
return nil unless attributes.is_a?(Hash)
|
|
128
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
129
|
+
transformed_hash = {}
|
|
130
|
+
openapi_types.each_pair do |key, type|
|
|
131
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
132
|
+
transformed_hash["#{key}"] = nil
|
|
133
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
134
|
+
# check to ensure the input is an array given that the attribute
|
|
135
|
+
# is documented as an array but the input is not
|
|
136
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
137
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
138
|
+
end
|
|
139
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
140
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
new(transformed_hash)
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Returns the object in the form of hash
|
|
147
|
+
# @return [Hash] Returns the object in the form of hash
|
|
148
|
+
def to_hash
|
|
149
|
+
hash = {}
|
|
150
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
151
|
+
value = self.send(attr)
|
|
152
|
+
if value.nil?
|
|
153
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
154
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
hash[param] = _to_hash(value)
|
|
158
|
+
end
|
|
159
|
+
hash
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
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.1
|
|
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.1
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.19.0
|
|
@@ -14,9 +14,9 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Weft
|
|
17
|
-
# `slug` and `category` are accepted but silently ignored — the server generates the slug from `name`, and category is a post-claim concern.
|
|
17
|
+
# `slug` and `category` are accepted but silently ignored — the server generates the slug from `name`, and category is a post-claim concern.
|
|
18
18
|
class ResourceEnrollmentRequest < ApiModelBase
|
|
19
|
-
# Resource kind. Must be one of the supported kinds (currently `agent`); an unknown value is rejected with a 422.
|
|
19
|
+
# Resource kind. Must be one of the supported kinds (currently `agent`); an unknown value is rejected with a 422.
|
|
20
20
|
attr_accessor :kind
|
|
21
21
|
|
|
22
22
|
# Human-readable name; the server derives the slug from it.
|
|
@@ -24,7 +24,7 @@ module Weft
|
|
|
24
24
|
|
|
25
25
|
attr_accessor :description
|
|
26
26
|
|
|
27
|
-
# Declared EVM wallet address for the ghost resource. Stored as a claim (unverified) until the resource is claimed.
|
|
27
|
+
# Declared EVM wallet address for the ghost resource. Stored as a claim (unverified) until the resource is claimed.
|
|
28
28
|
attr_accessor :wallet_address
|
|
29
29
|
|
|
30
30
|
# Attribute mapping from ruby-style variable name to JSON key.
|