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.
Files changed (170) hide show
  1. checksums.yaml +4 -4
  2. data/docs/APIKeysApi.md +1 -2
  3. data/docs/AccountApi.md +6 -5
  4. data/docs/AccountDetails.md +2 -1
  5. data/docs/ApiKey.md +0 -1
  6. data/docs/ApiKeyCreated.md +0 -1
  7. data/docs/ApiKeyCreatedResponse.md +0 -1
  8. data/docs/ApiKeyListResponse.md +0 -1
  9. data/docs/AuthApi.md +6 -7
  10. data/docs/AuthResponse.md +0 -1
  11. data/docs/AuthResponseData.md +0 -1
  12. data/docs/BalanceApi.md +1 -2
  13. data/docs/BalanceResponse.md +3 -4
  14. data/docs/ConfirmRequest.md +0 -1
  15. data/docs/CreateApiKeyRequest.md +0 -1
  16. data/docs/DefaultApi.md +0 -1
  17. data/docs/EnrolledResource.md +0 -1
  18. data/docs/Error.md +0 -1
  19. data/docs/ErrorResponse.md +0 -1
  20. data/docs/Fetch403Response.md +0 -1
  21. data/docs/FetchApi.md +10 -7
  22. data/docs/FetchBalanceSnapshot.md +2 -3
  23. data/docs/FetchErrorResponse.md +0 -1
  24. data/docs/FetchRequest.md +0 -1
  25. data/docs/FetchRequestBody.md +0 -1
  26. data/docs/FetchResponse.md +5 -2
  27. data/docs/InsufficientScopeResponse.md +0 -1
  28. data/docs/MeApiKey.md +0 -1
  29. data/docs/MeApiKeyCreator.md +0 -1
  30. data/docs/MeResponse.md +1 -2
  31. data/docs/MeResponseData.md +78 -0
  32. data/docs/Merchant.md +0 -1
  33. data/docs/MessageResponse.md +0 -1
  34. data/docs/MessageResponseData.md +0 -1
  35. data/docs/Pagination.md +0 -1
  36. data/docs/PasswordResetRequest.md +0 -1
  37. data/docs/PasswordUpdateRequest.md +0 -1
  38. data/docs/Payment.md +0 -3
  39. data/docs/PaymentListResponse.md +0 -1
  40. data/docs/PaymentResponse.md +0 -1
  41. data/docs/PaymentsApi.md +0 -1
  42. data/docs/PrincipalWallet.md +19 -0
  43. data/docs/PromoBalance.md +0 -1
  44. data/docs/Purchase.md +43 -0
  45. data/docs/PurchaseArtifact.md +23 -0
  46. data/docs/PurchaseListResponse.md +19 -0
  47. data/docs/PurchaseResponse.md +17 -0
  48. data/docs/PurchasesApi.md +148 -0
  49. data/docs/ResendConfirmationRequest.md +0 -1
  50. data/docs/ResourceEnrollmentRequest.md +0 -1
  51. data/docs/ResourceEnrollmentResponse.md +0 -1
  52. data/docs/ResourceStats.md +0 -1
  53. data/docs/ResourcesApi.md +2 -3
  54. data/docs/SearchApi.md +2 -3
  55. data/docs/SearchCapabilityRef.md +19 -0
  56. data/docs/SearchEndpointCall.md +23 -0
  57. data/docs/SearchEndpointHit.md +41 -0
  58. data/docs/SearchEndpointPrice.md +25 -0
  59. data/docs/SearchErrorResponse.md +0 -1
  60. data/docs/SearchFilterSpec.md +23 -0
  61. data/docs/SearchPaymentOffer.md +31 -0
  62. data/docs/SearchPriceAtomicFilter.md +25 -0
  63. data/docs/SearchPriceUsdFilter.md +25 -0
  64. data/docs/SearchProtocolFilter.md +19 -0
  65. data/docs/SearchProviderRef.md +21 -0
  66. data/docs/SearchRequest.md +3 -4
  67. data/docs/SearchResourceTypeFilter.md +19 -0
  68. data/docs/SearchResponse.md +35 -8
  69. data/docs/SearchResponseWarningsInner.md +23 -0
  70. data/docs/SearchResult.md +8 -21
  71. data/docs/SignInRequest.md +0 -1
  72. data/docs/SignUpRequest.md +0 -1
  73. data/docs/SpendingPolicy.md +0 -1
  74. data/docs/User.md +0 -1
  75. data/docs/UserPrincipal.md +33 -0
  76. data/docs/Wallet.md +3 -4
  77. data/lib/weft/generated/api/account_api.rb +6 -4
  78. data/lib/weft/generated/api/api_keys_api.rb +4 -4
  79. data/lib/weft/generated/api/auth_api.rb +14 -14
  80. data/lib/weft/generated/api/balance_api.rb +4 -4
  81. data/lib/weft/generated/api/default_api.rb +2 -2
  82. data/lib/weft/generated/api/fetch_api.rb +22 -6
  83. data/lib/weft/generated/api/payments_api.rb +2 -2
  84. data/lib/weft/generated/api/purchases_api.rb +150 -0
  85. data/lib/weft/generated/api/resources_api.rb +6 -6
  86. data/lib/weft/generated/api/search_api.rb +6 -6
  87. data/lib/weft/generated/api_client.rb +2 -2
  88. data/lib/weft/generated/api_error.rb +2 -2
  89. data/lib/weft/generated/api_model_base.rb +2 -2
  90. data/lib/weft/generated/configuration.rb +2 -2
  91. data/lib/weft/generated/models/account_details.rb +54 -4
  92. data/lib/weft/generated/models/api_key.rb +2 -2
  93. data/lib/weft/generated/models/api_key_created.rb +2 -2
  94. data/lib/weft/generated/models/api_key_created_response.rb +2 -2
  95. data/lib/weft/generated/models/api_key_list_response.rb +2 -2
  96. data/lib/weft/generated/models/auth_response.rb +2 -2
  97. data/lib/weft/generated/models/auth_response_data.rb +2 -2
  98. data/lib/weft/generated/models/balance_response.rb +5 -5
  99. data/lib/weft/generated/models/confirm_request.rb +2 -2
  100. data/lib/weft/generated/models/create_api_key_request.rb +2 -2
  101. data/lib/weft/generated/models/enrolled_resource.rb +4 -4
  102. data/lib/weft/generated/models/error.rb +3 -3
  103. data/lib/weft/generated/models/error_response.rb +3 -3
  104. data/lib/weft/generated/models/fetch403_response.rb +2 -2
  105. data/lib/weft/generated/models/fetch_balance_snapshot.rb +5 -5
  106. data/lib/weft/generated/models/fetch_error_response.rb +5 -5
  107. data/lib/weft/generated/models/fetch_request.rb +5 -5
  108. data/lib/weft/generated/models/fetch_request_body.rb +2 -2
  109. data/lib/weft/generated/models/fetch_response.rb +83 -5
  110. data/lib/weft/generated/models/insufficient_scope_response.rb +3 -3
  111. data/lib/weft/generated/models/me_api_key.rb +2 -2
  112. data/lib/weft/generated/models/me_api_key_creator.rb +3 -3
  113. data/lib/weft/generated/models/me_response.rb +3 -3
  114. data/lib/weft/generated/models/me_response_data.rb +55 -0
  115. data/lib/weft/generated/models/merchant.rb +2 -2
  116. data/lib/weft/generated/models/message_response.rb +2 -2
  117. data/lib/weft/generated/models/message_response_data.rb +2 -2
  118. data/lib/weft/generated/models/pagination.rb +2 -2
  119. data/lib/weft/generated/models/password_reset_request.rb +2 -2
  120. data/lib/weft/generated/models/password_update_request.rb +2 -2
  121. data/lib/weft/generated/models/payment.rb +3 -12
  122. data/lib/weft/generated/models/payment_list_response.rb +2 -2
  123. data/lib/weft/generated/models/payment_response.rb +2 -2
  124. data/lib/weft/generated/models/principal_wallet.rb +190 -0
  125. data/lib/weft/generated/models/promo_balance.rb +3 -3
  126. data/lib/weft/generated/models/purchase.rb +427 -0
  127. data/lib/weft/generated/models/{search_agent_card.rb → purchase_artifact.rb} +91 -82
  128. data/lib/weft/generated/models/purchase_list_response.rb +192 -0
  129. data/lib/weft/generated/models/purchase_response.rb +164 -0
  130. data/lib/weft/generated/models/resend_confirmation_request.rb +2 -2
  131. data/lib/weft/generated/models/resource_enrollment_request.rb +5 -5
  132. data/lib/weft/generated/models/resource_enrollment_response.rb +2 -2
  133. data/lib/weft/generated/models/resource_stats.rb +2 -2
  134. data/lib/weft/generated/models/{search_skill_endpoint.rb → search_capability_ref.rb} +18 -19
  135. data/lib/weft/generated/models/search_endpoint_call.rb +179 -0
  136. data/lib/weft/generated/models/search_endpoint_hit.rb +296 -0
  137. data/lib/weft/generated/models/{search_skill.rb → search_endpoint_price.rb} +76 -112
  138. data/lib/weft/generated/models/search_error_response.rb +5 -5
  139. data/lib/weft/generated/models/search_filter_spec.rb +175 -0
  140. data/lib/weft/generated/models/{search_pricing.rb → search_payment_offer.rb} +64 -67
  141. data/lib/weft/generated/models/search_price_atomic_filter.rb +284 -0
  142. data/lib/weft/generated/models/search_price_usd_filter.rb +294 -0
  143. data/lib/weft/generated/models/search_protocol_filter.rb +200 -0
  144. data/lib/weft/generated/models/{search_endpoints.rb → search_provider_ref.rb} +26 -36
  145. data/lib/weft/generated/models/search_request.rb +36 -27
  146. data/lib/weft/generated/models/search_resource_type_filter.rb +200 -0
  147. data/lib/weft/generated/models/search_response.rb +367 -31
  148. data/lib/weft/generated/models/search_response_warnings_inner.rb +210 -0
  149. data/lib/weft/generated/models/search_result.rb +68 -220
  150. data/lib/weft/generated/models/sign_in_request.rb +2 -2
  151. data/lib/weft/generated/models/sign_up_request.rb +2 -2
  152. data/lib/weft/generated/models/spending_policy.rb +2 -2
  153. data/lib/weft/generated/models/user.rb +2 -2
  154. data/lib/weft/generated/models/user_principal.rb +370 -0
  155. data/lib/weft/generated/models/wallet.rb +5 -5
  156. data/lib/weft/generated/version.rb +3 -3
  157. data/lib/weft/generated.rb +10 -4
  158. data/lib/weft/sdk.rb +1 -1
  159. metadata +57 -19
  160. data/docs/SearchAgentCard.md +0 -34
  161. data/docs/SearchEndpoints.md +0 -24
  162. data/docs/SearchFilters.md +0 -26
  163. data/docs/SearchPricing.md +0 -24
  164. data/docs/SearchRanking.md +0 -26
  165. data/docs/SearchResponseResultsInner.md +0 -36
  166. data/docs/SearchSkill.md +0 -36
  167. data/docs/SearchSkillEndpoint.md +0 -20
  168. data/lib/weft/generated/models/search_filters.rb +0 -277
  169. data/lib/weft/generated/models/search_ranking.rb +0 -277
  170. data/lib/weft/generated/models/search_response_results_inner.rb +0 -103
