@knowledge-stack/ksapi 1.5.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/.openapi-generator/FILES +6 -0
  2. package/README.md +2 -2
  3. package/dist/apis/DocumentVersionsApi.d.ts +146 -0
  4. package/dist/apis/DocumentVersionsApi.js +168 -0
  5. package/dist/apis/PathPartsApi.d.ts +30 -1
  6. package/dist/apis/PathPartsApi.js +32 -0
  7. package/dist/apis/SectionsApi.d.ts +144 -0
  8. package/dist/apis/SectionsApi.js +166 -0
  9. package/dist/apis/index.d.ts +2 -0
  10. package/dist/apis/index.js +2 -0
  11. package/dist/esm/apis/DocumentVersionsApi.d.ts +146 -0
  12. package/dist/esm/apis/DocumentVersionsApi.js +164 -0
  13. package/dist/esm/apis/PathPartsApi.d.ts +30 -1
  14. package/dist/esm/apis/PathPartsApi.js +33 -1
  15. package/dist/esm/apis/SectionsApi.d.ts +144 -0
  16. package/dist/esm/apis/SectionsApi.js +162 -0
  17. package/dist/esm/apis/index.d.ts +2 -0
  18. package/dist/esm/apis/index.js +2 -0
  19. package/dist/esm/models/CreateSectionRequest.d.ts +65 -0
  20. package/dist/esm/models/CreateSectionRequest.js +57 -0
  21. package/dist/esm/models/DocumentVersionResponse.d.ts +1 -1
  22. package/dist/esm/models/PaginatedResponseDocumentVersionResponse.d.ts +66 -0
  23. package/dist/esm/models/PaginatedResponseDocumentVersionResponse.js +70 -0
  24. package/dist/esm/models/SectionResponse.d.ts +101 -0
  25. package/dist/esm/models/SectionResponse.js +74 -0
  26. package/dist/esm/models/UpdateSectionRequest.d.ts +65 -0
  27. package/dist/esm/models/UpdateSectionRequest.js +53 -0
  28. package/dist/esm/models/index.d.ts +4 -0
  29. package/dist/esm/models/index.js +4 -0
  30. package/dist/models/CreateSectionRequest.d.ts +65 -0
  31. package/dist/models/CreateSectionRequest.js +65 -0
  32. package/dist/models/DocumentVersionResponse.d.ts +1 -1
  33. package/dist/models/PaginatedResponseDocumentVersionResponse.d.ts +66 -0
  34. package/dist/models/PaginatedResponseDocumentVersionResponse.js +78 -0
  35. package/dist/models/SectionResponse.d.ts +101 -0
  36. package/dist/models/SectionResponse.js +82 -0
  37. package/dist/models/UpdateSectionRequest.d.ts +65 -0
  38. package/dist/models/UpdateSectionRequest.js +61 -0
  39. package/dist/models/index.d.ts +4 -0
  40. package/dist/models/index.js +4 -0
  41. package/package.json +1 -1
  42. package/src/apis/DocumentVersionsApi.ts +303 -0
  43. package/src/apis/PathPartsApi.ts +64 -0
  44. package/src/apis/SectionsApi.ts +305 -0
  45. package/src/apis/index.ts +2 -0
  46. package/src/models/CreateSectionRequest.ts +112 -0
  47. package/src/models/DocumentVersionResponse.ts +1 -1
  48. package/src/models/PaginatedResponseDocumentVersionResponse.ts +130 -0
  49. package/src/models/SectionResponse.ts +161 -0
  50. package/src/models/UpdateSectionRequest.ts +110 -0
  51. package/src/models/index.ts +4 -0
