@knowledge-stack/ksapi 1.15.0 → 1.16.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 +7 -0
- package/README.md +2 -2
- package/dist/apis/AuthApi.d.ts +30 -1
- package/dist/apis/AuthApi.js +39 -0
- package/dist/apis/DocumentVersionsApi.d.ts +32 -1
- package/dist/apis/DocumentVersionsApi.js +37 -0
- package/dist/apis/DocumentsApi.d.ts +34 -1
- package/dist/apis/DocumentsApi.js +59 -0
- package/dist/apis/TenantsApi.d.ts +4 -4
- package/dist/apis/TenantsApi.js +2 -2
- package/dist/esm/apis/AuthApi.d.ts +30 -1
- package/dist/esm/apis/AuthApi.js +40 -1
- package/dist/esm/apis/DocumentVersionsApi.d.ts +32 -1
- package/dist/esm/apis/DocumentVersionsApi.js +38 -1
- package/dist/esm/apis/DocumentsApi.d.ts +34 -1
- package/dist/esm/apis/DocumentsApi.js +60 -1
- package/dist/esm/apis/TenantsApi.d.ts +4 -4
- package/dist/esm/apis/TenantsApi.js +2 -2
- package/dist/esm/models/AssumeUserRequest.d.ts +53 -0
- package/dist/esm/models/AssumeUserRequest.js +48 -0
- package/dist/esm/models/AssumeUserResponse.d.ts +47 -0
- package/dist/esm/models/AssumeUserResponse.js +44 -0
- package/dist/esm/models/DocumentVersionMetadata.d.ts +89 -0
- package/dist/esm/models/DocumentVersionMetadata.js +55 -0
- package/dist/esm/models/DocumentVersionMetadataUpdate.d.ts +87 -0
- package/dist/esm/models/DocumentVersionMetadataUpdate.js +55 -0
- package/dist/esm/models/DocumentVersionResponse.d.ts +13 -0
- package/dist/esm/models/DocumentVersionResponse.js +5 -0
- package/dist/esm/models/IngestDocumentResponse.d.ts +59 -0
- package/dist/esm/models/IngestDocumentResponse.js +52 -0
- package/dist/esm/models/PipelineState.d.ts +78 -0
- package/dist/esm/models/PipelineState.js +57 -0
- package/dist/esm/models/PipelineStatus.d.ts +27 -0
- package/dist/esm/models/PipelineStatus.js +45 -0
- package/dist/esm/models/index.d.ts +7 -0
- package/dist/esm/models/index.js +7 -0
- package/dist/models/AssumeUserRequest.d.ts +53 -0
- package/dist/models/AssumeUserRequest.js +56 -0
- package/dist/models/AssumeUserResponse.d.ts +47 -0
- package/dist/models/AssumeUserResponse.js +52 -0
- package/dist/models/DocumentVersionMetadata.d.ts +89 -0
- package/dist/models/DocumentVersionMetadata.js +63 -0
- package/dist/models/DocumentVersionMetadataUpdate.d.ts +87 -0
- package/dist/models/DocumentVersionMetadataUpdate.js +63 -0
- package/dist/models/DocumentVersionResponse.d.ts +13 -0
- package/dist/models/DocumentVersionResponse.js +5 -0
- package/dist/models/IngestDocumentResponse.d.ts +59 -0
- package/dist/models/IngestDocumentResponse.js +60 -0
- package/dist/models/PipelineState.d.ts +78 -0
- package/dist/models/PipelineState.js +65 -0
- package/dist/models/PipelineStatus.d.ts +27 -0
- package/dist/models/PipelineStatus.js +53 -0
- package/dist/models/index.d.ts +7 -0
- package/dist/models/index.js +7 -0
- package/package.json +1 -1
- package/src/apis/AuthApi.ts +80 -0
- package/src/apis/DocumentVersionsApi.ts +76 -0
- package/src/apis/DocumentsApi.ts +103 -0
- package/src/apis/TenantsApi.ts +4 -4
- package/src/models/AssumeUserRequest.ts +92 -0
- package/src/models/AssumeUserResponse.ts +83 -0
- package/src/models/DocumentVersionMetadata.ts +143 -0
- package/src/models/DocumentVersionMetadataUpdate.ts +141 -0
- package/src/models/DocumentVersionResponse.ts +24 -0
- package/src/models/IngestDocumentResponse.ts +101 -0
- package/src/models/PipelineState.ts +134 -0
- package/src/models/PipelineStatus.ts +55 -0
- package/src/models/index.ts +7 -0
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.PipelineStatus = void 0;
|
|
17
|
+
exports.instanceOfPipelineStatus = instanceOfPipelineStatus;
|
|
18
|
+
exports.PipelineStatusFromJSON = PipelineStatusFromJSON;
|
|
19
|
+
exports.PipelineStatusFromJSONTyped = PipelineStatusFromJSONTyped;
|
|
20
|
+
exports.PipelineStatusToJSON = PipelineStatusToJSON;
|
|
21
|
+
exports.PipelineStatusToJSONTyped = PipelineStatusToJSONTyped;
|
|
22
|
+
/**
|
|
23
|
+
* Status of the ingestion pipeline workflow.
|
|
24
|
+
* @export
|
|
25
|
+
*/
|
|
26
|
+
exports.PipelineStatus = {
|
|
27
|
+
Pending: 'pending',
|
|
28
|
+
Processing: 'processing',
|
|
29
|
+
Completed: 'completed',
|
|
30
|
+
Failed: 'failed'
|
|
31
|
+
};
|
|
32
|
+
function instanceOfPipelineStatus(value) {
|
|
33
|
+
for (const key in exports.PipelineStatus) {
|
|
34
|
+
if (Object.prototype.hasOwnProperty.call(exports.PipelineStatus, key)) {
|
|
35
|
+
if (exports.PipelineStatus[key] === value) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
function PipelineStatusFromJSON(json) {
|
|
43
|
+
return PipelineStatusFromJSONTyped(json, false);
|
|
44
|
+
}
|
|
45
|
+
function PipelineStatusFromJSONTyped(json, ignoreDiscriminator) {
|
|
46
|
+
return json;
|
|
47
|
+
}
|
|
48
|
+
function PipelineStatusToJSON(value) {
|
|
49
|
+
return value;
|
|
50
|
+
}
|
|
51
|
+
function PipelineStatusToJSONTyped(value, ignoreDiscriminator) {
|
|
52
|
+
return value;
|
|
53
|
+
}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export * from './AssumeUserRequest';
|
|
2
|
+
export * from './AssumeUserResponse';
|
|
1
3
|
export * from './ChunkLineageResponse';
|
|
2
4
|
export * from './ChunkMetadataInput';
|
|
3
5
|
export * from './ChunkMetadataOutput';
|
|
@@ -19,6 +21,8 @@ export * from './DocumentContentPathPart';
|
|
|
19
21
|
export * from './DocumentOrigin';
|
|
20
22
|
export * from './DocumentResponse';
|
|
21
23
|
export * from './DocumentType';
|
|
24
|
+
export * from './DocumentVersionMetadata';
|
|
25
|
+
export * from './DocumentVersionMetadataUpdate';
|
|
22
26
|
export * from './DocumentVersionResponse';
|
|
23
27
|
export * from './EmailSentResponse';
|
|
24
28
|
export * from './EmailVerificationRequest';
|
|
@@ -28,6 +32,7 @@ export * from './FolderResponse';
|
|
|
28
32
|
export * from './HTTPValidationError';
|
|
29
33
|
export * from './HealthCheckResponse';
|
|
30
34
|
export * from './IdpType';
|
|
35
|
+
export * from './IngestDocumentResponse';
|
|
31
36
|
export * from './InviteResponse';
|
|
32
37
|
export * from './InviteStatus';
|
|
33
38
|
export * from './InviteUserRequest';
|
|
@@ -56,6 +61,8 @@ export * from './PathOrder';
|
|
|
56
61
|
export * from './PathPartResponse';
|
|
57
62
|
export * from './PermissionCapability';
|
|
58
63
|
export * from './PermissionResponse';
|
|
64
|
+
export * from './PipelineState';
|
|
65
|
+
export * from './PipelineStatus';
|
|
59
66
|
export * from './Polygon';
|
|
60
67
|
export * from './PolygonReference';
|
|
61
68
|
export * from './RootResponse';
|
package/dist/models/index.js
CHANGED
|
@@ -16,6 +16,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
/* tslint:disable */
|
|
18
18
|
/* eslint-disable */
|
|
19
|
+
__exportStar(require("./AssumeUserRequest"), exports);
|
|
20
|
+
__exportStar(require("./AssumeUserResponse"), exports);
|
|
19
21
|
__exportStar(require("./ChunkLineageResponse"), exports);
|
|
20
22
|
__exportStar(require("./ChunkMetadataInput"), exports);
|
|
21
23
|
__exportStar(require("./ChunkMetadataOutput"), exports);
|
|
@@ -37,6 +39,8 @@ __exportStar(require("./DocumentContentPathPart"), exports);
|
|
|
37
39
|
__exportStar(require("./DocumentOrigin"), exports);
|
|
38
40
|
__exportStar(require("./DocumentResponse"), exports);
|
|
39
41
|
__exportStar(require("./DocumentType"), exports);
|
|
42
|
+
__exportStar(require("./DocumentVersionMetadata"), exports);
|
|
43
|
+
__exportStar(require("./DocumentVersionMetadataUpdate"), exports);
|
|
40
44
|
__exportStar(require("./DocumentVersionResponse"), exports);
|
|
41
45
|
__exportStar(require("./EmailSentResponse"), exports);
|
|
42
46
|
__exportStar(require("./EmailVerificationRequest"), exports);
|
|
@@ -46,6 +50,7 @@ __exportStar(require("./FolderResponse"), exports);
|
|
|
46
50
|
__exportStar(require("./HTTPValidationError"), exports);
|
|
47
51
|
__exportStar(require("./HealthCheckResponse"), exports);
|
|
48
52
|
__exportStar(require("./IdpType"), exports);
|
|
53
|
+
__exportStar(require("./IngestDocumentResponse"), exports);
|
|
49
54
|
__exportStar(require("./InviteResponse"), exports);
|
|
50
55
|
__exportStar(require("./InviteStatus"), exports);
|
|
51
56
|
__exportStar(require("./InviteUserRequest"), exports);
|
|
@@ -74,6 +79,8 @@ __exportStar(require("./PathOrder"), exports);
|
|
|
74
79
|
__exportStar(require("./PathPartResponse"), exports);
|
|
75
80
|
__exportStar(require("./PermissionCapability"), exports);
|
|
76
81
|
__exportStar(require("./PermissionResponse"), exports);
|
|
82
|
+
__exportStar(require("./PipelineState"), exports);
|
|
83
|
+
__exportStar(require("./PipelineStatus"), exports);
|
|
77
84
|
__exportStar(require("./Polygon"), exports);
|
|
78
85
|
__exportStar(require("./PolygonReference"), exports);
|
|
79
86
|
__exportStar(require("./RootResponse"), exports);
|
package/package.json
CHANGED
package/src/apis/AuthApi.ts
CHANGED
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
|
+
AssumeUserRequest,
|
|
19
|
+
AssumeUserResponse,
|
|
18
20
|
CreatePasswordUserRequest,
|
|
19
21
|
EmailSentResponse,
|
|
20
22
|
EmailVerificationRequest,
|
|
@@ -26,6 +28,10 @@ import type {
|
|
|
26
28
|
UserResponse,
|
|
27
29
|
} from '../models/index';
|
|
28
30
|
import {
|
|
31
|
+
AssumeUserRequestFromJSON,
|
|
32
|
+
AssumeUserRequestToJSON,
|
|
33
|
+
AssumeUserResponseFromJSON,
|
|
34
|
+
AssumeUserResponseToJSON,
|
|
29
35
|
CreatePasswordUserRequestFromJSON,
|
|
30
36
|
CreatePasswordUserRequestToJSON,
|
|
31
37
|
EmailSentResponseFromJSON,
|
|
@@ -46,6 +52,11 @@ import {
|
|
|
46
52
|
UserResponseToJSON,
|
|
47
53
|
} from '../models/index';
|
|
48
54
|
|
|
55
|
+
export interface AssumeUserOperationRequest {
|
|
56
|
+
xAdminApiKey: string;
|
|
57
|
+
assumeUserRequest: AssumeUserRequest;
|
|
58
|
+
}
|
|
59
|
+
|
|
49
60
|
export interface CreatePasswordUserOperationRequest {
|
|
50
61
|
createPasswordUserRequest: CreatePasswordUserRequest;
|
|
51
62
|
}
|
|
@@ -97,6 +108,23 @@ export interface SendPwResetEmailRequest {
|
|
|
97
108
|
* @interface AuthApiInterface
|
|
98
109
|
*/
|
|
99
110
|
export interface AuthApiInterface {
|
|
111
|
+
/**
|
|
112
|
+
* Generate a UAT for a given user/tenant pair. Authenticated via static ADMIN_API_KEY. Intended for worker service to obtain identity credentials for user-aware API operations. Validates that the user is a member of the requested tenant before minting the token.
|
|
113
|
+
* @summary Assume User Identity Handler
|
|
114
|
+
* @param {string} xAdminApiKey
|
|
115
|
+
* @param {AssumeUserRequest} assumeUserRequest
|
|
116
|
+
* @param {*} [options] Override http request option.
|
|
117
|
+
* @throws {RequiredError}
|
|
118
|
+
* @memberof AuthApiInterface
|
|
119
|
+
*/
|
|
120
|
+
assumeUserRaw(requestParameters: AssumeUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AssumeUserResponse>>;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Generate a UAT for a given user/tenant pair. Authenticated via static ADMIN_API_KEY. Intended for worker service to obtain identity credentials for user-aware API operations. Validates that the user is a member of the requested tenant before minting the token.
|
|
124
|
+
* Assume User Identity Handler
|
|
125
|
+
*/
|
|
126
|
+
assumeUser(requestParameters: AssumeUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AssumeUserResponse>;
|
|
127
|
+
|
|
100
128
|
/**
|
|
101
129
|
*
|
|
102
130
|
* @summary Create Password User Handler
|
|
@@ -268,6 +296,58 @@ export interface AuthApiInterface {
|
|
|
268
296
|
*/
|
|
269
297
|
export class AuthApi extends runtime.BaseAPI implements AuthApiInterface {
|
|
270
298
|
|
|
299
|
+
/**
|
|
300
|
+
* Generate a UAT for a given user/tenant pair. Authenticated via static ADMIN_API_KEY. Intended for worker service to obtain identity credentials for user-aware API operations. Validates that the user is a member of the requested tenant before minting the token.
|
|
301
|
+
* Assume User Identity Handler
|
|
302
|
+
*/
|
|
303
|
+
async assumeUserRaw(requestParameters: AssumeUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AssumeUserResponse>> {
|
|
304
|
+
if (requestParameters['xAdminApiKey'] == null) {
|
|
305
|
+
throw new runtime.RequiredError(
|
|
306
|
+
'xAdminApiKey',
|
|
307
|
+
'Required parameter "xAdminApiKey" was null or undefined when calling assumeUser().'
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
if (requestParameters['assumeUserRequest'] == null) {
|
|
312
|
+
throw new runtime.RequiredError(
|
|
313
|
+
'assumeUserRequest',
|
|
314
|
+
'Required parameter "assumeUserRequest" was null or undefined when calling assumeUser().'
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
const queryParameters: any = {};
|
|
319
|
+
|
|
320
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
321
|
+
|
|
322
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
323
|
+
|
|
324
|
+
if (requestParameters['xAdminApiKey'] != null) {
|
|
325
|
+
headerParameters['x-admin-api-key'] = String(requestParameters['xAdminApiKey']);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
let urlPath = `/v1/auth/assume_user`;
|
|
330
|
+
|
|
331
|
+
const response = await this.request({
|
|
332
|
+
path: urlPath,
|
|
333
|
+
method: 'POST',
|
|
334
|
+
headers: headerParameters,
|
|
335
|
+
query: queryParameters,
|
|
336
|
+
body: AssumeUserRequestToJSON(requestParameters['assumeUserRequest']),
|
|
337
|
+
}, initOverrides);
|
|
338
|
+
|
|
339
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AssumeUserResponseFromJSON(jsonValue));
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Generate a UAT for a given user/tenant pair. Authenticated via static ADMIN_API_KEY. Intended for worker service to obtain identity credentials for user-aware API operations. Validates that the user is a member of the requested tenant before minting the token.
|
|
344
|
+
* Assume User Identity Handler
|
|
345
|
+
*/
|
|
346
|
+
async assumeUser(requestParameters: AssumeUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AssumeUserResponse> {
|
|
347
|
+
const response = await this.assumeUserRaw(requestParameters, initOverrides);
|
|
348
|
+
return await response.value();
|
|
349
|
+
}
|
|
350
|
+
|
|
271
351
|
/**
|
|
272
352
|
* Create Password User Handler
|
|
273
353
|
*/
|
|
@@ -15,12 +15,15 @@
|
|
|
15
15
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
|
+
DocumentVersionMetadataUpdate,
|
|
18
19
|
DocumentVersionResponse,
|
|
19
20
|
HTTPValidationError,
|
|
20
21
|
PaginatedResponseDocumentContentPathPart,
|
|
21
22
|
PaginatedResponseDocumentVersionResponse,
|
|
22
23
|
} from '../models/index';
|
|
23
24
|
import {
|
|
25
|
+
DocumentVersionMetadataUpdateFromJSON,
|
|
26
|
+
DocumentVersionMetadataUpdateToJSON,
|
|
24
27
|
DocumentVersionResponseFromJSON,
|
|
25
28
|
DocumentVersionResponseToJSON,
|
|
26
29
|
HTTPValidationErrorFromJSON,
|
|
@@ -61,6 +64,12 @@ export interface ListDocumentVersionsRequest {
|
|
|
61
64
|
ksUat?: string;
|
|
62
65
|
}
|
|
63
66
|
|
|
67
|
+
export interface UpdateDocumentVersionMetadataRequest {
|
|
68
|
+
versionId: string;
|
|
69
|
+
documentVersionMetadataUpdate: DocumentVersionMetadataUpdate;
|
|
70
|
+
ksUat?: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
64
73
|
/**
|
|
65
74
|
* DocumentVersionsApi - interface
|
|
66
75
|
*
|
|
@@ -158,6 +167,24 @@ export interface DocumentVersionsApiInterface {
|
|
|
158
167
|
*/
|
|
159
168
|
listDocumentVersions(requestParameters: ListDocumentVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseDocumentVersionResponse>;
|
|
160
169
|
|
|
170
|
+
/**
|
|
171
|
+
* Merge metadata fields into an existing document version\'s metadata. Only non-null fields in the request body are merged; existing metadata fields not present in the request are preserved.
|
|
172
|
+
* @summary Update Document Version Metadata Handler
|
|
173
|
+
* @param {string} versionId DocumentVersion ID
|
|
174
|
+
* @param {DocumentVersionMetadataUpdate} documentVersionMetadataUpdate
|
|
175
|
+
* @param {string} [ksUat]
|
|
176
|
+
* @param {*} [options] Override http request option.
|
|
177
|
+
* @throws {RequiredError}
|
|
178
|
+
* @memberof DocumentVersionsApiInterface
|
|
179
|
+
*/
|
|
180
|
+
updateDocumentVersionMetadataRaw(requestParameters: UpdateDocumentVersionMetadataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentVersionResponse>>;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Merge metadata fields into an existing document version\'s metadata. Only non-null fields in the request body are merged; existing metadata fields not present in the request are preserved.
|
|
184
|
+
* Update Document Version Metadata Handler
|
|
185
|
+
*/
|
|
186
|
+
updateDocumentVersionMetadata(requestParameters: UpdateDocumentVersionMetadataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentVersionResponse>;
|
|
187
|
+
|
|
161
188
|
}
|
|
162
189
|
|
|
163
190
|
/**
|
|
@@ -382,4 +409,53 @@ export class DocumentVersionsApi extends runtime.BaseAPI implements DocumentVers
|
|
|
382
409
|
return await response.value();
|
|
383
410
|
}
|
|
384
411
|
|
|
412
|
+
/**
|
|
413
|
+
* Merge metadata fields into an existing document version\'s metadata. Only non-null fields in the request body are merged; existing metadata fields not present in the request are preserved.
|
|
414
|
+
* Update Document Version Metadata Handler
|
|
415
|
+
*/
|
|
416
|
+
async updateDocumentVersionMetadataRaw(requestParameters: UpdateDocumentVersionMetadataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentVersionResponse>> {
|
|
417
|
+
if (requestParameters['versionId'] == null) {
|
|
418
|
+
throw new runtime.RequiredError(
|
|
419
|
+
'versionId',
|
|
420
|
+
'Required parameter "versionId" was null or undefined when calling updateDocumentVersionMetadata().'
|
|
421
|
+
);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
if (requestParameters['documentVersionMetadataUpdate'] == null) {
|
|
425
|
+
throw new runtime.RequiredError(
|
|
426
|
+
'documentVersionMetadataUpdate',
|
|
427
|
+
'Required parameter "documentVersionMetadataUpdate" was null or undefined when calling updateDocumentVersionMetadata().'
|
|
428
|
+
);
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
const queryParameters: any = {};
|
|
432
|
+
|
|
433
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
434
|
+
|
|
435
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
let urlPath = `/v1/document_versions/{version_id}/metadata`;
|
|
439
|
+
urlPath = urlPath.replace(`{${"version_id"}}`, encodeURIComponent(String(requestParameters['versionId'])));
|
|
440
|
+
|
|
441
|
+
const response = await this.request({
|
|
442
|
+
path: urlPath,
|
|
443
|
+
method: 'PATCH',
|
|
444
|
+
headers: headerParameters,
|
|
445
|
+
query: queryParameters,
|
|
446
|
+
body: DocumentVersionMetadataUpdateToJSON(requestParameters['documentVersionMetadataUpdate']),
|
|
447
|
+
}, initOverrides);
|
|
448
|
+
|
|
449
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => DocumentVersionResponseFromJSON(jsonValue));
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Merge metadata fields into an existing document version\'s metadata. Only non-null fields in the request body are merged; existing metadata fields not present in the request are preserved.
|
|
454
|
+
* Update Document Version Metadata Handler
|
|
455
|
+
*/
|
|
456
|
+
async updateDocumentVersionMetadata(requestParameters: UpdateDocumentVersionMetadataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentVersionResponse> {
|
|
457
|
+
const response = await this.updateDocumentVersionMetadataRaw(requestParameters, initOverrides);
|
|
458
|
+
return await response.value();
|
|
459
|
+
}
|
|
460
|
+
|
|
385
461
|
}
|
package/src/apis/DocumentsApi.ts
CHANGED
|
@@ -18,6 +18,7 @@ import type {
|
|
|
18
18
|
CreateDocumentRequest,
|
|
19
19
|
DocumentResponse,
|
|
20
20
|
HTTPValidationError,
|
|
21
|
+
IngestDocumentResponse,
|
|
21
22
|
PaginatedResponseDocumentResponse,
|
|
22
23
|
PathOrder,
|
|
23
24
|
UpdateDocumentRequest,
|
|
@@ -29,6 +30,8 @@ import {
|
|
|
29
30
|
DocumentResponseToJSON,
|
|
30
31
|
HTTPValidationErrorFromJSON,
|
|
31
32
|
HTTPValidationErrorToJSON,
|
|
33
|
+
IngestDocumentResponseFromJSON,
|
|
34
|
+
IngestDocumentResponseToJSON,
|
|
32
35
|
PaginatedResponseDocumentResponseFromJSON,
|
|
33
36
|
PaginatedResponseDocumentResponseToJSON,
|
|
34
37
|
PathOrderFromJSON,
|
|
@@ -52,6 +55,13 @@ export interface GetDocumentRequest {
|
|
|
52
55
|
ksUat?: string;
|
|
53
56
|
}
|
|
54
57
|
|
|
58
|
+
export interface IngestDocumentRequest {
|
|
59
|
+
file: Blob;
|
|
60
|
+
folderId: string;
|
|
61
|
+
ksUat?: string;
|
|
62
|
+
name?: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
55
65
|
export interface ListDocumentsRequest {
|
|
56
66
|
parentId?: string;
|
|
57
67
|
sortOrder?: PathOrder;
|
|
@@ -124,6 +134,25 @@ export interface DocumentsApiInterface {
|
|
|
124
134
|
*/
|
|
125
135
|
getDocument(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
|
|
126
136
|
|
|
137
|
+
/**
|
|
138
|
+
* Upload a file, create document + version, and trigger ingestion workflow. Returns 201 with the Temporal workflow ID. Design decision — S3 upload happens *before* the DB write: We pre-generate document and version UUIDs, upload the source file to S3, and only then persist the DB records. If the DB write fails, an orphaned S3 object is left behind (acceptable storage cost cleaned up by the S3 deletion cronjob). The reverse — a committed DB record pointing to a missing S3 object — would crash downstream pipeline activities that expect the file to exist.
|
|
139
|
+
* @summary Ingest Document Handler
|
|
140
|
+
* @param {Blob} file
|
|
141
|
+
* @param {string} folderId Parent folder ID
|
|
142
|
+
* @param {string} [ksUat]
|
|
143
|
+
* @param {string} [name] Document name (defaults to filename)
|
|
144
|
+
* @param {*} [options] Override http request option.
|
|
145
|
+
* @throws {RequiredError}
|
|
146
|
+
* @memberof DocumentsApiInterface
|
|
147
|
+
*/
|
|
148
|
+
ingestDocumentRaw(requestParameters: IngestDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IngestDocumentResponse>>;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Upload a file, create document + version, and trigger ingestion workflow. Returns 201 with the Temporal workflow ID. Design decision — S3 upload happens *before* the DB write: We pre-generate document and version UUIDs, upload the source file to S3, and only then persist the DB records. If the DB write fails, an orphaned S3 object is left behind (acceptable storage cost cleaned up by the S3 deletion cronjob). The reverse — a committed DB record pointing to a missing S3 object — would crash downstream pipeline activities that expect the file to exist.
|
|
152
|
+
* Ingest Document Handler
|
|
153
|
+
*/
|
|
154
|
+
ingestDocument(requestParameters: IngestDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IngestDocumentResponse>;
|
|
155
|
+
|
|
127
156
|
/**
|
|
128
157
|
* 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.
|
|
129
158
|
* @summary List Documents Handler
|
|
@@ -287,6 +316,80 @@ export class DocumentsApi extends runtime.BaseAPI implements DocumentsApiInterfa
|
|
|
287
316
|
return await response.value();
|
|
288
317
|
}
|
|
289
318
|
|
|
319
|
+
/**
|
|
320
|
+
* Upload a file, create document + version, and trigger ingestion workflow. Returns 201 with the Temporal workflow ID. Design decision — S3 upload happens *before* the DB write: We pre-generate document and version UUIDs, upload the source file to S3, and only then persist the DB records. If the DB write fails, an orphaned S3 object is left behind (acceptable storage cost cleaned up by the S3 deletion cronjob). The reverse — a committed DB record pointing to a missing S3 object — would crash downstream pipeline activities that expect the file to exist.
|
|
321
|
+
* Ingest Document Handler
|
|
322
|
+
*/
|
|
323
|
+
async ingestDocumentRaw(requestParameters: IngestDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IngestDocumentResponse>> {
|
|
324
|
+
if (requestParameters['file'] == null) {
|
|
325
|
+
throw new runtime.RequiredError(
|
|
326
|
+
'file',
|
|
327
|
+
'Required parameter "file" was null or undefined when calling ingestDocument().'
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if (requestParameters['folderId'] == null) {
|
|
332
|
+
throw new runtime.RequiredError(
|
|
333
|
+
'folderId',
|
|
334
|
+
'Required parameter "folderId" was null or undefined when calling ingestDocument().'
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
const queryParameters: any = {};
|
|
339
|
+
|
|
340
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
341
|
+
|
|
342
|
+
const consumes: runtime.Consume[] = [
|
|
343
|
+
{ contentType: 'multipart/form-data' },
|
|
344
|
+
];
|
|
345
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
346
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
347
|
+
|
|
348
|
+
let formParams: { append(param: string, value: any): any };
|
|
349
|
+
let useForm = false;
|
|
350
|
+
// use FormData to transmit files using content-type "multipart/form-data"
|
|
351
|
+
useForm = canConsumeForm;
|
|
352
|
+
if (useForm) {
|
|
353
|
+
formParams = new FormData();
|
|
354
|
+
} else {
|
|
355
|
+
formParams = new URLSearchParams();
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
if (requestParameters['file'] != null) {
|
|
359
|
+
formParams.append('file', requestParameters['file'] as any);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
if (requestParameters['folderId'] != null) {
|
|
363
|
+
formParams.append('folder_id', requestParameters['folderId'] as any);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
if (requestParameters['name'] != null) {
|
|
367
|
+
formParams.append('name', requestParameters['name'] as any);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
let urlPath = `/v1/documents/ingest`;
|
|
372
|
+
|
|
373
|
+
const response = await this.request({
|
|
374
|
+
path: urlPath,
|
|
375
|
+
method: 'POST',
|
|
376
|
+
headers: headerParameters,
|
|
377
|
+
query: queryParameters,
|
|
378
|
+
body: formParams,
|
|
379
|
+
}, initOverrides);
|
|
380
|
+
|
|
381
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => IngestDocumentResponseFromJSON(jsonValue));
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Upload a file, create document + version, and trigger ingestion workflow. Returns 201 with the Temporal workflow ID. Design decision — S3 upload happens *before* the DB write: We pre-generate document and version UUIDs, upload the source file to S3, and only then persist the DB records. If the DB write fails, an orphaned S3 object is left behind (acceptable storage cost cleaned up by the S3 deletion cronjob). The reverse — a committed DB record pointing to a missing S3 object — would crash downstream pipeline activities that expect the file to exist.
|
|
386
|
+
* Ingest Document Handler
|
|
387
|
+
*/
|
|
388
|
+
async ingestDocument(requestParameters: IngestDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IngestDocumentResponse> {
|
|
389
|
+
const response = await this.ingestDocumentRaw(requestParameters, initOverrides);
|
|
390
|
+
return await response.value();
|
|
391
|
+
}
|
|
392
|
+
|
|
290
393
|
/**
|
|
291
394
|
* 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.
|
|
292
395
|
* List Documents Handler
|
package/src/apis/TenantsApi.ts
CHANGED
|
@@ -96,7 +96,7 @@ export interface TenantsApiInterface {
|
|
|
96
96
|
createTenant(requestParameters: CreateTenantOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TenantResponse>;
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
|
-
* Delete a tenant. Requires OWNER role in the tenant.
|
|
99
|
+
* Delete a tenant. Requires OWNER role in the tenant. Deletes the tenant\'s S3 bucket after the DB transaction commits.
|
|
100
100
|
* @summary Delete Tenant
|
|
101
101
|
* @param {string} tenantId
|
|
102
102
|
* @param {string} [ksUat]
|
|
@@ -107,7 +107,7 @@ export interface TenantsApiInterface {
|
|
|
107
107
|
deleteTenantRaw(requestParameters: DeleteTenantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
|
-
* Delete a tenant. Requires OWNER role in the tenant.
|
|
110
|
+
* Delete a tenant. Requires OWNER role in the tenant. Deletes the tenant\'s S3 bucket after the DB transaction commits.
|
|
111
111
|
* Delete Tenant
|
|
112
112
|
*/
|
|
113
113
|
deleteTenant(requestParameters: DeleteTenantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
@@ -233,7 +233,7 @@ export class TenantsApi extends runtime.BaseAPI implements TenantsApiInterface {
|
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
/**
|
|
236
|
-
* Delete a tenant. Requires OWNER role in the tenant.
|
|
236
|
+
* Delete a tenant. Requires OWNER role in the tenant. Deletes the tenant\'s S3 bucket after the DB transaction commits.
|
|
237
237
|
* Delete Tenant
|
|
238
238
|
*/
|
|
239
239
|
async deleteTenantRaw(requestParameters: DeleteTenantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
@@ -263,7 +263,7 @@ export class TenantsApi extends runtime.BaseAPI implements TenantsApiInterface {
|
|
|
263
263
|
}
|
|
264
264
|
|
|
265
265
|
/**
|
|
266
|
-
* Delete a tenant. Requires OWNER role in the tenant.
|
|
266
|
+
* Delete a tenant. Requires OWNER role in the tenant. Deletes the tenant\'s S3 bucket after the DB transaction commits.
|
|
267
267
|
* Delete Tenant
|
|
268
268
|
*/
|
|
269
269
|
async deleteTenant(requestParameters: DeleteTenantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
@@ -0,0 +1,92 @@
|
|
|
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
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface AssumeUserRequest
|
|
20
|
+
*/
|
|
21
|
+
export interface AssumeUserRequest {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof AssumeUserRequest
|
|
26
|
+
*/
|
|
27
|
+
tenantId: string;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof AssumeUserRequest
|
|
32
|
+
*/
|
|
33
|
+
userId: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Check if a given object implements the AssumeUserRequest interface.
|
|
38
|
+
*/
|
|
39
|
+
export function instanceOfAssumeUserRequest(value: object): value is AssumeUserRequest {
|
|
40
|
+
if (!('tenantId' in value) || value['tenantId'] === undefined) return false;
|
|
41
|
+
if (!('userId' in value) || value['userId'] === undefined) return false;
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function AssumeUserRequestFromJSON(json: any): AssumeUserRequest {
|
|
46
|
+
return AssumeUserRequestFromJSONTyped(json, false);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function AssumeUserRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AssumeUserRequest {
|
|
50
|
+
if (json == null) {
|
|
51
|
+
return json;
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
|
|
55
|
+
'tenantId': json['tenant_id'],
|
|
56
|
+
'userId': json['user_id'],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function AssumeUserRequestToJSON(json: any): AssumeUserRequest {
|
|
61
|
+
return AssumeUserRequestToJSONTyped(json, false);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function AssumeUserRequestToJSONTyped(value?: AssumeUserRequest | null, ignoreDiscriminator: boolean = false): any {
|
|
65
|
+
if (value == null) {
|
|
66
|
+
return value;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
|
|
71
|
+
'tenant_id': value['tenantId'],
|
|
72
|
+
'user_id': value['userId'],
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export const AssumeUserRequestPropertyValidationAttributesMap: {
|
|
77
|
+
[property: string]: {
|
|
78
|
+
maxLength?: number,
|
|
79
|
+
minLength?: number,
|
|
80
|
+
pattern?: string,
|
|
81
|
+
maximum?: number,
|
|
82
|
+
exclusiveMaximum?: boolean,
|
|
83
|
+
minimum?: number,
|
|
84
|
+
exclusiveMinimum?: boolean,
|
|
85
|
+
multipleOf?: number,
|
|
86
|
+
maxItems?: number,
|
|
87
|
+
minItems?: number,
|
|
88
|
+
uniqueItems?: boolean
|
|
89
|
+
}
|
|
90
|
+
} = {
|
|
91
|
+
}
|
|
92
|
+
|