@knowledge-stack/ksapi 1.4.0 → 1.5.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 (53) hide show
  1. package/.openapi-generator/FILES +8 -0
  2. package/README.md +2 -2
  3. package/dist/apis/DocumentsApi.d.ts +179 -0
  4. package/dist/apis/DocumentsApi.js +206 -0
  5. package/dist/apis/index.d.ts +1 -0
  6. package/dist/apis/index.js +1 -0
  7. package/dist/esm/apis/DocumentsApi.d.ts +179 -0
  8. package/dist/esm/apis/DocumentsApi.js +202 -0
  9. package/dist/esm/apis/index.d.ts +1 -0
  10. package/dist/esm/apis/index.js +1 -0
  11. package/dist/esm/models/CreateDocumentRequest.d.ts +67 -0
  12. package/dist/esm/models/CreateDocumentRequest.js +63 -0
  13. package/dist/esm/models/DocumentOrigin.d.ts +25 -0
  14. package/dist/esm/models/DocumentOrigin.js +43 -0
  15. package/dist/esm/models/DocumentResponse.d.ts +110 -0
  16. package/dist/esm/models/DocumentResponse.js +87 -0
  17. package/dist/esm/models/DocumentType.d.ts +25 -0
  18. package/dist/esm/models/DocumentType.js +43 -0
  19. package/dist/esm/models/DocumentVersionResponse.d.ts +92 -0
  20. package/dist/esm/models/DocumentVersionResponse.js +72 -0
  21. package/dist/esm/models/PaginatedResponseDocumentResponse.d.ts +66 -0
  22. package/dist/esm/models/PaginatedResponseDocumentResponse.js +70 -0
  23. package/dist/esm/models/UpdateDocumentRequest.d.ts +59 -0
  24. package/dist/esm/models/UpdateDocumentRequest.js +51 -0
  25. package/dist/esm/models/index.d.ts +7 -0
  26. package/dist/esm/models/index.js +7 -0
  27. package/dist/models/CreateDocumentRequest.d.ts +67 -0
  28. package/dist/models/CreateDocumentRequest.js +71 -0
  29. package/dist/models/DocumentOrigin.d.ts +25 -0
  30. package/dist/models/DocumentOrigin.js +51 -0
  31. package/dist/models/DocumentResponse.d.ts +110 -0
  32. package/dist/models/DocumentResponse.js +95 -0
  33. package/dist/models/DocumentType.d.ts +25 -0
  34. package/dist/models/DocumentType.js +51 -0
  35. package/dist/models/DocumentVersionResponse.d.ts +92 -0
  36. package/dist/models/DocumentVersionResponse.js +80 -0
  37. package/dist/models/PaginatedResponseDocumentResponse.d.ts +66 -0
  38. package/dist/models/PaginatedResponseDocumentResponse.js +78 -0
  39. package/dist/models/UpdateDocumentRequest.d.ts +59 -0
  40. package/dist/models/UpdateDocumentRequest.js +59 -0
  41. package/dist/models/index.d.ts +7 -0
  42. package/dist/models/index.js +7 -0
  43. package/package.json +1 -1
  44. package/src/apis/DocumentsApi.ts +386 -0
  45. package/src/apis/index.ts +1 -0
  46. package/src/models/CreateDocumentRequest.ts +131 -0
  47. package/src/models/DocumentOrigin.ts +53 -0
  48. package/src/models/DocumentResponse.ts +197 -0
  49. package/src/models/DocumentType.ts +53 -0
  50. package/src/models/DocumentVersionResponse.ts +149 -0
  51. package/src/models/PaginatedResponseDocumentResponse.ts +130 -0
  52. package/src/models/UpdateDocumentRequest.ts +102 -0
  53. package/src/models/index.ts +7 -0
@@ -5,6 +5,7 @@ README.md
5
5
  package.json
6
6
  src/apis/AuthApi.ts
7
7
  src/apis/DefaultApi.ts
8
+ src/apis/DocumentsApi.ts
8
9
  src/apis/FoldersApi.ts
9
10
  src/apis/InvitesApi.ts
10
11
  src/apis/PathPartsApi.ts
@@ -12,9 +13,14 @@ src/apis/TenantsApi.ts
12
13
  src/apis/UsersApi.ts
