@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,749 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Knowledge Stack API
|
|
5
|
+
* Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.1.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
import * as runtime from '../runtime';
|
|
24
|
+
import { ActivateSkillVersionRequestToJSON, CreateSkillRequestToJSON, PaginatedResponseSkillResponseFromJSON, SearchSkillsRequestToJSON, SearchSkillsResponseFromJSON, SkillResponseFromJSON, SkillVersionResponseFromJSON, UpdateSkillRequestToJSON, } from '../models/index';
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export class SkillsApi extends runtime.BaseAPI {
|
|
29
|
+
/**
|
|
30
|
+
* Creates request options for activateSkillVersion without sending the request
|
|
31
|
+
*/
|
|
32
|
+
activateSkillVersionRequestOpts(requestParameters) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
if (requestParameters['skillId'] == null) {
|
|
35
|
+
throw new runtime.RequiredError('skillId', 'Required parameter "skillId" was null or undefined when calling activateSkillVersion().');
|
|
36
|
+
}
|
|
37
|
+
if (requestParameters['versionId'] == null) {
|
|
38
|
+
throw new runtime.RequiredError('versionId', 'Required parameter "versionId" was null or undefined when calling activateSkillVersion().');
|
|
39
|
+
}
|
|
40
|
+
if (requestParameters['activateSkillVersionRequest'] == null) {
|
|
41
|
+
throw new runtime.RequiredError('activateSkillVersionRequest', 'Required parameter "activateSkillVersionRequest" was null or undefined when calling activateSkillVersion().');
|
|
42
|
+
}
|
|
43
|
+
const queryParameters = {};
|
|
44
|
+
const headerParameters = {};
|
|
45
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
46
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
47
|
+
const token = this.configuration.accessToken;
|
|
48
|
+
const tokenString = yield token("bearerAuth", []);
|
|
49
|
+
if (tokenString) {
|
|
50
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
let urlPath = `/v1/skills/{skill_id}/versions/{version_id}/activate`;
|
|
54
|
+
urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
|
|
55
|
+
urlPath = urlPath.replace(`{${"version_id"}}`, encodeURIComponent(String(requestParameters['versionId'])));
|
|
56
|
+
return {
|
|
57
|
+
path: urlPath,
|
|
58
|
+
method: 'POST',
|
|
59
|
+
headers: headerParameters,
|
|
60
|
+
query: queryParameters,
|
|
61
|
+
body: ActivateSkillVersionRequestToJSON(requestParameters['activateSkillVersionRequest']),
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Activate a published version, restoring the working copy to it. Requires a held checkout (it overwrites the working copy).
|
|
67
|
+
* Activate Skill Version Handler
|
|
68
|
+
*/
|
|
69
|
+
activateSkillVersionRaw(requestParameters, initOverrides) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
const requestOptions = yield this.activateSkillVersionRequestOpts(requestParameters);
|
|
72
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
73
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SkillResponseFromJSON(jsonValue));
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Activate a published version, restoring the working copy to it. Requires a held checkout (it overwrites the working copy).
|
|
78
|
+
* Activate Skill Version Handler
|
|
79
|
+
*/
|
|
80
|
+
activateSkillVersion(requestParameters, initOverrides) {
|
|
81
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
const response = yield this.activateSkillVersionRaw(requestParameters, initOverrides);
|
|
83
|
+
return yield response.value();
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Creates request options for checkinSkill without sending the request
|
|
88
|
+
*/
|
|
89
|
+
checkinSkillRequestOpts(requestParameters) {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
+
if (requestParameters['skillId'] == null) {
|
|
92
|
+
throw new runtime.RequiredError('skillId', 'Required parameter "skillId" was null or undefined when calling checkinSkill().');
|
|
93
|
+
}
|
|
94
|
+
const queryParameters = {};
|
|
95
|
+
const headerParameters = {};
|
|
96
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
97
|
+
const token = this.configuration.accessToken;
|
|
98
|
+
const tokenString = yield token("bearerAuth", []);
|
|
99
|
+
if (tokenString) {
|
|
100
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
let urlPath = `/v1/skills/{skill_id}/checkin`;
|
|
104
|
+
urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
|
|
105
|
+
return {
|
|
106
|
+
path: urlPath,
|
|
107
|
+
method: 'POST',
|
|
108
|
+
headers: headerParameters,
|
|
109
|
+
query: queryParameters,
|
|
110
|
+
};
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Release the skill\'s checkout so another author can edit it.
|
|
115
|
+
* Checkin Skill Handler
|
|
116
|
+
*/
|
|
117
|
+
checkinSkillRaw(requestParameters, initOverrides) {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
const requestOptions = yield this.checkinSkillRequestOpts(requestParameters);
|
|
120
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
121
|
+
return new runtime.VoidApiResponse(response);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Release the skill\'s checkout so another author can edit it.
|
|
126
|
+
* Checkin Skill Handler
|
|
127
|
+
*/
|
|
128
|
+
checkinSkill(requestParameters, initOverrides) {
|
|
129
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
+
yield this.checkinSkillRaw(requestParameters, initOverrides);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Creates request options for checkoutSkill without sending the request
|
|
135
|
+
*/
|
|
136
|
+
checkoutSkillRequestOpts(requestParameters) {
|
|
137
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
138
|
+
if (requestParameters['skillId'] == null) {
|
|
139
|
+
throw new runtime.RequiredError('skillId', 'Required parameter "skillId" was null or undefined when calling checkoutSkill().');
|
|
140
|
+
}
|
|
141
|
+
const queryParameters = {};
|
|
142
|
+
const headerParameters = {};
|
|
143
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
144
|
+
const token = this.configuration.accessToken;
|
|
145
|
+
const tokenString = yield token("bearerAuth", []);
|
|
146
|
+
if (tokenString) {
|
|
147
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
let urlPath = `/v1/skills/{skill_id}/checkout`;
|
|
151
|
+
urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
|
|
152
|
+
return {
|
|
153
|
+
path: urlPath,
|
|
154
|
+
method: 'POST',
|
|
155
|
+
headers: headerParameters,
|
|
156
|
+
query: queryParameters,
|
|
157
|
+
};
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* 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``.
|
|
162
|
+
* Checkout Skill Handler
|
|
163
|
+
*/
|
|
164
|
+
checkoutSkillRaw(requestParameters, initOverrides) {
|
|
165
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
166
|
+
const requestOptions = yield this.checkoutSkillRequestOpts(requestParameters);
|
|
167
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
168
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SkillResponseFromJSON(jsonValue));
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* 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``.
|
|
173
|
+
* Checkout Skill Handler
|
|
174
|
+
*/
|
|
175
|
+
checkoutSkill(requestParameters, initOverrides) {
|
|
176
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
177
|
+
const response = yield this.checkoutSkillRaw(requestParameters, initOverrides);
|
|
178
|
+
return yield response.value();
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Creates request options for createSkill without sending the request
|
|
183
|
+
*/
|
|
184
|
+
createSkillRequestOpts(requestParameters) {
|
|
185
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
186
|
+
if (requestParameters['createSkillRequest'] == null) {
|
|
187
|
+
throw new runtime.RequiredError('createSkillRequest', 'Required parameter "createSkillRequest" was null or undefined when calling createSkill().');
|
|
188
|
+
}
|
|
189
|
+
const queryParameters = {};
|
|
190
|
+
const headerParameters = {};
|
|
191
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
192
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
193
|
+
const token = this.configuration.accessToken;
|
|
194
|
+
const tokenString = yield token("bearerAuth", []);
|
|
195
|
+
if (tokenString) {
|
|
196
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
let urlPath = `/v1/skills`;
|
|
200
|
+
return {
|
|
201
|
+
path: urlPath,
|
|
202
|
+
method: 'POST',
|
|
203
|
+
headers: headerParameters,
|
|
204
|
+
query: queryParameters,
|
|
205
|
+
body: CreateSkillRequestToJSON(requestParameters['createSkillRequest']),
|
|
206
|
+
};
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Author a skill (JSON) under /agents/skills; requires can_write there.
|
|
211
|
+
* Create Skill Handler
|
|
212
|
+
*/
|
|
213
|
+
createSkillRaw(requestParameters, initOverrides) {
|
|
214
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
215
|
+
const requestOptions = yield this.createSkillRequestOpts(requestParameters);
|
|
216
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
217
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SkillResponseFromJSON(jsonValue));
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Author a skill (JSON) under /agents/skills; requires can_write there.
|
|
222
|
+
* Create Skill Handler
|
|
223
|
+
*/
|
|
224
|
+
createSkill(requestParameters, initOverrides) {
|
|
225
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
226
|
+
const response = yield this.createSkillRaw(requestParameters, initOverrides);
|
|
227
|
+
return yield response.value();
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Creates request options for deleteSkill without sending the request
|
|
232
|
+
*/
|
|
233
|
+
deleteSkillRequestOpts(requestParameters) {
|
|
234
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
235
|
+
if (requestParameters['skillId'] == null) {
|
|
236
|
+
throw new runtime.RequiredError('skillId', 'Required parameter "skillId" was null or undefined when calling deleteSkill().');
|
|
237
|
+
}
|
|
238
|
+
const queryParameters = {};
|
|
239
|
+
const headerParameters = {};
|
|
240
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
241
|
+
const token = this.configuration.accessToken;
|
|
242
|
+
const tokenString = yield token("bearerAuth", []);
|
|
243
|
+
if (tokenString) {
|
|
244
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
let urlPath = `/v1/skills/{skill_id}`;
|
|
248
|
+
urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
|
|
249
|
+
return {
|
|
250
|
+
path: urlPath,
|
|
251
|
+
method: 'DELETE',
|
|
252
|
+
headers: headerParameters,
|
|
253
|
+
query: queryParameters,
|
|
254
|
+
};
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Soft-delete a skill; requires can_delete; 409 if another holds checkout.
|
|
259
|
+
* Delete Skill Handler
|
|
260
|
+
*/
|
|
261
|
+
deleteSkillRaw(requestParameters, initOverrides) {
|
|
262
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
263
|
+
const requestOptions = yield this.deleteSkillRequestOpts(requestParameters);
|
|
264
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
265
|
+
return new runtime.VoidApiResponse(response);
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Soft-delete a skill; requires can_delete; 409 if another holds checkout.
|
|
270
|
+
* Delete Skill Handler
|
|
271
|
+
*/
|
|
272
|
+
deleteSkill(requestParameters, initOverrides) {
|
|
273
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
274
|
+
yield this.deleteSkillRaw(requestParameters, initOverrides);
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Creates request options for discardSkillDraft without sending the request
|
|
279
|
+
*/
|
|
280
|
+
discardSkillDraftRequestOpts(requestParameters) {
|
|
281
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
282
|
+
if (requestParameters['skillId'] == null) {
|
|
283
|
+
throw new runtime.RequiredError('skillId', 'Required parameter "skillId" was null or undefined when calling discardSkillDraft().');
|
|
284
|
+
}
|
|
285
|
+
const queryParameters = {};
|
|
286
|
+
const headerParameters = {};
|
|
287
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
288
|
+
const token = this.configuration.accessToken;
|
|
289
|
+
const tokenString = yield token("bearerAuth", []);
|
|
290
|
+
if (tokenString) {
|
|
291
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
let urlPath = `/v1/skills/{skill_id}/discard-draft`;
|
|
295
|
+
urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
|
|
296
|
+
return {
|
|
297
|
+
path: urlPath,
|
|
298
|
+
method: 'POST',
|
|
299
|
+
headers: headerParameters,
|
|
300
|
+
query: queryParameters,
|
|
301
|
+
};
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Discard unpublished edits: restore the working copy to the active version. Requires a held checkout (it overwrites the working copy).
|
|
306
|
+
* Discard Skill Draft Handler
|
|
307
|
+
*/
|
|
308
|
+
discardSkillDraftRaw(requestParameters, initOverrides) {
|
|
309
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
310
|
+
const requestOptions = yield this.discardSkillDraftRequestOpts(requestParameters);
|
|
311
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
312
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SkillResponseFromJSON(jsonValue));
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Discard unpublished edits: restore the working copy to the active version. Requires a held checkout (it overwrites the working copy).
|
|
317
|
+
* Discard Skill Draft Handler
|
|
318
|
+
*/
|
|
319
|
+
discardSkillDraft(requestParameters, initOverrides) {
|
|
320
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
321
|
+
const response = yield this.discardSkillDraftRaw(requestParameters, initOverrides);
|
|
322
|
+
return yield response.value();
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Creates request options for exportSkill without sending the request
|
|
327
|
+
*/
|
|
328
|
+
exportSkillRequestOpts(requestParameters) {
|
|
329
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
330
|
+
if (requestParameters['skillId'] == null) {
|
|
331
|
+
throw new runtime.RequiredError('skillId', 'Required parameter "skillId" was null or undefined when calling exportSkill().');
|
|
332
|
+
}
|
|
333
|
+
const queryParameters = {};
|
|
334
|
+
const headerParameters = {};
|
|
335
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
336
|
+
const token = this.configuration.accessToken;
|
|
337
|
+
const tokenString = yield token("bearerAuth", []);
|
|
338
|
+
if (tokenString) {
|
|
339
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
let urlPath = `/v1/skills/{skill_id}/export`;
|
|
343
|
+
urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
|
|
344
|
+
return {
|
|
345
|
+
path: urlPath,
|
|
346
|
+
method: 'GET',
|
|
347
|
+
headers: headerParameters,
|
|
348
|
+
query: queryParameters,
|
|
349
|
+
};
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Download the active published version as a self-contained ZIP for sharing.
|
|
354
|
+
* Export Skill Handler
|
|
355
|
+
*/
|
|
356
|
+
exportSkillRaw(requestParameters, initOverrides) {
|
|
357
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
358
|
+
const requestOptions = yield this.exportSkillRequestOpts(requestParameters);
|
|
359
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
360
|
+
if (this.isJsonMime(response.headers.get('content-type'))) {
|
|
361
|
+
return new runtime.JSONApiResponse(response);
|
|
362
|
+
}
|
|
363
|
+
else {
|
|
364
|
+
return new runtime.TextApiResponse(response);
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Download the active published version as a self-contained ZIP for sharing.
|
|
370
|
+
* Export Skill Handler
|
|
371
|
+
*/
|
|
372
|
+
exportSkill(requestParameters, initOverrides) {
|
|
373
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
374
|
+
const response = yield this.exportSkillRaw(requestParameters, initOverrides);
|
|
375
|
+
return yield response.value();
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Creates request options for getSkill without sending the request
|
|
380
|
+
*/
|
|
381
|
+
getSkillRequestOpts(requestParameters) {
|
|
382
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
383
|
+
if (requestParameters['skillId'] == null) {
|
|
384
|
+
throw new runtime.RequiredError('skillId', 'Required parameter "skillId" was null or undefined when calling getSkill().');
|
|
385
|
+
}
|
|
386
|
+
const queryParameters = {};
|
|
387
|
+
const headerParameters = {};
|
|
388
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
389
|
+
const token = this.configuration.accessToken;
|
|
390
|
+
const tokenString = yield token("bearerAuth", []);
|
|
391
|
+
if (tokenString) {
|
|
392
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
let urlPath = `/v1/skills/{skill_id}`;
|
|
396
|
+
urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
|
|
397
|
+
return {
|
|
398
|
+
path: urlPath,
|
|
399
|
+
method: 'GET',
|
|
400
|
+
headers: headerParameters,
|
|
401
|
+
query: queryParameters,
|
|
402
|
+
};
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Skill detail: SKILL.md, scripts, has_unpublished_changes, permissions.
|
|
407
|
+
* Get Skill Handler
|
|
408
|
+
*/
|
|
409
|
+
getSkillRaw(requestParameters, initOverrides) {
|
|
410
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
411
|
+
const requestOptions = yield this.getSkillRequestOpts(requestParameters);
|
|
412
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
413
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SkillResponseFromJSON(jsonValue));
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Skill detail: SKILL.md, scripts, has_unpublished_changes, permissions.
|
|
418
|
+
* Get Skill Handler
|
|
419
|
+
*/
|
|
420
|
+
getSkill(requestParameters, initOverrides) {
|
|
421
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
422
|
+
const response = yield this.getSkillRaw(requestParameters, initOverrides);
|
|
423
|
+
return yield response.value();
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Creates request options for importSkill without sending the request
|
|
428
|
+
*/
|
|
429
|
+
importSkillRequestOpts(requestParameters) {
|
|
430
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
431
|
+
if (requestParameters['file'] == null) {
|
|
432
|
+
throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling importSkill().');
|
|
433
|
+
}
|
|
434
|
+
const queryParameters = {};
|
|
435
|
+
const headerParameters = {};
|
|
436
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
437
|
+
const token = this.configuration.accessToken;
|
|
438
|
+
const tokenString = yield token("bearerAuth", []);
|
|
439
|
+
if (tokenString) {
|
|
440
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
const consumes = [
|
|
444
|
+
{ contentType: 'multipart/form-data' },
|
|
445
|
+
];
|
|
446
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
447
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
448
|
+
let formParams;
|
|
449
|
+
let useForm = false;
|
|
450
|
+
// use FormData to transmit files using content-type "multipart/form-data"
|
|
451
|
+
useForm = canConsumeForm;
|
|
452
|
+
if (useForm) {
|
|
453
|
+
formParams = new FormData();
|
|
454
|
+
}
|
|
455
|
+
else {
|
|
456
|
+
formParams = new URLSearchParams();
|
|
457
|
+
}
|
|
458
|
+
if (requestParameters['file'] != null) {
|
|
459
|
+
formParams.append('file', requestParameters['file']);
|
|
460
|
+
}
|
|
461
|
+
let urlPath = `/v1/skills/import`;
|
|
462
|
+
return {
|
|
463
|
+
path: urlPath,
|
|
464
|
+
method: 'POST',
|
|
465
|
+
headers: headerParameters,
|
|
466
|
+
query: queryParameters,
|
|
467
|
+
body: formParams,
|
|
468
|
+
};
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Create a skill by importing a redistributable ZIP (works across tenants).
|
|
473
|
+
* Import Skill Handler
|
|
474
|
+
*/
|
|
475
|
+
importSkillRaw(requestParameters, initOverrides) {
|
|
476
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
477
|
+
const requestOptions = yield this.importSkillRequestOpts(requestParameters);
|
|
478
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
479
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SkillResponseFromJSON(jsonValue));
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Create a skill by importing a redistributable ZIP (works across tenants).
|
|
484
|
+
* Import Skill Handler
|
|
485
|
+
*/
|
|
486
|
+
importSkill(requestParameters, initOverrides) {
|
|
487
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
488
|
+
const response = yield this.importSkillRaw(requestParameters, initOverrides);
|
|
489
|
+
return yield response.value();
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* Creates request options for listSkillVersions without sending the request
|
|
494
|
+
*/
|
|
495
|
+
listSkillVersionsRequestOpts(requestParameters) {
|
|
496
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
497
|
+
if (requestParameters['skillId'] == null) {
|
|
498
|
+
throw new runtime.RequiredError('skillId', 'Required parameter "skillId" was null or undefined when calling listSkillVersions().');
|
|
499
|
+
}
|
|
500
|
+
const queryParameters = {};
|
|
501
|
+
const headerParameters = {};
|
|
502
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
503
|
+
const token = this.configuration.accessToken;
|
|
504
|
+
const tokenString = yield token("bearerAuth", []);
|
|
505
|
+
if (tokenString) {
|
|
506
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
let urlPath = `/v1/skills/{skill_id}/versions`;
|
|
510
|
+
urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
|
|
511
|
+
return {
|
|
512
|
+
path: urlPath,
|
|
513
|
+
method: 'GET',
|
|
514
|
+
headers: headerParameters,
|
|
515
|
+
query: queryParameters,
|
|
516
|
+
};
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* List a skill\'s published versions, newest first.
|
|
521
|
+
* List Skill Versions Handler
|
|
522
|
+
*/
|
|
523
|
+
listSkillVersionsRaw(requestParameters, initOverrides) {
|
|
524
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
525
|
+
const requestOptions = yield this.listSkillVersionsRequestOpts(requestParameters);
|
|
526
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
527
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(SkillVersionResponseFromJSON));
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* List a skill\'s published versions, newest first.
|
|
532
|
+
* List Skill Versions Handler
|
|
533
|
+
*/
|
|
534
|
+
listSkillVersions(requestParameters, initOverrides) {
|
|
535
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
536
|
+
const response = yield this.listSkillVersionsRaw(requestParameters, initOverrides);
|
|
537
|
+
return yield response.value();
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Creates request options for listSkills without sending the request
|
|
542
|
+
*/
|
|
543
|
+
listSkillsRequestOpts(requestParameters) {
|
|
544
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
545
|
+
const queryParameters = {};
|
|
546
|
+
if (requestParameters['sortBy'] != null) {
|
|
547
|
+
queryParameters['sort_by'] = requestParameters['sortBy'];
|
|
548
|
+
}
|
|
549
|
+
if (requestParameters['search'] != null) {
|
|
550
|
+
queryParameters['search'] = requestParameters['search'];
|
|
551
|
+
}
|
|
552
|
+
if (requestParameters['limit'] != null) {
|
|
553
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
554
|
+
}
|
|
555
|
+
if (requestParameters['offset'] != null) {
|
|
556
|
+
queryParameters['offset'] = requestParameters['offset'];
|
|
557
|
+
}
|
|
558
|
+
if (requestParameters['sortDir'] != null) {
|
|
559
|
+
queryParameters['sort_dir'] = requestParameters['sortDir'];
|
|
560
|
+
}
|
|
561
|
+
const headerParameters = {};
|
|
562
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
563
|
+
const token = this.configuration.accessToken;
|
|
564
|
+
const tokenString = yield token("bearerAuth", []);
|
|
565
|
+
if (tokenString) {
|
|
566
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
let urlPath = `/v1/skills`;
|
|
570
|
+
return {
|
|
571
|
+
path: urlPath,
|
|
572
|
+
method: 'GET',
|
|
573
|
+
headers: headerParameters,
|
|
574
|
+
query: queryParameters,
|
|
575
|
+
};
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* List readable skills: paginated, sortable both ways, name-searchable.
|
|
580
|
+
* List Skills Handler
|
|
581
|
+
*/
|
|
582
|
+
listSkillsRaw(requestParameters, initOverrides) {
|
|
583
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
584
|
+
const requestOptions = yield this.listSkillsRequestOpts(requestParameters);
|
|
585
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
586
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedResponseSkillResponseFromJSON(jsonValue));
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* List readable skills: paginated, sortable both ways, name-searchable.
|
|
591
|
+
* List Skills Handler
|
|
592
|
+
*/
|
|
593
|
+
listSkills() {
|
|
594
|
+
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
|
|
595
|
+
const response = yield this.listSkillsRaw(requestParameters, initOverrides);
|
|
596
|
+
return yield response.value();
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* Creates request options for publishSkillVersion without sending the request
|
|
601
|
+
*/
|
|
602
|
+
publishSkillVersionRequestOpts(requestParameters) {
|
|
603
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
604
|
+
if (requestParameters['skillId'] == null) {
|
|
605
|
+
throw new runtime.RequiredError('skillId', 'Required parameter "skillId" was null or undefined when calling publishSkillVersion().');
|
|
606
|
+
}
|
|
607
|
+
const queryParameters = {};
|
|
608
|
+
const headerParameters = {};
|
|
609
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
610
|
+
const token = this.configuration.accessToken;
|
|
611
|
+
const tokenString = yield token("bearerAuth", []);
|
|
612
|
+
if (tokenString) {
|
|
613
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
let urlPath = `/v1/skills/{skill_id}/versions`;
|
|
617
|
+
urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
|
|
618
|
+
return {
|
|
619
|
+
path: urlPath,
|
|
620
|
+
method: 'POST',
|
|
621
|
+
headers: headerParameters,
|
|
622
|
+
query: queryParameters,
|
|
623
|
+
};
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* 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.
|
|
628
|
+
* Publish Skill Version Handler
|
|
629
|
+
*/
|
|
630
|
+
publishSkillVersionRaw(requestParameters, initOverrides) {
|
|
631
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
632
|
+
const requestOptions = yield this.publishSkillVersionRequestOpts(requestParameters);
|
|
633
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
634
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SkillResponseFromJSON(jsonValue));
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
/**
|
|
638
|
+
* 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.
|
|
639
|
+
* Publish Skill Version Handler
|
|
640
|
+
*/
|
|
641
|
+
publishSkillVersion(requestParameters, initOverrides) {
|
|
642
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
643
|
+
const response = yield this.publishSkillVersionRaw(requestParameters, initOverrides);
|
|
644
|
+
return yield response.value();
|
|
645
|
+
});
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* Creates request options for searchSkills without sending the request
|
|
649
|
+
*/
|
|
650
|
+
searchSkillsRequestOpts(requestParameters) {
|
|
651
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
652
|
+
if (requestParameters['searchSkillsRequest'] == null) {
|
|
653
|
+
throw new runtime.RequiredError('searchSkillsRequest', 'Required parameter "searchSkillsRequest" was null or undefined when calling searchSkills().');
|
|
654
|
+
}
|
|
655
|
+
const queryParameters = {};
|
|
656
|
+
const headerParameters = {};
|
|
657
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
658
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
659
|
+
const token = this.configuration.accessToken;
|
|
660
|
+
const tokenString = yield token("bearerAuth", []);
|
|
661
|
+
if (tokenString) {
|
|
662
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
let urlPath = `/v1/skills/search`;
|
|
666
|
+
return {
|
|
667
|
+
path: urlPath,
|
|
668
|
+
method: 'POST',
|
|
669
|
+
headers: headerParameters,
|
|
670
|
+
query: queryParameters,
|
|
671
|
+
body: SearchSkillsRequestToJSON(requestParameters['searchSkillsRequest']),
|
|
672
|
+
};
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* 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.
|
|
677
|
+
* Search Skills Handler
|
|
678
|
+
*/
|
|
679
|
+
searchSkillsRaw(requestParameters, initOverrides) {
|
|
680
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
681
|
+
const requestOptions = yield this.searchSkillsRequestOpts(requestParameters);
|
|
682
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
683
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SearchSkillsResponseFromJSON(jsonValue));
|
|
684
|
+
});
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* 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.
|
|
688
|
+
* Search Skills Handler
|
|
689
|
+
*/
|
|
690
|
+
searchSkills(requestParameters, initOverrides) {
|
|
691
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
692
|
+
const response = yield this.searchSkillsRaw(requestParameters, initOverrides);
|
|
693
|
+
return yield response.value();
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
/**
|
|
697
|
+
* Creates request options for updateSkill without sending the request
|
|
698
|
+
*/
|
|
699
|
+
updateSkillRequestOpts(requestParameters) {
|
|
700
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
701
|
+
if (requestParameters['skillId'] == null) {
|
|
702
|
+
throw new runtime.RequiredError('skillId', 'Required parameter "skillId" was null or undefined when calling updateSkill().');
|
|
703
|
+
}
|
|
704
|
+
if (requestParameters['updateSkillRequest'] == null) {
|
|
705
|
+
throw new runtime.RequiredError('updateSkillRequest', 'Required parameter "updateSkillRequest" was null or undefined when calling updateSkill().');
|
|
706
|
+
}
|
|
707
|
+
const queryParameters = {};
|
|
708
|
+
const headerParameters = {};
|
|
709
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
710
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
711
|
+
const token = this.configuration.accessToken;
|
|
712
|
+
const tokenString = yield token("bearerAuth", []);
|
|
713
|
+
if (tokenString) {
|
|
714
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
let urlPath = `/v1/skills/{skill_id}`;
|
|
718
|
+
urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
|
|
719
|
+
return {
|
|
720
|
+
path: urlPath,
|
|
721
|
+
method: 'PATCH',
|
|
722
|
+
headers: headerParameters,
|
|
723
|
+
query: queryParameters,
|
|
724
|
+
body: UpdateSkillRequestToJSON(requestParameters['updateSkillRequest']),
|
|
725
|
+
};
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
/**
|
|
729
|
+
* Edit the working copy in place; requires can_write + a held checkout.
|
|
730
|
+
* Update Skill Handler
|
|
731
|
+
*/
|
|
732
|
+
updateSkillRaw(requestParameters, initOverrides) {
|
|
733
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
734
|
+
const requestOptions = yield this.updateSkillRequestOpts(requestParameters);
|
|
735
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
736
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SkillResponseFromJSON(jsonValue));
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
/**
|
|
740
|
+
* Edit the working copy in place; requires can_write + a held checkout.
|
|
741
|
+
* Update Skill Handler
|
|
742
|
+
*/
|
|
743
|
+
updateSkill(requestParameters, initOverrides) {
|
|
744
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
745
|
+
const response = yield this.updateSkillRaw(requestParameters, initOverrides);
|
|
746
|
+
return yield response.value();
|
|
747
|
+
});
|
|
748
|
+
}
|
|
749
|
+
}
|