@weftlabs/sdk 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +499 -0
- package/dist/client-C9_zh3Qg.d.mts +11 -0
- package/dist/client-C9_zh3Qg.d.ts +11 -0
- package/dist/facilitator/index.d.mts +18 -0
- package/dist/facilitator/index.d.ts +18 -0
- package/dist/facilitator/index.js +180 -0
- package/dist/facilitator/index.js.map +1 -0
- package/dist/facilitator/index.mjs +149 -0
- package/dist/facilitator/index.mjs.map +1 -0
- package/dist/facilitator/middleware/index.d.mts +539 -0
- package/dist/facilitator/middleware/index.d.ts +539 -0
- package/dist/facilitator/middleware/index.js +1522 -0
- package/dist/facilitator/middleware/index.js.map +1 -0
- package/dist/facilitator/middleware/index.mjs +1493 -0
- package/dist/facilitator/middleware/index.mjs.map +1 -0
- package/dist/index.d.mts +5667 -0
- package/dist/index.d.ts +5667 -0
- package/dist/index.js +5555 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +5553 -0
- package/dist/index.mjs.map +1 -0
- package/dist/server.d.mts +8 -0
- package/dist/server.d.ts +8 -0
- package/dist/server.js +1587 -0
- package/dist/server.js.map +1 -0
- package/dist/server.mjs +1574 -0
- package/dist/server.mjs.map +1 -0
- package/docs/APIKeysApi.md +219 -0
- package/docs/AccountApi.md +72 -0
- package/docs/AccountBootstrapApproval.md +36 -0
- package/docs/AccountBootstrapCreated.md +44 -0
- package/docs/AccountBootstrapCreatedApproval.md +38 -0
- package/docs/AccountBootstrapCreatedResponse.md +32 -0
- package/docs/AccountBootstrapRequest.md +42 -0
- package/docs/AccountBootstrapStatus.md +40 -0
- package/docs/AccountBootstrapStatusResponse.md +32 -0
- package/docs/AccountDetails.md +43 -0
- package/docs/AgentBootstrapApi.md +223 -0
- package/docs/ApiKey.md +42 -0
- package/docs/ApiKeyCreated.md +40 -0
- package/docs/ApiKeyCreatedResponse.md +32 -0
- package/docs/ApiKeyListResponse.md +34 -0
- package/docs/AuthApi.md +408 -0
- package/docs/AuthResponse.md +32 -0
- package/docs/AuthResponseData.md +36 -0
- package/docs/BalanceApi.md +73 -0
- package/docs/BalanceResponse.md +45 -0
- package/docs/ConfirmRequest.md +32 -0
- package/docs/CreateApiKeyRequest.md +32 -0
- package/docs/DocumentationApi.md +65 -0
- package/docs/EnrolledResource.md +59 -0
- package/docs/ErrorResponse.md +33 -0
- package/docs/Fetch403Response.md +44 -0
- package/docs/FetchApi.md +91 -0
- package/docs/FetchBalanceSnapshot.md +41 -0
- package/docs/FetchErrorResponse.md +41 -0
- package/docs/FetchRequest.md +46 -0
- package/docs/FetchRequestBody.md +31 -0
- package/docs/FetchResponse.md +49 -0
- package/docs/InsufficientScopeResponse.md +37 -0
- package/docs/MeApiKey.md +40 -0
- package/docs/MeApiKeyCreator.md +37 -0
- package/docs/MeResponse.md +32 -0
- package/docs/MeResponseData.md +56 -0
- package/docs/MessageResponse.md +32 -0
- package/docs/MessageResponseData.md +32 -0
- package/docs/ModelError.md +39 -0
- package/docs/Pagination.md +38 -0
- package/docs/PasswordResetRequest.md +32 -0
- package/docs/PasswordUpdateRequest.md +36 -0
- package/docs/Payment.md +56 -0
- package/docs/PaymentListResponse.md +34 -0
- package/docs/PaymentResponse.md +32 -0
- package/docs/PaymentsApi.md +154 -0
- package/docs/PrincipalWallet.md +34 -0
- package/docs/PromoBalance.md +37 -0
- package/docs/Purchase.md +58 -0
- package/docs/PurchaseArtifact.md +38 -0
- package/docs/PurchaseListResponse.md +34 -0
- package/docs/PurchaseResponse.md +32 -0
- package/docs/PurchasesApi.md +157 -0
- package/docs/RateLimitResponse.md +34 -0
- package/docs/ResendConfirmationRequest.md +32 -0
- package/docs/ResourceEnrollmentRequest.md +39 -0
- package/docs/ResourceEnrollmentResponse.md +32 -0
- package/docs/ResourceStats.md +45 -0
- package/docs/ResourcesApi.md +77 -0
- package/docs/SearchAccessMethod.md +52 -0
- package/docs/SearchApi.md +86 -0
- package/docs/SearchCapabilityRef.md +34 -0
- package/docs/SearchCuratedCallability.md +34 -0
- package/docs/SearchCuratedExecution.md +32 -0
- package/docs/SearchCuratedOperation.md +36 -0
- package/docs/SearchCuratedService.md +34 -0
- package/docs/SearchCuratedSource.md +36 -0
- package/docs/SearchEndpointCall.md +39 -0
- package/docs/SearchEndpointHit.md +74 -0
- package/docs/SearchEndpointPrice.md +41 -0
- package/docs/SearchErrorResponse.md +35 -0
- package/docs/SearchExecutionModeFilter.md +34 -0
- package/docs/SearchFilterSpec.md +49 -0
- package/docs/SearchMethodFilter.md +34 -0
- package/docs/SearchPaymentOffer.md +47 -0
- package/docs/SearchPriceAtomicFilter.md +41 -0
- package/docs/SearchPriceUsdFilter.md +41 -0
- package/docs/SearchProtocolFilter.md +35 -0
- package/docs/SearchProviderRef.md +36 -0
- package/docs/SearchRequest.md +36 -0
- package/docs/SearchResourceTypeFilter.md +35 -0
- package/docs/SearchResponse.md +67 -0
- package/docs/SearchResponseWarningsInner.md +38 -0
- package/docs/SearchResult.md +38 -0
- package/docs/SearchStringSetFilter.md +34 -0
- package/docs/SearchWeftFetchCompatibility.md +36 -0
- package/docs/SignInRequest.md +34 -0
- package/docs/SignUpRequest.md +36 -0
- package/docs/SpendingPolicy.md +36 -0
- package/docs/User.md +36 -0
- package/docs/UserPrincipal.md +49 -0
- package/docs/Wallet.md +42 -0
- package/examples/charge-api-hono.mjs +40 -0
- package/examples/charge-api.mjs +43 -0
- package/examples/quickstart.mjs +16 -0
- package/package.json +105 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# SearchApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://weft.network*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
| [**search**](SearchApi.md#searchoperation) | **POST** /api/v1/search | Search the Weft index |
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## search
|
|
12
|
+
|
|
13
|
+
> SearchResponse search(searchRequest)
|
|
14
|
+
|
|
15
|
+
Search the Weft index
|
|
16
|
+
|
|
17
|
+
Semantic search over the Weft index of paid agent resources. The request body is the weft-search-platform `/v1/search` contract: a free-text `query`, optional `max_results`, and optional structured `filters` (price / price_atomic / type / protocol — the canonical FilterSpec v1 vocabulary, vendored verbatim from the platform). Price is a dual representation of one constraint: `price` in USD decimal strings (the reasoning form) XOR `price_atomic` in integer micro-USD (the settlement form) — mutually exclusive, set at most one. Account-scoped: the bearer token must be a buyer-scoped API key, an OAuth token carrying `search`, or a pending or claimed `wbt_*` bootstrap bearer. Pending bootstrap access uses an anonymous bootstrap identity; after claim, the promoted bearer uses its bound User. Rejection, cancellation, expiry, and revocation end bootstrap search. Bootstrap search is limited to 60 requests per credential and 120 per IP each hour before native credential promotion. Response negotiation: `Accept: application/json` (default) returns the structured envelope; `Accept: text/markdown` returns a rendered Markdown digest of the same results — useful for piping into a chat UI or LLM prompt.
|
|
18
|
+
|
|
19
|
+
### Example
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import {
|
|
23
|
+
Configuration,
|
|
24
|
+
SearchApi,
|
|
25
|
+
} from '@weftlabs/sdk';
|
|
26
|
+
import type { SearchOperationRequest } from '@weftlabs/sdk';
|
|
27
|
+
|
|
28
|
+
async function example() {
|
|
29
|
+
console.log("🚀 Testing @weftlabs/sdk SDK...");
|
|
30
|
+
const config = new Configuration({
|
|
31
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
32
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
33
|
+
});
|
|
34
|
+
const api = new SearchApi(config);
|
|
35
|
+
|
|
36
|
+
const body = {
|
|
37
|
+
// SearchRequest
|
|
38
|
+
searchRequest: ...,
|
|
39
|
+
} satisfies SearchOperationRequest;
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
const data = await api.search(body);
|
|
43
|
+
console.log(data);
|
|
44
|
+
} catch (error) {
|
|
45
|
+
console.error(error);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Run the test
|
|
50
|
+
example().catch(console.error);
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Parameters
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
| Name | Type | Description | Notes |
|
|
57
|
+
|------------- | ------------- | ------------- | -------------|
|
|
58
|
+
| **searchRequest** | [SearchRequest](SearchRequest.md) | | |
|
|
59
|
+
|
|
60
|
+
### Return type
|
|
61
|
+
|
|
62
|
+
[**SearchResponse**](SearchResponse.md)
|
|
63
|
+
|
|
64
|
+
### Authorization
|
|
65
|
+
|
|
66
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
67
|
+
|
|
68
|
+
### HTTP request headers
|
|
69
|
+
|
|
70
|
+
- **Content-Type**: `application/json`
|
|
71
|
+
- **Accept**: `application/json`, `text/markdown`
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
### HTTP response details
|
|
75
|
+
| Status code | Description | Response headers |
|
|
76
|
+
|-------------|-------------|------------------|
|
|
77
|
+
| **200** | Search results | - |
|
|
78
|
+
| **401** | Unauthorized — missing or non-buyer-scoped API key | - |
|
|
79
|
+
| **403** | The OAuth access token authenticated but lacks the `search` scope (RFC 6750 `insufficient_scope`). Carries a `WWW-Authenticate: Bearer error=\"insufficient_scope\", scope=\"search\"` header. `wk_` API keys are unscoped and never see this. | - |
|
|
80
|
+
| **406** | The requested response format is not JSON or Markdown. | - |
|
|
81
|
+
| **422** | Invalid request — empty/missing `query`, out-of-range `max_results`, an unknown top-level parameter, or invalid `filters` (unknown filter key/operator, bad enum value, or a sub-filter without exactly one operator). See the `error` code. | - |
|
|
82
|
+
| **429** | Bootstrap search rate limit exceeded | - |
|
|
83
|
+
| **502** | Search service unavailable | - |
|
|
84
|
+
| **500** | Internal server error | - |
|
|
85
|
+
|
|
86
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# SearchCapabilityRef
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`capabilityId` | string
|
|
10
|
+
`capabilityType` | string
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { SearchCapabilityRef } from '@weftlabs/sdk'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"capabilityId": null,
|
|
20
|
+
"capabilityType": null,
|
|
21
|
+
} satisfies SearchCapabilityRef
|
|
22
|
+
|
|
23
|
+
console.log(example)
|
|
24
|
+
|
|
25
|
+
// Convert the instance to a JSON string
|
|
26
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
27
|
+
console.log(exampleJSON)
|
|
28
|
+
|
|
29
|
+
// Parse the JSON string back to an object
|
|
30
|
+
const exampleParsed = JSON.parse(exampleJSON) as SearchCapabilityRef
|
|
31
|
+
console.log(exampleParsed)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# SearchCuratedCallability
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`state` | string
|
|
10
|
+
`missing` | Array<string>
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { SearchCuratedCallability } from '@weftlabs/sdk'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"state": null,
|
|
20
|
+
"missing": null,
|
|
21
|
+
} satisfies SearchCuratedCallability
|
|
22
|
+
|
|
23
|
+
console.log(example)
|
|
24
|
+
|
|
25
|
+
// Convert the instance to a JSON string
|
|
26
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
27
|
+
console.log(exampleJSON)
|
|
28
|
+
|
|
29
|
+
// Parse the JSON string back to an object
|
|
30
|
+
const exampleParsed = JSON.parse(exampleJSON) as SearchCuratedCallability
|
|
31
|
+
console.log(exampleParsed)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
# SearchCuratedExecution
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`mode` | string
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { SearchCuratedExecution } from '@weftlabs/sdk'
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
"mode": null,
|
|
19
|
+
} satisfies SearchCuratedExecution
|
|
20
|
+
|
|
21
|
+
console.log(example)
|
|
22
|
+
|
|
23
|
+
// Convert the instance to a JSON string
|
|
24
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
25
|
+
console.log(exampleJSON)
|
|
26
|
+
|
|
27
|
+
// Parse the JSON string back to an object
|
|
28
|
+
const exampleParsed = JSON.parse(exampleJSON) as SearchCuratedExecution
|
|
29
|
+
console.log(exampleParsed)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# SearchCuratedOperation
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`id` | string
|
|
10
|
+
`name` | string
|
|
11
|
+
`description` | string
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { SearchCuratedOperation } from '@weftlabs/sdk'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"id": null,
|
|
21
|
+
"name": null,
|
|
22
|
+
"description": null,
|
|
23
|
+
} satisfies SearchCuratedOperation
|
|
24
|
+
|
|
25
|
+
console.log(example)
|
|
26
|
+
|
|
27
|
+
// Convert the instance to a JSON string
|
|
28
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
29
|
+
console.log(exampleJSON)
|
|
30
|
+
|
|
31
|
+
// Parse the JSON string back to an object
|
|
32
|
+
const exampleParsed = JSON.parse(exampleJSON) as SearchCuratedOperation
|
|
33
|
+
console.log(exampleParsed)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# SearchCuratedService
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`id` | string
|
|
10
|
+
`name` | string
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { SearchCuratedService } from '@weftlabs/sdk'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"id": null,
|
|
20
|
+
"name": null,
|
|
21
|
+
} satisfies SearchCuratedService
|
|
22
|
+
|
|
23
|
+
console.log(example)
|
|
24
|
+
|
|
25
|
+
// Convert the instance to a JSON string
|
|
26
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
27
|
+
console.log(exampleJSON)
|
|
28
|
+
|
|
29
|
+
// Parse the JSON string back to an object
|
|
30
|
+
const exampleParsed = JSON.parse(exampleJSON) as SearchCuratedService
|
|
31
|
+
console.log(exampleParsed)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# SearchCuratedSource
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`catalog` | string
|
|
10
|
+
`snapshotVersion` | number
|
|
11
|
+
`capturedAt` | Date
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { SearchCuratedSource } from '@weftlabs/sdk'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"catalog": null,
|
|
21
|
+
"snapshotVersion": null,
|
|
22
|
+
"capturedAt": null,
|
|
23
|
+
} satisfies SearchCuratedSource
|
|
24
|
+
|
|
25
|
+
console.log(example)
|
|
26
|
+
|
|
27
|
+
// Convert the instance to a JSON string
|
|
28
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
29
|
+
console.log(exampleJSON)
|
|
30
|
+
|
|
31
|
+
// Parse the JSON string back to an object
|
|
32
|
+
const exampleParsed = JSON.parse(exampleJSON) as SearchCuratedSource
|
|
33
|
+
console.log(exampleParsed)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
# SearchEndpointCall
|
|
3
|
+
|
|
4
|
+
The machine-readable call contract for this endpoint: the verb, the provider-declared argument schema, and the worked examples. Always present; an endpoint whose provider declares nothing carries an empty `method` and null members rather than an absent block, so a caller can always read `input_schema` without a presence check. Combine with the hit\'s `url` to construct the request.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`method` | string
|
|
11
|
+
`inputSchema` | object
|
|
12
|
+
`exampleRequest` | object
|
|
13
|
+
`exampleResponse` | any
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import type { SearchEndpointCall } from '@weftlabs/sdk'
|
|
19
|
+
|
|
20
|
+
// TODO: Update the object below with actual values
|
|
21
|
+
const example = {
|
|
22
|
+
"method": null,
|
|
23
|
+
"inputSchema": null,
|
|
24
|
+
"exampleRequest": null,
|
|
25
|
+
"exampleResponse": null,
|
|
26
|
+
} satisfies SearchEndpointCall
|
|
27
|
+
|
|
28
|
+
console.log(example)
|
|
29
|
+
|
|
30
|
+
// Convert the instance to a JSON string
|
|
31
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
32
|
+
console.log(exampleJSON)
|
|
33
|
+
|
|
34
|
+
// Parse the JSON string back to an object
|
|
35
|
+
const exampleParsed = JSON.parse(exampleJSON) as SearchEndpointCall
|
|
36
|
+
console.log(exampleParsed)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
|
|
2
|
+
# SearchEndpointHit
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`endpointId` | string
|
|
10
|
+
`url` | string
|
|
11
|
+
`resourceType` | string
|
|
12
|
+
`primaryProtocol` | string
|
|
13
|
+
`call` | [SearchEndpointCall](SearchEndpointCall.md)
|
|
14
|
+
`price` | [SearchEndpointPrice](SearchEndpointPrice.md)
|
|
15
|
+
`payment` | [Array<SearchPaymentOffer>](SearchPaymentOffer.md)
|
|
16
|
+
`accessMethods` | [Array<SearchAccessMethod>](SearchAccessMethod.md)
|
|
17
|
+
`service` | [SearchCuratedService](SearchCuratedService.md)
|
|
18
|
+
`operation` | [SearchCuratedOperation](SearchCuratedOperation.md)
|
|
19
|
+
`outputSchema` | object
|
|
20
|
+
`output` | object
|
|
21
|
+
`execution` | [SearchCuratedExecution](SearchCuratedExecution.md)
|
|
22
|
+
`callability` | [SearchCuratedCallability](SearchCuratedCallability.md)
|
|
23
|
+
`compatibility` | object
|
|
24
|
+
`source` | [SearchCuratedSource](SearchCuratedSource.md)
|
|
25
|
+
`operatorType` | string
|
|
26
|
+
`operatedById` | string
|
|
27
|
+
`settledViaFacilitatorId` | string
|
|
28
|
+
`settlements` | number
|
|
29
|
+
`lastVerifiedAt` | Date
|
|
30
|
+
`latencyP50Ms` | number
|
|
31
|
+
|
|
32
|
+
## Example
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
import type { SearchEndpointHit } from '@weftlabs/sdk'
|
|
36
|
+
|
|
37
|
+
// TODO: Update the object below with actual values
|
|
38
|
+
const example = {
|
|
39
|
+
"endpointId": null,
|
|
40
|
+
"url": null,
|
|
41
|
+
"resourceType": null,
|
|
42
|
+
"primaryProtocol": null,
|
|
43
|
+
"call": null,
|
|
44
|
+
"price": null,
|
|
45
|
+
"payment": null,
|
|
46
|
+
"accessMethods": null,
|
|
47
|
+
"service": null,
|
|
48
|
+
"operation": null,
|
|
49
|
+
"outputSchema": null,
|
|
50
|
+
"output": null,
|
|
51
|
+
"execution": null,
|
|
52
|
+
"callability": null,
|
|
53
|
+
"compatibility": null,
|
|
54
|
+
"source": null,
|
|
55
|
+
"operatorType": null,
|
|
56
|
+
"operatedById": null,
|
|
57
|
+
"settledViaFacilitatorId": null,
|
|
58
|
+
"settlements": null,
|
|
59
|
+
"lastVerifiedAt": null,
|
|
60
|
+
"latencyP50Ms": null,
|
|
61
|
+
} satisfies SearchEndpointHit
|
|
62
|
+
|
|
63
|
+
console.log(example)
|
|
64
|
+
|
|
65
|
+
// Convert the instance to a JSON string
|
|
66
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
67
|
+
console.log(exampleJSON)
|
|
68
|
+
|
|
69
|
+
// Parse the JSON string back to an object
|
|
70
|
+
const exampleParsed = JSON.parse(exampleJSON) as SearchEndpointHit
|
|
71
|
+
console.log(exampleParsed)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
# SearchEndpointPrice
|
|
3
|
+
|
|
4
|
+
Price + provenance + freshness for this (endpoint × capability) pairing. Always present; an unpriced endpoint carries null amounts rather than an absent block, so a caller never has to distinguish \"free\" from \"we do not know\".
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`indexedUsd` | string
|
|
11
|
+
`atomic` | number
|
|
12
|
+
`source` | string
|
|
13
|
+
`lastObservedAt` | Date
|
|
14
|
+
`liveVerified` | boolean
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import type { SearchEndpointPrice } from '@weftlabs/sdk'
|
|
20
|
+
|
|
21
|
+
// TODO: Update the object below with actual values
|
|
22
|
+
const example = {
|
|
23
|
+
"indexedUsd": null,
|
|
24
|
+
"atomic": null,
|
|
25
|
+
"source": null,
|
|
26
|
+
"lastObservedAt": null,
|
|
27
|
+
"liveVerified": null,
|
|
28
|
+
} satisfies SearchEndpointPrice
|
|
29
|
+
|
|
30
|
+
console.log(example)
|
|
31
|
+
|
|
32
|
+
// Convert the instance to a JSON string
|
|
33
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
34
|
+
console.log(exampleJSON)
|
|
35
|
+
|
|
36
|
+
// Parse the JSON string back to an object
|
|
37
|
+
const exampleParsed = JSON.parse(exampleJSON) as SearchEndpointPrice
|
|
38
|
+
console.log(exampleParsed)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
# SearchErrorResponse
|
|
3
|
+
|
|
4
|
+
Bespoke error envelope returned by `/api/v1/search` for `422`, `502`, and `500` responses. It differs from the standard `ErrorResponse` envelope (no nested `code`/`message`/`request_id`); SDK clients should handle both shapes for this endpoint until the controller is migrated to the standard envelope.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`error` | string
|
|
11
|
+
`details` | { [key: string]: any; }
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { SearchErrorResponse } from '@weftlabs/sdk'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"error": null,
|
|
21
|
+
"details": null,
|
|
22
|
+
} satisfies SearchErrorResponse
|
|
23
|
+
|
|
24
|
+
console.log(example)
|
|
25
|
+
|
|
26
|
+
// Convert the instance to a JSON string
|
|
27
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
28
|
+
console.log(exampleJSON)
|
|
29
|
+
|
|
30
|
+
// Parse the JSON string back to an object
|
|
31
|
+
const exampleParsed = JSON.parse(exampleJSON) as SearchErrorResponse
|
|
32
|
+
console.log(exampleParsed)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# SearchExecutionModeFilter
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`eq` | string
|
|
10
|
+
`_in` | Array<string>
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { SearchExecutionModeFilter } from '@weftlabs/sdk'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"eq": null,
|
|
20
|
+
"_in": null,
|
|
21
|
+
} satisfies SearchExecutionModeFilter
|
|
22
|
+
|
|
23
|
+
console.log(example)
|
|
24
|
+
|
|
25
|
+
// Convert the instance to a JSON string
|
|
26
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
27
|
+
console.log(exampleJSON)
|
|
28
|
+
|
|
29
|
+
// Parse the JSON string back to an object
|
|
30
|
+
const exampleParsed = JSON.parse(exampleJSON) as SearchExecutionModeFilter
|
|
31
|
+
console.log(exampleParsed)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
|
|
2
|
+
# SearchFilterSpec
|
|
3
|
+
|
|
4
|
+
Structured hard constraints on the query — the weft-search-platform `FilterSpec` v1 typed subset, vendored verbatim (D1 contract). Every field is optional; an empty object is the no-filter query. Set fields are ANDed. Each sub-filter takes exactly one operator; unknown filter keys and unknown operators are rejected (`422 INVALID_FILTERS`). `price` (USD decimal strings) and `price_atomic` (integer micro-USD) are two representations of ONE price constraint — the reasoning form and the settlement form. They are MUTUALLY EXCLUSIVE: setting both is `422 INVALID_FILTERS`. A JSON number in `price` is rejected (only decimal strings), so `{lte: 5}` can never be mis-read as 5 micro-dollars. The canonical enum value sets are pinned to the platform spec by the CI drift gate (`docs/contracts/search-platform.openapi.yaml`).
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`price` | [SearchPriceUsdFilter](SearchPriceUsdFilter.md)
|
|
11
|
+
`priceAtomic` | [SearchPriceAtomicFilter](SearchPriceAtomicFilter.md)
|
|
12
|
+
`type` | [SearchResourceTypeFilter](SearchResourceTypeFilter.md)
|
|
13
|
+
`protocol` | [SearchProtocolFilter](SearchProtocolFilter.md)
|
|
14
|
+
`category` | [SearchStringSetFilter](SearchStringSetFilter.md)
|
|
15
|
+
`method` | [SearchMethodFilter](SearchMethodFilter.md)
|
|
16
|
+
`executionMode` | [SearchExecutionModeFilter](SearchExecutionModeFilter.md)
|
|
17
|
+
`weftFetchCompatible` | boolean
|
|
18
|
+
`includeUnknownPrices` | boolean
|
|
19
|
+
|
|
20
|
+
## Example
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import type { SearchFilterSpec } from '@weftlabs/sdk'
|
|
24
|
+
|
|
25
|
+
// TODO: Update the object below with actual values
|
|
26
|
+
const example = {
|
|
27
|
+
"price": null,
|
|
28
|
+
"priceAtomic": null,
|
|
29
|
+
"type": null,
|
|
30
|
+
"protocol": null,
|
|
31
|
+
"category": null,
|
|
32
|
+
"method": null,
|
|
33
|
+
"executionMode": null,
|
|
34
|
+
"weftFetchCompatible": null,
|
|
35
|
+
"includeUnknownPrices": null,
|
|
36
|
+
} satisfies SearchFilterSpec
|
|
37
|
+
|
|
38
|
+
console.log(example)
|
|
39
|
+
|
|
40
|
+
// Convert the instance to a JSON string
|
|
41
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
42
|
+
console.log(exampleJSON)
|
|
43
|
+
|
|
44
|
+
// Parse the JSON string back to an object
|
|
45
|
+
const exampleParsed = JSON.parse(exampleJSON) as SearchFilterSpec
|
|
46
|
+
console.log(exampleParsed)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# SearchMethodFilter
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`eq` | string
|
|
10
|
+
`_in` | Array<string>
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { SearchMethodFilter } from '@weftlabs/sdk'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"eq": null,
|
|
20
|
+
"_in": null,
|
|
21
|
+
} satisfies SearchMethodFilter
|
|
22
|
+
|
|
23
|
+
console.log(example)
|
|
24
|
+
|
|
25
|
+
// Convert the instance to a JSON string
|
|
26
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
27
|
+
console.log(exampleJSON)
|
|
28
|
+
|
|
29
|
+
// Parse the JSON string back to an object
|
|
30
|
+
const exampleParsed = JSON.parse(exampleJSON) as SearchMethodFilter
|
|
31
|
+
console.log(exampleParsed)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
# SearchPaymentOffer
|
|
3
|
+
|
|
4
|
+
One settlement route the endpoint\'s own 402 challenge published — a (rail × network × asset × payee) tuple a caller can settle against directly with its own SDK.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`protocol` | string
|
|
11
|
+
`scheme` | string
|
|
12
|
+
`network` | string
|
|
13
|
+
`asset` | string
|
|
14
|
+
`amount` | string
|
|
15
|
+
`payTo` | string
|
|
16
|
+
`maxTimeoutSeconds` | number
|
|
17
|
+
`facilitator` | string
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import type { SearchPaymentOffer } from '@weftlabs/sdk'
|
|
23
|
+
|
|
24
|
+
// TODO: Update the object below with actual values
|
|
25
|
+
const example = {
|
|
26
|
+
"protocol": null,
|
|
27
|
+
"scheme": null,
|
|
28
|
+
"network": null,
|
|
29
|
+
"asset": null,
|
|
30
|
+
"amount": null,
|
|
31
|
+
"payTo": null,
|
|
32
|
+
"maxTimeoutSeconds": null,
|
|
33
|
+
"facilitator": null,
|
|
34
|
+
} satisfies SearchPaymentOffer
|
|
35
|
+
|
|
36
|
+
console.log(example)
|
|
37
|
+
|
|
38
|
+
// Convert the instance to a JSON string
|
|
39
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
40
|
+
console.log(exampleJSON)
|
|
41
|
+
|
|
42
|
+
// Parse the JSON string back to an object
|
|
43
|
+
const exampleParsed = JSON.parse(exampleJSON) as SearchPaymentOffer
|
|
44
|
+
console.log(exampleParsed)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|