@@ -0,0 +1,101 @@
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
+ * Section response model.
14
+ * @export
15
+ * @interface SectionResponse
16
+ */
17
+ export interface SectionResponse {
18
+ /**
19
+ * Section ID
20
+ * @type {string}
21
+ * @memberof SectionResponse
22
+ */
23
+ id: string;
24
+ /**
25
+ * PathPart ID
26
+ * @type {string}
27
+ * @memberof SectionResponse
28
+ */
29
+ pathPartId: string;
30
+ /**
31
+ * Section name
32
+ * @type {string}
33
+ * @memberof SectionResponse
34
+ */
35
+ name: string;
36
+ /**
37
+ * Page number in source document
38
+ * @type {number}
39
+ * @memberof SectionResponse
40
+ */
41
+ pageNumber?: number;
42
+ /**
43
+ * Parent PathPart ID
44
+ * @type {string}
45
+ * @memberof SectionResponse
46
+ */
47
+ parentId: string;
48
+ /**
49
+ * Previous sibling PathPart ID
50
+ * @type {string}
51
+ * @memberof SectionResponse
52
+ */
53
+ prevSiblingPathId?: string;
54
+ /**
55
+ * Next sibling PathPart ID
56
+ * @type {string}
57
+ * @memberof SectionResponse
58
+ */
59
+ nextSiblingId?: string;
60
+ /**
61
+ * Tenant ID
62
+ * @type {string}
63
+ * @memberof SectionResponse
64
+ */
65
+ tenantId: string;
66
+ /**
67
+ * Creation timestamp
68
+ * @type {Date}
69
+ * @memberof SectionResponse
70
+ */
71
+ createdAt: Date;
72
+ /**
73
+ * Last update timestamp
74
+ * @type {Date}
75
+ * @memberof SectionResponse
76
+ */
77
+ updatedAt: Date;
78
+ }
79
+ /**
80
+ * Check if a given object implements the SectionResponse interface.
81
+ */
82
+ export declare function instanceOfSectionResponse(value: object): value is SectionResponse;
83
+ export declare function SectionResponseFromJSON(json: any): SectionResponse;
84
+ export declare function SectionResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): SectionResponse;
85
+ export declare function SectionResponseToJSON(json: any): SectionResponse;
86
+ export declare function SectionResponseToJSONTyped(value?: SectionResponse | null, ignoreDiscriminator?: boolean): any;
87
+ export declare const SectionResponsePropertyValidationAttributesMap: {
88
+ [property: string]: {
89
+ maxLength?: number;
90
+ minLength?: number;
91
+ pattern?: string;
92
+ maximum?: number;
93
+ exclusiveMaximum?: boolean;
94
+ minimum?: number;
95
+ exclusiveMinimum?: boolean;
96
+ multipleOf?: number;
97
+ maxItems?: number;
98
+ minItems?: number;
99
+ uniqueItems?: boolean;
100
+ };
101
+ };
@@ -0,0 +1,82 @@
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.SectionResponsePropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfSectionResponse = instanceOfSectionResponse;
18
+ exports.SectionResponseFromJSON = SectionResponseFromJSON;
19
+ exports.SectionResponseFromJSONTyped = SectionResponseFromJSONTyped;
20
+ exports.SectionResponseToJSON = SectionResponseToJSON;
21
+ exports.SectionResponseToJSONTyped = SectionResponseToJSONTyped;
22
+ /**
23
+ * Check if a given object implements the SectionResponse interface.
24
+ */
25
+ function instanceOfSectionResponse(value) {
26
+ if (!('id' in value) || value['id'] === undefined)
27
+ return false;
28
+ if (!('pathPartId' in value) || value['pathPartId'] === undefined)
29
+ return false;
30
+ if (!('name' in value) || value['name'] === undefined)
31
+ return false;
32
+ if (!('parentId' in value) || value['parentId'] === undefined)
33
+ return false;
34
+ if (!('tenantId' in value) || value['tenantId'] === undefined)
35
+ return false;
36
+ if (!('createdAt' in value) || value['createdAt'] === undefined)
37
+ return false;
38
+ if (!('updatedAt' in value) || value['updatedAt'] === undefined)
39
+ return false;
40
+ return true;
41
+ }
42
+ function SectionResponseFromJSON(json) {
43
+ return SectionResponseFromJSONTyped(json, false);
44
+ }
45
+ function SectionResponseFromJSONTyped(json, ignoreDiscriminator) {
46
+ if (json == null) {
47
+ return json;
48
+ }
49
+ return {
50
+ 'id': json['id'],
51
+ 'pathPartId': json['path_part_id'],
52
+ 'name': json['name'],
53
+ 'pageNumber': json['page_number'] == null ? undefined : json['page_number'],
54
+ 'parentId': json['parent_id'],
55
+ 'prevSiblingPathId': json['prev_sibling_path_id'] == null ? undefined : json['prev_sibling_path_id'],
56
+ 'nextSiblingId': json['next_sibling_id'] == null ? undefined : json['next_sibling_id'],
57
+ 'tenantId': json['tenant_id'],
58
+ 'createdAt': (new Date(json['created_at'])),
59
+ 'updatedAt': (new Date(json['updated_at'])),
60
+ };
61
+ }
62
+ function SectionResponseToJSON(json) {
63
+ return SectionResponseToJSONTyped(json, false);
64
+ }
65
+ function SectionResponseToJSONTyped(value, ignoreDiscriminator = false) {
66
+ if (value == null) {
67
+ return value;
68
+ }
69
+ return {
70
+ 'id': value['id'],
71
+ 'path_part_id': value['pathPartId'],
72
+ 'name': value['name'],
73
+ 'page_number': value['pageNumber'],
74
+ 'parent_id': value['parentId'],
75
+ 'prev_sibling_path_id': value['prevSiblingPathId'],
76
+ 'next_sibling_id': value['nextSiblingId'],
77
+ 'tenant_id': value['tenantId'],
78
+ 'created_at': value['createdAt'].toISOString(),
79
+ 'updated_at': value['updatedAt'].toISOString(),
80
+ };
81
+ }
82
+ exports.SectionResponsePropertyValidationAttributesMap = {};
@@ -0,0 +1,65 @@
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
+ * Request to update a section.
14
+ * @export
15
+ * @interface UpdateSectionRequest
16
+ */
17
+ export interface UpdateSectionRequest {
18
+ /**
19
+ * New section name (can contain any characters)
20
+ * @type {string}
21
+ * @memberof UpdateSectionRequest
22
+ */
23
+ name?: string;
24
+ /**
25
+ * New page number (must be > 0)
26
+ * @type {number}
27
+ * @memberof UpdateSectionRequest
28
+ */
29
+ pageNumber?: number;
30
+ /**
31
+ * Move after this sibling PathPart ID
32
+ * @type {string}
33
+ * @memberof UpdateSectionRequest
34
+ */
35
+ prevSiblingPathId?: string;
36
+ /**
37
+ * Set to true to move to head of sibling list. This is needed since prev_sibling_path_id = None means no update
38
+ * @type {boolean}
39
+ * @memberof UpdateSectionRequest
40
+ */
41
+ moveToHead?: boolean;
42
+ }
43
+ /**
44
+ * Check if a given object implements the UpdateSectionRequest interface.
45
+ */
46
+ export declare function instanceOfUpdateSectionRequest(value: object): value is UpdateSectionRequest;
47
+ export declare function UpdateSectionRequestFromJSON(json: any): UpdateSectionRequest;
48
+ export declare function UpdateSectionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateSectionRequest;
49
+ export declare function UpdateSectionRequestToJSON(json: any): UpdateSectionRequest;
50
+ export declare function UpdateSectionRequestToJSONTyped(value?: UpdateSectionRequest | null, ignoreDiscriminator?: boolean): any;
51
+ export declare const UpdateSectionRequestPropertyValidationAttributesMap: {
52
+ [property: string]: {
53
+ maxLength?: number;
54
+ minLength?: number;
55
+ pattern?: string;
56
+ maximum?: number;
57
+ exclusiveMaximum?: boolean;
58
+ minimum?: number;
59
+ exclusiveMinimum?: boolean;
60
+ multipleOf?: number;
61
+ maxItems?: number;
62
+ minItems?: number;
63
+ uniqueItems?: boolean;
64
+ };
65
+ };
@@ -0,0 +1,61 @@
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.UpdateSectionRequestPropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfUpdateSectionRequest = instanceOfUpdateSectionRequest;
18
+ exports.UpdateSectionRequestFromJSON = UpdateSectionRequestFromJSON;
19
+ exports.UpdateSectionRequestFromJSONTyped = UpdateSectionRequestFromJSONTyped;
20
+ exports.UpdateSectionRequestToJSON = UpdateSectionRequestToJSON;
21
+ exports.UpdateSectionRequestToJSONTyped = UpdateSectionRequestToJSONTyped;
22
+ /**
23
+ * Check if a given object implements the UpdateSectionRequest interface.
24
+ */
25
+ function instanceOfUpdateSectionRequest(value) {
26
+ return true;
27
+ }
28
+ function UpdateSectionRequestFromJSON(json) {
29
+ return UpdateSectionRequestFromJSONTyped(json, false);
30
+ }
31
+ function UpdateSectionRequestFromJSONTyped(json, ignoreDiscriminator) {
32
+ if (json == null) {
33
+ return json;
34
+ }
35
+ return {
36
+ 'name': json['name'] == null ? undefined : json['name'],
37
+ 'pageNumber': json['page_number'] == null ? undefined : json['page_number'],
38
+ 'prevSiblingPathId': json['prev_sibling_path_id'] == null ? undefined : json['prev_sibling_path_id'],
39
+ 'moveToHead': json['move_to_head'] == null ? undefined : json['move_to_head'],
40
+ };
41
+ }
42
+ function UpdateSectionRequestToJSON(json) {
43
+ return UpdateSectionRequestToJSONTyped(json, false);
44
+ }
45
+ function UpdateSectionRequestToJSONTyped(value, ignoreDiscriminator = false) {
46
+ if (value == null) {
47
+ return value;
48
+ }
49
+ return {
50
+ 'name': value['name'],
51
+ 'page_number': value['pageNumber'],
52
+ 'prev_sibling_path_id': value['prevSiblingPathId'],
53
+ 'move_to_head': value['moveToHead'],
54
+ };
55
+ }
56
+ exports.UpdateSectionRequestPropertyValidationAttributesMap = {
57
+ name: {
58
+ maxLength: 255,
59
+ minLength: 1,
60
+ },
61
+ };
@@ -1,6 +1,7 @@
1
1
  export * from './CreateDocumentRequest';