@@ -0,0 +1,23 @@
1
+ # Weft::SearchResponseWarningsInner
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **code** | **String** | | |
8
+ | **message** | **String** | | |
9
+ | **cause** | **String** | Typed cause for codes that carry one. Null otherwise. | [optional] |
10
+ | **context** | **Object** | Structured context for the warning. Null when the code carries none. | [optional] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'weft-sdk'
16
+
17
+ instance = Weft::SearchResponseWarningsInner.new(
18
+ code: null,
19
+ message: null,
20
+ cause: null,
21
+ context: null
22
+ )
23
+ ```
data/docs/SearchResult.md CHANGED
@@ -4,16 +4,10 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
- | **id** | **String** | Stable agent identifier (e.g. `weft:agent:agentmail`). | |
8
- | **score** | **Float** | Cosine similarity score, clipped to [0, 1]. | |
9
- | **protocol** | **String** | Agent protocol surface. | |
10
- | **domain** | **Array<String>** | Domain tags declared by the agent. | |
11
- | **reseller** | **String** | Reseller slug if this agent is fronted by an aggregator (e.g. `locus`). | [optional] |
12
- | **upstream** | **String** | Upstream provider hostname when fronted by a reseller. | [optional] |
13
- | **agent_card** | [**SearchAgentCard**](SearchAgentCard.md) | | |
14
- | **pricing** | [**SearchPricing**](SearchPricing.md) | | |
15
- | **ranking** | [**SearchRanking**](SearchRanking.md) | | |
16
- | **endpoints** | [**SearchEndpoints**](SearchEndpoints.md) | | |
7
+ | **provider** | [**SearchProviderRef**](SearchProviderRef.md) | | |
8
+ | **capability** | [**SearchCapabilityRef**](SearchCapabilityRef.md) | | |
9
+ | **endpoints** | [**Array<SearchEndpointHit>**](SearchEndpointHit.md) | | |
10
+ | **score** | **Float** | | |
17
11
 
18
12
  ## Example
19
13
 
@@ -21,16 +15,9 @@
21
15
  require 'weft-sdk'
22
16
 
23
17
  instance = Weft::SearchResult.new(
24
- id: null,
25
- score: null,
26
- protocol: null,
27
- domain: null,
28
- reseller: null,
29
- upstream: null,
30
- agent_card: null,
31
- pricing: null,
32
- ranking: null,
33
- endpoints: null
18
+ provider: null,
19
+ capability: null,
20
+ endpoints: null,
21
+ score: null
34
22
  )
35
23
  ```
