@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.
- package/.openapi-generator/FILES +6 -0
- package/README.md +2 -2
- package/dist/apis/DocumentVersionsApi.d.ts +146 -0
- package/dist/apis/DocumentVersionsApi.js +168 -0
- package/dist/apis/PathPartsApi.d.ts +30 -1
- package/dist/apis/PathPartsApi.js +32 -0
- package/dist/apis/SectionsApi.d.ts +144 -0
- package/dist/apis/SectionsApi.js +166 -0
- package/dist/apis/index.d.ts +2 -0
- package/dist/apis/index.js +2 -0
- package/dist/esm/apis/DocumentVersionsApi.d.ts +146 -0
- package/dist/esm/apis/DocumentVersionsApi.js +164 -0
- package/dist/esm/apis/PathPartsApi.d.ts +30 -1
- package/dist/esm/apis/PathPartsApi.js +33 -1
- package/dist/esm/apis/SectionsApi.d.ts +144 -0
- package/dist/esm/apis/SectionsApi.js +162 -0
- package/dist/esm/apis/index.d.ts +2 -0
- package/dist/esm/apis/index.js +2 -0
- package/dist/esm/models/CreateSectionRequest.d.ts +65 -0
- package/dist/esm/models/CreateSectionRequest.js +57 -0
- package/dist/esm/models/DocumentVersionResponse.d.ts +1 -1
- package/dist/esm/models/PaginatedResponseDocumentVersionResponse.d.ts +66 -0
- package/dist/esm/models/PaginatedResponseDocumentVersionResponse.js +70 -0
- package/dist/esm/models/SectionResponse.d.ts +101 -0
- package/dist/esm/models/SectionResponse.js +74 -0
- package/dist/esm/models/UpdateSectionRequest.d.ts +65 -0
- package/dist/esm/models/UpdateSectionRequest.js +53 -0
- package/dist/esm/models/index.d.ts +4 -0
- package/dist/esm/models/index.js +4 -0
- package/dist/models/CreateSectionRequest.d.ts +65 -0
- package/dist/models/CreateSectionRequest.js +65 -0
- package/dist/models/DocumentVersionResponse.d.ts +1 -1
- package/dist/models/PaginatedResponseDocumentVersionResponse.d.ts +66 -0
- package/dist/models/PaginatedResponseDocumentVersionResponse.js +78 -0
- package/dist/models/SectionResponse.d.ts +101 -0
- package/dist/models/SectionResponse.js +82 -0
- package/dist/models/UpdateSectionRequest.d.ts +65 -0
- package/dist/models/UpdateSectionRequest.js +61 -0
- package/dist/models/index.d.ts +4 -0
- package/dist/models/index.js +4 -0
- package/package.json +1 -1
- package/src/apis/DocumentVersionsApi.ts +303 -0
- package/src/apis/PathPartsApi.ts +64 -0
- package/src/apis/SectionsApi.ts +305 -0
- package/src/apis/index.ts +2 -0
- package/src/models/CreateSectionRequest.ts +112 -0
- package/src/models/DocumentVersionResponse.ts +1 -1
- package/src/models/PaginatedResponseDocumentVersionResponse.ts +130 -0
- package/src/models/SectionResponse.ts +161 -0
- package/src/models/UpdateSectionRequest.ts +110 -0
- package/src/models/index.ts +4 -0
|
@@ -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;
|
package/dist/apis/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export * from './AuthApi';
|
|
2
2
|
export * from './DefaultApi';
|
|
3
|
+
export * from './DocumentVersionsApi';
|
|
3
4
|
export * from './DocumentsApi';
|
|
4
5
|
export * from './FoldersApi';
|
|
5
6
|
export * from './InvitesApi';
|
|
6
7
|
export * from './PathPartsApi';
|
|
8
|
+
export * from './SectionsApi';
|
|
7
9
|
export * from './TenantsApi';
|
|
8
10
|
export * from './UsersApi';
|
package/dist/apis/index.js
CHANGED
|
@@ -18,9 +18,11 @@ 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("./DocumentVersionsApi"), exports);
|
|
21
22
|
__exportStar(require("./DocumentsApi"), exports);
|
|
22
23
|
__exportStar(require("./FoldersApi"), exports);
|
|
23
24
|
__exportStar(require("./InvitesApi"), exports);
|
|
24
25
|
__exportStar(require("./PathPartsApi"), exports);
|
|
26
|
+
__exportStar(require("./SectionsApi"), exports);
|
|
25
27
|
__exportStar(require("./TenantsApi"), exports);
|
|
26
28
|
__exportStar(require("./UsersApi"), exports);
|
|
@@ -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,164 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Knowledge Stack API
|
|
5
|
+
* Knowledge Stack backend API for authentication and knowledge management
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.1.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
import * as runtime from '../runtime';
|
|
24
|
+
import { DocumentVersionResponseFromJSON, PaginatedResponseDocumentVersionResponseFromJSON, } from '../models/index';
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export class DocumentVersionsApi extends runtime.BaseAPI {
|
|
29
|
+
/**
|
|
30
|
+
* Create a new version for a document. The version number is automatically incremented from the highest existing version.
|
|
31
|
+
* Create Document Version Handler
|
|
32
|
+
*/
|
|
33
|
+
createDocumentVersionRaw(requestParameters, initOverrides) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
if (requestParameters['documentId'] == null) {
|
|
36
|
+
throw new runtime.RequiredError('documentId', 'Required parameter "documentId" was null or undefined when calling createDocumentVersion().');
|
|
37
|
+
}
|
|
38
|
+
const queryParameters = {};
|
|
39
|
+
const headerParameters = {};
|
|
40
|
+
let urlPath = `/v1/documents/{document_id}/versions`;
|
|
41
|
+
urlPath = urlPath.replace(`{${"document_id"}}`, encodeURIComponent(String(requestParameters['documentId'])));
|
|
42
|
+
const response = yield this.request({
|
|
43
|
+
path: urlPath,
|
|
44
|
+
method: 'POST',
|
|
45
|
+
headers: headerParameters,
|
|
46
|
+
query: queryParameters,
|
|
47
|
+
}, initOverrides);
|
|
48
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => DocumentVersionResponseFromJSON(jsonValue));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Create a new version for a document. The version number is automatically incremented from the highest existing version.
|
|
53
|
+
* Create Document Version Handler
|
|
54
|
+
*/
|
|
55
|
+
createDocumentVersion(requestParameters, initOverrides) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
const response = yield this.createDocumentVersionRaw(requestParameters, initOverrides);
|
|
58
|
+
return yield response.value();
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Delete a document version by its ID. Cannot delete the active version of a document.
|
|
63
|
+
* Delete Document Version Handler
|
|
64
|
+
*/
|
|
65
|
+
deleteDocumentVersionRaw(requestParameters, initOverrides) {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
if (requestParameters['versionId'] == null) {
|
|
68
|
+
throw new runtime.RequiredError('versionId', 'Required parameter "versionId" was null or undefined when calling deleteDocumentVersion().');
|
|
69
|
+
}
|
|
70
|
+
const queryParameters = {};
|
|
71
|
+
const headerParameters = {};
|
|
72
|
+
let urlPath = `/v1/document_versions/{version_id}`;
|
|
73
|
+
urlPath = urlPath.replace(`{${"version_id"}}`, encodeURIComponent(String(requestParameters['versionId'])));
|
|
74
|
+
const response = yield this.request({
|
|
75
|
+
path: urlPath,
|
|
76
|
+
method: 'DELETE',
|
|
77
|
+
headers: headerParameters,
|
|
78
|
+
query: queryParameters,
|
|
79
|
+
}, initOverrides);
|
|
80
|
+
return new runtime.VoidApiResponse(response);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Delete a document version by its ID. Cannot delete the active version of a document.
|
|
85
|
+
* Delete Document Version Handler
|
|
86
|
+
*/
|
|
87
|
+
deleteDocumentVersion(requestParameters, initOverrides) {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
yield this.deleteDocumentVersionRaw(requestParameters, initOverrides);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Get a document version by its ID.
|
|
94
|
+
* Get Document Version Handler
|
|
95
|
+
*/
|
|
96
|
+
getDocumentVersionRaw(requestParameters, initOverrides) {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
if (requestParameters['versionId'] == null) {
|
|
99
|
+
throw new runtime.RequiredError('versionId', 'Required parameter "versionId" was null or undefined when calling getDocumentVersion().');
|
|
100
|
+
}
|
|
101
|
+
const queryParameters = {};
|
|
102
|
+
const headerParameters = {};
|
|
103
|
+
let urlPath = `/v1/document_versions/{version_id}`;
|
|
104
|
+
urlPath = urlPath.replace(`{${"version_id"}}`, encodeURIComponent(String(requestParameters['versionId'])));
|
|
105
|
+
const response = yield this.request({
|
|
106
|
+
path: urlPath,
|
|
107
|
+
method: 'GET',
|
|
108
|
+
headers: headerParameters,
|
|
109
|
+
query: queryParameters,
|
|
110
|
+
}, initOverrides);
|
|
111
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => DocumentVersionResponseFromJSON(jsonValue));
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Get a document version by its ID.
|
|
116
|
+
* Get Document Version Handler
|
|
117
|
+
*/
|
|
118
|
+
getDocumentVersion(requestParameters, initOverrides) {
|
|
119
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
+
const response = yield this.getDocumentVersionRaw(requestParameters, initOverrides);
|
|
121
|
+
return yield response.value();
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* List all versions for a document. Returns versions ordered by version number ascending (v0, v1, v2...).
|
|
126
|
+
* List Document Versions Handler
|
|
127
|
+
*/
|
|
128
|
+
listDocumentVersionsRaw(requestParameters, initOverrides) {
|
|
129
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
+
if (requestParameters['documentId'] == null) {
|
|
131
|
+
throw new runtime.RequiredError('documentId', 'Required parameter "documentId" was null or undefined when calling listDocumentVersions().');
|
|
132
|
+
}
|
|
133
|
+
const queryParameters = {};
|
|
134
|
+
if (requestParameters['documentId'] != null) {
|
|
135
|
+
queryParameters['document_id'] = requestParameters['documentId'];
|
|
136
|
+
}
|
|
137
|
+
if (requestParameters['limit'] != null) {
|
|
138
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
139
|
+
}
|
|
140
|
+
if (requestParameters['offset'] != null) {
|
|
141
|
+
queryParameters['offset'] = requestParameters['offset'];
|
|
142
|
+
}
|
|
143
|
+
const headerParameters = {};
|
|
144
|
+
let urlPath = `/v1/document_versions`;
|
|
145
|
+
const response = yield this.request({
|
|
146
|
+
path: urlPath,
|
|
147
|
+
method: 'GET',
|
|
148
|
+
headers: headerParameters,
|
|
149
|
+
query: queryParameters,
|
|
150
|
+
}, initOverrides);
|
|
151
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedResponseDocumentVersionResponseFromJSON(jsonValue));
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* List all versions for a document. Returns versions ordered by version number ascending (v0, v1, v2...).
|
|
156
|
+
* List Document Versions Handler
|
|
157
|
+
*/
|
|
158
|
+
listDocumentVersions(requestParameters, initOverrides) {
|
|
159
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
160
|
+
const response = yield this.listDocumentVersionsRaw(requestParameters, initOverrides);
|
|
161
|
+
return yield response.value();
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
@@ -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
|