@knowledge-stack/ksapi 1.135.0 → 1.136.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/.openapi-generator/FILES +28 -4
  2. package/README.md +29 -4
  3. package/dist/apis/FoldersApi.d.ts +9 -9
  4. package/dist/apis/FoldersApi.js +2 -2
  5. package/dist/apis/SkillsApi.d.ts +579 -0
  6. package/dist/apis/SkillsApi.js +786 -0
  7. package/dist/apis/WorkflowDefinitionsApi.d.ts +3 -0
  8. package/dist/apis/WorkflowDefinitionsApi.js +3 -0
  9. package/dist/apis/index.d.ts +1 -0
  10. package/dist/apis/index.js +1 -0
  11. package/dist/esm/apis/FoldersApi.d.ts +9 -9
  12. package/dist/esm/apis/FoldersApi.js +3 -3
  13. package/dist/esm/apis/SkillsApi.d.ts +579 -0
  14. package/dist/esm/apis/SkillsApi.js +749 -0
  15. package/dist/esm/apis/WorkflowDefinitionsApi.d.ts +3 -0
  16. package/dist/esm/apis/WorkflowDefinitionsApi.js +3 -0
  17. package/dist/esm/apis/index.d.ts +1 -0
  18. package/dist/esm/apis/index.js +1 -0
  19. package/dist/esm/models/ActivateSkillVersionRequest.d.ts +47 -0
  20. package/dist/esm/models/ActivateSkillVersionRequest.js +42 -0
  21. package/dist/esm/models/CreateSkillRequest.d.ts +60 -0
  22. package/dist/esm/models/CreateSkillRequest.js +59 -0
  23. package/dist/esm/models/CreateWorkflowDefinitionRequest.d.ts +6 -0
  24. package/dist/esm/models/CreateWorkflowDefinitionRequest.js +6 -0
  25. package/dist/esm/models/{FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaResponseOrDataSourceTableResponseOrApiConnectionResponse.d.ts → FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.d.ts} +9 -6
  26. package/dist/esm/models/{FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaResponseOrDataSourceTableResponseOrApiConnectionResponse.js → FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.js} +11 -6
  27. package/dist/esm/models/{PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDataSourceResponseDataSourceSchemaResponseDataSourceTableResponseApiConnectionResponseDiscriminator.d.ts → PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat.d.ts} +16 -16
  28. package/dist/esm/models/{PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDataSourceResponseDataSourceSchemaResponseDataSourceTableResponseApiConnectionResponseDiscriminator.js → PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat.js} +12 -12
  29. package/dist/esm/models/PaginatedResponseSkillResponse.d.ts +66 -0
  30. package/dist/esm/models/PaginatedResponseSkillResponse.js +70 -0
  31. package/dist/esm/models/PartType.d.ts +1 -0
  32. package/dist/esm/models/PartType.js +2 -1
  33. package/dist/esm/models/ReferenceType.d.ts +1 -0
  34. package/dist/esm/models/ReferenceType.js +1 -0
  35. package/dist/esm/models/SearchSkillsRequest.d.ts +59 -0
  36. package/dist/esm/models/SearchSkillsRequest.js +64 -0
  37. package/dist/esm/models/SearchSkillsResponse.d.ts +48 -0
  38. package/dist/esm/models/SearchSkillsResponse.js +43 -0
  39. package/dist/esm/models/SkillOrder.d.ts +26 -0
  40. package/dist/esm/models/SkillOrder.js +44 -0
  41. package/dist/esm/models/SkillResponse.d.ts +147 -0
  42. package/dist/esm/models/SkillResponse.js +101 -0
  43. package/dist/esm/models/SkillScriptFile.d.ts +53 -0
  44. package/dist/esm/models/SkillScriptFile.js +52 -0
  45. package/dist/esm/models/SkillSearchResult.d.ts +71 -0
  46. package/dist/esm/models/SkillSearchResult.js +60 -0
  47. package/dist/esm/models/SkillVersionResponse.d.ts +71 -0
  48. package/dist/esm/models/SkillVersionResponse.js +58 -0
  49. package/dist/esm/models/UpdateSkillRequest.d.ts +54 -0
  50. package/dist/esm/models/UpdateSkillRequest.js +50 -0
  51. package/dist/esm/models/UpdateWorkflowDefinitionRequest.d.ts +6 -0
  52. package/dist/esm/models/UpdateWorkflowDefinitionRequest.js +6 -0
  53. package/dist/esm/models/WorkflowDefinitionResponse.d.ts +6 -0
  54. package/dist/esm/models/WorkflowDefinitionResponse.js +2 -0
  55. package/dist/esm/models/WorkflowRunSnapshot.d.ts +6 -0
  56. package/dist/esm/models/WorkflowRunSnapshot.js +2 -0
  57. package/dist/esm/models/index.d.ts +13 -2
  58. package/dist/esm/models/index.js +13 -2
  59. package/dist/models/ActivateSkillVersionRequest.d.ts +47 -0
  60. package/dist/models/ActivateSkillVersionRequest.js +50 -0
  61. package/dist/models/CreateSkillRequest.d.ts +60 -0
  62. package/dist/models/CreateSkillRequest.js +67 -0
  63. package/dist/models/CreateWorkflowDefinitionRequest.d.ts +6 -0
  64. package/dist/models/CreateWorkflowDefinitionRequest.js +6 -0
  65. package/dist/models/{FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaResponseOrDataSourceTableResponseOrApiConnectionResponse.d.ts → FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.d.ts} +9 -6
  66. package/dist/models/{FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaResponseOrDataSourceTableResponseOrApiConnectionResponse.js → FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.js} +15 -10
  67. package/dist/models/{PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDataSourceResponseDataSourceSchemaResponseDataSourceTableResponseApiConnectionResponseDiscriminator.d.ts → PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat.d.ts} +16 -16
  68. package/dist/models/{PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDataSourceResponseDataSourceSchemaResponseDataSourceTableResponseApiConnectionResponseDiscriminator.js → PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat.js} +18 -18
  69. package/dist/models/PaginatedResponseSkillResponse.d.ts +66 -0
  70. package/dist/models/PaginatedResponseSkillResponse.js +78 -0
  71. package/dist/models/PartType.d.ts +1 -0
  72. package/dist/models/PartType.js +2 -1
  73. package/dist/models/ReferenceType.d.ts +1 -0
  74. package/dist/models/ReferenceType.js +1 -0
  75. package/dist/models/SearchSkillsRequest.d.ts +59 -0
  76. package/dist/models/SearchSkillsRequest.js +72 -0
  77. package/dist/models/SearchSkillsResponse.d.ts +48 -0
  78. package/dist/models/SearchSkillsResponse.js +51 -0
  79. package/dist/models/SkillOrder.d.ts +26 -0
  80. package/dist/models/SkillOrder.js +52 -0
  81. package/dist/models/SkillResponse.d.ts +147 -0
  82. package/dist/models/SkillResponse.js +109 -0
  83. package/dist/models/SkillScriptFile.d.ts +53 -0
  84. package/dist/models/SkillScriptFile.js +60 -0
  85. package/dist/models/SkillSearchResult.d.ts +71 -0
  86. package/dist/models/SkillSearchResult.js +68 -0
  87. package/dist/models/SkillVersionResponse.d.ts +71 -0
  88. package/dist/models/SkillVersionResponse.js +66 -0
  89. package/dist/models/UpdateSkillRequest.d.ts +54 -0
  90. package/dist/models/UpdateSkillRequest.js +58 -0
  91. package/dist/models/UpdateWorkflowDefinitionRequest.d.ts +6 -0
  92. package/dist/models/UpdateWorkflowDefinitionRequest.js +6 -0
  93. package/dist/models/WorkflowDefinitionResponse.d.ts +6 -0
  94. package/dist/models/WorkflowDefinitionResponse.js +2 -0
  95. package/dist/models/WorkflowRunSnapshot.d.ts +6 -0
  96. package/dist/models/WorkflowRunSnapshot.js +2 -0
  97. package/dist/models/index.d.ts +13 -2
  98. package/dist/models/index.js +13 -2
  99. package/docs/ActivateSkillVersionRequest.md +35 -0
  100. package/docs/ChunksApi.md +1 -1
  101. package/docs/CreateSkillRequest.md +39 -0
  102. package/docs/CreateWorkflowDefinitionRequest.md +2 -0
  103. package/docs/{FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaResponseOrDataSourceTableResponseOrApiConnectionResponse.md → FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.md} +12 -4
  104. package/docs/FoldersApi.md +4 -4
  105. package/docs/{PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDataSourceResponseDataSourceSchemaResponseDataSourceTableResponseApiConnectionResponseDiscriminator.md → PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat.md} +5 -5
  106. package/docs/PaginatedResponseSkillResponse.md +40 -0
  107. package/docs/SearchSkillsRequest.md +39 -0
  108. package/docs/SearchSkillsResponse.md +34 -0
  109. package/docs/SkillOrder.md +33 -0
  110. package/docs/SkillResponse.md +65 -0
  111. package/docs/SkillScriptFile.md +37 -0
  112. package/docs/SkillSearchResult.md +43 -0
  113. package/docs/SkillVersionResponse.md +43 -0
  114. package/docs/SkillsApi.md +1093 -0
  115. package/docs/UpdateSkillRequest.md +37 -0
  116. package/docs/UpdateWorkflowDefinitionRequest.md +2 -0
  117. package/docs/WorkflowDefinitionResponse.md +2 -0
  118. package/docs/WorkflowDefinitionsApi.md +4 -1
  119. package/docs/WorkflowRunSnapshot.md +2 -0
  120. package/package.json +1 -1
  121. package/src/apis/FoldersApi.ts +13 -13
  122. package/src/apis/SkillsApi.ts +1321 -0
  123. package/src/apis/WorkflowDefinitionsApi.ts +7 -0
  124. package/src/apis/index.ts +1 -0
  125. package/src/models/ActivateSkillVersionRequest.ts +82 -0
  126. package/src/models/CreateSkillRequest.ts +115 -0
  127. package/src/models/CreateWorkflowDefinitionRequest.ts +12 -0
  128. package/src/models/{FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaResponseOrDataSourceTableResponseOrApiConnectionResponse.ts → FolderResponseOrDocumentResponseOrWorkflowDefinitionResponseOrWorkflowRunResponseOrDataSourceResponseOrDataSourceSchemaR.ts} +19 -8
  129. package/src/models/{PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDataSourceResponseDataSourceSchemaResponseDataSourceTableResponseApiConnectionResponseDiscriminator.ts → PaginatedResponseAnnotatedUnionFolderResponseDocumentResponseWorkflowDefinitionResponseWorkflowRunResponseDat.ts} +25 -25
  130. package/src/models/PaginatedResponseSkillResponse.ts +130 -0
  131. package/src/models/PartType.ts +2 -1
  132. package/src/models/ReferenceType.ts +1 -0
  133. package/src/models/SearchSkillsRequest.ts +114 -0
  134. package/src/models/SearchSkillsResponse.ts +90 -0
  135. package/src/models/SkillOrder.ts +54 -0
  136. package/src/models/SkillResponse.ts +244 -0
  137. package/src/models/SkillScriptFile.ts +95 -0
  138. package/src/models/SkillSearchResult.ts +119 -0
  139. package/src/models/SkillVersionResponse.ts +118 -0
  140. package/src/models/UpdateSkillRequest.ts +102 -0
  141. package/src/models/UpdateWorkflowDefinitionRequest.ts +12 -0
  142. package/src/models/WorkflowDefinitionResponse.ts +8 -0
  143. package/src/models/WorkflowRunSnapshot.ts +8 -0
  144. package/src/models/index.ts +13 -2