36
-
@@ -17,4 +17,3 @@ instance = Weft::SignInRequest.new(
17
17
  password: null
18
18
  )
19
19
  ```
20
-
@@ -19,4 +19,3 @@ instance = Weft::SignUpRequest.new(
19
19
  password_confirmation: null
20
20
  )
21
21
  ```
22
-
@@ -19,4 +19,3 @@ instance = Weft::SpendingPolicy.new(
19
19
  weekly_limit_usd: 50.00
20
20
  )
21
21
  ```
22
-
data/docs/User.md CHANGED
@@ -19,4 +19,3 @@ instance = Weft::User.new(
19
19
  status: null
20
20
  )
21
21
  ```
22
-
@@ -0,0 +1,33 @@
1
+ # Weft::UserPrincipal
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **principal_type** | **String** | | |
8
+ | **id** | **Integer** | | |
9
+ | **email** | **String** | | |
10
+ | **display_name** | **String** | | [optional] |
11
+ | **status** | **String** | | |
12
+ | **buyer_enabled** | **Boolean** | | |
13
+ | **seller_enabled** | **Boolean** | | |
14
+ | **provisioning_status** | **String** | | |
15
+ | **wallet** | [**PrincipalWallet**](PrincipalWallet.md) | | |
16
+
17
+ ## Example
18
+
19
+ ```ruby
20
+ require 'weft-sdk'
21
+
22
+ instance = Weft::UserPrincipal.new(
23
+ principal_type: null,
24
+ id: null,
25
+ email: null,
26
+ display_name: null,
27
+ status: null,
28
+ buyer_enabled: null,
29
+ seller_enabled: null,
30
+ provisioning_status: null,
31
+ wallet: null
32
+ )
33
+ ```
data/docs/Wallet.md CHANGED
@@ -5,9 +5,9 @@
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **address** | **String** | EVM address of the buyer's Privy-managed wallet. Null if no wallet provisioned. | |
8
- | **balance_usdc** | **String** | Live Base USDC balance, 2dp. Returns \"0.00\" if the upstream wallet provider is unreachable. | |
9
- | **tempo_usd** | **String** | Aggregated USD value of the allowlisted Tempo TIP-20 dollar tokens on the wallet's paired Tempo chain, 2dp. `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. | |
10
- | **total_usd** | **String** | Single aggregated USD balance = Base USDC + Tempo dollar tokens, 2dp. 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. | |
8
+ | **balance_usdc** | **String** | 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. | |
9
+ | **tempo_usd** | **String** | 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. | |
10
+ | **total_usd** | **String** | 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. | |
11
11
  | **network** | **String** | Wallet network (e.g. `base-sepolia`). | |
