@knowledge-stack/ksapi 1.4.0 → 1.6.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 +10 -0
- package/README.md +2 -2
- package/dist/apis/DocumentVersionsApi.d.ts +146 -0
- package/dist/apis/DocumentVersionsApi.js +168 -0
- package/dist/apis/DocumentsApi.d.ts +179 -0
- package/dist/apis/DocumentsApi.js +206 -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/DocumentsApi.d.ts +179 -0
- package/dist/esm/apis/DocumentsApi.js +202 -0
- package/dist/esm/apis/index.d.ts +2 -0
- package/dist/esm/apis/index.js +2 -0
- package/dist/esm/models/CreateDocumentRequest.d.ts +67 -0
- package/dist/esm/models/CreateDocumentRequest.js +63 -0
- package/dist/esm/models/DocumentOrigin.d.ts +25 -0
- package/dist/esm/models/DocumentOrigin.js +43 -0
- package/dist/esm/models/DocumentResponse.d.ts +110 -0
- package/dist/esm/models/DocumentResponse.js +87 -0
- package/dist/esm/models/DocumentType.d.ts +25 -0
- package/dist/esm/models/DocumentType.js +43 -0
- package/dist/esm/models/DocumentVersionResponse.d.ts +92 -0
- package/dist/esm/models/DocumentVersionResponse.js +72 -0
- package/dist/esm/models/PaginatedResponseDocumentResponse.d.ts +66 -0
- package/dist/esm/models/PaginatedResponseDocumentResponse.js +70 -0
- package/dist/esm/models/PaginatedResponseDocumentVersionResponse.d.ts +66 -0
- package/dist/esm/models/PaginatedResponseDocumentVersionResponse.js +70 -0
- package/dist/esm/models/UpdateDocumentRequest.d.ts +59 -0
- package/dist/esm/models/UpdateDocumentRequest.js +51 -0
- package/dist/esm/models/index.d.ts +8 -0
- package/dist/esm/models/index.js +8 -0
- package/dist/models/CreateDocumentRequest.d.ts +67 -0
- package/dist/models/CreateDocumentRequest.js +71 -0
- package/dist/models/DocumentOrigin.d.ts +25 -0
- package/dist/models/DocumentOrigin.js +51 -0
- package/dist/models/DocumentResponse.d.ts +110 -0
- package/dist/models/DocumentResponse.js +95 -0
- package/dist/models/DocumentType.d.ts +25 -0
- package/dist/models/DocumentType.js +51 -0
- package/dist/models/DocumentVersionResponse.d.ts +92 -0
- package/dist/models/DocumentVersionResponse.js +80 -0
- package/dist/models/PaginatedResponseDocumentResponse.d.ts +66 -0
- package/dist/models/PaginatedResponseDocumentResponse.js +78 -0
- package/dist/models/PaginatedResponseDocumentVersionResponse.d.ts +66 -0
- package/dist/models/PaginatedResponseDocumentVersionResponse.js +78 -0
- package/dist/models/UpdateDocumentRequest.d.ts +59 -0
- package/dist/models/UpdateDocumentRequest.js +59 -0
- package/dist/models/index.d.ts +8 -0
- package/dist/models/index.js +8 -0
- package/package.json +1 -1
- package/src/apis/DocumentVersionsApi.ts +303 -0
- package/src/apis/DocumentsApi.ts +386 -0
- package/src/apis/index.ts +2 -0
- package/src/models/CreateDocumentRequest.ts +131 -0
- package/src/models/DocumentOrigin.ts +53 -0
- package/src/models/DocumentResponse.ts +197 -0
- package/src/models/DocumentType.ts +53 -0
- package/src/models/DocumentVersionResponse.ts +149 -0
- package/src/models/PaginatedResponseDocumentResponse.ts +130 -0
- package/src/models/PaginatedResponseDocumentVersionResponse.ts +130 -0
- package/src/models/UpdateDocumentRequest.ts +102 -0
- package/src/models/index.ts +8 -0
package/.openapi-generator/FILES
CHANGED
|
@@ -5,6 +5,8 @@ README.md
|
|
|
5
5
|
package.json
|
|
6
6
|
src/apis/AuthApi.ts
|
|
7
7
|
src/apis/DefaultApi.ts
|
|
8
|
+
src/apis/DocumentVersionsApi.ts
|
|
9
|
+
src/apis/DocumentsApi.ts
|
|
8
10
|
src/apis/FoldersApi.ts
|
|
9
11
|
src/apis/InvitesApi.ts
|
|
10
12
|
src/apis/PathPartsApi.ts
|
|
@@ -12,9 +14,14 @@ src/apis/TenantsApi.ts
|
|
|
12
14
|
src/apis/UsersApi.ts
|
|
13
15
|
src/apis/index.ts
|
|
14
16
|
src/index.ts
|
|
17
|
+
src/models/CreateDocumentRequest.ts
|
|
15
18
|
src/models/CreateFolderRequest.ts
|
|
16
19
|
src/models/CreatePasswordUserRequest.ts
|
|
17
20
|
src/models/CreateTenantRequest.ts
|
|
21
|
+
src/models/DocumentOrigin.ts
|
|
22
|
+
src/models/DocumentResponse.ts
|
|
23
|
+
src/models/DocumentType.ts
|
|
24
|
+
src/models/DocumentVersionResponse.ts
|
|
18
25
|
src/models/EmailSentResponse.ts
|
|
19
26
|
src/models/EmailVerificationRequest.ts
|
|
20
27
|
src/models/FolderResponse.ts
|
|
@@ -25,6 +32,8 @@ src/models/InviteResponse.ts
|
|
|
25
32
|
src/models/InviteStatus.ts
|
|
26
33
|
src/models/InviteUserRequest.ts
|
|
27
34
|
src/models/OAuth2Config.ts
|
|
35
|
+
src/models/PaginatedResponseDocumentResponse.ts
|
|
36
|
+
src/models/PaginatedResponseDocumentVersionResponse.ts
|
|
28
37
|
src/models/PaginatedResponseFolderResponse.ts
|
|
29
38
|
src/models/PaginatedResponseInviteResponse.ts
|
|
30
39
|
src/models/PaginatedResponsePathPartResponse.ts
|
|
@@ -40,6 +49,7 @@ src/models/SignInRequest.ts
|
|
|
40
49
|
src/models/TenantResponse.ts
|
|
41
50
|
src/models/TenantUserInTenantResponse.ts
|
|
42
51
|
src/models/TenantUserRole.ts
|
|
52
|
+
src/models/UpdateDocumentRequest.ts
|
|
43
53
|
src/models/UpdateFolderRequest.ts
|
|
44
54
|
src/models/UpdateTenantRequest.ts
|
|
45
55
|
src/models/UpdateUserRequest.ts
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## @knowledge-stack/ksapi@1.
|
|
1
|
+
## @knowledge-stack/ksapi@1.6.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.
|
|
39
|
+
npm install @knowledge-stack/ksapi@1.6.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;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Knowledge Stack API
|
|
3
|
+
* Knowledge Stack backend API for authentication and knowledge management
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.1.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import type { CreateDocumentRequest, DocumentResponse, PaginatedResponseDocumentResponse, PathOrder, UpdateDocumentRequest } from '../models/index';
|
|
14
|
+
export interface CreateDocumentOperationRequest {
|
|
15
|
+
createDocumentRequest: CreateDocumentRequest;
|
|
16
|
+
ksUat?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface DeleteDocumentRequest {
|
|
19
|
+
documentId: string;
|
|
20
|
+
ksUat?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface GetDocumentRequest {
|
|
23
|
+
documentId: string;
|
|
24
|
+
ksUat?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ListDocumentsRequest {
|
|
27
|
+
parentId?: string;
|
|
28
|
+
sortOrder?: PathOrder;
|
|
29
|
+
limit?: number;
|
|
30
|
+
offset?: number;
|
|
31
|
+
ksUat?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface UpdateDocumentOperationRequest {
|
|
34
|
+
documentId: string;
|
|
35
|
+
updateDocumentRequest: UpdateDocumentRequest;
|
|
36
|
+
ksUat?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* DocumentsApi - interface
|
|
40
|
+
*
|
|
41
|
+
* @export
|
|
42
|
+
* @interface DocumentsApiInterface
|
|
43
|
+
*/
|
|
44
|
+
export interface DocumentsApiInterface {
|
|
45
|
+
/**
|
|
46
|
+
* Create a new document with initial v0 version. The document is created as a child of the specified parent folder. An initial version (v0) is automatically created.
|
|
47
|
+
* @summary Create Document Handler
|
|
48
|
+
* @param {CreateDocumentRequest} createDocumentRequest
|
|
49
|
+
* @param {string} [ksUat]
|
|
50
|
+
* @param {*} [options] Override http request option.
|
|
51
|
+
* @throws {RequiredError}
|
|
52
|
+
* @memberof DocumentsApiInterface
|
|
53
|
+
*/
|
|
54
|
+
createDocumentRaw(requestParameters: CreateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>>;
|
|
55
|
+
/**
|
|
56
|
+
* Create a new document with initial v0 version. The document is created as a child of the specified parent folder. An initial version (v0) is automatically created.
|
|
57
|
+
* Create Document Handler
|
|
58
|
+
*/
|
|
59
|
+
createDocument(requestParameters: CreateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
|
|
60
|
+
/**
|
|
61
|
+
* Delete a document and all its contents. WARNING: This cascades to all children (versions, sections, chunks, etc.) due to parent_id ON DELETE CASCADE.
|
|
62
|
+
* @summary Delete Document Handler
|
|
63
|
+
* @param {string} documentId
|
|
64
|
+
* @param {string} [ksUat]
|
|
65
|
+
* @param {*} [options] Override http request option.
|
|
66
|
+
* @throws {RequiredError}
|
|
67
|
+
* @memberof DocumentsApiInterface
|
|
68
|
+
*/
|
|
69
|
+
deleteDocumentRaw(requestParameters: DeleteDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
70
|
+
/**
|
|
71
|
+
* Delete a document and all its contents. WARNING: This cascades to all children (versions, sections, chunks, etc.) due to parent_id ON DELETE CASCADE.
|
|
72
|
+
* Delete Document Handler
|
|
73
|
+
*/
|
|
74
|
+
deleteDocument(requestParameters: DeleteDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* Get a document by its document ID.
|
|
77
|
+
* @summary Get Document Handler
|
|
78
|
+
* @param {string} documentId
|
|
79
|
+
* @param {string} [ksUat]
|
|
80
|
+
* @param {*} [options] Override http request option.
|
|
81
|
+
* @throws {RequiredError}
|
|
82
|
+
* @memberof DocumentsApiInterface
|
|
83
|
+
*/
|
|
84
|
+
getDocumentRaw(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>>;
|
|
85
|
+
/**
|
|
86
|
+
* Get a document by its document ID.
|
|
87
|
+
* Get Document Handler
|
|
88
|
+
*/
|
|
89
|
+
getDocument(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
|
|
90
|
+
/**
|
|
91
|
+
* List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_id is not provided, lists documents in the root folder.
|
|
92
|
+
* @summary List Documents Handler
|
|
93
|
+
* @param {string} [parentId] Parent folder PathPart ID (defaults to root)
|
|
94
|
+
* @param {PathOrder} [sortOrder] Sort order for results (default: LOGICAL)
|
|
95
|
+
* @param {number} [limit] Number of items per page
|
|
96
|
+
* @param {number} [offset] Number of items to skip
|
|
97
|
+
* @param {string} [ksUat]
|
|
98
|
+
* @param {*} [options] Override http request option.
|
|
99
|
+
* @throws {RequiredError}
|
|
100
|
+
* @memberof DocumentsApiInterface
|
|
101
|
+
*/
|
|
102
|
+
listDocumentsRaw(requestParameters: ListDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseDocumentResponse>>;
|
|
103
|
+
/**
|
|
104
|
+
* List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_id is not provided, lists documents in the root folder.
|
|
105
|
+
* List Documents Handler
|
|
106
|
+
*/
|
|
107
|
+
listDocuments(requestParameters: ListDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseDocumentResponse>;
|
|
108
|
+
/**
|
|
109
|
+
* Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
|
|
110
|
+
* @summary Update Document Handler
|
|
111
|
+
* @param {string} documentId
|
|
112
|
+
* @param {UpdateDocumentRequest} updateDocumentRequest
|
|
113
|
+
* @param {string} [ksUat]
|
|
114
|
+
* @param {*} [options] Override http request option.
|
|
115
|
+
* @throws {RequiredError}
|
|
116
|
+
* @memberof DocumentsApiInterface
|
|
117
|
+
*/
|
|
118
|
+
updateDocumentRaw(requestParameters: UpdateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>>;
|
|
119
|
+
/**
|
|
120
|
+
* Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
|
|
121
|
+
* Update Document Handler
|
|
122
|
+
*/
|
|
123
|
+
updateDocument(requestParameters: UpdateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
*
|
|
127
|
+
*/
|
|
128
|
+
export declare class DocumentsApi extends runtime.BaseAPI implements DocumentsApiInterface {
|
|
129
|
+
/**
|
|
130
|
+
* Create a new document with initial v0 version. The document is created as a child of the specified parent folder. An initial version (v0) is automatically created.
|
|
131
|
+
* Create Document Handler
|
|
132
|
+
*/
|
|
133
|
+
createDocumentRaw(requestParameters: CreateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>>;
|
|
134
|
+
/**
|
|
135
|
+
* Create a new document with initial v0 version. The document is created as a child of the specified parent folder. An initial version (v0) is automatically created.
|
|
136
|
+
* Create Document Handler
|
|
137
|
+
*/
|
|
138
|
+
createDocument(requestParameters: CreateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
|
|
139
|
+
/**
|
|
140
|
+
* Delete a document and all its contents. WARNING: This cascades to all children (versions, sections, chunks, etc.) due to parent_id ON DELETE CASCADE.
|
|
141
|
+
* Delete Document Handler
|
|
142
|
+
*/
|
|
143
|
+
deleteDocumentRaw(requestParameters: DeleteDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
144
|
+
/**
|
|
145
|
+
* Delete a document and all its contents. WARNING: This cascades to all children (versions, sections, chunks, etc.) due to parent_id ON DELETE CASCADE.
|
|
146
|
+
* Delete Document Handler
|
|
147
|
+
*/
|
|
148
|
+
deleteDocument(requestParameters: DeleteDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
149
|
+
/**
|
|
150
|
+
* Get a document by its document ID.
|
|
151
|
+
* Get Document Handler
|
|
152
|
+
*/
|
|
153
|
+
getDocumentRaw(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>>;
|
|
154
|
+
/**
|
|
155
|
+
* Get a document by its document ID.
|
|
156
|
+
* Get Document Handler
|
|
157
|
+
*/
|
|
158
|
+
getDocument(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
|
|
159
|
+
/**
|
|
160
|
+
* List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_id is not provided, lists documents in the root folder.
|
|
161
|
+
* List Documents Handler
|
|
162
|
+
*/
|
|
163
|
+
listDocumentsRaw(requestParameters: ListDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseDocumentResponse>>;
|
|
164
|
+
/**
|
|
165
|
+
* List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_id is not provided, lists documents in the root folder.
|
|
166
|
+
* List Documents Handler
|
|
167
|
+
*/
|
|
168
|
+
listDocuments(requestParameters?: ListDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseDocumentResponse>;
|
|
169
|
+
/**
|
|
170
|
+
* Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
|
|
171
|
+
* Update Document Handler
|
|
172
|
+
*/
|
|
173
|
+
updateDocumentRaw(requestParameters: UpdateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>>;
|
|
174
|
+
/**
|
|
175
|
+
* Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
|
|
176
|
+
* Update Document Handler
|
|
177
|
+
*/
|
|
178
|
+
updateDocument(requestParameters: UpdateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
|
|
179
|
+
}
|