@@ -0,0 +1,1321 @@
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
+
15
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ ActivateSkillVersionRequest,
19
+ CreateSkillRequest,
20
+ ErrorResponse,
21
+ HTTPValidationError,
22
+ PaginatedResponseSkillResponse,
23
+ SearchSkillsRequest,
24
+ SearchSkillsResponse,
25
+ SkillOrder,
26
+ SkillResponse,
27
+ SkillVersionResponse,
28
+ SortDirection,
29
+ UpdateSkillRequest,
30
+ } from '../models/index';
31
+ import {
32
+ ActivateSkillVersionRequestFromJSON,
33
+ ActivateSkillVersionRequestToJSON,
34
+ CreateSkillRequestFromJSON,
35
+ CreateSkillRequestToJSON,
36
+ ErrorResponseFromJSON,
37
+ ErrorResponseToJSON,
38
+ HTTPValidationErrorFromJSON,
39
+ HTTPValidationErrorToJSON,
40
+ PaginatedResponseSkillResponseFromJSON,
41
+ PaginatedResponseSkillResponseToJSON,
42
+ SearchSkillsRequestFromJSON,
43
+ SearchSkillsRequestToJSON,
44
+ SearchSkillsResponseFromJSON,
45
+ SearchSkillsResponseToJSON,
46
+ SkillOrderFromJSON,
47
+ SkillOrderToJSON,
48
+ SkillResponseFromJSON,
49
+ SkillResponseToJSON,
50
+ SkillVersionResponseFromJSON,
51
+ SkillVersionResponseToJSON,
52
+ SortDirectionFromJSON,
53
+ SortDirectionToJSON,
54
+ UpdateSkillRequestFromJSON,
55
+ UpdateSkillRequestToJSON,
56
+ } from '../models/index';
57
+
58
+ export interface ActivateSkillVersionOperationRequest {
59
+ skillId: string;
60
+ versionId: string;
61
+ activateSkillVersionRequest: ActivateSkillVersionRequest;
62
+ }
63
+
64
+ export interface CheckinSkillRequest {
65
+ skillId: string;
66
+ }
67
+
68
+ export interface CheckoutSkillRequest {
69
+ skillId: string;
70
+ }
71
+
72
+ export interface CreateSkillOperationRequest {
73
+ createSkillRequest: CreateSkillRequest;
74
+ }
75
+
76
+ export interface DeleteSkillRequest {
77
+ skillId: string;
78
+ }
79
+
80
+ export interface DiscardSkillDraftRequest {
81
+ skillId: string;
82
+ }
83
+
84
+ export interface ExportSkillRequest {
85
+ skillId: string;
86
+ }
87
+
88
+ export interface GetSkillRequest {
89
+ skillId: string;
90
+ }
91
+
92
+ export interface ImportSkillRequest {
93
+ file: Blob;
94
+ }
95
+
96
+ export interface ListSkillVersionsRequest {
97
+ skillId: string;
98
+ }
99
+
100
+ export interface ListSkillsRequest {
101
+ sortBy?: SkillOrder;
102
+ search?: string | null;
103
+ limit?: number;
104
+ offset?: number;
105
+ sortDir?: SortDirection;
106
+ }
107
+
108
+ export interface PublishSkillVersionRequest {
109
+ skillId: string;
110
+ }
111
+
112
+ export interface SearchSkillsOperationRequest {
113
+ searchSkillsRequest: SearchSkillsRequest;
114
+ }
115
+
116
+ export interface UpdateSkillOperationRequest {
117
+ skillId: string;
118
+ updateSkillRequest: UpdateSkillRequest;
119
+ }
120
+
121
+ /**
122
+ * SkillsApi - interface
123
+ *
124
+ * @export
125
+ * @interface SkillsApiInterface
126
+ */
127
+ export interface SkillsApiInterface {
128
+ /**
129
+ * Creates request options for activateSkillVersion without sending the request
130
+ * @param {string} skillId
131
+ * @param {string} versionId
132
+ * @param {ActivateSkillVersionRequest} activateSkillVersionRequest
133
+ * @throws {RequiredError}
134
+ * @memberof SkillsApiInterface
135
+ */
136
+ activateSkillVersionRequestOpts(requestParameters: ActivateSkillVersionOperationRequest): Promise<runtime.RequestOpts>;
137
+
138
+ /**
139
+ * Activate a published version, restoring the working copy to it. Requires a held checkout (it overwrites the working copy).
140
+ * @summary Activate Skill Version Handler
141
+ * @param {string} skillId
142
+ * @param {string} versionId
143
+ * @param {ActivateSkillVersionRequest} activateSkillVersionRequest
144
+ * @param {*} [options] Override http request option.
145
+ * @throws {RequiredError}
146
+ * @memberof SkillsApiInterface
147
+ */
148
+ activateSkillVersionRaw(requestParameters: ActivateSkillVersionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SkillResponse>>;
149
+
150
+ /**
151
+ * Activate a published version, restoring the working copy to it. Requires a held checkout (it overwrites the working copy).
152
+ * Activate Skill Version Handler
153
+ */
154
+ activateSkillVersion(requestParameters: ActivateSkillVersionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SkillResponse>;
155
+
156
+ /**
157
+ * Creates request options for checkinSkill without sending the request
158
+ * @param {string} skillId
159
+ * @throws {RequiredError}
160
+ * @memberof SkillsApiInterface
161
+ */
162
+ checkinSkillRequestOpts(requestParameters: CheckinSkillRequest): Promise<runtime.RequestOpts>;
163
+
164
+ /**
165
+ * Release the skill\'s checkout so another author can edit it.
166
+ * @summary Checkin Skill Handler
167
+ * @param {string} skillId
168
+ * @param {*} [options] Override http request option.
169
+ * @throws {RequiredError}
170
+ * @memberof SkillsApiInterface
171
+ */
172
+ checkinSkillRaw(requestParameters: CheckinSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
173
+
174
+ /**
175
+ * Release the skill\'s checkout so another author can edit it.
176
+ * Checkin Skill Handler
177
+ */
178
+ checkinSkill(requestParameters: CheckinSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
179
+
180
+ /**
181
+ * Creates request options for checkoutSkill without sending the request
182
+ * @param {string} skillId
183
+ * @throws {RequiredError}
184
+ * @memberof SkillsApiInterface
185
+ */
186
+ checkoutSkillRequestOpts(requestParameters: CheckoutSkillRequest): Promise<runtime.RequestOpts>;
187
+
188
+ /**
189
+ * 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``.
190
+ * @summary Checkout Skill Handler
191
+ * @param {string} skillId
192
+ * @param {*} [options] Override http request option.
193
+ * @throws {RequiredError}
194
+ * @memberof SkillsApiInterface
195
+ */
196
+ checkoutSkillRaw(requestParameters: CheckoutSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SkillResponse>>;
197
+
198
+ /**
199
+ * 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``.
200
+ * Checkout Skill Handler
201
+ */
202
+ checkoutSkill(requestParameters: CheckoutSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SkillResponse>;
203
+
204
+ /**
205
+ * Creates request options for createSkill without sending the request
206
+ * @param {CreateSkillRequest} createSkillRequest
207
+ * @throws {RequiredError}
208
+ * @memberof SkillsApiInterface
209
+ */
210
+ createSkillRequestOpts(requestParameters: CreateSkillOperationRequest): Promise<runtime.RequestOpts>;
211
+
212
+ /**
213
+ * Author a skill (JSON) under /agents/skills; requires can_write there.
214
+ * @summary Create Skill Handler
215
+ * @param {CreateSkillRequest} createSkillRequest
216
+ * @param {*} [options] Override http request option.
217
+ * @throws {RequiredError}
218
+ * @memberof SkillsApiInterface
219
+ */
220
+ createSkillRaw(requestParameters: CreateSkillOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SkillResponse>>;
221
+
222
+ /**
223
+ * Author a skill (JSON) under /agents/skills; requires can_write there.
224
+ * Create Skill Handler
225
+ */
226
+ createSkill(requestParameters: CreateSkillOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SkillResponse>;
227
+
228
+ /**
229
+ * Creates request options for deleteSkill without sending the request
230
+ * @param {string} skillId
231
+ * @throws {RequiredError}
232
+ * @memberof SkillsApiInterface
233
+ */
234
+ deleteSkillRequestOpts(requestParameters: DeleteSkillRequest): Promise<runtime.RequestOpts>;
235
+
236
+ /**
237
+ * Soft-delete a skill; requires can_delete; 409 if another holds checkout.
238
+ * @summary Delete Skill Handler
239
+ * @param {string} skillId
240
+ * @param {*} [options] Override http request option.
241
+ * @throws {RequiredError}
242
+ * @memberof SkillsApiInterface
243
+ */
244
+ deleteSkillRaw(requestParameters: DeleteSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
245
+
246
+ /**
247
+ * Soft-delete a skill; requires can_delete; 409 if another holds checkout.
248
+ * Delete Skill Handler
249
+ */
250
+ deleteSkill(requestParameters: DeleteSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
251
+
252
+ /**
253
+ * Creates request options for discardSkillDraft without sending the request
254
+ * @param {string} skillId
255
+ * @throws {RequiredError}
256
+ * @memberof SkillsApiInterface
257
+ */
258
+ discardSkillDraftRequestOpts(requestParameters: DiscardSkillDraftRequest): Promise<runtime.RequestOpts>;
259
+
260
+ /**
261
+ * Discard unpublished edits: restore the working copy to the active version. Requires a held checkout (it overwrites the working copy).
262
+ * @summary Discard Skill Draft Handler
263
+ * @param {string} skillId
264
+ * @param {*} [options] Override http request option.
265
+ * @throws {RequiredError}
266
+ * @memberof SkillsApiInterface
267
+ */
268
+ discardSkillDraftRaw(requestParameters: DiscardSkillDraftRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SkillResponse>>;
269
+
270
+ /**
271
+ * Discard unpublished edits: restore the working copy to the active version. Requires a held checkout (it overwrites the working copy).
272
+ * Discard Skill Draft Handler
273
+ */
274
+ discardSkillDraft(requestParameters: DiscardSkillDraftRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SkillResponse>;
275
+
276
+ /**
277
+ * Creates request options for exportSkill without sending the request
278
+ * @param {string} skillId
279
+ * @throws {RequiredError}
280
+ * @memberof SkillsApiInterface
281
+ */
282
+ exportSkillRequestOpts(requestParameters: ExportSkillRequest): Promise<runtime.RequestOpts>;
283
+
284
+ /**
285
+ * Download the active published version as a self-contained ZIP for sharing.
286
+ * @summary Export Skill Handler
287
+ * @param {string} skillId
288
+ * @param {*} [options] Override http request option.
289
+ * @throws {RequiredError}
290
+ * @memberof SkillsApiInterface
291
+ */
292
+ exportSkillRaw(requestParameters: ExportSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<any>>;
293
+
294
+ /**
295
+ * Download the active published version as a self-contained ZIP for sharing.
296
+ * Export Skill Handler
297
+ */
298
+ exportSkill(requestParameters: ExportSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<any>;
299
+
300
+ /**
301
+ * Creates request options for getSkill without sending the request
302
+ * @param {string} skillId
303
+ * @throws {RequiredError}
304
+ * @memberof SkillsApiInterface
305
+ */
306
+ getSkillRequestOpts(requestParameters: GetSkillRequest): Promise<runtime.RequestOpts>;
307
+
308
+ /**
309
+ * Skill detail: SKILL.md, scripts, has_unpublished_changes, permissions.
310
+ * @summary Get Skill Handler
311
+ * @param {string} skillId
312
+ * @param {*} [options] Override http request option.
313
+ * @throws {RequiredError}
314
+ * @memberof SkillsApiInterface
315
+ */
316
+ getSkillRaw(requestParameters: GetSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SkillResponse>>;
317
+
318
+ /**
319
+ * Skill detail: SKILL.md, scripts, has_unpublished_changes, permissions.
320
+ * Get Skill Handler
321
+ */
322
+ getSkill(requestParameters: GetSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SkillResponse>;
323
+
324
+ /**
325
+ * Creates request options for importSkill without sending the request
326
+ * @param {Blob} file
327
+ * @throws {RequiredError}
328
+ * @memberof SkillsApiInterface
329
+ */
330
+ importSkillRequestOpts(requestParameters: ImportSkillRequest): Promise<runtime.RequestOpts>;
331
+
332
+ /**
333
+ * Create a skill by importing a redistributable ZIP (works across tenants).
334
+ * @summary Import Skill Handler
335
+ * @param {Blob} file
336
+ * @param {*} [options] Override http request option.
337
+ * @throws {RequiredError}
338
+ * @memberof SkillsApiInterface
339
+ */
340
+ importSkillRaw(requestParameters: ImportSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SkillResponse>>;
341
+
342
+ /**
343
+ * Create a skill by importing a redistributable ZIP (works across tenants).
344
+ * Import Skill Handler
345
+ */
346
+ importSkill(requestParameters: ImportSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SkillResponse>;
347
+
348
+ /**
349
+ * Creates request options for listSkillVersions without sending the request
350
+ * @param {string} skillId
351
+ * @throws {RequiredError}
352
+ * @memberof SkillsApiInterface
353
+ */
354
+ listSkillVersionsRequestOpts(requestParameters: ListSkillVersionsRequest): Promise<runtime.RequestOpts>;
355
+
356
+ /**
357
+ * List a skill\'s published versions, newest first.
358
+ * @summary List Skill Versions Handler
359
+ * @param {string} skillId
360
+ * @param {*} [options] Override http request option.
361
+ * @throws {RequiredError}
362
+ * @memberof SkillsApiInterface
363
+ */
364
+ listSkillVersionsRaw(requestParameters: ListSkillVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<SkillVersionResponse>>>;
365
+
366
+ /**
367
+ * List a skill\'s published versions, newest first.
368
+ * List Skill Versions Handler
369
+ */
370
+ listSkillVersions(requestParameters: ListSkillVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<SkillVersionResponse>>;
371
+
372
+ /**
373
+ * Creates request options for listSkills without sending the request
374
+ * @param {SkillOrder} [sortBy] Field to sort skills by (default: CREATED_AT)
375
+ * @param {string} [search] Case-insensitive skill-name substring filter (search bar)
376
+ * @param {number} [limit] Number of items per page
377
+ * @param {number} [offset] Number of items to skip
378
+ * @param {SortDirection} [sortDir] Sort direction (ASC or DESC); overrides the field\&#39;s natural default. Every sort field supports both directions.
379
+ * @throws {RequiredError}
380
+ * @memberof SkillsApiInterface
381
+ */
382
+ listSkillsRequestOpts(requestParameters: ListSkillsRequest): Promise<runtime.RequestOpts>;
383
+
384
+ /**
385
+ * List readable skills: paginated, sortable both ways, name-searchable.
386
+ * @summary List Skills Handler
387
+ * @param {SkillOrder} [sortBy] Field to sort skills by (default: CREATED_AT)
388
+ * @param {string} [search] Case-insensitive skill-name substring filter (search bar)
389
+ * @param {number} [limit] Number of items per page
390
+ * @param {number} [offset] Number of items to skip
391
+ * @param {SortDirection} [sortDir] Sort direction (ASC or DESC); overrides the field\&#39;s natural default. Every sort field supports both directions.
392
+ * @param {*} [options] Override http request option.
393
+ * @throws {RequiredError}
394
+ * @memberof SkillsApiInterface
395
+ */
396
+ listSkillsRaw(requestParameters: ListSkillsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseSkillResponse>>;
397
+
398
+ /**
399
+ * List readable skills: paginated, sortable both ways, name-searchable.
400
+ * List Skills Handler
401
+ */
402
+ listSkills(requestParameters: ListSkillsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseSkillResponse>;
403
+
404
+ /**
405
+ * Creates request options for publishSkillVersion without sending the request
406
+ * @param {string} skillId
407
+ * @throws {RequiredError}
408
+ * @memberof SkillsApiInterface
409
+ */
410
+ publishSkillVersionRequestOpts(requestParameters: PublishSkillVersionRequest): Promise<runtime.RequestOpts>;
411
+
412
+ /**
413
+ * 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.
414
+ * @summary Publish Skill Version Handler
415
+ * @param {string} skillId
416
+ * @param {*} [options] Override http request option.
417
+ * @throws {RequiredError}
418
+ * @memberof SkillsApiInterface
419
+ */
420
+ publishSkillVersionRaw(requestParameters: PublishSkillVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SkillResponse>>;
421
+
422
+ /**
423
+ * 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.
424
+ * Publish Skill Version Handler
425
+ */
426
+ publishSkillVersion(requestParameters: PublishSkillVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SkillResponse>;
427
+
428
+ /**
429
+ * Creates request options for searchSkills without sending the request
430
+ * @param {SearchSkillsRequest} searchSkillsRequest
431
+ * @throws {RequiredError}
432
+ * @memberof SkillsApiInterface
433
+ */
434
+ searchSkillsRequestOpts(requestParameters: SearchSkillsOperationRequest): Promise<runtime.RequestOpts>;
435
+
436
+ /**
437
+ * 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.
438
+ * @summary Search Skills Handler
439
+ * @param {SearchSkillsRequest} searchSkillsRequest
440
+ * @param {*} [options] Override http request option.
441
+ * @throws {RequiredError}
442
+ * @memberof SkillsApiInterface
443
+ */
444
+ searchSkillsRaw(requestParameters: SearchSkillsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SearchSkillsResponse>>;
445
+
446
+ /**
447
+ * 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.
448
+ * Search Skills Handler
449
+ */
450
+ searchSkills(requestParameters: SearchSkillsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SearchSkillsResponse>;
451
+
452
+ /**
453
+ * Creates request options for updateSkill without sending the request
454
+ * @param {string} skillId
455
+ * @param {UpdateSkillRequest} updateSkillRequest
456
+ * @throws {RequiredError}
457
+ * @memberof SkillsApiInterface
458
+ */
459
+ updateSkillRequestOpts(requestParameters: UpdateSkillOperationRequest): Promise<runtime.RequestOpts>;
460
+
461
+ /**
462
+ * Edit the working copy in place; requires can_write + a held checkout.
463
+ * @summary Update Skill Handler
464
+ * @param {string} skillId
465
+ * @param {UpdateSkillRequest} updateSkillRequest
466
+ * @param {*} [options] Override http request option.
467
+ * @throws {RequiredError}
468
+ * @memberof SkillsApiInterface
469
+ */
470
+ updateSkillRaw(requestParameters: UpdateSkillOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SkillResponse>>;
471
+
472
+ /**
473
+ * Edit the working copy in place; requires can_write + a held checkout.
474
+ * Update Skill Handler
475
+ */
476
+ updateSkill(requestParameters: UpdateSkillOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SkillResponse>;
477
+
478
+ }
479
+
480
+ /**
481
+ *
482
+ */
483
+ export class SkillsApi extends runtime.BaseAPI implements SkillsApiInterface {
484
+
485
+ /**
486
+ * Creates request options for activateSkillVersion without sending the request
487
+ */
488
+ async activateSkillVersionRequestOpts(requestParameters: ActivateSkillVersionOperationRequest): Promise<runtime.RequestOpts> {
489
+ if (requestParameters['skillId'] == null) {
490
+ throw new runtime.RequiredError(
491
+ 'skillId',
492
+ 'Required parameter "skillId" was null or undefined when calling activateSkillVersion().'
493
+ );
494
+ }
495
+
496
+ if (requestParameters['versionId'] == null) {
497
+ throw new runtime.RequiredError(
498
+ 'versionId',
499
+ 'Required parameter "versionId" was null or undefined when calling activateSkillVersion().'
500
+ );
501
+ }
502
+
503
+ if (requestParameters['activateSkillVersionRequest'] == null) {
504
+ throw new runtime.RequiredError(
505
+ 'activateSkillVersionRequest',
506
+ 'Required parameter "activateSkillVersionRequest" was null or undefined when calling activateSkillVersion().'
507
+ );
508
+ }
509
+
510
+ const queryParameters: any = {};
511
+
512
+ const headerParameters: runtime.HTTPHeaders = {};
513
+
514
+ headerParameters['Content-Type'] = 'application/json';
515
+
516
+ if (this.configuration && this.configuration.accessToken) {
517
+ const token = this.configuration.accessToken;
518
+ const tokenString = await token("bearerAuth", []);
519
+
520
+ if (tokenString) {
521
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
522
+ }
523
+ }
524
+
525
+ let urlPath = `/v1/skills/{skill_id}/versions/{version_id}/activate`;
526
+ urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
527
+ urlPath = urlPath.replace(`{${"version_id"}}`, encodeURIComponent(String(requestParameters['versionId'])));
528
+
529
+ return {
530
+ path: urlPath,
531
+ method: 'POST',
532
+ headers: headerParameters,
533
+ query: queryParameters,
534
+ body: ActivateSkillVersionRequestToJSON(requestParameters['activateSkillVersionRequest']),
535
+ };
536
+ }
537
+
538
+ /**
539
+ * Activate a published version, restoring the working copy to it. Requires a held checkout (it overwrites the working copy).
540
+ * Activate Skill Version Handler
541
+ */
542
+ async activateSkillVersionRaw(requestParameters: ActivateSkillVersionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SkillResponse>> {
543
+ const requestOptions = await this.activateSkillVersionRequestOpts(requestParameters);
544
+ const response = await this.request(requestOptions, initOverrides);
545
+
546
+ return new runtime.JSONApiResponse(response, (jsonValue) => SkillResponseFromJSON(jsonValue));
547
+ }
548
+
549
+ /**
550
+ * Activate a published version, restoring the working copy to it. Requires a held checkout (it overwrites the working copy).
551
+ * Activate Skill Version Handler
552
+ */
553
+ async activateSkillVersion(requestParameters: ActivateSkillVersionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SkillResponse> {
554
+ const response = await this.activateSkillVersionRaw(requestParameters, initOverrides);
555
+ return await response.value();
556
+ }
557
+
558
+ /**
559
+ * Creates request options for checkinSkill without sending the request
560
+ */
561
+ async checkinSkillRequestOpts(requestParameters: CheckinSkillRequest): Promise<runtime.RequestOpts> {
562
+ if (requestParameters['skillId'] == null) {
563
+ throw new runtime.RequiredError(
564
+ 'skillId',
565
+ 'Required parameter "skillId" was null or undefined when calling checkinSkill().'
566
+ );
567
+ }
568
+
569
+ const queryParameters: any = {};
570
+
571
+ const headerParameters: runtime.HTTPHeaders = {};
572
+
573
+ if (this.configuration && this.configuration.accessToken) {
574
+ const token = this.configuration.accessToken;
575
+ const tokenString = await token("bearerAuth", []);
576
+
577
+ if (tokenString) {
578
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
579
+ }
580
+ }
581
+
582
+ let urlPath = `/v1/skills/{skill_id}/checkin`;
583
+ urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
584
+
585
+ return {
586
+ path: urlPath,
587
+ method: 'POST',
588
+ headers: headerParameters,
589
+ query: queryParameters,
590
+ };
591
+ }
592
+
593
+ /**
594
+ * Release the skill\'s checkout so another author can edit it.
595
+ * Checkin Skill Handler
596
+ */
597
+ async checkinSkillRaw(requestParameters: CheckinSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
598
+ const requestOptions = await this.checkinSkillRequestOpts(requestParameters);
599
+ const response = await this.request(requestOptions, initOverrides);
600
+
601
+ return new runtime.VoidApiResponse(response);
602
+ }
603
+
604
+ /**
605
+ * Release the skill\'s checkout so another author can edit it.
606
+ * Checkin Skill Handler
607
+ */
608
+ async checkinSkill(requestParameters: CheckinSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
609
+ await this.checkinSkillRaw(requestParameters, initOverrides);
610
+ }
611
+
612
+ /**
613
+ * Creates request options for checkoutSkill without sending the request
614
+ */
615
+ async checkoutSkillRequestOpts(requestParameters: CheckoutSkillRequest): Promise<runtime.RequestOpts> {
616
+ if (requestParameters['skillId'] == null) {
617
+ throw new runtime.RequiredError(
618
+ 'skillId',
619
+ 'Required parameter "skillId" was null or undefined when calling checkoutSkill().'
620
+ );
621
+ }
622
+
623
+ const queryParameters: any = {};
624
+
625
+ const headerParameters: runtime.HTTPHeaders = {};
626
+
627
+ if (this.configuration && this.configuration.accessToken) {
628
+ const token = this.configuration.accessToken;
629
+ const tokenString = await token("bearerAuth", []);
630
+
631
+ if (tokenString) {
632
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
633
+ }
634
+ }
635
+
636
+ let urlPath = `/v1/skills/{skill_id}/checkout`;
637
+ urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
638
+
639
+ return {
640
+ path: urlPath,
641
+ method: 'POST',
642
+ headers: headerParameters,
643
+ query: queryParameters,
644
+ };
645
+ }
646
+
647
+ /**
648
+ * 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``.
649
+ * Checkout Skill Handler
650
+ */
651
+ async checkoutSkillRaw(requestParameters: CheckoutSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SkillResponse>> {
652
+ const requestOptions = await this.checkoutSkillRequestOpts(requestParameters);
653
+ const response = await this.request(requestOptions, initOverrides);
654
+
655
+ return new runtime.JSONApiResponse(response, (jsonValue) => SkillResponseFromJSON(jsonValue));
656
+ }
657
+
658
+ /**
659
+ * 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``.
660
+ * Checkout Skill Handler
661
+ */
662
+ async checkoutSkill(requestParameters: CheckoutSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SkillResponse> {
663
+ const response = await this.checkoutSkillRaw(requestParameters, initOverrides);
664
+ return await response.value();
665
+ }
666
+
667
+ /**
668
+ * Creates request options for createSkill without sending the request
669
+ */
670
+ async createSkillRequestOpts(requestParameters: CreateSkillOperationRequest): Promise<runtime.RequestOpts> {
671
+ if (requestParameters['createSkillRequest'] == null) {
672
+ throw new runtime.RequiredError(
673
+ 'createSkillRequest',
674
+ 'Required parameter "createSkillRequest" was null or undefined when calling createSkill().'
675
+ );
676
+ }
677
+
678
+ const queryParameters: any = {};
679
+
680
+ const headerParameters: runtime.HTTPHeaders = {};
681
+
682
+ headerParameters['Content-Type'] = 'application/json';
683
+
684
+ if (this.configuration && this.configuration.accessToken) {
685
+ const token = this.configuration.accessToken;
686
+ const tokenString = await token("bearerAuth", []);
687
+
688
+ if (tokenString) {
689
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
690
+ }
691
+ }
692
+
693
+ let urlPath = `/v1/skills`;
694
+
695
+ return {
696
+ path: urlPath,
697
+ method: 'POST',
698
+ headers: headerParameters,
699
+ query: queryParameters,
700
+ body: CreateSkillRequestToJSON(requestParameters['createSkillRequest']),
701
+ };
702
+ }
703
+
704
+ /**
705
+ * Author a skill (JSON) under /agents/skills; requires can_write there.
706
+ * Create Skill Handler
707
+ */
708
+ async createSkillRaw(requestParameters: CreateSkillOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SkillResponse>> {
709
+ const requestOptions = await this.createSkillRequestOpts(requestParameters);
710
+ const response = await this.request(requestOptions, initOverrides);
711
+
712
+ return new runtime.JSONApiResponse(response, (jsonValue) => SkillResponseFromJSON(jsonValue));
713
+ }
714
+
715
+ /**
716
+ * Author a skill (JSON) under /agents/skills; requires can_write there.
717
+ * Create Skill Handler
718
+ */
719
+ async createSkill(requestParameters: CreateSkillOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SkillResponse> {
720
+ const response = await this.createSkillRaw(requestParameters, initOverrides);
721
+ return await response.value();
722
+ }
723
+
724
+ /**
725
+ * Creates request options for deleteSkill without sending the request
726
+ */
727
+ async deleteSkillRequestOpts(requestParameters: DeleteSkillRequest): Promise<runtime.RequestOpts> {
728
+ if (requestParameters['skillId'] == null) {
729
+ throw new runtime.RequiredError(
730
+ 'skillId',
731
+ 'Required parameter "skillId" was null or undefined when calling deleteSkill().'
732
+ );
733
+ }
734
+
735
+ const queryParameters: any = {};
736
+
737
+ const headerParameters: runtime.HTTPHeaders = {};
738
+
739
+ if (this.configuration && this.configuration.accessToken) {
740
+ const token = this.configuration.accessToken;
741
+ const tokenString = await token("bearerAuth", []);
742
+
743
+ if (tokenString) {
744
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
745
+ }
746
+ }
747
+
748
+ let urlPath = `/v1/skills/{skill_id}`;
749
+ urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
750
+
751
+ return {
752
+ path: urlPath,
753
+ method: 'DELETE',
754
+ headers: headerParameters,
755
+ query: queryParameters,
756
+ };
757
+ }
758
+
759
+ /**
760
+ * Soft-delete a skill; requires can_delete; 409 if another holds checkout.
761
+ * Delete Skill Handler
762
+ */
763
+ async deleteSkillRaw(requestParameters: DeleteSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
764
+ const requestOptions = await this.deleteSkillRequestOpts(requestParameters);
765
+ const response = await this.request(requestOptions, initOverrides);
766
+
767
+ return new runtime.VoidApiResponse(response);
768
+ }
769
+
770
+ /**
771
+ * Soft-delete a skill; requires can_delete; 409 if another holds checkout.
772
+ * Delete Skill Handler
773
+ */
774
+ async deleteSkill(requestParameters: DeleteSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
775
+ await this.deleteSkillRaw(requestParameters, initOverrides);
776
+ }
777
+
778
+ /**
779
+ * Creates request options for discardSkillDraft without sending the request
780
+ */
781
+ async discardSkillDraftRequestOpts(requestParameters: DiscardSkillDraftRequest): Promise<runtime.RequestOpts> {
782
+ if (requestParameters['skillId'] == null) {
783
+ throw new runtime.RequiredError(
784
+ 'skillId',
785
+ 'Required parameter "skillId" was null or undefined when calling discardSkillDraft().'
786
+ );
787
+ }
788
+
789
+ const queryParameters: any = {};
790
+
791
+ const headerParameters: runtime.HTTPHeaders = {};
792
+
793
+ if (this.configuration && this.configuration.accessToken) {
794
+ const token = this.configuration.accessToken;
795
+ const tokenString = await token("bearerAuth", []);
796
+
797
+ if (tokenString) {
798
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
799
+ }
800
+ }
801
+
802
+ let urlPath = `/v1/skills/{skill_id}/discard-draft`;
803
+ urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
804
+
805
+ return {
806
+ path: urlPath,
807
+ method: 'POST',
808
+ headers: headerParameters,
809
+ query: queryParameters,
810
+ };
811
+ }
812
+
813
+ /**
814
+ * Discard unpublished edits: restore the working copy to the active version. Requires a held checkout (it overwrites the working copy).
815
+ * Discard Skill Draft Handler
816
+ */
817
+ async discardSkillDraftRaw(requestParameters: DiscardSkillDraftRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SkillResponse>> {
818
+ const requestOptions = await this.discardSkillDraftRequestOpts(requestParameters);
819
+ const response = await this.request(requestOptions, initOverrides);
820
+
821
+ return new runtime.JSONApiResponse(response, (jsonValue) => SkillResponseFromJSON(jsonValue));
822
+ }
823
+
824
+ /**
825
+ * Discard unpublished edits: restore the working copy to the active version. Requires a held checkout (it overwrites the working copy).
826
+ * Discard Skill Draft Handler
827
+ */
828
+ async discardSkillDraft(requestParameters: DiscardSkillDraftRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SkillResponse> {
829
+ const response = await this.discardSkillDraftRaw(requestParameters, initOverrides);
830
+ return await response.value();
831
+ }
832
+
833
+ /**
834
+ * Creates request options for exportSkill without sending the request
835
+ */
836
+ async exportSkillRequestOpts(requestParameters: ExportSkillRequest): Promise<runtime.RequestOpts> {
837
+ if (requestParameters['skillId'] == null) {
838
+ throw new runtime.RequiredError(
839
+ 'skillId',
840
+ 'Required parameter "skillId" was null or undefined when calling exportSkill().'
841
+ );
842
+ }
843
+
844
+ const queryParameters: any = {};
845
+
846
+ const headerParameters: runtime.HTTPHeaders = {};
847
+
848
+ if (this.configuration && this.configuration.accessToken) {
849
+ const token = this.configuration.accessToken;
850
+ const tokenString = await token("bearerAuth", []);
851
+
852
+ if (tokenString) {
853
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
854
+ }
855
+ }
856
+
857
+ let urlPath = `/v1/skills/{skill_id}/export`;
858
+ urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
859
+
860
+ return {
861
+ path: urlPath,
862
+ method: 'GET',
863
+ headers: headerParameters,
864
+ query: queryParameters,
865
+ };
866
+ }
867
+
868
+ /**
869
+ * Download the active published version as a self-contained ZIP for sharing.
870
+ * Export Skill Handler
871
+ */
872
+ async exportSkillRaw(requestParameters: ExportSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<any>> {
873
+ const requestOptions = await this.exportSkillRequestOpts(requestParameters);
874
+ const response = await this.request(requestOptions, initOverrides);
875
+
876
+ if (this.isJsonMime(response.headers.get('content-type'))) {
877
+ return new runtime.JSONApiResponse<any>(response);
878
+ } else {
879
+ return new runtime.TextApiResponse(response) as any;
880
+ }
881
+ }
882
+
883
+ /**
884
+ * Download the active published version as a self-contained ZIP for sharing.
885
+ * Export Skill Handler
886
+ */
887
+ async exportSkill(requestParameters: ExportSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<any> {
888
+ const response = await this.exportSkillRaw(requestParameters, initOverrides);
889
+ return await response.value();
890
+ }
891
+
892
+ /**
893
+ * Creates request options for getSkill without sending the request
894
+ */
895
+ async getSkillRequestOpts(requestParameters: GetSkillRequest): Promise<runtime.RequestOpts> {
896
+ if (requestParameters['skillId'] == null) {
897
+ throw new runtime.RequiredError(
898
+ 'skillId',
899
+ 'Required parameter "skillId" was null or undefined when calling getSkill().'
900
+ );
901
+ }
902
+
903
+ const queryParameters: any = {};
904
+
905
+ const headerParameters: runtime.HTTPHeaders = {};
906
+
907
+ if (this.configuration && this.configuration.accessToken) {
908
+ const token = this.configuration.accessToken;
909
+ const tokenString = await token("bearerAuth", []);
910
+
911
+ if (tokenString) {
912
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
913
+ }
914
+ }
915
+
916
+ let urlPath = `/v1/skills/{skill_id}`;
917
+ urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
918
+
919
+ return {
920
+ path: urlPath,
921
+ method: 'GET',
922
+ headers: headerParameters,
923
+ query: queryParameters,
924
+ };
925
+ }
926
+
927
+ /**
928
+ * Skill detail: SKILL.md, scripts, has_unpublished_changes, permissions.
929
+ * Get Skill Handler
930
+ */
931
+ async getSkillRaw(requestParameters: GetSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SkillResponse>> {
932
+ const requestOptions = await this.getSkillRequestOpts(requestParameters);
933
+ const response = await this.request(requestOptions, initOverrides);
934
+
935
+ return new runtime.JSONApiResponse(response, (jsonValue) => SkillResponseFromJSON(jsonValue));
936
+ }
937
+
938
+ /**
939
+ * Skill detail: SKILL.md, scripts, has_unpublished_changes, permissions.
940
+ * Get Skill Handler
941
+ */
942
+ async getSkill(requestParameters: GetSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SkillResponse> {
943
+ const response = await this.getSkillRaw(requestParameters, initOverrides);
944
+ return await response.value();
945
+ }
946
+
947
+ /**
948
+ * Creates request options for importSkill without sending the request
949
+ */
950
+ async importSkillRequestOpts(requestParameters: ImportSkillRequest): Promise<runtime.RequestOpts> {
951
+ if (requestParameters['file'] == null) {
952
+ throw new runtime.RequiredError(
953
+ 'file',
954
+ 'Required parameter "file" was null or undefined when calling importSkill().'
955
+ );
956
+ }
957
+
958
+ const queryParameters: any = {};
959
+
960
+ const headerParameters: runtime.HTTPHeaders = {};
961
+
962
+ if (this.configuration && this.configuration.accessToken) {
963
+ const token = this.configuration.accessToken;
964
+ const tokenString = await token("bearerAuth", []);
965
+
966
+ if (tokenString) {
967
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
968
+ }
969
+ }
970
+ const consumes: runtime.Consume[] = [
971
+ { contentType: 'multipart/form-data' },
972
+ ];
973
+ // @ts-ignore: canConsumeForm may be unused
974
+ const canConsumeForm = runtime.canConsumeForm(consumes);
975
+
976
+ let formParams: { append(param: string, value: any): any };
977
+ let useForm = false;
978
+ // use FormData to transmit files using content-type "multipart/form-data"
979
+ useForm = canConsumeForm;
980
+ if (useForm) {
981
+ formParams = new FormData();
982
+ } else {
983
+ formParams = new URLSearchParams();
984
+ }
985
+
986
+ if (requestParameters['file'] != null) {
987
+ formParams.append('file', requestParameters['file'] as any);
988
+ }
989
+
990
+
991
+ let urlPath = `/v1/skills/import`;
992
+
993
+ return {
994
+ path: urlPath,
995
+ method: 'POST',
996
+ headers: headerParameters,
997
+ query: queryParameters,
998
+ body: formParams,
999
+ };
1000
+ }
1001
+
1002
+ /**
1003
+ * Create a skill by importing a redistributable ZIP (works across tenants).
1004
+ * Import Skill Handler
1005
+ */
1006
+ async importSkillRaw(requestParameters: ImportSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SkillResponse>> {
1007
+ const requestOptions = await this.importSkillRequestOpts(requestParameters);
1008
+ const response = await this.request(requestOptions, initOverrides);
1009
+
1010
+ return new runtime.JSONApiResponse(response, (jsonValue) => SkillResponseFromJSON(jsonValue));
1011
+ }
1012
+
1013
+ /**
1014
+ * Create a skill by importing a redistributable ZIP (works across tenants).
1015
+ * Import Skill Handler
1016
+ */
1017
+ async importSkill(requestParameters: ImportSkillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SkillResponse> {
1018
+ const response = await this.importSkillRaw(requestParameters, initOverrides);
1019
+ return await response.value();
1020
+ }
1021
+
1022
+ /**
1023
+ * Creates request options for listSkillVersions without sending the request
1024
+ */
1025
+ async listSkillVersionsRequestOpts(requestParameters: ListSkillVersionsRequest): Promise<runtime.RequestOpts> {
1026
+ if (requestParameters['skillId'] == null) {
1027
+ throw new runtime.RequiredError(
1028
+ 'skillId',
1029
+ 'Required parameter "skillId" was null or undefined when calling listSkillVersions().'
1030
+ );
1031
+ }
1032
+
1033
+ const queryParameters: any = {};
1034
+
1035
+ const headerParameters: runtime.HTTPHeaders = {};
1036
+
1037
+ if (this.configuration && this.configuration.accessToken) {
1038
+ const token = this.configuration.accessToken;
1039
+ const tokenString = await token("bearerAuth", []);
1040
+
1041
+ if (tokenString) {
1042
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1043
+ }
1044
+ }
1045
+
1046
+ let urlPath = `/v1/skills/{skill_id}/versions`;
1047
+ urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
1048
+
1049
+ return {
1050
+ path: urlPath,
1051
+ method: 'GET',
1052
+ headers: headerParameters,
1053
+ query: queryParameters,
1054
+ };
1055
+ }
1056
+
1057
+ /**
1058
+ * List a skill\'s published versions, newest first.
1059
+ * List Skill Versions Handler
1060
+ */
1061
+ async listSkillVersionsRaw(requestParameters: ListSkillVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<SkillVersionResponse>>> {
1062
+ const requestOptions = await this.listSkillVersionsRequestOpts(requestParameters);
1063
+ const response = await this.request(requestOptions, initOverrides);
1064
+
1065
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(SkillVersionResponseFromJSON));
1066
+ }
1067
+
1068
+ /**
1069
+ * List a skill\'s published versions, newest first.
1070
+ * List Skill Versions Handler
1071
+ */
1072
+ async listSkillVersions(requestParameters: ListSkillVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<SkillVersionResponse>> {
1073
+ const response = await this.listSkillVersionsRaw(requestParameters, initOverrides);
1074
+ return await response.value();
1075
+ }
1076
+
1077
+ /**
1078
+ * Creates request options for listSkills without sending the request
1079
+ */
1080
+ async listSkillsRequestOpts(requestParameters: ListSkillsRequest): Promise<runtime.RequestOpts> {
1081
+ const queryParameters: any = {};
1082
+
1083
+ if (requestParameters['sortBy'] != null) {
1084
+ queryParameters['sort_by'] = requestParameters['sortBy'];
1085
+ }
1086
+
1087
+ if (requestParameters['search'] != null) {
1088
+ queryParameters['search'] = requestParameters['search'];
1089
+ }
1090
+
1091
+ if (requestParameters['limit'] != null) {
1092
+ queryParameters['limit'] = requestParameters['limit'];
1093
+ }
1094
+
1095
+ if (requestParameters['offset'] != null) {
1096
+ queryParameters['offset'] = requestParameters['offset'];
1097
+ }
1098
+
1099
+ if (requestParameters['sortDir'] != null) {
1100
+ queryParameters['sort_dir'] = requestParameters['sortDir'];
1101
+ }
1102
+
1103
+ const headerParameters: runtime.HTTPHeaders = {};
1104
+
1105
+ if (this.configuration && this.configuration.accessToken) {
1106
+ const token = this.configuration.accessToken;
1107
+ const tokenString = await token("bearerAuth", []);
1108
+
1109
+ if (tokenString) {
1110
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1111
+ }
1112
+ }
1113
+
1114
+ let urlPath = `/v1/skills`;
1115
+
1116
+ return {
1117
+ path: urlPath,
1118
+ method: 'GET',
1119
+ headers: headerParameters,
1120
+ query: queryParameters,
1121
+ };
1122
+ }
1123
+
1124
+ /**
1125
+ * List readable skills: paginated, sortable both ways, name-searchable.
1126
+ * List Skills Handler
1127
+ */
1128
+ async listSkillsRaw(requestParameters: ListSkillsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseSkillResponse>> {
1129
+ const requestOptions = await this.listSkillsRequestOpts(requestParameters);
1130
+ const response = await this.request(requestOptions, initOverrides);
1131
+
1132
+ return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedResponseSkillResponseFromJSON(jsonValue));
1133
+ }
1134
+
1135
+ /**
1136
+ * List readable skills: paginated, sortable both ways, name-searchable.
1137
+ * List Skills Handler
1138
+ */
1139
+ async listSkills(requestParameters: ListSkillsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseSkillResponse> {
1140
+ const response = await this.listSkillsRaw(requestParameters, initOverrides);
1141
+ return await response.value();
1142
+ }
1143
+
1144
+ /**
1145
+ * Creates request options for publishSkillVersion without sending the request
1146
+ */
1147
+ async publishSkillVersionRequestOpts(requestParameters: PublishSkillVersionRequest): Promise<runtime.RequestOpts> {
1148
+ if (requestParameters['skillId'] == null) {
1149
+ throw new runtime.RequiredError(
1150
+ 'skillId',
1151
+ 'Required parameter "skillId" was null or undefined when calling publishSkillVersion().'
1152
+ );
1153
+ }
1154
+
1155
+ const queryParameters: any = {};
1156
+
1157
+ const headerParameters: runtime.HTTPHeaders = {};
1158
+
1159
+ if (this.configuration && this.configuration.accessToken) {
1160
+ const token = this.configuration.accessToken;
1161
+ const tokenString = await token("bearerAuth", []);
1162
+
1163
+ if (tokenString) {
1164
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1165
+ }
1166
+ }
1167
+
1168
+ let urlPath = `/v1/skills/{skill_id}/versions`;
1169
+ urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
1170
+
1171
+ return {
1172
+ path: urlPath,
1173
+ method: 'POST',
1174
+ headers: headerParameters,
1175
+ query: queryParameters,
1176
+ };
1177
+ }
1178
+
1179
+ /**
1180
+ * 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.
1181
+ * Publish Skill Version Handler
1182
+ */
1183
+ async publishSkillVersionRaw(requestParameters: PublishSkillVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SkillResponse>> {
1184
+ const requestOptions = await this.publishSkillVersionRequestOpts(requestParameters);
1185
+ const response = await this.request(requestOptions, initOverrides);
1186
+
1187
+ return new runtime.JSONApiResponse(response, (jsonValue) => SkillResponseFromJSON(jsonValue));
1188
+ }
1189
+
1190
+ /**
1191
+ * 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.
1192
+ * Publish Skill Version Handler
1193
+ */
1194
+ async publishSkillVersion(requestParameters: PublishSkillVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SkillResponse> {
1195
+ const response = await this.publishSkillVersionRaw(requestParameters, initOverrides);
1196
+ return await response.value();
1197
+ }
1198
+
1199
+ /**
1200
+ * Creates request options for searchSkills without sending the request
1201
+ */
1202
+ async searchSkillsRequestOpts(requestParameters: SearchSkillsOperationRequest): Promise<runtime.RequestOpts> {
1203
+ if (requestParameters['searchSkillsRequest'] == null) {
1204
+ throw new runtime.RequiredError(
1205
+ 'searchSkillsRequest',
1206
+ 'Required parameter "searchSkillsRequest" was null or undefined when calling searchSkills().'
1207
+ );
1208
+ }
1209
+
1210
+ const queryParameters: any = {};
1211
+
1212
+ const headerParameters: runtime.HTTPHeaders = {};
1213
+
1214
+ headerParameters['Content-Type'] = 'application/json';
1215
+
1216
+ if (this.configuration && this.configuration.accessToken) {
1217
+ const token = this.configuration.accessToken;
1218
+ const tokenString = await token("bearerAuth", []);
1219
+
1220
+ if (tokenString) {
1221
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1222
+ }
1223
+ }
1224
+
1225
+ let urlPath = `/v1/skills/search`;
1226
+
1227
+ return {
1228
+ path: urlPath,
1229
+ method: 'POST',
1230
+ headers: headerParameters,
1231
+ query: queryParameters,
1232
+ body: SearchSkillsRequestToJSON(requestParameters['searchSkillsRequest']),
1233
+ };
1234
+ }
1235
+
1236
+ /**
1237
+ * 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.
1238
+ * Search Skills Handler
1239
+ */
1240
+ async searchSkillsRaw(requestParameters: SearchSkillsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SearchSkillsResponse>> {
1241
+ const requestOptions = await this.searchSkillsRequestOpts(requestParameters);
1242
+ const response = await this.request(requestOptions, initOverrides);
1243
+
1244
+ return new runtime.JSONApiResponse(response, (jsonValue) => SearchSkillsResponseFromJSON(jsonValue));
1245
+ }
1246
+
1247
+ /**
1248
+ * 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.
1249
+ * Search Skills Handler
1250
+ */
1251
+ async searchSkills(requestParameters: SearchSkillsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SearchSkillsResponse> {
1252
+ const response = await this.searchSkillsRaw(requestParameters, initOverrides);
1253
+ return await response.value();
1254
+ }
1255
+
1256
+ /**
1257
+ * Creates request options for updateSkill without sending the request
1258
+ */
1259
+ async updateSkillRequestOpts(requestParameters: UpdateSkillOperationRequest): Promise<runtime.RequestOpts> {
1260
+ if (requestParameters['skillId'] == null) {
1261
+ throw new runtime.RequiredError(
1262
+ 'skillId',
1263
+ 'Required parameter "skillId" was null or undefined when calling updateSkill().'
1264
+ );
1265
+ }
1266
+
1267
+ if (requestParameters['updateSkillRequest'] == null) {
1268
+ throw new runtime.RequiredError(
1269
+ 'updateSkillRequest',
1270
+ 'Required parameter "updateSkillRequest" was null or undefined when calling updateSkill().'
1271
+ );
1272
+ }
1273
+
1274
+ const queryParameters: any = {};
1275
+
1276
+ const headerParameters: runtime.HTTPHeaders = {};
1277
+
1278
+ headerParameters['Content-Type'] = 'application/json';
1279
+
1280
+ if (this.configuration && this.configuration.accessToken) {
1281
+ const token = this.configuration.accessToken;
1282
+ const tokenString = await token("bearerAuth", []);
1283
+
1284
+ if (tokenString) {
1285
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
1286
+ }
1287
+ }
1288
+
1289
+ let urlPath = `/v1/skills/{skill_id}`;
1290
+ urlPath = urlPath.replace(`{${"skill_id"}}`, encodeURIComponent(String(requestParameters['skillId'])));
1291
+
1292
+ return {
1293
+ path: urlPath,
1294
+ method: 'PATCH',
1295
+ headers: headerParameters,
1296
+ query: queryParameters,
1297
+ body: UpdateSkillRequestToJSON(requestParameters['updateSkillRequest']),
1298
+ };
1299
+ }
1300
+
1301
+ /**
1302
+ * Edit the working copy in place; requires can_write + a held checkout.
1303
+ * Update Skill Handler
1304
+ */
1305
+ async updateSkillRaw(requestParameters: UpdateSkillOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SkillResponse>> {
1306
+ const requestOptions = await this.updateSkillRequestOpts(requestParameters);
1307
+ const response = await this.request(requestOptions, initOverrides);
1308
+
1309
+ return new runtime.JSONApiResponse(response, (jsonValue) => SkillResponseFromJSON(jsonValue));
1310
+ }
1311
+
1312
+ /**
1313
+ * Edit the working copy in place; requires can_write + a held checkout.
1314
+ * Update Skill Handler
1315
+ */
1316
+ async updateSkill(requestParameters: UpdateSkillOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SkillResponse> {
1317
+ const response = await this.updateSkillRaw(requestParameters, initOverrides);
1318
+ return await response.value();
1319
+ }
1320
+
1321
+ }