2
2
  export * from './CreateFolderRequest';
3
3
  export * from './CreatePasswordUserRequest';
4
+ export * from './CreateSectionRequest';
4
5
  export * from './CreateTenantRequest';
5
6
  export * from './DocumentOrigin';
6
7
  export * from './DocumentResponse';
@@ -17,6 +18,7 @@ export * from './InviteStatus';
17
18
  export * from './InviteUserRequest';
18
19
  export * from './OAuth2Config';
19
20
  export * from './PaginatedResponseDocumentResponse';
21
+ export * from './PaginatedResponseDocumentVersionResponse';
20
22
  export * from './PaginatedResponseFolderResponse';
21
23
  export * from './PaginatedResponseInviteResponse';
22
24
  export * from './PaginatedResponsePathPartResponse';
@@ -28,12 +30,14 @@ export * from './PasswordResetWithTokenRequest';
28
30
  export * from './PathOrder';
29
31
  export * from './PathPartResponse';
30
32
  export * from './RootResponse';
33
+ export * from './SectionResponse';
31
34
  export * from './SignInRequest';
32
35
  export * from './TenantResponse';
33
36
  export * from './TenantUserInTenantResponse';
34
37
  export * from './TenantUserRole';
35
38
  export * from './UpdateDocumentRequest';