12
12
 
13
13
  ## Example
@@ -23,4 +23,3 @@ instance = Weft::Wallet.new(
23
23
  network: null
24
24
  )
25
25
  ```
26
-
@@ -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/payments`) 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`.
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.7.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
@@ -19,7 +19,8 @@ module Weft
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
- # Get current account
22
+ # Get the current credential principal
23
+ # Returns the Organization represented by a resource API key, or the User represented by an account API key or OAuth access token. Branch on `data.principal_type`; existing Organization fields remain unchanged.
23
24
  # @param [Hash] opts the optional parameters
24
25
  # @return [MeResponse]
25
26
  def get_me(opts = {})
@@ -27,7 +28,8 @@ module Weft
27
28
  data
28
29
  end
29
30
 
30
- # Get current account
31
+ # Get the current credential principal
32
+ # Returns the Organization represented by a resource API key, or the User represented by an account API key or OAuth access token. Branch on `data.principal_type`; existing Organization fields remain unchanged.
31
33
  # @param [Hash] opts the optional parameters
32
34
  # @return [Array<(MeResponse, Integer, Hash)>] MeResponse data, response status code and response headers
33
35
  def get_me_with_http_info(opts = {})
@@ -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/payments`) 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`.
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.7.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
@@ -20,7 +20,7 @@ module Weft
20
20
  @api_client = api_client
21
21
  end
22
22
  # Create an API key
23
- # @param create_api_key_request [CreateApiKeyRequest]
23
+ # @param create_api_key_request [CreateApiKeyRequest]
24
24
  # @param [Hash] opts the optional parameters
25
25
  # @return [ApiKeyCreatedResponse]
26
26
  def create_api_key(create_api_key_request, opts = {})
@@ -29,7 +29,7 @@ module Weft
29
29
  end
30
30
 
31
31
  # Create an API key
32
- # @param create_api_key_request [CreateApiKeyRequest]
32
+ # @param create_api_key_request [CreateApiKeyRequest]
33
33
  # @param [Hash] opts the optional parameters
34
34
  # @return [Array<(ApiKeyCreatedResponse, Integer, Hash)>] ApiKeyCreatedResponse data, response status code and response headers
35
35
  def create_api_key_with_http_info(create_api_key_request, opts = {})
@@ -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/payments`) 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`.
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.7.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
@@ -20,7 +20,7 @@ module Weft
20
20
  @api_client = api_client
21
21
  end
22
22
  # Confirm an account
23
- # @param confirm_request [ConfirmRequest]
23
+ # @param confirm_request [ConfirmRequest]
24
24
  # @param [Hash] opts the optional parameters
25
25
  # @return [AuthResponse]
26
26
  def confirm_account(confirm_request, opts = {})
@@ -29,7 +29,7 @@ module Weft
29
29
  end
30
30
 
31
31
  # Confirm an account
32
- # @param confirm_request [ConfirmRequest]
32
+ # @param confirm_request [ConfirmRequest]
33
33
  # @param [Hash] opts the optional parameters
34
34
  # @return [Array<(AuthResponse, Integer, Hash)>] AuthResponse data, response status code and response headers
35
35
  def confirm_account_with_http_info(confirm_request, opts = {})
@@ -86,7 +86,7 @@ module Weft
86
86
  end
87
87
 
88
88
  # Request password reset
89
- # @param password_reset_request [PasswordResetRequest]
89
+ # @param password_reset_request [PasswordResetRequest]
90
90
  # @param [Hash] opts the optional parameters
91
91
  # @return [MessageResponse]
92
92
  def request_password_reset(password_reset_request, opts = {})
@@ -95,7 +95,7 @@ module Weft
95
95
  end
96
96
 
97
97
  # Request password reset
98
- # @param password_reset_request [PasswordResetRequest]
98
+ # @param password_reset_request [PasswordResetRequest]
99
99
  # @param [Hash] opts the optional parameters
100
100
  # @return [Array<(MessageResponse, Integer, Hash)>] MessageResponse data, response status code and response headers
101
101
  def request_password_reset_with_http_info(password_reset_request, opts = {})
@@ -152,7 +152,7 @@ module Weft
152
152
  end
153
153
 
154
154
  # Resend confirmation email
155
- # @param resend_confirmation_request [ResendConfirmationRequest]
155
+ # @param resend_confirmation_request [ResendConfirmationRequest]
156
156
  # @param [Hash] opts the optional parameters
157
157
  # @return [MessageResponse]
158
158
  def resend_confirmation(resend_confirmation_request, opts = {})
@@ -161,7 +161,7 @@ module Weft
161
161
  end
162
162
 
163
163
  # Resend confirmation email
164
- # @param resend_confirmation_request [ResendConfirmationRequest]
164
+ # @param resend_confirmation_request [ResendConfirmationRequest]
165
165
  # @param [Hash] opts the optional parameters
166
166
  # @return [Array<(MessageResponse, Integer, Hash)>] MessageResponse data, response status code and response headers
167
167
  def resend_confirmation_with_http_info(resend_confirmation_request, opts = {})
@@ -218,7 +218,7 @@ module Weft
218
218
  end
219
219
 
220
220
  # Sign in with email and password
221
- # @param sign_in_request [SignInRequest]
221
+ # @param sign_in_request [SignInRequest]
222
222
  # @param [Hash] opts the optional parameters
223
223
  # @return [AuthResponse]
224
224
  def sign_in(sign_in_request, opts = {})
@@ -227,7 +227,7 @@ module Weft
227
227
  end
228
228
 
229
229
  # Sign in with email and password
230
- # @param sign_in_request [SignInRequest]
230
+ # @param sign_in_request [SignInRequest]
231
231
  # @param [Hash] opts the optional parameters
232
232
  # @return [Array<(AuthResponse, Integer, Hash)>] AuthResponse data, response status code and response headers
233
233
  def sign_in_with_http_info(sign_in_request, opts = {})
@@ -284,7 +284,7 @@ module Weft
284
284
  end
285
285
 
286
286
  # Create an account
287
- # @param sign_up_request [SignUpRequest]
287
+ # @param sign_up_request [SignUpRequest]
288
288
  # @param [Hash] opts the optional parameters
289
289
  # @return [AuthResponse]
290
290
  def sign_up(sign_up_request, opts = {})
@@ -293,7 +293,7 @@ module Weft
293
293
  end
294
294
 
295
295
  # Create an account
296
- # @param sign_up_request [SignUpRequest]
296
+ # @param sign_up_request [SignUpRequest]
297
297
  # @param [Hash] opts the optional parameters
298
298
  # @return [Array<(AuthResponse, Integer, Hash)>] AuthResponse data, response status code and response headers
299
299
  def sign_up_with_http_info(sign_up_request, opts = {})
@@ -350,7 +350,7 @@ module Weft
350
350
  end
351
351
 
352
352
  # Update password with reset token
353
- # @param password_update_request [PasswordUpdateRequest]
353
+ # @param password_update_request [PasswordUpdateRequest]
354
354
  # @param [Hash] opts the optional parameters
355
355
  # @return [MessageResponse]
356
356
  def update_password(password_update_request, opts = {})
@@ -359,7 +359,7 @@ module Weft
359
359
  end
360
360
 
361
361
  # Update password with reset token
362
- # @param password_update_request [PasswordUpdateRequest]
362
+ # @param password_update_request [PasswordUpdateRequest]
363
363
  # @param [Hash] opts the optional parameters
364
364
  # @return [Array<(MessageResponse, Integer, Hash)>] MessageResponse data, response status code and response headers
365
365
  def update_password_with_http_info(password_update_request, opts = {})
@@ -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/payments`) 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`.
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.7.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
@@ -20,7 +20,7 @@ module Weft
20
20
  @api_client = api_client
21
21
  end
22
22
  # Get wallet, spending policy, and current-window spend
23
- # Read-only snapshot for the buyer behind the bearer token. The response always includes a `promo` block — values are zero in v1 and fill in once the freemium promo ledger ships, without a shape change. `wallet.balance_usdc` is fetched live from Privy; if Privy is unreachable the field returns `\"0.00\"` rather than erroring the whole call. Account-scoped: the bearer must be a buyer-scoped API key.
23
+ # Read-only snapshot for the buyer behind the bearer token. The response always includes a `promo` block — values are zero in v1 and fill in once the freemium promo ledger ships, without a shape change. `wallet.balance_usdc` is fetched live from Privy; if Privy is unreachable the field returns `\"0.00\"` rather than erroring the whole call. Account-scoped: the bearer must be a buyer-scoped API key.
24
24
  # @param [Hash] opts the optional parameters
