@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.
Files changed (124) hide show
  1. package/README.md +499 -0
  2. package/dist/client-C9_zh3Qg.d.mts +11 -0
  3. package/dist/client-C9_zh3Qg.d.ts +11 -0
  4. package/dist/facilitator/index.d.mts +18 -0
  5. package/dist/facilitator/index.d.ts +18 -0
  6. package/dist/facilitator/index.js +180 -0
  7. package/dist/facilitator/index.js.map +1 -0
  8. package/dist/facilitator/index.mjs +149 -0
  9. package/dist/facilitator/index.mjs.map +1 -0
  10. package/dist/facilitator/middleware/index.d.mts +539 -0
  11. package/dist/facilitator/middleware/index.d.ts +539 -0
  12. package/dist/facilitator/middleware/index.js +1522 -0
  13. package/dist/facilitator/middleware/index.js.map +1 -0
  14. package/dist/facilitator/middleware/index.mjs +1493 -0
  15. package/dist/facilitator/middleware/index.mjs.map +1 -0
  16. package/dist/index.d.mts +5667 -0
  17. package/dist/index.d.ts +5667 -0
  18. package/dist/index.js +5555 -0
  19. package/dist/index.js.map +1 -0
  20. package/dist/index.mjs +5553 -0
  21. package/dist/index.mjs.map +1 -0
  22. package/dist/server.d.mts +8 -0
  23. package/dist/server.d.ts +8 -0
  24. package/dist/server.js +1587 -0
  25. package/dist/server.js.map +1 -0
  26. package/dist/server.mjs +1574 -0
  27. package/dist/server.mjs.map +1 -0
  28. package/docs/APIKeysApi.md +219 -0
  29. package/docs/AccountApi.md +72 -0
  30. package/docs/AccountBootstrapApproval.md +36 -0
  31. package/docs/AccountBootstrapCreated.md +44 -0
  32. package/docs/AccountBootstrapCreatedApproval.md +38 -0
  33. package/docs/AccountBootstrapCreatedResponse.md +32 -0
  34. package/docs/AccountBootstrapRequest.md +42 -0
  35. package/docs/AccountBootstrapStatus.md +40 -0
  36. package/docs/AccountBootstrapStatusResponse.md +32 -0
  37. package/docs/AccountDetails.md +43 -0
  38. package/docs/AgentBootstrapApi.md +223 -0
  39. package/docs/ApiKey.md +42 -0
  40. package/docs/ApiKeyCreated.md +40 -0
  41. package/docs/ApiKeyCreatedResponse.md +32 -0
  42. package/docs/ApiKeyListResponse.md +34 -0
  43. package/docs/AuthApi.md +408 -0
  44. package/docs/AuthResponse.md +32 -0
  45. package/docs/AuthResponseData.md +36 -0
  46. package/docs/BalanceApi.md +73 -0
  47. package/docs/BalanceResponse.md +45 -0
  48. package/docs/ConfirmRequest.md +32 -0
  49. package/docs/CreateApiKeyRequest.md +32 -0
  50. package/docs/DocumentationApi.md +65 -0
  51. package/docs/EnrolledResource.md +59 -0
  52. package/docs/ErrorResponse.md +33 -0
  53. package/docs/Fetch403Response.md +44 -0
  54. package/docs/FetchApi.md +91 -0
  55. package/docs/FetchBalanceSnapshot.md +41 -0
  56. package/docs/FetchErrorResponse.md +41 -0
  57. package/docs/FetchRequest.md +46 -0
  58. package/docs/FetchRequestBody.md +31 -0
  59. package/docs/FetchResponse.md +49 -0
  60. package/docs/InsufficientScopeResponse.md +37 -0
  61. package/docs/MeApiKey.md +40 -0
  62. package/docs/MeApiKeyCreator.md +37 -0
  63. package/docs/MeResponse.md +32 -0
  64. package/docs/MeResponseData.md +56 -0
  65. package/docs/MessageResponse.md +32 -0
  66. package/docs/MessageResponseData.md +32 -0
  67. package/docs/ModelError.md +39 -0
  68. package/docs/Pagination.md +38 -0
  69. package/docs/PasswordResetRequest.md +32 -0
  70. package/docs/PasswordUpdateRequest.md +36 -0
  71. package/docs/Payment.md +56 -0
  72. package/docs/PaymentListResponse.md +34 -0
  73. package/docs/PaymentResponse.md +32 -0
  74. package/docs/PaymentsApi.md +154 -0
  75. package/docs/PrincipalWallet.md +34 -0
  76. package/docs/PromoBalance.md +37 -0
  77. package/docs/Purchase.md +58 -0
  78. package/docs/PurchaseArtifact.md +38 -0
  79. package/docs/PurchaseListResponse.md +34 -0
  80. package/docs/PurchaseResponse.md +32 -0
  81. package/docs/PurchasesApi.md +157 -0
  82. package/docs/RateLimitResponse.md +34 -0
  83. package/docs/ResendConfirmationRequest.md +32 -0
  84. package/docs/ResourceEnrollmentRequest.md +39 -0
  85. package/docs/ResourceEnrollmentResponse.md +32 -0
  86. package/docs/ResourceStats.md +45 -0
  87. package/docs/ResourcesApi.md +77 -0
  88. package/docs/SearchAccessMethod.md +52 -0
  89. package/docs/SearchApi.md +86 -0
  90. package/docs/SearchCapabilityRef.md +34 -0
  91. package/docs/SearchCuratedCallability.md +34 -0
  92. package/docs/SearchCuratedExecution.md +32 -0
  93. package/docs/SearchCuratedOperation.md +36 -0
  94. package/docs/SearchCuratedService.md +34 -0
  95. package/docs/SearchCuratedSource.md +36 -0
  96. package/docs/SearchEndpointCall.md +39 -0
  97. package/docs/SearchEndpointHit.md +74 -0
  98. package/docs/SearchEndpointPrice.md +41 -0
  99. package/docs/SearchErrorResponse.md +35 -0
  100. package/docs/SearchExecutionModeFilter.md +34 -0
  101. package/docs/SearchFilterSpec.md +49 -0
  102. package/docs/SearchMethodFilter.md +34 -0
  103. package/docs/SearchPaymentOffer.md +47 -0
  104. package/docs/SearchPriceAtomicFilter.md +41 -0
  105. package/docs/SearchPriceUsdFilter.md +41 -0
  106. package/docs/SearchProtocolFilter.md +35 -0
  107. package/docs/SearchProviderRef.md +36 -0
  108. package/docs/SearchRequest.md +36 -0
  109. package/docs/SearchResourceTypeFilter.md +35 -0
  110. package/docs/SearchResponse.md +67 -0
  111. package/docs/SearchResponseWarningsInner.md +38 -0
  112. package/docs/SearchResult.md +38 -0
  113. package/docs/SearchStringSetFilter.md +34 -0
  114. package/docs/SearchWeftFetchCompatibility.md +36 -0
  115. package/docs/SignInRequest.md +34 -0
  116. package/docs/SignUpRequest.md +36 -0
  117. package/docs/SpendingPolicy.md +36 -0
  118. package/docs/User.md +36 -0
  119. package/docs/UserPrincipal.md +49 -0
  120. package/docs/Wallet.md +42 -0
  121. package/examples/charge-api-hono.mjs +40 -0
  122. package/examples/charge-api.mjs +43 -0
  123. package/examples/quickstart.mjs +16 -0
  124. package/package.json +105 -0
