@knowledge-stack/ksapi 1.6.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 (38) hide show
  1. package/.openapi-generator/FILES +4 -0
  2. package/README.md +2 -2
  3. package/dist/apis/PathPartsApi.d.ts +30 -1
  4. package/dist/apis/PathPartsApi.js +32 -0
  5. package/dist/apis/SectionsApi.d.ts +144 -0
  6. package/dist/apis/SectionsApi.js +166 -0
  7. package/dist/apis/index.d.ts +1 -0
  8. package/dist/apis/index.js +1 -0
  9. package/dist/esm/apis/PathPartsApi.d.ts +30 -1
  10. package/dist/esm/apis/PathPartsApi.js +33 -1
  11. package/dist/esm/apis/SectionsApi.d.ts +144 -0
  12. package/dist/esm/apis/SectionsApi.js +162 -0
  13. package/dist/esm/apis/index.d.ts +1 -0
  14. package/dist/esm/apis/index.js +1 -0
  15. package/dist/esm/models/CreateSectionRequest.d.ts +65 -0
  16. package/dist/esm/models/CreateSectionRequest.js +57 -0
  17. package/dist/esm/models/SectionResponse.d.ts +101 -0
  18. package/dist/esm/models/SectionResponse.js +74 -0
  19. package/dist/esm/models/UpdateSectionRequest.d.ts +65 -0
  20. package/dist/esm/models/UpdateSectionRequest.js +53 -0
  21. package/dist/esm/models/index.d.ts +3 -0
  22. package/dist/esm/models/index.js +3 -0
  23. package/dist/models/CreateSectionRequest.d.ts +65 -0
  24. package/dist/models/CreateSectionRequest.js +65 -0
  25. package/dist/models/SectionResponse.d.ts +101 -0
  26. package/dist/models/SectionResponse.js +82 -0
  27. package/dist/models/UpdateSectionRequest.d.ts +65 -0
  28. package/dist/models/UpdateSectionRequest.js +61 -0
  29. package/dist/models/index.d.ts +3 -0
  30. package/dist/models/index.js +3 -0
  31. package/package.json +1 -1
  32. package/src/apis/PathPartsApi.ts +64 -0
  33. package/src/apis/SectionsApi.ts +305 -0
  34. package/src/apis/index.ts +1 -0
  35. package/src/models/CreateSectionRequest.ts +112 -0
  36. package/src/models/SectionResponse.ts +161 -0
  37. package/src/models/UpdateSectionRequest.ts +110 -0
  38. package/src/models/index.ts +3 -0
@@ -10,6 +10,7 @@ src/apis/DocumentsApi.ts
10
10
  src/apis/FoldersApi.ts
11
11
  src/apis/InvitesApi.ts
12
12
  src/apis/PathPartsApi.ts
13
+ src/apis/SectionsApi.ts
13
14
  src/apis/TenantsApi.ts
14
15
  src/apis/UsersApi.ts
15
16
  src/apis/index.ts
@@ -17,6 +18,7 @@ src/index.ts
17
18
  src/models/CreateDocumentRequest.ts
18
19
  src/models/CreateFolderRequest.ts
19
20
  src/models/CreatePasswordUserRequest.ts
21
+ src/models/CreateSectionRequest.ts
20
22
  src/models/CreateTenantRequest.ts
21
23
  src/models/DocumentOrigin.ts
22
24
  src/models/DocumentResponse.ts
@@ -45,12 +47,14 @@ src/models/PasswordResetWithTokenRequest.ts
45
47
  src/models/PathOrder.ts
46
48
  src/models/PathPartResponse.ts
47
49
  src/models/RootResponse.ts
50
+ src/models/SectionResponse.ts
48
51
  src/models/SignInRequest.ts
49
52
  src/models/TenantResponse.ts
50
53
  src/models/TenantUserInTenantResponse.ts
51
54
  src/models/TenantUserRole.ts
52
55
  src/models/UpdateDocumentRequest.ts
53
56
  src/models/UpdateFolderRequest.ts
57
+ src/models/UpdateSectionRequest.ts
54
58
  src/models/UpdateTenantRequest.ts
55
59
  src/models/UpdateUserRequest.ts