25
25
  # @return [BalanceResponse]
26
26
  def get_balance(opts = {})
@@ -29,7 +29,7 @@ module Weft
29
29
  end
30
30
 
31
31
  # Get wallet, spending policy, and current-window spend
32
- # Read-only snapshot for the buyer behind the bearer token. The response always includes a &#x60;promo&#x60; block — values are zero in v1 and fill in once the freemium promo ledger ships, without a shape change. &#x60;wallet.balance_usdc&#x60; is fetched live from Privy; if Privy is unreachable the field returns &#x60;\&quot;0.00\&quot;&#x60; rather than erroring the whole call. Account-scoped: the bearer must be a buyer-scoped API key.
32
+ # Read-only snapshot for the buyer behind the bearer token. The response always includes a &#x60;promo&#x60; block — values are zero in v1 and fill in once the freemium promo ledger ships, without a shape change. &#x60;wallet.balance_usdc&#x60; is fetched live from Privy; if Privy is unreachable the field returns &#x60;\&quot;0.00\&quot;&#x60; rather than erroring the whole call. Account-scoped: the bearer must be a buyer-scoped API key.
33
33
  # @param [Hash] opts the optional parameters
34
34
  # @return [Array<(BalanceResponse, Integer, Hash)>] BalanceResponse data, response status code and response headers