@@ -0,0 +1,72 @@
1
+ # AccountApi
2
+
3
+ All URIs are relative to *https://weft.network*
4
+
5
+ | Method | HTTP request | Description |
6
+ |------------- | ------------- | -------------|
7
+ | [**getMe**](AccountApi.md#getme) | **GET** /api/v1/me | Get the current credential principal |
8
+
9
+
10
+
11
+ ## getMe
12
+
13
+ > MeResponse getMe()
14
+
15
+ Get the current credential principal
16
+
17
+ Returns the seller Organization represented by an `ax_live_*` resource key, or the buyer User represented by a `wk_*` account key, OAuth access token, or claimed `wbt_*` bearer. Branch on `data.principal_type`.
18
+
19
+ ### Example
20
+
21
+ ```ts
22
+ import {
23
+ Configuration,
24
+ AccountApi,
25
+ } from '@weftlabs/sdk';
26
+ import type { GetMeRequest } 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 AccountApi(config);
35
+
36
+ try {
37
+ const data = await api.getMe();
38
+ console.log(data);
39
+ } catch (error) {
40
+ console.error(error);
41
+ }
42
+ }
43
+
44
+ // Run the test
45
+ example().catch(console.error);
46
+ ```
47
+
48
+ ### Parameters
49
+
50
+ This endpoint does not need any parameter.
51
+
52
+ ### Return type
53
+
54
+ [**MeResponse**](MeResponse.md)
55
+
56
+ ### Authorization
57
+
58
+ [bearerAuth](../README.md#bearerAuth)
59
+
60
+ ### HTTP request headers
61
+
62
+ - **Content-Type**: Not defined
63
+ - **Accept**: `application/json`
64
+
65
+
66
+ ### HTTP response details
67
+ | Status code | Description | Response headers |
68
+ |-------------|-------------|------------------|
69
+ | **200** | Current Organization or User principal | - |
70
+ | **401** | Unauthorized | - |
71
+
72
+ [[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
+ # AccountBootstrapApproval
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `method` | string
10
+ `expiresIn` | number
11
+ `interval` | number
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import type { AccountBootstrapApproval } from '@weftlabs/sdk'
17
+
18
+ // TODO: Update the object below with actual values
19
+ const example = {
20
+ "method": null,
21
+ "expiresIn": null,
22
+ "interval": null,
23
+ } satisfies AccountBootstrapApproval
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 AccountBootstrapApproval
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,44 @@
1
+
2
+ # AccountBootstrapCreated
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `id` | string
10
+ `status` | string
11
+ `capabilities` | Set<string>
12
+ `expiresAt` | Date
13
+ `approval` | [AccountBootstrapCreatedApproval](AccountBootstrapCreatedApproval.md)
14
+ `temporaryApiKey` | string
15
+ `deviceCode` | string
16
+
17
+ ## Example
18
+
19
+ ```typescript
20
+ import type { AccountBootstrapCreated } from '@weftlabs/sdk'
21
+
22
+ // TODO: Update the object below with actual values
23
+ const example = {
24
+ "id": null,
25
+ "status": null,
26
+ "capabilities": null,
27
+ "expiresAt": null,
28
+ "approval": null,
29
+ "temporaryApiKey": null,
30
+ "deviceCode": null,
31
+ } satisfies AccountBootstrapCreated
32
+
33
+ console.log(example)
34
+
35
+ // Convert the instance to a JSON string
36
+ const exampleJSON: string = JSON.stringify(example)
37
+ console.log(exampleJSON)
38
+
39
+ // Parse the JSON string back to an object
40
+ const exampleParsed = JSON.parse(exampleJSON) as AccountBootstrapCreated
41
+ console.log(exampleParsed)
42
+ ```
43
+
44
+ [[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,38 @@
1
+
2
+ # AccountBootstrapCreatedApproval
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `method` | string
10
+ `expiresIn` | number
11
+ `interval` | number
12
+ `userCode` | string
13
+
14
+ ## Example
15
+
16
+ ```typescript
17
+ import type { AccountBootstrapCreatedApproval } from '@weftlabs/sdk'
18
+
19
+ // TODO: Update the object below with actual values
20
+ const example = {
21
+ "method": null,
22
+ "expiresIn": null,
23
+ "interval": null,
24
+ "userCode": null,
25
+ } satisfies AccountBootstrapCreatedApproval
26
+
27
+ console.log(example)
28
+
29
+ // Convert the instance to a JSON string
30
+ const exampleJSON: string = JSON.stringify(example)
31
+ console.log(exampleJSON)
32
+
33
+ // Parse the JSON string back to an object
34
+ const exampleParsed = JSON.parse(exampleJSON) as AccountBootstrapCreatedApproval
35
+ console.log(exampleParsed)
36
+ ```
37
+
38
+ [[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
+ # AccountBootstrapCreatedResponse
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `data` | [AccountBootstrapCreated](AccountBootstrapCreated.md)
10
+
11
+ ## Example
12
+
13
+ ```typescript
14
+ import type { AccountBootstrapCreatedResponse } from '@weftlabs/sdk'
15
+
16
+ // TODO: Update the object below with actual values
17
+ const example = {
18
+ "data": null,
19
+ } satisfies AccountBootstrapCreatedResponse
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 AccountBootstrapCreatedResponse
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,42 @@
1
+
2
+ # AccountBootstrapRequest
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `email` | string
10
+ `agentName` | string
11
+ `hostName` | string
12
+ `reason` | string
13
+ `oauthClientId` | string
14
+ `requestedScopes` | Set<string>
15
+
16
+ ## Example
17
+
18
+ ```typescript
19
+ import type { AccountBootstrapRequest } from '@weftlabs/sdk'
20
+
21
+ // TODO: Update the object below with actual values
22
+ const example = {
23
+ "email": null,
24
+ "agentName": null,
25
+ "hostName": null,
26
+ "reason": null,
27
+ "oauthClientId": null,
28
+ "requestedScopes": null,
29
+ } satisfies AccountBootstrapRequest
30
+
31
+ console.log(example)
32
+
33
+ // Convert the instance to a JSON string
34
+ const exampleJSON: string = JSON.stringify(example)
35
+ console.log(exampleJSON)
36
+
37
+ // Parse the JSON string back to an object
38
+ const exampleParsed = JSON.parse(exampleJSON) as AccountBootstrapRequest
39
+ console.log(exampleParsed)
40
+ ```
41
+
42
+ [[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,40 @@
1
+
2
+ # AccountBootstrapStatus
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `id` | string
10
+ `status` | string
11
+ `capabilities` | Set<string>
12
+ `expiresAt` | Date
13
+ `approval` | [AccountBootstrapApproval](AccountBootstrapApproval.md)
14
+
15
+ ## Example
16
+
17
+ ```typescript
18
+ import type { AccountBootstrapStatus } from '@weftlabs/sdk'
19
+
20
+ // TODO: Update the object below with actual values
21
+ const example = {
22
+ "id": null,
23
+ "status": null,
24
+ "capabilities": null,
25
+ "expiresAt": null,
26
+ "approval": null,
27
+ } satisfies AccountBootstrapStatus
28
+
29
+ console.log(example)
30
+
31
+ // Convert the instance to a JSON string
32
+ const exampleJSON: string = JSON.stringify(example)
33
+ console.log(exampleJSON)
34
+
35
+ // Parse the JSON string back to an object
36
+ const exampleParsed = JSON.parse(exampleJSON) as AccountBootstrapStatus
37
+ console.log(exampleParsed)
38
+ ```
39
+
40
+ [[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
+ # AccountBootstrapStatusResponse
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `data` | [AccountBootstrapStatus](AccountBootstrapStatus.md)
10
+
11
+ ## Example
12
+
13
+ ```typescript
14
+ import type { AccountBootstrapStatusResponse } from '@weftlabs/sdk'
15
+
16
+ // TODO: Update the object below with actual values
17
+ const example = {
18
+ "data": null,
19
+ } satisfies AccountBootstrapStatusResponse
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 AccountBootstrapStatusResponse
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,43 @@
1
+
2
+ # AccountDetails
3
+
4
+ The Organization that owns the authenticated API key — the principal in API v1 (the key represents an Org, not a person). `api_key` carries audit info about the key itself, including the user who minted it (`created_by`, which may be `null` if that user has left the Org).
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `principalType` | string
11
+ `id` | number
12
+ `name` | string
13
+ `slug` | string
14
+ `kind` | string
15
+ `apiKey` | [MeApiKey](MeApiKey.md)
16
+
17
+ ## Example
18
+
19
+ ```typescript
20
+ import type { AccountDetails } from '@weftlabs/sdk'
21
+
22
+ // TODO: Update the object below with actual values
23
+ const example = {
24
+ "principalType": null,
25
+ "id": null,
26
+ "name": null,
27
+ "slug": null,
28
+ "kind": null,
29
+ "apiKey": null,
30
+ } satisfies AccountDetails
31
+
32
+ console.log(example)
33
+
34
+ // Convert the instance to a JSON string
35
+ const exampleJSON: string = JSON.stringify(example)
36
+ console.log(exampleJSON)
37
+
38
+ // Parse the JSON string back to an object
39
+ const exampleParsed = JSON.parse(exampleJSON) as AccountDetails
40
+ console.log(exampleParsed)
41
+ ```
42
+
43
+ [[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,223 @@
1
+ # AgentBootstrapApi
2
+
3
+ All URIs are relative to *https://weft.network*
4
+
5
+ | Method | HTTP request | Description |
6
+ |------------- | ------------- | -------------|
7
+ | [**cancelAccountBootstrap**](AgentBootstrapApi.md#cancelaccountbootstrap) | **DELETE** /api/v1/account_bootstraps/{id} | Cancel or revoke a bootstrap credential |
8
+ | [**createAccountBootstrap**](AgentBootstrapApi.md#createaccountbootstrap) | **POST** /api/v1/account_bootstraps | Create a temporary agent bootstrap |
9
+ | [**getAccountBootstrap**](AgentBootstrapApi.md#getaccountbootstrap) | **GET** /api/v1/account_bootstraps/{id} | Read bootstrap lifecycle status |
10
+
11
+
12
+
13
+ ## cancelAccountBootstrap
14
+
15
+ > AccountBootstrapStatusResponse cancelAccountBootstrap(id)
16
+
17
+ Cancel or revoke a bootstrap credential
18
+
19
+ A pending bootstrap becomes rejected. A claimed promoted credential becomes revoked and fails every subsequent request immediately.
20
+
21
+ ### Example
22
+
23
+ ```ts
24
+ import {
25
+ Configuration,
26
+ AgentBootstrapApi,
27
+ } from '@weftlabs/sdk';
28
+ import type { CancelAccountBootstrapRequest } from '@weftlabs/sdk';
29
+
30
+ async function example() {
31
+ console.log("🚀 Testing @weftlabs/sdk SDK...");
32
+ const config = new Configuration({
33
+ // Configure HTTP bearer authorization: bootstrapAuth
34
+ accessToken: "YOUR BEARER TOKEN",
35
+ });
36
+ const api = new AgentBootstrapApi(config);
37
+
38
+ const body = {
39
+ // string
40
+ id: id_example,
41
+ } satisfies CancelAccountBootstrapRequest;
42
+
43
+ try {
44
+ const data = await api.cancelAccountBootstrap(body);
45
+ console.log(data);
46
+ } catch (error) {
47
+ console.error(error);
48
+ }
49
+ }
50
+
51
+ // Run the test
52
+ example().catch(console.error);
53
+ ```
54
+
55
+ ### Parameters
56
+
57
+
58
+ | Name | Type | Description | Notes |
59
+ |------------- | ------------- | ------------- | -------------|
60
+ | **id** | `string` | | [Defaults to `undefined`] |
61
+
62
+ ### Return type
63
+
64
+ [**AccountBootstrapStatusResponse**](AccountBootstrapStatusResponse.md)
65
+
66
+ ### Authorization
67
+
68
+ [bootstrapAuth](../README.md#bootstrapAuth)
69
+
70
+ ### HTTP request headers
71
+
72
+ - **Content-Type**: Not defined
73
+ - **Accept**: `application/json`
74
+
75
+
76
+ ### HTTP response details
77
+ | Status code | Description | Response headers |
78
+ |-------------|-------------|------------------|
79
+ | **200** | Rejected or revoked terminal lifecycle status | - |
80
+ | **401** | Unknown ID or non-matching bootstrap credential | - |
81
+
82
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
83
+
84
+
85
+ ## createAccountBootstrap
86
+
87
+ > AccountBootstrapCreatedResponse createAccountBootstrap(accountBootstrapRequest)
88
+
89
+ Create a temporary agent bootstrap
90
+
91
+ Creates a 30-minute, search-only bootstrap and emails a separate claim link to the supplied address. Human approval binds the same `wbt_*` bearer to the account and promotes it to the fixed durable capability set. The response is deliberately identical for new and existing account emails and never contains the claim token. Rate limits apply per IP and normalized email; request bodies over 4 KiB are rejected before parsing. The bootstrap row and one-time credentials are committed only after the mail relay accepts the claim email. A retryable 503 leaves no bootstrap row behind.
92
+
93
+ ### Example
94
+
95
+ ```ts
96
+ import {
97
+ Configuration,
98
+ AgentBootstrapApi,
99
+ } from '@weftlabs/sdk';
100
+ import type { CreateAccountBootstrapRequest } from '@weftlabs/sdk';
101
+
102
+ async function example() {
103
+ console.log("🚀 Testing @weftlabs/sdk SDK...");
104
+ const api = new AgentBootstrapApi();
105
+
106
+ const body = {
107
+ // AccountBootstrapRequest
108
+ accountBootstrapRequest: ...,
109
+ } satisfies CreateAccountBootstrapRequest;
110
+
111
+ try {
112
+ const data = await api.createAccountBootstrap(body);
113
+ console.log(data);
114
+ } catch (error) {
115
+ console.error(error);
116
+ }
117
+ }
118
+
119
+ // Run the test
120
+ example().catch(console.error);
121
+ ```
122
+
123
+ ### Parameters
124
+
125
+
126
+ | Name | Type | Description | Notes |
127
+ |------------- | ------------- | ------------- | -------------|
128
+ | **accountBootstrapRequest** | [AccountBootstrapRequest](AccountBootstrapRequest.md) | | |
129
+
130
+ ### Return type
131
+
132
+ [**AccountBootstrapCreatedResponse**](AccountBootstrapCreatedResponse.md)
133
+
134
+ ### Authorization
135
+
136
+ No authorization required
137
+
138
+ ### HTTP request headers
139
+
140
+ - **Content-Type**: `application/json`
141
+ - **Accept**: `application/json`
142
+
143
+
144
+ ### HTTP response details
145
+ | Status code | Description | Response headers |
146
+ |-------------|-------------|------------------|
147
+ | **201** | Bootstrap created after the claim email is accepted for delivery | - |
148
+ | **503** | Claim email delivery is temporarily unavailable; no bootstrap was created and the request may be retried | * Retry-After - Suggested delay before retrying, in seconds. <br> |
149
+ | **413** | Request body exceeds the 4 KiB limit | - |
150
+ | **422** | Invalid bootstrap context | - |
151
+ | **429** | Rate limit exceeded | - |
152
+
153
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
154
+
155
+
156
+ ## getAccountBootstrap
157
+
158
+ > AccountBootstrapStatusResponse getAccountBootstrap(id)
159
+
160
+ Read bootstrap lifecycle status
161
+
162
+ ### Example
163
+
164
+ ```ts
165
+ import {
166
+ Configuration,
167
+ AgentBootstrapApi,
168
+ } from '@weftlabs/sdk';
169
+ import type { GetAccountBootstrapRequest } from '@weftlabs/sdk';
170
+
171
+ async function example() {
172
+ console.log("🚀 Testing @weftlabs/sdk SDK...");
173
+ const config = new Configuration({
174
+ // Configure HTTP bearer authorization: bootstrapAuth
175
+ accessToken: "YOUR BEARER TOKEN",
176
+ });
177
+ const api = new AgentBootstrapApi(config);
178
+
179
+ const body = {
180
+ // string
181
+ id: id_example,
182
+ } satisfies GetAccountBootstrapRequest;
183
+
184
+ try {
185
+ const data = await api.getAccountBootstrap(body);
186
+ console.log(data);
187
+ } catch (error) {
188
+ console.error(error);
189
+ }
190
+ }
191
+
192
+ // Run the test
193
+ example().catch(console.error);
194
+ ```
195
+
196
+ ### Parameters
197
+
198
+
199
+ | Name | Type | Description | Notes |
200
+ |------------- | ------------- | ------------- | -------------|
201
+ | **id** | `string` | | [Defaults to `undefined`] |
202
+
203
+ ### Return type
204
+
205
+ [**AccountBootstrapStatusResponse**](AccountBootstrapStatusResponse.md)
206
+
207
+ ### Authorization
208
+
209
+ [bootstrapAuth](../README.md#bootstrapAuth)
210
+
211
+ ### HTTP request headers
212
+
213
+ - **Content-Type**: Not defined
214
+ - **Accept**: `application/json`
215
+
216
+
217
+ ### HTTP response details
218
+ | Status code | Description | Response headers |
219
+ |-------------|-------------|------------------|
220
+ | **200** | Current lifecycle and polling guidance while the credential can authenticate | - |
221
+ | **401** | Unknown ID or non-matching bootstrap credential | - |
222
+
223
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
package/docs/ApiKey.md ADDED
@@ -0,0 +1,42 @@
1
+
2
+ # ApiKey
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `id` | number
10
+ `name` | string
11
+ `keyPrefix` | string
12
+ `lastUsedAt` | Date
13
+ `revokedAt` | Date
14
+ `createdAt` | Date
15
+
16
+ ## Example
17
+
18
+ ```typescript
19
+ import type { ApiKey } from '@weftlabs/sdk'
20
+
21
+ // TODO: Update the object below with actual values
22
+ const example = {
23
+ "id": null,
24
+ "name": null,
25
+ "keyPrefix": null,
26
+ "lastUsedAt": null,
27
+ "revokedAt": null,
28
+ "createdAt": null,
29
+ } satisfies ApiKey
30
+
31
+ console.log(example)
32
+
33
+ // Convert the instance to a JSON string
34
+ const exampleJSON: string = JSON.stringify(example)
35
+ console.log(exampleJSON)
36
+
37
+ // Parse the JSON string back to an object
38
+ const exampleParsed = JSON.parse(exampleJSON) as ApiKey
39
+ console.log(exampleParsed)
40
+ ```
41
+
42
+ [[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,40 @@
1
+
2
+ # ApiKeyCreated
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `id` | number
10
+ `name` | string
11
+ `keyPrefix` | string
12
+ `rawKey` | string
13
+ `createdAt` | Date
14
+
15
+ ## Example
16
+
17
+ ```typescript
18
+ import type { ApiKeyCreated } from '@weftlabs/sdk'
19
+
20
+ // TODO: Update the object below with actual values
21
+ const example = {
22
+ "id": null,
23
+ "name": null,
24
+ "keyPrefix": null,
25
+ "rawKey": null,
26
+ "createdAt": null,
27
+ } satisfies ApiKeyCreated
28
+
29
+ console.log(example)
30
+
31
+ // Convert the instance to a JSON string
32
+ const exampleJSON: string = JSON.stringify(example)
33
+ console.log(exampleJSON)
34
+
35
+ // Parse the JSON string back to an object
36
+ const exampleParsed = JSON.parse(exampleJSON) as ApiKeyCreated
37
+ console.log(exampleParsed)
38
+ ```
39
+
40
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)