56
60
  src/models/UserResponse.ts
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ## @knowledge-stack/ksapi@1.6.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.6.0 --save
39
+ npm install @knowledge-stack/ksapi@1.7.0 --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
@@ -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
+ }
@@ -0,0 +1,166 @@
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.SectionsApi = void 0;
26
+ const runtime = require("../runtime");
27
+ const index_1 = require("../models/index");
28
+ /**
29
+ *
30
+ */
31
+ class SectionsApi extends runtime.BaseAPI {
32
+ /**
33
+ * 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.
34
+ * Create Section Handler
35
+ */
36
+ createSectionRaw(requestParameters, initOverrides) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ if (requestParameters['createSectionRequest'] == null) {
39
+ throw new runtime.RequiredError('createSectionRequest', 'Required parameter "createSectionRequest" was null or undefined when calling createSection().');
40
+ }
41
+ const queryParameters = {};
42
+ const headerParameters = {};
43
+ headerParameters['Content-Type'] = 'application/json';
44
+ let urlPath = `/v1/sections`;
45
+ const response = yield this.request({
46
+ path: urlPath,
47
+ method: 'POST',
48
+ headers: headerParameters,
49
+ query: queryParameters,
50
+ body: (0, index_1.CreateSectionRequestToJSON)(requestParameters['createSectionRequest']),
51
+ }, initOverrides);
52
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SectionResponseFromJSON)(jsonValue));
53
+ });
54
+ }
55
+ /**
56
+ * 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.
57
+ * Create Section Handler
58
+ */
59
+ createSection(requestParameters, initOverrides) {
60
+ return __awaiter(this, void 0, void 0, function* () {
61
+ const response = yield this.createSectionRaw(requestParameters, initOverrides);
62
+ return yield response.value();
63
+ });
64
+ }
65
+ /**
66
+ * Delete a section and all its children. WARNING: This cascades to all child sections due to parent_id ON DELETE CASCADE.
67
+ * Delete Section Handler
68
+ */
69
+ deleteSectionRaw(requestParameters, initOverrides) {
70
+ return __awaiter(this, void 0, void 0, function* () {
71
+ if (requestParameters['sectionId'] == null) {
72
+ throw new runtime.RequiredError('sectionId', 'Required parameter "sectionId" was null or undefined when calling deleteSection().');
73
+ }
74
+ const queryParameters = {};
75
+ const headerParameters = {};
76
+ let urlPath = `/v1/sections/{section_id}`;
77
+ urlPath = urlPath.replace(`{${"section_id"}}`, encodeURIComponent(String(requestParameters['sectionId'])));
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 section and all its children. WARNING: This cascades to all child sections due to parent_id ON DELETE CASCADE.
89
+ * Delete Section Handler
90
+ */
91
+ deleteSection(requestParameters, initOverrides) {
92
+ return __awaiter(this, void 0, void 0, function* () {
93
+ yield this.deleteSectionRaw(requestParameters, initOverrides);
94
+ });
95
+ }
96
+ /**
97
+ * Get a section by its ID.
98
+ * Get Section Handler
99
+ */
100
+ getSectionRaw(requestParameters, initOverrides) {
101
+ return __awaiter(this, void 0, void 0, function* () {
102
+ if (requestParameters['sectionId'] == null) {
103
+ throw new runtime.RequiredError('sectionId', 'Required parameter "sectionId" was null or undefined when calling getSection().');
104
+ }
105
+ const queryParameters = {};
106
+ const headerParameters = {};
107
+ let urlPath = `/v1/sections/{section_id}`;
108
+ urlPath = urlPath.replace(`{${"section_id"}}`, encodeURIComponent(String(requestParameters['sectionId'])));
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.SectionResponseFromJSON)(jsonValue));
116
+ });
117
+ }
118
+ /**
119
+ * Get a section by its ID.
120
+ * Get Section Handler
121
+ */
122
+ getSection(requestParameters, initOverrides) {
123
+ return __awaiter(this, void 0, void 0, function* () {
124
+ const response = yield this.getSectionRaw(requestParameters, initOverrides);
125
+ return yield response.value();
126
+ });
127
+ }
128
+ /**
129
+ * 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.
130
+ * Update Section Handler
131
+ */
132
+ updateSectionRaw(requestParameters, initOverrides) {
133
+ return __awaiter(this, void 0, void 0, function* () {
134
+ if (requestParameters['sectionId'] == null) {
135
+ throw new runtime.RequiredError('sectionId', 'Required parameter "sectionId" was null or undefined when calling updateSection().');
136
+ }
137
+ if (requestParameters['updateSectionRequest'] == null) {
138
+ throw new runtime.RequiredError('updateSectionRequest', 'Required parameter "updateSectionRequest" was null or undefined when calling updateSection().');
139
+ }
140
+ const queryParameters = {};
141
+ const headerParameters = {};
142
+ headerParameters['Content-Type'] = 'application/json';
143
+ let urlPath = `/v1/sections/{section_id}`;
144
+ urlPath = urlPath.replace(`{${"section_id"}}`, encodeURIComponent(String(requestParameters['sectionId'])));
145
+ const response = yield this.request({
146
+ path: urlPath,
147
+ method: 'PATCH',
148
+ headers: headerParameters,
149
+ query: queryParameters,
150
+ body: (0, index_1.UpdateSectionRequestToJSON)(requestParameters['updateSectionRequest']),
151
+ }, initOverrides);
152
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SectionResponseFromJSON)(jsonValue));
153
+ });
154
+ }
155
+ /**
156
+ * 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.
157
+ * Update Section Handler
158
+ */
159
+ updateSection(requestParameters, initOverrides) {
160
+ return __awaiter(this, void 0, void 0, function* () {
161
+ const response = yield this.updateSectionRaw(requestParameters, initOverrides);
162
+ return yield response.value();
163
+ });
164
+ }
165
+ }
166
+ exports.SectionsApi = SectionsApi;
@@ -5,5 +5,6 @@ export * from './DocumentsApi';
5
5
  export * from './FoldersApi';