35
35
  def get_balance_with_http_info(opts = {})
@@ -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/payments`) 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`.
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.7.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/payments`) 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`.
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.7.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
@@ -20,9 +20,10 @@ module Weft
20
20
  @api_client = api_client
21
21
  end
22
22
  # Pay-and-fetch any URL (x402 proxy)
23
- # Universal x402 fetch proxy. The caller provides a target `url`, a hard `max_cost_usd` ceiling, and optional `method` / `body` / `headers`. Weft: 1. Issues the request. 2. On `402 Payment Required`, parses the merchant's challenge. 3. Compares the asking price to `max_cost_usd` and the buyer's policy (`max_tx_usd`, daily/weekly limits). 4. Signs an EIP-3009 transfer from the buyer's wallet. 5. Replays the request with the `X-Payment` header. 6. Streams the upstream artifact back, base64-encoded under `body_base64`, with `paid_usd`, `tx_hash`, and the merchant's reputation snapshot. Errors are structured with a stable `error` code, and each error response carries the buyer's `policy`, `balance`, and a `dashboard_url` so a CLI can render an actionable message without a second round-trip. Account-scoped: the bearer must be a buyer-scoped API key. **Forwarded headers:** the caller's `headers` are passed through to the upstream, except a denylist of hop-by-hop and Weft-internal headers (`host`, `authorization`, `cookie`, `proxy-authorization`, `x-forwarded-*`, `x-real-ip`, `x-payment`, `connection`, `upgrade`). Up to 32 headers, 4 KB of combined value bytes.
24
- # @param fetch_request [FetchRequest]
23
+ # Universal x402 fetch proxy. The caller provides a target `url`, a hard `max_cost_usd` ceiling, and optional `method` / `body` / `headers`. Weft: 1. Issues the request. 2. On `402 Payment Required`, parses the merchant's challenge. 3. Compares the asking price to `max_cost_usd` and the buyer's policy (`max_tx_usd`, daily/weekly limits). 4. Signs an EIP-3009 transfer from the buyer's wallet. 5. Replays the request with the `X-Payment` header. 6. Streams the upstream artifact back, base64-encoded under `body_base64`, with `paid_usd`, `held_usd`, `payment_status`, `tx_hash`, and the merchant's reputation snapshot. `paid_usd` is \"0.00\" until the charge is CONFIRMED settled — a signed-but- unsettled hold (the common case for x402, which settles asynchronously) reports its amount in `held_usd` instead, never in `paid_usd`. Errors are structured with a stable `error` code, and each error response carries the buyer's `policy`, `balance`, and a `dashboard_url` so a CLI can render an actionable message without a second round-trip. Account-scoped: the bearer must be a buyer-scoped API key. **Forwarded headers:** the caller's `headers` are passed through to the upstream, except a denylist of hop-by-hop and Weft-internal headers (`host`, `authorization`, `cookie`, `proxy-authorization`, `x-forwarded-*`, `x-real-ip`, `x-payment`, `connection`, `upgrade`). Up to 32 headers, 4 KB of combined value bytes.
24
+ # @param fetch_request [FetchRequest]
25
25
  # @param [Hash] opts the optional parameters
26
+ # @option opts [String] :idempotency_key Opaque caller-generated retry key. Reusing the same key for the same buyer converges on one paid fetch; keys are hashed and namespaced by buyer before storage. Send this header for every unattended or retryable paid request.
26
27
  # @return [FetchResponse]
27
28
  def fetch(fetch_request, opts = {})
28
29
  data, _status_code, _headers = fetch_with_http_info(fetch_request, opts)
@@ -30,9 +31,10 @@ module Weft
30
31
  end
31
32
 
32
33
  # Pay-and-fetch any URL (x402 proxy)