13
14
  src/apis/index.ts
14
15
  src/index.ts
16
+ src/models/CreateDocumentRequest.ts
15
17
  src/models/CreateFolderRequest.ts
16
18
  src/models/CreatePasswordUserRequest.ts
17
19
  src/models/CreateTenantRequest.ts
20
+ src/models/DocumentOrigin.ts
21
+ src/models/DocumentResponse.ts
22
+ src/models/DocumentType.ts
23
+ src/models/DocumentVersionResponse.ts
18
24
  src/models/EmailSentResponse.ts
19
25
  src/models/EmailVerificationRequest.ts
20
26
  src/models/FolderResponse.ts
@@ -25,6 +31,7 @@ src/models/InviteResponse.ts
25
31
  src/models/InviteStatus.ts
26
32
  src/models/InviteUserRequest.ts
27
33
  src/models/OAuth2Config.ts
34
+ src/models/PaginatedResponseDocumentResponse.ts
28
35
  src/models/PaginatedResponseFolderResponse.ts
29
36
  src/models/PaginatedResponseInviteResponse.ts
30
37
  src/models/PaginatedResponsePathPartResponse.ts
@@ -40,6 +47,7 @@ src/models/SignInRequest.ts
40
47
  src/models/TenantResponse.ts
41
48
  src/models/TenantUserInTenantResponse.ts
42
49
  src/models/TenantUserRole.ts
50
+ src/models/UpdateDocumentRequest.ts
43
51
  src/models/UpdateFolderRequest.ts
44
52
  src/models/UpdateTenantRequest.ts
45
53
  src/models/UpdateUserRequest.ts
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ## @knowledge-stack/ksapi@1.4.0
1
+ ## @knowledge-stack/ksapi@1.5.0
2
2
 
3
3
  This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
4
4
 
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
36
36
  _published:_
37
37
 
