tuix-pdf-service-client 0.0.1
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 +37 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +48 -0
- package/apis/ClientApi.js +571 -0
- package/apis/ClientApi.js.map +1 -0
- package/apis/ClientApi.ts +858 -0
- package/apis/index.js +20 -0
- package/apis/index.js.map +1 -0
- package/apis/index.ts +3 -0
- package/docs/APIKeyDTO.md +40 -0
- package/docs/AccountDTO.md +34 -0
- package/docs/ApplicationDTO.md +42 -0
- package/docs/ApplicationWithApplicationCountDTO.md +44 -0
- package/docs/ClientApi.md +1115 -0
- package/docs/CreateAPIKeyRequestDTO.md +34 -0
- package/docs/CreateAPIKeyResponseDTO.md +42 -0
- package/docs/CreateAccountDTO.md +36 -0
- package/docs/CreateApplicationDTO.md +36 -0
- package/docs/CreatePdfRequestDTO.md +34 -0
- package/docs/ErrorDTO.md +34 -0
- package/docs/GetAPIKeysResponseDTO.md +42 -0
- package/docs/PaginatedApplicationsDTO.md +42 -0
- package/docs/PdfCreatedRequestItemsDTO.md +40 -0
- package/docs/PdfTemplateDTO.md +36 -0
- package/docs/UpdateApplicationDTO.md +36 -0
- package/index.js +22 -0
- package/index.js.map +1 -0
- package/index.ts +5 -0
- package/models/APIKeyDTO.js +55 -0
- package/models/APIKeyDTO.js.map +1 -0
- package/models/APIKeyDTO.ts +89 -0
- package/models/AccountDTO.js +49 -0
- package/models/AccountDTO.js.map +1 -0
- package/models/AccountDTO.ts +65 -0
- package/models/ApplicationDTO.js +57 -0
- package/models/ApplicationDTO.js.map +1 -0
- package/models/ApplicationDTO.ts +97 -0
- package/models/ApplicationWithApplicationCountDTO.js +59 -0
- package/models/ApplicationWithApplicationCountDTO.js.map +1 -0
- package/models/ApplicationWithApplicationCountDTO.ts +105 -0
- package/models/CreateAPIKeyRequestDTO.js +51 -0
- package/models/CreateAPIKeyRequestDTO.js.map +1 -0
- package/models/CreateAPIKeyRequestDTO.ts +66 -0
- package/models/CreateAPIKeyResponseDTO.js +57 -0
- package/models/CreateAPIKeyResponseDTO.js.map +1 -0
- package/models/CreateAPIKeyResponseDTO.ts +97 -0
- package/models/CreateAccountDTO.js +55 -0
- package/models/CreateAccountDTO.js.map +1 -0
- package/models/CreateAccountDTO.ts +75 -0
- package/models/CreateApplicationDTO.js +55 -0
- package/models/CreateApplicationDTO.js.map +1 -0
- package/models/CreateApplicationDTO.ts +75 -0
- package/models/CreatePdfRequestDTO.js +52 -0
- package/models/CreatePdfRequestDTO.js.map +1 -0
- package/models/CreatePdfRequestDTO.ts +74 -0
- package/models/ErrorDTO.js +49 -0
- package/models/ErrorDTO.js.map +1 -0
- package/models/ErrorDTO.ts +65 -0
- package/models/GetAPIKeysResponseDTO.js +58 -0
- package/models/GetAPIKeysResponseDTO.js.map +1 -0
- package/models/GetAPIKeysResponseDTO.ts +105 -0
- package/models/PaginatedApplicationsDTO.js +68 -0
- package/models/PaginatedApplicationsDTO.js.map +1 -0
- package/models/PaginatedApplicationsDTO.ts +110 -0
- package/models/PdfCreatedRequestItemsDTO.js +63 -0
- package/models/PdfCreatedRequestItemsDTO.js.map +1 -0
- package/models/PdfCreatedRequestItemsDTO.ts +93 -0
- package/models/PdfTemplateDTO.js +53 -0
- package/models/PdfTemplateDTO.js.map +1 -0
- package/models/PdfTemplateDTO.ts +74 -0
- package/models/UpdateApplicationDTO.js +51 -0
- package/models/UpdateApplicationDTO.js.map +1 -0
- package/models/UpdateApplicationDTO.ts +73 -0
- package/models/index.js +34 -0
- package/models/index.js.map +1 -0
- package/models/index.ts +17 -0
- package/package.json +17 -0
- package/runtime.js +330 -0
- package/runtime.js.map +1 -0
- package/runtime.ts +432 -0
- package/tsconfig.build.tsbuildinfo +1 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
.openapi-generator-ignore
|
|
2
|
+
apis/ClientApi.ts
|
|
3
|
+
apis/index.ts
|
|
4
|
+
docs/APIKeyDTO.md
|
|
5
|
+
docs/AccountDTO.md
|
|
6
|
+
docs/ApplicationDTO.md
|
|
7
|
+
docs/ApplicationWithApplicationCountDTO.md
|
|
8
|
+
docs/ClientApi.md
|
|
9
|
+
docs/CreateAPIKeyRequestDTO.md
|
|
10
|
+
docs/CreateAPIKeyResponseDTO.md
|
|
11
|
+
docs/CreateAccountDTO.md
|
|
12
|
+
docs/CreateApplicationDTO.md
|
|
13
|
+
docs/CreatePdfRequestDTO.md
|
|
14
|
+
docs/ErrorDTO.md
|
|
15
|
+
docs/GetAPIKeysResponseDTO.md
|
|
16
|
+
docs/PaginatedApplicationsDTO.md
|
|
17
|
+
docs/PdfCreatedRequestItemsDTO.md
|
|
18
|
+
docs/PdfTemplateDTO.md
|
|
19
|
+
docs/UpdateApplicationDTO.md
|
|
20
|
+
index.ts
|
|
21
|
+
models/APIKeyDTO.ts
|
|
22
|
+
models/AccountDTO.ts
|
|
23
|
+
models/ApplicationDTO.ts
|
|
24
|
+
models/ApplicationWithApplicationCountDTO.ts
|
|
25
|
+
models/CreateAPIKeyRequestDTO.ts
|
|
26
|
+
models/CreateAPIKeyResponseDTO.ts
|
|
27
|
+
models/CreateAccountDTO.ts
|
|
28
|
+
models/CreateApplicationDTO.ts
|
|
29
|
+
models/CreatePdfRequestDTO.ts
|
|
30
|
+
models/ErrorDTO.ts
|
|
31
|
+
models/GetAPIKeysResponseDTO.ts
|
|
32
|
+
models/PaginatedApplicationsDTO.ts
|
|
33
|
+
models/PdfCreatedRequestItemsDTO.ts
|
|
34
|
+
models/PdfTemplateDTO.ts
|
|
35
|
+
models/UpdateApplicationDTO.ts
|
|
36
|
+
models/index.ts
|
|
37
|
+
runtime.ts
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7.18.0
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# OpenAPI Generator Ignore
|
|
2
|
+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
|
3
|
+
|
|
4
|
+
# Use this file to prevent files from being overwritten by the generator.
|
|
5
|
+
# The patterns follow closely to .gitignore or .dockerignore.
|
|
6
|
+
|
|
7
|
+
# As an example, the C# client generator defines ApiClient.cs.
|
|
8
|
+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
|
9
|
+
#ApiClient.cs
|
|
10
|
+
|
|
11
|
+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
|
12
|
+
#foo/*/qux
|
|
13
|
+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
|
14
|
+
|
|
15
|
+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
|
16
|
+
#foo/**/qux
|
|
17
|
+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
|
18
|
+
|
|
19
|
+
# You can also negate patterns with an exclamation (!).
|
|
20
|
+
# For example, you can ignore all files in a docs folder with the file extension .md:
|
|
21
|
+
#docs/*.md
|
|
22
|
+
# Then explicitly reverse the ignore rule for a single file:
|
|
23
|
+
#!docs/README.md
|
package/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Tuix tuix-pdf-service
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
Api Client for project tuix-pdf-service
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
npm i tuix-pdf-service-client
|
|
11
|
+
```
|
|
12
|
+
If you need to use the staging api client, then use the command
|
|
13
|
+
```
|
|
14
|
+
npm i tuix-pdf-service-client@staging
|
|
15
|
+
```
|
|
16
|
+
Check the available versions in the following link: https://www.npmjs.com/package/tuix-tuix-pdf-service-client?activeTab=versions
|
|
17
|
+
|
|
18
|
+
## Developing the app
|
|
19
|
+
|
|
20
|
+
Tested on
|
|
21
|
+
```
|
|
22
|
+
node 18
|
|
23
|
+
npm 9.6.7
|
|
24
|
+
```
|
|
25
|
+
Make an example request :
|
|
26
|
+
```javascript
|
|
27
|
+
import { Configuration, ResponseError, Client } from 'tuix-pdf-service-client';
|
|
28
|
+
|
|
29
|
+
const configuration = new Configuration({
|
|
30
|
+
basePath: "https://staging-tuix-pdf-service.tuix.ch",
|
|
31
|
+
apiKey: "Bearer <JWT>"
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const APIClient = new Client(configuration);
|
|
35
|
+
|
|
36
|
+
(async () => {
|
|
37
|
+
try {
|
|
38
|
+
const companies = await APIClient.companiesGet()
|
|
39
|
+
console.log({ companies });
|
|
40
|
+
} catch (error) {
|
|
41
|
+
if(error instanceof ResponseError){
|
|
42
|
+
console.log(error.response.status, error.response.statusText);
|
|
43
|
+
const data = await error.response.json()
|
|
44
|
+
console.log(data);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
})()
|
|
48
|
+
```
|
|
@@ -0,0 +1,571 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Tuix Pdf Service
|
|
6
|
+
* Service to generate pdfs
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.0.1
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
18
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
19
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
20
|
+
}
|
|
21
|
+
Object.defineProperty(o, k2, desc);
|
|
22
|
+
}) : (function(o, m, k, k2) {
|
|
23
|
+
if (k2 === undefined) k2 = k;
|
|
24
|
+
o[k2] = m[k];
|
|
25
|
+
}));
|
|
26
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
27
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
28
|
+
}) : function(o, v) {
|
|
29
|
+
o["default"] = v;
|
|
30
|
+
});
|
|
31
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
32
|
+
var ownKeys = function(o) {
|
|
33
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
34
|
+
var ar = [];
|
|
35
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
36
|
+
return ar;
|
|
37
|
+
};
|
|
38
|
+
return ownKeys(o);
|
|
39
|
+
};
|
|
40
|
+
return function (mod) {
|
|
41
|
+
if (mod && mod.__esModule) return mod;
|
|
42
|
+
var result = {};
|
|
43
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
44
|
+
__setModuleDefault(result, mod);
|
|
45
|
+
return result;
|
|
46
|
+
};
|
|
47
|
+
})();
|
|
48
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
+
exports.ClientApi = void 0;
|
|
50
|
+
const runtime = __importStar(require("../runtime"));
|
|
51
|
+
const index_1 = require("../models/index");
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
*/
|
|
55
|
+
class ClientApi extends runtime.BaseAPI {
|
|
56
|
+
/**
|
|
57
|
+
* Retrieve all API keys associated with the authenticated user\'s account with pagination.
|
|
58
|
+
* Get all API keys for the authenticated user
|
|
59
|
+
*/
|
|
60
|
+
async apiKeysGetRaw(requestParameters, initOverrides) {
|
|
61
|
+
const queryParameters = {};
|
|
62
|
+
if (requestParameters['page'] != null) {
|
|
63
|
+
queryParameters['page'] = requestParameters['page'];
|
|
64
|
+
}
|
|
65
|
+
if (requestParameters['pageSize'] != null) {
|
|
66
|
+
queryParameters['page_size'] = requestParameters['pageSize'];
|
|
67
|
+
}
|
|
68
|
+
const headerParameters = {};
|
|
69
|
+
let urlPath = `/api-keys`;
|
|
70
|
+
const response = await this.request({
|
|
71
|
+
path: urlPath,
|
|
72
|
+
method: 'GET',
|
|
73
|
+
headers: headerParameters,
|
|
74
|
+
query: queryParameters,
|
|
75
|
+
}, initOverrides);
|
|
76
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.GetAPIKeysResponseDTOFromJSON)(jsonValue));
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Retrieve all API keys associated with the authenticated user\'s account with pagination.
|
|
80
|
+
* Get all API keys for the authenticated user
|
|
81
|
+
*/
|
|
82
|
+
async apiKeysGet(requestParameters = {}, initOverrides) {
|
|
83
|
+
const response = await this.apiKeysGetRaw(requestParameters, initOverrides);
|
|
84
|
+
return await response.value();
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Delete a specific API key belonging to the authenticated user.
|
|
88
|
+
* Delete an API key
|
|
89
|
+
*/
|
|
90
|
+
async apiKeysIdDeleteRaw(requestParameters, initOverrides) {
|
|
91
|
+
if (requestParameters['id'] == null) {
|
|
92
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling apiKeysIdDelete().');
|
|
93
|
+
}
|
|
94
|
+
const queryParameters = {};
|
|
95
|
+
const headerParameters = {};
|
|
96
|
+
let urlPath = `/api-keys/{id}`;
|
|
97
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
98
|
+
const response = await this.request({
|
|
99
|
+
path: urlPath,
|
|
100
|
+
method: 'DELETE',
|
|
101
|
+
headers: headerParameters,
|
|
102
|
+
query: queryParameters,
|
|
103
|
+
}, initOverrides);
|
|
104
|
+
return new runtime.VoidApiResponse(response);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Delete a specific API key belonging to the authenticated user.
|
|
108
|
+
* Delete an API key
|
|
109
|
+
*/
|
|
110
|
+
async apiKeysIdDelete(requestParameters, initOverrides) {
|
|
111
|
+
await this.apiKeysIdDeleteRaw(requestParameters, initOverrides);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Create a new API key for accessing the RAG service.
|
|
115
|
+
* Create a new API key
|
|
116
|
+
*/
|
|
117
|
+
async apiKeysPostRaw(requestParameters, initOverrides) {
|
|
118
|
+
if (requestParameters['createAPIKeyRequestDTO'] == null) {
|
|
119
|
+
throw new runtime.RequiredError('createAPIKeyRequestDTO', 'Required parameter "createAPIKeyRequestDTO" was null or undefined when calling apiKeysPost().');
|
|
120
|
+
}
|
|
121
|
+
const queryParameters = {};
|
|
122
|
+
const headerParameters = {};
|
|
123
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
124
|
+
let urlPath = `/api-keys`;
|
|
125
|
+
const response = await this.request({
|
|
126
|
+
path: urlPath,
|
|
127
|
+
method: 'POST',
|
|
128
|
+
headers: headerParameters,
|
|
129
|
+
query: queryParameters,
|
|
130
|
+
body: (0, index_1.CreateAPIKeyRequestDTOToJSON)(requestParameters['createAPIKeyRequestDTO']),
|
|
131
|
+
}, initOverrides);
|
|
132
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CreateAPIKeyResponseDTOFromJSON)(jsonValue));
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Create a new API key for accessing the RAG service.
|
|
136
|
+
* Create a new API key
|
|
137
|
+
*/
|
|
138
|
+
async apiKeysPost(requestParameters, initOverrides) {
|
|
139
|
+
const response = await this.apiKeysPostRaw(requestParameters, initOverrides);
|
|
140
|
+
return await response.value();
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Create an account
|
|
144
|
+
* Creates a new account
|
|
145
|
+
*/
|
|
146
|
+
async createAccountRaw(requestParameters, initOverrides) {
|
|
147
|
+
if (requestParameters['createAccountDTO'] == null) {
|
|
148
|
+
throw new runtime.RequiredError('createAccountDTO', 'Required parameter "createAccountDTO" was null or undefined when calling createAccount().');
|
|
149
|
+
}
|
|
150
|
+
const queryParameters = {};
|
|
151
|
+
const headerParameters = {};
|
|
152
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
153
|
+
let urlPath = `/accounts`;
|
|
154
|
+
const response = await this.request({
|
|
155
|
+
path: urlPath,
|
|
156
|
+
method: 'POST',
|
|
157
|
+
headers: headerParameters,
|
|
158
|
+
query: queryParameters,
|
|
159
|
+
body: (0, index_1.CreateAccountDTOToJSON)(requestParameters['createAccountDTO']),
|
|
160
|
+
}, initOverrides);
|
|
161
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AccountDTOFromJSON)(jsonValue));
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Create an account
|
|
165
|
+
* Creates a new account
|
|
166
|
+
*/
|
|
167
|
+
async createAccount(requestParameters, initOverrides) {
|
|
168
|
+
const response = await this.createAccountRaw(requestParameters, initOverrides);
|
|
169
|
+
return await response.value();
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Create a new application for the authenticated account
|
|
173
|
+
* Create a new application
|
|
174
|
+
*/
|
|
175
|
+
async createApplicationRaw(requestParameters, initOverrides) {
|
|
176
|
+
if (requestParameters['createApplicationDTO'] == null) {
|
|
177
|
+
throw new runtime.RequiredError('createApplicationDTO', 'Required parameter "createApplicationDTO" was null or undefined when calling createApplication().');
|
|
178
|
+
}
|
|
179
|
+
const queryParameters = {};
|
|
180
|
+
const headerParameters = {};
|
|
181
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
182
|
+
let urlPath = `/applications`;
|
|
183
|
+
const response = await this.request({
|
|
184
|
+
path: urlPath,
|
|
185
|
+
method: 'POST',
|
|
186
|
+
headers: headerParameters,
|
|
187
|
+
query: queryParameters,
|
|
188
|
+
body: (0, index_1.CreateApplicationDTOToJSON)(requestParameters['createApplicationDTO']),
|
|
189
|
+
}, initOverrides);
|
|
190
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ApplicationDTOFromJSON)(jsonValue));
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Create a new application for the authenticated account
|
|
194
|
+
* Create a new application
|
|
195
|
+
*/
|
|
196
|
+
async createApplication(requestParameters, initOverrides) {
|
|
197
|
+
const response = await this.createApplicationRaw(requestParameters, initOverrides);
|
|
198
|
+
return await response.value();
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Create PDF by template
|
|
202
|
+
* Create PDF by template
|
|
203
|
+
*/
|
|
204
|
+
async createPdfByTermplateRaw(requestParameters, initOverrides) {
|
|
205
|
+
if (requestParameters['applicationId'] == null) {
|
|
206
|
+
throw new runtime.RequiredError('applicationId', 'Required parameter "applicationId" was null or undefined when calling createPdfByTermplate().');
|
|
207
|
+
}
|
|
208
|
+
if (requestParameters['createPdfRequestDTO'] == null) {
|
|
209
|
+
throw new runtime.RequiredError('createPdfRequestDTO', 'Required parameter "createPdfRequestDTO" was null or undefined when calling createPdfByTermplate().');
|
|
210
|
+
}
|
|
211
|
+
const queryParameters = {};
|
|
212
|
+
const headerParameters = {};
|
|
213
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
214
|
+
let urlPath = `/api/applications/{applicationId}/create-pdf`;
|
|
215
|
+
urlPath = urlPath.replace(`{${"applicationId"}}`, encodeURIComponent(String(requestParameters['applicationId'])));
|
|
216
|
+
const response = await this.request({
|
|
217
|
+
path: urlPath,
|
|
218
|
+
method: 'POST',
|
|
219
|
+
headers: headerParameters,
|
|
220
|
+
query: queryParameters,
|
|
221
|
+
body: (0, index_1.CreatePdfRequestDTOToJSON)(requestParameters['createPdfRequestDTO']),
|
|
222
|
+
}, initOverrides);
|
|
223
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PdfTemplateDTOFromJSON)(jsonValue));
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Create PDF by template
|
|
227
|
+
* Create PDF by template
|
|
228
|
+
*/
|
|
229
|
+
async createPdfByTermplate(requestParameters, initOverrides) {
|
|
230
|
+
const response = await this.createPdfByTermplateRaw(requestParameters, initOverrides);
|
|
231
|
+
return await response.value();
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Delete an application belonging to the authenticated account
|
|
235
|
+
* Delete an application
|
|
236
|
+
*/
|
|
237
|
+
async deleteApplicationRaw(requestParameters, initOverrides) {
|
|
238
|
+
if (requestParameters['applicationId'] == null) {
|
|
239
|
+
throw new runtime.RequiredError('applicationId', 'Required parameter "applicationId" was null or undefined when calling deleteApplication().');
|
|
240
|
+
}
|
|
241
|
+
const queryParameters = {};
|
|
242
|
+
const headerParameters = {};
|
|
243
|
+
let urlPath = `/applications/{applicationId}`;
|
|
244
|
+
urlPath = urlPath.replace(`{${"applicationId"}}`, encodeURIComponent(String(requestParameters['applicationId'])));
|
|
245
|
+
const response = await this.request({
|
|
246
|
+
path: urlPath,
|
|
247
|
+
method: 'DELETE',
|
|
248
|
+
headers: headerParameters,
|
|
249
|
+
query: queryParameters,
|
|
250
|
+
}, initOverrides);
|
|
251
|
+
return new runtime.VoidApiResponse(response);
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Delete an application belonging to the authenticated account
|
|
255
|
+
* Delete an application
|
|
256
|
+
*/
|
|
257
|
+
async deleteApplication(requestParameters, initOverrides) {
|
|
258
|
+
await this.deleteApplicationRaw(requestParameters, initOverrides);
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Delete a pdf template
|
|
262
|
+
* Delete a pdf template
|
|
263
|
+
*/
|
|
264
|
+
async deletePDFTemplateRaw(requestParameters, initOverrides) {
|
|
265
|
+
if (requestParameters['id'] == null) {
|
|
266
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deletePDFTemplate().');
|
|
267
|
+
}
|
|
268
|
+
if (requestParameters['applicationId'] == null) {
|
|
269
|
+
throw new runtime.RequiredError('applicationId', 'Required parameter "applicationId" was null or undefined when calling deletePDFTemplate().');
|
|
270
|
+
}
|
|
271
|
+
const queryParameters = {};
|
|
272
|
+
const headerParameters = {};
|
|
273
|
+
let urlPath = `/applications/{applicationId}/pdf-templates/{id}`;
|
|
274
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
275
|
+
urlPath = urlPath.replace(`{${"applicationId"}}`, encodeURIComponent(String(requestParameters['applicationId'])));
|
|
276
|
+
const response = await this.request({
|
|
277
|
+
path: urlPath,
|
|
278
|
+
method: 'DELETE',
|
|
279
|
+
headers: headerParameters,
|
|
280
|
+
query: queryParameters,
|
|
281
|
+
}, initOverrides);
|
|
282
|
+
return new runtime.VoidApiResponse(response);
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Delete a pdf template
|
|
286
|
+
* Delete a pdf template
|
|
287
|
+
*/
|
|
288
|
+
async deletePDFTemplate(requestParameters, initOverrides) {
|
|
289
|
+
await this.deletePDFTemplateRaw(requestParameters, initOverrides);
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Get a specific application belonging to the authenticated account
|
|
293
|
+
* Get an application by applicationId
|
|
294
|
+
*/
|
|
295
|
+
async getApplicationByIDRaw(requestParameters, initOverrides) {
|
|
296
|
+
if (requestParameters['applicationId'] == null) {
|
|
297
|
+
throw new runtime.RequiredError('applicationId', 'Required parameter "applicationId" was null or undefined when calling getApplicationByID().');
|
|
298
|
+
}
|
|
299
|
+
const queryParameters = {};
|
|
300
|
+
const headerParameters = {};
|
|
301
|
+
let urlPath = `/applications/{applicationId}`;
|
|
302
|
+
urlPath = urlPath.replace(`{${"applicationId"}}`, encodeURIComponent(String(requestParameters['applicationId'])));
|
|
303
|
+
const response = await this.request({
|
|
304
|
+
path: urlPath,
|
|
305
|
+
method: 'GET',
|
|
306
|
+
headers: headerParameters,
|
|
307
|
+
query: queryParameters,
|
|
308
|
+
}, initOverrides);
|
|
309
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ApplicationDTOFromJSON)(jsonValue));
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Get a specific application belonging to the authenticated account
|
|
313
|
+
* Get an application by applicationId
|
|
314
|
+
*/
|
|
315
|
+
async getApplicationByID(requestParameters, initOverrides) {
|
|
316
|
+
const response = await this.getApplicationByIDRaw(requestParameters, initOverrides);
|
|
317
|
+
return await response.value();
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Get all applications belonging to the authenticated account
|
|
321
|
+
* Get all applications for the account
|
|
322
|
+
*/
|
|
323
|
+
async getApplicationsRaw(requestParameters, initOverrides) {
|
|
324
|
+
const queryParameters = {};
|
|
325
|
+
if (requestParameters['page'] != null) {
|
|
326
|
+
queryParameters['page'] = requestParameters['page'];
|
|
327
|
+
}
|
|
328
|
+
if (requestParameters['pageSize'] != null) {
|
|
329
|
+
queryParameters['pageSize'] = requestParameters['pageSize'];
|
|
330
|
+
}
|
|
331
|
+
const headerParameters = {};
|
|
332
|
+
let urlPath = `/applications`;
|
|
333
|
+
const response = await this.request({
|
|
334
|
+
path: urlPath,
|
|
335
|
+
method: 'GET',
|
|
336
|
+
headers: headerParameters,
|
|
337
|
+
query: queryParameters,
|
|
338
|
+
}, initOverrides);
|
|
339
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedApplicationsDTOFromJSON)(jsonValue));
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Get all applications belonging to the authenticated account
|
|
343
|
+
* Get all applications for the account
|
|
344
|
+
*/
|
|
345
|
+
async getApplications(requestParameters = {}, initOverrides) {
|
|
346
|
+
const response = await this.getApplicationsRaw(requestParameters, initOverrides);
|
|
347
|
+
return await response.value();
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Get template by id
|
|
351
|
+
* Get template by id
|
|
352
|
+
*/
|
|
353
|
+
async getPdfTemplateRaw(requestParameters, initOverrides) {
|
|
354
|
+
if (requestParameters['id'] == null) {
|
|
355
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getPdfTemplate().');
|
|
356
|
+
}
|
|
357
|
+
if (requestParameters['applicationId'] == null) {
|
|
358
|
+
throw new runtime.RequiredError('applicationId', 'Required parameter "applicationId" was null or undefined when calling getPdfTemplate().');
|
|
359
|
+
}
|
|
360
|
+
const queryParameters = {};
|
|
361
|
+
const headerParameters = {};
|
|
362
|
+
let urlPath = `/applications/{applicationId}/pdf-templates/{id}`;
|
|
363
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
364
|
+
urlPath = urlPath.replace(`{${"applicationId"}}`, encodeURIComponent(String(requestParameters['applicationId'])));
|
|
365
|
+
const response = await this.request({
|
|
366
|
+
path: urlPath,
|
|
367
|
+
method: 'GET',
|
|
368
|
+
headers: headerParameters,
|
|
369
|
+
query: queryParameters,
|
|
370
|
+
}, initOverrides);
|
|
371
|
+
if (this.isJsonMime(response.headers.get('content-type'))) {
|
|
372
|
+
return new runtime.JSONApiResponse(response);
|
|
373
|
+
}
|
|
374
|
+
else {
|
|
375
|
+
return new runtime.TextApiResponse(response);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Get template by id
|
|
380
|
+
* Get template by id
|
|
381
|
+
*/
|
|
382
|
+
async getPdfTemplate(requestParameters, initOverrides) {
|
|
383
|
+
const response = await this.getPdfTemplateRaw(requestParameters, initOverrides);
|
|
384
|
+
return await response.value();
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Get all templates
|
|
388
|
+
* Get all templates
|
|
389
|
+
*/
|
|
390
|
+
async getPdfTemplatesRaw(requestParameters, initOverrides) {
|
|
391
|
+
if (requestParameters['applicationId'] == null) {
|
|
392
|
+
throw new runtime.RequiredError('applicationId', 'Required parameter "applicationId" was null or undefined when calling getPdfTemplates().');
|
|
393
|
+
}
|
|
394
|
+
const queryParameters = {};
|
|
395
|
+
if (requestParameters['page'] != null) {
|
|
396
|
+
queryParameters['page'] = requestParameters['page'];
|
|
397
|
+
}
|
|
398
|
+
if (requestParameters['pageSize'] != null) {
|
|
399
|
+
queryParameters['pageSize'] = requestParameters['pageSize'];
|
|
400
|
+
}
|
|
401
|
+
const headerParameters = {};
|
|
402
|
+
let urlPath = `/applications/{applicationId}/pdf-templates`;
|
|
403
|
+
urlPath = urlPath.replace(`{${"applicationId"}}`, encodeURIComponent(String(requestParameters['applicationId'])));
|
|
404
|
+
const response = await this.request({
|
|
405
|
+
path: urlPath,
|
|
406
|
+
method: 'GET',
|
|
407
|
+
headers: headerParameters,
|
|
408
|
+
query: queryParameters,
|
|
409
|
+
}, initOverrides);
|
|
410
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.PdfTemplateDTOFromJSON));
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Get all templates
|
|
414
|
+
* Get all templates
|
|
415
|
+
*/
|
|
416
|
+
async getPdfTemplates(requestParameters, initOverrides) {
|
|
417
|
+
const response = await this.getPdfTemplatesRaw(requestParameters, initOverrides);
|
|
418
|
+
return await response.value();
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Update an application belonging to the authenticated account
|
|
422
|
+
* Update an application
|
|
423
|
+
*/
|
|
424
|
+
async updateApplicationRaw(requestParameters, initOverrides) {
|
|
425
|
+
if (requestParameters['applicationId'] == null) {
|
|
426
|
+
throw new runtime.RequiredError('applicationId', 'Required parameter "applicationId" was null or undefined when calling updateApplication().');
|
|
427
|
+
}
|
|
428
|
+
if (requestParameters['updateApplicationDTO'] == null) {
|
|
429
|
+
throw new runtime.RequiredError('updateApplicationDTO', 'Required parameter "updateApplicationDTO" was null or undefined when calling updateApplication().');
|
|
430
|
+
}
|
|
431
|
+
const queryParameters = {};
|
|
432
|
+
const headerParameters = {};
|
|
433
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
434
|
+
let urlPath = `/applications/{applicationId}`;
|
|
435
|
+
urlPath = urlPath.replace(`{${"applicationId"}}`, encodeURIComponent(String(requestParameters['applicationId'])));
|
|
436
|
+
const response = await this.request({
|
|
437
|
+
path: urlPath,
|
|
438
|
+
method: 'PATCH',
|
|
439
|
+
headers: headerParameters,
|
|
440
|
+
query: queryParameters,
|
|
441
|
+
body: (0, index_1.UpdateApplicationDTOToJSON)(requestParameters['updateApplicationDTO']),
|
|
442
|
+
}, initOverrides);
|
|
443
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ApplicationDTOFromJSON)(jsonValue));
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Update an application belonging to the authenticated account
|
|
447
|
+
* Update an application
|
|
448
|
+
*/
|
|
449
|
+
async updateApplication(requestParameters, initOverrides) {
|
|
450
|
+
const response = await this.updateApplicationRaw(requestParameters, initOverrides);
|
|
451
|
+
return await response.value();
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* Update template
|
|
455
|
+
* Update template
|
|
456
|
+
*/
|
|
457
|
+
async updatePdfTemplateRaw(requestParameters, initOverrides) {
|
|
458
|
+
if (requestParameters['applicationId'] == null) {
|
|
459
|
+
throw new runtime.RequiredError('applicationId', 'Required parameter "applicationId" was null or undefined when calling updatePdfTemplate().');
|
|
460
|
+
}
|
|
461
|
+
if (requestParameters['id'] == null) {
|
|
462
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling updatePdfTemplate().');
|
|
463
|
+
}
|
|
464
|
+
if (requestParameters['file'] == null) {
|
|
465
|
+
throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling updatePdfTemplate().');
|
|
466
|
+
}
|
|
467
|
+
if (requestParameters['name'] == null) {
|
|
468
|
+
throw new runtime.RequiredError('name', 'Required parameter "name" was null or undefined when calling updatePdfTemplate().');
|
|
469
|
+
}
|
|
470
|
+
const queryParameters = {};
|
|
471
|
+
const headerParameters = {};
|
|
472
|
+
const consumes = [
|
|
473
|
+
{ contentType: 'multipart/form-data' },
|
|
474
|
+
];
|
|
475
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
476
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
477
|
+
let formParams;
|
|
478
|
+
let useForm = false;
|
|
479
|
+
// use FormData to transmit files using content-type "multipart/form-data"
|
|
480
|
+
useForm = canConsumeForm;
|
|
481
|
+
if (useForm) {
|
|
482
|
+
formParams = new FormData();
|
|
483
|
+
}
|
|
484
|
+
else {
|
|
485
|
+
formParams = new URLSearchParams();
|
|
486
|
+
}
|
|
487
|
+
if (requestParameters['file'] != null) {
|
|
488
|
+
formParams.append('file', requestParameters['file']);
|
|
489
|
+
}
|
|
490
|
+
if (requestParameters['name'] != null) {
|
|
491
|
+
formParams.append('name', requestParameters['name']);
|
|
492
|
+
}
|
|
493
|
+
let urlPath = `/applications/{applicationId}/pdf-templates/{id}`;
|
|
494
|
+
urlPath = urlPath.replace(`{${"applicationId"}}`, encodeURIComponent(String(requestParameters['applicationId'])));
|
|
495
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
496
|
+
const response = await this.request({
|
|
497
|
+
path: urlPath,
|
|
498
|
+
method: 'PATCH',
|
|
499
|
+
headers: headerParameters,
|
|
500
|
+
query: queryParameters,
|
|
501
|
+
body: formParams,
|
|
502
|
+
}, initOverrides);
|
|
503
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PdfTemplateDTOFromJSON)(jsonValue));
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Update template
|
|
507
|
+
* Update template
|
|
508
|
+
*/
|
|
509
|
+
async updatePdfTemplate(requestParameters, initOverrides) {
|
|
510
|
+
const response = await this.updatePdfTemplateRaw(requestParameters, initOverrides);
|
|
511
|
+
return await response.value();
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* Upload template
|
|
515
|
+
* Upload template
|
|
516
|
+
*/
|
|
517
|
+
async uploadPdfTemplateRaw(requestParameters, initOverrides) {
|
|
518
|
+
if (requestParameters['applicationId'] == null) {
|
|
519
|
+
throw new runtime.RequiredError('applicationId', 'Required parameter "applicationId" was null or undefined when calling uploadPdfTemplate().');
|
|
520
|
+
}
|
|
521
|
+
if (requestParameters['file'] == null) {
|
|
522
|
+
throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling uploadPdfTemplate().');
|
|
523
|
+
}
|
|
524
|
+
if (requestParameters['name'] == null) {
|
|
525
|
+
throw new runtime.RequiredError('name', 'Required parameter "name" was null or undefined when calling uploadPdfTemplate().');
|
|
526
|
+
}
|
|
527
|
+
const queryParameters = {};
|
|
528
|
+
const headerParameters = {};
|
|
529
|
+
const consumes = [
|
|
530
|
+
{ contentType: 'multipart/form-data' },
|
|
531
|
+
];
|
|
532
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
533
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
534
|
+
let formParams;
|
|
535
|
+
let useForm = false;
|
|
536
|
+
// use FormData to transmit files using content-type "multipart/form-data"
|
|
537
|
+
useForm = canConsumeForm;
|
|
538
|
+
if (useForm) {
|
|
539
|
+
formParams = new FormData();
|
|
540
|
+
}
|
|
541
|
+
else {
|
|
542
|
+
formParams = new URLSearchParams();
|
|
543
|
+
}
|
|
544
|
+
if (requestParameters['file'] != null) {
|
|
545
|
+
formParams.append('file', requestParameters['file']);
|
|
546
|
+
}
|
|
547
|
+
if (requestParameters['name'] != null) {
|
|
548
|
+
formParams.append('name', requestParameters['name']);
|
|
549
|
+
}
|
|
550
|
+
let urlPath = `/applications/{applicationId}/pdf-templates`;
|
|
551
|
+
urlPath = urlPath.replace(`{${"applicationId"}}`, encodeURIComponent(String(requestParameters['applicationId'])));
|
|
552
|
+
const response = await this.request({
|
|
553
|
+
path: urlPath,
|
|
554
|
+
method: 'POST',
|
|
555
|
+
headers: headerParameters,
|
|
556
|
+
query: queryParameters,
|
|
557
|
+
body: formParams,
|
|
558
|
+
}, initOverrides);
|
|
559
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PdfTemplateDTOFromJSON)(jsonValue));
|
|
560
|
+
}
|
|
561
|
+
/**
|
|
562
|
+
* Upload template
|
|
563
|
+
* Upload template
|
|
564
|
+
*/
|
|
565
|
+
async uploadPdfTemplate(requestParameters, initOverrides) {
|
|
566
|
+
const response = await this.uploadPdfTemplateRaw(requestParameters, initOverrides);
|
|
567
|
+
return await response.value();
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
exports.ClientApi = ClientApi;
|
|
571
|
+
//# sourceMappingURL=ClientApi.js.map
|