@knowledge-stack/ksapi 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +8 -0
- package/README.md +2 -2
- package/dist/apis/DocumentsApi.d.ts +179 -0
- package/dist/apis/DocumentsApi.js +206 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -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 +1 -0
- package/dist/esm/apis/index.js +1 -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/UpdateDocumentRequest.d.ts +59 -0
- package/dist/esm/models/UpdateDocumentRequest.js +51 -0
- package/dist/esm/models/ValidationError.d.ts +12 -0
- package/dist/esm/models/ValidationError.js +4 -0
- package/dist/esm/models/index.d.ts +7 -0
- package/dist/esm/models/index.js +7 -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/UpdateDocumentRequest.d.ts +59 -0
- package/dist/models/UpdateDocumentRequest.js +59 -0
- package/dist/models/ValidationError.d.ts +12 -0
- package/dist/models/ValidationError.js +4 -0
- package/dist/models/index.d.ts +7 -0
- package/dist/models/index.js +7 -0
- package/package.json +1 -1
- package/src/apis/DocumentsApi.ts +386 -0
- package/src/apis/index.ts +1 -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/UpdateDocumentRequest.ts +102 -0
- package/src/models/ValidationError.ts +16 -0
- package/src/models/index.ts +7 -0
|
@@ -0,0 +1,202 @@
|
|
|
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 { CreateDocumentRequestToJSON, DocumentResponseFromJSON, PaginatedResponseDocumentResponseFromJSON, UpdateDocumentRequestToJSON, } from '../models/index';
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export class DocumentsApi extends runtime.BaseAPI {
|
|
29
|
+
/**
|
|
30
|
+
* 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.
|
|
31
|
+
* Create Document Handler
|
|
32
|
+
*/
|
|
33
|
+
createDocumentRaw(requestParameters, initOverrides) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
if (requestParameters['createDocumentRequest'] == null) {
|
|
36
|
+
throw new runtime.RequiredError('createDocumentRequest', 'Required parameter "createDocumentRequest" was null or undefined when calling createDocument().');
|
|
37
|
+
}
|
|
38
|
+
const queryParameters = {};
|
|
39
|
+
const headerParameters = {};
|
|
40
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
41
|
+
let urlPath = `/v1/documents`;
|
|
42
|
+
const response = yield this.request({
|
|
43
|
+
path: urlPath,
|
|
44
|
+
method: 'POST',
|
|
45
|
+
headers: headerParameters,
|
|
46
|
+
query: queryParameters,
|
|
47
|
+
body: CreateDocumentRequestToJSON(requestParameters['createDocumentRequest']),
|
|
48
|
+
}, initOverrides);
|
|
49
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => DocumentResponseFromJSON(jsonValue));
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 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.
|
|
54
|
+
* Create Document Handler
|
|
55
|
+
*/
|
|
56
|
+
createDocument(requestParameters, initOverrides) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const response = yield this.createDocumentRaw(requestParameters, initOverrides);
|
|
59
|
+
return yield response.value();
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Delete a document and all its contents. WARNING: This cascades to all children (versions, sections, chunks, etc.) due to parent_id ON DELETE CASCADE.
|
|
64
|
+
* Delete Document Handler
|
|
65
|
+
*/
|
|
66
|
+
deleteDocumentRaw(requestParameters, initOverrides) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
if (requestParameters['documentId'] == null) {
|
|
69
|
+
throw new runtime.RequiredError('documentId', 'Required parameter "documentId" was null or undefined when calling deleteDocument().');
|
|
70
|
+
}
|
|
71
|
+
const queryParameters = {};
|
|
72
|
+
const headerParameters = {};
|
|
73
|
+
let urlPath = `/v1/documents/{document_id}`;
|
|
74
|
+
urlPath = urlPath.replace(`{${"document_id"}}`, encodeURIComponent(String(requestParameters['documentId'])));
|
|
75
|
+
const response = yield this.request({
|
|
76
|
+
path: urlPath,
|
|
77
|
+
method: 'DELETE',
|
|
78
|
+
headers: headerParameters,
|
|
79
|
+
query: queryParameters,
|
|
80
|
+
}, initOverrides);
|
|
81
|
+
return new runtime.VoidApiResponse(response);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Delete a document and all its contents. WARNING: This cascades to all children (versions, sections, chunks, etc.) due to parent_id ON DELETE CASCADE.
|
|
86
|
+
* Delete Document Handler
|
|
87
|
+
*/
|
|
88
|
+
deleteDocument(requestParameters, initOverrides) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
yield this.deleteDocumentRaw(requestParameters, initOverrides);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Get a document by its document ID.
|
|
95
|
+
* Get Document Handler
|
|
96
|
+
*/
|
|
97
|
+
getDocumentRaw(requestParameters, initOverrides) {
|
|
98
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
if (requestParameters['documentId'] == null) {
|
|
100
|
+
throw new runtime.RequiredError('documentId', 'Required parameter "documentId" was null or undefined when calling getDocument().');
|
|
101
|
+
}
|
|
102
|
+
const queryParameters = {};
|
|
103
|
+
const headerParameters = {};
|
|
104
|
+
let urlPath = `/v1/documents/{document_id}`;
|
|
105
|
+
urlPath = urlPath.replace(`{${"document_id"}}`, encodeURIComponent(String(requestParameters['documentId'])));
|
|
106
|
+
const response = yield this.request({
|
|
107
|
+
path: urlPath,
|
|
108
|
+
method: 'GET',
|
|
109
|
+
headers: headerParameters,
|
|
110
|
+
query: queryParameters,
|
|
111
|
+
}, initOverrides);
|
|
112
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => DocumentResponseFromJSON(jsonValue));
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Get a document by its document ID.
|
|
117
|
+
* Get Document Handler
|
|
118
|
+
*/
|
|
119
|
+
getDocument(requestParameters, initOverrides) {
|
|
120
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
+
const response = yield this.getDocumentRaw(requestParameters, initOverrides);
|
|
122
|
+
return yield response.value();
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* 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.
|
|
127
|
+
* List Documents Handler
|
|
128
|
+
*/
|
|
129
|
+
listDocumentsRaw(requestParameters, initOverrides) {
|
|
130
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
const queryParameters = {};
|
|
132
|
+
if (requestParameters['parentId'] != null) {
|
|
133
|
+
queryParameters['parent_id'] = requestParameters['parentId'];
|
|
134
|
+
}
|
|
135
|
+
if (requestParameters['sortOrder'] != null) {
|
|
136
|
+
queryParameters['sort_order'] = requestParameters['sortOrder'];
|
|
137
|
+
}
|
|
138
|
+
if (requestParameters['limit'] != null) {
|
|
139
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
140
|
+
}
|
|
141
|
+
if (requestParameters['offset'] != null) {
|
|
142
|
+
queryParameters['offset'] = requestParameters['offset'];
|
|
143
|
+
}
|
|
144
|
+
const headerParameters = {};
|
|
145
|
+
let urlPath = `/v1/documents`;
|
|
146
|
+
const response = yield this.request({
|
|
147
|
+
path: urlPath,
|
|
148
|
+
method: 'GET',
|
|
149
|
+
headers: headerParameters,
|
|
150
|
+
query: queryParameters,
|
|
151
|
+
}, initOverrides);
|
|
152
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedResponseDocumentResponseFromJSON(jsonValue));
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* 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.
|
|
157
|
+
* List Documents Handler
|
|
158
|
+
*/
|
|
159
|
+
listDocuments() {
|
|
160
|
+
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
|
|
161
|
+
const response = yield this.listDocumentsRaw(requestParameters, initOverrides);
|
|
162
|
+
return yield response.value();
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* 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.
|
|
167
|
+
* Update Document Handler
|
|
168
|
+
*/
|
|
169
|
+
updateDocumentRaw(requestParameters, initOverrides) {
|
|
170
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
171
|
+
if (requestParameters['documentId'] == null) {
|
|
172
|
+
throw new runtime.RequiredError('documentId', 'Required parameter "documentId" was null or undefined when calling updateDocument().');
|
|
173
|
+
}
|
|
174
|
+
if (requestParameters['updateDocumentRequest'] == null) {
|
|
175
|
+
throw new runtime.RequiredError('updateDocumentRequest', 'Required parameter "updateDocumentRequest" was null or undefined when calling updateDocument().');
|
|
176
|
+
}
|
|
177
|
+
const queryParameters = {};
|
|
178
|
+
const headerParameters = {};
|
|
179
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
180
|
+
let urlPath = `/v1/documents/{document_id}`;
|
|
181
|
+
urlPath = urlPath.replace(`{${"document_id"}}`, encodeURIComponent(String(requestParameters['documentId'])));
|
|
182
|
+
const response = yield this.request({
|
|
183
|
+
path: urlPath,
|
|
184
|
+
method: 'PATCH',
|
|
185
|
+
headers: headerParameters,
|
|
186
|
+
query: queryParameters,
|
|
187
|
+
body: UpdateDocumentRequestToJSON(requestParameters['updateDocumentRequest']),
|
|
188
|
+
}, initOverrides);
|
|
189
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => DocumentResponseFromJSON(jsonValue));
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* 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.
|
|
194
|
+
* Update Document Handler
|
|
195
|
+
*/
|
|
196
|
+
updateDocument(requestParameters, initOverrides) {
|
|
197
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
198
|
+
const response = yield this.updateDocumentRaw(requestParameters, initOverrides);
|
|
199
|
+
return yield response.value();
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
}
|
package/dist/esm/apis/index.d.ts
CHANGED
package/dist/esm/apis/index.js
CHANGED
|
@@ -0,0 +1,67 @@
|
|
|
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 type { DocumentOrigin } from './DocumentOrigin';
|
|
13
|
+
import type { DocumentType } from './DocumentType';
|
|
14
|
+
/**
|
|
15
|
+
* Request to create a new document.
|
|
16
|
+
* @export
|
|
17
|
+
* @interface CreateDocumentRequest
|
|
18
|
+
*/
|
|
19
|
+
export interface CreateDocumentRequest {
|
|
20
|
+
/**
|
|
21
|
+
* Document name
|
|
22
|
+
* @type {string}
|
|
23
|
+
* @memberof CreateDocumentRequest
|
|
24
|
+
*/
|
|
25
|
+
name: string;
|
|
26
|
+
/**
|
|
27
|
+
* Parent folder PathPart ID
|
|
28
|
+
* @type {string}
|
|
29
|
+
* @memberof CreateDocumentRequest
|
|
30
|
+
*/
|
|
31
|
+
parentId: string;
|
|
32
|
+
/**
|
|
33
|
+
* Type of document (PDF, UNKNOWN, etc.)
|
|
34
|
+
* @type {DocumentType}
|
|
35
|
+
* @memberof CreateDocumentRequest
|
|
36
|
+
*/
|
|
37
|
+
documentType: DocumentType;
|
|
38
|
+
/**
|
|
39
|
+
* Origin of document (SOURCE, GENERATED)
|
|
40
|
+
* @type {DocumentOrigin}
|
|
41
|
+
* @memberof CreateDocumentRequest
|
|
42
|
+
*/
|
|
43
|
+
documentOrigin: DocumentOrigin;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Check if a given object implements the CreateDocumentRequest interface.
|
|
47
|
+
*/
|
|
48
|
+
export declare function instanceOfCreateDocumentRequest(value: object): value is CreateDocumentRequest;
|
|
49
|
+
export declare function CreateDocumentRequestFromJSON(json: any): CreateDocumentRequest;
|
|
50
|
+
export declare function CreateDocumentRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateDocumentRequest;
|
|
51
|
+
export declare function CreateDocumentRequestToJSON(json: any): CreateDocumentRequest;
|
|
52
|
+
export declare function CreateDocumentRequestToJSONTyped(value?: CreateDocumentRequest | null, ignoreDiscriminator?: boolean): any;
|
|
53
|
+
export declare const CreateDocumentRequestPropertyValidationAttributesMap: {
|
|
54
|
+
[property: string]: {
|
|
55
|
+
maxLength?: number;
|
|
56
|
+
minLength?: number;
|
|
57
|
+
pattern?: string;
|
|
58
|
+
maximum?: number;
|
|
59
|
+
exclusiveMaximum?: boolean;
|
|
60
|
+
minimum?: number;
|
|
61
|
+
exclusiveMinimum?: boolean;
|
|
62
|
+
multipleOf?: number;
|
|
63
|
+
maxItems?: number;
|
|
64
|
+
minItems?: number;
|
|
65
|
+
uniqueItems?: boolean;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
import { DocumentOriginFromJSON, DocumentOriginToJSON, } from './DocumentOrigin';
|
|
15
|
+
import { DocumentTypeFromJSON, DocumentTypeToJSON, } from './DocumentType';
|
|
16
|
+
/**
|
|
17
|
+
* Check if a given object implements the CreateDocumentRequest interface.
|
|
18
|
+
*/
|
|
19
|
+
export function instanceOfCreateDocumentRequest(value) {
|
|
20
|
+
if (!('name' in value) || value['name'] === undefined)
|
|
21
|
+
return false;
|
|
22
|
+
if (!('parentId' in value) || value['parentId'] === undefined)
|
|
23
|
+
return false;
|
|
24
|
+
if (!('documentType' in value) || value['documentType'] === undefined)
|
|
25
|
+
return false;
|
|
26
|
+
if (!('documentOrigin' in value) || value['documentOrigin'] === undefined)
|
|
27
|
+
return false;
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
export function CreateDocumentRequestFromJSON(json) {
|
|
31
|
+
return CreateDocumentRequestFromJSONTyped(json, false);
|
|
32
|
+
}
|
|
33
|
+
export function CreateDocumentRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
34
|
+
if (json == null) {
|
|
35
|
+
return json;
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
'name': json['name'],
|
|
39
|
+
'parentId': json['parent_id'],
|
|
40
|
+
'documentType': DocumentTypeFromJSON(json['document_type']),
|
|
41
|
+
'documentOrigin': DocumentOriginFromJSON(json['document_origin']),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export function CreateDocumentRequestToJSON(json) {
|
|
45
|
+
return CreateDocumentRequestToJSONTyped(json, false);
|
|
46
|
+
}
|
|
47
|
+
export function CreateDocumentRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
48
|
+
if (value == null) {
|
|
49
|
+
return value;
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
'name': value['name'],
|
|
53
|
+
'parent_id': value['parentId'],
|
|
54
|
+
'document_type': DocumentTypeToJSON(value['documentType']),
|
|
55
|
+
'document_origin': DocumentOriginToJSON(value['documentOrigin']),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export const CreateDocumentRequestPropertyValidationAttributesMap = {
|
|
59
|
+
name: {
|
|
60
|
+
maxLength: 255,
|
|
61
|
+
minLength: 1,
|
|
62
|
+
},
|
|
63
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
/**
|
|
13
|
+
* Origin of document - source/purpose (all origins are first-class).
|
|
14
|
+
* @export
|
|
15
|
+
*/
|
|
16
|
+
export declare const DocumentOrigin: {
|
|
17
|
+
readonly Source: "SOURCE";
|
|
18
|
+
readonly Generated: "GENERATED";
|
|
19
|
+
};
|
|
20
|
+
export type DocumentOrigin = typeof DocumentOrigin[keyof typeof DocumentOrigin];
|
|
21
|
+
export declare function instanceOfDocumentOrigin(value: any): boolean;
|
|
22
|
+
export declare function DocumentOriginFromJSON(json: any): DocumentOrigin;
|
|
23
|
+
export declare function DocumentOriginFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentOrigin;
|
|
24
|
+
export declare function DocumentOriginToJSON(value?: DocumentOrigin | null): any;
|
|
25
|
+
export declare function DocumentOriginToJSONTyped(value: any, ignoreDiscriminator: boolean): DocumentOrigin;
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
/**
|
|
15
|
+
* Origin of document - source/purpose (all origins are first-class).
|
|
16
|
+
* @export
|
|
17
|
+
*/
|
|
18
|
+
export const DocumentOrigin = {
|
|
19
|
+
Source: 'SOURCE',
|
|
20
|
+
Generated: 'GENERATED'
|
|
21
|
+
};
|
|
22
|
+
export function instanceOfDocumentOrigin(value) {
|
|
23
|
+
for (const key in DocumentOrigin) {
|
|
24
|
+
if (Object.prototype.hasOwnProperty.call(DocumentOrigin, key)) {
|
|
25
|
+
if (DocumentOrigin[key] === value) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
export function DocumentOriginFromJSON(json) {
|
|
33
|
+
return DocumentOriginFromJSONTyped(json, false);
|
|
34
|
+
}
|
|
35
|
+
export function DocumentOriginFromJSONTyped(json, ignoreDiscriminator) {
|
|
36
|
+
return json;
|
|
37
|
+
}
|
|
38
|
+
export function DocumentOriginToJSON(value) {
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
export function DocumentOriginToJSONTyped(value, ignoreDiscriminator) {
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
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 type { DocumentOrigin } from './DocumentOrigin';
|
|
13
|
+
import type { DocumentType } from './DocumentType';
|
|
14
|
+
import type { DocumentVersionResponse } from './DocumentVersionResponse';
|
|
15
|
+
/**
|
|
16
|
+
* Document response model.
|
|
17
|
+
* @export
|
|
18
|
+
* @interface DocumentResponse
|
|
19
|
+
*/
|
|
20
|
+
export interface DocumentResponse {
|
|
21
|
+
/**
|
|
22
|
+
* Document ID
|
|
23
|
+
* @type {string}
|
|
24
|
+
* @memberof DocumentResponse
|
|
25
|
+
*/
|
|
26
|
+
id: string;
|
|
27
|
+
/**
|
|
28
|
+
* PathPart ID
|
|
29
|
+
* @type {string}
|
|
30
|
+
* @memberof DocumentResponse
|
|
31
|
+
*/
|
|
32
|
+
pathPartId: string;
|
|
33
|
+
/**
|
|
34
|
+
* Document name
|
|
35
|
+
* @type {string}
|
|
36
|
+
* @memberof DocumentResponse
|
|
37
|
+
*/
|
|
38
|
+
name: string;
|
|
39
|
+
/**
|
|
40
|
+
* Parent PathPart ID
|
|
41
|
+
* @type {string}
|
|
42
|
+
* @memberof DocumentResponse
|
|
43
|
+
*/
|
|
44
|
+
parentId: string;
|
|
45
|
+
/**
|
|
46
|
+
* Type of document
|
|
47
|
+
* @type {DocumentType}
|
|
48
|
+
* @memberof DocumentResponse
|
|
49
|
+
*/
|
|
50
|
+
documentType: DocumentType;
|
|
51
|
+
/**
|
|
52
|
+
* Origin of document
|
|
53
|
+
* @type {DocumentOrigin}
|
|
54
|
+
* @memberof DocumentResponse
|
|
55
|
+
*/
|
|
56
|
+
documentOrigin: DocumentOrigin;
|
|
57
|
+
/**
|
|
58
|
+
* Active version ID
|
|
59
|
+
* @type {string}
|
|
60
|
+
* @memberof DocumentResponse
|
|
61
|
+
*/
|
|
62
|
+
activeVersionId: string;
|
|
63
|
+
/**
|
|
64
|
+
* Active version details
|
|
65
|
+
* @type {DocumentVersionResponse}
|
|
66
|
+
* @memberof DocumentResponse
|
|
67
|
+
*/
|
|
68
|
+
activeVersion: DocumentVersionResponse;
|
|
69
|
+
/**
|
|
70
|
+
* Tenant ID
|
|
71
|
+
* @type {string}
|
|
72
|
+
* @memberof DocumentResponse
|
|
73
|
+
*/
|
|
74
|
+
tenantId: string;
|
|
75
|
+
/**
|
|
76
|
+
* Creation timestamp
|
|
77
|
+
* @type {Date}
|
|
78
|
+
* @memberof DocumentResponse
|
|
79
|
+
*/
|
|
80
|
+
createdAt: Date;
|
|
81
|
+
/**
|
|
82
|
+
* Last update timestamp
|
|
83
|
+
* @type {Date}
|
|
84
|
+
* @memberof DocumentResponse
|
|
85
|
+
*/
|
|
86
|
+
updatedAt: Date;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Check if a given object implements the DocumentResponse interface.
|
|
90
|
+
*/
|
|
91
|
+
export declare function instanceOfDocumentResponse(value: object): value is DocumentResponse;
|
|
92
|
+
export declare function DocumentResponseFromJSON(json: any): DocumentResponse;
|
|
93
|
+
export declare function DocumentResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentResponse;
|
|
94
|
+
export declare function DocumentResponseToJSON(json: any): DocumentResponse;
|
|
95
|
+
export declare function DocumentResponseToJSONTyped(value?: DocumentResponse | null, ignoreDiscriminator?: boolean): any;
|
|
96
|
+
export declare const DocumentResponsePropertyValidationAttributesMap: {
|
|
97
|
+
[property: string]: {
|
|
98
|
+
maxLength?: number;
|
|
99
|
+
minLength?: number;
|
|
100
|
+
pattern?: string;
|
|
101
|
+
maximum?: number;
|
|
102
|
+
exclusiveMaximum?: boolean;
|
|
103
|
+
minimum?: number;
|
|
104
|
+
exclusiveMinimum?: boolean;
|
|
105
|
+
multipleOf?: number;
|
|
106
|
+
maxItems?: number;
|
|
107
|
+
minItems?: number;
|
|
108
|
+
uniqueItems?: boolean;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
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
|
+
import { DocumentOriginFromJSON, DocumentOriginToJSON, } from './DocumentOrigin';
|
|
15
|
+
import { DocumentTypeFromJSON, DocumentTypeToJSON, } from './DocumentType';
|
|
16
|
+
import { DocumentVersionResponseFromJSON, DocumentVersionResponseToJSON, } from './DocumentVersionResponse';
|
|
17
|
+
/**
|
|
18
|
+
* Check if a given object implements the DocumentResponse interface.
|
|
19
|
+
*/
|
|
20
|
+
export function instanceOfDocumentResponse(value) {
|
|
21
|
+
if (!('id' in value) || value['id'] === undefined)
|
|
22
|
+
return false;
|
|
23
|
+
if (!('pathPartId' in value) || value['pathPartId'] === undefined)
|
|
24
|
+
return false;
|
|
25
|
+
if (!('name' in value) || value['name'] === undefined)
|
|
26
|
+
return false;
|
|
27
|
+
if (!('parentId' in value) || value['parentId'] === undefined)
|
|
28
|
+
return false;
|
|
29
|
+
if (!('documentType' in value) || value['documentType'] === undefined)
|
|
30
|
+
return false;
|
|
31
|
+
if (!('documentOrigin' in value) || value['documentOrigin'] === undefined)
|
|
32
|
+
return false;
|
|
33
|
+
if (!('activeVersionId' in value) || value['activeVersionId'] === undefined)
|
|
34
|
+
return false;
|
|
35
|
+
if (!('activeVersion' in value) || value['activeVersion'] === undefined)
|
|
36
|
+
return false;
|
|
37
|
+
if (!('tenantId' in value) || value['tenantId'] === undefined)
|
|
38
|
+
return false;
|
|
39
|
+
if (!('createdAt' in value) || value['createdAt'] === undefined)
|
|
40
|
+
return false;
|
|
41
|
+
if (!('updatedAt' in value) || value['updatedAt'] === undefined)
|
|
42
|
+
return false;
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
export function DocumentResponseFromJSON(json) {
|
|
46
|
+
return DocumentResponseFromJSONTyped(json, false);
|
|
47
|
+
}
|
|
48
|
+
export function DocumentResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
49
|
+
if (json == null) {
|
|
50
|
+
return json;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
'id': json['id'],
|
|
54
|
+
'pathPartId': json['path_part_id'],
|
|
55
|
+
'name': json['name'],
|
|
56
|
+
'parentId': json['parent_id'],
|
|
57
|
+
'documentType': DocumentTypeFromJSON(json['document_type']),
|
|
58
|
+
'documentOrigin': DocumentOriginFromJSON(json['document_origin']),
|
|
59
|
+
'activeVersionId': json['active_version_id'],
|
|
60
|
+
'activeVersion': DocumentVersionResponseFromJSON(json['active_version']),
|
|
61
|
+
'tenantId': json['tenant_id'],
|
|
62
|
+
'createdAt': (new Date(json['created_at'])),
|
|
63
|
+
'updatedAt': (new Date(json['updated_at'])),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export function DocumentResponseToJSON(json) {
|
|
67
|
+
return DocumentResponseToJSONTyped(json, false);
|
|
68
|
+
}
|
|
69
|
+
export function DocumentResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
70
|
+
if (value == null) {
|
|
71
|
+
return value;
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
'id': value['id'],
|
|
75
|
+
'path_part_id': value['pathPartId'],
|
|
76
|
+
'name': value['name'],
|
|
77
|
+
'parent_id': value['parentId'],
|
|
78
|
+
'document_type': DocumentTypeToJSON(value['documentType']),
|
|
79
|
+
'document_origin': DocumentOriginToJSON(value['documentOrigin']),
|
|
80
|
+
'active_version_id': value['activeVersionId'],
|
|
81
|
+
'active_version': DocumentVersionResponseToJSON(value['activeVersion']),
|
|
82
|
+
'tenant_id': value['tenantId'],
|
|
83
|
+
'created_at': value['createdAt'].toISOString(),
|
|
84
|
+
'updated_at': value['updatedAt'].toISOString(),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
export const DocumentResponsePropertyValidationAttributesMap = {};
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
/**
|
|
13
|
+
* Type of document.
|
|
14
|
+
* @export
|
|
15
|
+
*/
|
|
16
|
+
export declare const DocumentType: {
|
|
17
|
+
readonly Pdf: "PDF";
|
|
18
|
+
readonly Unknown: "UNKNOWN";
|
|
19
|
+
};
|
|
20
|
+
export type DocumentType = typeof DocumentType[keyof typeof DocumentType];
|
|
21
|
+
export declare function instanceOfDocumentType(value: any): boolean;
|
|
22
|
+
export declare function DocumentTypeFromJSON(json: any): DocumentType;
|
|
23
|
+
export declare function DocumentTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentType;
|
|
24
|
+
export declare function DocumentTypeToJSON(value?: DocumentType | null): any;
|
|
25
|
+
export declare function DocumentTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): DocumentType;
|