33
- # Universal x402 fetch proxy. The caller provides a target &#x60;url&#x60;, a hard &#x60;max_cost_usd&#x60; ceiling, and optional &#x60;method&#x60; / &#x60;body&#x60; / &#x60;headers&#x60;. Weft: 1. Issues the request. 2. On &#x60;402 Payment Required&#x60;, parses the merchant&#39;s challenge. 3. Compares the asking price to &#x60;max_cost_usd&#x60; and the buyer&#39;s policy (&#x60;max_tx_usd&#x60;, daily/weekly limits). 4. Signs an EIP-3009 transfer from the buyer&#39;s wallet. 5. Replays the request with the &#x60;X-Payment&#x60; header. 6. Streams the upstream artifact back, base64-encoded under &#x60;body_base64&#x60;, with &#x60;paid_usd&#x60;, &#x60;tx_hash&#x60;, and the merchant&#39;s reputation snapshot. Errors are structured with a stable &#x60;error&#x60; code, and each error response carries the buyer&#39;s &#x60;policy&#x60;, &#x60;balance&#x60;, and a &#x60;dashboard_url&#x60; so a CLI can render an actionable message without a second round-trip. Account-scoped: the bearer must be a buyer-scoped API key. **Forwarded headers:** the caller&#39;s &#x60;headers&#x60; are passed through to the upstream, except a denylist of hop-by-hop and Weft-internal headers (&#x60;host&#x60;, &#x60;authorization&#x60;, &#x60;cookie&#x60;, &#x60;proxy-authorization&#x60;, &#x60;x-forwarded-*&#x60;, &#x60;x-real-ip&#x60;, &#x60;x-payment&#x60;, &#x60;connection&#x60;, &#x60;upgrade&#x60;). Up to 32 headers, 4 KB of combined value bytes.
34
- # @param fetch_request [FetchRequest]
34
+ # Universal x402 fetch proxy. The caller provides a target &#x60;url&#x60;, a hard &#x60;max_cost_usd&#x60; ceiling, and optional &#x60;method&#x60; / &#x60;body&#x60; / &#x60;headers&#x60;. Weft: 1. Issues the request. 2. On &#x60;402 Payment Required&#x60;, parses the merchant&#39;s challenge. 3. Compares the asking price to &#x60;max_cost_usd&#x60; and the buyer&#39;s policy (&#x60;max_tx_usd&#x60;, daily/weekly limits). 4. Signs an EIP-3009 transfer from the buyer&#39;s wallet. 5. Replays the request with the &#x60;X-Payment&#x60; header. 6. Streams the upstream artifact back, base64-encoded under &#x60;body_base64&#x60;, with &#x60;paid_usd&#x60;, &#x60;held_usd&#x60;, &#x60;payment_status&#x60;, &#x60;tx_hash&#x60;, and the merchant&#39;s reputation snapshot. &#x60;paid_usd&#x60; is \&quot;0.00\&quot; until the charge is CONFIRMED settled — a signed-but- unsettled hold (the common case for x402, which settles asynchronously) reports its amount in &#x60;held_usd&#x60; instead, never in &#x60;paid_usd&#x60;. Errors are structured with a stable &#x60;error&#x60; code, and each error response carries the buyer&#39;s &#x60;policy&#x60;, &#x60;balance&#x60;, and a &#x60;dashboard_url&#x60; so a CLI can render an actionable message without a second round-trip. Account-scoped: the bearer must be a buyer-scoped API key. **Forwarded headers:** the caller&#39;s &#x60;headers&#x60; are passed through to the upstream, except a denylist of hop-by-hop and Weft-internal headers (&#x60;host&#x60;, &#x60;authorization&#x60;, &#x60;cookie&#x60;, &#x60;proxy-authorization&#x60;, &#x60;x-forwarded-*&#x60;, &#x60;x-real-ip&#x60;, &#x60;x-payment&#x60;, &#x60;connection&#x60;, &#x60;upgrade&#x60;). Up to 32 headers, 4 KB of combined value bytes.
35
+ # @param fetch_request [FetchRequest]
35
36
  # @param [Hash] opts the optional parameters
37
+ # @option opts [String] :idempotency_key Opaque caller-generated retry key. Reusing the same key for the same buyer converges on one paid fetch; keys are hashed and namespaced by buyer before storage. Send this header for every unattended or retryable paid request.
36
38
  # @return [Array<(FetchResponse, Integer, Hash)>] FetchResponse data, response status code and response headers
37
39
  def fetch_with_http_info(fetch_request, opts = {})
38
40
  if @api_client.config.debugging
@@ -42,6 +44,19 @@ module Weft
42
44
  if @api_client.config.client_side_validation && fetch_request.nil?
43
45
  fail ArgumentError, "Missing the required parameter 'fetch_request' when calling FetchApi.fetch"
44
46
  end
47
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
48
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling FetchApi.fetch, the character length must be smaller than or equal to 255.'
49
+ end
50
+
51
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
52
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling FetchApi.fetch, the character length must be greater than or equal to 1.'
53
+ end
54
+
55
+ pattern = Regexp.new(/^[!-~]+$/)
56
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'] !~ pattern
57
+ fail ArgumentError, "invalid value for 'opts[:\"idempotency_key\"]' when calling FetchApi.fetch, must conform to the pattern #{pattern}."
58
+ end
59
+
45
60
  # resource path
46
61
  local_var_path = '/api/v1/fetch'
47
62
 
@@ -57,6 +72,7 @@ module Weft
57
72
  if !content_type.nil?
58
73
  header_params['Content-Type'] = content_type
59
74
  end
75
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
60
76
 
61
77
  # form parameters
62
78
  form_params = opts[:form_params] || {}
