@knowledge-stack/ksapi 1.84.0 → 1.85.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.
@@ -0,0 +1,233 @@
1
+ # DocumentCheckoutApi
2
+
3
+ All URIs are relative to *http://localhost:8000*
4
+
5
+ | Method | HTTP request | Description |
6
+ |------------- | ------------- | -------------|
7
+ | [**acquireDocumentCheckout**](DocumentCheckoutApi.md#acquiredocumentcheckout) | **POST** /v1/documents/{path_part_id}/checkout | Acquire Document Checkout Handler |
8
+ | [**getDocumentCheckout**](DocumentCheckoutApi.md#getdocumentcheckout) | **GET** /v1/documents/{path_part_id}/checkout | Get Document Checkout Handler |
9
+ | [**releaseDocumentCheckout**](DocumentCheckoutApi.md#releasedocumentcheckout) | **DELETE** /v1/documents/{path_part_id}/checkout | Release Document Checkout Handler |
10
+
11
+
12
+
13
+ ## acquireDocumentCheckout
14
+
15
+ > DocumentCheckoutResponse acquireDocumentCheckout(pathPartId, authorization, ksUat)
16
+
17
+ Acquire Document Checkout Handler
18
+
19
+ Acquire a write lock on the document. If the caller already holds the lock, re-acquire refreshes ``acquired_at``; the response is 200 in both cases. If another user holds the lock, returns 409. Locks have no TTL — they persist until released by the holder.
20
+
21
+ ### Example
22
+
23
+ ```ts
24
+ import {
25
+ Configuration,
26
+ DocumentCheckoutApi,
27
+ } from '@knowledge-stack/ksapi';
28
+ import type { AcquireDocumentCheckoutRequest } from '@knowledge-stack/ksapi';
29
+
30
+ async function example() {
31
+ console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
32
+ const api = new DocumentCheckoutApi();
33
+
34
+ const body = {
35
+ // string | Document\'s PathPart ID
36
+ pathPartId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
37
+ // string (optional)
38
+ authorization: authorization_example,
39
+ // string (optional)
40
+ ksUat: ksUat_example,
41
+ } satisfies AcquireDocumentCheckoutRequest;
42
+
43
+ try {
44
+ const data = await api.acquireDocumentCheckout(body);
45
+ console.log(data);
46
+ } catch (error) {
47
+ console.error(error);
48
+ }
49
+ }
50
+
51
+ // Run the test
52
+ example().catch(console.error);
53
+ ```
54
+
55
+ ### Parameters
56
+
57
+
58
+ | Name | Type | Description | Notes |
59
+ |------------- | ------------- | ------------- | -------------|
60
+ | **pathPartId** | `string` | Document\'s PathPart ID | [Defaults to `undefined`] |
61
+ | **authorization** | `string` | | [Optional] [Defaults to `undefined`] |
62
+ | **ksUat** | `string` | | [Optional] [Defaults to `undefined`] |
63
+
64
+ ### Return type
65
+
66
+ [**DocumentCheckoutResponse**](DocumentCheckoutResponse.md)
67
+
68
+ ### Authorization
69
+
70
+ No authorization required
71
+
72
+ ### HTTP request headers
73
+
74
+ - **Content-Type**: Not defined
75
+ - **Accept**: `application/json`
76
+
77
+
78
+ ### HTTP response details
79
+ | Status code | Description | Response headers |
80
+ |-------------|-------------|------------------|
81
+ | **200** | Successful Response | - |
82
+ | **422** | Validation Error | - |
83
+
84
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
85
+
86
+
87
+ ## getDocumentCheckout
88
+
89
+ > DocumentCheckoutResponse getDocumentCheckout(pathPartId, authorization, ksUat)
90
+
91
+ Get Document Checkout Handler
92
+
93
+ Get the active checkout for the document. 404 if no active checkout exists. The holder can always GET their own lock regardless of current path permissions (parallel to the release holder-bypass).
94
+
95
+ ### Example
96
+
97
+ ```ts
98
+ import {
99
+ Configuration,
100
+ DocumentCheckoutApi,
101
+ } from '@knowledge-stack/ksapi';
102
+ import type { GetDocumentCheckoutRequest } from '@knowledge-stack/ksapi';
103
+
104
+ async function example() {
105
+ console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
106
+ const api = new DocumentCheckoutApi();
107
+
108
+ const body = {
109
+ // string | Document\'s PathPart ID
110
+ pathPartId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
111
+ // string (optional)
112
+ authorization: authorization_example,
113
+ // string (optional)
114
+ ksUat: ksUat_example,
115
+ } satisfies GetDocumentCheckoutRequest;
116
+
117
+ try {
118
+ const data = await api.getDocumentCheckout(body);
119
+ console.log(data);
120
+ } catch (error) {
121
+ console.error(error);
122
+ }
123
+ }
124
+
125
+ // Run the test
126
+ example().catch(console.error);
127
+ ```
128
+
129
+ ### Parameters
130
+
131
+
132
+ | Name | Type | Description | Notes |
133
+ |------------- | ------------- | ------------- | -------------|
134
+ | **pathPartId** | `string` | Document\'s PathPart ID | [Defaults to `undefined`] |
135
+ | **authorization** | `string` | | [Optional] [Defaults to `undefined`] |
136
+ | **ksUat** | `string` | | [Optional] [Defaults to `undefined`] |
137
+
138
+ ### Return type
139
+
140
+ [**DocumentCheckoutResponse**](DocumentCheckoutResponse.md)
141
+
142
+ ### Authorization
143
+
144
+ No authorization required
145
+
146
+ ### HTTP request headers
147
+
148
+ - **Content-Type**: Not defined
149
+ - **Accept**: `application/json`
150
+
151
+
152
+ ### HTTP response details
153
+ | Status code | Description | Response headers |
154
+ |-------------|-------------|------------------|
155
+ | **200** | Successful Response | - |
156
+ | **422** | Validation Error | - |
157
+
158
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
159
+
160
+
161
+ ## releaseDocumentCheckout
162
+
163
+ > releaseDocumentCheckout(pathPartId, authorization, ksUat)
164
+
165
+ Release Document Checkout Handler
166
+
167
+ Release the write lock on the document. Only the holder may release the lock; others receive 403. The holder can always release regardless of current path permissions (in case a folder move relocated the doc to a path the holder can no longer write to).
168
+
169
+ ### Example
170
+
171
+ ```ts
172
+ import {
173
+ Configuration,
174
+ DocumentCheckoutApi,
175
+ } from '@knowledge-stack/ksapi';
176
+ import type { ReleaseDocumentCheckoutRequest } from '@knowledge-stack/ksapi';
177
+
178
+ async function example() {
179
+ console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
180
+ const api = new DocumentCheckoutApi();
181
+
182
+ const body = {
183
+ // string | Document\'s PathPart ID
184
+ pathPartId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
185
+ // string (optional)
186
+ authorization: authorization_example,
187
+ // string (optional)
188
+ ksUat: ksUat_example,
189
+ } satisfies ReleaseDocumentCheckoutRequest;
190
+
191
+ try {
192
+ const data = await api.releaseDocumentCheckout(body);
193
+ console.log(data);
194
+ } catch (error) {
195
+ console.error(error);
196
+ }
197
+ }
198
+
199
+ // Run the test
200
+ example().catch(console.error);
201
+ ```
202
+
203
+ ### Parameters
204
+
205
+
206
+ | Name | Type | Description | Notes |
207
+ |------------- | ------------- | ------------- | -------------|
208
+ | **pathPartId** | `string` | Document\'s PathPart ID | [Defaults to `undefined`] |
209
+ | **authorization** | `string` | | [Optional] [Defaults to `undefined`] |
210
+ | **ksUat** | `string` | | [Optional] [Defaults to `undefined`] |
211
+
212
+ ### Return type
213
+
214
+ `void` (Empty response body)
215
+
216
+ ### Authorization
217
+
218
+ No authorization required
219
+
220
+ ### HTTP request headers
221
+
222
+ - **Content-Type**: Not defined
223
+ - **Accept**: `application/json`
224
+
225
+
226
+ ### HTTP response details
227
+ | Status code | Description | Response headers |
228
+ |-------------|-------------|------------------|
229
+ | **204** | Successful Response | - |
230
+ | **422** | Validation Error | - |
231
+
232
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
233
+
@@ -0,0 +1,41 @@
1
+
2
+ # DocumentCheckoutResponse
3
+
4
+ Active checkout state on a document.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `tenantId` | string
11
+ `pathPartId` | string
12
+ `userId` | string
13
+ `acquiredAt` | Date
14
+
15
+ ## Example
16
+
17
+ ```typescript
18
+ import type { DocumentCheckoutResponse } from '@knowledge-stack/ksapi'
19
+
20
+ // TODO: Update the object below with actual values
21
+ const example = {
22
+ "tenantId": null,
23
+ "pathPartId": null,
24
+ "userId": null,
25
+ "acquiredAt": null,
26
+ } satisfies DocumentCheckoutResponse
27
+
28
+ console.log(example)
29
+
30
+ // Convert the instance to a JSON string
31
+ const exampleJSON: string = JSON.stringify(example)
32
+ console.log(exampleJSON)
33
+
34
+ // Parse the JSON string back to an object
35
+ const exampleParsed = JSON.parse(exampleJSON) as DocumentCheckoutResponse
36
+ console.log(exampleParsed)
37
+ ```
38
+
39
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
40
+
41
+
@@ -25,6 +25,7 @@ Name | Type
25
25
  `updatedAt` | Date
26
26
  `tags` | [Array<TagResponse>](TagResponse.md)
27
27
  `canWrite` | boolean
28
+ `checkout` | [DocumentCheckoutResponse](DocumentCheckoutResponse.md)
28
29
 
29
30
  ## Example
30
31
 
@@ -51,6 +52,7 @@ const example = {
51
52
  "updatedAt": null,
52
53
  "tags": null,
53
54
  "canWrite": null,
55
+ "checkout": null,
54
56
  } satisfies DocumentResponse
55
57
 
56
58
  console.log(example)
@@ -24,6 +24,7 @@ Name | Type
24
24
  `activeVersionId` | string
25
25
  `activeVersion` | [DocumentVersionResponse](DocumentVersionResponse.md)
26
26
  `ownerTenantUserId` | string
27
+ `checkout` | [DocumentCheckoutResponse](DocumentCheckoutResponse.md)
27
28
 
28
29
  ## Example
29
30
 
@@ -50,6 +51,7 @@ const example = {
50
51
  "activeVersionId": null,
51
52
  "activeVersion": null,
52
53
  "ownerTenantUserId": null,
54
+ "checkout": null,
53
55
  } satisfies FolderResponseOrDocumentResponse
54
56
 
55
57
  console.log(example)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowledge-stack/ksapi",
3
- "version": "1.84.0",
3
+ "version": "1.85.0",
4
4
  "description": "OpenAPI client for @knowledge-stack/ksapi",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -0,0 +1,296 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Knowledge Stack API
5
+ * Knowledge Stack backend API for authentication and knowledge management
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
+ DocumentCheckoutResponse,
19
+ HTTPValidationError,
20
+ } from '../models/index';
21
+ import {
22
+ DocumentCheckoutResponseFromJSON,
23
+ DocumentCheckoutResponseToJSON,
24
+ HTTPValidationErrorFromJSON,
25
+ HTTPValidationErrorToJSON,
26
+ } from '../models/index';
27
+
28
+ export interface AcquireDocumentCheckoutRequest {
29
+ pathPartId: string;
30
+ authorization?: string | null;
31
+ ksUat?: string | null;
32
+ }
33
+
34
+ export interface GetDocumentCheckoutRequest {
35
+ pathPartId: string;
36
+ authorization?: string | null;
37
+ ksUat?: string | null;
38
+ }
39
+
40
+ export interface ReleaseDocumentCheckoutRequest {
41
+ pathPartId: string;
42
+ authorization?: string | null;
43
+ ksUat?: string | null;
44
+ }
45
+
46
+ /**
47
+ * DocumentCheckoutApi - interface
48
+ *
49
+ * @export
50
+ * @interface DocumentCheckoutApiInterface
51
+ */
52
+ export interface DocumentCheckoutApiInterface {
53
+ /**
54
+ * Creates request options for acquireDocumentCheckout without sending the request
55
+ * @param {string} pathPartId Document\'s PathPart ID
56
+ * @param {string} [authorization]
57
+ * @param {string} [ksUat]
58
+ * @throws {RequiredError}
59
+ * @memberof DocumentCheckoutApiInterface
60
+ */
61
+ acquireDocumentCheckoutRequestOpts(requestParameters: AcquireDocumentCheckoutRequest): Promise<runtime.RequestOpts>;
62
+
63
+ /**
64
+ * Acquire a write lock on the document. If the caller already holds the lock, re-acquire refreshes ``acquired_at``; the response is 200 in both cases. If another user holds the lock, returns 409. Locks have no TTL — they persist until released by the holder.
65
+ * @summary Acquire Document Checkout Handler
66
+ * @param {string} pathPartId Document\&#39;s PathPart ID
67
+ * @param {string} [authorization]
68
+ * @param {string} [ksUat]
69
+ * @param {*} [options] Override http request option.
70
+ * @throws {RequiredError}
71
+ * @memberof DocumentCheckoutApiInterface
72
+ */
73
+ acquireDocumentCheckoutRaw(requestParameters: AcquireDocumentCheckoutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentCheckoutResponse>>;
74
+
75
+ /**
76
+ * Acquire a write lock on the document. If the caller already holds the lock, re-acquire refreshes ``acquired_at``; the response is 200 in both cases. If another user holds the lock, returns 409. Locks have no TTL — they persist until released by the holder.
77
+ * Acquire Document Checkout Handler
78
+ */
79
+ acquireDocumentCheckout(requestParameters: AcquireDocumentCheckoutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentCheckoutResponse>;
80
+
81
+ /**
82
+ * Creates request options for getDocumentCheckout without sending the request
83
+ * @param {string} pathPartId Document\&#39;s PathPart ID
84
+ * @param {string} [authorization]
85
+ * @param {string} [ksUat]
86
+ * @throws {RequiredError}
87
+ * @memberof DocumentCheckoutApiInterface
88
+ */
89
+ getDocumentCheckoutRequestOpts(requestParameters: GetDocumentCheckoutRequest): Promise<runtime.RequestOpts>;
90
+
91
+ /**
92
+ * Get the active checkout for the document. 404 if no active checkout exists. The holder can always GET their own lock regardless of current path permissions (parallel to the release holder-bypass).
93
+ * @summary Get Document Checkout Handler
94
+ * @param {string} pathPartId Document\&#39;s PathPart ID
95
+ * @param {string} [authorization]
96
+ * @param {string} [ksUat]
97
+ * @param {*} [options] Override http request option.
98
+ * @throws {RequiredError}
99
+ * @memberof DocumentCheckoutApiInterface
100
+ */
101
+ getDocumentCheckoutRaw(requestParameters: GetDocumentCheckoutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentCheckoutResponse>>;
102
+
103
+ /**
104
+ * Get the active checkout for the document. 404 if no active checkout exists. The holder can always GET their own lock regardless of current path permissions (parallel to the release holder-bypass).
105
+ * Get Document Checkout Handler
106
+ */
107
+ getDocumentCheckout(requestParameters: GetDocumentCheckoutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentCheckoutResponse>;
108
+
109
+ /**
110
+ * Creates request options for releaseDocumentCheckout without sending the request
111
+ * @param {string} pathPartId Document\&#39;s PathPart ID
112
+ * @param {string} [authorization]
113
+ * @param {string} [ksUat]
114
+ * @throws {RequiredError}
115
+ * @memberof DocumentCheckoutApiInterface
116
+ */
117
+ releaseDocumentCheckoutRequestOpts(requestParameters: ReleaseDocumentCheckoutRequest): Promise<runtime.RequestOpts>;
118
+
119
+ /**
120
+ * Release the write lock on the document. Only the holder may release the lock; others receive 403. The holder can always release regardless of current path permissions (in case a folder move relocated the doc to a path the holder can no longer write to).
121
+ * @summary Release Document Checkout Handler
122
+ * @param {string} pathPartId Document\&#39;s PathPart ID
123
+ * @param {string} [authorization]
124
+ * @param {string} [ksUat]
125
+ * @param {*} [options] Override http request option.
126
+ * @throws {RequiredError}
127
+ * @memberof DocumentCheckoutApiInterface
128
+ */
129
+ releaseDocumentCheckoutRaw(requestParameters: ReleaseDocumentCheckoutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
130
+
131
+ /**
132
+ * Release the write lock on the document. Only the holder may release the lock; others receive 403. The holder can always release regardless of current path permissions (in case a folder move relocated the doc to a path the holder can no longer write to).
133
+ * Release Document Checkout Handler
134
+ */
135
+ releaseDocumentCheckout(requestParameters: ReleaseDocumentCheckoutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
136
+
137
+ }
138
+
139
+ /**
140
+ *
141
+ */
142
+ export class DocumentCheckoutApi extends runtime.BaseAPI implements DocumentCheckoutApiInterface {
143
+
144
+ /**
145
+ * Creates request options for acquireDocumentCheckout without sending the request
146
+ */
147
+ async acquireDocumentCheckoutRequestOpts(requestParameters: AcquireDocumentCheckoutRequest): Promise<runtime.RequestOpts> {
148
+ if (requestParameters['pathPartId'] == null) {
149
+ throw new runtime.RequiredError(
150
+ 'pathPartId',
151
+ 'Required parameter "pathPartId" was null or undefined when calling acquireDocumentCheckout().'
152
+ );
153
+ }
154
+
155
+ const queryParameters: any = {};
156
+
157
+ const headerParameters: runtime.HTTPHeaders = {};
158
+
159
+ if (requestParameters['authorization'] != null) {
160
+ headerParameters['authorization'] = String(requestParameters['authorization']);
161
+ }
162
+
163
+
164
+ let urlPath = `/v1/documents/{path_part_id}/checkout`;
165
+ urlPath = urlPath.replace(`{${"path_part_id"}}`, encodeURIComponent(String(requestParameters['pathPartId'])));
166
+
167
+ return {
168
+ path: urlPath,
169
+ method: 'POST',
170
+ headers: headerParameters,
171
+ query: queryParameters,
172
+ };
173
+ }
174
+
175
+ /**
176
+ * Acquire a write lock on the document. If the caller already holds the lock, re-acquire refreshes ``acquired_at``; the response is 200 in both cases. If another user holds the lock, returns 409. Locks have no TTL — they persist until released by the holder.
177
+ * Acquire Document Checkout Handler
178
+ */
179
+ async acquireDocumentCheckoutRaw(requestParameters: AcquireDocumentCheckoutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentCheckoutResponse>> {
180
+ const requestOptions = await this.acquireDocumentCheckoutRequestOpts(requestParameters);
181
+ const response = await this.request(requestOptions, initOverrides);
182
+
183
+ return new runtime.JSONApiResponse(response, (jsonValue) => DocumentCheckoutResponseFromJSON(jsonValue));
184
+ }
185
+
186
+ /**
187
+ * Acquire a write lock on the document. If the caller already holds the lock, re-acquire refreshes ``acquired_at``; the response is 200 in both cases. If another user holds the lock, returns 409. Locks have no TTL — they persist until released by the holder.
188
+ * Acquire Document Checkout Handler
189
+ */
190
+ async acquireDocumentCheckout(requestParameters: AcquireDocumentCheckoutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentCheckoutResponse> {
191
+ const response = await this.acquireDocumentCheckoutRaw(requestParameters, initOverrides);
192
+ return await response.value();
193
+ }
194
+
195
+ /**
196
+ * Creates request options for getDocumentCheckout without sending the request
197
+ */
198
+ async getDocumentCheckoutRequestOpts(requestParameters: GetDocumentCheckoutRequest): Promise<runtime.RequestOpts> {
199
+ if (requestParameters['pathPartId'] == null) {
200
+ throw new runtime.RequiredError(
201
+ 'pathPartId',
202
+ 'Required parameter "pathPartId" was null or undefined when calling getDocumentCheckout().'
203
+ );
204
+ }
205
+
206
+ const queryParameters: any = {};
207
+
208
+ const headerParameters: runtime.HTTPHeaders = {};
209
+
210
+ if (requestParameters['authorization'] != null) {
211
+ headerParameters['authorization'] = String(requestParameters['authorization']);
212
+ }
213
+
214
+
215
+ let urlPath = `/v1/documents/{path_part_id}/checkout`;
216
+ urlPath = urlPath.replace(`{${"path_part_id"}}`, encodeURIComponent(String(requestParameters['pathPartId'])));
217
+
218
+ return {
219
+ path: urlPath,
220
+ method: 'GET',
221
+ headers: headerParameters,
222
+ query: queryParameters,
223
+ };
224
+ }
225
+
226
+ /**
227
+ * Get the active checkout for the document. 404 if no active checkout exists. The holder can always GET their own lock regardless of current path permissions (parallel to the release holder-bypass).
228
+ * Get Document Checkout Handler
229
+ */
230
+ async getDocumentCheckoutRaw(requestParameters: GetDocumentCheckoutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentCheckoutResponse>> {
231
+ const requestOptions = await this.getDocumentCheckoutRequestOpts(requestParameters);
232
+ const response = await this.request(requestOptions, initOverrides);
233
+
234
+ return new runtime.JSONApiResponse(response, (jsonValue) => DocumentCheckoutResponseFromJSON(jsonValue));
235
+ }
236
+
237
+ /**
238
+ * Get the active checkout for the document. 404 if no active checkout exists. The holder can always GET their own lock regardless of current path permissions (parallel to the release holder-bypass).
239
+ * Get Document Checkout Handler
240
+ */
241
+ async getDocumentCheckout(requestParameters: GetDocumentCheckoutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentCheckoutResponse> {
242
+ const response = await this.getDocumentCheckoutRaw(requestParameters, initOverrides);
243
+ return await response.value();
244
+ }
245
+
246
+ /**
247
+ * Creates request options for releaseDocumentCheckout without sending the request
248
+ */
249
+ async releaseDocumentCheckoutRequestOpts(requestParameters: ReleaseDocumentCheckoutRequest): Promise<runtime.RequestOpts> {
250
+ if (requestParameters['pathPartId'] == null) {
251
+ throw new runtime.RequiredError(
252
+ 'pathPartId',
253
+ 'Required parameter "pathPartId" was null or undefined when calling releaseDocumentCheckout().'
254
+ );
255
+ }
256
+
257
+ const queryParameters: any = {};
258
+
259
+ const headerParameters: runtime.HTTPHeaders = {};
260
+
261
+ if (requestParameters['authorization'] != null) {
262
+ headerParameters['authorization'] = String(requestParameters['authorization']);
263
+ }
264
+
265
+
266
+ let urlPath = `/v1/documents/{path_part_id}/checkout`;
267
+ urlPath = urlPath.replace(`{${"path_part_id"}}`, encodeURIComponent(String(requestParameters['pathPartId'])));
268
+
269
+ return {
270
+ path: urlPath,
271
+ method: 'DELETE',
272
+ headers: headerParameters,
273
+ query: queryParameters,
274
+ };
275
+ }
276
+
277
+ /**
278
+ * Release the write lock on the document. Only the holder may release the lock; others receive 403. The holder can always release regardless of current path permissions (in case a folder move relocated the doc to a path the holder can no longer write to).
279
+ * Release Document Checkout Handler
280
+ */
281
+ async releaseDocumentCheckoutRaw(requestParameters: ReleaseDocumentCheckoutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
282
+ const requestOptions = await this.releaseDocumentCheckoutRequestOpts(requestParameters);
283
+ const response = await this.request(requestOptions, initOverrides);
284
+
285
+ return new runtime.VoidApiResponse(response);
286
+ }
287
+
288
+ /**
289
+ * Release the write lock on the document. Only the holder may release the lock; others receive 403. The holder can always release regardless of current path permissions (in case a folder move relocated the doc to a path the holder can no longer write to).
290
+ * Release Document Checkout Handler
291
+ */
292
+ async releaseDocumentCheckout(requestParameters: ReleaseDocumentCheckoutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
293
+ await this.releaseDocumentCheckoutRaw(requestParameters, initOverrides);
294
+ }
295
+
296
+ }
package/src/apis/index.ts CHANGED
@@ -6,6 +6,7 @@ export * from './AuthApi';
6
6
  export * from './ChunkLineagesApi';
7
7
  export * from './ChunksApi';
8
8
  export * from './DefaultApi';
9
+ export * from './DocumentCheckoutApi';
9
10
  export * from './DocumentVersionsApi';
10
11
  export * from './DocumentsApi';
11
12
  export * from './FeaturesApi';