@knowledge-stack/ksapi 1.5.0 → 1.7.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 (51) hide show
  1. package/.openapi-generator/FILES +6 -0
  2. package/README.md +2 -2
  3. package/dist/apis/DocumentVersionsApi.d.ts +146 -0
  4. package/dist/apis/DocumentVersionsApi.js +168 -0
  5. package/dist/apis/PathPartsApi.d.ts +30 -1
  6. package/dist/apis/PathPartsApi.js +32 -0
  7. package/dist/apis/SectionsApi.d.ts +144 -0
  8. package/dist/apis/SectionsApi.js +166 -0
  9. package/dist/apis/index.d.ts +2 -0
  10. package/dist/apis/index.js +2 -0
  11. package/dist/esm/apis/DocumentVersionsApi.d.ts +146 -0
  12. package/dist/esm/apis/DocumentVersionsApi.js +164 -0
  13. package/dist/esm/apis/PathPartsApi.d.ts +30 -1
  14. package/dist/esm/apis/PathPartsApi.js +33 -1
  15. package/dist/esm/apis/SectionsApi.d.ts +144 -0
  16. package/dist/esm/apis/SectionsApi.js +162 -0
  17. package/dist/esm/apis/index.d.ts +2 -0
  18. package/dist/esm/apis/index.js +2 -0
  19. package/dist/esm/models/CreateSectionRequest.d.ts +65 -0
  20. package/dist/esm/models/CreateSectionRequest.js +57 -0
  21. package/dist/esm/models/DocumentVersionResponse.d.ts +1 -1
  22. package/dist/esm/models/PaginatedResponseDocumentVersionResponse.d.ts +66 -0
  23. package/dist/esm/models/PaginatedResponseDocumentVersionResponse.js +70 -0
  24. package/dist/esm/models/SectionResponse.d.ts +101 -0
  25. package/dist/esm/models/SectionResponse.js +74 -0
  26. package/dist/esm/models/UpdateSectionRequest.d.ts +65 -0
  27. package/dist/esm/models/UpdateSectionRequest.js +53 -0
  28. package/dist/esm/models/index.d.ts +4 -0
  29. package/dist/esm/models/index.js +4 -0
  30. package/dist/models/CreateSectionRequest.d.ts +65 -0
  31. package/dist/models/CreateSectionRequest.js +65 -0
  32. package/dist/models/DocumentVersionResponse.d.ts +1 -1
  33. package/dist/models/PaginatedResponseDocumentVersionResponse.d.ts +66 -0
  34. package/dist/models/PaginatedResponseDocumentVersionResponse.js +78 -0
  35. package/dist/models/SectionResponse.d.ts +101 -0
  36. package/dist/models/SectionResponse.js +82 -0
  37. package/dist/models/UpdateSectionRequest.d.ts +65 -0
  38. package/dist/models/UpdateSectionRequest.js +61 -0
  39. package/dist/models/index.d.ts +4 -0
  40. package/dist/models/index.js +4 -0
  41. package/package.json +1 -1
  42. package/src/apis/DocumentVersionsApi.ts +303 -0
  43. package/src/apis/PathPartsApi.ts +64 -0
  44. package/src/apis/SectionsApi.ts +305 -0
  45. package/src/apis/index.ts +2 -0
  46. package/src/models/CreateSectionRequest.ts +112 -0
  47. package/src/models/DocumentVersionResponse.ts +1 -1
  48. package/src/models/PaginatedResponseDocumentVersionResponse.ts +130 -0
  49. package/src/models/SectionResponse.ts +161 -0
  50. package/src/models/UpdateSectionRequest.ts +110 -0
  51. package/src/models/index.ts +4 -0
@@ -5,10 +5,12 @@ README.md
5
5
  package.json
6
6
  src/apis/AuthApi.ts
7
7
  src/apis/DefaultApi.ts
8
+ src/apis/DocumentVersionsApi.ts
8
9
  src/apis/DocumentsApi.ts