@@ -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/payments`) 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`.
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.7.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
@@ -0,0 +1,150 @@
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 'cgi'
14
+
15
+ module Weft
16
+ class PurchasesApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get a buyer purchase
23
+ # @param id [Integer] Purchase ID
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [PurchaseResponse]
26
+ def get_purchase(id, opts = {})
27
+ data, _status_code, _headers = get_purchase_with_http_info(id, opts)
28
+ data
29
+ end
30
+
31
+ # Get a buyer purchase
32
+ # @param id [Integer] Purchase ID
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(PurchaseResponse, Integer, Hash)>] PurchaseResponse data, response status code and response headers
35
+ def get_purchase_with_http_info(id, opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: PurchasesApi.get_purchase ...'
38
+ end
39
+ # verify the required parameter 'id' is set
40
+ if @api_client.config.client_side_validation && id.nil?
41
+ fail ArgumentError, "Missing the required parameter 'id' when calling PurchasesApi.get_purchase"
42
+ end
43
+ # resource path
44
+ local_var_path = '/api/v1/purchases/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
45
+
46
+ # query parameters
47
+ query_params = opts[:query_params] || {}
48
+
49
+ # header parameters
50
+ header_params = opts[:header_params] || {}
51
+ # HTTP header 'Accept' (if needed)
52
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
53
+
54
+ # form parameters
55
+ form_params = opts[:form_params] || {}
56
+
57
+ # http body (model)
58
+ post_body = opts[:debug_body]
59
+
60
+ # return_type
61
+ return_type = opts[:debug_return_type] || 'PurchaseResponse'
62
+
63
+ # auth_names
64
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
65
+
66
+ new_options = opts.merge(
67
+ :operation => :"PurchasesApi.get_purchase",
68
+ :header_params => header_params,
69
+ :query_params => query_params,
70
+ :form_params => form_params,
71
+ :body => post_body,
72
+ :auth_names => auth_names,
73
+ :return_type => return_type
74
+ )
75
+
76
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
77
+ if @api_client.config.debugging
78
+ @api_client.config.logger.debug "API called: PurchasesApi#get_purchase\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
79
+ end
80
+ return data, status_code, headers
81
+ end
82
+
83
+ # List buyer purchases
84
+ # Returns the authenticated buyer's signing and settlement ledger. Unlike `/api/v1/payments`, this endpoint is User-scoped and backed by `signed_events`, so rejected and pending attempts are included. Scoped to the buyer's own merchant spend, matching the dashboard's Purchases page. Internal signings are excluded: the Tempo refill self-transfer (`rebalance`) and operator signings (`manual`) are not payments the buyer made and never appear here.
85
+ # @param [Hash] opts the optional parameters
86
+ # @option opts [Integer] :page Page number (default to 1)
87
+ # @option opts [Integer] :per_page Items per page (default to 25)
88
+ # @return [PurchaseListResponse]
89
+ def list_purchases(opts = {})
90
+ data, _status_code, _headers = list_purchases_with_http_info(opts)
91
+ data
92
+ end
93
+
94
+ # List buyer purchases
95
+ # Returns the authenticated buyer&#39;s signing and settlement ledger. Unlike &#x60;/api/v1/payments&#x60;, this endpoint is User-scoped and backed by &#x60;signed_events&#x60;, so rejected and pending attempts are included. Scoped to the buyer&#39;s own merchant spend, matching the dashboard&#39;s Purchases page. Internal signings are excluded: the Tempo refill self-transfer (&#x60;rebalance&#x60;) and operator signings (&#x60;manual&#x60;) are not payments the buyer made and never appear here.
96
+ # @param [Hash] opts the optional parameters
97
+ # @option opts [Integer] :page Page number (default to 1)
98
+ # @option opts [Integer] :per_page Items per page (default to 25)
99
+ # @return [Array<(PurchaseListResponse, Integer, Hash)>] PurchaseListResponse data, response status code and response headers
100
+ def list_purchases_with_http_info(opts = {})
101
+ if @api_client.config.debugging
102
+ @api_client.config.logger.debug 'Calling API: PurchasesApi.list_purchases ...'
103
+ end
104
+ if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100
105
+ fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling PurchasesApi.list_purchases, must be smaller than or equal to 100.'
106
+ end
107
+
108
+ # resource path
109
+ local_var_path = '/api/v1/purchases'
110
+
111
+ # query parameters
112
+ query_params = opts[:query_params] || {}
113
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
114
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
115
+
116
+ # header parameters
117
+ header_params = opts[:header_params] || {}
118
+ # HTTP header 'Accept' (if needed)
119
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
120
+
121
+ # form parameters
122
+ form_params = opts[:form_params] || {}
123
+
124
+ # http body (model)
125
+ post_body = opts[:debug_body]
126
+
127
+ # return_type
128
+ return_type = opts[:debug_return_type] || 'PurchaseListResponse'
129
+
130
+ # auth_names
131
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
132
+
133
+ new_options = opts.merge(
134
+ :operation => :"PurchasesApi.list_purchases",
135
+ :header_params => header_params,
136
+ :query_params => query_params,
137
+ :form_params => form_params,
138
+ :body => post_body,
139
+ :auth_names => auth_names,
140
+ :return_type => return_type
141
+ )
142
+
143
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
144
+ if @api_client.config.debugging
145
+ @api_client.config.logger.debug "API called: PurchasesApi#list_purchases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
146
+ end
147
+ return data, status_code, headers
148
+ end
149
+ end
150
+ end