@knowledge-stack/ksapi 1.135.1 → 1.136.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.
- package/.openapi-generator/FILES +28 -4
- package/README.md +29 -4
- package/dist/apis/FoldersApi.d.ts +9 -9
- package/dist/apis/FoldersApi.js +2 -2
- package/dist/apis/SkillsApi.d.ts +579 -0
- package/dist/apis/SkillsApi.js +786 -0
- package/dist/apis/WorkflowDefinitionsApi.d.ts +3 -0
- package/dist/apis/WorkflowDefinitionsApi.js +3 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/esm/apis/FoldersApi.d.ts +9 -9
- package/dist/esm/apis/FoldersApi.js +3 -3
- package/dist/esm/apis/SkillsApi.d.ts +579 -0
- package/dist/esm/apis/SkillsApi.js +749 -0
- package/dist/esm/apis/WorkflowDefinitionsApi.d.ts +3 -0
- package/dist/esm/apis/WorkflowDefinitionsApi.js +3 -0
- package/dist/esm/apis/index.d.ts +1 -0
- package/dist/esm/apis/index.js +1 -0
- package/dist/esm/models/ActivateSkillVersionRequest.d.ts +47 -0
- package/dist/esm/models/ActivateSkillVersionRequest.js +42 -0
- package/dist/esm/models/CreateSkillRequest.d.ts +60 -0
- package/dist/esm/models/CreateSkillRequest.js +59 -0
- package/dist/esm/models/CreateWorkflowDefinitionRequest.d.ts +6 -0
- package/dist/esm/models/CreateWorkflowDefinitionRequest.js +6 -0
- package/dist/esm/models/{FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaResponseOrDataSourceTableResponseOrApiConnectionResponse.d.ts → FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.d.ts} +9 -6
- package/dist/esm/models/{FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaResponseOrDataSourceTableResponseOrApiConnectionResponse.js → FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.js} +11 -6
- package/dist/esm/models/{PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDataSourceResponseDataSourceSchemaResponseDataSourceTableResponseApiConnectionResponseDiscriminator.d.ts → PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat.d.ts} +16 -16
- package/dist/esm/models/{PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDataSourceResponseDataSourceSchemaResponseDataSourceTableResponseApiConnectionResponseDiscriminator.js → PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat.js} +12 -12
- package/dist/esm/models/PaginatedResponseSkillResponse.d.ts +66 -0
- package/dist/esm/models/PaginatedResponseSkillResponse.js +70 -0
- package/dist/esm/models/PartType.d.ts +1 -0
- package/dist/esm/models/PartType.js +2 -1
- package/dist/esm/models/ReferenceType.d.ts +1 -0
- package/dist/esm/models/ReferenceType.js +1 -0
- package/dist/esm/models/SearchSkillsRequest.d.ts +59 -0
- package/dist/esm/models/SearchSkillsRequest.js +64 -0
- package/dist/esm/models/SearchSkillsResponse.d.ts +48 -0
- package/dist/esm/models/SearchSkillsResponse.js +43 -0
- package/dist/esm/models/SkillOrder.d.ts +26 -0
- package/dist/esm/models/SkillOrder.js +44 -0
- package/dist/esm/models/SkillResponse.d.ts +147 -0
- package/dist/esm/models/SkillResponse.js +101 -0
- package/dist/esm/models/SkillScriptFile.d.ts +53 -0
- package/dist/esm/models/SkillScriptFile.js +52 -0
- package/dist/esm/models/SkillSearchResult.d.ts +71 -0
- package/dist/esm/models/SkillSearchResult.js +60 -0
- package/dist/esm/models/SkillVersionResponse.d.ts +71 -0
- package/dist/esm/models/SkillVersionResponse.js +58 -0
- package/dist/esm/models/UpdateSkillRequest.d.ts +54 -0
- package/dist/esm/models/UpdateSkillRequest.js +50 -0
- package/dist/esm/models/UpdateWorkflowDefinitionRequest.d.ts +6 -0
- package/dist/esm/models/UpdateWorkflowDefinitionRequest.js +6 -0
- package/dist/esm/models/WorkflowDefinitionResponse.d.ts +6 -0
- package/dist/esm/models/WorkflowDefinitionResponse.js +2 -0
- package/dist/esm/models/WorkflowRunSnapshot.d.ts +6 -0
- package/dist/esm/models/WorkflowRunSnapshot.js +2 -0
- package/dist/esm/models/index.d.ts +13 -2
- package/dist/esm/models/index.js +13 -2
- package/dist/models/ActivateSkillVersionRequest.d.ts +47 -0
- package/dist/models/ActivateSkillVersionRequest.js +50 -0
- package/dist/models/CreateSkillRequest.d.ts +60 -0
- package/dist/models/CreateSkillRequest.js +67 -0
- package/dist/models/CreateWorkflowDefinitionRequest.d.ts +6 -0
- package/dist/models/CreateWorkflowDefinitionRequest.js +6 -0
- package/dist/models/{FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaResponseOrDataSourceTableResponseOrApiConnectionResponse.d.ts → FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.d.ts} +9 -6
- package/dist/models/{FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaResponseOrDataSourceTableResponseOrApiConnectionResponse.js → FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.js} +15 -10
- package/dist/models/{PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDataSourceResponseDataSourceSchemaResponseDataSourceTableResponseApiConnectionResponseDiscriminator.d.ts → PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat.d.ts} +16 -16
- package/dist/models/{PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDataSourceResponseDataSourceSchemaResponseDataSourceTableResponseApiConnectionResponseDiscriminator.js → PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat.js} +18 -18
- package/dist/models/PaginatedResponseSkillResponse.d.ts +66 -0
- package/dist/models/PaginatedResponseSkillResponse.js +78 -0
- package/dist/models/PartType.d.ts +1 -0
- package/dist/models/PartType.js +2 -1
- package/dist/models/ReferenceType.d.ts +1 -0
- package/dist/models/ReferenceType.js +1 -0
- package/dist/models/SearchSkillsRequest.d.ts +59 -0
- package/dist/models/SearchSkillsRequest.js +72 -0
- package/dist/models/SearchSkillsResponse.d.ts +48 -0
- package/dist/models/SearchSkillsResponse.js +51 -0
- package/dist/models/SkillOrder.d.ts +26 -0
- package/dist/models/SkillOrder.js +52 -0
- package/dist/models/SkillResponse.d.ts +147 -0
- package/dist/models/SkillResponse.js +109 -0
- package/dist/models/SkillScriptFile.d.ts +53 -0
- package/dist/models/SkillScriptFile.js +60 -0
- package/dist/models/SkillSearchResult.d.ts +71 -0
- package/dist/models/SkillSearchResult.js +68 -0
- package/dist/models/SkillVersionResponse.d.ts +71 -0
- package/dist/models/SkillVersionResponse.js +66 -0
- package/dist/models/UpdateSkillRequest.d.ts +54 -0
- package/dist/models/UpdateSkillRequest.js +58 -0
- package/dist/models/UpdateWorkflowDefinitionRequest.d.ts +6 -0
- package/dist/models/UpdateWorkflowDefinitionRequest.js +6 -0
- package/dist/models/WorkflowDefinitionResponse.d.ts +6 -0
- package/dist/models/WorkflowDefinitionResponse.js +2 -0
- package/dist/models/WorkflowRunSnapshot.d.ts +6 -0
- package/dist/models/WorkflowRunSnapshot.js +2 -0
- package/dist/models/index.d.ts +13 -2
- package/dist/models/index.js +13 -2
- package/docs/ActivateSkillVersionRequest.md +35 -0
- package/docs/ChunksApi.md +1 -1
- package/docs/CreateSkillRequest.md +39 -0
- package/docs/CreateWorkflowDefinitionRequest.md +2 -0
- package/docs/{FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaResponseOrDataSourceTableResponseOrApiConnectionResponse.md → FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.md} +12 -4
- package/docs/FoldersApi.md +4 -4
- package/docs/{PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDataSourceResponseDataSourceSchemaResponseDataSourceTableResponseApiConnectionResponseDiscriminator.md → PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat.md} +5 -5
- package/docs/PaginatedResponseSkillResponse.md +40 -0
- package/docs/SearchSkillsRequest.md +39 -0
- package/docs/SearchSkillsResponse.md +34 -0
- package/docs/SkillOrder.md +33 -0
- package/docs/SkillResponse.md +65 -0
- package/docs/SkillScriptFile.md +37 -0
- package/docs/SkillSearchResult.md +43 -0
- package/docs/SkillVersionResponse.md +43 -0
- package/docs/SkillsApi.md +1093 -0
- package/docs/UpdateSkillRequest.md +37 -0
- package/docs/UpdateWorkflowDefinitionRequest.md +2 -0
- package/docs/WorkflowDefinitionResponse.md +2 -0
- package/docs/WorkflowDefinitionsApi.md +4 -1
- package/docs/WorkflowRunSnapshot.md +2 -0
- package/package.json +1 -1
- package/src/apis/FoldersApi.ts +13 -13
- package/src/apis/SkillsApi.ts +1321 -0
- package/src/apis/WorkflowDefinitionsApi.ts +7 -0
- package/src/apis/index.ts +1 -0
- package/src/models/ActivateSkillVersionRequest.ts +82 -0
- package/src/models/CreateSkillRequest.ts +115 -0
- package/src/models/CreateWorkflowDefinitionRequest.ts +12 -0
- package/src/models/{FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaResponseOrDataSourceTableResponseOrApiConnectionResponse.ts → FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.ts} +19 -8
- package/src/models/{PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDataSourceResponseDataSourceSchemaResponseDataSourceTableResponseApiConnectionResponseDiscriminator.ts → PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat.ts} +25 -25
- package/src/models/PaginatedResponseSkillResponse.ts +130 -0
- package/src/models/PartType.ts +2 -1
- package/src/models/ReferenceType.ts +1 -0
- package/src/models/SearchSkillsRequest.ts +114 -0
- package/src/models/SearchSkillsResponse.ts +90 -0
- package/src/models/SkillOrder.ts +54 -0
- package/src/models/SkillResponse.ts +244 -0
- package/src/models/SkillScriptFile.ts +95 -0
- package/src/models/SkillSearchResult.ts +119 -0
- package/src/models/SkillVersionResponse.ts +118 -0
- package/src/models/UpdateSkillRequest.ts +102 -0
- package/src/models/UpdateWorkflowDefinitionRequest.ts +12 -0
- package/src/models/WorkflowDefinitionResponse.ts +8 -0
- package/src/models/WorkflowRunSnapshot.ts +8 -0
- package/src/models/index.ts +13 -2
|
@@ -0,0 +1,1093 @@
|
|
|
1
|
+
# SkillsApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *http://localhost:8000*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
| [**activateSkillVersion**](SkillsApi.md#activateskillversionoperation) | **POST** /v1/skills/{skill_id}/versions/{version_id}/activate | Activate Skill Version Handler |
|
|
8
|
+
| [**checkinSkill**](SkillsApi.md#checkinskill) | **POST** /v1/skills/{skill_id}/checkin | Checkin Skill Handler |
|
|
9
|
+
| [**checkoutSkill**](SkillsApi.md#checkoutskill) | **POST** /v1/skills/{skill_id}/checkout | Checkout Skill Handler |
|
|
10
|
+
| [**createSkill**](SkillsApi.md#createskilloperation) | **POST** /v1/skills | Create Skill Handler |
|
|
11
|
+
| [**deleteSkill**](SkillsApi.md#deleteskill) | **DELETE** /v1/skills/{skill_id} | Delete Skill Handler |
|
|
12
|
+
| [**discardSkillDraft**](SkillsApi.md#discardskilldraft) | **POST** /v1/skills/{skill_id}/discard-draft | Discard Skill Draft Handler |
|
|
13
|
+
| [**exportSkill**](SkillsApi.md#exportskill) | **GET** /v1/skills/{skill_id}/export | Export Skill Handler |
|
|
14
|
+
| [**getSkill**](SkillsApi.md#getskill) | **GET** /v1/skills/{skill_id} | Get Skill Handler |
|
|
15
|
+
| [**importSkill**](SkillsApi.md#importskill) | **POST** /v1/skills/import | Import Skill Handler |
|
|
16
|
+
| [**listSkillVersions**](SkillsApi.md#listskillversions) | **GET** /v1/skills/{skill_id}/versions | List Skill Versions Handler |
|
|
17
|
+
| [**listSkills**](SkillsApi.md#listskills) | **GET** /v1/skills | List Skills Handler |
|
|
18
|
+
| [**publishSkillVersion**](SkillsApi.md#publishskillversion) | **POST** /v1/skills/{skill_id}/versions | Publish Skill Version Handler |
|
|
19
|
+
| [**searchSkills**](SkillsApi.md#searchskillsoperation) | **POST** /v1/skills/search | Search Skills Handler |
|
|
20
|
+
| [**updateSkill**](SkillsApi.md#updateskilloperation) | **PATCH** /v1/skills/{skill_id} | Update Skill Handler |
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## activateSkillVersion
|
|
25
|
+
|
|
26
|
+
> SkillResponse activateSkillVersion(skillId, versionId, activateSkillVersionRequest)
|
|
27
|
+
|
|
28
|
+
Activate Skill Version Handler
|
|
29
|
+
|
|
30
|
+
Activate a published version, restoring the working copy to it. Requires a held checkout (it overwrites the working copy).
|
|
31
|
+
|
|
32
|
+
### Example
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import {
|
|
36
|
+
Configuration,
|
|
37
|
+
SkillsApi,
|
|
38
|
+
} from '@knowledge-stack/ksapi';
|
|
39
|
+
import type { ActivateSkillVersionOperationRequest } from '@knowledge-stack/ksapi';
|
|
40
|
+
|
|
41
|
+
async function example() {
|
|
42
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
43
|
+
const config = new Configuration({
|
|
44
|
+
// To configure API key authorization: cookieAuth
|
|
45
|
+
apiKey: "YOUR API KEY",
|
|
46
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
47
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
48
|
+
});
|
|
49
|
+
const api = new SkillsApi(config);
|
|
50
|
+
|
|
51
|
+
const body = {
|
|
52
|
+
// string
|
|
53
|
+
skillId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
54
|
+
// string
|
|
55
|
+
versionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
56
|
+
// ActivateSkillVersionRequest
|
|
57
|
+
activateSkillVersionRequest: ...,
|
|
58
|
+
} satisfies ActivateSkillVersionOperationRequest;
|
|
59
|
+
|
|
60
|
+
try {
|
|
61
|
+
const data = await api.activateSkillVersion(body);
|
|
62
|
+
console.log(data);
|
|
63
|
+
} catch (error) {
|
|
64
|
+
console.error(error);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Run the test
|
|
69
|
+
example().catch(console.error);
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Parameters
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
| Name | Type | Description | Notes |
|
|
76
|
+
|------------- | ------------- | ------------- | -------------|
|
|
77
|
+
| **skillId** | `string` | | [Defaults to `undefined`] |
|
|
78
|
+
| **versionId** | `string` | | [Defaults to `undefined`] |
|
|
79
|
+
| **activateSkillVersionRequest** | [ActivateSkillVersionRequest](ActivateSkillVersionRequest.md) | | |
|
|
80
|
+
|
|
81
|
+
### Return type
|
|
82
|
+
|
|
83
|
+
[**SkillResponse**](SkillResponse.md)
|
|
84
|
+
|
|
85
|
+
### Authorization
|
|
86
|
+
|
|
87
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
88
|
+
|
|
89
|
+
### HTTP request headers
|
|
90
|
+
|
|
91
|
+
- **Content-Type**: `application/json`
|
|
92
|
+
- **Accept**: `application/json`
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
### HTTP response details
|
|
96
|
+
| Status code | Description | Response headers |
|
|
97
|
+
|-------------|-------------|------------------|
|
|
98
|
+
| **200** | Successful Response | - |
|
|
99
|
+
| **422** | Validation Error | - |
|
|
100
|
+
| **0** | Error response. | - |
|
|
101
|
+
|
|
102
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
## checkinSkill
|
|
106
|
+
|
|
107
|
+
> checkinSkill(skillId)
|
|
108
|
+
|
|
109
|
+
Checkin Skill Handler
|
|
110
|
+
|
|
111
|
+
Release the skill\'s checkout so another author can edit it.
|
|
112
|
+
|
|
113
|
+
### Example
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
import {
|
|
117
|
+
Configuration,
|
|
118
|
+
SkillsApi,
|
|
119
|
+
} from '@knowledge-stack/ksapi';
|
|
120
|
+
import type { CheckinSkillRequest } from '@knowledge-stack/ksapi';
|
|
121
|
+
|
|
122
|
+
async function example() {
|
|
123
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
124
|
+
const config = new Configuration({
|
|
125
|
+
// To configure API key authorization: cookieAuth
|
|
126
|
+
apiKey: "YOUR API KEY",
|
|
127
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
128
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
129
|
+
});
|
|
130
|
+
const api = new SkillsApi(config);
|
|
131
|
+
|
|
132
|
+
const body = {
|
|
133
|
+
// string
|
|
134
|
+
skillId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
135
|
+
} satisfies CheckinSkillRequest;
|
|
136
|
+
|
|
137
|
+
try {
|
|
138
|
+
const data = await api.checkinSkill(body);
|
|
139
|
+
console.log(data);
|
|
140
|
+
} catch (error) {
|
|
141
|
+
console.error(error);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Run the test
|
|
146
|
+
example().catch(console.error);
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Parameters
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
| Name | Type | Description | Notes |
|
|
153
|
+
|------------- | ------------- | ------------- | -------------|
|
|
154
|
+
| **skillId** | `string` | | [Defaults to `undefined`] |
|
|
155
|
+
|
|
156
|
+
### Return type
|
|
157
|
+
|
|
158
|
+
`void` (Empty response body)
|
|
159
|
+
|
|
160
|
+
### Authorization
|
|
161
|
+
|
|
162
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
163
|
+
|
|
164
|
+
### HTTP request headers
|
|
165
|
+
|
|
166
|
+
- **Content-Type**: Not defined
|
|
167
|
+
- **Accept**: `application/json`
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
### HTTP response details
|
|
171
|
+
| Status code | Description | Response headers |
|
|
172
|
+
|-------------|-------------|------------------|
|
|
173
|
+
| **204** | Successful Response | - |
|
|
174
|
+
| **422** | Validation Error | - |
|
|
175
|
+
| **0** | Error response. | - |
|
|
176
|
+
|
|
177
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
## checkoutSkill
|
|
181
|
+
|
|
182
|
+
> SkillResponse checkoutSkill(skillId)
|
|
183
|
+
|
|
184
|
+
Checkout Skill Handler
|
|
185
|
+
|
|
186
|
+
Check out the whole skill for editing (409 if another user holds it). Locks the skill via its ``SKILL.md`` document; hold it to edit any file (``SKILL.md`` or scripts) and release it with ``checkin``.
|
|
187
|
+
|
|
188
|
+
### Example
|
|
189
|
+
|
|
190
|
+
```ts
|
|
191
|
+
import {
|
|
192
|
+
Configuration,
|
|
193
|
+
SkillsApi,
|
|
194
|
+
} from '@knowledge-stack/ksapi';
|
|
195
|
+
import type { CheckoutSkillRequest } from '@knowledge-stack/ksapi';
|
|
196
|
+
|
|
197
|
+
async function example() {
|
|
198
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
199
|
+
const config = new Configuration({
|
|
200
|
+
// To configure API key authorization: cookieAuth
|
|
201
|
+
apiKey: "YOUR API KEY",
|
|
202
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
203
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
204
|
+
});
|
|
205
|
+
const api = new SkillsApi(config);
|
|
206
|
+
|
|
207
|
+
const body = {
|
|
208
|
+
// string
|
|
209
|
+
skillId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
210
|
+
} satisfies CheckoutSkillRequest;
|
|
211
|
+
|
|
212
|
+
try {
|
|
213
|
+
const data = await api.checkoutSkill(body);
|
|
214
|
+
console.log(data);
|
|
215
|
+
} catch (error) {
|
|
216
|
+
console.error(error);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// Run the test
|
|
221
|
+
example().catch(console.error);
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Parameters
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
| Name | Type | Description | Notes |
|
|
228
|
+
|------------- | ------------- | ------------- | -------------|
|
|
229
|
+
| **skillId** | `string` | | [Defaults to `undefined`] |
|
|
230
|
+
|
|
231
|
+
### Return type
|
|
232
|
+
|
|
233
|
+
[**SkillResponse**](SkillResponse.md)
|
|
234
|
+
|
|
235
|
+
### Authorization
|
|
236
|
+
|
|
237
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
238
|
+
|
|
239
|
+
### HTTP request headers
|
|
240
|
+
|
|
241
|
+
- **Content-Type**: Not defined
|
|
242
|
+
- **Accept**: `application/json`
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
### HTTP response details
|
|
246
|
+
| Status code | Description | Response headers |
|
|
247
|
+
|-------------|-------------|------------------|
|
|
248
|
+
| **200** | Successful Response | - |
|
|
249
|
+
| **422** | Validation Error | - |
|
|
250
|
+
| **0** | Error response. | - |
|
|
251
|
+
|
|
252
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
## createSkill
|
|
256
|
+
|
|
257
|
+
> SkillResponse createSkill(createSkillRequest)
|
|
258
|
+
|
|
259
|
+
Create Skill Handler
|
|
260
|
+
|
|
261
|
+
Author a skill (JSON) under /agents/skills; requires can_write there.
|
|
262
|
+
|
|
263
|
+
### Example
|
|
264
|
+
|
|
265
|
+
```ts
|
|
266
|
+
import {
|
|
267
|
+
Configuration,
|
|
268
|
+
SkillsApi,
|
|
269
|
+
} from '@knowledge-stack/ksapi';
|
|
270
|
+
import type { CreateSkillOperationRequest } from '@knowledge-stack/ksapi';
|
|
271
|
+
|
|
272
|
+
async function example() {
|
|
273
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
274
|
+
const config = new Configuration({
|
|
275
|
+
// To configure API key authorization: cookieAuth
|
|
276
|
+
apiKey: "YOUR API KEY",
|
|
277
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
278
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
279
|
+
});
|
|
280
|
+
const api = new SkillsApi(config);
|
|
281
|
+
|
|
282
|
+
const body = {
|
|
283
|
+
// CreateSkillRequest
|
|
284
|
+
createSkillRequest: ...,
|
|
285
|
+
} satisfies CreateSkillOperationRequest;
|
|
286
|
+
|
|
287
|
+
try {
|
|
288
|
+
const data = await api.createSkill(body);
|
|
289
|
+
console.log(data);
|
|
290
|
+
} catch (error) {
|
|
291
|
+
console.error(error);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// Run the test
|
|
296
|
+
example().catch(console.error);
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### Parameters
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
| Name | Type | Description | Notes |
|
|
303
|
+
|------------- | ------------- | ------------- | -------------|
|
|
304
|
+
| **createSkillRequest** | [CreateSkillRequest](CreateSkillRequest.md) | | |
|
|
305
|
+
|
|
306
|
+
### Return type
|
|
307
|
+
|
|
308
|
+
[**SkillResponse**](SkillResponse.md)
|
|
309
|
+
|
|
310
|
+
### Authorization
|
|
311
|
+
|
|
312
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
313
|
+
|
|
314
|
+
### HTTP request headers
|
|
315
|
+
|
|
316
|
+
- **Content-Type**: `application/json`
|
|
317
|
+
- **Accept**: `application/json`
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
### HTTP response details
|
|
321
|
+
| Status code | Description | Response headers |
|
|
322
|
+
|-------------|-------------|------------------|
|
|
323
|
+
| **201** | Successful Response | - |
|
|
324
|
+
| **422** | Validation Error | - |
|
|
325
|
+
| **0** | Error response. | - |
|
|
326
|
+
|
|
327
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
## deleteSkill
|
|
331
|
+
|
|
332
|
+
> deleteSkill(skillId)
|
|
333
|
+
|
|
334
|
+
Delete Skill Handler
|
|
335
|
+
|
|
336
|
+
Soft-delete a skill; requires can_delete; 409 if another holds checkout.
|
|
337
|
+
|
|
338
|
+
### Example
|
|
339
|
+
|
|
340
|
+
```ts
|
|
341
|
+
import {
|
|
342
|
+
Configuration,
|
|
343
|
+
SkillsApi,
|
|
344
|
+
} from '@knowledge-stack/ksapi';
|
|
345
|
+
import type { DeleteSkillRequest } from '@knowledge-stack/ksapi';
|
|
346
|
+
|
|
347
|
+
async function example() {
|
|
348
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
349
|
+
const config = new Configuration({
|
|
350
|
+
// To configure API key authorization: cookieAuth
|
|
351
|
+
apiKey: "YOUR API KEY",
|
|
352
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
353
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
354
|
+
});
|
|
355
|
+
const api = new SkillsApi(config);
|
|
356
|
+
|
|
357
|
+
const body = {
|
|
358
|
+
// string
|
|
359
|
+
skillId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
360
|
+
} satisfies DeleteSkillRequest;
|
|
361
|
+
|
|
362
|
+
try {
|
|
363
|
+
const data = await api.deleteSkill(body);
|
|
364
|
+
console.log(data);
|
|
365
|
+
} catch (error) {
|
|
366
|
+
console.error(error);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
// Run the test
|
|
371
|
+
example().catch(console.error);
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
### Parameters
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
| Name | Type | Description | Notes |
|
|
378
|
+
|------------- | ------------- | ------------- | -------------|
|
|
379
|
+
| **skillId** | `string` | | [Defaults to `undefined`] |
|
|
380
|
+
|
|
381
|
+
### Return type
|
|
382
|
+
|
|
383
|
+
`void` (Empty response body)
|
|
384
|
+
|
|
385
|
+
### Authorization
|
|
386
|
+
|
|
387
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
388
|
+
|
|
389
|
+
### HTTP request headers
|
|
390
|
+
|
|
391
|
+
- **Content-Type**: Not defined
|
|
392
|
+
- **Accept**: `application/json`
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
### HTTP response details
|
|
396
|
+
| Status code | Description | Response headers |
|
|
397
|
+
|-------------|-------------|------------------|
|
|
398
|
+
| **204** | Successful Response | - |
|
|
399
|
+
| **422** | Validation Error | - |
|
|
400
|
+
| **0** | Error response. | - |
|
|
401
|
+
|
|
402
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
## discardSkillDraft
|
|
406
|
+
|
|
407
|
+
> SkillResponse discardSkillDraft(skillId)
|
|
408
|
+
|
|
409
|
+
Discard Skill Draft Handler
|
|
410
|
+
|
|
411
|
+
Discard unpublished edits: restore the working copy to the active version. Requires a held checkout (it overwrites the working copy).
|
|
412
|
+
|
|
413
|
+
### Example
|
|
414
|
+
|
|
415
|
+
```ts
|
|
416
|
+
import {
|
|
417
|
+
Configuration,
|
|
418
|
+
SkillsApi,
|
|
419
|
+
} from '@knowledge-stack/ksapi';
|
|
420
|
+
import type { DiscardSkillDraftRequest } from '@knowledge-stack/ksapi';
|
|
421
|
+
|
|
422
|
+
async function example() {
|
|
423
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
424
|
+
const config = new Configuration({
|
|
425
|
+
// To configure API key authorization: cookieAuth
|
|
426
|
+
apiKey: "YOUR API KEY",
|
|
427
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
428
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
429
|
+
});
|
|
430
|
+
const api = new SkillsApi(config);
|
|
431
|
+
|
|
432
|
+
const body = {
|
|
433
|
+
// string
|
|
434
|
+
skillId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
435
|
+
} satisfies DiscardSkillDraftRequest;
|
|
436
|
+
|
|
437
|
+
try {
|
|
438
|
+
const data = await api.discardSkillDraft(body);
|
|
439
|
+
console.log(data);
|
|
440
|
+
} catch (error) {
|
|
441
|
+
console.error(error);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
// Run the test
|
|
446
|
+
example().catch(console.error);
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
### Parameters
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
| Name | Type | Description | Notes |
|
|
453
|
+
|------------- | ------------- | ------------- | -------------|
|
|
454
|
+
| **skillId** | `string` | | [Defaults to `undefined`] |
|
|
455
|
+
|
|
456
|
+
### Return type
|
|
457
|
+
|
|
458
|
+
[**SkillResponse**](SkillResponse.md)
|
|
459
|
+
|
|
460
|
+
### Authorization
|
|
461
|
+
|
|
462
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
463
|
+
|
|
464
|
+
### HTTP request headers
|
|
465
|
+
|
|
466
|
+
- **Content-Type**: Not defined
|
|
467
|
+
- **Accept**: `application/json`
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
### HTTP response details
|
|
471
|
+
| Status code | Description | Response headers |
|
|
472
|
+
|-------------|-------------|------------------|
|
|
473
|
+
| **200** | Successful Response | - |
|
|
474
|
+
| **422** | Validation Error | - |
|
|
475
|
+
| **0** | Error response. | - |
|
|
476
|
+
|
|
477
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
## exportSkill
|
|
481
|
+
|
|
482
|
+
> any exportSkill(skillId)
|
|
483
|
+
|
|
484
|
+
Export Skill Handler
|
|
485
|
+
|
|
486
|
+
Download the active published version as a self-contained ZIP for sharing.
|
|
487
|
+
|
|
488
|
+
### Example
|
|
489
|
+
|
|
490
|
+
```ts
|
|
491
|
+
import {
|
|
492
|
+
Configuration,
|
|
493
|
+
SkillsApi,
|
|
494
|
+
} from '@knowledge-stack/ksapi';
|
|
495
|
+
import type { ExportSkillRequest } from '@knowledge-stack/ksapi';
|
|
496
|
+
|
|
497
|
+
async function example() {
|
|
498
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
499
|
+
const config = new Configuration({
|
|
500
|
+
// To configure API key authorization: cookieAuth
|
|
501
|
+
apiKey: "YOUR API KEY",
|
|
502
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
503
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
504
|
+
});
|
|
505
|
+
const api = new SkillsApi(config);
|
|
506
|
+
|
|
507
|
+
const body = {
|
|
508
|
+
// string
|
|
509
|
+
skillId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
510
|
+
} satisfies ExportSkillRequest;
|
|
511
|
+
|
|
512
|
+
try {
|
|
513
|
+
const data = await api.exportSkill(body);
|
|
514
|
+
console.log(data);
|
|
515
|
+
} catch (error) {
|
|
516
|
+
console.error(error);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
// Run the test
|
|
521
|
+
example().catch(console.error);
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
### Parameters
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
| Name | Type | Description | Notes |
|
|
528
|
+
|------------- | ------------- | ------------- | -------------|
|
|
529
|
+
| **skillId** | `string` | | [Defaults to `undefined`] |
|
|
530
|
+
|
|
531
|
+
### Return type
|
|
532
|
+
|
|
533
|
+
**any**
|
|
534
|
+
|
|
535
|
+
### Authorization
|
|
536
|
+
|
|
537
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
538
|
+
|
|
539
|
+
### HTTP request headers
|
|
540
|
+
|
|
541
|
+
- **Content-Type**: Not defined
|
|
542
|
+
- **Accept**: `application/json`
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
### HTTP response details
|
|
546
|
+
| Status code | Description | Response headers |
|
|
547
|
+
|-------------|-------------|------------------|
|
|
548
|
+
| **200** | Successful Response | - |
|
|
549
|
+
| **422** | Validation Error | - |
|
|
550
|
+
| **0** | Error response. | - |
|
|
551
|
+
|
|
552
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
## getSkill
|
|
556
|
+
|
|
557
|
+
> SkillResponse getSkill(skillId)
|
|
558
|
+
|
|
559
|
+
Get Skill Handler
|
|
560
|
+
|
|
561
|
+
Skill detail: SKILL.md, scripts, has_unpublished_changes, permissions.
|
|
562
|
+
|
|
563
|
+
### Example
|
|
564
|
+
|
|
565
|
+
```ts
|
|
566
|
+
import {
|
|
567
|
+
Configuration,
|
|
568
|
+
SkillsApi,
|
|
569
|
+
} from '@knowledge-stack/ksapi';
|
|
570
|
+
import type { GetSkillRequest } from '@knowledge-stack/ksapi';
|
|
571
|
+
|
|
572
|
+
async function example() {
|
|
573
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
574
|
+
const config = new Configuration({
|
|
575
|
+
// To configure API key authorization: cookieAuth
|
|
576
|
+
apiKey: "YOUR API KEY",
|
|
577
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
578
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
579
|
+
});
|
|
580
|
+
const api = new SkillsApi(config);
|
|
581
|
+
|
|
582
|
+
const body = {
|
|
583
|
+
// string
|
|
584
|
+
skillId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
585
|
+
} satisfies GetSkillRequest;
|
|
586
|
+
|
|
587
|
+
try {
|
|
588
|
+
const data = await api.getSkill(body);
|
|
589
|
+
console.log(data);
|
|
590
|
+
} catch (error) {
|
|
591
|
+
console.error(error);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
// Run the test
|
|
596
|
+
example().catch(console.error);
|
|
597
|
+
```
|
|
598
|
+
|
|
599
|
+
### Parameters
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
| Name | Type | Description | Notes |
|
|
603
|
+
|------------- | ------------- | ------------- | -------------|
|
|
604
|
+
| **skillId** | `string` | | [Defaults to `undefined`] |
|
|
605
|
+
|
|
606
|
+
### Return type
|
|
607
|
+
|
|
608
|
+
[**SkillResponse**](SkillResponse.md)
|
|
609
|
+
|
|
610
|
+
### Authorization
|
|
611
|
+
|
|
612
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
613
|
+
|
|
614
|
+
### HTTP request headers
|
|
615
|
+
|
|
616
|
+
- **Content-Type**: Not defined
|
|
617
|
+
- **Accept**: `application/json`
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
### HTTP response details
|
|
621
|
+
| Status code | Description | Response headers |
|
|
622
|
+
|-------------|-------------|------------------|
|
|
623
|
+
| **200** | Successful Response | - |
|
|
624
|
+
| **422** | Validation Error | - |
|
|
625
|
+
| **0** | Error response. | - |
|
|
626
|
+
|
|
627
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
## importSkill
|
|
631
|
+
|
|
632
|
+
> SkillResponse importSkill(file)
|
|
633
|
+
|
|
634
|
+
Import Skill Handler
|
|
635
|
+
|
|
636
|
+
Create a skill by importing a redistributable ZIP (works across tenants).
|
|
637
|
+
|
|
638
|
+
### Example
|
|
639
|
+
|
|
640
|
+
```ts
|
|
641
|
+
import {
|
|
642
|
+
Configuration,
|
|
643
|
+
SkillsApi,
|
|
644
|
+
} from '@knowledge-stack/ksapi';
|
|
645
|
+
import type { ImportSkillRequest } from '@knowledge-stack/ksapi';
|
|
646
|
+
|
|
647
|
+
async function example() {
|
|
648
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
649
|
+
const config = new Configuration({
|
|
650
|
+
// To configure API key authorization: cookieAuth
|
|
651
|
+
apiKey: "YOUR API KEY",
|
|
652
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
653
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
654
|
+
});
|
|
655
|
+
const api = new SkillsApi(config);
|
|
656
|
+
|
|
657
|
+
const body = {
|
|
658
|
+
// Blob
|
|
659
|
+
file: BINARY_DATA_HERE,
|
|
660
|
+
} satisfies ImportSkillRequest;
|
|
661
|
+
|
|
662
|
+
try {
|
|
663
|
+
const data = await api.importSkill(body);
|
|
664
|
+
console.log(data);
|
|
665
|
+
} catch (error) {
|
|
666
|
+
console.error(error);
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
// Run the test
|
|
671
|
+
example().catch(console.error);
|
|
672
|
+
```
|
|
673
|
+
|
|
674
|
+
### Parameters
|
|
675
|
+
|
|
676
|
+
|
|
677
|
+
| Name | Type | Description | Notes |
|
|
678
|
+
|------------- | ------------- | ------------- | -------------|
|
|
679
|
+
| **file** | `Blob` | | [Defaults to `undefined`] |
|
|
680
|
+
|
|
681
|
+
### Return type
|
|
682
|
+
|
|
683
|
+
[**SkillResponse**](SkillResponse.md)
|
|
684
|
+
|
|
685
|
+
### Authorization
|
|
686
|
+
|
|
687
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
688
|
+
|
|
689
|
+
### HTTP request headers
|
|
690
|
+
|
|
691
|
+
- **Content-Type**: `multipart/form-data`
|
|
692
|
+
- **Accept**: `application/json`
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
### HTTP response details
|
|
696
|
+
| Status code | Description | Response headers |
|
|
697
|
+
|-------------|-------------|------------------|
|
|
698
|
+
| **201** | Successful Response | - |
|
|
699
|
+
| **422** | Validation Error | - |
|
|
700
|
+
| **0** | Error response. | - |
|
|
701
|
+
|
|
702
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
703
|
+
|
|
704
|
+
|
|
705
|
+
## listSkillVersions
|
|
706
|
+
|
|
707
|
+
> Array<SkillVersionResponse> listSkillVersions(skillId)
|
|
708
|
+
|
|
709
|
+
List Skill Versions Handler
|
|
710
|
+
|
|
711
|
+
List a skill\'s published versions, newest first.
|
|
712
|
+
|
|
713
|
+
### Example
|
|
714
|
+
|
|
715
|
+
```ts
|
|
716
|
+
import {
|
|
717
|
+
Configuration,
|
|
718
|
+
SkillsApi,
|
|
719
|
+
} from '@knowledge-stack/ksapi';
|
|
720
|
+
import type { ListSkillVersionsRequest } from '@knowledge-stack/ksapi';
|
|
721
|
+
|
|
722
|
+
async function example() {
|
|
723
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
724
|
+
const config = new Configuration({
|
|
725
|
+
// To configure API key authorization: cookieAuth
|
|
726
|
+
apiKey: "YOUR API KEY",
|
|
727
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
728
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
729
|
+
});
|
|
730
|
+
const api = new SkillsApi(config);
|
|
731
|
+
|
|
732
|
+
const body = {
|
|
733
|
+
// string
|
|
734
|
+
skillId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
735
|
+
} satisfies ListSkillVersionsRequest;
|
|
736
|
+
|
|
737
|
+
try {
|
|
738
|
+
const data = await api.listSkillVersions(body);
|
|
739
|
+
console.log(data);
|
|
740
|
+
} catch (error) {
|
|
741
|
+
console.error(error);
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
// Run the test
|
|
746
|
+
example().catch(console.error);
|
|
747
|
+
```
|
|
748
|
+
|
|
749
|
+
### Parameters
|
|
750
|
+
|
|
751
|
+
|
|
752
|
+
| Name | Type | Description | Notes |
|
|
753
|
+
|------------- | ------------- | ------------- | -------------|
|
|
754
|
+
| **skillId** | `string` | | [Defaults to `undefined`] |
|
|
755
|
+
|
|
756
|
+
### Return type
|
|
757
|
+
|
|
758
|
+
[**Array<SkillVersionResponse>**](SkillVersionResponse.md)
|
|
759
|
+
|
|
760
|
+
### Authorization
|
|
761
|
+
|
|
762
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
763
|
+
|
|
764
|
+
### HTTP request headers
|
|
765
|
+
|
|
766
|
+
- **Content-Type**: Not defined
|
|
767
|
+
- **Accept**: `application/json`
|
|
768
|
+
|
|
769
|
+
|
|
770
|
+
### HTTP response details
|
|
771
|
+
| Status code | Description | Response headers |
|
|
772
|
+
|-------------|-------------|------------------|
|
|
773
|
+
| **200** | Successful Response | - |
|
|
774
|
+
| **422** | Validation Error | - |
|
|
775
|
+
| **0** | Error response. | - |
|
|
776
|
+
|
|
777
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
## listSkills
|
|
781
|
+
|
|
782
|
+
> PaginatedResponseSkillResponse listSkills(sortBy, search, limit, offset, sortDir)
|
|
783
|
+
|
|
784
|
+
List Skills Handler
|
|
785
|
+
|
|
786
|
+
List readable skills: paginated, sortable both ways, name-searchable.
|
|
787
|
+
|
|
788
|
+
### Example
|
|
789
|
+
|
|
790
|
+
```ts
|
|
791
|
+
import {
|
|
792
|
+
Configuration,
|
|
793
|
+
SkillsApi,
|
|
794
|
+
} from '@knowledge-stack/ksapi';
|
|
795
|
+
import type { ListSkillsRequest } from '@knowledge-stack/ksapi';
|
|
796
|
+
|
|
797
|
+
async function example() {
|
|
798
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
799
|
+
const config = new Configuration({
|
|
800
|
+
// To configure API key authorization: cookieAuth
|
|
801
|
+
apiKey: "YOUR API KEY",
|
|
802
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
803
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
804
|
+
});
|
|
805
|
+
const api = new SkillsApi(config);
|
|
806
|
+
|
|
807
|
+
const body = {
|
|
808
|
+
// SkillOrder | Field to sort skills by (default: CREATED_AT) (optional)
|
|
809
|
+
sortBy: ...,
|
|
810
|
+
// string | Case-insensitive skill-name substring filter (search bar) (optional)
|
|
811
|
+
search: search_example,
|
|
812
|
+
// number | Number of items per page (optional)
|
|
813
|
+
limit: 56,
|
|
814
|
+
// number | Number of items to skip (optional)
|
|
815
|
+
offset: 56,
|
|
816
|
+
// SortDirection | Sort direction (ASC or DESC); overrides the field\'s natural default. Every sort field supports both directions. (optional)
|
|
817
|
+
sortDir: ...,
|
|
818
|
+
} satisfies ListSkillsRequest;
|
|
819
|
+
|
|
820
|
+
try {
|
|
821
|
+
const data = await api.listSkills(body);
|
|
822
|
+
console.log(data);
|
|
823
|
+
} catch (error) {
|
|
824
|
+
console.error(error);
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
// Run the test
|
|
829
|
+
example().catch(console.error);
|
|
830
|
+
```
|
|
831
|
+
|
|
832
|
+
### Parameters
|
|
833
|
+
|
|
834
|
+
|
|
835
|
+
| Name | Type | Description | Notes |
|
|
836
|
+
|------------- | ------------- | ------------- | -------------|
|
|
837
|
+
| **sortBy** | `SkillOrder` | Field to sort skills by (default: CREATED_AT) | [Optional] [Defaults to `undefined`] [Enum: NAME, CREATED_AT, UPDATED_AT] |
|
|
838
|
+
| **search** | `string` | Case-insensitive skill-name substring filter (search bar) | [Optional] [Defaults to `undefined`] |
|
|
839
|
+
| **limit** | `number` | Number of items per page | [Optional] [Defaults to `20`] |
|
|
840
|
+
| **offset** | `number` | Number of items to skip | [Optional] [Defaults to `0`] |
|
|
841
|
+
| **sortDir** | `SortDirection` | Sort direction (ASC or DESC); overrides the field\'s natural default. Every sort field supports both directions. | [Optional] [Defaults to `undefined`] [Enum: ASC, DESC] |
|
|
842
|
+
|
|
843
|
+
### Return type
|
|
844
|
+
|
|
845
|
+
[**PaginatedResponseSkillResponse**](PaginatedResponseSkillResponse.md)
|
|
846
|
+
|
|
847
|
+
### Authorization
|
|
848
|
+
|
|
849
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
850
|
+
|
|
851
|
+
### HTTP request headers
|
|
852
|
+
|
|
853
|
+
- **Content-Type**: Not defined
|
|
854
|
+
- **Accept**: `application/json`
|
|
855
|
+
|
|
856
|
+
|
|
857
|
+
### HTTP response details
|
|
858
|
+
| Status code | Description | Response headers |
|
|
859
|
+
|-------------|-------------|------------------|
|
|
860
|
+
| **200** | Successful Response | - |
|
|
861
|
+
| **422** | Validation Error | - |
|
|
862
|
+
| **0** | Error response. | - |
|
|
863
|
+
|
|
864
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
865
|
+
|
|
866
|
+
|
|
867
|
+
## publishSkillVersion
|
|
868
|
+
|
|
869
|
+
> SkillResponse publishSkillVersion(skillId)
|
|
870
|
+
|
|
871
|
+
Publish Skill Version Handler
|
|
872
|
+
|
|
873
|
+
Snapshot the working copy into a new immutable version and activate it. Requires a held checkout on the skill (publishing mutates it), so a second author cannot push a version over the checkout holder\'s in-progress draft.
|
|
874
|
+
|
|
875
|
+
### Example
|
|
876
|
+
|
|
877
|
+
```ts
|
|
878
|
+
import {
|
|
879
|
+
Configuration,
|
|
880
|
+
SkillsApi,
|
|
881
|
+
} from '@knowledge-stack/ksapi';
|
|
882
|
+
import type { PublishSkillVersionRequest } from '@knowledge-stack/ksapi';
|
|
883
|
+
|
|
884
|
+
async function example() {
|
|
885
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
886
|
+
const config = new Configuration({
|
|
887
|
+
// To configure API key authorization: cookieAuth
|
|
888
|
+
apiKey: "YOUR API KEY",
|
|
889
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
890
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
891
|
+
});
|
|
892
|
+
const api = new SkillsApi(config);
|
|
893
|
+
|
|
894
|
+
const body = {
|
|
895
|
+
// string
|
|
896
|
+
skillId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
897
|
+
} satisfies PublishSkillVersionRequest;
|
|
898
|
+
|
|
899
|
+
try {
|
|
900
|
+
const data = await api.publishSkillVersion(body);
|
|
901
|
+
console.log(data);
|
|
902
|
+
} catch (error) {
|
|
903
|
+
console.error(error);
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
// Run the test
|
|
908
|
+
example().catch(console.error);
|
|
909
|
+
```
|
|
910
|
+
|
|
911
|
+
### Parameters
|
|
912
|
+
|
|
913
|
+
|
|
914
|
+
| Name | Type | Description | Notes |
|
|
915
|
+
|------------- | ------------- | ------------- | -------------|
|
|
916
|
+
| **skillId** | `string` | | [Defaults to `undefined`] |
|
|
917
|
+
|
|
918
|
+
### Return type
|
|
919
|
+
|
|
920
|
+
[**SkillResponse**](SkillResponse.md)
|
|
921
|
+
|
|
922
|
+
### Authorization
|
|
923
|
+
|
|
924
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
925
|
+
|
|
926
|
+
### HTTP request headers
|
|
927
|
+
|
|
928
|
+
- **Content-Type**: Not defined
|
|
929
|
+
- **Accept**: `application/json`
|
|
930
|
+
|
|
931
|
+
|
|
932
|
+
### HTTP response details
|
|
933
|
+
| Status code | Description | Response headers |
|
|
934
|
+
|-------------|-------------|------------------|
|
|
935
|
+
| **201** | Successful Response | - |
|
|
936
|
+
| **422** | Validation Error | - |
|
|
937
|
+
| **0** | Error response. | - |
|
|
938
|
+
|
|
939
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
940
|
+
|
|
941
|
+
|
|
942
|
+
## searchSkills
|
|
943
|
+
|
|
944
|
+
> SearchSkillsResponse searchSkills(searchSkillsRequest)
|
|
945
|
+
|
|
946
|
+
Search Skills Handler
|
|
947
|
+
|
|
948
|
+
Find skills by the meaning of their routing card (agent discovery). Dense semantic search over each skill\'s ``name + description`` card, scoped to the tenant. Fail-closed: hits are re-loaded tenant-scoped from Postgres (the authority — a mis-scoped Qdrant hit can\'t leak another tenant\'s skill) and any the caller cannot read are dropped.
|
|
949
|
+
|
|
950
|
+
### Example
|
|
951
|
+
|
|
952
|
+
```ts
|
|
953
|
+
import {
|
|
954
|
+
Configuration,
|
|
955
|
+
SkillsApi,
|
|
956
|
+
} from '@knowledge-stack/ksapi';
|
|
957
|
+
import type { SearchSkillsOperationRequest } from '@knowledge-stack/ksapi';
|
|
958
|
+
|
|
959
|
+
async function example() {
|
|
960
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
961
|
+
const config = new Configuration({
|
|
962
|
+
// To configure API key authorization: cookieAuth
|
|
963
|
+
apiKey: "YOUR API KEY",
|
|
964
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
965
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
966
|
+
});
|
|
967
|
+
const api = new SkillsApi(config);
|
|
968
|
+
|
|
969
|
+
const body = {
|
|
970
|
+
// SearchSkillsRequest
|
|
971
|
+
searchSkillsRequest: ...,
|
|
972
|
+
} satisfies SearchSkillsOperationRequest;
|
|
973
|
+
|
|
974
|
+
try {
|
|
975
|
+
const data = await api.searchSkills(body);
|
|
976
|
+
console.log(data);
|
|
977
|
+
} catch (error) {
|
|
978
|
+
console.error(error);
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
// Run the test
|
|
983
|
+
example().catch(console.error);
|
|
984
|
+
```
|
|
985
|
+
|
|
986
|
+
### Parameters
|
|
987
|
+
|
|
988
|
+
|
|
989
|
+
| Name | Type | Description | Notes |
|
|
990
|
+
|------------- | ------------- | ------------- | -------------|
|
|
991
|
+
| **searchSkillsRequest** | [SearchSkillsRequest](SearchSkillsRequest.md) | | |
|
|
992
|
+
|
|
993
|
+
### Return type
|
|
994
|
+
|
|
995
|
+
[**SearchSkillsResponse**](SearchSkillsResponse.md)
|
|
996
|
+
|
|
997
|
+
### Authorization
|
|
998
|
+
|
|
999
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
1000
|
+
|
|
1001
|
+
### HTTP request headers
|
|
1002
|
+
|
|
1003
|
+
- **Content-Type**: `application/json`
|
|
1004
|
+
- **Accept**: `application/json`
|
|
1005
|
+
|
|
1006
|
+
|
|
1007
|
+
### HTTP response details
|
|
1008
|
+
| Status code | Description | Response headers |
|
|
1009
|
+
|-------------|-------------|------------------|
|
|
1010
|
+
| **200** | Successful Response | - |
|
|
1011
|
+
| **422** | Validation Error | - |
|
|
1012
|
+
| **0** | Error response. | - |
|
|
1013
|
+
|
|
1014
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
1015
|
+
|
|
1016
|
+
|
|
1017
|
+
## updateSkill
|
|
1018
|
+
|
|
1019
|
+
> SkillResponse updateSkill(skillId, updateSkillRequest)
|
|
1020
|
+
|
|
1021
|
+
Update Skill Handler
|
|
1022
|
+
|
|
1023
|
+
Edit the working copy in place; requires can_write + a held checkout.
|
|
1024
|
+
|
|
1025
|
+
### Example
|
|
1026
|
+
|
|
1027
|
+
```ts
|
|
1028
|
+
import {
|
|
1029
|
+
Configuration,
|
|
1030
|
+
SkillsApi,
|
|
1031
|
+
} from '@knowledge-stack/ksapi';
|
|
1032
|
+
import type { UpdateSkillOperationRequest } from '@knowledge-stack/ksapi';
|
|
1033
|
+
|
|
1034
|
+
async function example() {
|
|
1035
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
1036
|
+
const config = new Configuration({
|
|
1037
|
+
// To configure API key authorization: cookieAuth
|
|
1038
|
+
apiKey: "YOUR API KEY",
|
|
1039
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
1040
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
1041
|
+
});
|
|
1042
|
+
const api = new SkillsApi(config);
|
|
1043
|
+
|
|
1044
|
+
const body = {
|
|
1045
|
+
// string
|
|
1046
|
+
skillId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
1047
|
+
// UpdateSkillRequest
|
|
1048
|
+
updateSkillRequest: ...,
|
|
1049
|
+
} satisfies UpdateSkillOperationRequest;
|
|
1050
|
+
|
|
1051
|
+
try {
|
|
1052
|
+
const data = await api.updateSkill(body);
|
|
1053
|
+
console.log(data);
|
|
1054
|
+
} catch (error) {
|
|
1055
|
+
console.error(error);
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
// Run the test
|
|
1060
|
+
example().catch(console.error);
|
|
1061
|
+
```
|
|
1062
|
+
|
|
1063
|
+
### Parameters
|
|
1064
|
+
|
|
1065
|
+
|
|
1066
|
+
| Name | Type | Description | Notes |
|
|
1067
|
+
|------------- | ------------- | ------------- | -------------|
|
|
1068
|
+
| **skillId** | `string` | | [Defaults to `undefined`] |
|
|
1069
|
+
| **updateSkillRequest** | [UpdateSkillRequest](UpdateSkillRequest.md) | | |
|
|
1070
|
+
|
|
1071
|
+
### Return type
|
|
1072
|
+
|
|
1073
|
+
[**SkillResponse**](SkillResponse.md)
|
|
1074
|
+
|
|
1075
|
+
### Authorization
|
|
1076
|
+
|
|
1077
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
1078
|
+
|
|
1079
|
+
### HTTP request headers
|
|
1080
|
+
|
|
1081
|
+
- **Content-Type**: `application/json`
|
|
1082
|
+
- **Accept**: `application/json`
|
|
1083
|
+
|
|
1084
|
+
|
|
1085
|
+
### HTTP response details
|
|
1086
|
+
| Status code | Description | Response headers |
|
|
1087
|
+
|-------------|-------------|------------------|
|
|
1088
|
+
| **200** | Successful Response | - |
|
|
1089
|
+
| **422** | Validation Error | - |
|
|
1090
|
+
| **0** | Error response. | - |
|
|
1091
|
+
|
|
1092
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
1093
|
+
|