38
38
  ```
39
- npm install @knowledge-stack/ksapi@1.4.0 --save
39
+ npm install @knowledge-stack/ksapi@1.5.0 --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
@@ -0,0 +1,179 @@
1
+ /**
2
+ * Knowledge Stack API
3
+ * Knowledge Stack backend API for authentication and knowledge management
4
+ *
5
+ * The version of the OpenAPI document: 0.1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { CreateDocumentRequest, DocumentResponse, PaginatedResponseDocumentResponse, PathOrder, UpdateDocumentRequest } from '../models/index';
14
+ export interface CreateDocumentOperationRequest {
15
+ createDocumentRequest: CreateDocumentRequest;
16
+ ksUat?: string;
17
+ }
18
+ export interface DeleteDocumentRequest {
19
+ documentId: string;
20
+ ksUat?: string;
21
+ }
22
+ export interface GetDocumentRequest {
23
+ documentId: string;
24
+ ksUat?: string;
25
+ }
26
+ export interface ListDocumentsRequest {
27
+ parentId?: string;
28
+ sortOrder?: PathOrder;
29
+ limit?: number;
30
+ offset?: number;
31
+ ksUat?: string;
32
+ }
33
+ export interface UpdateDocumentOperationRequest {
34
+ documentId: string;
35
+ updateDocumentRequest: UpdateDocumentRequest;
36
+ ksUat?: string;
37
+ }
38
+ /**
39
+ * DocumentsApi - interface
40
+ *
41
+ * @export
42
+ * @interface DocumentsApiInterface
43
+ */
44
+ export interface DocumentsApiInterface {
45
+ /**
46
+ * Create a new document with initial v0 version. The document is created as a child of the specified parent folder. An initial version (v0) is automatically created.
47
+ * @summary Create Document Handler
48
+ * @param {CreateDocumentRequest} createDocumentRequest
49
+ * @param {string} [ksUat]
50
+ * @param {*} [options] Override http request option.
51
+ * @throws {RequiredError}
52
+ * @memberof DocumentsApiInterface
53
+ */
54
+ createDocumentRaw(requestParameters: CreateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>>;
55
+ /**
56
+ * Create a new document with initial v0 version. The document is created as a child of the specified parent folder. An initial version (v0) is automatically created.
57
+ * Create Document Handler
58
+ */
59
+ createDocument(requestParameters: CreateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
60
+ /**
61
+ * Delete a document and all its contents. WARNING: This cascades to all children (versions, sections, chunks, etc.) due to parent_id ON DELETE CASCADE.
62
+ * @summary Delete Document Handler
63
+ * @param {string} documentId
64
+ * @param {string} [ksUat]
65
+ * @param {*} [options] Override http request option.
66
+ * @throws {RequiredError}
67
+ * @memberof DocumentsApiInterface
68
+ */
69
+ deleteDocumentRaw(requestParameters: DeleteDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
70
+ /**
71
+ * Delete a document and all its contents. WARNING: This cascades to all children (versions, sections, chunks, etc.) due to parent_id ON DELETE CASCADE.
72
+ * Delete Document Handler
73
+ */
74
+ deleteDocument(requestParameters: DeleteDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
75
+ /**
76
+ * Get a document by its document ID.
77
+ * @summary Get Document Handler
78
+ * @param {string} documentId
79
+ * @param {string} [ksUat]
80
+ * @param {*} [options] Override http request option.
81
+ * @throws {RequiredError}
82
+ * @memberof DocumentsApiInterface
83
+ */
84
+ getDocumentRaw(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>>;
85
+ /**
86
+ * Get a document by its document ID.
87
+ * Get Document Handler
88
+ */
89
+ getDocument(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
90
+ /**
91
+ * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_id is not provided, lists documents in the root folder.
92
+ * @summary List Documents Handler
93
+ * @param {string} [parentId] Parent folder PathPart ID (defaults to root)
94
+ * @param {PathOrder} [sortOrder] Sort order for results (default: LOGICAL)
95
+ * @param {number} [limit] Number of items per page
96
+ * @param {number} [offset] Number of items to skip
97
+ * @param {string} [ksUat]
98
+ * @param {*} [options] Override http request option.
99
+ * @throws {RequiredError}
100
+ * @memberof DocumentsApiInterface
101
+ */
102
+ listDocumentsRaw(requestParameters: ListDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseDocumentResponse>>;
103
+ /**
104
+ * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_id is not provided, lists documents in the root folder.
105
+ * List Documents Handler
106
+ */
107
+ listDocuments(requestParameters: ListDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseDocumentResponse>;
108
+ /**
109
+ * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
110
+ * @summary Update Document Handler
111
+ * @param {string} documentId
112
+ * @param {UpdateDocumentRequest} updateDocumentRequest
113
+ * @param {string} [ksUat]
114
+ * @param {*} [options] Override http request option.
115
+ * @throws {RequiredError}
116
+ * @memberof DocumentsApiInterface
117
+ */
118
+ updateDocumentRaw(requestParameters: UpdateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>>;
119
+ /**
120
+ * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
121
+ * Update Document Handler
122
+ */
123
+ updateDocument(requestParameters: UpdateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
124
+ }
125
+ /**
126
+ *
127
+ */
128
+ export declare class DocumentsApi extends runtime.BaseAPI implements DocumentsApiInterface {
129
+ /**
130
+ * Create a new document with initial v0 version. The document is created as a child of the specified parent folder. An initial version (v0) is automatically created.
131
+ * Create Document Handler
132
+ */
133
+ createDocumentRaw(requestParameters: CreateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>>;
134
+ /**
135
+ * Create a new document with initial v0 version. The document is created as a child of the specified parent folder. An initial version (v0) is automatically created.
136
+ * Create Document Handler
137
+ */
138
+ createDocument(requestParameters: CreateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
139
+ /**
140
+ * Delete a document and all its contents. WARNING: This cascades to all children (versions, sections, chunks, etc.) due to parent_id ON DELETE CASCADE.
141
+ * Delete Document Handler
142
+ */
143
+ deleteDocumentRaw(requestParameters: DeleteDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
144
+ /**
145
+ * Delete a document and all its contents. WARNING: This cascades to all children (versions, sections, chunks, etc.) due to parent_id ON DELETE CASCADE.
146
+ * Delete Document Handler
147
+ */
148
+ deleteDocument(requestParameters: DeleteDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
149
+ /**
150
+ * Get a document by its document ID.
151
+ * Get Document Handler
152
+ */
153
+ getDocumentRaw(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>>;
154
+ /**
155
+ * Get a document by its document ID.
156
+ * Get Document Handler
157
+ */
158
+ getDocument(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
159
+ /**
160
+ * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_id is not provided, lists documents in the root folder.
161
+ * List Documents Handler
162
+ */
163
+ listDocumentsRaw(requestParameters: ListDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseDocumentResponse>>;
164
+ /**
165
+ * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_id is not provided, lists documents in the root folder.
166
+ * List Documents Handler
167
+ */
168
+ listDocuments(requestParameters?: ListDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseDocumentResponse>;
169
+ /**
170
+ * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
171
+ * Update Document Handler
172
+ */
173
+ updateDocumentRaw(requestParameters: UpdateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>>;
174
+ /**
175
+ * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
176
+ * Update Document Handler
177
+ */
178
+ updateDocument(requestParameters: UpdateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
179
+ }
@@ -0,0 +1,206 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Knowledge Stack API
6
+ * Knowledge Stack backend API for authentication and knowledge management
7
+ *
8
+ * The version of the OpenAPI document: 0.1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
+ return new (P || (P = Promise))(function (resolve, reject) {
18
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
22
+ });
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.DocumentsApi = void 0;
26
+ const runtime = require("../runtime");
27
+ const index_1 = require("../models/index");
28
+ /**
29
+ *
30
+ */
31
+ class DocumentsApi extends runtime.BaseAPI {
32
+ /**
33
+ * Create a new document with initial v0 version. The document is created as a child of the specified parent folder. An initial version (v0) is automatically created.
34
+ * Create Document Handler
35
+ */
36
+ createDocumentRaw(requestParameters, initOverrides) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ if (requestParameters['createDocumentRequest'] == null) {
39
+ throw new runtime.RequiredError('createDocumentRequest', 'Required parameter "createDocumentRequest" was null or undefined when calling createDocument().');
40
+ }
41
+ const queryParameters = {};
42
+ const headerParameters = {};
43
+ headerParameters['Content-Type'] = 'application/json';
44
+ let urlPath = `/v1/documents`;
45
+ const response = yield this.request({
46
+ path: urlPath,
47
+ method: 'POST',
48
+ headers: headerParameters,
49
+ query: queryParameters,
50
+ body: (0, index_1.CreateDocumentRequestToJSON)(requestParameters['createDocumentRequest']),
51
+ }, initOverrides);
52
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.DocumentResponseFromJSON)(jsonValue));
53
+ });
54
+ }
55
+ /**
56
+ * Create a new document with initial v0 version. The document is created as a child of the specified parent folder. An initial version (v0) is automatically created.
57
+ * Create Document Handler
58
+ */
59
+ createDocument(requestParameters, initOverrides) {
60
+ return __awaiter(this, void 0, void 0, function* () {
61
+ const response = yield this.createDocumentRaw(requestParameters, initOverrides);
62
+ return yield response.value();
63
+ });
64
+ }
65
+ /**
66
+ * Delete a document and all its contents. WARNING: This cascades to all children (versions, sections, chunks, etc.) due to parent_id ON DELETE CASCADE.
67
+ * Delete Document Handler
68
+ */
69
+ deleteDocumentRaw(requestParameters, initOverrides) {
70
+ return __awaiter(this, void 0, void 0, function* () {
71
+ if (requestParameters['documentId'] == null) {
72
+ throw new runtime.RequiredError('documentId', 'Required parameter "documentId" was null or undefined when calling deleteDocument().');
73
+ }
74
+ const queryParameters = {};
75
+ const headerParameters = {};
76
+ let urlPath = `/v1/documents/{document_id}`;
77
+ urlPath = urlPath.replace(`{${"document_id"}}`, encodeURIComponent(String(requestParameters['documentId'])));
78
+ const response = yield this.request({
79
+ path: urlPath,
80
+ method: 'DELETE',
81
+ headers: headerParameters,
82
+ query: queryParameters,
83
+ }, initOverrides);
84
+ return new runtime.VoidApiResponse(response);
85
+ });
86
+ }
87
+ /**
88
+ * Delete a document and all its contents. WARNING: This cascades to all children (versions, sections, chunks, etc.) due to parent_id ON DELETE CASCADE.
89
+ * Delete Document Handler
90
+ */
91
+ deleteDocument(requestParameters, initOverrides) {
92
+ return __awaiter(this, void 0, void 0, function* () {
93
+ yield this.deleteDocumentRaw(requestParameters, initOverrides);
94
+ });
95
+ }
96
+ /**
97
+ * Get a document by its document ID.
98
+ * Get Document Handler
99
+ */
100
+ getDocumentRaw(requestParameters, initOverrides) {
101
+ return __awaiter(this, void 0, void 0, function* () {
102
+ if (requestParameters['documentId'] == null) {
103
+ throw new runtime.RequiredError('documentId', 'Required parameter "documentId" was null or undefined when calling getDocument().');
104
+ }
105
+ const queryParameters = {};
106
+ const headerParameters = {};
107
+ let urlPath = `/v1/documents/{document_id}`;
108
+ urlPath = urlPath.replace(`{${"document_id"}}`, encodeURIComponent(String(requestParameters['documentId'])));
109
+ const response = yield this.request({
110
+ path: urlPath,
111
+ method: 'GET',
112
+ headers: headerParameters,
113
+ query: queryParameters,
114
+ }, initOverrides);
115
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.DocumentResponseFromJSON)(jsonValue));
116
+ });
117
+ }
118
+ /**
119
+ * Get a document by its document ID.
120
+ * Get Document Handler
121
+ */
122
+ getDocument(requestParameters, initOverrides) {
123
+ return __awaiter(this, void 0, void 0, function* () {
124
+ const response = yield this.getDocumentRaw(requestParameters, initOverrides);
125
+ return yield response.value();
126
+ });
127
+ }
128
+ /**
129
+ * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_id is not provided, lists documents in the root folder.
130
+ * List Documents Handler
131
+ */
132
+ listDocumentsRaw(requestParameters, initOverrides) {
133
+ return __awaiter(this, void 0, void 0, function* () {
134
+ const queryParameters = {};
135
+ if (requestParameters['parentId'] != null) {
136
+ queryParameters['parent_id'] = requestParameters['parentId'];
137
+ }
138
+ if (requestParameters['sortOrder'] != null) {
139
+ queryParameters['sort_order'] = requestParameters['sortOrder'];
140
+ }
141
+ if (requestParameters['limit'] != null) {
142
+ queryParameters['limit'] = requestParameters['limit'];
143
+ }
144
+ if (requestParameters['offset'] != null) {
145
+ queryParameters['offset'] = requestParameters['offset'];
146
+ }
147
+ const headerParameters = {};
148
+ let urlPath = `/v1/documents`;
149
+ const response = yield this.request({
150
+ path: urlPath,
151
+ method: 'GET',
152
+ headers: headerParameters,
153
+ query: queryParameters,
154
+ }, initOverrides);
155
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedResponseDocumentResponseFromJSON)(jsonValue));
156
+ });
157
+ }
158
+ /**
159
+ * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_id is not provided, lists documents in the root folder.
160
+ * List Documents Handler
161
+ */
162
+ listDocuments() {
163
+ return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
164
+ const response = yield this.listDocumentsRaw(requestParameters, initOverrides);
165
+ return yield response.value();
166
+ });
167
+ }
168
+ /**
169
+ * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
170
+ * Update Document Handler
171
+ */
172
+ updateDocumentRaw(requestParameters, initOverrides) {
173
+ return __awaiter(this, void 0, void 0, function* () {
174
+ if (requestParameters['documentId'] == null) {
175
+ throw new runtime.RequiredError('documentId', 'Required parameter "documentId" was null or undefined when calling updateDocument().');
176
+ }
177
+ if (requestParameters['updateDocumentRequest'] == null) {
178
+ throw new runtime.RequiredError('updateDocumentRequest', 'Required parameter "updateDocumentRequest" was null or undefined when calling updateDocument().');
179
+ }
180
+ const queryParameters = {};
181
+ const headerParameters = {};
182
+ headerParameters['Content-Type'] = 'application/json';
183
+ let urlPath = `/v1/documents/{document_id}`;
184
+ urlPath = urlPath.replace(`{${"document_id"}}`, encodeURIComponent(String(requestParameters['documentId'])));
185
+ const response = yield this.request({
186
+ path: urlPath,
187
+ method: 'PATCH',
188
+ headers: headerParameters,
189
+ query: queryParameters,
190
+ body: (0, index_1.UpdateDocumentRequestToJSON)(requestParameters['updateDocumentRequest']),
191
+ }, initOverrides);
192
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.DocumentResponseFromJSON)(jsonValue));
193
+ });
194
+ }
195
+ /**
196
+ * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
197
+ * Update Document Handler
198
+ */
199
+ updateDocument(requestParameters, initOverrides) {
200
+ return __awaiter(this, void 0, void 0, function* () {
201
+ const response = yield this.updateDocumentRaw(requestParameters, initOverrides);
202
+ return yield response.value();
203
+ });
204
+ }
205
+ }
206
+ exports.DocumentsApi = DocumentsApi;
@@ -1,5 +1,6 @@
1
1
  export * from './AuthApi';
2
2
  export * from './DefaultApi';
3
+ export * from './DocumentsApi';
3
4
  export * from './FoldersApi';
4
5
  export * from './InvitesApi';
5
6
  export * from './PathPartsApi';
@@ -18,6 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  /* eslint-disable */
19
19
  __exportStar(require("./AuthApi"), exports);
20
20
  __exportStar(require("./DefaultApi"), exports);
21
+ __exportStar(require("./DocumentsApi"), exports);
21
22
  __exportStar(require("./FoldersApi"), exports);
22
23
  __exportStar(require("./InvitesApi"), exports);
23
24
  __exportStar(require("./PathPartsApi"), exports);
@@ -0,0 +1,179 @@
1
+ /**
2
+ * Knowledge Stack API
3
+ * Knowledge Stack backend API for authentication and knowledge management
4
+ *
5
+ * The version of the OpenAPI document: 0.1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { CreateDocumentRequest, DocumentResponse, PaginatedResponseDocumentResponse, PathOrder, UpdateDocumentRequest } from '../models/index';
14
+ export interface CreateDocumentOperationRequest {
15
+ createDocumentRequest: CreateDocumentRequest;
16
+ ksUat?: string;
17
+ }
18
+ export interface DeleteDocumentRequest {
19
+ documentId: string;
20
+ ksUat?: string;
21
+ }
22
+ export interface GetDocumentRequest {
23
+ documentId: string;
24
+ ksUat?: string;
25
+ }
26
+ export interface ListDocumentsRequest {
27
+ parentId?: string;
28
+ sortOrder?: PathOrder;
29
+ limit?: number;
30
+ offset?: number;
31
+ ksUat?: string;
32
+ }
33
+ export interface UpdateDocumentOperationRequest {
34
+ documentId: string;
35
+ updateDocumentRequest: UpdateDocumentRequest;
36
+ ksUat?: string;
37
+ }
38
+ /**
39
+ * DocumentsApi - interface
40
+ *
41
+ * @export
42
+ * @interface DocumentsApiInterface
43
+ */
44
+ export interface DocumentsApiInterface {
45
+ /**
46
+ * Create a new document with initial v0 version. The document is created as a child of the specified parent folder. An initial version (v0) is automatically created.
47
+ * @summary Create Document Handler
48
+ * @param {CreateDocumentRequest} createDocumentRequest
49
+ * @param {string} [ksUat]
50
+ * @param {*} [options] Override http request option.
51
+ * @throws {RequiredError}
52
+ * @memberof DocumentsApiInterface
53
+ */
54
+ createDocumentRaw(requestParameters: CreateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>>;
55
+ /**
56
+ * Create a new document with initial v0 version. The document is created as a child of the specified parent folder. An initial version (v0) is automatically created.
57
+ * Create Document Handler
58
+ */
59
+ createDocument(requestParameters: CreateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
60
+ /**
61
+ * Delete a document and all its contents. WARNING: This cascades to all children (versions, sections, chunks, etc.) due to parent_id ON DELETE CASCADE.
62
+ * @summary Delete Document Handler
63
+ * @param {string} documentId
64
+ * @param {string} [ksUat]
65
+ * @param {*} [options] Override http request option.
66
+ * @throws {RequiredError}
67
+ * @memberof DocumentsApiInterface
68
+ */
69
+ deleteDocumentRaw(requestParameters: DeleteDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
70
+ /**
71
+ * Delete a document and all its contents. WARNING: This cascades to all children (versions, sections, chunks, etc.) due to parent_id ON DELETE CASCADE.
72
+ * Delete Document Handler
73
+ */
74
+ deleteDocument(requestParameters: DeleteDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
75
+ /**
76
+ * Get a document by its document ID.
77
+ * @summary Get Document Handler
78
+ * @param {string} documentId
79
+ * @param {string} [ksUat]
80
+ * @param {*} [options] Override http request option.
81
+ * @throws {RequiredError}
82
+ * @memberof DocumentsApiInterface
83
+ */
84
+ getDocumentRaw(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>>;
85
+ /**
86
+ * Get a document by its document ID.
87
+ * Get Document Handler
88
+ */
89
+ getDocument(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
90
+ /**
91
+ * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_id is not provided, lists documents in the root folder.
92
+ * @summary List Documents Handler
93
+ * @param {string} [parentId] Parent folder PathPart ID (defaults to root)
94
+ * @param {PathOrder} [sortOrder] Sort order for results (default: LOGICAL)
95
+ * @param {number} [limit] Number of items per page
96
+ * @param {number} [offset] Number of items to skip
97
+ * @param {string} [ksUat]
98
+ * @param {*} [options] Override http request option.
99
+ * @throws {RequiredError}
100
+ * @memberof DocumentsApiInterface
101
+ */
102
+ listDocumentsRaw(requestParameters: ListDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseDocumentResponse>>;
103
+ /**
104
+ * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_id is not provided, lists documents in the root folder.
105
+ * List Documents Handler
106
+ */
107
+ listDocuments(requestParameters: ListDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseDocumentResponse>;
108
+ /**
109
+ * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
110
+ * @summary Update Document Handler
111
+ * @param {string} documentId
112
+ * @param {UpdateDocumentRequest} updateDocumentRequest
113
+ * @param {string} [ksUat]
114
+ * @param {*} [options] Override http request option.
115
+ * @throws {RequiredError}
116
+ * @memberof DocumentsApiInterface
117
+ */
118
+ updateDocumentRaw(requestParameters: UpdateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>>;
119
+ /**
120
+ * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
121
+ * Update Document Handler
122
+ */
123
+ updateDocument(requestParameters: UpdateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
124
+ }
125
+ /**
126
+ *
127
+ */
128
+ export declare class DocumentsApi extends runtime.BaseAPI implements DocumentsApiInterface {
129
+ /**
130
+ * Create a new document with initial v0 version. The document is created as a child of the specified parent folder. An initial version (v0) is automatically created.
131
+ * Create Document Handler
132
+ */
133
+ createDocumentRaw(requestParameters: CreateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>>;
134
+ /**
135
+ * Create a new document with initial v0 version. The document is created as a child of the specified parent folder. An initial version (v0) is automatically created.
136
+ * Create Document Handler
137
+ */
138
+ createDocument(requestParameters: CreateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
139
+ /**
140
+ * Delete a document and all its contents. WARNING: This cascades to all children (versions, sections, chunks, etc.) due to parent_id ON DELETE CASCADE.
141
+ * Delete Document Handler
142
+ */
143
+ deleteDocumentRaw(requestParameters: DeleteDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
144
+ /**
145
+ * Delete a document and all its contents. WARNING: This cascades to all children (versions, sections, chunks, etc.) due to parent_id ON DELETE CASCADE.
146
+ * Delete Document Handler
147
+ */
148
+ deleteDocument(requestParameters: DeleteDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
149
+ /**
150
+ * Get a document by its document ID.
151
+ * Get Document Handler
152
+ */
153
+ getDocumentRaw(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>>;
154
+ /**
155
+ * Get a document by its document ID.
156
+ * Get Document Handler
157
+ */
158
+ getDocument(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
159
+ /**
160
+ * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_id is not provided, lists documents in the root folder.
161
+ * List Documents Handler
162
+ */
163
+ listDocumentsRaw(requestParameters: ListDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseDocumentResponse>>;
164
+ /**
165
+ * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_id is not provided, lists documents in the root folder.
166
+ * List Documents Handler
167
+ */
168
+ listDocuments(requestParameters?: ListDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseDocumentResponse>;
169
+ /**
170
+ * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
171
+ * Update Document Handler
172
+ */
173
+ updateDocumentRaw(requestParameters: UpdateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>>;
174
+ /**
175
+ * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
176
+ * Update Document Handler
177
+ */
178
+ updateDocument(requestParameters: UpdateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
179
+ }