9
10
  src/apis/FoldersApi.ts
10
11
  src/apis/InvitesApi.ts
11
12
  src/apis/PathPartsApi.ts
13
+ src/apis/SectionsApi.ts
12
14
  src/apis/TenantsApi.ts
13
15
  src/apis/UsersApi.ts
14
16
  src/apis/index.ts
@@ -16,6 +18,7 @@ src/index.ts
16
18
  src/models/CreateDocumentRequest.ts
17
19
  src/models/CreateFolderRequest.ts
18
20
  src/models/CreatePasswordUserRequest.ts
21
+ src/models/CreateSectionRequest.ts
19
22
  src/models/CreateTenantRequest.ts
20
23
  src/models/DocumentOrigin.ts
21
24
  src/models/DocumentResponse.ts
@@ -32,6 +35,7 @@ src/models/InviteStatus.ts
32
35
  src/models/InviteUserRequest.ts
33
36
  src/models/OAuth2Config.ts
34
37
  src/models/PaginatedResponseDocumentResponse.ts
38
+ src/models/PaginatedResponseDocumentVersionResponse.ts
35
39
  src/models/PaginatedResponseFolderResponse.ts
36
40
  src/models/PaginatedResponseInviteResponse.ts
37
41
  src/models/PaginatedResponsePathPartResponse.ts
@@ -43,12 +47,14 @@ src/models/PasswordResetWithTokenRequest.ts
43
47
  src/models/PathOrder.ts
44
48
  src/models/PathPartResponse.ts
45
49
  src/models/RootResponse.ts
50
+ src/models/SectionResponse.ts
46
51
  src/models/SignInRequest.ts
47
52
  src/models/TenantResponse.ts
48
53
  src/models/TenantUserInTenantResponse.ts
49
54
  src/models/TenantUserRole.ts
50
55
  src/models/UpdateDocumentRequest.ts
51
56
  src/models/UpdateFolderRequest.ts
57
+ src/models/UpdateSectionRequest.ts
52
58
  src/models/UpdateTenantRequest.ts
53
59
  src/models/UpdateUserRequest.ts