6
6
  export * from './InvitesApi';
7
7
  export * from './PathPartsApi';
8
+ export * from './SectionsApi';
8
9
  export * from './TenantsApi';
9
10
  export * from './UsersApi';
@@ -23,5 +23,6 @@ __exportStar(require("./DocumentsApi"), exports);
23
23
  __exportStar(require("./FoldersApi"), exports);
24
24
  __exportStar(require("./InvitesApi"), exports);
25
25
  __exportStar(require("./PathPartsApi"), exports);
26
+ __exportStar(require("./SectionsApi"), exports);
26
27
  __exportStar(require("./TenantsApi"), exports);
27
28
  __exportStar(require("./UsersApi"), exports);
@@ -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
@@ -21,11 +21,43 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import * as runtime from '../runtime';
24
- import { PaginatedResponsePathPartResponseFromJSON, } from '../models/index';
24
+ import { PaginatedResponsePathPartResponseFromJSON, PathPartResponseFromJSON, } from '../models/index';
25
25
  /**
26
26
  *
27
27
  */
28
28
  export class PathPartsApi extends runtime.BaseAPI {
29
+ /**
30
+ * Get a path part by its ID. Returns the path part if it exists and belongs to the user\'s tenant.
31
+ * Get Path Part Handler
32
+ */
33
+ getPathPartRaw(requestParameters, initOverrides) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ if (requestParameters['pathPartId'] == null) {
36
+ throw new runtime.RequiredError('pathPartId', 'Required parameter "pathPartId" was null or undefined when calling getPathPart().');
37
+ }
38
+ const queryParameters = {};
39
+ const headerParameters = {};
40
+ let urlPath = `/v1/path-parts/{path_part_id}`;
41
+ urlPath = urlPath.replace(`{${"path_part_id"}}`, encodeURIComponent(String(requestParameters['pathPartId'])));
42
+ const response = yield this.request({
43
+ path: urlPath,
44
+ method: 'GET',
45
+ headers: headerParameters,
46
+ query: queryParameters,
47
+ }, initOverrides);
48
+ return new runtime.JSONApiResponse(response, (jsonValue) => PathPartResponseFromJSON(jsonValue));
49
+ });
50
+ }
51
+ /**
52
+ * Get a path part by its ID. Returns the path part if it exists and belongs to the user\'s tenant.
53
+ * Get Path Part Handler
54
+ */
55
+ getPathPart(requestParameters, initOverrides) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ const response = yield this.getPathPartRaw(requestParameters, initOverrides);
58
+ return yield response.value();
59
+ });
60
+ }
29
61
  /**
30
62
  * 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.
31
63
  * List Path Parts Handler