36
39
  export * from './UpdateFolderRequest';
40
+ export * from './UpdateSectionRequest';
37
41
  export * from './UpdateTenantRequest';
38
42
  export * from './UpdateUserRequest';
39
43
  export * from './UserResponse';
@@ -19,6 +19,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
19
19
  __exportStar(require("./CreateDocumentRequest"), exports);
20
20
  __exportStar(require("./CreateFolderRequest"), exports);
21
21
  __exportStar(require("./CreatePasswordUserRequest"), exports);
22
+ __exportStar(require("./CreateSectionRequest"), exports);
22
23
  __exportStar(require("./CreateTenantRequest"), exports);
23
24
  __exportStar(require("./DocumentOrigin"), exports);
24
25
  __exportStar(require("./DocumentResponse"), exports);
@@ -35,6 +36,7 @@ __exportStar(require("./InviteStatus"), exports);
35
36
  __exportStar(require("./InviteUserRequest"), exports);
36
37
  __exportStar(require("./OAuth2Config"), exports);
37
38
  __exportStar(require("./PaginatedResponseDocumentResponse"), exports);
39
+ __exportStar(require("./PaginatedResponseDocumentVersionResponse"), exports);
38
40
  __exportStar(require("./PaginatedResponseFolderResponse"), exports);