54
60
  src/models/UserResponse.ts
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ## @knowledge-stack/ksapi@1.5.0
1
+ ## @knowledge-stack/ksapi@1.7.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.5.0 --save
39
+ npm install @knowledge-stack/ksapi@1.7.0 --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
@@ -0,0 +1,146 @@
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 { DocumentVersionResponse, PaginatedResponseDocumentVersionResponse } from '../models/index';
14
+ export interface CreateDocumentVersionRequest {
15
+ documentId: string;
16
+ ksUat?: string;
17
+ }
18
+ export interface DeleteDocumentVersionRequest {
19
+ versionId: string;
20
+ ksUat?: string;
21
+ }
22
+ export interface GetDocumentVersionRequest {
23
+ versionId: string;
24
+ ksUat?: string;
25
+ }
26
+ export interface ListDocumentVersionsRequest {
27
+ documentId: string;
28
+ limit?: number;
29
+ offset?: number;
30
+ ksUat?: string;
31
+ }
32
+ /**
33
+ * DocumentVersionsApi - interface
34
+ *
35
+ * @export
36
+ * @interface DocumentVersionsApiInterface
37
+ */
38
+ export interface DocumentVersionsApiInterface {
39
+ /**
40
+ * Create a new version for a document. The version number is automatically incremented from the highest existing version.
41
+ * @summary Create Document Version Handler
42
+ * @param {string} documentId Document ID
43
+ * @param {string} [ksUat]
44
+ * @param {*} [options] Override http request option.
45
+ * @throws {RequiredError}
46
+ * @memberof DocumentVersionsApiInterface
47
+ */
48
+ createDocumentVersionRaw(requestParameters: CreateDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentVersionResponse>>;
49
+ /**
50
+ * Create a new version for a document. The version number is automatically incremented from the highest existing version.
51
+ * Create Document Version Handler
52
+ */
53
+ createDocumentVersion(requestParameters: CreateDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentVersionResponse>;
54
+ /**
55
+ * Delete a document version by its ID. Cannot delete the active version of a document.
56
+ * @summary Delete Document Version Handler
57
+ * @param {string} versionId DocumentVersion ID
58
+ * @param {string} [ksUat]
59
+ * @param {*} [options] Override http request option.
60
+ * @throws {RequiredError}
61
+ * @memberof DocumentVersionsApiInterface
62
+ */
63
+ deleteDocumentVersionRaw(requestParameters: DeleteDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
64
+ /**
65
+ * Delete a document version by its ID. Cannot delete the active version of a document.
66
+ * Delete Document Version Handler
67
+ */
68
+ deleteDocumentVersion(requestParameters: DeleteDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
69
+ /**
70
+ * Get a document version by its ID.
71
+ * @summary Get Document Version Handler
72
+ * @param {string} versionId DocumentVersion ID
73
+ * @param {string} [ksUat]
74
+ * @param {*} [options] Override http request option.
75
+ * @throws {RequiredError}
76
+ * @memberof DocumentVersionsApiInterface
77
+ */
78
+ getDocumentVersionRaw(requestParameters: GetDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentVersionResponse>>;
79
+ /**
80
+ * Get a document version by its ID.
81
+ * Get Document Version Handler
82
+ */
83
+ getDocumentVersion(requestParameters: GetDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentVersionResponse>;
84
+ /**
85
+ * List all versions for a document. Returns versions ordered by version number ascending (v0, v1, v2...).
86
+ * @summary List Document Versions Handler
87
+ * @param {string} documentId Document ID to list versions for
88
+ * @param {number} [limit] Number of items per page
89
+ * @param {number} [offset] Number of items to skip
90
+ * @param {string} [ksUat]
91
+ * @param {*} [options] Override http request option.
92
+ * @throws {RequiredError}
93
+ * @memberof DocumentVersionsApiInterface
94
+ */
95
+ listDocumentVersionsRaw(requestParameters: ListDocumentVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseDocumentVersionResponse>>;
96
+ /**
97
+ * List all versions for a document. Returns versions ordered by version number ascending (v0, v1, v2...).
98
+ * List Document Versions Handler
99
+ */
100
+ listDocumentVersions(requestParameters: ListDocumentVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseDocumentVersionResponse>;
101
+ }
102
+ /**
103
+ *
104
+ */
105
+ export declare class DocumentVersionsApi extends runtime.BaseAPI implements DocumentVersionsApiInterface {
106
+ /**
107
+ * Create a new version for a document. The version number is automatically incremented from the highest existing version.
108
+ * Create Document Version Handler
109
+ */
110
+ createDocumentVersionRaw(requestParameters: CreateDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentVersionResponse>>;
111
+ /**
112
+ * Create a new version for a document. The version number is automatically incremented from the highest existing version.
113
+ * Create Document Version Handler
114
+ */
115
+ createDocumentVersion(requestParameters: CreateDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentVersionResponse>;
116
+ /**
117
+ * Delete a document version by its ID. Cannot delete the active version of a document.
118
+ * Delete Document Version Handler
119
+ */
120
+ deleteDocumentVersionRaw(requestParameters: DeleteDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
121
+ /**
122
+ * Delete a document version by its ID. Cannot delete the active version of a document.
123
+ * Delete Document Version Handler
124
+ */
125
+ deleteDocumentVersion(requestParameters: DeleteDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
126
+ /**
127
+ * Get a document version by its ID.
128
+ * Get Document Version Handler
129
+ */
130
+ getDocumentVersionRaw(requestParameters: GetDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentVersionResponse>>;
131
+ /**
132
+ * Get a document version by its ID.
133
+ * Get Document Version Handler
134
+ */
135
+ getDocumentVersion(requestParameters: GetDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentVersionResponse>;
136
+ /**
137
+ * List all versions for a document. Returns versions ordered by version number ascending (v0, v1, v2...).
138
+ * List Document Versions Handler
139
+ */
140
+ listDocumentVersionsRaw(requestParameters: ListDocumentVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseDocumentVersionResponse>>;
141
+ /**
142
+ * List all versions for a document. Returns versions ordered by version number ascending (v0, v1, v2...).
143
+ * List Document Versions Handler
144
+ */
145
+ listDocumentVersions(requestParameters: ListDocumentVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseDocumentVersionResponse>;
146
+ }
@@ -0,0 +1,168 @@
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.DocumentVersionsApi = void 0;
26
+ const runtime = require("../runtime");
27
+ const index_1 = require("../models/index");
28
+ /**
29
+ *
30
+ */
31
+ class DocumentVersionsApi extends runtime.BaseAPI {
32
+ /**
33
+ * Create a new version for a document. The version number is automatically incremented from the highest existing version.
34
+ * Create Document Version Handler
35
+ */
36
+ createDocumentVersionRaw(requestParameters, initOverrides) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ if (requestParameters['documentId'] == null) {
39
+ throw new runtime.RequiredError('documentId', 'Required parameter "documentId" was null or undefined when calling createDocumentVersion().');
40
+ }
41
+ const queryParameters = {};
42
+ const headerParameters = {};
43
+ let urlPath = `/v1/documents/{document_id}/versions`;
44
+ urlPath = urlPath.replace(`{${"document_id"}}`, encodeURIComponent(String(requestParameters['documentId'])));
45
+ const response = yield this.request({
46
+ path: urlPath,
47
+ method: 'POST',
48
+ headers: headerParameters,
49
+ query: queryParameters,
50
+ }, initOverrides);
51
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.DocumentVersionResponseFromJSON)(jsonValue));
52
+ });
53
+ }
54
+ /**
55
+ * Create a new version for a document. The version number is automatically incremented from the highest existing version.
56
+ * Create Document Version Handler
57
+ */
58
+ createDocumentVersion(requestParameters, initOverrides) {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ const response = yield this.createDocumentVersionRaw(requestParameters, initOverrides);
61
+ return yield response.value();
62
+ });
63
+ }
64
+ /**
65
+ * Delete a document version by its ID. Cannot delete the active version of a document.
66
+ * Delete Document Version Handler
67
+ */
68
+ deleteDocumentVersionRaw(requestParameters, initOverrides) {
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ if (requestParameters['versionId'] == null) {
71
+ throw new runtime.RequiredError('versionId', 'Required parameter "versionId" was null or undefined when calling deleteDocumentVersion().');
72
+ }
73
+ const queryParameters = {};
74
+ const headerParameters = {};
75
+ let urlPath = `/v1/document_versions/{version_id}`;
76
+ urlPath = urlPath.replace(`{${"version_id"}}`, encodeURIComponent(String(requestParameters['versionId'])));
77
+ const response = yield this.request({
78
+ path: urlPath,
79
+ method: 'DELETE',
80
+ headers: headerParameters,
81
+ query: queryParameters,
82
+ }, initOverrides);
83
+ return new runtime.VoidApiResponse(response);
84
+ });
85
+ }
86
+ /**
87
+ * Delete a document version by its ID. Cannot delete the active version of a document.
88
+ * Delete Document Version Handler
89
+ */
90
+ deleteDocumentVersion(requestParameters, initOverrides) {
91
+ return __awaiter(this, void 0, void 0, function* () {
92
+ yield this.deleteDocumentVersionRaw(requestParameters, initOverrides);
93
+ });
94
+ }
95
+ /**
96
+ * Get a document version by its ID.
97
+ * Get Document Version Handler
98
+ */
99
+ getDocumentVersionRaw(requestParameters, initOverrides) {
100
+ return __awaiter(this, void 0, void 0, function* () {
101
+ if (requestParameters['versionId'] == null) {
102
+ throw new runtime.RequiredError('versionId', 'Required parameter "versionId" was null or undefined when calling getDocumentVersion().');
103
+ }
104
+ const queryParameters = {};
105
+ const headerParameters = {};
106
+ let urlPath = `/v1/document_versions/{version_id}`;
107
+ urlPath = urlPath.replace(`{${"version_id"}}`, encodeURIComponent(String(requestParameters['versionId'])));
108
+ const response = yield this.request({
109
+ path: urlPath,
110
+ method: 'GET',
111
+ headers: headerParameters,
112
+ query: queryParameters,
113
+ }, initOverrides);
114
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.DocumentVersionResponseFromJSON)(jsonValue));
115
+ });
116
+ }
117
+ /**
118
+ * Get a document version by its ID.
119
+ * Get Document Version Handler
120
+ */
121
+ getDocumentVersion(requestParameters, initOverrides) {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ const response = yield this.getDocumentVersionRaw(requestParameters, initOverrides);
124
+ return yield response.value();
125
+ });
126
+ }
127
+ /**
128
+ * List all versions for a document. Returns versions ordered by version number ascending (v0, v1, v2...).
129
+ * List Document Versions Handler
130
+ */
131
+ listDocumentVersionsRaw(requestParameters, initOverrides) {
132
+ return __awaiter(this, void 0, void 0, function* () {
133
+ if (requestParameters['documentId'] == null) {
134
+ throw new runtime.RequiredError('documentId', 'Required parameter "documentId" was null or undefined when calling listDocumentVersions().');
135
+ }
136
+ const queryParameters = {};
137
+ if (requestParameters['documentId'] != null) {
138
+ queryParameters['document_id'] = requestParameters['documentId'];
139
+ }
140
+ if (requestParameters['limit'] != null) {
141
+ queryParameters['limit'] = requestParameters['limit'];
142
+ }
143
+ if (requestParameters['offset'] != null) {
144
+ queryParameters['offset'] = requestParameters['offset'];
145
+ }
146
+ const headerParameters = {};
147
+ let urlPath = `/v1/document_versions`;
148
+ const response = yield this.request({
149
+ path: urlPath,
150
+ method: 'GET',
151
+ headers: headerParameters,
152
+ query: queryParameters,
153
+ }, initOverrides);
154
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedResponseDocumentVersionResponseFromJSON)(jsonValue));
155
+ });
156
+ }
157
+ /**
158
+ * List all versions for a document. Returns versions ordered by version number ascending (v0, v1, v2...).
159
+ * List Document Versions Handler
160
+ */
161
+ listDocumentVersions(requestParameters, initOverrides) {
162
+ return __awaiter(this, void 0, void 0, function* () {
163
+ const response = yield this.listDocumentVersionsRaw(requestParameters, initOverrides);
164
+ return yield response.value();
165
+ });
166
+ }
167
+ }
168
+ exports.DocumentVersionsApi = DocumentVersionsApi;
@@ -10,7 +10,11 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { PaginatedResponsePathPartResponse, PathOrder } from '../models/index';
13
+ import type { PaginatedResponsePathPartResponse, PathOrder, PathPartResponse } from '../models/index';
14
+ export interface GetPathPartRequest {
15
+ pathPartId: string;
16
+ ksUat?: string;
17
+ }
14
18
  export interface ListPathPartsRequest {
15
19
  parentId?: string;
16
20
  includeDocuments?: boolean;
@@ -27,6 +31,21 @@ export interface ListPathPartsRequest {
27
31
  * @interface PathPartsApiInterface
28
32
  */
29
33
  export interface PathPartsApiInterface {
34
+ /**
35
+ * Get a path part by its ID. Returns the path part if it exists and belongs to the user\'s tenant.
36
+ * @summary Get Path Part Handler
37
+ * @param {string} pathPartId
38
+ * @param {string} [ksUat]
39
+ * @param {*} [options] Override http request option.
40
+ * @throws {RequiredError}
41
+ * @memberof PathPartsApiInterface
42
+ */
43
+ getPathPartRaw(requestParameters: GetPathPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PathPartResponse>>;
44
+ /**
45
+ * Get a path part by its ID. Returns the path part if it exists and belongs to the user\'s tenant.
46
+ * Get Path Part Handler
47
+ */
48
+ getPathPart(requestParameters: GetPathPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PathPartResponse>;
30
49
  /**
31
50
  * List path parts under a parent with flexible filtering and traversal. This is a generic endpoint for traversing the path hierarchy. It can return folders, documents, or both depending on the filters provided. - If parent_id is not provided, lists contents of the root folder. - If include_documents is True, includes both FOLDER and DOCUMENT types. Documents act as traversal boundaries (their children are not traversed). - max_depth controls how deep to traverse (1 = direct children only). - sort_order controls the ordering: LOGICAL (linked-list), NAME, UPDATED_AT, CREATED_AT.
32
51
  * @summary List Path Parts Handler
@@ -52,6 +71,16 @@ export interface PathPartsApiInterface {
52
71
  *
53
72
  */
54
73
  export declare class PathPartsApi extends runtime.BaseAPI implements PathPartsApiInterface {
74
+ /**
75
+ * Get a path part by its ID. Returns the path part if it exists and belongs to the user\'s tenant.
76
+ * Get Path Part Handler
77
+ */
78
+ getPathPartRaw(requestParameters: GetPathPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PathPartResponse>>;
79
+ /**
80
+ * Get a path part by its ID. Returns the path part if it exists and belongs to the user\'s tenant.
81
+ * Get Path Part Handler
82
+ */
83
+ getPathPart(requestParameters: GetPathPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PathPartResponse>;
55
84
  /**
56
85
  * List path parts under a parent with flexible filtering and traversal. This is a generic endpoint for traversing the path hierarchy. It can return folders, documents, or both depending on the filters provided. - If parent_id is not provided, lists contents of the root folder. - If include_documents is True, includes both FOLDER and DOCUMENT types. Documents act as traversal boundaries (their children are not traversed). - max_depth controls how deep to traverse (1 = direct children only). - sort_order controls the ordering: LOGICAL (linked-list), NAME, UPDATED_AT, CREATED_AT.
57
86
  * List Path Parts Handler
@@ -29,6 +29,38 @@ const index_1 = require("../models/index");
29
29
  *
30
30
  */
31
31
  class PathPartsApi extends runtime.BaseAPI {
32
+ /**
33
+ * Get a path part by its ID. Returns the path part if it exists and belongs to the user\'s tenant.
34
+ * Get Path Part Handler
35
+ */
36
+ getPathPartRaw(requestParameters, initOverrides) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ if (requestParameters['pathPartId'] == null) {
39
+ throw new runtime.RequiredError('pathPartId', 'Required parameter "pathPartId" was null or undefined when calling getPathPart().');
40
+ }
41
+ const queryParameters = {};
42
+ const headerParameters = {};
43
+ let urlPath = `/v1/path-parts/{path_part_id}`;
44
+ urlPath = urlPath.replace(`{${"path_part_id"}}`, encodeURIComponent(String(requestParameters['pathPartId'])));
45
+ const response = yield this.request({
46
+ path: urlPath,
47
+ method: 'GET',
48
+ headers: headerParameters,
49
+ query: queryParameters,
50
+ }, initOverrides);
51
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PathPartResponseFromJSON)(jsonValue));
52
+ });
53
+ }
54
+ /**
55
+ * Get a path part by its ID. Returns the path part if it exists and belongs to the user\'s tenant.
56
+ * Get Path Part Handler
57
+ */
58
+ getPathPart(requestParameters, initOverrides) {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ const response = yield this.getPathPartRaw(requestParameters, initOverrides);
61
+ return yield response.value();
62
+ });
63
+ }
32
64
  /**
33
65
  * List path parts under a parent with flexible filtering and traversal. This is a generic endpoint for traversing the path hierarchy. It can return folders, documents, or both depending on the filters provided. - If parent_id is not provided, lists contents of the root folder. - If include_documents is True, includes both FOLDER and DOCUMENT types. Documents act as traversal boundaries (their children are not traversed). - max_depth controls how deep to traverse (1 = direct children only). - sort_order controls the ordering: LOGICAL (linked-list), NAME, UPDATED_AT, CREATED_AT.
34
66
  * List Path Parts Handler
@@ -0,0 +1,144 @@
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 { CreateSectionRequest, SectionResponse, UpdateSectionRequest } from '../models/index';
14
+ export interface CreateSectionOperationRequest {
15
+ createSectionRequest: CreateSectionRequest;
16
+ ksUat?: string;
17
+ }
18
+ export interface DeleteSectionRequest {
19
+ sectionId: string;
20
+ ksUat?: string;
21
+ }
22
+ export interface GetSectionRequest {
23
+ sectionId: string;
24
+ ksUat?: string;
25
+ }
26
+ export interface UpdateSectionOperationRequest {
27
+ sectionId: string;
28
+ updateSectionRequest: UpdateSectionRequest;
29
+ ksUat?: string;
30
+ }
31
+ /**
32
+ * SectionsApi - interface
33
+ *
34
+ * @export
35
+ * @interface SectionsApiInterface
36
+ */
37
+ export interface SectionsApiInterface {
38
+ /**
39
+ * Create a new section. The section is created as a child of the specified parent (must be DOCUMENT_VERSION or SECTION). If prev_sibling_path_id is provided, the section is inserted after that sibling; otherwise it is appended to the end of the sibling list.
40
+ * @summary Create Section Handler
41
+ * @param {CreateSectionRequest} createSectionRequest
42
+ * @param {string} [ksUat]
43
+ * @param {*} [options] Override http request option.
44
+ * @throws {RequiredError}
45
+ * @memberof SectionsApiInterface
46
+ */
47
+ createSectionRaw(requestParameters: CreateSectionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SectionResponse>>;
48
+ /**
49
+ * Create a new section. The section is created as a child of the specified parent (must be DOCUMENT_VERSION or SECTION). If prev_sibling_path_id is provided, the section is inserted after that sibling; otherwise it is appended to the end of the sibling list.
50
+ * Create Section Handler
51
+ */
52
+ createSection(requestParameters: CreateSectionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SectionResponse>;
53
+ /**
54
+ * Delete a section and all its children. WARNING: This cascades to all child sections due to parent_id ON DELETE CASCADE.
55
+ * @summary Delete Section Handler
56
+ * @param {string} sectionId
57
+ * @param {string} [ksUat]
58
+ * @param {*} [options] Override http request option.
59
+ * @throws {RequiredError}
60
+ * @memberof SectionsApiInterface
61
+ */
62
+ deleteSectionRaw(requestParameters: DeleteSectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
63
+ /**
64
+ * Delete a section and all its children. WARNING: This cascades to all child sections due to parent_id ON DELETE CASCADE.
65
+ * Delete Section Handler
66
+ */
67
+ deleteSection(requestParameters: DeleteSectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
68
+ /**
69
+ * Get a section by its ID.
70
+ * @summary Get Section Handler
71
+ * @param {string} sectionId
72
+ * @param {string} [ksUat]
73
+ * @param {*} [options] Override http request option.
74
+ * @throws {RequiredError}
75
+ * @memberof SectionsApiInterface
76
+ */
77
+ getSectionRaw(requestParameters: GetSectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SectionResponse>>;
78
+ /**
79
+ * Get a section by its ID.
80
+ * Get Section Handler
81
+ */
82
+ getSection(requestParameters: GetSectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SectionResponse>;
83
+ /**
84
+ * Update a section. Can update name, page_number, and/or reorder within siblings. To move: provide prev_sibling_path_id OR move_to_head (not both). Moving is only allowed within the same document version. Note: Section names can contain any characters. The corresponding path_part.name will be automatically normalized by a database trigger.
85
+ * @summary Update Section Handler
86
+ * @param {string} sectionId
87
+ * @param {UpdateSectionRequest} updateSectionRequest
88
+ * @param {string} [ksUat]
89
+ * @param {*} [options] Override http request option.
90
+ * @throws {RequiredError}
91
+ * @memberof SectionsApiInterface
92
+ */
93
+ updateSectionRaw(requestParameters: UpdateSectionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SectionResponse>>;
94
+ /**
95
+ * Update a section. Can update name, page_number, and/or reorder within siblings. To move: provide prev_sibling_path_id OR move_to_head (not both). Moving is only allowed within the same document version. Note: Section names can contain any characters. The corresponding path_part.name will be automatically normalized by a database trigger.
96
+ * Update Section Handler
97
+ */
98
+ updateSection(requestParameters: UpdateSectionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SectionResponse>;
99
+ }
100
+ /**
101
+ *
102
+ */
103
+ export declare class SectionsApi extends runtime.BaseAPI implements SectionsApiInterface {
104
+ /**
105
+ * Create a new section. The section is created as a child of the specified parent (must be DOCUMENT_VERSION or SECTION). If prev_sibling_path_id is provided, the section is inserted after that sibling; otherwise it is appended to the end of the sibling list.
106
+ * Create Section Handler
107
+ */
108
+ createSectionRaw(requestParameters: CreateSectionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SectionResponse>>;
109
+ /**
110
+ * Create a new section. The section is created as a child of the specified parent (must be DOCUMENT_VERSION or SECTION). If prev_sibling_path_id is provided, the section is inserted after that sibling; otherwise it is appended to the end of the sibling list.
111
+ * Create Section Handler
112
+ */
113
+ createSection(requestParameters: CreateSectionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SectionResponse>;
114
+ /**
115
+ * Delete a section and all its children. WARNING: This cascades to all child sections due to parent_id ON DELETE CASCADE.
116
+ * Delete Section Handler
117
+ */
118
+ deleteSectionRaw(requestParameters: DeleteSectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
119
+ /**
120
+ * Delete a section and all its children. WARNING: This cascades to all child sections due to parent_id ON DELETE CASCADE.
121
+ * Delete Section Handler
122
+ */
123
+ deleteSection(requestParameters: DeleteSectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
124
+ /**
125
+ * Get a section by its ID.
126
+ * Get Section Handler
127
+ */
128
+ getSectionRaw(requestParameters: GetSectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SectionResponse>>;
129
+ /**
130
+ * Get a section by its ID.
131
+ * Get Section Handler
132
+ */
133
+ getSection(requestParameters: GetSectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SectionResponse>;
134
+ /**
135
+ * Update a section. Can update name, page_number, and/or reorder within siblings. To move: provide prev_sibling_path_id OR move_to_head (not both). Moving is only allowed within the same document version. Note: Section names can contain any characters. The corresponding path_part.name will be automatically normalized by a database trigger.
136
+ * Update Section Handler
137
+ */
138
+ updateSectionRaw(requestParameters: UpdateSectionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SectionResponse>>;
139
+ /**
140
+ * Update a section. Can update name, page_number, and/or reorder within siblings. To move: provide prev_sibling_path_id OR move_to_head (not both). Moving is only allowed within the same document version. Note: Section names can contain any characters. The corresponding path_part.name will be automatically normalized by a database trigger.
141
+ * Update Section Handler
142
+ */
143
+ updateSection(requestParameters: UpdateSectionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SectionResponse>;
144
+ }