39
41
  __exportStar(require("./PaginatedResponseInviteResponse"), exports);
40
42
  __exportStar(require("./PaginatedResponsePathPartResponse"), exports);
@@ -46,12 +48,14 @@ __exportStar(require("./PasswordResetWithTokenRequest"), exports);
46
48
  __exportStar(require("./PathOrder"), exports);
47
49
  __exportStar(require("./PathPartResponse"), exports);
48
50
  __exportStar(require("./RootResponse"), exports);
51
+ __exportStar(require("./SectionResponse"), exports);
49
52
  __exportStar(require("./SignInRequest"), exports);
50
53
  __exportStar(require("./TenantResponse"), exports);
51
54
  __exportStar(require("./TenantUserInTenantResponse"), exports);
52
55
  __exportStar(require("./TenantUserRole"), exports);
53
56
  __exportStar(require("./UpdateDocumentRequest"), exports);
54
57
  __exportStar(require("./UpdateFolderRequest"), exports);
58
+ __exportStar(require("./UpdateSectionRequest"), exports);
55
59
  __exportStar(require("./UpdateTenantRequest"), exports);
56
60
  __exportStar(require("./UpdateUserRequest"), exports);
57
61
  __exportStar(require("./UserResponse"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowledge-stack/ksapi",
3
- "version": "1.5.0",
3
+ "version": "1.7.0",
4
4
  "description": "OpenAPI client for @knowledge-stack/ksapi",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -0,0 +1,303 @@
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
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ DocumentVersionResponse,
19
+ HTTPValidationError,
20
+ PaginatedResponseDocumentVersionResponse,
21
+ } from '../models/index';
22
+ import {
23
+ DocumentVersionResponseFromJSON,
24
+ DocumentVersionResponseToJSON,
25
+ HTTPValidationErrorFromJSON,
26
+ HTTPValidationErrorToJSON,
27
+ PaginatedResponseDocumentVersionResponseFromJSON,
28
+ PaginatedResponseDocumentVersionResponseToJSON,
29
+ } from '../models/index';
30
+
31
+ export interface CreateDocumentVersionRequest {
32
+ documentId: string;
33
+ ksUat?: string;
34
+ }
35
+
36
+ export interface DeleteDocumentVersionRequest {
37
+ versionId: string;
38
+ ksUat?: string;
39
+ }
40
+
41
+ export interface GetDocumentVersionRequest {
42
+ versionId: string;
43
+ ksUat?: string;
44
+ }
45
+
46
+ export interface ListDocumentVersionsRequest {
47
+ documentId: string;
48
+ limit?: number;
49
+ offset?: number;
50
+ ksUat?: string;
51
+ }
52
+
53
+ /**
54
+ * DocumentVersionsApi - interface
55
+ *
56
+ * @export
57
+ * @interface DocumentVersionsApiInterface
58
+ */
59
+ export interface DocumentVersionsApiInterface {
60
+ /**
61
+ * Create a new version for a document. The version number is automatically incremented from the highest existing version.
62
+ * @summary Create Document Version Handler
63
+ * @param {string} documentId Document ID
64
+ * @param {string} [ksUat]
65
+ * @param {*} [options] Override http request option.
66
+ * @throws {RequiredError}
67
+ * @memberof DocumentVersionsApiInterface
68
+ */
69
+ createDocumentVersionRaw(requestParameters: CreateDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentVersionResponse>>;
70
+
71
+ /**
72
+ * Create a new version for a document. The version number is automatically incremented from the highest existing version.
73
+ * Create Document Version Handler
74
+ */
75
+ createDocumentVersion(requestParameters: CreateDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentVersionResponse>;
76
+
77
+ /**
78
+ * Delete a document version by its ID. Cannot delete the active version of a document.
79
+ * @summary Delete Document Version Handler
80
+ * @param {string} versionId DocumentVersion ID
81
+ * @param {string} [ksUat]
82
+ * @param {*} [options] Override http request option.
83
+ * @throws {RequiredError}
84
+ * @memberof DocumentVersionsApiInterface
85
+ */
86
+ deleteDocumentVersionRaw(requestParameters: DeleteDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
87
+
88
+ /**
89
+ * Delete a document version by its ID. Cannot delete the active version of a document.
90
+ * Delete Document Version Handler
91
+ */
92
+ deleteDocumentVersion(requestParameters: DeleteDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
93
+
94
+ /**
95
+ * Get a document version by its ID.
96
+ * @summary Get Document Version Handler
97
+ * @param {string} versionId DocumentVersion ID
98
+ * @param {string} [ksUat]
99
+ * @param {*} [options] Override http request option.
100
+ * @throws {RequiredError}
101
+ * @memberof DocumentVersionsApiInterface
102
+ */
103
+ getDocumentVersionRaw(requestParameters: GetDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentVersionResponse>>;
104
+
105
+ /**
106
+ * Get a document version by its ID.
107
+ * Get Document Version Handler
108
+ */
109
+ getDocumentVersion(requestParameters: GetDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentVersionResponse>;
110
+
111
+ /**
112
+ * List all versions for a document. Returns versions ordered by version number ascending (v0, v1, v2...).
113
+ * @summary List Document Versions Handler
114
+ * @param {string} documentId Document ID to list versions for
115
+ * @param {number} [limit] Number of items per page
116
+ * @param {number} [offset] Number of items to skip
117
+ * @param {string} [ksUat]
118
+ * @param {*} [options] Override http request option.
119
+ * @throws {RequiredError}
120
+ * @memberof DocumentVersionsApiInterface
121
+ */
122
+ listDocumentVersionsRaw(requestParameters: ListDocumentVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseDocumentVersionResponse>>;
123
+
124
+ /**
125
+ * List all versions for a document. Returns versions ordered by version number ascending (v0, v1, v2...).
126
+ * List Document Versions Handler
127
+ */
128
+ listDocumentVersions(requestParameters: ListDocumentVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseDocumentVersionResponse>;
129
+
130
+ }
131
+
132
+ /**
133
+ *
134
+ */
135
+ export class DocumentVersionsApi extends runtime.BaseAPI implements DocumentVersionsApiInterface {
136
+
137
+ /**
138
+ * Create a new version for a document. The version number is automatically incremented from the highest existing version.
139
+ * Create Document Version Handler
140
+ */
141
+ async createDocumentVersionRaw(requestParameters: CreateDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentVersionResponse>> {
142
+ if (requestParameters['documentId'] == null) {
143
+ throw new runtime.RequiredError(
144
+ 'documentId',
145
+ 'Required parameter "documentId" was null or undefined when calling createDocumentVersion().'
146
+ );
147
+ }
148
+
149
+ const queryParameters: any = {};
150
+
151
+ const headerParameters: runtime.HTTPHeaders = {};
152
+
153
+
154
+ let urlPath = `/v1/documents/{document_id}/versions`;
155
+ urlPath = urlPath.replace(`{${"document_id"}}`, encodeURIComponent(String(requestParameters['documentId'])));
156
+
157
+ const response = await this.request({
158
+ path: urlPath,
159
+ method: 'POST',
160
+ headers: headerParameters,
161
+ query: queryParameters,
162
+ }, initOverrides);
163
+
164
+ return new runtime.JSONApiResponse(response, (jsonValue) => DocumentVersionResponseFromJSON(jsonValue));
165
+ }
166
+
167
+ /**
168
+ * Create a new version for a document. The version number is automatically incremented from the highest existing version.
169
+ * Create Document Version Handler
170
+ */
171
+ async createDocumentVersion(requestParameters: CreateDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentVersionResponse> {
172
+ const response = await this.createDocumentVersionRaw(requestParameters, initOverrides);
173
+ return await response.value();
174
+ }
175
+
176
+ /**
177
+ * Delete a document version by its ID. Cannot delete the active version of a document.
178
+ * Delete Document Version Handler
179
+ */
180
+ async deleteDocumentVersionRaw(requestParameters: DeleteDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
181
+ if (requestParameters['versionId'] == null) {
182
+ throw new runtime.RequiredError(
183
+ 'versionId',
184
+ 'Required parameter "versionId" was null or undefined when calling deleteDocumentVersion().'
185
+ );
186
+ }
187
+
188
+ const queryParameters: any = {};
189
+
190
+ const headerParameters: runtime.HTTPHeaders = {};
191
+
192
+
193
+ let urlPath = `/v1/document_versions/{version_id}`;
194
+ urlPath = urlPath.replace(`{${"version_id"}}`, encodeURIComponent(String(requestParameters['versionId'])));
195
+
196
+ const response = await this.request({
197
+ path: urlPath,
198
+ method: 'DELETE',
199
+ headers: headerParameters,
200
+ query: queryParameters,
201
+ }, initOverrides);
202
+
203
+ return new runtime.VoidApiResponse(response);
204
+ }
205
+
206
+ /**
207
+ * Delete a document version by its ID. Cannot delete the active version of a document.
208
+ * Delete Document Version Handler
209
+ */
210
+ async deleteDocumentVersion(requestParameters: DeleteDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
211
+ await this.deleteDocumentVersionRaw(requestParameters, initOverrides);
212
+ }
213
+
214
+ /**
215
+ * Get a document version by its ID.
216
+ * Get Document Version Handler
217
+ */
218
+ async getDocumentVersionRaw(requestParameters: GetDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentVersionResponse>> {
219
+ if (requestParameters['versionId'] == null) {
220
+ throw new runtime.RequiredError(
221
+ 'versionId',
222
+ 'Required parameter "versionId" was null or undefined when calling getDocumentVersion().'
223
+ );
224
+ }
225
+
226
+ const queryParameters: any = {};
227
+
228
+ const headerParameters: runtime.HTTPHeaders = {};
229
+
230
+
231
+ let urlPath = `/v1/document_versions/{version_id}`;
232
+ urlPath = urlPath.replace(`{${"version_id"}}`, encodeURIComponent(String(requestParameters['versionId'])));
233
+
234
+ const response = await this.request({
235
+ path: urlPath,
236
+ method: 'GET',
237
+ headers: headerParameters,
238
+ query: queryParameters,
239
+ }, initOverrides);
240
+
241
+ return new runtime.JSONApiResponse(response, (jsonValue) => DocumentVersionResponseFromJSON(jsonValue));
242
+ }
243
+
244
+ /**
245
+ * Get a document version by its ID.
246
+ * Get Document Version Handler
247
+ */
248
+ async getDocumentVersion(requestParameters: GetDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentVersionResponse> {
249
+ const response = await this.getDocumentVersionRaw(requestParameters, initOverrides);
250
+ return await response.value();
251
+ }
252
+
253
+ /**
254
+ * List all versions for a document. Returns versions ordered by version number ascending (v0, v1, v2...).
255
+ * List Document Versions Handler
256
+ */
257
+ async listDocumentVersionsRaw(requestParameters: ListDocumentVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseDocumentVersionResponse>> {
258
+ if (requestParameters['documentId'] == null) {
259
+ throw new runtime.RequiredError(
260
+ 'documentId',
261
+ 'Required parameter "documentId" was null or undefined when calling listDocumentVersions().'
262
+ );
263
+ }
264
+
265
+ const queryParameters: any = {};
266
+
267
+ if (requestParameters['documentId'] != null) {
268
+ queryParameters['document_id'] = requestParameters['documentId'];
269
+ }
270
+
271
+ if (requestParameters['limit'] != null) {
272
+ queryParameters['limit'] = requestParameters['limit'];
273
+ }
274
+
275
+ if (requestParameters['offset'] != null) {
276
+ queryParameters['offset'] = requestParameters['offset'];
277
+ }
278
+
279
+ const headerParameters: runtime.HTTPHeaders = {};
280
+
281
+
282
+ let urlPath = `/v1/document_versions`;
283
+
284
+ const response = await this.request({
285
+ path: urlPath,
286
+ method: 'GET',
287
+ headers: headerParameters,
288
+ query: queryParameters,
289
+ }, initOverrides);
290
+
291
+ return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedResponseDocumentVersionResponseFromJSON(jsonValue));
292
+ }
293
+
294
+ /**
295
+ * List all versions for a document. Returns versions ordered by version number ascending (v0, v1, v2...).
296
+ * List Document Versions Handler
297
+ */
298
+ async listDocumentVersions(requestParameters: ListDocumentVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseDocumentVersionResponse> {
299
+ const response = await this.listDocumentVersionsRaw(requestParameters, initOverrides);
300
+ return await response.value();
301
+ }
302
+
303
+ }